import{az as M,aA as h,c as f,aB as x,aC as v,d as g,u as p,Q as Z,M as L,aD as w,aE as z}from"./CmTSwR0m.js";const N=Object.freeze({left:0,top:0,width:16,height:16}),I=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),S=Object.freeze({...N,...I});Object.freeze({...S,body:"",hidden:!1});function V(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}const H=/(-?[0-9.]*[0-9]+[0-9.]*)/g,$=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function q(e,t,n){if(t===1)return e;n=n||100;const r=e.split(H);if(r===null||!r.length)return e;const C=[];let s=r.shift(),c=$.test(s);for(;;){if(c){const o=parseFloat(s);isNaN(o)?C.push(s):C.push(Math.ceil(o*t*n)/n)}else C.push(s);if(s=r.shift(),s===void 0)return C.join("");c=!c}}function R(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function A(e){return"data:image/svg+xml,"+R(e)}function P(e){return'url("'+A(e)+'")'}function T(e){if(e.width!==e.height){const t=Math.max(e.width,e.height);return{...e,width:t,height:t,left:e.left-(t-e.width)/2,top:e.top-(t-e.height)/2}}return e}function j(e){const t={display:"inline-block",width:"1em",height:"1em"},n=e.varName;switch(e.pseudoSelector&&(t.content="''"),e.mode){case"background":n&&(t["background-image"]="var(--"+n+")"),t["background-repeat"]="no-repeat",t["background-size"]="100% 100%";break;case"mask":t["background-color"]="currentColor",n&&(t["mask-image"]=t["-webkit-mask-image"]="var(--"+n+")"),t["mask-repeat"]=t["-webkit-mask-repeat"]="no-repeat",t["mask-size"]=t["-webkit-mask-size"]="100% 100%";break}return t}function O(e,t){const n={},r=t.varName;e.width!==e.height&&(t.forceSquare?e=T(e):n.width=q("1em",e.width/e.height));const C=V(e.body.replace(/currentColor/g,t.color||"black"),{viewBox:`${e.left} ${e.top} ${e.width} ${e.height}`,width:e.width.toString(),height:e.height.toString()}),s=P(C);if(r)n["--"+r]=s;else switch(t.mode){case"background":n["background-image"]=s;break;case"mask":n["mask-image"]=n["-webkit-mask-image"]=s;break}return n}const m={selectorStart:{compressed:"{",compact:" {",expanded:" {"},selectorEnd:{compressed:"}",compact:`; } `,expanded:`; } `},rule:{compressed:"{key}:",compact:" {key}: ",expanded:` {key}: `}};function F(e,t="expanded"){const n=[];for(let r=0;r`},balanced:{width:12,height:14,body:``},extreme:{width:11,height:14,body:``},midspeed:{width:12,height:12,body:``},speed:{width:14,height:14,body:``},tech:{width:14,height:14,body:``},tiebreaker:{width:13,height:14,body:` `}}}];for(const t of e)M(t);y=!0}async function _(e){return e?(k(),await new Promise(t=>x([e],()=>t(!0))).catch(()=>null),v(e)):null}function b(e){const t=h().icon,n=(t.collections||[]).sort((r,C)=>C.length-r.length);return f(()=>{var c;const r=e(),C=r.startsWith(t.cssSelectorPrefix)?r.slice(t.cssSelectorPrefix.length):r,s=((c=t.aliases)==null?void 0:c[C])||C;if(!s.includes(":")){const o=n.find(l=>s.startsWith(l+"-"));return o?o+":"+s.slice(o.length+1):s}return s})}let d;function W(e){return e.replace(/([^\w-])/g,"\\$1")}function B(){if(d)return d;d=new Set;const e=n=>{if(n=n.replace(/^:where\((.*)\)$/,"$1").trim(),n.startsWith("."))return n},t=n=>{if(n!=null&&n.length)for(const r of n){r!=null&&r.cssRules&&t(r.cssRules);const C=r==null?void 0:r.selectorText;if(typeof C=="string"){const s=e(C);s&&d.add(s)}}};for(const n of document.styleSheets)try{const r=n.cssRules||n.rules;t(r)}catch{}return d}const D=g({name:"NuxtIconCss",props:{name:{type:String,required:!0},customize:{type:Function,required:!1}},async setup(e){const t=p(),n=h().icon,r=f(()=>e.name?n.cssSelectorPrefix+e.name:"");function C(o){var i,u;if(!o)return;const l=v(o);if(l)return l;const a=(u=(i=t.payload)==null?void 0:i.data)==null?void 0:u[o];if(a)return w(o,a),a}const s=f(()=>"."+W(r.value));function c(o,l=!0){let a=s.value;n.cssWherePseudo&&(a=`:where(${a})`);const i=E(o,{iconSelector:a,format:"compressed",customise:e.customize});return n.cssLayer&&l?`@layer ${n.cssLayer} { ${i} }`:i}{const o=B();async function l(a){if(o.has(s.value))return;const i=document.createElement("style");i.textContent=c(a);const u=document.head.querySelector('style, link[rel="stylesheet"]');u?document.head.insertBefore(i,u):document.head.appendChild(i),o.add(s.value)}Z(()=>e.name,()=>{if(o.has(s.value))return;const a=C(e.name);a?l(a):_(e.name).then(i=>{i&&l(i)})},{immediate:!0})}return()=>L("span",{class:["iconify",r.value,n.class]})}}),U=g({name:"NuxtIconSvg",props:{name:{type:String,required:!0},customize:{type:Function,required:!1}},async setup(e,{slots:t}){const n=p(),r=h().icon,C=b(()=>e.name),s="i-"+C.value;if(C.value){const c=n.payload.data[s];c?w(C.value,c):k()}return()=>L(z,{icon:C.value,ssr:!0,class:r.class,customise:e.customize},t)}}),K=g({name:"NuxtIcon",props:{name:{type:String,required:!0},mode:{type:String,required:!1,default:null},size:{type:[Number,String],required:!1,default:null},customize:{type:Function,required:!1}},async setup(e,{slots:t}){const n=p(),r=h().icon,C=b(()=>e.name),s=f(()=>{var l;return((l=n.vueApp)==null?void 0:l.component(C.value))||((e.mode||r.mode)==="svg"?U:D)}),c=f(()=>{const l=e.size||r.size;return l?{fontSize:Number.isNaN(+l)?l:l+"px"}:null}),o=e.customize||r.customize;return()=>L(s.value,{...r.attrs,name:C.value,class:r.class,style:c.value,customize:o},t)}});export{K as default};