@stacksjs/stx 0.2.359 → 0.2.360
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-aq5ccry0.js → chunk-1hvxs7rh.js} +1 -1
- package/dist/{chunk-j02bjc02.js → chunk-3xspzgrq.js} +1 -1
- package/dist/{chunk-g1w0krp7.js → chunk-6pdfvpa6.js} +1 -1
- package/dist/{chunk-twrg5nc4.js → chunk-8akj7f4h.js} +1 -1
- package/dist/{chunk-7meemc5z.js → chunk-a68y9s2j.js} +1 -1
- package/dist/{chunk-t2qw6g2y.js → chunk-bxkr3ts9.js} +1 -1
- package/dist/{chunk-fssaw4zm.js → chunk-d5gzma79.js} +1 -1
- package/dist/{chunk-7tgyaamc.js → chunk-vyhrzsnf.js} +4 -4
- package/dist/{chunk-3af6qhw7.js → chunk-z2rvc8d5.js} +1 -1
- package/dist/{chunk-gm6rwp5t.js → chunk-za8wxkx6.js} +1 -1
- package/dist/cli.js +3 -3
- package/package.json +5 -5
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{bg as ZJ,dg as g,fg as A,lg as n,og as GJ,rg as WJ,tg as YJ,vg as jJ}from"./chunk-
|
|
2
|
+
import{bg as ZJ,dg as g,fg as A,lg as n,og as GJ,rg as WJ,tg as YJ,vg as jJ}from"./chunk-a68y9s2j.js";import{yg as $J}from"./chunk-0knxnyq6.js";import{rl as XJ}from"./chunk-7rj4h2t2.js";import{lo as h}from"./chunk-2119txb8.js";import{Hs as e}from"./chunk-dj24n5n7.js";import{It as QJ,Mt as i,Ot as p}from"./chunk-xk402w4a.js";import{Dw as l,Iw as VJ,aw as KJ}from"./chunk-e03m4har.js";import{Sw as DJ}from"./chunk-m8kem5ca.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-xn226qe0.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
|
|
3
3
|
export{zJ as We,LJ as Xe,t as Ye,uJ as Ze};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{jg as e,lg as kF,mg as UF,ng as wF,vg as EF}from"./chunk-
|
|
2
|
+
import{jg as e,lg as kF,mg as UF,ng as wF,vg as EF}from"./chunk-a68y9s2j.js";import{yg as BF}from"./chunk-0knxnyq6.js";import{oj as l,pj as d}from"./chunk-pwctc0m1.js";import{Dk as HF,Ek as IF,Fk as KF}from"./chunk-frp9fc7j.js";import{nl as YF,pl as ZF}from"./chunk-7rj4h2t2.js";import{Hp as VF,Lp as r,Qp as o,Xm as s,jo as zF,kp as $F,om as p,qm as i,vr as t,xr as M,zp as GF}from"./chunk-2119txb8.js";import{xs as XF}from"./chunk-4arms0am.js";import{nt as qF}from"./chunk-dj24n5n7.js";import{Ht as WF}from"./chunk-1tz8fb87.js";import{Mt as QF}from"./chunk-xk402w4a.js";import{Fw as h,Iw as _F}from"./chunk-e03m4har.js";import G from"fs";import q from"path";import{createHash as NF}from"crypto";_F();function u(Q){return NF("sha256").update(Q).digest("hex").slice(0,8)}function c(Q=!1){let z=Q?d():l(),Z=u(z);return{content:z,filename:`runtime.${Z}.js`,hash:Z}}function a(){let Q=h(),z=u(Q);return{content:Q,filename:`router.${z}.js`,hash:z}}function bF(Q){return{runtimeTag:Q.runtime?`<script src="/__stx/${Q.runtime.filename}"></script>`:"",routerTag:Q.router?`<script src="/__stx/${Q.router.filename}"></script>`:"",cssTag:Q.css?`<link rel="stylesheet" href="/__stx/${Q.css.filename}">`:""}}import n from"path";import{createHash as OF}from"crypto";function TF(Q={}){let z=new Set;return{context:new Proxy(Q,{get(X,F){if(F in X)return X[F];if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return},has(X,F){if(F in X)return!0;if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return!1}}),accessedKeys:z}}async function FF(Q,z,Z={}){let X=n.resolve(Q),F=await Bun.file(X).text(),U=OF("sha256").update(F).digest("hex").slice(0,16);p();let w={};try{w=await M(Z.configDir)}catch{}let H=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(F))!==null){let E=k[1];if(/\bserver\b/.test(E))H.push(k[2])}let W=new Set(H.flatMap((E)=>o(E))),{context:_}=TF({__filename:X,__dirname:n.dirname(X),__stx_serverDeclared:W}),N=new Set,x={...t,...w,...Z,buildMode:"compile",strict:!1},I=await r(F,_,X,x,N),O=e(I),j=i();return{route:z,sourceFile:Q,html:I,fragment:O,placeholders:j,hasServerScripts:H.length>0,serverScriptContent:H,dependencies:Array.from(N),contentHash:U,status:s(F),streamTemplates:_.__streamTemplates}}var MF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function JF(Q,z){let Z=0,X=0;if(!G.existsSync(Q))return{copied:Z,bytes:X};G.mkdirSync(z,{recursive:!0});function F(U,w){let H=G.readdirSync(U,{withFileTypes:!0});for(let V of H){if(MF.has(V.name))continue;let k=q.join(U,V.name),W=q.join(w,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),F(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),Z++,X+=G.statSync(W).size}}}return F(Q,z),{copied:Z,bytes:X}}async function qJ(Q={}){let z=Date.now(),Z=q.resolve(Q.root||process.cwd()),X=q.resolve(Z,Q.outputDir||".output");console.log("[stx build] Starting production build...");let F=await M(Z),U=q.resolve(Z,Q.componentsDir??F.componentsDir??"components"),w=q.resolve(Z,Q.partialsDir??F.partialsDir??"partials"),H=q.resolve(Z,Q.layoutsDir??F.layoutsDir??"layouts"),V=Q.publicDir??F.publicDir??"public",k=F.app?.head||{},W=F.app?.colorMode,_=F.router?.container||"main",N=Q.routeRules??F.routeRules??{},x=BF(N),I=Q.serverApi??F.serverApi,O=typeof I==="object"?I:{};if(I)YF(Z,O);if(F.runtimeConfig)QF(F.runtimeConfig,{});if(G.existsSync(X))G.rmSync(X,{recursive:!0});let j=[q.join(X,"public","__stx"),q.join(X,"public","assets"),q.join(X,"server","pages"),q.join(X,"server","fragments")];for(let Y of j)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let E=zF(Z,{pagesDirs:F._layerPageDirs}),LF=["components","layouts","partials"],y=E.filter((Y)=>{return!LF.some((B)=>Y.pattern.startsWith(`/${B}/`)||Y.pattern===`/${B}`)});console.log(`[stx build] Found ${y.length} page routes (${E.length-y.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let L=c(Q.debug),K=a();await Bun.write(q.join(X,"public","__stx",L.filename),L.content),await Bun.write(q.join(X,"public","__stx",K.filename),K.content),console.log(`[stx build] Runtime: ${L.filename} (${(L.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${K.filename} (${(K.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let R=[],v=[];for(let Y of y){let B=x(Y.pattern),b=B.rendering==="prerender";if(b&&(Y.pattern.includes(":")||Y.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${Y.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let J=await FF(Y.filePath,Y.pattern,{configDir:Z,componentsDir:U,partialsDir:w,layoutsDir:H,debug:Q.debug});if(R.push(J),J.html=J.html.replace(/runtime\.__STX_HASH__\.js/g,L.filename).replace(/router\.__STX_HASH__\.js/g,K.filename),J.html=VF(J.html,k,{bodyScripts:[`<script src="/__stx/${K.filename}"></script>`],...W&&{colorMode:W}}),W)J.html=$F(J.html,W);if(k.htmlAttrs)J.html=GF(J.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(J.html)){let $=J.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if($&&$[1]){let m=$[1];J.html=J.html.replace(" "+m,""),J.html=J.html.replace(/<body([^>]*)>/,`<body$1 ${m}>`)}}if(J.html=J.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),J.html=await qF(J.html),b){let $=await EF(J,{params:{},request:new Request(`http://stx.build${Y.pattern}`),method:"GET",__stx_strict_hydration:!0});if($.redirect||$.cookies?.length||$.boundaries?.length||$.headers&&Object.keys($.headers).length)throw Error(`Prerendered route ${Y.pattern} cannot set response headers/cookies, redirect or stream`);J.html=$.html,J.status=$.status??J.status,J.hasServerScripts=!1,J.serverScriptContent=[],J.placeholders={}}J.fragment=kF(J.html,_);let C=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),g=q.join("server","pages",`${C}.compiled.json`),f=q.join("server","fragments",`${C}.html`);await Bun.write(q.join(X,g),JSON.stringify(J,null,2)),await Bun.write(q.join(X,f),J.fragment),v.push({pattern:Y.pattern,compiledPath:g,fragmentPath:f,isDynamic:J.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("["),prerendered:b}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(J){if(Object.keys(B).length)throw J;console.error(`[stx build] \u2717 ${Y.pattern}:`,J instanceof Error?J.message:J)}}let P=q.resolve(Z,V);if(G.existsSync(P)){let{copied:Y,bytes:B}=JF(P,q.join(X,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${V}/`)}let A=KF(Z);if(A){let{copied:Y,bytes:B}=JF(A,q.join(X,"public",IF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${HF}/`)}let S={runtime:L.filename,router:K.filename},T=UF(v,S,X);if(T.routeRules=N,T.routerContainer=_,I)T.apiRoutes=await ZF(Z,X,O);if(F.runtimeConfig)await Bun.write(q.join(X,"server/runtime-config.json"),JSON.stringify(F.runtimeConfig)),await WF(Z,F.runtimeConfig);if(F._layerGraph)await Bun.write(q.join(X,"server/layers.json"),JSON.stringify(XF(F._layerGraph),null,2));wF(T,X);let D=Date.now()-z;return console.log(`
|
|
3
3
|
[stx build] Done in ${D}ms \u2014 ${R.length} pages compiled`),{pageCount:R.length,assets:S,outputDir:X,duration:D}}
|
|
4
4
|
export{u as Sf,c as Tf,a as Uf,bF as Vf,FF as Wf,qJ as Xf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$ as km,$a as no,$b as yp,$c as yq,$d as yr,A as Wk,Aa as yn,Ab as So,Ac as Zp,Ad as Zq,Ae as ds,B as Xk,Ba as zn,Bb as To,Bc as _p,Bd as _q,Be as es,C as Yk,Ca as Mn,Cb as Uo,Cc as $p,Cd as $q,Ce as fs,D as Zk,Da as Nn,Db as Vo,Dc as aq,Dd as ar,De as gs,E as Pl,Ea as On,Eb as Wo,Ec as bq,Ed as br,Ee as hs,F as Ql,Fa as Pn,Fb as Xo,Fc as cq,Fd as cr,Fe as is,G as Rl,Ga as Qn,Gb as Yo,Gc as dq,Gd as dr,Ge as js,H as Sl,Ha as Rn,Hb as Zo,Hc as eq,Hd as er,He as ks,I as Tl,Ia as Vn,Ib as _o,Ic as fq,Id as fr,Ie as ls,J as Ul,Ja as Wn,Jb as $o,Jc as gq,Jd as gr,Je as ms,K as Vl,Ka as Xn,Kb as ap,Kc as hq,Kd as hr,Ke as ns,L as Wl,La as Yn,Lb as bp,Lc as iq,Ld as ir,M as Xl,Ma as Zn,Mb as cp,Mc as jq,Md as jr,N as Yl,Na as _n,Nb as kp,Nc as kq,Nd as kr,O as Zl,Oa as $n,Ob as lp,Oc as lq,Od as lr,P as _l,Pa as ao,Pb as mp,Pc as mq,Pd as mr,Q as $l,Qa as bo,Qb as np,Qc as nq,Qd as nr,R as am,Ra as co,Rb as op,Rc as oq,Rd as or,S as bm,Sa as eo,Sb as pp,Sc as pq,Sd as pr,T as cm,Ta as fo,Tb as qp,Tc as qq,Td as qr,U as dm,Ua as go,Ub as rp,Uc as rq,Ud as rr,V as em,Va as ho,Vb as sp,Vc as sq,Vd as sr,W as fm,Wa as io,Wb as tp,Wc as tq,Wd as tr,X as gm,Xa as jo,Xb as up,Xc as uq,Xd as ur,Y as hm,Ya as ko,Yb as vp,Yc as vq,Yd as vr,Z as im,Za as lo,Zb as wp,Zc as wq,Zd as wr,_ as jm,_a as mo,_b as xp,_c as xq,_d as xr,aa as lm,ab as oo,ac as zp,ad as zq,ae as zr,ba as mm,bb as po,bc as Ap,bd as Aq,be as Gr,ca as nm,cb as qo,cc as Bp,cd as Bq,ce as Hr,da as om,db as ro,dc as Cp,dd as Cq,de as Ir,ea as pm,eb as so,ec as Dp,ed as Dq,ee as Jr,fa as qm,fb as to,fc as Ep,fd as Eq,fe as Kr,ga as rm,gb as uo,gc as Fp,gd as Fq,ge as Lr,ha as sm,hb as vo,hc as Gp,hd as Gq,he as Mr,ia as tm,ib as wo,ic as Hp,id as Hq,ie as Nr,ja as um,jb as xo,jc as Ip,jd as Iq,je as Or,ka as vm,kb as yo,kc as Jp,kd as Jq,ke as Pr,la as wm,lb as zo,lc as Kp,ld as Kq,le as Qr,ma as xm,mb as Ao,mc as Lp,md as Lq,me as Rr,na as ym,nb as Do,nc as Mp,nd as Mq,ne as Sr,o as a,oa as zm,ob as Eo,oc as Np,od as Nq,oe as Tr,p as Hk,pa as nn,pb as Fo,pc as Op,pd as Oq,pe as Ur,q as Ik,qa as on,qb as Go,qc as Pp,qd as Pq,qe as Vr,r as Jk,ra as pn,rb as Io,rc as Qp,rd as Qq,re as Wr,s as Kk,sa as qn,sb as Jo,sc as Rp,sd as Rq,se as Xr,t as Lk,ta as rn,tb as Ko,tc as Sp,td as Sq,te as Yr,u as Mk,ua as sn,ub as Lo,uc as Tp,ud as Tq,ue as Zr,v as Nk,va as tn,vb as No,vc as Up,vd as Uq,ve as _r,w as Ok,wa as un,wb as Oo,wc as Vp,wd as Vq,we as $r,x as Pk,xa as vn,xb as Po,xc as Wp,xd as Wq,xe as as,y as Uk,ya as wn,yb as Qo,yc as Xp,yd as Xq,ye as bs,z as Vk,za as xn,zb as Ro,zc as Yp,zd as Yq,ze as cs}from"./chunk-7tgyaamc.js";import{Le as dp,Me as ep,Ne as fp,Oe as gp,Pe as hp,Qe as ip,Re as jp}from"./chunk-b381xgvw.js";import{Se as Bo,Te as Co}from"./chunk-7hb89n3z.js";import{Ue as Ho}from"./chunk-7kfv1q2r.js";import{Ve as mn}from"./chunk-twrg5nc4.js";import{We as Sn,Xe as Tn,Ye as Un,Ze as Mo}from"./chunk-aq5ccry0.js";import{$e as $k,_e as _k,af as al,bf as bl,cf as cl,df as dl,ef as el,ff as fl,gf as gl,hf as hl,if as il,jf as jl,kf as kl,lf as ll,mf as ml}from"./chunk-n0d7nwhd.js";import{nf as Dl,of as El,pf as Fl,qf as Gl,rf as Hl,sf as Il,tf as Jl,uf as Kl,vf as Ll,wf as Ml,xf as Nl,yf as Ol}from"./chunk-84577w4y.js";import{Af as Cl,zf as Bl}from"./chunk-5j3v0p6s.js";import{Bf as nl,Cf as ol,Df as pl,Ef as ql,Ff as rl,Gf as sl,Hf as tl,Jf as ul,Kf as vl,Lf as wl,Mf as xl,Nf as yl,Of as zl,Rf as Al}from"./chunk-198fr2d4.js";import{Sf as Wm,Tf as Xm,Uf as Ym,Vf as Zm,Wf as _m,Xf as ln}from"./chunk-j02bjc02.js";import{$f as Dm,Yf as Am,Zf as Bm,_f as Cm,ag as Em,bg as Fm,cg as Gm,dg as Hm,eg as Im,fg as Jm,gg as Km,hg as Lm,ig as Mm,jg as Nm,kg as Om,lg as Pm,mg as $m,ng as an,og as bn,pg as cn,qg as dn,rg as en,sg as fn,tg as gn,ug as hn,vg as jn,wg as kn}from"./chunk-7meemc5z.js";import{xg as Qm,yg as Rm}from"./chunk-0knxnyq6.js";import{Ag as Bn,Bg as Cn,Cg as Dn,Dg as En,Eg as Fn,Fg as Gn,Gg as Hn,Hg as In,Ig as Jn,Jg as Kn,Kg as Ln,zg as An}from"./chunk-634gaa9d.js";import{Lg as qi,Mg as ri,Ng as si,Og as ti,Pg as ui,Qg as vi}from"./chunk-r6xmsxaz.js";import{Rg as Lj,Sg as Mj,Tg as Nj,Xg as Oj,Yg as Pj,Zg as Qj}from"./chunk-karkhcja.js";import{$g as Xj,_g as Wj,ah as Yj,bh as Zj,ch as _j,dh as $j,eh as ak,fh as bk,gh as ck,hh as dk,ih as ek}from"./chunk-ypgyhr2p.js";import{jh as Bj,kh as Cj,lh as Dj,mh as Ej,nh as Fj,ph as Gj,qh as Hj,rh as Ij,sh as Jj,th as Kj}from"./chunk-bcpjhcpn.js";import{uh as wk,wh as xk}from"./chunk-y4zddt5r.js";import{Ch as Lh,Dh as Mh,Eh as Nh,Fh as Oh,Gh as Ph,Hh as Qh}from"./chunk-g7bpkpd4.js";import{Jh as Rh,Kh as Sh,Lh as Th,Mh as Uh,Nh as Vh,Oh as Wh,Ph as Xh,Qh as Yh,Rh as Zh,Sh as _h,Th as $h,Uh as ai,Vh as bi,Wh as ci}from"./chunk-k33778kc.js";import{$h as gi,Yh as di,Zh as ei,_h as fi}from"./chunk-yg0qm73a.js";import{ei as hi}from"./chunk-g1vxsvqv.js";import{hi as kh}from"./chunk-0ppgyq8q.js";import{ii as lh}from"./chunk-fqq5k9ve.js";import{ji as mh,ki as nh}from"./chunk-ya5m5vbn.js";import{li as oh,mi as ph,ni as qh,oi as rh,pi as sh,qi as th}from"./chunk-y4nzmkea.js";import{ri as uh,si as vh,ti as wh,ui as xh,vi as yh}from"./chunk-7kw3grq5.js";import{Ai as Dh,wi as zh,xi as Ah,yi as Bh,zi as Ch}from"./chunk-c79nfdyj.js";import{Bi as Eh,Ci as Fh,Di as Gh,Ei as Hh,Fi as Ih,Gi as Jh,Hi as Kh}from"./chunk-ej8mv2k6.js";import{Ii as ih,Ji as jh}from"./chunk-bab01mkf.js";import"./chunk-ra1s4s6b.js";import{Ni as Oe,Oi as Pe,Pi as Qe,Qi as Re,Ri as Se,Si as Te,Ti as Ue,Ui as Ve,Vi as We,Wi as Xe,Xi as Ye,Yi as Ze,Zi as _e,_i as $e}from"./chunk-benx1c4p.js";import{$i as rf,aj as sf,bj as tf,cj as uf,dj as vf,ej as wf,fj as xf,gj as yf,hj as zf,ij as Af,jj as Bf,kj as Cf,lj as Df,mj as Ef,nj as Ff,oj as Gf,pj as Hf}from"./chunk-pwctc0m1.js";import{Aj as gf,Bj as hf,Cj as jf,Dj as kf,Ej as lf,Fj as mf,Gj as nf,Hj as of,Ij as pf,Jj as qf,wj as cf,xj as df,yj as ef,zj as ff}from"./chunk-0t1yyn1d.js";import{Kj as If,Lj as Jf,Mj as Kf,Nj as Lf,Oj as Mf,Pj as Nf,Qj as Of,Rj as Pf,Sj as Qf,Tj as Rf,Uj as Sf,Vj as Tf,Wj as Uf,Xj as Vf}from"./chunk-k91ej0ts.js";import{pk as Ar,qk as Br,rk as Cr,sk as Dr,tk as Er,uk as Fr}from"./chunk-rargfb5s.js";import{Ak as Tm,Bk as Um,Ck as Vm,vk as Qk,wk as Rk,xk as Sk,yk as Tk,zk as Sm}from"./chunk-necx4e30.js";import"./chunk-frp9fc7j.js";import"./chunk-qg0w5tjb.js";import{nl as ec,ol as fc,sl as gc}from"./chunk-7rj4h2t2.js";import{ul as bc}from"./chunk-qjvny3wf.js";import{$l as Qb,$m as ld,$n as He,$o as yg,$p as mi,$q as Rj,Al as Ca,Am as Ec,An as Qd,Ap as Zg,Aq as aj,Ar as Dk,Bl as Da,Bm as Fc,Bn as Rd,Bo as Xf,Bp as _g,Bq as bj,Br as Ek,Cl as Ea,Cm as Gc,Cn as Sd,Cp as $g,Cq as cj,Cr as Fk,Dl as Fa,Dm as Hc,Dn as Td,Dp as ah,Dq as dj,Dr as Gk,El as Ga,Em as Ic,En as Ud,Ep as bh,Eq as ej,Fl as Ha,Fm as Jc,Fn as Vd,Fp as ch,Fq as fj,Gl as Ia,Gm as Kc,Gn as Wd,Gp as dh,Gq as gj,Hl as Ja,Hm as Lc,Hn as Xd,Hp as eh,Hq as hj,Il as Ka,Im as Mc,In as Yd,Io as Yf,Ip as fh,Iq as ij,Jl as La,Jm as Nc,Jn as Zd,Jp as gh,Jq as jj,Kl as Ma,Km as Oc,Kn as _d,Ko as Zf,Kp as hh,Kq as kj,Ll as Na,Lm as Pc,Ln as $d,Lp as ii,Lq as lj,Ml as Oa,Mm as Zc,Mn as qe,Mo as _f,Mp as ji,Mq as mj,Nl as ib,Nm as _c,Nn as re,No as $f,Nq as nj,Ol as jb,Om as $c,On as se,Oo as ag,Oq as oj,Pl as kb,Pm as ad,Pn as te,Po as bg,Pp as ki,Pq as pj,Ql as lb,Qm as bd,Qn as ue,Qo as cg,Qq as qj,Rl as mb,Rm as cd,Rn as ve,Ro as dg,Rq as rj,Sl as nb,Sm as dd,Sn as we,So as pg,Sq as sj,Tn as xe,To as qg,Tq as tj,Um as ed,Un as ye,Uo as rg,Uq as uj,Vl as Kb,Vm as fd,Vn as ze,Vo as sg,Vq as vj,Wl as Lb,Wm as gd,Wn as Ae,Wo as tg,Wq as wj,Xl as Mb,Xm as hd,Xn as Be,Xo as ug,Xq as xj,Yl as Nb,Ym as id,Yn as Ce,Yo as vg,Yq as yj,Zl as Ob,Zm as jd,Zn as De,Zo as wg,Zq as zj,_l as Pb,_m as kd,_o as xg,_p as li,_q as Aj,am as Ub,an as md,ao as Ie,ap as zg,aq as ni,ar as Sj,bm as Vb,bn as nd,bo as Je,bp as Ag,bq as oi,br as Tj,cm as Wb,cn as od,co as Ke,cp as Bg,cq as pi,cr as Uj,dm as hc,dn as pd,do as Le,dp as Cg,dq as wi,dr as Vj,em as ic,en as ud,eo as Me,ep as Dg,eq as xi,er as fk,fm as jc,fn as vd,fo as Ne,fp as Eg,fq as yi,fr as gk,gm as kc,gn as wd,gp as Fg,gq as zi,gr as hk,hm as lc,hn as xd,hp as Gg,hq as Ai,hr as ik,im as mc,in as yd,ip as Hg,iq as Bi,ir as jk,jm as nc,jn as zd,jo as af,jp as Ig,jq as Ci,jr as kk,km as oc,kn as Ad,ko as bf,kp as Jg,kq as Di,kr as lk,lm as pc,ln as Bd,lp as Kg,lq as Ei,lr as mk,mm as qc,mn as Cd,mo as Wf,mp as Lg,mq as Fi,mr as nk,nm as rc,nn as Dd,np as Mg,nq as Gi,nr as ok,om as sc,on as Ed,op as Ng,oq as Hi,or as pk,pm as tc,pn as Fd,pp as Og,pq as Ii,pr as qk,qm as uc,qn as Gd,qp as Pg,qq as Ji,qr as rk,rm as vc,rn as Hd,rp as Qg,rq as Ki,rr as sk,sm as wc,sn as Id,sp as Rg,sq as Li,sr as tk,tm as xc,tn as Jd,tp as Sg,tq as Mi,tr as uk,um as yc,un as Kd,up as Tg,uq as Ni,ur as vk,vl as xa,vm as zc,vn as Ld,vp as Ug,vq as Xi,vr as yk,wl as ya,wm as Ac,wn as Md,wp as Vg,wq as Yi,wr as zk,xl as za,xm as Bc,xn as Nd,xp as Wg,xq as Zi,xr as Ak,yl as Aa,ym as Cc,yn as Od,yp as Xg,yq as _i,yr as Bk,zl as Ba,zm as Dc,zn as Pd,zp as Yg,zq as $i,zr as Ck}from"./chunk-2119txb8.js";import{$r as ja,Er as M,Fr as N,Gr as O,Hr as P,Ir as Q,Jr as R,Kr as S,Lr as T,Mr as U,Nr as V,Or as W,Pr as X,Qr as Y,Rr as Z,Sr as _,Tr as $,Ur as aa,Vr as ba,Wr as ca,Xr as da,Yr as ea,Zr as fa,_r as ia,as as ka,bs as la,cs as ma,ds as na,es as oa,fs as pa,gs as qa,hs as ra,is as sa,js as ta,ks as ua,ls as va,ms as wa}from"./chunk-jc6wrxrh.js";import{ns as ga,os as ha}from"./chunk-2xpdcr8c.js";import{ps as Rb,qs as Sb,rs as Tb}from"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import{As as Qi,Bs as Ri,Cs as Si,Ds as Ti,Es as Ui,Fs as Vi,Gs as Wi,ys as Oi,zs as Pi}from"./chunk-135mme4g.js";import{$s as Tc,Ys as Qc,Zs as Rc,_s as Sc,at as Uc,ct as Vc,lt as Wc,mt as Xc,nt as Yc}from"./chunk-dj24n5n7.js";import{ot as Xb,pt as Yb,qt as Zb,rt as _b,st as $b,tt as ac}from"./chunk-w1asc0zd.js";import{At as Ee,Ct as Fe,Ft as Ge}from"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import{Kt as cc,Lt as dc}from"./chunk-xk402w4a.js";import{Pt as eg,Qt as fg,Rt as gg,St as hg,Tt as ig,Ut as jg,Vt as kg,Xt as lg,Yt as mg,Zt as ng,_t as og}from"./chunk-dnard9gp.js";import{$t as qd,Au as oe,Bu as pe,au as rd,bu as sd,cu as td,mu as ae,nu as be,ou as ce,pu as de,qu as ee,ru as fe,su as ge,tu as he,uu as ie,vu as je,wu as ke,xu as le,yu as me,zu as ne}from"./chunk-vgx5077x.js";import{$u as A,Cu as b,Du as c,Eu as d,Fu as e,Gu as f,Hu as g,Iu as h,Ju as i,Ku as j,Lu as k,Mu as l,Nu as m,Ou as n,Pu as o,Qu as p,Ru as q,Su as r,Tu as s,Uu as t,Vu as u,Wu as v,Xu as w,Yu as x,Zu as y,_u as z,av as B,bv as C,cv as D,dv as E,ev as F,fv as G,gv as H,hv as I,iv as J,jv as K,kv as L}from"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import{Av as ob,Bv as pb,Cv as qb,Dv as rb,Ev as sb,Fv as tb,Gv as ub,Hv as vb,Iv as wb,Jv as xb,Kv as yb,Lv as zb,Mv as Ab,Nv as Bb,Ov as Cb,Pv as Db,Qv as Eb,Rv as Fb,Sv as Gb,Tv as Hb,Uv as Ib,Vv as Jb}from"./chunk-7racewc5.js";import{Aw as fb,Bw as gb,Dw as hb,Zv as Pa,_v as Qa,bw as Ra,gw as Sa,hw as Ta,nw as Ua,ow as Va,pw as Wa,qw as Xa,rw as Ya,sw as Za,tw as _a,uw as $a,vw as ab,ww as bb,xw as cb,yw as db,zw as eb}from"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{il as writeNetlifyConfig,an as writeManifest,Nl as writeImageManifest,tp as wrapComponentForHMR,as as withDefaults,vk as webComponentDirectiveHandler,iq as watermark,kr as watchViews,Xl as watchMultiple,Yl as watchEffect,Wl as watch,Le as warmImagePlaceholders,jm as waitForStore,X as waitForLocale,ep as virtualPathFor,ik as videoDirective,G as validators,es as validated,Be as validateValueEnhanced,li as validateTemplate,Qm as validateRouteRules,nq as validateParams,Ce as validateFormEnhanced,$q as validateFile,xe as validateFields,we as validateField,ni as validateDirective,Wd as validateCspDirectives,Dk as validateConfig,on as validateComponentScripts,Mn as validateComponentProps,hh as validateClientScript,gi as v,Hc as usesSignalsInScript,ub as usesReactiveRuntime,Bi as userComponentFileExists,Oh as useVirtualList,ie as useTitle,im as useStoreOrThrow,Lp as useStore,Uk as useStorage,zf as useSlots,Wk as useSessionStorage,cc as useServerRuntimeConfig,Xf as useServerData,fe as useSeoMeta,dc as useRuntimeConfig,km as useRouteParams,mm as useRouteParamOrThrow,lm as useRouteParam,ie as usePageTitle,qf as useOptimistic,Ef as useModel,om as useMiddlewareValue,nm as useMiddlewareState,Vk as useLocalStorage,mp as useLoadingIndicator,de as useHead,di as useForm,Bf as useAttrs,br as uploadFiles,ar as uploadFile,fm as updateInstance,of as untrack,Ri as unregisterDirective,gm as unmountInstance,Pc as unescapeHtml,ip as typecheckStxFiles,zi as transpileTypeScript,Pr as translate,Ba as transitionDirective,lc as transformAutoImports,Gn as toUsers,Fn as toUser,Tp as thumbnail,Uq as thumbHashToRGBA,Vq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,If as templateCache,md as syncRecordedResponse,qp as stxClientHelpers,jg as structuredDataDirective,Sr as stripLocalePrefix,Nm as stripDocumentWrapper,Sb as stripCommentsAndLiterals,ro as stringToStream,Kd as strictCspPreset,We as streamingSuspenseDirective,_e as streamToResponse,Ue as streamTemplateSimple,Oe as streamTemplate,Pk as stopHmrServer,Cn as stopBroadcasting,_b as stateDirName,$b as stateDir,cf as state,bh as startsDocument,Mo as startProductionServer,Ho as startInteractive,Bn as startBroadcasting,Ur as stampLocaleLayoutGroup,Ia as staggerDirective,lq as srcsetUrls,Ja as springDirective,td as splitByPipe,Jm as spaNavVaryHeaders,fp as sourcePathFor,sq as smartBatchSign,Di as slotContentHasExpressions,qq as signUrl,xi as shouldTranspileTypeScript,Mk as shouldReloadOnChange,vq as shouldRefreshSignature,Nk as shouldIgnoreFile,Gh as shouldCacheComponent,Xp as sharpen,hs as shape,Zb as setStateDir,sm as setRouteParams,tm as setMiddlewareState,Ke as setImagePlaceholder,tf as setGlobalProvide,b as setErrorLocale,Pl as setCurrentInstance,Yj as setCachedVideoResult,Nj as setCachedImageResult,Hj as setCached,ks as serveStxFile,ms as serveMultipleStxFiles,Hk as serveMarkdownFile,Xo as serveFile,ns as serveApp,Wo as serve,wp as serializeState,cn as serializeSetCookie,Zp as sepia,ge as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,Ai as scopeOnRootElement,mk as scopeHTML,lk as scopeCSS,mg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,bq as saturation,oq 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,Gb as runtimeEventRegexLiteral,Eb as runtimeDirectiveNamesLiteral,xg as runPreProcessingMiddleware,yg as runPostProcessingMiddleware,fn as runPageAction,jf as runMountCallbacks,gb as runMiddleware,dm as runHooks,Ir as runDoctor,kf as runDestroyCallbacks,Bg as runComposers,cq as rotate,hi as rewriteImagesWithSiblings,nd as responseBindings,Hi as resolveTemplatePath,ha as resolveStxTargets,zk as resolveStxDirectories,Or as resolveI18n,Rp as resize,pg as resetUnscopedSignalWarnings,Nc as resetRejectedExpressionWarnings,sc as resetPlaceholders,ce as resetHead,vp as resetHMRHandler,o as resetErrorConfig,cs as required,bg as reportDeferredLoopWarnings,wc as replacePlaceholders,Ec as replaceInterpolations,ir as renderView,fk as renderVideoComponent,ic as renderVendorStyleTags,rr as renderToString,sr as renderToStream,tr as renderToDOM,Tq as renderThumbhashToCanvas,Fr as renderTemplateString,Dr as renderTemplate,Er as renderString,Re as renderStreamingPage,si as renderSlot,wh as renderSSRSuspense,Dq as renderProtectedVideo,Cq as renderProtectedImg,pq as renderMediaUpload,Cr as renderMarkdownView,Um as renderLayoutTypes,Rj as renderImgComponent,Dl as renderImageComponent,ke as renderHtmlAttrs,je as renderHead,lr as renderEmail,Fi as renderComponentWithSlot,le as renderBodyAttrs,Gp as render,Md as relaxedCspPreset,ve as registerValidationRule,Ye as registerStreamingDirectives,Np as registerStoresClient,qm as registerStore,Qf as registerServeModuleBundle,kg as registerSeoDirectives,_a as registerMiddleware,Ac as registerFilters,zc as registerFilter,d as registerErrorMessages,Ae as registerEnhancedValidationRule,Oi as registerDirective,Vd as registerCspDirectives,Pn as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,mc as referencesName,Tl as ref,zo as redirect,id as recordResponseStatus,jd as recordResponseHeader,ac as rebaseOntoStateDir,kd as readResponseStatus,ld as readResponseHeaders,Fk as readMarkdownFile,Jf as readFileCached,Ul as reactive,gq as quality,Aq as pruneSignatureCache,Kj as pruneCache,rf as provide,Br as protectCodeBlocks,bs as prop,Eg as processVueTemplate,Mh as processVirtualListDirectives,Qh as processVirtualGridDirectives,ek as processVideo,ye as processValidateDirective,ea as processTranslateDirective,qh as processTransitionDirectives,th as processTransitionAttributes,oe as processTitleDirective,ad as processTemplateBindings,mh as processTeleportDirectives,uh as processSuspenseDirectives,fg as processStructuredData,Se as processStreamDirectives,od as processStatusDirective,bi as processStaticDirectives,vg as processStackReplacements,ug as processStackPushDirectives,ti as processSlots,Lm as processShell,Ne as processServerBindings,gg as processSeoDirective,Ze as processSectionDirectives,Uc as processScopedStyles,_c as processReactiveBindings,Eq as processProtectedMedia,Wh as processPartialHydrationDirectives,gh as processOnceDirective,wg as processMiddleware,eg as processMetaDirectives,pe as processMetaDirective,Gk as processMarkdownFileDirectives,Mi as processMarkdownDirectives,cg as processLoops,Eh as processKeepAliveDirectives,fh as processJsonDirective,Ph as processInfiniteListDirectives,tg as processIncludes,Tj as processImgComponents,Fl as processImageComponents,sl as processImage,ne as processHeadDirective,re as processForms,te as processFormInputDirectives,Lc as processExpressions,Pb as processEventDirectives,ue as processErrorDirective,Fg as processDynamicComponents,ii as processDirectives,Wi as processDirectiveAttributes,lh as processDeferDirectives,_d as processCustomDirectives,Sd as processCspDirectives,is as processComponentProps,rc as processClientScript,se as processBasicFormDirectives,zh as processAsyncDirectives,$d as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ge as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,lp as preloadIslandHandlers,Me as preloadIconCollection,xn as poolStrings,xk as pluginManager,Ie as placeholdersWarmed,ph as performLeave,oh as performEnter,lf as pendingLifecycleCounts,pf as peek,qg as partialsCache,gk as parseVideoDirectiveOptions,Pp as parseUrl,Wq as parseThumbhashString,zd as parseSwitchBlock,qi as parseSlots,ri as parseSlotElement,Ed as parseScriptDeclarations,tk as parseSFCComponent,Fq as parseProtectedArgs,ag as parseLoopBinding,Sj as parseImgComponent,ij as parseImageUrl,El as parseImageComponent,dn as parseFormBody,Bd as parseExpressionWithFilters,Qn as parseDefaults,wo as parseCookies,Cm as parseContainerSelector,wd as parseConditionalBlock,Cd as parseArguments,Ma as parseAnimationShorthand,ds as optional,yn as optimizeTemplate,Kl as optimizeImage,Ll as optimizeDirectory,fs as oneOf,rg as onceStore,am as onUpdated,Zc as onUpdate,cm as onUnmounted,xm as onServer,_l as onMounted,gf as onMount,ai as onHydrated,xf as onErrorCaptured,hf as onDestroy,Kh as onDeactivated,wm as onClient,$l as onBeforeUpdate,bm as onBeforeUnmount,Zl as onBeforeMount,Jh as onActivated,Pq as observeElement,Ao as notFound,Kg as normalizeCriticalHeadOrder,wf as nextTick,Tn as negotiateEncoding,Ua as navigateTo,em as mountInstance,Ea as motionDirective,Ld as moderateCspPreset,wn as minifyHtml,ig as metaDirective,Vg as metaDedupKey,Qp as mergeParams,Xg as mergeHtmlAttrs,ee as mergeHeadConfigs,Rc as mergeCssConfig,Pd as mergeCspDirectives,Ra as matchRoute,Ni as markdownDirectiveHandler,Ek as markdownCache,ga as looksLikeGlob,Rr as localizePath,U as loadTranslationLazy,_ as loadTranslation,Ak as loadStxConfig,db as loadMiddlewareFromDirectory,bn as loadManifest,Lq as loadElement,Dn as loadChannels,Lb as listensPassively,Yr as lintStxStrict,Nq as lazyLoadAll,Mq as lazyLoad,Ha as keyframeDirective,pr as jsxs,qr as jsxDEV,or as jsx,yo as jsonResponse,Xe as islandDirective,l as isTest,Om as isSpaNavigation,Hm as isSpaNavRequest,tq as isSignatureValid,mf as isSignal,ql as isSharpAvailable,ko as isServerEnvironment,um as isServer,yb as isRuntimeOwnedColonAttr,Hb as isRuntimeEventName,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Iq as isNativeLazySupported,Ar as isMarkdownPath,Q as isLoading,R as isLoaded,wi as isJavaScriptScript,Jq as isIntersectionObserverSupported,yl as isImageFile,rl as isImageBackendAvailable,aa as isICUFormat,$h as isHydrated,Ci as isHydrateTrigger,gd as isHttpStatus,jo as isEdgeEnvironment,Zr as isDirectiveKind,k as isDevelopment,nf as isDerived,Lk as isCssOnlyChange,Sn as isCompressible,vm as isClient,Bh as isAsyncComponent,en as isActionableMethod,_p as invert,Lf as invalidateFileCacheByDir,Kf as invalidateFileCache,Kc as interpolateScriptsInTemplate,Ic as interpolateScriptExpressions,Jc as interpolateScriptAttributes,x as inlineError,Nr as injectThemeBootstrap,hg as injectSeoTags,Kr as injectSeo,Wf as injectRouterScript,Kk as injectHotReload,kb as injectHeatmap,Yc as injectCss,Qd as injectCspMetaTag,dh as injectConfigHeadTags,Jg as injectColorModeBootScript,Zg as injectCloakStyle,Qg as injectBuildId,kc as injectBrowserCoreAutoImports,cd as injectAnalytics,sf as inject,pm as initStoreRegistry,ll as initNetlify,np as initLoadingIndicator,Kq as initLazyLoading,Go as initFile,Sq as initBlurUp,Yq as initAllBlurUp,Vj as imgDirective,Il as imageDirective,jn as hydrateTemplateStream,hn as hydrateTemplate,kp as hydrateIslands,Yh as hydrateIsland,kn as hydrateFragment,Zh as hydrateByStrategy,_h as hydrateAll,Dp as hydrate,Vo as htmlResponse,$g as hoistLeadingHeadTags,Lg as hoistColorModeBootScript,lb as heatmapDirective,Dj as hashString,Vf as hashFilePath,Bj as hashFile,Cj as hashBuffer,Dg as hasVueTemplateSyntax,$f as hasVariables,Ip as hasStore,xc as hasPlaceholders,jl as hasNetlifyConfig,ab as hasMiddleware,Qb as hasEventDirectives,ch as hasDocumentShell,oi as hasDirectives,ma as hasDOMSupport,Bl as handleImageRequest,yf as handleError,xr as h,xl as groupVariantsByFormat,Yp as grayscale,Oo as gitHash,qn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,el as getTotalSize,uq as getTimeUntilExpiry,ih as getStoreScript,Jp as getStoreNames,Hp as getStore,Zk as getStorageSize,Yk as getStorageKeys,Ii as getSourceLineInfo,yi as getSharedTranspiler,Rf as getServeModuleBundle,Pf as getServeClientAsset,la as getScreenReaderOnlyStyle,nk as getScopeAttribute,bf as getRouteParams,Vb as getPublicEnvDefine,Wb as getPublicEnv,mi as getPositionInfo,uc as getPlaceholderRegistry,Aj as getPlaceholderCacheStats,be as getPageMeta,Gd as getNonce,zl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,He as getImagePlaceholder,tl as getImageMetadata,Ee as getImageDelivery,Cp as getHydrationRuntime,rm as getHydratedStoreState,Ok as getHmrServer,ae as getHead,up as getHMRHandler,mj as getFormatExtension,Fj as getFileMtime,wl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Qi as getDirectives,Pi as getDirective,Ql as getCurrentInstance,Vc as getCssServeAsset,Od as getCspPreset,Xd as getCspHeaderName,Li as getComponentCacheStats,Xj as getCachedVideoResult,yq as getCachedSignature,Nf as getCachedSignalsRuntime,Of as getCachedRouterScript,yj as getCachedPlaceholder,Mj as getCachedImageResult,Gj as getCached,Jj as getCacheStats,Og as getBuildId,An as getBroadcastServer,lj as getBestVariant,Bc as getAllFilters,$i as generateWidthSrcset,Nh as generateVirtualListCSS,dr as generateVideoPreview,De as generateValidationScript,er as generateUploadRuntime,rn as generateTreeShakenBundle,sh as generateTransitionRuntime,rh as generateTransitionCSS,$j as generateThumbnails,rj as generateThumbhashPlaceholder,ao as generateTemplatesDocs,yh as generateSuspenseRuntime,xh as generateSuspenseCSS,xp as generateStateScript,jj as generateSrcsetData,Qj as generateSrcset,ul as generateSrcSet,ak as generateSpriteSheet,mr as generateSpaShell,kj as generateSourceTags,fj as generateSizesFromBreakpoints,ej as generateSizesAttribute,vl as generateSizes,lg as generateSitemapIndex,Lr as generateSitemap,Hq as generateSimpleMediaPicker,Bq as generateSignatureRuntime,Hf as generateSignalsRuntimeDev,Gf as generateSignalsRuntime,qc as generateServerDataBridge,kk as generateScopeId,uk as generateSFCWebComponent,Nb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,ng as generateRobotsTxt,Mr as generateRobots,Pj as generateResponsiveVariants,qk as generateReactiveWebComponentTS,pk as generateReactiveWebComponent,sk as generateReactiveRuntime,rk as generateReactiveMixin,_j as generatePoster,xj as generatePlaceholderStyle,wj as generatePlaceholderCSS,qj as generatePlaceholder,Xh as generatePartialHydrationCSS,Fd as generateNonce,fl as generateNetlifyToml,gr as generateMinifiedMediaRuntime,fr as generateMediaRuntime,Gq as generateMediaManagerEmbed,$m as generateManifest,pp as generateLoadingIndicatorHtml,Rq as generateLazyLoadRuntime,Vm as generateLayoutTypes,tj as generateLQIP,Ih as generateKeepAliveRuntime,Hh as generateKeepAliveCSS,ci as generateIslandManifest,cr as generateImagePreview,Ml as generateImageManifest,Bp as generateHydrationScript,$e as generateHydrationRuntime,Ep as generateHydrationCSS,Rh as generateHydrationBootstrap,Jk as generateHotReloadScript,jb as generateHeatmapScript,sp as generateHMRClientScript,bk as generateHLSManifest,yp as generateEventBindings,dj as generateDprSrcsetWithVariableQuality,cj as generateDprSrcset,ah as generateDocumentShell,go as generateDocs,bo as generateDirectivesDocs,Vi as generateDirectiveRuntime,og as generateDefaultRobotsTxt,ck as generateDASHManifest,Xc as generateCss,Jd as generateCspMetaTag,Id as generateCspHeader,Df as generateCompositionRuntime,$n as generateComponentsDocs,Sh as generateComponentManifest,Zn as generateComponentDoc,vj as generateColorPlaceholder,Ig as generateColorModeBootScript,hm as generateClientRuntime,Ej as generateCacheKey,oc as generateBrowserAutoImportDestructuring,Zq as generateBlurUpRuntime,_q as generateBlurUpCSS,$c as generateBindingsRuntime,aj as generateAutoWidthSrcset,nc as generateAutoImportDestructuring,Dh as generateAsyncComponentRuntime,Ch as generateAsyncComponentCSS,fc as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,bd as generateAnalyticsScript,jp as formatTypecheckDiagnostics,cp as formatTypeErrors,Do as formatStxContent,dl as formatSize,Ta as formatRoutes,Eo as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Jr as formatDoctorReport,co as formatDocsAsMarkdown,fo as formatDocsAsJson,eo as formatDocsAsHtml,fq as format,vn as foldConstants,eq as flipVertical,dq as flipHorizontal,Wm as fingerprint,hp as findStxModuleDeclarations,gp as findRuntimeTypeDeclarations,Hr as findPantryPackage,Dc as findMustacheEnd,vd as findMatchingEndTag,rd as findMatchingDelimiter,Rb as findInterpolationEnd,xd as findIfBlocks,Ad as findExpressions,Sa as findErrorPage,Sc as findDuplicateScopedStyleRanges,yd as findDirectiveBlocks,sn as findDeadCode,sn as findDeadBranches,Dm as findContainerRegion,_n as findComponentFiles,ls as findCommonDir,cl as filterRequiredFiles,Gi as fileExists,Yf as extractVariables,ki as extractTemplateExpressions,Te as extractStreamBoundaries,zp as extractState,ui as extractSlotContent,_f as extractScriptFromTemplate,ji as extractScriptBlocks,vc as extractPlaceholders,ud as extractParenthesizedExpression,hd as extractPageResponseStatus,hb as extractLayoutMetadata,uj as extractDominantColor,Dd as extractDirectiveParams,pi as extractDirectiveNames,Pm as extractContainerContent,Xn as extractComponentProps,Th as extractComponentName,Yn as extractComponentDescription,Wc as extractClassNames,pc as extractBridgeData,Uh as extractBoundProps,sd as extractBalancedExpression,hc as extractAndStripCssImports,ok as extractAndScopeStyles,Ob as extractAndProcessEvents,Sk as externalizeSharedAssets,Tk as externalizeRepeatedAssets,Rk as externalizeHtml,Oc as evaluateExpression,un as evaluateConstant,pd as evaluateAuthExpression,Gc as escapeHtmlValue,Fc as escapeHtml,C as errorRecovery,E as errorLogger,nh as ensureTeleportTargets,eh as ensureDocumentShell,ze as enhancedValidationRules,Vn as enableDevTools,tn as eliminateDeadCode,ef as effect,mq as dprUrls,ho as docsCommand,ec as discoverServerApi,Tm as discoverLayoutNames,Qq as disconnectObserver,Wn as disableDevTools,F as devHelpers,Km as detectShell,io as detectRuntime,gl as detectProjectConfig,nj as detectFormat,nn as detectBuildMode,df as derived,kl as deploy,Ck as defineStxConfig,Mp as defineStore,Af as defineSlots,Xr as defineSiteConfig,$r as definePropsWithValidation,_r as defineProps,wk as definePlugin,he as definePageMeta,Wa as defineMiddleware,ei as defineForm,vf as defineExpose,uf as defineEmits,Si as defineDirective,zr as defineCustomElement,Lo as defineConfig,Ti as defineClientDirective,Ah as defineAsyncComponent,No as defineApiHandler,hr as defaultMediaConfig,Ol as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,qe as defaultFormClasses,yc as defaultFilters,Zd as defaultCspConfig,yk as defaultConfig,js as default,Qc as deepMergeThemes,Tc as dedupeScopedStyles,Gm as decodeTitleEntities,sj as decodeThumbhash,dg as declareBareLoopHead,Ud as cspNonceDirective,Td as cspDirective,Xq as crossfadeTransition,Sp as crop,Lh as createVirtualList,hk as createVideoDirective,uo as createVercelHandler,$o as createTypeChecker,fa as createTranslateFilter,qo as createTextEncoderStream,yr as createStxApp,po as createStreamingResponse,Ve as createStreamRenderer,Kp as createStore,Za as createStorageManager,Xa as createServerCookieManager,gc as createServerApi,Sl as createScope,vh as createSSRSuspense,af as createRouter,Rm as createRouteRuleResolver,eb as createRouteLocation,Zo as createRoute,Tl as createRef,Ul as createReactive,Cf as createProvideContext,Qo as createProject,Ko as createProductionBuild,tc as createPlaceholder,zn as createOptimizedBuild,vo as createNetlifyHandler,_k as createNetlifyClient,fb as createMiddlewareContext,Yo as createMiddleware,Oq as createLazyObserver,Fh as createKeepAliveCache,mo as createKVNamespace,Vh as createIslandRegistry,Uj as createImgDirective,Jl as createImagePlugin,Cl as createImageHandler,Hl as createImageDirective,nb as createHeatmapAggregator,bl as createFileManifest,lo as createEnvAccessor,z as createEnhancedError,oo as createEdgeHandler,no as createEdgeCache,Ji as createDetailedErrorMessage,to as createDenoHandler,hl as createDefaultNetlifyConfig,Yd as createCspHeaders,xo as createCookie,Vl as createComputed,Rl as createComponentInstance,so as createCloudflareHandler,Ya as createClientCookieManager,Ui as createBuiltinDirectives,yr as createApp,Ka as createAnimationTimeline,Vp as cover,Zf as convertToCommonJS,aq as contrast,Up as contain,y as consoleError,m as configureErrorHandling,Bk as config,Vl as computed,Un as compressResponse,Ag as composerPattern,zg as composer,Mm as composeShellWithPage,On as componentDirective,Ei as componentClientSignalNames,_m as compileTemplate,a as collectRepeatedFlag,al as collectDeployFiles,_g as cloakStyleFragment,Zj as clearVideoCache,N as clearTranslationCache,jh as clearStoreCache,Xk as clearStorage,zq as clearSignatureCache,Ff as clearServerData,zj as clearPlaceholderCache,sg as clearOnceStore,Hd as clearNonce,bb as clearMiddleware,Je as clearImagePlaceholders,Fe as clearImageDeliveryCatalog,Gl as clearImageCache,e as clearErrorMessages,Sf as clearDevCaches,Cc as clearCustomFilters,Cg as clearComposers,kh as clearComposableCache,Ki as clearComponentCache,Ij as clearCache,Ib as clearBlankCache,op as cleanupLoadingIndicator,Am as classifyScript,Bm as classifyAllScripts,ap as checkTemplateFile,bp as checkTemplate,Tf as checkCache,wq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Jn as channel,Co as captureScreenshots,Bo as captureScreenshot,Z as cancelPendingLoads,$k as calculateSha1,bj as calculateOptimalWidths,Uf as cacheTemplate,bc as cacheEngineFingerprint,jk as buildWebComponents,dp as buildVirtualSource,jr as buildViews,Op as buildUrl,Pe as buildSuspenseResolveScript,Wr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Xm as buildRuntimeAsset,Ym as buildRouterAsset,Vr as buildLangPickerScript,hj as buildImageUrl,Rg as buildIdFragment,Wg as buildHtmlAttrs,ln as buildForProduction,Rn as buildComponentLibrary,xq as buildAuthParams,mn as buildApp,Tr as buildAlternateLinks,Jo as build,Hn as broadcastPrivate,In as broadcastPresence,En as broadcast,$p as brightness,Tb as bracketDepths,Wp as blur,Jb as blankInertHtmlRegions,rq as batchSignUrls,ff as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,hq as auto,ja as attributeValue,Zm as assetTags,Mb as asInvocableStatement,gs as arrayOf,Qr as applyTranslations,Oj as applyTransformations,vi as applySlots,Nn as applyPropDefaults,kq as applyPreset,Yg as applyHtmlAttrs,me as applyHead,Mc as applyFilters,Im as appendVary,Nd as apiCspPreset,Da as animationGroupDirective,dk as analyzeVideo,pn as analyzeUsage,ym as analyzeTemplate,zm as analyzeProject,pn as analyzeDirectiveUsage,dd as analyticsDirective,To as addStore,So as addPage,Rd as addNonceToInlineContent,Uo as addLayout,Ro as addComponent,gn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Mf as __setSignalsGeneratorsForTest,Pg as __setBuildIdForTest,Wj as VideoProcessorCache,fi as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,qd as Tokenizer,_o as TemplateTypeChecker,Fo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,ur as Show,Qe as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,jc as STX_AUTO_IMPORTS,Yb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Em as SPA_NAV_HEADER,Kb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Fb as RUNTIME_EVENT_NAMES,Db as RUNTIME_DIRECTIVE_NAMES,ed as RESPONSE_STATUS_KEY,fd as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Io as ProductionBuild,wr as Portal,Po as PROJECT_TEMPLATES,jq as PRESETS,sb as NON_CLIENT_PRIMITIVES,Fp as MemorySessionStore,_i as MIME_TYPES,Xi as MEDIA_DEFAULT_WIDTHS,Zi as MEDIA_DEFAULT_FORMATS,Sm as LAYOUT_TYPES_FILE,Lj as ImageProcessorCache,Al as ImageProcessingError,Ap as HydrationRuntime,Ik as HotReloadServer,mb as HeatmapAggregator,Ug as HTML_CLASS_MARKER,Tg as HTML_ATTRS_MARKER,nr as Fragment,vr as For,Fm as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Qk as EXTERNALIZED_ASSET_DIR,ml as DeployError,nl as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Xb as DEFAULT_STATE_DIR,pl as DEFAULT_QUALITY,oj as DEFAULT_PLACEHOLDER_OPTIONS,ol as DEFAULT_FORMATS,Yi as DEFAULT_DPR_VALUES,rp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,gj as COMMON_SIZES,Gg as COLOR_MODE_BOOT_MARKER,Hg as COLOR_MODE_BOOT_GLOBAL,Sg as CLOAK_STYLE,Ln as BroadcastServer,Kn as Broadcast,Mg as BUILD_ID_META,Ng as BUILD_ID_HEADER,Ub as BROWSER_CORE_IMPORTS,pj as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,Gr as $path};
|
|
2
|
+
import{$ as km,$a as no,$b as yp,$c as yq,$d as yr,A as Wk,Aa as yn,Ab as So,Ac as Zp,Ad as Zq,Ae as ds,B as Xk,Ba as zn,Bb as To,Bc as _p,Bd as _q,Be as es,C as Yk,Ca as Mn,Cb as Uo,Cc as $p,Cd as $q,Ce as fs,D as Zk,Da as Nn,Db as Vo,Dc as aq,Dd as ar,De as gs,E as Pl,Ea as On,Eb as Wo,Ec as bq,Ed as br,Ee as hs,F as Ql,Fa as Pn,Fb as Xo,Fc as cq,Fd as cr,Fe as is,G as Rl,Ga as Qn,Gb as Yo,Gc as dq,Gd as dr,Ge as js,H as Sl,Ha as Rn,Hb as Zo,Hc as eq,Hd as er,He as ks,I as Tl,Ia as Vn,Ib as _o,Ic as fq,Id as fr,Ie as ls,J as Ul,Ja as Wn,Jb as $o,Jc as gq,Jd as gr,Je as ms,K as Vl,Ka as Xn,Kb as ap,Kc as hq,Kd as hr,Ke as ns,L as Wl,La as Yn,Lb as bp,Lc as iq,Ld as ir,M as Xl,Ma as Zn,Mb as cp,Mc as jq,Md as jr,N as Yl,Na as _n,Nb as kp,Nc as kq,Nd as kr,O as Zl,Oa as $n,Ob as lp,Oc as lq,Od as lr,P as _l,Pa as ao,Pb as mp,Pc as mq,Pd as mr,Q as $l,Qa as bo,Qb as np,Qc as nq,Qd as nr,R as am,Ra as co,Rb as op,Rc as oq,Rd as or,S as bm,Sa as eo,Sb as pp,Sc as pq,Sd as pr,T as cm,Ta as fo,Tb as qp,Tc as qq,Td as qr,U as dm,Ua as go,Ub as rp,Uc as rq,Ud as rr,V as em,Va as ho,Vb as sp,Vc as sq,Vd as sr,W as fm,Wa as io,Wb as tp,Wc as tq,Wd as tr,X as gm,Xa as jo,Xb as up,Xc as uq,Xd as ur,Y as hm,Ya as ko,Yb as vp,Yc as vq,Yd as vr,Z as im,Za as lo,Zb as wp,Zc as wq,Zd as wr,_ as jm,_a as mo,_b as xp,_c as xq,_d as xr,aa as lm,ab as oo,ac as zp,ad as zq,ae as zr,ba as mm,bb as po,bc as Ap,bd as Aq,be as Gr,ca as nm,cb as qo,cc as Bp,cd as Bq,ce as Hr,da as om,db as ro,dc as Cp,dd as Cq,de as Ir,ea as pm,eb as so,ec as Dp,ed as Dq,ee as Jr,fa as qm,fb as to,fc as Ep,fd as Eq,fe as Kr,ga as rm,gb as uo,gc as Fp,gd as Fq,ge as Lr,ha as sm,hb as vo,hc as Gp,hd as Gq,he as Mr,ia as tm,ib as wo,ic as Hp,id as Hq,ie as Nr,ja as um,jb as xo,jc as Ip,jd as Iq,je as Or,ka as vm,kb as yo,kc as Jp,kd as Jq,ke as Pr,la as wm,lb as zo,lc as Kp,ld as Kq,le as Qr,ma as xm,mb as Ao,mc as Lp,md as Lq,me as Rr,na as ym,nb as Do,nc as Mp,nd as Mq,ne as Sr,o as a,oa as zm,ob as Eo,oc as Np,od as Nq,oe as Tr,p as Hk,pa as nn,pb as Fo,pc as Op,pd as Oq,pe as Ur,q as Ik,qa as on,qb as Go,qc as Pp,qd as Pq,qe as Vr,r as Jk,ra as pn,rb as Io,rc as Qp,rd as Qq,re as Wr,s as Kk,sa as qn,sb as Jo,sc as Rp,sd as Rq,se as Xr,t as Lk,ta as rn,tb as Ko,tc as Sp,td as Sq,te as Yr,u as Mk,ua as sn,ub as Lo,uc as Tp,ud as Tq,ue as Zr,v as Nk,va as tn,vb as No,vc as Up,vd as Uq,ve as _r,w as Ok,wa as un,wb as Oo,wc as Vp,wd as Vq,we as $r,x as Pk,xa as vn,xb as Po,xc as Wp,xd as Wq,xe as as,y as Uk,ya as wn,yb as Qo,yc as Xp,yd as Xq,ye as bs,z as Vk,za as xn,zb as Ro,zc as Yp,zd as Yq,ze as cs}from"./chunk-vyhrzsnf.js";import{Le as dp,Me as ep,Ne as fp,Oe as gp,Pe as hp,Qe as ip,Re as jp}from"./chunk-b381xgvw.js";import{Se as Bo,Te as Co}from"./chunk-7hb89n3z.js";import{Ue as Ho}from"./chunk-7kfv1q2r.js";import{Ve as mn}from"./chunk-8akj7f4h.js";import{We as Sn,Xe as Tn,Ye as Un,Ze as Mo}from"./chunk-1hvxs7rh.js";import{$e as $k,_e as _k,af as al,bf as bl,cf as cl,df as dl,ef as el,ff as fl,gf as gl,hf as hl,if as il,jf as jl,kf as kl,lf as ll,mf as ml}from"./chunk-n0d7nwhd.js";import{nf as Dl,of as El,pf as Fl,qf as Gl,rf as Hl,sf as Il,tf as Jl,uf as Kl,vf as Ll,wf as Ml,xf as Nl,yf as Ol}from"./chunk-84577w4y.js";import{Af as Cl,zf as Bl}from"./chunk-5j3v0p6s.js";import{Bf as nl,Cf as ol,Df as pl,Ef as ql,Ff as rl,Gf as sl,Hf as tl,Jf as ul,Kf as vl,Lf as wl,Mf as xl,Nf as yl,Of as zl,Rf as Al}from"./chunk-198fr2d4.js";import{Sf as Wm,Tf as Xm,Uf as Ym,Vf as Zm,Wf as _m,Xf as ln}from"./chunk-3xspzgrq.js";import{$f as Dm,Yf as Am,Zf as Bm,_f as Cm,ag as Em,bg as Fm,cg as Gm,dg as Hm,eg as Im,fg as Jm,gg as Km,hg as Lm,ig as Mm,jg as Nm,kg as Om,lg as Pm,mg as $m,ng as an,og as bn,pg as cn,qg as dn,rg as en,sg as fn,tg as gn,ug as hn,vg as jn,wg as kn}from"./chunk-a68y9s2j.js";import{xg as Qm,yg as Rm}from"./chunk-0knxnyq6.js";import{Ag as Bn,Bg as Cn,Cg as Dn,Dg as En,Eg as Fn,Fg as Gn,Gg as Hn,Hg as In,Ig as Jn,Jg as Kn,Kg as Ln,zg as An}from"./chunk-634gaa9d.js";import{Lg as qi,Mg as ri,Ng as si,Og as ti,Pg as ui,Qg as vi}from"./chunk-r6xmsxaz.js";import{Rg as Lj,Sg as Mj,Tg as Nj,Xg as Oj,Yg as Pj,Zg as Qj}from"./chunk-karkhcja.js";import{$g as Xj,_g as Wj,ah as Yj,bh as Zj,ch as _j,dh as $j,eh as ak,fh as bk,gh as ck,hh as dk,ih as ek}from"./chunk-ypgyhr2p.js";import{jh as Bj,kh as Cj,lh as Dj,mh as Ej,nh as Fj,ph as Gj,qh as Hj,rh as Ij,sh as Jj,th as Kj}from"./chunk-bcpjhcpn.js";import{uh as wk,wh as xk}from"./chunk-y4zddt5r.js";import{Ch as Lh,Dh as Mh,Eh as Nh,Fh as Oh,Gh as Ph,Hh as Qh}from"./chunk-g7bpkpd4.js";import{Jh as Rh,Kh as Sh,Lh as Th,Mh as Uh,Nh as Vh,Oh as Wh,Ph as Xh,Qh as Yh,Rh as Zh,Sh as _h,Th as $h,Uh as ai,Vh as bi,Wh as ci}from"./chunk-k33778kc.js";import{$h as gi,Yh as di,Zh as ei,_h as fi}from"./chunk-yg0qm73a.js";import{ei as hi}from"./chunk-g1vxsvqv.js";import{hi as kh}from"./chunk-0ppgyq8q.js";import{ii as lh}from"./chunk-fqq5k9ve.js";import{ji as mh,ki as nh}from"./chunk-ya5m5vbn.js";import{li as oh,mi as ph,ni as qh,oi as rh,pi as sh,qi as th}from"./chunk-y4nzmkea.js";import{ri as uh,si as vh,ti as wh,ui as xh,vi as yh}from"./chunk-7kw3grq5.js";import{Ai as Dh,wi as zh,xi as Ah,yi as Bh,zi as Ch}from"./chunk-c79nfdyj.js";import{Bi as Eh,Ci as Fh,Di as Gh,Ei as Hh,Fi as Ih,Gi as Jh,Hi as Kh}from"./chunk-ej8mv2k6.js";import{Ii as ih,Ji as jh}from"./chunk-bab01mkf.js";import"./chunk-ra1s4s6b.js";import{Ni as Oe,Oi as Pe,Pi as Qe,Qi as Re,Ri as Se,Si as Te,Ti as Ue,Ui as Ve,Vi as We,Wi as Xe,Xi as Ye,Yi as Ze,Zi as _e,_i as $e}from"./chunk-benx1c4p.js";import{$i as rf,aj as sf,bj as tf,cj as uf,dj as vf,ej as wf,fj as xf,gj as yf,hj as zf,ij as Af,jj as Bf,kj as Cf,lj as Df,mj as Ef,nj as Ff,oj as Gf,pj as Hf}from"./chunk-pwctc0m1.js";import{Aj as gf,Bj as hf,Cj as jf,Dj as kf,Ej as lf,Fj as mf,Gj as nf,Hj as of,Ij as pf,Jj as qf,wj as cf,xj as df,yj as ef,zj as ff}from"./chunk-0t1yyn1d.js";import{Kj as If,Lj as Jf,Mj as Kf,Nj as Lf,Oj as Mf,Pj as Nf,Qj as Of,Rj as Pf,Sj as Qf,Tj as Rf,Uj as Sf,Vj as Tf,Wj as Uf,Xj as Vf}from"./chunk-k91ej0ts.js";import{pk as Ar,qk as Br,rk as Cr,sk as Dr,tk as Er,uk as Fr}from"./chunk-rargfb5s.js";import{Ak as Tm,Bk as Um,Ck as Vm,vk as Qk,wk as Rk,xk as Sk,yk as Tk,zk as Sm}from"./chunk-necx4e30.js";import"./chunk-frp9fc7j.js";import"./chunk-qg0w5tjb.js";import{nl as ec,ol as fc,sl as gc}from"./chunk-7rj4h2t2.js";import{ul as bc}from"./chunk-qjvny3wf.js";import{$l as Qb,$m as ld,$n as He,$o as yg,$p as mi,$q as Rj,Al as Ca,Am as Ec,An as Qd,Ap as Zg,Aq as aj,Ar as Dk,Bl as Da,Bm as Fc,Bn as Rd,Bo as Xf,Bp as _g,Bq as bj,Br as Ek,Cl as Ea,Cm as Gc,Cn as Sd,Cp as $g,Cq as cj,Cr as Fk,Dl as Fa,Dm as Hc,Dn as Td,Dp as ah,Dq as dj,Dr as Gk,El as Ga,Em as Ic,En as Ud,Ep as bh,Eq as ej,Fl as Ha,Fm as Jc,Fn as Vd,Fp as ch,Fq as fj,Gl as Ia,Gm as Kc,Gn as Wd,Gp as dh,Gq as gj,Hl as Ja,Hm as Lc,Hn as Xd,Hp as eh,Hq as hj,Il as Ka,Im as Mc,In as Yd,Io as Yf,Ip as fh,Iq as ij,Jl as La,Jm as Nc,Jn as Zd,Jp as gh,Jq as jj,Kl as Ma,Km as Oc,Kn as _d,Ko as Zf,Kp as hh,Kq as kj,Ll as Na,Lm as Pc,Ln as $d,Lp as ii,Lq as lj,Ml as Oa,Mm as Zc,Mn as qe,Mo as _f,Mp as ji,Mq as mj,Nl as ib,Nm as _c,Nn as re,No as $f,Nq as nj,Ol as jb,Om as $c,On as se,Oo as ag,Oq as oj,Pl as kb,Pm as ad,Pn as te,Po as bg,Pp as ki,Pq as pj,Ql as lb,Qm as bd,Qn as ue,Qo as cg,Qq as qj,Rl as mb,Rm as cd,Rn as ve,Ro as dg,Rq as rj,Sl as nb,Sm as dd,Sn as we,So as pg,Sq as sj,Tn as xe,To as qg,Tq as tj,Um as ed,Un as ye,Uo as rg,Uq as uj,Vl as Kb,Vm as fd,Vn as ze,Vo as sg,Vq as vj,Wl as Lb,Wm as gd,Wn as Ae,Wo as tg,Wq as wj,Xl as Mb,Xm as hd,Xn as Be,Xo as ug,Xq as xj,Yl as Nb,Ym as id,Yn as Ce,Yo as vg,Yq as yj,Zl as Ob,Zm as jd,Zn as De,Zo as wg,Zq as zj,_l as Pb,_m as kd,_o as xg,_p as li,_q as Aj,am as Ub,an as md,ao as Ie,ap as zg,aq as ni,ar as Sj,bm as Vb,bn as nd,bo as Je,bp as Ag,bq as oi,br as Tj,cm as Wb,cn as od,co as Ke,cp as Bg,cq as pi,cr as Uj,dm as hc,dn as pd,do as Le,dp as Cg,dq as wi,dr as Vj,em as ic,en as ud,eo as Me,ep as Dg,eq as xi,er as fk,fm as jc,fn as vd,fo as Ne,fp as Eg,fq as yi,fr as gk,gm as kc,gn as wd,gp as Fg,gq as zi,gr as hk,hm as lc,hn as xd,hp as Gg,hq as Ai,hr as ik,im as mc,in as yd,ip as Hg,iq as Bi,ir as jk,jm as nc,jn as zd,jo as af,jp as Ig,jq as Ci,jr as kk,km as oc,kn as Ad,ko as bf,kp as Jg,kq as Di,kr as lk,lm as pc,ln as Bd,lp as Kg,lq as Ei,lr as mk,mm as qc,mn as Cd,mo as Wf,mp as Lg,mq as Fi,mr as nk,nm as rc,nn as Dd,np as Mg,nq as Gi,nr as ok,om as sc,on as Ed,op as Ng,oq as Hi,or as pk,pm as tc,pn as Fd,pp as Og,pq as Ii,pr as qk,qm as uc,qn as Gd,qp as Pg,qq as Ji,qr as rk,rm as vc,rn as Hd,rp as Qg,rq as Ki,rr as sk,sm as wc,sn as Id,sp as Rg,sq as Li,sr as tk,tm as xc,tn as Jd,tp as Sg,tq as Mi,tr as uk,um as yc,un as Kd,up as Tg,uq as Ni,ur as vk,vl as xa,vm as zc,vn as Ld,vp as Ug,vq as Xi,vr as yk,wl as ya,wm as Ac,wn as Md,wp as Vg,wq as Yi,wr as zk,xl as za,xm as Bc,xn as Nd,xp as Wg,xq as Zi,xr as Ak,yl as Aa,ym as Cc,yn as Od,yp as Xg,yq as _i,yr as Bk,zl as Ba,zm as Dc,zn as Pd,zp as Yg,zq as $i,zr as Ck}from"./chunk-2119txb8.js";import{$r as ja,Er as M,Fr as N,Gr as O,Hr as P,Ir as Q,Jr as R,Kr as S,Lr as T,Mr as U,Nr as V,Or as W,Pr as X,Qr as Y,Rr as Z,Sr as _,Tr as $,Ur as aa,Vr as ba,Wr as ca,Xr as da,Yr as ea,Zr as fa,_r as ia,as as ka,bs as la,cs as ma,ds as na,es as oa,fs as pa,gs as qa,hs as ra,is as sa,js as ta,ks as ua,ls as va,ms as wa}from"./chunk-jc6wrxrh.js";import{ns as ga,os as ha}from"./chunk-2xpdcr8c.js";import{ps as Rb,qs as Sb,rs as Tb}from"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import{As as Qi,Bs as Ri,Cs as Si,Ds as Ti,Es as Ui,Fs as Vi,Gs as Wi,ys as Oi,zs as Pi}from"./chunk-135mme4g.js";import{$s as Tc,Ys as Qc,Zs as Rc,_s as Sc,at as Uc,ct as Vc,lt as Wc,mt as Xc,nt as Yc}from"./chunk-dj24n5n7.js";import{ot as Xb,pt as Yb,qt as Zb,rt as _b,st as $b,tt as ac}from"./chunk-w1asc0zd.js";import{At as Ee,Ct as Fe,Ft as Ge}from"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import{Kt as cc,Lt as dc}from"./chunk-xk402w4a.js";import{Pt as eg,Qt as fg,Rt as gg,St as hg,Tt as ig,Ut as jg,Vt as kg,Xt as lg,Yt as mg,Zt as ng,_t as og}from"./chunk-dnard9gp.js";import{$t as qd,Au as oe,Bu as pe,au as rd,bu as sd,cu as td,mu as ae,nu as be,ou as ce,pu as de,qu as ee,ru as fe,su as ge,tu as he,uu as ie,vu as je,wu as ke,xu as le,yu as me,zu as ne}from"./chunk-vgx5077x.js";import{$u as A,Cu as b,Du as c,Eu as d,Fu as e,Gu as f,Hu as g,Iu as h,Ju as i,Ku as j,Lu as k,Mu as l,Nu as m,Ou as n,Pu as o,Qu as p,Ru as q,Su as r,Tu as s,Uu as t,Vu as u,Wu as v,Xu as w,Yu as x,Zu as y,_u as z,av as B,bv as C,cv as D,dv as E,ev as F,fv as G,gv as H,hv as I,iv as J,jv as K,kv as L}from"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import{Av as ob,Bv as pb,Cv as qb,Dv as rb,Ev as sb,Fv as tb,Gv as ub,Hv as vb,Iv as wb,Jv as xb,Kv as yb,Lv as zb,Mv as Ab,Nv as Bb,Ov as Cb,Pv as Db,Qv as Eb,Rv as Fb,Sv as Gb,Tv as Hb,Uv as Ib,Vv as Jb}from"./chunk-7racewc5.js";import{Aw as fb,Bw as gb,Dw as hb,Zv as Pa,_v as Qa,bw as Ra,gw as Sa,hw as Ta,nw as Ua,ow as Va,pw as Wa,qw as Xa,rw as Ya,sw as Za,tw as _a,uw as $a,vw as ab,ww as bb,xw as cb,yw as db,zw as eb}from"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{il as writeNetlifyConfig,an as writeManifest,Nl as writeImageManifest,tp as wrapComponentForHMR,as as withDefaults,vk as webComponentDirectiveHandler,iq as watermark,kr as watchViews,Xl as watchMultiple,Yl as watchEffect,Wl as watch,Le as warmImagePlaceholders,jm as waitForStore,X as waitForLocale,ep as virtualPathFor,ik as videoDirective,G as validators,es as validated,Be as validateValueEnhanced,li as validateTemplate,Qm as validateRouteRules,nq as validateParams,Ce as validateFormEnhanced,$q as validateFile,xe as validateFields,we as validateField,ni as validateDirective,Wd as validateCspDirectives,Dk as validateConfig,on as validateComponentScripts,Mn as validateComponentProps,hh as validateClientScript,gi as v,Hc as usesSignalsInScript,ub as usesReactiveRuntime,Bi as userComponentFileExists,Oh as useVirtualList,ie as useTitle,im as useStoreOrThrow,Lp as useStore,Uk as useStorage,zf as useSlots,Wk as useSessionStorage,cc as useServerRuntimeConfig,Xf as useServerData,fe as useSeoMeta,dc as useRuntimeConfig,km as useRouteParams,mm as useRouteParamOrThrow,lm as useRouteParam,ie as usePageTitle,qf as useOptimistic,Ef as useModel,om as useMiddlewareValue,nm as useMiddlewareState,Vk as useLocalStorage,mp as useLoadingIndicator,de as useHead,di as useForm,Bf as useAttrs,br as uploadFiles,ar as uploadFile,fm as updateInstance,of as untrack,Ri as unregisterDirective,gm as unmountInstance,Pc as unescapeHtml,ip as typecheckStxFiles,zi as transpileTypeScript,Pr as translate,Ba as transitionDirective,lc as transformAutoImports,Gn as toUsers,Fn as toUser,Tp as thumbnail,Uq as thumbHashToRGBA,Vq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,If as templateCache,md as syncRecordedResponse,qp as stxClientHelpers,jg as structuredDataDirective,Sr as stripLocalePrefix,Nm as stripDocumentWrapper,Sb as stripCommentsAndLiterals,ro as stringToStream,Kd as strictCspPreset,We as streamingSuspenseDirective,_e as streamToResponse,Ue as streamTemplateSimple,Oe as streamTemplate,Pk as stopHmrServer,Cn as stopBroadcasting,_b as stateDirName,$b as stateDir,cf as state,bh as startsDocument,Mo as startProductionServer,Ho as startInteractive,Bn as startBroadcasting,Ur as stampLocaleLayoutGroup,Ia as staggerDirective,lq as srcsetUrls,Ja as springDirective,td as splitByPipe,Jm as spaNavVaryHeaders,fp as sourcePathFor,sq as smartBatchSign,Di as slotContentHasExpressions,qq as signUrl,xi as shouldTranspileTypeScript,Mk as shouldReloadOnChange,vq as shouldRefreshSignature,Nk as shouldIgnoreFile,Gh as shouldCacheComponent,Xp as sharpen,hs as shape,Zb as setStateDir,sm as setRouteParams,tm as setMiddlewareState,Ke as setImagePlaceholder,tf as setGlobalProvide,b as setErrorLocale,Pl as setCurrentInstance,Yj as setCachedVideoResult,Nj as setCachedImageResult,Hj as setCached,ks as serveStxFile,ms as serveMultipleStxFiles,Hk as serveMarkdownFile,Xo as serveFile,ns as serveApp,Wo as serve,wp as serializeState,cn as serializeSetCookie,Zp as sepia,ge as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,Ai as scopeOnRootElement,mk as scopeHTML,lk as scopeCSS,mg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,bq as saturation,oq 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,Gb as runtimeEventRegexLiteral,Eb as runtimeDirectiveNamesLiteral,xg as runPreProcessingMiddleware,yg as runPostProcessingMiddleware,fn as runPageAction,jf as runMountCallbacks,gb as runMiddleware,dm as runHooks,Ir as runDoctor,kf as runDestroyCallbacks,Bg as runComposers,cq as rotate,hi as rewriteImagesWithSiblings,nd as responseBindings,Hi as resolveTemplatePath,ha as resolveStxTargets,zk as resolveStxDirectories,Or as resolveI18n,Rp as resize,pg as resetUnscopedSignalWarnings,Nc as resetRejectedExpressionWarnings,sc as resetPlaceholders,ce as resetHead,vp as resetHMRHandler,o as resetErrorConfig,cs as required,bg as reportDeferredLoopWarnings,wc as replacePlaceholders,Ec as replaceInterpolations,ir as renderView,fk as renderVideoComponent,ic as renderVendorStyleTags,rr as renderToString,sr as renderToStream,tr as renderToDOM,Tq as renderThumbhashToCanvas,Fr as renderTemplateString,Dr as renderTemplate,Er as renderString,Re as renderStreamingPage,si as renderSlot,wh as renderSSRSuspense,Dq as renderProtectedVideo,Cq as renderProtectedImg,pq as renderMediaUpload,Cr as renderMarkdownView,Um as renderLayoutTypes,Rj as renderImgComponent,Dl as renderImageComponent,ke as renderHtmlAttrs,je as renderHead,lr as renderEmail,Fi as renderComponentWithSlot,le as renderBodyAttrs,Gp as render,Md as relaxedCspPreset,ve as registerValidationRule,Ye as registerStreamingDirectives,Np as registerStoresClient,qm as registerStore,Qf as registerServeModuleBundle,kg as registerSeoDirectives,_a as registerMiddleware,Ac as registerFilters,zc as registerFilter,d as registerErrorMessages,Ae as registerEnhancedValidationRule,Oi as registerDirective,Vd as registerCspDirectives,Pn as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,mc as referencesName,Tl as ref,zo as redirect,id as recordResponseStatus,jd as recordResponseHeader,ac as rebaseOntoStateDir,kd as readResponseStatus,ld as readResponseHeaders,Fk as readMarkdownFile,Jf as readFileCached,Ul as reactive,gq as quality,Aq as pruneSignatureCache,Kj as pruneCache,rf as provide,Br as protectCodeBlocks,bs as prop,Eg as processVueTemplate,Mh as processVirtualListDirectives,Qh as processVirtualGridDirectives,ek as processVideo,ye as processValidateDirective,ea as processTranslateDirective,qh as processTransitionDirectives,th as processTransitionAttributes,oe as processTitleDirective,ad as processTemplateBindings,mh as processTeleportDirectives,uh as processSuspenseDirectives,fg as processStructuredData,Se as processStreamDirectives,od as processStatusDirective,bi as processStaticDirectives,vg as processStackReplacements,ug as processStackPushDirectives,ti as processSlots,Lm as processShell,Ne as processServerBindings,gg as processSeoDirective,Ze as processSectionDirectives,Uc as processScopedStyles,_c as processReactiveBindings,Eq as processProtectedMedia,Wh as processPartialHydrationDirectives,gh as processOnceDirective,wg as processMiddleware,eg as processMetaDirectives,pe as processMetaDirective,Gk as processMarkdownFileDirectives,Mi as processMarkdownDirectives,cg as processLoops,Eh as processKeepAliveDirectives,fh as processJsonDirective,Ph as processInfiniteListDirectives,tg as processIncludes,Tj as processImgComponents,Fl as processImageComponents,sl as processImage,ne as processHeadDirective,re as processForms,te as processFormInputDirectives,Lc as processExpressions,Pb as processEventDirectives,ue as processErrorDirective,Fg as processDynamicComponents,ii as processDirectives,Wi as processDirectiveAttributes,lh as processDeferDirectives,_d as processCustomDirectives,Sd as processCspDirectives,is as processComponentProps,rc as processClientScript,se as processBasicFormDirectives,zh as processAsyncDirectives,$d as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ge as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,lp as preloadIslandHandlers,Me as preloadIconCollection,xn as poolStrings,xk as pluginManager,Ie as placeholdersWarmed,ph as performLeave,oh as performEnter,lf as pendingLifecycleCounts,pf as peek,qg as partialsCache,gk as parseVideoDirectiveOptions,Pp as parseUrl,Wq as parseThumbhashString,zd as parseSwitchBlock,qi as parseSlots,ri as parseSlotElement,Ed as parseScriptDeclarations,tk as parseSFCComponent,Fq as parseProtectedArgs,ag as parseLoopBinding,Sj as parseImgComponent,ij as parseImageUrl,El as parseImageComponent,dn as parseFormBody,Bd as parseExpressionWithFilters,Qn as parseDefaults,wo as parseCookies,Cm as parseContainerSelector,wd as parseConditionalBlock,Cd as parseArguments,Ma as parseAnimationShorthand,ds as optional,yn as optimizeTemplate,Kl as optimizeImage,Ll as optimizeDirectory,fs as oneOf,rg as onceStore,am as onUpdated,Zc as onUpdate,cm as onUnmounted,xm as onServer,_l as onMounted,gf as onMount,ai as onHydrated,xf as onErrorCaptured,hf as onDestroy,Kh as onDeactivated,wm as onClient,$l as onBeforeUpdate,bm as onBeforeUnmount,Zl as onBeforeMount,Jh as onActivated,Pq as observeElement,Ao as notFound,Kg as normalizeCriticalHeadOrder,wf as nextTick,Tn as negotiateEncoding,Ua as navigateTo,em as mountInstance,Ea as motionDirective,Ld as moderateCspPreset,wn as minifyHtml,ig as metaDirective,Vg as metaDedupKey,Qp as mergeParams,Xg as mergeHtmlAttrs,ee as mergeHeadConfigs,Rc as mergeCssConfig,Pd as mergeCspDirectives,Ra as matchRoute,Ni as markdownDirectiveHandler,Ek as markdownCache,ga as looksLikeGlob,Rr as localizePath,U as loadTranslationLazy,_ as loadTranslation,Ak as loadStxConfig,db as loadMiddlewareFromDirectory,bn as loadManifest,Lq as loadElement,Dn as loadChannels,Lb as listensPassively,Yr as lintStxStrict,Nq as lazyLoadAll,Mq as lazyLoad,Ha as keyframeDirective,pr as jsxs,qr as jsxDEV,or as jsx,yo as jsonResponse,Xe as islandDirective,l as isTest,Om as isSpaNavigation,Hm as isSpaNavRequest,tq as isSignatureValid,mf as isSignal,ql as isSharpAvailable,ko as isServerEnvironment,um as isServer,yb as isRuntimeOwnedColonAttr,Hb as isRuntimeEventName,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Iq as isNativeLazySupported,Ar as isMarkdownPath,Q as isLoading,R as isLoaded,wi as isJavaScriptScript,Jq as isIntersectionObserverSupported,yl as isImageFile,rl as isImageBackendAvailable,aa as isICUFormat,$h as isHydrated,Ci as isHydrateTrigger,gd as isHttpStatus,jo as isEdgeEnvironment,Zr as isDirectiveKind,k as isDevelopment,nf as isDerived,Lk as isCssOnlyChange,Sn as isCompressible,vm as isClient,Bh as isAsyncComponent,en as isActionableMethod,_p as invert,Lf as invalidateFileCacheByDir,Kf as invalidateFileCache,Kc as interpolateScriptsInTemplate,Ic as interpolateScriptExpressions,Jc as interpolateScriptAttributes,x as inlineError,Nr as injectThemeBootstrap,hg as injectSeoTags,Kr as injectSeo,Wf as injectRouterScript,Kk as injectHotReload,kb as injectHeatmap,Yc as injectCss,Qd as injectCspMetaTag,dh as injectConfigHeadTags,Jg as injectColorModeBootScript,Zg as injectCloakStyle,Qg as injectBuildId,kc as injectBrowserCoreAutoImports,cd as injectAnalytics,sf as inject,pm as initStoreRegistry,ll as initNetlify,np as initLoadingIndicator,Kq as initLazyLoading,Go as initFile,Sq as initBlurUp,Yq as initAllBlurUp,Vj as imgDirective,Il as imageDirective,jn as hydrateTemplateStream,hn as hydrateTemplate,kp as hydrateIslands,Yh as hydrateIsland,kn as hydrateFragment,Zh as hydrateByStrategy,_h as hydrateAll,Dp as hydrate,Vo as htmlResponse,$g as hoistLeadingHeadTags,Lg as hoistColorModeBootScript,lb as heatmapDirective,Dj as hashString,Vf as hashFilePath,Bj as hashFile,Cj as hashBuffer,Dg as hasVueTemplateSyntax,$f as hasVariables,Ip as hasStore,xc as hasPlaceholders,jl as hasNetlifyConfig,ab as hasMiddleware,Qb as hasEventDirectives,ch as hasDocumentShell,oi as hasDirectives,ma as hasDOMSupport,Bl as handleImageRequest,yf as handleError,xr as h,xl as groupVariantsByFormat,Yp as grayscale,Oo as gitHash,qn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,el as getTotalSize,uq as getTimeUntilExpiry,ih as getStoreScript,Jp as getStoreNames,Hp as getStore,Zk as getStorageSize,Yk as getStorageKeys,Ii as getSourceLineInfo,yi as getSharedTranspiler,Rf as getServeModuleBundle,Pf as getServeClientAsset,la as getScreenReaderOnlyStyle,nk as getScopeAttribute,bf as getRouteParams,Vb as getPublicEnvDefine,Wb as getPublicEnv,mi as getPositionInfo,uc as getPlaceholderRegistry,Aj as getPlaceholderCacheStats,be as getPageMeta,Gd as getNonce,zl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,He as getImagePlaceholder,tl as getImageMetadata,Ee as getImageDelivery,Cp as getHydrationRuntime,rm as getHydratedStoreState,Ok as getHmrServer,ae as getHead,up as getHMRHandler,mj as getFormatExtension,Fj as getFileMtime,wl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Qi as getDirectives,Pi as getDirective,Ql as getCurrentInstance,Vc as getCssServeAsset,Od as getCspPreset,Xd as getCspHeaderName,Li as getComponentCacheStats,Xj as getCachedVideoResult,yq as getCachedSignature,Nf as getCachedSignalsRuntime,Of as getCachedRouterScript,yj as getCachedPlaceholder,Mj as getCachedImageResult,Gj as getCached,Jj as getCacheStats,Og as getBuildId,An as getBroadcastServer,lj as getBestVariant,Bc as getAllFilters,$i as generateWidthSrcset,Nh as generateVirtualListCSS,dr as generateVideoPreview,De as generateValidationScript,er as generateUploadRuntime,rn as generateTreeShakenBundle,sh as generateTransitionRuntime,rh as generateTransitionCSS,$j as generateThumbnails,rj as generateThumbhashPlaceholder,ao as generateTemplatesDocs,yh as generateSuspenseRuntime,xh as generateSuspenseCSS,xp as generateStateScript,jj as generateSrcsetData,Qj as generateSrcset,ul as generateSrcSet,ak as generateSpriteSheet,mr as generateSpaShell,kj as generateSourceTags,fj as generateSizesFromBreakpoints,ej as generateSizesAttribute,vl as generateSizes,lg as generateSitemapIndex,Lr as generateSitemap,Hq as generateSimpleMediaPicker,Bq as generateSignatureRuntime,Hf as generateSignalsRuntimeDev,Gf as generateSignalsRuntime,qc as generateServerDataBridge,kk as generateScopeId,uk as generateSFCWebComponent,Nb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,ng as generateRobotsTxt,Mr as generateRobots,Pj as generateResponsiveVariants,qk as generateReactiveWebComponentTS,pk as generateReactiveWebComponent,sk as generateReactiveRuntime,rk as generateReactiveMixin,_j as generatePoster,xj as generatePlaceholderStyle,wj as generatePlaceholderCSS,qj as generatePlaceholder,Xh as generatePartialHydrationCSS,Fd as generateNonce,fl as generateNetlifyToml,gr as generateMinifiedMediaRuntime,fr as generateMediaRuntime,Gq as generateMediaManagerEmbed,$m as generateManifest,pp as generateLoadingIndicatorHtml,Rq as generateLazyLoadRuntime,Vm as generateLayoutTypes,tj as generateLQIP,Ih as generateKeepAliveRuntime,Hh as generateKeepAliveCSS,ci as generateIslandManifest,cr as generateImagePreview,Ml as generateImageManifest,Bp as generateHydrationScript,$e as generateHydrationRuntime,Ep as generateHydrationCSS,Rh as generateHydrationBootstrap,Jk as generateHotReloadScript,jb as generateHeatmapScript,sp as generateHMRClientScript,bk as generateHLSManifest,yp as generateEventBindings,dj as generateDprSrcsetWithVariableQuality,cj as generateDprSrcset,ah as generateDocumentShell,go as generateDocs,bo as generateDirectivesDocs,Vi as generateDirectiveRuntime,og as generateDefaultRobotsTxt,ck as generateDASHManifest,Xc as generateCss,Jd as generateCspMetaTag,Id as generateCspHeader,Df as generateCompositionRuntime,$n as generateComponentsDocs,Sh as generateComponentManifest,Zn as generateComponentDoc,vj as generateColorPlaceholder,Ig as generateColorModeBootScript,hm as generateClientRuntime,Ej as generateCacheKey,oc as generateBrowserAutoImportDestructuring,Zq as generateBlurUpRuntime,_q as generateBlurUpCSS,$c as generateBindingsRuntime,aj as generateAutoWidthSrcset,nc as generateAutoImportDestructuring,Dh as generateAsyncComponentRuntime,Ch as generateAsyncComponentCSS,fc as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,bd as generateAnalyticsScript,jp as formatTypecheckDiagnostics,cp as formatTypeErrors,Do as formatStxContent,dl as formatSize,Ta as formatRoutes,Eo as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Jr as formatDoctorReport,co as formatDocsAsMarkdown,fo as formatDocsAsJson,eo as formatDocsAsHtml,fq as format,vn as foldConstants,eq as flipVertical,dq as flipHorizontal,Wm as fingerprint,hp as findStxModuleDeclarations,gp as findRuntimeTypeDeclarations,Hr as findPantryPackage,Dc as findMustacheEnd,vd as findMatchingEndTag,rd as findMatchingDelimiter,Rb as findInterpolationEnd,xd as findIfBlocks,Ad as findExpressions,Sa as findErrorPage,Sc as findDuplicateScopedStyleRanges,yd as findDirectiveBlocks,sn as findDeadCode,sn as findDeadBranches,Dm as findContainerRegion,_n as findComponentFiles,ls as findCommonDir,cl as filterRequiredFiles,Gi as fileExists,Yf as extractVariables,ki as extractTemplateExpressions,Te as extractStreamBoundaries,zp as extractState,ui as extractSlotContent,_f as extractScriptFromTemplate,ji as extractScriptBlocks,vc as extractPlaceholders,ud as extractParenthesizedExpression,hd as extractPageResponseStatus,hb as extractLayoutMetadata,uj as extractDominantColor,Dd as extractDirectiveParams,pi as extractDirectiveNames,Pm as extractContainerContent,Xn as extractComponentProps,Th as extractComponentName,Yn as extractComponentDescription,Wc as extractClassNames,pc as extractBridgeData,Uh as extractBoundProps,sd as extractBalancedExpression,hc as extractAndStripCssImports,ok as extractAndScopeStyles,Ob as extractAndProcessEvents,Sk as externalizeSharedAssets,Tk as externalizeRepeatedAssets,Rk as externalizeHtml,Oc as evaluateExpression,un as evaluateConstant,pd as evaluateAuthExpression,Gc as escapeHtmlValue,Fc as escapeHtml,C as errorRecovery,E as errorLogger,nh as ensureTeleportTargets,eh as ensureDocumentShell,ze as enhancedValidationRules,Vn as enableDevTools,tn as eliminateDeadCode,ef as effect,mq as dprUrls,ho as docsCommand,ec as discoverServerApi,Tm as discoverLayoutNames,Qq as disconnectObserver,Wn as disableDevTools,F as devHelpers,Km as detectShell,io as detectRuntime,gl as detectProjectConfig,nj as detectFormat,nn as detectBuildMode,df as derived,kl as deploy,Ck as defineStxConfig,Mp as defineStore,Af as defineSlots,Xr as defineSiteConfig,$r as definePropsWithValidation,_r as defineProps,wk as definePlugin,he as definePageMeta,Wa as defineMiddleware,ei as defineForm,vf as defineExpose,uf as defineEmits,Si as defineDirective,zr as defineCustomElement,Lo as defineConfig,Ti as defineClientDirective,Ah as defineAsyncComponent,No as defineApiHandler,hr as defaultMediaConfig,Ol as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,qe as defaultFormClasses,yc as defaultFilters,Zd as defaultCspConfig,yk as defaultConfig,js as default,Qc as deepMergeThemes,Tc as dedupeScopedStyles,Gm as decodeTitleEntities,sj as decodeThumbhash,dg as declareBareLoopHead,Ud as cspNonceDirective,Td as cspDirective,Xq as crossfadeTransition,Sp as crop,Lh as createVirtualList,hk as createVideoDirective,uo as createVercelHandler,$o as createTypeChecker,fa as createTranslateFilter,qo as createTextEncoderStream,yr as createStxApp,po as createStreamingResponse,Ve as createStreamRenderer,Kp as createStore,Za as createStorageManager,Xa as createServerCookieManager,gc as createServerApi,Sl as createScope,vh as createSSRSuspense,af as createRouter,Rm as createRouteRuleResolver,eb as createRouteLocation,Zo as createRoute,Tl as createRef,Ul as createReactive,Cf as createProvideContext,Qo as createProject,Ko as createProductionBuild,tc as createPlaceholder,zn as createOptimizedBuild,vo as createNetlifyHandler,_k as createNetlifyClient,fb as createMiddlewareContext,Yo as createMiddleware,Oq as createLazyObserver,Fh as createKeepAliveCache,mo as createKVNamespace,Vh as createIslandRegistry,Uj as createImgDirective,Jl as createImagePlugin,Cl as createImageHandler,Hl as createImageDirective,nb as createHeatmapAggregator,bl as createFileManifest,lo as createEnvAccessor,z as createEnhancedError,oo as createEdgeHandler,no as createEdgeCache,Ji as createDetailedErrorMessage,to as createDenoHandler,hl as createDefaultNetlifyConfig,Yd as createCspHeaders,xo as createCookie,Vl as createComputed,Rl as createComponentInstance,so as createCloudflareHandler,Ya as createClientCookieManager,Ui as createBuiltinDirectives,yr as createApp,Ka as createAnimationTimeline,Vp as cover,Zf as convertToCommonJS,aq as contrast,Up as contain,y as consoleError,m as configureErrorHandling,Bk as config,Vl as computed,Un as compressResponse,Ag as composerPattern,zg as composer,Mm as composeShellWithPage,On as componentDirective,Ei as componentClientSignalNames,_m as compileTemplate,a as collectRepeatedFlag,al as collectDeployFiles,_g as cloakStyleFragment,Zj as clearVideoCache,N as clearTranslationCache,jh as clearStoreCache,Xk as clearStorage,zq as clearSignatureCache,Ff as clearServerData,zj as clearPlaceholderCache,sg as clearOnceStore,Hd as clearNonce,bb as clearMiddleware,Je as clearImagePlaceholders,Fe as clearImageDeliveryCatalog,Gl as clearImageCache,e as clearErrorMessages,Sf as clearDevCaches,Cc as clearCustomFilters,Cg as clearComposers,kh as clearComposableCache,Ki as clearComponentCache,Ij as clearCache,Ib as clearBlankCache,op as cleanupLoadingIndicator,Am as classifyScript,Bm as classifyAllScripts,ap as checkTemplateFile,bp as checkTemplate,Tf as checkCache,wq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Jn as channel,Co as captureScreenshots,Bo as captureScreenshot,Z as cancelPendingLoads,$k as calculateSha1,bj as calculateOptimalWidths,Uf as cacheTemplate,bc as cacheEngineFingerprint,jk as buildWebComponents,dp as buildVirtualSource,jr as buildViews,Op as buildUrl,Pe as buildSuspenseResolveScript,Wr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Xm as buildRuntimeAsset,Ym as buildRouterAsset,Vr as buildLangPickerScript,hj as buildImageUrl,Rg as buildIdFragment,Wg as buildHtmlAttrs,ln as buildForProduction,Rn as buildComponentLibrary,xq as buildAuthParams,mn as buildApp,Tr as buildAlternateLinks,Jo as build,Hn as broadcastPrivate,In as broadcastPresence,En as broadcast,$p as brightness,Tb as bracketDepths,Wp as blur,Jb as blankInertHtmlRegions,rq as batchSignUrls,ff as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,hq as auto,ja as attributeValue,Zm as assetTags,Mb as asInvocableStatement,gs as arrayOf,Qr as applyTranslations,Oj as applyTransformations,vi as applySlots,Nn as applyPropDefaults,kq as applyPreset,Yg as applyHtmlAttrs,me as applyHead,Mc as applyFilters,Im as appendVary,Nd as apiCspPreset,Da as animationGroupDirective,dk as analyzeVideo,pn as analyzeUsage,ym as analyzeTemplate,zm as analyzeProject,pn as analyzeDirectiveUsage,dd as analyticsDirective,To as addStore,So as addPage,Rd as addNonceToInlineContent,Uo as addLayout,Ro as addComponent,gn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Mf as __setSignalsGeneratorsForTest,Pg as __setBuildIdForTest,Wj as VideoProcessorCache,fi as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,qd as Tokenizer,_o as TemplateTypeChecker,Fo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,ur as Show,Qe as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,jc as STX_AUTO_IMPORTS,Yb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Em as SPA_NAV_HEADER,Kb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Fb as RUNTIME_EVENT_NAMES,Db as RUNTIME_DIRECTIVE_NAMES,ed as RESPONSE_STATUS_KEY,fd as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Io as ProductionBuild,wr as Portal,Po as PROJECT_TEMPLATES,jq as PRESETS,sb as NON_CLIENT_PRIMITIVES,Fp as MemorySessionStore,_i as MIME_TYPES,Xi as MEDIA_DEFAULT_WIDTHS,Zi as MEDIA_DEFAULT_FORMATS,Sm as LAYOUT_TYPES_FILE,Lj as ImageProcessorCache,Al as ImageProcessingError,Ap as HydrationRuntime,Ik as HotReloadServer,mb as HeatmapAggregator,Ug as HTML_CLASS_MARKER,Tg as HTML_ATTRS_MARKER,nr as Fragment,vr as For,Fm as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Qk as EXTERNALIZED_ASSET_DIR,ml as DeployError,nl as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Xb as DEFAULT_STATE_DIR,pl as DEFAULT_QUALITY,oj as DEFAULT_PLACEHOLDER_OPTIONS,ol as DEFAULT_FORMATS,Yi as DEFAULT_DPR_VALUES,rp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,gj as COMMON_SIZES,Gg as COLOR_MODE_BOOT_MARKER,Hg as COLOR_MODE_BOOT_GLOBAL,Sg as CLOAK_STYLE,Ln as BroadcastServer,Kn as Broadcast,Mg as BUILD_ID_META,Ng as BUILD_ID_HEADER,Ub as BROWSER_CORE_IMPORTS,pj as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,Gr as $path};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xg as I}from"./chunk-0knxnyq6.js";import{xr as H}from"./chunk-2119txb8.js";import{Sw as G}from"./chunk-m8kem5ca.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-
|
|
2
|
+
import{xg as I}from"./chunk-0knxnyq6.js";import{xr as H}from"./chunk-2119txb8.js";import{Sw as G}from"./chunk-m8kem5ca.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-za8wxkx6.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
|
|
3
3
|
export{Q as Ve};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$m as l,Cm as P,Co as i,Ep as h,Io as T,Km as k,_m as c,sm as R,tm as O}from"./chunk-2119txb8.js";import{Ps as S,Rs as y}from"./chunk-dj24n5n7.js";import{Lu as m}from"./chunk-met6wtbk.js";import{Ew as YJ,Hw as ZJ,Iw as $J}from"./chunk-e03m4har.js";import{Pw as XJ,Sw as q}from"./chunk-m8kem5ca.js";var r=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function s(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(r.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var o=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function C(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=y(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=o.exec(j);if(F){let K=s(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function t(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function v(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function e(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function JJ(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=e(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=t(J),Z;while((Z=X.exec(J))!==null){if(v(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||a.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!JJ(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(v(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var NJ="X-STX-Router",_J="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function QJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:QJ(J,"X-STX-Router")}}import E from"path";YJ();var UJ="stx-page-head:",WJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,D={dev:null,prod:null};function jJ(){let J=m()?"dev":"prod",Y=D[J];if(Y!==null)return Y;try{let Q=($J(),XJ(ZJ)),X=J==="dev"&&typeof Q.getRouterScriptDev==="function"?Q.getRouterScriptDev:Q.getRouterScript;D[J]=`<script>${X()}</script>`}catch{D[J]=""}return D[J]}async function RJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function PJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=C(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:A}=await import("./chunk-
|
|
2
|
+
import{$m as l,Cm as P,Co as i,Ep as h,Io as T,Km as k,_m as c,sm as R,tm as O}from"./chunk-2119txb8.js";import{Ps as S,Rs as y}from"./chunk-dj24n5n7.js";import{Lu as m}from"./chunk-met6wtbk.js";import{Ew as YJ,Hw as ZJ,Iw as $J}from"./chunk-e03m4har.js";import{Pw as XJ,Sw as q}from"./chunk-m8kem5ca.js";var r=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function s(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(r.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var o=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function C(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=y(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=o.exec(j);if(F){let K=s(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function t(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function v(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function e(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function JJ(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=e(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=t(J),Z;while((Z=X.exec(J))!==null){if(v(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||a.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!JJ(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(v(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var NJ="X-STX-Router",_J="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function QJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:QJ(J,"X-STX-Router")}}import E from"path";YJ();var UJ="stx-page-head:",WJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,D={dev:null,prod:null};function jJ(){let J=m()?"dev":"prod",Y=D[J];if(Y!==null)return Y;try{let Q=($J(),XJ(ZJ)),X=J==="dev"&&typeof Q.getRouterScriptDev==="function"?Q.getRouterScriptDev:Q.getRouterScript;D[J]=`<script>${X()}</script>`}catch{D[J]=""}return D[J]}async function RJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function PJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=C(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:A}=await import("./chunk-6pdfvpa6.js"),I=await A(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let _=await B(K,z,J,{...N,...I,...Y},new Set),H=_.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:_.substring(0,H),afterSlot:_.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function kJ(J,Y,Q){let X,$="",Z=Y.match(WJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=jJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ve as a}from"./chunk-
|
|
2
|
+
import{Ve as a}from"./chunk-8akj7f4h.js";import"./chunk-0knxnyq6.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as buildApp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze as a}from"./chunk-
|
|
2
|
+
import{Ze as a}from"./chunk-1hvxs7rh.js";import"./chunk-a68y9s2j.js";import"./chunk-0knxnyq6.js";import"./chunk-7rj4h2t2.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as startProductionServer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ye as z$}from"./chunk-
|
|
2
|
+
import{Ye as z$}from"./chunk-1hvxs7rh.js";import{Zf as i7,bg as j$,cg as c6,dg as T6,fg as B1,gg as l6,hg as K5,ig as O$,jg as A$,kg as i6,lg as a6,pg as z5}from"./chunk-a68y9s2j.js";import{bj as u5}from"./chunk-pwctc0m1.js";import{rj as l1,sj as I1,tj as R1,uj as a$,vj as s$,wj as n5,yj as o5}from"./chunk-0t1yyn1d.js";import{Vj as _$,Wj as U$}from"./chunk-k91ej0ts.js";import{xk as l5,yk as i5}from"./chunk-necx4e30.js";import{Ek as Z3,Fk as Q3}from"./chunk-frp9fc7j.js";import{Zk as U1}from"./chunk-qg0w5tjb.js";import{sl as M5,tl as j8}from"./chunk-7rj4h2t2.js";import{$m as C1,Bm as n0,Cr as T0,Io as M0,Lp as V0,Tm as d6,To as o0,Wl as V8,Xm as _5,_m as T1,_n as K$,hp as s7,ir as B$,jo as H$,lo as u6,mo as E6,mq as _6,nm as l7,nq as x1,op as m6,pp as p6,rq as t0,vr as C$,xr as r0,yr as w0}from"./chunk-2119txb8.js";import{Js as J5,bt as B,it as L$,jt as F$,nt as J0}from"./chunk-dj24n5n7.js";import{st as u0}from"./chunk-w1asc0zd.js";import{Iu as s1,Lu as M6,Tu as Z5,Vu as Q5,Yu as r1,av as Y5,dv as W$,ev as V6,qv as K6}from"./chunk-met6wtbk.js";import{Aw as g6,Bw as f6,Dw as h6,Iw as w6,bw as W5,cw as D6,gw as x6,hw as S6,ww as P6,xw as b6,yw as y6,zw as v6}from"./chunk-e03m4har.js";import{Sw as s}from"./chunk-m8kem5ca.js";var t5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function U3($,X,Z={}){let{storage:Q="local",serializer:Y=t5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Z,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Q==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let O=L.getItem($);if(O===null)return X;let A=Y.read(O);if(J&&typeof X==="object"&&X!==null)return{...X,...A};return A}catch{return X}},F=(L)=>{let O=_();if(!O)return;try{if(L===null||L===void 0)O.removeItem($);else O.setItem($,Y.write(L))}catch(A){console.warn(`[useStorage] Failed to write key "${$}":`,A)}},z=U(),j=(L,O)=>{for(let A of W)try{A(L,O)}catch(M){console.error("[useStorage] Subscriber error:",M)}};if(K&&G){let L=(A)=>{if(A.key===$&&A.storageArea===_()){let M=z;try{z=A.newValue?Y.read(A.newValue):X}catch(V){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,V);return}j(z,M)}};window.addEventListener("storage",L);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",L))}let H={get value(){return z},set value(L){let O=z;z=L,F(L),j(L,O)},get:()=>z,set:(L)=>{H.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let O=z;z=X,j(X,O)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return H}function e5($,X,Z,Q,Y={}){let{serializer:J=t5,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 Q;try{let H=J.read(j);if(G&&typeof Q==="object"&&Q!==null)return{...Q,...H};return H}catch(H){return console.warn(`[${X}] Failed to read key "${Z}":`,H),Q}},z=n5((()=>{let j=_();if(!j)return Q;try{return U(j.getItem(Z))}catch(H){return console.warn(`[${X}] Cannot read "${Z}":`,H),Q}})());if(o5(()=>{let j=z(),H=_();if(!H)return;try{if(j===null||j===void 0)H.removeItem(Z);else H.setItem(Z,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Z}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Z)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",j))}return z}function B3($,X,Z){return e5("local","useLocalStorage",$,X,Z)}function L3($,X,Z){return e5("session","useSessionStorage",$,X,Z)}function F3($="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 j3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Z=0;for(let Q in X)if(Object.prototype.hasOwnProperty.call(X,Q))Z+=(Q.length+(X.getItem(Q)?.length||0))*2;return Z}var t=null;function c1($,X,Z=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Z.has($))return!0;if(Z.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(!c1($[J],X[J],Z))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)||!c1(G,X.get(J),Z))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 Q=Object.keys($),Y=Object.keys(X);if(Q.length!==Y.length)return!1;for(let J of Q){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!c1($[J],X[J],Z))return!1}return!0}function UJ($){t=$}function BJ(){return t}function LJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:H3()}}function H3(){return{refs:new Map,effects:new Set,cleanups:[]}}function FJ($){let X=new Set,Z=new Set,Q=$,Y=Symbol("ref"),J={get value(){let G=l1();if(G)Z.add(G);return Q},set value(G){if(!Object.is(G,Q)){let W=Q;Q=G;for(let K of X)K(G,W);for(let K of Z)if(a$())s$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(t)t.scope.refs.set(Y,J);return J}var $6=new WeakMap;function O3($){let X=$6.get($);if(X)return X;let Z=new Map,Q=(G)=>{let W=Z.get(G);if(!W)return;for(let K of[...W])if(a$())s$(K);else K()},Y=(G,W)=>{if(!Z.has(G))Z.set(G,new Set);return Z.get(G).add(W),()=>{Z.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=l1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return O3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Q(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Q(W),K}});return $6.set($,J),J}function zJ($){let X,Z=!0,Q=new Set,Y=new Set,J=()=>{Z=!0,G()},G=()=>{if(Z){let K=X,_=I1(J);if(X=$(),R1(_),Z=!1,!Object.is(X,K)){for(let U of Q)U(X,K);for(let U of Y)U()}}},W=I1(J);return X=$(),Z=!1,R1(W),{get value(){let K=l1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Q.add(K),()=>{Q.delete(K)}}}}function A3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function jJ($,X,Z={}){let{immediate:Q=!1,deep:Y=!1,flush:J="post"}=Z,G,W,K=!1,_=()=>{if(K)return;let H=j();if((Y?!c1(H,G):!Object.is(H,G))||Q)if(X(H,G),Y&&H!==null&&typeof H==="object")try{G=structuredClone(H)}catch{G=H}else G=H},U=(H)=>{if(J==="sync")H();else if(J==="pre")Promise.resolve().then(H);else A3(H)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let H=I1(z);try{return $()}finally{R1(H)}}return $.value};if(typeof $!=="function"){let H=$.subscribe(()=>{U(_)});W=()=>{K=!0,H()}}else W=()=>{K=!0};if(G=j(),Q)U(_);if(t)t.scope.cleanups.push(()=>W?.());return()=>W?.()}function HJ($,X,Z={}){let Q=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Q.push(G)}if(Z.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Q)J()}}function OJ($){let X,Z=!1,Q=()=>{if(Z)return;if(X)X();let Y=I1(Q);X=$(),R1(Y)};if(Q(),t)t.scope.cleanups.push(()=>{if(Z=!0,X)X()});return()=>{if(Z=!0,X)X()}}function AJ($){if(t)t.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function NJ($){if(t)t.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function qJ($){if(t)t.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function MJ($){if(t)t.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function VJ($){if(t)t.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function EJ($){if(t)t.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function Y1($,X){let Z=$.hooks[X];for(let Q of Z)await Q()}async function IJ($){await Y1($,"beforeMount"),$.isMounted=!0,await Y1($,"mounted")}async function RJ($){if(!$.isMounted||$.isUnmounted)return;await Y1($,"beforeUpdate"),await Y1($,"updated")}async function DJ($){if($.isUnmounted)return;await Y1($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await Y1($,"unmounted")}function wJ(){return`
|
|
3
3
|
<script data-stx-client-runtime>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -697,7 +697,7 @@ else {
|
|
|
697
697
|
<span class="frontmatter-label">${X}:</span>
|
|
698
698
|
<span>${Array.isArray(Z)?Z.join(", "):String(Z)}</span>
|
|
699
699
|
</div>`).join("")}
|
|
700
|
-
</div>`}import N6 from"net";async function O4($){return new Promise((X)=>{let Z=N6.createServer();Z.once("error",()=>X(!1)),Z.once("listening",()=>{Z.close(()=>X(!0))}),Z.listen($,"0.0.0.0")})}async function A4($){return new Promise((X)=>{let Z=N6.createServer();Z.once("error",()=>X(!1)),Z.once("listening",()=>{Z.close(()=>X(!0))}),Z.listen($,"::")})}async function N4($){if(!await O4($))return!1;return await A4($)}async function h0($,X=20){$=Number($);for(let Z=0;Z<X;Z++){let Q=$+Z;if(await N4(Q))return Q}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var q4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function M4(){try{let $=await import("./chunk-
|
|
700
|
+
</div>`}import N6 from"net";async function O4($){return new Promise((X)=>{let Z=N6.createServer();Z.once("error",()=>X(!1)),Z.once("listening",()=>{Z.close(()=>X(!0))}),Z.listen($,"0.0.0.0")})}async function A4($){return new Promise((X)=>{let Z=N6.createServer();Z.once("error",()=>X(!1)),Z.once("listening",()=>{Z.close(()=>X(!0))}),Z.listen($,"::")})}async function N4($){if(!await O4($))return!1;return await A4($)}async function h0($,X=20){$=Number($);for(let Z=0;Z<X;Z++){let Q=$+Z;if(await N4(Q))return Q}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var q4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function M4(){try{let $=await import("./chunk-z2rvc8d5.js");if(typeof $.openDevWindow!=="function")return null;return $}catch{return null}}async function G1($,X={}){let Z={...q4,...X},Q=await M4();if(!Q)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 Q.openDevWindow($,{title:Z.title,width:Z.width,height:Z.height,darkMode:Z.darkMode,hotReload:Z.hotReload,titlebarHidden:Z.titlebarHidden,nativeSidebar:Z.nativeSidebar,sidebarWidth:Z.sidebarWidth,sidebarConfig:Z.sidebarConfig});if(Y&&Z.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 Z$($){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=`
|
|
701
701
|
${J}
|
|
702
702
|
return typeof sidebarConfig !== 'undefined' ? sidebarConfig : null;
|
|
703
703
|
`,K=Function(G)();if(K)return K}catch(G){console.warn("Invalid sidebarConfig:",G)}}return{sections:[]}}let Z=$.match(/@nativeSidebar\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(Z)try{return JSON.parse(Z[1])}catch{console.warn("Invalid @nativeSidebar configuration")}let Q=$.match(/<script\s+native-sidebar[^>]*>([\s\S]*?)<\/script>/i);if(Q)try{let Y=Q[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 e$(){console.log(`
|
|
@@ -1132,7 +1132,7 @@ ${O}`}if(H=await E6(H),W.forEach((L)=>Q.add(L)),Z.cache&&Z.cachePath){if(await U
|
|
|
1132
1132
|
<h1>Something went wrong</h1>
|
|
1133
1133
|
<p>An internal error occurred. Please try again later.</p>
|
|
1134
1134
|
</body>
|
|
1135
|
-
</html>`,loader:"html"}}})}};async function C4($,X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=Q0.resolve($);if(!E0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return X5(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=u0(process.cwd(),"output");E0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let I={name:"public-assets",setup(T){T.onResolve({filter:/^\/(images|fonts|assets|public)\//},(f)=>{return{path:f.path,external:!0}})}},E=await Bun.build({entrypoints:[W],outdir:K,plugins:[I,_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!E.success)return console.error(`${B.red}Build failed:${B.reset}`,E.logs),!1;let w=E.outputs.find((T)=>T.path.endsWith(".html"));if(!w)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(w.path).text(),!0}catch(I){return console.error(`${B.red}Error building stx file:${B.reset}`,I),!1}};if(!await U())return!1;let z=Q0.dirname(W);await L$(z);let j=Z;try{if(j=await h0(Z),j!==Z)console.log(`${B.yellow}Port ${Z} 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 I=X.hmrPort||j+1;J=G$({wsPort:I,verbose:!1}),G=J.start(I)}let H={},L=null,O;try{let{loadStxConfig:I}=await import("./chunk-
|
|
1135
|
+
</html>`,loader:"html"}}})}};async function C4($,X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=Q0.resolve($);if(!E0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return X5(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=u0(process.cwd(),"output");E0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let I={name:"public-assets",setup(T){T.onResolve({filter:/^\/(images|fonts|assets|public)\//},(f)=>{return{path:f.path,external:!0}})}},E=await Bun.build({entrypoints:[W],outdir:K,plugins:[I,_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!E.success)return console.error(`${B.red}Build failed:${B.reset}`,E.logs),!1;let w=E.outputs.find((T)=>T.path.endsWith(".html"));if(!w)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(w.path).text(),!0}catch(I){return console.error(`${B.red}Error building stx file:${B.reset}`,I),!1}};if(!await U())return!1;let z=Q0.dirname(W);await L$(z);let j=Z;try{if(j=await h0(Z),j!==Z)console.log(`${B.yellow}Port ${Z} 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 I=X.hmrPort||j+1;J=G$({wsPort:I,verbose:!1}),G=J.start(I)}let H={},L=null,O;try{let{loadStxConfig:I}=await import("./chunk-6pdfvpa6.js"),E=await I();if(O=X.stxOptions?.serverApi??E.serverApi,E?.apiRouter)L=E?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(E?.apiRoutes){H=E.apiRoutes;let w=Object.keys(H).length;if(w>0)console.log(`${B.blue}Loaded ${B.bright}${w} API route${w>1?"s":""}${B.reset}`)}if(E?.broadcasting?.enabled)try{let{startBroadcasting:w,loadChannels:D}=await import("./chunk-0w12p79j.js"),T=E.broadcasting;await w(T);let f=T.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${f}/ws${B.reset}`);let c=Q0.join(process.cwd(),"channels.ts");if(E0.existsSync(c))try{let v=await D(c);console.log(`${B.blue}Loaded ${B.bright}${v} broadcast channel${v!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(v){console.warn(`${B.yellow}Failed to load channels.ts: ${v.message}${B.reset}`)}}catch(w){console.warn(`${B.yellow}Broadcasting failed to start: ${w.message}${B.reset}`)}}catch{}let{createServerApi:A,isServerApiSource:M}=await import("./chunk-x6c2t5dv.js"),V=await A(process.cwd(),O);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 N=T4({port:j,async fetch(I){return z$(I,await(async()=>{let E=new URL(I.url);if([K,Q0.dirname(W),Q0.join(process.cwd(),"public")].some((v)=>M(Q0.join(v,E.pathname),process.cwd(),O)))return new Response("Not Found",{status:404});if(L)try{let v=await L.handleRequest(I);if(v.status!==404)return v}catch{}if(H[E.pathname])try{return await H[E.pathname](I)}catch(v){return new Response(JSON.stringify({error:v.message}),{status:500,headers:{"Content-Type":"application/json"}})}let w=await V(I);if(w)return w;if(E.pathname==="/")return(async()=>{let S=await J0(_||"");if(Y)S=P0(S,G);if(X.native)if(S.includes("<head>"))S=S.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(S.includes("<html"))S=S.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 S="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+S;if(X.titlebarHidden)if(S.includes("<head>"))S=S.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(S.includes("<html"))S=S.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 S=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${S}`;return S})().then((S)=>new Response(S,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let D=Q0.join(K,E.pathname);if(E0.existsSync(D)&&E0.statSync(D).isFile()){let v=Bun.file(D),S=Q0.extname(D).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let T=Q0.dirname(W),f=Q0.join(T,E.pathname);if(E0.existsSync(f)&&E0.statSync(f).isFile()){let v=Bun.file(f),S=Q0.extname(f).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let c=Q0.join(process.cwd(),"public",E.pathname);if(E0.existsSync(c)&&E0.statSync(c).isFile()){let v=Bun.file(c),S=Q0.extname(c).toLowerCase(),k="application/octet-stream";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}return new Response("Not Found",{status:404})})())},error(I){return new Response(`<pre>${I}
|
|
1136
1136
|
${I.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
1137
1137
|
${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(`
|
|
1138
1138
|
${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
|
|
@@ -1619,7 +1619,7 @@ ${H.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
|
|
|
1619
1619
|
${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(`
|
|
1620
1620
|
${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
|
|
1621
1621
|
${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((H)=>H.routeTemplate)),j=Object.entries(G).filter(([H])=>!z.has(H)).sort(([H],[L])=>H.localeCompare(L)).map(([H,L])=>({route:H==="/"?"/":H,filePath:B0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let H of W){let L=H.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:B0.relative(process.cwd(),H.filePath),fileType:"stx"})}if(j.sort((H,L)=>H.route.localeCompare(L.route)),j.forEach((H,L)=>{let A=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",M=H.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${A}${H.route}${B.reset} \u2192 ${B.bright}${H.filePath}${B.reset} ${M}`)}),console.log(`
|
|
1622
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),d0(F.url.toString(),()=>{if(Q)m0.watch(J,{recursive:!0}).close();F.stop()}),Q){console.log(`${B.blue}Watching for changes...${B.reset}`);let H=m0.watch(J,{recursive:!0},async(L,O)=>{if(!O)return;if(O.endsWith(".stx")||O.endsWith(".js")||O.endsWith(".ts")||O.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${O}${B.yellow} changed, rebuilding...${B.reset}`),o0.clear(),t0(),await K()});process.on("SIGINT",()=>{H.close(),F.stop(),process.exit(0)})}return!0}function R6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:S4}=globalThis.Bun;import e from"fs";import m from"path";async function k6($){try{return _5(await Bun.file($).text())}catch{return}}function G5($){let X=Bun.file($),Z=m.extname($).toLowerCase(),Q={".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(Z)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Q[Z]||"application/octet-stream",...J}})}async function P4($=".",X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=m.resolve($),{loadStxConfig:K}=await import("./chunk-g1w0krp7.js"),_=await K(W),{createServerApi:U,isServerApiSource:F}=await import("./chunk-x6c2t5dv.js"),z=X.stxOptions?.serverApi??_.serverApi,j=await U(W,z),H=_.root&&_.root!=="."?m.join(W,_.root):W,L=X.pagesDir||_.pagesDir||"pages",O=m.join(H,L);if(!e.existsSync(O)&&!_._layerPageDirs?.some((R)=>e.existsSync(R)))return console.error(`${B.red}Error: No '${L}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${O}${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 ${L}/index.stx for the homepage.${B.reset}`),!1;let A=H$(H,{pagesDir:L,pagesDirs:_._layerPageDirs?[O,..._._layerPageDirs.slice(1)]:void 0});if(A.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${O}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${A.length}${B.blue} routes${B.reset}`);let M=_?._pluginPageDirs||[],V=[];for(let{dir:R,prefix:x}of M)if(e.existsSync(R)){let P=H$(m.dirname(R),{pagesDir:m.basename(R)});for(let y of P){let Z0=x==="/"?y.pattern:`${x}${y.pattern==="/"?"":y.pattern}`;V.push({route:{...y,pattern:Z0},prefix:x})}if(P.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${P.length}${B.blue} routes at ${B.cyan}${x}${B.reset}`)}let N=new Map,q=null,I=null;if(X.stxOptions?.shell!==!1){if(I=await l6(W,X.stxOptions?.shell),I){if(q=await K5(I,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${m.relative(W,I)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}P6(),await y6(W);let E=b6();if(E.length>0)console.log(`${B.blue}Loaded ${B.bright}${E.length}${B.blue} middleware: ${B.dim}${E.join(", ")}${B.reset}`);let w={},D=null;try{let{loadStxConfig:R}=await import("./chunk-g1w0krp7.js"),x=await R(W);if(x?.apiRouter)D=x?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(x?.apiRoutes){w=x.apiRoutes;let P=Object.keys(w).length;if(P>0)console.log(`${B.blue}Loaded ${B.bright}${P} API route${P>1?"s":""}${B.reset}`)}if(x?.broadcasting?.enabled)try{let{startBroadcasting:P,loadChannels:y}=await import("./chunk-0w12p79j.js"),Z0=x.broadcasting;await P(Z0);let R0=Z0.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${R0}/ws${B.reset}`);let g0=m.join(process.cwd(),"channels.ts");if(e.existsSync(g0))try{let p=await y(g0);console.log(`${B.blue}Loaded ${B.bright}${p} broadcast channel${p!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(p){console.warn(`${B.yellow}Failed to load channels.ts: ${p.message}${B.reset}`)}}catch(P){console.warn(`${B.yellow}Broadcasting failed to start: ${P.message}${B.reset}`)}}catch{}let T=u0(W,"output");e.mkdirSync(T,{recursive:!0});let f=new Map,c=new Set,v=async(R)=>{let x=x6(O,R);if(!x)return null;try{let P=await Bun.build({entrypoints:[x],outdir:T,plugins:[_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!P.success)return null;let y=P.outputs.find((Z0)=>Z0.path.endsWith(".html"));if(!y)return null;return await Bun.file(y.path).text()}catch{return null}},S=new Map,k=async(R,x)=>{try{let{processDirectives:P,extractVariables:y,defaultConfig:Z0,loadStxConfig:R0,injectRouterScript:g0}=await import("./chunk-g1w0krp7.js"),{checkCache:p,cacheTemplate:u,readFileCached:g,templateCache:h}=await import("./chunk-7ppey2yt.js"),Y0=await R0(W),f0=(i)=>{if(!i)return i;if(m.isAbsolute(i))return i;return m.resolve(W,i)},C={...Z0,...Y0,...X.stxOptions,autoShell:!0};if(X.debugDirectives)C.debug=!0;C.partialsDir=f0(C.partialsDir),C.componentsDir=f0(C.componentsDir),C.layoutsDir=f0(C.layoutsDir),C.storesDir=f0(C.storesDir||"stores"),C.cachePath=f0(C.cachePath)??u0(W,"cache");let X0=!x&&!X.profile,a=C.cache!==!1;if(a&&X0){let i=h.get(R.filePath);if(i)try{if((await e.promises.stat(R.filePath)).mtime.getTime()<=i.mtime){let q0=!0;for(let _0 of i.dependencies){if(!e.existsSync(_0)){q0=!1;break}if((await e.promises.stat(_0)).mtime.getTime()>i.mtime){q0=!1;break}}if(q0){let _0=i.output;if(q)_0=A$(_0,{preserveHead:!0});let E1=S.get(R.filePath);return{route:R,content:_0,status:E1?.status??await k6(R.filePath),headers:E1?.headers}}}}catch{}let A0=await p(R.filePath,C);if(A0){let N0=A0;if(q)N0=A$(N0,{preserveHead:!0});let q0=S.get(R.filePath);return{route:R,content:N0,status:q0?.status??await k6(R.filePath),headers:q0?.headers}}}let o=a?await g(R.filePath):await Bun.file(R.filePath).text(),K0=_5(o),{classifyAllScripts:d}=await import("./chunk-g1w0krp7.js"),O0=d(o),D0=O0.server.map((i)=>i.content),r=o;for(let i of O0.server)r=r.replace(i.fullTag,"");let n={__filename:R.filePath,__dirname:m.dirname(R.filePath),__stx_options:C,params:x??{},__stx_runtime_head:{}};for(let i of D0)try{await y(i,n,R.filePath)}catch(A0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",R.filePath,A0?.message||A0)}let S0=new Set,j0;if(X.profile){let i=performance.now();j0=await P(r,n,R.filePath,C,S0);let A0=performance.now()-i,N0=m.relative(W,R.filePath)||R.filePath;console.log(`[stx:profile] ${N0} \u2192 ${A0.toFixed(2)}ms`)}else j0=await P(r,n,R.filePath,C,S0);if(!q)j0=await g0(j0,{router:C.router});{let{interpolateScriptExpressions:i}=await import("./chunk-0p52xkk9.js");j0=j0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(A0,N0,q0)=>{if(!/function\s+__stx_setup_/.test(q0))return A0;return`<script${N0}>${i(q0,n)}</script>`})}if(q)j0=A$(j0,{preserveHead:!0});if(a&&X0)await u(R.filePath,j0,S0,C);let{extractStreamBoundaries:_3}=await import("./chunk-xn226qe0.js"),Q1=_3(n),V1=n.__streamTemplates;if(V1&&typeof V1==="object"&&Object.keys(V1).length>0){let i=n.streamBoundaries||{},A0={...C,autoShell:!1},N0=Object.keys(V1).map((_0)=>({id:_0,render:async()=>{let E1=typeof i[_0]==="function"?await i[_0]():void 0;return P(V1[_0],{...n,$boundary:E1},R.filePath,A0,new Set)}})),q0=new Set(N0.map((_0)=>_0.id));Q1=[...(Q1||[]).filter((_0)=>!q0.has(_0.id)),...N0]}if(Q1&&Q1.length>0)c.add(R.pattern);else Q1=void 0;let s5=T1(n),r5=C1(n);if(X0)S.set(R.filePath,{status:s5,headers:r5});return{route:R,content:j0,status:s5??K0,headers:r5,boundaries:Q1}}catch(P){return console.error(`${B.red}Error building ${B.bright}${R.pattern}${B.reset}:`,P),null}},H0=8,G0=async()=>{f.clear(),N.clear();for(let R=0;R<A.length;R+=H0){let x=A.slice(R,R+H0),P=await Promise.all(x.map((y)=>k(y)));for(let y of P)if(y)f.set(y.route.pattern,y)}for(let R=0;R<V.length;R+=H0){let x=V.slice(R,R+H0),P=await Promise.all(x.map(({route:y})=>k(y)));for(let y of P)if(y)N.set(y.route.pattern,y)}return f.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await G0())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await L$(W);let v0=Z;try{if(v0=await h0(Z),v0!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${v0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let R=X.hmrPort||v0+1;J=G$({wsPort:R,verbose:!1}),G=J.start(R)}let z0=(R,x)=>{let y=`<script data-stx-route-params>(function(){var p=${JSON.stringify(x).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(R.includes("</head>"))return R.replace("</head>",`${y}</head>`);if(R.includes("<body"))return R.replace(/<body([^>]*)>/,`<body$1>${y}`);return y+R};console.log(`${B.blue}Starting server...${B.reset}`);let Z1=S4({port:v0,async fetch(R){let x=new URL(R.url),P=_?.publicDir||"public",y=m.join(W,P,x.pathname),Z0=m.join(W,x.pathname),R0=m.join(T,x.pathname);if([y,Z0,R0].some((C)=>F(C,W,z)))return new Response("Not Found",{status:404});let[g0,p,u]=await Promise.all([e.promises.stat(y).catch(()=>null),e.promises.stat(Z0).catch(()=>null),e.promises.stat(R0).catch(()=>null)]);if(g0?.isFile()&&!F(y,W,z))return G5(y);if(p?.isFile()&&!F(Z0,W,z))return G5(Z0);if(u?.isFile()&&!F(R0,W,z))return G5(R0);if(x.pathname.startsWith("/_stx/component/")){let C=decodeURIComponent(x.pathname.slice(16));if(C)try{let X0=`<${C} />`,a={...buildConfig,autoShell:!1},o=await processDirectives(X0,{},m.join(W,"components",`${C}.stx`),a,new Set);return new Response(o,{headers:{"Content-Type":"text/html"}})}catch(X0){return new Response(`<div class="stx-async-error">${X0.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(x.pathname==="/_stx/img"){let{handleImageRequest:C}=await import("./chunk-sd57d9bq.js"),X0=await C(R,{publicDir:m.join(W,P),cacheDir:u0(W,"cache","img")});if(X0)return X0}if(D)try{let C=await D.handleRequest(R);if(C.status!==404)return C}catch{}if(w[x.pathname])try{return await w[x.pathname](R)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}let g=await j(R);if(g)return g;let h=W5(x.pathname,A);if(h){let C=f.get(h.route.pattern),X0=c.has(h.route.pattern);if(h.route.isDynamic&&Object.keys(h.params).length>0||X0){let a=await k(h.route,h.params);if(a)C=a}if(C){let a=C.status??200,o=C.headers??{},K0=(h.route.filePath?d6(await Bun.file(h.route.filePath).text().catch(()=>"")):null)??{};if(K0.validate){if(!await K0.validate({params:h.params})){let D0=await v(404);if(D0){let r=D0;if(r=await J0(r,W),Y)r=P0(r,G);return new Response(r,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(K0.middleware){let O0=v6(x.pathname,h.params,K0,x.search),D0=g6(O0,null,R,{isServer:!0}),r=await f6(K0.middleware,D0);if(r.redirect){let n=r.redirect.path,S0=r.redirect.options.redirectCode||302,j0=new Headers(r.responseHeaders);return j0.set("Location",n),new Response(null,{status:S0,headers:j0})}if(r.abort){let{statusCode:n,message:S0}=r.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${n}</title></head><body><h1>Error ${n}</h1><p>${S0}</p></body></html>`,{status:n,headers:{"Content-Type":"text/html"}})}if(Object.keys(r.state).length>0){let n=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(r.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;C.content=C.content.replace("</head>",`${n}</head>`)}}let d=C.content;if(q&&i6(R)){let O0=h6(d),D0=u6(d),r=d.match(/<title[^>]*>([\s\S]*?)<\/title>/i),n=r?c6(r[1].trim()):"";if(Object.keys(h.params).length>0)d=z0(d,h.params);d=await J0(d,W);let S0=_?.router?.container||"main";return d=a6(d,S0),new Response(d,{status:a,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":O0.layout,"X-STX-Layout-Group":O0.group,"X-STX-Runtime":D0?"true":"false",...n&&{"X-STX-Title":encodeURIComponent(n)},[m6]:p6(),...B1(),"Cache-Control":j$}})}if(q)d=O$(q,d);if(Object.keys(h.params).length>0)d=z0(d,h.params);if(d=await J0(d,W),Y)d=P0(d,G);if(X.native)if(d.includes("<head>"))d=d.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 d="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+d;if(X.titlebarHidden)if(d.includes("<head>"))d=d.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 d=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${d}`;if(C.boundaries&&C.boundaries.length>0){let{renderStreamingPage:O0,streamToResponse:D0}=await import("./chunk-xn226qe0.js");return D0(O0(d,C.boundaries,{timeoutMs:30000}),{status:a,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(d,{status:a,headers:{"Content-Type":"text/html",...B1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...o}})}}if(V.length>0){let C=V.map((a)=>a.route),X0=W5(x.pathname,C);if(X0){let a=N.get(X0.route.pattern);if(a){let o=a.content;if(q)o=O$(q,o);if(Object.keys(X0.params).length>0)o=z0(o,X0.params);if(o=await J0(o,W),Y)o=P0(o,G);return new Response(o,{status:a.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:a}of M)if(a!=="/"&&x.pathname.startsWith(a)){let o=N.get(a)||N.get(a+"/");if(o){let K0=o.content;if(q)K0=O$(q,K0);if(K0=await J0(K0,W),Y)K0=P0(K0,G);return new Response(K0,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let Y0=f.get("/");if(Y0){let C=Y0.content;if(C=await J0(C,W),Y)C=P0(C,G);if(X.native)if(C.includes("<head>"))C=C.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 C="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+C;return new Response(C,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let f0=await v(404);if(f0){let C=f0;if(C=await J0(C,W),Y)C=P0(C,G);return new Response(C,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(R){let x=await v(500);if(x)return new Response(x,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${R}
|
|
1622
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),d0(F.url.toString(),()=>{if(Q)m0.watch(J,{recursive:!0}).close();F.stop()}),Q){console.log(`${B.blue}Watching for changes...${B.reset}`);let H=m0.watch(J,{recursive:!0},async(L,O)=>{if(!O)return;if(O.endsWith(".stx")||O.endsWith(".js")||O.endsWith(".ts")||O.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${O}${B.yellow} changed, rebuilding...${B.reset}`),o0.clear(),t0(),await K()});process.on("SIGINT",()=>{H.close(),F.stop(),process.exit(0)})}return!0}function R6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:S4}=globalThis.Bun;import e from"fs";import m from"path";async function k6($){try{return _5(await Bun.file($).text())}catch{return}}function G5($){let X=Bun.file($),Z=m.extname($).toLowerCase(),Q={".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(Z)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Q[Z]||"application/octet-stream",...J}})}async function P4($=".",X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=m.resolve($),{loadStxConfig:K}=await import("./chunk-6pdfvpa6.js"),_=await K(W),{createServerApi:U,isServerApiSource:F}=await import("./chunk-x6c2t5dv.js"),z=X.stxOptions?.serverApi??_.serverApi,j=await U(W,z),H=_.root&&_.root!=="."?m.join(W,_.root):W,L=X.pagesDir||_.pagesDir||"pages",O=m.join(H,L);if(!e.existsSync(O)&&!_._layerPageDirs?.some((R)=>e.existsSync(R)))return console.error(`${B.red}Error: No '${L}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${O}${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 ${L}/index.stx for the homepage.${B.reset}`),!1;let A=H$(H,{pagesDir:L,pagesDirs:_._layerPageDirs?[O,..._._layerPageDirs.slice(1)]:void 0});if(A.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${O}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${A.length}${B.blue} routes${B.reset}`);let M=_?._pluginPageDirs||[],V=[];for(let{dir:R,prefix:x}of M)if(e.existsSync(R)){let P=H$(m.dirname(R),{pagesDir:m.basename(R)});for(let y of P){let Z0=x==="/"?y.pattern:`${x}${y.pattern==="/"?"":y.pattern}`;V.push({route:{...y,pattern:Z0},prefix:x})}if(P.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${P.length}${B.blue} routes at ${B.cyan}${x}${B.reset}`)}let N=new Map,q=null,I=null;if(X.stxOptions?.shell!==!1){if(I=await l6(W,X.stxOptions?.shell),I){if(q=await K5(I,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${m.relative(W,I)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}P6(),await y6(W);let E=b6();if(E.length>0)console.log(`${B.blue}Loaded ${B.bright}${E.length}${B.blue} middleware: ${B.dim}${E.join(", ")}${B.reset}`);let w={},D=null;try{let{loadStxConfig:R}=await import("./chunk-6pdfvpa6.js"),x=await R(W);if(x?.apiRouter)D=x?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(x?.apiRoutes){w=x.apiRoutes;let P=Object.keys(w).length;if(P>0)console.log(`${B.blue}Loaded ${B.bright}${P} API route${P>1?"s":""}${B.reset}`)}if(x?.broadcasting?.enabled)try{let{startBroadcasting:P,loadChannels:y}=await import("./chunk-0w12p79j.js"),Z0=x.broadcasting;await P(Z0);let R0=Z0.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${R0}/ws${B.reset}`);let g0=m.join(process.cwd(),"channels.ts");if(e.existsSync(g0))try{let p=await y(g0);console.log(`${B.blue}Loaded ${B.bright}${p} broadcast channel${p!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(p){console.warn(`${B.yellow}Failed to load channels.ts: ${p.message}${B.reset}`)}}catch(P){console.warn(`${B.yellow}Broadcasting failed to start: ${P.message}${B.reset}`)}}catch{}let T=u0(W,"output");e.mkdirSync(T,{recursive:!0});let f=new Map,c=new Set,v=async(R)=>{let x=x6(O,R);if(!x)return null;try{let P=await Bun.build({entrypoints:[x],outdir:T,plugins:[_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!P.success)return null;let y=P.outputs.find((Z0)=>Z0.path.endsWith(".html"));if(!y)return null;return await Bun.file(y.path).text()}catch{return null}},S=new Map,k=async(R,x)=>{try{let{processDirectives:P,extractVariables:y,defaultConfig:Z0,loadStxConfig:R0,injectRouterScript:g0}=await import("./chunk-6pdfvpa6.js"),{checkCache:p,cacheTemplate:u,readFileCached:g,templateCache:h}=await import("./chunk-7ppey2yt.js"),Y0=await R0(W),f0=(i)=>{if(!i)return i;if(m.isAbsolute(i))return i;return m.resolve(W,i)},C={...Z0,...Y0,...X.stxOptions,autoShell:!0};if(X.debugDirectives)C.debug=!0;C.partialsDir=f0(C.partialsDir),C.componentsDir=f0(C.componentsDir),C.layoutsDir=f0(C.layoutsDir),C.storesDir=f0(C.storesDir||"stores"),C.cachePath=f0(C.cachePath)??u0(W,"cache");let X0=!x&&!X.profile,a=C.cache!==!1;if(a&&X0){let i=h.get(R.filePath);if(i)try{if((await e.promises.stat(R.filePath)).mtime.getTime()<=i.mtime){let q0=!0;for(let _0 of i.dependencies){if(!e.existsSync(_0)){q0=!1;break}if((await e.promises.stat(_0)).mtime.getTime()>i.mtime){q0=!1;break}}if(q0){let _0=i.output;if(q)_0=A$(_0,{preserveHead:!0});let E1=S.get(R.filePath);return{route:R,content:_0,status:E1?.status??await k6(R.filePath),headers:E1?.headers}}}}catch{}let A0=await p(R.filePath,C);if(A0){let N0=A0;if(q)N0=A$(N0,{preserveHead:!0});let q0=S.get(R.filePath);return{route:R,content:N0,status:q0?.status??await k6(R.filePath),headers:q0?.headers}}}let o=a?await g(R.filePath):await Bun.file(R.filePath).text(),K0=_5(o),{classifyAllScripts:d}=await import("./chunk-6pdfvpa6.js"),O0=d(o),D0=O0.server.map((i)=>i.content),r=o;for(let i of O0.server)r=r.replace(i.fullTag,"");let n={__filename:R.filePath,__dirname:m.dirname(R.filePath),__stx_options:C,params:x??{},__stx_runtime_head:{}};for(let i of D0)try{await y(i,n,R.filePath)}catch(A0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",R.filePath,A0?.message||A0)}let S0=new Set,j0;if(X.profile){let i=performance.now();j0=await P(r,n,R.filePath,C,S0);let A0=performance.now()-i,N0=m.relative(W,R.filePath)||R.filePath;console.log(`[stx:profile] ${N0} \u2192 ${A0.toFixed(2)}ms`)}else j0=await P(r,n,R.filePath,C,S0);if(!q)j0=await g0(j0,{router:C.router});{let{interpolateScriptExpressions:i}=await import("./chunk-0p52xkk9.js");j0=j0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(A0,N0,q0)=>{if(!/function\s+__stx_setup_/.test(q0))return A0;return`<script${N0}>${i(q0,n)}</script>`})}if(q)j0=A$(j0,{preserveHead:!0});if(a&&X0)await u(R.filePath,j0,S0,C);let{extractStreamBoundaries:_3}=await import("./chunk-xn226qe0.js"),Q1=_3(n),V1=n.__streamTemplates;if(V1&&typeof V1==="object"&&Object.keys(V1).length>0){let i=n.streamBoundaries||{},A0={...C,autoShell:!1},N0=Object.keys(V1).map((_0)=>({id:_0,render:async()=>{let E1=typeof i[_0]==="function"?await i[_0]():void 0;return P(V1[_0],{...n,$boundary:E1},R.filePath,A0,new Set)}})),q0=new Set(N0.map((_0)=>_0.id));Q1=[...(Q1||[]).filter((_0)=>!q0.has(_0.id)),...N0]}if(Q1&&Q1.length>0)c.add(R.pattern);else Q1=void 0;let s5=T1(n),r5=C1(n);if(X0)S.set(R.filePath,{status:s5,headers:r5});return{route:R,content:j0,status:s5??K0,headers:r5,boundaries:Q1}}catch(P){return console.error(`${B.red}Error building ${B.bright}${R.pattern}${B.reset}:`,P),null}},H0=8,G0=async()=>{f.clear(),N.clear();for(let R=0;R<A.length;R+=H0){let x=A.slice(R,R+H0),P=await Promise.all(x.map((y)=>k(y)));for(let y of P)if(y)f.set(y.route.pattern,y)}for(let R=0;R<V.length;R+=H0){let x=V.slice(R,R+H0),P=await Promise.all(x.map(({route:y})=>k(y)));for(let y of P)if(y)N.set(y.route.pattern,y)}return f.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await G0())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await L$(W);let v0=Z;try{if(v0=await h0(Z),v0!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${v0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let R=X.hmrPort||v0+1;J=G$({wsPort:R,verbose:!1}),G=J.start(R)}let z0=(R,x)=>{let y=`<script data-stx-route-params>(function(){var p=${JSON.stringify(x).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(R.includes("</head>"))return R.replace("</head>",`${y}</head>`);if(R.includes("<body"))return R.replace(/<body([^>]*)>/,`<body$1>${y}`);return y+R};console.log(`${B.blue}Starting server...${B.reset}`);let Z1=S4({port:v0,async fetch(R){let x=new URL(R.url),P=_?.publicDir||"public",y=m.join(W,P,x.pathname),Z0=m.join(W,x.pathname),R0=m.join(T,x.pathname);if([y,Z0,R0].some((C)=>F(C,W,z)))return new Response("Not Found",{status:404});let[g0,p,u]=await Promise.all([e.promises.stat(y).catch(()=>null),e.promises.stat(Z0).catch(()=>null),e.promises.stat(R0).catch(()=>null)]);if(g0?.isFile()&&!F(y,W,z))return G5(y);if(p?.isFile()&&!F(Z0,W,z))return G5(Z0);if(u?.isFile()&&!F(R0,W,z))return G5(R0);if(x.pathname.startsWith("/_stx/component/")){let C=decodeURIComponent(x.pathname.slice(16));if(C)try{let X0=`<${C} />`,a={...buildConfig,autoShell:!1},o=await processDirectives(X0,{},m.join(W,"components",`${C}.stx`),a,new Set);return new Response(o,{headers:{"Content-Type":"text/html"}})}catch(X0){return new Response(`<div class="stx-async-error">${X0.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(x.pathname==="/_stx/img"){let{handleImageRequest:C}=await import("./chunk-sd57d9bq.js"),X0=await C(R,{publicDir:m.join(W,P),cacheDir:u0(W,"cache","img")});if(X0)return X0}if(D)try{let C=await D.handleRequest(R);if(C.status!==404)return C}catch{}if(w[x.pathname])try{return await w[x.pathname](R)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}let g=await j(R);if(g)return g;let h=W5(x.pathname,A);if(h){let C=f.get(h.route.pattern),X0=c.has(h.route.pattern);if(h.route.isDynamic&&Object.keys(h.params).length>0||X0){let a=await k(h.route,h.params);if(a)C=a}if(C){let a=C.status??200,o=C.headers??{},K0=(h.route.filePath?d6(await Bun.file(h.route.filePath).text().catch(()=>"")):null)??{};if(K0.validate){if(!await K0.validate({params:h.params})){let D0=await v(404);if(D0){let r=D0;if(r=await J0(r,W),Y)r=P0(r,G);return new Response(r,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(K0.middleware){let O0=v6(x.pathname,h.params,K0,x.search),D0=g6(O0,null,R,{isServer:!0}),r=await f6(K0.middleware,D0);if(r.redirect){let n=r.redirect.path,S0=r.redirect.options.redirectCode||302,j0=new Headers(r.responseHeaders);return j0.set("Location",n),new Response(null,{status:S0,headers:j0})}if(r.abort){let{statusCode:n,message:S0}=r.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${n}</title></head><body><h1>Error ${n}</h1><p>${S0}</p></body></html>`,{status:n,headers:{"Content-Type":"text/html"}})}if(Object.keys(r.state).length>0){let n=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(r.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;C.content=C.content.replace("</head>",`${n}</head>`)}}let d=C.content;if(q&&i6(R)){let O0=h6(d),D0=u6(d),r=d.match(/<title[^>]*>([\s\S]*?)<\/title>/i),n=r?c6(r[1].trim()):"";if(Object.keys(h.params).length>0)d=z0(d,h.params);d=await J0(d,W);let S0=_?.router?.container||"main";return d=a6(d,S0),new Response(d,{status:a,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":O0.layout,"X-STX-Layout-Group":O0.group,"X-STX-Runtime":D0?"true":"false",...n&&{"X-STX-Title":encodeURIComponent(n)},[m6]:p6(),...B1(),"Cache-Control":j$}})}if(q)d=O$(q,d);if(Object.keys(h.params).length>0)d=z0(d,h.params);if(d=await J0(d,W),Y)d=P0(d,G);if(X.native)if(d.includes("<head>"))d=d.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 d="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+d;if(X.titlebarHidden)if(d.includes("<head>"))d=d.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 d=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${d}`;if(C.boundaries&&C.boundaries.length>0){let{renderStreamingPage:O0,streamToResponse:D0}=await import("./chunk-xn226qe0.js");return D0(O0(d,C.boundaries,{timeoutMs:30000}),{status:a,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(d,{status:a,headers:{"Content-Type":"text/html",...B1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...o}})}}if(V.length>0){let C=V.map((a)=>a.route),X0=W5(x.pathname,C);if(X0){let a=N.get(X0.route.pattern);if(a){let o=a.content;if(q)o=O$(q,o);if(Object.keys(X0.params).length>0)o=z0(o,X0.params);if(o=await J0(o,W),Y)o=P0(o,G);return new Response(o,{status:a.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:a}of M)if(a!=="/"&&x.pathname.startsWith(a)){let o=N.get(a)||N.get(a+"/");if(o){let K0=o.content;if(q)K0=O$(q,K0);if(K0=await J0(K0,W),Y)K0=P0(K0,G);return new Response(K0,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let Y0=f.get("/");if(Y0){let C=Y0.content;if(C=await J0(C,W),Y)C=P0(C,G);if(X.native)if(C.includes("<head>"))C=C.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 C="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+C;return new Response(C,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let f0=await v(404);if(f0){let C=f0;if(C=await J0(C,W),Y)C=P0(C,G);return new Response(C,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(R){let x=await v(500);if(x)return new Response(x,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${R}
|
|
1623
1623
|
${R.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
|
|
1624
1624
|
${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(`
|
|
1625
1625
|
${B.bright}\u2192 ${B.cyan}http://localhost:${v0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
|
|
@@ -891,7 +891,7 @@ NoDisplay=true`:""}
|
|
|
891
891
|
`;if(!p(Q))J4(Q,{recursive:!0});Q4(J,K,"utf-8")}else if(p(J))G4(J)}async function Z8(Z){return p(z4(Z))}async function Y8(Z){let Y=R4(Z);if(!p(Y))return!1;try{let $=s6(Y,"utf-8");if($.includes("X-GNOME-Autostart-enabled=false"))return!1;if($.includes("Hidden=true"))return!1;return!0}catch{return!1}}function $8(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function J8(Z,Y={}){let $=X4();switch($){case"darwin":return t6(Z,Y);case"linux":return e6(Z,Y);default:throw Error(`Auto-launch is not yet supported on ${$}`)}}async function G8(Z){let Y=Z||"StxApp";switch(X4()){case"darwin":return Z8(Y);case"linux":return Y8(Y);default:return!1}}var B=new Map,Q8=0,zZ=!1;function K4(Z){let Y=Z.split("+").map((J)=>J.trim()),$={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let J of Y){let Q=J.toLowerCase();switch(Q){case"cmd":case"command":case"meta":case"\u2318":$.meta=!0;break;case"ctrl":case"control":case"\u2303":$.ctrl=!0;break;case"shift":case"\u21E7":$.shift=!0;break;case"alt":case"option":case"opt":case"\u2325":$.alt=!0;break;case"cmdorctrl":case"commandorcontrol":if(typeof process<"u"&&process.platform==="darwin")$.meta=!0;else $.ctrl=!0;break;default:$.key=Q}}return $}function X8(Z){let Y=[];if(Z.ctrl)Y.push("\u2303");if(Z.alt)Y.push("\u2325");if(Z.shift)Y.push("\u21E7");if(Z.meta)Y.push("\u2318");return Y.push(Z.key.toUpperCase()),Y.join("")}function z8(Z,Y){if(Y.meta!==Z.metaKey)return!1;if(Y.ctrl!==Z.ctrlKey)return!1;if(Y.shift!==Z.shiftKey)return!1;if(Y.alt!==Z.altKey)return!1;return Z.key.toLowerCase()===Y.key||Z.code.toLowerCase()===`key${Y.key}`}function F4(Z){for(let[,Y]of B)if(z8(Z,Y.parsed)){Z.preventDefault(),Z.stopPropagation();try{Y.handler()}catch{}break}}function R8(){if(zZ)return;if(typeof document>"u")return;document.addEventListener("keydown",F4,!0),zZ=!0}function TZ(){if(!zZ)return;if(typeof document>"u")return;document.removeEventListener("keydown",F4,!0),zZ=!1}async function K8(Z,Y){if(typeof window>"u")return!1;let $=window.craft;if(!$?.hotkeys?.register)return!1;try{return await $.hotkeys.register(Z,Y),!0}catch{return!1}}async function NZ(Z){if(typeof window>"u")return;let Y=window.craft;if(!Y?.hotkeys?.unregister)return;try{await Y.hotkeys.unregister(Z)}catch{}}function F8(Z,Y){let $=`hotkey_${++Q8}_${Date.now()}`,J=K4(Z);B.set($,{shortcut:Z,handler:Y,parsed:J}),K8($,Z),R8();let Q={shortcut:Z,id:$,unregister(){j4(Q)}};return Q}function j4(Z){if(B.delete(Z.id),NZ(Z.id),B.size===0)TZ()}function j8(){for(let[Z]of B)NZ(Z);B.clear(),TZ()}function O8(){return Array.from(B.entries()).map(([Z,Y])=>({shortcut:Y.shortcut,id:Z,unregister(){if(B.delete(Z),NZ(Z),B.size===0)TZ()}}))}class O4{_duration;_tickInterval;_remaining;_running=!1;_paused=!1;_complete=!1;_intervalId=null;_lastTick=0;_completionHandlers=new Set;_tickHandlers=new Set;constructor(Z){if(this._duration=Z.duration,this._tickInterval=Z.tickInterval||1000,this._remaining=Z.duration,Z.onComplete)this._completionHandlers.add(Z.onComplete);if(Z.onTick)this._tickHandlers.add(Z.onTick);if(Z.autoStart)this.start()}get isRunning(){return this._running&&!this._paused}get isPaused(){return this._paused}get isComplete(){return this._complete}get remaining(){if(this._running&&!this._paused){let Z=Date.now()-this._lastTick;return Math.max(0,this._remaining-Z)}return Math.max(0,this._remaining)}get elapsed(){return this._duration-this.remaining}get duration(){return this._duration}get progress(){if(this._duration===0)return 1;return Math.min(1,this.elapsed/this._duration)}start(){if(this._running)return;this._running=!0,this._paused=!1,this._complete=!1,this._lastTick=Date.now(),this._startInterval()}stop(){this._clearInterval(),this._running=!1,this._paused=!1,this._remaining=this._duration}pause(){if(!this._running||this._paused)return;let Z=Date.now()-this._lastTick;this._remaining=Math.max(0,this._remaining-Z),this._clearInterval(),this._paused=!0}resume(){if(!this._paused)return;this._paused=!1,this._lastTick=Date.now(),this._startInterval()}reset(){this._clearInterval(),this._running=!1,this._paused=!1,this._complete=!1,this._remaining=this._duration}onComplete(Z){return this._completionHandlers.add(Z),()=>{this._completionHandlers.delete(Z)}}onTick(Z){return this._tickHandlers.add(Z),()=>{this._tickHandlers.delete(Z)}}_startInterval(){this._clearInterval(),this._intervalId=setInterval(()=>{let Z=Date.now(),Y=Z-this._lastTick;this._lastTick=Z,this._remaining=Math.max(0,this._remaining-Y);for(let $ of this._tickHandlers)try{$(this._remaining)}catch{}if(this._remaining<=0){this._clearInterval(),this._running=!1,this._complete=!0;for(let $ of this._completionHandlers)try{$()}catch{}}},this._tickInterval)}_clearInterval(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null}}class V4{_interval;_handler;_immediate;_running=!1;_intervalId=null;constructor(Z){if(this._interval=Z.interval,this._handler=Z.handler,this._immediate=Z.immediate!==!1,this._immediate)this.start()}get isRunning(){return this._running}start(){if(this._running)return;this._running=!0,this._intervalId=setInterval(()=>{try{this._handler()}catch{}},this._interval)}stop(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null;this._running=!1}}function V8(Z){return new O4(Z)}function q8(Z){return new V4(Z)}function U8(Z){return new Promise((Y)=>setTimeout(Y,Z))}function P8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0)return`${$}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${J}:${String(Q).padStart(2,"0")}`}function L8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0){if(J>0)return`${$}h ${J}m`;return`${$}h`}if(J>0){if(Q>0)return`${J}m ${Q}s`;return`${J}m`}return`${Q}s`}function G(Z){if(typeof window>"u")return!1;let Y=window.craft;return!!(Y&&Y[Z])}function M(Z){if(!G(Z))throw Error(`craft.${Z} is not available \u2014 this API requires a Craft native window`);return window.craft[Z]}function U(Z,Y){if(typeof window>"u")return()=>{};let $=(J)=>Y(J.detail??{});return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var W8={async writeText(Z){if(G("clipboard")){await window.craft.clipboard.writeText(Z);return}if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(Z)},async readText(){if(G("clipboard")){let Z=await window.craft.clipboard.readText();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.readText)try{return await navigator.clipboard.readText()}catch{return""}return""},async writeHTML(Z){if(G("clipboard")){await window.craft.clipboard.writeHTML(Z);return}if(typeof navigator<"u"&&navigator.clipboard?.write)try{let Y=new window.ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([D8(Z)],{type:"text/plain"})});await navigator.clipboard.write([Y])}catch{}},async readHTML(){if(G("clipboard")){let Z=await window.craft.clipboard.readHTML();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.read)try{let Z=await navigator.clipboard.read();for(let Y of Z)if(Y.types.includes("text/html"))return await(await Y.getType("text/html")).text()}catch{}return""},async clear(){if(G("clipboard")){await window.craft.clipboard.clear();return}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText("")}catch{}},async hasText(){if(G("clipboard"))return await window.craft.clipboard.hasText();return(await this.readText()).length>0},async hasHTML(){if(G("clipboard"))return await window.craft.clipboard.hasHTML();return(await this.readHTML()).length>0},async hasImage(){if(G("clipboard"))return await window.craft.clipboard.hasImage();return!1}};function D8(Z){return Z.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<\/?(br|p|div|li|h[1-6])\b[^>]*>/gi,`
|
|
892
892
|
`).replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\n{3,}/g,`
|
|
893
893
|
|
|
894
|
-
`).trim()}var M8={async show(Z){if(!Z.title)throw Error("notification title is required");if(G("notifications")){await window.craft.notifications.show(Z);return}if(typeof window<"u"&&"Notification"in window){let Y=window.Notification;if(Y.permission==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon});else if(Y.permission==="default"){if(await Y.requestPermission()==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon})}}},async schedule(Z){if(G("notifications")){let J={...Z};if(J.triggerAt instanceof Date)J.triggerAt=J.triggerAt.toISOString();await window.craft.notifications.schedule(J);return}let Y=_8(Z.triggerAt),$=Math.max(0,Y-Date.now());setTimeout(()=>{this.show(Z).catch(()=>{})},$)},async cancel(Z){if(G("notifications"))await window.craft.notifications.cancel(Z)},async cancelAll(){if(G("notifications"))await window.craft.notifications.cancelAll()},async setBadge(Z){let Y=Math.max(0,Math.round(Number.isFinite(Z)?Z:0));if(G("notifications")){await window.craft.notifications.setBadge(Y);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge(Y)}catch{}},async clearBadge(){if(G("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(G("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let Z=window.Notification;if(Z.permission==="granted")return!0;if(Z.permission==="denied")return!1;return await Z.requestPermission()==="granted"}return!1},async registerCategories(Z){if(!Array.isArray(Z)||Z.length===0)return;if(G("notifications")){let Y=window.craft.notifications.registerCategories;if(typeof Y==="function")await Y(Z)}},onActionClicked(Z){return U("craft:notification:actionClicked",Z)},onReply(Z){return U("craft:notification:reply",Z)}};function _8(Z){if(Z==null)return Date.now();if(Z instanceof Date)return Z.getTime();if(typeof Z==="number")return Z;let Y=Date.parse(Z);return Number.isNaN(Y)?Date.now():Y}var T8={async readFile(Z){let Y=await M("fs").readFile(Z);return Y&&Y.data||""},async readBuffer(Z){let Y=await M("fs").readFile(Z),$=Y&&Y.data||"";if(Y&&Y.base64===!0)return E8($);return new TextEncoder().encode($)},async writeFile(Z,Y){await M("fs").writeFile(Z,Y)},async writeBuffer(Z,Y){let $=N8(Y),J=M("fs");if(typeof J.writeFileBytes==="function")await J.writeFileBytes(Z,$);else await J.writeFile(Z,$)},async copy(Z,Y){if(Z===Y)throw Error("fs.copy: source and destination must differ");await M("fs").copy(Z,Y)},async move(Z,Y){if(Z===Y)throw Error("fs.move: source and destination must differ");await M("fs").move(Z,Y)},async appendFile(Z,Y){await M("fs").appendFile(Z,Y)},async deleteFile(Z){await M("fs").deleteFile(Z)},async exists(Z){return await M("fs").exists(Z)},async stat(Z){return A8(await M("fs").stat(Z))},async readDir(Z){let Y=await M("fs").readDir(Z),$=Y&&Y.entries||[],J=Z.endsWith("/")?Z.slice(0,-1):Z;return $.map((Q)=>({name:Q.name,path:`${J}/${Q.name}`,isDirectory:!!Q.isDirectory}))},async mkdir(Z,Y){await M("fs").mkdir(Z,Y)},async rmdir(Z,Y){await M("fs").rmdir(Z,Y)},async watch(Z,Y){await M("fs").watch(Z,Y)},async unwatch(Z){await M("fs").unwatch(Z)},onChange(Z){return U("craft:fs:change",Z)},async watchTree(Z,Y,$){let J=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Q=M("fs");await Q.watch(Z,J,{recursive:!!Y.recursive});let X=Y.kinds&&Y.kinds.length>0?new Set(Y.kinds):null,R=Math.max(0,Math.floor(Y.coalesceMs??0)),z=[],K=null,F=!1,O=()=>{if(K=null,z.length===0)return;let j=z;z=[];try{$(j)}catch{}},V=U("craft:fs:change",(j)=>{if(F)return;if(j.id!==J)return;if(X&&j.kind&&!X.has(j.kind))return;if(z.push(j),R===0){O();return}if(K==null)K=setTimeout(O,R)});return{id:J,async stop(){if(F)return;if(F=!0,V(),K)clearTimeout(K),K=null;if(z.length>0)O();try{await Q.unwatch(J)}catch{}}}},async homeDir(){return await M("fs").homeDir()},async tempDir(){return await M("fs").tempDir()},async appDataDir(){return await M("fs").appDataDir()}};function N8(Z){let Y="";for(let $=0;$<Z.length;$++)Y+=String.fromCharCode(Z[$]);return typeof btoa==="function"?btoa(Y):Buffer.from(Z).toString("base64")}function E8(Z){let Y=typeof atob==="function"?atob(Z):Buffer.from(Z,"base64").toString("binary"),$=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)$[J]=Y.charCodeAt(J);return $}function A8(Z){return{isFile:!!Z.isFile,isDirectory:!!Z.isDirectory,isSymlink:!!Z.isSymlink,size:Number(Z.size)||0,modifiedAt:Z.modifiedAt!=null?Z.modifiedAt<1000000000000?Z.modifiedAt*1000:Z.modifiedAt:0}}var a=new Set,q4=!1;function k8(){if(q4)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(Z)=>{let Y=Z.detail;if(Y?.id)a.delete(Y.id)}),q4=!0}var H8=new Set(["javascript:","data:","file:","vbscript:"]),x8={async openExternal(Z){let Y=Z.trim().toLowerCase();for(let $ of H8)if(Y.startsWith($))throw Error(`shell.openExternal: ${$} URLs are blocked for safety`);if(G("shell")){await window.craft.shell.openExternal(Z);return}if(typeof window<"u"&&typeof window.open==="function")window.open(Z,"_blank","noopener,noreferrer")},async openPath(Z){await M("shell").openPath(Z)},async showInFinder(Z){await M("shell").showInFinder(Z)},async spawn(Z,Y,$=[],J={}){if(k8(),!Z||typeof Z!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!Y||typeof Y!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray($))throw Error("shell.spawn: args must be an array");for(let Q of $)if(typeof Q!=="string")throw Error("shell.spawn: args entries must be strings");if(a.has(Z))throw Error(`shell.spawn: id "${Z}" is already in use \u2014 call kill(id) first or pick a different id`);a.add(Z);try{await M("shell").spawn(Z,Y,$,J)}catch(Q){throw a.delete(Z),Q}},async kill(Z){await M("shell").kill(Z),a.delete(Z)},async getEnv(Z){if(G("shell")){let Y=await window.craft.shell.getEnv(Z);return Y==null?void 0:String(Y)}return},async setEnv(Z,Y){await M("shell").setEnv(Z,Y)},onStdout(Z){return U("craft:shell:stdout",Z)},onStderr(Z){return U("craft:shell:stderr",Z)},onExit(Z){return U("craft:shell:exit",Z)}};function u(){return window.craft.shortcuts}var C8={async register(Z,Y,$){if(!G("shortcuts"))return;await u().register(Z,Y,$)},async unregister(Z){if(!G("shortcuts"))return;await u().unregister(Z)},async unregisterAll(){if(!G("shortcuts"))return;await u().unregisterAll()},async enable(Z){if(!G("shortcuts"))return;await u().enable(Z)},async disable(Z){if(!G("shortcuts"))return;await u().disable(Z)},async isRegistered(Z){if(!G("shortcuts"))return!1;return await u().isRegistered(Z)},async list(){if(!G("shortcuts"))return[];return await u().list()},on(Z){return U("craft:shortcut",Z)}};var I8={get(){if(G("theme"))try{return window.craft.theme.get()}catch{}return{appearance:S8()}},onChange(Z){if(Z(this.get()),G("theme"))return U("craft:theme",Z);if(typeof window<"u"&&window.matchMedia){let Y=window.matchMedia("(prefers-color-scheme: dark)"),$=()=>Z({appearance:Y.matches?"dark":"light"});return Y.addEventListener("change",$),()=>Y.removeEventListener("change",$)}return()=>{}},async current(){return this.get()}};function S8(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function w8(Z,Y={}){if(!G("dragOut"))throw Error("dragOut requires a Craft native window");let $=Array.isArray(Z)?Z:[Z];if($.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start($,Y)}function B8(){return G("dragOut")}var f8={onUrl(Z){if(!G("deepLink"))return()=>{};return U("craft:deepLink",Z)},getInitialUrl(){if(typeof window>"u")return null;if(G("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let Z=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return Z},isAvailable(){return G("deepLink")}};var v8={async isCharging(){if(G("power"))return await window.craft.power.isCharging();let Z=await RZ();return Z?!!Z.charging:!1},async isPluggedIn(){if(G("power"))return await window.craft.power.isPluggedIn();let Z=await RZ();return Z?!!Z.charging||Z.level>=0.999:!1},async isLowPowerMode(){if(G("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(G("power")){let Y=await window.craft.power.batteryLevel();return typeof Y==="number"?Y:null}let Z=await RZ();return Z?Z.level:null},async timeRemaining(){if(G("power")){let $=await window.craft.power.timeRemaining();return typeof $==="number"?$:null}let Z=await RZ();if(!Z)return null;let Y=Z.charging?Z.chargingTime:Z.dischargingTime;return Number.isFinite(Y)?Math.round(Y/60):null},async thermalState(){if(G("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(G("power"))return await window.craft.power.uptimeSeconds();if(typeof performance<"u"&&typeof performance.now==="function")return Math.round(performance.now()/1000);return 0},async preventSleep(Z="app is busy"){if(G("power")){await window.craft.power.preventSleep(Z);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let Y=window;if(Y.__craftWebWakeLock?.release){try{await Y.__craftWebWakeLock.release()}catch{}Y.__craftWebWakeLock=null}try{let $=await navigator.wakeLock.request("screen");Y.__craftWebWakeLock=$}catch{}},async allowSleep(){if(G("power")){await window.craft.power.allowSleep();return}let Z=window.__craftWebWakeLock;if(Z&&typeof Z.release==="function"){try{await Z.release()}catch{}window.__craftWebWakeLock=null}},onSleep(Z){return U("craft:powerSleep",Z)},onWake(Z){return U("craft:powerWake",Z)}};async function RZ(){if(typeof navigator>"u")return null;let Z=navigator;if(typeof Z.getBattery!=="function")return null;try{return await Z.getBattery()}catch{return null}}var y8={async connectionType(){if(G("network"))return await window.craft.network.connectionType();return U4()},async wifiSSID(){if(G("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(G("network")){let Z=await window.craft.network.wifiSignalStrength();return typeof Z==="number"?Z:void 0}return},async ipAddress(){if(G("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(G("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(G("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(G("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(G("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(G("network"))await window.craft.network.openPreferences()},onChange(Z){if(G("network"))return U("craft:networkChange",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({type:U4(),online:!0}),$=()=>Z({type:"none",online:!1});return window.addEventListener("online",Y),window.addEventListener("offline",$),()=>{window.removeEventListener("online",Y),window.removeEventListener("offline",$)}}};function U4(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let Z=navigator.connection;if(!Z)return"unknown";let Y=String(Z.type||Z.effectiveType||"unknown").toLowerCase();if(Y==="wifi"||Y==="cellular"||Y==="ethernet"||Y==="bluetooth"||Y==="none")return Y;return"unknown"}var g8={async checkForUpdates(){if(!G("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!G("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(Z){if(!G("updater"))return;await window.craft.updater.setAutomaticChecks(Z)},async setCheckInterval(Z){if(!G("updater"))return;if(!Number.isFinite(Z))throw Error("setCheckInterval: must be a finite number");let Y=Z<=0?0:Math.max(60,Math.round(Z));await window.craft.updater.setCheckInterval(Y)},async setFeedURL(Z){if(!G("updater"))return;await window.craft.updater.setFeedURL(Z)},async getLastUpdateCheckDate(){if(!G("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!G("updater"))return null;let Z=await window.craft.updater.getUpdateInfo();if(!Z||typeof Z.version!=="string"||Z.version.length===0)return null;return Z},onAvailable(Z){return U("craft:updateAvailable",Z)},onDownloaded(Z){return U("craft:updateDownloaded",Z)},async verifySignature({payload:Z,signatureB64:Y,publicKeyB64:$}){let J=P4(Z),Q;try{Q=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",Q,KZ(Y),J)}catch{return!1}},async verifyDownload({url:Z,signatureB64:Y,publicKeyB64:$,fetchInit:J}){let Q;try{Q=await fetch(Z,J)}catch{return{ok:!1,reason:"fetch-failed"}}if(!Q.ok)return{ok:!1,reason:"http-error",status:Q.status};let X=new Uint8Array(await Q.arrayBuffer()),R;try{R=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let z=!1;try{z=await crypto.subtle.verify("Ed25519",R,KZ(Y),P4(X))}catch{z=!1}if(!z)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:X}}};function P4(Z){if(Z instanceof ArrayBuffer)return new Uint8Array(Z);let Y=new ArrayBuffer(Z.byteLength),$=new Uint8Array(Y);return $.set(Z),$}function KZ(Z){if(typeof atob==="function"){let J=atob(Z),Q=new ArrayBuffer(J.length),X=new Uint8Array(Q);for(let R=0;R<J.length;R++)X[R]=J.charCodeAt(R);return X}let Y=Buffer.from(Z,"base64"),$=new ArrayBuffer(Y.length);return new Uint8Array($).set(Y),new Uint8Array($)}var b8={onFocus(Z){if(G("window"))return U("craft:window:focus",()=>Z());return EZ("focus",Z)},onBlur(Z){if(G("window"))return U("craft:window:blur",()=>Z());return EZ("blur",Z)},onResize(Z){if(G("window"))return U("craft:window:resize",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},onMove(Z){if(G("window"))return U("craft:window:move",Z);return()=>{}},onClose(Z){if(G("window"))return U("craft:window:close",()=>Z());return EZ("beforeunload",Z)},onMinimize(Z){if(G("window"))return U("craft:window:minimize",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="hidden")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},onRestore(Z){if(G("window"))return U("craft:window:restore",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="visible")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)}};function EZ(Z,Y){if(typeof window>"u")return()=>{};let $=()=>Y();return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var L4={name:"",version:"0.0.0"},u8={async hideDockIcon(){if(G("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(G("app"))await window.craft.app.showDockIcon()},async quit(){if(G("app"))await window.craft.app.quit()},async getInfo(){if(!G("app"))return L4;let Z=await window.craft.app.getInfo();return{...L4,...Z||{}}},async notify(Z){if(!Z.title)throw Error("notify: title is required");if(G("app"))await window.craft.app.notify(Z)},async setBadge(Z){if(G("app"))await window.craft.app.setBadge(Z)},async bounce(Z="informational"){if(G("app"))await window.craft.app.bounce(Z)}};var m8={app(Z){return{label:Z,items:[{label:`About ${Z}`,role:"about"},{separator:!0},{label:`Hide ${Z}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${Z}`,role:"quit",shortcut:"cmd+q"}]}},edit(){return{label:"Edit",items:[{label:"Undo",role:"undo",shortcut:"cmd+z"},{label:"Redo",role:"redo",shortcut:"cmd+shift+z"},{separator:!0},{label:"Cut",role:"cut",shortcut:"cmd+x"},{label:"Copy",role:"copy",shortcut:"cmd+c"},{label:"Paste",role:"paste",shortcut:"cmd+v"},{label:"Select All",role:"selectAll",shortcut:"cmd+a"}]}},window(){return{label:"Window",items:[{label:"Minimize",role:"minimize",shortcut:"cmd+m"},{label:"Zoom",role:"zoom"},{separator:!0},{label:"Close Window",role:"close",shortcut:"cmd+w"}]}},leading(Z){return[this.app(Z),this.edit()]}},h8=0;function c8(Z){let Y=new Map;return{payload:{menus:Z.menus.map((J)=>({label:J.label,items:J.items.map((Q)=>{let{onClick:X,...R}=Q;if(R.separator)return R;let z=R.id??`stx.menu.${h8++}`;if(X)Y.set(z,X);return{...R,id:z}})}))},handlers:Y}}var AZ=null,p8={async set(Z){if(!G("menu"))return!1;let{payload:Y,handlers:$}=c8(Z);if(AZ?.(),AZ=null,$.size>0)AZ=U("craft:menu:action",(J)=>{$.get(J.id)?.()});return await window.craft.menu.set(Y),!0},async setDock(Z){if(G("menu"))await window.craft.menu.setDock(Z)},async addItem(Z,Y){if(G("menu"))await window.craft.menu.addItem(Z,Y)},async removeItem(Z){if(G("menu"))await window.craft.menu.removeItem(Z)},async enableItem(Z){if(G("menu"))await window.craft.menu.enableItem(Z)},async disableItem(Z){if(G("menu"))await window.craft.menu.disableItem(Z)},async checkItem(Z){if(G("menu"))await window.craft.menu.checkItem(Z)},async uncheckItem(Z){if(G("menu"))await window.craft.menu.uncheckItem(Z)},async setItemLabel(Z,Y){if(G("menu"))await window.craft.menu.setItemLabel(Z,Y)},async clearDock(){if(G("menu"))await window.craft.menu.clearDock()},onAction(Z){return U("craft:menu:action",Z)}};function D4(Z){if(Z.separator)return{id:Z.id||"",title:"",type:"separator"};return{id:Z.id||"",title:Z.title||"",icon:Z.icon,shortcut:Z.shortcut,enabled:Z.disabled?!1:void 0,type:Z.submenu?"submenu":void 0,submenu:Z.submenu?.map(D4)}}async function W4(Z){if(!Z.items||Z.items.length===0)throw Error("contextMenu.show requires at least one item");if(!G("nativeUI"))return null;let Y=await window.craft.nativeUI.showContextMenu({targetId:Z.targetId||"",targetType:"general",x:Math.round(Z.x),y:Math.round(Z.y),items:Z.items.map(D4)});return{id:typeof Y?.id==="string"?Y.id:null,targetId:Y?.targetId}}var l8={available(){return G("nativeUI")},async show(Z){return await W4(Z)!==null},async pick(Z){return(await W4(Z))?.id??null},onAction(Z){return U("craft:contextmenu:action",(Y)=>{if(typeof Y.id==="string")Z({id:Y.id,targetId:Y.targetId??""})})}};var d8={accentColor:()=>x("system","accentColor",()=>""),highlightColor:()=>x("system","highlightColor",()=>""),language:()=>x("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>x("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>x("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>x("system","is24HourTime",()=>{try{let Z=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return Z.hourCycle==="h23"||Z.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>x("system","reduceMotion",()=>kZ("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>x("system","reduceTransparency",()=>kZ("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>x("system","increaseContrast",()=>kZ("(prefers-contrast: more)")),systemVersion:()=>x("system","systemVersion",()=>""),hostname:()=>x("system","hostname",()=>""),username:()=>x("system","username",()=>""),async openPreferences(){if(G("system"))await window.craft.system.openPreferences()}};async function x(Z,Y,$){if(G(Z))return await window.craft[Z][Y]();return await $()}function kZ(Z){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(Z).matches}var r8={async getDisplays(){if(G("screen"))return await window.craft.screen.getDisplays();return M4()},async getPrimary(){if(G("screen")){let Z=await window.craft.screen.getPrimary();return Z&&typeof Z.width==="number"?Z:null}return M4()[0]??null},onChange(Z){if(G("screen"))return U("craft:screen:change",()=>Z());if(typeof window>"u")return()=>{};let Y=()=>Z();return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)}};function M4(){if(typeof window>"u"||!window.screen)return[];let Z=window.screen;return[{id:0,x:Z.left??0,y:Z.top??0,width:Z.width||0,height:Z.height||0,workX:Z.availLeft??0,workY:Z.availTop??0,workWidth:Z.availWidth??Z.width??0,workHeight:Z.availHeight??Z.height??0,scaleFactor:window.devicePixelRatio||1}]}var n8={async set(Z,Y,$){if(!Z)throw Error("keychain.set: service is required");if(!Y)throw Error("keychain.set: account is required");await M("keychain").set(Z,Y,$)},async get(Z,Y){if(!Z)throw Error("keychain.get: service is required");if(!Y)throw Error("keychain.get: account is required");let $=await M("keychain").get(Z,Y);return typeof $==="string"?$:null},async delete(Z,Y){if(!Z)throw Error("keychain.delete: service is required");if(!Y)throw Error("keychain.delete: account is required");await M("keychain").delete(Z,Y)},async has(Z,Y){if(!Z)throw Error("keychain.has: service is required");if(!Y)throw Error("keychain.has: account is required");return await M("keychain").has(Z,Y)}};var o8={async check(Z){if(G("permissions"))return await window.craft.permissions.check(Z);return await _4(Z)},async request(Z){if(G("permissions"))return await window.craft.permissions.request(Z);return await a8(Z)},async openSettings(Z){if(G("permissions"))await window.craft.permissions.openSettings(Z)}};async function _4(Z){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let Y=await navigator.permissions.query({name:Z});return i8(Y.state)}catch{return"not-supported"}}async function a8(Z){if(Z==="notifications"&&typeof window<"u"&&"Notification"in window){let Y=await window.Notification.requestPermission();return Y==="granted"?"granted":Y==="denied"?"denied":"undetermined"}return await _4(Z)}function i8(Z){if(Z==="granted")return"granted";if(Z==="denied")return"denied";if(Z==="prompt")return"undetermined";return"undetermined"}var s8={async print(){if(G("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(Z){if(!Z)throw Error("printToPDF: path is required");let Y=Z.startsWith("/"),$=/^[a-zA-Z]:[\\/]/.test(Z)||Z.startsWith("\\\\");if(!Y&&!$)throw Error("printToPDF: path must be absolute");let J=await M("printing").printToPDF(Z);return{ok:!!(J&&J.ok),path:J?.path}}};var t8={async enable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};function HZ(){if(!G("window"))return null;return window.craft.window}function f(Z){let Y=HZ();if(!Y)return Promise.resolve();try{return Promise.resolve(Z(Y)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var e8={get available(){return HZ()!==null},open(Z){let Y=()=>{if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return{name:Z.name}},$=HZ();if(!$?.open)return Promise.resolve(Y());return $.open(Z).then((J)=>({name:J?.name||Z.name})).catch(Y)},close:()=>f((Z)=>Z.close?.()),focus:()=>f((Z)=>Z.focus?.()),minimize:()=>f((Z)=>Z.minimize?.()),maximize:()=>f((Z)=>Z.maximize?.()),center:()=>f((Z)=>Z.center?.()),startDrag:()=>f((Z)=>Z.startDrag?.()),setTitle:(Z)=>f((Y)=>Y.setTitle?.(Z)),setSize:(Z,Y)=>f(($)=>$.setSize?.(Z,Y)),setAppearance:(Z)=>f((Y)=>Y.setAppearance?.(Z))};var Z9={async addItem(Z){if(G("touchbar"))await window.craft.touchbar.addItem(Z)},async removeItem(Z){if(G("touchbar"))await window.craft.touchbar.removeItem(Z)},async updateItem(Z,Y){if(G("touchbar"))await window.craft.touchbar.updateItem(Z,Y)},async setLabel(Z,Y){if(G("touchbar"))await window.craft.touchbar.setLabel(Z,Y)},async setIcon(Z,Y){if(G("touchbar"))await window.craft.touchbar.setIcon(Z,Y)},async setEnabled(Z,Y){if(G("touchbar"))await window.craft.touchbar.setEnabled(Z,Y)},async setSliderValue(Z,Y){if(G("touchbar"))await window.craft.touchbar.setSliderValue(Z,Y)},async clear(){if(G("touchbar"))await window.craft.touchbar.clear()},async show(){if(G("touchbar"))await window.craft.touchbar.show()},async hide(){if(G("touchbar"))await window.craft.touchbar.hide()},onAction(Z){return U("craft:touchbar:action",Z)}};var Y9=/^[\da-f]*$/i;function $9(Z,Y){if(typeof Y!=="string"||!Y9.test(Y)||Y.length%2!==0)throw Error(`${Z}: must be a hex string with even length, got ${JSON.stringify(Y)}`)}var J9={async isEnabled(){return G("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return G("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return G("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return G("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return G("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(Z){if(G("bluetooth"))await window.craft.bluetooth.connect(Z)},async disconnect(Z){if(G("bluetooth"))await window.craft.bluetooth.disconnect(Z)},async openPreferences(){if(G("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(Z){if(!Z)throw Error("bluetooth.discoverServices: deviceId is required");if(!G("bluetooth"))return[];let Y=await window.craft.bluetooth.discoverServices(Z);return Array.isArray(Y)?Y:[]},async discoverCharacteristics(Z,Y){if(!Z||!Y)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!G("bluetooth"))return[];let $=await window.craft.bluetooth.discoverCharacteristics(Z,Y);return Array.isArray($)?$:[]},async readCharacteristic(Z,Y,$){if(!Z||!Y||!$)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(Z,Y,$)},async writeCharacteristic(Z,Y,$,J,Q="with-response"){if(!Z||!Y||!$)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if($9("bluetooth.writeCharacteristic.valueHex",J),!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(Z,Y,$,J,Q)},async setCharacteristicNotify(Z,Y,$,J){if(!Z||!Y||!$)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(Z,Y,$,J)},onDeviceFound(Z){return U("craft:bluetooth:deviceFound",Z)},onDeviceConnected(Z){return U("craft:bluetooth:deviceConnected",Z)},onDeviceDisconnected(Z){return U("craft:bluetooth:deviceDisconnected",Z)},onCharacteristicValue(Z){return U("craft:bluetooth:characteristicValue",Z)}};var G9={async speak(Z,Y){if(!Z)throw Error("speech.speak: text is required");if(G("speech")){await window.craft.speech.speak(Z,Y);return}if(typeof window<"u"&&window.speechSynthesis){let $=new window.SpeechSynthesisUtterance(Z);if(Y){if(Y.rate!=null)$.rate=Y.rate;if(Y.pitch!=null)$.pitch=Y.pitch;if(Y.volume!=null)$.volume=Y.volume;if(Y.voice){let Q=window.speechSynthesis.getVoices().find((X)=>X.voiceURI===Y.voice||X.name===Y.voice||X.lang===Y.voice);if(Q)$.voice=Q}}window.speechSynthesis.speak($)}},async stop(){if(G("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(G("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(G("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(G("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(G("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map((Y)=>({id:Y.voiceURI||Y.name,name:Y.name,language:Y.lang||"",quality:"default"}));return[]}};var i=[],xZ=!0,CZ,IZ,s={async report(Z){if(G("crashReporter")){await window.craft.crashReporter.report(Z);return}if(!xZ)return;let Y=Z instanceof Error?{timestamp:Date.now(),severity:"error",message:Z.message,source:"js",stack:Z.stack||"",userId:CZ,appVersion:IZ}:{timestamp:Date.now(),severity:Z.severity||"error",message:Z.message||"",source:Z.source||"js",stack:Z.stack||"",userId:CZ,appVersion:IZ};if(i.length>=64)i.shift();i.push(Y)},async flush(){if(G("crashReporter"))return await window.craft.crashReporter.flush();return[...i]},async clear(){if(G("crashReporter")){await window.craft.crashReporter.clear();return}i.length=0},async setEnabled(Z){if(G("crashReporter")){await window.craft.crashReporter.setEnabled(Z);return}xZ=Z},async isEnabled(){if(G("crashReporter"))return await window.craft.crashReporter.isEnabled();return xZ},async setUser(Z){if(G("crashReporter")){await window.craft.crashReporter.setUser(Z);return}CZ=Z||void 0},async setAppVersion(Z){if(G("crashReporter")){await window.craft.crashReporter.setAppVersion(Z);return}IZ=Z||void 0},attachGlobalHandlers(){if(G("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let Z=($)=>{s.report({severity:"error",message:$.message,source:"js",stack:$.error?.stack||`${$.message}
|
|
894
|
+
`).trim()}var M8={async show(Z){if(!Z.title)throw Error("notification title is required");if(G("notifications")){await window.craft.notifications.show(Z);return}if(typeof window<"u"&&"Notification"in window){let Y=window.Notification;if(Y.permission==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon});else if(Y.permission==="default"){if(await Y.requestPermission()==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon})}}},async schedule(Z){if(G("notifications")){let J={...Z};if(J.triggerAt instanceof Date)J.triggerAt=J.triggerAt.toISOString();await window.craft.notifications.schedule(J);return}let Y=_8(Z.triggerAt),$=Math.max(0,Y-Date.now());setTimeout(()=>{this.show(Z).catch(()=>{})},$)},async cancel(Z){if(G("notifications"))await window.craft.notifications.cancel(Z)},async cancelAll(){if(G("notifications"))await window.craft.notifications.cancelAll()},async setBadge(Z){let Y=Math.max(0,Math.round(Number.isFinite(Z)?Z:0));if(G("notifications")){await window.craft.notifications.setBadge(Y);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge(Y)}catch{}},async clearBadge(){if(G("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(G("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let Z=window.Notification;if(Z.permission==="granted")return!0;if(Z.permission==="denied")return!1;return await Z.requestPermission()==="granted"}return!1},async registerCategories(Z){if(!Array.isArray(Z)||Z.length===0)return;if(G("notifications")){let Y=window.craft.notifications.registerCategories;if(typeof Y==="function")await Y(Z)}},onActionClicked(Z){return U("craft:notification:actionClicked",Z)},onReply(Z){return U("craft:notification:reply",Z)}};function _8(Z){if(Z==null)return Date.now();if(Z instanceof Date)return Z.getTime();if(typeof Z==="number")return Z;let Y=Date.parse(Z);return Number.isNaN(Y)?Date.now():Y}var T8={async readFile(Z){let Y=await M("fs").readFile(Z);return Y&&Y.data||""},async readBuffer(Z){let Y=await M("fs").readFile(Z),$=Y&&Y.data||"";if(Y&&Y.base64===!0)return E8($);return new TextEncoder().encode($)},async writeFile(Z,Y){await M("fs").writeFile(Z,Y)},async writeBuffer(Z,Y){let $=N8(Y),J=M("fs");if(typeof J.writeFileBytes==="function")await J.writeFileBytes(Z,$);else await J.writeFile(Z,$)},async copy(Z,Y){if(Z===Y)throw Error("fs.copy: source and destination must differ");await M("fs").copy(Z,Y)},async move(Z,Y){if(Z===Y)throw Error("fs.move: source and destination must differ");await M("fs").move(Z,Y)},async appendFile(Z,Y){await M("fs").appendFile(Z,Y)},async deleteFile(Z){await M("fs").deleteFile(Z)},async exists(Z){return await M("fs").exists(Z)},async stat(Z){return A8(await M("fs").stat(Z))},async readDir(Z){let Y=await M("fs").readDir(Z),$=Y&&Y.entries||[],J=Z.endsWith("/")?Z.slice(0,-1):Z;return $.map((Q)=>({name:Q.name,path:`${J}/${Q.name}`,isDirectory:!!Q.isDirectory}))},async mkdir(Z,Y){await M("fs").mkdir(Z,Y)},async rmdir(Z,Y){await M("fs").rmdir(Z,Y)},async watch(Z,Y){await M("fs").watch(Z,Y)},async unwatch(Z){await M("fs").unwatch(Z)},onChange(Z){return U("craft:fs:change",Z)},async watchTree(Z,Y,$){let J=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Q=M("fs");await Q.watch(Z,J,{recursive:!!Y.recursive});let X=Y.kinds&&Y.kinds.length>0?new Set(Y.kinds):null,R=Math.max(0,Math.floor(Y.coalesceMs??0)),z=[],K=null,F=!1,O=()=>{if(K=null,z.length===0)return;let j=z;z=[];try{$(j)}catch{}},V=U("craft:fs:change",(j)=>{if(F)return;if(j.id!==J)return;if(X&&j.kind&&!X.has(j.kind))return;if(z.push(j),R===0){O();return}if(K==null)K=setTimeout(O,R)});return{id:J,async stop(){if(F)return;if(F=!0,V(),K)clearTimeout(K),K=null;if(z.length>0)O();try{await Q.unwatch(J)}catch{}}}},async homeDir(){return await M("fs").homeDir()},async tempDir(){return await M("fs").tempDir()},async appDataDir(){return await M("fs").appDataDir()}};function N8(Z){let Y="";for(let $=0;$<Z.length;$++)Y+=String.fromCharCode(Z[$]);return typeof btoa==="function"?btoa(Y):Buffer.from(Z).toString("base64")}function E8(Z){let Y=typeof atob==="function"?atob(Z):Buffer.from(Z,"base64").toString("binary"),$=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)$[J]=Y.charCodeAt(J);return $}function A8(Z){return{isFile:!!Z.isFile,isDirectory:!!Z.isDirectory,isSymlink:!!Z.isSymlink,size:Number(Z.size)||0,modifiedAt:Z.modifiedAt!=null?Z.modifiedAt<1000000000000?Z.modifiedAt*1000:Z.modifiedAt:0}}var a=new Set,q4=!1;function k8(){if(q4)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(Z)=>{let Y=Z.detail;if(Y?.id)a.delete(Y.id)}),q4=!0}var H8=new Set(["javascript:","data:","file:","vbscript:"]),x8={async openExternal(Z){let Y=Z.trim().toLowerCase();for(let $ of H8)if(Y.startsWith($))throw Error(`shell.openExternal: ${$} URLs are blocked for safety`);if(G("shell")){await window.craft.shell.openExternal(Z);return}if(typeof window<"u"&&typeof window.open==="function")window.open(Z,"_blank","noopener,noreferrer")},async openPath(Z){await M("shell").openPath(Z)},async showInFinder(Z){await M("shell").showInFinder(Z)},async spawn(Z,Y,$=[],J={}){if(k8(),!Z||typeof Z!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!Y||typeof Y!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray($))throw Error("shell.spawn: args must be an array");for(let Q of $)if(typeof Q!=="string")throw Error("shell.spawn: args entries must be strings");if(a.has(Z))throw Error(`shell.spawn: id "${Z}" is already in use \u2014 call kill(id) first or pick a different id`);a.add(Z);try{await M("shell").spawn(Z,Y,$,J)}catch(Q){throw a.delete(Z),Q}},async kill(Z){await M("shell").kill(Z),a.delete(Z)},async getEnv(Z){if(G("shell")){let Y=await window.craft.shell.getEnv(Z);return Y==null?void 0:String(Y)}return},async setEnv(Z,Y){await M("shell").setEnv(Z,Y)},onStdout(Z){return U("craft:shell:stdout",Z)},onStderr(Z){return U("craft:shell:stderr",Z)},onExit(Z){return U("craft:shell:exit",Z)}};function u(){return window.craft.shortcuts}var C8={async register(Z,Y,$){if(!G("shortcuts"))return;await u().register(Z,Y,$)},async unregister(Z){if(!G("shortcuts"))return;await u().unregister(Z)},async unregisterAll(){if(!G("shortcuts"))return;await u().unregisterAll()},async enable(Z){if(!G("shortcuts"))return;await u().enable(Z)},async disable(Z){if(!G("shortcuts"))return;await u().disable(Z)},async isRegistered(Z){if(!G("shortcuts"))return!1;return await u().isRegistered(Z)},async list(){if(!G("shortcuts"))return[];return await u().list()},on(Z){return U("craft:shortcut",Z)}};var I8={get(){if(G("theme"))try{return window.craft.theme.get()}catch{}return{appearance:S8()}},onChange(Z){if(Z(this.get()),G("theme"))return U("craft:theme",Z);if(typeof window<"u"&&window.matchMedia){let Y=window.matchMedia("(prefers-color-scheme: dark)"),$=()=>Z({appearance:Y.matches?"dark":"light"});return Y.addEventListener("change",$),()=>Y.removeEventListener("change",$)}return()=>{}},async current(){return this.get()}};function S8(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function w8(Z,Y={}){if(!G("dragOut"))throw Error("dragOut requires a Craft native window");let $=Array.isArray(Z)?Z:[Z];if($.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start($,Y)}function B8(){return G("dragOut")}var f8={onUrl(Z){if(!G("deepLink"))return()=>{};return U("craft:deepLink",Z)},getInitialUrl(){if(typeof window>"u")return null;if(G("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let Z=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return Z},isAvailable(){return G("deepLink")}};var v8={async isCharging(){if(G("power"))return await window.craft.power.isCharging();let Z=await RZ();return Z?!!Z.charging:!1},async isPluggedIn(){if(G("power"))return await window.craft.power.isPluggedIn();let Z=await RZ();return Z?!!Z.charging||Z.level>=0.999:!1},async isLowPowerMode(){if(G("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(G("power")){let Y=await window.craft.power.batteryLevel();return typeof Y==="number"?Y:null}let Z=await RZ();return Z?Z.level:null},async timeRemaining(){if(G("power")){let $=await window.craft.power.timeRemaining();return typeof $==="number"?$:null}let Z=await RZ();if(!Z)return null;let Y=Z.charging?Z.chargingTime:Z.dischargingTime;return Number.isFinite(Y)?Math.round(Y/60):null},async thermalState(){if(G("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(G("power"))return await window.craft.power.uptimeSeconds();if(typeof performance<"u"&&typeof performance.now==="function")return Math.round(performance.now()/1000);return 0},async preventSleep(Z="app is busy"){if(G("power")){await window.craft.power.preventSleep(Z);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let Y=window;if(Y.__craftWebWakeLock?.release){try{await Y.__craftWebWakeLock.release()}catch{}Y.__craftWebWakeLock=null}try{let $=await navigator.wakeLock.request("screen");Y.__craftWebWakeLock=$}catch{}},async allowSleep(){if(G("power")){await window.craft.power.allowSleep();return}let Z=window.__craftWebWakeLock;if(Z&&typeof Z.release==="function"){try{await Z.release()}catch{}window.__craftWebWakeLock=null}},onSleep(Z){return U("craft:powerSleep",Z)},onWake(Z){return U("craft:powerWake",Z)}};async function RZ(){if(typeof navigator>"u")return null;let Z=navigator;if(typeof Z.getBattery!=="function")return null;try{return await Z.getBattery()}catch{return null}}var y8={async connectionType(){if(G("network"))return await window.craft.network.connectionType();return U4()},async wifiSSID(){if(G("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(G("network")){let Z=await window.craft.network.wifiSignalStrength();return typeof Z==="number"?Z:void 0}return},async ipAddress(){if(G("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(G("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(G("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(G("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(G("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(G("network"))await window.craft.network.openPreferences()},onChange(Z){if(G("network"))return U("craft:networkChange",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({type:U4(),online:!0}),$=()=>Z({type:"none",online:!1});return window.addEventListener("online",Y),window.addEventListener("offline",$),()=>{window.removeEventListener("online",Y),window.removeEventListener("offline",$)}}};function U4(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let Z=navigator.connection;if(!Z)return"unknown";let Y=String(Z.type||Z.effectiveType||"unknown").toLowerCase();if(Y==="wifi"||Y==="cellular"||Y==="ethernet"||Y==="bluetooth"||Y==="none")return Y;return"unknown"}var g8={async checkForUpdates(){if(!G("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!G("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(Z){if(!G("updater"))return;await window.craft.updater.setAutomaticChecks(Z)},async setCheckInterval(Z){if(!G("updater"))return;if(!Number.isFinite(Z))throw Error("setCheckInterval: must be a finite number");let Y=Z<=0?0:Math.max(60,Math.round(Z));await window.craft.updater.setCheckInterval(Y)},async setFeedURL(Z){if(!G("updater"))return;await window.craft.updater.setFeedURL(Z)},async getLastUpdateCheckDate(){if(!G("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!G("updater"))return null;let Z=await window.craft.updater.getUpdateInfo();if(!Z||typeof Z.version!=="string"||Z.version.length===0)return null;return Z},onAvailable(Z){return U("craft:updateAvailable",Z)},onDownloaded(Z){return U("craft:updateDownloaded",Z)},async verifySignature({payload:Z,signatureB64:Y,publicKeyB64:$}){let J=P4(Z),Q;try{Q=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",Q,KZ(Y),J)}catch{return!1}},async verifyDownload({url:Z,signatureB64:Y,publicKeyB64:$,fetchInit:J}){let Q;try{Q=await fetch(Z,J)}catch{return{ok:!1,reason:"fetch-failed"}}if(!Q.ok)return{ok:!1,reason:"http-error",status:Q.status};let X=new Uint8Array(await Q.arrayBuffer()),R;try{R=await crypto.subtle.importKey("raw",KZ($),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let z=!1;try{z=await crypto.subtle.verify("Ed25519",R,KZ(Y),P4(X))}catch{z=!1}if(!z)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:X}}};function P4(Z){if(Z instanceof ArrayBuffer)return new Uint8Array(Z);let Y=new ArrayBuffer(Z.byteLength),$=new Uint8Array(Y);return $.set(Z),$}function KZ(Z){if(typeof atob==="function"){let J=atob(Z),Q=new ArrayBuffer(J.length),X=new Uint8Array(Q);for(let R=0;R<J.length;R++)X[R]=J.charCodeAt(R);return X}let Y=Buffer.from(Z,"base64"),$=new ArrayBuffer(Y.length);return new Uint8Array($).set(Y),new Uint8Array($)}var b8={onFocus(Z){if(G("window"))return U("craft:window:focus",()=>Z());return EZ("focus",Z)},onBlur(Z){if(G("window"))return U("craft:window:blur",()=>Z());return EZ("blur",Z)},onResize(Z){if(G("window"))return U("craft:window:resize",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},onMove(Z){if(G("window"))return U("craft:window:move",Z);return()=>{}},onClose(Z){if(G("window"))return U("craft:window:close",()=>Z());return EZ("beforeunload",Z)},onMinimize(Z){if(G("window"))return U("craft:window:minimize",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="hidden")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},onRestore(Z){if(G("window"))return U("craft:window:restore",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="visible")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)}};function EZ(Z,Y){if(typeof window>"u")return()=>{};let $=()=>Y();return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var L4={name:"",version:"0.0.0"},u8={async hideDockIcon(){if(G("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(G("app"))await window.craft.app.showDockIcon()},async quit(){if(G("app"))await window.craft.app.quit()},async getInfo(){if(!G("app"))return L4;let Z=await window.craft.app.getInfo();return{...L4,...Z||{}}},async notify(Z){if(!Z.title)throw Error("notify: title is required");if(G("app"))await window.craft.app.notify(Z)},async setBadge(Z){if(G("app"))await window.craft.app.setBadge(Z)},async bounce(Z="informational"){if(G("app"))await window.craft.app.bounce(Z)}};var m8={app(Z){return{label:Z,items:[{label:`About ${Z}`,role:"about"},{separator:!0},{label:`Hide ${Z}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${Z}`,role:"quit",shortcut:"cmd+q"}]}},edit(){return{label:"Edit",items:[{label:"Undo",role:"undo",shortcut:"cmd+z"},{label:"Redo",role:"redo",shortcut:"cmd+shift+z"},{separator:!0},{label:"Cut",role:"cut",shortcut:"cmd+x"},{label:"Copy",role:"copy",shortcut:"cmd+c"},{label:"Paste",role:"paste",shortcut:"cmd+v"},{label:"Select All",role:"selectAll",shortcut:"cmd+a"}]}},window(){return{label:"Window",items:[{label:"Minimize",role:"minimize",shortcut:"cmd+m"},{label:"Zoom",role:"zoom"},{separator:!0},{label:"Close Window",role:"close",shortcut:"cmd+w"}]}},leading(Z){return[this.app(Z),this.edit()]}},h8=0;function c8(Z){let Y=new Map;return{payload:{menus:Z.menus.map((J)=>({label:J.label,items:J.items.map((Q)=>{let{onClick:X,...R}=Q;if(R.separator)return R;let z=R.id??`stx.menu.${h8++}`;if(X)Y.set(z,X);return{...R,id:z}})}))},handlers:Y}}var AZ=null,p8={async set(Z){if(!G("menu"))return!1;let{payload:Y,handlers:$}=c8(Z);if(AZ?.(),AZ=null,$.size>0)AZ=U("craft:menu:action",(J)=>{$.get(J.id)?.()});return await window.craft.menu.set(Y),!0},async setDock(Z){if(G("menu"))await window.craft.menu.setDock(Z)},async addItem(Z,Y){if(G("menu"))await window.craft.menu.addItem(Z,Y)},async removeItem(Z){if(G("menu"))await window.craft.menu.removeItem(Z)},async enableItem(Z){if(G("menu"))await window.craft.menu.enableItem(Z)},async disableItem(Z){if(G("menu"))await window.craft.menu.disableItem(Z)},async checkItem(Z){if(G("menu"))await window.craft.menu.checkItem(Z)},async uncheckItem(Z){if(G("menu"))await window.craft.menu.uncheckItem(Z)},async setItemLabel(Z,Y){if(G("menu"))await window.craft.menu.setItemLabel(Z,Y)},async clearDock(){if(G("menu"))await window.craft.menu.clearDock()},onAction(Z){return U("craft:menu:action",Z)}};function D4(Z){if(Z.separator)return{id:Z.id||"",title:"",type:"separator"};return{id:Z.id||"",title:Z.title||"",icon:Z.icon,shortcut:Z.shortcut,enabled:Z.disabled?!1:void 0,checked:Z.checked?!0:void 0,type:Z.submenu?"submenu":void 0,submenu:Z.submenu?.map(D4)}}async function W4(Z){if(!Z.items||Z.items.length===0)throw Error("contextMenu.show requires at least one item");if(!G("nativeUI"))return null;let Y=await window.craft.nativeUI.showContextMenu({targetId:Z.targetId||"",targetType:"general",x:Math.round(Z.x),y:Math.round(Z.y),items:Z.items.map(D4)});return{id:typeof Y?.id==="string"?Y.id:null,targetId:Y?.targetId}}var l8={available(){return G("nativeUI")},async show(Z){return await W4(Z)!==null},async pick(Z){return(await W4(Z))?.id??null},onAction(Z){return U("craft:contextmenu:action",(Y)=>{if(typeof Y.id==="string")Z({id:Y.id,targetId:Y.targetId??""})})}};var d8={accentColor:()=>x("system","accentColor",()=>""),highlightColor:()=>x("system","highlightColor",()=>""),language:()=>x("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>x("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>x("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>x("system","is24HourTime",()=>{try{let Z=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return Z.hourCycle==="h23"||Z.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>x("system","reduceMotion",()=>kZ("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>x("system","reduceTransparency",()=>kZ("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>x("system","increaseContrast",()=>kZ("(prefers-contrast: more)")),systemVersion:()=>x("system","systemVersion",()=>""),hostname:()=>x("system","hostname",()=>""),username:()=>x("system","username",()=>""),async openPreferences(){if(G("system"))await window.craft.system.openPreferences()}};async function x(Z,Y,$){if(G(Z))return await window.craft[Z][Y]();return await $()}function kZ(Z){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(Z).matches}var r8={async getDisplays(){if(G("screen"))return await window.craft.screen.getDisplays();return M4()},async getPrimary(){if(G("screen")){let Z=await window.craft.screen.getPrimary();return Z&&typeof Z.width==="number"?Z:null}return M4()[0]??null},onChange(Z){if(G("screen"))return U("craft:screen:change",()=>Z());if(typeof window>"u")return()=>{};let Y=()=>Z();return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)}};function M4(){if(typeof window>"u"||!window.screen)return[];let Z=window.screen;return[{id:0,x:Z.left??0,y:Z.top??0,width:Z.width||0,height:Z.height||0,workX:Z.availLeft??0,workY:Z.availTop??0,workWidth:Z.availWidth??Z.width??0,workHeight:Z.availHeight??Z.height??0,scaleFactor:window.devicePixelRatio||1}]}var n8={async set(Z,Y,$){if(!Z)throw Error("keychain.set: service is required");if(!Y)throw Error("keychain.set: account is required");await M("keychain").set(Z,Y,$)},async get(Z,Y){if(!Z)throw Error("keychain.get: service is required");if(!Y)throw Error("keychain.get: account is required");let $=await M("keychain").get(Z,Y);return typeof $==="string"?$:null},async delete(Z,Y){if(!Z)throw Error("keychain.delete: service is required");if(!Y)throw Error("keychain.delete: account is required");await M("keychain").delete(Z,Y)},async has(Z,Y){if(!Z)throw Error("keychain.has: service is required");if(!Y)throw Error("keychain.has: account is required");return await M("keychain").has(Z,Y)}};var o8={async check(Z){if(G("permissions"))return await window.craft.permissions.check(Z);return await _4(Z)},async request(Z){if(G("permissions"))return await window.craft.permissions.request(Z);return await a8(Z)},async openSettings(Z){if(G("permissions"))await window.craft.permissions.openSettings(Z)}};async function _4(Z){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let Y=await navigator.permissions.query({name:Z});return i8(Y.state)}catch{return"not-supported"}}async function a8(Z){if(Z==="notifications"&&typeof window<"u"&&"Notification"in window){let Y=await window.Notification.requestPermission();return Y==="granted"?"granted":Y==="denied"?"denied":"undetermined"}return await _4(Z)}function i8(Z){if(Z==="granted")return"granted";if(Z==="denied")return"denied";if(Z==="prompt")return"undetermined";return"undetermined"}var s8={async print(){if(G("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(Z){if(!Z)throw Error("printToPDF: path is required");let Y=Z.startsWith("/"),$=/^[a-zA-Z]:[\\/]/.test(Z)||Z.startsWith("\\\\");if(!Y&&!$)throw Error("printToPDF: path must be absolute");let J=await M("printing").printToPDF(Z);return{ok:!!(J&&J.ok),path:J?.path}}};var t8={async enable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};function HZ(){if(!G("window"))return null;return window.craft.window}function f(Z){let Y=HZ();if(!Y)return Promise.resolve();try{return Promise.resolve(Z(Y)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var e8={get available(){return HZ()!==null},open(Z){let Y=()=>{if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return{name:Z.name}},$=HZ();if(!$?.open)return Promise.resolve(Y());return $.open(Z).then((J)=>({name:J?.name||Z.name})).catch(Y)},close:()=>f((Z)=>Z.close?.()),focus:()=>f((Z)=>Z.focus?.()),minimize:()=>f((Z)=>Z.minimize?.()),maximize:()=>f((Z)=>Z.maximize?.()),center:()=>f((Z)=>Z.center?.()),startDrag:()=>f((Z)=>Z.startDrag?.()),setTitle:(Z)=>f((Y)=>Y.setTitle?.(Z)),setSize:(Z,Y)=>f(($)=>$.setSize?.(Z,Y)),setAppearance:(Z)=>f((Y)=>Y.setAppearance?.(Z))};var Z9={async addItem(Z){if(G("touchbar"))await window.craft.touchbar.addItem(Z)},async removeItem(Z){if(G("touchbar"))await window.craft.touchbar.removeItem(Z)},async updateItem(Z,Y){if(G("touchbar"))await window.craft.touchbar.updateItem(Z,Y)},async setLabel(Z,Y){if(G("touchbar"))await window.craft.touchbar.setLabel(Z,Y)},async setIcon(Z,Y){if(G("touchbar"))await window.craft.touchbar.setIcon(Z,Y)},async setEnabled(Z,Y){if(G("touchbar"))await window.craft.touchbar.setEnabled(Z,Y)},async setSliderValue(Z,Y){if(G("touchbar"))await window.craft.touchbar.setSliderValue(Z,Y)},async clear(){if(G("touchbar"))await window.craft.touchbar.clear()},async show(){if(G("touchbar"))await window.craft.touchbar.show()},async hide(){if(G("touchbar"))await window.craft.touchbar.hide()},onAction(Z){return U("craft:touchbar:action",Z)}};var Y9=/^[\da-f]*$/i;function $9(Z,Y){if(typeof Y!=="string"||!Y9.test(Y)||Y.length%2!==0)throw Error(`${Z}: must be a hex string with even length, got ${JSON.stringify(Y)}`)}var J9={async isEnabled(){return G("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return G("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return G("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return G("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return G("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(Z){if(G("bluetooth"))await window.craft.bluetooth.connect(Z)},async disconnect(Z){if(G("bluetooth"))await window.craft.bluetooth.disconnect(Z)},async openPreferences(){if(G("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(Z){if(!Z)throw Error("bluetooth.discoverServices: deviceId is required");if(!G("bluetooth"))return[];let Y=await window.craft.bluetooth.discoverServices(Z);return Array.isArray(Y)?Y:[]},async discoverCharacteristics(Z,Y){if(!Z||!Y)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!G("bluetooth"))return[];let $=await window.craft.bluetooth.discoverCharacteristics(Z,Y);return Array.isArray($)?$:[]},async readCharacteristic(Z,Y,$){if(!Z||!Y||!$)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(Z,Y,$)},async writeCharacteristic(Z,Y,$,J,Q="with-response"){if(!Z||!Y||!$)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if($9("bluetooth.writeCharacteristic.valueHex",J),!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(Z,Y,$,J,Q)},async setCharacteristicNotify(Z,Y,$,J){if(!Z||!Y||!$)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(Z,Y,$,J)},onDeviceFound(Z){return U("craft:bluetooth:deviceFound",Z)},onDeviceConnected(Z){return U("craft:bluetooth:deviceConnected",Z)},onDeviceDisconnected(Z){return U("craft:bluetooth:deviceDisconnected",Z)},onCharacteristicValue(Z){return U("craft:bluetooth:characteristicValue",Z)}};var G9={async speak(Z,Y){if(!Z)throw Error("speech.speak: text is required");if(G("speech")){await window.craft.speech.speak(Z,Y);return}if(typeof window<"u"&&window.speechSynthesis){let $=new window.SpeechSynthesisUtterance(Z);if(Y){if(Y.rate!=null)$.rate=Y.rate;if(Y.pitch!=null)$.pitch=Y.pitch;if(Y.volume!=null)$.volume=Y.volume;if(Y.voice){let Q=window.speechSynthesis.getVoices().find((X)=>X.voiceURI===Y.voice||X.name===Y.voice||X.lang===Y.voice);if(Q)$.voice=Q}}window.speechSynthesis.speak($)}},async stop(){if(G("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(G("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(G("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(G("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(G("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map((Y)=>({id:Y.voiceURI||Y.name,name:Y.name,language:Y.lang||"",quality:"default"}));return[]}};var i=[],xZ=!0,CZ,IZ,s={async report(Z){if(G("crashReporter")){await window.craft.crashReporter.report(Z);return}if(!xZ)return;let Y=Z instanceof Error?{timestamp:Date.now(),severity:"error",message:Z.message,source:"js",stack:Z.stack||"",userId:CZ,appVersion:IZ}:{timestamp:Date.now(),severity:Z.severity||"error",message:Z.message||"",source:Z.source||"js",stack:Z.stack||"",userId:CZ,appVersion:IZ};if(i.length>=64)i.shift();i.push(Y)},async flush(){if(G("crashReporter"))return await window.craft.crashReporter.flush();return[...i]},async clear(){if(G("crashReporter")){await window.craft.crashReporter.clear();return}i.length=0},async setEnabled(Z){if(G("crashReporter")){await window.craft.crashReporter.setEnabled(Z);return}xZ=Z},async isEnabled(){if(G("crashReporter"))return await window.craft.crashReporter.isEnabled();return xZ},async setUser(Z){if(G("crashReporter")){await window.craft.crashReporter.setUser(Z);return}CZ=Z||void 0},async setAppVersion(Z){if(G("crashReporter")){await window.craft.crashReporter.setAppVersion(Z);return}IZ=Z||void 0},attachGlobalHandlers(){if(G("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let Z=($)=>{s.report({severity:"error",message:$.message,source:"js",stack:$.error?.stack||`${$.message}
|
|
895
895
|
at ${$.filename}:${$.lineno}:${$.colno}`}).catch(()=>{})},Y=($)=>{let J=$.reason;s.report({severity:"error",message:J?.message||String(J),source:"js",stack:J?.stack||""}).catch(()=>{})};return window.addEventListener("error",Z),window.addEventListener("unhandledrejection",Y),()=>{window.removeEventListener("error",Z),window.removeEventListener("unhandledrejection",Y)}},forwardTo(Z){return F9(Z)}},Q9="craft:crashReporter:pending",X9=/[\w.+-]+@[\w-]+\.[\w.-]+/g,z9=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,R9=/\/(?:Users|home)\/[^\s/'"`]+/g;function N4(Z){let Y=($)=>$.replace(X9,"<email>").replace(z9,"<ip>").replace(R9,"/<home>");return{...Z,message:Y(Z.message),stack:Y(Z.stack)}}async function E4(Z,Y){let $=new TextEncoder,J=await crypto.subtle.importKey("raw",$.encode(Z),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Q=await crypto.subtle.sign("HMAC",J,$.encode(Y));return[...new Uint8Array(Q)].map((X)=>X.toString(16).padStart(2,"0")).join("")}function K9(Z){if(!Z||typeof localStorage>"u")return[];try{let Y=localStorage.getItem(Z);if(!Y)return[];let $=JSON.parse(Y);return Array.isArray($)?$:[]}catch{return[]}}function T4(Z,Y){if(!Z||typeof localStorage>"u")return;try{if(Y.length===0)localStorage.removeItem(Z);else localStorage.setItem(Z,JSON.stringify(Y))}catch{}}function F9(Z){let{endpoint:Y,intervalMs:$=60000,signingSecret:J,redact:Q=!0,headers:X={},maxRetries:R=5,persistKey:z}=Z,K=z===null?null:z??Q9,F=K9(K),O=!1,V=null,j=null,P=typeof Q==="function"?Q:Q===!1?(N)=>N:N4;async function L(N){let E=JSON.stringify({entries:N}),S={"Content-Type":"application/json",...X};if(J)S["X-Craft-Signature"]=await E4(J,E);let e=0,w=1000;while(!O)try{let m=await fetch(Y,{method:"POST",headers:S,body:E});if(m.ok)return;if(m.status>=400&&m.status<500)return;throw Error(`HTTP ${m.status}`)}catch(m){if(e+=1,e>R)throw F=[...N,...F],T4(K,F),m;await new Promise((S4)=>{setTimeout(S4,w)}),w=Math.min(w*2,60000)}}async function T(){if(O||j)return j??void 0;let N=await s.flush();if(N.length>0)await s.clear();if(F=[...F,...N.map((S)=>P(S))],F.length===0)return;let E=F;return F=[],T4(K,F),j=L(E).catch(()=>{}).finally(()=>{j=null}),j}if($>0)V=setInterval(()=>{T().catch(()=>{})},$);return{async flushNow(){await T()},stop(){if(O=!0,V)clearInterval(V);V=null},pending(){return[...F]}}}var j9={async isAvailable(){if(!G("iap"))return!1;return await window.craft.iap.isAvailable()},async getProducts(Z){if(!G("iap"))return[];let Y=Array.isArray(Z)?Z:[String(Z)];return await window.craft.iap.getProducts(Y)},async purchase(Z){if(!G("iap"))return{queued:!1,productId:Z,reason:"IAP bridge not available"};let Y=await window.craft.iap.purchase(Z);return{queued:!!(Y&&Y.queued),productId:Y?.productId,reason:Y?.reason}},async restorePurchases(){if(!G("iap"))return{ok:!1};let Z=await window.craft.iap.restorePurchases();return{ok:!!(Z&&Z.ok)}},async finishTransaction(Z){if(!G("iap"))return;await window.craft.iap.finishTransaction(Z)},async getReceiptData(){if(!G("iap"))return null;let Z=await window.craft.iap.getReceiptData();return Z?String(Z):null},onPurchased(Z){return U("craft:iap:purchased",Z)},onFailed(Z){return U("craft:iap:failed",Z)},onRestored(Z){return U("craft:iap:restored",Z)},onProductsLoaded(Z){return U("craft:iap:productsLoaded",(Y)=>Z(Y.products||[]))},onRefunded(Z){return U("craft:iap:refunded",Z)},onSubscriptionStatusChanged(Z){return U("craft:iap:subscriptionStatusChanged",Z)},async getActiveSubscriptions(){if(!G("iap"))return[];let Z=window.craft.iap.getActiveSubscriptions;if(typeof Z!=="function")return[];let Y=await Z();return Array.isArray(Y)?Y:[]},async isEligibleForIntroOffer(Z){if(!G("iap"))return!1;let Y=window.craft.iap.isEligibleForIntroOffer;if(typeof Y!=="function")return!1;return!!await Y(Z)}};var t={async startActivity(Z,Y){if(!Z)throw Error("handoff.startActivity: type is required");if(!G("handoff"))return!1;let $=await window.craft.handoff.startActivity(Z,Y);return typeof $==="boolean"?$:!!($&&$.ok)},async updateActivity(Z){if(!G("handoff"))return!1;let Y=await window.craft.handoff.updateActivity(Z);return typeof Y==="boolean"?Y:!!(Y&&Y.ok)},async stopActivity(){if(!G("handoff"))return;await window.craft.handoff.stopActivity()},async getCurrentActivity(){if(!G("handoff"))return null;let Z=await window.craft.handoff.getCurrentActivity();return Z&&typeof Z.type==="string"?Z:null},onIncoming(Z){return U("craft:handoff:incoming",Z)}};var O9={async start(Z,Y){return t.startActivity(Z,{title:Y?.title,webpageURL:Y?.webpageURL,userInfo:Y?.state})},async update(Z){return t.updateActivity({title:Z.title,webpageURL:Z.webpageURL,userInfo:Z.state})},async stop(){await t.stopActivity()}};var V9={async requestPermission(Z="whenInUse"){if(G("location"))return await window.craft.location.requestPermission(Z);if(typeof navigator<"u"&&navigator.geolocation)return"undetermined";return"not-supported"},async getAuthorization(){if(G("location"))return await window.craft.location.getAuthorization();return"unknown"},async getCurrentLocation(){if(G("location"))return await window.craft.location.getCurrentLocation();if(typeof navigator<"u"&&navigator.geolocation)return navigator.geolocation.getCurrentPosition((Z)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:Z.coords.latitude,longitude:Z.coords.longitude,altitude:Z.coords.altitude,horizontalAccuracy:Z.coords.accuracy,verticalAccuracy:Z.coords.altitudeAccuracy,speed:Z.coords.speed}}))},(Z)=>{window.dispatchEvent(new CustomEvent("craft:location:error",{detail:{message:Z.message||String(Z)}}))}),{requested:!0};return{requested:!1}},async startWatching(Z){if(G("location"))return await window.craft.location.startWatching(Z);if(typeof navigator<"u"&&navigator.geolocation){let Y=navigator.geolocation.watchPosition(($)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:$.coords.latitude,longitude:$.coords.longitude,altitude:$.coords.altitude,horizontalAccuracy:$.coords.accuracy,verticalAccuracy:$.coords.altitudeAccuracy,speed:$.coords.speed}}))});return window.__craftWebLocationWatchId=Y,!0}return!1},async stopWatching(){if(G("location")){await window.craft.location.stopWatching();return}if(typeof navigator<"u"&&navigator.geolocation){let Z=window.__craftWebLocationWatchId;if(Z!=null)navigator.geolocation.clearWatch(Z),window.__craftWebLocationWatchId=null}},onUpdate(Z){return U("craft:location:update",Z)},onError(Z){return U("craft:location:error",Z)},onAuthChanged(Z){return U("craft:location:authChanged",Z)}};var q9={async captureScreen(){if(!G("screenCapture"))return null;let Z=await window.craft.screenCapture.captureScreen();return Z?String(Z):null},async captureWindow(Z){if(!G("screenCapture"))return null;if(!Number.isFinite(Z)||Z<=0)throw Error("captureWindow: id must be a positive number");let Y=await window.craft.screenCapture.captureWindow(Z);return Y?String(Y):null},async listWindows(){if(!G("screenCapture"))return[];return await window.craft.screenCapture.listWindows()}};var k4=250,H4=60000,SZ=2000,A4={sharing:!1,signals:{systemScreenShare:!1,remoteSession:!1,conferenceSharing:!1,screenRecording:!1},sources:[]};function U9(){return{...A4,signals:{...A4.signals},sources:[]}}var FZ={async getState(){if(!G("screenSharing"))return U9();return await window.craft.screenSharing.getState()},async watch(Z=SZ){let Y=Math.min(H4,Math.max(k4,Math.round(Z)));if(!G("screenSharing"))return Y;let $=await window.craft.screenSharing.watch(Y);return $&&$.intervalMs||Y},async stop(){if(!G("screenSharing"))return;await window.craft.screenSharing.unwatch()},onChange(Z){return U("craft:screenSharing:change",Z)}};async function P9(Z,Y=SZ){let $=FZ.onChange(Z);return await FZ.watch(Y),()=>{$(),FZ.stop()}}var L9={supported:!1,isFocused:null,authorization:"unsupported"};function x4(){return{ok:!1,error:"Focus control is only available in a Craft window on macOS"}}var wZ={async getStatus(){if(!G("focus"))return{...L9};return await window.craft.focus.getStatus()},async requestAuthorization(){if(!G("focus"))return"unsupported";return await window.craft.focus.requestAuthorization()},async setEnabled(Z,Y={}){if(!G("focus"))return x4();if(!(Z?Y.onShortcut:Y.offShortcut))return{ok:!1,error:`focus.setEnabled: no ${Z?"onShortcut":"offShortcut"} configured`};return await window.craft.focus.setEnabled(Z,Y)},async runShortcut(Z){if(!G("focus"))return x4();if(!Z)throw Error("focus.runShortcut: name is required");return await window.craft.focus.runShortcut(Z)},async listShortcuts(){if(!G("focus"))return[];return await window.craft.focus.listShortcuts()},async listShortcutsResult(){if(!G("focus"))return{canList:!1,shortcuts:[]};let Y=await window.craft.focus.listShortcutsResult?.();return{canList:Boolean(Y?.canList),shortcuts:Y?.shortcuts??[]}}};async function W9(...Z){if(Z.length===0)return!1;let Y=new Set(await wZ.listShortcuts());return Z.every(($)=>Y.has($))}async function D9(...Z){if(Z.length===0)return!1;let{canList:Y,shortcuts:$}=await wZ.listShortcutsResult();if(!Y)return"unknown";let J=new Set($);return Z.every((Q)=>J.has(Q))}var M9={async start(Z=0,Y="127.0.0.1"){if(!G("localServer"))return{port:0,started:!1,reason:"bridge unavailable"};return await window.craft.localServer.start(Z,Y)},async stop(){if(!G("localServer"))return;await window.craft.localServer.stop()},async respond(Z){if(!G("localServer"))return;await window.craft.localServer.respond(Z||{status:200,body:"OK"})},onRequest(Z){return U("craft:localServer:request",Z)},async awaitOAuthCallback(Z={}){M("localServer");let{port:Y=0,host:$="127.0.0.1",timeoutMs:J=300000,successHTML:Q}=Z,X=await this.start(Y,$);if(!X.started)throw Error(`localServer: start failed${X.reason?` \u2014 ${X.reason}`:""}`);return new Promise((R,z)=>{let K=setTimeout(()=>{F(),this.stop().catch(()=>{}),z(Error("localServer: OAuth callback timed out"))},J),F=this.onRequest(({url:O})=>{clearTimeout(K),F();let V=Q??`<!doctype html><meta charset="utf-8"><title>Done</title>
|
|
896
896
|
<style>body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7}</style>
|
|
897
897
|
<div><h1>You can close this tab.</h1><p>Returning to the app\u2026</p></div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Xf as a}from"./chunk-
|
|
2
|
+
import{Xf as a}from"./chunk-3xspzgrq.js";import"./chunk-a68y9s2j.js";import"./chunk-0knxnyq6.js";import"./chunk-pwctc0m1.js";import"./chunk-0t1yyn1d.js";import"./chunk-frp9fc7j.js";import"./chunk-7rj4h2t2.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as buildForProduction};
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-
|
|
3
|
+
import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-vyhrzsnf.js";import"./chunk-b381xgvw.js";import"./chunk-7hb89n3z.js";import"./chunk-7kfv1q2r.js";import"./chunk-8akj7f4h.js";import"./chunk-1hvxs7rh.js";import"./chunk-n0d7nwhd.js";import"./chunk-84577w4y.js";import"./chunk-5j3v0p6s.js";import"./chunk-198fr2d4.js";import"./chunk-3xspzgrq.js";import"./chunk-a68y9s2j.js";import"./chunk-0knxnyq6.js";import"./chunk-634gaa9d.js";import"./chunk-r6xmsxaz.js";import"./chunk-karkhcja.js";import"./chunk-ypgyhr2p.js";import"./chunk-bcpjhcpn.js";import"./chunk-y4zddt5r.js";import"./chunk-g7bpkpd4.js";import"./chunk-k33778kc.js";import"./chunk-yg0qm73a.js";import"./chunk-g1vxsvqv.js";import"./chunk-0ppgyq8q.js";import"./chunk-fqq5k9ve.js";import"./chunk-ya5m5vbn.js";import"./chunk-y4nzmkea.js";import"./chunk-7kw3grq5.js";import"./chunk-c79nfdyj.js";import"./chunk-ej8mv2k6.js";import"./chunk-bab01mkf.js";import"./chunk-ra1s4s6b.js";import"./chunk-benx1c4p.js";import"./chunk-pwctc0m1.js";import"./chunk-0t1yyn1d.js";import"./chunk-k91ej0ts.js";import"./chunk-rargfb5s.js";import"./chunk-necx4e30.js";import"./chunk-frp9fc7j.js";import{bl as u,cl as c}from"./chunk-qg0w5tjb.js";import"./chunk-7rj4h2t2.js";import"./chunk-qjvny3wf.js";import"./chunk-2119txb8.js";import{fs as f}from"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import{Js as A}from"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import{Sw as B}from"./chunk-m8kem5ca.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.360";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
|
|
4
4
|
Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-p41s1y4v.js");if(x==="list"){console.log(`
|
|
5
5
|
\uD83D\uDCDA Fetching available icon collections...
|
|
6
6
|
`);let j=await z(),W=Object.entries(j).sort((H,U)=>U[1].total-H[1].total);console.log(`Available collections:
|
|
@@ -69,7 +69,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
|
|
|
69
69
|
File not found: ${x}`),w.exit(1);if(!x.endsWith(".stx"))console.error(`
|
|
70
70
|
File must have .stx extension: ${x}`),w.exit(1)}let k=$.resolve(b.pages),j=$.resolve(b.out);if(!x&&!L.existsSync(k))console.error(`
|
|
71
71
|
Pages directory not found: ${k}`),console.log(`
|
|
72
|
-
Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-
|
|
72
|
+
Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-bxkr3ts9.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
|
|
73
73
|
Build complete! (SSR)
|
|
74
74
|
`),console.log(` Pages compiled: ${H.ssr.pageCount}`),console.log(` Output: ${H.ssr.outputDir}`),console.log(` Duration: ${U}s
|
|
75
75
|
`);else if(H.ssg){if(console.log(`
|
|
@@ -84,7 +84,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
|
|
|
84
84
|
Build completed with ${H.ssg.failedCount} error(s). Fix the issues above and try again.
|
|
85
85
|
`),w.exit(1);console.log(" To preview locally:"),console.log(` cd ${b.out||"dist"} && npx serve
|
|
86
86
|
`)}}catch(z){console.error(`
|
|
87
|
-
Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-
|
|
87
|
+
Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-d5gzma79.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
|
|
88
88
|
Failed to start production server:`,b instanceof Error?b.message:String(b)),w.exit(1)}}),E.command("deploy [directory]","Deploy built site to Netlify").option("--site-id <id>","Netlify site ID (or set NETLIFY_SITE_ID env var)").option("--token <token>","Auth token (or set NETLIFY_AUTH_TOKEN env var)").option("--production","Deploy to production (default: draft preview)").option("--message <msg>","Deploy message/title").option("--no-build","Skip build step before deploy").option("--open","Open deployed URL in browser").option("--dry-run","Preview deployment without uploading").option("--init","Initialize Netlify configuration for this project").example("stx deploy").example("stx deploy --production").example("stx deploy dist --site-id my-site-abc123").example("stx deploy --init").example("stx deploy --dry-run").action(async(x,b)=>{try{let{deploy:z,initNetlify:k,DeployError:j}=await import("./chunk-89xwdc1d.js");if(console.log(`\x1B[1mstx deploy\x1B[0m \x1B[2mv${N}\x1B[0m`),b.init){console.log(`
|
|
89
89
|
\uD83D\uDCDD Initializing Netlify configuration...
|
|
90
90
|
`);let H=await k({directory:x||w.cwd(),siteId:b.siteId});if(console.log(`\u2713 Created ${H.configPath}`),H.siteId)console.log("\u2713 Saved site ID to .env.local");console.log(`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.360",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@stacksjs/ts-css": "^0.3.2",
|
|
120
120
|
"@stacksjs/clapp": "^0.2.16",
|
|
121
|
-
"@stacksjs/desktop": "0.2.
|
|
122
|
-
"@stacksjs/sanitizer": "0.2.
|
|
121
|
+
"@stacksjs/desktop": "0.2.360",
|
|
122
|
+
"@stacksjs/sanitizer": "0.2.360",
|
|
123
123
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
124
|
-
"bun-plugin-stx": "0.2.
|
|
124
|
+
"bun-plugin-stx": "0.2.360",
|
|
125
125
|
"bunfig": "^0.15.19",
|
|
126
|
-
"stx-router": "0.2.
|
|
126
|
+
"stx-router": "0.2.360",
|
|
127
127
|
"ts-broadcasting": "^0.0.10",
|
|
128
128
|
"ts-images": "^0.2.22",
|
|
129
129
|
"ts-syntax-highlighter": "^0.2.1"
|