@stacksjs/stx 0.2.470 → 0.2.471
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-yv00fy8z.js → chunk-045kr10b.js} +1 -1
- package/dist/{chunk-f64rmdvt.js → chunk-0ax9kmf8.js} +2 -2
- package/dist/{chunk-r7m8dh2g.js → chunk-0r7gsny3.js} +5 -5
- package/dist/chunk-0xqy73ss.js +2 -0
- package/dist/chunk-106r55j4.js +2 -0
- package/dist/{chunk-2qz5gqqe.js → chunk-16h7wedx.js} +7 -7
- package/dist/chunk-1g8p13wt.js +2 -0
- package/dist/{chunk-9pjy59d6.js → chunk-1p7pws60.js} +65 -65
- package/dist/{chunk-qf7da9f6.js → chunk-2542vq5p.js} +1 -1
- package/dist/{chunk-9kb3my0w.js → chunk-27kb6nrb.js} +2 -2
- package/dist/{chunk-pz537q62.js → chunk-28s5x7wv.js} +2 -2
- package/dist/chunk-2njt4vbe.js +2 -0
- package/dist/chunk-2p7d1psf.js +2 -0
- package/dist/chunk-4aw47rmg.js +2 -0
- package/dist/{chunk-wc6k446y.js → chunk-5tgctj1p.js} +3 -3
- package/dist/chunk-71e050r2.js +2 -0
- package/dist/{chunk-y8h823cb.js → chunk-74j18qk0.js} +28 -28
- package/dist/{chunk-y42ge4xh.js → chunk-7ekp1tw8.js} +20 -20
- package/dist/chunk-8319g47g.js +2 -0
- package/dist/{chunk-8v24kvjk.js → chunk-86knxbhs.js} +1 -1
- package/dist/{chunk-594tt40e.js → chunk-8adstrk5.js} +2 -2
- package/dist/{chunk-wzeq29c1.js → chunk-8sxkvdz2.js} +2 -2
- package/dist/chunk-8y71t1j7.js +2 -0
- package/dist/chunk-93q4tw6z.js +2 -0
- package/dist/{chunk-scvzv5y2.js → chunk-99kt56fn.js} +2 -2
- package/dist/{chunk-250psr2a.js → chunk-9kzk7zyy.js} +1 -1
- package/dist/{chunk-mx446wgp.js → chunk-9ztdvnkk.js} +2 -2
- package/dist/chunk-a0grp45v.js +2 -0
- package/dist/chunk-bfvmkncd.js +2 -0
- package/dist/{chunk-tydxqfs6.js → chunk-bnd6kd6d.js} +1 -1
- package/dist/chunk-bp9snrj7.js +2 -0
- package/dist/{chunk-564pmmj3.js → chunk-bqx3dqv1.js} +1 -1
- package/dist/{chunk-xts31rkc.js → chunk-cetdwrqh.js} +96 -96
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-a6amx427.js → chunk-crjmrhkh.js} +1 -1
- package/dist/{chunk-5rx7ptse.js → chunk-cxbp2m66.js} +2 -2
- package/dist/chunk-czxs5tf2.js +2 -0
- package/dist/{chunk-rvzx5s72.js → chunk-dts9z53c.js} +1 -1
- package/dist/{chunk-98gxw97n.js → chunk-ecr642nj.js} +1 -1
- package/dist/{chunk-6sken7b2.js → chunk-eqf8985n.js} +1 -1
- package/dist/chunk-ezf8r05n.js +2 -0
- package/dist/chunk-f5yg6sp3.js +2 -0
- package/dist/{chunk-xc27xdm6.js → chunk-f6kwahhn.js} +1 -1
- package/dist/{chunk-6vstn9dk.js → chunk-gkj42zq7.js} +1 -1
- package/dist/{chunk-rdn3egy7.js → chunk-h9afpxpp.js} +1 -1
- package/dist/chunk-hc01wxaf.js +2 -0
- package/dist/chunk-hr487qbk.js +2 -0
- package/dist/chunk-j338fs8k.js +2 -0
- package/dist/{chunk-3q9hhpvz.js → chunk-jzax5rnm.js} +1 -1
- package/dist/chunk-m5dgc757.js +2 -0
- package/dist/chunk-m8nn4fmg.js +2 -0
- package/dist/{chunk-dj3b04tn.js → chunk-m8w4hve0.js} +1 -1
- package/dist/chunk-mmh37ywa.js +2 -0
- package/dist/{chunk-cxkyt6ht.js → chunk-r6174yzb.js} +1 -1
- package/dist/{chunk-yd7g02v5.js → chunk-s10r6hxp.js} +7 -7
- package/dist/chunk-sx89w4af.js +2 -0
- package/dist/{chunk-mn6gcvk9.js → chunk-sxf8nb5z.js} +4 -4
- package/dist/chunk-t1x2gjtj.js +2 -0
- package/dist/{chunk-ktvr45qg.js → chunk-t61vdbje.js} +6 -6
- package/dist/{chunk-aw4jxj6a.js → chunk-t7s0pdtw.js} +2 -2
- package/dist/{chunk-gskjzw5r.js → chunk-tbef3yyk.js} +3 -3
- package/dist/{chunk-hvmtpe7w.js → chunk-tt28sg5z.js} +1 -1
- package/dist/{chunk-j3z1bfjt.js → chunk-vnaxhk3z.js} +1 -1
- package/dist/{chunk-71ttf2ne.js → chunk-vt5k0j68.js} +1 -1
- package/dist/chunk-w8qmc1mn.js +2 -0
- package/dist/chunk-wxaezzq7.js +33 -0
- package/dist/{chunk-3jjevm1j.js → chunk-x3vqyegd.js} +6 -6
- package/dist/chunk-x5yzgahy.js +2 -0
- package/dist/chunk-x7tsekgw.js +2 -0
- package/dist/{chunk-hjhz90kg.js → chunk-xnjcmhs5.js} +2 -2
- package/dist/{chunk-3c6v9hp1.js → chunk-ykfkvk67.js} +1 -1
- package/dist/chunk-zam9d5bk.js +2 -0
- package/dist/chunk-zb5p05v4.js +2 -0
- package/dist/{chunk-168dqya1.js → chunk-zkg0rbmp.js} +3 -3
- package/dist/chunk-znwpwae1.js +2 -0
- package/dist/cli.js +42 -42
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/headwind-to-style.js +28 -0
- package/dist/native/compiler/html-to-ir.js +67 -4
- package/dist/native/compiler/ir.d.ts +15 -1
- package/dist/native/compiler/svg.d.ts +86 -0
- package/dist/native/compiler/svg.js +414 -0
- package/dist/native/prop-names.js +2 -0
- package/dist/native/runtime/native-host.js +22 -9
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0q8xacmn.js +0 -2
- package/dist/chunk-2a22ep8p.js +0 -2
- package/dist/chunk-4waxn99v.js +0 -2
- package/dist/chunk-695de40v.js +0 -2
- package/dist/chunk-6a1g18h4.js +0 -2
- package/dist/chunk-94d2t16y.js +0 -2
- package/dist/chunk-b5mfa6w6.js +0 -2
- package/dist/chunk-bprn7crb.js +0 -2
- package/dist/chunk-cxgr65kt.js +0 -33
- package/dist/chunk-ds6eqyq2.js +0 -2
- package/dist/chunk-dy0gm4e4.js +0 -2
- package/dist/chunk-e8ewjcmj.js +0 -2
- package/dist/chunk-fkgdbdqa.js +0 -2
- package/dist/chunk-g9dh9yat.js +0 -2
- package/dist/chunk-gg4hrjrf.js +0 -2
- package/dist/chunk-gna3h2yv.js +0 -2
- package/dist/chunk-gyfb3rj5.js +0 -2
- package/dist/chunk-gzk5ak8f.js +0 -2
- package/dist/chunk-j04s01mf.js +0 -2
- package/dist/chunk-kyda9myt.js +0 -2
- package/dist/chunk-m4sd2ker.js +0 -2
- package/dist/chunk-mhjndjjb.js +0 -2
- package/dist/chunk-nrjevcyh.js +0 -2
- package/dist/chunk-pq9978k5.js +0 -2
- package/dist/chunk-r0gx4p2m.js +0 -2
- package/dist/chunk-rskf20cw.js +0 -2
- package/dist/chunk-sz2cf4w6.js +0 -2
- package/dist/chunk-vbbrtrcg.js +0 -2
- package/dist/chunk-vc24bahj.js +0 -2
- package/dist/chunk-vkgsj6k0.js +0 -2
- package/dist/chunk-y51pb1tc.js +0 -2
- package/dist/chunk-yn2d8x8m.js +0 -3
|
@@ -4,5 +4,5 @@ var Fr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{na
|
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function _o(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Eo,createHotReloadServer:_o,NATIVE_COMPONENTS:Fr},
|
|
8
|
-
export{Fr,Eo,_o,
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function _o(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Eo,createHotReloadServer:_o,NATIVE_COMPONENTS:Fr},yu=K;
|
|
8
|
+
export{Fr,Eo,_o,yu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{t,i,fn,Is,xe,l}from"./chunk-ab7vh24b.js";function S(e,n,r,o=0){let a=0,s=o,u=null,c=0,p=!1;while(s<e.length){let h=e[s];if(u&&p){p=!1,s++;continue}if(u&&h==="\\"){p=!0,s++;continue}if(p=!1,(h==='"'||h==="'"||h==="`")&&!u){u=h,s++;continue}if(h===u&&u!=="`"){u=null,s++;continue}if(u==="`"&&h==="$"&&e[s+1]==="{"){c++,s+=2;continue}if(c>0&&h==="}"){c--,s++;continue}if(h==="`"&&u==="`"&&c===0){u=null,s++;continue}if(u){s++;continue}if(h===n)a++;else if(h===r){if(a--,a===0)return s}s++}return-1}import T from"path";function Ts(e,n){let r=[];n.lastIndex=0;let o;while((o=n.exec(e))!==null){let a=o.index,s=a+o[0].length-1,u=S(e,"(",")",s);if(u===-1){r.push({start:a,end:-1,args:"",call:e.slice(a,Math.min(e.length,a+80))}),n.lastIndex=s+1;continue}r.push({start:a,end:u+1,args:e.slice(s+1,u),call:e.slice(a,u+1)}),n.lastIndex=u+1}return r}function Xe(e,n,r,o){let a="",s=0;for(let u of Ts(e,n)){if(a+=e.slice(s,u.start),u.end===-1){a+=o(u.call),s=u.start;continue}a+=r(u.args,u.call),s=u.end}return a+e.slice(s)}function Ge(e){let n=[],r=0,o=null,a="";for(let s=0;s<e.length;s++){let u=e[s];if(o){if(a+=u,u==="\\"&&s+1<e.length){a+=e[++s];continue}if(u===o)o=null;continue}if(u==="'"||u==='"'||u==="`")o=u;else if(u==="("||u==="["||u==="{")r++;else if(u===")"||u==="]"||u==="}")r--;else if(u===","&&r===0){n.push(a.trim()),a="";continue}a+=u}if(a.trim())n.push(a.trim());return n}function y(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let o="";for(let a=1;a<n.length-1;a++){let s=n[a];if(s==="\\"&&a+1<n.length-1){let u=n[++a];o+=u==="n"?`
|
|
3
|
-
`:u==="t"?"\t":u;continue}if(s===r)return null;if(r==="`"&&s==="$"&&n[a+1]==="{")return null;o+=s}return o}var R=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Je(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let o=fn(r);if(o)return{ok:!1,message:`the expression is not allowed (${o})`,code:t.UNSAFE_EXPRESSION};let a=Is(n),s;try{s=l(r,Object.keys(a))(...Object.values(a))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(s!==void 0&&s!==null)return{ok:!0,value:s};let u=[...new Set(xe(r))].filter((c)=>!R.has(c)&&!(c in a)&&!(c in globalThis));if(u.length>0)return{ok:!1,message:`${u.map((p)=>`"${p}"`).join(", ")} ${u.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(s===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:s}}function
|
|
4
|
-
`)}function
|
|
5
|
-
`,"")),headContent:n.trim()}}function
|
|
3
|
+
`:u==="t"?"\t":u;continue}if(s===r)return null;if(r==="`"&&s==="$"&&n[a+1]==="{")return null;o+=s}return o}var R=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Je(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let o=fn(r);if(o)return{ok:!1,message:`the expression is not allowed (${o})`,code:t.UNSAFE_EXPRESSION};let a=Is(n),s;try{s=l(r,Object.keys(a))(...Object.values(a))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(s!==void 0&&s!==null)return{ok:!0,value:s};let u=[...new Set(xe(r))].filter((c)=>!R.has(c)&&!(c in a)&&!(c in globalThis));if(u.length>0)return{ok:!1,message:`${u.map((p)=>`"${p}"`).join(", ")} ${u.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(s===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:s}}function de(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function ve(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function v(e){if(!e)return"";return T.isAbsolute(e)?T.relative(process.cwd(),e)||e:e}function f(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function E(e,n,r,o,a=t.EVALUATION_ERROR){let s=o?` in ${v(o)}`:"";return console.warn(`[stx] ${f(n)}${s}: ${r}`),i(e,`${f(n)}: ${r}`,a)}function tr(e,n,r){let o=r?` in ${v(r)}`:"";console.warn(`[stx] ${f(e)}${o}: ${n}`)}var x=["og:","article:","book:","profile:","fb:","music:","video:"],I=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function un(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=_(e[0],n);if(typeof r!=="string")return r;let o;if(e.length===2){let s=C(e[1],n);if(typeof s!=="string")return s;o=s}else{let s=r.includes(":")?r.slice(r.indexOf(":")+1):r,u=n.openGraph,c=n[s]??(ve(u)?u[s]:void 0);o=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!o)return{kind:"empty"};return{kind:"tag",tag:x.some((s)=>r.startsWith(s))?{property:r,content:o}:{name:r,content:o}}}function _(e,n){let r=y(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(I.test(e.trim()))return e.trim();let o=Je(e,n);if(!o.ok)return{kind:"error",message:`meta name: ${o.message}`,code:o.code};if(typeof o.value!=="string"||!o.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${de(o.value)}`,code:t.TYPE_ERROR};return o.value}function C(e,n){let r=y(e);if(r!==null)return r;let o=Je(e,n);if(!o.ok)return{kind:"error",message:o.message,code:o.code};let a=o.value;if(a===void 0||a===null||a===!1)return"";if(Array.isArray(a))return a.filter((s)=>s!==void 0&&s!==null&&s!=="").map(String).join(", ");if(typeof a==="object"&&!(a instanceof Date))return{kind:"error",message:`the content must be text, got ${de(a)}`,code:t.TYPE_ERROR};return String(a)}var dn=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],nr=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],w={links:"link",metas:"meta",scripts:"script",styles:"style"},b=new Set,A=new WeakMap;function k(e){if(b.has(e))return;b.add(e),console.warn(e)}function N(e,n){let r=Array.from({length:n.length+1},(o,a)=>a);for(let o=1;o<=e.length;o++){let a=r[0];r[0]=o;for(let s=1;s<=n.length;s++){let u=r[s];r[s]=Math.min(r[s]+1,r[s-1]+1,a+(e[o-1]===n[s-1]?0:1)),a=u}}return r[n.length]}function M(e,n){let r=e.toLowerCase(),o=n.find((p)=>p.toLowerCase()===r);if(o)return o;let a=w[r];if(a&&n.includes(a))return a;let s,u=1/0;for(let p of n){let h=N(r,p.toLowerCase());if(h<u)s=p,u=h}let c=Math.min(e.length,s?.length??0)<=4?1:2;return u<=c?s:void 0}function pe(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=A.get(e);if(r)return r;let{known:o,source:a}=n,s=e;for(let u of Object.keys(e)){if(o.includes(u))continue;let c=w[u];if(c&&o.includes(c)&&Array.isArray(e[u])){if(s===e)s={...e};let h=Array.isArray(s[c])?s[c]:[];s[c]=[...h,...e[u]],delete s[u],k(`[stx] ${a}.${u} is not a head key; reading it as ${a}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(u)&&!o.includes("style")){k(`[stx] ${a}.${u} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=M(u,o);k(p?`[stx] ${a}.${u} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${a}.${u} is not a head key and is ignored. Known keys: ${o.join(", ")}.`)}return A.set(e,s),s}var d={},D=[],g={};function Rs(){return d}function Gu(){return g}function Ju(){d={},D.length=0,g={}}function xi(e){d=fe(d,pe(e,{known:nr,source:"useHead()"}))}function fe(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:[...e.meta||[],...n.meta||[]],link:[...e.link||[],...n.link||[]],script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Rc(e){xi(rr(e))}function rr(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,o=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(o)n.push({property:"og:description",content:o});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let a=e.twitterTitle??e.title,s=e.twitterDescription??e.description,u=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(a)n.push({name:"twitter:title",content:a});if(s)n.push({name:"twitter:description",content:s});if(u){n.push({name:"twitter:image",content:u});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:c}}function Yu(e){if(g={...g,...e},e.title||e.description)Rc({title:e.title,description:e.description})}function Zu(e){let n=typeof e==="function"?e():e;xi({title:n})}function Qu(e=d){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${m(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([o,a])=>`${o}="${m(a)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let o=Object.entries(r).filter(([a,s])=>s!==void 0).map(([a,s])=>`${a==="httpEquiv"?"http-equiv":a}="${m(String(s))}"`).join(" ");n.push(`<meta ${o}>`)}for(let r of e.link||[]){let o=Object.entries(r).filter(([a,s])=>s!==void 0).map(([a,s])=>`${a}="${m(String(s))}"`).join(" ");n.push(`<link ${o}>`)}for(let r of e.script||[]){let{content:o,...a}=r,s=Object.entries(a).filter(([u,c])=>c!==void 0).map(([u,c])=>{if(typeof c==="boolean")return c?u:"";return`${u}="${m(String(c))}"`}).filter(Boolean).join(" ");if(o)n.push(`<script ${s}>${o}</script>`);else n.push(`<script ${s}></script>`)}for(let r of e.style||[]){let o=r.type?` type="${r.type}"`:"";n.push(`<style${o}>${r.content}</style>`)}return n.join(`
|
|
4
|
+
`)}function ed(e=d){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${m(r)}"`).join(" ")}function td(e=d){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${m(r)}"`).join(" ")}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function nd(e=d){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let o=document.querySelector(r);if(!o){if(o=document.createElement("meta"),n.name)o.setAttribute("name",n.name);if(n.property)o.setAttribute("property",n.property);document.head.appendChild(o)}o.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,o=document.querySelector(r);if(!o)o=document.createElement("link"),document.head.appendChild(o);for(let[a,s]of Object.entries(n))if(s!==void 0)o.setAttribute(a,String(s))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let o of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(o);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function rd(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(o,a)=>(n+=a.trim()+`
|
|
5
|
+
`,"")),headContent:n.trim()}}function sd(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,o,a,s)=>{let u=o?a:n[(s||"").trim()]??s,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=fe(c,{title:u}),""})}function od(e,n,r=""){if(!e.includes("@meta"))return e;return Xe(e,/(?<![\w$@])@meta\s*\(/g,(o,a)=>{let s=un(Ge(o),n);if(s.kind==="error")return E("Meta",a,s.message,r,s.code);if(s.kind==="tag"){let u=n.__stx_runtime_head??{};n.__stx_runtime_head=fe(u,{meta:[s.tag]})}return""},(o)=>E("Meta",o,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{S,Ts,Xe,Ge,Je,de,ve,E,tr,un,dn,nr,pe,Rs,Gu,Ju,xi,fe,Rc,rr,Yu,Zu,Qu,ed,td,nd,rd,sd,od};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ie,Wt}from"./chunk-nma8b17c.js";import{ke}from"./chunk-
|
|
2
|
+
import{Ie,Wt}from"./chunk-nma8b17c.js";import{ke}from"./chunk-9ztdvnkk.js";import{Fo,zo,f,St,Q,N,Vn,Un,Wn,n,I,o}from"./chunk-cetdwrqh.js";import{C}from"./chunk-99kt56fn.js";import{Ss}from"./chunk-f6kwahhn.js";import{dn,pe}from"./chunk-tbef3yyk.js";import{wi}from"./chunk-j4afmryj.js";import{me,re,io,ao,It}from"./chunk-16h7wedx.js";import{bt,Ur}from"./chunk-5tgctj1p.js";import{Dt}from"./chunk-7grtpdw5.js";import{pt,Gt,Jt}from"./chunk-5pjsc9zv.js";import{createHash as ee}from"crypto";function J(i){return ee("sha256").update(i).digest("hex").slice(0,8)}function U(i=!1){let l=i?Wt():Ie(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let i=ke(),l=J(i);return{content:i,filename:`router.${l}.js`,hash:l}}import m from"fs";import c from"path";import q from"path";import{createHash as te}from"crypto";function se(i={}){let l=new Set;return{context:new Proxy(i,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(i,l,a={}){let r=q.resolve(i),e=await Bun.file(r).text(),S=te("sha256").update(e).digest("hex").slice(0,16);Fo();let _={};try{_=await o(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>Q(R))),{context:D}=se({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),A=new Set,j={...I,..._,...a,buildMode:"compile",strict:!1},b=await n(e,D,r,j,A),w=me(b),P=zo();return{route:l,sourceFile:i,html:b,fragment:w,placeholders:P,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:S,status:St(e),streamTemplates:D.__streamTemplates}}var ne=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(i,l){let a=0,r=0;if(!m.existsSync(i))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(ne.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,r+=m.statSync(u).size}}}return e(i,l),{copied:a,bytes:r}}async function Zc(i={}){let l=Date.now(),a=c.resolve(i.root||process.cwd()),r=c.resolve(a,i.outputDir||".output");console.log("[stx build] Starting production build...");let e=await o(a),S=c.resolve(a,i.componentsDir??e.componentsDir??"components"),_=c.resolve(a,i.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,i.layoutsDir??e.layoutsDir??"layouts"),d=i.publicDir??e.publicDir??"public",g=pe(e.app?.head,{known:dn,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=i.routeRules??e.routeRules??{},j=Dt(A),b=i.serverApi??e.serverApi,w=typeof b==="object"?b:{};if(b)bt(a,w);if(e.runtimeConfig)C(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let P=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of P)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=N(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],B=R.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${B.length} page routes (${R.length-B.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=U(i.debug),x=V();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],k=[];for(let s of B){let h=j(s.pattern),O=h.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:i.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=Wn(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Vn(t.html,u);if(g.htmlAttrs)t.html=Un(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let W=p[1];t.html=t.html.replace(" "+W,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${W}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),O){let p=await It(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=re(t.html,D);let L=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),k.push({pattern:s.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let E=c.resolve(a,d);if(m.existsSync(E)){let{copied:s,bytes:h}=Z(E,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let H=Jt(a);if(H){let{copied:s,bytes:h}=Z(H,c.join(r,"public",Gt));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${pt}/`)}let F={runtime:v.filename,router:x.filename},T=io(k,F,r);if(T.routeRules=A,T.routerContainer=D,b)T.apiRoutes=await Ur(a,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Ss(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(wi(e._layerGraph),null,2));ao(T,r);let K=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${K}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:K}}
|
|
4
4
|
export{Zc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{W,Kr,Xr,Va,wt,jo,Gr,Bo,
|
|
2
|
+
import{W,Kr,Xr,Va,wt,jo,Gr,Bo,vu,Ne,Jr,he}from"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import{hi,s}from"./chunk-ak95401g.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{W as BROWSER_CORE_IMPORTS,Va as STX_AUTO_IMPORTS,Kr as extractAndStripCssImports,Ne as extractBridgeData,hi as findInterpolationEnd,Bo as generateAutoImportDestructuring,vu as generateBrowserAutoImportDestructuring,Jr as generateServerDataBridge,wt as injectBrowserCoreAutoImports,he as processClientScript,Gr as referencesName,Xr as renderVendorStyleTags,s as stripCommentsAndLiterals,jo as transformAutoImports};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{y}from"./chunk-01nx6zcw.js";import{P,Tt}from"./chunk-pf0d8y9n.js";import{m,h,w,He,L,o}from"./chunk-
|
|
2
|
+
import{y}from"./chunk-01nx6zcw.js";import{P,Tt}from"./chunk-pf0d8y9n.js";import{m,h,w,He,L,o}from"./chunk-cetdwrqh.js";import{ie,ht,yt}from"./chunk-0ax9kmf8.js";import{Pe,Ut,dt,H}from"./chunk-xnjcmhs5.js";import _ from"path";var x=new Map,D=new Map,N=m(64),k=new Map,U=["composables","functions"];function O(t){let r=_.basename(t,".ts");return r==="index"||r==="types"||t.endsWith(".d.ts")}async function W(t){if(t)return _.resolve(t);let r=`<default>:${process.cwd()}`,c=k.get(r);if(c!==void 0)return c;let e=await X();if(e!==null)k.set(r,e);return e}async function X(){let t=await o(),r=t.root||process.cwd(),c=t.composablesDir;if(c)return _.resolve(r,c);for(let e of U){let i=_.resolve(r,e);try{let l=new Bun.Glob("**/*.ts");for await(let a of l.scan({cwd:i,absolute:!0}))if(!O(a))return i}catch{}}return null}async function G(t){let r=Array.isArray(t)?t:t?[_.resolve(t)]:(await o())._layerComposableDirs??[await W()].filter((e)=>!!e),c=new Map;for(let e of r){let i=new Bun.Glob("**/*.ts");try{for await(let l of i.scan({cwd:e,absolute:!0})){let a=_.relative(e,l);if(!O(l)&&!c.has(a))c.set(a,l)}}catch{}}return{key:r.join("\x00"),files:[...c.values()].sort()}}async function Mr(t){let{files:r}=await G(t),c=L({loader:"ts",target:"browser",define:w()}),e=[];for(let i of r)try{let l=await Bun.file(i).text(),a=c.scan(l).exports.filter((f)=>f!=="default");if(a.length>0)e.push({file:i,names:a})}catch{}return e}function Z(t,r){return new RegExp(`\\b${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function q(t,r){let c=new Set(t.match(/\w+/g)),e=new Set;for(let i of r)if(/^\w+$/.test(i)?c.has(i):Z(t,i))e.add(i);return e}function Q(t,r,c){let e=new Map;for(let{file:f,names:d}of t)for(let u of d)if(!e.has(u))e.set(u,f);let i=(f)=>{let d=[];for(let u of q(f,e.keys()))d.push(e.get(u));return d},l=new Set,a=c.flatMap(i);while(a.length>0){let f=[];for(let d of a){if(l.has(d))continue;l.add(d);for(let u of i(r.get(d)??""))if(!l.has(u))f.push(u)}a=f}return l}async function El(t,r,c){let{key:e,files:i}=await G(t);if(!e)return null;let l=()=>[...new Set([...i,...i.flatMap((n)=>ie(n))])],a=Pe(l());if(i.length===0)return H(x,e,a,""),null;i.sort();let f=L({loader:"ts",target:"browser",define:w()}),d=dt(D,e,a);if(!d){let n=new Map,s=[];for(let p of i)try{let S=await Bun.file(p).text();n.set(p,S);let g=f.scan(S).exports.filter((z)=>z!=="default");if(g.length>0)s.push({file:p,names:g})}catch{n.set(p,"")}d=H(D,e,a,{codeByFile:n,modules:s})}let{codeByFile:u,modules:J}=d,b;if(r===void 0)b=new Set(i);else{let n=c?[r,...c]:[r],s=h(n.join("\x00"),e,n.length,a),p=N.get(s);if(b=p??Q(J,u,n),!p)N.set(s,b)}if(b.size===0)return null;let E=i.filter((n)=>b.has(n)),v=`${e}\x00${E.join("\x00")}`,I=dt(x,v,a);if(I!==void 0)return I||null;let M=[],C=new Set,F=new Set;for(let n of E)try{let s=u.get(n)??await Bun.file(n).text(),p=_.basename(n,".ts");for(let g of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])F.add(g[1]);let S=[];try{for(let g of f.scan(s).exports)if(g!=="default")C.add(g),S.push(g)}catch{}if(s=P(s),ht(s))s=await yt(s,n,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:S}),s=He(s);s=Tt(s),s=s.replace(/^export\s+(default\s+)?/gm,""),s=f.transformSync(s),M.push(`// Composable: ${p}
|
|
3
3
|
${s.trim()}`)}catch(s){console.warn(`[stx] Failed to load composable ${n}:`,s)}if(M.length===0||C.size===0)return H(x,v,a,""),null;let K=[...C].map((n)=>` try { if (!(${JSON.stringify(n)} in __c)) __c[${JSON.stringify(n)}] = ${n}; } catch (e) {}`).join(`
|
|
4
4
|
`),j=JSON.stringify([...C]),B=M.join(`
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rn,oc,os}from"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import{xe}from"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{xe as freeIdentifiers,os as processComponents,oc as processESImports,rn as rendersAsElement};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-ab7vh24b.js";import"./chunk-wkc34drs.js";import"./chunk-9ztdvnkk.js";import{ir,Os,Ai}from"./chunk-01nx6zcw.js";import"./chunk-pf0d8y9n.js";import{Ln,zn,n,o}from"./chunk-cetdwrqh.js";import"./chunk-tbef3yyk.js";import"./chunk-s10r6hxp.js";import"./chunk-99kt56fn.js";import"./chunk-f6kwahhn.js";import"./chunk-pcq6vphz.js";import"./chunk-j4afmryj.js";import{Ie}from"./chunk-nma8b17c.js";import"./chunk-8adstrk5.js";import{existsSync as le,mkdirSync as qt,readFileSync as Yt}from"fs";import P from"path";import{existsSync as jt,mkdirSync as Gt}from"fs";import D from"path";import{existsSync as $t}from"fs";import j from"path";var Ke="data-stx-b",he=new Set(Os),Qe=new Set(ir);function Ze(r){if(r==="ref"||r==="data-stx-ref")return"ref";if(r.startsWith("::"))return null;if(r.startsWith("@bind:")||r.startsWith("x-bind:"))return"attr";if(r.startsWith("@")||r.startsWith(":")){let e=r.slice(1).split(".")[0];if(he.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(Ai(e))return"event";if(r.startsWith("@"))return"event";return"attr"}if(r.startsWith("x-")){let e=r.split(".")[0];if(!Qe.has(e))return"attr";let t=e.slice(2);if(t==="cloak"||t==="data"||t==="bind")return null;if(t==="tooltip"||t==="tooltip-position")return null;return he.has(t)?t==="if"?"if":t:"attr"}return null}function et(r){let e=[];for(let[t,i]of r){let s=Ze(t);if(s)e.push({name:t,value:i,kind:s})}return e}var tt=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,Q=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function be(r){let e=[],t=0;return{html:r.replace(tt,(s,a,l)=>{if(!l||!/[:@]|x-/.test(l))return s;let u=[];Q.lastIndex=0;for(let h=Q.exec(l);h;h=Q.exec(l))u.push([h[1],h[2]??h[3]??h[4]??""]);let d=et(u);if(!d.length)return s;let m={id:t++,bindings:d};if(d.some((h)=>h.kind==="for"))m.template=!0;e.push(m);let p=s.endsWith("/>");return`${s.slice(0,p?-2:-1).trimEnd()} ${Ke}="${m.id}"${p?"/>":">"}`}),manifest:{entries:e}}}var ee={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText"},we=new Set(Object.values(ee));var ye=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Te=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight"];function C(r){let e=typeof r==="number"?r:Number.parseFloat(String(r??""));return Number.isFinite(e)?e:0}function V(r){return Math.round(r*1000)/1000}function ke(r){if(Array.isArray(r)&&r.length===4&&r.every((t)=>Number.isFinite(Number(t))))return r.map(Number);let e=String(r??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((t)=>!Number.isFinite(t))||e[2]<=0||e[3]<=0)return null;return e}function nt(r){let e=String(r??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var Se=/[MLHVCSQTAZ]/i,Z=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function rt(r){let e=[],t=r,i=Se.exec(t);while(i){let s=i.index;t=t.slice(s);let a=t[0];t=t.slice(1);let l=Se.exec(t),u=l?t.slice(0,l.index):t,d;if(a==="A"||a==="a"){d=[];let m=0,p=u.trim(),c=0;while(c<p.length){let h=m%7,b=p.slice(c).replace(/^[\s,]+/,"");if(c=p.length-b.length,!b)break;if(h===3||h===4)d.push(b[0]==="1"?1:0),c+=1;else{Z.lastIndex=0;let x=Z.exec(b);if(!x||x.index!==0)break;d.push(Number.parseFloat(x[0])),c+=x[0].length}m++}}else d=(u.match(Z)||[]).map(Number.parseFloat);e.push({command:a,args:d}),i=l}return e}function it(r,e,t,i,s,a,l,u,d){if(r===u&&e===d)return[];let m=Math.abs(t),p=Math.abs(i);if(!m||!p)return[1,u,d];let c=s*Math.PI/180,h=Math.cos(c),b=Math.sin(c),x=(r-u)/2,S=(e-d)/2,f=h*x+b*S,w=-b*x+h*S,T=f*f/(m*m)+w*w/(p*p);if(T>1)m*=Math.sqrt(T),p*=Math.sqrt(T);let N=m*m*p*p-m*m*w*w-p*p*f*f,g=m*m*w*w+p*p*f*f,R=Math.sqrt(Math.max(0,N/g));if(a===l)R=-R;let k=R*(m*w)/p,v=R*-(p*f)/m,I=h*k-b*v+(r+u)/2,B=b*k+h*v+(e+d)/2,W=(E,_,L,X)=>{let J=E*X-_*L<0?-1:1,K=(E*L+_*X)/(Math.hypot(E,_)*Math.hypot(L,X));return J*Math.acos(Math.min(1,Math.max(-1,K)))},qe=W(1,0,(f-k)/m,(w-v)/p),A=W((f-k)/m,(w-v)/p,(-f-k)/m,(-w-v)/p);if(!l&&A>0)A-=2*Math.PI;if(l&&A<0)A+=2*Math.PI;let G=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2))),ue=A/G,U=1.3333333333333333*Math.tan(ue/4),de=[],fe=(E)=>{let _=m*Math.cos(E),L=p*Math.sin(E);return[h*_-b*L+I,b*_+h*L+B]},pe=(E)=>{let _=-m*Math.sin(E),L=p*Math.cos(E);return[h*_-b*L,b*_+h*L]},H=qe;for(let E=0;E<G;E++){let _=H+ue,[L,X]=fe(H),[J,K]=pe(H),[ge,me]=fe(_),[Ye,Je]=pe(_);de.push(2,L+U*J,X+U*K,ge-U*Ye,me-U*Je,E===G-1?u:ge,E===G-1?d:me),H=_}return de}function ot(r){let e=[],t=0,i=0,s=0,a=0,l=0,u=0,d=0,m=0,p="";for(let{command:c,args:h}of rt(String(r??""))){let b=c===c.toLowerCase(),x=c.toUpperCase(),S=()=>b?t:0,f=()=>b?i:0,w=0,T=(g)=>{if(w+g>h.length)return null;let R=h.slice(w,w+g);return w+=g,R};if(x==="Z"){e.push(4),t=s,i=a,p="Z";continue}let N=!0;while(w<h.length||N&&x==="Z"){switch(x){case"M":{let g=T(2);if(!g)return e;if(t=g[0]+S(),i=g[1]+f(),N)e.push(0,t,i),s=t,a=i;else e.push(1,t,i);p=N?"M":"L";break}case"L":{let g=T(2);if(!g)return e;t=g[0]+S(),i=g[1]+f(),e.push(1,t,i),p="L";break}case"H":{let g=T(1);if(!g)return e;t=g[0]+S(),e.push(1,t,i),p="L";break}case"V":{let g=T(1);if(!g)return e;i=g[0]+f(),e.push(1,t,i),p="L";break}case"C":{let g=T(6);if(!g)return e;let R=g[0]+S(),k=g[1]+f();l=g[2]+S(),u=g[3]+f(),t=g[4]+S(),i=g[5]+f(),e.push(2,R,k,l,u,t,i),p="C";break}case"S":{let g=T(4);if(!g)return e;let R=p==="C"?2*t-l:t,k=p==="C"?2*i-u:i;l=g[0]+S(),u=g[1]+f(),t=g[2]+S(),i=g[3]+f(),e.push(2,R,k,l,u,t,i),p="C";break}case"Q":{let g=T(4);if(!g)return e;d=g[0]+S(),m=g[1]+f(),t=g[2]+S(),i=g[3]+f(),e.push(3,d,m,t,i),p="Q";break}case"T":{let g=T(2);if(!g)return e;d=p==="Q"?2*t-d:t,m=p==="Q"?2*i-m:i,t=g[0]+S(),i=g[1]+f(),e.push(3,d,m,t,i),p="Q";break}case"A":{let g=T(7);if(!g)return e;let R=g[5]+S(),k=g[6]+f();e.push(...it(t,i,g[0],g[1],g[2],g[3],g[4],R,k)),t=R,i=k,p="A";break}default:return e}N=!1}}return e.map((c)=>V(c))}function xe(r,e,t,i){if(t<=0||i<=0)return[];let s=0.5522847498;return[0,r+t,e,2,r+t,e+s*i,r+s*t,e+i,r,e+i,2,r-s*t,e+i,r-t,e+s*i,r-t,e,2,r-t,e-s*i,r-s*t,e-i,r,e-i,2,r+s*t,e-i,r+t,e-s*i,r+t,e,4].map(V)}function ve(r,e){switch(r){case"Path":return ot(String(e.d??""));case"Line":return[0,C(e.x1),C(e.y1),1,C(e.x2),C(e.y2)].map(V);case"Rect":{let t=C(e.x),i=C(e.y),s=C(e.width),a=C(e.height);if(s<=0||a<=0)return[];let l=e.rx===void 0?C(e.ry):C(e.rx),u=e.ry===void 0?l:C(e.ry);if(l=Math.min(Math.max(0,l),s/2),u=Math.min(Math.max(0,u),a/2),!l||!u)return[0,t,i,1,t+s,i,1,t+s,i+a,1,t,i+a,4].map(V);let d=0.5522847498;return[0,t+l,i,1,t+s-l,i,2,t+s-l+d*l,i,t+s,i+u-d*u,t+s,i+u,1,t+s,i+a-u,2,t+s,i+a-u+d*u,t+s-l+d*l,i+a,t+s-l,i+a,1,t+l,i+a,2,t+l-d*l,i+a,t,i+a-u+d*u,t,i+a-u,1,t,i+u,2,t,i+u-d*u,t+l-d*l,i,t+l,i,4].map(V)}case"Circle":return xe(C(e.cx),C(e.cy),C(e.r),C(e.r));case"Ellipse":return xe(C(e.cx),C(e.cy),C(e.rx),C(e.ry));case"Polyline":case"Polygon":{let t=nt(e.points);if(t.length<4)return[];let i=[0,t[0],t[1]];for(let s=2;s<t.length;s+=2)i.push(1,t[s],t[s+1]);if(r==="Polygon")i.push(4);return i.map(V)}default:return null}}var st=[...Te,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumTrackTintColor","minimumValue","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],at=new Map(st.map((r)=>[Ce(r),r]));function Ce(r){return r.replace(/[-_]/g,"").toLowerCase()}function te(r){return at.get(Ce(r))??r}var ct={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function Re(r){return ct[r.toLowerCase()]||r}var lt={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette","badge-check":"checkmark.seal","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100",bed:"bed.double",bell:"bell","bell-off":"bell.slash",bike:"figure.outdoor.cycle",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",brain:"brain",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath",camera:"camera","chart-bar":"chart.bar","chart-line":"chart.xyaxis.line",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",download:"arrow.down.circle",droplet:"drop",droplets:"drop",dumbbell:"dumbbell",edit:"pencil","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",heart:"heart","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",house:"house",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-grid":"square.grid.2x2",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble",mic:"mic",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-plus":"person.badge.plus","user-round":"person",users:"person.2",video:"video","volume-2":"speaker.wave.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function Ee(r,e=!1){let t=String(r??"").trim();if(!t)return{symbol:"circle",known:!1};if(e)return{symbol:t,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(t)??/^([a-z0-9]+):(.+)$/.exec(t),s=i?i[1]:"lucide",a=i?i[2]:t;if(s==="lucide"){let l=lt[a];if(l)return{symbol:l,iconify:`i-lucide-${a}`,known:!0};if(!i&&t.includes("."))return{symbol:t,known:!0}}return{symbol:"circle",iconify:i?t:`i-lucide-${a}`,known:!1}}var ut={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},Le={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},_e={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},O={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function z(r){let e=r.lastIndexOf("/");if(e>0&&!r.endsWith("]")){let i=z(r.slice(0,e)),s=r.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return dt(i,a/100)}if(r==="transparent")return"transparent";if(r==="current")return"currentColor";if(r==="black")return"#000000";if(r==="white")return"#ffffff";let t=r.split("-");if(t.length===2){let[i,s]=t,a=ut[i];if(a&&typeof a==="object")return a[s]}if(r.startsWith("[")&&r.endsWith("]")){let i=r.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function dt(r,e){if(r==="transparent")return r;let t=r.startsWith("#")?r.slice(1):"";if(t.length===3)t=t.split("").map((s)=>s+s).join("");if(t.length===8)t=t.slice(0,6);if(t.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${t}${i.toString(16).padStart(2,"0")}`}function ne(r,e=16){if(!r.startsWith("[")||!r.endsWith("]"))return;let t=r.slice(1,-1),i=Number.parseFloat(t);if(!Number.isFinite(i))return;if(t.endsWith("rem"))return i*16;if(t.endsWith("em"))return i*e;return i}function y(r){if(r.startsWith("[")&&r.endsWith("]")){let e=r.slice(1,-1),t=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(t)?t:void 0}return Le[r]}var ft={flex:(r,e)=>(e.display="flex",!0),hidden:(r,e)=>(e.display="none",!0),grid:(r,e)=>(e.display="grid",!0),"flex-row":(r,e)=>(e.flexDirection="row",!0),"flex-col":(r,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(r,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(r,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(r,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(r,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(r,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(r,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(r,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(r,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(r,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(r,e)=>(e.flexGrow=1,!0),"grow-0":(r,e)=>(e.flexGrow=0,!0),shrink:(r,e)=>(e.flexShrink=1,!0),"shrink-0":(r,e)=>(e.flexShrink=0,!0),"justify-start":(r,e)=>(e.justifyContent="flex-start",!0),"justify-center":(r,e)=>(e.justifyContent="center",!0),"justify-end":(r,e)=>(e.justifyContent="flex-end",!0),"justify-between":(r,e)=>(e.justifyContent="space-between",!0),"justify-around":(r,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(r,e)=>(e.justifyContent="space-evenly",!0),"items-start":(r,e)=>(e.alignItems="flex-start",!0),"items-center":(r,e)=>(e.alignItems="center",!0),"items-end":(r,e)=>(e.alignItems="flex-end",!0),"items-stretch":(r,e)=>(e.alignItems="stretch",!0),"items-baseline":(r,e)=>(e.alignItems="baseline",!0),"self-auto":(r,e)=>(e.alignSelf="auto",!0),"self-start":(r,e)=>(e.alignSelf="flex-start",!0),"self-center":(r,e)=>(e.alignSelf="center",!0),"self-end":(r,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(r,e)=>(e.alignSelf="stretch",!0),"self-baseline":(r,e)=>(e.alignSelf="baseline",!0),"min-w-0":(r,e)=>(e.minWidth=0,!0),"aspect-square":(r,e)=>(e.aspectRatio=1,!0),"inset-0":(r,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(r,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(r,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(r,e)=>(e.letterSpacing=0,!0),"tracking-wide":(r,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(r,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(r,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(r,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(r,e)=>(e.position="relative",!0),absolute:(r,e)=>(e.position="absolute",!0),"overflow-visible":(r,e)=>(e.overflow="visible",!0),"overflow-hidden":(r,e)=>(e.overflow="hidden",!0),"overflow-scroll":(r,e)=>(e.overflow="scroll",!0),"font-thin":(r,e)=>(e.fontWeight="100",!0),"font-extralight":(r,e)=>(e.fontWeight="200",!0),"font-light":(r,e)=>(e.fontWeight="300",!0),"font-normal":(r,e)=>(e.fontWeight="400",!0),"font-medium":(r,e)=>(e.fontWeight="500",!0),"font-semibold":(r,e)=>(e.fontWeight="600",!0),"font-bold":(r,e)=>(e.fontWeight="bold",!0),"font-extrabold":(r,e)=>(e.fontWeight="800",!0),"font-black":(r,e)=>(e.fontWeight="900",!0),italic:(r,e)=>(e.fontStyle="italic",!0),"not-italic":(r,e)=>(e.fontStyle="normal",!0),"text-left":(r,e)=>(e.textAlign="left",!0),"text-center":(r,e)=>(e.textAlign="center",!0),"text-right":(r,e)=>(e.textAlign="right",!0),"text-justify":(r,e)=>(e.textAlign="justify",!0),uppercase:(r,e)=>(e.textTransform="uppercase",!0),lowercase:(r,e)=>(e.textTransform="lowercase",!0),capitalize:(r,e)=>(e.textTransform="capitalize",!0),"normal-case":(r,e)=>(e.textTransform="none",!0),underline:(r,e)=>(e.textDecorationLine="underline",!0),"line-through":(r,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(r,e)=>(e.textDecorationLine="none",!0)};function pt(r,e){if(!r.startsWith("bg-"))return!1;let t=r.slice(3),i=z(t);if(i)return e.backgroundColor=i,!0;return!1}function gt(r,e){if(!r.startsWith("text-"))return!1;let t=r.slice(5);if(_e[t])return e.fontSize=_e[t],!0;if(t.startsWith("[")&&t.endsWith("]")){let s=t.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(s)){let a=s.endsWith("rem")||s.endsWith("em")?Number.parseFloat(s)*16:Number.parseFloat(s);if(Number.isFinite(a))return e.fontSize=a,!0}}let i=z(t);if(i)return e.color=i,!0;return!1}function mt(r,e){for(let t of["fill","stroke"]){let i=`${t}-`;if(!r.startsWith(i))continue;let s=r.slice(i.length);if(s==="none")return e[t]="none",!0;if(t==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return e.strokeWidth=Number.parseFloat(s),!0;if(t==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return e.strokeWidth=Number.parseFloat(s.slice(1)),!0;let a=z(s);if(a)return e[t]=a,!0}return!1}function ht(r,e){if(r.startsWith("p-")){let t=y(r.slice(2));if(t!==void 0)return e.padding=t,!0}if(r.startsWith("px-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingHorizontal=t,!0}if(r.startsWith("py-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingVertical=t,!0}if(r.startsWith("pt-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingTop=t,!0}if(r.startsWith("pr-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingRight=t,!0}if(r.startsWith("pb-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingBottom=t,!0}if(r.startsWith("pl-")){let t=y(r.slice(3));if(t!==void 0)return e.paddingLeft=t,!0}return!1}function bt(r,e){if(r.startsWith("m-")){let t=y(r.slice(2));if(t!==void 0)return e.margin=t,!0}if(r.startsWith("mx-")){let t=y(r.slice(3));if(t!==void 0)return e.marginHorizontal=t,!0}if(r.startsWith("my-")){let t=y(r.slice(3));if(t!==void 0)return e.marginVertical=t,!0}if(r.startsWith("mt-")){let t=y(r.slice(3));if(t!==void 0)return e.marginTop=t,!0}if(r.startsWith("mr-")){let t=y(r.slice(3));if(t!==void 0)return e.marginRight=t,!0}if(r.startsWith("mb-")){let t=y(r.slice(3));if(t!==void 0)return e.marginBottom=t,!0}if(r.startsWith("ml-")){let t=y(r.slice(3));if(t!==void 0)return e.marginLeft=t,!0}return!1}function St(r,e){if(!r.startsWith("w-"))return!1;let t=r.slice(2);if(t==="full")return e.width="100%",!0;if(t==="screen")return e.width="100%",!0;if(t==="auto")return e.width="auto",!0;if(t.includes("/")){let[s,a]=t.split("/"),l=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${l}%`,!0}let i=y(t);if(i!==void 0)return e.width=i,!0;return!1}function xt(r,e){if(!r.startsWith("h-"))return!1;let t=r.slice(2);if(t==="full")return e.height="100%",!0;if(t==="screen")return e.height="100%",!0;if(t==="auto")return e.height="auto",!0;let i=y(t);if(i!==void 0)return e.height=i,!0;return!1}function wt(r,e){if(!r.startsWith("rounded"))return!1;if(r==="rounded")return e.borderRadius=O.DEFAULT,!0;let t=r.slice(8);if(t==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(t);if(i){let a=ne(i[2]);if(a===void 0)return!1;let l={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let u of i[1]?l[i[1]]:["borderRadius"])e[u]=a;return!0}if(t.startsWith("t-")){let a=O[t.slice(2)]??O.DEFAULT;return e.borderTopLeftRadius=a,e.borderTopRightRadius=a,!0}if(t.startsWith("b-")){let a=O[t.slice(2)]??O.DEFAULT;return e.borderBottomLeftRadius=a,e.borderBottomRightRadius=a,!0}if(t.startsWith("l-")){let a=O[t.slice(2)]??O.DEFAULT;return e.borderTopLeftRadius=a,e.borderBottomLeftRadius=a,!0}if(t.startsWith("r-")){let a=O[t.slice(2)]??O.DEFAULT;return e.borderTopRightRadius=a,e.borderBottomRightRadius=a,!0}let s=O[t];if(s!==void 0)return e.borderRadius=s,!0;return!1}function yt(r,e){if(!r.startsWith("border"))return!1;if(r==="border")return e.borderWidth=1,!0;let t=r.match(/^border-(\d+)$/);if(t)return e.borderWidth=Number.parseInt(t[1]),!0;let i=r.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,s,a]=i,l=a?Number.parseInt(a):1;switch(s){case"t":e.borderTopWidth=l;break;case"r":e.borderRightWidth=l;break;case"b":e.borderBottomWidth=l;break;case"l":e.borderLeftWidth=l;break}return!0}return!1}function Tt(r,e){if(!r.startsWith("border-"))return!1;let t=r.slice(7),i=z(t);if(i)return e.borderColor=i,!0;return!1}function kt(r,e){if(!r.startsWith("opacity-"))return!1;let t=Number.parseInt(r.slice(8));if(!Number.isNaN(t))return e.opacity=t/100,!0;return!1}function vt(r,e){if(r.startsWith("tracking-[")){let t=ne(r.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(t===void 0)return!1;return e.letterSpacing=t,!0}if(r.startsWith("leading-")){let t=r.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=t.startsWith("[")?/^\[[\d.]+\]$/.test(t)?Number.parseFloat(t.slice(1,-1))*i:ne(t,i):s[t]!==void 0?s[t]*i:Le[t];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function Ct(r,e){let t=/^grid-cols-(\d+)$/.exec(r);if(!t)return!1;return e.gridColumns=Number(t[1]),!0}function Rt(r,e){if(!r.startsWith("size-"))return!1;let t=r.slice(5),i=t==="full"?"100%":y(t);if(i===void 0)return!1;return e.width=i,e.height=i,!0}function Et(r,e){let t=/^(-?)(top|right|bottom|left)-(.+)$/.exec(r);if(!t)return!1;let i=t[3]==="full"?"100%":y(t[3]);if(i===void 0)return!1;return e[t[2]]=typeof i==="number"&&t[1]?-i:i,!0}function _t(r,e){let t=/^space-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=y(t[2]);if(i===void 0)return!1;return e.gap=i,!0}function Nt(r,e){if(r.startsWith("gap-")){let t=y(r.slice(4));if(t!==void 0)return e.gap=t,!0}if(r.startsWith("gap-x-")){let t=y(r.slice(6));if(t!==void 0)return e.columnGap=t,!0}if(r.startsWith("gap-y-")){let t=y(r.slice(6));if(t!==void 0)return e.rowGap=t,!0}return!1}function re(r){let e=[],t=[],i=[];function s(d,m){let p=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(d),c=p&&Ln[p[2]];return c?`${p[1]}-${c[m]}${p[3]||""}`:d}for(let d of r.split(/\s+/).filter(Boolean))if(d.startsWith("dark:"))t.push(s(d.slice(5),"dark"));else if(!d.includes(":")||d.startsWith("[")){if(e.push(s(d,"light")),s(d,"dark")!==d)i.push(s(d,"dark"))}let a=[],u={style:Ne(e.join(" "),a),unknown:a};if(t.length||i.length)u.dark=Ne([...i,...t].join(" "),a);for(let d of e){if(d==="truncate")u.numberOfLines=1;let m=/^line-clamp-(\d+)$/.exec(d);if(m)u.numberOfLines=Number(m[1]);if(!u.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(d))u.icon=d}return u.unknown=a.filter((d)=>!/^line-clamp-\d+$/.test(d)),u}function Ne(r,e){let t={},i=r.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=ft[s];if(a){a("",t);continue}if(pt(s,t))continue;if(mt(s,t))continue;if(gt(s,t))continue;if(ht(s,t))continue;if(bt(s,t))continue;if(St(s,t))continue;if(xt(s,t))continue;if(wt(s,t))continue;if(yt(s,t))continue;if(Tt(s,t))continue;if(kt(s,t))continue;if(Nt(s,t))continue;if(vt(s,t))continue;if(Rt(s,t))continue;if(Ct(s,t))continue;if(Et(s,t))continue;if(_t(s,t))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return t}function M(r,e={},t={},i={},s=[]){return{type:r,props:e,style:t,events:i,children:s}}function Be(r,e,t={}){return{version:"1.0.0",root:r,script:e,meta:{source:t.source||"unknown",compiledAt:t.compiledAt||Date.now(),headwindConfig:t.headwindConfig}}}var We=new Set(["script","style","head","meta","link","title","base","noscript"]),Oe=new Set(["template","body","html","main","fragment"]),q=new Set,It={click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError"},Lt=new Set(["onBlur","onChangeText","onDismiss","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onPress","onPressIn","onPressOut","onRequestClose","onRefresh","onScroll","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),ie=new Set(["display","gridColumns","gridTemplateColumns","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow","fill","stroke","strokeWidth"]),Bt=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),Wt=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),Pe=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...we]),De=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Ot={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function F(r){return r.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,t)=>{let i=Ot[t.toLowerCase()];if(i!==void 0)return i;if(t[0]==="#"){let s=t[1]==="x"||t[1]==="X"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function Ae(r){return r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Ve(r){let e=/^(-?[\d.]+)px$/.exec(r);if(e)return Number.parseFloat(e[1]);let t=/^(-?[\d.]+)r?em$/.exec(r);if(t)return Number.parseFloat(t[1])*16;if(/^-?[\d.]+$/.test(r))return Number.parseFloat(r);return r}function Me(r,e,t){let i={},s={},a={},l="",u={};for(let[m,p]of e){let c=m.toLowerCase();if(c==="class"||c==="classname"){l=l?`${l} ${p}`:p;continue}if(c==="style"){u={...u,...Pt(r,p,t)};continue}if(c.startsWith(":")||c.startsWith("x-")&&c!=="x-cloak"){a[c.startsWith(":")?c.slice(1):c.slice(2)]=F(p);continue}if(c==="x-cloak")continue;if(c.startsWith("@")||c.startsWith("v-on:")){let b=c.startsWith("@")?c.slice(1):c.slice(5),[x]=b.split("."),S=It[x]??(x.startsWith("on")?x:"");if(!S||!Lt.has(S)){t.push({kind:"unread-event",tag:r,name:m});continue}s[S]=F(p);continue}if(c==="key"){i.key=p;continue}let h=F(p);try{i[te(m)]=JSON.parse(h)}catch{i[te(m)]=h}}let d={...l?re(l).style:{},...u};return{props:i,style:d,events:s,bindings:a,classes:l,inline:u}}function Xe(r,e){if(Bt.has(r))return!1;if(Wt.has(r))return/^-?[\d.]+%$/.test(e);return!0}function Pt(r,e,t){let i={},s=F(e);try{let a=JSON.parse(s);if(a&&typeof a==="object"&&!Array.isArray(a)){for(let[l,u]of Object.entries(a)){let d=ie.has(l)?l:Ae(l.trim().toLowerCase());if(!ie.has(d)){t.push({kind:"unknown-style",tag:r,name:d});continue}if(u===null||u===void 0)continue;let m=typeof u==="string"?Ve(u):u;if(typeof m!=="string"&&typeof m!=="number")continue;if(typeof m==="string"&&!Xe(d,m)){t.push({kind:"non-numeric-style",tag:r,name:d});continue}i[d]=m}return i}}catch{}for(let a of s.split(";")){let l=a.indexOf(":");if(l===-1)continue;let u=Ae(a.slice(0,l).trim().toLowerCase()),d=a.slice(l+1).trim();if(!u||!d)continue;if(!ie.has(u)){t.push({kind:"unknown-style",tag:r,name:u});continue}let m=Ve(d);if(typeof m==="string"&&!Xe(u,m)){t.push({kind:"non-numeric-style",tag:r,name:u});continue}i[u]=m}return i}function oe(r){return r.children.map((e)=>typeof e==="string"?e:oe(e)).join("").replace(/\s+/g," ").trim()}function Dt(r,e){let t=r.node,i=t.children.filter((a)=>typeof a!=="string"),s=t.children.filter((a)=>typeof a==="string").join("").trim();if(t.type==="Svg"||t.type==="G")return t.children=i,t;if(t.type==="SvgText"){let a=oe(t);return t.children=a?[a]:[],t}if(De.has(t.type)&&i.length===0&&s)return t.type="Text",t.children=[s],t;if(t.type==="Text"&&i.length>0){let a=oe(t);return e.push({kind:"flattened-text",tag:r.tag}),t.children=a?[a]:[],t}if(De.has(t.type)&&i.length>0)t.children=i;return t}async function At(r,e={}){let t=[],i=[],s=[],a=new Set;function l(c){let h=s[s.length-1];if(!h)i.push(c);else if(!h.dropped)h.node.children.push(c)}function u(c){if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let b=c.node.children,x=b.filter((f)=>typeof f!=="string"),S=x.length===1&&x.length===b.length?x[0]:M("View",{},{},{},b);if(S.bindings={...c.node.bindings,...S.bindings},S.bindingId===void 0&&c.node.bindingId!==void 0)S.bindingId=c.node.bindingId;l(S);return}let h=s[s.length-1];for(let b of c.node.children){if(typeof b==="string"){if(h&&!h.dropped)h.node.children.push(b);continue}if(!h)i.push(b);else if(!h.dropped)h.node.children.push(b)}}function d(c,h){let b=s[s.length-1];if(c==="svg"||b?.svg)return m(c,h,b);let x=We.has(c)&&!q.has(c),S=s[s.length-1]?.dropped??!1,{props:f,style:w,events:T,bindings:N,classes:g,inline:R}=x||S?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:Me(c,h,t),k=f["data-native"],v;if(typeof k==="string"&&Pe.has(k))v=k,delete f["data-native"];else v=q.has(c)?"View":Re(c);if(v===c&&!Pe.has(v)&&!We.has(c)&&!Oe.has(c)&&!a.has(c))a.add(c),t.push({kind:"unmapped-tag",tag:c});if((x||q.has(c))&&!a.has(`drop:${c}`))a.add(`drop:${c}`),t.push({kind:"dropped-subtree",tag:c});if(v==="Icon"){let W=re(g).icon;f.symbol=Ee(String(f.symbol||f.name||W||""),Boolean(f.symbol)).symbol}let I=M(v,f,w,T);I._inlineStyle=R;let B=f["data-stx-b"];if(typeof B==="number"&&Number.isInteger(B))I.bindingId=B;if(delete f["data-stx-b"],g)I._classes=g;if(Object.keys(N).length>0)I.bindings=N;if(typeof f.key==="string")I.key=f.key,delete f.key;return{tag:c,node:I,dropped:x||S||q.has(c),discard:x||S,unwrap:Oe.has(c)}}function m(c,h,b){let x=b?.dropped??!1,S=ee[c];if(x||!S){if(!x&&!a.has(`drop:${c}`))a.add(`drop:${c}`),t.push({kind:ye.has(c)?"dropped-subtree":"unmapped-tag",tag:c});return{tag:c,node:M("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let{props:f,style:w,events:T,bindings:N,classes:g,inline:R}=Me(c,h,t);if(S==="Svg"){let B=ke(f.viewBox);if(B)f.viewBox=B;else delete f.viewBox;for(let W of["width","height"]){if(typeof f[W]==="number"&&w[W]===void 0)w[W]=f[W];delete f[W]}}if(typeof f.strokeDasharray==="string"||typeof f.strokeDasharray==="number"){let B=String(f.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);f.strokeDasharray=B}let k=ve(S,f);if(k)f.geometry=k;let v=M(S,f,w,T);v._inlineStyle=R;let I=f["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))v.bindingId=I;if(delete f["data-stx-b"],g)v._classes=g;if(Object.keys(N).length>0)v.bindings=N;if(typeof f.key==="string")v.key=f.key,delete f.key;return{tag:c,node:v,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(c){let h=c.tagName.toLowerCase(),b=d(h,[...c.attributes]),x=!0;try{c.onEndTag(()=>{if(s.pop(),b.discard)return;if(b.unwrap)u(b);else l(Dt(b,t))})}catch{x=!1}if(x)s.push(b);else if(!b.discard)l(b.node)},text(c){let h=s[s.length-1];if(!h||h.dropped)return;let b=F(c.text).replace(/\s+/g," ");if(!b.trim())return;h.node.children.push(b)}}).transform(new Response(r)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:M("View",{},{},{},i),diagnostics:t}}async function $e(r,e={}){let{root:t,diagnostics:i}=await At(r,e),s=e.script??{exports:{},functions:[],code:""};return{document:Be(t,s,{source:e.source??"unknown"}),diagnostics:i}}var ze=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Vt=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Mt=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,Fe=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function se(r){let e=[];ze.lastIndex=0;for(let a of r.matchAll(ze)){let l=a[1]??"";if(/\bserver\b/.test(l))continue;e.push(a[2].trim())}let t=e.filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`),i=[];for(let a of[Vt,Mt]){a.lastIndex=0;for(let l of t.matchAll(a))if(!i.includes(l[1]))i.push(l[1])}let s={};Fe.lastIndex=0;for(let a of t.matchAll(Fe)){let l=a[2];try{s[a[1]]=JSON.parse(l.replace(/^'(.*)'$/,'"$1"'))}catch{s[a[1]]=l}}return{exports:s,functions:i,code:t}}var je=/<script\b[^>]*\bdata-stx-scoped\b[^>]*>([\s\S]*?)<\/script>/gi,Xt=/function\s+(__stx_setup_[\w$]+)\s*\(/;function ae(r){je.lastIndex=0;for(let e of r.matchAll(je)){let t=e[1].trim(),i=Xt.exec(t)?.[1];if(i)return{name:i,code:t}}return null}function zt(){let r=[j.join(import.meta.dir,"..","primitives"),j.join(import.meta.dir,"native","primitives")];for(let e of r)if($t(j.join(e,"View.stx")))return e;return r[0]}async function Ft(r,e,t={}){let i=t.root??j.dirname(e),s=await o(i),a={root:i,componentsDir:t.componentsDir??j.join(i,"components"),buildMode:"serve",cache:!1,_pluginComponentDirs:[zt(),...s._pluginComponentDirs??[]]},l={...t.context??{},__stx_inject_css:!1},u=await n(r,l,e,a,new Set),{html:d,manifest:m}=be(u),{document:p,diagnostics:c}=await $e(d,{source:e,script:se(r)}),h=ae(d);if(se(r).code.trim()){let b=await zn(r,e,t.context,{forceClientSetup:!0});h=ae(b.setupCode??"")??h}return{document:p,manifest:m,setup:h,diagnostics:c,html:d}}async function Y(r,e={}){return Ft(await Bun.file(r).text(),r,e)}function Ge(r){let t=[D.join(import.meta.dir,"..","runtime",`${r}.ts`),D.join(import.meta.dir,"..","runtime",`${r}.js`),D.join(import.meta.dir,"native","runtime",`${r}.js`)].find((i)=>jt(i));if(!t)throw Error(`Native runtime module ${r} is missing`);return t}async function Ut(r,e,t){let i=await Bun.build({entrypoints:[r],target:"browser",format:"iife",minify:t,plugins:e,define:{"process.env.NODE_ENV":JSON.stringify(t?"production":"development")}});if(!i.success){let s=i.logs.map((a)=>String(a.message??a)).join(`
|
|
5
|
+
`);throw Error(`Could not bundle ${r}:
|
|
6
|
+
${s}`)}return(await i.outputs[0].text()).trim()}async function ce(r){let e=Object.keys(r.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let t=r.routed??!0,i=r.initialScreen??e[0];if(!r.screens[i])throw Error(`Initial screen ${i} is not in screens`);let s=D.resolve(r.root??process.cwd()),a=[];for(let f of e){let w=D.resolve(s,r.screens[f]);if(!w.endsWith(".stx"))throw Error(`Screen ${f} must name a .stx file`);a.push({name:f,file:w,compiled:await Y(w,{root:s})})}let l=Ge("jsc-globals"),u=Ge("shared-screen"),d=t?`var routeName = g.__stxNativeRoute || ${JSON.stringify(i)};
|
|
7
|
+
if (routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));`:"var routeName = 'main';",m=a.map(({name:f,compiled:w},T)=>`${T===0?"if":"else if"} (routeName === ${JSON.stringify(t?f:"main")}) {
|
|
8
|
+
nativeDocument = ${JSON.stringify(w.document)};
|
|
9
|
+
manifest = ${JSON.stringify(w.manifest)};
|
|
10
|
+
}`).join(`
|
|
11
|
+
`),p=a.map(({name:f,compiled:w},T)=>`${T===0?"if":"else if"} (routeName === ${JSON.stringify(t?f:"main")}) {
|
|
12
|
+
${w.setup?.code??"g.__stx_latestSetup = null;"}
|
|
13
|
+
}`).join(`
|
|
14
|
+
`),c=`
|
|
15
|
+
import { installJSCGlobals } from ${JSON.stringify(l)};
|
|
16
|
+
import { prepareSharedNativeScreen } from ${JSON.stringify(u)};
|
|
17
|
+
var g = globalThis;
|
|
18
|
+
installJSCGlobals(g);
|
|
19
|
+
var bridge = g.__stxNativeBridge;
|
|
20
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
21
|
+
var routeNames = ${JSON.stringify(t?e:["main"])};
|
|
22
|
+
${d}
|
|
23
|
+
g.__stxNativeRoute = routeName;
|
|
24
|
+
var nativeDocument;
|
|
25
|
+
var manifest;
|
|
26
|
+
${m}
|
|
27
|
+
var screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
28
|
+
g.__stx_host = screen.host;
|
|
29
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
30
|
+
${Ie()}
|
|
31
|
+
${p}
|
|
32
|
+
screen.mount(g.stx, g.__stx_latestSetup || null);
|
|
33
|
+
`,b=await Ut("stx:native-shared-screens",[{name:"stx-native-shared-screens",setup(f){f.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),f.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:c,loader:"js"}))}}],r.minify??!1),x=a.flatMap(({compiled:f})=>f.diagnostics).map((f)=>({level:"warning",message:[f.kind,f.tag,f.name].filter(Boolean).join(": ")}));if(!r.outFile)return{code:b,diagnostics:x};let S=D.resolve(s,r.outFile);return Gt(D.dirname(S),{recursive:!0}),await Bun.write(S,b),{code:b,outFile:S,diagnostics:x}}async function Ht(r,e={}){return ce({...e,screens:{main:r},routed:!1})}function Ue(r,e={}){return Ht(r,e)}var He=["native.config.json","stx-native.config.json"];function Jt(r=process.cwd(),e){let t=e?P.resolve(r,e):He.map((u)=>P.join(r,u)).find((u)=>le(u));if(!t)return null;if(!le(t))throw Error(`Native config not found: ${t}`);let i=JSON.parse(Yt(t,"utf8")),s=Object.entries(i.screens??{});if(s.length===0)throw Error(`${P.basename(t)} must name at least one screen in "screens"`);let a={};for(let[u,d]of s){if(!/^[A-Z][\w-]*$/i.test(u))throw Error(`Invalid native screen name: ${u}`);if(typeof d!=="string"||!d.endsWith(".stx"))throw Error(`Screen ${u} must name a .stx file`);if(a[u]=P.resolve(P.dirname(t),d),!le(a[u]))throw Error(`Screen ${u} not found: ${a[u]}`)}let l=i.initialScreen||s[0][0];if(!a[l])throw Error(`Initial screen ${l} is not in screens`);return{initialScreen:l,screens:a,file:t}}async function An(r,e={}){let t=P.resolve(e.cwd??process.cwd()),i=e.format??"ir";if(i!=="ir"&&i!=="bundle")throw Error(`Unknown compile format: ${i}. Expected ir or bundle.`);let s=r?null:Jt(t,e.config);if(!r&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${He[0]}`);let a,l=[];if(i==="bundle"){let d=s?await ce({screens:s.screens,initialScreen:s.initialScreen,minify:e.minify,root:t}):await Ue(P.resolve(t,r),{minify:e.minify});a=d.code,l=d.diagnostics}else{let d=async(p)=>{let c=await Y(p);return l.push(...c.diagnostics.map((h)=>({level:"warning",message:[h.kind,h.tag,h.name].filter(Boolean).join(": ")}))),c.document},m=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([p,c])=>[p,await d(c)])))}:await d(P.resolve(t,r));a=JSON.stringify(m,null,2)}if(!e.output)return{output:a,diagnostics:l};let u=P.resolve(t,e.output);return qt(P.dirname(u),{recursive:!0}),await Bun.write(u,a),{output:a,written:u,diagnostics:l}}export{An as runNativeCompile};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{b,
|
|
2
|
+
import{b,d,n,g,I}from"./chunk-cetdwrqh.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function eu(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=z(c),u=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let k=c.slice(v,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((k)=>setTimeout(k,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let h=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
|
-
</div>`),h.set(
|
|
4
|
+
</div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
|
|
5
5
|
<script>
|
|
6
6
|
(function() {
|
|
7
7
|
window.__stxSuspense = window.__stxSuspense || {
|
|
@@ -17,7 +17,7 @@ import{b,u,n,g,I}from"./chunk-xts31rkc.js";import q from"path";var M={enabled:!0
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
-
</script>`);let S=Array.from(h.entries()).map(async([
|
|
20
|
+
</script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await bo(l,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function bo(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
|
|
21
21
|
<script>
|
|
22
22
|
window.__stxSuspense.resolve('${e}', \`${s}\`);
|
|
23
23
|
</script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
|
|
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
|
-
</script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function
|
|
46
|
+
</script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function tu(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ta),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await bo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function nu(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function ru(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function su(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let S=await n(c,y,e,s,E);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function ou(e,t={}){let o={...I,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...R,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ra={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Aa={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
|
|
47
47
|
${c}
|
|
48
48
|
<script type="application/json" data-island-props="${a}">
|
|
49
49
|
${m?`{${m}}`:"{}"}
|
|
50
50
|
</script>
|
|
51
|
-
</div>`}};function
|
|
51
|
+
</div>`}};function iu(e={}){let t=[];if(e.streaming?.enabled)t.push(Ra);if(e.hydration?.enabled)t.push(Aa);return t}async function au(e,t,o,s={}){return e}function cu(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function lu(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
|
|
52
52
|
`);if(t==="loader")return`
|
|
53
53
|
(function() {
|
|
54
54
|
window.__stx = window.__stx || {};
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{
|
|
194
|
+
export{eu,bo,Ta,tu,nu,ru,su,ou,Ra,Aa,iu,au,cu,lu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wi,to,Xc,qi,Ki,Gc,Jc}from"./chunk-eqf8985n.js";import"./chunk-vt5k0j68.js";import"./chunk-0ax9kmf8.js";import"./chunk-5tgctj1p.js";import"./chunk-8scw1bes.js";import{ze,sc}from"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{Wi as buildVirtualSource,ze as extractScriptBlocks,sc as extractTemplateExpressions,qi as findRuntimeTypeDeclarations,Ki as findStxModuleDeclarations,Jc as formatTypecheckDiagnostics,Xc as sourcePathFor,Gc as typecheckStxFiles,to as virtualPathFor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Du,Uo,Ou,Wo,Qa,ec,xt,nn,Mu,tc,nc,rc,f}from"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{xt as buildCss,tc as extractClassNames,ec as fingerprintConfig,nc as generateCss,Mu as getCachedCSS,Du as getCssServeAsset,f as injectCss,Uo as loadCssEngine,Wo as loadCssEngineConfig,nn as rebuildCss,Ou as resetCssCache,Qa as resolveUserCssConfig,rc as withLinkedModuleBundles};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import a from"fs";function Pe(r){return o(r)}var g=1000,i=new Map;function Ut(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
|
|
3
|
-
`)}function
|
|
4
|
-
export{Pe,Ut,
|
|
3
|
+
`)}function dt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function H(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
|
|
4
|
+
export{Pe,Ut,dt,H};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,n}from"./chunk-
|
|
2
|
+
import{q,n}from"./chunk-cetdwrqh.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Uc}from"./chunk-h9afpxpp.js";import"./chunk-16h7wedx.js";import"./chunk-5tgctj1p.js";import"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{Uc as startProductionServer};
|
|
@@ -124,7 +124,7 @@ function mo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function ua(v,c){let l=null,u=()=>{if(!l)l=mo(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function da(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=ho(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -212,5 +212,5 @@ function mo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var Sl={createVirtualList:mo,processVirtualListDirectives:ho,processInfiniteListDirectives:
|
|
216
|
-
export{mo,ho,la,da,
|
|
215
|
+
`})}var Sl={createVirtualList:mo,processVirtualListDirectives:ho,processInfiniteListDirectives:da,processVirtualGridDirectives:pa,generateVirtualListCSS:la,useVirtualList:ua};
|
|
216
|
+
export{mo,ho,la,ua,da,pa,Sl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ct,lc,uc,dc,pc,fc,d,gc,us,mc,si,oi}from"./chunk-cetdwrqh.js";import"./chunk-8adstrk5.js";import"./chunk-wkc34drs.js";import"./chunk-j4afmryj.js";import"./chunk-f6kwahhn.js";import"./chunk-99kt56fn.js";import"./chunk-s10r6hxp.js";import"./chunk-tbef3yyk.js";import"./chunk-ab7vh24b.js";import"./chunk-pf0d8y9n.js";import"./chunk-01nx6zcw.js";import"./chunk-9ztdvnkk.js";import"./chunk-pcq6vphz.js";export{Ct as STX_ENGINE_BINDING_NAMES,us as convertToCommonJS,si as extractScriptFromTemplate,d as extractVariables,oi as hasVariables,gc as isCompleteImport,fc as isMissingBindingFailure,dc as isModuleResolutionFailure,pc as isSyntaxFailure,mc as splitDeclaration,lc as stripTypeScript,uc as withoutStxReferrer};
|