@stacksjs/stx 0.2.890 → 0.2.891
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-9a9cec4x.js → chunk-08kcxz79.js} +1 -1
- package/dist/{chunk-r7m60q1m.js → chunk-0fyh29m1.js} +1 -1
- package/dist/{chunk-xeyq6d0t.js → chunk-0t31rf3v.js} +1 -1
- package/dist/chunk-0w578pgv.js +3 -0
- package/dist/{chunk-1t15z230.js → chunk-0yxvz6qz.js} +2 -2
- package/dist/chunk-0zynd3x0.js +2 -0
- package/dist/chunk-10c7pg5h.js +2 -0
- package/dist/{chunk-wedwczed.js → chunk-12m3qagv.js} +1 -1
- package/dist/{chunk-8f8qgjjr.js → chunk-12nmmdnp.js} +1 -1
- package/dist/{chunk-6svc4kb8.js → chunk-1vp0h7d6.js} +9 -9
- package/dist/{chunk-zpqjsnz9.js → chunk-29cw0fcr.js} +1 -1
- package/dist/{chunk-xwrjre34.js → chunk-2eq3aret.js} +1 -1
- package/dist/chunk-3ngbdap1.js +2 -0
- package/dist/{chunk-gfea8a9y.js → chunk-3t30a2nx.js} +1 -1
- package/dist/chunk-484x27q5.js +2 -0
- package/dist/{chunk-9344rq4r.js → chunk-4f3456ht.js} +1 -1
- package/dist/{chunk-v1mwwben.js → chunk-4r6hbjx7.js} +2 -2
- package/dist/chunk-4ts8qztg.js +2 -0
- package/dist/{chunk-1bft48gk.js → chunk-5zs5hrgz.js} +2 -2
- package/dist/{chunk-k8bk685s.js → chunk-6aq1pv9a.js} +1 -1
- package/dist/chunk-6kkatcka.js +2 -0
- package/dist/{chunk-a3zrwky3.js → chunk-6kt9wxja.js} +1 -1
- package/dist/{chunk-nzpb263k.js → chunk-70paeznz.js} +5 -5
- package/dist/{chunk-v90nz5xm.js → chunk-7d2j41e3.js} +4 -4
- package/dist/{chunk-49xwf7dk.js → chunk-8ay5r808.js} +2 -2
- package/dist/{chunk-40k0r6z9.js → chunk-8hdp4ark.js} +1 -1
- package/dist/chunk-8res5m9x.js +2 -0
- package/dist/{chunk-zf68afyh.js → chunk-8y39f6z3.js} +3 -3
- package/dist/{chunk-4akw3bym.js → chunk-90qwzwsm.js} +1 -1
- package/dist/{chunk-ch9028z3.js → chunk-9f8fda1j.js} +1 -1
- package/dist/{chunk-eq86wzhr.js → chunk-9w6k311w.js} +35 -27
- package/dist/{chunk-3yvmaphj.js → chunk-9zhpv03v.js} +1 -1
- package/dist/chunk-a5d5qveh.js +2 -0
- package/dist/{chunk-4eescf3s.js → chunk-aasgawa9.js} +4 -4
- package/dist/{chunk-xmg6bmh6.js → chunk-ac3e6nhg.js} +3 -3
- package/dist/{chunk-qnf7w4xw.js → chunk-b0jk94wx.js} +3 -3
- package/dist/{chunk-kr2400c3.js → chunk-b18vpz6p.js} +1 -1
- package/dist/chunk-bsbd6y64.js +2 -0
- package/dist/{chunk-sztr4d5g.js → chunk-cf527twj.js} +1 -1
- package/dist/{chunk-bm0mzk3b.js → chunk-cgrg6xzg.js} +1 -1
- package/dist/{chunk-adsqckg4.js → chunk-dm069acv.js} +4 -4
- package/dist/{chunk-yesh4dfe.js → chunk-e5md1cck.js} +4 -4
- package/dist/{chunk-j9vfv53x.js → chunk-fs7tv867.js} +1 -1
- package/dist/{chunk-1jtsr42q.js → chunk-gcjqxvbb.js} +6 -2
- package/dist/{chunk-35j7gaj5.js → chunk-gk0h2hp7.js} +1 -1
- package/dist/{chunk-b0hj8eg2.js → chunk-gwayvyg5.js} +1 -1
- package/dist/{chunk-kg7vby72.js → chunk-gydvy8a3.js} +5 -5
- package/dist/{chunk-8ccgty8s.js → chunk-gzc16hs8.js} +2 -2
- package/dist/{chunk-xy8smv5e.js → chunk-h7yme97q.js} +2 -2
- package/dist/chunk-h87pjzn7.js +2 -0
- package/dist/{chunk-94j4p584.js → chunk-hq03mwtw.js} +1 -1
- package/dist/chunk-k0mndyb4.js +2 -0
- package/dist/{chunk-nhv81gp2.js → chunk-k89gbytd.js} +2 -2
- package/dist/{chunk-aj5tsksz.js → chunk-kd7k31x3.js} +4 -4
- package/dist/{chunk-t0ttxayz.js → chunk-kfbw96c5.js} +2 -2
- package/dist/chunk-kh3sxa3j.js +2 -0
- package/dist/chunk-kr4z3633.js +2 -0
- package/dist/{chunk-rd663v1m.js → chunk-kvz7ad7p.js} +1 -1
- package/dist/{chunk-wy6vjz1e.js → chunk-kxewj557.js} +19 -19
- package/dist/chunk-mbpz45v9.js +2 -0
- package/dist/{chunk-whcrca58.js → chunk-mxf6cfbg.js} +6 -6
- package/dist/{chunk-9rjgq8k4.js → chunk-n64zbwzr.js} +1 -1
- package/dist/chunk-nd0f11at.js +2 -0
- package/dist/{chunk-p0bjbtdx.js → chunk-nvre22sw.js} +5 -5
- package/dist/chunk-p9cwapm8.js +2 -0
- package/dist/{chunk-12cjs6vs.js → chunk-ph4tgp9g.js} +1 -1
- package/dist/{chunk-0wp23n1d.js → chunk-phx820py.js} +1 -1
- package/dist/{chunk-690518hw.js → chunk-pjpf21y9.js} +1 -1
- package/dist/{chunk-1w0bqqh5.js → chunk-psykt348.js} +1 -1
- package/dist/{chunk-0k437z3q.js → chunk-qn45rk5n.js} +1 -1
- package/dist/{chunk-t3zmfh8w.js → chunk-qrk535j6.js} +4 -4
- package/dist/{chunk-97snfzsy.js → chunk-rc7djca5.js} +19 -19
- package/dist/chunk-sydgagr1.js +2 -0
- package/dist/chunk-vm57848v.js +2 -0
- package/dist/{chunk-4d85str1.js → chunk-vya7cck4.js} +1 -1
- package/dist/{chunk-vkfw9k1n.js → chunk-w8djc4qb.js} +8 -8
- package/dist/chunk-wwb6c5rr.js +2 -0
- package/dist/chunk-x691tnkx.js +2 -0
- package/dist/{chunk-cphc60zw.js → chunk-x9036mfd.js} +2 -2
- package/dist/{chunk-80ky40mm.js → chunk-xvprhdcb.js} +1 -1
- package/dist/chunk-y7qm1m0e.js +2 -0
- package/dist/{chunk-c25q87ys.js → chunk-ye6ev3qp.js} +1 -1
- package/dist/{chunk-g3vce7ka.js → chunk-ypyezjr0.js} +1 -1
- package/dist/{chunk-vxbvrbqs.js → chunk-yv797v6e.js} +2 -2
- package/dist/{chunk-cmg9x1ka.js → chunk-z012vpdz.js} +3 -3
- package/dist/{chunk-hyyh7qxw.js → chunk-z6ndrx2p.js} +1 -1
- package/dist/{chunk-2nqmw4dv.js → chunk-z8sv926e.js} +1 -1
- package/dist/{chunk-2xnbdqy4.js → chunk-z92e297r.js} +2 -2
- package/dist/chunk-zd21ntcm.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/client/signals-timer-runtime.js +4 -0
- package/dist/component-library.js +11 -3
- package/dist/component-renderer.js +23 -10
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/prop-names.js +7 -2
- package/dist/native/runtime/craft-bridge.js +29 -2
- package/dist/native/runtime/craft.d.ts +32 -0
- package/dist/native/runtime/native-host.js +27 -11
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +10 -10
- package/package.json +5 -5
- package/stx.d.ts +2 -1
- package/dist/chunk-0q0nbq50.js +0 -2
- package/dist/chunk-44teqn0b.js +0 -2
- package/dist/chunk-4xbtxeak.js +0 -2
- package/dist/chunk-6s3jwysv.js +0 -2
- package/dist/chunk-850tye3c.js +0 -2
- package/dist/chunk-amb7e0fp.js +0 -2
- package/dist/chunk-e8szp5wa.js +0 -2
- package/dist/chunk-hda7t8g6.js +0 -2
- package/dist/chunk-j6fs31va.js +0 -2
- package/dist/chunk-jvnsz2x9.js +0 -2
- package/dist/chunk-kexqmwx8.js +0 -2
- package/dist/chunk-kpjq135z.js +0 -2
- package/dist/chunk-kqsm7gf1.js +0 -2
- package/dist/chunk-mtfymhy1.js +0 -2
- package/dist/chunk-p82fzxdg.js +0 -2
- package/dist/chunk-qsv84cwm.js +0 -2
- package/dist/chunk-r98pye4h.js +0 -2
- package/dist/chunk-t4gcsbna.js +0 -2
- package/dist/chunk-tbh7r1wh.js +0 -2
- package/dist/chunk-vfcbz0an.js +0 -3
- package/dist/chunk-wmvvrsn0.js +0 -2
- package/dist/chunk-wnrh62by.js +0 -2
- package/dist/chunk-ymc1wgb3.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze,Mn,uo,Ki,z}from"./chunk-41z7f41b.js";import{Nn}from"./chunk-g3vce7ka.js";import{Jr,C,Bl,xt,ta,Fl}from"./chunk-cphc60zw.js";import{D}from"./chunk-vk2jy6mn.js";import{T,R}from"./chunk-0jdz31q1.js";import{Xr,bo,Fn,Dl,Le}from"./chunk-3b3mkgpj.js";import{po,d,m,zr,p,te,K,be,_,bt,ho,De,et,yo}from"./chunk-xmg6bmh6.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-a0aqs5a8.js";import{t,h}from"./chunk-neg6ckjg.js";import{c}from"./chunk-hxws025y.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as nc}from"async_hooks";var ni=new nc;function Rn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function si(e,n){return ni.run(Rn(e),n)}async function ri(e,n){let r=ni.getStore();if(!r)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 i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Br(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Gs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function sc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Xs(e,n){let r=`{ ${sc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Fe from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ii=new Map;function Ir(e,n=!0){let r=ii.get(e);if(n&&r)return r;let i=new Map,a=[Fe.join(e,"src"),Fe.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Fe.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ii.set(e,i);return i}function Js(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Fe.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Fe.dirname(r);if(a===r)return null;r=a}}function Ys(e,n,r={}){return[Fe.resolve(Fe.dirname(n),`${e}.stx`),Fe.resolve(Fe.dirname(n),e),Fe.resolve(r.componentsDir||"components",`${e}.stx`),Fe.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function oi(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ti(e,n){let[r,i,a]=oi(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function $i(e,n){let r=n?Fe.resolve(n):void 0,i=Fe.dirname(Fe.resolve(e));for(;;){if(sn.existsSync(Fe.join(i,"package.json")))return r&&i===r?void 0:i;let a=Fe.dirname(i);if(a===i)return;i=a}}var rc=["src/ui","src/components","components","dist"];function rs(e,n){let r=Fe.resolve(e);if(!n&&!r.split(Fe.sep).includes("node_modules"))return[];let i=$i(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Fe.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:rc;return[Fe.dirname(Fe.resolve(e)),...l.map((u)=>Fe.resolve(i,u))]}function*Ri(e,n,r={},i){let a=oi(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Fe.resolve(Fe.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Fe.join(Fe.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Fe.join(Fe.dirname(n),"components"),Fe.resolve(u,"src/components"),Fe.resolve(u,"components"),...import.meta.dir?[Fe.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Fe.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Fe.join(v,S.name,I)}catch{}}}function ai(e,n,r={},i){let a=Ti(e,i);if(a!==void 0)return a;for(let l of Ri(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Zs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import ge from"path";import Bt from"path";import _n from"fs";var ic=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return ic.has(e.toLowerCase())}var ci=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"]),li={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"},oc=new Set(["ctrl","alt","shift","meta"]),fi={left:0,middle:1,right:2};function ui(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(oc.has(i))n.systemKeys.push(i);else if(i in fi)n.mouse=i;else if(i in li||/^[a-z]$/.test(i))n.keys.push(li[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function di(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ci.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:ui(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ci.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:ui(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function ac(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=fi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function cc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function lc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=ac(e),a=cc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
2
|
+
import{Ze,Mn,uo,Ki,z}from"./chunk-41z7f41b.js";import{Nn}from"./chunk-ypyezjr0.js";import{Jr,C,Bl,xt,ta,Fl}from"./chunk-x9036mfd.js";import{D}from"./chunk-vk2jy6mn.js";import{T,R}from"./chunk-0jdz31q1.js";import{Xr,bo,Fn,Dl,Le}from"./chunk-3b3mkgpj.js";import{po,d,m,zr,p,te,K,be,_,bt,ho,De,et,yo}from"./chunk-ac3e6nhg.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-a0aqs5a8.js";import{t,h}from"./chunk-neg6ckjg.js";import{c}from"./chunk-hxws025y.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as nc}from"async_hooks";var ni=new nc;function Rn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function si(e,n){return ni.run(Rn(e),n)}async function ri(e,n){let r=ni.getStore();if(!r)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 i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Br(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Gs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function sc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Xs(e,n){let r=`{ ${sc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Fe from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ii=new Map;function Ir(e,n=!0){let r=ii.get(e);if(n&&r)return r;let i=new Map,a=[Fe.join(e,"src"),Fe.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Fe.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ii.set(e,i);return i}function Js(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Fe.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Fe.dirname(r);if(a===r)return null;r=a}}function Ys(e,n,r={}){return[Fe.resolve(Fe.dirname(n),`${e}.stx`),Fe.resolve(Fe.dirname(n),e),Fe.resolve(r.componentsDir||"components",`${e}.stx`),Fe.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function oi(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ti(e,n){let[r,i,a]=oi(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function $i(e,n){let r=n?Fe.resolve(n):void 0,i=Fe.dirname(Fe.resolve(e));for(;;){if(sn.existsSync(Fe.join(i,"package.json")))return r&&i===r?void 0:i;let a=Fe.dirname(i);if(a===i)return;i=a}}var rc=["src/ui","src/components","components","dist"];function rs(e,n){let r=Fe.resolve(e);if(!n&&!r.split(Fe.sep).includes("node_modules"))return[];let i=$i(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Fe.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:rc;return[Fe.dirname(Fe.resolve(e)),...l.map((u)=>Fe.resolve(i,u))]}function*Ri(e,n,r={},i){let a=oi(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Fe.resolve(Fe.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Fe.join(Fe.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Fe.join(Fe.dirname(n),"components"),Fe.resolve(u,"src/components"),Fe.resolve(u,"components"),...import.meta.dir?[Fe.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Fe.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Fe.join(v,S.name,I)}catch{}}}function ai(e,n,r={},i){let a=Ti(e,i);if(a!==void 0)return a;for(let l of Ri(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Zs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import ge from"path";import Bt from"path";import _n from"fs";var ic=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return ic.has(e.toLowerCase())}var ci=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"]),li={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"},oc=new Set(["ctrl","alt","shift","meta"]),fi={left:0,middle:1,right:2};function ui(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(oc.has(i))n.systemKeys.push(i);else if(i in fi)n.mouse=i;else if(i in li||/^[a-z]$/.test(i))n.keys.push(li[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function di(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ci.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:ui(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ci.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:ui(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function ac(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=fi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function cc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function lc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=ac(e),a=cc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=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('${r}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -112,7 +112,7 @@ else {
|
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
114
|
</script>`}function uc(e,n=""){let r=di(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let v=f.match(/id=["']([^"']+)["']/);if(v)for(let S of u.events)S.elementId=v[1]}for(let v of u.events){let S=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${S}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${S}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(j,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function pi(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function tl(e,n,r){if(Fl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:v}=uc(e,pi(n)),S=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...S,...v],f}let i=di(e,pi(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let v=i[f],S=v.originalTag;if(!S.includes(" id="))S=S.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let I=S.match(/id=["']([^"']+)["']/);if(I)for(let j of v.events)j.elementId=I[1]}for(let I of v.events){let j=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");S=S.replace(L,""),S=S.replace(M,"")}a=a.slice(0,v.startIndex)+S+a.slice(v.endIndex)}let l=Ai(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
|
|
115
|
-
`+a.slice(u);else a+=l;return a}function gi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){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))r.add(a)}return r}function
|
|
115
|
+
`+a.slice(u);else a+=l;return a}function gi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){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))r.add(a)}return r}function Ut(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&gi(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&gi(f[1],!1).has(n))return!0;return!1}var Ve="0.2.891";var mi=Symbol.for(`stx.lazy-module-promises.${Ve}`);function fc(){let e=globalThis;return e[mi]??=new Map,e[mi]}function o(e,n){let r=fc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var dc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(dc,"<\\/$1")}import hi from"fs";var xi=[];function k(e){let n=new T(e);return xi.push(n),n}function nl(){for(let e of xi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Or(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:hi.statSync(r).mtimeMs})}catch{}return n}function Qs(e){for(let n of e)try{if(hi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Ie=["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 gc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function mc(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function hc(e,n){let r=n;while(!0){let i=Bt.join(r,"node_modules",e,"package.json");if(_n.existsSync(i))return Bt.dirname(i);let a=Bt.dirname(r);if(a===r)return null;r=a}}function xc(e,n){if(!e||typeof e!=="object")return null;let r=(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 r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function bc(e,n){let r=mc(e);if(!r||!r.subpath)return null;let i=hc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(_n.readFileSync(Bt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=xc(a.exports,l);if(!u)return null;let f=Bt.resolve(i,u);return _n.existsSync(f)?f:null}function Fi(e,n){let r=n.filePath?Bt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(gc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Bt.resolve(r,S),!_n.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=bc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=_n.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function yc(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function zi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${yc(n.source)}" data-stx-layer="vendor">
|
|
116
116
|
@layer vendor {
|
|
117
117
|
${n.contents}
|
|
118
118
|
}
|
|
@@ -132,7 +132,7 @@ ${Ec(e,n)}`;return""}function Ty(e,n=[]){let{browserImports:r}=vl(e),i=new Set(n
|
|
|
132
132
|
+ 'or it should be imported from a relative path so the bundler includes it.'
|
|
133
133
|
);
|
|
134
134
|
});
|
|
135
|
-
`}function Ke(e){let n=e.__stxClientPayload;if(n&&typeof n==="object"){let i={};for(let a in n){let l=n[a];if(typeof l==="function")continue;i[a]=l}return i.__stxDeclaredPayload=!0,i}let r={};for(let i in e){if(i.startsWith("__")||i.startsWith("$"))continue;let a=e[i];if(typeof a==="function")continue;r[i]=a}return r}var kc=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,_i=new Set;function Cc(e,n){let r=kc.test(e),i=n.length>32768;if(!r&&!i)return;if(_i.has(e))return;if(_i.add(e),r)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(i)console.warn(`[stx] server\u2192client bridge is publishing ${(n.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function An(e,n){if(!n)return"";let r=Le(e,new Set(Object.keys(n))),i=n.__stxDeclaredPayload===!0,a=[],l=Object.entries(n).sort(([u],[f])=>u<f?-1:u>f?1:0);for(let[u,f]of l){if(!/^[A-Za-z_$][\w$]*$/.test(u))continue;if(u.startsWith("__")||u.startsWith("$"))continue;if(!i&&!r.has(u))continue;if(
|
|
135
|
+
`}function Ke(e){let n=e.__stxClientPayload;if(n&&typeof n==="object"){let i={};for(let a in n){let l=n[a];if(typeof l==="function")continue;i[a]=l}return i.__stxDeclaredPayload=!0,i}let r={};for(let i in e){if(i.startsWith("__")||i.startsWith("$"))continue;let a=e[i];if(typeof a==="function")continue;r[i]=a}return r}var kc=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,_i=new Set;function Cc(e,n){let r=kc.test(e),i=n.length>32768;if(!r&&!i)return;if(_i.has(e))return;if(_i.add(e),r)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(i)console.warn(`[stx] server\u2192client bridge is publishing ${(n.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function An(e,n){if(!n)return"";let r=Le(e,new Set(Object.keys(n))),i=n.__stxDeclaredPayload===!0,a=[],l=Object.entries(n).sort(([u],[f])=>u<f?-1:u>f?1:0);for(let[u,f]of l){if(!/^[A-Za-z_$][\w$]*$/.test(u))continue;if(u.startsWith("__")||u.startsWith("$"))continue;if(!i&&!r.has(u))continue;if(Ut(e,u)){if(i)console.warn(`[stx] defineClientPayload declares "${u}", but this client block also declares "${u}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${u}" from defineClientPayload.`);continue}let v;try{v=JSON.stringify(f)}catch{continue}if(v===void 0)continue;Cc(u,v),a.push(` var ${u} = ${v.replace(/</g,"\\u003c")};`)}if(a.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
|
|
136
136
|
${a.join(`
|
|
137
137
|
`)}
|
|
138
138
|
`}var Rc={left:0,middle:1,right:2};function Tc(e){let n=[];if(e.self)n.push("if ($event.target !== $el) return");for(let r of e.systemKeys)n.push(`if (!$event.${r}Key) return`);if(e.keys.length>0){let r=e.keys.map((i)=>`$event.key === '${i}'`).join(" || ");n.push(`if (!(${r})) return`)}if(e.mouse!==null){let r=Rc[e.mouse];n.push(`if ($event.button !== ${r}) return`)}if(e.prevent)n.push("$event.preventDefault()");if(e.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Ac(e,n){let{elementId:r,event:i,modifiers:a}=e,l=Hs(e.handler),u=Tc(a),f=[];if(a.once)f.push("once: true");if(a.capture)f.push("capture: true");if(Us(i,a))f.push("passive: true");let v=f.length>0?`, { ${f.join(", ")} }`:"",S="";if(u)S+=`${u}; `;let I=l.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),j=`var $emit = function(name, detail) {
|
|
@@ -182,7 +182,7 @@ else {
|
|
|
182
182
|
// STX: auto-generated event bindings
|
|
183
183
|
${e.map((r,i)=>Ac(r,i)).join(`
|
|
184
184
|
`)}`}function wi(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let v=f;if(u++,v==="`"){let S=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&S===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){S++,u+=2;continue}if(i[u]==="}"&&S>0){S--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===v){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
|
|
185
|
-
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Oc=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 jc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Oc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=Fi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=zi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
185
|
+
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Oc=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 jc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Oc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=Fi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=zi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-cf527twj.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=vl(r);r=U.code,i=xl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${An(r,n.serverData)}${i}`,r=D(r),!a&&Xe(n.attrs||""))r=Je(r);let j=Ic(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
|
|
186
186
|
${me(`${i}${r}
|
|
187
187
|
${j}`)}
|
|
188
188
|
</script>`}let W=ta(e),Z=/function __stx_setup_/.test(r),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function G(U){let H=U.length>0?`
|
|
@@ -205,7 +205,7 @@ ${j}`)}
|
|
|
205
205
|
} catch (error) {
|
|
206
206
|
console.error(${JSON.stringify(`[stx] client block failed${n.filePath?` (${n.filePath})`:""}; this block will not hydrate`)}, error);
|
|
207
207
|
}
|
|
208
|
-
})()</script>`}import{createHash as Wc}from"crypto";var qs=/\s*/y,er=/\x00STX_HTML_COMMENT_\d+\x00/y;function
|
|
208
|
+
})()</script>`}import{createHash as Wc}from"crypto";var qs=/\s*/y,er=/\x00STX_HTML_COMMENT_\d+\x00/y;function Vt(e){let n=0;while(n<e.length){if(qs.lastIndex=n,qs.exec(e),n=qs.lastIndex,e.startsWith("<!--",n)){let r=e.indexOf("-->",n+4);if(r===-1)return n;n=r+3;continue}if(er.lastIndex=n,er.test(e)){n=er.lastIndex;continue}return n}return n}var tr=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)\b/y,Pc=new Map(["textarea","title","xmp","iframe","noembed","noframes"].map((e)=>[e,new RegExp(`</${e}\\s*>`,"ig")]));function Oe(e){let n=[],r=0;while(r<e.length){let i=e.indexOf("<",r);if(i===-1)break;if(e.startsWith("<!--",i)){let L=e.indexOf("-->",i+4);if(L===-1)break;r=L+3;continue}tr.lastIndex=i;let a=tr.exec(e);if(!a){r=i+1;continue}let l=tr.lastIndex,u=l,f=null;for(;u<e.length;u++){let L=e[u];if(f){if(L===f)f=null}else if(L==='"'||L==="'")f=L;else if(L===">")break}if(u===e.length)break;let v=a[1]==="/",S=e[u-1]==="/";n.push({start:i,end:u+1,name:a[2],attributes:e.slice(l,S?u-1:u),closing:v,selfClosing:S}),r=u+1;let I=a[2].toLowerCase();if(!v&&I==="plaintext")break;let j=Pc.get(I);if(!v&&(I==="script"||I==="style"||j)){let L=j??(I==="script"?as:cs);L.lastIndex=r;let M=L.exec(e);if(!M)break;r=M.index}}return n}var is=/<script\b[^>]*>/iy,as=/<\/script\s*>/ig,os=/<style\b[^>]*>/iy,cs=/<\/style\s*>/ig;function Si(e,n,r,i){r.lastIndex=n;let a=r.exec(e);if(!a||a.index!==n)return-1;i.lastIndex=r.lastIndex;let l=i.exec(e);if(!l)return-1;return l.index+l[0].length}function Q(e,n){return Si(e,n,is,as)}function Cn(e,n){return Si(e,n,os,cs)}function qe(e,n){if(!e.startsWith("<!--",n))return-1;let r=e.indexOf("-->",n+4);if(r===-1)return-1;return r+3}function Ei(e,n){if(e.startsWith("<!--",n)){let a=qe(e,n);return a===-1?e.length:a}if(is.lastIndex=n,is.exec(e)?.index===n){as.lastIndex=is.lastIndex;let a=as.exec(e);return a?a.index+a[0].length:e.length}if(os.lastIndex=n,os.exec(e)?.index===n){cs.lastIndex=os.lastIndex;let a=cs.exec(e);return a?a.index+a[0].length:e.length}return-1}function x(e,n){let r=[],i=0,a=e.length,l=!1,u=null;while(i<a){let f=e[i];if(l){if(u){if(f===u)u=null}else if(f==='"'||f==="'")u=f;else if(f===">")l=!1;i++;continue}if(f!=="<"){let j=e.indexOf("<",i+1);if(j===-1)break;i=j;continue}let v=n(e,i);if(v>i){r.push({start:i,end:v,token:e.slice(i,v)}),i=v;continue}let S=Ei(e,i);if(S>i){i=S;continue}let I=e.charCodeAt(i+1);if(I>=65&&I<=90||I>=97&&I<=122)l=!0;i++}return r}function ki(e){let n=0,r=0,i=0,a=!1,l=null;while(i<e.length){if(a){let j=e[i];if(l){if(j===l)l=null}else if(j==='"'||j==="'")l=j;else if(j===">")a=!1;i++;continue}let u=e.indexOf("<",i),f=u===-1?e.length:u;while(i<f){let j=e[i++];if(j==="{")n++;else if(j==="}")r++;if(n>=2&&r>=2)return!0}if(u===-1)break;let v=Ei(e,u);if(v>u){i=v;continue}let S=e.charCodeAt(u+1),I=S===47?e.charCodeAt(u+2):S;if(I>=65&&I<=90||I>=97&&I<=122)a=!0;i=u+1}return!1}function rl(e,n){while(e.size>=n){let r=e.keys().next();if(r.done)return;e.delete(r.value)}}var Mc=1024,Dc=16777216,rn=new Map,nr=0;function Nc(e,n){rn.set(e,n),nr+=e.length+n.output.length;for(let[r,i]of rn){if(nr<=Dc)break;rn.delete(r),nr-=r.length+i.output.length}}function ke(e,n,r,i){let a=i!==void 0&&e.length>=Mc,l=a?`${i}\x00${e}`:"";if(a){let I=rn.get(l);if(I)return rn.delete(l),rn.set(l,I),{output:I.output,tokens:I.tokens.slice()}}let u=x(e,n);if(u.length===0)return{output:e,tokens:[]};let f=u.map((I)=>I.token),v="",S=0;for(let I=0;I<u.length;I++){let j=u[I];v+=e.slice(S,j.start),v+=r(j.token,I),S=j.end}if(v+=e.slice(S),a)return Nc(l,{output:v,tokens:f}),{output:v,tokens:f.slice()};return{output:v,tokens:f}}var Lc=1024,zc=16777216,on=new Map,sr=0;function Bc(e,n){on.set(e,n),sr+=e.length+n.output.length;for(let[r,i]of on){if(sr<=zc)break;on.delete(r),sr-=r.length+i.output.length}}function rr(e,n,r){return{output:n,scripts:r,restore:(i)=>i===n?e:Nr(i,r)}}function se(e){let n=e.length>=Lc;if(n){let a=on.get(e);if(a)return on.delete(e),on.set(e,a),rr(e,a.output,a.scripts.slice())}let{output:r,tokens:i}=ke(e,Q,(a,l)=>`\x00STX_SCRIPT_${l}\x00`);if(n)return Bc(e,{output:r,scripts:i}),rr(e,r,i.slice());return rr(e,r,i)}function Nr(e,n){if(n.length===0)return e;return e.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(r,i)=>n[+i]??"")}function ee(e){let n=Oe(e),r=[];for(let i=0;i<n.length;i++){let a=n[i],l=n[i+1];if(a.name.toLowerCase()!=="script"||a.closing||l?.name.toLowerCase()!=="script"||!l.closing)continue;r.push({start:a.start,end:l.end,bodyStart:a.end,bodyEnd:l.start,attrs:a.attributes})}return r}var ls="__stx_component_client_factories";function us(e){let n=e[ls];return n instanceof Map?n:null}function hl(e){e[ls]=new Map}function ir(e,n){let r=us(e);if(!r)return null;let i=Wc("sha256").update(n).digest("hex").slice(0,16),a=r.get(i);if(a)a.instances++;else r.set(i,{body:n,instances:1});return i}function yl(e,n){let r=us(n);if(!r?.size)return e;let i=new Map;for(let[I,j]of r)if(j.instances===1)i.set(I,j.body);let a=[];if(i.size>0){let I=[...i.keys()].map((M)=>JSON.stringify(M).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),j=new RegExp(`window\\.__stxComponentFactories\\[(${I})\\]\\(("[^"]+")\\);`,"g"),L=j.exec(e);while(L!==null){let M=i.get(JSON.parse(L[1]));if(M!==void 0)a.push({start:L.index,end:L.index+L[0].length,replacement:me(`(${M})(${L[2]});`)});L=j.exec(e)}}let l=[...r].filter(([,I])=>I.instances>1);if(l.length===0)return Ci(e,a);let u=l.map(([I,j])=>` try { factories[${JSON.stringify(I)}] = factories[${JSON.stringify(I)}] || ${j.body}; }
|
|
209
209
|
catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(I)} + ' failed to register; instances of it will not hydrate.', e); }`).join(`
|
|
210
210
|
`),f=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
|
|
211
211
|
(function() {
|
|
@@ -213,8 +213,8 @@ ${j}`)}
|
|
|
213
213
|
${me(u)}
|
|
214
214
|
})();
|
|
215
215
|
</script>`,v,S=/<(?:template\b|script\b(?=[^>]*\bdata-stx-scoped\b))/iy;return x(e,(I,j)=>{if(v===void 0){if(S.lastIndex=j,S.test(I))v=j}return-1}),a.push({start:v??0,end:v??0,replacement:`${f}
|
|
216
|
-
`}),Ci(e,a)}function Ci(e,n){if(n.length===0)return e;n.sort((l,u)=>l.start-u.start||l.end-u.end);let r=Array(n.length*2+1),i=0,a=0;for(let l of n)r[a++]=e.slice(i,l.start),r[a++]=l.replacement,i=l.end;return r[a]=e.slice(i),r.join("")}function qi(e){let n=us(e),r=new Map;if(n)for(let[i,a]of n)r.set(i,a.instances);return r}function Zi(e,n){let r=us(e);if(!r)return[];let i=[];for(let[a,l]of r){let u=l.instances-(n.get(a)??0);if(u>0)i.push({body:l.body,count:u})}return i}function Ji(e,n){for(let{body:r,count:i}of n)for(let a=0;a<i;a++)ir(e,r)}function Pe(e,n,r=2){let i=0,a=null;for(let l=n+r;l<e.length;l++){let u=e[l];if(a){if(u==="\\"){l++;continue}if(u===a)a=null;continue}if(u==='"'||u==="'"||u==="`"){a=u;continue}if(u==="{"){i++;continue}if(u==="}"){if(i>0){i--;continue}let f=0;while(e[l+f]==="}")f++;if(f>=r)return l}}return-1}import xo from"fs";var Xi=0,or=new Map;function Cl(){Xi=0,or.clear()}function ps(e,n){let r=Xi++,i=`<!--__STX_${e.toUpperCase()}_${r}__-->`;return or.set(i,{type:e,expression:n}),i}function El(){let e={};for(let[n,r]of or)e[n]={type:r.type,expression:r.expression};return e}function Tl(e,n){let r=e;for(let[i,a]of n)r=r.split(i).join(a);return r}function Vi(e){return e.includes("<!--__STX_")}var Fc=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function Vc(e){return Array.from({length:e},()=>"{").join("⁠")}function Gi(e){return e.replace(/\{{2,}/g,(n)=>Vc(n.length)).replace(/\{(?=!)/g,"{⁠").replace(Fc,"@")}function Dr(e,n,r=!1){let{openTag:i,tail:a}=r?Uc(e,n):Hc(e).at(n);return qc(a,i,r)}function Uc(e,n){let r="",i=0;for(let u=0;u<n;u++){if(!e.startsWith("{{",u))continue;let f=Pe(e,u);if(f<0||f+2>n)break;r+=e.slice(i,u)+"x",u=f+1,i=f+2}r+=e.slice(i,n);let a=-1,l=null;for(let u=0;u<r.length;u++){let f=r[u];if(l){if(f===l)l=null;continue}if(f==='"'||f==="'"){l=f;continue}if(f===">"){a=-1;continue}if(f==="<")a=u}return{openTag:a,tail:a>=0?r.slice(a+1):r}}var fs=null;function Hc(e){if(fs&&fs.source===e)return fs.scanner;let n=Kc(e);return fs={source:e,scanner:n},n}function Kc(e){let n=0,r=-1,i=null,a=-1,l=(f,v)=>{let S=e[f];if(v.quote){if(S===v.quote)v.quote=null;return}if(v.openTag>=0){if(S==='"'||S==="'"){v.quote=S;return}if(S===">"){v.openTag=-1;return}}if(S==="<")v.openTag=f},u=(f,v)=>{if(v.openTag>=0||!e.startsWith("<!--",f))return-1;let S=e.indexOf("-->",f+4);return S<0?e.length:S+3};return{at(f){if(f<n)n=0,r=-1,i=null,a=-1;let v={openTag:r,quote:i},S=!1;while(n<f){if(a<0&&e.startsWith("{{",n)){let W=Pe(e,n);if(W<0)a=n;else if(W+2<=f){n=W+2;continue}else break}let V=u(n,v);if(V>=0){if(V>f){S=!0;break}n=V;continue}l(n,v),n++}if(r=v.openTag,i=v.quote,S)return{openTag:-1,tail:""};let I=a>=0?a:n,j={openTag:r,quote:i};for(let V=n;V<f;V++){let W=u(V,j);if(W>=0){if(W>f)return{openTag:-1,tail:""};V=W-1;continue}l(V,j)}if(j.openTag<0)return{openTag:-1,tail:""};let L="",M=j.openTag+1;for(let V=M;V<Math.min(f,I);V++){if(!e.startsWith("{{",V))continue;let W=Pe(e,V);L+=e.slice(M,V)+"x",V=W+1,M=W+2}return L+=e.slice(M,f),{openTag:j.openTag,tail:L}}}}function qc(e,n,r){if(n<0&&!r)return null;if(n>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(n>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let i=0;if(n>=0)while(i<e.length&&!/\s/.test(e[i]))i++;while(i<e.length){while(/\s/.test(e[i]??"")&&i<e.length)i++;let a=i;while(i<e.length&&!/[\s=/>]/.test(e[i]))i++;let l=e.slice(a,i);if(!l)break;while(i<e.length&&/\s/.test(e[i]))i++;if(e[i]!=="=")continue;i++;while(i<e.length&&/\s/.test(e[i]))i++;let u=e[i];if(u==='"'||u==="'"){let f=++i,v=e.indexOf(u,i);if(v===-1)return{kind:"attribute",name:l,quote:u,valuePrefix:e.slice(f)};i=v+1}else{let f=i;while(i<e.length&&!/\s/.test(e[i]))i++;if(i===e.length)return{kind:"attribute",name:l,quote:null,valuePrefix:e.slice(f)}}}return{kind:"tag"}}class he extends Error{attribute;near;constructor(e,n){super(`Unsafe interpolation in ${e}: ${n}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,n){if(this.near===void 0)this.near=e.slice(Math.max(0,n-160),n).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var Yi="unsafe:";var Zc=/^(?:javascript|vbscript|livescript|mocha|view-source):/,Jc=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,Xc=/^data:(?:text\/html|application\/xhtml\+xml)/,Gc=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function Yc(e){return e.replace(Gc,"").toLowerCase()}function ar(e){let n=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(n))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(n))return"fetched";return null}function ds(e,n="navigable"){let r=Yc(e);if(Zc.test(r))return!0;return n==="navigable"?Jc.test(r):Xc.test(r)}function Mr(e,n="navigable"){return ds(e,n)?"unsafe:"+e:e}function Qc(e){let n=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!n)return null;if(n[3].trim()!=="")return null;return ar(n[1])}function Qi(e,n,r=256){if(n<=r)return e.slice(0,n);let i=e.slice(n-r,n),a=i.search(/[\s"'`/]/);return a===-1?"":i.slice(a)}function fo(e,n,r=n){let i=Qc(e);return i&&ds(n,i)?"unsafe:"+r:r}function Wt(e){let n=e.indexOf(" as ");if(n!==-1){let l=e.slice(0,n).trim(),u=e.slice(n+4).trim();return l&&u?{arrayExpr:l,itemVar:u}:null}let r=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!r)return null;let i=r[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),a=r[2].trim();return i&&a?{arrayExpr:a,itemVar:i}:null}function gs(e){let n=[],r=0,i="",a=0;for(let l=0;l<e.length;l++){let u=e[l];if(i){if(u==="\\")l++;else if(u===i)i="";continue}if(u==="'"||u==='"'||u==="`")i=u;else if(u==="("||u==="["||u==="{")r++;else if(u===")"||u==="]"||u==="}")r--;else if(u===","&&r===0)n.push(e.slice(a,l)),a=l+1}return n.push(e.slice(a)),n}function go(e,n){let r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a==="("||a==="["||a==="{")r++;else if(a===")"||a==="]"||a==="}")r--;else if(a===n&&r===0)return i}return-1}function mo(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="("||i==="["||i==="{")n++;else if((i===")"||i==="]"||i==="}")&&--n===0)return r}return-1}function Ft(e,n){let r=e.trim().replace(/^\.\.\./,"").trim(),i=go(r,"=");if(i!==-1&&r[i+1]!==">")r=r.slice(0,i).trim();if(!r)return;if(r.startsWith("{")&&r.endsWith("}")){for(let a of gs(r.slice(1,-1))){let l=a.trim();if(!l)continue;if(l.startsWith("...")){Ft(l,n);continue}let u=go(l,":");Ft(u===-1?l:l.slice(u+1),n)}return}if(r.startsWith("[")&&r.endsWith("]")){for(let a of gs(r.slice(1,-1)))Ft(a,n);return}if(/^[A-Z_$][\w$]*$/i.test(r))n.push(r)}function oe(e){let n=e.trim(),r=[],i=0;for(let l=0;l<n.length;l++){let u=n[l];if(u==="("||u==="["||u==="{")i++;else if(u===")"||u==="]"||u==="}")i--;else if(i===0&&/\s/.test(u)){if(!/^\s+(?:in|of)\s/.exec(n.slice(l)))continue;let v=n.slice(0,l).trim();if(v.startsWith("(")&&mo(v)===v.length-1)v=v.slice(1,-1);for(let S of gs(v))Ft(S,r);if(r.length>0)return r;break}}let a=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(n);if(a){let l=a[1].trim();if(l.startsWith("(")&&mo(l)===l.length-1)l=l.slice(1,-1);let u=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(l);if(u)Ft(u[2],r),Ft(u[1],r);else for(let f of gs(l))Ft(f,r)}return r}function F(e,n){let r=n instanceof Set?n:new Set(n);if(r.size===0)return!1;let u=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let f of u.match(/[a-zA-Z_$][\w$]*/g)||[])if(r.has(f))return!0;return!1}var ms="__stx_client_loop_names";function mt(e){let n=e?.[ms];return Array.isArray(n)?n:[]}function hs(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let n=[],r=[],i=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let a of e.matchAll(i)){let l=a[0];if(/^<\/template\s*>$/i.test(l)){let u=r.pop();if(u)u.end=a.index}else if(/^<template\b/i.test(l)&&!/\/\s*>$/.test(l)){let f=[...l.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((I)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(I[1])),v=(f?.[2]??f?.[3])?.trim();if(v&&f?.[1]==="data-stx-slot-binding")try{v=decodeURIComponent(v)}catch{v=void 0}let S=v?{start:a.index+l.length,end:e.length,binding:v}:void 0;if(r.push(S),S)n.push(S)}}return n}var vn={},_o=new Map;function el(e){let n=_o.get(e);if(!n){let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=new RegExp(`:${r}(?!\\w)`,"g"),_o.set(e,n)}return n.lastIndex=0,n}var lo={uppercase:(e,n)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,n)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,n)=>{if(e===void 0||e===null)return"";let r=String(e);return r.charAt(0).toUpperCase()+r.slice(1)},number:(e,n,r=0)=>{if(e===void 0||e===null)return"";try{let i=Number(e);return Number.isNaN(i)?"":i.toFixed(Number.parseInt(String(r),10))}catch{return""}},fmt:(e,n,r="en-US")=>{if(e===void 0||e===null)return"";try{let i=Number(e);if(Number.isNaN(i))return String(e);return i.toLocaleString(r)}catch{return String(e)}},join:(e,n,r=",")=>{if(!Array.isArray(e))return"";return e.join(String(r))},escape:(e,n)=>{if(e===void 0||e===null)return"";return Y(String(e))},translate:(e,n,r={})=>{if(!n||!n.__translations)return e;let i=n.__translations,a=n.__i18nConfig?.fallbackToKey??!0,l=String(e).split("."),u=i;for(let v of l){if(u===void 0||u===null)break;u=u[v]}if(u===void 0||u===null)return a?e:"";let f=String(u);return Object.entries(r).forEach(([v,S])=>{f=f.replace(el(v),()=>String(S))}),f},t:(e,n,r={})=>lo.translate(e,n,r),truncate:(e,n,r=50,i="...")=>{if(e===void 0||e===null)return"";let a=String(e);if(a.length<=r)return a;if(r<=i.length)return i.substring(0,r);return a.substring(0,r-i.length)+i},date:(e,n,r="short",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return String(e);let l={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(r==="iso")return a.toISOString();return new Intl.DateTimeFormat(i,l[r]||l.short).format(a)}catch{return String(e)}},currency:(e,n,r="USD",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=Number(e);if(Number.isNaN(a))return String(e);return new Intl.NumberFormat(i,{style:"currency",currency:r}).format(a)}catch{return String(e)}},pluralize:(e,n,r,i)=>{let a=Number(e);if(Number.isNaN(a))return r;let l=i||`${r}s`;return a===1?r:l},first:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let r=String(e);return r.charAt(r.length-1)},length:(e,n)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,n,r=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return r?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,n,r="")=>e===void 0||e===null||e===""?r:e,reverse:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,n,r=0,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(r,i);return e},replace:(e,n,r,i="")=>{if(e===void 0||e===null)return"";let a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(a,"g"),()=>i)},stripTags:(e,n)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,n)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,n)=>{let r=Number(e);return Number.isNaN(r)?0:Math.abs(r)},round:(e,n,r=0)=>{let i=Number(e);if(Number.isNaN(i))return 0;let a=10**r;return Math.round(i*a)/a}};function qg(e,n){if(e in lo)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);vn[e]=n}function Ry(e){for(let[n,r]of Object.entries(e))qg(n,r)}function Kg(){return{...lo,...vn}}function Ay(){for(let e of Object.keys(vn))delete vn[e]}function ko(e){let n=e.next();while(!n.done)n=e.next();return n.value}function*Co(e,n,r,i){let a="{".repeat(r);if(!e.includes(a))return e;let l="",u=0,f=0,v=i===Number.POSITIVE_INFINITY?0:performance.now();for(;;){let S=e.indexOf(a,u);if(S===-1)break;let I=Pe(e,S,r);if(I===-1)break;if(l+=e.slice(u,S)+n(e.slice(S,I+r),e.slice(S+r,I),S),u=I+r,++f>=64){f=0;let j=performance.now();if(j-v>=i)v=j,yield}}return u===0?e:l+e.slice(u)}function In(e,n,r=2){return ko(Co(e,n,r,Number.POSITIVE_INFINITY))}function $l(e,n,r){let i=r[0];if(i!=="'"&&i!=='"'&&i!=="`")return!1;let a=Dr(e,n);if(!a||a.kind!=="attribute"||a.quote===i)return!1;if(!/^(?::|@|x-|v-)/.test(a.name))return!1;let l=0;for(let u=0;u<a.valuePrefix.length;u++)if(a.valuePrefix[u]==="\\")u++;else if(a.valuePrefix[u]===i)l++;return l%2===1}function g(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Y(e){return Gi(g(e))}function Rl(e){return e.replace(/ /g," ").replace(/\t/g,"	").replace(/\n/g," ").replace(/\r/g," ").replace(/\f/g,"").replace(/=/g,"=").replace(/`/g,"`")}function Al(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(n,r)=>String.fromCodePoint(Number.parseInt(r,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function Il(e,n){let r=Al(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(r))throw new he(n,"network-capable or executable CSS is not allowed in an escaped interpolation");let i=/url\(([^)]*)\)/g,a;while((a=i.exec(r))!==null){let l=a[1].replace(/^["']|["']$/g,""),u=l.startsWith("/")&&!l.startsWith("//")||l.startsWith("./")||l.startsWith("../")||l.startsWith("#"),f=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(l);if(!u&&!f)throw new he(n,"CSS URLs must be local paths or base64 raster images")}}function ae(e,n,r,i=!1,a=0){try{return Ol(e,n,r,i,a)}catch(l){if(l instanceof he)l.locate(e,n);throw l}}function Ol(e,n,r,i,a){let l=Dr(e,n,i),u=Y(r);if(!l)return u;if(l.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(r))throw new he("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return r}if(l.kind==="tag"){let S=e.slice(n+a).trimStart(),I=r.trim();if(!S.startsWith("=")&&(I===""||I.split(/\s+/).every((j)=>/^(?!on)[A-Za-z_:][\w:.-]*$/.test(j))))return I;throw new he("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let f=l.name.toLowerCase();if(/^on[a-z]/.test(f))throw new he(l.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(f==="srcdoc")u=Y(u);if(f==="style")Il(r,l.name);if(l.quote===null)u=Rl(u);let v=ar(f);if(v&&l.valuePrefix.trim()===""&&ds(r,v))return Yi+u;return fo(Qi(e,n),r,u)}function On(e,n){let r=` ${e}="`;return ae(r,r.length,n,!0)}function Ro(e){return e.flatMap((n)=>{let r=n.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!r||/\bserver\b|\bsrc\s*=/.test(r[1])?[]:[r[2]]})}function Ne(e,n){let{scripts:r}=se(e);for(let i of Ro(r)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(i)||kl.test(i))return!0;if(Jr(i,n))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function Gg(e){let n=[],r=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let i=r.exec(e);i;i=r.exec(e)){let a=i[1].toLowerCase(),l=new Set(oe(i[3]));if(l.size===0)continue;let u=i.index+i[0].length;if(i[0].endsWith("/>")){n.push({start:i.index,end:u,names:l});continue}let f=new RegExp(`<(/?)${a}\\b[^>]*?(/?)>`,"gi");f.lastIndex=u;let v=1,S=e.length;for(let I=f.exec(e);I;I=f.exec(e)){if(I[2]==="/")continue;if(v+=I[1]==="/"?-1:1,v===0){S=I.index+I[0].length;break}}n.push({start:i.index,end:S,names:l})}return n}function wo(e,n,r){let i=t(r);for(let a of e){if(n<a.start||n>=a.end)continue;for(let l of a.names)if(new RegExp(`(?<![.#\\w$])${l.replace(/\$/g,"\\$")}(?![\\w$])`).test(i))return!0}return!1}function vo(e,n){let r=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],i=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),a="",l=!1,u=0;for(let S=0;S<i.length;S++){let I=i[S];if(!l&&I==="`"){l=!0,u=0;continue}if(l){if(I==="`"&&u===0){l=!1;continue}if(I==="$"&&i[S+1]==="{"){u++,S++,a+=" ";continue}if(I==="}"&&u>0){u--;continue}if(u>0){a+=I;continue}continue}a+=I}i=a;let f=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,v;while((v=f.exec(i))!==null){let S=v[1];if(!i.substring(0,v.index).trimEnd().endsWith(".")){if(!r.includes(S)&&!(S in n))return!1}}return!0}function jl(e,n){let r=t(e);for(let i of r.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof n[i[1]]==="function")return!0;return!1}function Pl(e,n){let r=n.__stx_serverDeclared;if(!r||r.size===0)return!1;let i=t(e);for(let a of r)if(new RegExp(`(?<![.#\\w$])${a}(?![\\w$])`).test(i))return!0;return!1}var So=new Set;function $o(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function Ml(e,n,r){let i=r[0];if(i!=="'"&&i!=='"'&&i!=="`")return!1;let a=0;for(let l=e.lastIndexOf(`
|
|
217
|
-
`,n-1)+1;l<n;l++)if(e[l]==="\\")l++;else if(e[l]===i)a++;return a%2===1}function Eo(e,n){let r=`${n??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!So.has(r))So.add(r),console.warn(`[stx] {{ ${e} }} in a <script> in ${n??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function
|
|
216
|
+
`}),Ci(e,a)}function Ci(e,n){if(n.length===0)return e;n.sort((l,u)=>l.start-u.start||l.end-u.end);let r=Array(n.length*2+1),i=0,a=0;for(let l of n)r[a++]=e.slice(i,l.start),r[a++]=l.replacement,i=l.end;return r[a]=e.slice(i),r.join("")}function qi(e){let n=us(e),r=new Map;if(n)for(let[i,a]of n)r.set(i,a.instances);return r}function Zi(e,n){let r=us(e);if(!r)return[];let i=[];for(let[a,l]of r){let u=l.instances-(n.get(a)??0);if(u>0)i.push({body:l.body,count:u})}return i}function Ji(e,n){for(let{body:r,count:i}of n)for(let a=0;a<i;a++)ir(e,r)}function Pe(e,n,r=2){let i=0,a=null;for(let l=n+r;l<e.length;l++){let u=e[l];if(a){if(u==="\\"){l++;continue}if(u===a)a=null;continue}if(u==='"'||u==="'"||u==="`"){a=u;continue}if(u==="{"){i++;continue}if(u==="}"){if(i>0){i--;continue}let f=0;while(e[l+f]==="}")f++;if(f>=r)return l}}return-1}import xo from"fs";var Xi=0,or=new Map;function Cl(){Xi=0,or.clear()}function ps(e,n){let r=Xi++,i=`<!--__STX_${e.toUpperCase()}_${r}__-->`;return or.set(i,{type:e,expression:n}),i}function El(){let e={};for(let[n,r]of or)e[n]={type:r.type,expression:r.expression};return e}function Tl(e,n){let r=e;for(let[i,a]of n)r=r.split(i).join(a);return r}function Ui(e){return e.includes("<!--__STX_")}var Fc=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function Vc(e){return Array.from({length:e},()=>"{").join("⁠")}function Gi(e){return e.replace(/\{{2,}/g,(n)=>Vc(n.length)).replace(/\{(?=!)/g,"{⁠").replace(Fc,"@")}function Dr(e,n,r=!1){let{openTag:i,tail:a}=r?Uc(e,n):Hc(e).at(n);return qc(a,i,r)}function Uc(e,n){let r="",i=0;for(let u=0;u<n;u++){if(!e.startsWith("{{",u))continue;let f=Pe(e,u);if(f<0||f+2>n)break;r+=e.slice(i,u)+"x",u=f+1,i=f+2}r+=e.slice(i,n);let a=-1,l=null;for(let u=0;u<r.length;u++){let f=r[u];if(l){if(f===l)l=null;continue}if(f==='"'||f==="'"){l=f;continue}if(f===">"){a=-1;continue}if(f==="<")a=u}return{openTag:a,tail:a>=0?r.slice(a+1):r}}var fs=null;function Hc(e){if(fs&&fs.source===e)return fs.scanner;let n=Kc(e);return fs={source:e,scanner:n},n}function Kc(e){let n=0,r=-1,i=null,a=-1,l=(f,v)=>{let S=e[f];if(v.quote){if(S===v.quote)v.quote=null;return}if(v.openTag>=0){if(S==='"'||S==="'"){v.quote=S;return}if(S===">"){v.openTag=-1;return}}if(S==="<")v.openTag=f},u=(f,v)=>{if(v.openTag>=0||!e.startsWith("<!--",f))return-1;let S=e.indexOf("-->",f+4);return S<0?e.length:S+3};return{at(f){if(f<n)n=0,r=-1,i=null,a=-1;let v={openTag:r,quote:i},S=!1;while(n<f){if(a<0&&e.startsWith("{{",n)){let W=Pe(e,n);if(W<0)a=n;else if(W+2<=f){n=W+2;continue}else break}let V=u(n,v);if(V>=0){if(V>f){S=!0;break}n=V;continue}l(n,v),n++}if(r=v.openTag,i=v.quote,S)return{openTag:-1,tail:""};let I=a>=0?a:n,j={openTag:r,quote:i};for(let V=n;V<f;V++){let W=u(V,j);if(W>=0){if(W>f)return{openTag:-1,tail:""};V=W-1;continue}l(V,j)}if(j.openTag<0)return{openTag:-1,tail:""};let L="",M=j.openTag+1;for(let V=M;V<Math.min(f,I);V++){if(!e.startsWith("{{",V))continue;let W=Pe(e,V);L+=e.slice(M,V)+"x",V=W+1,M=W+2}return L+=e.slice(M,f),{openTag:j.openTag,tail:L}}}}function qc(e,n,r){if(n<0&&!r)return null;if(n>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(n>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let i=0;if(n>=0)while(i<e.length&&!/\s/.test(e[i]))i++;while(i<e.length){while(/\s/.test(e[i]??"")&&i<e.length)i++;let a=i;while(i<e.length&&!/[\s=/>]/.test(e[i]))i++;let l=e.slice(a,i);if(!l)break;while(i<e.length&&/\s/.test(e[i]))i++;if(e[i]!=="=")continue;i++;while(i<e.length&&/\s/.test(e[i]))i++;let u=e[i];if(u==='"'||u==="'"){let f=++i,v=e.indexOf(u,i);if(v===-1)return{kind:"attribute",name:l,quote:u,valuePrefix:e.slice(f)};i=v+1}else{let f=i;while(i<e.length&&!/\s/.test(e[i]))i++;if(i===e.length)return{kind:"attribute",name:l,quote:null,valuePrefix:e.slice(f)}}}return{kind:"tag"}}class he extends Error{attribute;near;constructor(e,n){super(`Unsafe interpolation in ${e}: ${n}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,n){if(this.near===void 0)this.near=e.slice(Math.max(0,n-160),n).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var Yi="unsafe:";var Zc=/^(?:javascript|vbscript|livescript|mocha|view-source):/,Jc=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,Xc=/^data:(?:text\/html|application\/xhtml\+xml)/,Gc=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function Yc(e){return e.replace(Gc,"").toLowerCase()}function ar(e){let n=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(n))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(n))return"fetched";return null}function ds(e,n="navigable"){let r=Yc(e);if(Zc.test(r))return!0;return n==="navigable"?Jc.test(r):Xc.test(r)}function Mr(e,n="navigable"){return ds(e,n)?"unsafe:"+e:e}function Qc(e){let n=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!n)return null;if(n[3].trim()!=="")return null;return ar(n[1])}function Qi(e,n,r=256){if(n<=r)return e.slice(0,n);let i=e.slice(n-r,n),a=i.search(/[\s"'`/]/);return a===-1?"":i.slice(a)}function fo(e,n,r=n){let i=Qc(e);return i&&ds(n,i)?"unsafe:"+r:r}function Wt(e){let n=e.indexOf(" as ");if(n!==-1){let l=e.slice(0,n).trim(),u=e.slice(n+4).trim();return l&&u?{arrayExpr:l,itemVar:u}:null}let r=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!r)return null;let i=r[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),a=r[2].trim();return i&&a?{arrayExpr:a,itemVar:i}:null}function gs(e){let n=[],r=0,i="",a=0;for(let l=0;l<e.length;l++){let u=e[l];if(i){if(u==="\\")l++;else if(u===i)i="";continue}if(u==="'"||u==='"'||u==="`")i=u;else if(u==="("||u==="["||u==="{")r++;else if(u===")"||u==="]"||u==="}")r--;else if(u===","&&r===0)n.push(e.slice(a,l)),a=l+1}return n.push(e.slice(a)),n}function go(e,n){let r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a==="("||a==="["||a==="{")r++;else if(a===")"||a==="]"||a==="}")r--;else if(a===n&&r===0)return i}return-1}function mo(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="("||i==="["||i==="{")n++;else if((i===")"||i==="]"||i==="}")&&--n===0)return r}return-1}function Ft(e,n){let r=e.trim().replace(/^\.\.\./,"").trim(),i=go(r,"=");if(i!==-1&&r[i+1]!==">")r=r.slice(0,i).trim();if(!r)return;if(r.startsWith("{")&&r.endsWith("}")){for(let a of gs(r.slice(1,-1))){let l=a.trim();if(!l)continue;if(l.startsWith("...")){Ft(l,n);continue}let u=go(l,":");Ft(u===-1?l:l.slice(u+1),n)}return}if(r.startsWith("[")&&r.endsWith("]")){for(let a of gs(r.slice(1,-1)))Ft(a,n);return}if(/^[A-Z_$][\w$]*$/i.test(r))n.push(r)}function oe(e){let n=e.trim(),r=[],i=0;for(let l=0;l<n.length;l++){let u=n[l];if(u==="("||u==="["||u==="{")i++;else if(u===")"||u==="]"||u==="}")i--;else if(i===0&&/\s/.test(u)){if(!/^\s+(?:in|of)\s/.exec(n.slice(l)))continue;let v=n.slice(0,l).trim();if(v.startsWith("(")&&mo(v)===v.length-1)v=v.slice(1,-1);for(let S of gs(v))Ft(S,r);if(r.length>0)return r;break}}let a=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(n);if(a){let l=a[1].trim();if(l.startsWith("(")&&mo(l)===l.length-1)l=l.slice(1,-1);let u=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(l);if(u)Ft(u[2],r),Ft(u[1],r);else for(let f of gs(l))Ft(f,r)}return r}function F(e,n){let r=n instanceof Set?n:new Set(n);if(r.size===0)return!1;let u=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let f of u.match(/[a-zA-Z_$][\w$]*/g)||[])if(r.has(f))return!0;return!1}var ms="__stx_client_loop_names";function mt(e){let n=e?.[ms];return Array.isArray(n)?n:[]}function hs(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let n=[],r=[],i=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let a of e.matchAll(i)){let l=a[0];if(/^<\/template\s*>$/i.test(l)){let u=r.pop();if(u)u.end=a.index}else if(/^<template\b/i.test(l)&&!/\/\s*>$/.test(l)){let f=[...l.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((I)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(I[1])),v=(f?.[2]??f?.[3])?.trim();if(v&&f?.[1]==="data-stx-slot-binding")try{v=decodeURIComponent(v)}catch{v=void 0}let S=v?{start:a.index+l.length,end:e.length,binding:v}:void 0;if(r.push(S),S)n.push(S)}}return n}var vn={},_o=new Map;function el(e){let n=_o.get(e);if(!n){let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=new RegExp(`:${r}(?!\\w)`,"g"),_o.set(e,n)}return n.lastIndex=0,n}var lo={uppercase:(e,n)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,n)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,n)=>{if(e===void 0||e===null)return"";let r=String(e);return r.charAt(0).toUpperCase()+r.slice(1)},number:(e,n,r=0)=>{if(e===void 0||e===null)return"";try{let i=Number(e);return Number.isNaN(i)?"":i.toFixed(Number.parseInt(String(r),10))}catch{return""}},fmt:(e,n,r="en-US")=>{if(e===void 0||e===null)return"";try{let i=Number(e);if(Number.isNaN(i))return String(e);return i.toLocaleString(r)}catch{return String(e)}},join:(e,n,r=",")=>{if(!Array.isArray(e))return"";return e.join(String(r))},escape:(e,n)=>{if(e===void 0||e===null)return"";return Y(String(e))},translate:(e,n,r={})=>{if(!n||!n.__translations)return e;let i=n.__translations,a=n.__i18nConfig?.fallbackToKey??!0,l=String(e).split("."),u=i;for(let v of l){if(u===void 0||u===null)break;u=u[v]}if(u===void 0||u===null)return a?e:"";let f=String(u);return Object.entries(r).forEach(([v,S])=>{f=f.replace(el(v),()=>String(S))}),f},t:(e,n,r={})=>lo.translate(e,n,r),truncate:(e,n,r=50,i="...")=>{if(e===void 0||e===null)return"";let a=String(e);if(a.length<=r)return a;if(r<=i.length)return i.substring(0,r);return a.substring(0,r-i.length)+i},date:(e,n,r="short",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return String(e);let l={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(r==="iso")return a.toISOString();return new Intl.DateTimeFormat(i,l[r]||l.short).format(a)}catch{return String(e)}},currency:(e,n,r="USD",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=Number(e);if(Number.isNaN(a))return String(e);return new Intl.NumberFormat(i,{style:"currency",currency:r}).format(a)}catch{return String(e)}},pluralize:(e,n,r,i)=>{let a=Number(e);if(Number.isNaN(a))return r;let l=i||`${r}s`;return a===1?r:l},first:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let r=String(e);return r.charAt(r.length-1)},length:(e,n)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,n,r=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return r?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,n,r="")=>e===void 0||e===null||e===""?r:e,reverse:(e,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,n,r=0,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(r,i);return e},replace:(e,n,r,i="")=>{if(e===void 0||e===null)return"";let a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(a,"g"),()=>i)},stripTags:(e,n)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,n)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,n)=>{let r=Number(e);return Number.isNaN(r)?0:Math.abs(r)},round:(e,n,r=0)=>{let i=Number(e);if(Number.isNaN(i))return 0;let a=10**r;return Math.round(i*a)/a}};function qg(e,n){if(e in lo)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);vn[e]=n}function Ry(e){for(let[n,r]of Object.entries(e))qg(n,r)}function Kg(){return{...lo,...vn}}function Ay(){for(let e of Object.keys(vn))delete vn[e]}function ko(e){let n=e.next();while(!n.done)n=e.next();return n.value}function*Co(e,n,r,i){let a="{".repeat(r);if(!e.includes(a))return e;let l="",u=0,f=0,v=i===Number.POSITIVE_INFINITY?0:performance.now();for(;;){let S=e.indexOf(a,u);if(S===-1)break;let I=Pe(e,S,r);if(I===-1)break;if(l+=e.slice(u,S)+n(e.slice(S,I+r),e.slice(S+r,I),S),u=I+r,++f>=64){f=0;let j=performance.now();if(j-v>=i)v=j,yield}}return u===0?e:l+e.slice(u)}function In(e,n,r=2){return ko(Co(e,n,r,Number.POSITIVE_INFINITY))}function $l(e,n,r){let i=r[0];if(i!=="'"&&i!=='"'&&i!=="`")return!1;let a=Dr(e,n);if(!a||a.kind!=="attribute"||a.quote===i)return!1;if(!/^(?::|@|x-|v-)/.test(a.name))return!1;let l=0;for(let u=0;u<a.valuePrefix.length;u++)if(a.valuePrefix[u]==="\\")u++;else if(a.valuePrefix[u]===i)l++;return l%2===1}function g(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Y(e){return Gi(g(e))}function Rl(e){return e.replace(/ /g," ").replace(/\t/g,"	").replace(/\n/g," ").replace(/\r/g," ").replace(/\f/g,"").replace(/=/g,"=").replace(/`/g,"`")}function Al(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(n,r)=>String.fromCodePoint(Number.parseInt(r,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function Il(e,n){let r=Al(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(r))throw new he(n,"network-capable or executable CSS is not allowed in an escaped interpolation");let i=/url\(([^)]*)\)/g,a;while((a=i.exec(r))!==null){let l=a[1].replace(/^["']|["']$/g,""),u=l.startsWith("/")&&!l.startsWith("//")||l.startsWith("./")||l.startsWith("../")||l.startsWith("#"),f=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(l);if(!u&&!f)throw new he(n,"CSS URLs must be local paths or base64 raster images")}}function ae(e,n,r,i=!1,a=0){try{return Ol(e,n,r,i,a)}catch(l){if(l instanceof he)l.locate(e,n);throw l}}function Ol(e,n,r,i,a){let l=Dr(e,n,i),u=Y(r);if(!l)return u;if(l.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(r))throw new he("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return r}if(l.kind==="tag"){let S=e.slice(n+a).trimStart(),I=r.trim();if(!S.startsWith("=")&&(I===""||I.split(/\s+/).every((j)=>/^(?!on)[A-Za-z_:][\w:.-]*$/.test(j))))return I;throw new he("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let f=l.name.toLowerCase();if(/^on[a-z]/.test(f))throw new he(l.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(f==="srcdoc")u=Y(u);if(f==="style")Il(r,l.name);if(l.quote===null)u=Rl(u);let v=ar(f);if(v&&l.valuePrefix.trim()===""&&ds(r,v))return Yi+u;return fo(Qi(e,n),r,u)}function On(e,n){let r=` ${e}="`;return ae(r,r.length,n,!0)}function Ro(e){return e.flatMap((n)=>{let r=n.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!r||/\bserver\b|\bsrc\s*=/.test(r[1])?[]:[r[2]]})}function Ne(e,n){let{scripts:r}=se(e);for(let i of Ro(r)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(i)||kl.test(i))return!0;if(Jr(i,n))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function Gg(e){let n=[],r=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let i=r.exec(e);i;i=r.exec(e)){let a=i[1].toLowerCase(),l=new Set(oe(i[3]));if(l.size===0)continue;let u=i.index+i[0].length;if(i[0].endsWith("/>")){n.push({start:i.index,end:u,names:l});continue}let f=new RegExp(`<(/?)${a}\\b[^>]*?(/?)>`,"gi");f.lastIndex=u;let v=1,S=e.length;for(let I=f.exec(e);I;I=f.exec(e)){if(I[2]==="/")continue;if(v+=I[1]==="/"?-1:1,v===0){S=I.index+I[0].length;break}}n.push({start:i.index,end:S,names:l})}return n}function wo(e,n,r){let i=t(r);for(let a of e){if(n<a.start||n>=a.end)continue;for(let l of a.names)if(new RegExp(`(?<![.#\\w$])${l.replace(/\$/g,"\\$")}(?![\\w$])`).test(i))return!0}return!1}function vo(e,n){let r=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],i=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),a="",l=!1,u=0;for(let S=0;S<i.length;S++){let I=i[S];if(!l&&I==="`"){l=!0,u=0;continue}if(l){if(I==="`"&&u===0){l=!1;continue}if(I==="$"&&i[S+1]==="{"){u++,S++,a+=" ";continue}if(I==="}"&&u>0){u--;continue}if(u>0){a+=I;continue}continue}a+=I}i=a;let f=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,v;while((v=f.exec(i))!==null){let S=v[1];if(!i.substring(0,v.index).trimEnd().endsWith(".")){if(!r.includes(S)&&!(S in n))return!1}}return!0}function jl(e,n){let r=t(e);for(let i of r.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof n[i[1]]==="function")return!0;return!1}function Pl(e,n){let r=n.__stx_serverDeclared;if(!r||r.size===0)return!1;let i=t(e);for(let a of r)if(new RegExp(`(?<![.#\\w$])${a}(?![\\w$])`).test(i))return!0;return!1}var So=new Set;function $o(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function Ml(e,n,r){let i=r[0];if(i!=="'"&&i!=='"'&&i!=="`")return!1;let a=0;for(let l=e.lastIndexOf(`
|
|
217
|
+
`,n-1)+1;l<n;l++)if(e[l]==="\\")l++;else if(e[l]===i)a++;return a%2===1}function Eo(e,n){let r=`${n??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!So.has(r))So.add(r),console.warn(`[stx] {{ ${e} }} in a <script> in ${n??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function Vi(e,n,r){let i=e;return i=i.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>{try{let u=N(l,n);if(u===void 0)return $o(l)?Eo(l.trim(),r):a;return u===null?"":String(u)}catch{return a}}),i=In(i,(a,l,u)=>{let f=l.trim();if(Ml(i,u,l))return a;if(/^__[A-Z_]+__$/.test(f))return a;try{let v=N(l,n);if(v===void 0)return $o(f)?Eo(f,r):a;return JSON.stringify(v).replace(/</g,"\\u003c").replace(/@/g,"\\u0040").replace(/\{{2,}/g,(S)=>"\\u007b".repeat(S.length)).replace(/\{(?=!)/g,"\\u007b")}catch{return a}}),i}function Xg(e,n){if(!e.includes("{"))return e;let r=e;return r=r.replace(/\{!!([\s\S]*?)!!\}/g,(i,a)=>{try{let l=N(a,n);if(l===void 0)return i;return l===null?"":String(l)}catch{return i}}),r=In(r,(i,a,l)=>{let u=a.trim();if(/^__[A-Z_]+__$/.test(u))return i;try{let f=N(a,n);if(f===void 0)return i;if(f===null)return"";let v=String(f);return ae(r,l,v,!0,i.length)}catch(f){if(f instanceof he)throw f;return i}}),r}function Py(e,n,r={}){let{output:i,scripts:a}=se(e),l=a.map((u)=>{let f=u.match(/^<script\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/i),v=u.search(/<\/script\s*>$/i);if(!f||v===-1)return u;let S=f[1],I=u.slice(f[0].length,v);if(/\bdata-raw\b/.test(S))return u;if(r.skipServer&&/\bserver\b/.test(S))return u;let L=`<script${Xg(S,n)}>`;if(/\bsrc\s*=/.test(S)||/\btype\s*=\s*["']application\/json["']/.test(S))return L+I+u.slice(v);return L+Vi(I,n)+u.slice(v)});return Nr(i,l)}function*To(e,n,r,i){let a=e,l=(W,Z)=>{let q=Cn(W,Z);if(q===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(W.slice(Z,q))?-1:q},u=(W,Z,q,G)=>{let U=q.length,{output:H,tokens:re}=ke(W,Z,(ce,le)=>G(U+le));return q.push(...re),H},f=[];a=u(a,l,f,(W)=>`<!--__STX_STYLE_${W}__-->`);let v=[];a=u(a,Q,v,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`);let S=n?.__stx_signals_gate===!0||Ne(e),I=new Set([...Array.isArray(n?.__stx_client_signal_names)?n.__stx_client_signal_names:[],...Hi(Ro(v))]),j=new Set(Array.isArray(n?.__stx_preserved_client_expressions)?n.__stx_preserved_client_expressions:[]);a=In(a,(W,Z,q)=>{if(F(Z,I))return W;try{let G=N(Z,n,!1,(U)=>cr(U,W,r,e));return G!==void 0&&G!==null?String(G):""}catch(G){let U=G instanceof Error?G.message:String(G);return b("Expression",`Error evaluating: {{{ ${Z.trim()}}}}: ${U}`,r,e,q,W)}},3),a=a.replace(/\{!!([\s\S]*?)!!\}/g,(W,Z,q)=>{if(F(Z,I))return W;try{let G=N(Z,n,!1,(U)=>cr(U,W,r,e));if(G===void 0&&n.__stx_buildMode==="compile")return ps("raw",Z.trim());return G!==void 0&&G!==null?String(G):""}catch(G){if(n.__stx_buildMode==="compile")return ps("raw",Z.trim());let U=G instanceof Error?G.message:String(G);return b("Expression",`Error evaluating: {!! ${Z.trim()} !!}: ${U}`,r,e,q,W)}}),a=u(a,Q,v,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`),a=u(a,l,f,(W)=>`<!--__STX_STYLE_${W}__-->`);let L=S?Gg(a):[],M=hs(a).map((W)=>({...W,names:new Set(oe(`${W.binding} in __slot`))})),V=new Set(mt(n));if(a=yield*Co(a,(W,Z,q)=>{let G=Z.trim();if($l(a,q,Z))return W;if(wo(M,q,G))return W;if(F(G,V))return W;if(L.length>0&&wo(L,q,G))return W;if(j.has(G))return W;let U=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],H=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,ce=G.match(H)?.[1],le=ce&&((ce in n)||U.includes(ce)),fe=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,we=G.match(fe),Ee=we&&!U.includes(we[1])&&!(we[1]in n);if(/^__[A-Z_]+__$/.test(G))return"";if(F(G,I))return W;if(n.__stx_native_screen===!0&&jl(G,n))return W;let Re;try{let ve=N(Z,n,!1,(Be)=>{Re=Be});if(S&&!vo(G,n))return W;if(Re)cr(Re,W,r,e);if(n.__stx_buildMode==="compile"&&!S&&(ve===void 0||Pl(G,n)))return ps("expr",G);if(ve===void 0||ve===null)return"";let Qe=String(ve);return ae(a,q,Qe,!1,W.length)}catch(ve){if(ve instanceof he)throw ve;if(S&&!vo(G,n))return W;if(Ee)return W;let Qe=ve instanceof Error?ve.message:String(ve);return b("Expression",`Error evaluating: {{ ${G} }}: ${Qe}`,r,e,q,W)}},2,i),v.length>0)a=a.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(W,Z)=>v[Number(Z)]??W);if(f.length>0)a=a.replace(/<!--__STX_STYLE_(\d+)__-->/g,(W,Z)=>f[Number(Z)]??W);return a}function P(e,n,r){return ko(To(e,n,r,Number.POSITIVE_INFINITY))}var Nl=100;async function Wi(e,n,r,i=Nl){let a=To(e,n,r,i),l=a.next();while(!l.done)await R(),l=a.next();return l.value}function Jg(e,n,r){if(!n.trim())return e;let i=e,a=n.trim();while(a.length>0){let l=a.match(/^(\w+)/);if(!l)break;let u=l[1];a=a.substring(u.length).trim();let f=vn[u]||lo[u];if(!f)throw Error(`Filter not found: ${u}. Available filters: ${Object.keys(Kg()).join(", ")}`);let v=[];if(a.startsWith(":")){let S=a.match(/^:([^|\s]+)/);if(S){let I=S[1].trim();try{let j=Number(I);v=[Number.isNaN(j)?I:j]}catch{v=[I]}a=a.substring(S[0].length).trim()}}else if(a.startsWith("(")){let S=1,I=1;while(S>0&&I<a.length){if(a[I]==="(")S++;if(a[I]===")")S--;I++}if(S===0){let j=a.substring(1,I-1).trim();if(j)try{if(j.startsWith("{")&&j.endsWith("}"))v=[N(`(${j})`,r,!0)];else{let L=[],M="",V=null,W=0,Z=0,q=0,G=!1;for(let U=0;U<j.length;U++){let H=j[U];if(G){M+=H,G=!1;continue}if(H==="\\"){M+=H,G=!0;continue}if(V){if(M+=H,H===V)V=null;continue}if(H==='"'||H==="'"||H==="`"){V=H,M+=H;continue}if(H==="(")W++;else if(H===")")W--;else if(H==="[")Z++;else if(H==="]")Z--;else if(H==="{")q++;else if(H==="}")q--;if(H===","&&W===0&&Z===0&&q===0){L.push(M),M="";continue}M+=H}if(M)L.push(M);v=L.map((U)=>{let H=U.trim();return N(H,r,!0)})}}catch{v=[j]}a=a.substring(I).trim()}}try{i=f(i,r,...v)}catch(S){let I=S instanceof Error?S.message:String(S);throw Error(`Error applying filter '${u}': ${I}`)}if(a.startsWith("|"))a=a.substring(1).trim();else break}return i}function Ll(e){let n=!1,r="",i=0,a=0,l=0,u=!1;for(let f=0;f<e.length;f++){let v=e[f],S=e[f+1];if(n&&u){u=!1;continue}if(n&&v==="\\"){u=!0;continue}if(u=!1,(v==='"'||v==="'"||v==="`")&&!u){if(!n)n=!0,r=v;else if(v===r)n=!1,r="";continue}if(n&&r==="`"&&v==="$"&&S==="{"){let I=1;f+=2;while(f<e.length&&I>0){if(e[f]==="{")I++;else if(e[f]==="}")I--;if(I>0)f++}continue}if(n)continue;if(v==="(")i++;else if(v===")")i--;else if(v==="[")a++;else if(v==="]")a--;else if(v==="{")l++;else if(v==="}")l--;if(v==="|"&&i===0&&a===0&&l===0){if(S==="|"){f++;continue}if(S==="="){f++;continue}return f}}return-1}var wn=new Set,zl=1000;function Iy(){wn.clear()}function cr(e,n,r,i){if(!ne())return;let a=`${r}\x00${e.expression}`;if(wn.has(a))return;if(wn.size>=zl)wn.clear();wn.add(a);let l=r,u=i;try{if(r&&xo.existsSync(r))u=xo.readFileSync(r,"utf8")}catch{}let f=u.indexOf(n);if(f>=0)l=`${r}:${u.slice(0,f).split(`
|
|
218
218
|
`).length}`;console.warn(`${l}: stx warning: ${n} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function N(e,n,r=!1,i){try{let a=e.trim(),l=Ll(a);if(l>0){let f=a.substring(0,l).trim(),v=a.substring(l+1).trim(),S=N(f,n,!0,i);return Jg(S,v,n)}let u=po(a);if(u!==null){i?.({expression:a,rule:u});return}try{let f=Object.keys(n),v=Object.values(n);return p(a,f)(...v)}catch{return d(a,n)}}catch(a){if(a instanceof ReferenceError){let l=/(\b\w+)\s+is not defined/.exec(a.message);if(l){let u=l[1],f=Wl(u,Object.keys(n));if(f&&f!==u)a.message=`${a.message} \u2014 did you mean '${f}'?`}}if(!r)console.error(`Error evaluating expression: ${e}`,a);throw a}}function Wl(e,n){let r=null;for(let a of n){if(a===e)continue;let l=Vl(e,a);if(r===null||l<r.dist)r={key:a,dist:l}}if(!r)return null;let i=Math.max(e.length,r.key.length);if(r.dist<=2||r.dist/i<=0.35)return r.key;return null}function Vl(e,n){if(e===n)return 0;if(e.length===0)return n.length;if(n.length===0)return e.length;let[r,i]=e.length<n.length?[e,n]:[n,e],a=Array(r.length+1),l=Array(r.length+1);for(let u=0;u<=r.length;u++)a[u]=u;for(let u=1;u<=i.length;u++){l[0]=u;for(let f=1;f<=r.length;f++){let v=r[f-1]===i[u-1]?0:1;l[f]=Math.min(l[f-1]+1,a[f]+1,a[f-1]+v)}for(let f=0;f<=r.length;f++)a[f]=l[f]}return a[r.length]}function Oy(e){if(!e)return"";return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}import Ul from"process";function A(e="STX_PUBLIC_"){let n={},r={};for(let[i,a]of Object.entries(Ul.env)){if(!i.startsWith(e)||a===void 0)continue;n[`import.meta.env.${i}`]=JSON.stringify(a),r[i]=a}return n["import.meta.env"]=JSON.stringify(r),n}function Ao(e,n=""){let r=`${e}${n}`,i=0;for(let a=0;a<r.length;a++){let l=r.charCodeAt(a);i=(i<<5)-i+l,i=i&i}return`stx-${Math.abs(i).toString(36)}`}function Io(e,n,r={}){let{prefix:i="",preserveHost:a=!0,scopeKeyframes:l=!0,scopeCustomProperties:u=!1}=r;if(!e.trim())return"";let f=lr(e),v=[],S=new Map;if(l)for(let I of f){let j=I.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(j){let L=j[1],M=`${n}_${L}`;S.set(L,M)}}for(let I of f){let j=Oo(I,n,i,a,S,u);v.push(j)}return v.join(`
|
|
219
219
|
|
|
220
220
|
`)}function lr(e){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=0,a="",l=!1,u="";for(let f=0;f<r.length;f++){let v=r[f];if(v==="@"&&i===0)l=!0;if(v==="{")i++;else if(v==="}"){if(i--,i===0){if(l){u+=v;let S=u.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(S){let[,I,j,L]=S;if(I==="keyframes")n.push({selector:`@keyframes ${j.trim()}`,declarations:L.trim()});else if(I==="media"||I==="supports"||I==="container"){let M=lr(L);n.push({selector:`@${I} ${j.trim()}`,declarations:M.map((V)=>`${V.selector} { ${V.declarations} }`).join(`
|
|
@@ -505,7 +505,7 @@ window.__stx_reactive = (function() {
|
|
|
505
505
|
${au()}
|
|
506
506
|
${i}
|
|
507
507
|
</script>`}function pl(e,n,r,i=!1){if(!fr(e))return e;let a=su(e);if(a.length===0)return e;let l=lu(e,a),u=cu(a,n,i),f=c(l);if(f!==-1)l=l.slice(0,f)+u+`
|
|
508
|
-
`+l.slice(f);else l+=u;return l}function lu(e,n){let r=[],i=0;for(let[l,u]of Lo(e).entries()){let f=n[l];if(!f)break;r.push(e.slice(i,u.startIndex));let v=xs(u.attributes,"data-stx-scope");if(v)f.id=v,f.selector=`[data-stx-scope="${f.id}"]`,r.push(u.fullMatch);else r.push(`<${u.tagName} data-stx-scope="${f.id}"${u.attributes}>`);i=u.endIndex}r.push(e.slice(i));let a=r.join("");return a=a.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),a=a.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),a=a.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),a=a.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),a=a.replace(/\s*x-destroy\s*=\s*"([^"]*)"/g,' data-stx-xdestroy="$1"'),a=a.replace(/\s*x-destroy\s*=\s*'([^']*)'/g," data-stx-xdestroy='$1'"),a}function fr(e){return/x-data\s*=\s*["']/.test(e)}function io(e,n){let r=e,i=/@json\s*\(/g,a;while((a=i.exec(r))!==null){let l=a.index,u=l+a[0].length-1,f=1,v=u+1,S=null,I=!1;while(v<r.length&&f>0){let U=r[v];if(I){I=!1,v++;continue}if(U==="\\"&&S){I=!0,v++;continue}if(S){if(U===S)S=null;v++;continue}if(U==='"'||U==="'"||U==="`"){S=U,v++;continue}if(U==="(")f++;else if(U===")"){if(f--,f===0)break}v++}if(f!==0)break;let j=r.substring(u+1,v).trim(),L=r.substring(l,v+1),M=-1,V=0,W=null,Z=!1;for(let U=0;U<j.length;U++){let H=j[U];if(Z){Z=!1;continue}if(H==="\\"&&W){Z=!0;continue}if(W){if(H===W)W=null;continue}if(H==='"'||H==="'"||H==="`"){W=H;continue}if(H==="("||H==="["||H==="{")V++;else if(H===")"||H==="]"||H==="}")V--;if(H===","&&V===0){M=U;break}}let q=M>=0?j.substring(0,M).trim():j,G=M>=0?j.substring(M+1).trim():void 0;try{let U=q.trim(),H;if(m(U))H=p(U,Object.keys(n))(...Object.values(n));else H=void 0;let re;if(G==="true")re=JSON.stringify(H,null,2);else re=JSON.stringify(H);let ce=re.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");r=r.substring(0,l)+ce+r.substring(v+1),i.lastIndex=l+ce.length}catch(U){K.log(U instanceof Error?U:Error(String(U)),{directive:"@json"},"error"),i.lastIndex=l+L.length}}return r}function ao(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function fl(e){let n=e,r=/@memo\s*\(/g,i,a=[];while((i=r.exec(n))!==null){let l=i.index,u=l+i[0].length,f=1,v=u;while(v<n.length&&f>0){if(n[v]==="(")f++;else if(n[v]===")")f--;v++}if(f!==0)continue;let S=n.slice(u,v-1).trim(),I=v,j=n.slice(I),L=j.indexOf("@endmemo");if(L===-1)continue;let M=j.slice(0,L),V=I+L+8,W=
|
|
508
|
+
`+l.slice(f);else l+=u;return l}function lu(e,n){let r=[],i=0;for(let[l,u]of Lo(e).entries()){let f=n[l];if(!f)break;r.push(e.slice(i,u.startIndex));let v=xs(u.attributes,"data-stx-scope");if(v)f.id=v,f.selector=`[data-stx-scope="${f.id}"]`,r.push(u.fullMatch);else r.push(`<${u.tagName} data-stx-scope="${f.id}"${u.attributes}>`);i=u.endIndex}r.push(e.slice(i));let a=r.join("");return a=a.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),a=a.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),a=a.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),a=a.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),a=a.replace(/\s*x-destroy\s*=\s*"([^"]*)"/g,' data-stx-xdestroy="$1"'),a=a.replace(/\s*x-destroy\s*=\s*'([^']*)'/g," data-stx-xdestroy='$1'"),a}function fr(e){return/x-data\s*=\s*["']/.test(e)}function io(e,n){let r=e,i=/@json\s*\(/g,a;while((a=i.exec(r))!==null){let l=a.index,u=l+a[0].length-1,f=1,v=u+1,S=null,I=!1;while(v<r.length&&f>0){let U=r[v];if(I){I=!1,v++;continue}if(U==="\\"&&S){I=!0,v++;continue}if(S){if(U===S)S=null;v++;continue}if(U==='"'||U==="'"||U==="`"){S=U,v++;continue}if(U==="(")f++;else if(U===")"){if(f--,f===0)break}v++}if(f!==0)break;let j=r.substring(u+1,v).trim(),L=r.substring(l,v+1),M=-1,V=0,W=null,Z=!1;for(let U=0;U<j.length;U++){let H=j[U];if(Z){Z=!1;continue}if(H==="\\"&&W){Z=!0;continue}if(W){if(H===W)W=null;continue}if(H==='"'||H==="'"||H==="`"){W=H;continue}if(H==="("||H==="["||H==="{")V++;else if(H===")"||H==="]"||H==="}")V--;if(H===","&&V===0){M=U;break}}let q=M>=0?j.substring(0,M).trim():j,G=M>=0?j.substring(M+1).trim():void 0;try{let U=q.trim(),H;if(m(U))H=p(U,Object.keys(n))(...Object.values(n));else H=void 0;let re;if(G==="true")re=JSON.stringify(H,null,2);else re=JSON.stringify(H);let ce=re.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");r=r.substring(0,l)+ce+r.substring(v+1),i.lastIndex=l+ce.length}catch(U){K.log(U instanceof Error?U:Error(String(U)),{directive:"@json"},"error"),i.lastIndex=l+L.length}}return r}function ao(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function fl(e){let n=e,r=/@memo\s*\(/g,i,a=[];while((i=r.exec(n))!==null){let l=i.index,u=l+i[0].length,f=1,v=u;while(v<n.length&&f>0){if(n[v]==="(")f++;else if(n[v]===")")f--;v++}if(f!==0)continue;let S=n.slice(u,v-1).trim(),I=v,j=n.slice(I),L=j.indexOf("@endmemo");if(L===-1)continue;let M=j.slice(0,L),V=I+L+8,W=Vt(M),Z=M.slice(W),q=M.match(/(\s*)$/),G=q?q[0].length:0,U=Z.slice(0,Z.length-G),H=U.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),re;if(H){let[ce,le,fe="",we]=H,Ee=`<${le}${fe} data-stx-memo="${S}"${we}>`;re=M.slice(0,W)+Ee+U.slice(ce.length)+M.slice(W+U.length)}else re=`${M.slice(0,W)}<div data-stx-memo="${S}">${U}</div>${M.slice(W+U.length)}`;a.push({start:l,end:V,replacement:re}),r.lastIndex=V}for(let l=a.length-1;l>=0;l--){let u=a[l];n=n.slice(0,u.start)+u.replacement+n.slice(u.end)}return n.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function ji(e){let n=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return n=n.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),n}function Fo(e,n){let r=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,i=x(e,(f,v)=>{r.lastIndex=v;let S=r.exec(f);if(!S||/^(?:script|style)$/i.test(S[1]))return-1;return r.lastIndex}),a=[],l=0,u=[];for(let{start:f,end:v,token:S}of i){let I=/^<\/?([\w-]+)/.exec(S)[1].toLowerCase();if(S.startsWith("</")){while(a.length&&a.pop()!==I);continue}if(!a.length&&!/\sdata-stx-slot-owner\s*=/.test(S))u.push(e.slice(l,f),S.replace(/\s*\/?>$/,(j)=>` data-stx-slot-owner="${n}"${j}`)),l=v;if(!dr.has(I)&&!/\/>$/.test(S))a.push(I)}return u.push(e.slice(l)),u.join("")}function Vo(e,n){if(!/\bref\s*=/.test(e))return e;let r=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,i=x(e,(v,S)=>{r.lastIndex=S;let I=r.exec(v);if(!I||/^(?:script|style)$/i.test(I[1]))return-1;return r.lastIndex}),a=[],l=0,u=0,f=[];for(let{start:v,end:S,token:I}of i){let j=/^<\/?([\w-]+)/.exec(I)[1].toLowerCase();if(I.startsWith("</")){let W;while(W=a.pop()){if(W.scoped)l--;if(W.name===j)break}continue}let L=/\sdata-stx-scope\s*=/.test(I),M=/\sdata-stx-ref-caller\s*=\s*(["'])(.*?)\1/.exec(I),V=a.find((W)=>W.scoped)?.scopeId;if(M&&V&&M[2]===V)f.push(e.slice(u,v),I.replace(M[0],` data-stx-ref-caller="${n}"`)),u=S;else if(!l&&!L&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(I)&&!/\sdata-stx-ref-caller\s*=/.test(I))f.push(e.slice(u,v),I.replace(/\s*\/?>$/,(W)=>` data-stx-ref-caller="${n}"${W}`)),u=S;if(!dr.has(j)&&!/\/>$/.test(I)){let W=/\sdata-stx-scope\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(I);if(a.push({name:j,scoped:L,scopeId:W?.[1]??W?.[2]}),L)l++}}return f.push(e.slice(u)),f.join("")}var dr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Uo=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,zo=/<\/?\s*([a-z][\w-]*)/iy,uu=/\s/;function pu(e,n){let r=n-1;while(r>=0&&uu.test(e[r]))r--;return r>=0&&e[r]==="/"}function fu(e,n){let r=!1,i=!1;for(let a=n;a<e.length;a++){let l=e[a];if(r){if(l==="'")r=!1}else if(i){if(l==='"')i=!1}else if(l==="'")r=!0;else if(l==='"')i=!0;else if(l===">")return a}return-1}function du(e,n){if(e.indexOf("{",n)===-1||e.indexOf("}",n)===-1)return!1;let r=0,i=n,a=!1,l=!1,u=!1;while(i<e.length){let f=e.indexOf("<",i),v=f===-1?e.length:f;if(v>i){if(r===0)while(i<v){let j=e.indexOf(l?"}":"{",i);if(j===-1||j>=v){if(l)u=!1;else a=!1;break}if(j>i)if(l)u=!1;else a=!1;if(l){if(u)return!0;u=!0}else if(a)l=!0,u=!1;else a=!0;i=j+1}i=v;continue}if(e.startsWith("<!--",i)){let j=e.indexOf("-->",i);i=j===-1?e.length:j+3;continue}let S=fu(e,i);if(S===-1)break;zo.lastIndex=i;let I=zo.exec(e)?.[1]?.toLowerCase()??"";if(e[i+1]==="/"){if(r===0)break;r--}else if(!pu(e,S)&&!dr.has(I))r++;i=S+1}return!1}var Bo=k(256);function gl(e){if(e.length<1024)return Wo(e);let n=E(e),r=Bo.get(n);if(r!==void 0)return r;let i=Wo(e);return Bo.set(n,i),i}function Wo(e){if(e.length>=32768&&!ki(e))return e;let r=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),i="",a=0,l;while((l=r.exec(e))!==null){let u=l.index,f=u+l[0].length,v=!1,S=!1,I=-1;while(f<e.length){let L=e[f];if(v){if(L==="'")v=!1}else if(S){if(L==='"')S=!1}else if(L==="'")v=!0;else if(L==='"')S=!0;else if(L===">"){I=f;break}f++}if(I===-1)continue;let j=e.slice(u,I+1);if(Uo.test(j))continue;if(j.includes("x-cloak"))continue;if(du(e,I+1))i+=e.slice(a,I)+" x-cloak>",a=I+1}return i+=e.slice(a),i}var gu=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,mu=/<\/script>/gi,hu=/<\/style>/gi;function ml(e){let n=/<[a-z][\w-]*/gi,r="",i=0,a;while((a=n.exec(e))!==null){let l=a.index,u=a[0].slice(1).toLowerCase();if(u==="script"||u==="style"){let V=u==="script"?mu:hu;V.lastIndex=l;let W=V.exec(e);if(W!==null)n.lastIndex=W.index+W[0].length;continue}let f=l+a[0].length,v=!1,S=!1,I=-1;while(f<e.length){let V=e[f];if(v){if(V==="'")v=!1}else if(S){if(V==='"')S=!1}else if(V==="'")v=!0;else if(V==='"')S=!0;else if(V===">"){I=f;break}f++}if(I===-1)continue;let j=e.slice(l+a[0].length,I);if(Uo.test(j))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(j))continue;if(!gu.test(j))continue;let L=e[I-1]==="/",M=L?I-1:I;r+=`${e.slice(i,M)} x-cloak${L?" ":""}`,i=M}return r+=e.slice(i),r}function O(e){let n=new Map;for(let r of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))n.set(r[1].toLowerCase(),r[2]??r[3]??r[4]??!0);return n}function $t(e){let n=e.get("type");return typeof n!=="string"||!n.trim()||/^(?:module|(?:text|application)\/(?:javascript|typescript|ecmascript))$/i.test(n.trim())}import ha from"path";import gr from"fs";import jn from"path";function Ho(e,n,r,i){let a=0;for(let l=n;l<e.length;l++)if(e[l]===r)a++;else if(e[l]===i&&!(i===">"&&e[l-1]==="=")){if(--a===0)return l}return-1}function xu(e){let n=t(e),r=0,i=0,a=[];for(let l=0;l<n.length;l++)if("([{".includes(n[l]))r++;else if(")]}".includes(n[l]))r--;else if(n[l]===","&&r===0)a.push(e.slice(i,l).trim()),i=l+1;return a.push(e.slice(i).trim()),a}function kn(e,n,r=!1){let i=t(e),a=new RegExp(`\\b(?:${n.map((u)=>u.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g"),l=r?h(i).depths:void 0;for(let u of i.matchAll(a)){if(l&&l[u.index]!==0)continue;let f=u.index+u[0].length,v="";if(i[f]==="<"){let I=Ho(i,f,"<",">");if(I<0)continue;v=e.slice(f+1,I),f=I+1;while(/\s/.test(i[f]||"")&&f<i.length)f++}if(i[f]!=="(")continue;let S=Ho(i,f,"(",")");if(S>=0)return{type:v,args:xu(e.slice(f+1,S)),start:u.index,end:S+1}}return null}var bs=`
|
|
509
509
|
type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
|
|
510
510
|
type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
|
|
511
511
|
type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
|
|
@@ -781,7 +781,10 @@ ${e?` _beginScope() {
|
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
_callScopeMethod(name, args) {
|
|
784
|
-
|
|
784
|
+
// Template calls already have this render's current prop closures. Refresh
|
|
785
|
+
// pending props only for an outside call, otherwise a public helper in the
|
|
786
|
+
// template would recursively render while the queued update is pending.
|
|
787
|
+
if (!this._scopeRenderDepth && (!this._scopeMethods || this._updatePending)) this.render(RENDER_HELPERS);
|
|
785
788
|
return this._scopeMethods[name].apply(this, args);
|
|
786
789
|
}
|
|
787
790
|
|
|
@@ -959,8 +962,13 @@ const { ${a.apis.join(", ")} } = ${u};`:"",f?`const { ${f} } = this._props();`:"
|
|
|
959
962
|
${I}
|
|
960
963
|
}`),M=L.indexOf("{"),V=L.lastIndexOf("}");j=L.slice(M+1,V).trim()}catch(L){throw Error(`${e.sourcePath}: failed to compile render (${L.message})`)}S=`
|
|
961
964
|
render(__helpers) {
|
|
962
|
-
|
|
963
|
-
|
|
965
|
+
this._scopeRenderDepth = (this._scopeRenderDepth || 0) + 1;
|
|
966
|
+
try {
|
|
967
|
+
const { escape: __escape, raw: __raw, values: __values, entries: __entries } = __helpers;
|
|
968
|
+
${v(v(j.trim()))}
|
|
969
|
+
} finally {
|
|
970
|
+
this._scopeRenderDepth--;
|
|
971
|
+
}
|
|
964
972
|
}
|
|
965
973
|
`}return`import { StxElement, defineComponent } from ${n==="./runtime.js"?"'./runtime.js'":JSON.stringify(n)};
|
|
966
974
|
${a.imports.length?`${a.imports.join(`
|
|
@@ -1141,12 +1149,12 @@ return {`});for(let[W,Z]of u.entries())l.push({text:`value${W}: (`}),l.push({tex
|
|
|
1141
1149
|
`&&!/[=|&,<([{]\s*$/.test(n.slice(Math.max(0,j-40),j)))){S=L===";"?j+1:j;break}}}a.push({name:v,text:e.slice(u.index,S).replace(/^[ \t]*export[ \t]+/,"")}),l.lastIndex=S}return a}function ap(e){let n=t(e),r=[],i=/^[ \t]*(?:export[ \t]+)?(?:const|let|var)[ \t]+/gm,a,l=0,u=0;while((a=i.exec(n))!==null){for(;u<a.index;u++){let S=n[u];if(S==="{"||S==="("||S==="[")l++;else if(S==="}"||S===")"||S==="]")l=Math.max(0,l-1)}if(l!==0)continue;let f=0,v=n.length;for(let S=a.index+a[0].length;S<n.length;S++){let I=n[S];if(I==="{"||I==="("||I==="[")f++;else if(I==="}"||I===")"||I==="]")f--;else if(f<=0&&(I===";"||I===`
|
|
1142
1150
|
`)){v=I===";"?S+1:S;break}}if(/\bdefineProps\s*(?:<|\()/.test(n.slice(a.index,v)))r.push(e.slice(a.index,v).replace(/^[ \t]*export[ \t]+/,"").trim())}return r}function Ii(e){let n=e.filter((a)=>a.kind==="server").map((a)=>a.code).join(`
|
|
1143
1151
|
`);if(/\bdefineProps\s*(?:<|\()/.test(t(n)))return n;let r=va(n),i=e.filter((a)=>a.kind!=="server").flatMap((a)=>{let l=ap(a.code);if(!l.length)return[];return[...Zt(a.code).filter((u)=>!r.has(u.name)).map((u)=>u.text),...l]});return[n,...i].filter(Boolean).join(`
|
|
1144
|
-
`)}function va(e){return new Set(Zt(e).map((n)=>n.name))}function al(e,n=""){let r=_a(e),i=va(n),a=Zt(e).filter((S)=>!i.has(S.name)).map((S)=>S.text);if(!r){let S=ye(e).filter((I)=>!
|
|
1152
|
+
`)}function va(e){return new Set(Zt(e).map((n)=>n.name))}function al(e,n=""){let r=_a(e),i=va(n),a=Zt(e).filter((S)=>!i.has(S.name)).map((S)=>S.text);if(!r){let S=ye(e).filter((I)=>!Ut(n,I));if(S.length===0&&a.length===0)return"";return["",`// ${up}`,...a,...S.map((I)=>`declare var ${I}: any`)].join(`
|
|
1145
1153
|
`)}if(r.length===0)return a.length>0?["",`// ${fa}`,...a].join(`
|
|
1146
1154
|
`):"";let{imports:l,body:u}=wa(e),f=u.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),v=["",`// ${fa}`];if(l)v.push(l);return v.push(...a),v.push(`async function ${da}() {`,f,` return { ${r.join(", ")} }`,"}",`type ${ga} = Awaited<ReturnType<typeof ${da}>>`,...r.map((S)=>`declare var ${S}: ${ga}[${JSON.stringify(S)}]`)),v.join(`
|
|
1147
1155
|
`)}function Oi(e){let n=t(e),r=n.split(""),i=[],a=0,l=0;for(let f=0;f<r.length;f++){let v=r[f];if(v===`
|
|
1148
1156
|
`)l=f+1;if(v==="{"||v==="("||v==="["){if(a===0&&v!=="("&&cp.test(n.slice(l,f))){let S=Sa(n,f);if(S!==-1)i.push(...$a(n.slice(f,S+1)))}a++;continue}if(v==="}"||v===")"||v==="]"){a=Math.max(0,a-1);continue}if(a>0&&v!==`
|
|
1149
|
-
`)r[f]=" "}let u=ye(r.join(""));return i.length===0?u:[...new Set([...u,...i])].sort()}var cp=/^\s*(?:export\s+)?(?:const|let|var)\s*$/;function Sa(e,n){let r=0;for(let i=n;i<e.length;i++){let a=e[i];if(a==="{"||a==="("||a==="[")r++;else if(a==="}"||a===")"||a==="]")r--;if(r===0)return i}return-1}function lp(e){let n=[],r=0,i=0;for(let a=0;a<e.length;a++){let l=e[a];if(l==="{"||l==="("||l==="[")r++;else if(l==="}"||l===")"||l==="]")r--;else if(l===","&&r===0)n.push(e.slice(i,a)),i=a+1}return n.push(e.slice(i)),n}function pa(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="{"||i==="("||i==="[")n++;else if(i==="}"||i===")"||i==="]")n--;else if(n===0&&(i===":"||i==="="))return{index:r,char:i}}return null}function $a(e){let n=[],r=(a)=>{let l=a.trim().replace(/^\.\.\./,"").trim();if(l.startsWith("{")||l.startsWith("[")){let f=Sa(l,0);if(f!==-1)n.push(...$a(l.slice(0,f+1)));return}let u=pa(l);if(u)l=l.slice(0,u.index).trim();if(/^[A-Z_$][\w$]*$/i.test(l))n.push(l)},i=e.slice(1,-1);for(let a of lp(i)){if(!a.trim())continue;if(e[0]==="["){r(a);continue}let l=pa(a);r(l?.char===":"?a.slice(l.index+1):a)}return n}function cl(e,n){if(_a(e)!==null)return[];let r=Oi(e),i=Le(n,new Set(r)),a=new Set(C);return r.filter((l)=>{if(a.has(l))return!1;if(
|
|
1157
|
+
`)r[f]=" "}let u=ye(r.join(""));return i.length===0?u:[...new Set([...u,...i])].sort()}var cp=/^\s*(?:export\s+)?(?:const|let|var)\s*$/;function Sa(e,n){let r=0;for(let i=n;i<e.length;i++){let a=e[i];if(a==="{"||a==="("||a==="[")r++;else if(a==="}"||a===")"||a==="]")r--;if(r===0)return i}return-1}function lp(e){let n=[],r=0,i=0;for(let a=0;a<e.length;a++){let l=e[a];if(l==="{"||l==="("||l==="[")r++;else if(l==="}"||l===")"||l==="]")r--;else if(l===","&&r===0)n.push(e.slice(i,a)),i=a+1}return n.push(e.slice(i)),n}function pa(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="{"||i==="("||i==="[")n++;else if(i==="}"||i===")"||i==="]")n--;else if(n===0&&(i===":"||i==="="))return{index:r,char:i}}return null}function $a(e){let n=[],r=(a)=>{let l=a.trim().replace(/^\.\.\./,"").trim();if(l.startsWith("{")||l.startsWith("[")){let f=Sa(l,0);if(f!==-1)n.push(...$a(l.slice(0,f+1)));return}let u=pa(l);if(u)l=l.slice(0,u.index).trim();if(/^[A-Z_$][\w$]*$/i.test(l))n.push(l)},i=e.slice(1,-1);for(let a of lp(i)){if(!a.trim())continue;if(e[0]==="["){r(a);continue}let l=pa(a);r(l?.char===":"?a.slice(l.index+1):a)}return n}function cl(e,n){if(_a(e)!==null)return[];let r=Oi(e),i=Le(n,new Set(r)),a=new Set(C);return r.filter((l)=>{if(a.has(l))return!1;if(Ut(n,l))return!1;return i.has(l)})}var fa="stx: types for the declared client payload (#1868)",up="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",da="__stxServerScope",ga="__StxClientPayload";var ma=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","$native","props","slot"];var pp=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function fp(e){let n=new Map,r=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let i of e){let a=t(i),{depths:l,balanced:u}=h(a);if(!u)continue;let f=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let v of a.matchAll(f)){let S=v.index??0;if(l[S+v[1].length]!==0)continue;let I=v[2],j=S+v[0].length-v[3].length,L=i.slice(j,S+v[0].length).trim().replace(/;$/,"").trim(),M=v[3],V=r.test(M)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(M)&&!/[,+\-*/%&|?:=]$/.test(L)&&h(M).balanced;n.set(I,n.has(I)||!V?null:L)}}return new Map([...n].filter((i)=>i[1]!==null))}function Ea(e,n,r=0,i=new Set){if(n.size===0||r>=5)return e;let a=t(e),l="",u=0;for(let f of a.matchAll(/[A-Za-z_$][\w$]*/g)){let v=f.index??0,S=f[0],I=n.get(S);if(!I||i.has(S))continue;let j=a.slice(0,v).trimEnd(),L=a.slice(v+S.length).trimStart();if(j.endsWith(".")||/^:(?!:)/.test(L)&&/[{,]$/.test(j))continue;if(v>0&&/[\w$]/.test(a[v-1]))continue;l+=`${e.slice(u,v)}(${Ea(I,n,r+1,new Set([...i,S]))})`,u=v+S.length}return l+e.slice(u)}function dp(e,n){let r=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,i=[],a;while((a=r.exec(e))!==null){if(a.index>n)break;let l=a[1];if(a.index===n){if(l==="elseif"){let f=i[i.length-1];if(f?.current)f.seen.push(f.current);if(f)f.current=null}break}if(l==="endif"||l==="endunless"){i.pop();continue}let u="";if(a[2]==="("){let f=0,v=a.index+a[0].length-1,S=v+1;for(;v<e.length;v++){let I=e[v];if(I==="(")f++;else if(I===")"){if(f--,f===0)break}}u=e.slice(S,v).trim(),r.lastIndex=v+1}if(l==="if")i.push({seen:[],current:u});else if(l==="unless")i.push({seen:[],current:`!(${u})`});else if(l==="elseif"||l==="else"){let f=i[i.length-1];if(!f)continue;if(f.current)f.seen.push(f.current);f.current=l==="elseif"?u:null}}return i.flatMap((l)=>[...l.seen.map((u)=>`!(${u})`),...l.current?[l.current]:[]]).filter(Boolean)}function gp(e){let n=e.code.trim();if(!n)return null;if(e.attribute?.startsWith("@")){if(pp.test(n))return null;let i=";(($event: any): void => { ";return{text:`${i}${n} });`,prefixLength:i.length}}let r=";void ((";return{text:`${r}${n}));`,prefixLength:r.length}}var mp=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function Es(e,n){return ro(e,n).code}function ro(e,n){let r=new Map;if(!n)return{code:e,columns:r};let i=ka(e),a=[],l=0;for(let u of e.matchAll(mp)){let f=u.index,[v,S,I,j]=u,L=ha.resolve(n,j).replace(/\\/g,"/"),M=`${S}${I}${L}${I}`;if(a.push(e.slice(l,f),M),l=f+v.length,v.includes(`
|
|
1150
1158
|
`))continue;let V=Er(i,f),W=r.get(V.line)??[],Z=W.at(-1),q=V.column+(Z?Z.generatedEnd-Z.sourceEnd:0);W.push({sourceStart:V.column,sourceEnd:V.column+v.length,generatedStart:q,generatedEnd:q+M.length}),r.set(V.line,W)}return a.push(e.slice(l)),{code:a.join(""),columns:r}}function hp(e,n,r){let i=vr(e.importColumns?.get(n)??[],r);return vr(e.scriptColumns?.get(n)??[],vr(e.componentColumns?.get(n)??[],i))}function Ni(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function ks(e){let n=new Set,r=t(e);for(let i of r.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let a=i[1],l=/\{([^}]*)\}/.exec(a);for(let S of l?.[1].split(",")??[]){let I=S.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(I&&/^[A-Z_$][\w$]*$/i.test(I))n.add(I)}let u=a.replace(/\{[^}]*\}/,""),f=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(u);if(f)n.add(f[1]);let v=/^\s*([A-Z_$][\w$]*)/i.exec(u);if(v&&v[1]!=="type")n.add(v[1])}return[...n].sort()}function Mi(e,n={}){let r=_e(e),i=n.scriptKinds?r.filter((H)=>n.scriptKinds.includes(H.kind)):r,a=to(e,n.componentMethodValidator),l=n.filePath&&n.templateExpressions!==!1?oa(e,{filePath:n.filePath,partialsDir:n.partialsDir,layoutsDir:n.layoutsDir,contractsKnown:n.inheritedContractsKnown,readTemplate:n.readComponent}):void 0,u=new Map,f=e.split(`
|
|
1151
1159
|
`),v=Array.from({length:f.length},()=>""),S=new Map,I=new Map,j=new Map,L=[],M=Ii(r),V=n.filePath&&n.templateExpressions!==!1?Ko(e,ln(e),{filePath:n.filePath,componentsDir:n.componentsDir,projectRoot:n.projectRoot,readComponent:n.readComponent,scriptCode:(H,re)=>_e(H).map((ce)=>Es(ce.code,ha.dirname(re))).join(`
|
|
1152
1160
|
`)}):void 0,W=new Set,Z=[];for(let[H,re]of i.entries()){let ce=Pi(Ni(re)+re.code,M,String(H));for(let[Re,ve]of ce.columns)I.set(re.startLine+Re-1,ve);for(let Re of ce.declarations)L.push({text:Es(Re.text,n.originDir??""),origin:Re.origin?{...Re.origin,line:Re.origin.line+re.startLine-1}:void 0});let le=re.kind==="client"&&a?a.project(ce.code):void 0;for(let[Re,ve]of le?.columns??[])u.set(re.startLine+Re-1,ve);let fe=En(le?.code??ce.code),we=ro(fe,n.originDir??"");for(let[Re,ve]of we.columns)j.set(re.startLine+Re-1,ve);let Ee=we.code.split(`
|
|
@@ -1170,13 +1178,13 @@ ${ce}`:"";S.push(` \u2717 ${W}${re}
|
|
|
1170
1178
|
${S.join(`
|
|
1171
1179
|
`)}
|
|
1172
1180
|
Tip: prefer useRef(), navigate(), and composables for component code`;if(kr.set(l,M),console.warn(M),a.failOnViolation)throw new te(M,i??n)}var wp=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],vp=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],Sp=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function jg(e){let n=[],r=[];return $p(e,n),Ep(e,n,r),kp(e,r),Cp(e,n),{valid:n.length===0,errors:n,warnings:r}}function $p(e,n){let r=(e.match(/\{\{/g)||[]).length,i=(e.match(/\}\}/g)||[]).length;if(r!==i)n.push({type:"expression",message:`Unclosed expression brackets: found ${r} opening '{{' and ${i} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function Ep(e,n,r){for(let i of wp){let a=new RegExp(`${i.open}(?:\\s|\\()`,"g"),l=new RegExp(i.close,"g"),u=(e.match(a)||[]).length,f=(e.match(l)||[]).length;if(i.altClose){let v=new RegExp(i.altClose,"g");f+=(e.match(v)||[]).length}if(u>f)n.push({type:"directive",message:`Unclosed @${i.name} directive: found ${u} opening and ${f} closing`,suggestion:`Add ${u-f} missing ${i.close} tag(s)`});else if(f>u)r.push({type:"directive",message:`Extra ${i.close} found: ${f-u} more closing than opening`,suggestion:`Check for orphaned ${i.close} tags`})}}function kp(e,n){for(let r of vp)if(r.pattern.test(e))n.push({type:"syntax",message:r.message,suggestion:r.suggestion})}function Cp(e,n){for(let r of Sp)if(r.pattern.test(e))n.push({type:"expression",message:`Security warning: ${r.message}`,suggestion:"Remove dangerous code from template expressions"})}function Bg(e,n){let r=e.slice(0,n).split(`
|
|
1173
|
-
`);return{line:r.length,column:r[r.length-1].length+1}}function Fg(e,n,r){let i=[];switch(e){case"if":case"elseif":case"unless":if(r.length===0)i.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(r.length===0||!r[0].includes(" as "))i.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(r.length===0)i.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(r.length===0)i.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(r.length===0)i.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(r.length===0)i.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return i}function zg(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function Hg(e){let n=e.matchAll(/@([a-z]+)/gi),r=new Set;for(let i of n){let a=i[1].toLowerCase();if(!a.startsWith("end"))r.add(a)}return Array.from(r)}function Ra(e,n,r){let i=/^<script\b([^>]*)>/i.exec(e);if(!i||!/(?:^|\s)src\s*=/i.test(i[1]??""))return null;return P(i[0],n,r)+e.slice(i[0].length)}var Wn=new T(500),Tr=new Map;function Ta(e){try{let n=Is.statSync(e);return`${n.size}:${n.mtimeMs}`}catch{return""}}var Ts=new T(1000),Ar=new Map,Pr=new T(2000),Wr=new T(500),La=33554432,Vr=La;function Rp(e){let n=e.componentRenderCacheBytes;if(typeof n!=="number"||n<0||n===Vr)return;Vr=n,As.setMaxBytes(n)}var As=new T(2000,{maxBytes:La,sizeOf:(e)=>e.output.length});function Tp(e){let n=new WeakSet;try{let r=(i)=>{if(i===void 0)return{__stxType:"undefined"};if(typeof i==="bigint")return{__stxType:"bigint",value:i.toString()};if(typeof i==="function"||typeof i==="symbol")throw TypeError("Non-serializable component input");if(i===null||typeof i!=="object")return i;if(n.has(i))throw TypeError("Circular component input");n.add(i);try{if(i instanceof Date)return{__stxType:"date",value:i.toISOString()};if(Array.isArray(i))return i.map(r);let a=Object.getPrototypeOf(i);if(a!==Object.prototype&&a!==null)throw TypeError("Non-plain component input");let l={};for(let u of Object.keys(i).sort())l[u]=r(i[u]);return l}finally{n.delete(i)}};return JSON.stringify(r(e))}catch{return null}}function Ap(e){let n={};for(let[r,i]of Object.entries(e))if(!r.startsWith("__")||r==="__stxServeContext")n[r]=i;return n}function Cr(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function co(e){let n=process.cwd(),r=`${n}\x00${e}`,i=Aa.get(r);if(i===void 0)i=Bun.hash(za(e,n).split(ge.sep).join("/")).toString(36).slice(0,6),Aa.set(r,i);return i}var Aa=new Map;function za(e,n){if(!ge.isAbsolute(e))return e;let r=(i)=>{try{return Is.realpathSync(i)}catch{return i}};return ge.relative(r(n),r(e))}function
|
|
1181
|
+
`);return{line:r.length,column:r[r.length-1].length+1}}function Fg(e,n,r){let i=[];switch(e){case"if":case"elseif":case"unless":if(r.length===0)i.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(r.length===0||!r[0].includes(" as "))i.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(r.length===0)i.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(r.length===0)i.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(r.length===0)i.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(r.length===0)i.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return i}function zg(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function Hg(e){let n=e.matchAll(/@([a-z]+)/gi),r=new Set;for(let i of n){let a=i[1].toLowerCase();if(!a.startsWith("end"))r.add(a)}return Array.from(r)}function Ra(e,n,r){let i=/^<script\b([^>]*)>/i.exec(e);if(!i||!/(?:^|\s)src\s*=/i.test(i[1]??""))return null;return P(i[0],n,r)+e.slice(i[0].length)}var Wn=new T(500),Tr=new Map;function Ta(e){try{let n=Is.statSync(e);return`${n.size}:${n.mtimeMs}`}catch{return""}}var Ts=new T(1000),Ar=new Map,Pr=new T(2000),Wr=new T(500),La=33554432,Vr=La;function Rp(e){let n=e.componentRenderCacheBytes;if(typeof n!=="number"||n<0||n===Vr)return;Vr=n,As.setMaxBytes(n)}var As=new T(2000,{maxBytes:La,sizeOf:(e)=>e.output.length});function Tp(e){let n=new WeakSet;try{let r=(i)=>{if(i===void 0)return{__stxType:"undefined"};if(typeof i==="bigint")return{__stxType:"bigint",value:i.toString()};if(typeof i==="function"||typeof i==="symbol")throw TypeError("Non-serializable component input");if(i===null||typeof i!=="object")return i;if(n.has(i))throw TypeError("Circular component input");n.add(i);try{if(i instanceof Date)return{__stxType:"date",value:i.toISOString()};if(Array.isArray(i))return i.map(r);let a=Object.getPrototypeOf(i);if(a!==Object.prototype&&a!==null)throw TypeError("Non-plain component input");let l={};for(let u of Object.keys(i).sort())l[u]=r(i[u]);return l}finally{n.delete(i)}};return JSON.stringify(r(e))}catch{return null}}function Ap(e){let n={};for(let[r,i]of Object.entries(e))if(!r.startsWith("__")||r==="__stxServeContext")n[r]=i;return n}function Cr(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function co(e){let n=process.cwd(),r=`${n}\x00${e}`,i=Aa.get(r);if(i===void 0)i=Bun.hash(za(e,n).split(ge.sep).join("/")).toString(36).slice(0,6),Aa.set(r,i);return i}var Aa=new Map;function za(e,n){if(!ge.isAbsolute(e))return e;let r=(i)=>{try{return Is.realpathSync(i)}catch{return i}};return ge.relative(r(n),r(e))}function Ug(e){return/\bjs\b/.test(e)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(e)}function Xe(e){return!Ug(e)}var Rs=new Map;function ie(e){let n;try{n=JSON.stringify(e)}catch{return new Bun.Transpiler(e)}let r=Rs.get(n);if(r)return r;if(Rs.size>=16)Rs.clear();let i=new Bun.Transpiler(e);return Rs.set(n,i),i}var Ia=new WeakMap,Ip=256;function Je(e){try{let n=ie({loader:"ts",target:"browser",define:A()}),r=Ia.get(n);if(!r)r=new Map,Ia.set(n,r);let i=r.get(e);if(i!==void 0)return i;let a=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");a=a.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let l=[];a=a.replace(/\{!![\s\S]*?!!\}/g,(f)=>{let v=l.length;return l.push(f),`"__STX_EXPR_${v}__"`}),a=a.replace(/\{\{\{[\s\S]*?\}\}\}/g,(f)=>{let v=l.length;return l.push(f),`"__STX_EXPR_${v}__"`}),a=a.replace(/\{\{[\s\S]*?\}\}/g,(f)=>{let v=l.length;return l.push(f),`"__STX_EXPR_${v}__"`});let u=n.transformSync(a);for(let f=0;f<l.length;f++)u=u.replace(`"__STX_EXPR_${f}__"`,l[f]),u=u.replace(`'__STX_EXPR_${f}__'`,l[f]);if(r.size>=Ip){let f=r.keys().next();if(!f.done)r.delete(f.value)}return r.set(e,u),u}catch(n){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",n);return e}}function Op(e){let n=[],r=new Set,i=0,a=0,l=e.length,u=(M)=>{a++;while(a<l){if(e[a]==="\\"){a+=2;continue}if(e[a]===M){a++;return}a++}},f=()=>{a++;while(a<l){if(e[a]==="\\"){a+=2;continue}if(e[a]==="`"){a++;return}if(e[a]==="$"&&e[a+1]==="{"){a+=2;let M=1;while(a<l&&M>0)if(e[a]==="{")M++,a++;else if(e[a]==="}")M--,a++;else if(e[a]==="'"||e[a]==='"')u(e[a]);else if(e[a]==="`")f();else a++;continue}a++}},v=()=>{if(e[a]==="/"&&e[a+1]==="/"){while(a<l&&e[a]!==`
|
|
1174
1182
|
`)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<l-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},S=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]),I=()=>{let M=a-1;while(M>=0&&/\s/.test(e[M]))M--;if(M<0)return!0;let V=e[M];if("(,=:[!&|?{};+-*%<>~^".includes(V))return!0;if(!/[\w$]/.test(V))return!1;let W=M;while(W>0&&/[\w$]/.test(e[W-1]))W--;return S.has(e.slice(W,M+1))},j=()=>{a++;let M=!1;while(a<l&&e[a]!==`
|
|
1175
|
-
`){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((G)=>{let U=G.trim().split(":");return U[U.length-1].trim()});for(let G of q)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!r.has(G))n.push(G),r.add(G);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function jp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!$t(a))continue;let l=an(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=ws(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Pp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function
|
|
1183
|
+
`){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((G)=>{let U=G.trim().split(":");return U[U.length-1].trim()});for(let G of q)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!r.has(G))n.push(G),r.add(G);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function jp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!$t(a))continue;let l=an(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=ws(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Pp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Vg(e,n){let r=Vt(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!Pp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=x(e,(I,j)=>(l.lastIndex=j,l.exec(I)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,v=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;v=!0;break}}if(!v)return null;let S=r+i[0].length;return e.slice(0,S)+n+e.slice(S)}function Ba(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=ge.relative(ge.resolve(i),ge.resolve(e));return!a.startsWith("..")&&!ge.isAbsolute(a)})}async function Fr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ce)=>ce.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ce of[l,l.toLowerCase(),u(l),J(l)])if(f.has(ce))return!0}let v=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${J(l)}.stx`])],S=typeof a.root==="string"?ge.resolve(a.root):void 0,I=S??ge.dirname(i),j=[],L=(ce)=>{if(ce&&!j.includes(ce))j.push(ce)};for(let ce of rs(i,S))L(ce);let M=r.__originalFilePath;if(M)L(ge.join(ge.dirname(M),"components"));if(Ba(n,a))L(a._rootComponentsDir);L(n),L(a._rootComponentsDir),L(ge.join(ge.dirname(i),"components")),L(a.componentsDir);for(let ce of a.additionalComponentsDirs??[])L(ce);let V=a._targetComponentFallbackNames?.some((ce)=>ce.toLowerCase()===l.toLowerCase());if(!V)for(let ce of a._targetComponentDirs??[])L(ce);if(S)L(ge.resolve(S,"resources/views/components")),L(ge.resolve(S,"resources/components")),L(ge.resolve(S,"src/components")),L(ge.resolve(S,"components"));for(let ce of a._layerComponentDirs??[])L(ce);let W=a._pluginComponentDirs;if(Array.isArray(W))for(let ce of W)L(typeof ce==="string"?ce:null);if(L(a.fallbackComponentsDir),V)for(let ce of a._targetComponentDirs??[])L(ce);let Z=a._nativePrimitivesFallback;if(Z&&!Z.except.some((ce)=>ce.toLowerCase()===l.toLowerCase()))L(Z.dir);if(l.startsWith("./")||l.startsWith("../"))return s(ge.resolve(ge.dirname(i),`${l}.stx`));let q=Oa(ge.resolve(import.meta.dir,"components")),G=j.map((ce)=>ge.isAbsolute(ce)?ce:ge.resolve(I,ce)),U=`${v.join("\x00")}\x00\x00${G.join("\x00")}`,H=Pr.get(U);if(H!==void 0)return H;let re=!1;e:for(let ce of G){if(Oa(ce)===q)continue;for(let le of v)if(await s(ge.join(ce,le))){re=!0;break e}}return Pr.set(U,re),re}function Oa(e){let n=Wr.get(e);if(n!==void 0)return n;let r=e;try{r=Is.realpathSync(e)}catch{}return Wr.set(e,r),r}function Wg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Sl(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Mp(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=N(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var ja=new Set;function Pa(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&ja.has(a))return;ja.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
|
|
1176
1184
|
searched:
|
|
1177
1185
|
${r.map((v)=>` - ${v}`).join(`
|
|
1178
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ma(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Da=new Set,Wa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",kl=new RegExp(`\\b(?:${Wa})\\s*(?:<[^>]*>)?\\s*\\(`);function Hi(e){let n=new Set,r=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|${Wa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-kexqmwx8.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Wg(W)?W:"";try{let q=(pe)=>pe.split("-").map((xe)=>xe.charAt(0).toUpperCase()+xe.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let xe of pe)if(H.has(xe)){U=H.get(xe);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],xe=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=ge.join(ge.dirname(Me),"components");$e.push(Te)}let He=u._rootComponentsDir;if(typeof He==="string"&&Ba(i,u)&&!$e.includes(He))$e.push(He);if(i&&!$e.includes(i))$e.push(i);if(typeof He==="string"&&!$e.includes(He))$e.push(He);let Ot=ge.join(ge.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Zs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Gr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Gr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?ge.resolve(u.root):void 0,Yr=tn??ge.dirname(l),nn=[];if(tn)nn.push(ge.resolve(tn,"resources/views/components")),nn.push(ge.resolve(tn,"resources/components")),nn.push(ge.resolve(tn,"src/components")),nn.push(ge.resolve(tn,"components"));nn.push(ge.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Gr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>ge.isAbsolute(ut)?ut:ge.resolve(Yr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Ar.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of xe)if(await s(ge.join(ut,zt))){kt=!0;break}if(kt)break}Ar.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Qr=u._pluginComponentDirs;if(Array.isArray(Qr)){for(let Te of Qr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let ei=[...new Set($e.map((Te)=>{if(!Te)return Te;return ge.isAbsolute(Te)?Te:ge.resolve(Yr,Te)}))];$e.length=0,$e.push(...ei);let Ws=`${G}\x00${l}\x00${ei.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=ge.resolve(ge.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of xe){let gt=ge.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ti=ge.join(ut.path,ss.name);for(let tc of xe){let Vs=ge.join(ti,tc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ti,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Pa(e,l,re),Ma(e);v.add(U);let ce;if(Wn.has(U)&&Tr.get(U)===Ta(U))ce=Wn.get(U);else try{let pe=Ta(U);ce=await Bun.file(U).text(),Wn.set(U,ce),Tr.set(U,pe)}catch(pe){let xe=pe instanceof Error?pe.message:String(pe);return Pa(e,l,[U],xe),Ma(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let xe=pe.toLowerCase();if(xe.startsWith("aria-")||xe.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let xe=`${U}\x00${pe}`;if(Da.has(xe))continue;Da.add(xe),console.warn(`[stx] ${ge.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${ge.basename(l)} binds it (:${pe}): 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('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),fe={};for(let[pe,xe]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))fe[pe]=xe;let we=S.length>0?{[ms]:[...S]}:{},Ee=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-qsv84cwm.js"));Ee=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-t4gcsbna.js")),xe={...a,__processedComponents:M,...we};Ee=await pe(Ee,xe,l,u,v);let Me=xe.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let Re=[];if(Sl(Ee)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-wedwczed.js")),xe=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...we}:S.length>0?{...a,...we}:a;Ee=pe(Ee,xe,l);for(let Me of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(Me[1].trim())}let ve=se(Ee),Qe=[],Be=ve.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,xe)=>{let Me=ve.scripts[Number(xe)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),He=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&He&&!Ot)return Qe.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-mtfymhy1.js")),rt=it(Be),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,xe]of rt.namedSlots)wt[pe]=xe.content;let ft=a.__stx_scope_seq??={n:0,key:co(String(a.__filename??l))},ot=za(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...fe,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Be,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||Sl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Re]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-t4gcsbna.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,xe]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(xe,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Vr>0){let pe=Tp({props:n,slot:Ee,slotContext:r.trim()?Ap(fe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((xe)=>xe.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let xe=As.get(Jt);if(xe){for(let Me of xe.dependencies)v.add(Me);if(Ji(a,xe.clientFactories),ft.n+=xe.uidsConsumed,xe.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of xe.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return xe.output}Rt=new Set(v),dn=qi(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let xe=pe[1]||"",Me=pe[2]||"",$e=xe.includes("server");if(Xe(xe)&&Me.trim())Me=Je(Me);if($e&&Me){for(let He of ye(Me))mn.add(He);try{await L(Me,Ae,U,{onFailure:(He)=>{if(He.kind!=="unknown")fn=He.kind}})}catch(He){}}if(!$e){let He=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=He.includes("{{")&&He.includes("}}"),Yt=He.includes("{!!")&&He.includes("!!}");if(Ot||Yt)He=Ui(He,Ae,U);let Dt=xe.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${He}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let de=dt;if(de=de.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)de=de.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,xe=[];if(de=de.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)xe.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),de=de.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),xe.length>0)Tt=`${Tt}${xe.join(`
|
|
1179
|
-
`)}`}if(r&&de.includes("{{ text || slot }}"))de=de.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-
|
|
1186
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ma(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Da=new Set,Wa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",kl=new RegExp(`\\b(?:${Wa})\\s*(?:<[^>]*>)?\\s*\\(`);function Hi(e){let n=new Set,r=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|${Wa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-sydgagr1.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Wg(W)?W:"";try{let q=(pe)=>pe.split("-").map((xe)=>xe.charAt(0).toUpperCase()+xe.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let xe of pe)if(H.has(xe)){U=H.get(xe);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],xe=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=ge.join(ge.dirname(Me),"components");$e.push(Te)}let He=u._rootComponentsDir;if(typeof He==="string"&&Ba(i,u)&&!$e.includes(He))$e.push(He);if(i&&!$e.includes(i))$e.push(i);if(typeof He==="string"&&!$e.includes(He))$e.push(He);let Ot=ge.join(ge.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Zs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Gr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Gr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?ge.resolve(u.root):void 0,Yr=tn??ge.dirname(l),nn=[];if(tn)nn.push(ge.resolve(tn,"resources/views/components")),nn.push(ge.resolve(tn,"resources/components")),nn.push(ge.resolve(tn,"src/components")),nn.push(ge.resolve(tn,"components"));nn.push(ge.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Gr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&>.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>ge.isAbsolute(ut)?ut:ge.resolve(Yr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Ar.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of xe)if(await s(ge.join(ut,zt))){kt=!0;break}if(kt)break}Ar.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Qr=u._pluginComponentDirs;if(Array.isArray(Qr)){for(let Te of Qr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let ei=[...new Set($e.map((Te)=>{if(!Te)return Te;return ge.isAbsolute(Te)?Te:ge.resolve(Yr,Te)}))];$e.length=0,$e.push(...ei);let Ws=`${G}\x00${l}\x00${ei.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=ge.resolve(ge.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of xe){let gt=ge.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ti=ge.join(ut.path,ss.name);for(let tc of xe){let Vs=ge.join(ti,tc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ti,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Pa(e,l,re),Ma(e);v.add(U);let ce;if(Wn.has(U)&&Tr.get(U)===Ta(U))ce=Wn.get(U);else try{let pe=Ta(U);ce=await Bun.file(U).text(),Wn.set(U,ce),Tr.set(U,pe)}catch(pe){let xe=pe instanceof Error?pe.message:String(pe);return Pa(e,l,[U],xe),Ma(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let xe=pe.toLowerCase();if(xe.startsWith("aria-")||xe.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let xe=`${U}\x00${pe}`;if(Da.has(xe))continue;Da.add(xe),console.warn(`[stx] ${ge.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${ge.basename(l)} binds it (:${pe}): 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('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),fe={};for(let[pe,xe]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))fe[pe]=xe;let we=S.length>0?{[ms]:[...S]}:{},Ee=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-k0mndyb4.js"));Ee=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ee)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-zd21ntcm.js")),xe={...a,__processedComponents:M,...we};Ee=await pe(Ee,xe,l,u,v);let Me=xe.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let Re=[];if(Sl(Ee)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-12m3qagv.js")),xe=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...we}:S.length>0?{...a,...we}:a;Ee=pe(Ee,xe,l);for(let Me of Ee.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(Me[1].trim())}let ve=se(Ee),Qe=[],Be=ve.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,xe)=>{let Me=ve.scripts[Number(xe)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),He=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&He&&!Ot)return Qe.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-p9cwapm8.js")),rt=it(Be),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,xe]of rt.namedSlots)wt[pe]=xe.content;let ft=a.__stx_scope_seq??={n:0,key:co(String(a.__filename??l))},ot=za(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...fe,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Be,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||Sl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Re]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-zd21ntcm.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,xe]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(xe,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Vr>0){let pe=Tp({props:n,slot:Ee,slotContext:r.trim()?Ap(fe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((xe)=>xe.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let xe=As.get(Jt);if(xe){for(let Me of xe.dependencies)v.add(Me);if(Ji(a,xe.clientFactories),ft.n+=xe.uidsConsumed,xe.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of xe.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return xe.output}Rt=new Set(v),dn=qi(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let xe=pe[1]||"",Me=pe[2]||"",$e=xe.includes("server");if(Xe(xe)&&Me.trim())Me=Je(Me);if($e&&Me){for(let He of ye(Me))mn.add(He);try{await L(Me,Ae,U,{onFailure:(He)=>{if(He.kind!=="unknown")fn=He.kind}})}catch(He){}}if(!$e){let He=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=He.includes("{{")&&He.includes("}}"),Yt=He.includes("{!!")&&He.includes("!!}");if(Ot||Yt)He=Vi(He,Ae,U);let Dt=xe.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${He}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let de=dt;if(de=de.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)de=de.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,xe=[];if(de=de.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)xe.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),de=de.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),xe.length>0)Tt=`${Tt}${xe.join(`
|
|
1187
|
+
`)}`}if(r&&de.includes("{{ text || slot }}"))de=de.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-p9cwapm8.js")),{defaultSlot:ze,namedSlots:tt}=rt,at=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Be),Et=vt.length>0&&fr(de)||u._nativeHostAttrs===!0&&vt.length>0||at&&vt.length>0||vt.some((pe)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(pe)),Ms=(pe)=>Et?Vo(pe,je):pe,Ds=new Map([...tt].map(([pe,xe])=>[pe,{...xe,content:Ms(xe.content)}]));de=await Se(de,Et?Fo(Ms(ze),je):ze,Ds,Ae,Et?je:"");let Hn=Hi(vt),xn=(Array.isArray(Ae.__stx_client_signal_names)?Ae.__stx_client_signal_names:[]).filter((pe)=>!mn.has(pe));if(Hn.length>0||xn.length>0)Ae.__stx_client_signal_names=[...new Set([...xn,...Hn])];else delete Ae.__stx_client_signal_names;let bn=S.filter((pe)=>!mn.has(pe)&&!(pe in n));if(bn.length>0)Ae[ms]=bn;let Kn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:ge.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Et||vt.length===0,defaultLayout:void 0};Ae.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:qn}=await o("stx/process",()=>import("./chunk-x691tnkx.js")),At=await qn(de,Ae,U,Kn,v),Mt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let pe of At.matchAll(/\{\{([\s\S]*?)\}\}/g))Mt.add(pe[1].trim());if(Mt.size>0)a.__stx_preserved_client_expressions=[...Mt];let It=je,ct=At;if(Et){let pe="";if(Object.keys(n).length>0)try{pe=` data-stx-props="${Cr(JSON.stringify(n))}"`}catch{}let xe=Z?` stx-hydrate="${Cr(Z)}"`:"",Me=Object.fromEntries(Object.entries(wt).map(([Lt,Qt])=>[Lt,Boolean(Qt)])),$e=Object.keys(Me).length>0?` data-stx-slots="${Cr(JSON.stringify(Me))}"`:"",lt=` data-stx-scope="${It}"${pe}${$e}${xe}`,He=At.slice(Vt(At)),Ot=/^<span(?=[\s/>])/i.test(He),Yt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(He),Dt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(He),Zn=Ot?"span":"div",Ns=Yt&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Dt&&u._nativeHostAttrs?' style="width:100%;height:100%"':Ot||Yt?' style="display:contents"':"";ct=Vg(At,lt)??`<${Zn}${lt} data-stx-component-wrapper${Ns}>${At}</${Zn}>`;let Ls=await Promise.all(vt.map(async(Lt)=>{let Qt=Lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Qt)return Lt;let[,yn,zs]=Qt,Jn=Ra(Lt,Ae,U);if(Jn!==null)return Jn;let en=await Lp(zs,U,u.buildMode==="compile"),Xn=An(en.clientCode,Ke(Ae)),{vendorStyleTags:Gn}=en,Yn=Xn?`function(__scopeId) {
|
|
1180
1188
|
${Xn}
|
|
1181
1189
|
return (${en.factoryBody})(__scopeId);
|
|
1182
1190
|
}`:en.factoryBody,Qn=Z?null:ir(a,Yn),es=Qn?`window.__stxComponentFactories[${JSON.stringify(Qn)}](${JSON.stringify(It)});`:`(${Yn})(${JSON.stringify(It)});`;if(Z)return`${Gn}<script type="stx/island" data-stx-island="${It}" data-stx-scoped data-stx-owner="${It}"${yn}>${me(es)}</script>`;return`${Gn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${It}"${yn}>${me(es)}</script>`}));if(ct=ct+`
|
|
@@ -1189,20 +1197,20 @@ return (${en.factoryBody})(__scopeId);
|
|
|
1189
1197
|
${Qe.join(`
|
|
1190
1198
|
`)}`:ct}catch(q){if(q instanceof te)throw q;return`[Error processing component: ${q instanceof Error?q.message:String(q)}]`}finally{M.delete(e)}}async function s(e){return Bun.file(e).exists()}function Ur(e,n){let r=ge.resolve(n),i=ge.resolve(e),a=r.endsWith(ge.sep)?r:r+ge.sep;if(i===r||i.startsWith(a))return i;return null}async function Na(e,n,r,i){let a=n.startsWith("layouts/")?n.slice(8):n,l=ge.join(e,a);for(let u of l.endsWith(".stx")?[l]:[l,`${l}.stx`])if(await s(u)){if(i)console.log(`Found layout in ${e}: ${u}`);return r?.add(u),u}return null}async function Pn(e,n,r,i){let a=await Np(e,n,r,i);if(a===null)return null;let l=Ur(a,process.cwd());if(l)return l;let u=[r.root,r.layoutsDir,r.fallbackLayoutsDir,r.componentsDir,r.partialsDir,r.pagesDir,...r._layerLayoutDirs??[]].filter((f)=>typeof f==="string"&&f.length>0);for(let f of u){let v=ge.isAbsolute(f)?f:ge.resolve(process.cwd(),f);if(Ur(a,v))return ge.resolve(a)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${a} (template: ${e}, from: ${n})`),null}async function Np(e,n,r,i){if(r.debug)console.log(`Resolving template path: ${e} from ${n}`);let a=ge.dirname(n),l=process.cwd();if(e.startsWith("/")){let M=ge.join(l,e),V=Ur(M,l);if(!V)return console.warn(`[stx] rejected template path that escapes project root: ${e} (from ${n})`),null;if(r.debug)console.log(`Checking absolute path: ${V}`);if(await s(V)&&i)i.add(V);return V}let u=async(M)=>{if(!r.layoutsDir||!r.fallbackLayoutsDir)return M;let V=ge.relative(ge.resolve(l,r.fallbackLayoutsDir),M);if(V.startsWith("..")||ge.isAbsolute(V))return M;return await Na(ge.resolve(l,r.layoutsDir),e,i,r.debug)??M},f=ge.join(a,e);if(await s(f)){if(r.debug)console.log(`Found direct path: ${f}`);let M=await u(f);if(i)i.add(M);return M}if(!e.endsWith(".stx")&&!e.endsWith(".jsx")&&!e.endsWith(".tsx"))for(let M of[".stx",".tsx",".jsx"]){let V=`${f}${M}`;if(await s(V)){if(r.debug)console.log(`Found direct path with extension: ${V}`);let W=await u(V);if(i)i.add(W);return W}}let v=[];if(v.push(...r._layerLayoutDirs??[]),r.layoutsDir)v.push(ge.isAbsolute(r.layoutsDir)?r.layoutsDir:ge.resolve(process.cwd(),r.layoutsDir));let S=ge.resolve(a),I=process.cwd();for(let M=0;M<10;M++){let V=ge.join(S,"layouts"),W=!1;try{W=Is.statSync(V,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(W){v.push(V);break}let Z=ge.dirname(S);if(Z===S||Z.length<I.length)break;S=Z}for(let M of v){let V=await Na(M,e,i,r.debug);if(V)return V}if(r.fallbackLayoutsDir){let M=ge.isAbsolute(r.fallbackLayoutsDir)?r.fallbackLayoutsDir:ge.resolve(process.cwd(),r.fallbackLayoutsDir),V=e.startsWith("layouts/")?e.slice(8):e,W=[ge.join(M,V)];if(!e.endsWith(".stx"))W.push(`${W[0]}.stx`);for(let Z of W)if(await s(Z)){if(r.debug)console.log(`Found in options.fallbackLayoutsDir: ${Z}`);if(i)i.add(Z);return Z}}if(e.startsWith("layouts/")||e.includes("/layouts/")){let M=e.split("layouts/"),V=ge.join(r.partialsDir||a,"layouts",M[1]);if(await s(V)){if(r.debug)console.log(`Found in layouts path: ${V}`);if(i)i.add(V);return V}if(!V.endsWith(".stx")){let W=`${V}.stx`;if(await s(W)){if(r.debug)console.log(`Found in layouts path with extension: ${W}`);if(i)i.add(W);return W}}}if(r.partialsDir){let M=ge.join(r.partialsDir,"layouts");if(await s(M)){let V=ge.join(M,e);if(await s(V)){if(r.debug)console.log(`Found in partials layouts dir: ${V}`);if(i)i.add(V);return V}if(!e.endsWith(".stx")){let W=`${V}.stx`;if(await s(W)){if(r.debug)console.log(`Found in partials layouts dir with extension: ${W}`);if(i)i.add(W);return W}}}}let j=r.partialsDir||ge.join(process.cwd(),"views"),L=ge.join(j,e);if(await s(L)){if(r.debug)console.log(`Found in views path: ${L}`);if(i)i.add(L);return L}if(!e.endsWith(".stx")){let M=`${L}.stx`;if(await s(M)){if(r.debug)console.log(`Found in views path with extension: ${M}`);if(i)i.add(M);return M}}if(a.includes("temp")){let M=ge.join(ge.dirname(a),"layouts",e);if(await s(M)){if(r.debug)console.log(`Found in temp layouts dir: ${M}`);if(i)i.add(M);return M}if(!e.endsWith(".stx")){let V=`${M}.stx`;if(await s(V)){if(r.debug)console.log(`Found in temp layouts dir with extension: ${V}`);if(i)i.add(V);return V}}}if(r.debug)console.warn(`Template not found after trying all paths: ${e} (referenced from ${n})`);else console.warn(`Template not found: ${e} (referenced from ${n})`);return null}function _l(e,n,r){let i=0,a="",l="";try{if(typeof n==="number"&&n>=0){let u=e.split(`
|
|
1191
1199
|
`),f=0;for(let v=0;v<u.length;v++)if(f+=u[v].length+1,f>=n){i=v+1,a=u[v].trim();let S=Math.max(0,v-2),I=Math.min(u.length,v+3);l=u.slice(S,I).map((j,L)=>{let M=S+L+1;return`${M===i?"> ":" "}${M}: ${j}`}).join(`
|
|
1192
|
-
`);break}}else if(r){let u=e.indexOf(r);if(u>=0)return _l(e,u)}}catch{}return{lineNumber:i,lineContent:a,context:l}}var
|
|
1200
|
+
`);break}}else if(r){let u=e.indexOf(r);if(u>=0)return _l(e,u)}}catch{}return{lineNumber:i,lineContent:a,context:l}}var Ue={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function b(e,n,r,i,a,l){let{lineNumber:u,context:f}=_l(i,a,l),v=r.split("/").pop(),S=0;if(typeof a==="number"&&a>=0&&i){let j=i.lastIndexOf(`
|
|
1193
1201
|
`,Math.max(0,a-1));S=a-(j+1)+1}let I="";if(u>0)I+=`
|
|
1194
1202
|
${r}:${u}${S>0?`:${S}`:""}: ${e.toLowerCase()} error: ${n}
|
|
1195
1203
|
`;if(I+=`
|
|
1196
|
-
${
|
|
1197
|
-
`,I+=`${
|
|
1198
|
-
`,I+=`${
|
|
1204
|
+
${Ue.bold}${Ue.red}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${Ue.reset}
|
|
1205
|
+
`,I+=`${Ue.bold}${Ue.red}\u2502${Ue.reset} ${Ue.bold}${Ue.bgRed} ERROR ${Ue.reset} ${Ue.red}${e} Error${Ue.reset}${" ".repeat(Math.max(0,43-e.length))}${Ue.bold}${Ue.red}\u2502${Ue.reset}
|
|
1206
|
+
`,I+=`${Ue.bold}${Ue.red}\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${Ue.reset}
|
|
1199
1207
|
`,I+=`
|
|
1200
|
-
${
|
|
1201
|
-
${
|
|
1208
|
+
${Ue.cyan}${Ue.bold}File:${Ue.reset} ${Ue.dim}${v}${Ue.reset}`,u>0)I+=` ${Ue.gray}(line ${u}${S>0?`, col ${S}`:""})${Ue.reset}`;if(I+=`
|
|
1209
|
+
${Ue.yellow}${Ue.bold}Message:${Ue.reset} ${n}
|
|
1202
1210
|
`,f)I+=`
|
|
1203
|
-
${
|
|
1204
|
-
${
|
|
1205
|
-
`;return I}function Ce(){Wn.clear(),Tr.clear(),Ts.clear(),Ar.clear(),Pr.clear(),Wr.clear(),As.clear()}function $y(){return{size:Wn.size,maxSize:500}}var Rr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Rr.get(i);if(a){if(Qs(a.deps))return a;Rr.delete(i)}let l=Fi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=zi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
1211
|
+
${Ue.blue}${Ue.bold}Context:${Ue.reset}
|
|
1212
|
+
${Ue.dim}${f}${Ue.reset}
|
|
1213
|
+
`;return I}function Ce(){Wn.clear(),Tr.clear(),Ts.clear(),Ar.clear(),Pr.clear(),Wr.clear(),As.clear()}function $y(){return{size:Wn.size,maxSize:500}}var Rr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Rr.get(i);if(a){if(Qs(a.deps))return a;Rr.delete(i)}let l=Fi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=zi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-cf527twj.js")),I=[],j=!1;if(v(u)){let G=u;u=await S(G,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===G}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-3t30a2nx.js"));u=L(u);let M=D(u),V=Op(M),W=new Set(X(M,!0).split(",").map((G)=>G.trim())),Z=`function(__scopeId) {
|
|
1206
1214
|
${xt("const",[...Bl,...V],M)}
|
|
1207
1215
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
1208
1216
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -1311,4 +1319,4 @@ ${e[S]}`,S++;else break}return v=v.trim().replace(/;$/,""),{type:l,name:u,value:
|
|
|
1311
1319
|
${l}`,a++}while(a<e.length){let l=e[a].trim();if(l.startsWith(".")||l.startsWith("?."))i+=`
|
|
1312
1320
|
${e[a]}`,a++;else break}return{value:i,nextIndex:a}}function Xp(e,n,r){let i=r,a=n+1;while(a<e.length){let l=ec(i);if(l!==-1){if(_(i,"{","}",l)!==-1)break}let u=e[a];i+=`
|
|
1313
1321
|
${u}`,a++}return{functionCode:i,nextIndex:a}}function Xa(e,n){let r=d(e,n)??d(`(${e})`,n);if(r!==void 0)return r;if(!/\bprocess\b/.test(e))return;let i={...n,process:Object.freeze({env:{...un.env}})},a=Object.keys(i).filter(zr),l=a.map((u)=>i[u]);try{return Function(...a,`'use strict'; return (${e});`)(...l)}catch{try{return Function(...a,`'use strict'; return ${e};`)(...l)}catch{return}}}async function Gp(e,n,r){let i=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let l of i){let[,,u,f]=l;try{let v=f.trim().replace(/;$/,""),S=Xa(v,n);if(S!==void 0)n[u]=S}catch(v){console.warn(`Failed to parse export ${u} in fallback:`,v)}}let a=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let l of a){let[,,u,f]=l;if(!(u in n))try{let v=f.trim().replace(/;$/,""),S=Xa(v,n);if(S!==void 0)n[u]=S}catch{}}}function bl(e){let n=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),r=n?n[1]:"",i=n?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):e;return{scriptContent:r,templateWithoutScript:i}}function wl(e){let n=e.trim();if(!n)return!1;return/(?:const|let|var|function)\s+\w+/.test(n)}
|
|
1314
|
-
export{
|
|
1322
|
+
export{Ve,Pe,X,Gs,Xs,J,Ir,Js,Ys,Ti,$i,Ri,Zs,Ai,tl,Ut,o,me,k,nl,E,Or,Qs,Ie,A,We,B,Vt,Oe,Q,Cn,qe,x,rl,ke,se,Nr,ee,Mr,Dr,he,Wt,oe,F,mt,O,Lr,jr,ht,sl,qt,eo,to,_e,Pi,En,no,ye,ol,il,Ii,al,Oi,cl,ro,Ni,Mi,ll,Di,Li,Tn,so,$n,Kt,Gt,ul,oo,dl,pl,Rn,Br,io,ao,fl,ji,gl,ml,hl,yl,Rg,Ag,Pg,Ig,Og,y,Ng,Bi,Mg,bl,wl,Fi,zi,Dg,Xt,vl,Lg,xl,Ty,Ke,An,Ge,jg,Bg,Fg,zg,Hg,co,Ug,Xe,ie,Je,Vg,Fr,Wg,Sl,kl,Hi,Ye,s,Pn,_l,b,Ce,$y,Cl,El,Tl,Ui,lo,qg,Ry,Kg,Ay,In,g,Y,ae,On,Ne,Gg,Vi,Xg,Py,P,Wi,Jg,Iy,N,Oy};
|