@stacksjs/stx 0.2.587 → 0.2.589
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-s043hpvd.js → chunk-04gt67sv.js} +1 -1
- package/dist/chunk-122y2fkw.js +3 -0
- package/dist/chunk-138zjhwa.js +2 -0
- package/dist/{chunk-751b5zv9.js → chunk-14t0wps0.js} +1 -1
- package/dist/{chunk-03qf2z4d.js → chunk-18ws9heh.js} +1 -1
- package/dist/{chunk-33q5zka4.js → chunk-1944jgb2.js} +1 -1
- package/dist/{chunk-tc15vkfh.js → chunk-25zpd110.js} +2 -2
- package/dist/{chunk-emxa2djv.js → chunk-2qt63502.js} +1 -1
- package/dist/{chunk-qhr1tkhj.js → chunk-38mt83wa.js} +6 -6
- package/dist/chunk-3bx12g3y.js +2 -0
- package/dist/{chunk-j8v5164e.js → chunk-3q312svf.js} +1 -1
- package/dist/chunk-3vcvsc17.js +2 -0
- package/dist/{chunk-k1szsenr.js → chunk-48s1nprc.js} +2 -2
- package/dist/{chunk-qf3axv86.js → chunk-4st1qw62.js} +2 -2
- package/dist/chunk-55bmmwtx.js +2 -0
- package/dist/{chunk-cqr5cv7h.js → chunk-5rs5jnqk.js} +5 -5
- package/dist/chunk-64xcx3y4.js +2 -0
- package/dist/{chunk-y5x8xnnf.js → chunk-6eg9a3mt.js} +2 -2
- package/dist/{chunk-3qmx12d3.js → chunk-6qnemg0e.js} +298 -298
- package/dist/{chunk-ww28zfwt.js → chunk-7b0svfg0.js} +1 -1
- package/dist/chunk-7frsbxzd.js +2 -0
- package/dist/chunk-7nr3f2bw.js +2 -0
- package/dist/chunk-83rmpb0b.js +2 -0
- package/dist/chunk-88mj71mb.js +2 -0
- package/dist/{chunk-9qsnq026.js → chunk-9cgga2aw.js} +2 -2
- package/dist/{chunk-45x4myqe.js → chunk-9e49fnj9.js} +2 -2
- package/dist/{chunk-f29fk7dw.js → chunk-9h1ytsgm.js} +2 -2
- package/dist/{chunk-jtx74677.js → chunk-9q079ttt.js} +1 -1
- package/dist/chunk-9t6gzmze.js +2 -0
- package/dist/{chunk-vf15db1j.js → chunk-9wtb959p.js} +5 -5
- package/dist/{chunk-794v5crp.js → chunk-9x4r15mv.js} +2 -2
- package/dist/{chunk-pxw4edw8.js → chunk-a7crvy3b.js} +2 -2
- package/dist/chunk-acm2tym9.js +2 -0
- package/dist/{chunk-c6egfhy6.js → chunk-b3c1gggs.js} +2 -2
- package/dist/chunk-bd5gxtt2.js +2 -0
- package/dist/chunk-bepj7q9j.js +2 -0
- package/dist/{chunk-t212h9zm.js → chunk-cxhqps9m.js} +1 -1
- package/dist/chunk-d81h4mxd.js +2 -0
- package/dist/{chunk-b217d16p.js → chunk-dbp1sj5f.js} +36 -36
- package/dist/chunk-dgtxj56t.js +3 -0
- package/dist/chunk-ds66kaac.js +127 -0
- package/dist/chunk-emx9v5z8.js +2 -0
- package/dist/chunk-eqa0wdv9.js +4 -0
- package/dist/{chunk-haag5n42.js → chunk-f17rcvdb.js} +1 -1
- package/dist/chunk-ffykng6w.js +2 -0
- package/dist/{chunk-076h7nb9.js → chunk-fjw3sn55.js} +5 -5
- package/dist/chunk-fn9gdw2x.js +2 -0
- package/dist/{chunk-bhg4pvtn.js → chunk-frm8k9gj.js} +1 -1
- package/dist/chunk-fwt5fh5w.js +2 -0
- package/dist/{chunk-m7ddgrsm.js → chunk-g6ew2drc.js} +4 -4
- package/dist/{chunk-6cg03r93.js → chunk-g7fjra7a.js} +4 -4
- package/dist/{chunk-03xsf9jm.js → chunk-gh181dnr.js} +8 -8
- package/dist/{chunk-6hgngmn0.js → chunk-gzpxvca7.js} +1 -1
- package/dist/{chunk-d0tmc6v5.js → chunk-h9gbsgrt.js} +1 -1
- package/dist/{chunk-qx0tcsdm.js → chunk-hhcmn37g.js} +3 -3
- package/dist/chunk-hhwnd24n.js +2 -0
- package/dist/chunk-hq4mtcp0.js +2 -0
- package/dist/{chunk-7fghm9zy.js → chunk-j1dmkt29.js} +1 -1
- package/dist/chunk-jhswy523.js +2 -0
- package/dist/{chunk-mmbspaqh.js → chunk-jtq8e3b0.js} +2 -2
- package/dist/chunk-jyqanvwp.js +2 -0
- package/dist/chunk-k6bmhf83.js +2 -0
- package/dist/{chunk-3ybbat49.js → chunk-khdvzjzd.js} +1 -1
- package/dist/{chunk-q03kn4d1.js → chunk-krvaknk7.js} +1 -1
- package/dist/{chunk-30acme5g.js → chunk-kx52xt96.js} +2 -2
- package/dist/chunk-m0ngddr1.js +2 -0
- package/dist/{chunk-yhhfxx17.js → chunk-mkmgy50k.js} +4 -4
- package/dist/chunk-n06xznty.js +2 -0
- package/dist/{chunk-048eyjyj.js → chunk-nb0ytx70.js} +2 -2
- package/dist/chunk-nft0k8sy.js +2 -0
- package/dist/{chunk-wkrf41se.js → chunk-nmfnstjg.js} +1 -1
- package/dist/chunk-p69ay3bg.js +2 -0
- package/dist/{chunk-hj8tr9g0.js → chunk-p9yqetnj.js} +1 -1
- package/dist/{chunk-07869zev.js → chunk-pb7vste8.js} +3 -3
- package/dist/chunk-pbvtyw5h.js +2 -0
- package/dist/{chunk-a30mtx17.js → chunk-ph2hzxz7.js} +2 -2
- package/dist/chunk-pq9yr5f5.js +2 -0
- package/dist/chunk-q5rqp7rm.js +2 -0
- package/dist/{chunk-cy07dhqh.js → chunk-q66ry997.js} +2 -2
- package/dist/{chunk-pg164sdw.js → chunk-q6h6yjg4.js} +2 -2
- package/dist/{chunk-91pdg853.js → chunk-qf39z0hg.js} +3 -3
- package/dist/chunk-qhy84exn.js +2 -0
- package/dist/chunk-san161h4.js +2 -0
- package/dist/{chunk-7ydavm3h.js → chunk-shnsvsg4.js} +2 -2
- package/dist/{chunk-kfhghjh6.js → chunk-shnvs7x9.js} +2 -2
- package/dist/{chunk-s2h601k7.js → chunk-sjehpstn.js} +7 -7
- package/dist/{chunk-w24qmxc3.js → chunk-t19th11m.js} +1 -1
- package/dist/{chunk-awgvt956.js → chunk-tc3ne706.js} +9 -9
- package/dist/chunk-td7a6wwq.js +2 -0
- package/dist/{chunk-3y5tzxm6.js → chunk-tds3d65g.js} +2 -2
- package/dist/{chunk-mnnxa3r7.js → chunk-vhgdz0qf.js} +2 -2
- package/dist/{chunk-j7kcjgxy.js → chunk-vn6h03nq.js} +68 -40
- package/dist/chunk-w3k1r8r5.js +2 -0
- package/dist/{chunk-e556dvy4.js → chunk-wkxzzdzs.js} +2 -2
- package/dist/{chunk-ns1jqzqk.js → chunk-wr6gw263.js} +1 -1
- package/dist/chunk-wrp7m33d.js +2 -0
- package/dist/{chunk-7xw1e8t6.js → chunk-y0qjpcc8.js} +3 -3
- package/dist/chunk-y3g9jaa4.js +2 -0
- package/dist/{chunk-fkq55rh7.js → chunk-y3wdf7v7.js} +1 -1
- package/dist/chunk-y6909jm7.js +2 -0
- package/dist/{chunk-ede39b7h.js → chunk-zvs13kgh.js} +2 -2
- package/dist/cli.js +14 -14
- package/dist/client/signals-component-hydration-runtime.js +57 -29
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/dev-server/ts-css.js +7 -2
- package/dist/native/compiler/app-theme.d.ts +9 -0
- package/dist/native/compiler/app-theme.js +51 -0
- package/dist/native/compiler/bundle.js +7 -3
- package/dist/native/compiler/headwind-to-style.d.ts +6 -0
- package/dist/native/compiler/headwind-to-style.js +7 -0
- package/dist/native/compiler/html-to-ir.js +7 -1
- package/dist/native/compiler/render-screen.js +2 -1
- package/dist/native/primitives/Pressable.stx +1 -1
- package/dist/native/primitives/TouchableHighlight.stx +1 -1
- package/dist/native/primitives/TouchableOpacity.stx +1 -1
- package/dist/native/runtime/browser-renderer.js +1 -1
- package/dist/native/ui.d.ts +90 -0
- package/dist/native/ui.js +37 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +10 -10
- package/dist/theme-tokens.d.ts +38 -3
- package/dist/theme-tokens.js +18 -6
- package/dist/ts-css-config.d.ts +1 -0
- package/dist/ts-css-config.js +4 -3
- package/package.json +5 -5
- package/dist/chunk-11jmasqb.js +0 -2
- package/dist/chunk-2wx2aczp.js +0 -2
- package/dist/chunk-4dpab4j6.js +0 -2
- package/dist/chunk-4vnwge6p.js +0 -2
- package/dist/chunk-4w37cqg9.js +0 -2
- package/dist/chunk-51pz8cwa.js +0 -2
- package/dist/chunk-65agttgm.js +0 -2
- package/dist/chunk-7ae40484.js +0 -2
- package/dist/chunk-7dtyf7hq.js +0 -2
- package/dist/chunk-7ebt9n43.js +0 -4
- package/dist/chunk-80g8kaes.js +0 -2
- package/dist/chunk-9pk5jhqa.js +0 -3
- package/dist/chunk-a3d5g1ss.js +0 -122
- package/dist/chunk-a3k4nfq2.js +0 -2
- package/dist/chunk-c8fdccgp.js +0 -2
- package/dist/chunk-cw76edds.js +0 -2
- package/dist/chunk-czrs87r9.js +0 -2
- package/dist/chunk-d9vjsqs4.js +0 -2
- package/dist/chunk-ddgyj88h.js +0 -2
- package/dist/chunk-dj90w48e.js +0 -2
- package/dist/chunk-dngzks8e.js +0 -2
- package/dist/chunk-eztvhppz.js +0 -2
- package/dist/chunk-h2534p6q.js +0 -2
- package/dist/chunk-h9gtc6bk.js +0 -2
- package/dist/chunk-hwnvfke9.js +0 -2
- package/dist/chunk-hygxh993.js +0 -2
- package/dist/chunk-jqy5q8m0.js +0 -2
- package/dist/chunk-jy7yzat1.js +0 -2
- package/dist/chunk-n7yk4nc1.js +0 -2
- package/dist/chunk-qd4snptd.js +0 -2
- package/dist/chunk-r90v2jz6.js +0 -2
- package/dist/chunk-rtgf9fgc.js +0 -2
- package/dist/chunk-sjkdpsca.js +0 -3
- package/dist/chunk-sqpme1hg.js +0 -2
- package/dist/chunk-thydj877.js +0 -2
- package/dist/chunk-vv1kr9dn.js +0 -2
- package/dist/chunk-wm9nzg76.js +0 -2
- package/dist/chunk-x5qymgxa.js +0 -2
- package/dist/chunk-xnbkyj4g.js +0 -2
- package/dist/chunk-xyepqdjy.js +0 -2
- package/dist/chunk-y93y2qat.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{y}from"./chunk-
|
|
2
|
+
import{y}from"./chunk-b3c1gggs.js";import{O,zt}from"./chunk-jtq8e3b0.js";import{Rt,m,h,w,Ye,j,o}from"./chunk-6qnemg0e.js";import{le,_t,Et,Tt}from"./chunk-5rs5jnqk.js";import{Be,rn,wt,U}from"./chunk-eqa0wdv9.js";import{E,Nn}from"./chunk-zvs13kgh.js";import S from"path";var C=new Map,D=new Map,k=m(64),A=new Map,q=["composables","functions"];function J(t){let n=S.basename(t,".ts");return n==="index"||n==="types"||t.endsWith(".d.ts")}async function Q(t){if(t)return S.resolve(t);let n=`<default>:${process.cwd()}`,a=A.get(n);if(a!==void 0)return a;let e=await V();if(e!==null)A.set(n,e);return e}async function V(){let t=await o(),n=t.root||process.cwd(),a=t.composablesDir;if(a)return S.resolve(n,a);for(let e of q){let s=S.resolve(n,e);try{let d=new Bun.Glob("**/*.ts");for await(let c of d.scan({cwd:s,absolute:!0}))if(!J(c))return s}catch{}}return null}async function L(t){let n=Array.isArray(t)?t:t?[S.resolve(t)]:(await o())._layerComposableDirs??[await Q()].filter((e)=>!!e),a=new Map;for(let e of n){let s=new Bun.Glob("**/*.ts");try{for await(let d of s.scan({cwd:e,absolute:!0})){let c=S.relative(e,d);if(!J(d)&&!a.has(c))a.set(c,d)}}catch{}}return{key:n.join("\x00"),files:[...a.values()].sort()}}async function Qr(t){let{files:n}=await L(t),a=j({loader:"ts",target:"browser",define:w()}),e=[];for(let s of n)try{let d=await Bun.file(s).text(),c=a.scan(d).exports.filter((p)=>p!=="default");if(c.length>0)e.push({file:s,names:c})}catch{}return e}function Y(t,n){return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function H(t,n){let a=new Set(t.match(/\w+/g)),e=new Set;for(let s of n)if(/^\w+$/.test(s)?a.has(s):Y(t,s))e.add(s);return e}var G=m(64);function ee(t,n){let a=h(t,n.size),e=G.get(a);if(e)return e;let s;try{s=Rt(t,n)}catch{s=H(t,n)}let d=[...t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...t.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let c of d)for(let p of c[1].split(",")){let g=p.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(g&&n.has(g))s.add(g)}return G.set(a,s),s}function te(t,n,a){let e=new Map;for(let{file:u,names:l}of t)for(let f of l)if(!e.has(f))e.set(f,u);let s=(u)=>{let l=[];for(let f of H(u,e.keys()))l.push(e.get(f));return l},d=new Set(e.keys()),c=(u)=>{let l=[];for(let f of ee(u,d))l.push(e.get(f));return l},p=new Set,g=a.flatMap((u,l)=>l===0?s(u):c(u));while(g.length>0){let u=[];for(let l of g){if(p.has(l))continue;p.add(l);for(let f of c(n.get(l)??""))if(!p.has(f))u.push(f)}g=u}return p}async function Zl(t,n,a){let{key:e,files:s}=await L(t);if(!e)return null;let d=()=>[...new Set([...s,...s.flatMap((r)=>le(r))])],c=Be(d());if(s.length===0)return U(C,e,c,""),null;s.sort();let p=j({loader:"ts",target:"browser",define:w()}),g=wt(D,e,c);if(!g){let r=new Map,i=[];for(let _ of s)try{let x=await Bun.file(_).text();r.set(_,x);let b=p.scan(x).exports.filter((Z)=>Z!=="default");if(b.length>0)i.push({file:_,names:b})}catch{r.set(_,"")}g=U(D,e,c,{codeByFile:r,modules:i})}let{codeByFile:u,modules:l}=g,f;if(n===void 0)f=new Set(s);else{let r=a?[n,...a]:[n],i=h(r.join("\x00"),e,r.length,c),_=k.get(i);if(f=_??te(l,u,r),!_)k.set(i,f)}if(f.size===0)return null;let I=s.filter((r)=>f.has(r)),B=`${e}\x00${I.join("\x00")}\x00${Et()}`,F=wt(C,B,c);if(F!==void 0)return F||null;let M=[],v=new Set,R=new Set;for(let r of I)try{let i=u.get(r)??await Bun.file(r).text(),_=S.basename(r,".ts");for(let b of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(b[1])R.add(b[1]);let x=[];try{for(let b of p.scan(i).exports)if(b!=="default")v.add(b),x.push(b)}catch{}if(i=O(i),_t(i))i=await Tt(i,r,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),i=Ye(i);i=zt(i),i=i.replace(/^export\s+(default\s+)?/gm,""),i=p.transformSync(i),M.push(`// Composable: ${_}
|
|
3
3
|
${i.trim()}`)}catch(i){console.warn(`[stx] Failed to load composable ${r}:`,i)}if(M.length===0||v.size===0)return U(C,B,c,""),null;let W=[...v].map((r)=>` try { if (!(${JSON.stringify(r)} in __c)) __c[${JSON.stringify(r)}] = ${r}; } catch (e) {}`).join(`
|
|
4
4
|
`),P=JSON.stringify([...v]),N=M.join(`
|
|
5
5
|
|
|
@@ -29,5 +29,5 @@ ${W}
|
|
|
29
29
|
window[__n] = __c[__n];
|
|
30
30
|
__published[__n] = true;
|
|
31
31
|
}
|
|
32
|
-
})();`,z=E()?
|
|
32
|
+
})();`,z=E()?Nn(T):T;return c=Be(d()),U(C,B,c,z),z}function Ql(){C.clear(),rn(),D.clear(),k.clear(),A.clear()}
|
|
33
33
|
export{Qr,Zl,Ql};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ea,ta,na}from"./chunk-
|
|
2
|
+
import{ea,ta,na}from"./chunk-b3c1gggs.js";import{W,on,an,es,Xn,Jn,cn,ln,ts,Yn}from"./chunk-shnsvsg4.js";function X(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},z=(b)=>{let w=R;p.restore(e,b).then((A)=>{if(!A||w!==R||c)return;n=A.data,P.set(A.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let A=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},A)}),T;if(m.load)T=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;T=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([T,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,A=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,A).then((T)=>{if(w!==R||A!==N())return j(),I();return n=T,c=Date.now(),P.set(c),K.set(null),p.persist(e,T,k),F(),j(),I()},(T)=>{if(w===R&&A===N())K.set(T&&T.message?T.message:"Could not load.");return j(),I()})},O=`${w} ${A||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!0);F()}}),d.set(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
|
|
3
3
|
options = options || {};
|
|
4
4
|
// The pre-paint boot script (stacksjs/stx#1794) publishes the app's
|
|
5
5
|
// configured options here. Reading them makes a bare useColorMode() agree
|
|
@@ -1041,7 +1041,41 @@ else {
|
|
|
1041
1041
|
});
|
|
1042
1042
|
return resolved;
|
|
1043
1043
|
}
|
|
1044
|
-
`;var ue=`
|
|
1044
|
+
`;var ue=` /*
|
|
1045
|
+
* Run a component setup for one clone. The compiled setup finds its root by
|
|
1046
|
+
* the template's scope id, so the clone answers to that id while it runs,
|
|
1047
|
+
* and the scope it registers is moved to the clone's own id afterwards.
|
|
1048
|
+
*/
|
|
1049
|
+
function runClonedComponentSetup(setup, root) {
|
|
1050
|
+
var scopeId = root.getAttribute('data-stx-scope');
|
|
1051
|
+
var originalScopeId = root.getAttribute('data-stx-template-scope') || scopeId;
|
|
1052
|
+
if (!scopeId || !originalScopeId) return;
|
|
1053
|
+
|
|
1054
|
+
root.setAttribute('data-stx-scope', originalScopeId);
|
|
1055
|
+
// The setup finds its root by id, which a detached clone cannot answer
|
|
1056
|
+
// to: rows a :for builds inside a component's closed :if are set up
|
|
1057
|
+
// before the :if puts them in the document, and found nothing, so they
|
|
1058
|
+
// never read a prop. Hand the root over (utils.ts reads it).
|
|
1059
|
+
var previousSetupRoot = window.__STX_SETUP_ROOT__;
|
|
1060
|
+
window.__STX_SETUP_ROOT__ = root;
|
|
1061
|
+
try {
|
|
1062
|
+
setup();
|
|
1063
|
+
var registeredScope = window.stx._scopes && (window.stx._scopes[originalScopeId] || window.stx._scopes[scopeId]);
|
|
1064
|
+
if (registeredScope && originalScopeId !== scopeId) {
|
|
1065
|
+
delete window.stx._scopes[originalScopeId];
|
|
1066
|
+
window.stx._scopes[scopeId] = registeredScope;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
catch (e) {
|
|
1070
|
+
console.error('[stx] cloned component setup error:', e);
|
|
1071
|
+
}
|
|
1072
|
+
finally {
|
|
1073
|
+
window.__STX_SETUP_ROOT__ = previousSetupRoot;
|
|
1074
|
+
root.setAttribute('data-stx-scope', scopeId);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
function hydrateComponentScopes(nodes, callerScope) {
|
|
1045
1079
|
var roots = [];
|
|
1046
1080
|
var scripts = [];
|
|
1047
1081
|
forEachGroupElement(nodes, function(node, insideTemplateContent) {
|
|
@@ -1105,34 +1139,7 @@ else {
|
|
|
1105
1139
|
}
|
|
1106
1140
|
}
|
|
1107
1141
|
|
|
1108
|
-
pendingRoots.forEach(function(root) {
|
|
1109
|
-
var scopeId = root.getAttribute('data-stx-scope');
|
|
1110
|
-
var originalScopeId = root.getAttribute('data-stx-template-scope') || scopeId;
|
|
1111
|
-
if (!scopeId || !originalScopeId) return;
|
|
1112
|
-
|
|
1113
|
-
root.setAttribute('data-stx-scope', originalScopeId);
|
|
1114
|
-
// The setup finds its root by id, which a detached clone cannot answer
|
|
1115
|
-
// to: rows a :for builds inside a component's closed :if are set up
|
|
1116
|
-
// before the :if puts them in the document, and found nothing, so they
|
|
1117
|
-
// never read a prop. Hand the root over (utils.ts reads it).
|
|
1118
|
-
var previousSetupRoot = window.__STX_SETUP_ROOT__;
|
|
1119
|
-
window.__STX_SETUP_ROOT__ = root;
|
|
1120
|
-
try {
|
|
1121
|
-
setup();
|
|
1122
|
-
var registeredScope = window.stx._scopes && (window.stx._scopes[originalScopeId] || window.stx._scopes[scopeId]);
|
|
1123
|
-
if (registeredScope && originalScopeId !== scopeId) {
|
|
1124
|
-
delete window.stx._scopes[originalScopeId];
|
|
1125
|
-
window.stx._scopes[scopeId] = registeredScope;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
catch (e) {
|
|
1129
|
-
console.error('[stx] cloned component setup error:', e);
|
|
1130
|
-
}
|
|
1131
|
-
finally {
|
|
1132
|
-
window.__STX_SETUP_ROOT__ = previousSetupRoot;
|
|
1133
|
-
root.setAttribute('data-stx-scope', scopeId);
|
|
1134
|
-
}
|
|
1135
|
-
});
|
|
1142
|
+
pendingRoots.forEach(function(root) { runClonedComponentSetup(setup, root); });
|
|
1136
1143
|
|
|
1137
1144
|
// A component that is itself a structural source still needs its setup
|
|
1138
1145
|
// sibling when bindFor/bindIf turns that source into a clone template.
|
|
@@ -1148,6 +1155,27 @@ else {
|
|
|
1148
1155
|
if (!isStructuralSource && old.parentNode) old.parentNode.removeChild(old);
|
|
1149
1156
|
});
|
|
1150
1157
|
|
|
1158
|
+
/*
|
|
1159
|
+
* A host with no script elements. A native screen's setup scripts are
|
|
1160
|
+
* compiled out of the tree, so a clone a :for or :if builds carries none
|
|
1161
|
+
* to copy, and every row after the template rendered with no scope at
|
|
1162
|
+
* all: no props, no state, no handlers. The native bundle registers each
|
|
1163
|
+
* component's setup by its compiled scope id instead, and a clone is set
|
|
1164
|
+
* up from that the same way a cloned script would set it up here.
|
|
1165
|
+
*/
|
|
1166
|
+
var registeredSetups = window.__stx_componentSetups;
|
|
1167
|
+
if (registeredSetups) {
|
|
1168
|
+
roots.forEach(function(root) {
|
|
1169
|
+
// A :for clone carries a remapped id beside the template's; an :if
|
|
1170
|
+
// clone keeps the template's id, whose scope the source reclaimed.
|
|
1171
|
+
var scopeId = root.getAttribute('data-stx-scope');
|
|
1172
|
+
var originalScopeId = root.getAttribute('data-stx-template-scope') || scopeId;
|
|
1173
|
+
if (!scopeId || hasPendingStructuralAncestor(root) || (window.stx._scopes && window.stx._scopes[scopeId])) return;
|
|
1174
|
+
var setup = registeredSetups[originalScopeId];
|
|
1175
|
+
if (typeof setup === 'function') runClonedComponentSetup(setup, root);
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1151
1179
|
roots.forEach(function(root) {
|
|
1152
1180
|
// Still inside a conditional or loop this walk has not bound: the
|
|
1153
1181
|
// directive decides whether the component is on the page at all, and
|
|
@@ -4086,7 +4114,7 @@ catch (e) {
|
|
|
4086
4114
|
return ids;
|
|
4087
4115
|
}
|
|
4088
4116
|
};
|
|
4089
|
-
`;var
|
|
4117
|
+
`;var Me=` // Hydrate a subtree inserted AFTER initial load \u2014 e.g. a streamed suspense
|
|
4090
4118
|
// boundary (#1746 Phase 3). Mirrors the SPA re-init pass, scoped to the
|
|
4091
4119
|
// container: (1) executes the subtree's scoped setup scripts (inert when
|
|
4092
4120
|
// inserted via innerHTML, so they're cloned into fresh script elements to
|
|
@@ -4137,7 +4165,7 @@ catch (e) {
|
|
|
4137
4165
|
}
|
|
4138
4166
|
window.dispatchEvent(new CustomEvent('stx:hydrated', { detail: { el: container, trigger: 'stream' } }));
|
|
4139
4167
|
}
|
|
4140
|
-
`;var
|
|
4168
|
+
`;var De=` // ==========================================================================
|
|
4141
4169
|
// Post-hydration invariant sweep (stacksjs/stx#1773)
|
|
4142
4170
|
// ==========================================================================
|
|
4143
4171
|
//
|
|
@@ -4345,7 +4373,7 @@ catch (e) {
|
|
|
4345
4373
|
_exprFailureCount = 0;
|
|
4346
4374
|
}
|
|
4347
4375
|
}
|
|
4348
|
-
`;var
|
|
4376
|
+
`;var Pe=` // Reactive if/else-if/else chain. A single effect drives mutual exclusion:
|
|
4349
4377
|
// on each run it picks the first branch whose condition is truthy (the
|
|
4350
4378
|
// trailing x-else always matches), inserts that branch, and removes
|
|
4351
4379
|
// whichever branch was previously shown. One effect for the whole chain
|
|
@@ -4627,7 +4655,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4627
4655
|
// Shown branches whose deferred bind found them off the page: an enclosing
|
|
4628
4656
|
// :if, bound later in the same pass, hid them between the queue and the run.
|
|
4629
4657
|
// Their own condition has not changed, so their effect never runs again to
|
|
4630
|
-
// retry; each resumes here when an enclosing branch puts it back.`;var
|
|
4658
|
+
// retry; each resumes here when an enclosing branch puts it back.`;var Le=` const detachedBranches = new Set();
|
|
4631
4659
|
function resumeDetachedBranches() {
|
|
4632
4660
|
if (!detachedBranches.size) return;
|
|
4633
4661
|
Array.from(detachedBranches).forEach(function(resume) {
|
|
@@ -10260,7 +10288,7 @@ else if (timer === null) {
|
|
|
10260
10288
|
subscribe: subscribe
|
|
10261
10289
|
};
|
|
10262
10290
|
}
|
|
10263
|
-
`;function
|
|
10291
|
+
`;function Fe(){let t=xt(sn());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function sn(){return`${ae}${Oe}
|
|
10264
10292
|
${Je(ie,Se,Ee)}
|
|
10265
10293
|
|
|
10266
10294
|
${Re}
|
|
@@ -10301,8 +10329,8 @@ ${Be}
|
|
|
10301
10329
|
${Te}
|
|
10302
10330
|
${qe}
|
|
10303
10331
|
${he}
|
|
10332
|
+
${Pe}
|
|
10304
10333
|
${Le}
|
|
10305
|
-
${Fe}
|
|
10306
10334
|
${ce}
|
|
10307
10335
|
${mt}
|
|
10308
10336
|
${re}
|
|
@@ -10320,7 +10348,7 @@ ${Xe}
|
|
|
10320
10348
|
${ve}
|
|
10321
10349
|
${we}
|
|
10322
10350
|
${gt}
|
|
10323
|
-
${
|
|
10351
|
+
${Me}
|
|
10324
10352
|
${rt(pe)}
|
|
10325
10353
|
|
|
10326
10354
|
${ut}
|
|
@@ -10332,11 +10360,11 @@ ${Ne}
|
|
|
10332
10360
|
${ye}
|
|
10333
10361
|
${be}
|
|
10334
10362
|
${st}
|
|
10335
|
-
${
|
|
10363
|
+
${De}
|
|
10336
10364
|
${me}
|
|
10337
10365
|
${lt}
|
|
10338
10366
|
${ct}
|
|
10339
10367
|
${at}
|
|
10340
10368
|
})();
|
|
10341
|
-
`}var xu={state:W,derived:
|
|
10342
|
-
export{
|
|
10369
|
+
`}var xu={state:W,derived:on,effect:an,batch:es,onMount:Xn,onDestroy:Jn,isSignal:cn,isDerived:ln,untrack:ts,peek:Yn,generateSignalsRuntime:Fe,generateSignalsRuntimeDev:sn};
|
|
10370
|
+
export{Fe,sn,xu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{to,no,at,Z,Ln,_r,jn,Er,Tr,nl,rl,sl,Bn,ol,il,al,cl,sa,oa,ia,ro,aa,ll,ct,lt,ut,dt,pt,ft,Pe,ul}from"./chunk-a7crvy3b.js";export{jn as Router,al as abortNavigation,_r as bracketPathToRegex,ct as clearMiddleware,oa as createClientCookieManager,pt as createMiddlewareContext,dt as createRouteLocation,sa as createServerCookieManager,ia as createStorageManager,cl as defineMiddleware,rl as defineRoute,sl as defineRoutes,Er as findErrorPage,Tr as formatRoutes,no as generateRouteManifest,to as generateRouteTypes,aa as getMiddleware,lt as getMiddlewareNames,Pe as getRouterScript,ul as getRouterScriptDev,ll as hasMiddleware,at as isFileRequestPath,ut as loadMiddlewareFromDirectory,Ln as matchRoute,il as navigateTo,Z as patternToRegex,ro as registerMiddleware,ol as resetRoutes,Bn as route,ft as runMiddleware,nl as setAppUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{W}from"./chunk-
|
|
2
|
+
import{W}from"./chunk-shnsvsg4.js";function g(e,t){let r={};for(let n of e)r[n]=W(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=W(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Lo(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=W(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var Ja=Lo;class nn{rules=[];defaultValue="";addRule(e){let t=new nn;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new nn;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new nn;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var Jl=new nn;function Ya(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
|
|
3
3
|
`)}catch{return""}})}function Za(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
|
|
4
|
-
`)}catch{return""}})}function Qa(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function Yl(e,t,r){let n=e;return n=Ya(n,t,r),n=Za(n,t,r),n=Qa(n,t,r),n}export{Lo,Ja,
|
|
4
|
+
`)}catch{return""}})}function Qa(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function Yl(e,t,r){let n=e;return n=Ya(n,t,r),n=Za(n,t,r),n=Qa(n,t,r),n}export{Lo,Ja,nn,Jl,Ya,Za,Qa,Yl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lo,Ja,
|
|
2
|
+
import{Lo,Ja,nn,Jl,Ya,Za,Qa,Yl}from"./chunk-wkxzzdzs.js";export{nn as Validator,Ja as defineForm,Ya as processErrorDirective,Za as processErrorsDirective,Yl as processFormValidationDirectives,Qa as processHasErrorsDirective,Lo as useForm,Jl as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mt,Nc,Mc,Lc,jc,Bc,u,Fc,$s,zc,_i,Ei}from"./chunk-6qnemg0e.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-9e49fnj9.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-a7crvy3b.js";import"./chunk-82bttwqm.js";export{Mt as STX_ENGINE_BINDING_NAMES,$s as convertToCommonJS,_i as extractScriptFromTemplate,u as extractVariables,Ei as hasVariables,Fc as isCompleteImport,Bc as isMissingBindingFailure,Lc as isModuleResolutionFailure,jc as isSyntaxFailure,zc as splitDeclaration,Nc as stripTypeScript,Mc as withoutStxReferrer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function
|
|
3
|
-
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Xo(e,n){let r=
|
|
4
|
-
export{
|
|
2
|
+
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function ze(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function q(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
|
|
3
|
+
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Xo(e,n){let r=ze(e);try{return await n(r)}finally{q(r)}}
|
|
4
|
+
export{ze,q,Xo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{K,ds,ps,hc,At,oi,gs,ii,Gu,we,mn,xe}from"./chunk-6qnemg0e.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import{Li,s}from"./chunk-6eg9a3mt.js";import"./chunk-k71e38fk.js";import"./chunk-9e49fnj9.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-a7crvy3b.js";import"./chunk-82bttwqm.js";export{K as BROWSER_CORE_IMPORTS,hc as STX_AUTO_IMPORTS,ds as extractAndStripCssImports,we as extractBridgeData,Li as findInterpolationEnd,ii as generateAutoImportDestructuring,Gu as generateBrowserAutoImportDestructuring,mn as generateServerDataBridge,At as injectBrowserCoreAutoImports,xe as processClientScript,gs as referencesName,ps as renderVendorStyleTags,s as stripCommentsAndLiterals,oi as transformAutoImports};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-38mt83wa.js";import"./chunk-v8ze2q95.js";import"./chunk-t19th11m.js";import{a}from"./chunk-dgtxj56t.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function E(){let{NODE_ENV:n}=process.env;return n==="production"}function N(){let{STX_DEBUG:n}=process.env;return!E()||n==="true"}function
|
|
3
|
-
export{E,N,
|
|
2
|
+
function E(){let{NODE_ENV:n}=process.env;return n==="production"}function N(){let{STX_DEBUG:n}=process.env;return!E()||n==="true"}function Dn(){let{NODE_ENV:n}=process.env;return n==="test"}function Zs(n){return n==="compile"||E()}function Nn(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
+
export{E,N,Dn,Zs,Nn};
|