"use strict";const t=require("vue"),d=require("./constants.js"),h=require("./_plugin-vue_export-helper.js"),m='',v='',g='',f='',z='',M='',L='',y='',C='',k='',_='',H='',S='',w=m,x=v,B=g,E=f,V=z,D=M,F=L,A={langCodeMap:{ar:y},default:C},I={ltr:k,shouldFlip:!0},$={ltr:_,shouldFlip:!0},b=H,K=S;function q(e,o,n){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return n==="rtl"?e.rtl:e.ltr;const l=o in e.langCodeMap?e.langCodeMap[o]:e.default;return typeof l=="string"||"path"in l?l:l.ltr}function T(e,o){if(typeof e=="string")return!1;if("langCodeMap"in e){const n=o in e.langCodeMap?e.langCodeMap[o]:e.default;if(typeof n=="string")return!1;e=n}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const n=e.shouldFlipExceptions.indexOf(o);return n===void 0||n===-1}return"shouldFlip"in e?e.shouldFlip:!1}function u(e){const o=t.ref(null);return t.onMounted(()=>{const n=window.getComputedStyle(e.value).direction;o.value=n==="ltr"||n==="rtl"?n:null}),o}function Z(e){const o=t.ref("");return t.onMounted(()=>{let n=e.value;for(;n&&n.lang==="";)n=n.parentElement;o.value=n?n.lang:null}),o}const J=d.makeStringTypeValidator(d.IconSizes),O=t.defineComponent({name:"CdxIcon",props:{icon:{type:[String,Object],required:!0},iconLabel:{type:String,default:""},lang:{type:String,default:null},dir:{type:String,default:null},size:{type:String,default:"medium",validator:J}},setup(e){const o=t.ref(),n=u(o),l=Z(o),r=t.computed(()=>e.dir||n.value),i=t.computed(()=>e.lang||l.value),s=t.computed(()=>({"cdx-icon--flipped":r.value==="rtl"&&i.value!==null&&T(e.icon,i.value),["cdx-icon--".concat(e.size)]:!0})),a=t.computed(()=>q(e.icon,i.value||"",r.value||"ltr")),c=t.computed(()=>typeof a.value=="string"?a.value:""),p=t.computed(()=>typeof a.value!="string"?a.value.path:"");return{rootElement:o,rootClasses:s,iconSvg:c,iconPath:p}}});const P=["aria-hidden"],Q={key:0},j=["innerHTML"],N=["d"];function R(e,o,n,l,r,i){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses])},[(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":e.iconLabel?void 0:!0},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",Q,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,j)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,N))],8,P))],2)}const U=h._export_sfc(O,[["render",R]]);exports.CdxIcon=U;exports.D3=F;exports.D7=K;exports.J6=I;exports.K3=A;exports.K5=B;exports.Q5=E;exports.V7=b;exports.e3=V;exports.k5=x;exports.m5=w;exports.s7=$;exports.useComputedDirection=u;exports.z3=D;