@stacksjs/stx 0.2.588 → 0.2.589
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-s043hpvd.js → chunk-04gt67sv.js} +1 -1
- package/dist/chunk-122y2fkw.js +3 -0
- package/dist/chunk-138zjhwa.js +2 -0
- package/dist/{chunk-751b5zv9.js → chunk-14t0wps0.js} +1 -1
- package/dist/{chunk-03qf2z4d.js → chunk-18ws9heh.js} +1 -1
- package/dist/{chunk-33q5zka4.js → chunk-1944jgb2.js} +1 -1
- package/dist/{chunk-tc15vkfh.js → chunk-25zpd110.js} +2 -2
- package/dist/{chunk-emxa2djv.js → chunk-2qt63502.js} +1 -1
- package/dist/{chunk-qhr1tkhj.js → chunk-38mt83wa.js} +6 -6
- package/dist/chunk-3bx12g3y.js +2 -0
- package/dist/{chunk-j8v5164e.js → chunk-3q312svf.js} +1 -1
- package/dist/chunk-3vcvsc17.js +2 -0
- package/dist/{chunk-k1szsenr.js → chunk-48s1nprc.js} +2 -2
- package/dist/{chunk-qf3axv86.js → chunk-4st1qw62.js} +2 -2
- package/dist/chunk-55bmmwtx.js +2 -0
- package/dist/{chunk-cqr5cv7h.js → chunk-5rs5jnqk.js} +5 -5
- package/dist/chunk-64xcx3y4.js +2 -0
- package/dist/{chunk-y5x8xnnf.js → chunk-6eg9a3mt.js} +2 -2
- package/dist/{chunk-3qmx12d3.js → chunk-6qnemg0e.js} +298 -298
- package/dist/{chunk-ww28zfwt.js → chunk-7b0svfg0.js} +1 -1
- package/dist/chunk-7frsbxzd.js +2 -0
- package/dist/chunk-7nr3f2bw.js +2 -0
- package/dist/chunk-83rmpb0b.js +2 -0
- package/dist/chunk-88mj71mb.js +2 -0
- package/dist/{chunk-9qsnq026.js → chunk-9cgga2aw.js} +2 -2
- package/dist/{chunk-45x4myqe.js → chunk-9e49fnj9.js} +2 -2
- package/dist/{chunk-f29fk7dw.js → chunk-9h1ytsgm.js} +2 -2
- package/dist/{chunk-jtx74677.js → chunk-9q079ttt.js} +1 -1
- package/dist/chunk-9t6gzmze.js +2 -0
- package/dist/{chunk-vf15db1j.js → chunk-9wtb959p.js} +5 -5
- package/dist/{chunk-794v5crp.js → chunk-9x4r15mv.js} +2 -2
- package/dist/{chunk-pxw4edw8.js → chunk-a7crvy3b.js} +2 -2
- package/dist/chunk-acm2tym9.js +2 -0
- package/dist/{chunk-c6egfhy6.js → chunk-b3c1gggs.js} +2 -2
- package/dist/chunk-bd5gxtt2.js +2 -0
- package/dist/chunk-bepj7q9j.js +2 -0
- package/dist/{chunk-t212h9zm.js → chunk-cxhqps9m.js} +1 -1
- package/dist/chunk-d81h4mxd.js +2 -0
- package/dist/{chunk-b217d16p.js → chunk-dbp1sj5f.js} +36 -36
- package/dist/chunk-dgtxj56t.js +3 -0
- package/dist/chunk-ds66kaac.js +127 -0
- package/dist/chunk-emx9v5z8.js +2 -0
- package/dist/chunk-eqa0wdv9.js +4 -0
- package/dist/{chunk-haag5n42.js → chunk-f17rcvdb.js} +1 -1
- package/dist/chunk-ffykng6w.js +2 -0
- package/dist/{chunk-076h7nb9.js → chunk-fjw3sn55.js} +5 -5
- package/dist/chunk-fn9gdw2x.js +2 -0
- package/dist/{chunk-bhg4pvtn.js → chunk-frm8k9gj.js} +1 -1
- package/dist/chunk-fwt5fh5w.js +2 -0
- package/dist/{chunk-m7ddgrsm.js → chunk-g6ew2drc.js} +4 -4
- package/dist/{chunk-6cg03r93.js → chunk-g7fjra7a.js} +4 -4
- package/dist/{chunk-03xsf9jm.js → chunk-gh181dnr.js} +8 -8
- package/dist/{chunk-6hgngmn0.js → chunk-gzpxvca7.js} +1 -1
- package/dist/{chunk-d0tmc6v5.js → chunk-h9gbsgrt.js} +1 -1
- package/dist/{chunk-qx0tcsdm.js → chunk-hhcmn37g.js} +3 -3
- package/dist/chunk-hhwnd24n.js +2 -0
- package/dist/chunk-hq4mtcp0.js +2 -0
- package/dist/{chunk-7fghm9zy.js → chunk-j1dmkt29.js} +1 -1
- package/dist/chunk-jhswy523.js +2 -0
- package/dist/{chunk-mmbspaqh.js → chunk-jtq8e3b0.js} +2 -2
- package/dist/chunk-jyqanvwp.js +2 -0
- package/dist/chunk-k6bmhf83.js +2 -0
- package/dist/{chunk-3ybbat49.js → chunk-khdvzjzd.js} +1 -1
- package/dist/{chunk-q03kn4d1.js → chunk-krvaknk7.js} +1 -1
- package/dist/{chunk-30acme5g.js → chunk-kx52xt96.js} +2 -2
- package/dist/chunk-m0ngddr1.js +2 -0
- package/dist/{chunk-yhhfxx17.js → chunk-mkmgy50k.js} +4 -4
- package/dist/chunk-n06xznty.js +2 -0
- package/dist/{chunk-048eyjyj.js → chunk-nb0ytx70.js} +2 -2
- package/dist/chunk-nft0k8sy.js +2 -0
- package/dist/{chunk-wkrf41se.js → chunk-nmfnstjg.js} +1 -1
- package/dist/chunk-p69ay3bg.js +2 -0
- package/dist/{chunk-hj8tr9g0.js → chunk-p9yqetnj.js} +1 -1
- package/dist/{chunk-07869zev.js → chunk-pb7vste8.js} +3 -3
- package/dist/chunk-pbvtyw5h.js +2 -0
- package/dist/{chunk-a30mtx17.js → chunk-ph2hzxz7.js} +2 -2
- package/dist/chunk-pq9yr5f5.js +2 -0
- package/dist/chunk-q5rqp7rm.js +2 -0
- package/dist/{chunk-cy07dhqh.js → chunk-q66ry997.js} +2 -2
- package/dist/{chunk-pg164sdw.js → chunk-q6h6yjg4.js} +2 -2
- package/dist/{chunk-91pdg853.js → chunk-qf39z0hg.js} +3 -3
- package/dist/chunk-qhy84exn.js +2 -0
- package/dist/chunk-san161h4.js +2 -0
- package/dist/{chunk-7ydavm3h.js → chunk-shnsvsg4.js} +2 -2
- package/dist/{chunk-kfhghjh6.js → chunk-shnvs7x9.js} +2 -2
- package/dist/{chunk-s2h601k7.js → chunk-sjehpstn.js} +7 -7
- package/dist/{chunk-w24qmxc3.js → chunk-t19th11m.js} +1 -1
- package/dist/{chunk-awgvt956.js → chunk-tc3ne706.js} +9 -9
- package/dist/chunk-td7a6wwq.js +2 -0
- package/dist/{chunk-3y5tzxm6.js → chunk-tds3d65g.js} +2 -2
- package/dist/{chunk-mnnxa3r7.js → chunk-vhgdz0qf.js} +2 -2
- package/dist/{chunk-j7kcjgxy.js → chunk-vn6h03nq.js} +68 -40
- package/dist/chunk-w3k1r8r5.js +2 -0
- package/dist/{chunk-e556dvy4.js → chunk-wkxzzdzs.js} +2 -2
- package/dist/{chunk-ns1jqzqk.js → chunk-wr6gw263.js} +1 -1
- package/dist/chunk-wrp7m33d.js +2 -0
- package/dist/{chunk-7xw1e8t6.js → chunk-y0qjpcc8.js} +3 -3
- package/dist/chunk-y3g9jaa4.js +2 -0
- package/dist/{chunk-fkq55rh7.js → chunk-y3wdf7v7.js} +1 -1
- package/dist/chunk-y6909jm7.js +2 -0
- package/dist/{chunk-ede39b7h.js → chunk-zvs13kgh.js} +2 -2
- package/dist/cli.js +14 -14
- package/dist/client/signals-component-hydration-runtime.js +57 -29
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/dev-server/ts-css.js +7 -2
- package/dist/native/compiler/app-theme.d.ts +9 -0
- package/dist/native/compiler/app-theme.js +51 -0
- package/dist/native/compiler/bundle.js +7 -3
- package/dist/native/compiler/headwind-to-style.d.ts +6 -0
- package/dist/native/compiler/headwind-to-style.js +7 -0
- package/dist/native/compiler/html-to-ir.js +7 -1
- package/dist/native/compiler/render-screen.js +2 -1
- package/dist/native/ui.d.ts +90 -0
- package/dist/native/ui.js +37 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +10 -10
- package/dist/theme-tokens.d.ts +38 -3
- package/dist/theme-tokens.js +18 -6
- package/dist/ts-css-config.d.ts +1 -0
- package/dist/ts-css-config.js +4 -3
- package/package.json +5 -5
- package/dist/chunk-11jmasqb.js +0 -2
- package/dist/chunk-2wx2aczp.js +0 -2
- package/dist/chunk-4dpab4j6.js +0 -2
- package/dist/chunk-4vnwge6p.js +0 -2
- package/dist/chunk-4w37cqg9.js +0 -2
- package/dist/chunk-51pz8cwa.js +0 -2
- package/dist/chunk-65agttgm.js +0 -2
- package/dist/chunk-7ae40484.js +0 -2
- package/dist/chunk-7dtyf7hq.js +0 -2
- package/dist/chunk-7ebt9n43.js +0 -4
- package/dist/chunk-80g8kaes.js +0 -2
- package/dist/chunk-9pk5jhqa.js +0 -3
- package/dist/chunk-a3d5g1ss.js +0 -122
- package/dist/chunk-a3k4nfq2.js +0 -2
- package/dist/chunk-c8fdccgp.js +0 -2
- package/dist/chunk-cw76edds.js +0 -2
- package/dist/chunk-czrs87r9.js +0 -2
- package/dist/chunk-d9vjsqs4.js +0 -2
- package/dist/chunk-ddgyj88h.js +0 -2
- package/dist/chunk-dj90w48e.js +0 -2
- package/dist/chunk-dngzks8e.js +0 -2
- package/dist/chunk-eztvhppz.js +0 -2
- package/dist/chunk-h2534p6q.js +0 -2
- package/dist/chunk-h9gtc6bk.js +0 -2
- package/dist/chunk-hwnvfke9.js +0 -2
- package/dist/chunk-hygxh993.js +0 -2
- package/dist/chunk-jqy5q8m0.js +0 -2
- package/dist/chunk-jy7yzat1.js +0 -2
- package/dist/chunk-n7yk4nc1.js +0 -2
- package/dist/chunk-qd4snptd.js +0 -2
- package/dist/chunk-r90v2jz6.js +0 -2
- package/dist/chunk-rtgf9fgc.js +0 -2
- package/dist/chunk-sjkdpsca.js +0 -3
- package/dist/chunk-sqpme1hg.js +0 -2
- package/dist/chunk-thydj877.js +0 -2
- package/dist/chunk-vv1kr9dn.js +0 -2
- package/dist/chunk-wm9nzg76.js +0 -2
- package/dist/chunk-x5qymgxa.js +0 -2
- package/dist/chunk-xnbkyj4g.js +0 -2
- package/dist/chunk-xyepqdjy.js +0 -2
- package/dist/chunk-y93y2qat.js +0 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"path";var Lt=".stx",o="STX_DIR",e=null;function zi(t){e=t?.trim()||null}function kn(){return process.env[o]?.trim()||e||Lt}function a(t=process.cwd(),...n){let r=kn();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function Cn(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==Lt&&!n.startsWith(`${Lt}/`))return t;let r=n.slice(Lt.length+1);return r?i.join(kn(),r):kn()}
|
|
3
|
+
export{Lt,zi,kn,a,Cn};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-38mt83wa.js";import"./chunk-v8ze2q95.js";import"./chunk-a7crvy3b.js";import{Cr,eo,ra}from"./chunk-b3c1gggs.js";import"./chunk-jtq8e3b0.js";import{qe,ke,te,Ot,de,bn,vn,Ce,ar,n,o}from"./chunk-6qnemg0e.js";import"./chunk-gh181dnr.js";import"./chunk-qf39z0hg.js";import"./chunk-48s1nprc.js";import"./chunk-9e49fnj9.js";import"./chunk-82bttwqm.js";import"./chunk-k71e38fk.js";import{Fe}from"./chunk-vn6h03nq.js";import"./chunk-tds3d65g.js";import"./chunk-mkmgy50k.js";import{is}from"./chunk-5rs5jnqk.js";import"./chunk-t19th11m.js";import{existsSync as ue,mkdirSync as sr,readFileSync as or}from"fs";import X from"path";import{existsSync as De,mkdirSync as _t,realpathSync as Jn,rmSync as At}from"fs";import C from"path";import{existsSync as Hn}from"fs";import ee from"path";var Mt="data-stx-b",je=new Set(eo),Bt=new Set(Cr);function Dt(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(je.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(ra(e))return"event";if(r.startsWith("@"))return"event";return"attr"}if(r.startsWith("x-")){let e=r.split(".")[0];if(!Bt.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 je.has(t)?t==="if"?"if":t:"attr"}return null}function Lt(r){let e=[];for(let[t,i]of r){let s=Dt(t);if(s)e.push({name:t,value:i,kind:s})}return e}var Vt=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,ge=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function We(r){let e=[],t=0;return{html:r.replace(Vt,(s,a,l)=>{if(!l||!/[:@]|x-/.test(l))return s;let d=[];ge.lastIndex=0;for(let b=ge.exec(l);b;b=ge.exec(l))d.push([b[1],b[2]??b[3]??b[4]??""]);let u=Lt(d);if(!u.length)return s;let h={id:t++,bindings:u};if(u.some((b)=>b.kind==="for"))h.template=!0;e.push(h);let v=s.endsWith("/>");return`${s.slice(0,v?-2:-1).trimEnd()} ${Mt}="${h.id}"${v?"/>":">"}`}),manifest:{entries:e}}}import un from"path";function re(r){let e=r&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(r.trim());if(!e)return;let t=Number(e[1])*(e[2]==="rem"?16:1);return Number.isFinite(t)?t:void 0}function he(r,e){if(!te[r])return;return re(e?.get(Ot(r))??te[r].value)}function me(r,e){let t=bn[r];if(!t)return;return re(e?.get(Ce(t))??de[t]?.value)}function ye(r,e){let t=vn[r];if(!t)return;let i=re(e?.get(Ce(t.size))??de[t.size]?.value),s=re(e?.get(Ce(t.leading))??de[t.leading]?.value);if(i===void 0||s===void 0)return;return{fontSize:i,lineHeight:s}}var $t={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"}},Ue={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},Xe={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},ze={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function q(r){let e=r.lastIndexOf("/");if(e>0&&!r.endsWith("]")){let i=q(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 Ft(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=$t[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 ve(r){return q(r.trim())}function Ft(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 be(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 P(r){if(r.startsWith("[")&&r.endsWith("]")){let e=r.slice(1,-1);if(e.endsWith("%"))return;let t=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(t)?t:void 0}return Ue[r]??me(r)}function ie(r){let e=/^\[(-?\d*\.?\d+)%\]$/.exec(r);if(e)return`${Number.parseFloat(e[1])}%`;return P(r)}var jt={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),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-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 Wt(r,e){if(!r.startsWith("bg-"))return!1;let t=r.slice(3),i=q(t);if(i)return e.backgroundColor=i,!0;return!1}function Xt(r,e){if(!r.startsWith("text-"))return!1;let t=r.slice(5),i=ye(t);if(i)return Object.assign(e,i),!0;if(Xe[t])return e.fontSize=Xe[t],!0;if(t.startsWith("[")&&t.endsWith("]")){let a=t.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(a)){let l=a.endsWith("rem")||a.endsWith("em")?Number.parseFloat(a)*16:Number.parseFloat(a);if(Number.isFinite(l))return e.fontSize=l,!0}}let s=q(t);if(s)return e.color=s,!0;return!1}var zt=new Set(["t","tr","r","br","b","bl","l","tl"]);function Ht(r,e){let t=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(r);if(t&&zt.has(t[1]))return e.gradientDirection=`to-${t[1]}`,!0;let i=/^(from|via|to)-(.+)$/.exec(r);if(!i)return!1;let s=q(i[2]);if(!s)return!1;if(i[1]==="from")e.gradientFrom=s;else if(i[1]==="via")e.gradientVia=s;else e.gradientTo=s;return!0}function Ut(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=q(s);if(a)return e[t]=a,!0}return!1}function qt(r,e){if(r.startsWith("p-")){let t=P(r.slice(2));if(t!==void 0)return e.padding=t,!0}if(r.startsWith("px-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingHorizontal=t,!0}if(r.startsWith("py-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingVertical=t,!0}if(r.startsWith("pt-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingTop=t,!0}if(r.startsWith("pr-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingRight=t,!0}if(r.startsWith("pb-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingBottom=t,!0}if(r.startsWith("pl-")){let t=P(r.slice(3));if(t!==void 0)return e.paddingLeft=t,!0}return!1}function Ge(r,e){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(r)){let t={};if(!Ge(r.slice(1),t))return!1;let i=Object.entries(t);if(i.some(([,s])=>typeof s!=="number"))return!1;for(let[s,a]of i)e[s]=-a;return!0}if(r.startsWith("m-")){let t=P(r.slice(2));if(t!==void 0)return e.margin=t,!0}if(r.startsWith("mx-")){let t=P(r.slice(3));if(t!==void 0)return e.marginHorizontal=t,!0}if(r.startsWith("my-")){let t=P(r.slice(3));if(t!==void 0)return e.marginVertical=t,!0}if(r.startsWith("mt-")){let t=P(r.slice(3));if(t!==void 0)return e.marginTop=t,!0}if(r.startsWith("mr-")){let t=P(r.slice(3));if(t!==void 0)return e.marginRight=t,!0}if(r.startsWith("mb-")){let t=P(r.slice(3));if(t!==void 0)return e.marginBottom=t,!0}if(r.startsWith("ml-")){let t=P(r.slice(3));if(t!==void 0)return e.marginLeft=t,!0}return!1}function Gt(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=ie(t);if(i!==void 0)return e.width=i,!0;return!1}function Jt(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=ie(t);if(i!==void 0)return e.height=i,!0;return!1}function Kt(r,e){if(r==="rounded")return e.borderRadius=ze.DEFAULT,!0;if(!r.startsWith("rounded-"))return!1;let t=r.slice(8);if(t==="")return!1;let i=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(t),s=ze[i[2]]??he(i[2])??be(i[2]);if(s===void 0)return!1;let a={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],tl:["borderTopLeftRadius"],tr:["borderTopRightRadius"],bl:["borderBottomLeftRadius"],br:["borderBottomRightRadius"]};for(let l of i[1]?a[i[1]]:["borderRadius"])e[l]=s;return!0}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 Qt(r,e){if(!r.startsWith("border-"))return!1;let t=r.slice(7),i=q(t);if(i)return e.borderColor=i,!0;return!1}function Zt(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 en(r,e){if(r.startsWith("tracking-[")){let t=be(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:be(t,i):s[t]!==void 0?s[t]*i:Ue[t];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function tn(r,e){let t=/^grid-cols-(\d+)$/.exec(r);if(!t)return!1;return e.gridColumns=Number(t[1]),!0}function nn(r,e){if(!r.startsWith("size-"))return!1;let t=r.slice(5),i=t==="full"?"100%":ie(t);if(i===void 0)return!1;return e.width=i,e.height=i,!0}var rn={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function sn(r,e){let t=/^(min|max)-(w|h)-(.+)$/.exec(r);if(!t)return!1;let[,i,s,a]=t,l=a==="full"||a==="screen"?"100%":a==="none"?void 0:s==="w"&&i==="max"&&rn[a]||ie(a);if(l===void 0&&a!=="none")return!1;let d=`${i}${s==="w"?"Width":"Height"}`;if(l===void 0)delete e[d];else e[d]=l;return!0}function on(r,e){let t=/^(-?)(top|right|bottom|left)-(.+)$/.exec(r);if(!t)return!1;let i=t[3]==="full"?"100%":P(t[3]);if(i===void 0)return!1;return e[t[2]]=typeof i==="number"&&t[1]?-i:i,!0}function an(r,e){let t=/^(-?)translate-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=t[3],s;if(i.startsWith("[")){let d=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(i);if(!d)return!1;s=Number(d[1])*(d[2]?.endsWith("em")?16:1)}else s=P(i);if(s===void 0||!Number.isFinite(s))return!1;if(t[1])s=-s;let a=t[2]==="x"?"translateX":"translateY",l=a==="translateX"?{translateX:s}:{translateY:s};return e.transform=[...(e.transform??[]).filter((d)=>!(a in d)),l],!0}function cn(r,e){let t=/^space-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=P(t[2]);if(i===void 0)return!1;return e.gap=i,!0}function ln(r,e){if(r.startsWith("gap-")){let t=P(r.slice(4));if(t!==void 0)return e.gap=t,!0}if(r.startsWith("gap-x-")){let t=P(r.slice(6));if(t!==void 0)return e.columnGap=t,!0}if(r.startsWith("gap-y-")){let t=P(r.slice(6));if(t!==void 0)return e.rowGap=t,!0}return!1}function dn(r,e){let i={"shadow-none":[0,0,0,0],"shadow-xs":[1,1,0.05,1],"shadow-sm":[2,1,0.1,2],shadow:[3,2,0.12,3],"shadow-md":[6,4,0.15,4],"shadow-lg":[10,6,0.18,8],"shadow-xl":[16,10,0.2,12],"shadow-2xl":[24,16,0.25,18]}[r];if(!i)return!1;let[s,a,l,d]=i;return Object.assign(e,{shadowColor:"#000000",shadowOpacity:l,shadowRadius:s,shadowOffset:{width:0,height:a},elevation:d}),!0}function se(r,e){let t=[],i=[],s=[],a=[],l=new Map;function d(c,m){let f=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(c),g=f&&qe[f[2]];if(g){let p=e?.get(ke(f[2]));return[`${f[1]}-${p===void 0?g[m]:`[${p}]`}${f[3]||""}`]}let S=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(c);if(S&&te[S[2]]){let p=he(S[2],e);return p===void 0?void 0:[`rounded-${S[1]?`${S[1]}-`:""}[${p}px]`]}let x=c.startsWith("text-")?c.slice(5):"";if(vn[x]){let p=ye(x,e);return p&&[`text-[${p.fontSize}px]`,`leading-[${p.lineHeight}px]`]}for(let p of Object.keys(bn)){if(!c.endsWith(`-${p}`))continue;let w=me(p,e);return w===void 0?void 0:[`${c.slice(0,-p.length)}[${w}px]`]}return[c]}function u(c,m){if(!l.has(c))l.set(c,new Set);return l.get(c).add(m),c}for(let c of r.split(/\s+/).filter(Boolean))if(c.startsWith("dark:")){let m=d(c.slice(5),"dark");if(!m)a.push(c);else i.push(...m.map((f)=>u(f,c)))}else if(!c.includes(":")||c.startsWith("[")){let m=d(c,"light"),f=d(c,"dark");if(!m||!f){a.push(c);continue}if(t.push(...m.map((g)=>u(g,c))),f.join(" ")!==m.join(" "))s.push(...f.map((g)=>u(g,c)))}else a.push(c);let h=[],v=He(t,h),y={style:v,unknown:h};if(i.length||s.length)y.dark=He([...s,...i],h);if(v.transform&&y.dark?.transform){let c=new Set(y.dark.transform.flatMap((m)=>Object.keys(m)));y.dark.transform=[...v.transform.filter((m)=>!Object.keys(m).some((f)=>c.has(f))),...y.dark.transform]}for(let c of t){if(c==="truncate")y.numberOfLines=1;let m=/^line-clamp-(\d+)$/.exec(c);if(m)y.numberOfLines=Number(m[1]);if(!y.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(c))y.icon=c}let b=h.flatMap((c)=>[...l.get(c)??[c]]);return y.unknown=[...new Set([...b.filter((c)=>!/^line-clamp-\d+$/.test(c)),...a])],y}function He(r,e){let t={},i=Array.isArray(r)?r:r.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=jt[s];if(a){a("",t);continue}if(dn(s,t))continue;if(Ht(s,t))continue;if(Wt(s,t))continue;if(Ut(s,t))continue;if(Xt(s,t))continue;if(qt(s,t))continue;if(Ge(s,t))continue;if(Gt(s,t))continue;if(Jt(s,t))continue;if(Kt(s,t))continue;if(Yt(s,t))continue;if(Qt(s,t))continue;if(Zt(s,t))continue;if(ln(s,t))continue;if(en(s,t))continue;if(nn(s,t))continue;if(sn(s,t))continue;if(tn(s,t))continue;if(on(s,t))continue;if(an(s,t))continue;if(cn(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}var Je=new Map;function Ke(r,e){if(!r)return;let t=r.trim(),i=t.lastIndexOf("-"),s=i===-1?e[t]:e[t.slice(0,i)],a=i===-1?s:s?.[t.slice(i+1)];if(typeof a==="string"&&/^#[\da-f]{3,8}$/i.test(a))return a;return ve(t)??ve(`[${t}]`)}function fn(r){let e=r.roles??{},t=r.shapes??{},i=r.density??{},s={...r.theme?.colors,...r.theme?.extend?.colors},a=[],l=[];for(let[d,u]of Object.entries(e)){if(!qe[d])continue;let h=Ke(typeof u==="string"?u:u?.light,s),v=Ke(typeof u==="string"?u:u?.dark,s);if(h)a.push(`${ke(d)}: ${h};`);if(v)l.push(`${ke(d)}: ${v};`)}for(let[d,u]of Object.entries(t))if(te[d])a.push(`${Ot(d)}: ${u};`);for(let[d,u]of Object.entries(i))if(de[d])a.push(`${Ce(d)}: ${u};`);return[a.length?`:root { ${a.join(" ")} }`:"",l.length?`.dark { ${l.join(" ")} }`:""].filter(Boolean).join(`
|
|
3
|
+
`)}async function pn(r){let{resolveUserCssConfig:e}=await import("./chunk-64xcx3y4.js"),t=await e(r);return t?fn(t):""}function Ye(r){let e=un.resolve(r),t=Je.get(e);if(!t)t=pn(e).catch(()=>""),Je.set(e,t);return t}var we={"region-change-complete":"onRegionChangeComplete",regionchangecomplete:"onRegionChangeComplete",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","scroll-begin-drag":"onScrollBeginDrag",scrollbegindrag:"onScrollBeginDrag","scroll-end-drag":"onScrollEndDrag",scrollenddrag:"onScrollEndDrag","momentum-scroll-begin":"onMomentumScrollBegin",momentumscrollbegin:"onMomentumScrollBegin","momentum-scroll-end":"onMomentumScrollEnd",momentumscrollend:"onMomentumScrollEnd",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",play:"onPlay",playing:"onPlay",pause:"onPause",ended:"onEnd",end:"onEnd",timeupdate:"onProgress",progress:"onProgress",loadedmetadata:"onLoad",enterpictureinpicture:"onPictureInPictureStart",leavepictureinpicture:"onPictureInPictureStop"};var Ze={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},Qe={alert:"alert",button:"button",checkbox:"checkbox",combobox:"combobox",header:"header",heading:"header",image:"image",img:"image",link:"link",menu:"menu",menubar:"menubar",menuitem:"menuitem",none:"none",presentation:"none",progressbar:"progressbar",radio:"radio",scrollbar:"scrollbar",search:"search",searchbox:"search",slider:"adjustable",spinbutton:"spinbutton",switch:"switch",tab:"tab",tablist:"tablist",timer:"timer",toolbar:"toolbar"};function et(r){return r==="role"||r==="aria-label"||r==="aria-valuetext"||r in Ze}function gn(r,e){if(e===void 0||e===null)return;let t=String(e).trim().toLowerCase();if(t==="mixed")return r==="aria-checked"?"mixed":!0;if(t==="undefined")return;return t===""||t==="true"}function hn(r){if(r===void 0||r===null)return null;for(let e of String(r).trim().toLowerCase().split(/\s+/))if(Qe[e])return Qe[e];return null}function tt(r,e,t){if(r==="aria-label")return{accessibilityLabel:e===void 0||e===null||e===""?null:String(e)};if(r==="aria-valuetext")return{accessibilityValue:e===void 0||e===null||e===""?null:String(e)};if(r==="role")return{accessibilityRole:hn(e)};let i=Ze[r];if(!i)return;let s=t.accessibilityState,a=s&&typeof s==="object"?{...s}:{},l=gn(r,e);if(l===void 0)delete a[i];else a[i]=l;return{accessibilityState:Object.keys(a).length?a:null}}function nt(r){let e=r.accessibilityState&&typeof r.accessibilityState==="object"?r.accessibilityState:void 0,t={};for(let[s,a]of Object.entries(r)){if(!et(s))continue;let l=tt(s,a,t);if(l)Object.assign(t,l)}for(let s of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(r[s]===void 0&&t[s]!==void 0&&t[s]!==null)r[s]=t[s];let i=t.accessibilityState;if(i)r.accessibilityState={...i,...e}}var xe={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText"},Ne=new Set(Object.values(xe));var st=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),ot=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight"];function M(r){let e=typeof r==="number"?r:Number.parseFloat(String(r??""));return Number.isFinite(e)?e:0}function J(r){return Math.round(r*1000)/1000}function Te(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 mn(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 rt=/[MLHVCSQTAZ]/i,Se=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function yn(r){let e=[],t=r,i=rt.exec(t);while(i){let s=i.index;t=t.slice(s);let a=t[0];t=t.slice(1);let l=rt.exec(t),d=l?t.slice(0,l.index):t,u;if(a==="A"||a==="a"){u=[];let h=0,v=d.trim(),y=0;while(y<v.length){let b=h%7,c=v.slice(y).replace(/^[\s,]+/,"");if(y=v.length-c.length,!c)break;if(b===3||b===4)u.push(c[0]==="1"?1:0),y+=1;else{Se.lastIndex=0;let m=Se.exec(c);if(!m||m.index!==0)break;u.push(Number.parseFloat(m[0])),y+=m[0].length}h++}}else u=(d.match(Se)||[]).map(Number.parseFloat);e.push({command:a,args:u}),i=l}return e}function wn(r,e,t,i,s,a,l,d,u){if(r===d&&e===u)return[];let h=Math.abs(t),v=Math.abs(i);if(!h||!v)return[1,d,u];let y=s*Math.PI/180,b=Math.cos(y),c=Math.sin(y),m=(r-d)/2,f=(e-u)/2,g=b*m+c*f,S=-c*m+b*f,x=g*g/(h*h)+S*S/(v*v);if(x>1)h*=Math.sqrt(x),v*=Math.sqrt(x);let p=h*h*v*v-h*h*S*S-v*v*g*g,w=h*h*S*S+v*v*g*g,A=Math.sqrt(Math.max(0,p/w));if(a===l)A=-A;let R=A*(h*S)/v,B=A*-(v*g)/h,k=b*R-c*B+(r+d)/2,E=c*R+b*B+(e+u)/2,N=(O,F,L,Y)=>{let fe=O*Y-F*L<0?-1:1,pe=(O*L+F*Y)/(Math.hypot(O,F)*Math.hypot(L,Y));return fe*Math.acos(Math.min(1,Math.max(-1,pe)))},D=N(1,0,(g-R)/h,(S-B)/v),_=N((g-R)/h,(S-B)/v,(-g-R)/h,(-S-B)/v);if(!l&&_>0)_-=2*Math.PI;if(l&&_<0)_+=2*Math.PI;let T=Math.max(1,Math.ceil(Math.abs(_)/(Math.PI/2))),j=_/T,I=1.3333333333333333*Math.tan(j/4),V=[],H=(O)=>{let F=h*Math.cos(O),L=v*Math.sin(O);return[b*F-c*L+k,c*F+b*L+E]},U=(O)=>{let F=-h*Math.sin(O),L=v*Math.cos(O);return[b*F-c*L,c*F+b*L]},W=D;for(let O=0;O<T;O++){let F=W+j,[L,Y]=H(W),[fe,pe]=U(W),[Ve,$e]=H(F),[Ct,Pt]=U(F);V.push(2,L+I*fe,Y+I*pe,Ve-I*Ct,$e-I*Pt,O===T-1?d:Ve,O===T-1?u:$e),W=F}return V}function Sn(r){let e=[],t=0,i=0,s=0,a=0,l=0,d=0,u=0,h=0,v="";for(let{command:y,args:b}of yn(String(r??""))){let c=y===y.toLowerCase(),m=y.toUpperCase(),f=()=>c?t:0,g=()=>c?i:0,S=0,x=(w)=>{if(S+w>b.length)return null;let A=b.slice(S,S+w);return S+=w,A};if(m==="Z"){e.push(4),t=s,i=a,v="Z";continue}let p=!0;while(S<b.length||p&&m==="Z"){switch(m){case"M":{let w=x(2);if(!w)return e;if(t=w[0]+f(),i=w[1]+g(),p)e.push(0,t,i),s=t,a=i;else e.push(1,t,i);v=p?"M":"L";break}case"L":{let w=x(2);if(!w)return e;t=w[0]+f(),i=w[1]+g(),e.push(1,t,i),v="L";break}case"H":{let w=x(1);if(!w)return e;t=w[0]+f(),e.push(1,t,i),v="L";break}case"V":{let w=x(1);if(!w)return e;i=w[0]+g(),e.push(1,t,i),v="L";break}case"C":{let w=x(6);if(!w)return e;let A=w[0]+f(),R=w[1]+g();l=w[2]+f(),d=w[3]+g(),t=w[4]+f(),i=w[5]+g(),e.push(2,A,R,l,d,t,i),v="C";break}case"S":{let w=x(4);if(!w)return e;let A=v==="C"?2*t-l:t,R=v==="C"?2*i-d:i;l=w[0]+f(),d=w[1]+g(),t=w[2]+f(),i=w[3]+g(),e.push(2,A,R,l,d,t,i),v="C";break}case"Q":{let w=x(4);if(!w)return e;u=w[0]+f(),h=w[1]+g(),t=w[2]+f(),i=w[3]+g(),e.push(3,u,h,t,i),v="Q";break}case"T":{let w=x(2);if(!w)return e;u=v==="Q"?2*t-u:t,h=v==="Q"?2*i-h:i,t=w[0]+f(),i=w[1]+g(),e.push(3,u,h,t,i),v="Q";break}case"A":{let w=x(7);if(!w)return e;let A=w[5]+f(),R=w[6]+g();e.push(...wn(t,i,w[0],w[1],w[2],w[3],w[4],A,R)),t=A,i=R,v="A";break}default:return e}p=!1}}return e.map((y)=>J(y))}function it(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(J)}function Re(r,e){switch(r){case"Path":return Sn(String(e.d??""));case"Line":return[0,M(e.x1),M(e.y1),1,M(e.x2),M(e.y2)].map(J);case"Rect":{let t=M(e.x),i=M(e.y),s=M(e.width),a=M(e.height);if(s<=0||a<=0)return[];let l=e.rx===void 0?M(e.ry):M(e.rx),d=e.ry===void 0?l:M(e.ry);if(l=Math.min(Math.max(0,l),s/2),d=Math.min(Math.max(0,d),a/2),!l||!d)return[0,t,i,1,t+s,i,1,t+s,i+a,1,t,i+a,4].map(J);let u=0.5522847498;return[0,t+l,i,1,t+s-l,i,2,t+s-l+u*l,i,t+s,i+d-u*d,t+s,i+d,1,t+s,i+a-d,2,t+s,i+a-d+u*d,t+s-l+u*l,i+a,t+s-l,i+a,1,t+l,i+a,2,t+l-u*l,i+a,t,i+a-d+u*d,t,i+a-d,1,t,i+d,2,t,i+d-u*d,t+l-u*l,i,t+l,i,4].map(J)}case"Circle":return it(M(e.cx),M(e.cy),M(e.r),M(e.r));case"Ellipse":return it(M(e.cx),M(e.cy),M(e.rx),M(e.ry));case"Polyline":case"Polygon":{let t=mn(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(J)}default:return null}}var xn=[...ot,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize","initialRegion","tileOverlay","edgePadding","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","mapType","strokeColor","pinColor","showsCompass","showsScale","cameraPitch","cameraHeading","autoScrollBottom","scrollKey","pictureInPicture","transitionID"],at=new Set(["animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","showsCompass","showsScale","pictureInPicture"]),Nn=new Map(xn.map((r)=>[ct(r),r]));function ct(r){return r.replace(/[-_]/g,"").toLowerCase()}function _e(r){return Nn.get(ct(r))??r}var kn={view:"View",sidebar:"Sidebar",splitview:"SplitView",textinput:"TextInput",pressable:"Pressable",icon:"Icon",text:"Text",button:"Button",image:"Image",img:"Image",video:"Video",map:"Map",mappolyline:"MapPolyline",mapmarker:"MapMarker",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",checkbox:"Checkbox",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 lt(r){return kn[r.toLowerCase()]||r}var Tn={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox",armchair:"sofa","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",backpack:"backpack","badge-check":"checkmark.seal","badge-x":"xmark.seal",ban:"nosign","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100","battery-charging":"battery.100.bolt",bed:"bed.double",bell:"bell","bell-off":"bell.slash","bell-ring":"bell.and.waves.left.and.right",bike:"figure.outdoor.cycle",blocks:"square.grid.2x2",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",box:"shippingbox",brain:"brain",building:"building","building-2":"building.2",cable:"cable.connector",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-minus":"calendar.badge.minus","calendar-minus-2":"calendar.badge.minus","calendar-off":"calendar.badge.exclamationmark","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath","calendar-x":"calendar.badge.exclamationmark","calendar-x-2":"calendar.badge.exclamationmark",camera:"camera","chart-bar":"chart.bar","chart-column":"chart.bar","chart-line":"chart.xyaxis.line","chart-no-axes-gantt":"chart.bar.doc.horizontal",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-arrow-out-up-left":"arrow.uturn.backward.circle","circle-minus":"minus.circle","circle-arrow-down":"arrow.down.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-dot":"smallcircle.filled.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","clock-12":"clock","clock-2":"clock","clock-3":"clock","clock-4":"clock","clock-8":"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",cylinder:"cylinder",disc:"opticaldisc",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","hand-fist":"hand.raised",heart:"heart","heart-off":"heart.slash","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",hourglass:"hourglass",house:"house","id-card":"person.text.rectangle",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-dashboard":"rectangle.3.group","layout-grid":"square.grid.2x2",leaf:"leaf",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",megaphone:"megaphone",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","music-2":"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","rectangle-horizontal":"rectangle","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","scan-line":"barcode.viewfinder",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",shuffle:"shuffle","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",sprout:"leaf",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront","stretch-horizontal":"rectangle.split.1x2",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","triangle-alert":"exclamationmark.triangle",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-check":"person.crop.circle.badge.checkmark","user-minus":"person.badge.minus","user-plus":"person.badge.plus","user-round":"person","user-round-check":"person.crop.circle.badge.checkmark","user-round-minus":"person.crop.circle.badge.minus","user-round-plus":"person.crop.circle.badge.plus","user-round-x":"person.crop.circle.badge.xmark","user-x":"person.crop.circle.badge.xmark",users:"person.2","users-round":"person.2",video:"video","volume-2":"speaker.wave.2",warehouse:"building.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 Ae(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=Tn[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=/^--[\w\u0080-\uFFFF-]+$/u;function dt(r,e){if(!/var\(/i.test(r))return r;let t="",i="",s=!1;for(let a=0;a<r.length;a++){let l=r[a];if(l==="\\"){t+=r.slice(a,a+2),a++;continue}if(i){if(t+=l,l===i)i="";continue}if(l==='"'||l==="'"){i=l,t+=l;continue}if(r.slice(a,a+4).toLowerCase()!=="var("||a>0&&/[\w-]/.test(r[a-1])){t+=l;continue}let d=1,u=-1,h="",v=a+4;for(;v<r.length;v++){let c=r[v];if(c==="\\"){v++;continue}if(h){if(c===h)h="";continue}if(c==='"'||c==="'"){h=c;continue}if(c==="(")d++;if(c===")"&&--d===0)break;if(c===","&&d===1&&u===-1)u=v}if(d!==0)return;let y=r.slice(a+4,u===-1?v:u).trim();if(!ut.test(y))return;let b=e(y,u===-1?void 0:r.slice(u+1,v).trim());if(b===void 0||t.length+b.length>65536)return;t+=b,s=!0,a=v}return s&&t.length>65536?void 0:t}function Q(r,e){let t=new Map,i=new Set;for(let[f,g]of r){let S=f.trim();if(!ut.test(S))continue;if(typeof g==="string"||typeof g==="number"&&Number.isFinite(g))t.set(S,String(g).trim())}let s=new Map,a=new Set;for(let[f,g]of t){let S=new Set,x=(p,w=0)=>w>64?void 0:dt(p,(A,R)=>(S.add(A),R===void 0?"":x(R,w+1)));if(x(g)===void 0)a.add(f);s.set(f,S)}let l=new Map,d=new Map,u=[],h=new Set,v=0;function y(f,g=0){if(g>64){a.add(f);return}l.set(f,v),d.set(f,v++),u.push(f),h.add(f);for(let p of s.get(f)??[]){if(!t.has(p))continue;if(!l.has(p)){if(y(p,g+1),d.has(p))d.set(f,Math.min(d.get(f),d.get(p)))}else if(h.has(p))d.set(f,Math.min(d.get(f),l.get(p)))}if(d.get(f)!==l.get(f))return;let S=[],x;do x=u.pop(),h.delete(x),S.push(x);while(x!==f);if(S.length>1||s.get(f)?.has(f))S.forEach((p)=>a.add(p))}for(let f of t.keys())if(!l.has(f))y(f);let b=new Map;function c(f,g){if(i.add(f),b.has(f))return b.get(f);let S=t.get(f),x=S===void 0||/^(?:inherit|unset)$/i.test(S)?e?.get(f):a.has(f)||/^(?:initial|revert|revert-layer)$/i.test(S)?void 0:m(S,g+1);return b.set(f,x),x}function m(f,g=0){if(g>64)return;return dt(f,(S,x)=>c(S,g)??(x===void 0?void 0:m(x,g+1)))}return{resolve:m,used:i,computed(){let f=new Map(e);for(let g of t.keys())f.set(g,c(g,0));return f}}}var ft=new Set(["display","gridColumns","gridTemplateColumns","gridTemplateRows","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","gradientDirection","gradientFrom","gradientVia","gradientTo"]),Rn=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"]),pt=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"]),_n=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,An=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,En=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),In=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function Cn(r){if(typeof r!=="string")return r;let e=An.exec(r);return e?Number(e[1])*(/^r?em$/i.test(e[2]||"")?16:1):r}function K(r){return typeof r==="number"&&Number.isFinite(r)}function Pn(r,e){if(r==="shadowOffset"&&e&&typeof e==="object"&&!Array.isArray(e)){let{width:t,height:i}=e;return K(t)&&K(i)?{width:t,height:i}:void 0}if(r==="transform"&&Array.isArray(e)){let t=[];for(let i of e){if(!i||typeof i!=="object"||Array.isArray(i)||Object.keys(i).length!==1)return;let[s,a]=Object.entries(i)[0];if(In.has(s)&&K(a))t.push({[s]:a});else if(En.has(s)&&typeof a==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(a))t.push({[s]:a});else return}return t}return}function On(r){let e=[],t=0,i=0,s="";for(let a=0;a<=r.length;a++){let l=r[a];if(l==="\\"){a++;continue}if(s){if(l===s)s="";continue}if(l==='"'||l==="'"){s=l;continue}if(l==="(")i++;if(l===")")i=Math.max(0,i-1);if(a!==r.length&&(l!==";"||i))continue;let d=r.slice(t,a),u=d.indexOf(":");if(u!==-1)e.push([d.slice(0,u).trim(),d.slice(u+1).trim()]);t=a+1}return e}function Mn(r,e){let t;if(typeof r==="string"){if(r=r.trim(),!r)return[];try{r=JSON.parse(r)}catch{}}if(typeof r==="string")t=On(r);else if(r&&typeof r==="object"&&!Array.isArray(r))t=Object.entries(r);else{if(r!=null&&r!==!1)e({kind:"non-numeric-style",name:"style"});return[]}return t}function gt(r,e=()=>{},t={}){let i=Mn(r,e),s=Q(i,t.inheritedVariables);return t.onVariables?.(s.computed()),Bn(i,s,e)}function Bn(r,e,t){let i={},s=[];for(let[a,l]of r){if(a.trim().startsWith("--")){s.push(a.trim());continue}let d=ft.has(a)||a.trim().startsWith("--")?a:a.trim().toLowerCase().replace(/-([a-z])/g,(v,y)=>y.toUpperCase());if(!ft.has(d)){t({kind:"unknown-style",name:d});continue}if(l==null||l==="")continue;let u=typeof l==="string"?e.resolve(l.trim()):l;if(u===void 0){t({kind:"non-numeric-style",name:d});continue}if(u==="")continue;let h;if(Rn.has(d)||pt.has(d)){if(h=Cn(u),!K(h)&&!(pt.has(d)&&typeof h==="string"&&h.endsWith("%")&&_n.test(h.slice(0,-1))&&Number.isFinite(Number(h.slice(0,-1)))))h=void 0}else if(d==="shadowOffset"||d==="transform")h=Pn(d,u);else if(d==="gridTemplateColumns"||d==="gridTemplateRows")h=K(u)||typeof u==="string"?u:void 0;else if(d==="fontWeight"&&K(u))h=String(u);else if(typeof u==="string")h=u;if(h===void 0)t({kind:"non-numeric-style",name:d});else i[d]=h}for(let a of s)if(!e.used.has(a))t({kind:"unknown-style",name:a});return i}import{generate as Z,parse as ht}from"@stacksjs/ts-css/parse";async function mt(r,e){let t={light:new Map,dark:new Map},i=new Set,s=(y)=>{if(!i.has(y))i.add(y),e(y)},a=(y,b,c)=>{for(let m of c){let f=t[m].get(y);if(!f||Number(b.important)>Number(f.important)||b.important===f.important&&b.specificity>=f.specificity)t[m].set(y,b)}},l=(y)=>{if(y.type==="Declaration")return y.property.startsWith("--");if(y.type==="Rule"||y.type==="Atrule")return!!y.block&&[...y.block.children].some(l);return!1},d=(y)=>{let b=y.replace(/\s+/g,"").toLowerCase();if(!b||b==="all"||b==="screen")return["light","dark"];let c=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(b);return c?[c[1]]:void 0};function u(y,b){for(let c of y){if(!l(c))continue;if(c.type==="Atrule"){let f=c.prelude?Z(c.prelude):"",g=c.name.toLowerCase()==="media"?d(f):void 0;if(!g){s(`@${c.name} ${f}`.trim());continue}u(c.block.children,b.filter((S)=>g.includes(S)));continue}if(c.type!=="Rule")continue;let m=c.prelude.type==="SelectorList"?[...c.prelude.children].map(Z):[Z(c.prelude)];for(let f of m){let g=/^(html|:root)?(?:\.(dark|light))?$/.exec(f.trim());if(!g||!g[1]&&!g[2]){s(f);continue}let S=(g[1]===":root"?10:g[1]?1:0)+(g[2]?10:0);for(let x of c.block.children){if(x.type!=="Declaration"){if(l(x))s(`nested rule in ${f}`);continue}if(!x.property.startsWith("--"))continue;let p={value:Z(x.value),important:!!x.important,specificity:S};a(x.property,p,b.filter((w)=>!g[2]||g[2]===w))}}}}let h="",v;return await new HTMLRewriter().on("html",{element(y){let b=y.getAttribute("style");if(!b)return;try{let c=ht(b,{context:"declarationList"});if(c.type!=="DeclarationList")return;for(let m of c.children)if(m.type==="Declaration"&&m.property.startsWith("--"))a(m.property,{value:Z(m.value),important:!!m.important,specificity:1000},["light","dark"])}catch{s("invalid document inline theme")}}}).on("style",{element(y){h="";let b=y.getAttribute("type");v=!b||b.toLowerCase()==="text/css"?d(y.getAttribute("media")??""):void 0,y.onEndTag(()=>{try{let c=ht(h);if(c.type!=="StyleSheet")return;if(!v){if([...c.children].some(l))s("style type/media");return}u(c.children,v)}catch{s("invalid stylesheet")}})},text(y){h+=y.text}}).transform(new Response(r)).text(),{light:[...t.light].map(([y,b])=>[y,b.value]),dark:[...t.dark].map(([y,b])=>[y,b.value])}}function z(r,e={},t={},i={},s=[]){return{type:r,props:e,style:t,events:i,children:s}}function yt(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 bt=new Set(["script","style","head","meta","link","title","base","noscript"]),vt=new Set(["template","body","html","main","fragment"]),oe=new Set,Dn=new Set(["onBlur","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPictureInPictureStart","onPictureInPictureStop","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRegionChangeComplete","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),Ee=new Set(["Sidebar","SplitView","View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","Map","MapPolyline","MapMarker","FlatList","SectionList","Switch","Checkbox","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...Ne]),Ln=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"],["listrole","listRole"]]),wt=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Vn={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function G(r){return r.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,t)=>{let i=Vn[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 St(r,e,t,i={}){let s=i.inheritedVariables,a={},l={},d={},u="",h={};for(let[b,c]of e){let m=b.toLowerCase();if(m==="class"||m==="classname"){u=u?`${u} ${c}`:c;continue}if(m==="style"){h={...h,...$n(r,c,t,{...i,onVariables(S){s=S,i.onVariables?.(S)}})};continue}if(m.startsWith(":")||m.startsWith("x-")&&m!=="x-cloak"){d[m.startsWith(":")?m.slice(1):m.slice(2)]=G(c);continue}if(m==="x-cloak")continue;if(m.startsWith("@")||m.startsWith("v-on:")){let S=m.startsWith("@")?m.slice(1):m.slice(5),[x]=S.split("."),p=we[x]??(x.startsWith("on")?x:"");if(!p||!Dn.has(p)){t.push({kind:"unread-event",tag:r,name:b});continue}l[p]=G(c);continue}if(m==="key"){a.key=c;continue}let f=G(c),g=_e(b);if(f===""&&at.has(g)){a[g]=!0;continue}try{a[g]=JSON.parse(f)}catch{a[g]=f}}let v=u?se(u,s):void 0;for(let b of new Set(v?.unknown??[]))t.push({kind:"unknown-class",tag:r,name:b});let y={...v?.style,...h};return{props:a,style:y,events:l,bindings:d,classes:u,inline:h}}function $n(r,e,t,i){return gt(G(e),(s)=>t.push({...s,tag:r}),i)}function Ie(r){return r.children.map((e)=>typeof e==="string"?e:Ie(e)).join("").replace(/\s+/g," ").trim()}function Fn(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(r.tag==="button"&&t.type==="Button"&&!r.declaredNative&&i.length>0)return t.type="Pressable",t.props.accessibilityRole??=t.props.role??"button",t.children=t.children.flatMap((a)=>typeof a==="string"?a.trim()?[z("Text",{},{},{},[a.trim()])]:[]:[a]),t;if(t.type==="Button"&&i.length===0)return t.children=s?[s]:[],t;if(t.type==="Svg"||t.type==="G")return t.children=i,t;if(t.type==="SvgText"){let a=Ie(t);return t.children=a?[a]:[],t}if(wt.has(t.type)&&i.length===0&&s)return t.type="Text",t.children=[s],t;if(t.type==="Text"&&!s&&i.length===0&&typeof t.props.text==="string")return t.children=t.props.text?[t.props.text]:[],delete t.props.text,t;if(t.type==="Text"&&i.length>0){if(/(?:^|\s)(?:inline-)?(?:flex|grid)(?:\s|$)/.test(t._classes??"")||i.some((d)=>d.type!=="Text"))return t.type="View",t.children=t.children.map((d)=>typeof d==="string"?z("Text",{},{},{},[d]):d),t;let l=Ie(t);return e.push({kind:"flattened-text",tag:r.tag}),t.children=l?[l]:[],t}if(wt.has(t.type)&&i.length>0)t.children=i;return t}async function jn(r,e={}){let t=[],i=await mt(r,(c)=>t.push({kind:"unsupported-theme-rule",tag:"style",name:c})),s=Q(i.light).computed(),a=[],l=[],d=new Set;function u(c){let m=l[l.length-1];if(!m)a.push(c);else if(!m.dropped)m.node.children.push(c)}function h(c){let m=(g)=>{if(c.tag!=="html"&&c.node._styleSource)g._styleAncestors=[c.node._styleSource,...g._styleAncestors??[]]};if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let g=c.node.children,S=g.filter((p)=>typeof p!=="string"),x=S.length===1&&S.length===g.length?S[0]:z("View",{},{},{},g);if(x.bindings={...c.node.bindings,...x.bindings},x.bindingId===void 0&&c.node.bindingId!==void 0)x.bindingId=c.node.bindingId;m(x),u(x);return}let f=l[l.length-1];for(let g of c.node.children){if(typeof g==="string"){if(f&&!f.dropped)f.node.children.push(g);continue}if(m(g),!f)a.push(g);else if(!f.dropped)f.node.children.push(g)}}function v(c,m){let f=l[l.length-1];if(c==="svg"||f?.svg)return y(c,m,f);let g=bt.has(c)&&!oe.has(c),S=l[l.length-1]?.dropped??!1,x=f?.variables??s,{props:p,style:w,events:A,bindings:R,classes:B,inline:k}=g||S?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:St(c,m,t,{inheritedVariables:x,onVariables:(T)=>{x=T}});if(c==="html")x=s;let E=p["data-native"],N;if(typeof E==="string"&&Ee.has(E))N=E,delete p["data-native"];else if(N=oe.has(c)?"View":lt(c),c==="input"){let T=String(p.type??"text").toLowerCase();if(T==="checkbox")N="Checkbox",p.formValue=p.value??"on",p.checked=p.checked===""||p.checked===!0||p.checked==="true",p.value=p.checked;else if(T==="hidden")N="View",w.display="none",k.display="none";else if(T==="radio")N="View",p.accessibilityRole="radio",t.push({kind:"unsupported-control",tag:c,name:"input:radio"})}if(N===c&&!Ee.has(N)&&!bt.has(c)&&!vt.has(c)&&!d.has(c))d.add(c),t.push({kind:"unmapped-tag",tag:c});if((g||oe.has(c))&&!d.has(`drop:${c}`))d.add(`drop:${c}`),t.push({kind:"dropped-subtree",tag:c});if(N==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(B))N="ScrollView",p.horizontal=!0,p.showsHorizontalScrollIndicator??=!1;else if(N==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(B))N="ScrollView";if(c==="form")p["data-stx-form"]=!0;if(c==="button"&&p.type===void 0)p.type="submit";if(N==="Video"&&p.source===void 0&&p.src!==void 0)p.source=p.src,delete p.src;if(N==="Icon"){let T=se(B).icon,j=Ae(String(p.symbol||p.name||T||""),Boolean(p.symbol));if(p.symbol=j.symbol,j.iconify)p.iconify=j.iconify}if(N==="FlatList"||N==="SectionList"){let T=new Set([...Object.keys(p),...Object.keys(R)].map((j)=>j.toLowerCase()));for(let[j,I]of Ln)if(T.has(j))t.push({kind:"unsupported-list-prop",tag:N,name:I})}nt(p);let D=z(N,p,w,A);D._inlineStyle=k,D._styleSource=G(m.find(([T])=>T==="style")?.[1]??"");let _=p["data-stx-b"];if(typeof _==="number"&&Number.isInteger(_))D.bindingId=_;if(delete p["data-stx-b"],B)D._classes=B;if(Object.keys(R).length>0)D.bindings=R;if(typeof p.key==="string")D.key=p.key,delete p.key;return{tag:c,node:D,variables:x,declaredNative:typeof E==="string"&&Ee.has(E),dropped:g||S||oe.has(c),discard:g||S,unwrap:vt.has(c)}}function y(c,m,f){let g=f?.dropped??!1,S=xe[c];if(g||!S){if(!g&&!d.has(`drop:${c}`))d.add(`drop:${c}`),t.push({kind:st.has(c)?"dropped-subtree":"unmapped-tag",tag:c});return{tag:c,node:z("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let x=f?.variables??s,{props:p,style:w,events:A,bindings:R,classes:B,inline:k}=St(c,m,t,{inheritedVariables:x,onVariables:(_)=>{x=_}});if(S==="Svg"){let _=Te(p.viewBox);if(_)p.viewBox=_;else delete p.viewBox;for(let T of["width","height"]){if(typeof p[T]==="number"&&w[T]===void 0)w[T]=p[T];delete p[T]}}if(typeof p.strokeDasharray==="string"||typeof p.strokeDasharray==="number"){let _=String(p.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);p.strokeDasharray=_}let E=Re(S,p);if(E)p.geometry=E;let N=z(S,p,w,A);N._inlineStyle=k,N._styleSource=G(m.find(([_])=>_==="style")?.[1]??"");let D=p["data-stx-b"];if(typeof D==="number"&&Number.isInteger(D))N.bindingId=D;if(delete p["data-stx-b"],B)N._classes=B;if(Object.keys(R).length>0)N.bindings=R;if(typeof p.key==="string")N.key=p.key,delete p.key;return{tag:c,node:N,variables:x,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(c){let m=c.tagName.toLowerCase(),f=v(m,[...c.attributes]),g=!0;try{c.onEndTag(()=>{if(l.pop(),f.discard)return;if(f.unwrap)h(f);else u(Fn(f,t))})}catch{g=!1}if(g)l.push(f);else if(!f.discard)u(f.node)},text(c){let m=l[l.length-1];if(!m||m.dropped)return;let f=G(c.text).replace(/\s+/g," ");if(!f.trim())return;m.node.children.push(f)}}).transform(new Response(r)).text(),a.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);let b=a.length===1?a[0]:z("View",{},{},{},a);if(i.light.length||i.dark.length)b._stylesheetTheme=i;return{root:b,diagnostics:t}}async function xt(r,e={}){let{root:t,diagnostics:i}=await jn(r,e),s=e.script??{exports:{},functions:[],code:""};return{document:yt(t,s,{source:e.source??"unknown"}),diagnostics:i}}var Nt=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Wn=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Xn=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,kt=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function Pe(r){let e=[];Nt.lastIndex=0;for(let a of r.matchAll(Nt)){let l=a[1]??"";if(/\bserver\b/.test(l))continue;e.push(a[2].trim())}let t=e.filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`),i=[];for(let a of[Wn,Xn]){a.lastIndex=0;for(let l of t.matchAll(a))if(!i.includes(l[1]))i.push(l[1])}let s={};kt.lastIndex=0;for(let a of t.matchAll(kt)){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 ae=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,Tt=/function\s+(__stx_setup_[\w$]+)\s*\(/,zn=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function Oe(r){ae.lastIndex=0;for(let e of r.matchAll(ae)){let t=e[2].trim(),i=Tt.exec(t)?.[1];if(i)return{name:i,code:t}}return null}function Rt(r){let e=[];ae.lastIndex=0;for(let t of r.matchAll(ae)){let i=t[1],s=t[2].trim(),a=zn.exec(i)?.[1],l=/\bdata-stx-component-factories\b/i.test(i);if(!s||!a&&!l&&!Tt.test(s))continue;e.push(a?{code:s,owner:a}:{code:s})}return e}function Un(){let r=[ee.join(import.meta.dir,"..","primitives"),ee.join(import.meta.dir,"native","primitives")];for(let e of r)if(Hn(ee.join(e,"View.stx")))return e;return r[0]}async function qn(r,e,t={}){let i=t.root??ee.dirname(e),s=await o(i),a={root:i,componentsDir:t.componentsDir??s.componentsDir??ee.join(i,"components"),buildMode:"serve",cache:!1,_targetComponentDirs:[Un()],_targetComponentFallbackNames:["Button"],_nativeHostAttrs:!0,_pluginComponentDirs:s._pluginComponentDirs??[]},l={...t.context??{},__stx_inject_css:!1},d=new Set([e]),u=await n(r,l,e,a,d),{html:h,manifest:v}=We(u),y=await Ye(i),{document:b,diagnostics:c}=await xt(y?`<style>${y}</style>${h}`:h,{source:e,script:Pe(r)}),m=Oe(h),f=Rt(h);if(Pe(r).code.trim()){let g=await ar(r,e,t.context,{forceClientSetup:!0}),S=Oe(g.setupCode??"");if(m=S??m,S&&!f.some((x)=>x.code===S.code))f.push({code:S.code})}return{document:b,manifest:v,setup:m,scripts:f,diagnostics:c,html:h,dependencies:[...d]}}async function ce(r,e={}){return qn(await Bun.file(r).text(),r,e)}var ne="__app";var le="__runtime",Kn="__messages";function Me(r){let t=[C.join(import.meta.dir,"..","runtime",`${r}.ts`),C.join(import.meta.dir,"..","runtime",`${r}.js`),C.join(import.meta.dir,"native","runtime",`${r}.js`)].find((i)=>De(i));if(!t)throw Error(`Native runtime module ${r} is missing`);return t}async function Be(r,e,t,i,s){let a={name:"stx-screen-inputs",setup(d){d.onLoad({filter:/.*/,namespace:"file"},({path:u})=>{i.add(u);let h=s?.get(u);return h===void 0?void 0:{contents:h,loader:"js"}})}},l=await Bun.build({entrypoints:[r],target:"browser",format:"iife",minify:t,plugins:[a,...e],define:{"process.env.NODE_ENV":JSON.stringify(t?"production":"development")}});if(!l.success){let d=l.logs.map((u)=>String(u.message??u)).join(`
|
|
6
|
+
`);throw Error(`Could not bundle ${r}:
|
|
7
|
+
${d}`)}return(await l.outputs[0].text()).trim()}var Yn=/^[\w-]+(?:\/[\w-]+)*$/,Qn=/^[\w-]+$/;async function Zn(r,e){let t=C.resolve(r,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let i=new Map,s=new Map;for(let a of e.languages){if(!Qn.test(a))throw Error(`messages: "${a}" is not a language directory name`);let l=C.join(t,a);if(!De(l))throw Error(`messages: ${C.relative(r,l)} does not exist`);let d=new Map;for(let u of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:l})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(u))continue;let h=u.replace(/\.[^./]+$/,"").split(C.sep).join("/");if(!Yn.test(h))throw Error(`messages: ${a}/${u} is not an area name`);if(d.has(h))throw Error(`messages: ${a}/${h} is defined twice`);let v=C.join(l,u),y=await import(v),b=Object.keys(y).filter((f)=>f!=="default");if(b.length)throw Error(`messages: ${a}/${u} exports ${b.join(", ")}; a message module exports its messages as default, and nothing else`);let c=y.default,m=c!==null&&typeof c==="object"&&!Array.isArray(c)?JSON.stringify(c):void 0;if(m===void 0||!Bun.deepEquals(JSON.parse(m),c,!0))throw Error(`messages: ${a}/${u} must export plain data (an object JSON can hold) as default`);d.set(h,m),i.set(v,{language:a,area:h})}s.set(a,d)}return{files:i,data:s}}function er(r,e){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(r)}, ${JSON.stringify(e)});`}function tr(r){let e=new Map;for(let[t,{language:i,area:s}]of r.files){let a=er(i,s);e.set(t,a),e.set(Jn(t),a)}return e}function nr(r){let e=new Set;for(let t of r.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))e.add(t[1]);return[...e].sort()}function rr(r,e){let t=C.isAbsolute(r.meta.source)?C.relative(e,r.meta.source).split(C.sep).join("/"):r.meta.source;return{...r,script:{exports:r.script.exports,functions:[],code:""},meta:{...r.meta,source:t,compiledAt:0}}}async function Le(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=C.resolve(r.root??process.cwd());if(r.messages&&!r.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(r.sharedRuntime&&!r.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(r.messages&&!r.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(r.messages&&r.outFile)throw Error("messages leave the languages out of the screens' code, which the one-file bundle cannot read: build it without messages");let a=r.messages?await Zn(s,r.messages):null,l=a?tr(a):null,d=[],u=async()=>{for(let k of e){let E=C.resolve(s,r.screens[k]);if(!E.endsWith(".stx"))throw Error(`Screen ${k} must name a .stx file`);d.push({name:k,file:E,compiled:await ce(E,{root:s})})}};if(l)await is(l,u);else await u();let h=Me("jsc-globals"),v=Me("shared-screen"),y=r.app?C.resolve(s,r.app):null;if(y&&!De(y))throw Error(`The app script ${r.app} does not exist`);if(y&&!t)throw Error("An app script needs a routed bundle");if(y&&r.screens[ne])throw Error(`${ne} is the app script's route, not a screen name`);let b=r.browser;if(r.screens[le])throw Error(`${le} is the runtime prelude's file, not a screen name`);let c=Fe();if(b&&r.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let m=(k,E,N)=>{let D=t?`var routeName = g.__stxNativeRoute || ${JSON.stringify(i)};
|
|
8
|
+
var isApp = ${y?`routeName === ${JSON.stringify(ne)}`:"false"};
|
|
9
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
10
|
+
if (isApp ? ${!E} : ${JSON.stringify(k.map(({name:W})=>W))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
11
|
+
var isApp = false;`,_=k.map(({name:W,compiled:O},F)=>`${F===0?"if":"else if"} (routeName === ${JSON.stringify(t?W:"main")}) {
|
|
12
|
+
nativeDocument = ${JSON.stringify(rr(O.document,s))};
|
|
13
|
+
manifest = ${JSON.stringify(O.manifest)};
|
|
14
|
+
}`).join(`
|
|
15
|
+
`),T=k.map(({name:W,compiled:O},F)=>`${F===0?"if":"else if"} (routeName === ${JSON.stringify(t?W:"main")}) {
|
|
16
|
+
g.__stx_latestSetup = null;
|
|
17
|
+
${O.scripts.map((L)=>L.owner?` g.__stx_componentSetups = g.__stx_componentSetups || {};
|
|
18
|
+
// Kept by id as well as run once: a :for or :if clone of this component
|
|
19
|
+
// has no script to copy, and is set up from this (component hydration).
|
|
20
|
+
g.__stx_componentSetups[${JSON.stringify(L.owner)}] = function() {
|
|
21
|
+
${L.code}
|
|
22
|
+
};
|
|
23
|
+
g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(L.owner)});
|
|
24
|
+
try { g.__stx_componentSetups[${JSON.stringify(L.owner)}](); }
|
|
25
|
+
finally { g.__STX_SETUP_ROOT__ = null; }`:L.code).join(`
|
|
26
|
+
`)}
|
|
27
|
+
}`).join(`
|
|
28
|
+
`),j=E&&y,I=b?Me("browser-screen"):null,V=b?Bun.resolveSync(b.platformModule,s):null;return`
|
|
29
|
+
${N?`var runtime = globalThis.__stxNativeRuntime;
|
|
30
|
+
if (!runtime || runtime.version !== ${JSON.stringify(N)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${le}.js from the same build first');
|
|
31
|
+
var installJSCGlobals = runtime.installJSCGlobals;
|
|
32
|
+
var prepareNativeApp = runtime.prepareNativeApp;
|
|
33
|
+
var prepareSharedNativeScreen = runtime.prepareSharedNativeScreen;`:`import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
34
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(v)};`}
|
|
35
|
+
${b?`import { createBrowserScreenBridge } from ${JSON.stringify(I)};
|
|
36
|
+
import { createBrowserPlatform } from ${JSON.stringify(V)};`:""}
|
|
37
|
+
${j?`import * as nativeAppModule from ${JSON.stringify(y)};`:"var nativeAppModule = null;"}
|
|
38
|
+
${b?"(async function() {":""}
|
|
39
|
+
var g = globalThis;
|
|
40
|
+
installJSCGlobals(g);
|
|
41
|
+
${b?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(b.platformOptions??{})});
|
|
42
|
+
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(b)});
|
|
43
|
+
var bridge = browserBridge;
|
|
44
|
+
g.__stxNativeRoute = ${JSON.stringify(i)};`:"var bridge = g.__stxNativeBridge;"}
|
|
45
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
46
|
+
var routeNames = ${JSON.stringify(t?e:["main"])};
|
|
47
|
+
${D}
|
|
48
|
+
g.__stxNativeRoute = routeName;
|
|
49
|
+
var nativeDocument;
|
|
50
|
+
var manifest;
|
|
51
|
+
${_}
|
|
52
|
+
var screen = null;
|
|
53
|
+
var app = null;
|
|
54
|
+
if (isApp) {
|
|
55
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
56
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
60
|
+
g.__stx_host = screen.host;
|
|
61
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
62
|
+
}
|
|
63
|
+
${N?"runtime.startSignals();":c}
|
|
64
|
+
var pageSetup = g.__stx_latestSetup;
|
|
65
|
+
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
66
|
+
${T}
|
|
67
|
+
// The screen's setup is the native host's to run. A screen script publishes
|
|
68
|
+
// it where a page's document runtime adopts its own, and in a browser that
|
|
69
|
+
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
70
|
+
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
71
|
+
// whatever setup it had.
|
|
72
|
+
var screenSetup = g.__stx_latestSetup || null;
|
|
73
|
+
g.__stx_latestSetup = pageSetup;
|
|
74
|
+
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
75
|
+
if (isApp) app.start(nativeAppModule);
|
|
76
|
+
else screen.mount(g.stx, screenSetup);
|
|
77
|
+
${b?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
78
|
+
var unmount = g.__stxNativeUnmount;
|
|
79
|
+
var ended = false;
|
|
80
|
+
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
81
|
+
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
82
|
+
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(b.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
83
|
+
`},f=(k)=>({name:"stx-native-shared-screens",setup(E){E.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),E.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:k,loader:"js"}))}}),g=new Set(d.flatMap(({compiled:k})=>k.dependencies)),S=d.flatMap(({compiled:k})=>k.diagnostics).map((k)=>({level:"warning",message:[k.kind,k.tag,k.name].filter(Boolean).join(": ")})),x=r.minify??!1,p,w,A;if(r.routesDir){let k=C.resolve(s,r.routesDir);_t(k,{recursive:!0});let E=`
|
|
84
|
+
import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
85
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(v)};
|
|
86
|
+
globalThis.__stxNativeRuntime = {
|
|
87
|
+
version: '__STX_NATIVE_RUNTIME_VERSION__',
|
|
88
|
+
installJSCGlobals: installJSCGlobals,
|
|
89
|
+
prepareNativeApp: prepareNativeApp,
|
|
90
|
+
prepareSharedNativeScreen: prepareSharedNativeScreen,
|
|
91
|
+
// Each screen starts its own signals runtime, after its host is in place.
|
|
92
|
+
startSignals: function() {
|
|
93
|
+
${c}
|
|
94
|
+
},
|
|
95
|
+
// A language's messages for an area (the compile's \`messages\`), read the
|
|
96
|
+
// first time they are looked into: a screen never parses a language it
|
|
97
|
+
// is not shown in, nor an area it does not use.
|
|
98
|
+
messages: function(language, area) {
|
|
99
|
+
var g = globalThis;
|
|
100
|
+
var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
|
|
101
|
+
function table() {
|
|
102
|
+
var forLanguage = loaded[language] || (loaded[language] = {});
|
|
103
|
+
if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
|
|
104
|
+
var value = null;
|
|
105
|
+
if (typeof g.__stxNativeReadMessages === 'function') {
|
|
106
|
+
try {
|
|
107
|
+
var text = g.__stxNativeReadMessages(language, area);
|
|
108
|
+
if (typeof text === 'string') value = JSON.parse(text);
|
|
109
|
+
}
|
|
110
|
+
catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
|
|
111
|
+
}
|
|
112
|
+
forLanguage[area] = value;
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
var own = Object.prototype.hasOwnProperty;
|
|
116
|
+
return new Proxy({}, {
|
|
117
|
+
get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
|
|
118
|
+
has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
|
|
119
|
+
ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
|
|
120
|
+
getOwnPropertyDescriptor: function(target, name) {
|
|
121
|
+
var messages = table();
|
|
122
|
+
return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
`,N,D=C.join(k,`${le}.js`);if(r.sharedRuntime){let I=await Be("stx:native-shared-screens",[f(E)],x,g);N=Bun.hash(I).toString(36),w=D,await Bun.write(w,I.replace("__STX_NATIVE_RUNTIME_VERSION__",N))}else At(D,{force:!0});let _=C.join(k,Kn);At(_,{recursive:!0,force:!0});let T={},j=[...d.map((I)=>({name:I.name,screens:[I],app:!1})),...y?[{name:ne,screens:[],app:!0}]:[]];p={};for(let I=0;I<j.length;I+=6)await Promise.all(j.slice(I,I+6).map(async(V)=>{let H=C.join(k,`${V.name}.js`),U=await Be("stx:native-shared-screens",[f(m(V.screens,V.app,N))],x,g,l??void 0);if(await Bun.write(H,U),p[V.name]=H,a)T[V.name]=nr(U)}));if(a){for(let[V,H]of a.data)for(let[U,W]of H)await Bun.write(C.join(_,V,`${U}.json`),W);let I=Object.fromEntries(Object.keys(T).sort().map((V)=>[V,T[V]]));await Bun.write(C.join(_,"routes.json"),JSON.stringify(I));for(let V of a.files.keys())g.add(V);A={dir:_,languages:[...a.data.keys()],routes:I}}if(!r.outFile)return{code:"",routes:p,runtime:w,...A?{messages:A}:{},diagnostics:S,dependencies:[...g]}}let R=await Be("stx:native-shared-screens",[f(m(d,!0))],x,g);if(!r.outFile)return{code:R,diagnostics:S,dependencies:[...g]};let B=C.resolve(s,r.outFile);return _t(C.dirname(B),{recursive:!0}),await Bun.write(B,R),{code:R,outFile:B,...p?{routes:p,runtime:w}:{},...A?{messages:A}:{},diagnostics:S,dependencies:[...g]}}async function ir(r,e={}){return Le({...e,screens:{main:r},routed:!1})}function Et(r,e={}){return ir(r,e)}var It=["native.config.json","stx-native.config.json"];function cr(r=process.cwd(),e){let t=e?X.resolve(r,e):It.map((u)=>X.join(r,u)).find((u)=>ue(u));if(!t)return null;if(!ue(t))throw Error(`Native config not found: ${t}`);let i=JSON.parse(or(t,"utf8")),s=Object.entries(i.screens??{});if(s.length===0)throw Error(`${X.basename(t)} must name at least one screen in "screens"`);let a={};for(let[u,h]of s){if(!/^[A-Z][\w-]*$/i.test(u))throw Error(`Invalid native screen name: ${u}`);if(typeof h!=="string"||!h.endsWith(".stx"))throw Error(`Screen ${u} must name a .stx file`);if(a[u]=X.resolve(X.dirname(t),h),!ue(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`);if(i.app!==void 0&&typeof i.app!=="string")throw Error(`"app" must name the app script's file`);let d=i.app?X.resolve(X.dirname(t),i.app):void 0;if(d&&!ue(d))throw Error(`App script not found: ${d}`);return{initialScreen:l,screens:a,file:t,...d?{app:d}:{}}}async function cs(r,e={}){let t=X.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:cr(t,e.config);if(!r&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${It[0]}`);let a,l=[];if(i==="bundle"){let u=s?await Le({screens:s.screens,initialScreen:s.initialScreen,minify:e.minify,root:t,...s.app?{app:s.app}:{}}):await Et(X.resolve(t,r),{minify:e.minify});a=u.code,l=u.diagnostics}else{let u=async(v)=>{let y=await ce(v);return l.push(...y.diagnostics.map((b)=>({level:"warning",message:[b.kind,b.tag,b.name].filter(Boolean).join(": ")}))),y.document},h=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([v,y])=>[v,await u(y)])))}:await u(X.resolve(t,r));a=JSON.stringify(h,null,2)}if(!e.output)return{output:a,diagnostics:l};let d=X.resolve(t,e.output);return sr(X.dirname(d),{recursive:!0}),await Bun.write(d,a),{output:a,written:d,diagnostics:l}}export{cs as runNativeCompile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hl}from"./chunk-shnvs7x9.js";import"./chunk-fjw3sn55.js";import"./chunk-mkmgy50k.js";import"./chunk-6qnemg0e.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-9e49fnj9.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-a7crvy3b.js";import"./chunk-82bttwqm.js";export{hl as startProductionServer};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import a from"fs";function Be(r){return o(r)}var g=1000,i=new Map;function rn(){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 wt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function U(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
|
|
4
|
+
export{Be,rn,wt,U};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{H}from"./chunk-
|
|
2
|
+
import{H}from"./chunk-nb0ytx70.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Po(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":H(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function ka(e){return async(t)=>await Po(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-jhswy523.js")}
|
|
3
3
|
export{Po,ka};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Bt}from"./chunk-gh181dnr.js";import{li,ms,V,We,ee,It,x,Ke,Xe,cr,u}from"./chunk-6qnemg0e.js";import{N}from"./chunk-zvs13kgh.js";var H=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function B(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(H.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var q=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function ko(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=We(t,s);if(a>s){i=a;continue}let o=V(t,s);if(o>s){let c=t.slice(s,o),f=q.exec(c);if(f){let l=B(f[1],f[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function U(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function W(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=U(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=G(t),s;while((s=r.exec(t))!==null){if(P(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||z.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!W(o,e))continue;let c=s[0],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,m;while((m=l.exec(t))!==null){if(P(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(g+=S?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:m.index,tagName:a}}return null}return null}var Le="private, no-store";function Co(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function oe(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function T(t){return{Vary:X(t,"X-STX-Router")}}import E from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=N()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-w3k1r8r5.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function _o(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Fr(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=ko(e),a=[...s.client.map((d)=>d.fullTag),...s.signals.map((d)=>d.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)o.push(f[0]);let l=r;for(let d of s.server)l=l.replace(d.fullTag,"");for(let d of s.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-san161h4.js"),y=await w(),p={__filename:t,__dirname:E.dirname(t)};for(let d of a){let C=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!d.includes("client")&&!d.includes('type="module"'))await S(C[1],p,t)}let R=await m(l,p,t,{...b,...y,...n},new Set),h=R.indexOf(g);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+g.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function qn(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -18,14 +18,14 @@ ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
|
|
|
18
18
|
${c}
|
|
19
19
|
${o}
|
|
20
20
|
</body>
|
|
21
|
-
</html>`}function
|
|
21
|
+
</html>`}function ve(t,n={}){let e=t.trim();if(!Bt(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let c=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=f.exec(c))!==null)r.push(l[0]);let g=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(g)r.push(g[0]);let m=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(m)r.push(m[0])}if(n.preserveHead&&i){let c=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${J}${Buffer.from(c.join(`
|
|
22
22
|
`),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,f=e.slice(c,a).trim();if(r.length>0)return r.join(`
|
|
23
23
|
`)+`
|
|
24
24
|
`+f;return f}let o=e;if(o=o.replace(/<!DOCTYPE\b[^>]*>/i,""),o=o.replace(/<html\b[^>]*>/i,""),o=o.replace(/<\/html\s*>/i,""),i)o=o.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
|
|
25
|
-
`));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function I(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function Eo(t){return
|
|
25
|
+
`));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function I(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function Eo(t){return oe(t)}function Z(t,n){let e=[],r=new Set;for(let i of ee(t,V)){if(i.start>=n.start&&i.start<n.end)continue;let s=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let f of s.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let o=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!o||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(o))continue;if(I(t,i.token,n.start,n.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function ie(t,n="main"){let e=t.trim(),r=[],i=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let p=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=R.exec(p))!==null)r.push(h[0]);let d=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=d.exec(p))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;i.push(h[0])}}let a=O(e,n);if(!a)return ve(t);let o=Z(e,a),c=new Set(o),{tagName:f,start:l,end:g}=a,m=e.slice(l,g).trim(),S=[],b=e.match(/<body\b[^>]*>/i),w=e.lastIndexOf("</body>");if(b&&b.index!==void 0&&w!==-1){let R=[[b.index+b[0].length,a.openIndex],[g+`</${f}>`.length,w]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[d,C]of R){if(d>=C)continue;let L=e.slice(d,C),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(I(e,A[0],l,g))continue;S.push(A[0])}}}let y=[];if(r.length>0)y.push(r.join(`
|
|
26
26
|
`));if(o.length>0)y.push(o.join(`
|
|
27
27
|
`));if(i.length>0)y.push(i.filter((p)=>!c.has(p)).join(`
|
|
28
28
|
`));if(S.length>0)y.push(S.filter((p)=>!c.has(p)).join(`
|
|
29
29
|
`));return y.push(m),y.join(`
|
|
30
|
-
`)}import k from"fs";import D from"path";function To(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function $o(t,n){let e=D.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function Ro(t){let n=D.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function _(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function Q(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function zr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!zr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await Q(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=tt(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function tt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(_(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(_(e,i.value,i))}}return n}function Ao(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function
|
|
31
|
-
export{ko,
|
|
30
|
+
`)}import k from"fs";import D from"path";function To(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function $o(t,n){let e=D.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function Ro(t){let n=D.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function _(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function Q(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function zr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!zr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await Q(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=tt(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function tt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(_(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(_(e,i.value,i))}}return n}function Ao(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Wt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await et(t,n),a=Ke(r),o=Xe(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-frm8k9gj.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-3bx12g3y.js"),{defaultConfig:m}=await import("./chunk-m0ngddr1.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((p)=>({id:p,render:async()=>{let R=typeof S[p]==="function"?await S[p]():void 0;return g(l[p],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((p)=>p.id));f=[...(f||[]).filter((p)=>!y.has(p.id)),...w]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:s,status:a,headers:o}}async function et(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!ms(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=cr(e);if(!c)return o;let f=o.indexOf("</head>");return f<0?c+o:o.slice(0,f)+c+o.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!ms(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?It(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(li(t.html,s)),context:e,cookies:r.cookies}}
|
|
31
|
+
export{ko,Le,Co,oe,T,_o,Fr,qn,ve,Eo,ie,To,$o,Ro,zr,Ao,Wt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pd,Ic,Cs,_s,xi,Si,Es,Ts,ar,Oc,ki,Ci,Dc,Ye}from"./chunk-6qnemg0e.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-9e49fnj9.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-a7crvy3b.js";import"./chunk-82bttwqm.js";export{pd as clearScriptScanCache,Es as convertServerLoopAttributesToDirectives,xi as convertSignalDirectivesToAttributes,Ts as convertSignalLoopsToAttributes,Oc as extractExports,Ci as findMarkupIndexOutsideScripts,_s as hasSignalsSyntax,Cs as parseLoopExpression,Si as preEvalLiteralReactiveIfs,ar as processScriptSetup,ki as processSignals,Dc as rewriteStxImportSpecifiers,Ic as scanScriptTags,Ye as stripStxRuntimeImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tu,jo,tc,$u,Ru,Au,Pu,Iu,nc,rc,Ou,Du,Nu,Mu}from"./chunk-
|
|
2
|
+
import{Tu,jo,tc,$u,Ru,Au,Pu,Iu,nc,rc,Ou,Du,Nu,Mu}from"./chunk-nmfnstjg.js";import"./chunk-6qnemg0e.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-9e49fnj9.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-a7crvy3b.js";import"./chunk-82bttwqm.js";export{tc as SUSPENSE_RESOLVER_RUNTIME,jo as buildSuspenseResolveScript,Iu as createStreamRenderer,Au as extractStreamBoundaries,Mu as generateHydrationRuntime,rc as islandDirective,Du as processSectionDirectives,Ru as processStreamDirectives,Ou as registerStreamingDirectives,$u as renderStreamingPage,Tu as streamTemplate,Pu as streamTemplateSimple,Nu as streamToResponse,nc as streamingSuspenseDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nr,yo,Vn,Mr,Lr,Ut,bt,bo,Un,Wn,jr,Br,yl,bl,Me}from"./chunk-tc3ne706.js";export{Me as DeployError,yo as calculateSha1,Vn as collectDeployFiles,Wn as createDefaultNetlifyConfig,Mr as createFileManifest,Nr as createNetlifyClient,yl as deploy,Un as detectProjectConfig,Lr as filterRequiredFiles,Ut as formatSize,bo as generateNetlifyToml,bt as getTotalSize,Br as hasNetlifyConfig,bl as initNetlify,jr as writeNetlifyConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B,F,z,
|
|
2
|
+
import{B,F,z,Gt,Q,ae,je,vt,Kt,Xt,Jt,H,Yt,Zt}from"./chunk-nb0ytx70.js";import{tt}from"./chunk-25zpd110.js";function ua(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=z,placeholder:l="none",formats:f=F,widths:y=B,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return ee(s,I,w);if(A||!b)return te(s);return se(s)}function ee(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=Xt(r),v=Kt(r),w=typeof m==="object"?vt(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",D=d?` class="${d}"`:"",C=u?"":` loading="${o}"`,T=` decoding="${l}"`,O=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",L=["avif","webp","jpeg","png"],V=[];for(let k of L){let P=p.get(k);if(P&&P.length>0){let M=je(P),X=H(k);V.push(` <source type="${X}" srcset="${M}" sizes="${w}" />`)}}let q="",N="",E;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(q=`<div class="stx-image-wrapper" id="${k}">`,N="</div>",h==="blur")E=`
|
|
3
3
|
#${k} {
|
|
4
4
|
position: relative;
|
|
5
5
|
background-image: url('${e.placeholder}');
|
|
@@ -23,14 +23,14 @@ ${V.join(`
|
|
|
23
23
|
src="${v?.url||t}"
|
|
24
24
|
alt="${U(n)}"${K}${Z}${D}${A}${C}${T}${O}
|
|
25
25
|
/>
|
|
26
|
-
</picture>${N}`,W;if(u&&v){let k=p.get("webp"),P=k?.[Math.floor(k.length/2)]||v,M=H(P.format);W=`<link rel="preload" as="image" href="${P.url}" type="${M}" />`}return{html:G,preloadLink:W,placeholderCss:E}}function te(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${U(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function se(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=z,formats:u=F,widths:l=B,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,D=` decoding="${f}"`,C=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",T=typeof a==="object"?
|
|
26
|
+
</picture>${N}`,W;if(u&&v){let k=p.get("webp"),P=k?.[Math.floor(k.length/2)]||v,M=H(P.format);W=`<link rel="preload" as="image" href="${P.url}" type="${M}" />`}return{html:G,preloadLink:W,placeholderCss:E}}function te(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${U(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function se(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=z,formats:u=F,widths:l=B,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,D=` decoding="${f}"`,C=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",T=typeof a==="object"?vt(a):a,O=`
|
|
27
27
|
data-stx-image
|
|
28
28
|
data-src="${r}"
|
|
29
29
|
data-sizes="${T}"
|
|
30
30
|
data-quality="${o}"
|
|
31
31
|
data-formats="${u.join(",")}"
|
|
32
32
|
data-widths="${l.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${D}${C} ${O} />`}}function vo(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function da(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=vo(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function U(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var j=new Map;function pa(){j.clear()}async function re(s,r){let e=`${s}:${JSON.stringify(r)}`;if(j.has(e))return j.get(e);try{let t=await
|
|
33
|
+
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${U(e)}"${I}${b}${w}${v}${A}${D}${C} ${O} />`}}function vo(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function da(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=vo(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function U(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var j=new Map;function pa(){j.clear()}async function re(s,r){let e=`${s}:${JSON.stringify(r)}`;if(j.has(e))return j.get(e);try{let t=await ae(s,r);return j.set(e,t),t}catch{return null}}function wo(){return tt({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=ie(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:B),formats:a.formats||F,quality:a.quality||z,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await Q())return _(t,n||"",a);let o=await re(t,i);if(!o)return _(t,n||"",a);return oe(o,n||"",a)}})}function ie(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ne(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ne(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function _(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function oe(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=je(p),w=H(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
|
|
34
34
|
`;if(d+=l.join(`
|
|
35
35
|
`)+`
|
|
36
36
|
`,d+=` <img ${c.join(" ")} />
|
|
@@ -39,5 +39,5 @@ ${d}
|
|
|
39
39
|
</div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
|
|
40
40
|
${d}
|
|
41
41
|
</div>`}}if(e.priority&&y){let g=H(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
|
|
42
|
-
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var fa=wo();import S from"fs";import R from"path";function ga(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=F,widths:a=B,quality:i=z,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await Q()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await S.promises.mkdir(l,{recursive:!0});if(y){let g=await
|
|
42
|
+
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var fa=wo();import S from"fs";import R from"path";function ga(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=F,widths:a=B,quality:i=z,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await Q()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await S.promises.mkdir(l,{recursive:!0});if(y){let g=await Gt();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=ce(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ge(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await Q())return;await S.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!S.existsSync(w))continue;let I=await Y(w);g.push(...I)}let p=f?g.filter((w)=>le(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=J(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await ae(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=S.statSync(I).size,D=Yt(b.variants);if(c.stats.savedBytes+=Math.max(0,A-D/b.variants.length),y)console.log(` \u2713 ${R.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${Zt(c.stats.savedBytes)}`)}}}function ce(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function le(s,r){let e=R.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ge(s,r){return s}async function Y(s){let r=[];async function e(t){let n=await S.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=R.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&Jt(i))r.push(i)}}return await e(s),r}function J(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function ma(s,r,e={}){if(!await Q())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return ae(s,{...e,outputDir:r})}async function ha(s,r,e={}){let{formats:t=F,widths:n=B,quality:a=z,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await Q())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await S.promises.mkdir(r,{recursive:!0});let l=await Y(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=J(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await ae(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${R.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function xo(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function ya(s,r){let e=xo(s);await Bun.write(r,JSON.stringify(e,null,2))}var vl={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
|
|
43
43
|
export{ua,vo,da,pa,wo,fa,ga,ma,ha,xo,ya,vl};
|