@stacksjs/stx 0.2.834 → 0.2.836
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/{chunk-mya2g8sn.js → chunk-0ee6a69c.js} +1 -1
- package/dist/{chunk-zb7kfwac.js → chunk-14dmmthm.js} +1 -1
- package/dist/{chunk-0mrzdsh5.js → chunk-1av9cx4h.js} +1 -1
- package/dist/{chunk-rfdwn0k3.js → chunk-1rgex0bn.js} +5 -5
- package/dist/{chunk-qdagsy5b.js → chunk-2b25kjyx.js} +1 -1
- package/dist/{chunk-9n14m2gn.js → chunk-3sty93sy.js} +1 -1
- package/dist/{chunk-kzvt88tk.js → chunk-6c3wj83w.js} +1 -1
- package/dist/{chunk-npn692c4.js → chunk-71vj7v61.js} +1 -1
- package/dist/{chunk-qbvy23qa.js → chunk-7kzxmm80.js} +6 -6
- package/dist/{chunk-vnk6gt0t.js → chunk-876qk7ct.js} +1 -1
- package/dist/{chunk-ddtk57fy.js → chunk-8dr42g11.js} +1 -1
- package/dist/{chunk-pt8nft3k.js → chunk-8p9bphp5.js} +1 -1
- package/dist/{chunk-0mb3jch4.js → chunk-8tktmm5d.js} +1 -1
- package/dist/{chunk-zsdqsky6.js → chunk-8xmm692p.js} +1 -1
- package/dist/{chunk-3w8kt53x.js → chunk-91qky0er.js} +2 -2
- package/dist/{chunk-5379q74v.js → chunk-92j6qkbh.js} +1 -1
- package/dist/{chunk-dvyysszs.js → chunk-944tcqgg.js} +4 -4
- package/dist/{chunk-jmk1ze6r.js → chunk-9gg6hm3q.js} +1 -1
- package/dist/{chunk-y47n1j5x.js → chunk-9wsrkcyw.js} +2 -2
- package/dist/{chunk-rtj900pa.js → chunk-a20xgjzx.js} +1 -1
- package/dist/{chunk-dgqp0pjn.js → chunk-c3n6rbr8.js} +1 -1
- package/dist/{chunk-fc5zj6qg.js → chunk-c7hw37ww.js} +1 -1
- package/dist/{chunk-v1wgp7ep.js → chunk-cjna1thj.js} +1 -1
- package/dist/{chunk-v4kenb7z.js → chunk-cyd6s7tj.js} +1 -1
- package/dist/{chunk-x57x0yq7.js → chunk-d6twwydm.js} +2 -2
- package/dist/{chunk-ecmvq302.js → chunk-d85fvcf5.js} +2 -2
- package/dist/{chunk-cddzcckm.js → chunk-d9m9azzk.js} +4 -4
- package/dist/chunk-dcsg4h3n.js +2 -0
- package/dist/{chunk-55k7m9cp.js → chunk-dq9mrthz.js} +1 -1
- package/dist/{chunk-99ddfv0b.js → chunk-ek3gqadc.js} +1 -1
- package/dist/{chunk-4g6v5qsp.js → chunk-eydfzmdj.js} +1 -1
- package/dist/{chunk-z2e06633.js → chunk-fn0419dn.js} +1 -1
- package/dist/chunk-fxc0q5g6.js +2 -0
- package/dist/{chunk-k46pfdmn.js → chunk-h12ekfb7.js} +1 -1
- package/dist/chunk-hf8750kf.js +2 -0
- package/dist/{chunk-ga2k1rga.js → chunk-hrzef4vb.js} +1 -1
- package/dist/{chunk-cy3c4yxg.js → chunk-hzp3yf39.js} +1 -1
- package/dist/{chunk-3f1ks1ah.js → chunk-kkvyy9an.js} +1 -1
- package/dist/{chunk-b3s8tb18.js → chunk-mpd57aqc.js} +1 -1
- package/dist/{chunk-v53kdjz6.js → chunk-nzybzbh4.js} +1 -1
- package/dist/chunk-pb1f52s7.js +2 -0
- package/dist/{chunk-1qgzexkc.js → chunk-pj904eyr.js} +4 -4
- package/dist/{chunk-srb0qmgx.js → chunk-pkxy74j9.js} +1 -1
- package/dist/{chunk-srqk1nxc.js → chunk-qq19g7e2.js} +1 -1
- package/dist/{chunk-913grzaj.js → chunk-s5g6gtz3.js} +1 -1
- package/dist/chunk-s5gt7k23.js +2 -0
- package/dist/chunk-t02y9hrh.js +2 -0
- package/dist/{chunk-3tn9tb9w.js → chunk-tc7s3tny.js} +4 -4
- package/dist/{chunk-t33fttx9.js → chunk-tj24x37q.js} +1 -1
- package/dist/{chunk-xvmn976f.js → chunk-v8mh2xvp.js} +1 -1
- package/dist/chunk-vdyvtnbs.js +2 -0
- package/dist/{chunk-6j2aea05.js → chunk-vjh6va50.js} +1 -1
- package/dist/{chunk-g3xbwz51.js → chunk-vrptmxvt.js} +1 -1
- package/dist/{chunk-5gqjhq31.js → chunk-vxmfeys6.js} +1 -1
- package/dist/{chunk-q46ay7aq.js → chunk-w0a6yz73.js} +4 -4
- package/dist/{chunk-b0z85f8h.js → chunk-we6yqv3w.js} +1 -1
- package/dist/{chunk-xqy8y5dc.js → chunk-we7cc5x7.js} +1 -1
- package/dist/{chunk-qfcabz87.js → chunk-wsaann3r.js} +2 -2
- package/dist/{chunk-xd9t20sx.js → chunk-xa8jn2ym.js} +1 -1
- package/dist/chunk-xg852k9h.js +3 -0
- package/dist/chunk-xvwpc56h.js +2 -0
- package/dist/chunk-y8ban8z2.js +2 -0
- package/dist/{chunk-e7ssdryq.js → chunk-yjp3bggk.js} +1 -1
- package/dist/{chunk-0z7w8e0s.js → chunk-z9rm4rcv.js} +1 -1
- package/dist/{chunk-7h5rt22w.js → chunk-zbnxrj3b.js} +2 -2
- package/dist/{chunk-gnt1v0kc.js → chunk-zwgxnjmx.js} +3 -3
- package/dist/cli.js +8 -8
- package/dist/client/signals-class-runtime.js +1 -1
- package/dist/client/signals-native-row-runtime.js +3 -3
- package/dist/component-image-usage.js +7 -3
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0c8fqfan.js +0 -3
- package/dist/chunk-4f2zy3y6.js +0 -2
- package/dist/chunk-523s4p08.js +0 -2
- package/dist/chunk-brk1pk8w.js +0 -2
- package/dist/chunk-db7p6bc4.js +0 -2
- package/dist/chunk-ee147ezb.js +0 -2
- package/dist/chunk-g5jfb1ms.js +0 -2
- package/dist/chunk-k4hjqfx1.js +0 -2
- package/dist/chunk-q1cfc2fp.js +0 -2
- package/dist/chunk-xxyhzsqx.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{He,kn,qs,ki,M}from"./chunk-vfj9wp11.js";import{Sn}from"./chunk-qdagsy5b.js";import{Nr,k,pl,ct,Pi,fl}from"./chunk-4ntm3dtk.js";import{I}from"./chunk-s6r54dyf.js";import{T,Ks,u,f,Bt,d,K,z,x,Ys,Ce,Ue,Zs}from"./chunk-txd2js5v.js";import{r,me}from"./chunk-fwktw49p.js";import{g}from"./chunk-0dve54ne.js";import{X}from"./chunk-jr0r5pzw.js";import rt from"path";import Rt from"process";import{AsyncLocalStorage as Go}from"async_hooks";var hr=new Go;function yn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function yr(e,t){return hr.run(yn(e),t)}async function $r(e,t){let i=hr.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let a=Promise.resolve().then(t).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),b=JSON.parse(c);return i.values.set(e,b),b}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,a),a}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function V(e,t=!1){let i=r(e),n=[],a=new Set,l=0,c=0,b=i.length,v=()=>{if(l!==0)return;let E=i.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let P=E[2];if(!a.has(P))n.push(P),a.add(P);return}let A=i.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(c).startsWith("const"))return;A[1].split(",").forEach((P)=>{let B=P.trim();if(!B)return;let L=B.indexOf(":"),G=(L>=0?B.slice(L+1).trim():B).split(/[\s=]/)[0];if(G&&!a.has(G))n.push(G),a.add(G)});return}let j=i.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(t&&i.slice(c).startsWith("const"))return;j[1].split(",").forEach((P)=>{let B=P.trim().replace(/^\.\.\./,"");if(!B)return;let L=B.split(/[\s=]/)[0];if(L&&!a.has(L))n.push(L),a.add(L)});return}if(t)return;let F=i.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let P=F[1];if(!a.has(P))n.push(P),a.add(P);return}let O=i.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let P=O[1];if(!a.has(P))n.push(P),a.add(P)}};while(c<b){if(i[c]==="{"){l++,c++;continue}if(i[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(i[c])&&(c===0||/\s|[;{}()]/.test(i[c-1])))v();c++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Yo(e,t=V(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(V(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Yo(e,t)} }`;return V(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import vt from"fs";import $e from"path";function U(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Rr=new Map;function br(e,t=!0){let i=Rr.get(e);if(t&&i)return i;let n=new Map,a=[$e.join(e,"src"),$e.join(e,"dist"),e];function l(c,b){if(b>6)return;let v;try{v=vt.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let A=$e.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,b+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let j=E.name.slice(0,-4);if(!n.has(j))n.set(j,A);let F=j.toLowerCase();if(!n.has(F))n.set(F,A);let O=U(j);if(!n.has(O))n.set(O,A)}}}for(let c of a)if(l(c,0),n.size>0)break;if(t)Rr.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=$e.join(i,"node_modules",e);try{if(vt.statSync(n).isDirectory())return n}catch{}let a=$e.dirname(i);if(a===i)return null;i=a}}function Ms(e,t,i={}){return[$e.resolve($e.dirname(t),`${e}.stx`),$e.resolve($e.dirname(t),e),$e.resolve(i.componentsDir||"components",`${e}.stx`),$e.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Ar(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),n=U(t);return[t,i,n]}function ai(e,t){let[i,n,a]=Ar(e);for(let l of[i,i.toLowerCase(),n,a]){let c=t?.__importedComponents?.get(l);if(c!==void 0)return c}}function Qo(e,t){let i=t?$e.resolve(t):void 0,n=$e.dirname($e.resolve(e));for(;;){if(vt.existsSync($e.join(n,"package.json")))return i&&n===i?void 0:n;let a=$e.dirname(n);if(a===n)return;n=a}}var ea=["src/ui","src/components","components","dist"];function fs(e,t){let i=$e.resolve(e);if(!t&&!i.split($e.sep).includes("node_modules"))return[];let n=Qo(i,t);if(!n)return[];let a=[];try{let b=JSON.parse(vt.readFileSync($e.join(n,"package.json"),"utf8")).stx?.components;if(Array.isArray(b))a=b.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ea;return[$e.dirname($e.resolve(e)),...l.map((c)=>$e.resolve(n,c))]}function*ci(e,t,i={},n){let a=Ar(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield $e.resolve($e.dirname(t),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=i.projectRoot||process.cwd(),b=[...fs(t,i.projectRoot),...n?.__originalFilePath?[$e.join($e.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],$e.join($e.dirname(t),"components"),$e.resolve(c,"src/components"),$e.resolve(c,"components"),...import.meta.dir?[$e.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(b)){for(let E of l)yield $e.join(v,E);try{for(let E of vt.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield $e.join(v,E.name,A)}catch{}}}function Tr(e,t,i={},n){let a=ai(e,n);if(a!==void 0)return a;for(let l of ci(e,t,i,n))try{if(vt.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let a=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=a.get("alt"),c=a.get("decorative"),b=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!b&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Gn from"fs";import ae from"path";import ht from"path";import Kt from"fs";var ta=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ps(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return ta.has(e.toLowerCase())}var Ir=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Pr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},na=new Set(["ctrl","alt","shift","meta"]),jr={left:0,middle:1,right:2};function Or(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(na.has(n))t.systemKeys.push(n);else if(n in jr)t.mouse=n;else if(n in Pr||/^[a-z]$/.test(n))t.keys.push(Pr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let a=n.match(/debounce(?:\.(\d+))?/);t.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(n.startsWith("throttle")){let a=n.match(/throttle(?:\.(\d+))?/);t.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return t}function Dr(e,t=""){let i=[],n=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,b,v]=l,E=l.index,A=E+c.length,j=`__stx_evt_${t}${n++}`,F=[],O=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=O.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Ir.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Or(G.slice(1)),elementId:j})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=B.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Ir.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Or(G.slice(1)),elementId:j})}if(F.length>0)i.push({originalTag:c,elementId:j,events:F,startIndex:E,endIndex:A})}return i}function sa(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((a)=>`$event.key === '${a}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=jr[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function ra(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function ds(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function ia(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=sa(e),a=ra(ds(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(ps(e.event,t))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",b=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
2
|
+
import{He,kn,qs,ki,M}from"./chunk-vfj9wp11.js";import{Sn}from"./chunk-2b25kjyx.js";import{Nr,k,pl,ct,Pi,fl}from"./chunk-4ntm3dtk.js";import{I}from"./chunk-s6r54dyf.js";import{T,Ks,u,f,Bt,d,K,z,x,Ys,Ce,Ue,Zs}from"./chunk-txd2js5v.js";import{r,me}from"./chunk-fwktw49p.js";import{g}from"./chunk-0dve54ne.js";import{X}from"./chunk-jr0r5pzw.js";import rt from"path";import Rt from"process";import{AsyncLocalStorage as Go}from"async_hooks";var hr=new Go;function yn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function yr(e,t){return hr.run(yn(e),t)}async function $r(e,t){let i=hr.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let a=Promise.resolve().then(t).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),b=JSON.parse(c);return i.values.set(e,b),b}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,a),a}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function V(e,t=!1){let i=r(e),n=[],a=new Set,l=0,c=0,b=i.length,v=()=>{if(l!==0)return;let E=i.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let P=E[2];if(!a.has(P))n.push(P),a.add(P);return}let A=i.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(c).startsWith("const"))return;A[1].split(",").forEach((P)=>{let B=P.trim();if(!B)return;let L=B.indexOf(":"),G=(L>=0?B.slice(L+1).trim():B).split(/[\s=]/)[0];if(G&&!a.has(G))n.push(G),a.add(G)});return}let j=i.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(t&&i.slice(c).startsWith("const"))return;j[1].split(",").forEach((P)=>{let B=P.trim().replace(/^\.\.\./,"");if(!B)return;let L=B.split(/[\s=]/)[0];if(L&&!a.has(L))n.push(L),a.add(L)});return}if(t)return;let F=i.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let P=F[1];if(!a.has(P))n.push(P),a.add(P);return}let O=i.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let P=O[1];if(!a.has(P))n.push(P),a.add(P)}};while(c<b){if(i[c]==="{"){l++,c++;continue}if(i[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(i[c])&&(c===0||/\s|[;{}()]/.test(i[c-1])))v();c++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Yo(e,t=V(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(V(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Yo(e,t)} }`;return V(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import vt from"fs";import $e from"path";function U(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Rr=new Map;function br(e,t=!0){let i=Rr.get(e);if(t&&i)return i;let n=new Map,a=[$e.join(e,"src"),$e.join(e,"dist"),e];function l(c,b){if(b>6)return;let v;try{v=vt.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let A=$e.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,b+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let j=E.name.slice(0,-4);if(!n.has(j))n.set(j,A);let F=j.toLowerCase();if(!n.has(F))n.set(F,A);let O=U(j);if(!n.has(O))n.set(O,A)}}}for(let c of a)if(l(c,0),n.size>0)break;if(t)Rr.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=$e.join(i,"node_modules",e);try{if(vt.statSync(n).isDirectory())return n}catch{}let a=$e.dirname(i);if(a===i)return null;i=a}}function Ms(e,t,i={}){return[$e.resolve($e.dirname(t),`${e}.stx`),$e.resolve($e.dirname(t),e),$e.resolve(i.componentsDir||"components",`${e}.stx`),$e.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Ar(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),n=U(t);return[t,i,n]}function ai(e,t){let[i,n,a]=Ar(e);for(let l of[i,i.toLowerCase(),n,a]){let c=t?.__importedComponents?.get(l);if(c!==void 0)return c}}function Qo(e,t){let i=t?$e.resolve(t):void 0,n=$e.dirname($e.resolve(e));for(;;){if(vt.existsSync($e.join(n,"package.json")))return i&&n===i?void 0:n;let a=$e.dirname(n);if(a===n)return;n=a}}var ea=["src/ui","src/components","components","dist"];function fs(e,t){let i=$e.resolve(e);if(!t&&!i.split($e.sep).includes("node_modules"))return[];let n=Qo(i,t);if(!n)return[];let a=[];try{let b=JSON.parse(vt.readFileSync($e.join(n,"package.json"),"utf8")).stx?.components;if(Array.isArray(b))a=b.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ea;return[$e.dirname($e.resolve(e)),...l.map((c)=>$e.resolve(n,c))]}function*ci(e,t,i={},n){let a=Ar(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield $e.resolve($e.dirname(t),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=i.projectRoot||process.cwd(),b=[...fs(t,i.projectRoot),...n?.__originalFilePath?[$e.join($e.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],$e.join($e.dirname(t),"components"),$e.resolve(c,"src/components"),$e.resolve(c,"components"),...import.meta.dir?[$e.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(b)){for(let E of l)yield $e.join(v,E);try{for(let E of vt.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield $e.join(v,E.name,A)}catch{}}}function Tr(e,t,i={},n){let a=ai(e,n);if(a!==void 0)return a;for(let l of ci(e,t,i,n))try{if(vt.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")&&!n.has("source")||!n.has("alt")&&!n.has("decorative"))return!1;let a=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=a.get("alt"),c=a.get("decorative"),b=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!b&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(n.has("resizemode")&&(n.has("fit")||n.has("objectfit")))return!1;if(n.has("src")&&n.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Gn from"fs";import ae from"path";import ht from"path";import Kt from"fs";var ta=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ps(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return ta.has(e.toLowerCase())}var Ir=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Pr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},na=new Set(["ctrl","alt","shift","meta"]),jr={left:0,middle:1,right:2};function Or(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(na.has(n))t.systemKeys.push(n);else if(n in jr)t.mouse=n;else if(n in Pr||/^[a-z]$/.test(n))t.keys.push(Pr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let a=n.match(/debounce(?:\.(\d+))?/);t.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(n.startsWith("throttle")){let a=n.match(/throttle(?:\.(\d+))?/);t.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return t}function Dr(e,t=""){let i=[],n=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,b,v]=l,E=l.index,A=E+c.length,j=`__stx_evt_${t}${n++}`,F=[],O=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=O.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Ir.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Or(G.slice(1)),elementId:j})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=B.exec(v))!==null){let[,L,H]=P,G=L.split("."),D=G[0];if(!Ir.has(D))continue;F.push({attribute:`@${L}`,event:D,handler:H,modifiers:Or(G.slice(1)),elementId:j})}if(F.length>0)i.push({originalTag:c,elementId:j,events:F,startIndex:E,endIndex:A})}return i}function sa(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((a)=>`$event.key === '${a}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=jr[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function ra(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function ds(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function ia(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=sa(e),a=ra(ds(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(ps(e.event,t))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",b=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
3
3
|
(function() {
|
|
4
4
|
var $el = document.getElementById('${i}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -112,7 +112,7 @@ else {
|
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
114
|
</script>`}function oa(e,t=""){let i=Dr(e,t);if(i.length===0)return{template:e,bindings:[]};let n=e,a=[];for(let l=i.length-1;l>=0;l--){let c=i[l],b=c.originalTag;if(!b.includes(" id="))b=b.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let v=b.match(/id=["']([^"']+)["']/);if(v)for(let E of c.events)E.elementId=v[1]}for(let v of c.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");b=b.replace(A,""),b=b.replace(j,"")}n=n.slice(0,c.startIndex)+b+n.slice(c.endIndex),a.push(...c.events)}return{template:n,bindings:a}}function Mr(e){let t=e.$uid;return typeof t==="string"&&t?`${t}_`:""}function Ac(e,t,i){if(fl(e))return e;if(t.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:b,bindings:v}=oa(e,Mr(t)),E=t.__stx_event_bindings||[];return t.__stx_event_bindings=[...E,...v],b}let n=Dr(e,Mr(t));if(n.length===0)return e;let a=e;for(let b=n.length-1;b>=0;b--){let v=n[b],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let A=E.match(/id=["']([^"']+)["']/);if(A)for(let j of v.events)j.elementId=A[1]}for(let A of v.events){let j=A.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");E=E.replace(F,""),E=E.replace(O,"")}a=a.slice(0,v.startIndex)+E+a.slice(v.endIndex)}let l=li(n.flatMap((b)=>b.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+l+`
|
|
115
|
-
`+a.slice(c);else a+=l;return a}function Lr(e,t){let i=new Set;for(let n of e.split(",")){let a=n.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(t){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))i.add(a)}return i}function At(e,t){let i=r(e),{depths:n,balanced:a}=me(i),l=(b)=>!a||n[b]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let b of i.matchAll(c)){let v=(b.index??0)+b[0].length-b[1].length;if(l(v))return!0}for(let b of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(b.index??0)&&Lr(b[1],!0).has(t))return!0;for(let b of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(b.index??0)&&Lr(b[1],!1).has(t))return!0;return!1}var zr=new T(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),dt=/^[A-Za-z_$][\w$]*$/,aa=new Set(["if","for","while","switch","with"]),Br=["(","[","{"],Wr=[")","]","}"],ca=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function la(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=n.index??0;i.push({text:n[0],start:a,end:a+n[0].length})}return{code:t,tokens:i}}function gs(e){let t=zr.get(e);if(t)return t;let{code:i,tokens:n}=la(e),a=new Map,l=[];for(let L=0;L<n.length;L++){let H=n[L].text;if(["(","[","{"].includes(H))l.push(L);else if([")","]","}"].includes(H)){let G=l.at(-1);if(G!==void 0&&["()","[]","{}"].includes(n[G].text+H))l.pop(),a.set(G,L),a.set(L,G)}}function c(L,H){let G=[],D=L;for(let ee=L;ee<H;ee++){if(["(","[","{"].includes(n[ee].text)&&(a.get(ee)??H)<H){ee=a.get(ee);continue}if(n[ee].text===",")G.push([D,ee]),D=ee+1}return G.push([D,H]),G}let b=[];function v(L,H,G,D=!1){if(n[L]?.text==="...")L++;if(L>=H)return;let ee=n[L].text;if(dt.test(ee)){if(G.add(ee),G===j)b.push({name:ee,token:L,functionScoped:D});return}if(ee!=="{"&&ee!=="[")return;let ne=a.get(L);if(ne===void 0||ne>=H)return;for(let[te,le]of c(L+1,ne)){let he=te;if(ee==="{")for(let ue=te;ue<le;ue++){if(n[ue].text===":"){he=ue+1;break}if(n[ue].text==="=")break;if(["(","[","{"].includes(n[ue].text)&&a.has(ue))ue=a.get(ue)}v(he,le,G,D)}}function E(L,H){let G=new Set;for(let[D,ee]of c(L,H))v(D,ee,G);return G}function A(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(["(","[","{"].includes(G)&&a.has(H)){H=a.get(H);continue}if([",",";",")","]","}"].includes(G))break}return n[Math.max(L,H-1)]?.end??i.length}let j=new Set,F=[];for(let L=0;L<n.length;L++)if(n[L].text==="=>"){let H=L-1,G=H,D;if(n[H]?.text===")"&&a.has(H))G=a.get(H),D=E(G+1,H);else if(n[H]&&dt.test(n[H].text))D=new Set([n[H].text]);else continue;let ee=L+1,ne=n[ee]?.text==="{"&&a.has(ee)?n[a.get(ee)].end:A(ee);F.push({start:n[G].start,end:ne,bodyStart:n[ee]?.start??ne,functionBody:!0,names:D})}else if(n[L].text==="("&&a.has(L)){let H=n[L-1]?.text;if(!H||aa.has(H)||!dt.test(H)&&H!=="*"&&H!=="]")continue;let G=a.get(L),D=G+1;if(n[D]?.text===":"){D++;while(D<n.length&&!["{","=>",";","="].includes(n[D].text))D++}if(n[D]?.text!=="{"||!a.has(D))continue;F.push({start:n[L].start,end:n[a.get(D)].end,bodyStart:n[D].start,functionBody:H!=="catch",names:E(L+1,G)})}function O(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(Br.includes(G)&&a.has(H)){H=a.get(H);continue}if(G===";"||Wr.includes(G))break;let D=n[H-1];if(H>L&&ca.has(G)&&D.text!==".")break;if(H>L&&/[\n\r]/.test(i.slice(D.end,n[H].start))&&(/^[\w$]+$/.test(D.text)||Wr.includes(D.text)||['"',"'","`"].includes(D.text))&&dt.test(G)&&!["in","of","instanceof"].includes(G))break}return H}let P=[];for(let L=0;L<n.length;L++){if(n[L].text!=="for")continue;let H=n[L+1]?.text==="await"?L+2:L+1;if(n[H]?.text!=="("||!a.has(H))continue;let G=a.get(H),D=G+1,ee=n[D]?.text==="{"&&a.has(D)?a.get(D):O(D),ne=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(D,ee-1)]?.end??i.length;P.push({headStart:H,headEnd:G,start:n[H].start,end:ne})}for(let L=0;L<n.length;L++){let H=n[L].text,G=n[L-1]?.text;if(G==="."||n[L+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(H==="const"||H==="let"||H==="var"){let D=O(L+1),ee=L+1,ne=!1,te=!1,le=0;for(let he=L+1;he<=D;he++){let ue=n[he]?.text;if(he<D&&Br.includes(ue)&&a.has(he)&&a.get(he)<D){he=a.get(he);continue}if(he<D&&ue===":"&&!te)ne=!0;else if(he<D&&ue==="="&&le===0)ne=!1,te=!0;else if(he<D&&ne&&ue==="<")le++;else if(he<D&&ne&&ue===">"&&le>0)le--;else if(he===D||ue===","&&le===0)v(ee,he,j,H==="var"),ee=he+1,ne=!1,te=!1}}else if(H==="function"||H==="class"){let D=L+1;if(n[D]?.text==="*")D++;if(n[D]&&dt.test(n[D].text)&&n[D].text!=="extends")j.add(n[D].text),b.push({name:n[D].text,token:D})}else if(H==="import"){let D=L+1;if(n[D]?.text==="*"&&n[D+1]?.text==="as")D+=2;let ee=n[D]?.text;if(ee&&dt.test(ee)&&ee!=="type"&&n[D+1]?.text!=="("&&n[D+1]?.text!==".")j.add(ee),b.push({name:ee,token:D,file:!0});let ne=n[D]?.text==="{"?D:n[D+1]?.text===","&&n[D+2]?.text==="{"?D+2:-1;if(ne!==-1&&a.has(ne)){let te=a.get(ne);for(let[le,he]of c(ne+1,te)){let ue=he-1;while(ue>=le&&!dt.test(n[ue].text))ue--;if(ue>=le&&n[ue].text!=="type")b.push({name:n[ue].text,token:ue,file:!0})}}}}let B={code:i,scopes:F,loops:P,declarations:j,sites:b,tokens:n,pairs:a};return zr.set(e,B),B}function Zt(e){let t=gs(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((a)=>n>=a.start&&n<a.end&&a.names.has(i))}}function Pn(e){return new Set(gs(e).declarations)}function Oe(e,t){let{scopes:i,loops:n,sites:a,tokens:l,pairs:c}=gs(e),b=Array.from({length:l.length},()=>-1),v=[];for(let O=0;O<l.length;O++){b[O]=v.length?v[v.length-1]:-1;let P=l[O].text;if(P==="{"&&c.has(O))v.push(O);else if(P==="}"&&v.length&&c.get(O)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let O of a){if(!t.has(O.name))continue;E.add(O.token);let P=O.file?-1:b[O.token],B=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(O.functionScoped){let H=l[O.token].start,G=i.filter((D)=>D.functionBody&&H>=D.bodyStart&&H<D.end).sort((D,ee)=>D.end-D.bodyStart-(ee.end-ee.bodyStart))[0];B=G?[G.bodyStart,G.end]:[0,Number.POSITIVE_INFINITY]}else if(!O.file){let H=n.filter((G)=>O.token>G.headStart&&O.token<G.headEnd).sort((G,D)=>G.headEnd-G.headStart-(D.headEnd-D.headStart))[0];if(H)B=[H.start,H.end]}let L=A.get(O.name);if(L)L.push(B);else A.set(O.name,[B])}let j=new Set;for(let O=0;O<l.length;O++){if(l[O].text!=="import"||l[O-1]?.text===".")continue;let P=O+1;if(l[P]?.text==="type")P++;if(l[P]&&dt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let B=P+1;B<c.get(P);B++)j.add(B)}let F=new Set;for(let O=0;O<l.length;O++){let P=l[O].text;if(!t.has(P)||F.has(P)||E.has(O)||j.has(O))continue;let B=l[O-1]?.text;if(B==="#"||B==="."&&l[O-2]?.text!=="..")continue;if(l[O+1]?.text===":"&&(B==="{"||B===","))continue;let L=l[O].start;if(A.get(P)?.some(([H,G])=>L>=H&&L<G))continue;if(i.some((H)=>L>=H.start&&L<H.end&&H.names.has(P)))continue;F.add(P)}return F}var Ie="0.2.834";var Fr=Symbol.for(`stx.lazy-module-promises.${Ie}`);function fa(){let e=globalThis;return e[Fr]??=new Map,e[Fr]}function o(e,t){let i=fa(),n=`${import.meta.url}\x00${e}`,a=i.get(n);if(a)return a;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var pa=/<\/(script)/gi;function pn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(pa,"<\\/$1")}import Vr from"fs";var Ur=[];function w(e){let t=new T(e);return Ur.push(t),t}function Pc(){for(let e of Ur)e.clear()}function S(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function wr(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Vr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Vr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var Se=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var da=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ga(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function ma(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let a=ht.dirname(i);if(a===i)return null;i=a}}function ha(e,t){if(!e||typeof e!=="object")return null;let i=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return i(a.import);if(typeof a.default==="object")return i(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let c=a.slice(0,l),b=a.slice(l+1);if(!t.startsWith(c)||!t.endsWith(b))continue;if(t.length<c.length+b.length)continue;if(!n||c.length>n.prefix.length)n={pattern:a,prefix:c,suffix:b}}if(n){let a=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",a)}return null}function xa(e,t){let i=ga(e);if(!i||!i.subpath)return null;let n=ma(i.pkg,t);if(!n)return null;let a;try{a=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,c=ha(a.exports,l);if(!c)return null;let b=ht.resolve(n,c);return Kt.existsSync(b)?b:null}function yi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),a=new Set,l=[],c=[];return{code:e.replace(da,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let j=null;try{j=Bun.resolveSync(E,n)}catch{j=xa(E,n)}if(!j)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${j?.message||j}`),c.push(E),""}if(a.has(A))return"";a.add(A);try{let j=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${A}: ${j?.message||j}`),c.push(E)}return""}),styles:l,unresolved:c}}function ba(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function bi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${ba(t.source)}" data-stx-layer="vendor">
|
|
115
|
+
`+a.slice(c);else a+=l;return a}function Lr(e,t){let i=new Set;for(let n of e.split(",")){let a=n.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(t){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))i.add(a)}return i}function At(e,t){let i=r(e),{depths:n,balanced:a}=me(i),l=(b)=>!a||n[b]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let b of i.matchAll(c)){let v=(b.index??0)+b[0].length-b[1].length;if(l(v))return!0}for(let b of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(b.index??0)&&Lr(b[1],!0).has(t))return!0;for(let b of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(b.index??0)&&Lr(b[1],!1).has(t))return!0;return!1}var zr=new T(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),dt=/^[A-Za-z_$][\w$]*$/,aa=new Set(["if","for","while","switch","with"]),Br=["(","[","{"],Wr=[")","]","}"],ca=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function la(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=n.index??0;i.push({text:n[0],start:a,end:a+n[0].length})}return{code:t,tokens:i}}function gs(e){let t=zr.get(e);if(t)return t;let{code:i,tokens:n}=la(e),a=new Map,l=[];for(let L=0;L<n.length;L++){let H=n[L].text;if(["(","[","{"].includes(H))l.push(L);else if([")","]","}"].includes(H)){let G=l.at(-1);if(G!==void 0&&["()","[]","{}"].includes(n[G].text+H))l.pop(),a.set(G,L),a.set(L,G)}}function c(L,H){let G=[],D=L;for(let ee=L;ee<H;ee++){if(["(","[","{"].includes(n[ee].text)&&(a.get(ee)??H)<H){ee=a.get(ee);continue}if(n[ee].text===",")G.push([D,ee]),D=ee+1}return G.push([D,H]),G}let b=[];function v(L,H,G,D=!1){if(n[L]?.text==="...")L++;if(L>=H)return;let ee=n[L].text;if(dt.test(ee)){if(G.add(ee),G===j)b.push({name:ee,token:L,functionScoped:D});return}if(ee!=="{"&&ee!=="[")return;let ne=a.get(L);if(ne===void 0||ne>=H)return;for(let[te,le]of c(L+1,ne)){let he=te;if(ee==="{")for(let ue=te;ue<le;ue++){if(n[ue].text===":"){he=ue+1;break}if(n[ue].text==="=")break;if(["(","[","{"].includes(n[ue].text)&&a.has(ue))ue=a.get(ue)}v(he,le,G,D)}}function E(L,H){let G=new Set;for(let[D,ee]of c(L,H))v(D,ee,G);return G}function A(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(["(","[","{"].includes(G)&&a.has(H)){H=a.get(H);continue}if([",",";",")","]","}"].includes(G))break}return n[Math.max(L,H-1)]?.end??i.length}let j=new Set,F=[];for(let L=0;L<n.length;L++)if(n[L].text==="=>"){let H=L-1,G=H,D;if(n[H]?.text===")"&&a.has(H))G=a.get(H),D=E(G+1,H);else if(n[H]&&dt.test(n[H].text))D=new Set([n[H].text]);else continue;let ee=L+1,ne=n[ee]?.text==="{"&&a.has(ee)?n[a.get(ee)].end:A(ee);F.push({start:n[G].start,end:ne,bodyStart:n[ee]?.start??ne,functionBody:!0,names:D})}else if(n[L].text==="("&&a.has(L)){let H=n[L-1]?.text;if(!H||aa.has(H)||!dt.test(H)&&H!=="*"&&H!=="]")continue;let G=a.get(L),D=G+1;if(n[D]?.text===":"){D++;while(D<n.length&&!["{","=>",";","="].includes(n[D].text))D++}if(n[D]?.text!=="{"||!a.has(D))continue;F.push({start:n[L].start,end:n[a.get(D)].end,bodyStart:n[D].start,functionBody:H!=="catch",names:E(L+1,G)})}function O(L){let H=L;for(;H<n.length;H++){let G=n[H].text;if(Br.includes(G)&&a.has(H)){H=a.get(H);continue}if(G===";"||Wr.includes(G))break;let D=n[H-1];if(H>L&&ca.has(G)&&D.text!==".")break;if(H>L&&/[\n\r]/.test(i.slice(D.end,n[H].start))&&(/^[\w$]+$/.test(D.text)||Wr.includes(D.text)||['"',"'","`"].includes(D.text))&&dt.test(G)&&!["in","of","instanceof"].includes(G))break}return H}let P=[];for(let L=0;L<n.length;L++){if(n[L].text!=="for")continue;let H=n[L+1]?.text==="await"?L+2:L+1;if(n[H]?.text!=="("||!a.has(H))continue;let G=a.get(H),D=G+1,ee=n[D]?.text==="{"&&a.has(D)?a.get(D):O(D),ne=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(D,ee-1)]?.end??i.length;P.push({headStart:H,headEnd:G,start:n[H].start,end:ne})}for(let L=0;L<n.length;L++){let H=n[L].text,G=n[L-1]?.text;if(G==="."||n[L+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(H==="const"||H==="let"||H==="var"){let D=O(L+1),ee=L+1,ne=!1,te=!1,le=0;for(let he=L+1;he<=D;he++){let ue=n[he]?.text;if(he<D&&Br.includes(ue)&&a.has(he)&&a.get(he)<D){he=a.get(he);continue}if(he<D&&ue===":"&&!te)ne=!0;else if(he<D&&ue==="="&&le===0)ne=!1,te=!0;else if(he<D&&ne&&ue==="<")le++;else if(he<D&&ne&&ue===">"&&le>0)le--;else if(he===D||ue===","&&le===0)v(ee,he,j,H==="var"),ee=he+1,ne=!1,te=!1}}else if(H==="function"||H==="class"){let D=L+1;if(n[D]?.text==="*")D++;if(n[D]&&dt.test(n[D].text)&&n[D].text!=="extends")j.add(n[D].text),b.push({name:n[D].text,token:D})}else if(H==="import"){let D=L+1;if(n[D]?.text==="*"&&n[D+1]?.text==="as")D+=2;let ee=n[D]?.text;if(ee&&dt.test(ee)&&ee!=="type"&&n[D+1]?.text!=="("&&n[D+1]?.text!==".")j.add(ee),b.push({name:ee,token:D,file:!0});let ne=n[D]?.text==="{"?D:n[D+1]?.text===","&&n[D+2]?.text==="{"?D+2:-1;if(ne!==-1&&a.has(ne)){let te=a.get(ne);for(let[le,he]of c(ne+1,te)){let ue=he-1;while(ue>=le&&!dt.test(n[ue].text))ue--;if(ue>=le&&n[ue].text!=="type")b.push({name:n[ue].text,token:ue,file:!0})}}}}let B={code:i,scopes:F,loops:P,declarations:j,sites:b,tokens:n,pairs:a};return zr.set(e,B),B}function Zt(e){let t=gs(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((a)=>n>=a.start&&n<a.end&&a.names.has(i))}}function Pn(e){return new Set(gs(e).declarations)}function Oe(e,t){let{scopes:i,loops:n,sites:a,tokens:l,pairs:c}=gs(e),b=Array.from({length:l.length},()=>-1),v=[];for(let O=0;O<l.length;O++){b[O]=v.length?v[v.length-1]:-1;let P=l[O].text;if(P==="{"&&c.has(O))v.push(O);else if(P==="}"&&v.length&&c.get(O)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let O of a){if(!t.has(O.name))continue;E.add(O.token);let P=O.file?-1:b[O.token],B=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(O.functionScoped){let H=l[O.token].start,G=i.filter((D)=>D.functionBody&&H>=D.bodyStart&&H<D.end).sort((D,ee)=>D.end-D.bodyStart-(ee.end-ee.bodyStart))[0];B=G?[G.bodyStart,G.end]:[0,Number.POSITIVE_INFINITY]}else if(!O.file){let H=n.filter((G)=>O.token>G.headStart&&O.token<G.headEnd).sort((G,D)=>G.headEnd-G.headStart-(D.headEnd-D.headStart))[0];if(H)B=[H.start,H.end]}let L=A.get(O.name);if(L)L.push(B);else A.set(O.name,[B])}let j=new Set;for(let O=0;O<l.length;O++){if(l[O].text!=="import"||l[O-1]?.text===".")continue;let P=O+1;if(l[P]?.text==="type")P++;if(l[P]&&dt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let B=P+1;B<c.get(P);B++)j.add(B)}let F=new Set;for(let O=0;O<l.length;O++){let P=l[O].text;if(!t.has(P)||F.has(P)||E.has(O)||j.has(O))continue;let B=l[O-1]?.text;if(B==="#"||B==="."&&l[O-2]?.text!=="..")continue;if(l[O+1]?.text===":"&&(B==="{"||B===","))continue;let L=l[O].start;if(A.get(P)?.some(([H,G])=>L>=H&&L<G))continue;if(i.some((H)=>L>=H.start&&L<H.end&&H.names.has(P)))continue;F.add(P)}return F}var Ie="0.2.836";var Fr=Symbol.for(`stx.lazy-module-promises.${Ie}`);function fa(){let e=globalThis;return e[Fr]??=new Map,e[Fr]}function o(e,t){let i=fa(),n=`${import.meta.url}\x00${e}`,a=i.get(n);if(a)return a;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var pa=/<\/(script)/gi;function pn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(pa,"<\\/$1")}import Vr from"fs";var Ur=[];function w(e){let t=new T(e);return Ur.push(t),t}function Pc(){for(let e of Ur)e.clear()}function S(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function wr(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Vr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Vr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var Se=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var da=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ga(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function ma(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let a=ht.dirname(i);if(a===i)return null;i=a}}function ha(e,t){if(!e||typeof e!=="object")return null;let i=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return i(a.import);if(typeof a.default==="object")return i(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let c=a.slice(0,l),b=a.slice(l+1);if(!t.startsWith(c)||!t.endsWith(b))continue;if(t.length<c.length+b.length)continue;if(!n||c.length>n.prefix.length)n={pattern:a,prefix:c,suffix:b}}if(n){let a=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",a)}return null}function xa(e,t){let i=ga(e);if(!i||!i.subpath)return null;let n=ma(i.pkg,t);if(!n)return null;let a;try{a=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,c=ha(a.exports,l);if(!c)return null;let b=ht.resolve(n,c);return Kt.existsSync(b)?b:null}function yi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),a=new Set,l=[],c=[];return{code:e.replace(da,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let j=null;try{j=Bun.resolveSync(E,n)}catch{j=xa(E,n)}if(!j)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${j?.message||j}`),c.push(E),""}if(a.has(A))return"";a.add(A);try{let j=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${A}: ${j?.message||j}`),c.push(E)}return""}),styles:l,unresolved:c}}function ba(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function bi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${ba(t.source)}" data-stx-layer="vendor">
|
|
116
116
|
@layer vendor {
|
|
117
117
|
${t.contents}
|
|
118
118
|
}
|
|
@@ -182,7 +182,7 @@ else {
|
|
|
182
182
|
// STX: auto-generated event bindings
|
|
183
183
|
${e.map((i,n)=>Aa(i,n)).join(`
|
|
184
184
|
`)}`}function Kr(e){let t=[],i=new Set,n=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=n.length,c=0;while(c<l){let b=n[c];if(b==="'"||b==='"'||b==="`"){let v=b;if(c++,v==="`"){let E=0;while(c<l){if(n[c]==="\\"){c+=2;continue}if(n[c]==="`"&&E===0){c++;break}if(n[c]==="$"&&n[c+1]==="{"){E++,c+=2;continue}if(n[c]==="}"&&E>0){E--,c++;continue}c++}}else while(c<l){if(n[c]==="\\"){c+=2;continue}if(n[c]===v){c++;break}c++}continue}if(b==="/"&&n[c+1]==="/"){while(c<l&&n[c]!==`
|
|
185
|
-
`)c++;continue}if(b==="/"&&n[c+1]==="*"){c+=2;while(c<l-1&&!(n[c]==="*"&&n[c+1]==="/"))c++;c+=2;continue}if(b==="{"){a++,c++;continue}if(b==="}"){a--,c++;continue}if(a===0){let v=n.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let F=E[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((F)=>{let O=F.trim(),P=O.indexOf(":"),B=P>=0?O.slice(P+1).trim().split(/[\s=]/)[0]:O.split(/[\s=]/)[0];if(B&&!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B)}),c+=A[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let F=j[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=j[0].length;continue}}c++}return t}var Ia=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Pa(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(F){let O;while((O=i.exec(F))!==null){let P=O[0];if(!Ia.has(P))t.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)n(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)n(l[1]);let b=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=b.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)n(l[1]);return t}async function je(e,t={}){let i=e,n="",a=!1,l=[],c=yi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=c.code;let b=bi(c.styles),v=Mt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
185
|
+
`)c++;continue}if(b==="/"&&n[c+1]==="*"){c+=2;while(c<l-1&&!(n[c]==="*"&&n[c+1]==="/"))c++;c+=2;continue}if(b==="{"){a++,c++;continue}if(b==="}"){a--,c++;continue}if(a===0){let v=n.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let F=E[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((F)=>{let O=F.trim(),P=O.indexOf(":"),B=P>=0?O.slice(P+1).trim().split(/[\s=]/)[0]:O.split(/[\s=]/)[0];if(B&&!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B)}),c+=A[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let F=j[1];if(!F.startsWith("_")&&!i.has(F))t.push(F),i.add(F);c+=j[0].length;continue}}c++}return t}var Ia=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Pa(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(F){let O;while((O=i.exec(F))!==null){let P=O[0];if(!Ia.has(P))t.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)n(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)n(l[1]);let b=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=b.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)n(l[1]);return t}async function je(e,t={}){let i=e,n="",a=!1,l=[],c=yi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=c.code;let b=bi(c.styles),v=Mt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-fn0419dn.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),a=!0;if(t.autoImports!==!1){let D=Gc(i);i=D.code,n=Jc(D.stxImports,D.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${wn(i,t.serverData)}${n}`,i=I(i),!a&&Be(t.attrs||""))i=Fe(i);let j=Ta(t.eventBindings||[]),F=(t.attrs||"").trim(),O=/\btype\s*=\s*["']module["']/i.test(F),P=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(O){let D=F.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${P}${D?` ${D}`:""}`;return`${b}<script ${ee}>
|
|
186
186
|
${pn(`${n}${i}
|
|
187
187
|
${j}`)}
|
|
188
188
|
</script>`}let B=Pi(e),L=/function __stx_setup_/.test(i),H=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function G(D){let ee=D.length>0?`
|
|
@@ -570,8 +570,8 @@ ${E.join(`
|
|
|
570
570
|
`){let P=e[a];if(P==="\\"){a+=2;continue}if(P==="[")O=!0;else if(P==="]")O=!1;else if(P==="/"&&!O){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},F=()=>{if(n!==0)return;let O=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(O){let H=O[2].split(",").map((G)=>{let D=G.trim().split(":");return D[D.length-1].trim()});for(let G of H)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!i.has(G))t.push(G),i.add(G);return}let P=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(P){let H=P[2];if(!i.has(H))t.push(H),i.add(H);return}let B=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let H=B[1];if(!i.has(H))t.push(H),i.add(H);return}let L=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let H=L[1];if(!i.has(H))t.push(H),i.add(H)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){b();continue}if(e[a]==="/"&&A()){j();continue}if(e[a]==="{"){n++,a++;continue}if(e[a]==="}"){n--,a++;continue}if(n===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))F();a++}return t}function Gl(e){let t=[],i=0,n=0,a=null;for(let l=0;l<e.length;l++){let c=e[l];if(a){if(c==="\\"){l++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;else if(c===","&&i===0)t.push(e.slice(n,l)),n=l+1}if(n<e.length)t.push(e.slice(n));return t}function Yl(e){let t=0,i=null;for(let n=0;n<e.length;n++){let a=e[n];if(i){if(a==="\\"){n++;continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;else if(a==="="&&t===0){let l=e[n-1],c=e[n+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(c==="="||c===">")continue;return n}}return-1}function Ql(e,t){try{let i=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!i)return;let n=i.index-1;while(n>=0&&/\s/.test(e[n]))n--;if(e[n]!=="}")return;let a=n,l=0,c=-1;for(;n>=0;n--){let v=e[n];if(v==="}")l++;else if(v==="{"){if(l--,l===0){c=n;break}}}if(c===-1)return;let b=e.slice(c+1,a);for(let v of Gl(b)){let E=v.trim();if(!E||E.startsWith("..."))continue;let A=Yl(E);if(A===-1)continue;let j=E.slice(0,A).trim();if(!/^[A-Z_$][\w$]*$/i.test(j))continue;if(t[j]!==void 0)continue;let F=E.slice(A+1).trim();if(!F)continue;try{let O=Object.keys(t).filter(Bt),P=Function(...O,`"use strict"; return (${F});`);t[j]=P(...O.map((B)=>t[B]))}catch{}}}catch{}}var eu=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function hg(e,t){let i=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!i)return null;let n=i[2].toLowerCase();if(!eu.has(n))return null;let a=new RegExp(`<\\/?${n}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=y(e,(E,A)=>(a.lastIndex=A,a.exec(E)?.index===A?a.lastIndex:-1));if(n==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let c=0,b=!1;for(let E of l){if(c+=E.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(E.end).trim())return null;b=!0;break}}if(!b)return null;let v=i[0].length;return e.slice(0,v)+t+e.slice(v)}function Oo(e,t){if(!e)return!1;return[...t.additionalComponentsDirs??[],...t.fallbackComponentsDir?[t.fallbackComponentsDir]:[]].some((n)=>{let a=ae.relative(ae.resolve(n),ae.resolve(e));return!a.startsWith("..")&&!ae.isAbsolute(a)})}async function Er(e,t,i,n,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,c=(te)=>te.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),b=i.__importedComponents;if(b){for(let te of[l,l.toLowerCase(),c(l),U(l)])if(b.has(te))return!0}let v=[...new Set([`${l}.stx`,`${c(l)}.stx`,`${U(l)}.stx`])],E=typeof a.root==="string"?ae.resolve(a.root):void 0,A=E??ae.dirname(n),j=[],F=(te)=>{if(te&&!j.includes(te))j.push(te)};for(let te of fs(n,E))F(te);let O=i.__originalFilePath;if(O)F(ae.join(ae.dirname(O),"components"));if(Oo(t,a))F(a._rootComponentsDir);F(t),F(a._rootComponentsDir),F(ae.join(ae.dirname(n),"components")),F(a.componentsDir);for(let te of a.additionalComponentsDirs??[])F(te);let P=a._targetComponentFallbackNames?.some((te)=>te.toLowerCase()===l.toLowerCase());if(!P)for(let te of a._targetComponentDirs??[])F(te);if(E)F(ae.resolve(E,"resources/views/components")),F(ae.resolve(E,"resources/components")),F(ae.resolve(E,"src/components")),F(ae.resolve(E,"components"));for(let te of a._layerComponentDirs??[])F(te);let B=a._pluginComponentDirs;if(Array.isArray(B))for(let te of B)F(typeof te==="string"?te:null);if(F(a.fallbackComponentsDir),P)for(let te of a._targetComponentDirs??[])F(te);let L=a._nativePrimitivesFallback;if(L&&!L.except.some((te)=>te.toLowerCase()===l.toLowerCase()))F(L.dir);if(l.startsWith("./")||l.startsWith("../"))return s(ae.resolve(ae.dirname(n),`${l}.stx`));let H=Eo(ae.resolve(import.meta.dir,"components")),G=j.map((te)=>ae.isAbsolute(te)?te:ae.resolve(A,te)),D=`${v.join("\x00")}\x00\x00${G.join("\x00")}`,ee=nr.get(D);if(ee!==void 0)return ee;let ne=!1;e:for(let te of G){if(Eo(te)===H)continue;for(let le of v)if(await s(ae.join(te,le))){ne=!0;break e}}return nr.set(D,ne),ne}function Eo(e){let t=sr.get(e);if(t!==void 0)return t;let i=e;try{i=Gn.realpathSync(e)}catch{}return sr.set(e,i),i}function yg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Yc(e){if(!e)return!1;let t=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(t)}function tu(e,t,i){if(!e.includes("{{")&&!e.includes("{!!"))return e;let n=(a,l)=>{let c;try{c=R(a,t)}catch{return l}if(c===void 0||c===null)return"";let b=String(c);if(/<\/style/i.test(b))return console.warn(`[stx] a <style> expression in ${i??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return b};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>n(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>n(l,a))}var ko=new Set;function Ro(e,t,i,n){let a=`${e}\x00${t}\x00${n??""}`;if(!process.env.STX_DEBUG&&ko.has(a))return;ko.add(a);let l=t?` used in ${t}`:"",c=n?` Cause: ${n}.`:"",b=i.length>0?`
|
|
571
571
|
searched:
|
|
572
572
|
${i.map((v)=>` - ${v}`).join(`
|
|
573
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${b}`)}function Co(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var nu=new Set(["for","if","show","key","ref","class","className","style"]),Ao=new Set,Mo="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Zc=new RegExp(`\\b(?:${Mo})\\s*(?:<[^>]*>)?\\s*\\(`);function wi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Mo})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let a;while((a=i.exec(n))!==null)t.add(a[1]);i.lastIndex=0}return[...t]}async function ze(e,t,i,n,a,l,c,b=new Set,v,E=st(a),A,j=e){let{extractVariables:F}=await o("stx/variable-extractor",()=>import("./chunk-xd9t20sx.js")),O=b??new Set;if(O.has(e))return`[Circular component reference: ${e}]`;let P=new Set(O);P.add(e);let B=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let L=B&&B!=="load"&&yg(B)?B:"";try{let H=(re)=>re.split("-").map((ce)=>ce.charAt(0).toUpperCase()+ce.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,D=null,ee=a.__importedComponents;if(ee){let re=[G,G.toLowerCase(),H(G),U(G)];for(let ce of re)if(ee.has(ce)){D=ee.get(ce);break}}let ne=[];if(!D){let re=[`${G}.stx`,`${H(G)}.stx`,`${U(G)}.stx`],ce=[...new Set(re)],_e=a.__originalFilePath,be=[];if(be.push(...c._layerComponentDirs??[]),_e){let ye=ae.join(ae.dirname(_e),"components");be.push(ye)}let Ve=c._rootComponentsDir;if(typeof Ve==="string"&&Oo(n,c)&&!be.includes(Ve))be.push(Ve);if(n&&!be.includes(n))be.push(n);if(typeof Ve==="string"&&!be.includes(Ve))be.push(Ve);let Te=ae.join(ae.dirname(l),"components");if(!be.includes(Te))be.push(Te);if(c.componentsDir&&c.componentsDir!==n&&!be.includes(c.componentsDir))be.push(c.componentsDir);for(let ye of c.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ft=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),pt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),rs=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),is=!pt.includes("valuechange")&&(yt||pt.includes("change")&&!rs),mt=c._nativeHostAttrs&&/^textinput$/i.test(G),_t=pt.includes("update:value")&&!pt.includes("input"),qt=c._nativeHostAttrs&&/^video$/i.test(G),os=c._nativeHostAttrs&&/^image$/i.test(G),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),dn=qt&&(wt||un)&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),_n=new Set(["","primary","secondary","outline","ghost","danger"]),$n=typeof t.variant==="string"?t.variant.trim().toLowerCase():"",En=c._nativeHostAttrs&&/^button$/i.test(G)&&!_n.has($n),fr=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&(!ft||is)&&(!mt||_t)&&(!qt||dn)&&(!os||ln)&&!En;for(let ye of fr?[]:c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof c.root==="string"?ae.resolve(c.root):void 0,Ko=St??ae.dirname(l),$t=[];if(St)$t.push(ae.resolve(St,"resources/views/components")),$t.push(ae.resolve(St,"resources/components")),$t.push(ae.resolve(St,"src/components")),$t.push(ae.resolve(St,"components"));$t.push(ae.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let pr=c._pluginComponentDirs;if(Array.isArray(pr)){for(let ye of pr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(c.fallbackComponentsDir&&!be.includes(c.fallbackComponentsDir))be.push(c.fallbackComponentsDir);if(fr){for(let ye of c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let Rn=c._nativePrimitivesFallback;if(Rn&&!Rn.except.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&!be.includes(Rn.dir))be.push(Rn.dir);let dr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ae.isAbsolute(ye)?ye:ae.resolve(Ko,ye)}))];be.length=0,be.push(...dr);let as=`${G}\x00${l}\x00${dr.join("\x00")}`,cs=Xn.get(as);if(cs)if(await s(cs))D=cs;else Xn.delete(as);if(!D&&(G.startsWith("./")||G.startsWith("../")))D=ae.resolve(ae.dirname(l),`${G}.stx`),ne.push(D);else if(!D)for(let ye of be){if(!ye)continue;for(let Cn of ce){let An=ae.join(ye,Cn);if(ne.push(An),await s(An)){D=An;break}}if(D)break;if(!D)try{let Cn=await import("fs");if(!Cn.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let Xo=8,ls=[{path:ye,depth:0}];while(ls.length>0&&!D){let Tn=ls.pop();if(Tn.depth>=Xo)continue;let gr;try{gr=Cn.readdirSync(Tn.path,{withFileTypes:!0})}catch{continue}for(let In of gr){if(!In.isDirectory())continue;if(In.name==="node_modules"||In.name.startsWith("."))continue;let mr=ae.join(Tn.path,In.name);for(let Jo of ce){let us=ae.join(mr,Jo);if(ne.push(us),await s(us)){D=us;break}}if(D)break;ls.push({path:mr,depth:Tn.depth+1})}}}catch{}if(D)break}if(D)Xn.set(as,D)}if(!D||!await s(D))return Ro(e,l,ne),Co(e);v.add(D);let te;if(tn.has(D)&&tr.get(D)===So(D))te=tn.get(D);else try{let re=So(D);te=await Bun.file(D).text(),tn.set(D,te),tr.set(D,re)}catch(re){let ce=re instanceof Error?re.message:String(re);return Ro(e,l,[D],ce),Co(e)}if(A)for(let re of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ce=re.toLowerCase();if(ce.startsWith("aria-")||ce.startsWith("data-"))continue;let _e=re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(te))A.declaredProps.add(re);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(te)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(te))A.consumedProps?.add(re)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(te))for(let re of A.reactiveProps){if(nu.has(re)||A.consumedProps?.has(re))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(te))continue;let ce=`${D}\x00${re}`;if(Ao.has(ce))continue;Ao.add(ce),console.warn(`[stx] ${ae.basename(D)} reads \`${re}\` with defineProps(), which is not live, but ${ae.basename(l)} binds it (:${re}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${re}').`)}let le=new Set(["__originalFilePath","__importedComponents",Nn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[re,ce]of Object.entries(a))if(!re.startsWith("__")||le.has(re))he[re]=ce;let ue=E.length>0?{[Vn]:[...E]}:{},Ee=i;if(i.includes("@include")){let{processIncludes:re}=await o("stx/includes",()=>import("./chunk-3f1ks1ah.js"));Ee=await re(i,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:re}=await o("stx/component-renderer",()=>import("./chunk-b3s8tb18.js")),ce={...a,__processedComponents:O,...ue};Ee=await re(Ee,ce,l,c,v);let _e=ce.__stx_preserved_client_expressions;if(Array.isArray(_e)&&_e.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],..._e])]}let Ae=[];if(Yc(Ee)){let{processExpressions:re}=await o("stx/expressions",()=>import("./chunk-k46pfdmn.js")),ce=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ue}:E.length>0?{...a,...ue}:a;Ee=re(Ee,ce,l);for(let _e of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Ae.push(_e[1].trim())}let We=J(Ee),Ke=[],Ye=We.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(re,ce)=>{let _e=We.scripts[Number(ce)]||"",be=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ve=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Te=!Ve||["module","text/javascript","application/javascript"].includes(Ve),ft=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Te&&!ft)return Ke.push(_e),"";return _e}),{extractSlotContent:Xe}=await o("stx/slots",()=>import("./chunk-99ddfv0b.js")),et=Xe(Ye),Je={};if(et.defaultSlot?.trim())Je.default=et.defaultSlot;for(let[re,ce]of et.namedSlots)Je[re]=ce.content;let gt=a.__stx_scope_seq??={n:0,key:Us(String(a.__filename??l))},Ct=Po(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++gt.n}_${gt.key}`,Pe={...he,$uid:it,$native:c._nativeHostAttrs===!0,...t,props:t,slot:Ye,$slots:Je,__processedComponents:P,__sections:{},__stx_signals_gate:ke(te)||Yc(i),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Ae]};if(/import\s/.test(te)){Pe.__importedComponents=new Map(Pe.__importedComponents);let{processESImports:re}=await o("stx/component-renderer",()=>import("./chunk-b3s8tb18.js"));te=await re(te,Pe,D,c,v)}Ql(te,Pe);let Tt=te,sn=pe(Tt);if(sn)Tt=sn.content.trim();let Qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,jt=[...te.matchAll(Qn)];for(let[,re,ce]of jt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(re))Ne(ce,D,c.strict);let Ge=[],Lt=null,es=jt.some((re)=>/\bserver\b/.test(re[1]||"")&&/\bcache\b/.test(re[1]||"")),bt=null,ot=null,zt=null,rn=0,Wt=null;if(ql(c),es&&rr>0){let re=Zl({props:t,slot:Ee,slotContext:i.trim()?Kl(he):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((ce)=>ce.configFile),uid:it});if(re!==null){bt=`${D}\x00${S(te)}\x00${re}`;let ce=Jn.get(bt);if(ce){for(let _e of ce.dependencies)v.add(_e);if(ni(a,ce.clientFactories),gt.n+=ce.uidsConsumed,ce.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let be of ce.preservedClientExpressions)_e.add(be);a.__stx_preserved_client_expressions=[..._e]}return ce.output}ot=new Set(v),zt=ei(a),rn=gt.n,Wt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Ft=new Set;for(let re of jt){let ce=re[1]||"",_e=re[2]||"",be=ce.includes("server");if(Be(ce)&&_e.trim())_e=Fe(_e);if(be&&_e){for(let Te of De(_e))Ft.add(Te);try{await F(_e,Pe,D,{onFailure:(Te)=>{if(Te.kind!=="unknown")Lt=Te.kind}})}catch(Te){}}if(!be){let Te=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ft=Te.includes("{{")&&Te.includes("}}"),pt=Te.includes("{!!")&&Te.includes("!!}");if(ft||pt)Te=xi(Te,Pe,D);let yt=ce.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ge.push(`<script${yt}>${Te}</script>`)}}let Qe=J(te).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Vt=Qe?Qe[1]:"",ts=Qe?Qe[2]:"",at="",se=Vt&&/\bscoped\b/i.test(Vt);if(Qe)at=`<style${Vt}>${tu(ts,Pe,D)}</style>`;let oe=Tt;if(oe=oe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Qe)oe=oe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let re=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ce=[];if(oe=oe.replace(re,(_e,be)=>{let Ve=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ve)ce.push(`<style${Ve[1]}>${Ve[2]}</style>`);return""}),oe=oe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ce.length>0)at=`${at}${ce.join(`
|
|
574
|
-
`)}`}if(i&&oe.includes("{{ text || slot }}"))oe=oe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:de}=await o("stx/slots",()=>import("./chunk-
|
|
573
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${b}`)}function Co(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var nu=new Set(["for","if","show","key","ref","class","className","style"]),Ao=new Set,Mo="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Zc=new RegExp(`\\b(?:${Mo})\\s*(?:<[^>]*>)?\\s*\\(`);function wi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Mo})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let a;while((a=i.exec(n))!==null)t.add(a[1]);i.lastIndex=0}return[...t]}async function ze(e,t,i,n,a,l,c,b=new Set,v,E=st(a),A,j=e){let{extractVariables:F}=await o("stx/variable-extractor",()=>import("./chunk-xa8jn2ym.js")),O=b??new Set;if(O.has(e))return`[Circular component reference: ${e}]`;let P=new Set(O);P.add(e);let B=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let L=B&&B!=="load"&&yg(B)?B:"";try{let H=(re)=>re.split("-").map((ce)=>ce.charAt(0).toUpperCase()+ce.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,D=null,ee=a.__importedComponents;if(ee){let re=[G,G.toLowerCase(),H(G),U(G)];for(let ce of re)if(ee.has(ce)){D=ee.get(ce);break}}let ne=[];if(!D){let re=[`${G}.stx`,`${H(G)}.stx`,`${U(G)}.stx`],ce=[...new Set(re)],_e=a.__originalFilePath,be=[];if(be.push(...c._layerComponentDirs??[]),_e){let ye=ae.join(ae.dirname(_e),"components");be.push(ye)}let Ve=c._rootComponentsDir;if(typeof Ve==="string"&&Oo(n,c)&&!be.includes(Ve))be.push(Ve);if(n&&!be.includes(n))be.push(n);if(typeof Ve==="string"&&!be.includes(Ve))be.push(Ve);let Te=ae.join(ae.dirname(l),"components");if(!be.includes(Te))be.push(Te);if(c.componentsDir&&c.componentsDir!==n&&!be.includes(c.componentsDir))be.push(c.componentsDir);for(let ye of c.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ft=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),pt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),rs=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),is=!pt.includes("valuechange")&&(yt||pt.includes("change")&&!rs),mt=c._nativeHostAttrs&&/^textinput$/i.test(G),_t=pt.includes("update:value")&&!pt.includes("input"),qt=c._nativeHostAttrs&&/^video$/i.test(G),os=c._nativeHostAttrs&&/^image$/i.test(G),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),dn=qt&&(wt||un)&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),_n=new Set(["","primary","secondary","outline","ghost","danger"]),$n=typeof t.variant==="string"?t.variant.trim().toLowerCase():"",En=c._nativeHostAttrs&&/^button$/i.test(G)&&!_n.has($n),fr=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&(!ft||is)&&(!mt||_t)&&(!qt||dn)&&(!os||ln)&&!En;for(let ye of fr?[]:c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof c.root==="string"?ae.resolve(c.root):void 0,Ko=St??ae.dirname(l),$t=[];if(St)$t.push(ae.resolve(St,"resources/views/components")),$t.push(ae.resolve(St,"resources/components")),$t.push(ae.resolve(St,"src/components")),$t.push(ae.resolve(St,"components"));$t.push(ae.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let pr=c._pluginComponentDirs;if(Array.isArray(pr)){for(let ye of pr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(c.fallbackComponentsDir&&!be.includes(c.fallbackComponentsDir))be.push(c.fallbackComponentsDir);if(fr){for(let ye of c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let Rn=c._nativePrimitivesFallback;if(Rn&&!Rn.except.some((ye)=>ye.toLowerCase()===G.toLowerCase())&&!be.includes(Rn.dir))be.push(Rn.dir);let dr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ae.isAbsolute(ye)?ye:ae.resolve(Ko,ye)}))];be.length=0,be.push(...dr);let as=`${G}\x00${l}\x00${dr.join("\x00")}`,cs=Xn.get(as);if(cs)if(await s(cs))D=cs;else Xn.delete(as);if(!D&&(G.startsWith("./")||G.startsWith("../")))D=ae.resolve(ae.dirname(l),`${G}.stx`),ne.push(D);else if(!D)for(let ye of be){if(!ye)continue;for(let Cn of ce){let An=ae.join(ye,Cn);if(ne.push(An),await s(An)){D=An;break}}if(D)break;if(!D)try{let Cn=await import("fs");if(!Cn.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let Xo=8,ls=[{path:ye,depth:0}];while(ls.length>0&&!D){let Tn=ls.pop();if(Tn.depth>=Xo)continue;let gr;try{gr=Cn.readdirSync(Tn.path,{withFileTypes:!0})}catch{continue}for(let In of gr){if(!In.isDirectory())continue;if(In.name==="node_modules"||In.name.startsWith("."))continue;let mr=ae.join(Tn.path,In.name);for(let Jo of ce){let us=ae.join(mr,Jo);if(ne.push(us),await s(us)){D=us;break}}if(D)break;ls.push({path:mr,depth:Tn.depth+1})}}}catch{}if(D)break}if(D)Xn.set(as,D)}if(!D||!await s(D))return Ro(e,l,ne),Co(e);v.add(D);let te;if(tn.has(D)&&tr.get(D)===So(D))te=tn.get(D);else try{let re=So(D);te=await Bun.file(D).text(),tn.set(D,te),tr.set(D,re)}catch(re){let ce=re instanceof Error?re.message:String(re);return Ro(e,l,[D],ce),Co(e)}if(A)for(let re of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ce=re.toLowerCase();if(ce.startsWith("aria-")||ce.startsWith("data-"))continue;let _e=re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(te))A.declaredProps.add(re);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(te)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(te))A.consumedProps?.add(re)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(te))for(let re of A.reactiveProps){if(nu.has(re)||A.consumedProps?.has(re))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(te))continue;let ce=`${D}\x00${re}`;if(Ao.has(ce))continue;Ao.add(ce),console.warn(`[stx] ${ae.basename(D)} reads \`${re}\` with defineProps(), which is not live, but ${ae.basename(l)} binds it (:${re}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${re}').`)}let le=new Set(["__originalFilePath","__importedComponents",Nn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[re,ce]of Object.entries(a))if(!re.startsWith("__")||le.has(re))he[re]=ce;let ue=E.length>0?{[Vn]:[...E]}:{},Ee=i;if(i.includes("@include")){let{processIncludes:re}=await o("stx/includes",()=>import("./chunk-kkvyy9an.js"));Ee=await re(i,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:re}=await o("stx/component-renderer",()=>import("./chunk-mpd57aqc.js")),ce={...a,__processedComponents:O,...ue};Ee=await re(Ee,ce,l,c,v);let _e=ce.__stx_preserved_client_expressions;if(Array.isArray(_e)&&_e.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],..._e])]}let Ae=[];if(Yc(Ee)){let{processExpressions:re}=await o("stx/expressions",()=>import("./chunk-h12ekfb7.js")),ce=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ue}:E.length>0?{...a,...ue}:a;Ee=re(Ee,ce,l);for(let _e of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Ae.push(_e[1].trim())}let We=J(Ee),Ke=[],Ye=We.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(re,ce)=>{let _e=We.scripts[Number(ce)]||"",be=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ve=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Te=!Ve||["module","text/javascript","application/javascript"].includes(Ve),ft=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Te&&!ft)return Ke.push(_e),"";return _e}),{extractSlotContent:Xe}=await o("stx/slots",()=>import("./chunk-ek3gqadc.js")),et=Xe(Ye),Je={};if(et.defaultSlot?.trim())Je.default=et.defaultSlot;for(let[re,ce]of et.namedSlots)Je[re]=ce.content;let gt=a.__stx_scope_seq??={n:0,key:Us(String(a.__filename??l))},Ct=Po(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++gt.n}_${gt.key}`,Pe={...he,$uid:it,$native:c._nativeHostAttrs===!0,...t,props:t,slot:Ye,$slots:Je,__processedComponents:P,__sections:{},__stx_signals_gate:ke(te)||Yc(i),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Ae]};if(/import\s/.test(te)){Pe.__importedComponents=new Map(Pe.__importedComponents);let{processESImports:re}=await o("stx/component-renderer",()=>import("./chunk-mpd57aqc.js"));te=await re(te,Pe,D,c,v)}Ql(te,Pe);let Tt=te,sn=pe(Tt);if(sn)Tt=sn.content.trim();let Qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,jt=[...te.matchAll(Qn)];for(let[,re,ce]of jt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(re))Ne(ce,D,c.strict);let Ge=[],Lt=null,es=jt.some((re)=>/\bserver\b/.test(re[1]||"")&&/\bcache\b/.test(re[1]||"")),bt=null,ot=null,zt=null,rn=0,Wt=null;if(ql(c),es&&rr>0){let re=Zl({props:t,slot:Ee,slotContext:i.trim()?Kl(he):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((ce)=>ce.configFile),uid:it});if(re!==null){bt=`${D}\x00${S(te)}\x00${re}`;let ce=Jn.get(bt);if(ce){for(let _e of ce.dependencies)v.add(_e);if(ni(a,ce.clientFactories),gt.n+=ce.uidsConsumed,ce.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let be of ce.preservedClientExpressions)_e.add(be);a.__stx_preserved_client_expressions=[..._e]}return ce.output}ot=new Set(v),zt=ei(a),rn=gt.n,Wt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Ft=new Set;for(let re of jt){let ce=re[1]||"",_e=re[2]||"",be=ce.includes("server");if(Be(ce)&&_e.trim())_e=Fe(_e);if(be&&_e){for(let Te of De(_e))Ft.add(Te);try{await F(_e,Pe,D,{onFailure:(Te)=>{if(Te.kind!=="unknown")Lt=Te.kind}})}catch(Te){}}if(!be){let Te=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ft=Te.includes("{{")&&Te.includes("}}"),pt=Te.includes("{!!")&&Te.includes("!!}");if(ft||pt)Te=xi(Te,Pe,D);let yt=ce.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ge.push(`<script${yt}>${Te}</script>`)}}let Qe=J(te).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Vt=Qe?Qe[1]:"",ts=Qe?Qe[2]:"",at="",se=Vt&&/\bscoped\b/i.test(Vt);if(Qe)at=`<style${Vt}>${tu(ts,Pe,D)}</style>`;let oe=Tt;if(oe=oe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Qe)oe=oe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let re=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ce=[];if(oe=oe.replace(re,(_e,be)=>{let Ve=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ve)ce.push(`<style${Ve[1]}>${Ve[2]}</style>`);return""}),oe=oe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ce.length>0)at=`${at}${ce.join(`
|
|
574
|
+
`)}`}if(i&&oe.includes("{{ text || slot }}"))oe=oe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:de}=await o("stx/slots",()=>import("./chunk-ek3gqadc.js")),{defaultSlot:we,namedSlots:Re}=et,qe=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ye),tt=Ge.length>0&&Rs(oe)||c._nativeHostAttrs===!0&&Ge.length>0||qe&&Ge.length>0||Ge.some((re)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(re)),ns=(re)=>tt?Ki(re,it):re,ss=new Map([...Re].map(([re,ce])=>[re,{...ce,content:ns(ce.content)}]));oe=await de(oe,tt?Zi(ns(we),it):we,ss,Pe,tt?it:"");let on=wi(Ge),Ut=(Array.isArray(Pe.__stx_client_signal_names)?Pe.__stx_client_signal_names:[]).filter((re)=>!Ft.has(re));if(on.length>0||Ut.length>0)Pe.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete Pe.__stx_client_signal_names;let Ht=E.filter((re)=>!Ft.has(re)&&!(re in t));if(Ht.length>0)Pe[Vn]=Ht;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ae.dirname(D),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||tt||Ge.length===0,defaultLayout:void 0};Pe.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:cn}=await o("stx/process",()=>import("./chunk-s5gt7k23.js")),nt=await cn(oe,Pe,D,an,v),ut=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let re of nt.matchAll(/\{\{([\s\S]*?)\}\}/g))ut.add(re[1].trim());if(ut.size>0)a.__stx_preserved_client_expressions=[...ut];let lt=it,Ze=nt;if(tt){let re="";if(Object.keys(t).length>0)try{re=` data-stx-props="${Qs(JSON.stringify(t))}"`}catch{}let ce=L?` stx-hydrate="${Qs(L)}"`:"",_e=Object.fromEntries(Object.entries(Je).map(([mt,_t])=>[mt,Boolean(_t)])),be=Object.keys(_e).length>0?` data-stx-slots="${Qs(JSON.stringify(_e))}"`:"",Ve=` data-stx-scope="${lt}"${re}${be}${ce}`,Te=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(nt),ft=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(nt),pt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(nt),yt=Te?"span":"div",rs=ft&&c._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':pt&&c._nativeHostAttrs?' style="width:100%;height:100%"':Te||ft?' style="display:contents"':"";Ze=hg(nt,Ve)??`<${yt}${Ve} data-stx-component-wrapper${rs}>${nt}</${yt}>`;let is=await Promise.all(Ge.map(async(mt)=>{let _t=mt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return mt;let[,qt,os]=_t,ln=wo(mt,Pe,D);if(ln!==null)return ln;let wt=await ru(os,D,c.buildMode==="compile"),un=wn(wt.clientCode,Le(Pe)),{vendorStyleTags:dn}=wt,_n=un?`function(__scopeId) {
|
|
575
575
|
${un}
|
|
576
576
|
return (${wt.factoryBody})(__scopeId);
|
|
577
577
|
}`:wt.factoryBody,$n=L?null:_s(a,_n),En=$n?`window.__stxComponentFactories[${JSON.stringify($n)}](${JSON.stringify(lt)});`:`(${_n})(${JSON.stringify(lt)});`;if(L)return`${dn}<script type="stx/island" data-stx-island="${lt}" data-stx-scoped data-stx-owner="${lt}"${qt}>${En}</script>`;return`${dn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${lt}"${qt}>${En}</script>`}));if(Ze=Ze+`
|
|
@@ -597,7 +597,7 @@ ${ve.yellow}${ve.bold}Message:${ve.reset} ${t}
|
|
|
597
597
|
`,b)A+=`
|
|
598
598
|
${ve.blue}${ve.bold}Context:${ve.reset}
|
|
599
599
|
${ve.dim}${b}${ve.reset}
|
|
600
|
-
`;return A}function ge(){tn.clear(),tr.clear(),Xn.clear(),nr.clear(),sr.clear(),Jn.clear()}function Zh(){return{size:tn.size,maxSize:500}}var er=w(128);async function ru(e,t,i){let n=S(e,t,i),a=er.get(n);if(a){if(Ls(a.deps))return a;er.delete(n)}let l=yi(e,{filePath:t,projectRoot:process.cwd()}),c=l.code,b=bi(l.styles);c=Mt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
600
|
+
`;return A}function ge(){tn.clear(),tr.clear(),Xn.clear(),nr.clear(),sr.clear(),Jn.clear()}function Zh(){return{size:tn.size,maxSize:500}}var er=w(128);async function ru(e,t,i){let n=S(e,t,i),a=er.get(n);if(a){if(Ls(a.deps))return a;er.delete(n)}let l=yi(e,{filePath:t,projectRoot:process.cwd()}),c=l.code,b=bi(l.styles);c=Mt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-fn0419dn.js")),A=[],j=!1;if(v(c)){let G=c;c=await E(G,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),j=c===G}let{stripStxRuntimeImports:F}=await o("stx/signal-processing",()=>import("./chunk-vjh6va50.js"));c=F(c);let O=I(c),P=Jl(O),B=new Set(V(O,!0).split(",").map((G)=>G.trim())),L=`function(__scopeId) {
|
|
601
601
|
${ct("const",[...pl,...P],O)}
|
|
602
602
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
603
603
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,Me}from"./chunk-
|
|
2
|
+
import{q,Me}from"./chunk-7kzxmm80.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function en(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Me(t,s);if(p>s){c=p;continue}let a=q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
|
|
3
3
|
export{en};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nr,Re}from"./chunk-tx8wk6h7.js";import{V,w,wr,Ls,C}from"./chunk-qbvy23qa.js";import{a,O}from"./chunk-ecmvq302.js";import{No}from"./chunk-v4kenb7z.js";import{rt}from"./chunk-car6nhfe.js";import{c}from"./chunk-9w3r1ch2.js";import{r,me}from"./chunk-fwktw49p.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||No(t,e,n)}var at=2;function Sf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var st=new Map;function wt(t){let e=p.resolve(t),n=st.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),st.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function kf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var H=new Map;async function jt(t){let e=H.get(t)??0;if(e>0&&e<vt){H.set(t,e+1);return}H.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=kf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,b)=>b.at-o.at);for(let o of d.slice(i)){let b=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${b}.js`),{force:!0}),await B.promises.rm(p.join(t,`${b}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function ye(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function _f(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(_f())console.log("[stx:bundler]",...t)}var K=[];function nc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function tn(){return K.slice()}function nn(){K.length=0}var Q;function Eh(t){Q=t}function rc(){if(Q)return Q;try{let t=O.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function rn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var tr="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Cf(t,e){return p.relative(t,e).split(p.sep).join("/")}function Ef(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(tr)?`${i}${l}${o}${l}`:n})}function Tf(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,b=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let b of d.split(",")){let I=b.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,b)=>{let I=b.slice(tr.length),M=i(I),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(tr.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var G=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return G.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function sn(){return G.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,b,I,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(X(s,t,b))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${tr}${Cf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(s.importer,h,s.path);if(D)return D;return A(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${tr}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(X(s.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=I?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,P=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function $f(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function on(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||Sf(i),M=G.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${rt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(I,`${f}.js`),y=P.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!X(h.path,i,l))){A("memo hit:",f);let h=y.files.map((D)=>D.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(I,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),D=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=wr(N.files.map((g)=>ct(g,i))),D=k.length===N.files.length&&!k.some((g)=>X(g.path,i,l))}catch{D=!1}if(D){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((D)=>D.path));return h}let E=$f(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:I,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:b,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function sc(t){return`${t}-${process.pid}-${yt()}`}async function Th(t,e){let{projectRoot:n}=e,i=sc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,b=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${b++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),I,M,S,!1,new Map,void 0,G.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:b,depsPath:I,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=sc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:D,balanced:k}=me(h),N=(R)=>!k||D[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
|
|
2
|
+
import{nr,Re}from"./chunk-tx8wk6h7.js";import{V,w,wr,Ls,C}from"./chunk-7kzxmm80.js";import{a,O}from"./chunk-d85fvcf5.js";import{No}from"./chunk-cyd6s7tj.js";import{rt}from"./chunk-car6nhfe.js";import{c}from"./chunk-9w3r1ch2.js";import{r,me}from"./chunk-fwktw49p.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||No(t,e,n)}var at=2;function Sf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var st=new Map;function wt(t){let e=p.resolve(t),n=st.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),st.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function kf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var H=new Map;async function jt(t){let e=H.get(t)??0;if(e>0&&e<vt){H.set(t,e+1);return}H.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=kf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,b)=>b.at-o.at);for(let o of d.slice(i)){let b=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${b}.js`),{force:!0}),await B.promises.rm(p.join(t,`${b}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function ye(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function _f(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(_f())console.log("[stx:bundler]",...t)}var K=[];function nc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function tn(){return K.slice()}function nn(){K.length=0}var Q;function Eh(t){Q=t}function rc(){if(Q)return Q;try{let t=O.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function rn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var tr="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Cf(t,e){return p.relative(t,e).split(p.sep).join("/")}function Ef(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(tr)?`${i}${l}${o}${l}`:n})}function Tf(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,b=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let b of d.split(",")){let I=b.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,b)=>{let I=b.slice(tr.length),M=i(I),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(tr.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var G=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return G.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function sn(){return G.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,b,I,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(X(s,t,b))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${tr}${Cf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(s.importer,h,s.path);if(D)return D;return A(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${tr}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(X(s.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=I?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,P=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function $f(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function on(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||Sf(i),M=G.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${rt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(I,`${f}.js`),y=P.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!X(h.path,i,l))){A("memo hit:",f);let h=y.files.map((D)=>D.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(I,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),D=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=wr(N.files.map((g)=>ct(g,i))),D=k.length===N.files.length&&!k.some((g)=>X(g.path,i,l))}catch{D=!1}if(D){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((D)=>D.path));return h}let E=$f(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:I,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:b,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function sc(t){return`${t}-${process.pid}-${yt()}`}async function Th(t,e){let{projectRoot:n}=e,i=sc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,b=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${b++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),I,M,S,!1,new Map,void 0,G.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:b,depsPath:I,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=sc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:D,balanced:k}=me(h),N=(R)=>!k||D[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
|
|
3
3
|
export { ${[...s].join(", ")} }`:"";A("bundling:",o,"from:",p.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:l?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ut(i,j,v,t+pt,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":l?'"production"':'"development"',...C()},root:i});if(!R.success){let F=R.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${p.basename(e)}`,z=nr(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),nc(e||"",F,z),n.throwOnFailure||rc()==="error")throw Error(F);return t}let m="";for(let x of R.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let z=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){_.push([z[2],z[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))_.push([T,T])}if(n.expose){let x=new Set(n.expose);for(let F=_.length-1;F>=0;F--)if(!x.has(_[F][0]))_.splice(F,1)}let L=[];m=Tf(Ef(m,et),L);let dt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),l&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let J=`__stxBundle_${o}`,ft=new Set(V(t,!0).split(",").map((x)=>x.trim())),mt=_.map(([x,F])=>`get ${JSON.stringify(x)}() { return ${F} }${ft.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${F}) { ${F} = __stxValue_${F} }`:""}`).join(", "),gt=_.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
4
|
`),ht=_.map(([x])=>`${x} = ${J}[${JSON.stringify(x)}];`).join(`
|
|
5
5
|
`);if(m=`${dt.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{an,Po,Io,Oo,$h,No}from"./chunk-
|
|
2
|
+
import{an,Po,Io,Oo,$h,No}from"./chunk-cyd6s7tj.js";import"./chunk-amg6kr1p.js";import"./chunk-29f6vmyz.js";import"./chunk-vfj9wp11.js";export{Io as buildServerApi,$h as createServerApi,an as discoverServerApi,Po as generateApiTypes,No as isServerApiSource,Oo as productionApiDispatcher};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Oe,w,S,C,Z}from"./chunk-
|
|
2
|
+
import{Oe,w,S,C,Z}from"./chunk-7kzxmm80.js";import{k}from"./chunk-4ntm3dtk.js";import{I,$n}from"./chunk-s6r54dyf.js";import{a}from"./chunk-d85fvcf5.js";import{ye,rn,sn,on}from"./chunk-8dr42g11.js";import{vt}from"./chunk-91qky0er.js";import{ht,Vn,Jt,le}from"./chunk-33czswpt.js";import{E,Tn}from"./chunk-jr0r5pzw.js";import h from"path";var v=new Map,A=new Map,F=w(64),R=new Map,Y=["composables","functions"];function H(e){let s=h.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function ee(e){if(e)return h.resolve(e);let s=`<default>:${process.cwd()}`,r=R.get(s);if(r!==void 0)return r;let t=await te();if(t!==null)R.set(s,t);return t}async function te(){let e=await a(),s=e.root||process.cwd(),r=e.composablesDir;if(r)return h.resolve(s,r);for(let t of Y){let n=h.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let i of c.scan({cwd:n,absolute:!0}))if(!H(i))return n}catch{}}return null}async function W(e){let s=Array.isArray(e)?e:e?[h.resolve(e)]:(await a())._layerComposableDirs??[await ee()].filter((t)=>!!t),r=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let i=h.relative(t,c);if(!H(c)&&!r.has(i))r.set(i,c)}}catch{}}return{key:s.join("\x00"),files:[...r.values()].sort()}}async function vo(e){let{files:s}=await W(e),r=Z({loader:"ts",target:"browser",define:C()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),i=r.scan(c).exports.filter((u)=>u!=="default");if(i.length>0)t.push({file:n,names:i})}catch{}return t}function ne(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function P(e,s){let r=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?r.has(n):ne(e,n))t.add(n);return t}var J=w(64);function X(e,s){let r=S(e,s.size),t=J.get(r);if(t)return t;let n;try{n=Oe(e,s)}catch{n=P(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let i of c)for(let u of i[1].split(",")){let f=u.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return J.set(r,n),n}function se(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var L=w(256);function oe(e,s){let r=new Set(s),t="",n=0,c=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)){t+=e.slice(n,i.index),n=i.index+i[0].length;let u=i[1]??"",f=i[2]??"",d=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(u),m=d?(d[1]??d[2]??d[3]??"").trim():void 0;if(!se(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let y=P(f,r);if(y.size===0)continue;let _=S(f,[...y].sort().join(",")),b=L.get(_);if(!b)b=X(f,y),L.set(_,b);for(let B of b)c.add(B)}t+=e.slice(n);for(let i of P(t,r))c.add(i);return c}function ie(e,s,r){let t=new Map;for(let{file:f,names:d}of e)for(let m of d)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let d=[];for(let m of X(f,n))d.push(t.get(m));return d},i=new Set,u=r.flatMap((f,d)=>d===0?[...oe(f,t.keys())].map((m)=>t.get(m)):c(f));while(u.length>0){let f=[];for(let d of u){if(i.has(d))continue;i.add(d);for(let m of c(s.get(d)??""))if(!i.has(m))f.push(m)}u=f}return i}async function ph(e,s,r,t){let{key:n,files:c}=await W(e);if(!n)return null;let i=()=>[...new Set([...c,...c.flatMap((o)=>ye(o))])],u=ht(i());if(c.length===0)return le(v,n,u,""),null;c.sort();let f=Z({loader:"ts",target:"browser",define:C()}),d=Jt(A,n,u);if(!d){let o=new Map,l=[];for(let p of c)try{let x=await Bun.file(p).text();o.set(p,x);let g=f.scan(x).exports.filter((V)=>V!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}d=le(A,n,u,{codeByFile:o,modules:l})}let{codeByFile:m,modules:y}=d,_;if(s===void 0)_=new Set(c);else{let o=r?[s,...r]:[s],l=S(o.join("\x00"),n,o.length,u),p=F.get(l);if(_=p??ie(y,m,o),!p)F.set(l,_)}if(_.size===0)return null;let b=c.filter((o)=>_.has(o)),B=()=>{if(!t)return;for(let o of b)t.push(o,...ye(o))},N=`${n}\x00${b.join("\x00")}\x00${sn()}`,U=Jt(v,N,u);if(U!==void 0)return B(),U||null;let D=[],M=new Set,T=new Set;for(let o of b)try{let l=m.get(o)??await Bun.file(o).text(),p=h.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])T.add(g[1]);let x=[];try{for(let g of f.scan(l).exports)if(g!=="default")M.add(g),x.push(g)}catch{}if(l=I(l),rn(l))l=await on(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),l=vt(l);l=$n(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),D.push(`// Composable: ${p}
|
|
3
3
|
${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return le(v,N,u,""),null;let q=[...M].map((o)=>` try { if (!(${JSON.stringify(o)} in __c)) __c[${JSON.stringify(o)}] = ${o}; } catch (e) {}`).join(`
|
|
4
4
|
`),z=JSON.stringify([...M]),j=D.join(`
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ps,Df,zo,Lf}from"./chunk-
|
|
2
|
+
import{ps,Df,zo,Lf}from"./chunk-14dmmthm.js";import"./chunk-3bjnrmha.js";import"./chunk-91qky0er.js";import"./chunk-944tcqgg.js";import"./chunk-ya6bp08c.js";import"./chunk-d85fvcf5.js";import"./chunk-qq19g7e2.js";import"./chunk-gh62p9mx.js";import"./chunk-amg6kr1p.js";import"./chunk-ms3v5nat.js";import"./chunk-29f6vmyz.js";import{Pt}from"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{Lf as declareBareLoopHead,Pt as parseLoopBinding,Df as processLoops,zo as processLoopsAsync,ps as reportDeferredLoopWarnings};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ct,gl}from"./chunk-4ntm3dtk.js";import{I}from"./chunk-s6r54dyf.js";import{V,Os,o,pn,q,y,Ic,Mt,wn,Be,Fe}from"./chunk-
|
|
2
|
+
import{ct,gl}from"./chunk-4ntm3dtk.js";import{I}from"./chunk-s6r54dyf.js";import{V,Os,o,pn,q,y,Ic,Mt,wn,Be,Fe}from"./chunk-7kzxmm80.js";import{lr}from"./chunk-944tcqgg.js";import{B}from"./chunk-ybq56wam.js";import{un}from"./chunk-ya6bp08c.js";var X=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,O=new Map;function Dh(){O.clear()}function K(e){let c=[];for(let t of y(e,q)){let n=t.token.match(/^<script\b([^>]*)>/i),s=t.token.match(/<\/script\s*>$/i);if(!n||!s)continue;let u=n[0].length,f=t.token.length-s[0].length;c.push(Object.freeze({fullMatch:t.token,attrs:n[1],body:t.token.slice(u,f),start:t.start,end:t.end}))}return c}function gs(e,c={}){let t=e.length>=Q,n=t?O.get(e):void 0;if(n===void 0){if(n=K(e),t)Ic(O,J),O.set(e,n)}let s=c.skipAttrs;if(!s)return n.slice();let u=[];for(let f of n)if(s.lastIndex=0,!s.test(f.attrs))u.push(f);return u}function Wo(e){let c=e.trim(),t=c.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(t){let s=t[1].trim(),u=t[2].trim(),{itemVar:f,indexVar:i}=z(u);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:i}}let n=c.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(n){let s=n[1].trim(),u=n[2].trim(),{itemVar:f,indexVar:i}=z(s);if(f)return{style:"in",iterable:u,itemVar:f,indexVar:i}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function z(e){let c=e.trim(),t=c.match(/^(\w+)\s*=>\s*(\w+)$/);if(t)return{itemVar:t[2],indexVar:t[1]};let n=c.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(n)return{itemVar:n[1],indexVar:n[2]||null};let s=c.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let u=c.match(/^(\w+)$/);if(u)return{itemVar:u[1],indexVar:null};return{itemVar:null,indexVar:null}}function ms(e,c){return gl(e,c)}function Y(e){let c=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,t=0,n;while((n=c.exec(e))!==null){let s=n[1];if(s.startsWith("if"))t++;else if(s==="endif")t--;else if(t===0)return!0}return!1}function ar(e){let c=new Set,t=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,n=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=t.exec(e))!==null){let u=s[1],f;while((f=n.exec(u))!==null)c.add(f[1])}return c}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let c=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${X})>`,"iy"),t=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,n=y(e,(u,f)=>{c.lastIndex=f;let i=c.exec(u);if(!i||i.index!==f||!t.test(i[2]))return-1;return c.lastIndex}),s=[];for(let u of n){c.lastIndex=0;let f=c.exec(u.token);if(!f)continue;let i=f[2].match(t),p=Wo(i?.[1]??i?.[2]??""),m=[p.itemVar,p.indexVar].filter(Boolean);if(m.length===0)continue;let r=f[1],g=/\/\s*>$/.test(u.token)||P.has(r.toLowerCase())?u.end:D(e,u.start,r,u.end);if(g!==-1)s.push({start:u.start,end:g,vars:new Set(m)})}return s}var W=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 te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function Z(e,c,t,n){if(!e)return!1;let s=te(e),u=!1,f=!1,i=!1,p=/([a-zA-Z_$][\w$]*)/g,m;while((m=p.exec(s))!==null){let l=m[1];if(s.slice(0,m.index).trimEnd().endsWith("."))continue;if(W.has(l))continue;if(c.has(l)||n?.has(l))u=!0;else if(t&&l in t)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,a;while((a=r.exec(s))!==null){let l=a[1];if(s.slice(0,a.index).trimEnd().endsWith("."))continue;if(W.has(l)||t&&l in t)continue;i=!0}return(u||i)&&!f}function M(e,c,t){let n=t===void 0?` ${c}`:` ${c}="${t.replace(/"/g,""")}"`,s=e.trim(),u=s.match(H);if(u&&ne(u[3],u[1])){let[,f,i,p]=u;return`<${f}${i}${n}>${p}</${f}>`}return`<template${n}>${s}</template>`}function ne(e,c){let t=new RegExp(`<(/)?${c}(?=[\\s/>])`,"gi"),n=0,s;while((s=t.exec(e))!==null)if(s[1]){if(n--,n<0)return!1}else n++;return!0}function qo(e,c){let t=ar(e);function n(s){let u=s,f=ee(s),i=(a)=>{let g=new Set;for(let l of f)if(a>l.start&&a<l.end)for(let d of l.vars)g.add(d);return g},p=/@if\s*\(/g,m,r=[];while((m=p.exec(u))!==null){let a=m.index,g=a+m[0].length,l=1,d=g;while(d<u.length&&l>0){if(u[d]==="(")l++;else if(u[d]===")")l--;d++}if(l!==0)continue;let b=u.substring(g,d-1).trim(),S=d,w=1,E=S,x=/@(if\s*\(|endif)/g;x.lastIndex=S;let h;while((h=x.exec(u))!==null)if(h[1].startsWith("if"))w++;else if(h[1]==="endif"){if(w--,w===0){E=h.index+h[0].length;break}}if(w!==0)continue;let R=u.substring(S,E-6).trim(),A;if(Y(R)){let C=un(u.substring(a,E));if(C.length===0)continue;let k=C[0].branches.filter((_)=>_.type!=="else"),L=i(a);if(!(k.length>0&&k.every((_)=>Z(_.condition,t,c,L))))continue;A=C[0].branches.map((_)=>{let N=n(_.content);if(_.type==="elseif")return M(N,"@else-if",_.condition??"");if(_.type==="else")return M(N,"@else");return M(N,"@if",_.condition??"")}).join(`
|
|
3
3
|
`)}else{if(!Z(b,t,c,i(a)))continue;A=M(n(R),"@if",b)}r.push({start:a,end:E,replacement:A}),p.lastIndex=E}for(let a=r.length-1;a>=0;a--){let{start:g,end:l,replacement:d}=r[a];u=u.substring(0,g)+d+u.substring(l)}return u}return n(e)}function se(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function D(e,c,t,n){if(P.has(t.toLowerCase()))return n;let s=t.toLowerCase(),u=e.length,f=1,i=n;while(i<u){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}F.lastIndex=i;let m=F.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let l=m[1].toLowerCase()==="script"?re:ie;l.lastIndex=i;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let a=e.indexOf(">",i);if(a===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,a+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}i=a+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let u=e.slice(t,s+1);return oe.test(u)}function Ko(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 c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);y(e,(r,a)=>{t.lastIndex=a;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=t.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&n.test(r[l]))l++;let S=l;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:a,end:S+1,tag:g[1],...d});return-1}if(l===b)return-1;let w=l;while(l<r.length&&!n.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===w)return-1;let E=r.slice(w,l);if(E.startsWith("@")&&E.includes("("))return-1;let x=l,h=l;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){l=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(E))d={attrName:E,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};l=A+1}else{l=h;while(l<r.length&&!n.test(r[l])&&r[l]!==">")l++}}return-1});let u=[],f=-1;for(let r of c){let{start:a,end:g,tag:l,attrName:d,value:b}=r;if(a<f)continue;let S=se(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(a,g))||P.has(l.toLowerCase())?g:D(e,a,l,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ce(e,x))continue;if(S===!0){let R=e.slice(a,r.attrStart)+e.slice(r.attrEnd,g);u.push({start:a,end:g,replacement:R});continue}u.push({start:a,end:x,replacement:""}),f=x}if(u.length===0)return e;u.sort((r,a)=>r.start-a.start);let i=[],p=-1;for(let r of u){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:a,end:g,replacement:l}=i[r];m=m.substring(0,a)+l+m.substring(g)}return m}var U=[":for","@for","x-for"];function jf(e){let c=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(c,(t,n,s,u)=>{let f=u.replace(/'((?:[^'\\]|\\.)*)'/g,(i,p)=>{if(!p.includes("{{"))return i;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,a)=>`\${${a}}`)}\``});return`${n}${s}="${f}"`})}function hs(e,c){if(!c||Object.keys(c).length===0)return e;if(!U.some((i)=>e.includes(`${i}=`)))return e;let t=ar(e);if(Array.isArray(c.__stx_client_signal_names)){for(let i of c.__stx_client_signal_names)if(typeof i==="string")t.add(i)}let n=e,s=[],u=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=u.exec(n))!==null){let[i,p,m]=f,r=f.index,a=r+i.length,g=U.map((A)=>({attr:A,m:new RegExp(`\\s${A}="([^"]*)"`).exec(m)})).find((A)=>A.m!==null);if(!g||!g.m)continue;let l=Wo(g.m[1]);if(!l.iterable||!l.itemVar)continue;let d=l.iterable.trim().split(/[.[(]/)[0].trim();if(!d||t.has(d)||!(d in c))continue;let b=D(n,r,p,a);if(b===-1)continue;let S=m.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),w=n.slice(a,b-`</${p}>`.length),E={...c,[l.itemVar]:void 0};if(l.indexVar)E[l.indexVar]=void 0;let x=hs(w,E),h=l.indexVar?`${l.iterable} as ${l.indexVar} => ${l.itemVar}`:`${l.iterable} as ${l.itemVar}`,R=p.toLowerCase()==="template"?x:`<${p}${S}>${x}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${h})${R}@endforeach`}),u.lastIndex=b}for(let i=s.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=s[i];n=n.slice(0,p)+r+n.slice(m)}return n}function ys(e,c){let t=e,n=/@(for|foreach)\s*\(/g,s,u=[],f=[];while((s=n.exec(t))!==null){let i=s[1],p=s.index,m=p+s[0].length,r=1,a=m;while(a<t.length&&r>0){if(t[a]==="(")r++;else if(t[a]===")")r--;a++}if(r!==0)continue;let g=t.substring(m,a-1).trim(),l=a,d=Wo(g),b=i==="for"?"@endfor":"@endforeach",S=1,w=l,E=i==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${i}\\s*\\(|end${i})`,"g");E.lastIndex=l;let x;while((x=E.exec(t))!==null)if(x[1].startsWith(i))S++;else if(S--,S===0){w=x.index+x[0].length;break}if(S!==0)continue;let h=()=>{let v=[d.itemVar,d.indexVar].filter(Boolean);if(v.length)f.push({start:p,end:w,vars:v})};if(d.iterable){let v=d.iterable.trim();if(v.startsWith("[")||v.startsWith("{")||v.startsWith("'")||v.startsWith('"')||v.startsWith("`")||/^-?\d/.test(v)){h();continue}let T=v.split(/[.[(]/)[0].trim(),_=c?T in c:!1,N=f.some((j)=>p>j.start&&p<j.end&&j.vars.includes(T));if(T&&(_||N)){h();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=t.substring(l,w-b.length).trim(),A=c?{...c}:{};if(d.itemVar)delete A[d.itemVar];if(d.indexVar)delete A[d.indexVar];let C=jf(ys(R,A)),k=C.match(H),L;if(k){let[,v,T,_]=k;L=`<${v}${T} @for="${g}">${_}</${v}>`}else L=`<template @for="${g}">${C}</template>`;u.push({start:p,end:w,replacement:L}),n.lastIndex=w}for(let i=u.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=u[i];t=t.substring(0,p)+r+t.substring(m)}return t}function ae(e){let c=new Set,t=[],n=0,s=0,u=e.length,f=(r)=>{let a=n+1;while(a<u){let g=e[a];if(g==="\\"){a+=2;continue}if(g===r)return a+1;a++}return u},i=()=>{let r=n+2;while(r<u&&e[r]!==`
|
|
4
4
|
`)r++;return r},p=()=>{let r=n+2;while(r<u-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return u},m=(r)=>{let a=r,g=0;while(a<u){let l=e[a];if(l==="/"&&e[a+1]==="/"){let d=a+2;while(d<u&&e[d]!==`
|
|
5
|
-
`)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function ue(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return y(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!le.has(i))t=p;return u+f[0].length}),n??t}function fe(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function bs(e,c,t,n={}){let s=gs(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\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:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
5
|
+
`)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function ue(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return y(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!le.has(i))t=p;return u+f[0].length}),n??t}function fe(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function bs(e,c,t,n={}){let s=gs(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\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:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-fn0419dn.js"));for(let x of s){let h=x.body;if(Be(x.attrs))h=Fe(h);if(n.forceClientSetup||u.test(h)){f.push({content:h,start:x.start,end:x.end});continue}if(!i(h))continue;try{let R=await p(Mt(h).code,c||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(u.test(R))f.push({content:h,start:x.start,end:x.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let m=`${c??""}\x00${f.map((x)=>x.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(m).toString(36).slice(0,10)}`,a=[];for(let x=0;x<f.length;x++){let h=f[x].bundled??Mt(f[x].content).code;if(!f[x].bundled&&i(h))h=await p(h,c||"",{projectRoot:process.cwd()});h=vt(h);let R=I(h);a.push(`// \u2500\u2500 merged signal script #${x+1} \u2500\u2500
|
|
6
6
|
${R}`)}let g=a.join(`
|
|
7
7
|
|
|
8
8
|
`);g=ae(g);let d=V(g).split(",").map((x)=>x.trim()).filter(Boolean),b=wn(g,t),S=`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m,hi,Kc,Xc,ug,dg,pg,fg,gg,Us,mg,Be,Z,Fe,hg,Er,yg,Yc,Zc,wi,ze,s,vn,Qc,h,ge,Zh}from"./chunk-
|
|
2
|
+
import{m,hi,Kc,Xc,ug,dg,pg,fg,gg,Us,mg,Be,Z,Fe,hg,Er,yg,Yc,Zc,wi,ze,s,vn,Qc,h,ge,Zh}from"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{Zc as SIGNAL_COMPOSABLE_CALL,ge as clearComponentCache,wi as componentClientSignalNames,hi as convertToCommonJS,h as createDetailedErrorMessage,gg as extractDirectiveNames,Kc as extractScriptFromTemplate,m as extractVariables,s as fileExists,Zh as getComponentCacheStats,dg as getPositionInfo,Z as getSharedTranspiler,Qc as getSourceLineInfo,fg as hasDirectives,Xc as hasVariables,yg as isHydrateTrigger,mg as isJavaScriptScript,ze as renderComponentWithSlot,vn as resolveTemplatePath,hg as scopeOnRootElement,Us as scopeSequenceKey,Be as shouldTranspileTypeScript,Yc as slotContentHasExpressions,Fe as transpileTypeScript,Er as userComponentFileExists,pg as validateDirective,ug as validateTemplate};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{gr}from"./chunk-29f6vmyz.js";import{$r}from"./chunk-txd2js5v.js";import{a}from"./chunk-
|
|
2
|
+
import{gr}from"./chunk-29f6vmyz.js";import{$r}from"./chunk-txd2js5v.js";import{a}from"./chunk-d85fvcf5.js";import{B,Ze}from"./chunk-ybq56wam.js";import{fc}from"./chunk-2x9zhezb.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function cr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new gr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function we(e){return e.includes("data-stx-runtime")}function dc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=cr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
|
|
3
3
|
`+e.slice(t);let n=$r(e);if(n!==null)return`${e.slice(0,n)}
|
|
4
4
|
${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
|
|
5
5
|
`+e.slice(o)}if(B(e))return Ze(e,(o)=>`${o}
|
|
6
6
|
${r}`);return`${r}
|
|
7
|
-
${e}`}async function lr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-
|
|
7
|
+
${e}`}async function lr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-6c3wj83w.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-6c3wj83w.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function pc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${fc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
|
|
8
8
|
${r}`;return`${e.slice(0,t)}${r}
|
|
9
|
-
${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ve(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-
|
|
9
|
+
${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ve(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-6c3wj83w.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
|
|
10
10
|
`)}"></script>
|
|
11
11
|
`}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${g(i)};</script>
|
|
12
|
-
`}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-
|
|
12
|
+
`}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-6c3wj83w.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
|
|
13
13
|
</body>`+e.slice(d+7)}
|
|
14
14
|
export{cr,G,we,dc,lr,pc,ve};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{jr,oo,Hg,Tl,io}from"./chunk-
|
|
2
|
+
import{jr,oo,Hg,Tl,io}from"./chunk-d6twwydm.js";export{Hg as buildModuleRegistryScript,io as buildSharedModuleRegistries,Tl as exportsMutableBinding,jr as registeredModuleIdsIn,oo as registeredModuleNamesIn};
|