@stacksjs/stx 0.2.854 → 0.2.857
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-h8bqgjw4.js → chunk-03t7tk2k.js} +1 -1
- package/dist/{chunk-r8vx6aw7.js → chunk-08a7j82a.js} +1 -1
- package/dist/{chunk-5ppe8d51.js → chunk-08vwk3x7.js} +1 -1
- package/dist/{chunk-0dmpc70r.js → chunk-0d3z8hwz.js} +14 -14
- package/dist/{chunk-wsz9vajc.js → chunk-0hrkpb2h.js} +1 -1
- package/dist/{chunk-6ygjr05v.js → chunk-0veh8bcn.js} +2 -2
- package/dist/{chunk-5t4k477c.js → chunk-1277d5we.js} +4 -4
- package/dist/{chunk-m2srr0pz.js → chunk-16p1vkn6.js} +3 -3
- package/dist/{chunk-9tbghxd0.js → chunk-1772ax8e.js} +1 -1
- package/dist/chunk-1ffkbwdz.js +2 -0
- package/dist/{chunk-3fjdwr6s.js → chunk-1kmzj10y.js} +10 -10
- package/dist/{chunk-w032x0zm.js → chunk-1nankvf6.js} +2 -2
- package/dist/chunk-1qbagang.js +2 -0
- package/dist/{chunk-tks9wec7.js → chunk-1qvtme01.js} +1 -1
- package/dist/{chunk-gn1dmfdv.js → chunk-1xx55d2p.js} +1 -1
- package/dist/{chunk-q0ycypnt.js → chunk-1ywqsmy2.js} +1 -1
- package/dist/{chunk-1026xh3q.js → chunk-23mccy5y.js} +1 -1
- package/dist/{chunk-2j2qzv8g.js → chunk-27zp4q77.js} +2 -2
- package/dist/chunk-2a471sw1.js +3 -0
- package/dist/{chunk-33ph9zb2.js → chunk-2cy33z00.js} +2 -2
- package/dist/chunk-2jrf9m4w.js +2 -0
- package/dist/chunk-3jgrrjvx.js +2 -0
- package/dist/{chunk-df71jdb5.js → chunk-3wabhzf4.js} +8 -8
- package/dist/{chunk-68pvvd7v.js → chunk-3zjyhhg4.js} +3 -3
- package/dist/{chunk-7bt73vzq.js → chunk-41md2f3q.js} +3 -3
- package/dist/{chunk-ngnvyqk3.js → chunk-432c35hs.js} +2 -2
- package/dist/{chunk-a2fngjfx.js → chunk-4h9kkkh7.js} +1 -1
- package/dist/{chunk-h1f3dpvq.js → chunk-4tzsze9z.js} +2 -2
- package/dist/chunk-655m8g98.js +2 -0
- package/dist/chunk-68kspmq4.js +2 -0
- package/dist/{chunk-njj4mmdc.js → chunk-6tpcm12w.js} +1 -1
- package/dist/chunk-6x0jm4bv.js +2 -0
- package/dist/{chunk-97qv554b.js → chunk-6zj9wsy3.js} +1 -1
- package/dist/{chunk-krnp1bae.js → chunk-827rt3ew.js} +1 -1
- package/dist/{chunk-9f1p4y5e.js → chunk-8hymdzv2.js} +4 -4
- package/dist/chunk-8j8fth4b.js +2 -0
- package/dist/{chunk-enxnw50k.js → chunk-8ta5b0eb.js} +1 -1
- package/dist/{chunk-16tghnfh.js → chunk-914wcp1a.js} +3 -3
- package/dist/{chunk-kdc0xsds.js → chunk-93cgpqva.js} +1 -1
- package/dist/{chunk-car6nhfe.js → chunk-9n8t7v78.js} +2 -2
- package/dist/chunk-9wf5fx4s.js +2 -0
- package/dist/chunk-a4v8z93r.js +2 -0
- package/dist/{chunk-8vs6xk89.js → chunk-a53jtd74.js} +1 -1
- package/dist/{chunk-krtkxnz6.js → chunk-admnvsmx.js} +2 -2
- package/dist/chunk-b16g785w.js +2 -0
- package/dist/{chunk-ctb1bj28.js → chunk-bg574nvy.js} +3 -3
- package/dist/{chunk-vpqr2td2.js → chunk-bq6jy4yk.js} +3 -3
- package/dist/{chunk-59br2agx.js → chunk-cama7kaq.js} +3 -3
- package/dist/chunk-ccdp6g5z.js +2 -0
- package/dist/chunk-chr56bhk.js +2 -0
- package/dist/{chunk-v8p8t3t4.js → chunk-cskmp5p1.js} +1 -1
- package/dist/{chunk-3gbexkdv.js → chunk-cvrkr3re.js} +9 -9
- package/dist/{chunk-9r999ees.js → chunk-dhpd4mx7.js} +2 -2
- package/dist/{chunk-txg0pp28.js → chunk-dnrgcjds.js} +8 -8
- package/dist/chunk-dtxg2a6m.js +2 -0
- package/dist/{chunk-wzv7k91a.js → chunk-e8we717q.js} +2 -2
- package/dist/{chunk-zswtgwxg.js → chunk-eefdz43s.js} +1 -1
- package/dist/chunk-ent64fyq.js +2 -0
- package/dist/chunk-erfspa7v.js +2 -0
- package/dist/chunk-f0kveh4g.js +2 -0
- package/dist/{chunk-anva219c.js → chunk-f1vvhbmw.js} +2 -2
- package/dist/chunk-f1z6y2ts.js +2 -0
- package/dist/chunk-f3msj6jf.js +2 -0
- package/dist/chunk-fk7wk568.js +2 -0
- package/dist/{chunk-5c5nr9sf.js → chunk-fp24ecp8.js} +65 -65
- package/dist/{chunk-9z7fnv33.js → chunk-fyp1v087.js} +1 -1
- package/dist/{chunk-ga0e15n5.js → chunk-g0h1gxew.js} +11 -11
- package/dist/{chunk-kez50h8a.js → chunk-gggethdc.js} +1 -1
- package/dist/{chunk-7kc9xwht.js → chunk-gqrypyk7.js} +2 -2
- package/dist/chunk-gr19kv83.js +2 -0
- package/dist/{chunk-f61153pm.js → chunk-hfng042r.js} +26 -26
- package/dist/chunk-hj1yn8w5.js +2 -0
- package/dist/{chunk-y3gajdr9.js → chunk-htwn1f36.js} +6 -6
- package/dist/chunk-hzrcnxzg.js +2 -0
- package/dist/{chunk-vw73gsxx.js → chunk-j2s8j7ff.js} +3 -3
- package/dist/chunk-jed9n2hz.js +2 -0
- package/dist/{chunk-4qf5qh20.js → chunk-jefafv6s.js} +4 -4
- package/dist/chunk-jhm1228j.js +4 -0
- package/dist/chunk-js7nmw8v.js +2 -0
- package/dist/chunk-k0ert6e7.js +3 -0
- package/dist/{chunk-2rxr5cj6.js → chunk-mfwfaggj.js} +9 -9
- package/dist/{chunk-hpwtjb4a.js → chunk-mzes9ds7.js} +2 -2
- package/dist/chunk-n68sanmz.js +2 -0
- package/dist/{chunk-dak3fb0d.js → chunk-npzzbdn1.js} +1 -1
- package/dist/chunk-nstcwcpj.js +2 -0
- package/dist/{chunk-ybq56wam.js → chunk-pb09xy77.js} +2 -2
- package/dist/chunk-q87hkwfg.js +3 -0
- package/dist/chunk-qe6631me.js +2 -0
- package/dist/{chunk-ma4ftg5p.js → chunk-qvydfw8g.js} +4 -4
- package/dist/{chunk-r4r1fydy.js → chunk-qw0ctwnc.js} +3 -3
- package/dist/chunk-rrf78ezg.js +2 -0
- package/dist/{chunk-1wczdwv6.js → chunk-sb7zn84j.js} +5 -5
- package/dist/{chunk-f9thwm8c.js → chunk-sftyb8k4.js} +8 -8
- package/dist/{chunk-6gt2br9n.js → chunk-sgnkbgx1.js} +1 -1
- package/dist/chunk-shy2hkvj.js +2 -0
- package/dist/{chunk-v4bqmzj9.js → chunk-sny8rqe8.js} +2 -2
- package/dist/{chunk-csgfws3j.js → chunk-v1eycdhj.js} +2 -2
- package/dist/{chunk-qndtva3r.js → chunk-vmrvkbw6.js} +1 -1
- package/dist/chunk-vr5h5jpw.js +2 -0
- package/dist/{chunk-kdhgvfxw.js → chunk-wdh20fxz.js} +1 -1
- package/dist/chunk-wg7xzens.js +2 -0
- package/dist/{chunk-te82sjhy.js → chunk-xejhmsfw.js} +7 -7
- package/dist/{chunk-ht550m3c.js → chunk-xfymp197.js} +9 -9
- package/dist/{chunk-5mjsx45g.js → chunk-xqr2ec9k.js} +1 -1
- package/dist/{chunk-xsc8pksj.js → chunk-xw12cd90.js} +7 -7
- package/dist/{chunk-gsn5vvw4.js → chunk-y5agvhgg.js} +1 -1
- package/dist/chunk-zd2c84ct.js +2 -0
- package/dist/{chunk-4ekpj06v.js → chunk-zrsc45wv.js} +1 -1
- package/dist/{chunk-2f2rxpm9.js → chunk-zx5bt056.js} +24 -24
- package/dist/cli.js +17 -17
- package/dist/component-client-factories.js +6 -5
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +8 -8
- package/dist/utils.js +3 -2
- package/package.json +5 -5
- package/dist/chunk-0x4j65b0.js +0 -2
- package/dist/chunk-1p968nww.js +0 -2
- package/dist/chunk-33yeb861.js +0 -2
- package/dist/chunk-3wt0nh3p.js +0 -2
- package/dist/chunk-41vnkj8n.js +0 -2
- package/dist/chunk-5k8n17b4.js +0 -2
- package/dist/chunk-5wct6n72.js +0 -2
- package/dist/chunk-6bm19d4k.js +0 -2
- package/dist/chunk-7zhtnnzk.js +0 -2
- package/dist/chunk-cddvc63n.js +0 -2
- package/dist/chunk-cfmjtyzm.js +0 -2
- package/dist/chunk-cj923dqv.js +0 -2
- package/dist/chunk-cwt26rvt.js +0 -3
- package/dist/chunk-djte6zvt.js +0 -2
- package/dist/chunk-dq41v6hy.js +0 -2
- package/dist/chunk-dxgjmdnx.js +0 -2
- package/dist/chunk-ec54y5py.js +0 -2
- package/dist/chunk-ehp792dy.js +0 -3
- package/dist/chunk-fgxagxde.js +0 -2
- package/dist/chunk-g39txgtx.js +0 -2
- package/dist/chunk-hmys6w75.js +0 -2
- package/dist/chunk-hn1c3te7.js +0 -2
- package/dist/chunk-hqtj4ngq.js +0 -2
- package/dist/chunk-hxz5cd52.js +0 -3
- package/dist/chunk-j05z0m3r.js +0 -2
- package/dist/chunk-k4swzkyq.js +0 -2
- package/dist/chunk-ns5epsng.js +0 -2
- package/dist/chunk-pyc91z27.js +0 -2
- package/dist/chunk-rpk744cn.js +0 -2
- package/dist/chunk-spnq5xjw.js +0 -2
- package/dist/chunk-vz0t4mnc.js +0 -2
- package/dist/chunk-w525ymys.js +0 -2
- package/dist/chunk-wa06df5a.js +0 -2
- package/dist/chunk-x4077p94.js +0 -2
- package/dist/chunk-xk113s55.js +0 -2
- package/dist/chunk-xt6gss6f.js +0 -2
- package/dist/chunk-z0qfspzg.js +0 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R,u,f,P,d,K}from"./chunk-
|
|
3
|
-
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<g-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},re=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let Z=N[2];if(!r.has(Z))a.push(Z),r.add(Z);return}let te=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(te){let Z=te[1];if(!r.has(Z))a.push(Z),r.add(Z);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let Z=Y[1];if(!r.has(Z))a.push(Z),r.add(Z)}};while(n<g){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){D();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))re();n++}return a.join(", ")}function
|
|
2
|
+
import{R,u,f,P,d,K}from"./chunk-0d3z8hwz.js";import{V,Ms,Me,fe,Ot,Tr,Fe,ze,s,m,_e,E}from"./chunk-fp24ecp8.js";import{ut}from"./chunk-432c35hs.js";import{I}from"./chunk-xppm4cs4.js";import{ie}from"./chunk-cskmp5p1.js";import{B,Qe}from"./chunk-pb09xy77.js";import{T,$n}from"./chunk-ym5qgw03.js";import C from"path";import{existsSync as $e}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function Ee(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let g=n.index,t=g+n[0].length-1,D=1,W=t+1;while(W<r.length&&D>0){if(r[W]==="(")D++;else if(r[W]===")")D--;W++}if(D!==0)break;let re=r.substring(t+1,W-1),N=`${a}(${re})`;r=r.substring(0,g)+N+r.substring(W),S.lastIndex=g+N.length,n=S.exec(r)}return r}function ve(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,g=e.length,t=(N)=>{n++;while(n<g){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},D=()=>{n++;while(n<g){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<g&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")D();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<g&&e[n]!==`
|
|
3
|
+
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<g-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},re=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let Z=N[2];if(!r.has(Z))a.push(Z),r.add(Z);return}let te=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(te){let Z=te[1];if(!r.has(Z))a.push(Z),r.add(Z);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let Z=Y[1];if(!r.has(Z))a.push(Z),r.add(Z)}};while(n<g){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){D();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))re();n++}return a.join(", ")}function Re(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
|
|
4
4
|
(function() {
|
|
5
|
-
${
|
|
5
|
+
${ut("var",a)}
|
|
6
6
|
var __destroyHooks = [];
|
|
7
7
|
var __origOnDestroy = onDestroy;
|
|
8
8
|
onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
|
|
9
9
|
|
|
10
10
|
${c}
|
|
11
11
|
${e}})();
|
|
12
|
-
`}function
|
|
12
|
+
`}function ke(c,e){let r=he(c).split(",").map((g)=>g.trim()).filter(Boolean),S=new Set(V(c,!0).split(",").map((g)=>g.trim())),n=r.map((g)=>S.has(g)?` try { ${g}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(g)}, ${Ms(g)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(g)}] = ${g}; } catch (e) { /* not actually top-level */ }`).join(`
|
|
13
13
|
`);return`
|
|
14
14
|
// Register scope variables for STX runtime
|
|
15
15
|
if (!window.stx._scopes) window.stx._scopes = {};
|
|
@@ -22,7 +22,7 @@ ${n}
|
|
|
22
22
|
try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
|
|
23
23
|
if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
|
|
24
24
|
window.stx._scopes['${e}'] = __scopeRegistration;
|
|
25
|
-
`}function Ie(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function
|
|
25
|
+
`}function Ie(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ge(c,e){let a=ke(c,e);return Te(Re(c,a),e)}function Te(c,e){let a=`
|
|
26
26
|
(function() {
|
|
27
27
|
var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
|
|
28
28
|
var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
|
|
@@ -44,11 +44,11 @@ ${n}
|
|
|
44
44
|
}
|
|
45
45
|
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
46
46
|
}
|
|
47
|
-
})();`;return a+c+r}function
|
|
48
|
-
${b}`}if(
|
|
49
|
-
`;continue}if(X)try{let{extractVariables:U}=await import("./chunk-
|
|
50
|
-
`}}if(F.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-
|
|
47
|
+
})();`;return a+c+r}function Ae(c,e){if(B(c)){let n=B(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:Qe(c,(g,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ot(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),g=S.match(/data-stx-scope="([^"]*)"/);if(g)return{html:c,mergedIntoExisting:g[1],stamped:!0,root:n};let t=c.slice(0,a),D=r[1],W=r[2];return{html:`${t}${D} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ce=0;function ue(c,e){let a=C.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ce}`}var le=new Set,pe=new Set;function jh(){le.clear(),pe.clear()}var De=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Ff(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,g;while((g=n.exec(a))!==null){let t=g[1]==="/",D=g[2],W=g[3]==="/"||De.has(D.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(D);if(!W)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var Ze=new R(500),fc=new Set;function Bh(){fc.clear()}function Oe(c){if(c.__onceStore instanceof Set)return c.__onceStore;return fc}async function us(c,e,a,r,S,n=new Set){let g=r.partialsDir||C.join(C.dirname(a),"partials");if(g&&!C.isAbsolute(g))g=C.resolve(process.cwd(),g);let t=Ee(c,"@partial","@include"),D=Oe(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(h,k,x)=>{let p=k.trim(),i=`${a}:${p}`;if(D.has(i))return"";return D.add(i),k});{let h=/@includeIf\s*\(/g,k;while((k=h.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,_=p+1;while(_<t.length&&i>0){if(t[_]==="(")i++;else if(t[_]===")")i--;_++}if(i!==0)break;let l=t.substring(p+1,_-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){h.lastIndex=_;continue}let O=o[1],z=W(O,g,a),v="";if(z&&await Bun.file(z).exists())S.add(z),v=`@include(${l})`;t=t.substring(0,x)+v+t.substring(_),h.lastIndex=0}}for(let[h,k]of[["@includeWhen",!1],["@includeUnless",!0]]){let x=new RegExp(`${h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),p;while((p=x.exec(t))!==null){let i=p.index,_=i+p[0].length-1,l=1,o=_+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(_+1,o-1),z=ae(O,0);if(z===-1){x.lastIndex=o;continue}let v=O.substring(0,z).trim(),H=O.substring(z+1).trim(),F=H.match(/^\s*['"]([^'"]+)['"]/);if(!F){x.lastIndex=o;continue}let w=F[1],J=H.substring(F[0].length),j,M=ae(J,0);if(M!==-1)j=J.substring(M+1).trim();try{let A=`Boolean(${v})`,L;if(f(A)){let oe=d(A,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(u(A,e));let ee=k?!L:L,ne="";if(ee){let oe=W(w,g,a);if(oe&&await Bun.file(oe).exists())S.add(oe);ne=`@include('${w}'${j?`, ${j}`:""})`}t=t.substring(0,i)+ne+t.substring(o),x.lastIndex=0}catch(A){let L=A instanceof Error?A.message:String(A),ee=m("Include",`Error evaluating ${h} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),x.lastIndex=0}}}{let h=/@each\s*\(/g,k;while((k=h.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,_=p+1;while(_<t.length&&i>0){if(t[_]==="(")i++;else if(t[_]===")"){if(i--,i===0)break}_++}if(i!==0)break;let l=t.substring(p+1,_),o=t.substring(x,_+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){h.lastIndex=0,t=t.replace(o,"");continue}let[,z,v,H,F]=O;try{let w,J=v.trim();if(f(J))w=d(J,Object.keys(e))(...Object.values(e));else w=u(J,e);let j="";if(Array.isArray(w)&&w.length>0)for(let M of w){let A={...e,[H]:M},L=await te(z,A,c,x);j+=L}else if(F)j=await te(F,{},c,x);t=t.substring(0,x)+j+t.substring(_+1),h.lastIndex=0}catch(w){let J=w instanceof Error?w.message:String(w);t=t.substring(0,x)+m("Each",`Error in @each: ${J}`,a,c,x)+t.substring(_+1),h.lastIndex=0}}}{let h=/@includeFirst\s*\(/g,k;while((k=h.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,_=p+1;while(_<t.length&&i>0){if(t[_]==="(")i++;else if(t[_]===")"){if(i--,i===0)break}_++}if(i!==0)break;let l=t.substring(p+1,_),o=t.substring(x,_+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){h.lastIndex=0,t=t.replace(o,"");continue}let z=O[1],v=l.slice(O[0].length),H,F=v.match(/^\s*,\s*\{/);if(F){v=v.slice(F[0].length-1);let j=1,M=1;while(M<v.length&&j>0){if(v[M]==="{")j++;else if(v[M]==="}"){if(j--,j===0)break}M++}H=v.substring(0,M+1),v=v.slice(M+1)}let w,J=v.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)w=J[1];try{let j=JSON.parse(z.replace(/'/g,'"')),M={};if(H)try{M=P(H,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let ne=m("Include",`Error parsing includeFirst variables: ${ee}`,a,c,x,o);t=t.replace(o,()=>ne)}else t=t.replace(o,()=>w||"");continue}let A=!1;for(let L of j){let ee=W(L,g,a);if(!ee)continue;if(await s(ee)){let ne=await te(L,M,c,x);t=t.replace(o,()=>ne),A=!0;break}}if(!A)if(w!==void 0)t=t.replace(o,()=>w);else if(r.debug){let L=m("Include",`None of the includeFirst paths exist: ${z}`,a,c,x,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let M=j instanceof Error?j.message:String(j),A=m("Include",`Error processing @includeFirst: ${M}`,a,c,x,o);t=t.replace(o,()=>A)}h.lastIndex=0}}function W(h,k,x){try{let p=h;if(!h.endsWith(".stx"))p=`${h}.stx`;let i=C.resolve(k),_=C.resolve(C.dirname(x)),l;if(!p.startsWith("./")&&!p.startsWith("../")){for(let F of r._layerPartialDirs??[]){let w=C.resolve(F,p);if(w.startsWith(`${C.resolve(F)}${C.sep}`)&&$e(w))return w}l=C.resolve(k,p)}else l=C.resolve(_,p);let o=C.normalize(l),O=o.startsWith(i+C.sep)||o===i,z=o.startsWith(_+C.sep)||o===_,v=!1,H=C.dirname(_);if(o.startsWith(H+C.sep)){if(!C.relative(H,o).split(C.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))v=!0}if(!O&&!z&&!v)return console.error(`Security: Path traversal attempt blocked for include path: ${h}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${_}`),null;return o}catch(p){return console.error(`Error resolving path ${h}: ${p}`),null}}let re=C.resolve(a);n.add(re);function N(h,k,x,p){return r.onIncludeError?.({includePath:h,templatePath:a,message:k,partialsDir:g}),m("Include",k,a,x,p)}async function te(h,k={},x,p){let i=W(h,g,a);if(!i)return N(h,`Could not resolve path for include: ${h}`,x,p);let _=C.resolve(i);if(n.has(_)){let l=[...n,_].map((o)=>C.basename(o)).join(" -> ");return N(h,`Circular include detected: ${l}`,x,p)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let q=y instanceof Error?y.message:String(y);return N(h,`Error loading include file ${h}: ${q}`,x,p)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-js7nmw8v.js");l=y(l,e)}if(l&&(r.debug||!T()&&!$n()))try{let{warnUnbalancedTags:y}=await import("./chunk-7ycmnsh5.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-f0kveh4g.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=fe(o);if(O)o=O.content.trim();let v=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),H="";if(v)H=`<style${v[1]}>${v[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,q,b)=>{if(!me(q))return"";return F.push({attrs:q,body:b}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let w={...e};w.__stx_signals_gate=_e(l,i);for(let[y,q]of Object.entries(k))w[y]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(J)].sort((y,q)=>{let b=(y[1]||"").includes("server"),X=(q[1]||"").includes("server");return Number(X)-Number(b)}),M="",A=null,L=!1,ee=!1;for(let y of j){let q=y[1]||"",b=y[2]||"";if(me(q))continue;let X=q.includes("server"),Se=Fe(q);if(!X&&!/\bsrc\s*=/i.test(q))Me(b,i,r.strict);if(!X&&b.trim()){let{interpolateScriptExpressions:U}=await import("./chunk-03t7tk2k.js");b=U(b,w,h)}let ce="";try{let{extractAndStripCssImports:U,renderVendorStyleTags:Q}=await import("./chunk-1qbagang.js"),se=U(b,{filePath:i,projectRoot:process.cwd()});b=se.code,ce=Q(se.styles)}catch(U){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,U instanceof Error?U.message:U)}if(Se&&b.trim())b=ze(b);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-1qbagang.js");b=Q(b).code;let{hasUserImports:se,bundleClientScript:ye}=await import("./chunk-rrf78ezg.js");if(se(b))b=await ye(b,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:U}=await import("./chunk-2jrf9m4w.js");b=U(b)}let de=ve(b);if(!X){let{extractBridgeData:U,generateServerDataBridge:Q}=await import("./chunk-1qbagang.js"),se=Q(b,U(w));if(se)b=`${se}
|
|
48
|
+
${b}`}if(de&&!X){L=!0,A=ue(i,e);let U=I(b),Q=ge(U,A);M+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${A}">${Q}</script>
|
|
49
|
+
`;continue}if(X)try{let{extractVariables:U}=await import("./chunk-vmrvkbw6.js");await U(b,w,i)}catch(U){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,U)}if(!X&&!de){let U=q.replace(/\bclient\b/i,"").trim();A=ue(i,e);let Q=I(b),se=ge(Q,A);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(se))ee=!0;M+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${A}"${U?` ${U}`:""}>${se}</script>
|
|
50
|
+
`}}if(F.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-03t7tk2k.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,b)=>{let X=F[Number(b)];return`<script${X.attrs}>${y(X.body,w,h)}</script>`})}if(A){let y=Ae(o,A);if(o=y.html,y.mergedIntoExisting){let b=A,X=y.mergedIntoExisting;M=M.split(`'${b}'`).join(`'${X}'`).split(`"${b}"`).join(`"${X}"`),A=X}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${C.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let b=Ff(o);if(b.length>1)pe.add(i),console.warn(`[stx] ${C.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${b.length} top-level elements (${b.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=y.stamped&&y.root!==null&&Tr(y.root);M=Ie(M,q?A:null)}if(o.includes("@include")||o.includes("@partial"))o=await us(o,w,i,r,S,n);let{processLoops:ne,reportDeferredLoopWarnings:oe}=await import("./chunk-1ffkbwdz.js"),G=ne(o,w,i,void 0,!0);G=ie(G,w,i),G=oe(G);let{processMetaDirectives:xe,processSeoDirective:we,processStructuredData:be}=await import("./chunk-08vwk3x7.js");if(G=xe(G,w,i,r),G=be(G,w,i),G=we(G,w,i,r),G=E(G,w,i),H)G+=`
|
|
51
51
|
`+H;if(M)G+=`
|
|
52
52
|
`+M;return G}catch(l){if(l instanceof K)throw l;let o=l instanceof Error?l.message:String(l);return N(h,`Error processing include ${h}: ${o}`,x,p)}}let Y=/@include\s*\(/g,Z;while((Z=Y.exec(t))!==null){let h=Z.index,k=h+Z[0].length-1,x=1,p=k+1;while(p<t.length&&x>0){if(t[p]==="(")x++;else if(t[p]===")")x--;p++}if(x!==0)break;let i=t.substring(h,p),_=t.substring(k+1,p-1),l=_.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=p;continue}let o=l[1],O,z=_.substring(l[0].length),v=ae(z,0);if(v!==-1)O=z.substring(v+1).trim();let H={};if(O)try{H=P(O,e)}catch(w){let J=w instanceof Error?w.message:String(w);t=t.replace(i,m("Include",`Error parsing include variables for ${o}: ${J}`,a,c,h)),Y.lastIndex=0;continue}let F=await te(o,H,c,h);t=t.substring(0,h)+F+t.substring(p),Y.lastIndex=0}return t}function ds(c,e){let a=c;function r(S,n,g,t){let D=S,W=!0;while(W){W=!1;let re=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=D.match(re);if(!N||N.index===void 0)break;let te=N.index,Y=N[1],Z=te+N[0].length,h=new RegExp(`@${n}\\(`),k=new RegExp(`@${g}(?![a-z])`),x=1,p=Z,i=-1;while(x>0&&p<D.length){let l=D.slice(p),o=l.match(h),O=l.match(k),z=o?p+o.index:1/0,v=O?p+O.index:1/0;if(z<v)x++,p=z+(o[0].length||1);else if(v<1/0){if(x--,x===0){i=v;break}p=v+g.length+1}else break}if(i===-1)break;let _=D.slice(Z,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(_);else e[Y].push(_);D=D.substring(0,te)+D.substring(i+`@${g}`.length),W=!0}return D}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function ps(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
|
|
53
53
|
`)})}
|
|
54
|
-
export{jh,Ff,
|
|
54
|
+
export{jh,Ff,Ze,fc,Bh,us,ds,ps};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function
|
|
3
|
-
export{
|
|
2
|
+
import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function pt(e){let t=e.root??process.cwd(),o;try{let r=await import(c.join(t,"stx.config.ts"));o=(r.default||r).story}catch{}let a={...o,...e.config},f=l(a);return{root:t,config:f,storyFiles:[],tree:void 0,mode:e.mode}}function ft(e,t){e.storyFiles=t}function gt(e,t){e.tree=t}
|
|
3
|
+
export{pt,ft,gt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ke,xi,Si,gg,jt,tl,mg,nl,oy,je,vn,Be}from"./chunk-fp24ecp8.js";import{ll,r}from"./chunk-gqrypyk7.js";import"./chunk-6tpcm12w.js";import"./chunk-sny8rqe8.js";import"./chunk-0d3z8hwz.js";import"./chunk-xppm4cs4.js";import"./chunk-432c35hs.js";export{ke as BROWSER_CORE_IMPORTS,gg as STX_AUTO_IMPORTS,xi as extractAndStripCssImports,je as extractBridgeData,ll as findInterpolationEnd,nl as generateAutoImportDestructuring,oy as generateBrowserAutoImportDestructuring,vn as generateServerDataBridge,jt as injectBrowserCoreAutoImports,Be as processClientScript,mg as referencesName,Si as renderVendorStyleTags,r as stripCommentsAndLiterals,tl as transformAutoImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_n,Ti}from"./chunk-
|
|
2
|
+
import{_n,Ti}from"./chunk-6tpcm12w.js";import"./chunk-sny8rqe8.js";export{Ti as generateRuntimeConfigTypes,_n as prepareRuntimeConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{go,aa,Kr,mo,ho,On,
|
|
2
|
+
import{go,aa,Kr,mo,ho,On,Jt,ca,Gr,Xr,yo,bo,sm,om,mt}from"./chunk-mfwfaggj.js";export{mt as DeployError,aa as calculateSha1,Kr as collectDeployFiles,Xr as createDefaultNetlifyConfig,mo as createFileManifest,go as createNetlifyClient,sm as deploy,Gr as detectProjectConfig,ho as filterRequiredFiles,On as formatSize,ca as generateNetlifyToml,Jt as getTotalSize,bo as hasNetlifyConfig,om as initNetlify,yo as writeNetlifyConfig};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{se}from"./chunk-
|
|
2
|
+
import{se}from"./chunk-4tzsze9z.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function va(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":se(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Gl(e){return async(t)=>await va(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-chr56bhk.js")}
|
|
3
3
|
export{va,Gl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{He,M,jt}from"./chunk-v4bqmzj9.js";import{R}from"./chunk-0dmpc70r.js";import{mt,Ee,j,Ke,Te,ba,vo,wa,Dn}from"./chunk-xsc8pksj.js";import{_t,de,tt}from"./chunk-9r999ees.js";import{Do}from"./chunk-5t4k477c.js";import{Ln}from"./chunk-12r22pf0.js";import{we}from"./chunk-y3gajdr9.js";import Z from"fs";import P from"path";var{serve:ae}=globalThis.Bun;import H from"zlib";import{promisify as Y}from"util";var K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function se(t){if(!t)return null;let e=re(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,F=new Map,z=0;function oe(t,e){if(e.length>J/8)return;F.set(t,e),z+=e.length;for(let[a,r]of F){if(z<=J)break;F.delete(a),z-=r.length}}async function In(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let r=se(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(i.length<(a.threshold??te))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=F.get(g);if(!l)l=r==="br"?await Y(H.brotliCompress)(i,{params:{[H.constants.BROTLI_PARAM_QUALITY]:h,[H.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Y(H.gzip)(i),oe(g,l);if(l.length>=i.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new R(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",j(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Ee(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await a();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((C)=>C.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((C)=>C!=="x-stx-router"&&C!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",j(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return i();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):i()}}var ie={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function rm(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=ba(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=Ln(r.routeRules),f=new G,h=Do(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?M(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let C=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(C).text());if(m)c.html=jt(c.html,m);b.set(n.pattern,c),v.set(n.pattern,tt(c.html)),E.set(n.pattern,we(c.html));let _=P.join(e,n.fragmentPath);if(Ke(c.html,r.routerContainer||"main")&&await Bun.file(_).exists()){let A=await Bun.file(_).text();k.set(n.pattern,m?jt(A,m):A)}}catch(C){console.warn(`[stx] Failed to load route ${n.pattern}:`,C)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:C,params:c}=de(n.pattern,{page:!0});S.push({regex:C,route:n,paramNames:c})}else s.set(n.pattern,n);let B=ae({port:a,async fetch(n){return In(n,await He(m??M(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let _=await h(n);if(_)return _;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let y=P.extname(u).toLowerCase(),L=ie[y]||"application/octet-stream",N=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":N?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=Ee(n),w=null,q={};if(w=s.get(c)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let o=c.match(p);if(o){w=d,u.forEach((y,L)=>{q[y]=o[L+1]});break}}if(!w){let p=_t(c)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=i(c),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=k.get(w.pattern);if(o){let y=v.get(w.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...y?{"X-STX-Layout":y.layout,"X-STX-Layout-Group":y.group}:{},...j(),...O.cache?{}:{"Cache-Control":mt}}})}}let d=vo(n.method),u=b.get(w.pattern);if(!u){let o=s.get("/500")||null;if(o){let y=b.get(o.pattern);if(y)return new Response(y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...j(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:y,redirect:L,cookies:N,status:I,headers:D}=await Dn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(L)return wa(L,N,D);if(y&&y.length>0){let{renderStreamingPage:T,streamToResponse:U}=await import("./chunk-dq41v6hy.js"),X=new Headers({...j(),...D,"Cache-Control":"private, no-store"});for(let V of N??[])X.append("Set-Cookie",V);if(A&&!d&&Ke(o,r.routerContainer||"main")){let V=tt(o);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",we(o)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return U(T(A&&!d&&Ke(o,r.routerContainer||"main")?Te(o,r.routerContainer||"main",!0):o,y,{timeoutMs:30000}),{status:I??u.status??200,headers:X})}let x=new Headers({"Content-Type":"text/html",...j(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of N??[])x.append("Set-Cookie",T);for(let[T,U]of Object.entries(D??{}))x.set(T,U);if(x.set("Vary",j(x.get("Vary")).Vary),A&&!d&&Ke(o,r.routerContainer||"main")){let T=tt(o);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",we(o)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response(Te(o,r.routerContainer||"main",!0),{status:I??u.status??200,headers:x})}return new Response(o,{status:I??u.status??200,headers:x})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
|
|
2
|
+
import{Ve,M,Bt}from"./chunk-sny8rqe8.js";import{R}from"./chunk-0d3z8hwz.js";import{ht,Te,j,Ge,$e,ba,vo,wa,Dn}from"./chunk-xw12cd90.js";import{Ct,pe,nt}from"./chunk-dhpd4mx7.js";import{Do}from"./chunk-1277d5we.js";import{Ln}from"./chunk-12r22pf0.js";import{ve}from"./chunk-htwn1f36.js";import Z from"fs";import P from"path";var{serve:ae}=globalThis.Bun;import H from"zlib";import{promisify as Y}from"util";var K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function se(t){if(!t)return null;let e=re(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,F=new Map,z=0;function oe(t,e){if(e.length>J/8)return;F.set(t,e),z+=e.length;for(let[a,r]of F){if(z<=J)break;F.delete(a),z-=r.length}}async function In(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let r=se(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(i.length<(a.threshold??te))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=F.get(g);if(!l)l=r==="br"?await Y(H.brotliCompress)(i,{params:{[H.constants.BROTLI_PARAM_QUALITY]:h,[H.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Y(H.gzip)(i),oe(g,l);if(l.length>=i.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new R(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",j(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Te(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await a();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((C)=>C.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((C)=>C!=="x-stx-router"&&C!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",j(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return i();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):i()}}var ie={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function rm(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=ba(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=Ln(r.routeRules),f=new G,h=Do(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?M(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let C=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(C).text());if(m)c.html=Bt(c.html,m);b.set(n.pattern,c),v.set(n.pattern,nt(c.html)),E.set(n.pattern,ve(c.html));let _=P.join(e,n.fragmentPath);if(Ge(c.html,r.routerContainer||"main")&&await Bun.file(_).exists()){let A=await Bun.file(_).text();k.set(n.pattern,m?Bt(A,m):A)}}catch(C){console.warn(`[stx] Failed to load route ${n.pattern}:`,C)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:C,params:c}=pe(n.pattern,{page:!0});S.push({regex:C,route:n,paramNames:c})}else s.set(n.pattern,n);let B=ae({port:a,async fetch(n){return In(n,await Ve(m??M(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let _=await h(n);if(_)return _;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let y=P.extname(u).toLowerCase(),L=ie[y]||"application/octet-stream",N=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":N?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=Te(n),w=null,q={};if(w=s.get(c)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let o=c.match(p);if(o){w=d,u.forEach((y,L)=>{q[y]=o[L+1]});break}}if(!w){let p=Ct(c)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=i(c),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=k.get(w.pattern);if(o){let y=v.get(w.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...y?{"X-STX-Layout":y.layout,"X-STX-Layout-Group":y.group}:{},...j(),...O.cache?{}:{"Cache-Control":ht}}})}}let d=vo(n.method),u=b.get(w.pattern);if(!u){let o=s.get("/500")||null;if(o){let y=b.get(o.pattern);if(y)return new Response(y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...j(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:y,redirect:L,cookies:N,status:I,headers:D}=await Dn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(L)return wa(L,N,D);if(y&&y.length>0){let{renderStreamingPage:T,streamToResponse:U}=await import("./chunk-js7nmw8v.js"),X=new Headers({...j(),...D,"Cache-Control":"private, no-store"});for(let V of N??[])X.append("Set-Cookie",V);if(A&&!d&&Ge(o,r.routerContainer||"main")){let V=nt(o);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",ve(o)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return U(T(A&&!d&&Ge(o,r.routerContainer||"main")?$e(o,r.routerContainer||"main",!0):o,y,{timeoutMs:30000}),{status:I??u.status??200,headers:X})}let x=new Headers({"Content-Type":"text/html",...j(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of N??[])x.append("Set-Cookie",T);for(let[T,U]of Object.entries(D??{}))x.set(T,U);if(x.set("Vary",j(x.get("Vary")).Vary),A&&!d&&Ge(o,r.routerContainer||"main")){let T=nt(o);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",ve(o)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response($e(o,r.routerContainer||"main",!0),{status:I??u.status??200,headers:x})}return new Response(o,{status:I??u.status??200,headers:x})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
|
|
3
3
|
export{In,rm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{T}from"./chunk-ym5qgw03.js";import{
|
|
2
|
+
import{T}from"./chunk-ym5qgw03.js";import{qe,Pn}from"./chunk-admnvsmx.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?qe(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?qe(t,e):null,l=s?Pn(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Wt}from"./chunk-bg574nvy.js";function ro(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Wt(e),i=`
|
|
3
3
|
<!-- stx PWA Meta Tags -->
|
|
4
4
|
<link rel="manifest" href="/manifest.json">
|
|
5
5
|
<meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
|
|
@@ -48,7 +48,7 @@ if ('serviceWorker' in navigator) {
|
|
|
48
48
|
</head>`)}function Ig(e){if(!e.pwa?.enabled)return"";return`<script>
|
|
49
49
|
if ('serviceWorker' in navigator) {
|
|
50
50
|
window.addEventListener('load', function() {
|
|
51
|
-
navigator.serviceWorker.register('/${
|
|
51
|
+
navigator.serviceWorker.register('/${Wt(e)}')
|
|
52
52
|
.then(function(registration) {
|
|
53
53
|
console.log('[PWA] Service Worker registered:', registration.scope);
|
|
54
54
|
})
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Uh,ys,Go,bs,ur,Xo,Jo,Uf,ws,vs,xs,Yo,mc,Wf,St}from"./chunk-xfymp197.js";import"./chunk-htwn1f36.js";import"./chunk-eefdz43s.js";import"./chunk-g0h1gxew.js";import"./chunk-xqr2ec9k.js";import"./chunk-kvafq9gy.js";import"./chunk-tm8a2b69.js";import"./chunk-j2s8j7ff.js";import"./chunk-dhpd4mx7.js";import{V}from"./chunk-fp24ecp8.js";import"./chunk-6tpcm12w.js";import"./chunk-sny8rqe8.js";import"./chunk-0d3z8hwz.js";import"./chunk-xppm4cs4.js";import"./chunk-432c35hs.js";export{Uf as bindLoopInterpolations,Uh as clearScriptScanCache,ws as convertServerLoopAttributesToDirectives,Xo as convertSignalDirectivesToAttributes,vs as convertSignalLoopsToAttributes,ur as extractClientSignalNames,V as extractExports,mc as findMarkupIndexOutsideScripts,bs as hasSignalsSyntax,Go as parseLoopExpression,Jo as preEvalLiteralReactiveIfs,xs as processScriptSetup,Yo as processSignals,Wf as rewriteStxImportSpecifiers,ys as scanScriptTags,St as stripStxRuntimeImports};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{jh,Ff,Ze,fc,Bh,us,ds,ps}from"./chunk-1kmzj10y.js";import"./chunk-3wabhzf4.js";import"./chunk-2a471sw1.js";import"./chunk-cskmp5p1.js";import"./chunk-eefdz43s.js";import"./chunk-fp24ecp8.js";import"./chunk-6tpcm12w.js";import"./chunk-sny8rqe8.js";import"./chunk-0d3z8hwz.js";import"./chunk-xppm4cs4.js";import"./chunk-432c35hs.js";export{Bh as clearOnceStore,fc as onceStore,Ze as partialsCache,us as processIncludes,ds as processStackPushDirectives,ps as processStackReplacements,jh as resetUnscopedSignalWarnings,Ff as topLevelElements};
|