@stacksjs/stx 0.2.755 → 0.2.759
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-0dsykna3.js → chunk-00ns0516.js} +5 -5
- package/dist/chunk-055v5qz2.js +2 -0
- package/dist/{chunk-kjfzkac7.js → chunk-06zn167b.js} +7 -7
- package/dist/{chunk-024m1xmd.js → chunk-0dkd26t4.js} +5 -5
- package/dist/{chunk-gzbmfwxr.js → chunk-0e9xdrzx.js} +4 -4
- package/dist/chunk-0j7e56zm.js +2 -0
- package/dist/{chunk-8wbgq43c.js → chunk-0jn79fkt.js} +3 -3
- package/dist/chunk-0y44f9rk.js +2 -0
- package/dist/{chunk-d73hh5ar.js → chunk-11kejz35.js} +1 -1
- package/dist/{chunk-p33w8zst.js → chunk-1mfj2j5g.js} +3 -3
- package/dist/{chunk-vc4jww9y.js → chunk-2x112fxs.js} +13 -13
- package/dist/{chunk-6ywa41tr.js → chunk-3ajnrfa2.js} +2 -2
- package/dist/{chunk-3z38swhv.js → chunk-3cn9y08d.js} +7 -7
- package/dist/chunk-3h2yz805.js +2 -0
- package/dist/chunk-3jfes9b0.js +2 -0
- package/dist/{chunk-nsjkmpjf.js → chunk-3kfbs0mw.js} +1 -1
- package/dist/{chunk-z5kdmget.js → chunk-3nxe5xmy.js} +3 -3
- package/dist/{chunk-p2v0r96k.js → chunk-42hcspws.js} +2 -2
- package/dist/{chunk-0tgrqhkr.js → chunk-465resq9.js} +11 -11
- package/dist/{chunk-m0shnhth.js → chunk-4m8bexrn.js} +3 -3
- package/dist/{chunk-8wbcy0cn.js → chunk-4npabwne.js} +3 -3
- package/dist/{chunk-xrzghjvy.js → chunk-4s9kytdz.js} +2 -2
- package/dist/chunk-4tz00fkp.js +2 -0
- package/dist/{chunk-dvakr9p9.js → chunk-4zw118tn.js} +4 -4
- package/dist/chunk-52q8184e.js +2 -0
- package/dist/chunk-59ytzyp1.js +2 -0
- package/dist/chunk-5ffdtfwg.js +2 -0
- package/dist/{chunk-g223zsce.js → chunk-5ge5h2y3.js} +3 -3
- package/dist/chunk-5q551m4w.js +2 -0
- package/dist/{chunk-cb4ybh7g.js → chunk-5q9ss7ty.js} +4 -4
- package/dist/{chunk-txgd0sj1.js → chunk-6n195hvc.js} +5 -5
- package/dist/chunk-6xt3kvq1.js +2 -0
- package/dist/chunk-75r09rqt.js +2 -0
- package/dist/{chunk-90gx5qxn.js → chunk-76fcwbe1.js} +4 -4
- package/dist/chunk-79y41h1d.js +2 -0
- package/dist/{chunk-9r3ehqtx.js → chunk-7g9vd5fv.js} +2 -2
- package/dist/chunk-7h5d35bf.js +2 -0
- package/dist/{chunk-73b6sst8.js → chunk-7r7j7vwt.js} +3 -3
- package/dist/chunk-82ybmdqk.js +2 -0
- package/dist/{chunk-g22absm0.js → chunk-83ezv8yz.js} +2 -2
- package/dist/chunk-8frs2dtp.js +2 -0
- package/dist/chunk-8n2gj4q2.js +11 -0
- package/dist/chunk-8prq9t3b.js +2 -0
- package/dist/chunk-8sxngenk.js +2 -0
- package/dist/chunk-90er677t.js +2 -0
- package/dist/{chunk-bkkwdh13.js → chunk-93j4atq9.js} +2 -2
- package/dist/{chunk-1a2cwee1.js → chunk-9s1qnf90.js} +2 -2
- package/dist/{chunk-j3d9zknp.js → chunk-a5d888es.js} +6 -6
- package/dist/chunk-aakkjjgr.js +2 -0
- package/dist/chunk-abs1k04e.js +2 -0
- package/dist/{chunk-0vvb78yj.js → chunk-asp7ett1.js} +5 -5
- package/dist/{chunk-7mm5mvg0.js → chunk-b6g24qj0.js} +2 -2
- package/dist/{chunk-7djnbbeb.js → chunk-bsq9zg9j.js} +6 -6
- package/dist/{chunk-7ycf8a8d.js → chunk-c05r0rzw.js} +2 -2
- package/dist/{chunk-g45p4y4v.js → chunk-cehjp06v.js} +3 -3
- package/dist/chunk-cpep999n.js +2 -0
- package/dist/chunk-cvwn6mga.js +2 -0
- package/dist/chunk-davr7z73.js +2 -0
- package/dist/{chunk-vpa4xzz3.js → chunk-dh9aagwm.js} +1 -1
- package/dist/chunk-dqs4bgec.js +2 -0
- package/dist/chunk-e30kgg28.js +2 -0
- package/dist/chunk-e3fkq9gb.js +2 -0
- package/dist/chunk-eab8na0z.js +2 -0
- package/dist/chunk-exg7ry7b.js +2 -0
- package/dist/chunk-f4mmk2cx.js +2 -0
- package/dist/chunk-fhwn8j9p.js +2 -0
- package/dist/chunk-fj105fff.js +2 -0
- package/dist/{chunk-cmaxdd8d.js → chunk-fjxhga6w.js} +2 -2
- package/dist/{chunk-thr1m7k7.js → chunk-fpagqrd1.js} +22 -22
- package/dist/chunk-g387j1qv.js +2 -0
- package/dist/{chunk-zqmvhg37.js → chunk-geb6zyxg.js} +10 -10
- package/dist/chunk-gefpzry6.js +2 -0
- package/dist/chunk-ghzycypz.js +2 -0
- package/dist/{chunk-sj2a5twe.js → chunk-gs373714.js} +2 -2
- package/dist/{chunk-nzy4set0.js → chunk-gs6wc7sr.js} +5 -5
- package/dist/chunk-gvaee1w0.js +170 -0
- package/dist/{chunk-5q2tfrcw.js → chunk-gz38jt5j.js} +2 -2
- package/dist/{chunk-pydmzvpq.js → chunk-h692k9xn.js} +1 -1
- package/dist/{chunk-81ysx0tc.js → chunk-hk98vptc.js} +2 -2
- package/dist/{chunk-xzz36k99.js → chunk-hmae7ha6.js} +2 -2
- package/dist/{chunk-qxrsm48h.js → chunk-hmydy949.js} +5 -5
- package/dist/{chunk-7r5vhqtz.js → chunk-j04v4rgf.js} +4 -4
- package/dist/{chunk-1tmq09ch.js → chunk-j4snweyz.js} +3 -3
- package/dist/{chunk-d2vsw1j7.js → chunk-jb1dk0w7.js} +2 -2
- package/dist/{chunk-5evgz54v.js → chunk-jevd16gq.js} +30 -30
- package/dist/{chunk-41sq06t2.js → chunk-jt28zh50.js} +2 -2
- package/dist/chunk-k37472gm.js +2 -0
- package/dist/chunk-k3wnmpt3.js +2 -0
- package/dist/chunk-kfqdx75m.js +2 -0
- package/dist/{chunk-9q1kkfv1.js → chunk-kpr09x3g.js} +6 -6
- package/dist/{chunk-3ap06zzx.js → chunk-m00c7sh0.js} +1 -1
- package/dist/{chunk-8w0cwcvk.js → chunk-m5fjhrpd.js} +62 -62
- package/dist/{chunk-mpmx0n3q.js → chunk-mcynmrbe.js} +26 -26
- package/dist/chunk-mgx71bfg.js +2 -0
- package/dist/chunk-mmhbn7xt.js +2 -0
- package/dist/{chunk-0md73jp8.js → chunk-myynywry.js} +2 -2
- package/dist/chunk-mzcbfra0.js +2 -0
- package/dist/{chunk-j5p191zq.js → chunk-nv9dy71x.js} +7 -7
- package/dist/chunk-ny2qzraq.js +2 -0
- package/dist/{chunk-q0f28539.js → chunk-pes27snj.js} +2 -2
- package/dist/chunk-pg15tx9c.js +2 -0
- package/dist/chunk-ppc5s12t.js +2 -0
- package/dist/{chunk-0dt7ax79.js → chunk-prej5pk6.js} +2 -2
- package/dist/chunk-ptzzpf97.js +2 -0
- package/dist/{chunk-df8cbgf0.js → chunk-pwmkhs7z.js} +2 -2
- package/dist/chunk-qgsrxyh9.js +2 -0
- package/dist/chunk-qmxcs806.js +2 -0
- package/dist/chunk-qn4gt8sx.js +3 -0
- package/dist/chunk-qryg0hgn.js +2 -0
- package/dist/chunk-qt17792g.js +2 -0
- package/dist/{chunk-236bdf7y.js → chunk-qwds327k.js} +2 -2
- package/dist/{chunk-c3dphs36.js → chunk-qwsgc5rc.js} +1 -1
- package/dist/chunk-qz9fzz5k.js +2 -0
- package/dist/{chunk-5wcgg5t4.js → chunk-r4sawwmp.js} +1 -1
- package/dist/chunk-r5jytt0f.js +20 -0
- package/dist/chunk-rh90yh1c.js +2 -0
- package/dist/chunk-rvc0pb16.js +2 -0
- package/dist/{chunk-fxftc455.js → chunk-s4y26fk6.js} +2 -2
- package/dist/{chunk-v0s52tmv.js → chunk-sgm6tg8h.js} +2 -2
- package/dist/chunk-sj5t0tnv.js +2 -0
- package/dist/{chunk-yd2nj0rv.js → chunk-spjpdymh.js} +1 -1
- package/dist/{chunk-nmy72s6r.js → chunk-t4mpq6t0.js} +2 -2
- package/dist/{chunk-np8knskz.js → chunk-t5gabs4x.js} +1 -1
- package/dist/{chunk-4zta7ay1.js → chunk-t6qn1374.js} +2 -2
- package/dist/{chunk-4fc8zs15.js → chunk-tb56j1zt.js} +5 -5
- package/dist/chunk-tb6jcr2v.js +2 -0
- package/dist/chunk-v20cwjgz.js +17 -0
- package/dist/{chunk-k9m36nyw.js → chunk-v2egd4zh.js} +5 -5
- package/dist/{chunk-0fweckq5.js → chunk-vh1d5eqk.js} +6 -6
- package/dist/{chunk-fa3ygt8c.js → chunk-w8p1y4c0.js} +4 -4
- package/dist/{chunk-j2hm8v8b.js → chunk-wp9y6x33.js} +4 -4
- package/dist/{chunk-g5sctfwa.js → chunk-x1q2ape8.js} +10 -10
- package/dist/{chunk-x5sy0tym.js → chunk-x9haxcsj.js} +6 -6
- package/dist/chunk-xcq41ah8.js +2 -0
- package/dist/chunk-y3jbkk7a.js +2 -0
- package/dist/{chunk-fmxtnva8.js → chunk-yftw25sa.js} +2 -2
- package/dist/chunk-yme43vbp.js +2 -0
- package/dist/{chunk-m6w75sq2.js → chunk-yp6w740k.js} +2 -2
- package/dist/chunk-yv8jeqdn.js +2 -0
- package/dist/{chunk-k4dn3ry6.js → chunk-z8k3fx4r.js} +4 -4
- package/dist/chunk-zq7g0687.js +2 -0
- package/dist/{chunk-c85j39f7.js → chunk-ztdjdxjt.js} +3 -3
- package/dist/cli.js +19 -19
- package/dist/client-module-registry.d.ts +56 -0
- package/dist/client-module-registry.js +249 -9
- package/dist/client-script-bundler.d.ts +17 -0
- package/dist/client-script-bundler.js +58 -11
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/bundle.d.ts +1 -0
- package/dist/native/compiler/bundle.js +102 -11
- package/dist/native/compiler/render-screen.js +13 -6
- package/dist/native/compiler/setup-script.d.ts +1 -0
- package/dist/native/compiler/shared-scripts.d.ts +12 -0
- package/dist/native/compiler/shared-scripts.js +83 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/dist/store-loader.d.ts +23 -0
- package/dist/store-loader.js +93 -19
- package/package.json +5 -5
- package/dist/chunk-1gan06yr.js +0 -2
- package/dist/chunk-1menbxwb.js +0 -2
- package/dist/chunk-1n2d3cy5.js +0 -2
- package/dist/chunk-2vc2pkyz.js +0 -2
- package/dist/chunk-33bp9m4c.js +0 -2
- package/dist/chunk-361yezje.js +0 -2
- package/dist/chunk-45cvagp1.js +0 -2
- package/dist/chunk-5f0wwwmw.js +0 -2
- package/dist/chunk-5h71xbzk.js +0 -2
- package/dist/chunk-5z9a1vzw.js +0 -2
- package/dist/chunk-67jf2e8x.js +0 -2
- package/dist/chunk-6b7je8dc.js +0 -2
- package/dist/chunk-6fxjs3ay.js +0 -3
- package/dist/chunk-6n5jnd97.js +0 -2
- package/dist/chunk-6wvnfdqq.js +0 -2
- package/dist/chunk-78jkbaz3.js +0 -2
- package/dist/chunk-7e9hfrtb.js +0 -2
- package/dist/chunk-7tc5fj96.js +0 -2
- package/dist/chunk-82q0fy52.js +0 -2
- package/dist/chunk-8q5ec4s1.js +0 -2
- package/dist/chunk-8ysk095d.js +0 -2
- package/dist/chunk-9vbrj55v.js +0 -2
- package/dist/chunk-bcefawtc.js +0 -2
- package/dist/chunk-bd6s91p9.js +0 -2
- package/dist/chunk-bhkqzz91.js +0 -2
- package/dist/chunk-bx1mjwhb.js +0 -2
- package/dist/chunk-dw0m259e.js +0 -2
- package/dist/chunk-dx4g2ec9.js +0 -2
- package/dist/chunk-evdskc25.js +0 -2
- package/dist/chunk-gppv6fez.js +0 -2
- package/dist/chunk-grjr8shp.js +0 -2
- package/dist/chunk-gz1w4cpp.js +0 -2
- package/dist/chunk-h0qtmmq3.js +0 -2
- package/dist/chunk-h6sewvt2.js +0 -20
- package/dist/chunk-hb34m4pp.js +0 -2
- package/dist/chunk-hwvtpx3p.js +0 -2
- package/dist/chunk-k3kav39s.js +0 -2
- package/dist/chunk-k46j2maz.js +0 -2
- package/dist/chunk-ka2f844k.js +0 -2
- package/dist/chunk-kh4dr6gd.js +0 -2
- package/dist/chunk-myd82d80.js +0 -2
- package/dist/chunk-nek0q523.js +0 -130
- package/dist/chunk-nvbjcgzd.js +0 -2
- package/dist/chunk-p13dxvaj.js +0 -2
- package/dist/chunk-pht5z7wa.js +0 -2
- package/dist/chunk-ppvdbstz.js +0 -11
- package/dist/chunk-pwdk7jbx.js +0 -2
- package/dist/chunk-qekyxjy6.js +0 -2
- package/dist/chunk-r10eadgn.js +0 -2
- package/dist/chunk-r8184e10.js +0 -2
- package/dist/chunk-rshaz0df.js +0 -4
- package/dist/chunk-tcrpa52j.js +0 -2
- package/dist/chunk-vp1p250v.js +0 -2
- package/dist/chunk-vqrg5j83.js +0 -2
- package/dist/chunk-vzdfq3b5.js +0 -2
- package/dist/chunk-wzh4ene8.js +0 -2
- package/dist/chunk-x5vwkccx.js +0 -2
- package/dist/chunk-x6cmj5sa.js +0 -2
- package/dist/chunk-xnrfz4c3.js +0 -2
- package/dist/chunk-yaabhcss.js +0 -2
- package/dist/chunk-yazqtmq4.js +0 -2
- package/dist/chunk-zygpvm1x.js +0 -2
- package/dist/chunk-zz247c1r.js +0 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-465resq9.js";import{qs,_i,dl}from"./chunk-qwds327k.js";import"./chunk-89h4snzd.js";import"./chunk-m5fjhrpd.js";import"./chunk-gs373714.js";import"./chunk-b6g24qj0.js";import"./chunk-yp6w740k.js";import"./chunk-z8k3fx4r.js";import{a}from"./chunk-x1q2ape8.js";import"./chunk-3cn9y08d.js";import"./chunk-5q9ss7ty.js";import"./chunk-hmae7ha6.js";import{ht,qe,he,sn,Ae,er,tr,Ke}from"./chunk-x9haxcsj.js";import{i}from"./chunk-fpagqrd1.js";import"./chunk-0e9xdrzx.js";import"./chunk-nv9dy71x.js";import{ds}from"./chunk-06zn167b.js";import"./chunk-0jn79fkt.js";import"./chunk-jt28zh50.js";import{gt}from"./chunk-76fcwbe1.js";import"./chunk-19safa6y.js";import"./chunk-6n195hvc.js";import{Qr}from"./chunk-r5jytt0f.js";import{Dr,Zs,Qs}from"./chunk-v20cwjgz.js";import"./chunk-qn4gt8sx.js";import"./chunk-sgm6tg8h.js";import"./chunk-0dkd26t4.js";import"./chunk-3kfbs0mw.js";import"./chunk-1mfj2j5g.js";import{existsSync as Te,mkdirSync as Ri,readFileSync as Ti}from"fs";import G from"path";import{existsSync as at,mkdirSync as Sn,realpathSync as pi,rmSync as wn}from"fs";import F from"path";import{existsSync as ri}from"fs";import Z from"path";var Tn="data-stx-b",lt=new Set(_i),_n=new Set(qs);function Ee(e){if(e==="ref"||e==="data-stx-ref")return"ref";if(e.startsWith("::"))return null;if(e.startsWith("@bind:")||e.startsWith("x-bind:"))return"attr";if(e.startsWith("@")||e.startsWith(":")){let t=e.slice(1).split(".")[0];if(lt.has(t))return t==="if"?"if":t;if(t==="for"||t==="else"||t==="else-if"||t==="elseif")return"for";if(dl(t))return"event";if(e.startsWith("@"))return"event";return"attr"}if(e.startsWith("x-")){let t=e.split(".")[0];if(!_n.has(t))return"attr";let n=t.slice(2);if(n==="cloak"||n==="data"||n==="bind")return null;if(n==="tooltip"||n==="tooltip-position")return null;return lt.has(n)?n==="if"?"if":n:"attr"}return null}function An(e){let t=[];for(let[n,r]of e){let s=Ee(n);if(s)t.push({name:n,value:r,kind:s})}return t}var En=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,_e=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function ut(e){let t=[],n=0;return{html:e.replace(En,(s,o,c)=>{if(!c||!/[:@]|x-/.test(c))return s;let u=[];_e.lastIndex=0;for(let m=_e.exec(c);m;m=_e.exec(c))u.push([m[1],m[2]??m[3]??m[4]??""]);let d=An(u);if(!d.length)return s;let f={id:n++,bindings:d};if(d.some((m)=>m.kind==="for"))f.template=!0;t.push(f);let h=s.endsWith("/>");return`${s.slice(0,h?-2:-1).trimEnd()} ${Tn}="${f.id}"${h?"/>":">"}`}),manifest:{entries:t}}}import mr from"path";function fe(e){let t=e&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(e.trim());if(!t)return;let n=Number(t[1])*(t[2]==="rem"?16:1);return Number.isFinite(n)?n:void 0}function Ie(e,t){if(!he[e])return;return fe(t?.get(sn(e))??he[e].value)}function Ce(e,t){let n=er[e];if(!n)return;return fe(t?.get(Ke(n))??Ae[n]?.value)}function Oe(e,t){let n=tr[e];if(!n)return;let r=fe(t?.get(Ke(n.size))??Ae[n.size]?.value),s=fe(t?.get(Ke(n.leading))??Ae[n.leading]?.value);if(r===void 0||s===void 0)return;return{fontSize:r,lineHeight:s}}var In={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},mt=Me({}),dt,ft=null;function pe(){let e=globalThis.__stxNativeStyleConfig;if(!e)return mt;if(e!==dt)dt=e,ft=Me(e);return ft}function yt(e,t=new Map,n=""){for(let[r,s]of Object.entries(e??{})){let o=r==="DEFAULT"?n.replace(/-$/,""):`${n}${r}`;if(typeof s==="string")t.set(o,s);else if(s&&typeof s==="object")yt(s,t,`${o}-`)}return t}function bt(e){let t={};for(let[n,r]of Object.entries(e??{})){let s=typeof r==="number"?r:Number.parseFloat(String(r));if(Number.isFinite(s))t[n]=s}return t}function Me(e){return{shortcuts:new Map(Object.entries(e.shortcuts??{}).filter(([,t])=>typeof t==="string")),colors:yt(e.colors),fontFamily:new Map(Object.entries(e.fontFamily??{}).map(([t,n])=>[t,Array.isArray(n)?n.join(", "):n])),breakpoints:new Map(Object.entries({...In,...bt(e.breakpoints)}))}}var Pe={};function pt(e){Pe=e??{},mt=Me(Pe)}async function vt(e,t){let n=Pe;pt(e);try{return await t()}finally{pt(n)}}function St(e){if(!e)return{};let t=e.theme??{},n=Object.fromEntries(Object.entries(e.shortcuts??{}).filter(([,r])=>typeof r==="string"));return{...Object.keys(n).length?{shortcuts:n}:{},...t.fontFamily?{fontFamily:JSON.parse(JSON.stringify(t.fontFamily))}:{},...t.colors?{colors:JSON.parse(JSON.stringify(t.colors))}:{},...t.screens?{breakpoints:bt(t.screens)}:{}}}function wt(e){return pe().shortcuts.get(e)}function xt(e){return pe().colors.get(e)}function Be(e){return pe().breakpoints.get(e)}function ge(e){return pe().fontFamily.get(e)}var kt=/^--[\w\u0080-\uFFFF-]+$/u;function Nt(e,t){if(!/var\(/i.test(e))return e;let n="",r="",s=!1;for(let o=0;o<e.length;o++){let c=e[o];if(c==="\\"){n+=e.slice(o,o+2),o++;continue}if(r){if(n+=c,c===r)r="";continue}if(c==='"'||c==="'"){r=c,n+=c;continue}if(e.slice(o,o+4).toLowerCase()!=="var("||o>0&&/[\w-]/.test(e[o-1])){n+=c;continue}let u=1,d=-1,f="",h=o+4;for(;h<e.length;h++){let y=e[h];if(y==="\\"){h++;continue}if(f){if(y===f)f="";continue}if(y==='"'||y==="'"){f=y;continue}if(y==="(")u++;if(y===")"&&--u===0)break;if(y===","&&u===1&&d===-1)d=h}if(u!==0)return;let p=e.slice(o+4,d===-1?h:d).trim();if(!kt.test(p))return;let m=t(p,d===-1?void 0:e.slice(d+1,h).trim());if(m===void 0||n.length+m.length>65536)return;n+=m,s=!0,o=h}return s&&n.length>65536?void 0:n}function ae(e,t){let n=new Map,r=new Set;for(let[g,l]of e){let w=g.trim();if(!kt.test(w))continue;if(typeof l==="string"||typeof l==="number"&&Number.isFinite(l))n.set(w,String(l).trim())}let s=new Map,o=new Set;for(let[g,l]of n){let w=new Set,b=(N,S=0)=>S>64?void 0:Nt(N,(k,x)=>(w.add(k),x===void 0?"":b(x,S+1)));if(b(l)===void 0)o.add(g);s.set(g,w)}let c=new Map,u=new Map,d=[],f=new Set,h=0;function p(g,l=0){if(l>64){o.add(g);return}c.set(g,h),u.set(g,h++),d.push(g),f.add(g);for(let N of s.get(g)??[]){if(!n.has(N))continue;if(!c.has(N)){if(p(N,l+1),u.has(N))u.set(g,Math.min(u.get(g),u.get(N)))}else if(f.has(N))u.set(g,Math.min(u.get(g),c.get(N)))}if(u.get(g)!==c.get(g))return;let w=[],b;do b=d.pop(),f.delete(b),w.push(b);while(b!==g);if(w.length>1||s.get(g)?.has(g))w.forEach((N)=>o.add(N))}for(let g of n.keys())if(!c.has(g))p(g);let m=new Map;function y(g,l){if(r.add(g),m.has(g))return m.get(g);let w=n.get(g),b=w===void 0||/^(?:inherit|unset)$/i.test(w)?t?.get(g):o.has(g)||/^(?:initial|revert|revert-layer)$/i.test(w)?void 0:v(w,l+1);return m.set(g,b),b}function v(g,l=0){if(l>64)return;return Nt(g,(w,b)=>y(w,l)??(b===void 0?void 0:v(b,l+1)))}return{resolve:v,used:r,computed(){let g=new Map(t);for(let l of n.keys())g.set(l,y(l,0));return g}}}function Le(e){if(e.display==="flex"&&e.flexDirection==null)return{...e,flexDirection:"row"};return e}var Rt=new Set(["display","gridColumns","gridTemplateColumns","gridTemplateRows","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","order","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","objectFit","objectPosition","tintColor","transform","overflow","pointerEvents","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),Cn=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","order","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),Tt=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"]),_t=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,On=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,Pn=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),Mn=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function Bn(e){if(typeof e!=="string")return e;let t=On.exec(e);return t?Number(t[1])*(/^r?em$/i.test(t[2]||"")?16:1):e}function ie(e){return typeof e==="number"&&Number.isFinite(e)}function Ln(e,t){if(e==="shadowOffset"&&t&&typeof t==="object"&&!Array.isArray(t)){let{width:n,height:r}=t;return ie(n)&&ie(r)?{width:n,height:r}:void 0}if(e==="transform"&&Array.isArray(t)){let n=[];for(let r of t){if(!r||typeof r!=="object"||Array.isArray(r)||Object.keys(r).length!==1)return;let[s,o]=Object.entries(r)[0];if(Mn.has(s)&&ie(o))n.push({[s]:o});else if(Pn.has(s)&&typeof o==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(o))n.push({[s]:o});else return}return n}return}function $n(e){let t=[],n=0,r=0,s="";for(let o=0;o<=e.length;o++){let c=e[o];if(c==="\\"){o++;continue}if(s){if(c===s)s="";continue}if(c==='"'||c==="'"){s=c;continue}if(c==="(")r++;if(c===")")r=Math.max(0,r-1);if(o!==e.length&&(c!==";"||r))continue;let u=e.slice(n,o),d=u.indexOf(":");if(d!==-1)t.push([u.slice(0,d).trim(),u.slice(d+1).trim()]);n=o+1}return t}function Dn(e,t){let n;if(typeof e==="string"){if(e=e.trim(),!e)return[];try{e=JSON.parse(e)}catch{}}if(typeof e==="string")n=$n(e);else if(e&&typeof e==="object"&&!Array.isArray(e))n=Object.entries(e);else{if(e!=null&&e!==!1)t({kind:"non-numeric-style",name:"style"});return[]}return n}function me(e,t=()=>{},n={}){let r=Dn(e,t),s=ae(r,n.inheritedVariables);return n.onVariables?.(s.computed()),jn(r,s,t)}function jn(e,t,n){let r={},s=[];for(let[o,c]of e){if(o.trim().startsWith("--")){s.push(o.trim());continue}let u=Rt.has(o)||o.trim().startsWith("--")?o:o.trim().toLowerCase().replace(/-([a-z])/g,(h,p)=>p.toUpperCase());if(!Rt.has(u)){n({kind:"unknown-style",name:u});continue}if(c==null||c==="")continue;let d=typeof c==="string"?t.resolve(c.trim()):c;if(d===void 0){n({kind:"non-numeric-style",name:u});continue}if(d==="")continue;if(u==="pointerEvents"){if(typeof d==="string"&&["auto","none","box-none","box-only"].includes(d))r.pointerEvents=d;else n({kind:"unknown-style",name:`pointerEvents:${String(d)}`});continue}if(u==="objectFit"){let h=typeof d==="string"?d.trim().toLowerCase():"";if(["fill","contain","cover","none","scale-down"].includes(h))r.objectFit=h;else n({kind:"unknown-style",name:`objectFit:${String(d)}`});continue}if(u==="objectPosition"){let h=typeof d==="string"?d.trim().toLowerCase().replace(/\s+/g," "):"",p=h.split(" ");if(p.length===1)p.push("center");if(["top","bottom"].includes(p[0])||["left","right"].includes(p[1]))p.reverse();let m=(y)=>y.endsWith("%")&&_t.test(y.slice(0,-1))&&Number.isFinite(Number(y.slice(0,-1)));if(p.length===2&&(["left","center","right"].includes(p[0])||m(p[0]))&&(["top","center","bottom"].includes(p[1])||m(p[1])))r.objectPosition=h;else n({kind:"unknown-style",name:`objectPosition:${String(d)}`});continue}let f;if(Cn.has(u)||Tt.has(u)){if(f=Bn(d),!ie(f)&&!(Tt.has(u)&&typeof f==="string"&&f.endsWith("%")&&_t.test(f.slice(0,-1))&&Number.isFinite(Number(f.slice(0,-1)))))f=void 0}else if(u==="display"&&d==="inline-flex")f="flex";else if(u==="shadowOffset"||u==="transform")f=Ln(u,d);else if(u==="gridTemplateColumns"||u==="gridTemplateRows")f=ie(d)||typeof d==="string"?d:void 0;else if(u==="fontWeight"&&ie(d))f=String(d);else if(typeof d==="string")f=d;if(f===void 0)n({kind:"non-numeric-style",name:u});else r[u]=f}for(let o of s)if(!t.used.has(o))n({kind:"unknown-style",name:o});return r}var Vn={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"}},De={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},At={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},Et={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function ne(e){let t=e.lastIndexOf("/");if(t>0&&(!e.endsWith("]")||/\/\[[\d.]+%?\]$/.test(e))){let r=ne(e.slice(0,t)),s=e.slice(t+1),o=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!r||!Number.isFinite(o))return;return Wn(r,o/100)}if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="black")return"#000000";if(e==="white")return"#ffffff";let n=e.split("-");if(n.length===2){let[r,s]=n,o=Vn[r];if(o&&typeof o==="object")return o[s]}if(e.startsWith("[")&&e.endsWith("]")){let r=e.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(r)?r:void 0}return}function je(e){return ne(e.trim())}function Wn(e,t){if(e==="transparent")return e;let n=e.startsWith("#")?e.slice(1):"";if(n.length===3)n=n.split("").map((s)=>s+s).join("");if(n.length===8)n=n.slice(0,6);if(n.length!==6)return;let r=Math.round(Math.min(1,Math.max(0,t))*255);return`#${n}${r.toString(16).padStart(2,"0")}`}function $e(e,t=16){if(!e.startsWith("[")||!e.endsWith("]"))return;let n=e.slice(1,-1),r=Number.parseFloat(n);if(!Number.isFinite(r))return;if(n.endsWith("rem"))return r*16;if(n.endsWith("em"))return r*t;return r}function z(e){if(e.startsWith("[")&&e.endsWith("]")){let t=e.slice(1,-1);if(t.endsWith("%"))return;let n=t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t);return Number.isFinite(n)?n:void 0}return De[e]??Ce(e)}function be(e){let t=/^\[(-?\d*\.?\d+)%\]$/.exec(e);if(t)return`${Number.parseFloat(t[1])}%`;return z(e)}var Fn={flex:(e,t)=>(t.display="flex",!0),block:(e,t)=>(t.display="flex",!0),hidden:(e,t)=>(t.display="none",!0),grid:(e,t)=>(t.display="grid",!0),"flex-row":(e,t)=>(t.flexDirection="row",!0),"flex-col":(e,t)=>(t.flexDirection="column",!0),"flex-row-reverse":(e,t)=>(t.flexDirection="row-reverse",!0),"flex-col-reverse":(e,t)=>(t.flexDirection="column-reverse",!0),"flex-wrap":(e,t)=>(t.flexWrap="wrap",!0),"flex-nowrap":(e,t)=>(t.flexWrap="nowrap",!0),"flex-wrap-reverse":(e,t)=>(t.flexWrap="wrap-reverse",!0),"flex-1":(e,t)=>(t.flex=1,t.flexGrow=1,t.flexShrink=1,t.flexBasis=0,!0),"flex-auto":(e,t)=>(t.flexGrow=1,t.flexShrink=1,!0),"flex-initial":(e,t)=>(t.flexGrow=0,t.flexShrink=1,!0),"flex-none":(e,t)=>(t.flexGrow=0,t.flexShrink=0,!0),grow:(e,t)=>(t.flexGrow=1,!0),"grow-0":(e,t)=>(t.flexGrow=0,!0),shrink:(e,t)=>(t.flexShrink=1,!0),"shrink-0":(e,t)=>(t.flexShrink=0,!0),"order-first":(e,t)=>(t.order=-9999,!0),"order-last":(e,t)=>(t.order=9999,!0),"order-none":(e,t)=>(t.order=0,!0),"justify-start":(e,t)=>(t.justifyContent="flex-start",!0),"justify-center":(e,t)=>(t.justifyContent="center",!0),"justify-end":(e,t)=>(t.justifyContent="flex-end",!0),"justify-between":(e,t)=>(t.justifyContent="space-between",!0),"justify-around":(e,t)=>(t.justifyContent="space-around",!0),"justify-evenly":(e,t)=>(t.justifyContent="space-evenly",!0),"items-start":(e,t)=>(t.alignItems="flex-start",!0),"items-center":(e,t)=>(t.alignItems="center",!0),"items-end":(e,t)=>(t.alignItems="flex-end",!0),"items-stretch":(e,t)=>(t.alignItems="stretch",!0),"items-baseline":(e,t)=>(t.alignItems="baseline",!0),"self-auto":(e,t)=>(t.alignSelf="auto",!0),"self-start":(e,t)=>(t.alignSelf="flex-start",!0),"self-center":(e,t)=>(t.alignSelf="center",!0),"self-end":(e,t)=>(t.alignSelf="flex-end",!0),"self-stretch":(e,t)=>(t.alignSelf="stretch",!0),"self-baseline":(e,t)=>(t.alignSelf="baseline",!0),"min-w-0":(e,t)=>(t.minWidth=0,!0),"aspect-square":(e,t)=>(t.aspectRatio=1,!0),"aspect-video":(e,t)=>(t.aspectRatio=1.7777777777777777,!0),"border-solid":(e,t)=>(t.borderStyle="solid",!0),"border-dashed":(e,t)=>(t.borderStyle="dashed",!0),"border-dotted":(e,t)=>(t.borderStyle="dotted",!0),group:()=>!0,peer:()=>!0,"inset-0":(e,t)=>(t.top=0,t.right=0,t.bottom=0,t.left=0,!0),"mx-auto":(e,t)=>(t.alignSelf="center",!0),fixed:(e,t)=>(t.position="absolute",!0),sticky:()=>!0,"sr-only":(e,t)=>(t.position="absolute",t.width=1,t.height=1,t.overflow="hidden",!0),inline:()=>!0,"inline-block":()=>!0,contents:()=>!0,"align-top":()=>!0,"align-middle":()=>!0,"align-bottom":()=>!0,"align-baseline":()=>!0,"align-text-top":()=>!0,"whitespace-normal":()=>!0,"whitespace-pre":()=>!0,"whitespace-pre-line":()=>!0,"whitespace-pre-wrap":()=>!0,"whitespace-nowrap":()=>!0,"break-words":()=>!0,"break-all":()=>!0,"break-normal":()=>!0,"object-cover":()=>!0,"object-contain":()=>!0,"object-fill":()=>!0,"object-center":()=>!0,"tracking-tighter":(e,t)=>(t.letterSpacing=-0.8,!0),"tracking-tight":(e,t)=>(t.letterSpacing=-0.4,!0),"tracking-normal":(e,t)=>(t.letterSpacing=0,!0),"tracking-wide":(e,t)=>(t.letterSpacing=0.4,!0),"tracking-wider":(e,t)=>(t.letterSpacing=0.8,!0),"tracking-widest":(e,t)=>(t.letterSpacing=1.6,!0),"tabular-nums":()=>!0,"inline-flex":(e,t)=>(t.display="flex",!0),truncate:()=>!0,relative:(e,t)=>(t.position="relative",!0),absolute:(e,t)=>(t.position="absolute",!0),"pointer-events-none":(e,t)=>(t.pointerEvents="none",!0),"pointer-events-auto":(e,t)=>(t.pointerEvents="auto",!0),"overflow-visible":(e,t)=>(t.overflow="visible",!0),"overflow-hidden":(e,t)=>(t.overflow="hidden",!0),"overflow-scroll":(e,t)=>(t.overflow="scroll",!0),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-scroll":()=>!0,"font-sans":(e,t)=>(t.fontFamily=ge("sans")??"sans-serif",!0),"font-serif":(e,t)=>(t.fontFamily=ge("serif")??"serif",!0),"font-mono":(e,t)=>(t.fontFamily=ge("mono")??"monospace",!0),"font-thin":(e,t)=>(t.fontWeight="100",!0),"font-extralight":(e,t)=>(t.fontWeight="200",!0),"font-light":(e,t)=>(t.fontWeight="300",!0),"font-normal":(e,t)=>(t.fontWeight="400",!0),"font-medium":(e,t)=>(t.fontWeight="500",!0),"font-semibold":(e,t)=>(t.fontWeight="600",!0),"font-bold":(e,t)=>(t.fontWeight="bold",!0),"font-extrabold":(e,t)=>(t.fontWeight="800",!0),"font-black":(e,t)=>(t.fontWeight="900",!0),italic:(e,t)=>(t.fontStyle="italic",!0),"not-italic":(e,t)=>(t.fontStyle="normal",!0),"text-left":(e,t)=>(t.textAlign="left",!0),"text-center":(e,t)=>(t.textAlign="center",!0),"text-right":(e,t)=>(t.textAlign="right",!0),"text-justify":(e,t)=>(t.textAlign="justify",!0),uppercase:(e,t)=>(t.textTransform="uppercase",!0),lowercase:(e,t)=>(t.textTransform="lowercase",!0),capitalize:(e,t)=>(t.textTransform="capitalize",!0),"normal-case":(e,t)=>(t.textTransform="none",!0),underline:(e,t)=>(t.textDecorationLine="underline",!0),"line-through":(e,t)=>(t.textDecorationLine="line-through",!0),"no-underline":(e,t)=>(t.textDecorationLine="none",!0)};function Xn(e,t){if(!e.startsWith("bg-"))return!1;let n=e.slice(3),r=ne(n);if(r)return t.backgroundColor=r,!0;return!1}function It(e,t){if(!e.startsWith("text-"))return!1;let n=e.slice(5),r=Oe(n);if(r)return Object.assign(t,r),!0;if(At[n])return t.fontSize=At[n],!0;if(n.startsWith("[")&&n.endsWith("]")){let o=n.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(o)){let c=o.endsWith("rem")||o.endsWith("em")?Number.parseFloat(o)*16:Number.parseFloat(o);if(Number.isFinite(c))return t.fontSize=c,!0}}let s=ne(n);if(s)return t.color=s,!0;return!1}var zn=new Set(["t","tr","r","br","b","bl","l","tl"]);function Un(e,t){let n=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(e);if(n&&zn.has(n[1]))return t.gradientDirection=`to-${n[1]}`,!0;let r=/^(from|via|to)-(.+)$/.exec(e);if(!r)return!1;let s=ne(r[2]);if(!s)return!1;if(r[1]==="from")t.gradientFrom=s;else if(r[1]==="via")t.gradientVia=s;else t.gradientTo=s;return!0}function Hn(e,t){for(let n of["fill","stroke"]){let r=`${n}-`;if(!e.startsWith(r))continue;let s=e.slice(r.length);if(s==="none")return t[n]="none",!0;if(n==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return t.strokeWidth=Number.parseFloat(s),!0;if(n==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return t.strokeWidth=Number.parseFloat(s.slice(1)),!0;let o=ne(s);if(o)return t[n]=o,!0}return!1}function qn(e,t){if(e.startsWith("p-")){let n=z(e.slice(2));if(n!==void 0)return t.padding=n,!0}if(e.startsWith("px-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingHorizontal=n,!0}if(e.startsWith("py-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingVertical=n,!0}if(e.startsWith("pt-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingTop=n,!0}if(e.startsWith("pr-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingRight=n,!0}if(e.startsWith("pb-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingBottom=n,!0}if(e.startsWith("pl-")){let n=z(e.slice(3));if(n!==void 0)return t.paddingLeft=n,!0}return!1}function Ot(e,t){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(e)){let n={};if(!Ot(e.slice(1),n))return!1;let r=Object.entries(n);if(r.some(([,s])=>typeof s!=="number"))return!1;for(let[s,o]of r)t[s]=-o;return!0}if(e.startsWith("m-")){let n=z(e.slice(2));if(n!==void 0)return t.margin=n,!0}if(e.startsWith("mx-")){let n=z(e.slice(3));if(n!==void 0)return t.marginHorizontal=n,!0}if(e.startsWith("my-")){let n=z(e.slice(3));if(n!==void 0)return t.marginVertical=n,!0}if(e.startsWith("mt-")){let n=z(e.slice(3));if(n!==void 0)return t.marginTop=n,!0}if(e.startsWith("mr-")){let n=z(e.slice(3));if(n!==void 0)return t.marginRight=n,!0}if(e.startsWith("mb-")){let n=z(e.slice(3));if(n!==void 0)return t.marginBottom=n,!0}if(e.startsWith("ml-")){let n=z(e.slice(3));if(n!==void 0)return t.marginLeft=n,!0}return!1}function Gn(e,t){if(!e.startsWith("w-"))return!1;let n=e.slice(2);if(n==="full")return t.width="100%",!0;if(n==="screen")return t.width="100%",!0;if(n==="auto")return t.width="auto",!0;if(n.includes("/")){let[s,o]=n.split("/"),c=Number.parseInt(s)/Number.parseInt(o)*100;return t.width=`${c}%`,!0}let r=be(n);if(r!==void 0)return t.width=r,!0;return!1}function Jn(e,t){if(!e.startsWith("h-"))return!1;let n=e.slice(2);if(n==="full")return t.height="100%",!0;if(n==="screen")return t.height="100%",!0;if(n==="auto")return t.height="auto",!0;let r=be(n);if(r!==void 0)return t.height=r,!0;return!1}function Kn(e,t){if(e==="rounded")return t.borderRadius=Et.DEFAULT,!0;if(!e.startsWith("rounded-"))return!1;let n=e.slice(8);if(n==="")return!1;let r=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(n),s=Et[r[2]]??Ie(r[2])??$e(r[2]);if(s===void 0)return!1;let o={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],tl:["borderTopLeftRadius"],tr:["borderTopRightRadius"],bl:["borderBottomLeftRadius"],br:["borderBottomRightRadius"]};for(let c of r[1]?o[r[1]]:["borderRadius"])t[c]=s;return!0}function Yn(e,t){let n=/^border(?:-([trblxy]))?(?:-(\d+|\[[^\]]+\]))?$/.exec(e);if(!n)return!1;let[,r="",s]=n,o=s===void 0?1:Number(s);if(s?.startsWith("[")){let u=/^\[(\d+(?:\.\d+)?|\.\d+)(px|rem)?\]$/.exec(s);if(!u)return!1;o=Number(u[1])*(u[2]==="rem"?16:1)}if(!Number.isFinite(o)||o<0)return!1;let c={"":["borderWidth"],t:["borderTopWidth"],r:["borderRightWidth"],b:["borderBottomWidth"],l:["borderLeftWidth"],x:["borderLeftWidth","borderRightWidth"],y:["borderTopWidth","borderBottomWidth"]};for(let u of c[r])t[u]=o;return!0}function Qn(e,t){if(!e.startsWith("border-"))return!1;let n=e.slice(7),r=ne(n);if(r)return t.borderColor=r,!0;return!1}function Zn(e,t){if(!e.startsWith("opacity-"))return!1;let n=Number.parseInt(e.slice(8));if(!Number.isNaN(n))return t.opacity=n/100,!0;return!1}function nr(e,t,n){if(e.startsWith("tracking-[")){let r=$e(e.slice(9),n);if(r===void 0)return!1;return t.letterSpacing=r,!0}if(e.startsWith("leading-")){let r=e.slice(8),s=n,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},c=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*s:$e(r,s):o[r]!==void 0?o[r]*s:De[r];if(c===void 0||!Number.isFinite(c))return!1;return t.lineHeight=c,!0}return!1}function rr(e,t){let n=/^(-?)(inset-x|inset-y|inset|top|right|bottom|left)-(.+)$/.exec(e);if(!n)return!1;let r=n[3],s=/^\[(-?[\d.]+)px\]$/.exec(r),o=s?Number(s[1]):De[r];if(o===void 0||!Number.isFinite(o))return!1;let c=n[1]?-o:o,u=n[2]==="inset"?["top","right","bottom","left"]:n[2]==="inset-x"?["left","right"]:n[2]==="inset-y"?["top","bottom"]:[n[2]];for(let d of u)t[d]=c;return!0}function ir(e,t){let n=/^grid-cols-\[(.+)\]$/.exec(e);if(n)return t.gridColumns=n[1].split("_").filter(Boolean).length,!0;let r=/^grid-cols-(\d+)$/.exec(e);if(!r)return!1;return t.gridColumns=Number(r[1]),!0}function sr(e,t){if(!e.startsWith("size-"))return!1;let n=e.slice(5),r=n==="full"?"100%":be(n);if(r===void 0)return!1;return t.width=r,t.height=r,!0}var or={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function ar(e,t){let n=/^(min|max)-(w|h)-(.+)$/.exec(e);if(!n)return!1;let[,r,s,o]=n,c=o==="full"||o==="screen"?"100%":o==="none"?void 0:s==="w"&&r==="max"&&or[o]||be(o);if(c===void 0&&o!=="none")return!1;let u=`${r}${s==="w"?"Width":"Height"}`;if(c===void 0)delete t[u];else t[u]=c;return!0}function cr(e,t){let n=/^(-?)(top|right|bottom|left)-(.+)$/.exec(e);if(!n)return!1;let r=n[3]==="full"?"100%":z(n[3]);if(r===void 0)return!1;return t[n[2]]=typeof r==="number"&&n[1]?-r:r,!0}function lr(e,t){let n=/^(-?)translate-(x|y)-(.+)$/.exec(e);if(!n)return!1;let r=n[3],s;if(r.startsWith("[")){let u=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(r);if(!u)return!1;s=Number(u[1])*(u[2]?.endsWith("em")?16:1)}else s=z(r);if(s===void 0||!Number.isFinite(s))return!1;if(n[1])s=-s;let o=n[2]==="x"?"translateX":"translateY",c=o==="translateX"?{translateX:s}:{translateY:s};return t.transform=[...(t.transform??[]).filter((u)=>!(o in u)),c],!0}function ur(e,t){let n=/^space-(x|y)-(.+)$/.exec(e);if(!n)return!1;let r=z(n[2]);if(r===void 0)return!1;return t.gap=r,!0}function dr(e,t){if(e.startsWith("gap-")){let n=z(e.slice(4));if(n!==void 0)return t.gap=n,!0}if(e.startsWith("gap-x-")){let n=z(e.slice(6));if(n!==void 0)return t.columnGap=n,!0}if(e.startsWith("gap-y-")){let n=z(e.slice(6));if(n!==void 0)return t.rowGap=n,!0}return!1}function fr(e,t){let r={"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]}[e];if(!r)return!1;let[s,o,c,u]=r;return Object.assign(t,{shadowColor:"#000000",shadowOpacity:c,shadowRadius:s,shadowOffset:{width:0,height:o},elevation:u}),!0}function pr(e){let t=/^divide-(?:(y|x)(?:-(.+))?|(.+))$/.exec(e);if(!t)return null;if(t[2]==="reverse")return"";if(t[1])return`border-${t[1]==="y"?"t":"l"}${t[2]?`-${t[2]}`:""}`;return`border-${t[3]}`}var Pt=new Set(["aria-selected","aria-pressed","aria-checked","aria-expanded"]),gr=new Set(["hover","group-hover","peer-hover","active","group-active","visited","placeholder","selection","print","motion-safe"]),hr=/^(?:transition(?:-[a-z]+)?|animate-\S+|scroll-[mp][trblxyse]?-\S+|snap-\S+|overscroll-\S+|duration-\S+|ease-\S+|delay-\S+|will-change-\S+|cursor-\S+|select-(?:none|text|all|auto)|outline-none|outline-0|appearance-none|scroll-smooth|scroll-auto|antialiased|subpixel-antialiased|touch-\S+|resize(?:-\S+)?|backdrop-blur(?:-\S+)?|isolate|contain-\S+)$/;function Mt(e){let t=[],n=0,r=0;for(let s=0;s<e.length;s++){let o=e[s];if(o==="[")n++;else if(o==="]")n=Math.max(0,n-1);else if(o===":"&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}function Bt(e,t=new Set){let n=Mt(e),r=n[n.length-1],s=t.has(r)?void 0:wt(r);if(s===void 0)return[e];let o=n.slice(0,-1).map((u)=>`${u}:`).join(""),c=new Set(t).add(r);return s.split(/\s+/).filter(Boolean).flatMap((u)=>Bt(`${o}${u}`,c))}function ve(e,t,n={}){let r=new Map,s=(v,g)=>{if(!r.has(v))r.set(v,{...g,classes:[],authored:new Map});return r.get(v)};s("base",{});let o=[],c=[],u=e.split(/\s+/).filter(Boolean);if(n.rules){let v=new Set(u);for(let g of Object.keys(n.rules))if(g.includes(".")&&g.split(".").every((l)=>v.has(l)))c.push(g);c.sort((g,l)=>g.split(".").length-l.split(".").length)}for(let v of u){if(n.rules&&Object.hasOwn(n.rules,v)){o.push(v);continue}for(let g of Bt(v)){let l=Mt(g),w=l.pop(),b=l.some((C)=>C.startsWith("focus"));if(l.some((C)=>/^(?:group-|peer-)?focus(?:-visible|-within)?$/.test(C))&&/^(?:ring|outline)(?:-|$)/.test(w))continue;if(hr.test(w)||!b&&l.some((C)=>gr.has(C)))continue;let N,S,k=!1,x,A=[];for(let C of l){let E=Be(C),I=C.startsWith("max-")?Be(C.slice(4)):void 0;if(E!==void 0&&N===void 0)N=E;else if(I!==void 0&&S===void 0)S=I-0.02;else if(C==="disabled"&&!k)k=!0;else if(Pt.has(C)&&x===void 0)x=C;else A.push(C)}let M=[...A,w].join(":"),j=N!==void 0||S!==void 0,T=k?s("disabled",{disabled:!0}):x?s(`state:${x}`,{state:x}):j?s(`range:${N??0}:${S??""}`,{min:N??0,max:S}):r.get("base");if((k||x)&&(j||k&&x)){r.get("base").authored.set(g,v),r.get("base").classes.push(g);continue}if(T.classes.push(M),!T.authored.has(M))T.authored.set(M,v===g?g:`${v} (${g})`)}}let d=[...o,...c],f=(v,g)=>g.map((l)=>v.authored.get(l)??l),h=r.get("base"),p=ye(h.classes.join(" "),t,n),m=new Map;if(d.length){let v=(w)=>w?me(w,()=>{},{inheritedVariables:t}):{},g={},l={};for(let w of d){let b=n.rules[w];g={...g,...v(b.light)},l={...l,...v(b.dark)};for(let N of b.responsive??[]){let S=`${N.min}:${N.max??""}`,k=m.get(S)??{min:N.min,...N.max===void 0?{}:{max:N.max},style:{}};if(k.style={...k.style,...v(N.light)},N.dark)k.dark={...k.dark,...v(N.dark)};m.set(S,k)}}if(p.style={...g,...p.style},Object.keys(l).length)p.dark={...l,...p.dark}}p.unknown=f(h,p.unknown);let y=[];for(let v of r.values()){if(v===h)continue;let g=ye(v.classes.join(" "),t,{appearance:n.appearance});p.unknown=[...new Set([...p.unknown,...f(v,g.unknown)])];let l={style:g.style,...g.dark?{dark:g.dark}:{}};if(v.disabled)p.disabled=l;else if(v.state)(p.states??={})[v.state]=l;else y.push({min:v.min??0,...v.max===void 0?{}:{max:v.max},...l})}for(let v of m.values()){let g=y.find((l)=>l.min===v.min&&l.max===v.max);if(g){if(g.style={...v.style,...g.style},v.dark||g.dark)g.dark={...v.dark,...g.dark}}else y.push(v)}if(y.length)p.responsive=y.sort((v,g)=>v.min-g.min||(v.max??1/0)-(g.max??1/0));return p}function ye(e,t,n={}){let r=[],s=[],o=[],c=[],u={focus:{classes:[],originals:new Map},focusWithin:{classes:[],originals:new Map}},d=new Map;function f(b,N){let S=/^(bg|text|border(?:-[trblxy])?|from|via|to|fill|stroke|divide|decoration|caret|accent)-(.+?)(\/[^\s]+)?$/.exec(b),k=S&&xt(S[2]);if(S&&k){let T=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+?)\s*)?\)$/.exec(k),C=T?t?.get(T[1])??T[2]:k;if(C&&/^(?:#[0-9a-f]{3,8}|rgba?\(.+\)|hsla?\(.+\))$/i.test(C))return[`${S[1]}-[${C.replace(/\s+/g,"")}]${S[3]||""}`]}let x=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(b),A=x&&ht[x[2]];if(A){let T=t?.get(qe(x[2]));return[`${x[1]}-${T===void 0?A[N]:`[${T}]`}${x[3]||""}`]}let M=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(b);if(M&&he[M[2]]){let T=Ie(M[2],t);return T===void 0?void 0:[`rounded-${M[1]?`${M[1]}-`:""}[${T}px]`]}let j=b.startsWith("text-")?b.slice(5):"";if(tr[j]){let T=Oe(j,t);return T&&[`text-[${T.fontSize}px]`,`leading-[${T.lineHeight}px]`]}for(let T of Object.keys(er)){if(!b.endsWith(`-${T}`))continue;let C=Ce(T,t);return C===void 0?void 0:[`${b.slice(0,-T.length)}[${C}px]`]}return[b]}function h(b,N){if(!d.has(b))d.set(b,new Set);return d.get(b).add(N),b}let p=[],m=new Map;for(let b of e.split(/\s+/).filter(Boolean)){let N=b.startsWith("dark:")?b.slice(5):b,S=pr(N);if(S!==null){let A=S&&`${b===N?"":"dark:"}${S}`;if(A)p.push(A),m.set(A,b);continue}let k=/^(dark:)?(focus|focus-within):(dark:)?(.+)$/.exec(b),x=k?.[2]==="focus"?"focus":"focusWithin";if(k&&n[x]&&!(k[1]&&k[3])){let A=`${k[1]||k[3]?"dark:":""}${k[4]}`,M=u[x];M.classes.push(A),M.originals.set(A,[...M.originals.get(A)??[],b]);continue}if(b.startsWith("dark:")){let A=f(b.slice(5),"dark");if(!A)c.push(b);else s.push(...A.map((M)=>h(M,b)))}else if(!b.includes(":")||b.startsWith("[")){let A=f(b,n.appearance??"light"),M=f(b,"dark");if(!A||!M){c.push(b);continue}if(r.push(...A.map((j)=>h(j,b))),M.join(" ")!==A.join(" "))o.push(...M.map((j)=>h(j,b)))}else c.push(b)}let y=[],v=Ct(r,y),g={style:v,unknown:y},l=[...n.appearance===void 0?o:[],...s];if(l.length)g.dark=Ct(l,y);if(v.transform&&g.dark?.transform){let b=new Set(g.dark.transform.flatMap((N)=>Object.keys(N)));g.dark.transform=[...v.transform.filter((N)=>!Object.keys(N).some((S)=>b.has(S))),...g.dark.transform]}for(let b of r){if(b==="truncate"||b==="whitespace-nowrap")g.numberOfLines=1;let N=/^object-(cover|contain|fill)$/.exec(b);if(N)g.resizeMode=N[1]==="fill"?"stretch":N[1];let S=/^line-clamp-(\d+)$/.exec(b);if(S)g.numberOfLines=Number(S[1]);if(!g.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(b))g.icon=b}let w=y.flatMap((b)=>[...d.get(b)??[b]]);if(g.unknown=[...new Set([...w.filter((b)=>!/^line-clamp-\d+$/.test(b)),...c])],p.length){let b=ye(p.join(" "),t,{appearance:n.appearance});g.divide={style:b.style,...b.dark?{dark:b.dark}:{}},g.unknown=[...new Set([...g.unknown,...b.unknown.map((N)=>m.get(N)??N)])]}for(let b of["focus","focusWithin"]){let N=u[b];if(!N.classes.length)continue;let S=ye(N.classes.join(" "),t,{appearance:n.appearance});g[b]={style:S.style,dark:S.dark},g.unknown=[...new Set([...g.unknown,...S.unknown.flatMap((k)=>N.originals.get(k)??[k])])];for(let k of N.classes)if(/^(?:dark:)?(?:truncate|line-clamp-\d+|i-[a-z0-9]+-.+)$/.test(k))g.unknown.push(...N.originals.get(k))}return g}function Ct(e,t){let n={},r=Array.isArray(e)?e:e.split(/\s+/).filter(Boolean),s={};for(let c of r)if(c.startsWith("text-"))It(c,s);let o=typeof s.fontSize==="number"?s.fontSize:16;for(let c of r){if(/^i-[a-z0-9]+-/.test(c))continue;let u=Fn[c];if(u){u("",n);continue}if(fr(c,n))continue;if(Un(c,n))continue;if(Xn(c,n))continue;if(Hn(c,n))continue;if(It(c,n))continue;if(qn(c,n))continue;if(Ot(c,n))continue;if(Gn(c,n))continue;if(Jn(c,n))continue;if(Kn(c,n))continue;if(Yn(c,n))continue;if(Qn(c,n))continue;if(Zn(c,n))continue;if(dr(c,n))continue;if(nr(c,n,o))continue;if(sr(c,n))continue;if(ar(c,n))continue;if(ir(c,n))continue;let d=/^aspect-\[(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)\]$/.exec(c);if(d&&Number(d[2])>0){n.aspectRatio=Number(d[1])/Number(d[2]);continue}let f=/^z-\[(-?\d+)\]$/.exec(c)??/^z-(\d+)$/.exec(c);if(f){n.zIndex=Number(f[1]);continue}if(c==="z-auto")continue;if(rr(c,n))continue;let h=/^order-\[(-?\d+)\]$/.exec(c)??/^order-(-?\d+)$/.exec(c);if(h){n.order=Number(h[1]);continue}if(cr(c,n))continue;if(lr(c,n))continue;if(ur(c,n))continue;if(t?.push(c),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${c}`)}return n}var Lt=new Map;function $t(e,t){if(!e)return;let n=e.trim(),r=n.lastIndexOf("-"),s=r===-1?t[n]:t[n.slice(0,r)],o=r===-1?s:s?.[n.slice(r+1)];if(typeof o==="string"&&/^#[\da-f]{3,8}$/i.test(o))return o;return je(n)??je(`[${n}]`)}function yr(e){let t=e.roles??{},n=e.shapes??{},r=e.density??{},s={...e.theme?.colors,...e.theme?.extend?.colors},o=[],c=[];for(let[u,d]of Object.entries(t)){if(!ht[u])continue;let f=$t(typeof d==="string"?d:d?.light,s),h=$t(typeof d==="string"?d:d?.dark,s);if(f)o.push(`${qe(u)}: ${f};`);if(h)c.push(`${qe(u)}: ${h};`)}for(let[u,d]of Object.entries(n))if(he[u])o.push(`${sn(u)}: ${d};`);for(let[u,d]of Object.entries(r))if(Ae[u])o.push(`${Ke(u)}: ${d};`);return[o.length?`:root { ${o.join(" ")} }`:"",c.length?`.dark { ${c.join(" ")} }`:""].filter(Boolean).join(`
|
|
3
|
+
`)}async function br(e){let{resolveUserCssConfig:t}=await import("./chunk-davr7z73.js"),n=await t(e);return n?yr(n):""}function Dt(e){let t=mr.resolve(e),n=Lt.get(t);if(!n)n=br(t).catch(()=>""),Lt.set(t,n);return n}var Vt={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},jt={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 vr(e){return e==="role"||e==="aria-label"||e==="aria-valuetext"||e in Vt}function Sr(e,t){if(t===void 0||t===null)return;let n=String(t).trim().toLowerCase();if(n==="mixed")return e==="aria-checked"?"mixed":!0;if(n==="undefined")return;return n===""||n==="true"}function wr(e){if(e===void 0||e===null)return null;for(let t of String(e).trim().toLowerCase().split(/\s+/))if(jt[t])return jt[t];return null}function xr(e,t,n){if(e==="aria-label")return{accessibilityLabel:t===void 0||t===null||t===""?null:String(t)};if(e==="aria-valuetext")return{accessibilityValue:t===void 0||t===null||t===""?null:String(t)};if(e==="role")return{accessibilityRole:wr(t)};let r=Vt[e];if(!r)return;let s=n.accessibilityState,o=s&&typeof s==="object"?{...s}:{},c=Sr(e,t);if(c===void 0)delete o[r];else o[r]=c;return{accessibilityState:Object.keys(o).length?o:null}}function Nr(e){let t=e.accessibilityState&&typeof e.accessibilityState==="object"?e.accessibilityState:void 0,n={};for(let[s,o]of Object.entries(e)){if(!vr(s))continue;let c=xr(s,o,n);if(c)Object.assign(n,c)}for(let s of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(e[s]===void 0&&n[s]!==void 0&&n[s]!==null)e[s]=n[s];let r=n.accessibilityState;if(r)e.accessibilityState={...r,...t}}var Ve=["accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue"];function We(e,t){let n={...e};if(Nr(n),t==="Image"&&n.accessibilityLabel===void 0&&e.alt!=null&&e.alt!=="")n.accessibilityLabel=String(e.alt);return Object.fromEntries(Ve.filter((r)=>(r in n)).map((r)=>[r,n[r]]))}var Ft=["keyboardType","secureTextEntry","returnKeyType","autoCapitalize","autoCorrect","editable","autoComplete"],kr=new Set(["type","inputmode","inputMode","enterkeyhint","enterKeyHint","autoCapitalize","autoCorrect","spellcheck","readonly","readOnly","disabled",...Ft]),Rr={numeric:"number-pad",decimal:"decimal-pad",tel:"phone-pad",email:"email-address",url:"url",search:"web-search",text:"default"},Tr={email:{keyboardType:"email-address",verbatim:!0,autoComplete:"email"},tel:{keyboardType:"phone-pad",autoComplete:"tel"},url:{keyboardType:"url",verbatim:!0,autoComplete:"url"},number:{keyboardType:"decimal-pad"},search:{keyboardType:"web-search",returnKeyType:"search"},password:{secure:!0,verbatim:!0}},_r={enter:"default",done:"done",go:"go",next:"next",previous:"default",search:"search",send:"send"};function se(e){return e===void 0||e===null?"":String(e).trim().toLowerCase()}function Wt(e){if(e===void 0||e===null||e===!1)return!1;return se(e)!=="false"}function Fe(e,...t){for(let n of t)if(e[n]!==void 0&&e[n]!==null)return e[n];return}function Xt(e,t){if(e!=="TextInput")return{};let n={},r=se(t.type),s=Tr[r]??{},o=se(Fe(t,"inputmode","inputMode")),c=Rr[o]??s.keyboardType;if(c&&c!=="default")n.keyboardType=c;if(s.secure)n.secureTextEntry=!0;let u=se(Fe(t,"enterkeyhint","enterKeyHint")),d=_r[u]??s.returnKeyType;if(d&&d!=="default")n.returnKeyType=d;let f=se(t.autoCapitalize);if(f==="off"||f==="none")n.autoCapitalize="none";else if(f==="on")n.autoCapitalize="sentences";else if(!f&&s.verbatim)n.autoCapitalize="none";let h=t.autoCorrect;if(h==="off"||h==="false"||se(t.spellcheck)==="false"||h===void 0&&s.verbatim)n.autoCorrect=!1;else if(h==="on"||h==="true")n.autoCorrect=!0;if(Wt(Fe(t,"readonly","readOnly"))||Wt(t.disabled))n.editable=!1;if(s.autoComplete)n.autoComplete=s.autoComplete;return Object.fromEntries(Object.entries(n).filter(([p])=>t[p]===void 0||Ar(p,t[p])))}function Ar(e,t){if(e==="autoCapitalize")return t==="off"||t==="on";if(e==="autoCorrect")return typeof t==="string";return!1}function zt(e){let t=Xt(e.type,e.props);if(!Object.keys(t).length)return;e._textEntrySource=Object.fromEntries(Ft.filter((n)=>(n in e.props)).map((n)=>[n,e.props[n]])),Object.assign(e.props,t)}var Xe={"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",onchange:"onChange",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","page-selected":"onPageSelected",pageselected:"onPageSelected",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 Ue={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText",animate:"Animate"},He=new Set(Object.values(Ue));var qt=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Gt=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight","attributeName","keyTimes","repeatCount"];function U(e){let t=typeof e==="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function ee(e){return Math.round(e*1000)/1000}function Ge(e){if(Array.isArray(e)&&e.length===4&&e.every((n)=>Number.isFinite(Number(n))))return e.map(Number);let t=String(e??"").trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some((n)=>!Number.isFinite(n))||t[2]<=0||t[3]<=0)return null;return t}function Er(e){let t=String(e??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return t.length%2?t.slice(0,-1):t}var Ut=/[MLHVCSQTAZ]/i,ze=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function Ir(e){let t=[],n=e,r=Ut.exec(n);while(r){let s=r.index;n=n.slice(s);let o=n[0];n=n.slice(1);let c=Ut.exec(n),u=c?n.slice(0,c.index):n,d;if(o==="A"||o==="a"){d=[];let f=0,h=u.trim(),p=0;while(p<h.length){let m=f%7,y=h.slice(p).replace(/^[\s,]+/,"");if(p=h.length-y.length,!y)break;if(m===3||m===4)d.push(y[0]==="1"?1:0),p+=1;else{ze.lastIndex=0;let v=ze.exec(y);if(!v||v.index!==0)break;d.push(Number.parseFloat(v[0])),p+=v[0].length}f++}}else d=(u.match(ze)||[]).map(Number.parseFloat);t.push({command:o,args:d}),r=c}return t}function Cr(e,t,n,r,s,o,c,u,d){if(e===u&&t===d)return[];let f=Math.abs(n),h=Math.abs(r);if(!f||!h)return[1,u,d];let p=s*Math.PI/180,m=Math.cos(p),y=Math.sin(p),v=(e-u)/2,g=(t-d)/2,l=m*v+y*g,w=-y*v+m*g,b=l*l/(f*f)+w*w/(h*h);if(b>1)f*=Math.sqrt(b),h*=Math.sqrt(b);let N=f*f*h*h-f*f*w*w-h*h*l*l,S=f*f*w*w+h*h*l*l,k=Math.sqrt(Math.max(0,N/S));if(o===c)k=-k;let x=k*(f*w)/h,A=k*-(h*l)/f,M=m*x-y*A+(e+u)/2,j=y*x+m*A+(t+d)/2,T=(B,W,P,D)=>{let Y=B*D-W*P<0?-1:1,Q=(B*P+W*D)/(Math.hypot(B,W)*Math.hypot(P,D));return Y*Math.acos(Math.min(1,Math.max(-1,Q)))},C=T(1,0,(l-x)/f,(w-A)/h),E=T((l-x)/f,(w-A)/h,(-l-x)/f,(-w-A)/h);if(!c&&E>0)E-=2*Math.PI;if(c&&E<0)E+=2*Math.PI;let I=Math.max(1,Math.ceil(Math.abs(E)/(Math.PI/2))),V=E/I,R=1.3333333333333333*Math.tan(V/4),_=[],O=(B)=>{let W=f*Math.cos(B),P=h*Math.sin(B);return[m*W-y*P+M,y*W+m*P+j]},L=(B)=>{let W=-f*Math.sin(B),P=h*Math.cos(B);return[m*W-y*P,y*W+m*P]},X=C;for(let B=0;B<I;B++){let W=X+V,[P,D]=O(X),[Y,Q]=L(X),[H,K]=O(W),[te,q]=L(W);_.push(2,P+R*Y,D+R*Q,H-R*te,K-R*q,B===I-1?u:H,B===I-1?d:K),X=W}return _}function Jt(e){let t=[],n=0,r=0,s=0,o=0,c=0,u=0,d=0,f=0,h="";for(let{command:p,args:m}of Ir(String(e??""))){let y=p===p.toLowerCase(),v=p.toUpperCase(),g=()=>y?n:0,l=()=>y?r:0,w=0,b=(S)=>{if(w+S>m.length)return null;let k=m.slice(w,w+S);return w+=S,k};if(v==="Z"){t.push(4),n=s,r=o,h="Z";continue}let N=!0;while(w<m.length||N&&v==="Z"){switch(v){case"M":{let S=b(2);if(!S)return t;if(n=S[0]+g(),r=S[1]+l(),N)t.push(0,n,r),s=n,o=r;else t.push(1,n,r);h=N?"M":"L";break}case"L":{let S=b(2);if(!S)return t;n=S[0]+g(),r=S[1]+l(),t.push(1,n,r),h="L";break}case"H":{let S=b(1);if(!S)return t;n=S[0]+g(),t.push(1,n,r),h="L";break}case"V":{let S=b(1);if(!S)return t;r=S[0]+l(),t.push(1,n,r),h="L";break}case"C":{let S=b(6);if(!S)return t;let k=S[0]+g(),x=S[1]+l();c=S[2]+g(),u=S[3]+l(),n=S[4]+g(),r=S[5]+l(),t.push(2,k,x,c,u,n,r),h="C";break}case"S":{let S=b(4);if(!S)return t;let k=h==="C"?2*n-c:n,x=h==="C"?2*r-u:r;c=S[0]+g(),u=S[1]+l(),n=S[2]+g(),r=S[3]+l(),t.push(2,k,x,c,u,n,r),h="C";break}case"Q":{let S=b(4);if(!S)return t;d=S[0]+g(),f=S[1]+l(),n=S[2]+g(),r=S[3]+l(),t.push(3,d,f,n,r),h="Q";break}case"T":{let S=b(2);if(!S)return t;d=h==="Q"?2*n-d:n,f=h==="Q"?2*r-f:r,n=S[0]+g(),r=S[1]+l(),t.push(3,d,f,n,r),h="Q";break}case"A":{let S=b(7);if(!S)return t;let k=S[5]+g(),x=S[6]+l();t.push(...Cr(n,r,S[0],S[1],S[2],S[3],S[4],k,x)),n=k,r=x,h="A";break}default:return t}N=!1}}return t.map((p)=>ee(p))}function Ht(e,t,n,r){if(n<=0||r<=0)return[];let s=0.5522847498;return[0,e+n,t,2,e+n,t+s*r,e+s*n,t+r,e,t+r,2,e-s*n,t+r,e-n,t+s*r,e-n,t,2,e-n,t-s*r,e-s*n,t-r,e,t-r,2,e+s*n,t-r,e+n,t-s*r,e+n,t,4].map(ee)}function Je(e,t){switch(e){case"Path":return Jt(String(t.d??""));case"Line":return[0,U(t.x1),U(t.y1),1,U(t.x2),U(t.y2)].map(ee);case"Rect":{let n=U(t.x),r=U(t.y),s=U(t.width),o=U(t.height);if(s<=0||o<=0)return[];let c=t.rx===void 0?U(t.ry):U(t.rx),u=t.ry===void 0?c:U(t.ry);if(c=Math.min(Math.max(0,c),s/2),u=Math.min(Math.max(0,u),o/2),!c||!u)return[0,n,r,1,n+s,r,1,n+s,r+o,1,n,r+o,4].map(ee);let d=0.5522847498;return[0,n+c,r,1,n+s-c,r,2,n+s-c+d*c,r,n+s,r+u-d*u,n+s,r+u,1,n+s,r+o-u,2,n+s,r+o-u+d*u,n+s-c+d*c,r+o,n+s-c,r+o,1,n+c,r+o,2,n+c-d*c,r+o,n,r+o-u+d*u,n,r+o-u,1,n,r+u,2,n,r+u-d*u,n+c-d*c,r,n+c,r,4].map(ee)}case"Circle":return Ht(U(t.cx),U(t.cy),U(t.r),U(t.r));case"Ellipse":return Ht(U(t.cx),U(t.cy),U(t.rx),U(t.ry));case"Polyline":case"Polygon":{let n=Er(t.points);if(n.length<4)return[];let r=[0,n[0],n[1]];for(let s=2;s<n.length;s+=2)r.push(1,n[s],n[s+1]);if(e==="Polygon")r.push(4);return r.map(ee)}default:return null}}function Or(e){let t=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/.exec(String(e??""));if(!t)return null;let n=Number(t[1])/(t[2]==="ms"?1000:1);return n>0?n:null}function Pr(e){if(e.attributeName!=="d")return null;let t=Or(e.dur),n=String(e.values??"").split(";").map((u)=>u.trim()).filter(Boolean);if(t===null||n.length<2)return null;let r=n.map(Jt);if(r.some((u)=>!u.length))return null;let s=String(e.keyTimes??"").split(";").map((u)=>u.trim()).filter(Boolean).map(Number),c=s.length===r.length&&s[0]===0&&s[s.length-1]===1&&s.every((u,d)=>Number.isFinite(u)&&(d===0||u>=s[d-1]))?s.map(ee):r.map((u,d)=>ee(d/(r.length-1)));return{frames:r,frameTimes:c,duration:t}}function Ye(e){let t=Pr(e),n={frames:t?.frames??null,frameTimes:t?.frameTimes??null,duration:t?.duration??null};for(let[r,s]of Object.entries(n))if(s===null)delete e[r];else e[r]=s;return n}var Mr=[...Gt,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","barStyle","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","contentContainerStyle","currentTime","defaultSource","defaultValue","ellipsizeMode","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","ios_backgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","listRole","maxLength","mostRecentEventCount","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","objectFit","objectPosition","onEndReachedThreshold","pageIndex","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","sheetDetents","selectedDetent","grabberVisible","tintColor","clearButtonMode","nonModal","dismissOnOutsideTap","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize","initialRegion","tileOverlay","edgePadding","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","mapType","fillColor","strokeColor","pinColor","showsCompass","showsScale","cameraPitch","cameraHeading","autoScrollBottom","scrollKey","pictureInPicture","transitionID"],Kt=new Set(["alwaysBounceHorizontal","alwaysBounceVertical","animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible","nonModal","dismissOnOutsideTap","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","showsCompass","showsScale","pictureInPicture","grabberVisible"]),Br=new Map(Mr.map((e)=>[Yt(e),e]));function Yt(e){return e.replace(/[-_]/g,"").toLowerCase()}function Qe(e,t){if((t==="Image"||t==="Video")&&e.toLowerCase()==="src")return"source";return Br.get(Yt(e))??e}var Lr={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",mappolygon:"MapPolygon",mapmarker:"MapMarker",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",checkbox:"Checkbox",slider:"Slider",picker:"Picker",segmentedcontrol:"SegmentedControl",nativesegmentedcontrol:"SegmentedControl",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 Qt(e){return Lr[e.toLowerCase()]||e}var $r={"circle-pause":"pause.circle","cloud-alert":"exclamationmark.icloud","key-round":"key",paperclip:"paperclip","rotate-cw":"arrow.clockwise","route-off":"location.slash",syringe:"syringe","volume-1":"speaker.wave.1",activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",apple:"leaf",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",bean:"leaf",bed:"bed.double",beef:"fork.knife",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","cake-slice":"birthday.cake",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",carrot:"carrot","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-question-mark":"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","clock-alert":"clock.badge.exclamationmark",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",cookie:"birthday.cake",copy:"doc.on.doc","credit-card":"creditcard","cup-soda":"takeoutbag.and.cup.and.straw",cylinder:"cylinder",disc:"opticaldisc",download:"arrow.down.circle",droplet:"drop",droplets:"drop",drumstick:"fork.knife",dumbbell:"dumbbell",edit:"pencil",egg:"frying.pan","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",fish:"fish",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift","glass-water":"waterbottle",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",hamburger:"takeoutbag.and.cup.and.straw","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","messages-square":"bubble.left.and.bubble.right",mic:"mic",milk:"waterbottle",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note","music-2":"music.note",nut:"leaf",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",salad:"leaf",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",soup:"mug",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",utensils:"fork.knife",video:"video","volume-2":"speaker.wave.2",warehouse:"building.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wheat:"laurel.leading",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",wine:"wineglass",x:"xmark","x-circle":"xmark.circle",zap:"bolt"},Zt={lucide:$r,hugeicons:{"workout-run":"figure.run"}};function ce(e,t=!1){let n=String(e??"").trim();if(!n)return{symbol:"questionmark.square.dashed",known:!1};if(t)return{symbol:n,known:!0};let r=/^i-([a-z0-9]+)-(.+)$/.exec(n)??/^([a-z0-9]+):(.+)$/.exec(n),s=r?r[1]:"lucide",o=r?r[2]:n,c=Object.hasOwn(Zt,s)?Zt[s]:void 0;if(c&&Object.hasOwn(c,o))return{symbol:c[o],iconify:`i-${s}-${o}`,known:!0};if(!r&&n.includes("."))return{symbol:n,known:!0};return{symbol:"questionmark.square.dashed",iconify:r?n:`i-lucide-${o}`,known:!1}}function Ze(e){return e.split(/\s+/).find((t)=>/^i-[a-z0-9]+-[a-z0-9-]+$/.test(t))}import{generate as Se,parse as jr}from"@stacksjs/ts-css/parse";var Vr=/^(?::hover|:active|:visited|:focus|:focus-visible|:focus-within)$/;function Wr(e){let t=e.replace(/\s+/g,"").toLowerCase();if(!t||t==="all"||t==="screen")return{};if(/^(?:screenand)?\(prefers-color-scheme:dark\)$/.test(t))return{dark:!0};if(/^(?:screenand)?\(prefers-color-scheme:light\)$/.test(t))return{};if(/prefers-reduced-motion|\(hover|\(pointer|print|forced-colors|prefers-contrast/.test(t))return"skip";let n=t.replace(/^screenand/,"").split("and"),r={};for(let s of n){let o=/^\((min|max)-width:([\d.]+)(px|rem|em)\)$/.exec(s);if(!o)return;r[o[1]]=Number(o[2])*(o[3]==="px"?1:16)}return r}async function en(e,t){let n={},r=new Set,s=(f)=>{if(r.has(f))return;r.add(f),t(f,[...f.matchAll(/\.(-?[a-z_][\w-]*)/gi)].map((h)=>h[1]))},o=(f,h,p)=>{if(!h.trim())return;let m=n[f]??={},y=p.dark?"dark":"light";if(p.min===void 0&&p.max===void 0){m[y]=m[y]?`${m[y]};${h}`:h;return}let v=m.responsive??=[],g=p.min??0,l=v.find((w)=>w.min===g&&w.max===p.max);if(!l)v.push(l={min:g,...p.max===void 0?{}:{max:p.max}});l[y]=l[y]?`${l[y]};${h}`:h};function c(f,h){for(let p of f){if(p.type==="Atrule"){let v=p.name.toLowerCase();if(["font-face","keyframes","-webkit-keyframes","import","charset","property","page","layer"].includes(v)){if(v==="layer"&&p.block)c(p.block.children,h);continue}if(v!=="media"||!p.block){s(`@${v}`);continue}let g=p.prelude?Se(p.prelude):"",l=Wr(g);if(l==="skip")continue;if(!l){s(`@media ${g}`);continue}c(p.block.children,{dark:h.dark||l.dark,min:l.min??h.min,max:l.max??h.max});continue}if(p.type!=="Rule"||p.block.type!=="Block")continue;let m=[...p.block.children].filter((v)=>v.type==="Declaration").map((v)=>Se(v)).join(";"),y=p.prelude.type==="SelectorList"?[...p.prelude.children].map(Se):[Se(p.prelude)];for(let v of y){let g=/^(?:(?:html|:root)?\.dark\s+)?((?:\.-?[a-z_][\w-]*)+)((?::{1,2}[a-z-]+)*)$/i.exec(v.trim());if(!g){if(!/^(?:html|:root|body|\*|::?[a-z-]+)/i.test(v.trim()))s(v.trim());continue}let l=g[2];if(l){if(!Vr.test(l))s(v.trim());continue}let w=h.dark||/^(?:(?:html|:root)?\.dark\s+)/i.test(v.trim());o(g[1].slice(1),m,{dark:w,min:h.min,max:h.max})}}}let u="",d=!0;await new HTMLRewriter().on("style",{element(f){u="";let h=f.getAttribute("type");d=!h||h.toLowerCase()==="text/css",f.onEndTag(()=>{if(!d)return;try{let p=jr(u);if(p.type==="StyleSheet")c(p.children,{})}catch{s("invalid stylesheet")}})},text(f){u+=f.text}}).transform(new Response(e)).text();for(let f of Object.values(n))f.responsive?.sort((h,p)=>h.min-p.min||(h.max??1/0)-(p.max??1/0));return n}import{generate as le,parse as tn}from"@stacksjs/ts-css/parse";async function nn(e,t){let n={light:new Map,dark:new Map},r=new Set,s=(p)=>{if(!r.has(p))r.add(p),t(p)},o=(p,m,y)=>{for(let v of y){let g=n[v].get(p);if(!g||Number(m.important)>Number(g.important)||m.important===g.important&&m.specificity>=g.specificity)n[v].set(p,m)}},c=(p)=>{if(p.type==="Declaration")return p.property.startsWith("--");if(p.type==="Rule"||p.type==="Atrule")return!!p.block&&[...p.block.children].some(c);return!1},u=(p)=>{let m=p.replace(/\s+/g,"").toLowerCase();if(!m||m==="all"||m==="screen")return["light","dark"];let y=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(m);return y?[y[1]]:void 0};function d(p,m){for(let y of p){if(!c(y))continue;if(y.type==="Atrule"){let g=y.prelude?le(y.prelude):"",l=y.name.toLowerCase()==="media"?u(g):void 0;if(!l){s(`@${y.name} ${g}`.trim());continue}d(y.block.children,m.filter((w)=>l.includes(w)));continue}if(y.type!=="Rule")continue;let v=y.prelude.type==="SelectorList"?[...y.prelude.children].map(le):[le(y.prelude)];for(let g of v){let l=/^(html|:root)?(?:\.(dark|light))?$/.exec(g.trim());if(!l||!l[1]&&!l[2]){s(g);continue}let w=(l[1]===":root"?10:l[1]?1:0)+(l[2]?10:0);for(let b of y.block.children){if(b.type!=="Declaration"){if(c(b))s(`nested rule in ${g}`);continue}if(!b.property.startsWith("--"))continue;let N={value:le(b.value),important:!!b.important,specificity:w};o(b.property,N,m.filter((S)=>!l[2]||l[2]===S))}}}}let f="",h;return await new HTMLRewriter().on("html",{element(p){let m=p.getAttribute("style");if(!m)return;try{let y=tn(m,{context:"declarationList"});if(y.type!=="DeclarationList")return;for(let v of y.children)if(v.type==="Declaration"&&v.property.startsWith("--"))o(v.property,{value:le(v.value),important:!!v.important,specificity:1000},["light","dark"])}catch{s("invalid document inline theme")}}}).on("style",{element(p){f="";let m=p.getAttribute("type");h=!m||m.toLowerCase()==="text/css"?u(p.getAttribute("media")??""):void 0,p.onEndTag(()=>{try{let y=tn(f);if(y.type!=="StyleSheet")return;if(!h){if([...y.children].some(c))s("style type/media");return}d(y.children,h)}catch{s("invalid stylesheet")}})},text(p){f+=p.text}}).transform(new Response(e)).text(),{light:[...n.light].map(([p,m])=>[p,m.value]),dark:[...n.dark].map(([p,m])=>[p,m.value])}}function J(e,t={},n={},r={},s=[]){return{type:e,props:t,style:n,events:r,children:s}}function rn(e,t,n={}){return{version:"1.0.0",root:e,script:t,meta:{source:n.source||"unknown",compiledAt:n.compiledAt||Date.now(),headwindConfig:n.headwindConfig}}}var Fr=/^(?:key(?:down|up|press)|mouse[a-z]+|pointer[a-z]+|dbl(?:click)?|contextmenu|wheel|drag[a-z]*|drop|copy|cut|paste|beforeinput|compositionstart|compositionupdate|compositionend|animation[a-z]+|transition[a-z]+|resize|hashchange|popstate|beforeunload|unload|visibilitychange|selectionchange|selectstart|auxclick)$/,on=new Set(["script","style","head","meta","link","title","base","noscript"]),an=new Set(["template","body","html","main","fragment"]),we=new Set,Xr=new Set(["onBlur","onChange","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onPageSelected","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"]),xe=new Set(["Sidebar","SplitView","View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","Link","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","Map","MapPolyline","MapPolygon","MapMarker","FlatList","SectionList","Switch","Checkbox","Slider","Picker","SegmentedControl","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...He]),zr=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"]]),cn=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Ur={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function re(e){return e.replace(/&(#x?[0-9a-f]+|\w+);/gi,(t,n)=>{let r=Ur[n.toLowerCase()];if(r!==void 0)return r;if(n[0]==="#"){let s=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):t}return t})}function et(e){if(!e.includes("{{"))return null;let t=[],n=0;for(let r of e.matchAll(/\{\{([\s\S]+?)\}\}/g)){if(r.index>n)t.push(JSON.stringify(e.slice(n,r.index)));t.push(`(${r[1].trim()})`),n=r.index+r[0].length}if(!t.some((r)=>r.startsWith("(")))return null;if(n<e.length)t.push(JSON.stringify(e.slice(n)));if(t.length===1)return t[0].slice(1,-1);return`[${t.join(", ")}].map(__stxPart => __stxPart == null ? '' : __stxPart).join('')`}function ln(e,t,n,r={}){let s=r.inheritedVariables,o={},c={},u={},d=[],f="",h={};for(let[v,g]of t){let l=v.toLowerCase();if(l==="class"||l==="classname"){f=f?`${f} ${g}`:g;continue}if(l==="style"){h={...h,...Hr(e,g,n,{...r,onVariables(S){s=S,r.onVariables?.(S)}})};continue}if(l.startsWith(":")||l.startsWith("x-")&&l!=="x-cloak"){u[l.startsWith(":")?l.slice(1):l.slice(2)]=re(g);continue}if(l==="x-cloak")continue;if(l.startsWith("@")||l.startsWith("v-on:")){let S=l.startsWith("@")?l.slice(1):l.slice(5),[k]=S.split("."),x=Xe[k]??(k.startsWith("on")?k:"");if(!x||!Xr.has(x)){if(Fr.test(k)||/\./.test(S))n.push({kind:"unread-event",tag:e,name:v});continue}c[x]=re(g);continue}if(l==="key"){o.key=g;continue}let w=re(g),b=et(w);if(b){u[l]=b,d.push(l);continue}let N=Qe(v);if(w===""&&Kt.has(N)){o[N]=!0;continue}try{o[N]=JSON.parse(w)}catch{o[N]=w}}let p=o["data-native"]?o["data-native"]==="TextInput":e==="textarea"||e==="input"&&!["checkbox","radio","hidden"].includes(String(o.type??"text").toLowerCase()),m=f?ve(f,s,{focus:p,focusWithin:!0,rules:r.rules}):void 0;for(let v of new Set(m?.unknown??[]))n.push({kind:"unknown-class",tag:e,name:v});let y=Le({...m?.style,...h});return{props:o,style:y,events:c,bindings:u,classes:f,inline:h,templated:d}}function Hr(e,t,n,r){return me(re(t),(s)=>n.push({...s,tag:e}),r)}function tt(e){return e.children.map((t)=>typeof t==="string"?t:tt(t)).join("").replace(/\s+/g," ").trim()}function qr(e,t){let n=e.node;if(n.props["data-stx-native-template"])return n.children=n.children.map((o)=>typeof o==="string"?J("Text",{},{},{},[o]):o),n;let r=n.children.filter((o)=>typeof o!=="string"),s=n.children.filter((o)=>typeof o==="string").join("").trim();if(e.tag==="button"&&n.type==="Button"&&!e.declaredNative&&r.length>0)return n.type="Pressable",n.props.role??="button",n.children=n.children.flatMap((o)=>typeof o==="string"?o.trim()?[J("Text",{},{},{},[o.trim()])]:[]:[o]),n;if(n.type==="Button"&&r.length===0)return n.children=s?[s]:[],n;if(n.type==="Svg"||n.type==="G")return n.children=r,n;if(n.type==="SvgText"){let o=tt(n);return n.children=o?[o]:[],n}if(cn.has(n.type)&&r.length===0&&s)return n.type="Text",n.children=[s],n;if(n.type==="Text"&&!s&&r.length===0&&typeof n.props.text==="string")return n.children=n.props.text?[n.props.text]:[],delete n.props.text,n;if(n.type==="Text"&&r.length>0){if(/(?:^|\s)(?:inline-)?(?:flex|grid)(?:\s|$)/.test(n._classes??"")||r.some((u)=>u.type!=="Text"))return n.type="View",n.children=n.children.map((u)=>typeof u==="string"?J("Text",{},{},{},[u]):u),n;let c=tt(n);return t.push({kind:"flattened-text",tag:e.tag}),n.children=c?[c]:[],n}if(cn.has(n.type)&&r.length>0)n.children=r;return n}async function Gr(e,t={}){e=await ue(e);let n=[],r=await nn(e,(l)=>n.push({kind:"unsupported-theme-rule",tag:"style",name:l})),s=ae(r.light).computed(),o=new Set([...e.matchAll(/\sclass(?:name)?\s*=\s*"([^"]*)"/gi)].flatMap((l)=>l[1].split(/\s+/))),c=await en(e,(l,w)=>{if(!w.length||w.some((b)=>o.has(b)))n.push({kind:"unsupported-style-rule",tag:"style",name:l})}),u=[],d=[],f=new Set;function h(l){let w=d[d.length-1];if(!w)u.push(l);else if(!w.dropped)w.node.children.push(l)}function p(l){let w=l.node.style.fontFamily,b=(S)=>{if(l.tag!=="html"&&l.node._styleSource)S._styleAncestors=[l.node._styleSource,...S._styleAncestors??[]];if(w&&S.style.fontFamily===void 0)S._layoutDefaults={...S._layoutDefaults,fontFamily:w},S.style={fontFamily:w,...S.style}};if(l.node.bindings&&Object.keys(l.node.bindings).length>0){let S=l.node.children,k=S.filter((A)=>typeof A!=="string"),x=k.length===1&&k.length===S.length?k[0]:J("View",{},{},{},S);if(x.bindings={...l.node.bindings,...x.bindings},x.bindingId===void 0&&l.node.bindingId!==void 0)x.bindingId=l.node.bindingId;b(x),h(x);return}let N=d[d.length-1];for(let S of l.node.children){if(typeof S==="string"){if(N&&!N.dropped)N.node.children.push(S);continue}if(b(S),!N)u.push(S);else if(!N.dropped)N.node.children.push(S)}}function m(l,w){let b=d[d.length-1];if(l==="svg"||b?.svg)return y(l,w,b);let N=on.has(l)&&!we.has(l),S=d[d.length-1]?.dropped??!1,k=b?.variables??s,{props:x,style:A,events:M,bindings:j,classes:T,inline:C,templated:E}=N||S?{props:{},style:{},events:{},bindings:{},classes:"",inline:{},templated:[]}:ln(l,w,n,{inheritedVariables:k,onVariables:(L)=>{k=L},rules:c});if(l==="html")k=s;let I=x["data-native"],V=l==="template"&&w.some(([L])=>[":for","x-for","@for"].includes(L)),R;if(V)R="View",x["data-stx-native-template"]=!0;else if(typeof I==="string"&&xe.has(I))R=I,delete x["data-native"];else{if(R=we.has(l)?"View":Qt(l),(l==="i"||l==="span")&&/(?:^|\s)i-[a-z0-9]+-[a-z0-9-]+(?:\s|$)/.test(T))R="Icon";else if(l==="i"&&w.some(([L])=>/^(?::|x-)class$/i.test(L)))R="Icon";if(l==="input"){let L=String(x.type??"text").toLowerCase();if(L==="checkbox")R="Checkbox",x.formValue=x.value??"on",x.checked=x.checked===""||x.checked===!0||x.checked==="true",x.value=x.checked;else if(L==="hidden")R="View",A.display="none",C.display="none";else if(L==="radio")R="View",x.accessibilityRole="radio",n.push({kind:"unsupported-control",tag:l,name:"input:radio"})}}if(!S&&R===l&&!xe.has(R)&&!on.has(l)&&!an.has(l)&&!f.has(l))f.add(l),n.push({kind:"unmapped-tag",tag:l});if((N||we.has(l))&&!f.has(`drop:${l}`))f.add(`drop:${l}`),n.push({kind:"dropped-subtree",tag:l});if(R==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(T))R="ScrollView",x.horizontal=!0,x.showsHorizontalScrollIndicator??=!1;else if(R==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(T))R="ScrollView";if(l==="form")x["data-stx-form"]=!0;if(l==="button"&&x.type===void 0)x.type="submit";if(l==="textarea"&&R==="TextInput")x.multiline??=!0;if((R==="Video"||R==="Image")&&x.source===void 0&&x.src!==void 0)x.source=x.src,delete x.src;if(R==="Icon"){let L=ve(T).icon,X=String(x.symbol||x.name||L||""),B=ce(X,Boolean(x.symbol));if(X.trim()&&!B.known)n.push({kind:"unknown-icon",tag:l,name:X});if(x.symbol=B.symbol,B.iconify)x.iconify=B.iconify}if(R==="FlatList"||R==="SectionList"){let L=new Set([...Object.keys(x),...Object.keys(j)].map((X)=>X.toLowerCase()));for(let[X,B]of zr)if(L.has(X))n.push({kind:"unsupported-list-prop",tag:R,name:B})}let _=J(R,x,A,M);_._inlineStyle=C,_._styleSource=re(w.find(([L])=>L==="style")?.[1]??"");let O=x["data-stx-b"];if(typeof O==="number"&&Number.isInteger(O))_.bindingId=O;if(delete x["data-stx-b"],T)_._classes=T;if(Object.keys(j).length>0)_.bindings=j;if(E.length>0)_._templated=E;if(typeof x.key==="string")_.key=x.key,delete x.key;return{tag:l,node:_,variables:k,declaredNative:typeof I==="string"&&xe.has(I),dropped:N||S||we.has(l)||R==="Video",discard:N||S,unwrap:an.has(l)&&!V&&R!=="ScrollView"&&!(typeof I==="string"&&xe.has(I))}}function y(l,w,b){let N=b?.dropped??!1,S=Ue[l];if(N||!S){if(!N&&!f.has(`drop:${l}`))f.add(`drop:${l}`),n.push({kind:qt.has(l)?"dropped-subtree":"unmapped-tag",tag:l});return{tag:l,node:J("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let k=b?.variables??s,{props:x,style:A,events:M,bindings:j,classes:T,inline:C,templated:E}=ln(l,w,n,{inheritedVariables:k,onVariables:(_)=>{k=_},rules:c});if(S==="Svg"){let _=Ge(x.viewBox);if(_)x.viewBox=_;else delete x.viewBox;for(let O of["width","height"]){if(typeof x[O]==="number"&&A[O]===void 0)A[O]=x[O];delete x[O]}}if(typeof x.strokeDasharray==="string"||typeof x.strokeDasharray==="number"){let _=String(x.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);x.strokeDasharray=_}let I=Je(S,x);if(I)x.geometry=I;if(S==="Animate")Ye(x);let V=J(S,x,A,M);V._inlineStyle=C,V._styleSource=re(w.find(([_])=>_==="style")?.[1]??"");let R=x["data-stx-b"];if(typeof R==="number"&&Number.isInteger(R))V.bindingId=R;if(delete x["data-stx-b"],T)V._classes=T;if(Object.keys(j).length>0)V.bindings=j;if(E.length>0)V._templated=E;if(typeof x.key==="string")V.key=x.key,delete x.key;return{tag:l,node:V,variables:k,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(l){let w=l.tagName.toLowerCase(),b=m(w,[...l.attributes]),N=!0;try{l.onEndTag(()=>{if(d.pop(),b.discard)return;if(b.unwrap)p(b);else h(qr(b,n))})}catch{N=!1}if(N)d.push(b);else if(!b.discard)h(b.node)},text(l){let w=d[d.length-1];if(!w||w.dropped)return;let b=Jr(re(l.text),w.inMustache===!0);w.inMustache=b.inside;let N=b.text;if(!N.trim())return;w.node.children.push(N)}}).transform(new Response(e)).text(),u.length===0)throw Error(`No element to translate in the rendered output of ${t.source??"unknown"}`);let v=u.length===1?u[0]:J("View",{},{},{},u);if(r.light.length||r.dark.length)v._stylesheetTheme=r;if(Object.keys(c).length)v._stylesheetRules=c;let g=(l)=>{Kr(l);let w=We(l.props,l.type);if(Object.keys(w).length)l._accessibilitySource=Object.fromEntries(Ve.filter((b)=>(b in l.props)).map((b)=>[b,l.props[b]])),Object.assign(l.props,w);zt(l);for(let b of l.children)if(typeof b!=="string")g(b)};return g(v),un(v),{root:v,diagnostics:n}}function un(e){if(["ScrollView","FlatList","SectionList"].includes(e.type))return!e.props.horizontal&&(Number(e.style.flex)>0||Number(e.style.flexGrow)>0);if(!e.children.map((n)=>typeof n==="string"?!1:un(n)).some(Boolean)||!["View","SafeAreaView","KeyboardAvoidingView"].includes(e.type))return!1;if(e.style.height!==void 0||e.style.maxHeight!==void 0)return!1;if(e.style.flex===0||e.style.flexGrow===0||e.style.flexShrink===0)return!1;if(e.style.flex===void 0&&e.style.flexGrow===void 0)e._layoutDefaults={flex:1,flexGrow:1,flexShrink:1,flexBasis:0},e.style={...e._layoutDefaults,...e.style};return!0}function Jr(e,t){let n="",r=0;while(r<e.length){if(!t&&e.startsWith("{{",r)){t=!0,n+="{{",r+=2;continue}if(t&&e.startsWith("}}",r)){t=!1,n+="}}",r+=2;continue}let s=e[r];if(!t&&/\s/.test(s)){if(!n.endsWith(" "))n+=" ";while(r<e.length&&/\s/.test(e[r]))r++;continue}n+=s,r++}return{text:n,inside:t}}function Kr(e){if(e.props["data-stx-native-template"])return;if(e.bindings?.text||e.children.length===0)return;let t=e.children.filter((r)=>typeof r==="string");if(t.length<e.children.length){let r=e.type==="Button"||e.type==="Text"?null:et(t.join(""));if(!r)return;e.bindings={...e.bindings,text:r},e._templated=[...e._templated??[],"text"],e.children=e.children.filter((s)=>typeof s!=="string");return}let n=et(e.children.join(""));if(!n)return;if(e.type!=="Button")e.bindings={...e.bindings,text:n},e._templated=[...e._templated??[],"text"],e.children=[];else{e.type="Pressable",e.props.role??="button";let r=J("Text",{},{},{},[]);r.bindings={text:n},r._templated=["text"],e.children=[r]}}async function dn(e,t={}){let{root:n,diagnostics:r}=await Gr(e,t),s=t.script??{exports:{},functions:[],code:""};return{document:rn(n,s,{source:t.source??"unknown"}),diagnostics:r}}async function ue(e){if(!/\bdata-native-exclude\b/i.test(e))return e;return new HTMLRewriter().on("[data-native-exclude]",{element(t){t.remove()}}).transform(new Response(e)).text()}var fn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Yr=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Zr=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,pn=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function nt(e){let t=[];fn.lastIndex=0;for(let o of e.matchAll(fn)){let c=o[1]??"";if(/\bserver\b/.test(c))continue;t.push(o[2].trim())}let n=t.filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`),r=[];for(let o of[Yr,Zr]){o.lastIndex=0;for(let c of n.matchAll(o))if(!r.includes(c[1]))r.push(c[1])}let s={};pn.lastIndex=0;for(let o of n.matchAll(pn)){let c=o[2];try{s[o[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{s[o[1]]=c}}return{exports:s,functions:r,code:n}}var oe="[data-native-chrome]";function ei(e){let t=(e??"").trim().toLowerCase();return t==="tabs"||t==="bar"?t:""}function gn(e,t){let n=ce(e);if(!n.known&&/^i-|:/.test(e))t?.(e);return n.known||/^i-|:/.test(e)?n.symbol:e}function ti(e){let t=(e??"").trim();if(!t.startsWith("/")||t.startsWith("//"))return null;return t}function hn(e){return e.replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/\s+/g," ").trim()}async function mn(e,t){if(!/\bdata-native-chrome\b/i.test(e))return{html:e,chrome:null};let n=[],r=[],s=new Set,o=[],c=[],u=null,d=null,f=!1;if(await new HTMLRewriter().on(oe,{element(m){f=!0;let y=m.getAttribute("data-stx-scope");if(y)s.add(y);n.push(ei(m.getAttribute("data-native-chrome"))),m.onEndTag(()=>{n.pop()})}}).on("[data-stx-component-wrapper]",{element(m){let y={scope:m.getAttribute("data-stx-scope")??"",children:0,chrome:0};o.push(y),m.onEndTag(()=>{if(o.pop(),y.scope&&y.children>0&&y.chrome===y.children)s.add(y.scope)})}}).on("[data-stx-component-wrapper] > *",{element(m){let y=o[o.length-1];if(!y)return;if(y.children++,m.hasAttribute("data-native-chrome"))y.chrome++}}).on(`${oe} [data-stx-scope]`,{element(m){let y=m.getAttribute("data-stx-scope");if(y)s.add(y)}}).on(`${oe} script[data-stx-component-factories]`,{element(m){let y=[...m.attributes].map(([v,g])=>g===""?v:`${v}="${g.replace(/"/g,""")}"`).join(" ");u="",m.onEndTag(()=>{c.push(`<script ${y}>${u}</script>`),u=null})},text(m){if(u!==null)u+=m.text}}).on(`${oe} a`,{element(m){let y=ti(m.getAttribute("href")),v=n[n.length-1]??"";if(!y||!v)return;let g=m.getAttribute("data-native-icon")||Ze(m.getAttribute("class")??""),l={path:y,title:"",region:v,label:m.getAttribute("aria-label")||m.getAttribute("title")||"",...g?{symbol:gn(g,t)}:{}};d=l,m.onEndTag(()=>{if(l.title=hn(l.title)||hn(l.label),r.push(l),d===l)d=null})},text(m){if(d)d.title+=m.text}}).on(`${oe} a *`,{element(m){if(!d||d.symbol)return;let y=m.getAttribute("data-native-icon")||Ze(m.getAttribute("class")??"");if(y)d.symbol=gn(y,t)}}).transform(new Response(e)).text(),!f)return{html:e,chrome:null};let h=await new HTMLRewriter().on(oe,{element(m){m.remove()}}).on("script[data-stx-owner]",{element(m){if(s.has(m.getAttribute("data-stx-owner")??""))m.remove()}}).transform(new Response(e)).text(),p=(m)=>r.filter((y)=>y.region===m).map(({path:y,title:v,symbol:g})=>({path:y,title:v,...g?{symbol:g}:{}}));return{html:c.join(`
|
|
6
|
+
`)+h,chrome:{tabs:p("tabs"),bar:p("bar")}}}var Ne=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,yn=/function\s+(__stx_setup_[\w$]+)\s*\(/,ni=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function rt(e){Ne.lastIndex=0;for(let t of e.matchAll(Ne)){let n=t[2].trim(),r=yn.exec(n)?.[1];if(r)return{name:r,code:n}}return null}function bn(e){let t=[];Ne.lastIndex=0;for(let n of e.matchAll(Ne)){let r=n[1],s=n[2].trim(),o=ni.exec(r)?.[1],c=/\bdata-stx-component-factories\b/i.test(r);if(!s||!o&&!c&&!yn.test(s))continue;t.push(o?{code:s,owner:o}:{code:s})}return t}function ii(){let e=[Z.join(import.meta.dir,"..","primitives"),Z.join(import.meta.dir,"native","primitives")];for(let t of e)if(ri(Z.join(t,"View.stx")))return t;return e[0]}async function si(e,t,n={}){e=await ue(e);let r=n.root??Z.dirname(t),s=await a(r),o=typeof s.root==="string"&&s.root?Z.resolve(r,s.root):r,c=(E,I)=>E?Z.isAbsolute(E)?E:Z.resolve(o,E):Z.join(o,I),u={root:r,layoutsDir:c(s.layoutsDir,"layouts"),partialsDir:c(s.partialsDir,"partials"),storesDir:c(s.storesDir,"stores"),componentsDir:n.componentsDir??(s.componentsDir?c(s.componentsDir,"components"):Z.join(o,"components")),buildMode:"serve",cache:!1,_targetComponentDirs:[ii()],_targetComponentFallbackNames:["Button","Checkbox","Switch","TextInput","Image","Video"],_nativeHostAttrs:!0,skipEventDirectives:!0,_pluginComponentDirs:s._pluginComponentDirs??[]},d={...n.context??{},__stx_inject_css:!1,__stx_native_screen:!0},f=new Set([t]),h=await i(e,d,t,u,f),p=[],{html:m,chrome:y}=await mn(await ue(h),(E)=>{p.push({kind:"unknown-icon",tag:"data-native-chrome",name:E})}),{html:v,manifest:g}=ut(await ue(m)),l=await Dt(r),{document:w,diagnostics:b}=await dn(l?`<style>${l}</style>${v}`:v,{source:t,script:nt(e)});b.unshift(...p),oi(w.root,g);let N=d.__stx_runtime_head;if(typeof N?.title==="string"&&N.title.trim())w.title=N.title.trim();if(y)w.chrome=y;let S=rt(v),k=bn(v);if(nt(e).code.trim()){let E=await ds(e,t,n.context,{forceClientSetup:!0}),I=rt(E.setupCode??"");if(S=I??S,I&&!k.some((V)=>V.code===I.code))k.push({code:I.code})}let{buildModuleRegistryScript:x,registeredModuleIdsIn:A,registeredModuleNamesIn:M}=await import("./chunk-fhwn8j9p.js"),j=async()=>{let E=[],I=k.map((R)=>R.code),V=await x(A(...I),{collectInputs:E,names:M(...I)});for(let R of E)f.add(R);return V},T=await j();if([...k.map((E)=>E.code),T??""].some((E)=>/\buseStore\s*\(/.test(E))&&/<script\b[^>]*\bdata-stx-stores\b/i.test(v)){let{getStoreScriptFor:E}=await import("./chunk-y3jbkk7a.js"),I=[...k],V="";for(let R=0;R<8;R++){let _=await E(u.storesDir,[...I.map((O)=>O.code),T],{sharedModules:!0});if(!_)break;if(_.stores.join()===V)break;V=_.stores.join(),k.splice(0,k.length,{code:_.code},...I);for(let O of new Bun.Glob("*.ts").scanSync({cwd:u.storesDir,absolute:!0}))f.add(O);T=await j()}}if(T)k.unshift({code:T,registry:!0});return{document:w,manifest:g,setup:S,scripts:k,diagnostics:b,html:v,dependencies:[...f]}}function oi(e,t){let n=new Map(t.entries.map((o)=>[o.id,o])),r=t.entries.reduce((o,c)=>Math.max(o,c.id),-1)+1,s=(o)=>{if(o._templated?.length&&o.bindings){if(o.bindingId===void 0||!n.has(o.bindingId)){let u={id:o.bindingId??r++,bindings:[]};o.bindingId=u.id,n.set(u.id,u),t.entries.push(u)}let c=n.get(o.bindingId);for(let u of o._templated){let d=`:${u}`,f=Ee(d);if(f&&!c.bindings.some((h)=>h.name===d))c.bindings.push({name:d,value:o.bindings[u],kind:f})}}for(let c of o.children)if(typeof c!=="string")s(c)};s(e)}async function ke(e,t={}){return si(await Bun.file(e).text(),e,t)}var Us=Symbol("stx.nativeWebStorage.raw");var de="__app";var ui=(e)=>Bun.hash(e).toString(36);var di=/^ {2}try \{ factories\[("[0-9a-f]+")\] = factories\[\1\] \|\| /gm,fi=/^\(function\(__scopeId\) \{([\s\S]*)\}\)\("([^"\\]+)"\);\s*$/;function it(e){if(!e.startsWith(`(function() {
|
|
7
|
+
const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
|
|
8
|
+
`)||!e.endsWith(`
|
|
9
|
+
})();`))return null;let t=[...e.matchAll(di)];if(t.length===0)return null;let n=[],r=105;for(let[s,o]of t.entries()){if(o.index!==r)return null;let c=JSON.parse(o[1]),u=o.index+o[0].length,d=`; }
|
|
10
|
+
catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(c)} + ' failed to register; instances of it will not hydrate.', e); }`,f=e.indexOf(d,u);if(f<0||!e.slice(u,f).startsWith("function(__scopeId) {")&&!e.slice(u,f).startsWith("function (__scopeId) {"))return null;let h=t[s+1];if(r=f+d.length,h?e[r]!==`
|
|
11
|
+
`||h.index!==r+1:e.slice(r)!==`
|
|
12
|
+
})();`)return null;n.push({id:c,body:e.slice(u,f),text:e.slice(o.index,f+d.length)}),r=h?r+1:r}return n}function vn(e){let t=new Map;for(let{scripts:f}of e)for(let h of f)for(let p of(h.registry||h.owner?null:it(h.code))??[])t.set(p.body,p.id);let n=(f)=>t.get(f)??ui(f),r=new Map,s=(f)=>{let h=f.owner?fi.exec(f.code):null;return h?{body:`function(__scopeId) {${h[1]}}`,scope:h[2]}:null},o=(f,h)=>{let p=n(h),m=r.get(p)??new Set;m.add(f),r.set(p,m)},c=(f)=>(r.get(n(f))?.size??0)>1;for(let{name:f,scripts:h}of e)for(let p of h){if(p.registry)continue;for(let y of(p.owner?null:it(p.code))??[])o(f,y.body);let m=s(p);if(m)o(f,m.body)}let u=new Map,d=new Map;for(let{name:f,scripts:h}of e)d.set(f,h.map((p)=>{if(p.registry)return p;let m=p.owner?null:it(p.code);if(m){let v=m.filter((w)=>c(w.body));if(v.length===0)return p;for(let{body:w}of v)u.set(n(w),w);let g=m.filter((w)=>!v.includes(w)),l=v.map((w)=>JSON.stringify(w.id)).join(", ");return{...p,code:`(function() {
|
|
13
|
+
const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
|
|
14
|
+
${g.map((w)=>`${w.text}
|
|
15
|
+
`).join("")} [${l}].forEach(function (id) { factories[id] = factories[id] || runtime.components[id]; });
|
|
16
|
+
})();`}}let y=s(p);if(y&&c(y.body))return u.set(n(y.body),y.body),{...p,code:`runtime.components[${JSON.stringify(n(y.body))}](${JSON.stringify(y.scope)});`};return p}));return{bodies:u,screens:d}}async function gi(e){try{let{loadCssEngineConfig:t}=await import("./chunk-davr7z73.js");return St(await t(e))}catch{return{}}}var Re="__runtime",hi="__messages";function st(e){let n=[F.join(import.meta.dir,"..","runtime",`${e}.ts`),F.join(import.meta.dir,"..","runtime",`${e}.js`),F.join(import.meta.dir,"native","runtime",`${e}.js`)].find((r)=>at(r));if(!n)throw Error(`Native runtime module ${e} is missing`);return n}async function ot(e,t,n,r,s){let o={name:"stx-screen-inputs",setup(u){u.onLoad({filter:/.*/,namespace:"file"},({path:d})=>{r.add(d);let f=s?.get(d);return f===void 0?void 0:{contents:f,loader:"js"}})}},c=await Bun.build({entrypoints:[e],target:"browser",format:"iife",minify:n,plugins:[o,...t],define:{"process.env.NODE_ENV":JSON.stringify(n?"production":"development")}});if(!c.success){let u=c.logs.map((d)=>String(d.message??d)).join(`
|
|
17
|
+
`);throw Error(`Could not bundle ${e}:
|
|
18
|
+
${u}`)}return(await c.outputs[0].text()).trim()}var mi=/^[\w-]+(?:\/[\w-]+)*$/,yi=/^[\w-]+$/;async function bi(e,t){let n=F.resolve(e,t.dir);if(!t.languages?.length)throw Error("messages.languages must name at least one language");let r=new Map,s=new Map;for(let o of t.languages){if(!yi.test(o))throw Error(`messages: "${o}" is not a language directory name`);let c=F.join(n,o);if(!at(c))throw Error(`messages: ${F.relative(e,c)} does not exist`);let u=new Map;for(let d of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:c})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(d))continue;let f=d.replace(/\.[^./]+$/,"").split(F.sep).join("/");if(!mi.test(f))throw Error(`messages: ${o}/${d} is not an area name`);if(u.has(f))throw Error(`messages: ${o}/${f} is defined twice`);let h=F.join(c,d),p=await import(h),m=Object.keys(p).filter((g)=>g!=="default");if(m.length)throw Error(`messages: ${o}/${d} exports ${m.join(", ")}; a message module exports its messages as default, and nothing else`);let y=p.default,v=y!==null&&typeof y==="object"&&!Array.isArray(y)?JSON.stringify(y):void 0;if(v===void 0||!Bun.deepEquals(JSON.parse(v),y,!0))throw Error(`messages: ${o}/${d} must export plain data (an object JSON can hold) as default`);u.set(f,v),r.set(h,{language:o,area:f})}s.set(o,u)}return{files:r,data:s}}function vi(e,t){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(e)}, ${JSON.stringify(t)});`}function Si(e){let t=new Map;for(let[n,{language:r,area:s}]of e.files){let o=vi(r,s);t.set(n,o),t.set(pi(n),o)}return t}function xn(e){let t=new Set;for(let n of e.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))t.add(n[1]);return[...t].sort()}function wi(e,t){let n=F.isAbsolute(e.meta.source)?F.relative(t,e.meta.source).split(F.sep).join("/"):e.meta.source;return{...e,script:{exports:e.script.exports,functions:[],code:""},meta:{...e.meta,source:n,compiledAt:0}}}function xi(e){let t=new Map,n=e.flatMap(({name:u,document:d})=>{let{_stylesheetRules:f,_stylesheetTheme:h}=d.root;return f===void 0&&h===void 0?[]:[{name:u,rules:f??{},theme:h}]});for(let{rules:u}of n)for(let[d,f]of Object.entries(u)){let h=JSON.stringify(f),p=t.get(d)??new Map,m=p.get(h);if(m)m.count++;else p.set(h,{value:f,count:1});t.set(d,p)}let r={},s=new Map;for(let[u,d]of t){let[f,h]=[...d].sort(([,p],[,m])=>m.count-p.count)[0];r[u]=h.value,s.set(u,f)}let o={},c=new Map;for(let{name:u,rules:d,theme:f}of n){let h={};for(let[m,y]of Object.entries(d))if(JSON.stringify(y)!==s.get(m))h[m]=y;let p=null;if(f!==void 0)p=Bun.hash(JSON.stringify(f)).toString(36),o[p]=f;c.set(u,{order:Object.keys(d),own:h,theme:p})}return{rules:r,themes:o,screens:c}}function Ni(e){let{_stylesheetRules:t,_stylesheetTheme:n,...r}=e.root;return{...e,root:r}}async function ct(e){let t=Object.keys(e.screens);if(t.length===0)throw Error("screens must name at least one .stx file");let n=e.routed??!0,r=e.initialScreen??t[0];if(!e.screens[r])throw Error(`Initial screen ${r} is not in screens`);let s=F.resolve(e.root??process.cwd());if(e.messages&&!e.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(e.sharedRuntime&&!e.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(e.messages&&!e.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(e.messages&&e.outFile)throw Error("messages leave the languages out of the screens' code, which the one-file bundle cannot read: build it without messages");let o=e.messages?await bi(s,e.messages):null,c=e.styleConfig??await gi(s),u=o?Si(o):null,d=[],f=async()=>{for(let R of t){let _=F.resolve(s,e.screens[R]);if(!_.endsWith(".stx"))throw Error(`Screen ${R} must name a .stx file`);d.push({name:R,file:_,compiled:await ke(_,{root:s})})}};await vt(c,()=>u?Qr(u,f):f());let h=st("jsc-globals"),p=st("shared-screen"),m=e.app?F.resolve(s,e.app):null;if(m&&!at(m))throw Error(`The app script ${e.app} does not exist`);if(m&&!n)throw Error("An app script needs a routed bundle");if(m&&e.screens[de])throw Error(`${de} is the app script's route, not a screen name`);let y=e.browser;if(e.screens[Re])throw Error(`${Re} is the runtime prelude's file, not a screen name`);let v=gt();if(y&&e.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let g=new Set(d.flatMap(({compiled:R})=>R.dependencies)),l=null;if(e.routesDir&&e.sharedRuntime&&e.shareModules!==!1&&process.env.STX_NATIVE_SHARE_MODULES!=="0"){let R=[],_=d.map(({name:L,compiled:X})=>{let B=X.scripts.filter((W)=>!W.registry).map((W)=>W.code);return{name:L,ids:Dr(...B),names:Zs(...B)}}),O=()=>Qs(_,{collectInputs:R});if(l=await(u?Qr(u,O):O()),l)for(let L of R)g.add(L)}let w=l,b=e.routesDir&&e.sharedRuntime&&e.shareModules!==!1&&process.env.STX_NATIVE_SHARE_MODULES!=="0"?vn(d.map(({name:R,compiled:_})=>({name:R,scripts:_.scripts}))):null,N=xi(d.map(({name:R,compiled:_})=>({name:R,document:_.document}))),S=(R,_,O)=>{let L=n?`var routeName = g.__stxNativeRoute || ${JSON.stringify(r)};
|
|
19
|
+
var isApp = ${m?`routeName === ${JSON.stringify(de)}`:"false"};
|
|
20
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
21
|
+
if (isApp ? ${!_} : ${JSON.stringify(R.map(({name:H})=>H))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
22
|
+
var isApp = false;`,X=R.map(({name:H,compiled:K},te)=>{let q=O?N.screens.get(H):void 0,Rn=wi(q?Ni(K.document):K.document,s);return`${te===0?"if":"else if"} (routeName === ${JSON.stringify(n?H:"main")}) {
|
|
23
|
+
nativeDocument = ${JSON.stringify(Rn)};${q?`
|
|
24
|
+
nativeDocument.root._stylesheetRules = runtime.stylesheetRules(${JSON.stringify(q.order)}, ${JSON.stringify(q.own)});${q.theme?`
|
|
25
|
+
nativeDocument.root._stylesheetTheme = runtime.themes[${JSON.stringify(q.theme)}];`:""}`:""}
|
|
26
|
+
manifest = ${JSON.stringify(K.manifest)};
|
|
27
|
+
}`}).join(`
|
|
28
|
+
`),B=R.map(({name:H,compiled:K},te)=>`${te===0?"if":"else if"} (routeName === ${JSON.stringify(n?H:"main")}) {
|
|
29
|
+
g.__stx_latestSetup = null;
|
|
30
|
+
${(O&&b?.screens.get(H)||K.scripts).map((q)=>O&&q.registry&&w?.routes.has(H)?w.routes.get(H):q.owner?` g.__stx_componentSetups = g.__stx_componentSetups || {};
|
|
31
|
+
// Kept by id as well as run once: a :for or :if clone of this component
|
|
32
|
+
// has no script to copy, and is set up from this (component hydration).
|
|
33
|
+
g.__stx_componentSetups[${JSON.stringify(q.owner)}] = function() {
|
|
34
|
+
${q.code}
|
|
35
|
+
};
|
|
36
|
+
g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(q.owner)});
|
|
37
|
+
try { g.__stx_componentSetups[${JSON.stringify(q.owner)}](); }
|
|
38
|
+
finally { g.__STX_SETUP_ROOT__ = null; }`:q.code).join(`
|
|
39
|
+
`)}
|
|
40
|
+
}`).join(`
|
|
41
|
+
`),W=_&&m,P=y?st("browser-screen"):null,D=y?Bun.resolveSync(y.platformModule,s):null;return`
|
|
42
|
+
${O?`var runtime = globalThis.__stxNativeRuntime;
|
|
43
|
+
if (!runtime || runtime.version !== ${JSON.stringify(O)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${Re}.js from the same build first');
|
|
44
|
+
var installJSCGlobals = runtime.installJSCGlobals;
|
|
45
|
+
var prepareNativeApp = runtime.prepareNativeApp;
|
|
46
|
+
var prepareSharedNativeScreen = runtime.prepareSharedNativeScreen;`:`import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
47
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(p)};`}
|
|
48
|
+
${y?`import { createBrowserScreenBridge } from ${JSON.stringify(P)};
|
|
49
|
+
import { createBrowserPlatform } from ${JSON.stringify(D)};`:""}
|
|
50
|
+
${W?`import * as nativeAppModule from ${JSON.stringify(m)};`:"var nativeAppModule = null;"}
|
|
51
|
+
${y?"(async function() {":""}
|
|
52
|
+
var g = globalThis;
|
|
53
|
+
installJSCGlobals(g);
|
|
54
|
+
g.__stxNativeStyleConfig = ${O?"runtime.styleConfig":JSON.stringify(c)};
|
|
55
|
+
${y?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(y.platformOptions??{})});
|
|
56
|
+
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(y)});
|
|
57
|
+
var bridge = browserBridge;
|
|
58
|
+
g.__stxNativeRoute = ${JSON.stringify(r)};`:"var bridge = g.__stxNativeBridge;"}
|
|
59
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
60
|
+
var routeNames = ${O?"runtime.routeNames":JSON.stringify(n?t:["main"])};
|
|
61
|
+
var shareStorage = ${O?"runtime.shareStorage":JSON.stringify(e.shareStorage??{})};
|
|
62
|
+
${L}
|
|
63
|
+
g.__stxNativeRoute = routeName;
|
|
64
|
+
var nativeDocument;
|
|
65
|
+
var manifest;
|
|
66
|
+
${X}
|
|
67
|
+
var screen = null;
|
|
68
|
+
var app = null;
|
|
69
|
+
if (isApp) {
|
|
70
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames, shareStorage: shareStorage });
|
|
71
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames, shareStorage: shareStorage });
|
|
75
|
+
g.__stx_host = screen.host;
|
|
76
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
77
|
+
}
|
|
78
|
+
${O?"runtime.startSignals();":v}
|
|
79
|
+
var pageSetup = g.__stx_latestSetup;
|
|
80
|
+
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
81
|
+
${B}
|
|
82
|
+
// The screen's setup is the native host's to run. A screen script publishes
|
|
83
|
+
// it where a page's document runtime adopts its own, and in a browser that
|
|
84
|
+
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
85
|
+
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
86
|
+
// whatever setup it had.
|
|
87
|
+
var screenSetup = g.__stx_latestSetup || null;
|
|
88
|
+
g.__stx_latestSetup = pageSetup;
|
|
89
|
+
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
90
|
+
if (isApp) app.start(nativeAppModule);
|
|
91
|
+
else screen.mount(g.stx, screenSetup);
|
|
92
|
+
${y?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
93
|
+
var unmount = g.__stxNativeUnmount;
|
|
94
|
+
var ended = false;
|
|
95
|
+
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
96
|
+
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
97
|
+
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(y.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
98
|
+
`},k=(R)=>({name:"stx-native-shared-screens",setup(_){_.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),_.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:R,loader:"js"}))}}),x=d.flatMap(({compiled:R})=>R.diagnostics).map((R)=>({level:"warning",message:[R.kind,R.tag,R.name].filter(Boolean).join(": ")})),A=d.filter(({compiled:R})=>R.document.chrome),M=A.length?{chrome:Object.fromEntries(A.map(({name:R,compiled:_})=>[R,_.document.chrome]))}:{},j=e.minify??!1,T,C,E;if(e.routesDir){let R=F.resolve(s,e.routesDir);Sn(R,{recursive:!0});let _=`
|
|
99
|
+
import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
100
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(p)};
|
|
101
|
+
globalThis.__stxNativeRuntime = {
|
|
102
|
+
version: '__STX_NATIVE_RUNTIME_VERSION__',
|
|
103
|
+
// What every route of this build shares, held once instead of in each
|
|
104
|
+
// route file: the app's style vocabulary, its route names and shared
|
|
105
|
+
// storage keys, and the rules and themes of the stylesheets its screens carry.
|
|
106
|
+
styleConfig: ${JSON.stringify(c)},
|
|
107
|
+
routeNames: ${JSON.stringify(n?t:["main"])},
|
|
108
|
+
shareStorage: ${JSON.stringify(e.shareStorage??{})},
|
|
109
|
+
stylesheetRules: function(order, own) {
|
|
110
|
+
var rules = {};
|
|
111
|
+
var shared = this.rules;
|
|
112
|
+
for (var i = 0; i < order.length; i++) rules[order[i]] = Object.prototype.hasOwnProperty.call(own, order[i]) ? own[order[i]] : shared[order[i]];
|
|
113
|
+
return rules;
|
|
114
|
+
},
|
|
115
|
+
rules: ${JSON.stringify(N.rules)},
|
|
116
|
+
themes: ${JSON.stringify(N.themes)},
|
|
117
|
+
// The modules more than one route reaches (client-module-registry.ts),
|
|
118
|
+
// each run the first time a route asks for it, and once.
|
|
119
|
+
chunks: {${w?[...w.chunks].map(([P,D])=>`
|
|
120
|
+
${JSON.stringify(P)}: ${D}`).join(","):""}},
|
|
121
|
+
// The component code the routes have in common: the functions that set up
|
|
122
|
+
// a component, by content, which a route's factories and calls name.
|
|
123
|
+
components: {${b?[...b.bodies].sort(([P],[D])=>P<D?-1:1).map(([P,D])=>`
|
|
124
|
+
${JSON.stringify(P)}: ${D}`).join(","):""}},
|
|
125
|
+
chunk: function(name) {
|
|
126
|
+
var loaded = this.loaded || (this.loaded = {});
|
|
127
|
+
if (Object.prototype.hasOwnProperty.call(loaded, name)) return loaded[name];
|
|
128
|
+
var runtime = this;
|
|
129
|
+
return (loaded[name] = this.chunks[name](function(chunk) { return runtime.chunk(chunk); }));
|
|
130
|
+
},
|
|
131
|
+
installJSCGlobals: installJSCGlobals,
|
|
132
|
+
prepareNativeApp: prepareNativeApp,
|
|
133
|
+
prepareSharedNativeScreen: prepareSharedNativeScreen,
|
|
134
|
+
// Each screen starts its own signals runtime, after its host is in place.
|
|
135
|
+
startSignals: function() {
|
|
136
|
+
${v}
|
|
137
|
+
},
|
|
138
|
+
// A language's messages for an area (the compile's \`messages\`), read the
|
|
139
|
+
// first time they are looked into: a screen never parses a language it
|
|
140
|
+
// is not shown in, nor an area it does not use.
|
|
141
|
+
messages: function(language, area) {
|
|
142
|
+
var g = globalThis;
|
|
143
|
+
var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
|
|
144
|
+
function table() {
|
|
145
|
+
var forLanguage = loaded[language] || (loaded[language] = {});
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
|
|
147
|
+
var value = null;
|
|
148
|
+
if (typeof g.__stxNativeReadMessages === 'function') {
|
|
149
|
+
try {
|
|
150
|
+
var text = g.__stxNativeReadMessages(language, area);
|
|
151
|
+
if (typeof text === 'string') value = JSON.parse(text);
|
|
152
|
+
}
|
|
153
|
+
catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
|
|
154
|
+
}
|
|
155
|
+
forLanguage[area] = value;
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
var own = Object.prototype.hasOwnProperty;
|
|
159
|
+
return new Proxy({}, {
|
|
160
|
+
get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
|
|
161
|
+
has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
|
|
162
|
+
ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
|
|
163
|
+
getOwnPropertyDescriptor: function(target, name) {
|
|
164
|
+
var messages = table();
|
|
165
|
+
return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
`,O,L=F.join(R,`${Re}.js`);if(e.sharedRuntime){let P=await ot("stx:native-shared-screens",[k(_)],j,g);O=Bun.hash(P).toString(36),C=L,await Bun.write(C,P.replace("__STX_NATIVE_RUNTIME_VERSION__",O))}else wn(L,{force:!0});let X=F.join(R,hi);wn(X,{recursive:!0,force:!0});let B={},W=[...d.map((P)=>({name:P.name,screens:[P],app:!1})),...m?[{name:de,screens:[],app:!0}]:[]];T={};for(let P=0;P<W.length;P+=6)await Promise.all(W.slice(P,P+6).map(async(D)=>{let Y=F.join(R,`${D.name}.js`),Q=await ot("stx:native-shared-screens",[k(S(D.screens,D.app,O))],j,g,u??void 0);if(await Bun.write(Y,Q),T[D.name]=Y,o){let H=new Set(xn(Q));for(let K of w?.reads.get(D.name)??[])for(let te of xn(w?.chunks.get(K)??""))H.add(te);B[D.name]=[...H].sort()}}));if(o){for(let[D,Y]of o.data)for(let[Q,H]of Y)await Bun.write(F.join(X,D,`${Q}.json`),H);let P=Object.fromEntries(Object.keys(B).sort().map((D)=>[D,B[D]]));await Bun.write(F.join(X,"routes.json"),JSON.stringify(P));for(let D of o.files.keys())g.add(D);E={dir:X,languages:[...o.data.keys()],routes:P}}if(!e.outFile)return{code:"",routes:T,runtime:C,...E?{messages:E}:{},...M,diagnostics:x,dependencies:[...g]}}let I=await ot("stx:native-shared-screens",[k(S(d,!0))],j,g);if(!e.outFile)return{code:I,...M,diagnostics:x,dependencies:[...g]};let V=F.resolve(s,e.outFile);return Sn(F.dirname(V),{recursive:!0}),await Bun.write(V,I),{code:I,outFile:V,...T?{routes:T,runtime:C}:{},...E?{messages:E}:{},...M,diagnostics:x,dependencies:[...g]}}async function ki(e,t={}){return ct({...t,screens:{main:e},routed:!1})}function Nn(e,t={}){return ki(e,t)}var kn=["native.config.json","stx-native.config.json"];function Ai(e=process.cwd(),t){let n=t?G.resolve(e,t):kn.map((d)=>G.join(e,d)).find((d)=>Te(d));if(!n)return null;if(!Te(n))throw Error(`Native config not found: ${n}`);let r=JSON.parse(Ti(n,"utf8")),s=Object.entries(r.screens??{});if(s.length===0)throw Error(`${G.basename(n)} must name at least one screen in "screens"`);let o={};for(let[d,f]of s){if(!/^[A-Z][\w-]*$/i.test(d))throw Error(`Invalid native screen name: ${d}`);if(typeof f!=="string"||!f.endsWith(".stx"))throw Error(`Screen ${d} must name a .stx file`);if(o[d]=G.resolve(G.dirname(n),f),!Te(o[d]))throw Error(`Screen ${d} not found: ${o[d]}`)}let c=r.initialScreen||s[0][0];if(!o[c])throw Error(`Initial screen ${c} is not in screens`);if(r.app!==void 0&&typeof r.app!=="string")throw Error(`"app" must name the app script's file`);let u=r.app?G.resolve(G.dirname(n),r.app):void 0;if(u&&!Te(u))throw Error(`App script not found: ${u}`);return{initialScreen:c,screens:o,file:n,...u?{app:u}:{}}}async function Ta(e,t={}){let n=G.resolve(t.cwd??process.cwd()),r=t.format??"ir";if(r!=="ir"&&r!=="bundle")throw Error(`Unknown compile format: ${r}. Expected ir or bundle.`);let s=e?null:Ai(n,t.config);if(!e&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${kn[0]}`);let o,c=[];if(r==="bundle"){let d=s?await ct({screens:s.screens,initialScreen:s.initialScreen,minify:t.minify,root:n,...s.app?{app:s.app}:{}}):await Nn(G.resolve(n,e),{minify:t.minify});o=d.code,c=d.diagnostics}else{let d=async(h)=>{let p=await ke(h);return c.push(...p.diagnostics.map((m)=>({level:"warning",message:[m.kind,m.tag,m.name].filter(Boolean).join(": ")}))),p.document},f=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([h,p])=>[h,await d(p)])))}:await d(G.resolve(n,e));o=JSON.stringify(f,null,2)}if(!t.output)return{output:o,diagnostics:c};let u=G.resolve(n,t.output);return Ri(G.dirname(u),{recursive:!0}),await Bun.write(u,o),{output:o,written:u,diagnostics:c}}export{Ta as runNativeCompile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f,d}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{f,d}from"./chunk-465resq9.js";import{J,I,p}from"./chunk-m5fjhrpd.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Dl(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function em(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Ml(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(I(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!I(s,r))return e;let a=_(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Ll(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=J(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await Ml(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function tm(t){let o=Dl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function nm(t,o,i,r,e){return await Ll(t,{default:o,named:i},r,e)}
|
|
3
|
+
export{Dl,em,Ml,Ll,tm,nm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{T}from"./chunk-
|
|
2
|
+
import{T}from"./chunk-t4mpq6t0.js";import{Ve,Cn}from"./chunk-83ezv8yz.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function
|
|
3
|
-
export{
|
|
2
|
+
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function ru(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
+
export{ru};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{kc,r,fe}from"./chunk-m5fjhrpd.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-c05r0rzw.js";import o from"fs";import u from"path";var Rf=new Map,m=new Map;async function bh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){n=s;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function vh(e){m.delete(e)}function wh(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function xh(e){x=e}async function Af(e=!1){let t=x??await import("./chunk-79y41h1d.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function Pf(){if(S===null){let{getRouterScript:e}=await import("./chunk-e3fkq9gb.js");S=e()}return S}var y={};async function Sh(e,t=!1){let n=e==="runtime"?await Af(t):await Pf(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==n)s={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:n,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function kh(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let s=c.keys().next().value;p-=c.get(s).length*2,c.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(u.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function zo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function _h(){m.clear(),fe(),kc(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function ar(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${gs(e)}.html`),s=u.join(n,`${gs(e)}.meta.json`);if(!await r(i)||!await r(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==et())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await r(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function cr(e,t,n,i){try{if(!i.cachePath)return;let s=u.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=u.join(s,`${gs(e)}.html`),a=u.join(s,`${gs(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:et(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Rf.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function gs(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
|
|
3
|
+
export{Rf,bh,vh,wh,xh,Af,Pf,Sh,kh,zo,_h,ar,cr,gs};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function
|
|
2
|
+
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function wm(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function xm(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function Sm(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
|
|
3
3
|
<div
|
|
4
4
|
class="stx-transition-wrapper"
|
|
5
5
|
data-transition="${l}"
|
|
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
41
41
|
});
|
|
42
42
|
})();
|
|
43
43
|
</script>
|
|
44
|
-
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function
|
|
44
|
+
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function km(){return`
|
|
45
45
|
/* STX Transition Presets */
|
|
46
46
|
|
|
47
47
|
/* Fade */
|
|
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
228
228
|
opacity: 1;
|
|
229
229
|
max-height: 1000px;
|
|
230
230
|
}
|
|
231
|
-
`}function
|
|
231
|
+
`}function _m(){return`
|
|
232
232
|
// STX Transition Runtime
|
|
233
233
|
(function() {
|
|
234
234
|
if (typeof window === 'undefined') return;
|
|
@@ -317,5 +317,5 @@ else {
|
|
|
317
317
|
|
|
318
318
|
console.log('[stx] Transition runtime initialized');
|
|
319
319
|
})();
|
|
320
|
-
`}function
|
|
321
|
-
export{
|
|
320
|
+
`}function Cm(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
|
|
321
|
+
export{wm,xm,Sm,km,_m,Cm};
|