@stacksjs/stx 0.2.744 → 0.2.746
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtins/icon.d.ts +35 -1
- package/dist/builtins/icon.js +39 -8
- package/dist/{chunk-mene2hv8.js → chunk-0nhb2nwp.js} +1 -1
- package/dist/{chunk-pgmkefnc.js → chunk-149yxrcj.js} +3 -3
- package/dist/{chunk-q4d49yg7.js → chunk-19ayktjy.js} +1 -1
- package/dist/{chunk-49x0spek.js → chunk-1v4w7ppq.js} +1 -1
- package/dist/{chunk-chss7tcr.js → chunk-1wke0qfq.js} +2 -2
- package/dist/{chunk-7q630cz3.js → chunk-1xen7nkk.js} +1 -1
- package/dist/{chunk-swf1qs3z.js → chunk-2g9eaq6p.js} +1 -1
- package/dist/{chunk-g0tfh66t.js → chunk-4rr35v4y.js} +4 -4
- package/dist/{chunk-806jkdzv.js → chunk-57tpkrm5.js} +1 -1
- package/dist/{chunk-ptrme33w.js → chunk-5nqhfdj6.js} +1 -1
- package/dist/{chunk-hatn4c85.js → chunk-5spasxv7.js} +1 -1
- package/dist/chunk-6662t3bx.js +2 -0
- package/dist/{chunk-mzchr2vt.js → chunk-6mnebk49.js} +1 -1
- package/dist/chunk-79ch0r9x.js +2 -0
- package/dist/chunk-7vy02dt0.js +2 -0
- package/dist/{chunk-q53eg32x.js → chunk-7w7f14jq.js} +1 -1
- package/dist/{chunk-rm8nt1gr.js → chunk-8f14cgm8.js} +1 -1
- package/dist/{chunk-kq90gp4a.js → chunk-8fcne6ar.js} +1 -1
- package/dist/{chunk-g89gmt74.js → chunk-8zapr6yt.js} +1 -1
- package/dist/chunk-91pa4mt8.js +2 -0
- package/dist/{chunk-809kkqny.js → chunk-9p99v0vr.js} +2 -2
- package/dist/{chunk-n05sgshg.js → chunk-a46h84sz.js} +1 -1
- package/dist/{chunk-1rpntw1k.js → chunk-a6p51fpw.js} +1 -1
- package/dist/{chunk-qav71tr8.js → chunk-a7py2qd2.js} +6 -6
- package/dist/{chunk-ktxa9vx8.js → chunk-bgt7bwm0.js} +1 -1
- package/dist/{chunk-220pc67r.js → chunk-bj0z4gve.js} +1 -1
- package/dist/{chunk-0v9deafv.js → chunk-c8v5c5mz.js} +1 -1
- package/dist/{chunk-9r8ff53d.js → chunk-dxgvah9p.js} +3 -3
- package/dist/{chunk-eys9qtvt.js → chunk-dxsdr77m.js} +1 -1
- package/dist/{chunk-h6cxq0hn.js → chunk-dz2hn14j.js} +1 -1
- package/dist/{chunk-b1ft4znp.js → chunk-e7ke3rpn.js} +1 -1
- package/dist/{chunk-mwwnt27k.js → chunk-ed67z92f.js} +1 -1
- package/dist/chunk-eqbg3aj0.js +2 -0
- package/dist/{chunk-qxw5hr6e.js → chunk-evphmzyh.js} +1 -1
- package/dist/{chunk-wc23g6b4.js → chunk-evsbb3rc.js} +1 -1
- package/dist/{chunk-3zzgcvfc.js → chunk-f4y3h74q.js} +8 -8
- package/dist/{chunk-3ff1zbgf.js → chunk-f6gqf6v3.js} +2 -2
- package/dist/{chunk-e6527scq.js → chunk-fb6af3vk.js} +1 -1
- package/dist/chunk-gmp889v9.js +3 -0
- package/dist/chunk-h3gk6j59.js +2 -0
- package/dist/{chunk-493wjn21.js → chunk-hfryhf26.js} +1 -1
- package/dist/chunk-hqfd6mmq.js +2 -0
- package/dist/chunk-hrd0qhj0.js +2 -0
- package/dist/chunk-j5dzthxj.js +2 -0
- package/dist/{chunk-v3hxq6k0.js → chunk-kkmayabs.js} +5 -5
- package/dist/chunk-m2b0nwgp.js +2 -0
- package/dist/{chunk-pc8cb5q8.js → chunk-m7jq3907.js} +1 -1
- package/dist/{chunk-s52ny7da.js → chunk-mhn18833.js} +1 -1
- package/dist/{chunk-bq974x5d.js → chunk-n8txdhez.js} +1 -1
- package/dist/chunk-q1wk9j3s.js +2 -0
- package/dist/{chunk-qr0hy556.js → chunk-qx04cejf.js} +1 -1
- package/dist/{chunk-9d4anhh8.js → chunk-rfa9rz3g.js} +6 -6
- package/dist/{chunk-7fnkqpkh.js → chunk-s8gc1h8e.js} +1 -1
- package/dist/chunk-t0myqe0n.js +2 -0
- package/dist/{chunk-54t61ech.js → chunk-t7nw25st.js} +2 -2
- package/dist/chunk-vtjtz685.js +2 -0
- package/dist/{chunk-6m6p1pvr.js → chunk-wds7pewp.js} +1 -1
- package/dist/{chunk-shf75rrg.js → chunk-wpwh529h.js} +26 -26
- package/dist/{chunk-kjva91by.js → chunk-wwd61ewe.js} +1 -1
- package/dist/{chunk-jb39s79f.js → chunk-xc907jck.js} +1 -1
- package/dist/chunk-xgfetnnc.js +2 -0
- package/dist/{chunk-vc5kdzvy.js → chunk-xzsvx81w.js} +4 -4
- package/dist/{chunk-4j0brfek.js → chunk-y8ws4501.js} +1 -1
- package/dist/{chunk-mzryggpk.js → chunk-ygs7ersb.js} +1 -1
- package/dist/chunk-yjdp76hr.js +2 -0
- package/dist/{chunk-87n3hr89.js → chunk-ykjx8zf0.js} +1 -1
- package/dist/{chunk-0rfgcsv1.js → chunk-yvbqhm47.js} +1 -1
- package/dist/chunk-z7g92wak.js +2 -0
- package/dist/{chunk-h26wgsbx.js → chunk-zswnmzsd.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/safe-evaluator.js +13 -2
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0pv0vtx4.js +0 -2
- package/dist/chunk-1j5sjqh6.js +0 -2
- package/dist/chunk-2f8ttc6h.js +0 -2
- package/dist/chunk-3sw3ekqc.js +0 -2
- package/dist/chunk-3sz24efq.js +0 -2
- package/dist/chunk-8dydc6f0.js +0 -2
- package/dist/chunk-c58rqhyz.js +0 -2
- package/dist/chunk-h3dr2826.js +0 -2
- package/dist/chunk-k5j1q8we.js +0 -2
- package/dist/chunk-m1n3jxkd.js +0 -2
- package/dist/chunk-nee03ys0.js +0 -3
- package/dist/chunk-q53kc812.js +0 -2
- package/dist/chunk-qzfxasdd.js +0 -2
- package/dist/chunk-stmtvwry.js +0 -2
- package/dist/chunk-wh8rhad0.js +0 -2
- package/dist/chunk-xkpa06r2.js +0 -2
- package/dist/chunk-xsmj68pc.js +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Yc,Zc}from"./chunk-27agaezn.js";import{H,ks,_s,Cs,qo,Ko,mr,Oe,pe,X,Ts,ie,J,I,tt,yr,Yo,wr,Be,r,p,V,yn}from"./chunk-9d4anhh8.js";import{f,R,nt,d}from"./chunk-shf75rrg.js";import{n}from"./chunk-nee03ys0.js";import{se}from"./chunk-220pc67r.js";import{s}from"./chunk-q1db41k8.js";import{g}from"./chunk-0dve54ne.js";import{createHash as Ct}from"crypto";import ee from"fs";import Q from"path";import{decode as sn,generateThumbHash as on}from"ts-images";import{createImageDeliveryCatalog as yt}from"ts-images/delivery";import De from"fs";function Ce(e,t,i){let o=Buffer.alloc(i),a=De.readSync(e,o,0,i,t);return o.subarray(0,a)}function je(e){if(e.length<25)return!1;let t=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(t(0,4)!=="RIFF"||t(8,12)!=="WEBP")return!1;let i=t(12,16);if(i==="VP8X")return(e[20]&16)!==0;if(i==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Me(e){let t;try{t=De.openSync(e,"r");let i=Ce(t,0,33);if(i.length>=3&&i[0]===255&&i[1]===216&&i[2]===255)return"none";if(i.length>=26&&i[0]===137&&i.toString("latin1",1,4)==="PNG"){let o=i[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(t,a,8);if(l.length<8)return"unknown";let m=l.toString("latin1",4,8);if(m==="tRNS")return"possible";if(m==="IDAT"||m==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(i.length>=25&&i.toString("latin1",0,4)==="RIFF"&&i.toString("latin1",8,12)==="WEBP"){if(je(i))return"possible";let o=i.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(t!==void 0)De.closeSync(t)}}import Jt from"fs";import Re from"os";import{join as dt}from"path";import{fileURLToPath as gt}from"url";import{Worker as mt}from"worker_threads";var ke=Symbol("stx.image-worker.unavailable");function Yt(e=typeof Re.availableParallelism==="function"?Re.availableParallelism():Re.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,ht=[];async function Qt(){if(Ae<Yt()){Ae++;return}await new Promise((e)=>ht.push(e)),Ae++}function en(){Ae--,ht.shift()?.()}var tn="@stacksjs/stx/builtins/image-warmup-worker";function nn(e=process.cwd()){let t=import.meta.url.endsWith(".ts")?"ts":"js";try{let i=new URL(`./image-warmup-worker.${t}`,import.meta.url);if(i.protocol==="file:"&&Jt.existsSync(gt(i)))return gt(i)}catch{}try{let i=typeof Bun<"u"?Bun.resolveSync(tn,e):void 0;return i&&rn(i)?i:void 0}catch{return}}function rn(e,t=process.env){let i=e.replace(/\\/g,"/");if(i.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![t.BUN_INSTALL_CACHE_DIR,dt(t.BUN_INSTALL||dt(Re.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>i.startsWith(a))}var pt=!1;function me(e){if(!pt)pt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return ke}function Le(e){return e instanceof Error?e.message:String(e)}async function ze(e,t){if(typeof mt!=="function")return me("node:worker_threads has no Worker in this runtime");let i=nn();if(!i)return me("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await Qt();try{return await new Promise((o,a)=>{let c;try{c=new mt(i)}catch(y){o(me(`could not start ${i}: ${Le(y)}`));return}let l=!1,m=!1,u=(y)=>{if(m)return;m=!0,y(),c.terminate()};c.on("message",(y)=>{if(y.type==="ready"){l=!0,c.postMessage({task:e,args:t});return}if(y.type==="result"){u(()=>o(y.value));return}let w=Error(y.error?.message??"image worker failed");if(y.error?.name)w.name=y.error.name;if(y.error?.stack)w.stack=y.error.stack;u(()=>a(w))}),c.on("error",(y)=>{u(()=>l?a(y instanceof Error?y:Error(Le(y)||"image worker crashed")):o(me(`the worker failed before it was ready: ${Le(y)}`)))}),c.on("exit",(y)=>{u(()=>l?a(Error("image worker exited before it finished")):o(me(`the worker exited with code ${y} before it was ready`)))})})}finally{en()}}var an=new Set([".avif",".jpeg",".jpg",".png",".webp"]),cn=[320,640,960,1280,1920],he="/_stx/images",ln=`stx:${he}:alpha-1`,un=`stx:${he}:opaque-1`,fn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Pe;function dn(e,t){let i=Q.dirname(Bun.resolveSync(e,t));while(i!==Q.dirname(i)){let o=Q.join(i,"package.json");if(ee.existsSync(o)){let a=JSON.parse(ee.readFileSync(o,"utf8"));if(a.name===e)return a.version}i=Q.dirname(i)}return}function xt(){if(Pe!==void 0)return Pe;let e;try{e=Q.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Pe=fn.map((t)=>{let i;try{i=e?dn(t,e):void 0}catch{}return`${t.replace("@stacksjs/","")}@${i??"unknown"}`}).join("+"),Pe}var bt=Symbol.for("stx.image-delivery");function ye(){let e=globalThis;return e[bt]??={catalog:new Map,transparent:new Set},e[bt]}var vt=new Set;function gn(e){return`/${e.split(Q.sep).map(encodeURIComponent).join("/")}`}function mn(e){let t=Q.extname(e),i=e.slice(0,-t.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=Ct("sha256").update(e).digest("hex").slice(0,8);return`${i||"image"}-${o}`}function wt(e,t=`stx:${he}`){let i=(o)=>`${he}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:t,async stat(o){let a=Q.join(e,o);try{let c=await ee.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:i(o)}:null}catch{return null}},async write(o,a){let c=Q.join(e,o);await ee.promises.mkdir(Q.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await ee.promises.writeFile(l,a),await ee.promises.rename(l,c),{bytes:a.byteLength,path:c,url:i(o)}},url:i}}async function Rt(e,t=e){let i=await ee.promises.readdir(t,{withFileTypes:!0});i.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of i){let c=Q.join(t,a.name);if(a.isDirectory()){o.push(...await Rt(e,c));continue}if(!a.isFile()||!an.has(Q.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:Q.relative(e,c)})}return o}function $t(e,t){return e.map((i)=>({key:gn(i.relativePath),input:i.absolutePath,name:mn(i.relativePath),...pn(i.absolutePath)?{options:{storage:t}}:{}}))}function pn(e){return Me(e)==="possible"}function hn(e){for(let t=3;t<e.length;t+=4)if(e[t]!==255)return!0;return!1}async function xn(e){let t=Object.entries(e).filter(([,a])=>a.fallback.format==="png"),i=new Set,o=8;for(let a=0;a<t.length;a+=8)await Promise.all(t.slice(a,a+8).map(async([c,l])=>{let m=l.variants.filter((u)=>u.format==="png").sort((u,y)=>u.width-y.width)[0];try{let u=await sn(new Uint8Array(await ee.promises.readFile(m?.path??l.fallback.path)));if(hn(u.data))i.add(c)}catch{i.add(c)}}));return i}function bn(e,t){let i=[];for(let o of t){let a=e[o],c=a?.variants.filter((m)=>m.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((m)=>{let u;try{return u=ee.openSync(m.path,"r"),!je(Ce(u,0,32))}catch{return!0}finally{if(u!==void 0)ee.closeSync(u)}}))continue;if(a.variants=a.variants.filter((m)=>m.format!=="webp"),delete a.sources.webp,i.push(o),!vt.has(o))vt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return i}async function vn(e){let t=[],i=8;for(let o=0;o<e.length;o+=8){let a=e.slice(o,o+8),c=await Promise.all(a.map(async(l)=>{try{return await on(l.absolutePath),l}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${l.relativePath}`),null}}));t.push(...c.filter((l)=>l!==null))}return t}function Ue(e){return Q.join(e,"undecodable.json")}function wn(e){try{let t=ee.readFileSync(Ue(e),"utf-8"),i=JSON.parse(t);return i&&typeof i==="object"?i:{}}catch{return{}}}function $n(e,t){try{ee.mkdirSync(Q.dirname(Ue(e)),{recursive:!0}),ee.writeFileSync(Ue(e),JSON.stringify(t))}catch{}}function St(e){try{let t=ee.statSync(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}}function At(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let t=e.split(/[?#]/,1)[0];if(!t)return;try{return`/${t.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function _o(e){let t=At(e);return t?ye().catalog.get(t):void 0}function Co(e){let t=At(e);return t?ye().transparent.has(t):!1}function Eo(e){let t=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),i=t(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:t(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<i).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function nh(e){let t=_o(e);if(!t)return;return{src:t.fallback.url,srcset:t.sources[t.fallback.format]||"",sources:Eo(t).map(({format:i,srcset:o})=>({type:`image/${i}`,srcset:o})),width:t.source.width,height:t.source.height,placeholder:Co(e)?void 0:t.placeholder?.dataUrl}}function ts(){let e=ye();e.catalog=new Map,e.transparent=new Set}function Sn(e){let t=ye();t.catalog=new Map(e.entries),t.transparent=new Set(e.transparent)}async function rh(e,t,i={}){if(!e||!ee.existsSync(e))return ts(),{count:0,fingerprint:""};if(i.offThread){let h=await ze("delivery",{publicDir:e,outputDir:t});if(h!==ke)return Sn(h.state),h.result}let o=await Rt(e);if(o.length===0)return ts(),{count:0,fingerprint:""};let a=wn(t),c=o.filter((h)=>{let v=a[h.relativePath];if(!v)return!0;let S=St(h.absolutePath);return!S||S.mtimeMs!==v.mtimeMs||S.size!==v.size});if(c.length===0)return ts(),{count:0,fingerprint:""};let l=wt(Q.join(t,"_stx","images"),`${ln}:${xt()}`),m={outDir:Q.join(t,"_stx","images"),storage:wt(Q.join(t,"_stx","images"),`${un}:${xt()}`),baseUrl:he,widths:cn,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},u=c,y;try{y=await yt({...m,entries:$t(c,l)})}catch(h){if(u=await vn(c),u.length===c.length)throw h;let v=new Set(u.map((A)=>A.relativePath)),S=!1;for(let A of c){if(v.has(A.relativePath))continue;let P=St(A.absolutePath);if(!P)continue;a[A.relativePath]=P,S=!0}if(S)$n(t,a);if(u.length===0)return ts(),{count:0,fingerprint:""};y=await yt({...m,entries:$t(u,l)})}let w=await xn(y.entries),x=bn(y.entries,w),C=ye();C.catalog=new Map(Object.entries(y.entries)),C.transparent=w;let b=w.size===0&&x.length===0?y.fingerprint:Ct("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...w].sort(),droppedWebp:x.sort()})).digest("hex");return{count:u.length,fingerprint:b}}class kt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let t of e.aliases)this.builtins.set(t.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,t,i,o){let a=qo(e,o);if(a!==void 0)return a;for(let c of Ko(e,t,i,o))if(await r(c))return c;return null}}var le=new kt;var re="\x00stx-boolean-attribute";function We(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var Cn=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function Fe(e){let t=e.toLowerCase();return t.startsWith("aria-")||t.startsWith("data-")||Cn.has(t)}function oe(e,t){let i=[];for(let[o,a]of Object.entries(e.static)){if(t.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)i.push(p(c));continue}if(a===re){i.push(p(c));continue}i.push(`${p(c)}="${yn(c,We(String(a)))}"`)}return i}function ae(e,t){let i=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(t.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){i.push(p(c));continue}if(typeof a==="object")continue;i.push(`${p(c)}="${yn(c,We(String(a)))}"`)}return i}function Rn(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var He={name:"StxLink",aliases:["stx-link"],render(e,t,i){let o=Rn(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",m=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,u=[];if(o.reactive)u.push(`:href="${n(o.value)}"`);else u.push(`href="${n(mr(o.value,"navigable"))}"`);if(a)u.push(`class="${n(a)}"`);if(u.push("data-stx-link"),u.push(`data-stx-active-class="${n(c)}"`),u.push(`data-stx-exact-active-class="${n(l)}"`),m)u.push("data-stx-prefetch");let y=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(y)u.push(`data-stx-active-match="${n(y)}"`);let w=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return u.push(...oe(e,w)),u.push(...ae(e,w)),`<a ${u.join(" ")}>${t}</a>`}};var An=new Map;function qe(e){if(!e)return;let t=e.split("?")[0].split("#")[0];return An.get(t)}var kn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Xe=[320,640,768,1024,1280,1536,1920];function K(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function _e(e,t,i=!1){let o=e.serverDynamic[t];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[t];if(a!==void 0)return a!=="false"&&a!==!1;return i}function Ze(e){if(e.includes("(")||e.includes(","))return e;let t=e.trim().split(/\s+/),i=[];for(let o of t)if(o.includes(":")){let[a,c]=o.split(":"),l=kn[a];if(l)i.push(`(max-width: ${l}px) ${c}`);else{let m=Number.parseInt(a);if(!Number.isNaN(m))i.push(`(max-width: ${m}px) ${c}`)}}else i.push(o);return i.join(", ")}function Ve(e,t,i,o){return t.map((a)=>`${xe(e,a,void 0,i,o)} ${a}w`).join(", ")}function Pn(e,t,i,o,a){return t.map((c)=>{let l=i?i*c:void 0;return`${xe(e,l,void 0,o,a)} ${c}x`}).join(", ")}function xe(e,t,i,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(t)c.push(`w_${t}`);if(i)c.push(`h_${i}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(t)c.set("w",String(t));if(i)c.set("h",String(i));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(t)c.set("width",String(t));if(i)c.set("height",String(i));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function _n(e){return`var s=this.style;${e.map((t)=>`s.${t}=''`).join(";")}`}function In(e,t,i="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}"><rect width="100%" height="100%" fill="${i}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Ge={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,t,i){let o=K(e,"src")||"",a=_o(o),c=K(e,"alt")||"",l=K(e,"width")||(a?String(a.source.width):void 0),m=K(e,"height")||(a?String(a.source.height):void 0),u=K(e,"sizes"),y=K(e,"srcset"),w=K(e,"densities"),x=K(e,"format"),C=Co(o)||qe(o)?.transparent===!0,b=K(e,"placeholder")||(a&&!C?"thumbhash":void 0),h=K(e,"placeholderColor")||"#e5e7eb",v=K(e,"provider"),S=K(e,"class")||K(e,"className")||"",A=K(e,"style")||"",P=K(e,"objectFit")||K(e,"fit"),k=K(e,"objectPosition")||K(e,"position"),N=K(e,"quality"),U=_e(e,"lazy",!0),M=_e(e,"preload",!1),L=_e(e,"priority",!1),q=K(e,"loading"),O=K(e,"decoding")||"async",E=!!a||_e(e,"picture",!1)||!!x,B=l?Number.parseInt(l):void 0,T=m?Number.parseInt(m):void 0,z=y||"",G="";if(a)z=a.sources[a.fallback.format]||"",G=u?Ze(u):"100vw";else if(!z&&u&&v&&v!=="local"&&v!=="static")z=Ve(o,Xe,v,x),G=Ze(u);else if(!z&&w){let _=w.split(/\s+/).map((F)=>Number.parseFloat(F.replace("x","")));z=Pn(o,_,B,v,x)}else if(u)G=Ze(u);let j=[];if(A)j.push(A);if(P)j.push(`object-fit:${P}`);if(k)j.push(`object-position:${k}`);if(B&&T)j.push(`aspect-ratio:${B}/${T}`);let W=[],ce=b==="blur"||b==="color"||b==="thumbhash";if(ce&&!C){let _=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:h}:qe(o);if(_&&b==="color")j.push(`background-color:${_.color}`),W.push("backgroundColor");else if(_)j.push(`background-color:${_.color}`),j.push(`background-image:url(${_.dataUrl})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),W.push("backgroundColor","backgroundImage");else{let F=In(B||16,T||9,h);j.push(`background-image:url(${F})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),W.push("backgroundImage")}}else if(!ce&&b&&b!=="empty"&&b!=="none")j.push(`background-image:url(${n(b)})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),W.push("backgroundImage");let we=a?.fallback.url||xe(o,B,T,v,x),Y=[];if(Y.push(`src="${n(mr(we,"fetched"))}"`),Y.push(`alt="${n(c)}"`),l)Y.push(`width="${n(l)}"`);if(m)Y.push(`height="${n(m)}"`);let ne=q||(L||M?"eager":U?"lazy":"");if(ne)Y.push(`loading="${n(ne)}"`);if(L)Y.push('fetchpriority="high"');if(Y.push(`decoding="${n(O)}"`),S)Y.push(`class="${n(S)}"`);if(j.length>0)Y.push(`style="${n(j.join(";"))}"`);if(z)Y.push(`srcset="${n(mr(z,"fetched"))}"`);if(G)Y.push(`sizes="${n(G)}"`);let $e=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(W.length>0){let _=typeof e.static.onload==="string"?e.static.onload:"",F=_n(W)+(_?`;${_}`:"");Y.push(`onload="${n(F)}"`),$e.add("onload")}Y.push(...oe(e,$e)),Y.push(...ae(e,$e));let D=`<img ${Y.join(" ")} />`,Z="";if(M){let F=x==="webp"?"image/webp":x==="avif"?"image/avif":"";Z=`<link rel="preload" as="image" href="${n(we)}"${F?` type="${F}"`:""}${z?` imagesrcset="${n(z)}"`:""}${G?` imagesizes="${n(G)}"`:""} />
|
|
3
|
-
`}if(E){let _=[];if(a)for(let
|
|
2
|
+
import{Yc,Zc}from"./chunk-27agaezn.js";import{H,ks,_s,Cs,qo,Ko,mr,Oe,pe,X,Ts,ie,J,I,tt,yr,Yo,wr,Be,r,p,V,yn}from"./chunk-rfa9rz3g.js";import{f,R,nt,d}from"./chunk-wpwh529h.js";import{n}from"./chunk-gmp889v9.js";import{se}from"./chunk-bj0z4gve.js";import{s}from"./chunk-q1db41k8.js";import{g}from"./chunk-0dve54ne.js";import{createHash as Ct}from"crypto";import ee from"fs";import Q from"path";import{decode as sn,generateThumbHash as on}from"ts-images";import{createImageDeliveryCatalog as yt}from"ts-images/delivery";import De from"fs";function Ce(e,t,i){let o=Buffer.alloc(i),a=De.readSync(e,o,0,i,t);return o.subarray(0,a)}function je(e){if(e.length<25)return!1;let t=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(t(0,4)!=="RIFF"||t(8,12)!=="WEBP")return!1;let i=t(12,16);if(i==="VP8X")return(e[20]&16)!==0;if(i==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Me(e){let t;try{t=De.openSync(e,"r");let i=Ce(t,0,33);if(i.length>=3&&i[0]===255&&i[1]===216&&i[2]===255)return"none";if(i.length>=26&&i[0]===137&&i.toString("latin1",1,4)==="PNG"){let o=i[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(t,a,8);if(l.length<8)return"unknown";let m=l.toString("latin1",4,8);if(m==="tRNS")return"possible";if(m==="IDAT"||m==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(i.length>=25&&i.toString("latin1",0,4)==="RIFF"&&i.toString("latin1",8,12)==="WEBP"){if(je(i))return"possible";let o=i.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(t!==void 0)De.closeSync(t)}}import Jt from"fs";import Re from"os";import{join as dt}from"path";import{fileURLToPath as gt}from"url";import{Worker as pt}from"worker_threads";var ke=Symbol("stx.image-worker.unavailable");function Yt(e=typeof Re.availableParallelism==="function"?Re.availableParallelism():Re.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,ht=[];async function Qt(){if(Ae<Yt()){Ae++;return}await new Promise((e)=>ht.push(e)),Ae++}function en(){Ae--,ht.shift()?.()}var tn="@stacksjs/stx/builtins/image-warmup-worker";function nn(e=process.cwd()){let t=import.meta.url.endsWith(".ts")?"ts":"js";try{let i=new URL(`./image-warmup-worker.${t}`,import.meta.url);if(i.protocol==="file:"&&Jt.existsSync(gt(i)))return gt(i)}catch{}try{let i=typeof Bun<"u"?Bun.resolveSync(tn,e):void 0;return i&&rn(i)?i:void 0}catch{return}}function rn(e,t=process.env){let i=e.replace(/\\/g,"/");if(i.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![t.BUN_INSTALL_CACHE_DIR,dt(t.BUN_INSTALL||dt(Re.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>i.startsWith(a))}var mt=!1;function me(e){if(!mt)mt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return ke}function Le(e){return e instanceof Error?e.message:String(e)}async function ze(e,t){if(typeof pt!=="function")return me("node:worker_threads has no Worker in this runtime");let i=nn();if(!i)return me("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await Qt();try{return await new Promise((o,a)=>{let c;try{c=new pt(i)}catch(y){o(me(`could not start ${i}: ${Le(y)}`));return}let l=!1,m=!1,u=(y)=>{if(m)return;m=!0,y(),c.terminate()};c.on("message",(y)=>{if(y.type==="ready"){l=!0,c.postMessage({task:e,args:t});return}if(y.type==="result"){u(()=>o(y.value));return}let v=Error(y.error?.message??"image worker failed");if(y.error?.name)v.name=y.error.name;if(y.error?.stack)v.stack=y.error.stack;u(()=>a(v))}),c.on("error",(y)=>{u(()=>l?a(y instanceof Error?y:Error(Le(y)||"image worker crashed")):o(me(`the worker failed before it was ready: ${Le(y)}`)))}),c.on("exit",(y)=>{u(()=>l?a(Error("image worker exited before it finished")):o(me(`the worker exited with code ${y} before it was ready`)))})})}finally{en()}}var an=new Set([".avif",".jpeg",".jpg",".png",".webp"]),cn=[320,640,960,1280,1920],he="/_stx/images",ln=`stx:${he}:alpha-1`,un=`stx:${he}:opaque-1`,fn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Pe;function dn(e,t){let i=Q.dirname(Bun.resolveSync(e,t));while(i!==Q.dirname(i)){let o=Q.join(i,"package.json");if(ee.existsSync(o)){let a=JSON.parse(ee.readFileSync(o,"utf8"));if(a.name===e)return a.version}i=Q.dirname(i)}return}function bt(){if(Pe!==void 0)return Pe;let e;try{e=Q.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Pe=fn.map((t)=>{let i;try{i=e?dn(t,e):void 0}catch{}return`${t.replace("@stacksjs/","")}@${i??"unknown"}`}).join("+"),Pe}var xt=Symbol.for("stx.image-delivery");function ye(){let e=globalThis;return e[xt]??={catalog:new Map,transparent:new Set},e[xt]}var vt=new Set;function gn(e){return`/${e.split(Q.sep).map(encodeURIComponent).join("/")}`}function pn(e){let t=Q.extname(e),i=e.slice(0,-t.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=Ct("sha256").update(e).digest("hex").slice(0,8);return`${i||"image"}-${o}`}function wt(e,t=`stx:${he}`){let i=(o)=>`${he}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:t,async stat(o){let a=Q.join(e,o);try{let c=await ee.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:i(o)}:null}catch{return null}},async write(o,a){let c=Q.join(e,o);await ee.promises.mkdir(Q.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await ee.promises.writeFile(l,a),await ee.promises.rename(l,c),{bytes:a.byteLength,path:c,url:i(o)}},url:i}}async function Rt(e,t=e){let i=await ee.promises.readdir(t,{withFileTypes:!0});i.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of i){let c=Q.join(t,a.name);if(a.isDirectory()){o.push(...await Rt(e,c));continue}if(!a.isFile()||!an.has(Q.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:Q.relative(e,c)})}return o}function $t(e,t){return e.map((i)=>({key:gn(i.relativePath),input:i.absolutePath,name:pn(i.relativePath),...mn(i.absolutePath)?{options:{storage:t}}:{}}))}function mn(e){return Me(e)==="possible"}function hn(e){for(let t=3;t<e.length;t+=4)if(e[t]!==255)return!0;return!1}async function bn(e){let t=Object.entries(e).filter(([,a])=>a.fallback.format==="png"),i=new Set,o=8;for(let a=0;a<t.length;a+=8)await Promise.all(t.slice(a,a+8).map(async([c,l])=>{let m=l.variants.filter((u)=>u.format==="png").sort((u,y)=>u.width-y.width)[0];try{let u=await sn(new Uint8Array(await ee.promises.readFile(m?.path??l.fallback.path)));if(hn(u.data))i.add(c)}catch{i.add(c)}}));return i}function xn(e,t){let i=[];for(let o of t){let a=e[o],c=a?.variants.filter((m)=>m.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((m)=>{let u;try{return u=ee.openSync(m.path,"r"),!je(Ce(u,0,32))}catch{return!0}finally{if(u!==void 0)ee.closeSync(u)}}))continue;if(a.variants=a.variants.filter((m)=>m.format!=="webp"),delete a.sources.webp,i.push(o),!vt.has(o))vt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return i}async function vn(e){let t=[],i=8;for(let o=0;o<e.length;o+=8){let a=e.slice(o,o+8),c=await Promise.all(a.map(async(l)=>{try{return await on(l.absolutePath),l}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${l.relativePath}`),null}}));t.push(...c.filter((l)=>l!==null))}return t}function Ue(e){return Q.join(e,"undecodable.json")}function wn(e){try{let t=ee.readFileSync(Ue(e),"utf-8"),i=JSON.parse(t);return i&&typeof i==="object"?i:{}}catch{return{}}}function $n(e,t){try{ee.mkdirSync(Q.dirname(Ue(e)),{recursive:!0}),ee.writeFileSync(Ue(e),JSON.stringify(t))}catch{}}function St(e){try{let t=ee.statSync(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}}function At(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let t=e.split(/[?#]/,1)[0];if(!t)return;try{return`/${t.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function _o(e){let t=At(e);return t?ye().catalog.get(t):void 0}function Co(e){let t=At(e);return t?ye().transparent.has(t):!1}function Eo(e){let t=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),i=t(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:t(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<i).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function nh(e){let t=_o(e);if(!t)return;return{src:t.fallback.url,srcset:t.sources[t.fallback.format]||"",sources:Eo(t).map(({format:i,srcset:o})=>({type:`image/${i}`,srcset:o})),width:t.source.width,height:t.source.height,placeholder:Co(e)?void 0:t.placeholder?.dataUrl}}function ts(){let e=ye();e.catalog=new Map,e.transparent=new Set}function Sn(e){let t=ye();t.catalog=new Map(e.entries),t.transparent=new Set(e.transparent)}async function rh(e,t,i={}){if(!e||!ee.existsSync(e))return ts(),{count:0,fingerprint:""};if(i.offThread){let h=await ze("delivery",{publicDir:e,outputDir:t});if(h!==ke)return Sn(h.state),h.result}let o=await Rt(e);if(o.length===0)return ts(),{count:0,fingerprint:""};let a=wn(t),c=o.filter((h)=>{let w=a[h.relativePath];if(!w)return!0;let S=St(h.absolutePath);return!S||S.mtimeMs!==w.mtimeMs||S.size!==w.size});if(c.length===0)return ts(),{count:0,fingerprint:""};let l=wt(Q.join(t,"_stx","images"),`${ln}:${bt()}`),m={outDir:Q.join(t,"_stx","images"),storage:wt(Q.join(t,"_stx","images"),`${un}:${bt()}`),baseUrl:he,widths:cn,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},u=c,y;try{y=await yt({...m,entries:$t(c,l)})}catch(h){if(u=await vn(c),u.length===c.length)throw h;let w=new Set(u.map((A)=>A.relativePath)),S=!1;for(let A of c){if(w.has(A.relativePath))continue;let P=St(A.absolutePath);if(!P)continue;a[A.relativePath]=P,S=!0}if(S)$n(t,a);if(u.length===0)return ts(),{count:0,fingerprint:""};y=await yt({...m,entries:$t(u,l)})}let v=await bn(y.entries),b=xn(y.entries,v),C=ye();C.catalog=new Map(Object.entries(y.entries)),C.transparent=v;let x=v.size===0&&b.length===0?y.fingerprint:Ct("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...v].sort(),droppedWebp:b.sort()})).digest("hex");return{count:u.length,fingerprint:x}}class kt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let t of e.aliases)this.builtins.set(t.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,t,i,o){let a=qo(e,o);if(a!==void 0)return a;for(let c of Ko(e,t,i,o))if(await r(c))return c;return null}}var le=new kt;var re="\x00stx-boolean-attribute";function Fe(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var Cn=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function We(e){let t=e.toLowerCase();return t.startsWith("aria-")||t.startsWith("data-")||Cn.has(t)}function oe(e,t){let i=[];for(let[o,a]of Object.entries(e.static)){if(t.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)i.push(p(c));continue}if(a===re){i.push(p(c));continue}i.push(`${p(c)}="${yn(c,Fe(String(a)))}"`)}return i}function ae(e,t){let i=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(t.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){i.push(p(c));continue}if(typeof a==="object")continue;i.push(`${p(c)}="${yn(c,Fe(String(a)))}"`)}return i}function Rn(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var He={name:"StxLink",aliases:["stx-link"],render(e,t,i){let o=Rn(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",m=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,u=[];if(o.reactive)u.push(`:href="${n(o.value)}"`);else u.push(`href="${n(mr(o.value,"navigable"))}"`);if(a)u.push(`class="${n(a)}"`);if(u.push("data-stx-link"),u.push(`data-stx-active-class="${n(c)}"`),u.push(`data-stx-exact-active-class="${n(l)}"`),m)u.push("data-stx-prefetch");let y=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(y)u.push(`data-stx-active-match="${n(y)}"`);let v=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return u.push(...oe(e,v)),u.push(...ae(e,v)),`<a ${u.join(" ")}>${t}</a>`}};var An=new Map;function qe(e){if(!e)return;let t=e.split("?")[0].split("#")[0];return An.get(t)}var kn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Xe=[320,640,768,1024,1280,1536,1920];function K(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function Ie(e,t,i=!1){let o=e.serverDynamic[t];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[t];if(a!==void 0)return a!=="false"&&a!==!1;return i}function Ze(e){if(e.includes("(")||e.includes(","))return e;let t=e.trim().split(/\s+/),i=[];for(let o of t)if(o.includes(":")){let[a,c]=o.split(":"),l=kn[a];if(l)i.push(`(max-width: ${l}px) ${c}`);else{let m=Number.parseInt(a);if(!Number.isNaN(m))i.push(`(max-width: ${m}px) ${c}`)}}else i.push(o);return i.join(", ")}function Ve(e,t,i,o){return t.map((a)=>`${be(e,a,void 0,i,o)} ${a}w`).join(", ")}function Pn(e,t,i,o,a){return t.map((c)=>{let l=i?i*c:void 0;return`${be(e,l,void 0,o,a)} ${c}x`}).join(", ")}function be(e,t,i,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(t)c.push(`w_${t}`);if(i)c.push(`h_${i}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(t)c.set("w",String(t));if(i)c.set("h",String(i));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(t)c.set("width",String(t));if(i)c.set("height",String(i));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function In(e){return`var s=this.style;${e.map((t)=>`s.${t}=''`).join(";")}`}function _n(e,t,i="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}"><rect width="100%" height="100%" fill="${i}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Ge={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,t,i){let o=K(e,"src")||"",a=_o(o),c=K(e,"alt")||"",l=K(e,"width")||(a?String(a.source.width):void 0),m=K(e,"height")||(a?String(a.source.height):void 0),u=K(e,"sizes"),y=K(e,"srcset"),v=K(e,"densities"),b=K(e,"format"),C=Co(o)||qe(o)?.transparent===!0,x=K(e,"placeholder")||(a&&!C?"thumbhash":void 0),h=K(e,"placeholderColor")||"#e5e7eb",w=K(e,"provider"),S=K(e,"class")||K(e,"className")||"",A=K(e,"style")||"",P=K(e,"objectFit")||K(e,"fit"),k=K(e,"objectPosition")||K(e,"position"),N=K(e,"quality"),U=Ie(e,"lazy",!0),M=Ie(e,"preload",!1),L=Ie(e,"priority",!1),q=K(e,"loading"),O=K(e,"decoding")||"async",E=!!a||Ie(e,"picture",!1)||!!b,B=l?Number.parseInt(l):void 0,T=m?Number.parseInt(m):void 0,z=y||"",G="";if(a)z=a.sources[a.fallback.format]||"",G=u?Ze(u):"100vw";else if(!z&&u&&w&&w!=="local"&&w!=="static")z=Ve(o,Xe,w,b),G=Ze(u);else if(!z&&v){let _=v.split(/\s+/).map((W)=>Number.parseFloat(W.replace("x","")));z=Pn(o,_,B,w,b)}else if(u)G=Ze(u);let j=[];if(A)j.push(A);if(P)j.push(`object-fit:${P}`);if(k)j.push(`object-position:${k}`);if(B&&T)j.push(`aspect-ratio:${B}/${T}`);let F=[],ce=x==="blur"||x==="color"||x==="thumbhash";if(ce&&!C){let _=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:h}:qe(o);if(_&&x==="color")j.push(`background-color:${_.color}`),F.push("backgroundColor");else if(_)j.push(`background-color:${_.color}`),j.push(`background-image:url(${_.dataUrl})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),F.push("backgroundColor","backgroundImage");else{let W=_n(B||16,T||9,h);j.push(`background-image:url(${W})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),F.push("backgroundImage")}}else if(!ce&&x&&x!=="empty"&&x!=="none")j.push(`background-image:url(${n(x)})`),j.push("background-size:cover"),j.push("background-repeat:no-repeat"),F.push("backgroundImage");let we=a?.fallback.url||be(o,B,T,w,b),Y=[];if(Y.push(`src="${n(mr(we,"fetched"))}"`),Y.push(`alt="${n(c)}"`),l)Y.push(`width="${n(l)}"`);if(m)Y.push(`height="${n(m)}"`);let ne=q||(L||M?"eager":U?"lazy":"");if(ne)Y.push(`loading="${n(ne)}"`);if(L)Y.push('fetchpriority="high"');if(Y.push(`decoding="${n(O)}"`),S)Y.push(`class="${n(S)}"`);if(j.length>0)Y.push(`style="${n(j.join(";"))}"`);if(z)Y.push(`srcset="${n(mr(z,"fetched"))}"`);if(G)Y.push(`sizes="${n(G)}"`);let $e=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(F.length>0){let _=typeof e.static.onload==="string"?e.static.onload:"",W=In(F)+(_?`;${_}`:"");Y.push(`onload="${n(W)}"`),$e.add("onload")}Y.push(...oe(e,$e)),Y.push(...ae(e,$e));let D=`<img ${Y.join(" ")} />`,Z="";if(M){let W=b==="webp"?"image/webp":b==="avif"?"image/avif":"";Z=`<link rel="preload" as="image" href="${n(we)}"${W?` type="${W}"`:""}${z?` imagesrcset="${n(z)}"`:""}${G?` imagesizes="${n(G)}"`:""} />
|
|
3
|
+
`}if(E){let _=[];if(a)for(let W of Eo(a))_.push(`<source type="image/${W.format}" srcset="${n(W.srcset)}"${G?` sizes="${n(G)}"`:""} />`);if(!a&&(b==="avif"||b==="auto")){let W=be(o,B,T,w,"avif"),te=z?Ve(o,Xe,w,"avif"):`${W}`;_.push(`<source type="image/avif" srcset="${n(te)}"${G?` sizes="${n(G)}"`:""} />`)}if(!a&&(b==="webp"||b==="auto")){let W=be(o,B,T,w,"webp"),te=z?Ve(o,Xe,w,"webp"):`${W}`;_.push(`<source type="image/webp" srcset="${n(te)}"${G?` sizes="${n(G)}"`:""} />`)}return`${Z}<picture>
|
|
4
4
|
${_.join(`
|
|
5
5
|
`)}
|
|
6
6
|
${D}
|
|
7
|
-
</picture>`}return`${Z}${D}`}};var Pt="/images/safe-image-default.svg";function ue(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}var En=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${Pt}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,Ke={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,t,i){let o=ue(e,"src")||"",a=ue(e,"alt")||"",c=ue(e,"fallback")||Pt,l=ue(e,"class")||ue(e,"className")||"",m=ue(e,"fallbackClassName")||"",u=[];if(u.push(`src="${n(o)}"`),u.push(`alt="${n(a)}"`),l)u.push(`class="${n(l)}"`);if(u.push(`data-fallback="${n(c)}"`),m)u.push(`data-fallback-class="${n(m)}"`);u.push('onerror="window.__stxSafeImageHandler(this)"');let y=new Set(["src","alt","fallback","class","className","fallbackClassName"]);u.push(...oe(e,y)),u.push(...ae(e,y));let
|
|
7
|
+
</picture>`}return`${Z}${D}`}};var Pt="/images/safe-image-default.svg";function ue(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}var En=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${Pt}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,Ke={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,t,i){let o=ue(e,"src")||"",a=ue(e,"alt")||"",c=ue(e,"fallback")||Pt,l=ue(e,"class")||ue(e,"className")||"",m=ue(e,"fallbackClassName")||"",u=[];if(u.push(`src="${n(o)}"`),u.push(`alt="${n(a)}"`),l)u.push(`class="${n(l)}"`);if(u.push(`data-fallback="${n(c)}"`),m)u.push(`data-fallback-class="${n(m)}"`);u.push('onerror="window.__stxSafeImageHandler(this)"');let y=new Set(["src","alt","fallback","class","className","fallbackClassName"]);u.push(...oe(e,y)),u.push(...ae(e,y));let v=`<img ${u.join(" ")} />`,b=i.context;if(!b.__safeImageHandlerEmitted)return b.__safeImageHandlerEmitted=!0,`${En}${v}`;return v}};function Je(e){return e.replace(/[;{}()]/g,"").replace(/url/gi,"")}function xe(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function _e(e,t,i){let o=xe(e,t);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return i}var Ye={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render(e,t,i){let o=Je(xe(e,"color")||"#6366f1"),a=Je(xe(e,"initialColor")||xe(e,"initial-color")||""),c=Je(xe(e,"height")||"3px"),l=_e(e,"duration",2000),m=_e(e,"throttle",200),u=_e(e,"zIndex",999999)||_e(e,"z-index",999999),y=a?`linear-gradient(to right, ${a}, ${o})`:o;return`
|
|
8
8
|
<div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${c};background:${y};z-index:${u};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
|
|
9
9
|
<div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
|
|
10
10
|
</div>
|
|
11
11
|
<style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
|
|
12
12
|
<script>
|
|
13
13
|
(function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${m})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
|
|
14
|
-
</script>`}};function
|
|
14
|
+
</script>`}};function _t(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function Nn(e,t,i){let o=_t(e,t);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return i}var It={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},Qe={name:"StxToast",aliases:["stx-toast"],render(e,t,i){let o=n(_t(e,"position")||"top-right"),a=Nn(e,"max",5),c=It[o]||It["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${o}" data-stx-toast-max="${a}" style="position:fixed;${c};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
|
|
15
15
|
<style>
|
|
16
16
|
@keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
|
|
17
17
|
@keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
|
|
@@ -28,8 +28,8 @@ ${D}
|
|
|
28
28
|
@media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
|
|
29
29
|
.stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
|
|
30
30
|
.stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
|
|
31
|
-
</style>`}};function fe(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}var Nt={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},rt={name:"StxDrawer",aliases:["stx-drawer"],render(e,t,i){let o=fe(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=n(o),c=fe(e,"side")||"right",l=fe(e,"size")||"md",m=fe(e,"closeOnBackdrop")!=="false",u=fe(e,"closeOnEscape")!=="false",y=fe(e,"overlay")!=="false",
|
|
32
|
-
<div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${
|
|
31
|
+
</style>`}};function fe(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}var Nt={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},rt={name:"StxDrawer",aliases:["stx-drawer"],render(e,t,i){let o=fe(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=n(o),c=fe(e,"side")||"right",l=fe(e,"size")||"md",m=fe(e,"closeOnBackdrop")!=="false",u=fe(e,"closeOnEscape")!=="false",y=fe(e,"overlay")!=="false",v=Nt[l]||Nt.md,b=c==="left",C=b?"left:0":"right:0",x=b?"translateX(-100%)":"translateX(100%)",h=b?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${a}" class="stx-drawer-backdrop" data-stx-drawer="${a}" data-close-backdrop="${m}" data-close-escape="${u}" style="display:none;position:fixed;inset:0;z-index:99999;${y?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
|
|
32
|
+
<div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${v};max-width:100vw;transform:${x};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
|
|
33
33
|
<div style="padding:1.5rem">${t}</div>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
@@ -37,6 +37,6 @@ ${D}
|
|
|
37
37
|
@media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
|
|
38
38
|
.stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
|
|
39
39
|
.stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
|
|
40
|
-
</style>`}};import{existsSync as On,readFileSync as Bn}from"fs";var Ne=new Map,Ot=new Set;function Tn(e){if(Ot.has(e))return;Ot.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Dn(e){let t=process.cwd();for(let i of[`${t}/node_modules/@iconify-json/${e}/icons.json`,`${t}/pantry/@iconify-json/${e}/icons.json`,`${t}/node_modules/@iconify/json/json/${e}.json`,`${t}/pantry/@iconify/json/json/${e}.json`])if(On(i))return i;for(let i of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return g.resolve(i)}catch{}return null}function jn(e){if(Ne.has(e))return Ne.get(e);let t=Dn(e);if(!t)return Tn(e),null;try{let i=JSON.parse(Bn(t,"utf8"));return Ne.set(e,i.
|
|
41
|
-
`||O==="\t"){let E=Ln(e,L+S.length);if(e[E-1]!=="/")P++;k=E+1}else k=L+S.length}else{if(P--,P===0){N=q;break}k=q+A.length}}if(N===-1){a=b;continue}let U=e.slice(b,N),M=N+A.length;o.push({fullMatch:e.slice(l,M),tagName:y,attributes:v,content:U,startIndex:l,endIndex:M,isSelfClosing:!1}),a=M}}return o}function at(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/'/gi,"'").replace(/&/g,"&")}function Ut(e,t){try{let i=Buffer.from(e,"base64").toString("utf8");return JSON.parse(i)}catch{}try{let i=e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(i)}catch(i){if(t?.debug)console.error("Error decoding __stx_ prop:",i);return e}}function ct(e,t){let i=0,o="",a=t;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")i++;else if(c==="}"){if(i--,i===0)return e.slice(t,a+1)}a++}return e.slice(t)}function Wt(e){let t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;if(ct(t,0).length!==t.length)return null;return t.slice(1,-1).trim()}var zn=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Wn(e){return lt(e).map((t)=>[t.start,t.end])}function lt(e){let t=[],i=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,o;while((o=i.exec(e))!==null){let a=o[2]||"",c=/(?:^|\s)(?::for|x-for|v-for|@for)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/.exec(a);if(!c)continue;let l=J(c[1]??c[2]??c[3]??""),m=o.index,u=m+o[0].length,y=o[1].toLowerCase();if(o[0].endsWith("/>")||Un.has(y)){t.push({start:m,end:u,names:l});continue}let w=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=new RegExp(`<\\/?${w}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");x.lastIndex=u;let C=1,b=u,h;while((h=x.exec(e))!==null)if(h[0].startsWith("</")){if(C--,C===0){b=h.index+h[0].length;break}}else if(!h[0].endsWith("/>"))C++;t.push({start:m,end:b,names:l})}return t}function Ft(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((t)=>Ft(t)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,t])=>t).map(([t])=>t).join(" ");return e?String(e):""}function qa(e,t){if(!/:[\w-]+=/.test(e))return e;let i=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Wn(e));let l=new Set([...tt(t),...Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[]]);function m(C){return a.some(([b,h])=>C>=b&&C<h)}let u=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*?)\s*(\/?)>/g,y=[],w=new Map,x=256;while((c=u.exec(i))!==null){if(m(c.index))continue;let C=c[0],b=c[2];if(!b||!b.includes(":"))continue;let h=/(?:^|\s)data-native(?:\s|=|$)/i.test(b.replace(/"[^"]*"|'[^']*'/g,"")),v=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,S,A=b,P=!1;while((S=v.exec(b))!==null){if(Ts(b,S.index,!0)?.kind==="attribute")continue;let k=S[1],N=S[2];if(Yc(k))continue;if(I(N,l))continue;if(N.includes("()")&&!N.includes(".get(")||N.includes("$store")||N.includes("$ref"))continue;try{let U=Object.keys(t),M=Object.values(t),L=N.match(/^([a-zA-Z_$][\w$]*)/);if(L&&!U.includes(L[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(L[1]))continue;let q=JSON.stringify([U,N]),O=w.get(q);if(!O){if(O=Function(...U,`return (${N})`),w.size>=x)w.clear();w.set(q,O)}let E=O(...M);if(k==="class"){let B=V(Ft(E));if(B){let T=A.match(/\sclass="([^"]*)"/);if(T)A=A.replace(T[0],()=>` class="${T[1]} ${B}"`);else A=A.replace(S[0],()=>` class="${B}"`)}else A=A.replace(S[0],"");P=!0;continue}if(zn.has(k)){if(E)A=A.replace(S[0],` ${k}`);else A=A.replace(S[0],"");P=!0;continue}if(E===null||E===void 0||E===!1)A=A.replace(S[0],"");else{let B=h&&typeof E==="object"?JSON.stringify(E):String(E),T=yn(k,B);A=A.replace(S[0],()=>` ${k}="${T}"`)}P=!0}catch(U){if(U instanceof ie)throw U;continue}}if(P){let k=c[3]?" /":"",U=`<${c[1]}${A}${k}>`;y.push({start:c.index,end:c.index+C.length,replacement:U})}}if(y.length>0){let C=Array(y.length*2+1),b=0;for(let h=0;h<y.length;h++){let{start:v,end:S,replacement:A}=y[h];C[h*2]=i.slice(b,v),C[h*2+1]=A,b=S}C[y.length*2]=i.slice(b),i=C.join("")}return i}import Ht from"fs";import qt from"path";var Xt=!1;function Fn(e,t,i,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(t.__stx_client_signal_names)?t.__stx_client_signal_names:[]),m=(x)=>{if(l.size===0)return!1;let C=s(x),b=C.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(b&&l.has(b))return!0;for(let h of l){let v=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${v}\\s*\\(`).test(C))return!0}return!1},u=new Set(Zc),y=(x)=>{if(!x.includes("-")||x.startsWith("@")||x.startsWith(":")||x.startsWith("x-")||x.startsWith("__"))return x;if(x.startsWith("aria-")||x.startsWith("data-"))return x;return x.replace(/-([a-z0-9])/g,(C,b)=>b.toUpperCase())},w=(x,C)=>{let b=y(x);if(c.static[b]=C,b!==x)c.staticNames[b]=x};for(let[x,C]of Object.entries(e)){let b=x.startsWith("x-")&&!u.has(x)&&!x.startsWith("x-bind:")&&!x.startsWith("x-on:")?`:${x.slice(2)}`:x;if(b.startsWith("@")){c.events[b]=C;continue}if(b.startsWith("__stx_")){let h=y(b.slice(6));c.serverDynamic[h]=Ut(C,i);continue}if(b.startsWith(":")){let h=y(b.slice(1)),v=C===re?h:C;if(h==="if"||h==="for"||h==="show"){c.clientReactive[h]=v;continue}if(o){c.clientReactive[h]=v;continue}if(I(v,a)){c.clientReactive[h]=v;continue}if(m(v)){c.clientReactive[h]=v;continue}try{if(!f(v)){if(i.debug)console.error(`Unsafe expression in :${h} binding: ${v}`);c.clientReactive[h]=v;continue}let S=Object.keys(t),A=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),P=new Set(Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[]);if(nt(v).some((M)=>!A.has(M)&&!S.includes(M)&&(!(M in globalThis)||P.has(M)))){c.clientReactive[h]=v;continue}let U=d(v,S)(...Object.values(t));if(c.serverDynamic[h]=U,h!==b.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[h]=b.slice(1)}catch{c.clientReactive[h]=v}continue}if(typeof C==="string"&&C.includes("{{")&&C.includes("}}")){let h=Hn(C,a);if(h!==null){c.clientReactive[y(b)]=h;continue}let v=C.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(v)try{let S=v[1];if(f(S)){let P=d(S,Object.keys(t))(...Object.values(t));w(b,P!=null?String(P):"")}else{if(i.debug)console.error(`Unsafe expression in ${b}: ${S}`);w(b,C)}}catch(S){if(i.debug)console.error(`Error evaluating expression for ${b}:`,S);w(b,C)}else{let S=C,A=/\{\{\s*([\s\S]+?)\s*\}\}/g,P;while((P=A.exec(C))!==null)try{let k=P[1];if(!f(k)){if(i.debug)console.error(`Unsafe expression in ${b}: ${k}`);continue}let U=d(k,Object.keys(t))(...Object.values(t));S=S.replace(P[0],String(U??""))}catch(k){if(i.debug)console.error(`Error evaluating expression in ${b}:`,k)}w(b,S)}continue}w(b,C===re?"true":at(C))}return c}function Hn(e,t){if(t.size===0)return null;let i=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(i)];if(!o.some((m)=>I(m[1],t)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let m of o)c+=e.slice(l,m.index).replace(/[`\\$]/g,(u)=>`\\${u}`),c+=`\${${m[1]}}`,l=m.index+m[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(m)=>`\\${m}`),`\`${c}\``}var qn=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function Xn(e,t,i){if(!e.includes("@"))return e;if(!qn.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return se(e,t,i)}catch{return e}}function ge(e){let t={},i=0,o=e.length;while(i<o){while(i<o&&/\s/.test(e[i]))i++;if(i>=o)break;let a="";while(i<o&&!/[\s=]/.test(e[i]))a+=e[i],i++;if(!a)break;while(i<o&&/\s/.test(e[i]))i++;if(i<o&&e[i]==="="){i++;while(i<o&&/\s/.test(e[i]))i++;let c="";if(i<o&&(e[i]==='"'||e[i]==="'")){let l=e[i];i++;while(i<o){let m=e[i];if(m==="\\"&&i+1<o){i++,c+=e[i],i++;continue}if(m===l){i++;break}c+=m,i++}}else if(e[i]==="{"){c=ct(e,i),i+=c.length;let l=Wt(c);if(l!==null){t[`:${a}`]=l;continue}}else while(i<o&&!/\s/.test(e[i]))c+=e[i],i++;t[a]=c}else t[a]=re}return t}function Zt(e){return Object.entries(e).map(([t,i])=>i===re?t:`${t}="${Zn(i)}"`).join(" ")}function Zn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Vn(e){let t=new Set,i=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=i.exec(e))!==null){let a=o[1];if(le.isBuiltin(a))t.add(a)}return[...t].sort()}async function yf(e,t,i,o,a){if(!/import\s/.test(e))return e;if(!t.__importedComponents)t.__importedComponents=new Map;let c=t.__importedComponents,l=qt.dirname(i),m=[],u=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let x of e.matchAll(u)){let[C,b,h]=x,v=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,S=h,A,P=[];while((A=v.exec(h))!==null){let[k,N,U,M]=A,L=null,q=null;if(M.startsWith(".")||M.startsWith("/")){let B=qt.resolve(l,M);if(B.endsWith(".stx"))q=B;else{let T=`${B}.stx`;try{if(Ht.statSync(T).isFile())q=T}catch{try{if(Ht.statSync(B).isDirectory())L=B}catch{}}}}else L=_s(M,l);if(!L&&!q)continue;let O=!1,E=(B,T)=>{c.set(B,T),c.set(B.toLowerCase(),T);let z=B.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(z,T),a.add(T)};if(U&&q)E(U,q),O=!0;else if(N){let B=N.slice(1,-1).split(",").map((z)=>z.trim()).filter(Boolean).map((z)=>{let G=z.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(G)return{source:G[1],local:G[2]};return{source:z,local:z}}),T=L?ks(L):null;for(let{source:z,local:G}of B){let j=null;if(q)j=q;else if(T)j=T.get(z)??T.get(z.toLowerCase())??T.get(z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(j)E(G,j),O=!0}}if(O)P.push({start:A.index,end:A.index+k.length})}if(P.length===0)continue;for(let k=P.length-1;k>=0;k--)S=S.slice(0,P[k].start)+S.slice(P[k].end);m.push({start:x.index,end:x.index+C.length,value:`<script${b}>${S}</script>`})}if(m.length===0)return e;let y=[],w=0;for(let x of m)y.push(e.slice(w,x.start),x.value),w=x.end;return y.push(e.slice(w)),y.join("")}async function Gn(e,t,i,o,a){let c=e;if(!t.__importedComponents)t.__importedComponents=new Map;let l=t.__importedComponents,m=/@import\s*\(\s*([^)]+)\s*\)/g,u;while((u=m.exec(c))!==null){let[y,w]=u,x=w.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of x){let b=C.split("/"),v=b[b.length-1].replace(/\.stx$/,""),S=v.includes("-")?v.split("-").map((k)=>k.charAt(0).toUpperCase()+k.slice(1)).join(""):v.charAt(0).toUpperCase()+v.slice(1),A=null,P=Cs(C,i,o);for(let k of P)try{if(await Bun.file(k).exists()){A=k;break}}catch{}if(A){l.set(S,A),l.set(v,A),l.set(v.toLowerCase(),A);let k=S.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(k,A),a.add(A),o.debug)console.log(`Imported component: ${S} -> ${A}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(y,""),m.lastIndex=0}return c}async function Kn(e,t,i,o,a){let c=e,l=o.componentsDir||"components";if(!t.__processedComponents)t.__processedComponents=new Set;let m=t.__processedComponents,u=/@component\s*\(/g,y;while((y=u.exec(c))!==null){let w=y.index,x=w+y[0].length-1,C=1,b=x+1;while(b<c.length&&C>0){if(c[b]==="(")C++;else if(c[b]===")"){if(C--,C===0)break}b++}if(C!==0)break;let h=c.substring(x+1,b),v=b+1,S=h.match(/^\s*['"]([^'"]+)['"]/);if(!S){u.lastIndex=0;continue}let A=S[1],P,k=h.slice(S[0].length),N=k.match(/^\s*,\s*/);if(N)P=k.slice(N[0].length).trim();let U={};if(P)try{U=R(P,t)}catch(B){let T=B instanceof Error?B.message:String(B);c=c.replace(c.substring(w,v),`[Error parsing component props: ${T}]`);continue}let M="",L=v,O=c.substring(v).match(/^([\s\S]*?)@endcomponent/);if(O)M=O[1].trim(),L=v+O[0].length;let E=await Be(A,U,M,l,t,i,o,m,a);c=c.substring(0,w)+E+c.substring(L),u.lastIndex=0}return c}async function Jn(e,t,i,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!t.__processedComponents)t.__processedComponents=new Set;let m=t.__processedComponents,u=er(c);if(u.size>0){let v=Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[];t.__stx_client_declared_names=[...new Set([...v,...u])]}let y=X(c);c=y.output;let w=tt(t);return c=await h(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await h(c,/[A-Z][a-zA-Z0-9]*/,!0,Lt(yr)),c=await h(c,/[a-z][a-z0-9]*/,!1,yr),c=y.restore(c),c;async function h(v,S,A,P){if(!v)return v;let k=v,N=zt(k,S,P),U=lt(k),M=new Map;for(let O=N.length-1;O>=0;O--){let E=N[O],B=A?H(E.tagName):E.tagName,T=ge(Xn(E.attributes,t,i)),z=U.filter(({start:Z,end:_})=>E.startIndex>=Z&&E.startIndex<_),G=z.length>0,j=new Set(w);for(let Z of z)for(let _ of Z.names)j.add(_);let W=Fn(T,t,o,G,j);if(typeof W.clientReactive.for==="string")for(let Z of J(W.clientReactive.for))j.add(Z);let ce=le.getBuiltin(E.tagName),we=ce?await wr(E.tagName,l,t,i,o):!1;if(ce&&!we){let Z={context:t,filePath:i,options:o,dependencies:a},_=ce.render(W,E.content,Z);if(Object.keys(W.events).length>0){let F=Zt(W.events);_=_.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${F}`)}if(Object.keys(W.clientReactive).length>0)_=Vt(_,W.clientReactive);M.set(O,_);continue}if(!A&&E.tagName.includes("-")&&!await wr(B,l,t,i,o))continue;let Y={};for(let[Z,_]of Object.entries(W.static))Y[Z]=_;for(let[Z,_]of Object.entries(W.serverDynamic))Y[Z]=_;let ne={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(W.clientReactive),events:Object.keys(W.events)},D=await Be(B,Y,y.restore(E.content),l,t,i,o,m,a,[...j],ne,E.tagName);if(D=Yn(D,W,ne.declaredProps,ne.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let Z=ne.reactiveProps.filter((te)=>!ne.consumedProps.has(te)&&!["if","for","show","key","ref"].includes(te)).map(H),_=ut(D,!0);if(Z.length&&_){if(!Object.hasOwn(ge(D.slice(_.insertPos,_.tagEnd)),"data-stx-native-host-root"))D=D.slice(0,_.insertPos)+' data-stx-native-host-root="true"'+D.slice(_.insertPos);let te=ve(D);D=D.slice(0,te.insertPos)+` data-stx-native-forward="${Z.join(" ")}"`+D.slice(te.insertPos)}let F=ut(D,!0);if(F){let te=ge(D.slice(F.insertPos,F.tagEnd)),Se=ve(D),Kt=ge(D.slice(Se.insertPos,Se.tagEnd));if(Object.hasOwn(te,"data-stx-native-host-root")&&!Object.hasOwn(Kt,"data-stx-native-host-owner"))D=D.slice(0,Se.insertPos)+" data-stx-native-host-owner"+D.slice(Se.insertPos)}}if(Object.keys(W.events).length>0){let Z=ve(D);if(Z){let _=Zt(W.events),F=Object.keys(W.events).map((te)=>te.replace(/^@/,"").split(".")[0]).join(" ");D=D.substring(0,Z.insertPos)+` data-stx-parent-events="${F}" ${_}`+D.substring(Z.insertPos)}}if(Object.keys(W.clientReactive).length>0)D=Vt(D,W.clientReactive);M.set(O,D)}if(M.size===0)return k;let L="",q=0;for(let O=0;O<N.length;O++){let E=M.get(O);if(E===void 0)continue;L+=k.slice(q,N[O].startIndex),L+=E,q=N[O].endIndex}return L+=k.slice(q),L}}function Vt(e,t){let i=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(t).filter(([w])=>!i.has(w)),c=a.filter(([w])=>!o.has(w)).map(([w])=>H(w)).join(" "),l=e,m=a.length>0?ve(l):null;if(m){let w=a.map(([C,b])=>`:${H(C)}="${b.replace(/"/g,""")}"`).join(" "),x=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,m.insertPos)+`${x} ${w}`+l.substring(m.insertPos)}let u=t.if;if(u)l=`<template :if="${u.replace(/"/g,""")}">${l}</template>`;let y=t.for;if(y){let w=t.key,x=w?` :key="${w.replace(/"/g,""")}"`:"";l=`<template :for="${y.replace(/"/g,""")}"${x}>${l}</template>`}return l}function Yn(e,t,i=new Set,o=new Set,a=!1){let c=ut(e,a);if(!c)return e;let l=e.slice(c.insertPos,c.tagEnd),m=t.serverDynamic.class??t.static.class;if(a&&typeof m==="string"&&m&&!o.has("class")){let h=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,v=h.test(l)?l.replace(h,(S,A,P,k,N)=>`${A}class="${n(`${at(P??k??N)} ${m}`)}"`):` class="${n(m)}"${l}`;e=e.slice(0,c.insertPos)+v+e.slice(c.tagEnd),c.tagEnd+=v.length-l.length,l=v}let u=a||/\bdata-native(?:\s|=)/i.test(l),y=u?o:i,w=new Set(Object.keys(ge(l))),x=new Set(["class","className"]);for(let h of Object.keys(t.static)){let v=t.staticNames[h]??h;if(w.has(v)||y.has(h)||!u&&!Fe(v))x.add(h)}for(let h of Object.keys(t.serverDynamic)){let v=t.serverDynamicNames?.[h]??h;if(w.has(v)||y.has(h)||!u&&!Fe(v))x.add(h)}let C=[];if(u){for(let[h,v]of Object.entries(t.static)){if(x.has(h)||v!==!0&&v!==re)continue;x.add(h),C.push(`${n(t.staticNames?.[h]??h)}="true"`)}for(let[h,v]of Object.entries(t.serverDynamic)){if(x.has(h)||v!==!0)continue;x.add(h),C.push(`${n(t.serverDynamicNames?.[h]??h)}="true"`)}}let b=[...oe(t,x),...ae(t,x),...C];if(u){for(let[h,v]of Object.entries(t.serverDynamic)){if(x.has(h)||v!==!1)continue;let S=t.serverDynamicNames?.[h]??h;b.push(`${n(S)}="false"`)}for(let[h,v]of Object.entries(t.serverDynamic)){if(x.has(h)||v===null||typeof v!=="object")continue;let S=JSON.stringify(v);if(S!==void 0){let A=t.serverDynamicNames?.[h]??h;b.push(`${n(A)}="${n(S)}"`)}}}if(b.length===0)return e;return`${e.slice(0,c.insertPos)} ${b.join(" ")}${e.slice(c.insertPos)}`}function ve(e){let t=Gt(e,0);if(t)return t;let i=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(i)return{insertPos:i.index+1+i[1].length,tagEnd:ft(e,i.index+1+i[1].length)};return null}function ut(e,t=!1){let i=ve(e);if(!i)return null;let o=e.slice(i.insertPos,i.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?Gt(e,i.tagEnd+1):i;return a&&t?Qn(e,a)??a:a}function Qn(e,t){if(!e.includes("data-stx-native-host-root"))return null;let i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=e.lastIndexOf("<",t.insertPos),a=0,c;while(o>=0&&o<e.length){if(e.startsWith("<!--",o)){let w=e.indexOf("-->",o+4);if(w<0)return null;o=e.indexOf("<",w+3);continue}let l=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(o));if(!l){o=e.indexOf("<",o+1);continue}let m=l[2].toLowerCase(),u=o+l[0].length,y=ft(e,u);if(l[1]){if(a--,c!==void 0&&a<c)c=void 0;if(a<=0)return null}else if(m==="script"||m==="style"){let w=new RegExp(`</${m}\\s*>`,"gi");if(w.lastIndex=y+1,!w.exec(e))return null;o=e.indexOf("<",w.lastIndex);continue}else{let w=ge(e.slice(u,y)),x=a>0&&(Object.hasOwn(w,"data-stx-component-wrapper")||Object.hasOwn(w,"data-stx-native-host-owner"));if(c===void 0&&!x&&Object.hasOwn(w,"data-stx-native-host-root"))return{insertPos:u,tagEnd:y};if(!i.has(m)&&e[y-1]!=="/"){if(a++,c===void 0&&x)c=a}else if(a===0)return null}o=e.indexOf("<",y+1)}return null}function Gt(e,t){let i=t;while(i<e.length){let o=e.slice(i),a=o.match(/^\s+/);if(a){i+=a[0].length;continue}if(o.startsWith("<!--")){let m=e.indexOf("-->",i+4);if(m===-1)return null;i=m+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let m=`</${c[1].toLowerCase()}>`,u=e.toLowerCase().indexOf(m,i+c[0].length);if(u===-1)return null;i=u+m.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:i+1+l[1].length,tagEnd:ft(e,i+1+l[1].length)}}return null}function ft(e,t){let i="";for(let o=t;o<e.length;o++){let a=e[o];if(i){if(a==="\\")o++;else if(a===i)i=""}else if(a==='"'||a==="'")i=a;else if(a===">")return o}return e.length}function er(e){let t=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)){let o=i[1];if(!/\bclient\b/.test(o)||/\bserver\b/.test(o))continue;for(let a of Yo(i[2]))t.add(a);for(let a of i[2].matchAll(/^\s*import\s+(?:type\s+)?(?:([\w$]+)\s*,?\s*)?(?:\{([^}]*)\}|\*\s+as\s+([\w$]+))?\s*from\s/gm)){if(a[1])t.add(a[1]);if(a[3])t.add(a[3]);for(let c of(a[2]??"").split(",")){let l=c.replace(/^\s*type\s+/,"").split(/\s+as\s+/).pop().trim();if(/^[A-Za-z_$][\w$]*$/.test(l))t.add(l)}}}return t}async function ns(e,t,i,o,a){if(!Xt)Dt(le),Xt=!0;let c=await yf(e,t,i,o,a);c=await Gn(c,t,i,o,a),c=await Kn(c,t,i,o,a);let l=[];for(let m=0;m<3;m++){let u=l.length,y=pe(c,Oe,(x,C)=>`\x00STX_COMPONENT_COMMENT_${u+C}\x00`,`STX_COMPONENT_COMMENT:${u}`);l.push(...y.tokens);let w=c;if(c=await Jn(y.output,t,i,o,a),c===w)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(m,u)=>l[Number(u)]??"");if(o.debug){let m=Vn(c);if(m.length>0)console.warn(`[stx] ${i}: unresolved component tag(s) after render passes: ${m.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
|
|
40
|
+
</style>`}};import{existsSync as On,readFileSync as Bn}from"fs";var Ne=new Map,Ot=new Set;function Tn(e){if(Ot.has(e))return;Ot.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Dn(e){let t=process.cwd();for(let i of[`${t}/node_modules/@iconify-json/${e}/icons.json`,`${t}/pantry/@iconify-json/${e}/icons.json`,`${t}/node_modules/@iconify/json/json/${e}.json`,`${t}/pantry/@iconify/json/json/${e}.json`])if(On(i))return i;for(let i of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return g.resolve(i)}catch{}return null}function jn(e){if(Ne.has(e))return Ne.get(e);let t=Dn(e);if(!t)return Tn(e),null;try{let i=JSON.parse(Bn(t,"utf8"));return Ne.set(e,i),i}catch{return null}}function Mn(e,t,i,o){let a=[];if(t.rotate)a.push(`rotate(${t.rotate*90} ${i/2} ${o/2})`);if(t.hFlip)a.push(`translate(${i} 0) scale(-1 1)`);if(t.vFlip)a.push(`translate(0 ${o}) scale(1 -1)`);return a.length?`<g transform="${a.join(" ")}">${e}</g>`:e}function Ln(e,t){let i=t,o=e.icons[i],a={hFlip:!1,vFlip:!1,rotate:0};for(let m=0;!o&&m<8;m++){let u=e.aliases?.[i];if(!u)return null;if(u.hFlip)a.hFlip=!a.hFlip;if(u.vFlip)a.vFlip=!a.vFlip;if(u.rotate)a.rotate=((a.rotate+u.rotate)%4+4)%4;i=u.parent,o=e.icons[i]}if(!o)return null;let c=o.width??e.width??24,l=o.height??e.height??24;return{body:Mn(o.body,a,c,l),width:c,height:l}}function de(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);if(e.static[t]!==void 0)return String(e.static[t]);if(e.clientReactive[t]!==void 0)return e.clientReactive[t];return}var st={name:"Icon",aliases:["icon","stx-icon"],render(e,t,i){let o=de(e,"name")??de(e,"icon");if(!o)return"<!-- Icon: missing name/icon prop -->";let a="lucide",c=o;if(o.includes(":")){let S=o.split(":");a=S[0],c=S[1]}let l=n(de(e,"size")||"24"),m=n(de(e,"color")||"currentColor"),u=n(de(e,"class")||""),y=n(de(e,"style")||""),v=Ne.get(a)??jn(a);if(!v)return`<!-- Icon: collection "${a}" not loaded -->`;let b=Ln(v,c);if(!b)return`<!-- Icon: "${c}" not found in ${a} -->`;let C=`0 0 ${b.width} ${b.height}`,x=b.body;if(m!=="currentColor")x=x.replace(/currentColor/g,m);let h=u?` class="${u}"`:"",w=y?` style="${y}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="${C}" fill="none"${h}${w}>${x}</svg>`}};function Bt(e,...t){for(let i of t){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let o=e.static[i];if(typeof o==="string")return o}return}function Tt(e,t){let i=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${t}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),o=e.match(i);if(!o)return{region:null,rest:e};return{region:o[2],rest:e.replace(o[0],"")}}var it={name:"Suspense",aliases:["suspense"],render(e,t,i){let o=Tt(t,"fallback"),a=o.rest,c=Tt(a,"error"),l=c.rest,m=o.region??Bt(e,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',u=c.region??Bt(e,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${m}</div><div data-stx-suspense-error hidden>${u}</div><div data-stx-suspense-content hidden>${l}</div></div>`}};function Te(e,...t){for(let i of t){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let o=e.static[i];if(typeof o==="string")return o}return}var ot={name:"TransitionGroup",aliases:["transition-group"],render(e,t,i){let o=(Te(e,"name")||"v").replace(/["'<>]/g,""),a=(Te(e,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",c=Te(e,"class"),l=Te(e,"id"),m=[`data-stx-transition-group="${o}"`,c?`class="${c}"`:"",l?`id="${l}"`:""].filter(Boolean).join(" ");return`<${a} ${m}>${t}</${a}>`}};function Dt(e=le){e.registerBuiltin(He),e.registerBuiltin(Ge),e.registerBuiltin(Ke),e.registerBuiltin(Ye),e.registerBuiltin(Qe),e.registerBuiltin(et),e.registerBuiltin(rt),e.registerBuiltin(st),e.registerBuiltin(it),e.registerBuiltin(ot)}var jt=new Map;function zn(e){let t=jt.get(e.source);if(!t)t=new RegExp(`(${e.source})(?![\\w.:-])`,"y"),jt.set(e.source,t);return t}var Mt=new WeakMap;function Lt(e){let t=Mt.get(e);if(!t)t=new Set([...e].map((o)=>o.toLowerCase())),Mt.set(e,t);let i=t;return(o)=>!/[a-z]/.test(o)&&i.has(o.toLowerCase())}function Un(e,t){let i="";for(let o=t;o<e.length;o++){let a=e[o];if(i){if(a==="\\")o++;else if(a===i)i=""}else if(a==='"'||a==="'")i=a;else if(a===">")return o}return e.length}function zt(e,t,i){let o=[],a=0,c=typeof i==="function"?i:i?(l)=>i.has(l.toLowerCase()):void 0;while(a<e.length){let l=e.indexOf("<",a);if(l===-1)break;let m=zn(t);m.lastIndex=l+1;let u=m.exec(e);if(!u){a=l+1;continue}let y=u[1];if(c&&c(y)){let S=l+1+y.length;while(S<e.length&&e[S]!==">")S++;a=S+1;continue}let v=l+1+y.length,b=null,C=v,x=-1,h=!1;while(v<e.length){let S=e[v];if(b){if(S==="\\"&&v+1<e.length){v+=2;continue}if(S===b)b=null;v++;continue}if(S==='"'||S==="'"){b=S,v++;continue}if(S==="/"&&v+1<e.length&&e[v+1]===">"){x=v+2,h=!0;break}if(S===">"){x=v+1;break}v++}if(x===-1){a=l+1;continue}let w=e.slice(C,h?x-2:x-1).trim();if(h)o.push({fullMatch:e.slice(l,x),tagName:y,attributes:w,content:"",startIndex:l,endIndex:x,isSelfClosing:!0}),a=x;else{let S=`<${y}`,A=`</${y}>`,P=1,k=x,N=-1;while(P>0&&k<e.length){let L=e.indexOf(S,k),q=e.indexOf(A,k);if(q===-1)break;if(L!==-1&&L<q){let O=e[L+S.length];if(O===" "||O===">"||O==="/"||O===`
|
|
41
|
+
`||O==="\t"){let E=Un(e,L+S.length);if(e[E-1]!=="/")P++;k=E+1}else k=L+S.length}else{if(P--,P===0){N=q;break}k=q+A.length}}if(N===-1){a=x;continue}let U=e.slice(x,N),M=N+A.length;o.push({fullMatch:e.slice(l,M),tagName:y,attributes:w,content:U,startIndex:l,endIndex:M,isSelfClosing:!1}),a=M}}return o}function at(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/'/gi,"'").replace(/&/g,"&")}function Ut(e,t){try{let i=Buffer.from(e,"base64").toString("utf8");return JSON.parse(i)}catch{}try{let i=e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(i)}catch(i){if(t?.debug)console.error("Error decoding __stx_ prop:",i);return e}}function ct(e,t){let i=0,o="",a=t;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")i++;else if(c==="}"){if(i--,i===0)return e.slice(t,a+1)}a++}return e.slice(t)}function Ft(e){let t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;if(ct(t,0).length!==t.length)return null;return t.slice(1,-1).trim()}var Fn=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Hn(e){return lt(e).map((t)=>[t.start,t.end])}function lt(e){let t=[],i=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,o;while((o=i.exec(e))!==null){let a=o[2]||"",c=/(?:^|\s)(?::for|x-for|v-for|@for)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/.exec(a);if(!c)continue;let l=J(c[1]??c[2]??c[3]??""),m=o.index,u=m+o[0].length,y=o[1].toLowerCase();if(o[0].endsWith("/>")||Wn.has(y)){t.push({start:m,end:u,names:l});continue}let v=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b=new RegExp(`<\\/?${v}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");b.lastIndex=u;let C=1,x=u,h;while((h=b.exec(e))!==null)if(h[0].startsWith("</")){if(C--,C===0){x=h.index+h[0].length;break}}else if(!h[0].endsWith("/>"))C++;t.push({start:m,end:x,names:l})}return t}function Wt(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((t)=>Wt(t)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,t])=>t).map(([t])=>t).join(" ");return e?String(e):""}function qa(e,t){if(!/:[\w-]+=/.test(e))return e;let i=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Hn(e));let l=new Set([...tt(t),...Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[]]);function m(C){return a.some(([x,h])=>C>=x&&C<h)}let u=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*?)\s*(\/?)>/g,y=[],v=new Map,b=256;while((c=u.exec(i))!==null){if(m(c.index))continue;let C=c[0],x=c[2];if(!x||!x.includes(":"))continue;let h=/(?:^|\s)data-native(?:\s|=|$)/i.test(x.replace(/"[^"]*"|'[^']*'/g,"")),w=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,S,A=x,P=!1;while((S=w.exec(x))!==null){if(Ts(x,S.index,!0)?.kind==="attribute")continue;let k=S[1],N=S[2];if(Yc(k))continue;if(I(N,l))continue;if(N.includes("()")&&!N.includes(".get(")||N.includes("$store")||N.includes("$ref"))continue;try{let U=Object.keys(t),M=Object.values(t),L=N.match(/^([a-zA-Z_$][\w$]*)/);if(L&&!U.includes(L[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(L[1]))continue;let q=JSON.stringify([U,N]),O=v.get(q);if(!O){if(O=Function(...U,`return (${N})`),v.size>=b)v.clear();v.set(q,O)}let E=O(...M);if(k==="class"){let B=V(Wt(E));if(B){let T=A.match(/\sclass="([^"]*)"/);if(T)A=A.replace(T[0],()=>` class="${T[1]} ${B}"`);else A=A.replace(S[0],()=>` class="${B}"`)}else A=A.replace(S[0],"");P=!0;continue}if(Fn.has(k)){if(E)A=A.replace(S[0],` ${k}`);else A=A.replace(S[0],"");P=!0;continue}if(E===null||E===void 0||E===!1)A=A.replace(S[0],"");else{let B=h&&typeof E==="object"?JSON.stringify(E):String(E),T=yn(k,B);A=A.replace(S[0],()=>` ${k}="${T}"`)}P=!0}catch(U){if(U instanceof ie)throw U;continue}}if(P){let k=c[3]?" /":"",U=`<${c[1]}${A}${k}>`;y.push({start:c.index,end:c.index+C.length,replacement:U})}}if(y.length>0){let C=Array(y.length*2+1),x=0;for(let h=0;h<y.length;h++){let{start:w,end:S,replacement:A}=y[h];C[h*2]=i.slice(x,w),C[h*2+1]=A,x=S}C[y.length*2]=i.slice(x),i=C.join("")}return i}import Ht from"fs";import qt from"path";var Xt=!1;function qn(e,t,i,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(t.__stx_client_signal_names)?t.__stx_client_signal_names:[]),m=(b)=>{if(l.size===0)return!1;let C=s(b),x=C.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(x&&l.has(x))return!0;for(let h of l){let w=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${w}\\s*\\(`).test(C))return!0}return!1},u=new Set(Zc),y=(b)=>{if(!b.includes("-")||b.startsWith("@")||b.startsWith(":")||b.startsWith("x-")||b.startsWith("__"))return b;if(b.startsWith("aria-")||b.startsWith("data-"))return b;return b.replace(/-([a-z0-9])/g,(C,x)=>x.toUpperCase())},v=(b,C)=>{let x=y(b);if(c.static[x]=C,x!==b)c.staticNames[x]=b};for(let[b,C]of Object.entries(e)){let x=b.startsWith("x-")&&!u.has(b)&&!b.startsWith("x-bind:")&&!b.startsWith("x-on:")?`:${b.slice(2)}`:b;if(x.startsWith("@")){c.events[x]=C;continue}if(x.startsWith("__stx_")){let h=y(x.slice(6));c.serverDynamic[h]=Ut(C,i);continue}if(x.startsWith(":")){let h=y(x.slice(1)),w=C===re?h:C;if(h==="if"||h==="for"||h==="show"){c.clientReactive[h]=w;continue}if(o){c.clientReactive[h]=w;continue}if(I(w,a)){c.clientReactive[h]=w;continue}if(m(w)){c.clientReactive[h]=w;continue}try{if(!f(w)){if(i.debug)console.error(`Unsafe expression in :${h} binding: ${w}`);c.clientReactive[h]=w;continue}let S=Object.keys(t),A=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),P=new Set(Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[]);if(nt(w).some((M)=>!A.has(M)&&!S.includes(M)&&(!(M in globalThis)||P.has(M)))){c.clientReactive[h]=w;continue}let U=d(w,S)(...Object.values(t));if(c.serverDynamic[h]=U,h!==x.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[h]=x.slice(1)}catch{c.clientReactive[h]=w}continue}if(typeof C==="string"&&C.includes("{{")&&C.includes("}}")){let h=Xn(C,a);if(h!==null){c.clientReactive[y(x)]=h;continue}let w=C.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(w)try{let S=w[1];if(f(S)){let P=d(S,Object.keys(t))(...Object.values(t));v(x,P!=null?String(P):"")}else{if(i.debug)console.error(`Unsafe expression in ${x}: ${S}`);v(x,C)}}catch(S){if(i.debug)console.error(`Error evaluating expression for ${x}:`,S);v(x,C)}else{let S=C,A=/\{\{\s*([\s\S]+?)\s*\}\}/g,P;while((P=A.exec(C))!==null)try{let k=P[1];if(!f(k)){if(i.debug)console.error(`Unsafe expression in ${x}: ${k}`);continue}let U=d(k,Object.keys(t))(...Object.values(t));S=S.replace(P[0],String(U??""))}catch(k){if(i.debug)console.error(`Error evaluating expression in ${x}:`,k)}v(x,S)}continue}v(x,C===re?"true":at(C))}return c}function Xn(e,t){if(t.size===0)return null;let i=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(i)];if(!o.some((m)=>I(m[1],t)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let m of o)c+=e.slice(l,m.index).replace(/[`\\$]/g,(u)=>`\\${u}`),c+=`\${${m[1]}}`,l=m.index+m[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(m)=>`\\${m}`),`\`${c}\``}var Zn=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function Vn(e,t,i){if(!e.includes("@"))return e;if(!Zn.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return se(e,t,i)}catch{return e}}function ge(e){let t={},i=0,o=e.length;while(i<o){while(i<o&&/\s/.test(e[i]))i++;if(i>=o)break;let a="";while(i<o&&!/[\s=]/.test(e[i]))a+=e[i],i++;if(!a)break;while(i<o&&/\s/.test(e[i]))i++;if(i<o&&e[i]==="="){i++;while(i<o&&/\s/.test(e[i]))i++;let c="";if(i<o&&(e[i]==='"'||e[i]==="'")){let l=e[i];i++;while(i<o){let m=e[i];if(m==="\\"&&i+1<o){i++,c+=e[i],i++;continue}if(m===l){i++;break}c+=m,i++}}else if(e[i]==="{"){c=ct(e,i),i+=c.length;let l=Ft(c);if(l!==null){t[`:${a}`]=l;continue}}else while(i<o&&!/\s/.test(e[i]))c+=e[i],i++;t[a]=c}else t[a]=re}return t}function Zt(e){return Object.entries(e).map(([t,i])=>i===re?t:`${t}="${Gn(i)}"`).join(" ")}function Gn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Kn(e){let t=new Set,i=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=i.exec(e))!==null){let a=o[1];if(le.isBuiltin(a))t.add(a)}return[...t].sort()}async function yf(e,t,i,o,a){if(!/import\s/.test(e))return e;if(!t.__importedComponents)t.__importedComponents=new Map;let c=t.__importedComponents,l=qt.dirname(i),m=[],u=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let b of e.matchAll(u)){let[C,x,h]=b,w=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,S=h,A,P=[];while((A=w.exec(h))!==null){let[k,N,U,M]=A,L=null,q=null;if(M.startsWith(".")||M.startsWith("/")){let B=qt.resolve(l,M);if(B.endsWith(".stx"))q=B;else{let T=`${B}.stx`;try{if(Ht.statSync(T).isFile())q=T}catch{try{if(Ht.statSync(B).isDirectory())L=B}catch{}}}}else L=_s(M,l);if(!L&&!q)continue;let O=!1,E=(B,T)=>{c.set(B,T),c.set(B.toLowerCase(),T);let z=B.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(z,T),a.add(T)};if(U&&q)E(U,q),O=!0;else if(N){let B=N.slice(1,-1).split(",").map((z)=>z.trim()).filter(Boolean).map((z)=>{let G=z.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(G)return{source:G[1],local:G[2]};return{source:z,local:z}}),T=L?ks(L):null;for(let{source:z,local:G}of B){let j=null;if(q)j=q;else if(T)j=T.get(z)??T.get(z.toLowerCase())??T.get(z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(j)E(G,j),O=!0}}if(O)P.push({start:A.index,end:A.index+k.length})}if(P.length===0)continue;for(let k=P.length-1;k>=0;k--)S=S.slice(0,P[k].start)+S.slice(P[k].end);m.push({start:b.index,end:b.index+C.length,value:`<script${x}>${S}</script>`})}if(m.length===0)return e;let y=[],v=0;for(let b of m)y.push(e.slice(v,b.start),b.value),v=b.end;return y.push(e.slice(v)),y.join("")}async function Jn(e,t,i,o,a){let c=e;if(!t.__importedComponents)t.__importedComponents=new Map;let l=t.__importedComponents,m=/@import\s*\(\s*([^)]+)\s*\)/g,u;while((u=m.exec(c))!==null){let[y,v]=u,b=v.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of b){let x=C.split("/"),w=x[x.length-1].replace(/\.stx$/,""),S=w.includes("-")?w.split("-").map((k)=>k.charAt(0).toUpperCase()+k.slice(1)).join(""):w.charAt(0).toUpperCase()+w.slice(1),A=null,P=Cs(C,i,o);for(let k of P)try{if(await Bun.file(k).exists()){A=k;break}}catch{}if(A){l.set(S,A),l.set(w,A),l.set(w.toLowerCase(),A);let k=S.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(k,A),a.add(A),o.debug)console.log(`Imported component: ${S} -> ${A}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(y,""),m.lastIndex=0}return c}async function Yn(e,t,i,o,a){let c=e,l=o.componentsDir||"components";if(!t.__processedComponents)t.__processedComponents=new Set;let m=t.__processedComponents,u=/@component\s*\(/g,y;while((y=u.exec(c))!==null){let v=y.index,b=v+y[0].length-1,C=1,x=b+1;while(x<c.length&&C>0){if(c[x]==="(")C++;else if(c[x]===")"){if(C--,C===0)break}x++}if(C!==0)break;let h=c.substring(b+1,x),w=x+1,S=h.match(/^\s*['"]([^'"]+)['"]/);if(!S){u.lastIndex=0;continue}let A=S[1],P,k=h.slice(S[0].length),N=k.match(/^\s*,\s*/);if(N)P=k.slice(N[0].length).trim();let U={};if(P)try{U=R(P,t)}catch(B){let T=B instanceof Error?B.message:String(B);c=c.replace(c.substring(v,w),`[Error parsing component props: ${T}]`);continue}let M="",L=w,O=c.substring(w).match(/^([\s\S]*?)@endcomponent/);if(O)M=O[1].trim(),L=w+O[0].length;let E=await Be(A,U,M,l,t,i,o,m,a);c=c.substring(0,v)+E+c.substring(L),u.lastIndex=0}return c}async function Qn(e,t,i,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!t.__processedComponents)t.__processedComponents=new Set;let m=t.__processedComponents,u=nr(c);if(u.size>0){let w=Array.isArray(t.__stx_client_declared_names)?t.__stx_client_declared_names:[];t.__stx_client_declared_names=[...new Set([...w,...u])]}let y=X(c);c=y.output;let v=tt(t);return c=await h(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await h(c,/[A-Z][a-zA-Z0-9]*/,!0,Lt(yr)),c=await h(c,/[a-z][a-z0-9]*/,!1,yr),c=y.restore(c),c;async function h(w,S,A,P){if(!w)return w;let k=w,N=zt(k,S,P),U=lt(k),M=new Map;for(let O=N.length-1;O>=0;O--){let E=N[O],B=A?H(E.tagName):E.tagName,T=ge(Vn(E.attributes,t,i)),z=U.filter(({start:Z,end:_})=>E.startIndex>=Z&&E.startIndex<_),G=z.length>0,j=new Set(v);for(let Z of z)for(let _ of Z.names)j.add(_);let F=qn(T,t,o,G,j);if(typeof F.clientReactive.for==="string")for(let Z of J(F.clientReactive.for))j.add(Z);let ce=le.getBuiltin(E.tagName),we=ce?await wr(E.tagName,l,t,i,o):!1;if(ce&&!we){let Z={context:t,filePath:i,options:o,dependencies:a},_=ce.render(F,E.content,Z);if(Object.keys(F.events).length>0){let W=Zt(F.events);_=_.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${W}`)}if(Object.keys(F.clientReactive).length>0)_=Vt(_,F.clientReactive);M.set(O,_);continue}if(!A&&E.tagName.includes("-")&&!await wr(B,l,t,i,o))continue;let Y={};for(let[Z,_]of Object.entries(F.static))Y[Z]=_;for(let[Z,_]of Object.entries(F.serverDynamic))Y[Z]=_;let ne={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(F.clientReactive),events:Object.keys(F.events)},D=await Be(B,Y,y.restore(E.content),l,t,i,o,m,a,[...j],ne,E.tagName);if(D=er(D,F,ne.declaredProps,ne.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let Z=ne.reactiveProps.filter((te)=>!ne.consumedProps.has(te)&&!["if","for","show","key","ref"].includes(te)).map(H),_=ut(D,!0);if(Z.length&&_){if(!Object.hasOwn(ge(D.slice(_.insertPos,_.tagEnd)),"data-stx-native-host-root"))D=D.slice(0,_.insertPos)+' data-stx-native-host-root="true"'+D.slice(_.insertPos);let te=ve(D);D=D.slice(0,te.insertPos)+` data-stx-native-forward="${Z.join(" ")}"`+D.slice(te.insertPos)}let W=ut(D,!0);if(W){let te=ge(D.slice(W.insertPos,W.tagEnd)),Se=ve(D),Kt=ge(D.slice(Se.insertPos,Se.tagEnd));if(Object.hasOwn(te,"data-stx-native-host-root")&&!Object.hasOwn(Kt,"data-stx-native-host-owner"))D=D.slice(0,Se.insertPos)+" data-stx-native-host-owner"+D.slice(Se.insertPos)}}if(Object.keys(F.events).length>0){let Z=ve(D);if(Z){let _=Zt(F.events),W=Object.keys(F.events).map((te)=>te.replace(/^@/,"").split(".")[0]).join(" ");D=D.substring(0,Z.insertPos)+` data-stx-parent-events="${W}" ${_}`+D.substring(Z.insertPos)}}if(Object.keys(F.clientReactive).length>0)D=Vt(D,F.clientReactive);M.set(O,D)}if(M.size===0)return k;let L="",q=0;for(let O=0;O<N.length;O++){let E=M.get(O);if(E===void 0)continue;L+=k.slice(q,N[O].startIndex),L+=E,q=N[O].endIndex}return L+=k.slice(q),L}}function Vt(e,t){let i=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(t).filter(([v])=>!i.has(v)),c=a.filter(([v])=>!o.has(v)).map(([v])=>H(v)).join(" "),l=e,m=a.length>0?ve(l):null;if(m){let v=a.map(([C,x])=>`:${H(C)}="${x.replace(/"/g,""")}"`).join(" "),b=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,m.insertPos)+`${b} ${v}`+l.substring(m.insertPos)}let u=t.if;if(u)l=`<template :if="${u.replace(/"/g,""")}">${l}</template>`;let y=t.for;if(y){let v=t.key,b=v?` :key="${v.replace(/"/g,""")}"`:"";l=`<template :for="${y.replace(/"/g,""")}"${b}>${l}</template>`}return l}function er(e,t,i=new Set,o=new Set,a=!1){let c=ut(e,a);if(!c)return e;let l=e.slice(c.insertPos,c.tagEnd),m=t.serverDynamic.class??t.static.class;if(a&&typeof m==="string"&&m&&!o.has("class")){let h=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,w=h.test(l)?l.replace(h,(S,A,P,k,N)=>`${A}class="${n(`${at(P??k??N)} ${m}`)}"`):` class="${n(m)}"${l}`;e=e.slice(0,c.insertPos)+w+e.slice(c.tagEnd),c.tagEnd+=w.length-l.length,l=w}let u=a||/\bdata-native(?:\s|=)/i.test(l),y=u?o:i,v=new Set(Object.keys(ge(l))),b=new Set(["class","className"]);for(let h of Object.keys(t.static)){let w=t.staticNames[h]??h;if(v.has(w)||y.has(h)||!u&&!We(w))b.add(h)}for(let h of Object.keys(t.serverDynamic)){let w=t.serverDynamicNames?.[h]??h;if(v.has(w)||y.has(h)||!u&&!We(w))b.add(h)}let C=[];if(u){for(let[h,w]of Object.entries(t.static)){if(b.has(h)||w!==!0&&w!==re)continue;b.add(h),C.push(`${n(t.staticNames?.[h]??h)}="true"`)}for(let[h,w]of Object.entries(t.serverDynamic)){if(b.has(h)||w!==!0)continue;b.add(h),C.push(`${n(t.serverDynamicNames?.[h]??h)}="true"`)}}let x=[...oe(t,b),...ae(t,b),...C];if(u){for(let[h,w]of Object.entries(t.serverDynamic)){if(b.has(h)||w!==!1)continue;let S=t.serverDynamicNames?.[h]??h;x.push(`${n(S)}="false"`)}for(let[h,w]of Object.entries(t.serverDynamic)){if(b.has(h)||w===null||typeof w!=="object")continue;let S=JSON.stringify(w);if(S!==void 0){let A=t.serverDynamicNames?.[h]??h;x.push(`${n(A)}="${n(S)}"`)}}}if(x.length===0)return e;return`${e.slice(0,c.insertPos)} ${x.join(" ")}${e.slice(c.insertPos)}`}function ve(e){let t=Gt(e,0);if(t)return t;let i=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(i)return{insertPos:i.index+1+i[1].length,tagEnd:ft(e,i.index+1+i[1].length)};return null}function ut(e,t=!1){let i=ve(e);if(!i)return null;let o=e.slice(i.insertPos,i.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?Gt(e,i.tagEnd+1):i;return a&&t?tr(e,a)??a:a}function tr(e,t){if(!e.includes("data-stx-native-host-root"))return null;let i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=e.lastIndexOf("<",t.insertPos),a=0,c;while(o>=0&&o<e.length){if(e.startsWith("<!--",o)){let v=e.indexOf("-->",o+4);if(v<0)return null;o=e.indexOf("<",v+3);continue}let l=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(o));if(!l){o=e.indexOf("<",o+1);continue}let m=l[2].toLowerCase(),u=o+l[0].length,y=ft(e,u);if(l[1]){if(a--,c!==void 0&&a<c)c=void 0;if(a<=0)return null}else if(m==="script"||m==="style"){let v=new RegExp(`</${m}\\s*>`,"gi");if(v.lastIndex=y+1,!v.exec(e))return null;o=e.indexOf("<",v.lastIndex);continue}else{let v=ge(e.slice(u,y)),b=a>0&&(Object.hasOwn(v,"data-stx-component-wrapper")||Object.hasOwn(v,"data-stx-native-host-owner"));if(c===void 0&&!b&&Object.hasOwn(v,"data-stx-native-host-root"))return{insertPos:u,tagEnd:y};if(!i.has(m)&&e[y-1]!=="/"){if(a++,c===void 0&&b)c=a}else if(a===0)return null}o=e.indexOf("<",y+1)}return null}function Gt(e,t){let i=t;while(i<e.length){let o=e.slice(i),a=o.match(/^\s+/);if(a){i+=a[0].length;continue}if(o.startsWith("<!--")){let m=e.indexOf("-->",i+4);if(m===-1)return null;i=m+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let m=`</${c[1].toLowerCase()}>`,u=e.toLowerCase().indexOf(m,i+c[0].length);if(u===-1)return null;i=u+m.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:i+1+l[1].length,tagEnd:ft(e,i+1+l[1].length)}}return null}function ft(e,t){let i="";for(let o=t;o<e.length;o++){let a=e[o];if(i){if(a==="\\")o++;else if(a===i)i=""}else if(a==='"'||a==="'")i=a;else if(a===">")return o}return e.length}function nr(e){let t=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)){let o=i[1];if(!/\bclient\b/.test(o)||/\bserver\b/.test(o))continue;for(let a of Yo(i[2]))t.add(a);for(let a of i[2].matchAll(/^\s*import\s+(?:type\s+)?(?:([\w$]+)\s*,?\s*)?(?:\{([^}]*)\}|\*\s+as\s+([\w$]+))?\s*from\s/gm)){if(a[1])t.add(a[1]);if(a[3])t.add(a[3]);for(let c of(a[2]??"").split(",")){let l=c.replace(/^\s*type\s+/,"").split(/\s+as\s+/).pop().trim();if(/^[A-Za-z_$][\w$]*$/.test(l))t.add(l)}}}return t}async function ns(e,t,i,o,a){if(!Xt)Dt(le),Xt=!0;let c=await yf(e,t,i,o,a);c=await Jn(c,t,i,o,a),c=await Yn(c,t,i,o,a);let l=[];for(let m=0;m<3;m++){let u=l.length,y=pe(c,Oe,(b,C)=>`\x00STX_COMPONENT_COMMENT_${u+C}\x00`,`STX_COMPONENT_COMMENT:${u}`);l.push(...y.tokens);let v=c;if(c=await Qn(y.output,t,i,o,a),c===v)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(m,u)=>l[Number(u)]??"");if(o.debug){let m=Kn(c);if(m.length>0)console.warn(`[stx] ${i}: unresolved component tag(s) after render passes: ${m.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
|
|
42
42
|
export{_o,Co,Eo,nh,ts,rh,qa,yf,ns};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ot,Jc}from"./chunk-27agaezn.js";import{A}from"./chunk-zn3c0ew5.js";import{z,Ss,o,ln,W,S,mc,Ot,mn,Le,je}from"./chunk-
|
|
2
|
+
import{ot,Jc}from"./chunk-27agaezn.js";import{A}from"./chunk-zn3c0ew5.js";import{z,Ss,o,ln,W,S,mc,Ot,mn,Le,je}from"./chunk-rfa9rz3g.js";import{or}from"./chunk-xzsvx81w.js";import{L}from"./chunk-f4gqzg1y.js";import{on}from"./chunk-8f14cgm8.js";var D=`(?:"[^"]*"|'[^']*'|[^>"'])*`,q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,J=65536,K=4,M=new Map;function sh(){M.clear()}function Y(e){let i=[];for(let n of S(e,W)){let t=n.token.match(/^<script\b([^>]*)>/i),s=n.token.match(/<\/script\s*>$/i);if(!t||!s)continue;let a=t[0].length,f=n.token.length-s[0].length;i.push(Object.freeze({fullMatch:n.token,attrs:t[1],body:n.token.slice(a,f),start:n.start,end:n.end}))}return i}function rs(e,i={}){let n=e.length>=J,t=n?M.get(e):void 0;if(t===void 0){if(t=Y(e),n)mc(M,K),M.set(e,t)}let s=i.skipAttrs;if(!s)return t.slice();let a=[];for(let f of t)if(s.lastIndex=0,!s.test(f.attrs))a.push(f);return a}function Ao(e){let i=e.trim(),n=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(n){let s=n[1].trim(),a=n[2].trim(),{itemVar:f,indexVar:c}=F(a);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:c}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let s=t[1].trim(),a=t[2].trim(),{itemVar:f,indexVar:c}=F(s);if(f)return{style:"in",iterable:a,itemVar:f,indexVar:c}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function F(e){let i=e.trim(),n=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(n)return{itemVar:n[2],indexVar:n[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let s=i.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function ss(e,i){return Jc(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,n=0,t;while((t=i.exec(e))!==null){let s=t[1];if(s.startsWith("if"))n++;else if(s==="endif")n--;else if(n===0)return!0}return!1}function rr(e){let i=new Set,n=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=n.exec(e))!==null){let a=s[1],f;while((f=t.exec(a))!==null)i.add(f[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${D})>`,"iy"),n=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=S(e,(a,f)=>{i.lastIndex=f;let c=i.exec(a);if(!c||c.index!==f||!n.test(c[2]))return-1;return i.lastIndex}),s=[];for(let a of t){i.lastIndex=0;let f=i.exec(a.token);if(!f)continue;let c=f[2].match(n),p=Ao(c?.[1]??c?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let r=f[1],g=/\/\s*>$/.test(a.token)||P.has(r.toLowerCase())?a.end:Z(e,a.start,r,a.end);if(g!==-1)s.push({start:a.start,end:g,vars:new Set(h)})}return s}var U=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function G(e,i,n,t){if(!e)return!1;let s=ne(e),a=!1,f=!1,c=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(s))!==null){let l=h[1];if(s.slice(0,h.index).trimEnd().endsWith("."))continue;if(U.has(l))continue;if(i.has(l)||t?.has(l))a=!0;else if(n&&l in n)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,u;while((u=r.exec(s))!==null){let l=u[1];if(s.slice(0,u.index).trimEnd().endsWith("."))continue;if(U.has(l)||n&&l in n)continue;c=!0}return(a||c)&&!f}function O(e,i,n){let t=n===void 0?` ${i}`:` ${i}="${n.replace(/"/g,""")}"`,s=e.trim(),a=s.match(q);if(a&&se(a[3],a[1])){let[,f,c,p]=a;return`<${f}${c}${t}>${p}</${f}>`}return`<template${t}>${s}</template>`}function se(e,i){let n=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,s;while((s=n.exec(e))!==null)if(s[1]){if(t--,t<0)return!1}else t++;return!0}function Po(e,i){let n=rr(e);function t(s){let a=s,f=te(s),c=(u)=>{let g=new Set;for(let l of f)if(u>l.start&&u<l.end)for(let d of l.vars)g.add(d);return g},p=/@if\s*\(/g,h,r=[];while((h=p.exec(a))!==null){let u=h.index,g=u+h[0].length,l=1,d=g;while(d<a.length&&l>0){if(a[d]==="(")l++;else if(a[d]===")")l--;d++}if(l!==0)continue;let b=a.substring(g,d-1).trim(),w=d,E=1,y=w,m=/@(if\s*\(|endif)/g;m.lastIndex=w;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))E++;else if(x[1]==="endif"){if(E--,E===0){y=x.index+x[0].length;break}}if(E!==0)continue;let R=a.substring(w,y-6).trim(),v;if(ee(R)){let I=on(a.substring(u,y));if(I.length===0)continue;let k=I[0].branches.filter((C)=>C.type!=="else"),V=c(u);if(!(k.length>0&&k.every((C)=>G(C.condition,n,i,V))))continue;v=I[0].branches.map((C)=>{let N=t(C.content);if(C.type==="elseif")return O(N,"@else-if",C.condition??"");if(C.type==="else")return O(N,"@else");return O(N,"@if",C.condition??"")}).join(`
|
|
3
3
|
`)}else{if(!G(b,n,i,c(u)))continue;v=O(t(R),"@if",b)}r.push({start:u,end:y,replacement:v}),p.lastIndex=y}for(let u=r.length-1;u>=0;u--){let{start:g,end:l,replacement:d}=r[u];a=a.substring(0,g)+d+a.substring(l)}return a}return t(e)}function re(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let s=Number(i);return s!==0&&!Number.isNaN(s)}let n=i.match(/^'((?:\\.|[^'\\])*)'$/);if(n)return n[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),X=/<(script|style)\b/iy,ie=/<\/script/gi,oe=/<\/style/gi;function Z(e,i,n,t){if(P.has(n.toLowerCase()))return t;let s=n.toLowerCase(),a=e.length,f=1,c=t;while(c<a){let p=e.indexOf("<",c);if(p===-1)return-1;if(c=p,e.startsWith("<!--",c)){let g=e.indexOf("-->",c+4);if(g===-1)return-1;c=g+3;continue}X.lastIndex=c;let h=X.exec(e);if(h){let g=e.indexOf(">",c);if(g===-1)return-1;if(e[g-1]==="/"){c=g+1;continue}let l=h[1].toLowerCase()==="script"?ie:oe;l.lastIndex=c;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;c=b+1;continue}if(e[c+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(c,c+64));if(!g){c++;continue}if(g[1].toLowerCase()===s){if(f--,c+=g[0].length,f===0)return c;continue}c+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(c,c+64));if(!r){c++;continue}let u=e.indexOf(">",c);if(u===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(c,u+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}c=u+1}return-1}var ce=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ae(e,i){let n=i,t=e.length;for(;;){while(n<t&&e[n]!=="<")n++;if(n>=t)return!1;if(e.startsWith("<!--",n)){let f=e.indexOf("-->",n+4);if(f===-1)return!1;n=f+3;continue}break}if(e[n+1]==="/")return!1;let s=e.indexOf(">",n);if(s===-1)return!1;let a=e.slice(n,s+1);return ce.test(a)}function Io(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],n=/<([a-zA-Z][\w-]*)/y,t=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);S(e,(r,u)=>{n.lastIndex=u;let g=n.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=n.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&t.test(r[l]))l++;let w=l;if(r[w]==="/"){w++;while(w<r.length&&t.test(r[w]))w++}if(r[w]===">"){if(d)i.push({start:u,end:w+1,tag:g[1],...d});return-1}if(l===b)return-1;let E=l;while(l<r.length&&!t.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===E)return-1;let y=r.slice(E,l);if(y.startsWith("@")&&y.includes("("))return-1;let m=l,x=l;while(x<r.length&&t.test(r[x]))x++;if(r[x]!=="="){l=m;continue}x++;while(x<r.length&&t.test(r[x]))x++;let R=r[x];if(R==='"'||R==="'"){let v=r.indexOf(R,x+1);if(v===-1)return-1;if(!d&&R==='"'&&s.has(y))d={attrName:y,attrStart:b,attrEnd:v+1,value:r.slice(x+1,v)};l=v+1}else{l=x;while(l<r.length&&!t.test(r[l])&&r[l]!==">")l++}}return-1});let a=[],f=-1;for(let r of i){let{start:u,end:g,tag:l,attrName:d,value:b}=r;if(u<f)continue;let w=re(b);if(w===void 0)continue;let m=/\/\s*>$/.test(e.slice(u,g))||P.has(l.toLowerCase())?g:Z(e,u,l,g);if(m===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ae(e,m))continue;if(w===!0){let R=e.slice(u,r.attrStart)+e.slice(r.attrEnd,g);a.push({start:u,end:g,replacement:R});continue}a.push({start:u,end:m,replacement:""}),f=m}if(a.length===0)return e;a.sort((r,u)=>r.start-u.start);let c=[],p=-1;for(let r of a){if(r.start<p)continue;c.push(r),p=r.end}let h=e;for(let r=c.length-1;r>=0;r--){let{start:u,end:g,replacement:l}=c[r];h=h.substring(0,u)+l+h.substring(g)}return h}var H=[":for","@for","x-for"];function os(e,i){if(!i||Object.keys(i).length===0)return e;if(!H.some((c)=>e.includes(`${c}=`)))return e;let n=rr(e);if(Array.isArray(i.__stx_client_signal_names)){for(let c of i.__stx_client_signal_names)if(typeof c==="string")n.add(c)}let t=e,s=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=a.exec(t))!==null){let[c,p,h]=f,r=f.index,u=r+c.length,g=H.map((v)=>({attr:v,m:new RegExp(`\\s${v}="([^"]*)"`).exec(h)})).find((v)=>v.m!==null);if(!g||!g.m)continue;let l=Ao(g.m[1]);if(!l.iterable||!l.itemVar)continue;let d=l.iterable.trim().split(/[.[(]/)[0].trim();if(!d||n.has(d)||!(d in i))continue;let b=Z(t,r,p,u);if(b===-1)continue;let w=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),E=t.slice(u,b-`</${p}>`.length),y={...i,[l.itemVar]:void 0};if(l.indexVar)y[l.indexVar]=void 0;let m=os(E,y),x=l.indexVar?`${l.iterable} as ${l.indexVar} => ${l.itemVar}`:`${l.iterable} as ${l.itemVar}`,R=p.toLowerCase()==="template"?m:`<${p}${w}>${m}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${x})${R}@endforeach`}),a.lastIndex=b}for(let c=s.length-1;c>=0;c--){let{start:p,end:h,replacement:r}=s[c];t=t.slice(0,p)+r+t.slice(h)}return t}function is(e,i){let n=e,t=/@(for|foreach)\s*\(/g,s,a=[],f=[];while((s=t.exec(n))!==null){let c=s[1],p=s.index,h=p+s[0].length,r=1,u=h;while(u<n.length&&r>0){if(n[u]==="(")r++;else if(n[u]===")")r--;u++}if(r!==0)continue;let g=n.substring(h,u-1).trim(),l=u,d=Ao(g),b=c==="for"?"@endfor":"@endforeach",w=1,E=l,y=c==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${c}\\s*\\(|end${c})`,"g");y.lastIndex=l;let m;while((m=y.exec(n))!==null)if(m[1].startsWith(c))w++;else if(w--,w===0){E=m.index+m[0].length;break}if(w!==0)continue;let x=()=>{let _=[d.itemVar,d.indexVar].filter(Boolean);if(_.length)f.push({start:p,end:E,vars:_})};if(d.iterable){let _=d.iterable.trim();if(_.startsWith("[")||_.startsWith("{")||_.startsWith("'")||_.startsWith('"')||_.startsWith("`")||/^-?\d/.test(_)){x();continue}let T=_.split(/[.[(]/)[0].trim(),C=i?T in i:!1,N=f.some((j)=>p>j.start&&p<j.end&&j.vars.includes(T));if(T&&(C||N)){x();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=n.substring(l,E-b.length).trim(),v=i?{...i}:{};if(d.itemVar)delete v[d.itemVar];if(d.indexVar)delete v[d.indexVar];let I=is(R,v),k=I.match(q),V;if(k){let[,_,T,C]=k;V=`<${_}${T} @for="${g}">${C}</${_}>`}else V=`<template @for="${g}">${I}</template>`;a.push({start:p,end:E,replacement:V}),t.lastIndex=E}for(let c=a.length-1;c>=0;c--){let{start:p,end:h,replacement:r}=a[c];n=n.substring(0,p)+r+n.substring(h)}return n}function le(e){let i=new Set,n=[],t=0,s=0,a=e.length,f=(r)=>{let u=t+1;while(u<a){let g=e[u];if(g==="\\"){u+=2;continue}if(g===r)return u+1;u++}return a},c=()=>{let r=t+2;while(r<a&&e[r]!==`
|
|
4
4
|
`)r++;return r},p=()=>{let r=t+2;while(r<a-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return a},h=(r)=>{let u=r,g=0;while(u<a){let l=e[u];if(l==="/"&&e[u+1]==="/"){let d=u+2;while(d<a&&e[d]!==`
|
|
5
|
-
`)d++;u=d;continue}if(l==="/"&&e[u+1]==="*"){let d=u+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;u=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=u+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}u=d;continue}if(l==="("||l==="["||l==="{"){g++,u++;continue}if(l===")"||l==="]"||l==="}"){g--,u++;continue}if(l===";"&&g===0)return u+1;u++}return a};while(t<a){let r=e[t];if(r==="/"&&e[t+1]==="/"){let u=c();n.push(e.slice(t,u)),t=u;continue}if(r==="/"&&e[t+1]==="*"){let u=p();n.push(e.slice(t,u)),t=u;continue}if(r==='"'||r==="'"||r==="`"){let u=f(r);n.push(e.slice(t,u)),t=u;continue}if(r==="{"){s++,n.push(r),t++;continue}if(r==="}"){s--,n.push(r),t++;continue}if(s===0){let u=t>0?e[t-1]:"";if(u===""||/\s/.test(u)||u===";"||u==="}"||u==="{"){let l=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=h(t+l[0].length);if(i.has(d)){n.push(`/* stx: deduped const ${d} */`),t=b;continue}i.add(d),n.push(e.slice(t,b)),t=b;continue}}}n.push(r),t++}return n.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function B(e,i,n){for(let t of n){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,n){let t=0;while(t<e.length){let s=e.indexOf(i,t);if(s===-1)return!1;if(!B(s,s+i.length,n))return!0;t=s+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let s=new RegExp(`<body(${D})>`,"g"),a;while((a=s.exec(e))!==null)if(!B(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let n=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${D})>`,"gi"),t;while((t=n.exec(e))!==null){if(B(t.index,t.index+t[0].length,i))continue;if(ue.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,n,t){let s=[],a=` data-stx="${t}"`,f=0,c=!1,p=(h)=>{if(n!==null&&!c&&n>=f&&n<=h)s.push(e.slice(f,n),a,e.slice(n,h)),c=!0;else s.push(e.slice(f,h))};for(let h of i){if(h.start<f)continue;p(h.start),f=h.end}return p(e.length),s.join("")}async function as(e,i,n,t={}){let s=rs(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:c,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
5
|
+
`)d++;u=d;continue}if(l==="/"&&e[u+1]==="*"){let d=u+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;u=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=u+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}u=d;continue}if(l==="("||l==="["||l==="{"){g++,u++;continue}if(l===")"||l==="]"||l==="}"){g--,u++;continue}if(l===";"&&g===0)return u+1;u++}return a};while(t<a){let r=e[t];if(r==="/"&&e[t+1]==="/"){let u=c();n.push(e.slice(t,u)),t=u;continue}if(r==="/"&&e[t+1]==="*"){let u=p();n.push(e.slice(t,u)),t=u;continue}if(r==='"'||r==="'"||r==="`"){let u=f(r);n.push(e.slice(t,u)),t=u;continue}if(r==="{"){s++,n.push(r),t++;continue}if(r==="}"){s--,n.push(r),t++;continue}if(s===0){let u=t>0?e[t-1]:"";if(u===""||/\s/.test(u)||u===";"||u==="}"||u==="{"){let l=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=h(t+l[0].length);if(i.has(d)){n.push(`/* stx: deduped const ${d} */`),t=b;continue}i.add(d),n.push(e.slice(t,b)),t=b;continue}}}n.push(r),t++}return n.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function B(e,i,n){for(let t of n){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,n){let t=0;while(t<e.length){let s=e.indexOf(i,t);if(s===-1)return!1;if(!B(s,s+i.length,n))return!0;t=s+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let s=new RegExp(`<body(${D})>`,"g"),a;while((a=s.exec(e))!==null)if(!B(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let n=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${D})>`,"gi"),t;while((t=n.exec(e))!==null){if(B(t.index,t.index+t[0].length,i))continue;if(ue.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,n,t){let s=[],a=` data-stx="${t}"`,f=0,c=!1,p=(h)=>{if(n!==null&&!c&&n>=f&&n<=h)s.push(e.slice(f,n),a,e.slice(n,h)),c=!0;else s.push(e.slice(f,h))};for(let h of i){if(h.start<f)continue;p(h.start),f=h.end}return p(e.length),s.join("")}async function as(e,i,n,t={}){let s=rs(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:c,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-ykjx8zf0.js"));for(let m of s){let x=m.body;if(Le(m.attrs))x=je(x);if(t.forceClientSetup||a.test(x)){f.push({content:x,start:m.start,end:m.end});continue}if(!c(x))continue;try{let R=await p(Ot(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(R))f.push({content:x,start:m.start,end:m.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${f.map((m)=>m.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,u=[];for(let m=0;m<f.length;m++){let x=f[m].bundled??Ot(f[m].content).code;if(!f[m].bundled&&c(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=yt(x);let R=A(x);u.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
|
|
6
6
|
${R}`)}let g=u.join(`
|
|
7
7
|
|
|
8
8
|
`);g=le(g);let d=z(g).split(",").map((m)=>m.trim()).filter(Boolean),b=mn(g,n),w=`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bo,Fo,zo,Ho,gs,ms,gh,mh,hh,yh,hs,bh}from"./chunk-
|
|
2
|
+
import{Bo,Fo,zo,Ho,gs,ms,gh,mh,hh,yh,hs,bh}from"./chunk-dxsdr77m.js";import"./chunk-wpwh529h.js";export{bh as generateDefaultRobotsTxt,hs as generateRobotsTxt,mh as generateSitemap,hh as generateSitemapIndex,Ho as injectSeoTags,gs as metaDirective,Bo as processMetaDirectives,zo as processSeoDirective,Fo as processStructuredData,gh as registerSeoDirectives,yh as scanForSitemapEntries,ms as structuredDataDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ll,ul}from"./chunk-kkmayabs.js";import"./chunk-wds7pewp.js";import"./chunk-6mnebk49.js";import"./chunk-kp2rkczm.js";import"./chunk-crk5dzxb.js";import"./chunk-wwd61ewe.js";import"./chunk-nybty1zx.js";import"./chunk-evsbb3rc.js";import"./chunk-dxgvah9p.js";import"./chunk-888xnaex.js";import"./chunk-w1sdxmx3.js";import"./chunk-5nqhfdj6.js";import"./chunk-amyxgejb.js";import"./chunk-2g9eaq6p.js";import"./chunk-w34w1hrg.js";import"./chunk-ttsrhr95.js";import"./chunk-md36aysy.js";import"./chunk-ygs7ersb.js";import"./chunk-vyv76w55.js";import"./chunk-0nhb2nwp.js";import"./chunk-8fazd6fr.js";import"./chunk-pd89jnqk.js";import"./chunk-fsz9k5k0.js";import"./chunk-72hfqwvk.js";import"./chunk-78x8qfvt.js";import"./chunk-y3w2rc1y.js";import"./chunk-e7ke3rpn.js";import"./chunk-evphmzyh.js";import"./chunk-j6m7jwpv.js";import"./chunk-zswnmzsd.js";import"./chunk-e43cxztn.js";import"./chunk-vtmd3ssd.js";import{Jt}from"./chunk-bgt7bwm0.js";import"./chunk-ed67z92f.js";import"./chunk-19ayktjy.js";import"./chunk-1xjv71dw.js";import{Re,i}from"./chunk-a7py2qd2.js";import"./chunk-1wke0qfq.js";import"./chunk-91pycazt.js";import"./chunk-dz2hn14j.js";import"./chunk-4rr35v4y.js";import"./chunk-f4y3h74q.js";import"./chunk-gmp889v9.js";import"./chunk-bj0z4gve.js";import"./chunk-f6gqf6v3.js";import{be}from"./chunk-xzsvx81w.js";import"./chunk-8f14cgm8.js";import{ir,ar}from"./chunk-8zapr6yt.js";import{us,j,a}from"./chunk-t7nw25st.js";import"./chunk-mhn18833.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import{m,Me}from"./chunk-rfa9rz3g.js";import"./chunk-n8txdhez.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";import"./chunk-9zrbhs3p.js";import"./chunk-x0c8xq0s.js";export{us as buildWebComponents,ar as cacheTemplate,ir as checkCache,Jt as classifyAllScripts,ll as createMiddleware,ul as createRoute,j as defaultConfig,m as extractVariables,be as injectRouterScript,a as loadStxConfig,Me as processClientScript,i as processDirectives,Re as readMarkdownFile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-wpwh529h.js";import"./chunk-27agaezn.js";import"./chunk-zn3c0ew5.js";import"./chunk-rfa9rz3g.js";import"./chunk-nzwcbt98.js";import"./chunk-n8txdhez.js";import"./chunk-6ew10ptg.js";import"./chunk-mhn18833.js";import{l}from"./chunk-h2y36t58.js";import u from"fs";import m from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||l(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=m.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),c=JSON.parse(p);if(c.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(c.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ua,da,pa,fa,qm}from"./chunk-yvbqhm47.js";import"./chunk-amsbfc3y.js";import"./chunk-zswnmzsd.js";import"./chunk-e43cxztn.js";import"./chunk-a7py2qd2.js";import"./chunk-1wke0qfq.js";import"./chunk-91pycazt.js";import"./chunk-dz2hn14j.js";import"./chunk-4rr35v4y.js";import"./chunk-f4y3h74q.js";import"./chunk-gmp889v9.js";import"./chunk-bj0z4gve.js";import"./chunk-f6gqf6v3.js";import"./chunk-xzsvx81w.js";import"./chunk-8f14cgm8.js";import"./chunk-8zapr6yt.js";import"./chunk-t7nw25st.js";import"./chunk-mhn18833.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-rfa9rz3g.js";import"./chunk-n8txdhez.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{ua as buildNative,qm as default,da as findCraftBinary,fa as getAvailableFormats,pa as getAvailableTargets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{eh,hf,Ge,Wa,th,Zr,Qr,es}from"./chunk-4rr35v4y.js";import"./chunk-f4y3h74q.js";import"./chunk-gmp889v9.js";import"./chunk-bj0z4gve.js";import"./chunk-8f14cgm8.js";import"./chunk-rfa9rz3g.js";import"./chunk-n8txdhez.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{th as clearOnceStore,Wa as onceStore,Ge as partialsCache,Zr as processIncludes,Qr as processStackPushDirectives,es as processStackReplacements,eh as resetUnscopedSignalWarnings,hf as topLevelElements};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xg}from"./chunk-6mnebk49.js";import"./chunk-dxgvah9p.js";import"./chunk-bgt7bwm0.js";import"./chunk-19ayktjy.js";import"./chunk-gmp889v9.js";import"./chunk-xzsvx81w.js";import"./chunk-t7nw25st.js";import"./chunk-mhn18833.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-rfa9rz3g.js";import"./chunk-n8txdhez.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{xg as startProductionServer};
|