// @bun
var{defineProperty:B,getOwnPropertyNames:D,getOwnPropertyDescriptor:m}=Object,j=Object.prototype.hasOwnProperty;function A(u){return this[u]}var y=(u)=>{var g=(U??=new WeakMap).get(u),b;if(g)return g;if(g=B({},"__esModule",{value:!0}),u&&typeof u==="object"||typeof u==="function"){for(var q of D(u))if(!j.call(g,q))B(g,q,{get:A.bind(u,q),enumerable:!(b=m(u,q))||b.enumerable})}return U.set(u,g),g},U;var R=(u)=>u;function _(u,g){this[u]=R.bind(null,g)}var N=(u,g)=>{for(var b in g)B(u,b,{get:g[b],enumerable:!0,configurable:!0,set:_.bind(g,b)})};var v=(u,g)=>()=>(u&&(g=u(u=0)),g);var V=import.meta.require;function M(u){return u.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var n={};N(n,{preloadIconCollection:()=>P,IconBuiltin:()=>h});import{existsSync as k,readFileSync as d}from"fs";function W(u){try{return V.resolve(`@iconify/json/json/${u}.json`)}catch{}let g=process.cwd();for(let b of[`${g}/node_modules/@iconify/json/json/${u}.json`,`${g}/pantry/@iconify/json/json/${u}.json`])if(k(b))return b;return null}function w(u){if(E.has(u))return E.get(u);let g=W(u);if(!g)return null;try{let b=JSON.parse(d(g,"utf8"));return E.set(u,b.icons),b.icons}catch{return null}}async function C(u){if(E.has(u))return E.get(u);let g=W(u);if(!g)return null;try{let b=await Bun.file(g).json();return E.set(u,b.icons),b.icons}catch{return null}}function H(u,g){if(u.serverDynamic[g]!==void 0)return String(u.serverDynamic[g]);if(u.static[g]!==void 0)return String(u.static[g]);if(u.clientReactive[g]!==void 0)return u.clientReactive[g];return}async function P(u="lucide"){await C(u)}var E,h;var f=v(()=>{E=new Map;h={name:"Icon",aliases:["icon","stx-icon"],render(u,g,b){let q=H(u,"name")??H(u,"icon");if(!q)return"<!-- Icon: missing name/icon prop -->";let L="lucide",T=q;if(q.includes(":")){let Q=q.split(":");L=Q[0],T=Q[1]}let G=M(H(u,"size")||"24"),I=M(H(u,"color")||"currentColor"),J=M(H(u,"class")||""),K=M(H(u,"style")||""),O=E.get(L)??w(L);if(!O)return`<!-- Icon: collection "${L}" not loaded -->`;let S=O[T];if(!S)return`<!-- Icon: "${T}" not found in ${L} -->`;let Y=S.width||24,Z=S.height||24,$=`0 0 ${Y} ${Z}`,X=S.body;if(I!=="currentColor")X=X.replace(/currentColor/g,I);let F=J?` class="${J}"`:"",z=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${$}" fill="none"${F}${z}>${X}</svg>`}}});f();export{P as preloadIconCollection,h as IconBuiltin};
