@stacksjs/stx 0.2.286 → 0.2.288
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtins/index.d.ts +4 -3
- package/dist/builtins/index.js +11 -11
- package/dist/{chunk-3bv8h4r6.js → chunk-02af607x.js} +1 -1
- package/dist/chunk-06706a9a.js +2 -0
- package/dist/chunk-0896td83.js +2 -0
- package/dist/chunk-08yja60e.js +2 -0
- package/dist/{chunk-e2w23g2r.js → chunk-13tawjw8.js} +10 -10
- package/dist/{chunk-zn5jgmqw.js → chunk-1e83cj7k.js} +1 -1
- package/dist/chunk-1g6pvs7k.js +11 -0
- package/dist/chunk-1gvebxh4.js +2 -0
- package/dist/{chunk-jbfpc4z7.js → chunk-1t9g3mhg.js} +2 -2
- package/dist/{chunk-0f1kz0x2.js → chunk-2e6xafcm.js} +1 -1
- package/dist/chunk-2rfxs7zm.js +2 -0
- package/dist/{chunk-sskbegsz.js → chunk-2vza9m2x.js} +1 -1
- package/dist/{chunk-pbk8jxe2.js → chunk-2wtn443n.js} +1 -1
- package/dist/{chunk-6cye5m9f.js → chunk-34qkshwh.js} +2 -2
- package/dist/{chunk-2g9jwgs7.js → chunk-3br3pt6k.js} +1 -1
- package/dist/{chunk-kmhr1z0m.js → chunk-3p0n9ryv.js} +1 -1
- package/dist/chunk-437n7hyx.js +2 -0
- package/dist/{chunk-ayrjwkyw.js → chunk-461br5nn.js} +1 -1
- package/dist/chunk-4tr92e0v.js +2 -0
- package/dist/{chunk-t6nseeb9.js → chunk-4vpsvh6x.js} +1 -1
- package/dist/{chunk-nh21517m.js → chunk-5j9tvhpq.js} +2 -2
- package/dist/{chunk-mb518a4n.js → chunk-5yp3vt00.js} +1 -1
- package/dist/{chunk-e4hhz9j3.js → chunk-5zcg61j9.js} +2 -2
- package/dist/{chunk-snknv47x.js → chunk-6085vha7.js} +1 -1
- package/dist/{chunk-9th1wd1d.js → chunk-72c7gyqc.js} +3 -3
- package/dist/chunk-811cxzn4.js +2 -0
- package/dist/{chunk-bz2gytfs.js → chunk-8883pgj8.js} +1 -1
- package/dist/{chunk-vqxmxgaj.js → chunk-8bxtvsgm.js} +1 -1
- package/dist/{chunk-a63y3aa0.js → chunk-8daczchh.js} +1 -1
- package/dist/chunk-91ffbzmh.js +2 -0
- package/dist/chunk-96cqevhm.js +2 -0
- package/dist/chunk-978faewt.js +2 -0
- package/dist/{chunk-g3fy0tw8.js → chunk-9veqmqb6.js} +154 -48
- package/dist/{chunk-7q9mwh4v.js → chunk-a668m28h.js} +1 -1
- package/dist/{chunk-xg57nax9.js → chunk-a9fxxwrv.js} +2 -2
- package/dist/chunk-adkjxvy6.js +2 -0
- package/dist/{chunk-a2qghr2x.js → chunk-agx0620p.js} +1 -1
- package/dist/chunk-ak06mywr.js +2 -0
- package/dist/chunk-ayaz0wcj.js +2 -0
- package/dist/{chunk-ah4e6e09.js → chunk-bphx7ngb.js} +2 -2
- package/dist/chunk-bw48gj8j.js +2 -0
- package/dist/{chunk-7rxtra1g.js → chunk-byq2xpgb.js} +1 -1
- package/dist/chunk-bzsjhyet.js +2 -0
- package/dist/{chunk-rhs51nmz.js → chunk-ch31zddx.js} +2 -2
- package/dist/chunk-cqzqfm7m.js +2 -0
- package/dist/{chunk-9zndrzb3.js → chunk-d0f60jrg.js} +2 -2
- package/dist/{chunk-c0an64km.js → chunk-dcxtrqfy.js} +1 -1
- package/dist/{chunk-bf8wf3r2.js → chunk-drbbt69f.js} +35 -10
- package/dist/chunk-e0aybavh.js +2 -0
- package/dist/chunk-e63a220e.js +28 -0
- package/dist/chunk-e67w1bge.js +2 -0
- package/dist/chunk-e7kd0ny8.js +2 -0
- package/dist/{chunk-y8n174xq.js → chunk-ee2tfpec.js} +2 -2
- package/dist/{chunk-9n0gvfrg.js → chunk-efr3ejqt.js} +1 -1
- package/dist/chunk-evfct6hb.js +2 -0
- package/dist/{chunk-kzyhvrp8.js → chunk-favq46aa.js} +1 -1
- package/dist/{chunk-0fgcnv6y.js → chunk-fcfphfpw.js} +2 -2
- package/dist/{chunk-w95sp0k9.js → chunk-fed3xsp9.js} +2 -2
- package/dist/{chunk-e7jfpyqy.js → chunk-ffmtamm2.js} +1 -1
- package/dist/{chunk-39f40yc4.js → chunk-fv923f7g.js} +1 -1
- package/dist/{chunk-jr3jp3ev.js → chunk-fvh9ca47.js} +1 -1
- package/dist/chunk-fxk9j0rm.js +2 -0
- package/dist/{chunk-fskfes13.js → chunk-gy933rct.js} +1 -1
- package/dist/{chunk-f3hfk78e.js → chunk-h61qt916.js} +1 -1
- package/dist/{chunk-c6fw33zh.js → chunk-h7v70dbp.js} +2 -2
- package/dist/{chunk-bz820epz.js → chunk-hmf9z4jx.js} +1 -1
- package/dist/{chunk-j9g11dzx.js → chunk-hqh7x9h5.js} +2 -2
- package/dist/{chunk-hs0387tm.js → chunk-hv5v6vc2.js} +2 -2
- package/dist/{chunk-xttsqmkm.js → chunk-jem20v5k.js} +1 -1
- package/dist/{chunk-t1k5dpbr.js → chunk-jj6yp7gm.js} +1 -1
- package/dist/{chunk-90qr4f9m.js → chunk-jv91rkhx.js} +1 -1
- package/dist/{chunk-qbeffw17.js → chunk-jyc9eha6.js} +1 -1
- package/dist/{chunk-w3ycm4na.js → chunk-k0y7ta0d.js} +1 -1
- package/dist/chunk-k4jt9t4p.js +2 -0
- package/dist/{chunk-9y0g8kzt.js → chunk-k70fgb2f.js} +1 -1
- package/dist/{chunk-74cv4ta1.js → chunk-k78gvm0g.js} +1 -1
- package/dist/{chunk-jn6m8zf7.js → chunk-kb5j08tq.js} +1 -1
- package/dist/{chunk-a54n1r1q.js → chunk-kf8t2wq7.js} +1 -1
- package/dist/chunk-kfy1jh6p.js +2 -0
- package/dist/chunk-kws4rewx.js +17 -0
- package/dist/{chunk-s67mgegv.js → chunk-mc58fhgm.js} +1 -1
- package/dist/{chunk-n3ggrhb3.js → chunk-mjpqz66q.js} +1 -1
- package/dist/{chunk-mjkfc2v6.js → chunk-mmnqd035.js} +1 -1
- package/dist/{chunk-54st8g2j.js → chunk-mywp77gt.js} +1 -1
- package/dist/{chunk-p396xrew.js → chunk-n0j85038.js} +1 -1
- package/dist/{chunk-gjemavhx.js → chunk-n5y9gh1q.js} +1 -1
- package/dist/{chunk-qd8ggjdx.js → chunk-n9kk3jz1.js} +1 -1
- package/dist/{chunk-49kk0s96.js → chunk-nmkra8q5.js} +2 -2
- package/dist/{chunk-s2284nbk.js → chunk-np5dc1q1.js} +1 -1
- package/dist/chunk-nygtwffe.js +5 -0
- package/dist/{chunk-y6kw0wb7.js → chunk-p0zq5ckb.js} +1 -1
- package/dist/chunk-pb16azfa.js +4 -0
- package/dist/{chunk-nx5qkm8k.js → chunk-ps20v1ah.js} +1 -1
- package/dist/chunk-pv9apyrr.js +2 -0
- package/dist/chunk-qj2s3r1w.js +3756 -0
- package/dist/chunk-qjkzpd68.js +11 -0
- package/dist/chunk-qww39be9.js +2 -0
- package/dist/chunk-r90w3x6h.js +2 -0
- package/dist/chunk-rb87b7kr.js +2 -0
- package/dist/{chunk-an2539bs.js → chunk-rjqfa3g8.js} +2 -2
- package/dist/{chunk-2q630fj4.js → chunk-sag55qv7.js} +1 -1
- package/dist/chunk-srcbkg7g.js +2 -0
- package/dist/chunk-sxderfaa.js +12 -0
- package/dist/{chunk-ysnk7x79.js → chunk-t5c7rk0h.js} +1 -1
- package/dist/chunk-v2z3creg.js +2 -0
- package/dist/chunk-vtjfv7kg.js +2 -0
- package/dist/{chunk-5aq35j2e.js → chunk-vvqe2gaz.js} +2 -2
- package/dist/{chunk-s7pc68jf.js → chunk-vwzqg4fh.js} +2 -2
- package/dist/{chunk-7p9ns60j.js → chunk-vxxxczmn.js} +1 -1
- package/dist/chunk-vzzkhjw7.js +2 -0
- package/dist/{chunk-wcm80anz.js → chunk-wvq1g6gr.js} +1 -1
- package/dist/{chunk-y7m2dpd3.js → chunk-wyxw61az.js} +1 -1
- package/dist/{chunk-kdrpx9ft.js → chunk-xpct12p7.js} +1 -1
- package/dist/chunk-xvndd7h6.js +2 -0
- package/dist/{chunk-d0c3v7ax.js → chunk-y5jjrnfa.js} +1 -1
- package/dist/{chunk-vbdca0k1.js → chunk-ym4ggcpy.js} +1 -1
- package/dist/{chunk-q68xmak4.js → chunk-ymc99r5x.js} +18 -18
- package/dist/{chunk-refwkt87.js → chunk-ynt7y2n5.js} +1 -1
- package/dist/chunk-z6azwfb4.js +2 -0
- package/dist/chunk-zfnabevq.js +2 -0
- package/dist/{chunk-cvnh7dma.js → chunk-zqwmy0av.js} +1 -1
- package/dist/{chunk-phhzfeh9.js → chunk-zvw2qgwt.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/client-module-registry.d.ts +36 -0
- package/dist/client-module-registry.js +55 -0
- package/dist/client-script-bundler.d.ts +39 -0
- package/dist/client-script-bundler.js +89 -12
- package/dist/client-script.js +15 -8
- package/dist/component-client-factories.js +10 -5
- package/dist/component-processing.d.ts +13 -0
- package/dist/component-processing.js +37 -1
- package/dist/component-renderer.js +34 -15
- package/dist/conditionals.js +14 -3
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/document-shell.d.ts +1 -34
- package/dist/document-shell.js +19 -11
- package/dist/html-masking.d.ts +65 -9
- package/dist/html-masking.js +103 -15
- package/dist/misc-directives.d.ts +1 -1
- package/dist/misc-directives.js +48 -13
- package/dist/process.js +38 -7
- package/dist/pwa.js +2 -2
- package/dist/reactive-bindings.js +2 -0
- package/dist/runtime-globals.d.ts +7 -20
- package/dist/runtime-globals.js +28 -3
- package/dist/safe-evaluator.d.ts +15 -0
- package/dist/safe-evaluator.js +16 -12
- package/dist/server-bindings.js +21 -5
- package/dist/signal-processing.d.ts +17 -7
- package/dist/signal-processing.js +116 -46
- package/dist/signals-api.js +5 -2
- package/dist/signals.js +153 -47
- package/dist/ssg.js +2 -2
- package/dist/store-loader.js +1 -1
- package/dist/strip-literals.d.ts +20 -0
- package/dist/strip-literals.js +16 -0
- package/dist/utils.js +24 -7
- package/dist/variable-extractor.js +17 -47
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-3ehv1by2.js +0 -2
- package/dist/chunk-4cqgbcy7.js +0 -3756
- package/dist/chunk-52mh63sp.js +0 -11
- package/dist/chunk-56ywtaff.js +0 -2
- package/dist/chunk-61sj52qh.js +0 -2
- package/dist/chunk-7ej1d910.js +0 -2
- package/dist/chunk-829pcte9.js +0 -2
- package/dist/chunk-8emkx9ja.js +0 -2
- package/dist/chunk-ajbfeey7.js +0 -2
- package/dist/chunk-areethga.js +0 -2
- package/dist/chunk-b29wbjs5.js +0 -2
- package/dist/chunk-b7tjq91c.js +0 -2
- package/dist/chunk-ba6tthsm.js +0 -2
- package/dist/chunk-e4akvata.js +0 -2
- package/dist/chunk-f4k2a7vs.js +0 -2
- package/dist/chunk-f80wwn5x.js +0 -2
- package/dist/chunk-fjkstnz3.js +0 -2
- package/dist/chunk-j03bare5.js +0 -2
- package/dist/chunk-jg0axas8.js +0 -2
- package/dist/chunk-jrk8rhwt.js +0 -28
- package/dist/chunk-kawk5ve9.js +0 -2
- package/dist/chunk-m3yaa0v5.js +0 -15
- package/dist/chunk-m7xnzt2t.js +0 -2
- package/dist/chunk-mkn6qqc7.js +0 -2
- package/dist/chunk-n3jyv9z6.js +0 -2
- package/dist/chunk-nvgxjvnb.js +0 -2
- package/dist/chunk-qk8tbcwk.js +0 -2
- package/dist/chunk-qp97dx7x.js +0 -2
- package/dist/chunk-qsr3bqav.js +0 -12
- package/dist/chunk-vb10qph4.js +0 -2
- package/dist/chunk-vrvehb01.js +0 -2
- package/dist/chunk-vy8v5xdb.js +0 -2
- package/dist/chunk-w0sqz3cb.js +0 -11
- package/dist/chunk-w8smn72c.js +0 -2
- package/dist/chunk-wxk2pbrh.js +0 -2
- package/dist/chunk-x1nw1p8z.js +0 -2
- package/dist/chunk-xz55q3gr.js +0 -2
- package/dist/chunk-yq1d9hb3.js +0 -2
- package/dist/chunk-ytgnzeeb.js +0 -2
- package/dist/chunk-zfr4d08r.js +0 -2
package/dist/builtins/index.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export { IconBuiltin, preloadIconCollection } from './icon';
|
|
|
18
18
|
export { getTooltipRuntime } from './tooltip';
|
|
19
19
|
export { SuspenseBuiltin } from './suspense';
|
|
20
20
|
export { TransitionGroupBuiltin } from './transition-group';
|
|
21
|
+
import type { ComponentRegistry } from '../component-registry';
|
|
21
22
|
/**
|
|
22
|
-
* Register all builtin components with the
|
|
23
|
-
*
|
|
23
|
+
* Register all builtin components with the supplied registry, or with the
|
|
24
|
+
* package singleton when no target is supplied.
|
|
24
25
|
*/
|
|
25
|
-
export declare function registerBuiltins(): void;
|
|
26
|
+
export declare function registerBuiltins(target?: ComponentRegistry): void;
|
package/dist/builtins/index.js
CHANGED
|
@@ -20,15 +20,15 @@ import { StxDrawerBuiltin } from "./drawer.js";
|
|
|
20
20
|
import { IconBuiltin } from "./icon.js";
|
|
21
21
|
import { SuspenseBuiltin } from "./suspense.js";
|
|
22
22
|
import { TransitionGroupBuiltin } from "./transition-group.js";
|
|
23
|
-
export function registerBuiltins() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
export function registerBuiltins(target = registry) {
|
|
24
|
+
target.registerBuiltin(StxLinkBuiltin);
|
|
25
|
+
target.registerBuiltin(StxImageBuiltin);
|
|
26
|
+
target.registerBuiltin(SafeImageBuiltin);
|
|
27
|
+
target.registerBuiltin(StxLoadingIndicatorBuiltin);
|
|
28
|
+
target.registerBuiltin(StxToastBuiltin);
|
|
29
|
+
target.registerBuiltin(StxModalBuiltin);
|
|
30
|
+
target.registerBuiltin(StxDrawerBuiltin);
|
|
31
|
+
target.registerBuiltin(IconBuiltin);
|
|
32
|
+
target.registerBuiltin(SuspenseBuiltin);
|
|
33
|
+
target.registerBuiltin(TransitionGroupBuiltin);
|
|
34
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-2vza9m2x.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${L}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as vl,$a as pn,$b as Ho,$c as Hp,$d as Hq,A as fk,Aa as zm,Ab as $n,Ac as gp,Ad as gq,Ae as mr,B as gk,Ba as Am,Bb as ao,Bc as hp,Bd as hq,Be as nr,C as hk,Ca as Nm,Cb as bo,Cc as ip,Cd as iq,Ce as or,D as ik,Da as Om,Db as co,Dc as jp,Dd as jq,De as pr,E as _k,Ea as Pm,Eb as eo,Ec as kp,Ed as kq,Ee as qr,F as $k,Fa as Qm,Fb as fo,Fc as lp,Fd as lq,Fe as rr,G as al,Ga as Rm,Gb as go,Gc as mp,Gd as mq,Ge as sr,H as bl,Ha as Sm,Hb as ho,Hc as np,Hd as nq,He as tr,I as cl,Ia as Wm,Ib as io,Ic as op,Id as oq,Ie as ur,J as dl,Ja as Xm,Jb as jo,Jc as pp,Jd as pq,Je as vr,K as el,Ka as Ym,Kb as ko,Kc as qp,Kd as qq,Ke as wr,L as fl,La as Zm,Lb as lo,Lc as rp,Ld as rq,Le as xr,M as gl,Ma as _m,Mb as so,Mc as sp,Md as sq,Me as yr,N as hl,Na as $m,Nb as to,Nc as tp,Nd as tq,Ne as zr,O as il,Oa as an,Ob as uo,Oc as up,Od as uq,Oe as Ar,P as jl,Pa as bn,Pb as vo,Pc as vp,Pd as vq,Pe as Br,Q as kl,Qa as cn,Qb as wo,Qc as wp,Qd as wq,Qe as Cr,R as ll,Ra as dn,Rb as xo,Rc as xp,Rd as xq,Re as Dr,S as ml,Sa as en,Sb as yo,Sc as yp,Sd as yq,Se as Er,T as nl,Ta as fn,Tb as zo,Tc as zp,Td as zq,Te as Fr,U as ol,Ua as gn,Ub as Ao,Uc as Ap,Ud as Aq,Ue as Gr,V as pl,Va as hn,Vb as Bo,Vc as Bp,Vd as Bq,Ve as Hr,W as ql,Wa as kn,Wb as Co,Wc as Cp,Wd as Cq,We as Ir,X as rl,Xa as ln,Xb as Do,Xc as Dp,Xd as Dq,Y as sl,Ya as mn,Yb as Eo,Yc as Ep,Yd as Eq,Z as tl,Za as nn,Zb as Fo,Zc as Fp,Zd as Fq,_ as ul,_a as on,_b as Go,_c as Gp,_d as Gq,aa as wl,ab as qn,ac as Io,ad as Ip,ae as Iq,ba as xl,bb as rn,bc as Jo,bd as Jp,be as Jq,ca as yl,cb as sn,cc as Ko,cd as Kp,ce as Kq,da as zl,db as tn,dc as Lo,dd as Lp,de as Lq,ea as Al,eb as un,ec as Mo,ed as Mp,ee as Mq,fa as Bl,fb as vn,fc as No,fd as Np,fe as Nq,ga as Cl,gb as wn,gc as Oo,gd as Op,ge as Oq,ha as Dl,hb as xn,hc as Po,hd as Pp,he as Pq,ia as El,ib as yn,ic as Qo,id as Qp,ie as Qq,ja as Fl,jb as zn,jc as Ro,jd as Rp,je as Rq,ka as Gl,kb as An,kc as So,kd as Sp,ke as Sq,la as Hl,lb as Bn,lc as To,ld as Tp,le as Tq,ma as Il,mb as Cn,mc as Uo,md as Up,me as Uq,na as Jl,nb as Fn,nc as Vo,nd as Vp,ne as $q,o as a,oa as Kl,ob as Gn,oc as Wo,od as Wp,oe as ar,p as Sj,pa as om,pb as Hn,pc as Xo,pd as Xp,pe as br,q as Tj,qa as pm,qb as In,qc as Yo,qd as Yp,qe as cr,r as Uj,ra as qm,rb as On,rc as Zo,rd as Zp,re as dr,s as Vj,sa as rm,sb as Pn,sc as _o,sd as _p,se as er,t as Wj,ta as sm,tb as Qn,tc as $o,td as $p,te as fr,u as Xj,ua as tm,ub as Rn,uc as ap,ud as aq,ue as gr,v as Yj,va as um,vb as Wn,vc as bp,vd as bq,ve as hr,w as Zj,wa as vm,wb as Xn,wc as cp,wd as cq,we as ir,x as _j,xa as wm,xb as Yn,xc as dp,xd as dq,xe as jr,y as dk,ya as xm,yb as Zn,yc as ep,yd as eq,ye as kr,z as ek,za as ym,zb as _n,zc as fp,zd as fq,ze as lr}from"./chunk-13tawjw8.js";import{Xe as Jn}from"./chunk-5j9tvhpq.js";import{$e as jn,Ye as Tm,Ze as Um,_e as Vm,af as Kn,bf as Ln,cf as Mn,df as Nn,ef as Sn,ff as Tn,gf as Un,hf as Vn}from"./chunk-a9fxxwrv.js";import{if as jk,jf as kk,kf as lk,lf as mk,mf as nk,nf as ok,of as pk,pf as qk,qf as rk,rf as sk,sf as tk,tf as uk,uf as vk,vf as wk,wf as xk}from"./chunk-ps20v1ah.js";import{Af as Rk,Bf as Sk,Cf as Tk,Df as Uk,Ef as Vk,Ff as Wk,Gf as Xk,Hf as Yk,If as Zk,xf as Ok,yf as Pk,zf as Qk}from"./chunk-fcfphfpw.js";import{Jf as mo,Kf as no,Lf as oo,Mf as po,Nf as qo,Of as ro}from"./chunk-1t9g3mhg.js";import{Pf as Dn,Qf as En}from"./chunk-mjpqz66q.js";import{Rf as cm,Sf as dm,Tf as em,Uf as fm,Vf as im,Wf as mm}from"./chunk-hv5v6vc2.js";import{$f as Pl,Xf as Ll,Yf as Ml,Zf as Nl,_f as Ol,ag as Ql,bg as Rl,cg as Sl,dg as Tl,eg as Ul,fg as Vl,gg as Wl,hg as Xl,ig as Yl,jg as Zl,kg as jm,lg as km,mg as lm}from"./chunk-34qkshwh.js";import{ng as gm,qg as hm}from"./chunk-rjqfa3g8.js";import{Ag as Dm,Bg as Em,Cg as Fm,Dg as Gm,Eg as Hm,Fg as Im,Gg as Jm,Hg as Km,Ig as Lm,Jg as Mm,yg as Bm,zg as Cm}from"./chunk-8bxtvsgm.js";import{Kg as Mk,Lg as Nk}from"./chunk-vvqe2gaz.js";import{Mg as nm}from"./chunk-hqh7x9h5.js";import{Ng as Ch,Og as Dh,Pg as Eh,Qg as Fh,Rg as Gh,Sg as Hh}from"./chunk-bphx7ngb.js";import{$g as $i,Tg as Wi,Ug as Xi,Vg as Yi,Zg as Zi,_g as _i}from"./chunk-5yp3vt00.js";import{ah as fj,bh as gj,ch as hj,dh as ij,eh as jj,fh as kj,gh as lj,hh as mj,ih as nj,jh as oj,kh as pj}from"./chunk-5zcg61j9.js";import{lh as Mi,mh as Ni,nh as Oi,oh as Pi,ph as Qi,rh as Ri,sh as Si,th as Ti,uh as Ui,vh as Vi}from"./chunk-k78gvm0g.js";import{wh as Hj,yh as Ij}from"./chunk-hmf9z4jx.js";import{Eh as yk,Fh as zk,Gh as Ak,Hh as Bk,Ih as Ck,Jh as Dk,Kh as Ek,Mh as Fk,Nh as Gk,Oh as Hk,Ph as Ik,Qh as Jk,Rh as Kk,Uh as Lk}from"./chunk-d0f60jrg.js";import{$h as jh,Vh as dh,Wh as eh,Xh as fh,Yh as gh,Zh as hh,_h as ih,ai as kh,bi as lh,ci as mh,di as nh,ei as oh,fi as ph,gi as qh}from"./chunk-mywp77gt.js";import{ii as rh,ji as sh,ki as th,li as uh}from"./chunk-nmkra8q5.js";import{qi as vh}from"./chunk-k0y7ta0d.js";import{ri as zg}from"./chunk-a668m28h.js";import{si as Ag,ti as Bg}from"./chunk-ynt7y2n5.js";import{ui as Cg,vi as Dg,wi as Eg,xi as Fg,yi as Gg,zi as Hg}from"./chunk-wvq1g6gr.js";import{Ai as Ig,Bi as Jg,Ci as Kg,Di as Lg,Ei as Mg}from"./chunk-wyxw61az.js";import{Fi as Ng,Gi as Og,Hi as Pg,Ii as Qg,Ji as Rg}from"./chunk-k70fgb2f.js";import{Ki as Sg,Li as Tg,Mi as Ug,Ni as Vg,Oi as Wg,Pi as Xg,Qi as Yg}from"./chunk-4vpsvh6x.js";import{Ri as Zg,Si as _g,Ti as $g,Ui as ah,Vi as bh,Wi as ch}from"./chunk-jem20v5k.js";import{Yi as wg,Zi as xg}from"./chunk-1g6pvs7k.js";import{aj as yg}from"./chunk-e63a220e.js";import"./chunk-efr3ejqt.js";import{ej as ke,fj as le,gj as me,hj as ne,ij as oe,jj as pe,kj as qe,lj as re,mj as se,nj as te,oj as ue,pj as ve,qj as we,rj as xe}from"./chunk-3p0n9ryv.js";import{sj as Ye,tj as Ze}from"./chunk-9veqmqb6.js";import{Aj as Ke,Bj as Le,Cj as Me,Dj as Ne,Ej as Oe,Fj as Pe,Gj as Qe,Hj as Re,Ij as Se,Jj as Te,Kj as Ue,Lj as Ve,Mj as We,Nj as Xe}from"./chunk-fed3xsp9.js";import{Oj as _e,Pj as $e,Qj as af,Rj as bf,Sj as cf,Tj as df,Uj as ef,Vj as ff,Wj as gf,Xj as hf,Yj as jf}from"./chunk-jyc9eha6.js";import{qk as Vq,rk as Wq,sk as Xq,tk as Yq,uk as Zq,vk as _q}from"./chunk-ee2tfpec.js";import{Ak as _l,Bk as $l,Ck as am,Dk as bm,wk as $j,xk as ak,yk as bk,zk as ck}from"./chunk-1e83cj7k.js";import"./chunk-58f0mthg.js";import"./chunk-kws4rewx.js";import{$l as bc,$m as ed,$n as Ie,$o as Qf,$p as Wh,$q as Ej,Al as La,Am as Gc,An as Fd,Ao as pf,Ap as pg,Aq as Ei,Bl as Ma,Bm as Hc,Bn as Gd,Bo as qf,Bp as qg,Bq as Fi,Cl as Na,Cm as Ic,Cn as Hd,Co as rf,Cp as rg,Cq as Gi,Dl as Oa,Dm as Jc,Dn as Yd,Do as sf,Dp as sg,Dq as Hi,El as ib,Em as Kc,En as Zd,Eo as tf,Ep as tg,Eq as Ii,Fl as jb,Fm as Lc,Fn as _d,Fo as uf,Fp as ug,Fq as Ji,Gl as kb,Gn as $d,Go as vf,Gp as vg,Gq as Ki,Hl as lb,Hm as Mc,Hn as ae,Ho as wf,Hp as wh,Hq as Li,Il as mb,Im as Nc,In as be,Io as xf,Ip as xh,Iq as aj,Jl as nb,Jm as Oc,Jn as ce,Jo as yf,Jp as yh,Jq as bj,Km as Pc,Kn as de,Ko as zf,Kp as zh,Kq as cj,Lm as Qc,Ln as ee,Lo as Af,Lp as Ah,Lq as dj,Ml as Fb,Mm as Rc,Mn as fe,Mo as Bf,Mp as Bh,Mq as ej,Nl as Gb,Nm as Sc,Nn as ge,No as Cf,Np as Ih,Nq as qj,Ol as Hb,Om as Tc,On as he,Oo as Df,Op as Jh,Oq as rj,Pl as Ib,Pm as Uc,Pn as ie,Po as Ef,Pp as Kh,Pq as sj,Ql as Jb,Qm as Vc,Qn as je,Qo as Ff,Qp as Lh,Qq as tj,Rl as Nb,Rm as Wc,Ro as Gf,Rp as Mh,Rq as uj,Sl as Ob,Sm as Xc,Sn as Be,So as Hf,Sp as Nh,Sq as vj,Tl as Pb,Tm as Yc,Tn as Ce,To as If,Tp as Oh,Tq as wj,Ul as Wb,Um as Zc,Un as De,Uo as Jf,Up as Ph,Uq as xj,Vl as Xb,Vm as _c,Vn as Ee,Vo as Kf,Vp as Qh,Vq as yj,Wl as Yb,Wm as $c,Wn as Fe,Wo as Lf,Wp as Rh,Wq as zj,Xl as Zb,Xm as ad,Xn as Ge,Xo as Mf,Xp as Sh,Xq as Aj,Yl as _b,Ym as bd,Yn as He,Yo as Nf,Yp as Th,Yq as Bj,Zl as $b,Zm as cd,Zo as Of,Zp as Uh,Zq as Cj,_l as ac,_m as dd,_o as Pf,_p as Vh,_q as Dj,am as cc,an as fd,ao as Je,ap as Rf,aq as Xh,ar as Fj,bm as dc,bn as gd,bp as Sf,bq as Yh,br as Gj,cm as ec,cn as hd,co as kf,cp as Tf,cq as gi,cr as Jj,dm as fc,dn as id,dp as Uf,dq as hi,dr as Kj,em as gc,en as jd,ep as Vf,eq as ii,er as Lj,fm as hc,fn as kd,fp as Wf,fq as ji,fr as Mj,gm as ic,gn as ld,gp as Xf,gq as ki,gr as Nj,hm as jc,hn as md,hp as Yf,hq as li,hr as Oj,in as nd,ip as Zf,iq as mi,ir as Pj,jn as od,jp as _f,jq as ni,jr as Qj,km as kc,kn as pd,kp as $f,kq as oi,kr as Rj,lm as lc,ln as qd,lp as ag,lq as pi,ml as xa,mm as mc,mn as rd,mp as bg,mq as qi,nl as ya,nm as nc,nn as sd,np as cg,nq as ri,ol as za,om as oc,on as td,op as dg,oq as si,pl as Aa,pm as pc,pn as ud,pp as eg,pq as ti,ql as Ba,qm as qc,qn as vd,qp as fg,qq as ui,rl as Ca,rm as rc,rn as wd,rp as gg,rq as vi,sl as Da,sm as sc,sn as xd,sp as hg,sq as wi,tl as Ea,tm as tc,tn as yd,tp as ig,tq as xi,ul as Fa,um as uc,un as zd,uo as lf,up as jg,uq as yi,vl as Ga,vm as vc,vn as Ad,vp as kg,vq as zi,wl as Ha,wm as wc,wn as Bd,wo as mf,wp as lg,wq as Ai,xl as Ia,xm as xc,xn as Cd,xp as mg,xq as Bi,yl as Ja,ym as yc,yn as Dd,yo as nf,yp as ng,yq as Ci,zl as Ka,zm as Fc,zn as Ed,zo as of,zp as og,zq as Di}from"./chunk-qj2s3r1w.js";import{Ar as q,As as ka,Br as r,Bs as la,Cr as s,Cs as ma,Dr as t,Ds as na,Er as u,Es as oa,Fr as v,Fs as pa,Gr as w,Gs as qa,Hr as x,Hs as ra,Ir as y,Is as sa,Jr as z,Js as ta,Kr as A,Ks as ua,Lr as B,Ls as va,Mr as C,Ms as wa,Nr as D,Or as E,Pr as F,Qr as G,Rr as H,Sr as I,Tr as J,Ur as K,Vr as L,cs as M,ds as N,es as O,fs as P,gs as Q,hs as R,is as S,js as T,ks as U,lr as b,ls as V,mr as c,ms as W,nr as d,ns as X,or as e,os as Y,pr as f,ps as Z,qr as g,qs as _,rr as h,rs as $,sr as i,ss as aa,tr as j,ts as ba,ur as k,us as ca,vr as l,vs as da,wr as m,ws as ea,xr as n,xs as fa,yr as o,ys as ia,zr as p,zs as ja}from"./chunk-ymc99r5x.js";import{Ns as Zh,Os as _h,Ps as $h,Qs as ai,Rs as bi,Ss as ci,Ts as di,Us as ei,Vs as fi}from"./chunk-dcxtrqfy.js";import{Ws as ga,Xs as ha}from"./chunk-jj6yp7gm.js";import{Ys as Kb,Zs as Lb,_s as Mb}from"./chunk-qjkzpd68.js";import{$s as ye,at as ze,bt as Ae}from"./chunk-t5c7rk0h.js";import{kt as zc,lt as Ac,nt as Bc,wt as Cc,xt as Dc,yt as Ec}from"./chunk-72c7gyqc.js";import{At as Rb,Bt as Sb,Ct as Tb,Dt as Ub,Et as Vb,zt as Qb}from"./chunk-fv923f7g.js";import{Ft as Id,Gt as Jd,Ht as Kd,It as Ld,Jt as Md,Kt as Nd,Lt as Od,Mt as Pd,Nt as Qd,Ot as Rd,Pt as Sd,Qt as Td,Rt as Ud,St as Vd,Tt as Wd,Ut as Xd}from"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import{$t as pb,_t as ob,au as qb,bu as rb,cu as sb,du as tb,eu as ub,fu as vb,gu as wb,hu as xb,iu as yb,ju as zb,ku as Ab,lu as Bb,mu as Cb,nu as Db,ou as Eb}from"./chunk-h7v70dbp.js";import{Bu as Sa,Cu as Ta,Iu as Ua,Ju as Va,Ku as Wa,Lu as Xa,Mu as Ya,Nu as Za,Ou as _a,Pu as $a,Qu as ab,Ru as bb,Su as cb,Tu as db,Uu as eb,Vu as fb,Wu as gb,Yu as hb,su as Pa,tu as Qa,wu as Ra}from"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{tk as writeNetlifyConfig,km as writeManifest,Yk as writeImageManifest,Bo as wrapComponentForHMR,vr as withDefaults,Gj as webComponentDirectiveHandler,qp as watermark,sq as watchViews,gl as watchMultiple,hl as watchEffect,fl as watch,Fe as warmImagePlaceholders,ul as waitForStore,X as waitForLocale,no as virtualPathFor,tj as videoDirective,G as validators,zr as validated,he as validateValueEnhanced,xh as validateTemplate,vp as validateParams,ie as validateFormEnhanced,hq as validateFile,de as validateFields,ce as validateField,zh as validateDirective,Cd as validateCspDirectives,Oj as validateConfig,pm as validateComponentScripts,Nm as validateComponentProps,vg as validateClientScript,uh as v,rc as usesSignalsInScript,ub as usesReactiveRuntime,Mh as userComponentFileExists,ah as useVirtualList,Qd as useTitle,tl as useStoreOrThrow,To as useStore,dk as useStorage,Dq as useSlots,fk as useSessionStorage,Nd as useSeoMeta,vl as useRouteParams,xl as useRouteParamOrThrow,wl as useRouteParam,Qd as usePageTitle,Xe as useOptimistic,zl as useMiddlewareValue,yl as useMiddlewareState,ek as useLocalStorage,uo as useLoadingIndicator,Ld as useHead,rh as useForm,Fq as useAttrs,jq as uploadFiles,iq as uploadFile,ql as updateInstance,Ve as untrack,ai as unregisterDirective,rl as unmountInstance,yc as unescapeHtml,qo as typecheckStxFiles,Lh as transpileTypeScript,ir as translate,Ba as transitionDirective,_b as transformAutoImports,Hm as toUsers,Gm as toUser,$o as thumbnail,aq as thumbHashToRGBA,bq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,_e as templateCache,Uc as syncRecordedResponse,yo as stxClientHelpers,Ff as structuredDataDirective,lr as stripLocalePrefix,Xl as stripDocumentWrapper,Lb as stripCommentsAndLiterals,tn as stringToStream,qd as strictCspPreset,se as streamingSuspenseDirective,we as streamToResponse,qe as streamTemplateSimple,ke as streamTemplate,_j as stopHmrServer,Dm as stopBroadcasting,Tb as stateDirName,Ub as stateDir,Ke as state,pg as startsDocument,Vn as startProductionServer,Jn as startInteractive,Cm as startBroadcasting,nr as stampLocaleLayoutGroup,Ia as staggerDirective,tp as srcsetUrls,Ja as springDirective,$c as splitByPipe,Tl as spaNavVaryHeaders,oo as sourcePathFor,Ap as smartBatchSign,Oh as slotContentHasExpressions,yp as signUrl,Jh as shouldTranspileTypeScript,Xj as shouldReloadOnChange,Dp as shouldRefreshSignature,Yj as shouldIgnoreFile,Ug as shouldCacheComponent,dp as sharpen,Cr as shape,Sb as setStateDir,Dl as setRouteParams,El as setMiddlewareState,Ee as setImagePlaceholder,xq as setGlobalProvide,b as setErrorLocale,_k as setCurrentInstance,hj as setCachedVideoResult,Yi as setCachedImageResult,Si as setCached,Fr as serveStxFile,Hr as serveMultipleStxFiles,Sj as serveMarkdownFile,eo as serveFile,Ir as serveApp,co as serve,Eo as serializeState,jn as serializeSetCookie,fp as sepia,Od as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,xj as scopeHTML,wj as scopeCSS,If as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,jp as saturation,wp as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,yf as runPreProcessingMiddleware,zf as runPostProcessingMiddleware,Mn as runPageAction,Qe as runMountCallbacks,gb as runMiddleware,ol as runHooks,br as runDoctor,Re as runDestroyCallbacks,Nf as runComposers,kp as rotate,vh as rewriteImagesWithSiblings,Vc as responseBindings,Sh as resolveTemplatePath,ha as resolveStxTargets,Kj as resolveStxDirectories,hr as resolveI18n,Zo as resize,ec as resetPlaceholders,Kd as resetHead,Do as resetHMRHandler,o as resetErrorConfig,xr as required,ic as replacePlaceholders,qq as renderView,qj as renderVideoComponent,Xb as renderVendorStyleTags,Mq as renderToString,Nq as renderToStream,Oq as renderToDOM,$p as renderThumbhashToCanvas,_q as renderTemplateString,Yq as renderTemplate,Zq as renderString,ne as renderStreamingPage,Eh as renderSlot,Kg as renderSSRSuspense,Lp as renderProtectedVideo,Kp as renderProtectedImg,xp as renderMediaUpload,Xq as renderMarkdownView,am as renderLayoutTypes,aj as renderImgComponent,Ok as renderImageComponent,Sd as renderHtmlAttrs,Rd as renderHead,tq as renderEmail,Qh as renderComponentWithSlot,Td as renderBodyAttrs,Oo as render,sd as relaxedCspPreset,be as registerValidationRule,ue as registerStreamingDirectives,Vo as registerStoresClient,Bl as registerStore,Gf as registerSeoDirectives,_a as registerMiddleware,mc as registerFilters,lc as registerFilter,d as registerErrorMessages,ge as registerEnhancedValidationRule,Zh as registerDirective,Bd as registerCspDirectives,Qm as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,cl as ref,Bn as redirect,Qc as recordResponseStatus,Rc as recordResponseHeader,Vb as rebaseOntoStateDir,Sc as readResponseStatus,Tc as readResponseHeaders,Qj as readMarkdownFile,$e as readFileCached,dl as reactive,op as quality,Ip as pruneSignatureCache,Vi as pruneCache,vq as provide,Wq as protectCodeBlocks,wr as prop,Qf as processVueTemplate,_g as processVirtualListDirectives,ch as processVirtualGridDirectives,pj as processVideo,ee as processValidateDirective,ea as processTranslateDirective,Eg as processTransitionDirectives,Hg as processTransitionAttributes,Wd as processTitleDirective,Ic as processTemplateBindings,Ag as processTeleportDirectives,Ig as processSuspenseDirectives,Bf as processStructuredData,oe as processStreamDirectives,Wc as processStatusDirective,ph as processStaticDirectives,wf as processStackReplacements,vf as processStackPushDirectives,Fh as processSlots,Vl as processShell,He as processServerBindings,Cf as processSeoDirective,ve as processSectionDirectives,Tf as processScopedStyles,Gc as processReactiveBindings,Mp as processProtectedMedia,ih as processPartialHydrationDirectives,ug as processOnceDirective,xf as processMiddleware,Af as processMetaDirectives,Xd as processMetaDirective,Rj as processMarkdownFileDirectives,Xh as processMarkdownDirectives,qf as processLoops,Sg as processKeepAliveDirectives,tg as processJsonDirective,bh as processInfiniteListDirectives,uf as processIncludes,cj as processImgComponents,Qk as processImageComponents,Dk as processImage,Vd as processHeadDirective,Zd as processForms,$d as processFormInputDirectives,vc as processExpressions,Ib as processEventDirectives,ae as processErrorDirective,Rf as processDynamicComponents,wh as processDirectives,fi as processDirectiveAttributes,zg as processDeferDirectives,Gd as processCustomDirectives,yd as processCspDirectives,Dr as processComponentProps,dc as processClientScript,_d as processBasicFormDirectives,Ng as processAsyncDirectives,Hd as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ae as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,to as preloadIslandHandlers,Ge as preloadIconCollection,ym as poolStrings,Ij as pluginManager,Ce as placeholdersWarmed,Dg as performLeave,Cg as performEnter,Se as pendingLifecycleCounts,We as peek,rf as partialsCache,rj as parseVideoDirectiveOptions,Xo as parseUrl,cq as parseThumbhashString,fd as parseSwitchBlock,Ch as parseSlots,Dh as parseSlotElement,kd as parseScriptDeclarations,Ej as parseSFCComponent,Np as parseProtectedArgs,pf as parseLoopBinding,bj as parseImgComponent,ti as parseImageUrl,Pk as parseImageComponent,Kn as parseFormBody,hd as parseExpressionWithFilters,Rm as parseDefaults,yn as parseCookies,Nl as parseContainerSelector,cd as parseConditionalBlock,id as parseArguments,Ma as parseAnimationShorthand,yr as optional,zm as optimizeTemplate,Vk as optimizeImage,Wk as optimizeDirectory,Ar as oneOf,sf as onceStore,ll as onUpdated,Fc as onUpdate,nl as onUnmounted,Il as onServer,jl as onMounted,Oe as onMount,oh as onHydrated,Bq as onErrorCaptured,Pe as onDestroy,Yg as onDeactivated,Hl as onClient,kl as onBeforeUpdate,ml as onBeforeUnmount,il as onBeforeMount,Xg as onActivated,Xp as observeElement,Cn as notFound,Yf as normalizeCriticalHeadOrder,Aq as nextTick,Um as negotiateEncoding,Ua as navigateTo,pl as mountInstance,Ea as motionDirective,rd as moderateCspPreset,xm as minifyHtml,Ef as metaDirective,hg as metaDedupKey,Yo as mergeParams,jg as mergeHtmlAttrs,Md as mergeHeadConfigs,Ac as mergeCssConfig,vd as mergeCspDirectives,Ra as matchRoute,Yh as markdownDirectiveHandler,Pj as markdownCache,ga as looksLikeGlob,kr as localizePath,U as loadTranslationLazy,_ as loadTranslation,Lj as loadStxConfig,db as loadMiddlewareFromDirectory,lm as loadManifest,Tp as loadElement,Em as loadChannels,rr as lintStxStrict,Vp as lazyLoadAll,Up as lazyLoad,Ha as keyframeDirective,Kq as jsxs,Lq as jsxDEV,Jq as jsx,An as jsonResponse,te as islandDirective,l as isTest,Yl as isSpaNavigation,Rl as isSpaNavRequest,Bp as isSignatureValid,Te as isSignal,Bk as isSharpAvailable,mn as isServerEnvironment,Fl as isServer,yb as isRuntimeOwnedColonAttr,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Qp as isNativeLazySupported,Vq as isMarkdownPath,Q as isLoading,R as isLoaded,Ih as isJavaScriptScript,Rp as isIntersectionObserverSupported,Jk as isImageFile,Ck as isImageBackendAvailable,aa as isICUFormat,nh as isHydrated,Nh as isHydrateTrigger,Oc as isHttpStatus,ln as isEdgeEnvironment,sr as isDirectiveKind,k as isDevelopment,Ue as isDerived,Wj as isCssOnlyChange,Tm as isCompressible,Gl as isClient,Pg as isAsyncComponent,Ln as isActionableMethod,gp as invert,bf as invalidateFileCacheByDir,af as invalidateFileCache,uc as interpolateScriptsInTemplate,sc as interpolateScriptExpressions,tc as interpolateScriptAttributes,x as inlineError,gr as injectThemeBootstrap,Df as injectSeoTags,dr as injectSeo,kf as injectRouterScript,Vj as injectHotReload,kb as injectHeatmap,Ec as injectCss,wd as injectCspMetaTag,rg as injectConfigHeadTags,Xf as injectColorModeBootScript,lg as injectCloakStyle,cg as injectBuildId,Zb as injectBrowserCoreAutoImports,Kc as injectAnalytics,wq as inject,Al as initStoreRegistry,wk as initNetlify,vo as initLoadingIndicator,Sp as initLazyLoading,In as initFile,_p as initBlurUp,eq as initAllBlurUp,ej as imgDirective,Tk as imageDirective,Tn as hydrateTemplateStream,Sn as hydrateTemplate,so as hydrateIslands,kh as hydrateIsland,Un as hydrateFragment,lh as hydrateByStrategy,mh as hydrateAll,Lo as hydrate,bo as htmlResponse,ng as hoistLeadingHeadTags,Zf as hoistColorModeBootScript,lb as heatmapDirective,Oi as hashString,jf as hashFilePath,Mi as hashFile,Ni as hashBuffer,Pf as hasVueTemplateSyntax,of as hasVariables,Qo as hasStore,jc as hasPlaceholders,uk as hasNetlifyConfig,ab as hasMiddleware,Jb as hasEventDirectives,qg as hasDocumentShell,Ah as hasDirectives,ma as hasDOMSupport,Mk as handleImageRequest,Cq as handleError,Sq as h,Ik as groupVariantsByFormat,ep as grayscale,Wn as gitHash,rm as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,pk as getTotalSize,Cp as getTimeUntilExpiry,wg as getStoreScript,Ro as getStoreNames,Po as getStore,ik as getStorageSize,hk as getStorageKeys,Th as getSourceLineInfo,Kh as getSharedTranspiler,la as getScreenReaderOnlyStyle,yj as getScopeAttribute,Je as getRouteParams,Ob as getPublicEnvDefine,Pb as getPublicEnv,yh as getPositionInfo,gc as getPlaceholderRegistry,Li as getPlaceholderCacheStats,Jd as getPageMeta,md as getNonce,Kk as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,Be as getImagePlaceholder,Ek as getImageMetadata,ye as getImageDelivery,Ko as getHydrationRuntime,Cl as getHydratedStoreState,Zj as getHmrServer,Id as getHead,Co as getHMRHandler,xi as getFormatExtension,Qi as getFileMtime,Hk as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,$h as getDirectives,_h as getDirective,$k as getCurrentInstance,Bc as getCssServeAsset,ud as getCspPreset,Dd as getCspHeaderName,Wh as getComponentCacheStats,gj as getCachedVideoResult,Gp as getCachedSignature,df as getCachedSignalsRuntime,ef as getCachedRouterScript,Ji as getCachedPlaceholder,Xi as getCachedImageResult,Ri as getCached,Ui as getCacheStats,ag as getBuildId,Bm as getBroadcastServer,wi as getBestVariant,nc as getAllFilters,ki as generateWidthSrcset,$g as generateVirtualListCSS,lq as generateVideoPreview,je as generateValidationScript,mq as generateUploadRuntime,sm as generateTreeShakenBundle,Gg as generateTransitionRuntime,Fg as generateTransitionCSS,kj as generateThumbnails,Ci as generateThumbhashPlaceholder,bn as generateTemplatesDocs,Mg as generateSuspenseRuntime,Lg as generateSuspenseCSS,Fo as generateStateScript,ui as generateSrcsetData,$i as generateSrcset,Fk as generateSrcSet,lj as generateSpriteSheet,uq as generateSpaShell,vi as generateSourceTags,qi as generateSizesFromBreakpoints,pi as generateSizesAttribute,Gk as generateSizes,Hf as generateSitemapIndex,er as generateSitemap,Pp as generateSimpleMediaPicker,Jp as generateSignatureRuntime,Ze as generateSignalsRuntimeDev,Ye as generateSignalsRuntime,cc as generateServerDataBridge,vj as generateScopeId,Fj as generateSFCWebComponent,Gb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,Jf as generateRobotsTxt,fr as generateRobots,_i as generateResponsiveVariants,Bj as generateReactiveWebComponentTS,Aj as generateReactiveWebComponent,Dj as generateReactiveRuntime,Cj as generateReactiveMixin,jj as generatePoster,Ii as generatePlaceholderStyle,Hi as generatePlaceholderCSS,Bi as generatePlaceholder,jh as generatePartialHydrationCSS,ld as generateNonce,qk as generateNetlifyToml,oq as generateMinifiedMediaRuntime,nq as generateMediaRuntime,Op as generateMediaManagerEmbed,jm as generateManifest,xo as generateLoadingIndicatorHtml,Zp as generateLazyLoadRuntime,bm as generateLayoutTypes,Ei as generateLQIP,Wg as generateKeepAliveRuntime,Vg as generateKeepAliveCSS,qh as generateIslandManifest,kq as generateImagePreview,Xk as generateImageManifest,Jo as generateHydrationScript,xe as generateHydrationRuntime,Mo as generateHydrationCSS,dh as generateHydrationBootstrap,Uj as generateHotReloadScript,jb as generateHeatmapScript,Ao as generateHMRClientScript,mj as generateHLSManifest,Go as generateEventBindings,oi as generateDprSrcsetWithVariableQuality,ni as generateDprSrcset,og as generateDocumentShell,gn as generateDocs,cn as generateDirectivesDocs,ei as generateDirectiveRuntime,Kf as generateDefaultRobotsTxt,nj as generateDASHManifest,Dc as generateCss,pd as generateCspMetaTag,od as generateCspHeader,Hq as generateCompositionRuntime,an as generateComponentsDocs,eh as generateComponentManifest,_m as generateComponentDoc,Gi as generateColorPlaceholder,Wf as generateColorModeBootScript,sl as generateClientRuntime,Pi as generateCacheKey,ac as generateBrowserAutoImportDestructuring,fq as generateBlurUpRuntime,gq as generateBlurUpCSS,Hc as generateBindingsRuntime,li as generateAutoWidthSrcset,$b as generateAutoImportDestructuring,Rg as generateAsyncComponentRuntime,Qg as generateAsyncComponentCSS,Na as generateAnimationRuntime,La as generateAnimationCSS,Jc as generateAnalyticsScript,ro as formatTypecheckDiagnostics,lo as formatTypeErrors,Fn as formatStxContent,ok as formatSize,Ta as formatRoutes,Gn as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,cr as formatDoctorReport,dn as formatDocsAsMarkdown,fn as formatDocsAsJson,en as formatDocsAsHtml,np as format,wm as foldConstants,mp as flipVertical,lp as flipHorizontal,cm as fingerprint,po as findRuntimeTypeDeclarations,ar as findPantryPackage,bd as findMatchingEndTag,Zc as findMatchingDelimiter,Kb as findInterpolationEnd,dd as findIfBlocks,gd as findExpressions,Sa as findErrorPage,ed as findDirectiveBlocks,tm as findDeadCode,tm as findDeadBranches,Ol as findContainerRegion,$m as findComponentFiles,Gr as findCommonDir,nk as filterRequiredFiles,Rh as fileExists,lf as extractVariables,hm as extractTemplateExpressions,pe as extractStreamBoundaries,Ho as extractState,Gh as extractSlotContent,nf as extractScriptFromTemplate,gm as extractScriptBlocks,hc as extractPlaceholders,ad as extractParenthesizedExpression,Pc as extractPageResponseStatus,hb as extractLayoutMetadata,Fi as extractDominantColor,jd as extractDirectiveParams,Bh as extractDirectiveNames,Zl as extractContainerContent,Ym as extractComponentProps,fh as extractComponentName,Zm as extractComponentDescription,Cc as extractClassNames,bc as extractBridgeData,gh as extractBoundProps,_c as extractBalancedExpression,Wb as extractAndStripCssImports,zj as extractAndScopeStyles,Hb as extractAndProcessEvents,bk as externalizeSharedAssets,ck as externalizeRepeatedAssets,ak as externalizeHtml,xc as evaluateExpression,vm as evaluateConstant,Xc as evaluateAuthExpression,qc as escapeHtmlValue,pc as escapeHtml,C as errorRecovery,E as errorLogger,Bg as ensureTeleportTargets,sg as ensureDocumentShell,fe as enhancedValidationRules,Wm as enableDevTools,um as eliminateDeadCode,Me as effect,up as dprUrls,hn as docsCommand,$l as discoverLayoutNames,Yp as disconnectObserver,Xm as disableDevTools,F as devHelpers,Ul as detectShell,kn as detectRuntime,rk as detectProjectConfig,yi as detectFormat,om as detectBuildMode,Le as derived,vk as deploy,Nj as defineStxConfig,Uo as defineStore,Eq as defineSlots,qr as defineSiteConfig,ur as definePropsWithValidation,tr as defineProps,Hj as definePlugin,Pd as definePageMeta,Wa as defineMiddleware,sh as defineForm,zq as defineExpose,yq as defineEmits,bi as defineDirective,Uq as defineCustomElement,Rn as defineConfig,ci as defineClientDirective,Og as defineAsyncComponent,pq as defaultMediaConfig,Zk as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,Yd as defaultFormClasses,kc as defaultFilters,Fd as defaultCspConfig,Jj as defaultConfig,Er as default,zc as deepMergeThemes,Sf as dedupeScopedStyles,Di as decodeThumbhash,Ad as cspNonceDirective,zd as cspDirective,dq as crossfadeTransition,_o as crop,Zg as createVirtualList,sj as createVideoDirective,wn as createVercelHandler,io as createTypeChecker,fa as createTranslateFilter,sn as createTextEncoderStream,Tq as createStxApp,rn as createStreamingResponse,re as createStreamRenderer,So as createStore,Za as createStorageManager,Xa as createServerCookieManager,bl as createScope,Jg as createSSRSuspense,Ie as createRouter,eb as createRouteLocation,go as createRoute,cl as createRef,dl as createReactive,Gq as createProvideContext,Yn as createProject,Qn as createProductionBuild,fc as createPlaceholder,Am as createOptimizedBuild,xn as createNetlifyHandler,jk as createNetlifyClient,fb as createMiddlewareContext,fo as createMiddleware,Wp as createLazyObserver,Tg as createKeepAliveCache,on as createKVNamespace,hh as createIslandRegistry,dj as createImgDirective,Uk as createImagePlugin,Nk as createImageHandler,Sk as createImageDirective,nb as createHeatmapAggregator,mk as createFileManifest,nn as createEnvAccessor,z as createEnhancedError,qn as createEdgeHandler,pn as createEdgeCache,Uh as createDetailedErrorMessage,vn as createDenoHandler,sk as createDefaultNetlifyConfig,Ed as createCspHeaders,zn as createCookie,el as createComputed,al as createComponentInstance,un as createCloudflareHandler,Ya as createClientCookieManager,di as createBuiltinDirectives,Tq as createApp,Ka as createAnimationTimeline,bp as cover,mf as convertToCommonJS,ip as contrast,ap as contain,y as consoleError,m as configureErrorHandling,Mj as config,el as computed,Vm as compressResponse,Mf as composerPattern,Lf as composer,Wl as composeShellWithPage,Pm as componentDirective,Ph as componentClientSignalNames,im as compileTemplate,a as collectRepeatedFlag,lk as collectDeployFiles,mg as cloakStyleFragment,ij as clearVideoCache,N as clearTranslationCache,xg as clearStoreCache,gk as clearStorage,Hp as clearSignatureCache,Ki as clearPlaceholderCache,tf as clearOnceStore,nd as clearNonce,bb as clearMiddleware,De as clearImagePlaceholders,ze as clearImageDeliveryCatalog,Rk as clearImageCache,e as clearErrorMessages,ff as clearDevCaches,oc as clearCustomFilters,Of as clearComposers,yg as clearComposableCache,Vh as clearComponentCache,Ti as clearCache,Db as clearBlankCache,wo as cleanupLoadingIndicator,Ll as classifyScript,Ml as classifyAllScripts,jo as checkTemplateFile,ko as checkTemplate,gf as checkCache,Ep as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Km as channel,En as captureScreenshots,Dn as captureScreenshot,Z as cancelPendingLoads,kk as calculateSha1,mi as calculateOptimalWidths,hf as cacheTemplate,uj as buildWebComponents,mo as buildVirtualSource,rq as buildViews,Wo as buildUrl,le as buildSuspenseResolveScript,pr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,dm as buildRuntimeAsset,em as buildRouterAsset,or as buildLangPickerScript,si as buildImageUrl,dg as buildIdFragment,ig as buildHtmlAttrs,mm as buildForProduction,Sm as buildComponentLibrary,Fp as buildAuthParams,nm as buildApp,mr as buildAlternateLinks,Pn as build,Im as broadcastPrivate,Jm as broadcastPresence,Fm as broadcast,hp as brightness,Mb as bracketDepths,cp as blur,Eb as blankInertHtmlRegions,zp as batchSignUrls,Ne as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,pp as auto,ja as attributeValue,fm as assetTags,Fb as asInvocableStatement,Br as arrayOf,jr as applyTranslations,Zi as applyTransformations,Hh as applySlots,Om as applyPropDefaults,sp as applyPreset,kg as applyHtmlAttrs,Ud as applyHead,wc as applyFilters,Sl as appendVary,td as apiCspPreset,Da as animationGroupDirective,oj as analyzeVideo,qm as analyzeUsage,Jl as analyzeTemplate,Kl as analyzeProject,qm as analyzeDirectiveUsage,Lc as analyticsDirective,$n as addStore,_n as addPage,xd as addNonceToInlineContent,ao as addLayout,Zn as addComponent,Nn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,cf as __setSignalsGeneratorsForTest,bg as __setBuildIdForTest,fj as VideoProcessorCache,th as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,Yc as Tokenizer,ho as TemplateTypeChecker,Hn as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,Pq as Show,me as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,Yb as STX_AUTO_IMPORTS,Rb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Pl as SPA_NAV_HEADER,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Mc as RESPONSE_STATUS_KEY,Nc as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,On as ProductionBuild,Rq as Portal,Xn as PROJECT_TEMPLATES,rp as PRESETS,sb as NON_CLIENT_PRIMITIVES,No as MemorySessionStore,ji as MIME_TYPES,gi as MEDIA_DEFAULT_WIDTHS,ii as MEDIA_DEFAULT_FORMATS,_l as LAYOUT_TYPES_FILE,Wi as ImageProcessorCache,Lk as ImageProcessingError,Io as HydrationRuntime,Tj as HotReloadServer,mb as HeatmapAggregator,gg as HTML_CLASS_MARKER,fg as HTML_ATTRS_MARKER,Iq as Fragment,Qq as For,Ql as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,$j as EXTERNALIZED_ASSET_DIR,xk as DeployError,yk as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Qb as DEFAULT_STATE_DIR,Ak as DEFAULT_QUALITY,zi as DEFAULT_PLACEHOLDER_OPTIONS,zk as DEFAULT_FORMATS,hi as DEFAULT_DPR_VALUES,zo as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,ri as COMMON_SIZES,Uf as COLOR_MODE_BOOT_MARKER,Vf as COLOR_MODE_BOOT_GLOBAL,eg as CLOAK_STYLE,Mm as BroadcastServer,Lm as Broadcast,_f as BUILD_ID_META,$f as BUILD_ID_HEADER,Nb as BROWSER_CORE_IMPORTS,Ai as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,$q as $path};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hf as a}from"./chunk-a9fxxwrv.js";import"./chunk-34qkshwh.js";import"./chunk-qj2s3r1w.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-t5c7rk0h.js";import"./chunk-72c7gyqc.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{a as startProductionServer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$e as K5,_e as _$}from"./chunk-a9fxxwrv.js";import{Yf as y7,ag as U$,bg as q6,dg as Z1,eg as y6,fg as Q5,gg as B$,hg as L$,ig as v6,jg as g6}from"./chunk-34qkshwh.js";import{Aj as p5,Cj as c5,vj as u1,wj as O1,xj as H1,yj as m$,zj as p$}from"./chunk-fed3xsp9.js";import{Wj as Y$,Xj as J$}from"./chunk-jyc9eha6.js";import{yk as g5,zk as f5}from"./chunk-1e83cj7k.js";import{Fk as l7,Gk as i7}from"./chunk-58f0mthg.js";import{_k as Q1}from"./chunk-kws4rewx.js";import{$n as X5,Co as m0,Gm as x6,Hp as O0,Km as Z5,Nm as N1,Om as M1,Rn as Z$,Rq as G$,Vp as Q6,Wp as E1,_p as p0,bm as b7,bo as S6,co as z6,cr as E$,dp as g7,er as d0,fr as M0,jr as V0,kp as P6,lp as b6,pm as u0,uo as j0}from"./chunk-qj2s3r1w.js";import{Cr as s$,Er as n$,Hr as l1,Lr as o$,Or as Q$,Pr as F6,Zr as X6,rr as c1,ur as L6}from"./chunk-ymc99r5x.js";import{et as t$,mt as B,tt as W$,ut as K$,yt as o}from"./chunk-72c7gyqc.js";import{Dt as S0}from"./chunk-fv923f7g.js";import{Bu as V6,Cu as E6,Ru as R6,Su as I6,Tu as D6,Uu as w6,Vu as T6,Wu as C6,Yu as k6,av as A6,wu as $5,xu as H6}from"./chunk-drbbt69f.js";import{kv as p}from"./chunk-2vza9m2x.js";var l5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function e7($,X,Q={}){let{storage:Z="local",serializer:Y=l5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Q,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Z==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let H=L.getItem($);if(H===null)return X;let q=Y.read(H);if(J&&typeof X==="object"&&X!==null)return{...X,...q};return q}catch{return X}},F=(L)=>{let H=_();if(!H)return;try{if(L===null||L===void 0)H.removeItem($);else H.setItem($,Y.write(L))}catch(q){console.warn(`[useStorage] Failed to write key "${$}":`,q)}},z=U(),j=(L,H)=>{for(let q of W)try{q(L,H)}catch(A){console.error("[useStorage] Subscriber error:",A)}};if(K&&G){let L=(q)=>{if(q.key===$&&q.storageArea===_()){let A=z;try{z=q.newValue?Y.read(q.newValue):X}catch(N){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,N);return}j(z,A)}};window.addEventListener("storage",L);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",L))}let O={get value(){return z},set value(L){let H=z;z=L,F(L),j(L,H)},get:()=>z,set:(L)=>{O.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let H=z;z=X,j(X,H)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return O}function i5($,X,Q,Z,Y={}){let{serializer:J=l5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Z;try{let O=J.read(j);if(G&&typeof Z==="object"&&Z!==null)return{...Z,...O};return O}catch(O){return console.warn(`[${X}] Failed to read key "${Q}":`,O),Z}},z=p5((()=>{let j=_();if(!j)return Z;try{return U(j.getItem(Q))}catch(O){return console.warn(`[${X}] Cannot read "${Q}":`,O),Z}})());if(c5(()=>{let j=z(),O=_();if(!O)return;try{if(j===null||j===void 0)O.removeItem(Q);else O.setItem(Q,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Q}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Q)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",j))}return z}function $3($,X,Q){return i5("local","useLocalStorage",$,X,Q)}function X3($,X,Q){return i5("session","useSessionStorage",$,X,Q)}function Q3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function Z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function Y3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Q=0;for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))Q+=(Z.length+(X.getItem(Z)?.length||0))*2;return Q}var l=null;function d1($,X,Q=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Q.has($))return!0;if(Q.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!d1($[J],X[J],Q))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!d1(G,X.get(J),Q))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Z=Object.keys($),Y=Object.keys(X);if(Z.length!==Y.length)return!1;for(let J of Z){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!d1($[J],X[J],Q))return!1}return!0}function KJ($){l=$}function _J(){return l}function UJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:J3()}}function J3(){return{refs:new Map,effects:new Set,cleanups:[]}}function BJ($){let X=new Set,Q=new Set,Z=$,Y=Symbol("ref"),J={get value(){let G=u1();if(G)Q.add(G);return Z},set value(G){if(!Object.is(G,Z)){let W=Z;Z=G;for(let K of X)K(G,W);for(let K of Q)if(m$())p$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(l)l.scope.refs.set(Y,J);return J}var a5=new WeakMap;function G3($){let X=a5.get($);if(X)return X;let Q=new Map,Z=(G)=>{let W=Q.get(G);if(!W)return;for(let K of[...W])if(m$())p$(K);else K()},Y=(G,W)=>{if(!Q.has(G))Q.set(G,new Set);return Q.get(G).add(W),()=>{Q.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=u1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return G3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Z(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Z(W),K}});return a5.set($,J),J}function LJ($){let X,Q=!0,Z=new Set,Y=new Set,J=()=>{Q=!0,G()},G=()=>{if(Q){let K=X,_=O1(J);if(X=$(),H1(_),Q=!1,!Object.is(X,K)){for(let U of Z)U(X,K);for(let U of Y)U()}}},W=O1(J);return X=$(),Q=!1,H1(W),{get value(){let K=u1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Z.add(K),()=>{Z.delete(K)}}}}function W3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function FJ($,X,Q={}){let{immediate:Z=!1,deep:Y=!1,flush:J="post"}=Q,G,W,K=!1,_=()=>{if(K)return;let O=j();if((Y?!d1(O,G):!Object.is(O,G))||Z)if(X(O,G),Y&&O!==null&&typeof O==="object")try{G=structuredClone(O)}catch{G=O}else G=O},U=(O)=>{if(J==="sync")O();else if(J==="pre")Promise.resolve().then(O);else W3(O)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let O=O1(z);try{return $()}finally{H1(O)}}return $.value};if(typeof $!=="function"){let O=$.subscribe(()=>{U(_)});W=()=>{K=!0,O()}}else W=()=>{K=!0};if(G=j(),Z)U(_);if(l)l.scope.cleanups.push(()=>W?.());return()=>W?.()}function zJ($,X,Q={}){let Z=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Z.push(G)}if(Q.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Z)J()}}function jJ($){let X,Q=!1,Z=()=>{if(Q)return;if(X)X();let Y=O1(Z);X=$(),H1(Y)};if(Z(),l)l.scope.cleanups.push(()=>{if(Q=!0,X)X()});return()=>{if(Q=!0,X)X()}}function OJ($){if(l)l.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function HJ($){if(l)l.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function AJ($){if(l)l.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function qJ($){if(l)l.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function NJ($){if(l)l.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function MJ($){if(l)l.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function n0($,X){let Q=$.hooks[X];for(let Z of Q)await Z()}async function VJ($){await n0($,"beforeMount"),$.isMounted=!0,await n0($,"mounted")}async function EJ($){if(!$.isMounted||$.isUnmounted)return;await n0($,"beforeUpdate"),await n0($,"updated")}async function RJ($){if($.isUnmounted)return;await n0($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await n0($,"unmounted")}function IJ(){return`
|
|
3
3
|
<script data-stx-client-runtime>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -685,7 +685,7 @@ else {
|
|
|
685
685
|
<span class="frontmatter-label">${X}:</span>
|
|
686
686
|
<span>${Array.isArray(Q)?Q.join(", "):String(Q)}</span>
|
|
687
687
|
</div>`).join("")}
|
|
688
|
-
</div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-
|
|
688
|
+
</div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-n5y9gh1q.js");if(typeof $.openDevWindow!=="function")return null;return $}catch{return null}}async function t0($,X={}){let Q={...K4,...X},Z=await _4();if(!Z)return console.log(`${B.yellow}\u26A0${B.reset} Native window requested, but @stacksjs/desktop is not available.`),console.log(" Install & build the desktop package to enable --native."),!1;try{let Y=await Z.openDevWindow($,{title:Q.title,width:Q.width,height:Q.height,darkMode:Q.darkMode,hotReload:Q.hotReload,titlebarHidden:Q.titlebarHidden,nativeSidebar:Q.nativeSidebar,sidebarWidth:Q.sidebarWidth,sidebarConfig:Q.sidebarConfig});if(Y&&Q.nativeSidebar)console.log(`${B.green}\u2713${B.reset} Native sidebar enabled (macOS Tahoe style)`);return Y}catch(Y){return console.log(`${B.red}\u2717${B.reset} Could not open native window:`,Y),!1}}function o1($){if($.match(/<Sidebar[\s\S]*?variant=["'](?:tahoe|vibrancy|desktop)["'][\s\S]*?\/>/i)){let Y=$.match(/<script\s+server[^>]*>([\s\S]*?)<\/script>/i);if(Y){let J=Y[1];try{let G=`
|
|
689
689
|
${J}
|
|
690
690
|
return typeof sidebarConfig !== 'undefined' ? sidebarConfig : null;
|
|
691
691
|
`,K=Function(G)();if(K)return K}catch(G){console.warn("Invalid sidebarConfig:",G)}}return{sections:[]}}let Q=$.match(/@nativeSidebar\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(Q)try{return JSON.parse(Q[1])}catch{console.warn("Invalid @nativeSidebar configuration")}let Z=$.match(/<script\s+native-sidebar[^>]*>([\s\S]*?)<\/script>/i);if(Z)try{let Y=Z[1].match(/(?:export\s+(?:default\s+)?|const\s+\w+\s*=\s*)(\{[\s\S]*\})/m);if(Y)return Function(`return ${Y[1]}`)()}catch(Y){console.warn("Invalid native-sidebar script configuration:",Y)}return}function i$(){console.log(`
|
|
@@ -1057,7 +1057,7 @@ else {
|
|
|
1057
1057
|
};
|
|
1058
1058
|
})();
|
|
1059
1059
|
</script>
|
|
1060
|
-
`}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-
|
|
1060
|
+
`}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-adkjxvy6.js"),H=L(F.join(`
|
|
1061
1061
|
`),z),q=O.search(/<\/body>/i);if(q!==-1)O=O.slice(0,q)+H+`
|
|
1062
1062
|
`+O.slice(q);else O+=`
|
|
1063
1063
|
${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J$(G,O,W,Q),Q.debug)console.log(`Cached template ${G} with ${W.size} dependencies`)}return{contents:O,loader:"html"}}catch(W){let K=W instanceof Error?W:new s$(`Plugin processing failed: ${String(W)}`,G);if(Q$.log(K,{filePath:G,buildConfig:$.config}),F6.logDetailedError(K,{filePath:G,plugin:"bun-plugin-stx"}),Q.debug)console.error("stx Plugin Error:",K);let _=K,U=_.line||null,F=_.context||null;return{contents:Q.debug||L6()?`<!DOCTYPE html>
|
|
@@ -1120,7 +1120,7 @@ ${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J
|
|
|
1120
1120
|
<h1>Something went wrong</h1>
|
|
1121
1121
|
<p>An internal error occurred. Please try again later.</p>
|
|
1122
1122
|
</body>
|
|
1123
|
-
</html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-
|
|
1123
|
+
</html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-06706a9a.js"),N=await A();if(N?.apiRouter)L=N?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(N?.apiRoutes){O=N.apiRoutes;let V=Object.keys(O).length;if(V>0)console.log(`${B.blue}Loaded ${B.bright}${V} API route${V>1?"s":""}${B.reset}`)}if(N?.broadcasting?.enabled)try{let{startBroadcasting:V,loadChannels:M}=await import("./chunk-agx0620p.js"),R=N.broadcasting;await V(R);let w=R.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${w}/ws${B.reset}`);let C=Y0.join(process.cwd(),"channels.ts");if(H0.existsSync(C))try{let I=await M(C);console.log(`${B.blue}Loaded ${B.bright}${I} broadcast channel${I!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(I){console.warn(`${B.yellow}Failed to load channels.ts: ${I.message}${B.reset}`)}}catch(V){console.warn(`${B.yellow}Broadcasting failed to start: ${V.message}${B.reset}`)}}catch{}if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let H=O4({port:j,async fetch(A){return _$(A,await(async()=>{let N=new URL(A.url);if(L)try{let C=await L.handleRequest(A);if(C.status!==404)return C}catch{}if(O[N.pathname])try{return await O[N.pathname](A)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(N.pathname==="/")return(async()=>{let I=await o(_||"");if(Y)I=D0(I,G);if(X.native)if(I.includes("<head>"))I=I.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else I="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+I;if(X.titlebarHidden)if(I.includes("<head>"))I=I.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else I=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${I}`;return I})().then((I)=>new Response(I,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let V=Y0.join(K,N.pathname);if(H0.existsSync(V)&&H0.statSync(V).isFile()){let C=Bun.file(V),I=Y0.extname(V).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let M=Y0.dirname(W),R=Y0.join(M,N.pathname);if(H0.existsSync(R)&&H0.statSync(R).isFile()){let C=Bun.file(R),I=Y0.extname(R).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let w=Y0.join(process.cwd(),"public",N.pathname);if(H0.existsSync(w)&&H0.statSync(w).isFile()){let C=Bun.file(w),I=Y0.extname(w).toLowerCase(),E="application/octet-stream";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}return new Response("Not Found",{status:404})})())},error(A){return new Response(`<pre>${A}
|
|
1124
1124
|
${A.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
1125
1125
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1126
1126
|
${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
|
|
@@ -1607,12 +1607,12 @@ ${O.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
|
|
|
1607
1607
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1608
1608
|
${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
|
|
1609
1609
|
${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((O)=>O.routeTemplate)),j=Object.entries(G).filter(([O])=>!z.has(O)).sort(([O],[L])=>O.localeCompare(L)).map(([O,L])=>({route:O==="/"?"/":O,filePath:Q0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let O of W){let L=O.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:Q0.relative(process.cwd(),O.filePath),fileType:"stx"})}if(j.sort((O,L)=>O.route.localeCompare(L.route)),j.forEach((O,L)=>{let q=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",A=O.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${q}${O.route}${B.reset} \u2192 ${B.bright}${O.filePath}${B.reset} ${A}`)}),console.log(`
|
|
1610
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-w8smn72c.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-w8smn72c.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-a2qghr2x.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-w8smn72c.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-vb10qph4.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-w8smn72c.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-n3jyv9z6.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-mkn6qqc7.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-f80wwn5x.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-mkn6qqc7.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1610
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-06706a9a.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-06706a9a.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-agx0620p.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-06706a9a.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-v2z3creg.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-06706a9a.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-adkjxvy6.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-pv9apyrr.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-fxk9j0rm.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-pv9apyrr.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1611
1611
|
${D.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
|
|
1612
1612
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1613
1613
|
${B.bright}\u2192 ${B.cyan}http://localhost:${W0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
|
|
1614
1614
|
${B.yellow}Routes:${B.reset}`);let a0=[...E6(j,W)];for(let{route:D}of L)a0.push(`${D.pattern}`);if(a0.forEach((D,T)=>{let S=T===a0.length-1?"\u2514\u2500 ":"\u251C\u2500 ";console.log(` ${B.green}${S}${B.reset}${D}`)}),console.log(`
|
|
1615
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-
|
|
1615
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-v2z3creg.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(A&&b){if(g.resolve(W,b)===A||g.basename(A)===b){let K0=await Q5(A,X.stxOptions||{});if(K0)q=K0}}if(await t(),await K$(W),Y&&J)J.reload(b)}else{console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-v2z3creg.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(await t(),Y&&J)J.reload(b)}else if(t1(b)){if(console.log(`${B.cyan}CSS ${b} changed${B.reset}`),Y&&J)J.updateCss(b)}});process.on("SIGINT",()=>{if(x.close(),J)A1();g1.stop(),process.exit(0)})}return!0}var P={enabled:!1,components:new Map,stores:new Map,events:[],performance:[],selectedComponent:null,selectedStore:null,maxEvents:1000,maxPerformance:500};function V4($={}){if(typeof window>"u")return;P.enabled=!0,P.maxEvents=$.maxEvents||1000,P.maxPerformance=$.maxPerformance||500,window.__STX_DEVTOOLS__={getState:()=>P,getComponents:()=>Array.from(P.components.values()),getComponent:(X)=>P.components.get(X),getStores:()=>Array.from(P.stores.values()),getStore:(X)=>P.stores.get(X),getEvents:()=>P.events,getPerformance:()=>P.performance,selectComponent:(X)=>J5(X),selectStore:(X)=>R4(X),inspectElement:(X)=>I4(X),highlightComponent:(X)=>m6(X),clearHighlight:()=>p6(),logComponentTree:()=>D4(),logStoreState:(X)=>w4(X),timeTravel:(X,Q)=>T4(X,Q)},k4(),C4(),console.log("%c[STX DevTools] Enabled","color: #10b981; font-weight: bold;")}function E4(){P.enabled=!1,delete window.__STX_DEVTOOLS__;let $=document.getElementById("stx-devtools-panel");if($)$.remove();console.log("%c[STX DevTools] Disabled","color: #ef4444;")}function f6($){if(!P.enabled)return;let X=P.components.get($);if(X){if(X.parentId){let Q=P.components.get(X.parentId);if(Q)Q.children=Q.children.filter((Z)=>Z!==$)}P.components.delete($),Y5({timestamp:Date.now(),type:"component:unmounted",componentId:$,payload:{name:X.name}})}}function d6($,X,Q={},Z=[]){if(!P.enabled)return;let Y={id:$,state:X,getters:Q,actions:Z,history:[{timestamp:Date.now(),type:"state",name:"__init__",newValue:X}]};P.stores.set($,Y),Y5({timestamp:Date.now(),type:"store:registered",payload:{id:$,state:X}})}function u6($,X,Q,Z,Y="state"){if(!P.enabled)return;let J=P.stores.get($);if(J){let G={timestamp:Date.now(),type:Y,name:X,oldValue:Q,newValue:Z,stack:Error().stack};if(J.history.push(G),J.history.length>100)J.history=J.history.slice(-100);if(Y==="state")J.state={...J.state,[X]:Z};Y5({timestamp:Date.now(),type:`store:${Y}`,payload:{storeId:$,name:X,oldValue:Q,newValue:Z}})}}function Y5($){if(!P.enabled)return;if(P.events.push($),P.events.length>P.maxEvents)P.events=P.events.slice(-P.maxEvents);if(typeof window<"u")window.dispatchEvent(new CustomEvent("stx:devtools:event",{detail:$}))}function J5($){P.selectedComponent=$;let X=P.components.get($);if(X)m6($),console.log("%c[STX DevTools] Selected component:","color: #3b82f6;",X);return X}function R4($){P.selectedStore=$;let X=P.stores.get($);if(X)console.log("%c[STX DevTools] Selected store:","color: #8b5cf6;",X);return X}function I4($){let X=$;while(X){let Q=X.getAttribute("data-stx-component-id");if(Q)return J5(Q);X=X.parentElement}console.log("%c[STX DevTools] No component found for element","color: #f59e0b;");return}function m6($){p6();let X=P.components.get($);if(X?.element){let Q=document.createElement("div");Q.id="stx-devtools-highlight",Q.style.cssText=`
|
|
1616
1616
|
position: absolute;
|
|
1617
1617
|
background: rgba(59, 130, 246, 0.2);
|
|
1618
1618
|
border: 2px solid #3b82f6;
|
|
@@ -2881,9 +2881,9 @@ describe('Example', () => {
|
|
|
2881
2881
|
</footer>
|
|
2882
2882
|
@yield('scripts')
|
|
2883
2883
|
</body>
|
|
2884
|
-
</html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-
|
|
2884
|
+
</html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-cqzqfm7m.js");return{...await X($.configDir??process.cwd()).catch(()=>({})),...$.stxOptions??{}}}async function eX($={}){let{port:X=3000,root:Q=".",watch:Z=!0,onRequest:Y,routes:J={},middleware:G=[],on404:W,onError:K}=$,_=y0.resolve(Q),U=await J8($),F=new Map;async function z(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return{content:M.content,status:M.status,headers:M.headers};for(let T of F.keys())if(T.startsWith(`${A}:`)&&T!==V)F.delete(T);let R=await Bun.file(A).text(),w=R,C=Z$(R);if(C)w=C.content.trim();let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,E=[],h=[],u;while((u=I.exec(R))!==null){let T=u[1],x=u[2],S=u[0];if(T.includes("server"))h.push(x);else E.push(S)}let t=R.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],d5=w.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),W0={__filename:A,__dirname:y0.dirname(A)};for(let T of h)await j0(T,W0,A);let q0=await O0(d5,W0,A,U,new Set);if(t.length>0){let T=t.join(`
|
|
2885
2885
|
`);if(q0.match(/(<\/head>)/i))q0=q0.replace(/(<\/head>)/i,`${T}
|
|
2886
|
-
$1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-
|
|
2886
|
+
$1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-adkjxvy6.js"),x=T(E.join(`
|
|
2887
2887
|
`),W0);if(q0.match(/(<\/body>)/i))q0=q0.replace(/(<\/body>)/i,`${x}
|
|
2888
2888
|
$1`);else q0+=`
|
|
2889
2889
|
${x}`}let a0=N1(W0),D=M1(W0);return F.set(V,{content:q0,mtime:N.mtimeMs,status:a0,headers:D}),{content:q0,status:a0,headers:D}}async function j(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return M.content;let{content:R}=await V0(A,U);return F.set(V,{content:R,mtime:N.mtimeMs}),R}function O(A){let N=A.startsWith("/")?A.slice(1):A,V=[N,`${N}.stx`,`${N}.md`,`${N}.html`,y0.join(N,"index.stx"),y0.join(N,"index.md"),y0.join(N,"index.html")];for(let M of V){let R=y0.join(_,M);if(k1.existsSync(R)&&k1.statSync(R).isFile())return R}return null}async function L(A){let N=new URL(A.url),V=async()=>{if(J[N.pathname])return await J[N.pathname](A);if(Y){let R=await Y(A);if(R)return R}let M=O(N.pathname);if(!M){if(W)return await W(A);return new Response("Not Found",{status:404})}try{let R,w="text/html",C,I;if(M.endsWith(".stx")){let E=await z(M);R=E.content,C=E.status,I=E.headers}else if(M.endsWith(".md"))R=await j(M);else if(M.endsWith(".html"))R=await Bun.file(M).text();else if(M.endsWith(".css"))R=await Bun.file(M).text(),w="text/css";else if(M.endsWith(".js"))R=await Bun.file(M).text(),w="text/javascript";else if(M.endsWith(".json"))R=await Bun.file(M).text(),w="application/json";else return new Response(Bun.file(M));return new Response(R,{status:C??200,headers:{"Content-Type":w,...I}})}catch(R){if(K)return await K(R,A);let w=R instanceof Error?R.message:String(R),I=U?.debug===!0?`<h1>Error</h1><pre>${w}
|
|
@@ -4315,7 +4315,7 @@ else {
|
|
|
4315
4315
|
\u26A0\uFE0F Built ${Q.views.length} views with ${Q.errors.length} errors`);return Q}function Z9($,X){let Q=V$.watch($.viewsDir,{recursive:!0},async(Z,Y)=>{if(!Y)return;if(Y.endsWith(".stx")||Y.endsWith(".ts")||Y.endsWith(".js")){if($.debug)console.log(`
|
|
4316
4316
|
File changed: ${Y}, rebuilding...`);let J=await VZ($);X?.(J)}});return{close:()=>Q.close()}}async function Y9($,X={},Q={}){let Z={...Q,skipDefaultSeoTags:!0,skipSignalsRuntime:!0},Y=await V7($,X,Z);Y=await EZ(Y),Y=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),Y=Y.replace(/<!--\s*stx SEO Tags\s*-->/gi,""),Y=Y.replace(/\n\s*\n\s*\n/g,`
|
|
4317
4317
|
|
|
4318
|
-
`).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-
|
|
4318
|
+
`).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-sag55qv7.js");if(Q($).size===0)return $;let Y=await X($);if(!Y)return $;let J=RZ(Y);if(J.size===0)return $;return $.replace(/(<[a-z][a-z0-9]*)((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s+)class\s*=\s*"([^"]*)"((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?>)/gi,(G,W,K,_,U,F)=>{let z=_.split(/\s+/).filter(Boolean),j=[];for(let q of z){let A=J.get(q);if(A)j.push(A)}if(j.length===0)return`${W}${K}class="${_}"${U}${F}`;let O=j.join("; "),H=`${K}${U}`.match(/style\s*=\s*"([^"]*)"/);if(H){let q=`${O}; ${H[1]}`,A=K.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`),N=U.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`);return`${W}${A}class="${_}"${N}${F}`}return`${W}${K}class="${_}" style="${O}"${U}${F}`})}catch{return $}}function RZ($){let X=new Map,Q=/\.([a-zA-Z0-9_-]+(?:\\:[a-zA-Z0-9_-]+)*)\s*\{([^}]+)\}/g,Z=Q.exec($);while(Z!==null){let Y=Z[1].replace(/\\/g,""),J=Z[2].split(";").map((G)=>G.trim()).filter(Boolean).join("; ");if(J)X.set(Y,J);Z=Q.exec($)}return X}function IZ($){return $.replace(/<br\s*\/?>/gi,`
|
|
4319
4319
|
`).replace(/<\/(p|div|h[1-6]|li|tr)>/gi,`
|
|
4320
4320
|
`).replace(/<\/td>/gi,"\t").replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/©/g,"(c)").replace(/·/g,"-").replace(/\n\s*\n\s*\n/g,`
|
|
4321
4321
|
|
|
@@ -4450,7 +4450,7 @@ ${R}`}function Z0($){return $.replace(/&/g,"&").replace(/"/g,""").repla
|
|
|
4450
4450
|
`;let Q=$.sitemap!==!1?`Sitemap: ${$.url.replace(/\/$/,"")}/sitemap.xml
|
|
4451
4451
|
`:"";if(X==="disallow")return["User-agent: *","Disallow: /","",Q].filter(Boolean).join(`
|
|
4452
4452
|
`);return["User-agent: *","Allow: /","",Q].filter(Boolean).join(`
|
|
4453
|
-
`)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-
|
|
4453
|
+
`)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-3br3pt6k.js");if(typeof $.getRouterScript==="function")F1=$.getRouterScript();else F1=""}catch{F1=""}return F1}async function b5($,X){let Q=await JY();if(!Q)return $;let Z={interceptAllLinks:!0,container:"main",...X},J=`${`<script>window.__stxRouterConfig=${JSON.stringify(Z)};</script>
|
|
4454
4454
|
`}<script>${Q}</script>`;if(/<\/body>/i.test($))return $.replace(/<\/body>/i,`${J}
|
|
4455
4455
|
</body>`);return`${$}
|
|
4456
4456
|
${J}`}var GY=`window.__stxThemeIcon=function(isDark){try{var want=isDark?'dark':'light';var pick=document.querySelector('link[rel~="icon"][media*="prefers-color-scheme: '+want+'"]');if(!pick)return;var live=document.querySelector('link[rel~="icon"]:not([media])');if(!live){live=document.createElement('link');live.setAttribute('rel','icon');document.head.appendChild(live)}if(pick.type)live.setAttribute('type',pick.type);var href=pick.getAttribute('href');if(live.getAttribute('href')!==href)live.setAttribute('href',href)}catch(e){}};`,WY=($,X,Q,Z)=>`(function(){${GY}function read(){try{var k=${JSON.stringify(X)};var t=localStorage.getItem(k);return t===null?(${JSON.stringify($)}==='dark'||(${JSON.stringify($)}==='auto'&&window.matchMedia('(prefers-color-scheme: dark)').matches)):t==='dark'}catch(e){return ${JSON.stringify($)}==='dark'}}function apply(){var isDark=read();var html=document.documentElement;html.classList[isDark?'add':'remove']('dark');var color=isDark?${JSON.stringify(Z)}:${JSON.stringify(Q)};if(!document.head)return;var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(!tc){tc=document.createElement('meta');tc.setAttribute('name','theme-color');tc.setAttribute('data-stx-theme-meta','1')}tc.setAttribute('content',color);if(tc!==document.head.firstChild){document.head.insertBefore(tc,document.head.firstChild)}if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)}apply();window.addEventListener('stx:navigate',apply);window.addEventListener('popstate',apply)})();`,KY=($,X,Q)=>`document.addEventListener('click',function(e){var t=e.target&&e.target.closest&&e.target.closest('#theme-toggle');if(!t)return;var html=document.documentElement;var isDark=html.classList.toggle('dark');try{localStorage.setItem(${JSON.stringify($)},isDark?'dark':'light')}catch(e){}var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(tc)tc.setAttribute('content',isDark?${JSON.stringify(Q)}:${JSON.stringify(X)});if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)});`;function C$($,X){if(X.theme===!1)return $;let Q=$.includes(g7),Z=typeof X.theme==="object"&&X.theme!==null?X.theme:{},Y=Z.default??"dark",J=Z.storageKey??"theme",G=Z.colors?.light??"#ffffff",W=Z.colors?.dark??"#000000";if(Y==="dark"&&!Q){if(!/<html\b[^>]*\bclass=/.test($))$=$.replace(/<html\b([^>]*)>/i,'<html$1 class="dark">');else if(!/<html\b[^>]*\bclass="[^"]*\bdark\b/.test($))$=$.replace(/<html\b([^>]*\bclass=")([^"]*)(")/i,"<html$1$2 dark$3")}if(!$.includes("data-stx-theme-meta")&&/<head\b[^>]*>/i.test($)){let K=['<meta name="color-scheme" content="dark light" data-stx-theme-meta="1">',`<meta name="theme-color" media="(prefers-color-scheme: light)" content="${G}" data-stx-theme-meta="1">`,`<meta name="theme-color" media="(prefers-color-scheme: dark)" content="${W}" data-stx-theme-meta="1">`].join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{av as y}from"./chunk-drbbt69f.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
|
|
3
3
|
`);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
|
|
4
4
|
`)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
|
|
5
5
|
export{Y as wk,_ as xk,a as yk,s as zk,h as Ak,f as Bk,c as Ck,HM as Dk};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{bj as O,cj as w,dj as Z}from"./chunk-efr3ejqt.js";import{$k as R,gl as U,ll as T}from"./chunk-kws4rewx.js";import{Pp as k,Sl as M,er as C,po as W}from"./chunk-qj2s3r1w.js";import{Vt as E,Wt as L}from"./chunk-nygtwffe.js";import{_t as B}from"./chunk-h7v70dbp.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
|
+
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
|
+
|
|
5
|
+
`),x=`;(function(){
|
|
6
|
+
var __stx = window.stx || {};
|
|
7
|
+
${B.filter((q)=>!X.has(q)&&new RegExp(`\\b${q}\\b`).test(j)).map((q)=>`var ${q} = __stx[${JSON.stringify(q)}];`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${j}
|
|
10
|
+
})();`;return K=O(V()),Z(Y,z,K,x),x}function a(){Y.clear()}
|
|
11
|
+
export{l as Yi,a as Zi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ng as v,og as i,pg as t,sg as e,tg as HH,ug as KH,vg as QH,wg as YH,xg as ZH}from"./chunk-rjqfa3g8.js";import{_i as s}from"./chunk-e63a220e.js";import{Rl as a}from"./chunk-qj2s3r1w.js";import{Dt as h}from"./chunk-fv923f7g.js";import{_t as f}from"./chunk-h7v70dbp.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
|
|
3
3
|
`.repeat(K.startLine-1):"",N=t(i(K.code)),X=K.kind==="client"||K.kind==="plain"?HH(Q,K.code):"";return QH(`${L+N}
|
|
4
4
|
${X}
|
|
5
5
|
export {}
|
|
@@ -16,4 +16,4 @@ ${b.trim().split(`
|
|
|
16
16
|
`).slice(0,12).join(`
|
|
17
17
|
`)||"(no output)"}`:void 0;return{diagnostics:D,checkedFiles:q,blockCount:B,expressionCount:T,failure:XH}}function vH(K){return K.map((Q)=>{let V=Q.blockKind==="template"?`[template: ${Q.expression??""}]`:`[${Q.blockKind==="plain"?"<script>":`<script ${Q.blockKind}>`}]`;return`${Q.file}:${Q.line}:${Q.column} ${Q.category} TS${Q.code} ${Q.message} ${V}`}).join(`
|
|
18
18
|
`)}
|
|
19
|
-
export{GH as
|
|
19
|
+
export{GH as Jf,r as Kf,yH as Lf,UH as Mf,PH as Nf,vH as Of};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var K={},Y=[],O={};function I(){return K}function h(){return O}function D(){K={},Y.length=0,O={}}function U(j){K=Q(K,j)}function Q(j,z){return{title:z.title??j.title,titleTemplate:z.titleTemplate??j.titleTemplate,base:z.base??j.base,meta:[...j.meta||[],...z.meta||[]],link:[...j.link||[],...z.link||[]],script:[...j.script||[],...z.script||[]],style:[...j.style||[],...z.style||[]],htmlAttrs:{...j.htmlAttrs,...z.htmlAttrs},bodyAttrs:{...j.bodyAttrs,...z.bodyAttrs}}}function Z(j){U(_(j))}function _(j){let z=[];if(j.description)z.push({name:"description",content:j.description});if(j.keywords){let L=Array.isArray(j.keywords)?j.keywords.join(", "):j.keywords;z.push({name:"keywords",content:L})}if(j.author)z.push({name:"author",content:j.author});if(j.robots)z.push({name:"robots",content:j.robots});let A=j.ogTitle??j.title,B=j.ogDescription??j.description;if(A)z.push({property:"og:title",content:A});if(B)z.push({property:"og:description",content:B});if(j.ogImage)z.push({property:"og:image",content:j.ogImage});if(j.ogUrl)z.push({property:"og:url",content:j.ogUrl});if(j.ogType)z.push({property:"og:type",content:j.ogType});if(j.ogSiteName)z.push({property:"og:site_name",content:j.ogSiteName});if(j.ogLocale)z.push({property:"og:locale",content:j.ogLocale});let E=j.twitterTitle??j.title,F=j.twitterDescription??j.description,J=j.twitterImage??j.ogImage;if(j.twitterCard)z.push({name:"twitter:card",content:j.twitterCard});if(E)z.push({name:"twitter:title",content:E});if(F)z.push({name:"twitter:description",content:F});if(J)z.push({name:"twitter:image",content:J});if(j.twitterSite)z.push({name:"twitter:site",content:j.twitterSite});if(j.twitterCreator)z.push({name:"twitter:creator",content:j.twitterCreator});if(j.articleAuthor)z.push({property:"article:author",content:j.articleAuthor});if(j.articlePublishedTime)z.push({property:"article:published_time",content:j.articlePublishedTime});if(j.articleModifiedTime)z.push({property:"article:modified_time",content:j.articleModifiedTime});if(j.articleSection)z.push({property:"article:section",content:j.articleSection});if(j.articleTags)for(let L of j.articleTags)z.push({property:"article:tag",content:L});let G=[];if(j.canonical)G.push({rel:"canonical",href:j.canonical});return{title:j.title,titleTemplate:j.titleTemplate,meta:z,link:G}}function S(j){if(O={...O,...j},j.title||j.description)Z({title:j.title,description:j.description})}function P(j){let z=typeof j==="function"?j():j;U({title:z})}function C(j=K){let z=[];if(j.title){let A=j.title;if(j.titleTemplate)A=typeof j.titleTemplate==="function"?j.titleTemplate(A):j.titleTemplate.replace("%s",A);z.push(`<title>${N(A)}</title>`)}if(j.base){let A=Object.entries(j.base).map(([B,E])=>`${B}="${N(E)}"`).join(" ");z.push(`<base ${A}>`)}for(let A of j.meta||[]){let B=Object.entries(A).filter(([E,F])=>F!==void 0).map(([E,F])=>{return`${E==="httpEquiv"?"http-equiv":E}="${N(String(F))}"`}).join(" ");z.push(`<meta ${B}>`)}for(let A of j.link||[]){let B=Object.entries(A).filter(([E,F])=>F!==void 0).map(([E,F])=>`${E}="${N(String(F))}"`).join(" ");z.push(`<link ${B}>`)}for(let A of j.script||[]){let{content:B,...E}=A,F=Object.entries(E).filter(([J,G])=>G!==void 0).map(([J,G])=>{if(typeof G==="boolean")return G?J:"";return`${J}="${N(String(G))}"`}).filter(Boolean).join(" ");if(B)z.push(`<script ${F}>${B}</script>`);else z.push(`<script ${F}></script>`)}for(let A of j.style||[]){let B=A.type?` type="${A.type}"`:"";z.push(`<style${B}>${A.content}</style>`)}return z.join(`
|
|
3
3
|
`)}function M(j=K){if(!j.htmlAttrs)return"";return Object.entries(j.htmlAttrs).map(([z,A])=>`${z}="${N(A)}"`).join(" ")}function V(j=K){if(!j.bodyAttrs)return"";return Object.entries(j.bodyAttrs).map(([z,A])=>`${z}="${N(A)}"`).join(" ")}function N(j){return j.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w(j=K){if(typeof document>"u")return;if(j.title){let z=j.title;if(j.titleTemplate)z=typeof j.titleTemplate==="function"?j.titleTemplate(z):j.titleTemplate.replace("%s",z);document.title=z}for(let z of j.meta||[]){let A=z.name?`meta[name="${z.name}"]`:z.property?`meta[property="${z.property}"]`:null;if(A){let B=document.querySelector(A);if(!B){if(B=document.createElement("meta"),z.name)B.setAttribute("name",z.name);if(z.property)B.setAttribute("property",z.property);document.head.appendChild(B)}B.setAttribute("content",z.content)}}for(let z of j.link||[]){let A=`link[rel="${z.rel}"]${z.href?`[href="${z.href}"]`:""}`,B=document.querySelector(A);if(!B)B=document.createElement("link"),document.head.appendChild(B);for(let[E,F]of Object.entries(z))if(F!==void 0)B.setAttribute(E,String(F))}if(j.htmlAttrs)for(let[z,A]of Object.entries(j.htmlAttrs))if(z==="class")for(let B of String(A).split(/\s+/).filter(Boolean))document.documentElement.classList.add(B);else document.documentElement.setAttribute(z,A);if(j.bodyAttrs)for(let[z,A]of Object.entries(j.bodyAttrs))document.body.setAttribute(z,A)}function y(j){let z="";return{content:j.replace(/@head\s*([\s\S]*?)@endhead/g,(B,E)=>{return z+=E.trim()+`
|
|
4
|
-
`,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(A,B,E,F)=>{let J=B?E:z[(F||"").trim()]??F,G=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(G,{title:J}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(A,B,E,F,J,G)=>{let L=F?J:G,R=F?L:z[(L||"").trim()]??L,W=E.includes(":")?{property:E,content:R}:{name:E,content:R},X=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(X,{meta:[W]}),""})}export{I as
|
|
4
|
+
`,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(A,B,E,F)=>{let J=B?E:z[(F||"").trim()]??F,G=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(G,{title:J}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(A,B,E,F,J,G)=>{let L=F?J:G,R=F?L:z[(L||"").trim()]??L,W=E.includes(":")?{property:E,content:R}:{name:E,content:R},X=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(X,{meta:[W]}),""})}export{I as Ft,h as Gt,D as Ht,U as It,Q as Jt,Z as Kt,_ as Lt,S as Mt,P as Nt,C as Ot,M as Pt,V as Qt,w as Rt,y as St,x as Tt,T as Ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ik as a,jk as b,kk as c,lk as d}from"./chunk-vwzqg4fh.js";import"./chunk-ee2tfpec.js";import"./chunk-qj2s3r1w.js";import"./chunk-ymc99r5x.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-t5c7rk0h.js";import"./chunk-72c7gyqc.js";import"./chunk-fv923f7g.js";import"./chunk-2e6xafcm.js";import"./chunk-nygtwffe.js";import"./chunk-461br5nn.js";import"./chunk-h7v70dbp.js";import"./chunk-drbbt69f.js";import"./chunk-kb5j08tq.js";import"./chunk-2vza9m2x.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
|