@stacksjs/stx 0.2.657 → 0.2.661
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-n9dbjget.js → chunk-0961mx93.js} +1 -1
- package/dist/{chunk-3zbrmm40.js → chunk-09a8tn6e.js} +1 -1
- package/dist/{chunk-py28zkeh.js → chunk-2cb9r3r9.js} +11 -11
- package/dist/{chunk-6w8sjav5.js → chunk-2jv7g2fs.js} +1 -1
- package/dist/{chunk-g3tk83ea.js → chunk-2x9h3whx.js} +1 -1
- package/dist/{chunk-fzxx3rad.js → chunk-2yvqydak.js} +3 -3
- package/dist/{chunk-v5981jwt.js → chunk-3fyj98v9.js} +1 -1
- package/dist/{chunk-zvj935ma.js → chunk-3p8p8sfw.js} +1 -1
- package/dist/{chunk-51kzs978.js → chunk-57nbg2f9.js} +2 -2
- package/dist/{chunk-kt3nk905.js → chunk-5em9ak8r.js} +1 -1
- package/dist/{chunk-47qc69v1.js → chunk-5n6sej6b.js} +1 -1
- package/dist/{chunk-gjwyy7kh.js → chunk-5nfc2tw2.js} +71 -71
- package/dist/{chunk-pcscq080.js → chunk-6qd27t9k.js} +1 -1
- package/dist/{chunk-q68rssa6.js → chunk-714gdfj9.js} +1 -1
- package/dist/{chunk-s3t9tmsz.js → chunk-7ek9yvwk.js} +1 -1
- package/dist/chunk-7j486x8f.js +2 -0
- package/dist/{chunk-vpmfm04j.js → chunk-7rjm58gn.js} +1 -1
- package/dist/chunk-8xypmt6s.js +2 -0
- package/dist/{chunk-gb6229zj.js → chunk-9rh5anvd.js} +2 -2
- package/dist/{chunk-ddtmrma9.js → chunk-9zy4kzqk.js} +1 -1
- package/dist/{chunk-j8g1v38x.js → chunk-afavkkkq.js} +1 -1
- package/dist/chunk-avmqg5t6.js +2 -0
- package/dist/{chunk-aqk9e27b.js → chunk-bt4bd4f5.js} +1 -1
- package/dist/{chunk-m0gd0264.js → chunk-d5k8gx93.js} +1 -1
- package/dist/{chunk-3r5rk2rz.js → chunk-d5vz53t1.js} +2 -2
- package/dist/{chunk-jp4ef6dc.js → chunk-dah90qrm.js} +1 -1
- package/dist/{chunk-2mppsbt3.js → chunk-dn2h9g79.js} +1 -1
- package/dist/{chunk-mgkrnwjk.js → chunk-dr1vedj2.js} +1 -1
- package/dist/{chunk-h39efd30.js → chunk-dv709hnm.js} +1 -1
- package/dist/{chunk-sng45f0b.js → chunk-dyzgrvg3.js} +8 -8
- package/dist/{chunk-vmwdt8fr.js → chunk-een2wqah.js} +6 -6
- package/dist/chunk-eqrkhc18.js +12 -0
- package/dist/{chunk-y463z9qf.js → chunk-eyvex6fk.js} +39 -39
- package/dist/{chunk-zn7ncwb8.js → chunk-f9fty8ty.js} +1 -1
- package/dist/{chunk-7gpxz94n.js → chunk-ghge79wv.js} +1 -1
- package/dist/chunk-j02834qv.js +2 -0
- package/dist/{chunk-h8h2n247.js → chunk-jtheqwp2.js} +5 -5
- package/dist/{chunk-gg3wbfxa.js → chunk-k99f2njc.js} +1 -1
- package/dist/chunk-mdk323pn.js +2 -0
- package/dist/{chunk-nr9z0zeq.js → chunk-mmern3j1.js} +1 -1
- package/dist/{chunk-7nx74hdr.js → chunk-mvv5cpen.js} +1 -1
- package/dist/{chunk-0h3gpwyv.js → chunk-n4x9hytk.js} +56 -56
- package/dist/{chunk-f9xed7c1.js → chunk-nw9x9gsb.js} +1 -1
- package/dist/chunk-p6p29613.js +2 -0
- package/dist/chunk-pnnqftq6.js +2 -0
- package/dist/{chunk-pbxq1rwd.js → chunk-pp4pyeg4.js} +4 -4
- package/dist/{chunk-x29qw59w.js → chunk-px8e8qgp.js} +1 -1
- package/dist/{chunk-mj3fghaq.js → chunk-qzv0mqw5.js} +1 -1
- package/dist/{chunk-a8aqch0j.js → chunk-r1y1k2ky.js} +38 -38
- package/dist/{chunk-nm1ggj8d.js → chunk-rzxhdmz9.js} +1 -1
- package/dist/{chunk-3ey8888k.js → chunk-sk82mf97.js} +1 -1
- package/dist/chunk-snwps673.js +129 -0
- package/dist/{chunk-xmb4ttnf.js → chunk-t1fxzg0m.js} +2 -2
- package/dist/{chunk-28jtt8hn.js → chunk-vp9hse5k.js} +48 -48
- package/dist/chunk-w7dcy972.js +2 -0
- package/dist/{chunk-shbabvaz.js → chunk-w82nvp7r.js} +1 -1
- package/dist/{chunk-3areak0p.js → chunk-wc3e138p.js} +2 -2
- package/dist/{chunk-ndn0rmhs.js → chunk-wcmzr1sk.js} +1 -1
- package/dist/{chunk-64ny75zz.js → chunk-xt9t5wvx.js} +1 -1
- package/dist/chunk-yharrk8v.js +2 -0
- package/dist/{chunk-w6kdpx52.js → chunk-z4fa7nsm.js} +5 -5
- package/dist/{chunk-tnqbck1r.js → chunk-z5qj7enn.js} +1 -1
- package/dist/chunk-zdfja1ap.js +2 -0
- package/dist/{chunk-zd23z1j8.js → chunk-zjnh64wm.js} +1 -1
- package/dist/cli.js +8 -8
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/expressions.js +9 -0
- package/dist/native/bridge/protocol.d.ts +1 -0
- package/dist/native/compiler/bundle.d.ts +1 -0
- package/dist/native/compiler/bundle.js +3 -2
- package/dist/native/compiler/headwind-to-style.d.ts +4 -0
- package/dist/native/compiler/headwind-to-style.js +33 -3
- package/dist/native/compiler/html-to-ir.d.ts +12 -0
- package/dist/native/compiler/html-to-ir.js +56 -5
- package/dist/native/compiler/ir.d.ts +2 -0
- package/dist/native/compiler/render-screen.js +31 -5
- package/dist/native/runtime/binding-tree.js +2 -1
- package/dist/native/runtime/craft-bridge.d.ts +2 -0
- package/dist/native/runtime/craft-bridge.js +13 -3
- package/dist/native/runtime/native-host.d.ts +1 -0
- package/dist/native/runtime/native-host.js +82 -12
- package/dist/native/runtime/shared-screen.js +4 -3
- package/dist/native/runtime/web-navigation.d.ts +18 -0
- package/dist/native/runtime/web-navigation.js +59 -0
- package/dist/native/runtime/web-storage.d.ts +40 -1
- package/dist/native/runtime/web-storage.js +123 -26
- package/dist/native/testing.d.ts +1 -0
- package/dist/native/testing.js +1 -0
- package/dist/native/text-entry.d.ts +51 -0
- package/dist/native/text-entry.js +101 -0
- package/dist/native-build.js +3 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +25 -25
- package/dist/stx-virtual-ts.d.ts +1 -1
- package/dist/stx-virtual-ts.js +3 -1
- package/dist/utils.js +2 -0
- package/package.json +5 -5
- package/dist/chunk-0rs1j4bn.js +0 -2
- package/dist/chunk-1qmc6gg1.js +0 -2
- package/dist/chunk-2e9d0np1.js +0 -2
- package/dist/chunk-62x62wzy.js +0 -2
- package/dist/chunk-7js495j0.js +0 -2
- package/dist/chunk-cbsa2np9.js +0 -2
- package/dist/chunk-egg54kd0.js +0 -12
- package/dist/chunk-ez0s2kvp.js +0 -2
- package/dist/chunk-g884rvhy.js +0 -2
- package/dist/chunk-h42anr8g.js +0 -2
- package/dist/chunk-hz0g9xrq.js +0 -2
- package/dist/chunk-rhzkw6y4.js +0 -128
package/dist/chunk-rhzkw6y4.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-hb08vrbb.js";import{_s,Ko,gc}from"./chunk-7rta163c.js";import"./chunk-ce6zddpf.js";import"./chunk-gjwyy7kh.js";import"./chunk-2h8ea0we.js";import"./chunk-mj3fghaq.js";import"./chunk-a3d0g4mr.js";import"./chunk-zaaeneq6.js";import{i}from"./chunk-a8aqch0j.js";import"./chunk-t9mfztcs.js";import"./chunk-04kg16qs.js";import"./chunk-aqk9e27b.js";import{gt,Ve,fe,Qt,Te,Vn,Un,Ue}from"./chunk-3areak0p.js";import{s}from"./chunk-h8h2n247.js";import"./chunk-sng45f0b.js";import"./chunk-pbxq1rwd.js";import"./chunk-3ey8888k.js";import{Vr}from"./chunk-51kzs978.js";import"./chunk-prf164ct.js";import{pt}from"./chunk-pxqh758g.js";import"./chunk-v2x9vzgw.js";import"./chunk-ddtmrma9.js";import{qs}from"./chunk-7gpxz94n.js";import"./chunk-r7kmsq3n.js";import"./chunk-w6kdpx52.js";import"./chunk-8nryyqb5.js";import"./chunk-zd23z1j8.js";import{existsSync as me,mkdirSync as Gr,readFileSync as Jr}from"fs";import U from"path";import{existsSync as Ke,mkdirSync as en,realpathSync as Lr,rmSync as tn}from"fs";import B from"path";import{existsSync as Cr}from"fs";import K from"path";var an="data-stx-b",et=new Set(Ko),cn=new Set(_s);function ln(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(et.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(gc(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!cn.has(e))return"attr";let n=e.slice(2);if(n==="cloak"||n==="data"||n==="bind")return null;if(n==="tooltip"||n==="tooltip-position")return null;return et.has(n)?n==="if"?"if":n:"attr"}return null}function un(t){let e=[];for(let[n,r]of t){let o=ln(n);if(o)e.push({name:n,value:r,kind:o})}return e}var dn=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,ye=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function tt(t){let e=[],n=0;return{html:t.replace(dn,(o,a,d)=>{if(!d||!/[:@]|x-/.test(d))return o;let l=[];ye.lastIndex=0;for(let S=ye.exec(d);S;S=ye.exec(d))l.push([S[1],S[2]??S[3]??S[4]??""]);let f=un(l);if(!f.length)return o;let g={id:n++,bindings:f};if(f.some((S)=>S.kind==="for"))g.template=!0;e.push(g);let h=o.endsWith("/>");return`${o.slice(0,h?-2:-1).trimEnd()} ${an}="${g.id}"${h?"/>":">"}`}),manifest:{entries:e}}}import Zn from"path";function se(t){let e=t&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(t.trim());if(!e)return;let n=Number(e[1])*(e[2]==="rem"?16:1);return Number.isFinite(n)?n:void 0}function be(t,e){if(!fe[t])return;return se(e?.get(Qt(t))??fe[t].value)}function ve(t,e){let n=Vn[t];if(!n)return;return se(e?.get(Ue(n))??Te[n]?.value)}function we(t,e){let n=Un[t];if(!n)return;let r=se(e?.get(Ue(n.size))??Te[n.size]?.value),o=se(e?.get(Ue(n.leading))??Te[n.leading]?.value);if(r===void 0||o===void 0)return;return{fontSize:r,lineHeight:o}}var fn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},st=Ne({}),nt,rt=null;function xe(){let t=globalThis.__stxNativeStyleConfig;if(!t)return st;if(t!==nt)nt=t,rt=Ne(t);return rt}function ot(t,e=new Map,n=""){for(let[r,o]of Object.entries(t??{})){let a=r==="DEFAULT"?n.replace(/-$/,""):`${n}${r}`;if(typeof o==="string")e.set(a,o);else if(o&&typeof o==="object")ot(o,e,`${a}-`)}return e}function at(t){let e={};for(let[n,r]of Object.entries(t??{})){let o=typeof r==="number"?r:Number.parseFloat(String(r));if(Number.isFinite(o))e[n]=o}return e}function Ne(t){return{shortcuts:new Map(Object.entries(t.shortcuts??{}).filter(([,e])=>typeof e==="string")),colors:ot(t.colors),breakpoints:new Map(Object.entries({...fn,...at(t.breakpoints)}))}}var Se={};function it(t){Se=t??{},st=Ne(Se)}async function ct(t,e){let n=Se;it(t);try{return await e()}finally{it(n)}}function lt(t){if(!t)return{};let e=t.theme??{},n=Object.fromEntries(Object.entries(t.shortcuts??{}).filter(([,r])=>typeof r==="string"));return{...Object.keys(n).length?{shortcuts:n}:{},...e.colors?{colors:JSON.parse(JSON.stringify(e.colors))}:{},...e.screens?{breakpoints:at(e.screens)}:{}}}function ut(t){return xe().shortcuts.get(t)}function dt(t){return xe().colors.get(t)}function ke(t){return xe().breakpoints.get(t)}var ht=/^--[\w\u0080-\uFFFF-]+$/u;function ft(t,e){if(!/var\(/i.test(t))return t;let n="",r="",o=!1;for(let a=0;a<t.length;a++){let d=t[a];if(d==="\\"){n+=t.slice(a,a+2),a++;continue}if(r){if(n+=d,d===r)r="";continue}if(d==='"'||d==="'"){r=d,n+=d;continue}if(t.slice(a,a+4).toLowerCase()!=="var("||a>0&&/[\w-]/.test(t[a-1])){n+=d;continue}let l=1,f=-1,g="",h=a+4;for(;h<t.length;h++){let m=t[h];if(m==="\\"){h++;continue}if(g){if(m===g)g="";continue}if(m==='"'||m==="'"){g=m;continue}if(m==="(")l++;if(m===")"&&--l===0)break;if(m===","&&l===1&&f===-1)f=h}if(l!==0)return;let p=t.slice(a+4,f===-1?h:f).trim();if(!ht.test(p))return;let S=e(p,f===-1?void 0:t.slice(f+1,h).trim());if(S===void 0||n.length+S.length>65536)return;n+=S,o=!0,a=h}return o&&n.length>65536?void 0:n}function te(t,e){let n=new Map,r=new Set;for(let[u,c]of t){let y=u.trim();if(!ht.test(y))continue;if(typeof c==="string"||typeof c==="number"&&Number.isFinite(c))n.set(y,String(c).trim())}let o=new Map,a=new Set;for(let[u,c]of n){let y=new Set,b=(x,w=0)=>w>64?void 0:ft(x,(k,N)=>(y.add(k),N===void 0?"":b(N,w+1)));if(b(c)===void 0)a.add(u);o.set(u,y)}let d=new Map,l=new Map,f=[],g=new Set,h=0;function p(u,c=0){if(c>64){a.add(u);return}d.set(u,h),l.set(u,h++),f.push(u),g.add(u);for(let x of o.get(u)??[]){if(!n.has(x))continue;if(!d.has(x)){if(p(x,c+1),l.has(x))l.set(u,Math.min(l.get(u),l.get(x)))}else if(g.has(x))l.set(u,Math.min(l.get(u),d.get(x)))}if(l.get(u)!==d.get(u))return;let y=[],b;do b=f.pop(),g.delete(b),y.push(b);while(b!==u);if(y.length>1||o.get(u)?.has(u))y.forEach((x)=>a.add(x))}for(let u of n.keys())if(!d.has(u))p(u);let S=new Map;function m(u,c){if(r.add(u),S.has(u))return S.get(u);let y=n.get(u),b=y===void 0||/^(?:inherit|unset)$/i.test(y)?e?.get(u):a.has(u)||/^(?:initial|revert|revert-layer)$/i.test(y)?void 0:v(y,c+1);return S.set(u,b),b}function v(u,c=0){if(c>64)return;return ft(u,(y,b)=>m(y,c)??(b===void 0?void 0:v(b,c+1)))}return{resolve:v,used:r,computed(){let u=new Map(e);for(let c of n.keys())u.set(c,m(c,0));return u}}}function Re(t){if(t.display==="flex"&&t.flexDirection==null)return{...t,flexDirection:"row"};return t}var mt=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","tintColor","transform","overflow","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),pn=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"]),yt=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"]),gn=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,hn=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,mn=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),yn=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function bn(t){if(typeof t!=="string")return t;let e=hn.exec(t);return e?Number(e[1])*(/^r?em$/i.test(e[2]||"")?16:1):t}function ee(t){return typeof t==="number"&&Number.isFinite(t)}function vn(t,e){if(t==="shadowOffset"&&e&&typeof e==="object"&&!Array.isArray(e)){let{width:n,height:r}=e;return ee(n)&&ee(r)?{width:n,height:r}:void 0}if(t==="transform"&&Array.isArray(e)){let n=[];for(let r of e){if(!r||typeof r!=="object"||Array.isArray(r)||Object.keys(r).length!==1)return;let[o,a]=Object.entries(r)[0];if(yn.has(o)&&ee(a))n.push({[o]:a});else if(mn.has(o)&&typeof a==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(a))n.push({[o]:a});else return}return n}return}function wn(t){let e=[],n=0,r=0,o="";for(let a=0;a<=t.length;a++){let d=t[a];if(d==="\\"){a++;continue}if(o){if(d===o)o="";continue}if(d==='"'||d==="'"){o=d;continue}if(d==="(")r++;if(d===")")r=Math.max(0,r-1);if(a!==t.length&&(d!==";"||r))continue;let l=t.slice(n,a),f=l.indexOf(":");if(f!==-1)e.push([l.slice(0,f).trim(),l.slice(f+1).trim()]);n=a+1}return e}function Sn(t,e){let n;if(typeof t==="string"){if(t=t.trim(),!t)return[];try{t=JSON.parse(t)}catch{}}if(typeof t==="string")n=wn(t);else if(t&&typeof t==="object"&&!Array.isArray(t))n=Object.entries(t);else{if(t!=null&&t!==!1)e({kind:"non-numeric-style",name:"style"});return[]}return n}function oe(t,e=()=>{},n={}){let r=Sn(t,e),o=te(r,n.inheritedVariables);return n.onVariables?.(o.computed()),xn(r,o,e)}function xn(t,e,n){let r={},o=[];for(let[a,d]of t){if(a.trim().startsWith("--")){o.push(a.trim());continue}let l=mt.has(a)||a.trim().startsWith("--")?a:a.trim().toLowerCase().replace(/-([a-z])/g,(h,p)=>p.toUpperCase());if(!mt.has(l)){n({kind:"unknown-style",name:l});continue}if(d==null||d==="")continue;let f=typeof d==="string"?e.resolve(d.trim()):d;if(f===void 0){n({kind:"non-numeric-style",name:l});continue}if(f==="")continue;let g;if(pn.has(l)||yt.has(l)){if(g=bn(f),!ee(g)&&!(yt.has(l)&&typeof g==="string"&&g.endsWith("%")&&gn.test(g.slice(0,-1))&&Number.isFinite(Number(g.slice(0,-1)))))g=void 0}else if(l==="display"&&f==="inline-flex")g="flex";else if(l==="shadowOffset"||l==="transform")g=vn(l,f);else if(l==="gridTemplateColumns"||l==="gridTemplateRows")g=ee(f)||typeof f==="string"?f:void 0;else if(l==="fontWeight"&&ee(f))g=String(f);else if(typeof f==="string")g=f;if(g===void 0)n({kind:"non-numeric-style",name:l});else r[l]=g}for(let a of o)if(!e.used.has(a))n({kind:"unknown-style",name:a});return r}var Nn={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"}},Ee={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},bt={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},vt={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function Q(t){let e=t.lastIndexOf("/");if(e>0&&(!t.endsWith("]")||/\/\[[\d.]+%?\]$/.test(t))){let r=Q(t.slice(0,e)),o=t.slice(e+1),a=/^\[(.+)\]$/.test(o)?Number.parseFloat(o.slice(1,-1))*(o.includes("%")?1:100):Number.parseFloat(o);if(!r||!Number.isFinite(a))return;return kn(r,a/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let n=t.split("-");if(n.length===2){let[r,o]=n,a=Nn[r];if(a&&typeof a==="object")return a[o]}if(t.startsWith("[")&&t.endsWith("]")){let r=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(r)?r:void 0}return}function Ie(t){return Q(t.trim())}function kn(t,e){if(t==="transparent")return t;let n=t.startsWith("#")?t.slice(1):"";if(n.length===3)n=n.split("").map((o)=>o+o).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,e))*255);return`#${n}${r.toString(16).padStart(2,"0")}`}function Ae(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let n=t.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*e;return r}function M(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1);if(e.endsWith("%"))return;let n=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(n)?n:void 0}return Ee[t]??ve(t)}function ae(t){let e=/^\[(-?\d*\.?\d+)%\]$/.exec(t);if(e)return`${Number.parseFloat(e[1])}%`;return M(t)}var Tn={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"order-first":(t,e)=>(e.order=-9999,!0),"order-last":(t,e)=>(e.order=9999,!0),"order-none":(t,e)=>(e.order=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"mx-auto":(t,e)=>(e.alignSelf="center",!0),fixed:(t,e)=>(e.position="absolute",!0),sticky:()=>!0,"sr-only":(t,e)=>(e.position="absolute",e.width=1,e.height=1,e.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":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-scroll":()=>!0,"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function Rn(t,e){if(!t.startsWith("bg-"))return!1;let n=t.slice(3),r=Q(n);if(r)return e.backgroundColor=r,!0;return!1}function An(t,e){if(!t.startsWith("text-"))return!1;let n=t.slice(5),r=we(n);if(r)return Object.assign(e,r),!0;if(bt[n])return e.fontSize=bt[n],!0;if(n.startsWith("[")&&n.endsWith("]")){let a=n.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(a)){let d=a.endsWith("rem")||a.endsWith("em")?Number.parseFloat(a)*16:Number.parseFloat(a);if(Number.isFinite(d))return e.fontSize=d,!0}}let o=Q(n);if(o)return e.color=o,!0;return!1}var _n=new Set(["t","tr","r","br","b","bl","l","tl"]);function En(t,e){let n=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(t);if(n&&_n.has(n[1]))return e.gradientDirection=`to-${n[1]}`,!0;let r=/^(from|via|to)-(.+)$/.exec(t);if(!r)return!1;let o=Q(r[2]);if(!o)return!1;if(r[1]==="from")e.gradientFrom=o;else if(r[1]==="via")e.gradientVia=o;else e.gradientTo=o;return!0}function In(t,e){for(let n of["fill","stroke"]){let r=`${n}-`;if(!t.startsWith(r))continue;let o=t.slice(r.length);if(o==="none")return e[n]="none",!0;if(n==="stroke"&&/^\d+(?:\.\d+)?$/.test(o))return e.strokeWidth=Number.parseFloat(o),!0;if(n==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(o))return e.strokeWidth=Number.parseFloat(o.slice(1)),!0;let a=Q(o);if(a)return e[n]=a,!0}return!1}function Cn(t,e){if(t.startsWith("p-")){let n=M(t.slice(2));if(n!==void 0)return e.padding=n,!0}if(t.startsWith("px-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingHorizontal=n,!0}if(t.startsWith("py-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingVertical=n,!0}if(t.startsWith("pt-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingTop=n,!0}if(t.startsWith("pr-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingRight=n,!0}if(t.startsWith("pb-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingBottom=n,!0}if(t.startsWith("pl-")){let n=M(t.slice(3));if(n!==void 0)return e.paddingLeft=n,!0}return!1}function St(t,e){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(t)){let n={};if(!St(t.slice(1),n))return!1;let r=Object.entries(n);if(r.some(([,o])=>typeof o!=="number"))return!1;for(let[o,a]of r)e[o]=-a;return!0}if(t.startsWith("m-")){let n=M(t.slice(2));if(n!==void 0)return e.margin=n,!0}if(t.startsWith("mx-")){let n=M(t.slice(3));if(n!==void 0)return e.marginHorizontal=n,!0}if(t.startsWith("my-")){let n=M(t.slice(3));if(n!==void 0)return e.marginVertical=n,!0}if(t.startsWith("mt-")){let n=M(t.slice(3));if(n!==void 0)return e.marginTop=n,!0}if(t.startsWith("mr-")){let n=M(t.slice(3));if(n!==void 0)return e.marginRight=n,!0}if(t.startsWith("mb-")){let n=M(t.slice(3));if(n!==void 0)return e.marginBottom=n,!0}if(t.startsWith("ml-")){let n=M(t.slice(3));if(n!==void 0)return e.marginLeft=n,!0}return!1}function On(t,e){if(!t.startsWith("w-"))return!1;let n=t.slice(2);if(n==="full")return e.width="100%",!0;if(n==="screen")return e.width="100%",!0;if(n==="auto")return e.width="auto",!0;if(n.includes("/")){let[o,a]=n.split("/"),d=Number.parseInt(o)/Number.parseInt(a)*100;return e.width=`${d}%`,!0}let r=ae(n);if(r!==void 0)return e.width=r,!0;return!1}function Pn(t,e){if(!t.startsWith("h-"))return!1;let n=t.slice(2);if(n==="full")return e.height="100%",!0;if(n==="screen")return e.height="100%",!0;if(n==="auto")return e.height="auto",!0;let r=ae(n);if(r!==void 0)return e.height=r,!0;return!1}function Bn(t,e){if(t==="rounded")return e.borderRadius=vt.DEFAULT,!0;if(!t.startsWith("rounded-"))return!1;let n=t.slice(8);if(n==="")return!1;let r=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(n),o=vt[r[2]]??be(r[2])??Ae(r[2]);if(o===void 0)return!1;let a={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],tl:["borderTopLeftRadius"],tr:["borderTopRightRadius"],bl:["borderBottomLeftRadius"],br:["borderBottomRightRadius"]};for(let d of r[1]?a[r[1]]:["borderRadius"])e[d]=o;return!0}function Mn(t,e){let n=/^border(?:-([trblxy]))?(?:-(\d+|\[[^\]]+\]))?$/.exec(t);if(!n)return!1;let[,r="",o]=n,a=o===void 0?1:Number(o);if(o?.startsWith("[")){let l=/^\[(\d+(?:\.\d+)?|\.\d+)(px|rem)?\]$/.exec(o);if(!l)return!1;a=Number(l[1])*(l[2]==="rem"?16:1)}if(!Number.isFinite(a)||a<0)return!1;let d={"":["borderWidth"],t:["borderTopWidth"],r:["borderRightWidth"],b:["borderBottomWidth"],l:["borderLeftWidth"],x:["borderLeftWidth","borderRightWidth"],y:["borderTopWidth","borderBottomWidth"]};for(let l of d[r])e[l]=a;return!0}function Ln(t,e){if(!t.startsWith("border-"))return!1;let n=t.slice(7),r=Q(n);if(r)return e.borderColor=r,!0;return!1}function Dn(t,e){if(!t.startsWith("opacity-"))return!1;let n=Number.parseInt(t.slice(8));if(!Number.isNaN(n))return e.opacity=n/100,!0;return!1}function $n(t,e){if(t.startsWith("tracking-[")){let n=Ae(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(n===void 0)return!1;return e.letterSpacing=n,!0}if(t.startsWith("leading-")){let n=t.slice(8),r=typeof e.fontSize==="number"?e.fontSize:16,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=n.startsWith("[")?/^\[[\d.]+\]$/.test(n)?Number.parseFloat(n.slice(1,-1))*r:Ae(n,r):o[n]!==void 0?o[n]*r:Ee[n];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function jn(t,e){let n=/^(-?)(inset-x|inset-y|inset|top|right|bottom|left)-(.+)$/.exec(t);if(!n)return!1;let r=n[3],o=/^\[(-?[\d.]+)px\]$/.exec(r),a=o?Number(o[1]):Ee[r];if(a===void 0||!Number.isFinite(a))return!1;let d=n[1]?-a:a,l=n[2]==="inset"?["top","right","bottom","left"]:n[2]==="inset-x"?["left","right"]:n[2]==="inset-y"?["top","bottom"]:[n[2]];for(let f of l)e[f]=d;return!0}function Wn(t,e){let n=/^grid-cols-\[(.+)\]$/.exec(t);if(n)return e.gridColumns=n[1].split("_").filter(Boolean).length,!0;let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Fn(t,e){if(!t.startsWith("size-"))return!1;let n=t.slice(5),r=n==="full"?"100%":ae(n);if(r===void 0)return!1;return e.width=r,e.height=r,!0}var zn={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function Xn(t,e){let n=/^(min|max)-(w|h)-(.+)$/.exec(t);if(!n)return!1;let[,r,o,a]=n,d=a==="full"||a==="screen"?"100%":a==="none"?void 0:o==="w"&&r==="max"&&zn[a]||ae(a);if(d===void 0&&a!=="none")return!1;let l=`${r}${o==="w"?"Width":"Height"}`;if(d===void 0)delete e[l];else e[l]=d;return!0}function Hn(t,e){let n=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!n)return!1;let r=n[3]==="full"?"100%":M(n[3]);if(r===void 0)return!1;return e[n[2]]=typeof r==="number"&&n[1]?-r:r,!0}function qn(t,e){let n=/^(-?)translate-(x|y)-(.+)$/.exec(t);if(!n)return!1;let r=n[3],o;if(r.startsWith("[")){let l=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(r);if(!l)return!1;o=Number(l[1])*(l[2]?.endsWith("em")?16:1)}else o=M(r);if(o===void 0||!Number.isFinite(o))return!1;if(n[1])o=-o;let a=n[2]==="x"?"translateX":"translateY",d=a==="translateX"?{translateX:o}:{translateY:o};return e.transform=[...(e.transform??[]).filter((l)=>!(a in l)),d],!0}function Gn(t,e){let n=/^space-(x|y)-(.+)$/.exec(t);if(!n)return!1;let r=M(n[2]);if(r===void 0)return!1;return e.gap=r,!0}function Jn(t,e){if(t.startsWith("gap-")){let n=M(t.slice(4));if(n!==void 0)return e.gap=n,!0}if(t.startsWith("gap-x-")){let n=M(t.slice(6));if(n!==void 0)return e.columnGap=n,!0}if(t.startsWith("gap-y-")){let n=M(t.slice(6));if(n!==void 0)return e.rowGap=n,!0}return!1}function Kn(t,e){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]}[t];if(!r)return!1;let[o,a,d,l]=r;return Object.assign(e,{shadowColor:"#000000",shadowOpacity:d,shadowRadius:o,shadowOffset:{width:0,height:a},elevation:l}),!0}var Yn=new Set(["hover","group-hover","peer-hover","active","group-active","visited","placeholder","selection","print","motion-safe"]),Qn=/^(?:transition(?:-[a-z]+)?|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 xt(t){let e=[],n=0,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a==="[")n++;else if(a==="]")n=Math.max(0,n-1);else if(a===":"&&n===0)e.push(t.slice(r,o)),r=o+1}return e.push(t.slice(r)),e}function Nt(t,e=new Set){let n=xt(t),r=n[n.length-1],o=e.has(r)?void 0:ut(r);if(o===void 0)return[t];let a=n.slice(0,-1).map((l)=>`${l}:`).join(""),d=new Set(e).add(r);return o.split(/\s+/).filter(Boolean).flatMap((l)=>Nt(`${a}${l}`,d))}function ce(t,e,n={}){let r=new Map,o=(v,u)=>{if(!r.has(v))r.set(v,{...u,classes:[],authored:new Map});return r.get(v)};o("base",{});let a=[],d=[],l=t.split(/\s+/).filter(Boolean);if(n.rules){let v=new Set(l);for(let u of Object.keys(n.rules))if(u.includes(".")&&u.split(".").every((c)=>v.has(c)))d.push(u);d.sort((u,c)=>u.split(".").length-c.split(".").length)}for(let v of l){if(n.rules&&Object.hasOwn(n.rules,v)){a.push(v);continue}for(let u of Nt(v)){let c=xt(u),y=c.pop(),b=c.some((E)=>E.startsWith("focus"));if(c.some((E)=>/^(?:group-|peer-)?focus(?:-visible|-within)?$/.test(E))&&/^(?:ring|outline)(?:-|$)/.test(y))continue;if(Qn.test(y)||!b&&c.some((E)=>Yn.has(E)))continue;let x,w,k=!1,N=[];for(let E of c){let A=ke(E),I=E.startsWith("max-")?ke(E.slice(4)):void 0;if(A!==void 0&&x===void 0)x=A;else if(I!==void 0&&w===void 0)w=I-0.02;else if(E==="disabled"&&!k)k=!0;else N.push(E)}let T=[...N,y].join(":"),_=x!==void 0||w!==void 0,C=k?o("disabled",{disabled:!0}):_?o(`range:${x??0}:${w??""}`,{min:x??0,max:w}):r.get("base");if(k&&_){r.get("base").authored.set(u,v),r.get("base").classes.push(u);continue}if(C.classes.push(T),!C.authored.has(T))C.authored.set(T,v===u?u:`${v} (${u})`)}}let f=[...a,...d],g=(v,u)=>u.map((c)=>v.authored.get(c)??c),h=r.get("base"),p=_e(h.classes.join(" "),e,n),S=new Map;if(f.length){let v=(y)=>y?oe(y,()=>{},{inheritedVariables:e}):{},u={},c={};for(let y of f){let b=n.rules[y];u={...u,...v(b.light)},c={...c,...v(b.dark)};for(let x of b.responsive??[]){let w=`${x.min}:${x.max??""}`,k=S.get(w)??{min:x.min,...x.max===void 0?{}:{max:x.max},style:{}};if(k.style={...k.style,...v(x.light)},x.dark)k.dark={...k.dark,...v(x.dark)};S.set(w,k)}}if(p.style={...u,...p.style},Object.keys(c).length)p.dark={...c,...p.dark}}p.unknown=g(h,p.unknown);let m=[];for(let v of r.values()){if(v===h)continue;let u=_e(v.classes.join(" "),e);p.unknown=[...new Set([...p.unknown,...g(v,u.unknown)])];let c={style:u.style,...u.dark?{dark:u.dark}:{}};if(v.disabled)p.disabled=c;else m.push({min:v.min??0,...v.max===void 0?{}:{max:v.max},...c})}for(let v of S.values()){let u=m.find((c)=>c.min===v.min&&c.max===v.max);if(u){if(u.style={...v.style,...u.style},v.dark||u.dark)u.dark={...v.dark,...u.dark}}else m.push(v)}if(m.length)p.responsive=m.sort((v,u)=>v.min-u.min||(v.max??1/0)-(u.max??1/0));return p}function _e(t,e,n={}){let r=[],o=[],a=[],d=[],l={focus:{classes:[],originals:new Map},focusWithin:{classes:[],originals:new Map}},f=new Map;function g(u,c){let y=/^(bg|text|border(?:-[trblxy])?|from|via|to|fill|stroke|divide|decoration|caret|accent)-(.+?)(\/[^\s]+)?$/.exec(u),b=y&&dt(y[2]);if(y&&b){let T=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+?)\s*)?\)$/.exec(b),_=T?e?.get(T[1])??T[2]:b;if(_&&/^(?:#[0-9a-f]{3,8}|rgba?\(.+\)|hsla?\(.+\))$/i.test(_))return[`${y[1]}-[${_.replace(/\s+/g,"")}]${y[3]||""}`]}let x=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(u),w=x&>[x[2]];if(w){let T=e?.get(Ve(x[2]));return[`${x[1]}-${T===void 0?w[c]:`[${T}]`}${x[3]||""}`]}let k=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(u);if(k&&fe[k[2]]){let T=be(k[2],e);return T===void 0?void 0:[`rounded-${k[1]?`${k[1]}-`:""}[${T}px]`]}let N=u.startsWith("text-")?u.slice(5):"";if(Un[N]){let T=we(N,e);return T&&[`text-[${T.fontSize}px]`,`leading-[${T.lineHeight}px]`]}for(let T of Object.keys(Vn)){if(!u.endsWith(`-${T}`))continue;let _=ve(T,e);return _===void 0?void 0:[`${u.slice(0,-T.length)}[${_}px]`]}return[u]}function h(u,c){if(!f.has(u))f.set(u,new Set);return f.get(u).add(c),u}for(let u of t.split(/\s+/).filter(Boolean)){let c=/^(dark:)?(focus|focus-within):(dark:)?(.+)$/.exec(u),y=c?.[2]==="focus"?"focus":"focusWithin";if(c&&n[y]&&!(c[1]&&c[3])){let b=`${c[1]||c[3]?"dark:":""}${c[4]}`,x=l[y];x.classes.push(b),x.originals.set(b,[...x.originals.get(b)??[],u]);continue}if(u.startsWith("dark:")){let b=g(u.slice(5),"dark");if(!b)d.push(u);else o.push(...b.map((x)=>h(x,u)))}else if(!u.includes(":")||u.startsWith("[")){let b=g(u,"light"),x=g(u,"dark");if(!b||!x){d.push(u);continue}if(r.push(...b.map((w)=>h(w,u))),x.join(" ")!==b.join(" "))a.push(...x.map((w)=>h(w,u)))}else d.push(u)}let p=[],S=wt(r,p),m={style:S,unknown:p};if(o.length||a.length)m.dark=wt([...a,...o],p);if(S.transform&&m.dark?.transform){let u=new Set(m.dark.transform.flatMap((c)=>Object.keys(c)));m.dark.transform=[...S.transform.filter((c)=>!Object.keys(c).some((y)=>u.has(y))),...m.dark.transform]}for(let u of r){if(u==="truncate"||u==="whitespace-nowrap")m.numberOfLines=1;let c=/^object-(cover|contain|fill)$/.exec(u);if(c)m.resizeMode=c[1]==="fill"?"stretch":c[1];let y=/^line-clamp-(\d+)$/.exec(u);if(y)m.numberOfLines=Number(y[1]);if(!m.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(u))m.icon=u}let v=p.flatMap((u)=>[...f.get(u)??[u]]);m.unknown=[...new Set([...v.filter((u)=>!/^line-clamp-\d+$/.test(u)),...d])];for(let u of["focus","focusWithin"]){let c=l[u];if(!c.classes.length)continue;let y=_e(c.classes.join(" "),e);m[u]={style:y.style,dark:y.dark},m.unknown=[...new Set([...m.unknown,...y.unknown.flatMap((b)=>c.originals.get(b)??[b])])];for(let b of c.classes)if(/^(?:dark:)?(?:truncate|line-clamp-\d+|i-[a-z0-9]+-.+)$/.test(b))m.unknown.push(...c.originals.get(b))}return m}function wt(t,e){let n={},r=Array.isArray(t)?t:t.split(/\s+/).filter(Boolean);for(let o of r){if(/^i-[a-z0-9]+-/.test(o))continue;let a=Tn[o];if(a){a("",n);continue}if(Kn(o,n))continue;if(En(o,n))continue;if(Rn(o,n))continue;if(In(o,n))continue;if(An(o,n))continue;if(Cn(o,n))continue;if(St(o,n))continue;if(On(o,n))continue;if(Pn(o,n))continue;if(Bn(o,n))continue;if(Mn(o,n))continue;if(Ln(o,n))continue;if(Dn(o,n))continue;if(Jn(o,n))continue;if($n(o,n))continue;if(Fn(o,n))continue;if(Xn(o,n))continue;if(Wn(o,n))continue;let d=/^z-\[(-?\d+)\]$/.exec(o)??/^z-(\d+)$/.exec(o);if(d){n.zIndex=Number(d[1]);continue}if(o==="z-auto")continue;if(jn(o,n))continue;let l=/^order-\[(-?\d+)\]$/.exec(o)??/^order-(-?\d+)$/.exec(o);if(l){n.order=Number(l[1]);continue}if(Hn(o,n))continue;if(qn(o,n))continue;if(Gn(o,n))continue;if(e?.push(o),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${o}`)}return n}var kt=new Map;function Tt(t,e){if(!t)return;let n=t.trim(),r=n.lastIndexOf("-"),o=r===-1?e[n]:e[n.slice(0,r)],a=r===-1?o:o?.[n.slice(r+1)];if(typeof a==="string"&&/^#[\da-f]{3,8}$/i.test(a))return a;return Ie(n)??Ie(`[${n}]`)}function er(t){let e=t.roles??{},n=t.shapes??{},r=t.density??{},o={...t.theme?.colors,...t.theme?.extend?.colors},a=[],d=[];for(let[l,f]of Object.entries(e)){if(!gt[l])continue;let g=Tt(typeof f==="string"?f:f?.light,o),h=Tt(typeof f==="string"?f:f?.dark,o);if(g)a.push(`${Ve(l)}: ${g};`);if(h)d.push(`${Ve(l)}: ${h};`)}for(let[l,f]of Object.entries(n))if(fe[l])a.push(`${Qt(l)}: ${f};`);for(let[l,f]of Object.entries(r))if(Te[l])a.push(`${Ue(l)}: ${f};`);return[a.length?`:root { ${a.join(" ")} }`:"",d.length?`.dark { ${d.join(" ")} }`:""].filter(Boolean).join(`
|
|
3
|
-
`)}async function tr(t){let{resolveUserCssConfig:e}=await import("./chunk-zn7ncwb8.js"),n=await e(t);return n?er(n):""}function Rt(t){let e=Zn.resolve(t),n=kt.get(e);if(!n)n=tr(e).catch(()=>""),kt.set(e,n);return n}var _t={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},At={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 nr(t){return t==="role"||t==="aria-label"||t==="aria-valuetext"||t in _t}function rr(t,e){if(e===void 0||e===null)return;let n=String(e).trim().toLowerCase();if(n==="mixed")return t==="aria-checked"?"mixed":!0;if(n==="undefined")return;return n===""||n==="true"}function ir(t){if(t===void 0||t===null)return null;for(let e of String(t).trim().toLowerCase().split(/\s+/))if(At[e])return At[e];return null}function sr(t,e,n){if(t==="aria-label")return{accessibilityLabel:e===void 0||e===null||e===""?null:String(e)};if(t==="aria-valuetext")return{accessibilityValue:e===void 0||e===null||e===""?null:String(e)};if(t==="role")return{accessibilityRole:ir(e)};let r=_t[t];if(!r)return;let o=n.accessibilityState,a=o&&typeof o==="object"?{...o}:{},d=rr(t,e);if(d===void 0)delete a[r];else a[r]=d;return{accessibilityState:Object.keys(a).length?a:null}}function or(t){let e=t.accessibilityState&&typeof t.accessibilityState==="object"?t.accessibilityState:void 0,n={};for(let[o,a]of Object.entries(t)){if(!nr(o))continue;let d=sr(o,a,n);if(d)Object.assign(n,d)}for(let o of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(t[o]===void 0&&n[o]!==void 0&&n[o]!==null)t[o]=n[o];let r=n.accessibilityState;if(r)t.accessibilityState={...r,...e}}var Ce=["accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue"];function Oe(t){let e={...t};return or(e),Object.fromEntries(Ce.filter((n)=>(n in e)).map((n)=>[n,e[n]]))}var Pe={"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",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 Me={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText",animate:"Animate"},Le=new Set(Object.values(Me));var Ct=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Ot=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight","attributeName","keyTimes","repeatCount"];function z(t){let e=typeof t==="number"?t:Number.parseFloat(String(t??""));return Number.isFinite(e)?e:0}function J(t){return Math.round(t*1000)/1000}function De(t){if(Array.isArray(t)&&t.length===4&&t.every((n)=>Number.isFinite(Number(n))))return t.map(Number);let e=String(t??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((n)=>!Number.isFinite(n))||e[2]<=0||e[3]<=0)return null;return e}function ar(t){let e=String(t??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var Et=/[MLHVCSQTAZ]/i,Be=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function cr(t){let e=[],n=t,r=Et.exec(n);while(r){let o=r.index;n=n.slice(o);let a=n[0];n=n.slice(1);let d=Et.exec(n),l=d?n.slice(0,d.index):n,f;if(a==="A"||a==="a"){f=[];let g=0,h=l.trim(),p=0;while(p<h.length){let S=g%7,m=h.slice(p).replace(/^[\s,]+/,"");if(p=h.length-m.length,!m)break;if(S===3||S===4)f.push(m[0]==="1"?1:0),p+=1;else{Be.lastIndex=0;let v=Be.exec(m);if(!v||v.index!==0)break;f.push(Number.parseFloat(v[0])),p+=v[0].length}g++}}else f=(l.match(Be)||[]).map(Number.parseFloat);e.push({command:a,args:f}),r=d}return e}function lr(t,e,n,r,o,a,d,l,f){if(t===l&&e===f)return[];let g=Math.abs(n),h=Math.abs(r);if(!g||!h)return[1,l,f];let p=o*Math.PI/180,S=Math.cos(p),m=Math.sin(p),v=(t-l)/2,u=(e-f)/2,c=S*v+m*u,y=-m*v+S*u,b=c*c/(g*g)+y*y/(h*h);if(b>1)g*=Math.sqrt(b),h*=Math.sqrt(b);let x=g*g*h*h-g*g*y*y-h*h*c*c,w=g*g*y*y+h*h*c*c,k=Math.sqrt(Math.max(0,x/w));if(a===d)k=-k;let N=k*(g*y)/h,T=k*-(h*c)/g,_=S*N-m*T+(t+l)/2,C=m*N+S*T+(e+f)/2,E=(D,W,F,H)=>{let Y=D*H-W*F<0?-1:1,q=(D*F+W*H)/(Math.hypot(D,W)*Math.hypot(F,H));return Y*Math.acos(Math.min(1,Math.max(-1,q)))},A=E(1,0,(c-N)/g,(y-T)/h),I=E((c-N)/g,(y-T)/h,(-c-N)/g,(-y-T)/h);if(!d&&I>0)I-=2*Math.PI;if(d&&I<0)I+=2*Math.PI;let R=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),V=I/R,P=1.3333333333333333*Math.tan(V/4),O=[],X=(D)=>{let W=g*Math.cos(D),F=h*Math.sin(D);return[S*W-m*F+_,m*W+S*F+C]},L=(D)=>{let W=-g*Math.sin(D),F=h*Math.cos(D);return[S*W-m*F,m*W+S*F]},j=A;for(let D=0;D<R;D++){let W=j+V,[F,H]=X(j),[Y,q]=L(j),[Qe,Ze]=X(W),[sn,on]=L(W);O.push(2,F+P*Y,H+P*q,Qe-P*sn,Ze-P*on,D===R-1?l:Qe,D===R-1?f:Ze),j=W}return O}function Pt(t){let e=[],n=0,r=0,o=0,a=0,d=0,l=0,f=0,g=0,h="";for(let{command:p,args:S}of cr(String(t??""))){let m=p===p.toLowerCase(),v=p.toUpperCase(),u=()=>m?n:0,c=()=>m?r:0,y=0,b=(w)=>{if(y+w>S.length)return null;let k=S.slice(y,y+w);return y+=w,k};if(v==="Z"){e.push(4),n=o,r=a,h="Z";continue}let x=!0;while(y<S.length||x&&v==="Z"){switch(v){case"M":{let w=b(2);if(!w)return e;if(n=w[0]+u(),r=w[1]+c(),x)e.push(0,n,r),o=n,a=r;else e.push(1,n,r);h=x?"M":"L";break}case"L":{let w=b(2);if(!w)return e;n=w[0]+u(),r=w[1]+c(),e.push(1,n,r),h="L";break}case"H":{let w=b(1);if(!w)return e;n=w[0]+u(),e.push(1,n,r),h="L";break}case"V":{let w=b(1);if(!w)return e;r=w[0]+c(),e.push(1,n,r),h="L";break}case"C":{let w=b(6);if(!w)return e;let k=w[0]+u(),N=w[1]+c();d=w[2]+u(),l=w[3]+c(),n=w[4]+u(),r=w[5]+c(),e.push(2,k,N,d,l,n,r),h="C";break}case"S":{let w=b(4);if(!w)return e;let k=h==="C"?2*n-d:n,N=h==="C"?2*r-l:r;d=w[0]+u(),l=w[1]+c(),n=w[2]+u(),r=w[3]+c(),e.push(2,k,N,d,l,n,r),h="C";break}case"Q":{let w=b(4);if(!w)return e;f=w[0]+u(),g=w[1]+c(),n=w[2]+u(),r=w[3]+c(),e.push(3,f,g,n,r),h="Q";break}case"T":{let w=b(2);if(!w)return e;f=h==="Q"?2*n-f:n,g=h==="Q"?2*r-g:r,n=w[0]+u(),r=w[1]+c(),e.push(3,f,g,n,r),h="Q";break}case"A":{let w=b(7);if(!w)return e;let k=w[5]+u(),N=w[6]+c();e.push(...lr(n,r,w[0],w[1],w[2],w[3],w[4],k,N)),n=k,r=N,h="A";break}default:return e}x=!1}}return e.map((p)=>J(p))}function It(t,e,n,r){if(n<=0||r<=0)return[];let o=0.5522847498;return[0,t+n,e,2,t+n,e+o*r,t+o*n,e+r,t,e+r,2,t-o*n,e+r,t-n,e+o*r,t-n,e,2,t-n,e-o*r,t-o*n,e-r,t,e-r,2,t+o*n,e-r,t+n,e-o*r,t+n,e,4].map(J)}function $e(t,e){switch(t){case"Path":return Pt(String(e.d??""));case"Line":return[0,z(e.x1),z(e.y1),1,z(e.x2),z(e.y2)].map(J);case"Rect":{let n=z(e.x),r=z(e.y),o=z(e.width),a=z(e.height);if(o<=0||a<=0)return[];let d=e.rx===void 0?z(e.ry):z(e.rx),l=e.ry===void 0?d:z(e.ry);if(d=Math.min(Math.max(0,d),o/2),l=Math.min(Math.max(0,l),a/2),!d||!l)return[0,n,r,1,n+o,r,1,n+o,r+a,1,n,r+a,4].map(J);let f=0.5522847498;return[0,n+d,r,1,n+o-d,r,2,n+o-d+f*d,r,n+o,r+l-f*l,n+o,r+l,1,n+o,r+a-l,2,n+o,r+a-l+f*l,n+o-d+f*d,r+a,n+o-d,r+a,1,n+d,r+a,2,n+d-f*d,r+a,n,r+a-l+f*l,n,r+a-l,1,n,r+l,2,n,r+l-f*l,n+d-f*d,r,n+d,r,4].map(J)}case"Circle":return It(z(e.cx),z(e.cy),z(e.r),z(e.r));case"Ellipse":return It(z(e.cx),z(e.cy),z(e.rx),z(e.ry));case"Polyline":case"Polygon":{let n=ar(e.points);if(n.length<4)return[];let r=[0,n[0],n[1]];for(let o=2;o<n.length;o+=2)r.push(1,n[o],n[o+1]);if(t==="Polygon")r.push(4);return r.map(J)}default:return null}}function ur(t){let e=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/.exec(String(t??""));if(!e)return null;let n=Number(e[1])/(e[2]==="ms"?1000:1);return n>0?n:null}function dr(t){if(t.attributeName!=="d")return null;let e=ur(t.dur),n=String(t.values??"").split(";").map((l)=>l.trim()).filter(Boolean);if(e===null||n.length<2)return null;let r=n.map(Pt);if(r.some((l)=>!l.length))return null;let o=String(t.keyTimes??"").split(";").map((l)=>l.trim()).filter(Boolean).map(Number),d=o.length===r.length&&o[0]===0&&o[o.length-1]===1&&o.every((l,f)=>Number.isFinite(l)&&(f===0||l>=o[f-1]))?o.map(J):r.map((l,f)=>J(f/(r.length-1)));return{frames:r,frameTimes:d,duration:e}}function je(t){let e=dr(t),n={frames:e?.frames??null,frameTimes:e?.frameTimes??null,duration:e?.duration??null};for(let[r,o]of Object.entries(n))if(o===null)delete t[r];else t[r]=o;return n}var fr=[...Ot,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","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","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","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"],Bt=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"]),pr=new Map(fr.map((t)=>[Mt(t),t]));function Mt(t){return t.replace(/[-_]/g,"").toLowerCase()}function We(t,e){if((e==="Image"||e==="Video")&&t.toLowerCase()==="src")return"source";return pr.get(Mt(t))??t}var gr={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",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function Lt(t){return gr[t.toLowerCase()]||t}var hr={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-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"};function ne(t,e=!1){let n=String(t??"").trim();if(!n)return{symbol:"circle",known:!1};if(e)return{symbol:n,known:!0};let r=/^i-([a-z0-9]+)-(.+)$/.exec(n)??/^([a-z0-9]+):(.+)$/.exec(n),o=r?r[1]:"lucide",a=r?r[2]:n;if(o==="lucide"){let d=hr[a];if(d)return{symbol:d,iconify:`i-lucide-${a}`,known:!0};if(!r&&n.includes("."))return{symbol:n,known:!0}}return{symbol:"circle",iconify:r?n:`i-lucide-${a}`,known:!1}}function Fe(t){return t.split(/\s+/).find((e)=>/^i-[a-z0-9]+-[a-z0-9-]+$/.test(e))}import{generate as le,parse as mr}from"@stacksjs/ts-css/parse";var yr=/^(?::hover|:active|:visited|:focus|:focus-visible|:focus-within)$/;function br(t){let e=t.replace(/\s+/g,"").toLowerCase();if(!e||e==="all"||e==="screen")return{};if(/^(?:screenand)?\(prefers-color-scheme:dark\)$/.test(e))return{dark:!0};if(/^(?:screenand)?\(prefers-color-scheme:light\)$/.test(e))return{};if(/prefers-reduced-motion|\(hover|\(pointer|print|forced-colors|prefers-contrast/.test(e))return"skip";let n=e.replace(/^screenand/,"").split("and"),r={};for(let o of n){let a=/^\((min|max)-width:([\d.]+)(px|rem|em)\)$/.exec(o);if(!a)return;r[a[1]]=Number(a[2])*(a[3]==="px"?1:16)}return r}async function Dt(t,e){let n={},r=new Set,o=(g)=>{if(r.has(g))return;r.add(g),e(g,[...g.matchAll(/\.(-?[a-z_][\w-]*)/gi)].map((h)=>h[1]))},a=(g,h,p)=>{if(!h.trim())return;let S=n[g]??={},m=p.dark?"dark":"light";if(p.min===void 0&&p.max===void 0){S[m]=S[m]?`${S[m]};${h}`:h;return}let v=S.responsive??=[],u=p.min??0,c=v.find((y)=>y.min===u&&y.max===p.max);if(!c)v.push(c={min:u,...p.max===void 0?{}:{max:p.max}});c[m]=c[m]?`${c[m]};${h}`:h};function d(g,h){for(let p of g){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)d(p.block.children,h);continue}if(v!=="media"||!p.block){o(`@${v}`);continue}let u=p.prelude?le(p.prelude):"",c=br(u);if(c==="skip")continue;if(!c){o(`@media ${u}`);continue}d(p.block.children,{dark:h.dark||c.dark,min:c.min??h.min,max:c.max??h.max});continue}if(p.type!=="Rule"||p.block.type!=="Block")continue;let S=[...p.block.children].filter((v)=>v.type==="Declaration").map((v)=>le(v)).join(";"),m=p.prelude.type==="SelectorList"?[...p.prelude.children].map(le):[le(p.prelude)];for(let v of m){let u=/^(?:(?:html|:root)?\.dark\s+)?((?:\.-?[a-z_][\w-]*)+)((?::{1,2}[a-z-]+)*)$/i.exec(v.trim());if(!u){if(!/^(?:html|:root|body|\*|::?[a-z-]+)/i.test(v.trim()))o(v.trim());continue}let c=u[2];if(c){if(!yr.test(c))o(v.trim());continue}let y=h.dark||/^(?:(?:html|:root)?\.dark\s+)/i.test(v.trim());a(u[1].slice(1),S,{dark:y,min:h.min,max:h.max})}}}let l="",f=!0;await new HTMLRewriter().on("style",{element(g){l="";let h=g.getAttribute("type");f=!h||h.toLowerCase()==="text/css",g.onEndTag(()=>{if(!f)return;try{let p=mr(l);if(p.type==="StyleSheet")d(p.children,{})}catch{o("invalid stylesheet")}})},text(g){l+=g.text}}).transform(new Response(t)).text();for(let g of Object.values(n))g.responsive?.sort((h,p)=>h.min-p.min||(h.max??1/0)-(p.max??1/0));return n}import{generate as re,parse as $t}from"@stacksjs/ts-css/parse";async function Vt(t,e){let n={light:new Map,dark:new Map},r=new Set,o=(p)=>{if(!r.has(p))r.add(p),e(p)},a=(p,S,m)=>{for(let v of m){let u=n[v].get(p);if(!u||Number(S.important)>Number(u.important)||S.important===u.important&&S.specificity>=u.specificity)n[v].set(p,S)}},d=(p)=>{if(p.type==="Declaration")return p.property.startsWith("--");if(p.type==="Rule"||p.type==="Atrule")return!!p.block&&[...p.block.children].some(d);return!1},l=(p)=>{let S=p.replace(/\s+/g,"").toLowerCase();if(!S||S==="all"||S==="screen")return["light","dark"];let m=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(S);return m?[m[1]]:void 0};function f(p,S){for(let m of p){if(!d(m))continue;if(m.type==="Atrule"){let u=m.prelude?re(m.prelude):"",c=m.name.toLowerCase()==="media"?l(u):void 0;if(!c){o(`@${m.name} ${u}`.trim());continue}f(m.block.children,S.filter((y)=>c.includes(y)));continue}if(m.type!=="Rule")continue;let v=m.prelude.type==="SelectorList"?[...m.prelude.children].map(re):[re(m.prelude)];for(let u of v){let c=/^(html|:root)?(?:\.(dark|light))?$/.exec(u.trim());if(!c||!c[1]&&!c[2]){o(u);continue}let y=(c[1]===":root"?10:c[1]?1:0)+(c[2]?10:0);for(let b of m.block.children){if(b.type!=="Declaration"){if(d(b))o(`nested rule in ${u}`);continue}if(!b.property.startsWith("--"))continue;let x={value:re(b.value),important:!!b.important,specificity:y};a(b.property,x,S.filter((w)=>!c[2]||c[2]===w))}}}}let g="",h;return await new HTMLRewriter().on("html",{element(p){let S=p.getAttribute("style");if(!S)return;try{let m=$t(S,{context:"declarationList"});if(m.type!=="DeclarationList")return;for(let v of m.children)if(v.type==="Declaration"&&v.property.startsWith("--"))a(v.property,{value:re(v.value),important:!!v.important,specificity:1000},["light","dark"])}catch{o("invalid document inline theme")}}}).on("style",{element(p){g="";let S=p.getAttribute("type");h=!S||S.toLowerCase()==="text/css"?l(p.getAttribute("media")??""):void 0,p.onEndTag(()=>{try{let m=$t(g);if(m.type!=="StyleSheet")return;if(!h){if([...m.children].some(d))o("style type/media");return}f(m.children,h)}catch{o("invalid stylesheet")}})},text(p){g+=p.text}}).transform(new Response(t)).text(),{light:[...n.light].map(([p,S])=>[p,S.value]),dark:[...n.dark].map(([p,S])=>[p,S.value])}}function G(t,e={},n={},r={},o=[]){return{type:t,props:e,style:n,events:r,children:o}}function jt(t,e,n={}){return{version:"1.0.0",root:t,script:e,meta:{source:n.source||"unknown",compiledAt:n.compiledAt||Date.now(),headwindConfig:n.headwindConfig}}}var vr=/^(?: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)$/,Wt=new Set(["script","style","head","meta","link","title","base","noscript"]),Ft=new Set(["template","body","html","main","fragment"]),ue=new Set,wr=new Set(["onBlur","onChange","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPictureInPictureStart","onPictureInPictureStop","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRegionChangeComplete","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),ze=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","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...Le]),Sr=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"]]),zt=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),xr={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function Z(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,n)=>{let r=xr[n.toLowerCase()];if(r!==void 0)return r;if(n[0]==="#"){let o=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):e}return e})}function Xt(t,e,n,r={}){let o=r.inheritedVariables,a={},d={},l={},f="",g={};for(let[m,v]of e){let u=m.toLowerCase();if(u==="class"||u==="classname"){f=f?`${f} ${v}`:v;continue}if(u==="style"){g={...g,...Nr(t,v,n,{...r,onVariables(b){o=b,r.onVariables?.(b)}})};continue}if(u.startsWith(":")||u.startsWith("x-")&&u!=="x-cloak"){l[u.startsWith(":")?u.slice(1):u.slice(2)]=Z(v);continue}if(u==="x-cloak")continue;if(u.startsWith("@")||u.startsWith("v-on:")){let b=u.startsWith("@")?u.slice(1):u.slice(5),[x]=b.split("."),w=Pe[x]??(x.startsWith("on")?x:"");if(!w||!wr.has(w)){if(vr.test(x)||/\./.test(b))n.push({kind:"unread-event",tag:t,name:m});continue}d[w]=Z(v);continue}if(u==="key"){a.key=v;continue}let c=Z(v),y=We(m);if(c===""&&Bt.has(y)){a[y]=!0;continue}try{a[y]=JSON.parse(c)}catch{a[y]=c}}let h=a["data-native"]?a["data-native"]==="TextInput":t==="textarea"||t==="input"&&!["checkbox","radio","hidden"].includes(String(a.type??"text").toLowerCase()),p=f?ce(f,o,{focus:h,focusWithin:!0,rules:r.rules}):void 0;for(let m of new Set(p?.unknown??[]))n.push({kind:"unknown-class",tag:t,name:m});let S=Re({...p?.style,...g});return{props:a,style:S,events:d,bindings:l,classes:f,inline:g}}function Nr(t,e,n,r){return oe(Z(e),(o)=>n.push({...o,tag:t}),r)}function Xe(t){return t.children.map((e)=>typeof e==="string"?e:Xe(e)).join("").replace(/\s+/g," ").trim()}function kr(t,e){let n=t.node,r=n.children.filter((a)=>typeof a!=="string"),o=n.children.filter((a)=>typeof a==="string").join("").trim();if(t.tag==="button"&&n.type==="Button"&&!t.declaredNative&&r.length>0)return n.type="Pressable",n.props.role??="button",n.children=n.children.flatMap((a)=>typeof a==="string"?a.trim()?[G("Text",{},{},{},[a.trim()])]:[]:[a]),n;if(n.type==="Button"&&r.length===0)return n.children=o?[o]:[],n;if(n.type==="Svg"||n.type==="G")return n.children=r,n;if(n.type==="SvgText"){let a=Xe(n);return n.children=a?[a]:[],n}if(zt.has(n.type)&&r.length===0&&o)return n.type="Text",n.children=[o],n;if(n.type==="Text"&&!o&&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((l)=>l.type!=="Text"))return n.type="View",n.children=n.children.map((l)=>typeof l==="string"?G("Text",{},{},{},[l]):l),n;let d=Xe(n);return e.push({kind:"flattened-text",tag:t.tag}),n.children=d?[d]:[],n}if(zt.has(n.type)&&r.length>0)n.children=r;return n}async function Tr(t,e={}){let n=[],r=await Vt(t,(c)=>n.push({kind:"unsupported-theme-rule",tag:"style",name:c})),o=te(r.light).computed(),a=new Set([...t.matchAll(/\sclass(?:name)?\s*=\s*"([^"]*)"/gi)].flatMap((c)=>c[1].split(/\s+/))),d=await Dt(t,(c,y)=>{if(!y.length||y.some((b)=>a.has(b)))n.push({kind:"unsupported-style-rule",tag:"style",name:c})}),l=[],f=[],g=new Set;function h(c){let y=f[f.length-1];if(!y)l.push(c);else if(!y.dropped)y.node.children.push(c)}function p(c){let y=(x)=>{if(c.tag!=="html"&&c.node._styleSource)x._styleAncestors=[c.node._styleSource,...x._styleAncestors??[]]};if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let x=c.node.children,w=x.filter((N)=>typeof N!=="string"),k=w.length===1&&w.length===x.length?w[0]:G("View",{},{},{},x);if(k.bindings={...c.node.bindings,...k.bindings},k.bindingId===void 0&&c.node.bindingId!==void 0)k.bindingId=c.node.bindingId;y(k),h(k);return}let b=f[f.length-1];for(let x of c.node.children){if(typeof x==="string"){if(b&&!b.dropped)b.node.children.push(x);continue}if(y(x),!b)l.push(x);else if(!b.dropped)b.node.children.push(x)}}function S(c,y){let b=f[f.length-1];if(c==="svg"||b?.svg)return m(c,y,b);let x=Wt.has(c)&&!ue.has(c),w=f[f.length-1]?.dropped??!1,k=b?.variables??o,{props:N,style:T,events:_,bindings:C,classes:E,inline:A}=x||w?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:Xt(c,y,n,{inheritedVariables:k,onVariables:(O)=>{k=O},rules:d});if(c==="html")k=o;let I=N["data-native"],R;if(typeof I==="string"&&ze.has(I))R=I,delete N["data-native"];else{if(R=ue.has(c)?"View":Lt(c),(c==="i"||c==="span")&&/(?:^|\s)i-[a-z0-9]+-[a-z0-9-]+(?:\s|$)/.test(E))R="Icon";if(c==="input"){let O=String(N.type??"text").toLowerCase();if(O==="checkbox")R="Checkbox",N.formValue=N.value??"on",N.checked=N.checked===""||N.checked===!0||N.checked==="true",N.value=N.checked;else if(O==="hidden")R="View",T.display="none",A.display="none";else if(O==="radio")R="View",N.accessibilityRole="radio",n.push({kind:"unsupported-control",tag:c,name:"input:radio"})}}if(!w&&R===c&&!ze.has(R)&&!Wt.has(c)&&!Ft.has(c)&&!g.has(c))g.add(c),n.push({kind:"unmapped-tag",tag:c});if((x||ue.has(c))&&!g.has(`drop:${c}`))g.add(`drop:${c}`),n.push({kind:"dropped-subtree",tag:c});if(R==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(E))R="ScrollView",N.horizontal=!0,N.showsHorizontalScrollIndicator??=!1;else if(R==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(E))R="ScrollView";if(c==="form")N["data-stx-form"]=!0;if(c==="button"&&N.type===void 0)N.type="submit";if((R==="Video"||R==="Image")&&N.source===void 0&&N.src!==void 0)N.source=N.src,delete N.src;if(R==="Icon"){let O=ce(E).icon,X=ne(String(N.symbol||N.name||O||""),Boolean(N.symbol));if(N.symbol=X.symbol,X.iconify)N.iconify=X.iconify}if(R==="FlatList"||R==="SectionList"){let O=new Set([...Object.keys(N),...Object.keys(C)].map((X)=>X.toLowerCase()));for(let[X,L]of Sr)if(O.has(X))n.push({kind:"unsupported-list-prop",tag:R,name:L})}let V=G(R,N,T,_);V._inlineStyle=A,V._styleSource=Z(y.find(([O])=>O==="style")?.[1]??"");let P=N["data-stx-b"];if(typeof P==="number"&&Number.isInteger(P))V.bindingId=P;if(delete N["data-stx-b"],E)V._classes=E;if(Object.keys(C).length>0)V.bindings=C;if(typeof N.key==="string")V.key=N.key,delete N.key;return{tag:c,node:V,variables:k,declaredNative:typeof I==="string"&&ze.has(I),dropped:x||w||ue.has(c)||R==="Video",discard:x||w,unwrap:Ft.has(c)}}function m(c,y,b){let x=b?.dropped??!1,w=Me[c];if(x||!w){if(!x&&!g.has(`drop:${c}`))g.add(`drop:${c}`),n.push({kind:Ct.has(c)?"dropped-subtree":"unmapped-tag",tag:c});return{tag:c,node:G("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let k=b?.variables??o,{props:N,style:T,events:_,bindings:C,classes:E,inline:A}=Xt(c,y,n,{inheritedVariables:k,onVariables:(P)=>{k=P},rules:d});if(w==="Svg"){let P=De(N.viewBox);if(P)N.viewBox=P;else delete N.viewBox;for(let O of["width","height"]){if(typeof N[O]==="number"&&T[O]===void 0)T[O]=N[O];delete N[O]}}if(typeof N.strokeDasharray==="string"||typeof N.strokeDasharray==="number"){let P=String(N.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);N.strokeDasharray=P}let I=$e(w,N);if(I)N.geometry=I;if(w==="Animate")je(N);let R=G(w,N,T,_);R._inlineStyle=A,R._styleSource=Z(y.find(([P])=>P==="style")?.[1]??"");let V=N["data-stx-b"];if(typeof V==="number"&&Number.isInteger(V))R.bindingId=V;if(delete N["data-stx-b"],E)R._classes=E;if(Object.keys(C).length>0)R.bindings=C;if(typeof N.key==="string")R.key=N.key,delete N.key;return{tag:c,node:R,variables:k,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(c){let y=c.tagName.toLowerCase(),b=S(y,[...c.attributes]),x=!0;try{c.onEndTag(()=>{if(f.pop(),b.discard)return;if(b.unwrap)p(b);else h(kr(b,n))})}catch{x=!1}if(x)f.push(b);else if(!b.discard)h(b.node)},text(c){let y=f[f.length-1];if(!y||y.dropped)return;let b=Z(c.text).replace(/\s+/g," ");if(!b.trim())return;y.node.children.push(b)}}).transform(new Response(t)).text(),l.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);let v=l.length===1?l[0]:G("View",{},{},{},l);if(r.light.length||r.dark.length)v._stylesheetTheme=r;if(Object.keys(d).length)v._stylesheetRules=d;let u=(c)=>{let y=Oe(c.props);if(Object.keys(y).length)c._accessibilitySource=Object.fromEntries(Ce.filter((b)=>(b in c.props)).map((b)=>[b,c.props[b]])),Object.assign(c.props,y);for(let b of c.children)if(typeof b!=="string")u(b)};return u(v),{root:v,diagnostics:n}}async function Ut(t,e={}){let{root:n,diagnostics:r}=await Tr(t,e),o=e.script??{exports:{},functions:[],code:""};return{document:jt(n,o,{source:e.source??"unknown"}),diagnostics:r}}var Ht=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Rr=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Ar=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,qt=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function He(t){let e=[];Ht.lastIndex=0;for(let a of t.matchAll(Ht)){let d=a[1]??"";if(/\bserver\b/.test(d))continue;e.push(a[2].trim())}let n=e.filter(Boolean).join(`
|
|
4
|
-
|
|
5
|
-
`),r=[];for(let a of[Rr,Ar]){a.lastIndex=0;for(let d of n.matchAll(a))if(!r.includes(d[1]))r.push(d[1])}let o={};qt.lastIndex=0;for(let a of n.matchAll(qt)){let d=a[2];try{o[a[1]]=JSON.parse(d.replace(/^'(.*)'$/,'"$1"'))}catch{o[a[1]]=d}}return{exports:o,functions:r,code:n}}var de="[data-native-chrome]";function _r(t){let e=(t??"").trim().toLowerCase();return e==="tabs"||e==="bar"?e:""}function Gt(t){let e=ne(t);return e.known||/^i-|:/.test(t)?e.symbol:t}function Er(t){let e=(t??"").trim();if(!e.startsWith("/")||e.startsWith("//"))return null;return e}function Jt(t){return t.replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/\s+/g," ").trim()}async function Kt(t){if(!/\bdata-native-chrome\b/i.test(t))return{html:t,chrome:null};let e=[],n=[],r=null,o=!1;if(await new HTMLRewriter().on(de,{element(l){o=!0,e.push(_r(l.getAttribute("data-native-chrome"))),l.onEndTag(()=>{e.pop()})}}).on(`${de} a`,{element(l){let f=Er(l.getAttribute("href")),g=e[e.length-1]??"";if(!f||!g)return;let h=l.getAttribute("data-native-icon")||Fe(l.getAttribute("class")??""),p={path:f,title:"",region:g,label:l.getAttribute("aria-label")||l.getAttribute("title")||"",...h?{symbol:Gt(h)}:{}};r=p,l.onEndTag(()=>{if(p.title=Jt(p.title)||Jt(p.label),n.push(p),r===p)r=null})},text(l){if(r)r.title+=l.text}}).on(`${de} a *`,{element(l){if(!r||r.symbol)return;let f=l.getAttribute("data-native-icon")||Fe(l.getAttribute("class")??"");if(f)r.symbol=Gt(f)}}).transform(new Response(t)).text(),!o)return{html:t,chrome:null};let a=await new HTMLRewriter().on(de,{element(l){l.remove()}}).transform(new Response(t)).text(),d=(l)=>n.filter((f)=>f.region===l).map(({path:f,title:g,symbol:h})=>({path:f,title:g,...h?{symbol:h}:{}}));return{html:a,chrome:{tabs:d("tabs"),bar:d("bar")}}}var pe=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,Yt=/function\s+(__stx_setup_[\w$]+)\s*\(/,Ir=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function qe(t){pe.lastIndex=0;for(let e of t.matchAll(pe)){let n=e[2].trim(),r=Yt.exec(n)?.[1];if(r)return{name:r,code:n}}return null}function Zt(t){let e=[];pe.lastIndex=0;for(let n of t.matchAll(pe)){let r=n[1],o=n[2].trim(),a=Ir.exec(r)?.[1],d=/\bdata-stx-component-factories\b/i.test(r);if(!o||!a&&!d&&!Yt.test(o))continue;e.push(a?{code:o,owner:a}:{code:o})}return e}function Or(){let t=[K.join(import.meta.dir,"..","primitives"),K.join(import.meta.dir,"native","primitives")];for(let e of t)if(Cr(K.join(e,"View.stx")))return e;return t[0]}async function Pr(t,e,n={}){let r=n.root??K.dirname(e),o=await i(r),a=(_,C)=>_?K.isAbsolute(_)?_:K.resolve(r,_):K.join(r,C),d={root:r,layoutsDir:a(o.layoutsDir,"layouts"),partialsDir:a(o.partialsDir,"partials"),storesDir:a(o.storesDir,"stores"),componentsDir:n.componentsDir??o.componentsDir??K.join(r,"components"),buildMode:"serve",cache:!1,_targetComponentDirs:[Or()],_targetComponentFallbackNames:["Button","Checkbox","Switch"],_nativeHostAttrs:!0,skipEventDirectives:!0,_pluginComponentDirs:o._pluginComponentDirs??[]},l={...n.context??{},__stx_inject_css:!1},f=new Set([e]),g=await s(t,l,e,d,f),{html:h,chrome:p}=await Kt(g),{html:S,manifest:m}=tt(h),v=await Rt(r),{document:u,diagnostics:c}=await Ut(v?`<style>${v}</style>${S}`:S,{source:e,script:He(t)}),y=l.__stx_runtime_head;if(typeof y?.title==="string"&&y.title.trim())u.title=y.title.trim();if(p)u.chrome=p;let b=qe(S),x=Zt(S);if(He(t).code.trim()){let _=await Vr(t,e,n.context,{forceClientSetup:!0}),C=qe(_.setupCode??"");if(b=C??b,C&&!x.some((E)=>E.code===C.code))x.push({code:C.code})}if(/<script\b[^>]*\bdata-stx-stores\b/i.test(S)){let{getStoreScript:_}=await import("./chunk-7js495j0.js"),C=await _(d.storesDir);if(C){x.unshift({code:C});for(let E of new Bun.Glob("*.ts").scanSync({cwd:d.storesDir,absolute:!0}))f.add(E)}}let{buildModuleRegistryScript:w,registeredModuleIdsIn:k}=await import("./chunk-ndn0rmhs.js"),N=[],T=await w(k(...x.map((_)=>_.code)),{collectInputs:N});for(let _ of N)f.add(_);if(T)x.unshift({code:T});return{document:u,manifest:m,setup:b,scripts:x,diagnostics:c,html:S,dependencies:[...f]}}async function ge(t,e={}){return Pr(await Bun.file(t).text(),t,e)}var ie="__app";async function Dr(t){try{let{loadCssEngineConfig:e}=await import("./chunk-zn7ncwb8.js");return lt(await e(t))}catch{return{}}}var he="__runtime",$r="__messages";function Ge(t){let n=[B.join(import.meta.dir,"..","runtime",`${t}.ts`),B.join(import.meta.dir,"..","runtime",`${t}.js`),B.join(import.meta.dir,"native","runtime",`${t}.js`)].find((r)=>Ke(r));if(!n)throw Error(`Native runtime module ${t} is missing`);return n}async function Je(t,e,n,r,o){let a={name:"stx-screen-inputs",setup(l){l.onLoad({filter:/.*/,namespace:"file"},({path:f})=>{r.add(f);let g=o?.get(f);return g===void 0?void 0:{contents:g,loader:"js"}})}},d=await Bun.build({entrypoints:[t],target:"browser",format:"iife",minify:n,plugins:[a,...e],define:{"process.env.NODE_ENV":JSON.stringify(n?"production":"development")}});if(!d.success){let l=d.logs.map((f)=>String(f.message??f)).join(`
|
|
6
|
-
`);throw Error(`Could not bundle ${t}:
|
|
7
|
-
${l}`)}return(await d.outputs[0].text()).trim()}var jr=/^[\w-]+(?:\/[\w-]+)*$/,Wr=/^[\w-]+$/;async function Fr(t,e){let n=B.resolve(t,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let r=new Map,o=new Map;for(let a of e.languages){if(!Wr.test(a))throw Error(`messages: "${a}" is not a language directory name`);let d=B.join(n,a);if(!Ke(d))throw Error(`messages: ${B.relative(t,d)} does not exist`);let l=new Map;for(let f of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:d})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(f))continue;let g=f.replace(/\.[^./]+$/,"").split(B.sep).join("/");if(!jr.test(g))throw Error(`messages: ${a}/${f} is not an area name`);if(l.has(g))throw Error(`messages: ${a}/${g} is defined twice`);let h=B.join(d,f),p=await import(h),S=Object.keys(p).filter((u)=>u!=="default");if(S.length)throw Error(`messages: ${a}/${f} exports ${S.join(", ")}; a message module exports its messages as default, and nothing else`);let m=p.default,v=m!==null&&typeof m==="object"&&!Array.isArray(m)?JSON.stringify(m):void 0;if(v===void 0||!Bun.deepEquals(JSON.parse(v),m,!0))throw Error(`messages: ${a}/${f} must export plain data (an object JSON can hold) as default`);l.set(g,v),r.set(h,{language:a,area:g})}o.set(a,l)}return{files:r,data:o}}function zr(t,e){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(t)}, ${JSON.stringify(e)});`}function Xr(t){let e=new Map;for(let[n,{language:r,area:o}]of t.files){let a=zr(r,o);e.set(n,a),e.set(Lr(n),a)}return e}function Ur(t){let e=new Set;for(let n of t.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))e.add(n[1]);return[...e].sort()}function Hr(t,e){let n=B.isAbsolute(t.meta.source)?B.relative(e,t.meta.source).split(B.sep).join("/"):t.meta.source;return{...t,script:{exports:t.script.exports,functions:[],code:""},meta:{...t.meta,source:n,compiledAt:0}}}async function Ye(t){let e=Object.keys(t.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let n=t.routed??!0,r=t.initialScreen??e[0];if(!t.screens[r])throw Error(`Initial screen ${r} is not in screens`);let o=B.resolve(t.root??process.cwd());if(t.messages&&!t.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(t.sharedRuntime&&!t.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(t.messages&&!t.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(t.messages&&t.outFile)throw Error("messages leave the languages out of the screens' code, which the one-file bundle cannot read: build it without messages");let a=t.messages?await Fr(o,t.messages):null,d=t.styleConfig??await Dr(o),l=a?Xr(a):null,f=[],g=async()=>{for(let A of e){let I=B.resolve(o,t.screens[A]);if(!I.endsWith(".stx"))throw Error(`Screen ${A} must name a .stx file`);f.push({name:A,file:I,compiled:await ge(I,{root:o})})}};await ct(d,()=>l?qs(l,g):g());let h=Ge("jsc-globals"),p=Ge("shared-screen"),S=t.app?B.resolve(o,t.app):null;if(S&&!Ke(S))throw Error(`The app script ${t.app} does not exist`);if(S&&!n)throw Error("An app script needs a routed bundle");if(S&&t.screens[ie])throw Error(`${ie} is the app script's route, not a screen name`);let m=t.browser;if(t.screens[he])throw Error(`${he} is the runtime prelude's file, not a screen name`);let v=pt();if(m&&t.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let u=(A,I,R)=>{let V=n?`var routeName = g.__stxNativeRoute || ${JSON.stringify(r)};
|
|
8
|
-
var isApp = ${S?`routeName === ${JSON.stringify(ie)}`:"false"};
|
|
9
|
-
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
10
|
-
if (isApp ? ${!I} : ${JSON.stringify(A.map(({name:F})=>F))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
11
|
-
var isApp = false;`,P=A.map(({name:F,compiled:H},Y)=>`${Y===0?"if":"else if"} (routeName === ${JSON.stringify(n?F:"main")}) {
|
|
12
|
-
nativeDocument = ${JSON.stringify(Hr(H.document,o))};
|
|
13
|
-
manifest = ${JSON.stringify(H.manifest)};
|
|
14
|
-
}`).join(`
|
|
15
|
-
`),O=A.map(({name:F,compiled:H},Y)=>`${Y===0?"if":"else if"} (routeName === ${JSON.stringify(n?F:"main")}) {
|
|
16
|
-
g.__stx_latestSetup = null;
|
|
17
|
-
${H.scripts.map((q)=>q.owner?` g.__stx_componentSetups = g.__stx_componentSetups || {};
|
|
18
|
-
// Kept by id as well as run once: a :for or :if clone of this component
|
|
19
|
-
// has no script to copy, and is set up from this (component hydration).
|
|
20
|
-
g.__stx_componentSetups[${JSON.stringify(q.owner)}] = function() {
|
|
21
|
-
${q.code}
|
|
22
|
-
};
|
|
23
|
-
g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(q.owner)});
|
|
24
|
-
try { g.__stx_componentSetups[${JSON.stringify(q.owner)}](); }
|
|
25
|
-
finally { g.__STX_SETUP_ROOT__ = null; }`:q.code).join(`
|
|
26
|
-
`)}
|
|
27
|
-
}`).join(`
|
|
28
|
-
`),X=I&&S,L=m?Ge("browser-screen"):null,j=m?Bun.resolveSync(m.platformModule,o):null;return`
|
|
29
|
-
${R?`var runtime = globalThis.__stxNativeRuntime;
|
|
30
|
-
if (!runtime || runtime.version !== ${JSON.stringify(R)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${he}.js from the same build first');
|
|
31
|
-
var installJSCGlobals = runtime.installJSCGlobals;
|
|
32
|
-
var prepareNativeApp = runtime.prepareNativeApp;
|
|
33
|
-
var prepareSharedNativeScreen = runtime.prepareSharedNativeScreen;`:`import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
34
|
-
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(p)};`}
|
|
35
|
-
${m?`import { createBrowserScreenBridge } from ${JSON.stringify(L)};
|
|
36
|
-
import { createBrowserPlatform } from ${JSON.stringify(j)};`:""}
|
|
37
|
-
${X?`import * as nativeAppModule from ${JSON.stringify(S)};`:"var nativeAppModule = null;"}
|
|
38
|
-
${m?"(async function() {":""}
|
|
39
|
-
var g = globalThis;
|
|
40
|
-
installJSCGlobals(g);
|
|
41
|
-
g.__stxNativeStyleConfig = ${JSON.stringify(d)};
|
|
42
|
-
${m?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(m.platformOptions??{})});
|
|
43
|
-
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(m)});
|
|
44
|
-
var bridge = browserBridge;
|
|
45
|
-
g.__stxNativeRoute = ${JSON.stringify(r)};`:"var bridge = g.__stxNativeBridge;"}
|
|
46
|
-
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
47
|
-
var routeNames = ${JSON.stringify(n?e:["main"])};
|
|
48
|
-
${V}
|
|
49
|
-
g.__stxNativeRoute = routeName;
|
|
50
|
-
var nativeDocument;
|
|
51
|
-
var manifest;
|
|
52
|
-
${P}
|
|
53
|
-
var screen = null;
|
|
54
|
-
var app = null;
|
|
55
|
-
if (isApp) {
|
|
56
|
-
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
57
|
-
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
61
|
-
g.__stx_host = screen.host;
|
|
62
|
-
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
63
|
-
}
|
|
64
|
-
${R?"runtime.startSignals();":v}
|
|
65
|
-
var pageSetup = g.__stx_latestSetup;
|
|
66
|
-
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
67
|
-
${O}
|
|
68
|
-
// The screen's setup is the native host's to run. A screen script publishes
|
|
69
|
-
// it where a page's document runtime adopts its own, and in a browser that
|
|
70
|
-
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
71
|
-
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
72
|
-
// whatever setup it had.
|
|
73
|
-
var screenSetup = g.__stx_latestSetup || null;
|
|
74
|
-
g.__stx_latestSetup = pageSetup;
|
|
75
|
-
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
76
|
-
if (isApp) app.start(nativeAppModule);
|
|
77
|
-
else screen.mount(g.stx, screenSetup);
|
|
78
|
-
${m?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
79
|
-
var unmount = g.__stxNativeUnmount;
|
|
80
|
-
var ended = false;
|
|
81
|
-
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
82
|
-
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
83
|
-
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(m.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
84
|
-
`},c=(A)=>({name:"stx-native-shared-screens",setup(I){I.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),I.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:A,loader:"js"}))}}),y=new Set(f.flatMap(({compiled:A})=>A.dependencies)),b=f.flatMap(({compiled:A})=>A.diagnostics).map((A)=>({level:"warning",message:[A.kind,A.tag,A.name].filter(Boolean).join(": ")})),x=f.filter(({compiled:A})=>A.document.chrome),w=x.length?{chrome:Object.fromEntries(x.map(({name:A,compiled:I})=>[A,I.document.chrome]))}:{},k=t.minify??!1,N,T,_;if(t.routesDir){let A=B.resolve(o,t.routesDir);en(A,{recursive:!0});let I=`
|
|
85
|
-
import { installJSCGlobals } from ${JSON.stringify(h)};
|
|
86
|
-
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(p)};
|
|
87
|
-
globalThis.__stxNativeRuntime = {
|
|
88
|
-
version: '__STX_NATIVE_RUNTIME_VERSION__',
|
|
89
|
-
installJSCGlobals: installJSCGlobals,
|
|
90
|
-
prepareNativeApp: prepareNativeApp,
|
|
91
|
-
prepareSharedNativeScreen: prepareSharedNativeScreen,
|
|
92
|
-
// Each screen starts its own signals runtime, after its host is in place.
|
|
93
|
-
startSignals: function() {
|
|
94
|
-
${v}
|
|
95
|
-
},
|
|
96
|
-
// A language's messages for an area (the compile's \`messages\`), read the
|
|
97
|
-
// first time they are looked into: a screen never parses a language it
|
|
98
|
-
// is not shown in, nor an area it does not use.
|
|
99
|
-
messages: function(language, area) {
|
|
100
|
-
var g = globalThis;
|
|
101
|
-
var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
|
|
102
|
-
function table() {
|
|
103
|
-
var forLanguage = loaded[language] || (loaded[language] = {});
|
|
104
|
-
if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
|
|
105
|
-
var value = null;
|
|
106
|
-
if (typeof g.__stxNativeReadMessages === 'function') {
|
|
107
|
-
try {
|
|
108
|
-
var text = g.__stxNativeReadMessages(language, area);
|
|
109
|
-
if (typeof text === 'string') value = JSON.parse(text);
|
|
110
|
-
}
|
|
111
|
-
catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
|
|
112
|
-
}
|
|
113
|
-
forLanguage[area] = value;
|
|
114
|
-
return value;
|
|
115
|
-
}
|
|
116
|
-
var own = Object.prototype.hasOwnProperty;
|
|
117
|
-
return new Proxy({}, {
|
|
118
|
-
get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
|
|
119
|
-
has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
|
|
120
|
-
ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
|
|
121
|
-
getOwnPropertyDescriptor: function(target, name) {
|
|
122
|
-
var messages = table();
|
|
123
|
-
return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
`,R,V=B.join(A,`${he}.js`);if(t.sharedRuntime){let L=await Je("stx:native-shared-screens",[c(I)],k,y);R=Bun.hash(L).toString(36),T=V,await Bun.write(T,L.replace("__STX_NATIVE_RUNTIME_VERSION__",R))}else tn(V,{force:!0});let P=B.join(A,$r);tn(P,{recursive:!0,force:!0});let O={},X=[...f.map((L)=>({name:L.name,screens:[L],app:!1})),...S?[{name:ie,screens:[],app:!0}]:[]];N={};for(let L=0;L<X.length;L+=6)await Promise.all(X.slice(L,L+6).map(async(j)=>{let D=B.join(A,`${j.name}.js`),W=await Je("stx:native-shared-screens",[c(u(j.screens,j.app,R))],k,y,l??void 0);if(await Bun.write(D,W),N[j.name]=D,a)O[j.name]=Ur(W)}));if(a){for(let[j,D]of a.data)for(let[W,F]of D)await Bun.write(B.join(P,j,`${W}.json`),F);let L=Object.fromEntries(Object.keys(O).sort().map((j)=>[j,O[j]]));await Bun.write(B.join(P,"routes.json"),JSON.stringify(L));for(let j of a.files.keys())y.add(j);_={dir:P,languages:[...a.data.keys()],routes:L}}if(!t.outFile)return{code:"",routes:N,runtime:T,..._?{messages:_}:{},...w,diagnostics:b,dependencies:[...y]}}let C=await Je("stx:native-shared-screens",[c(u(f,!0))],k,y);if(!t.outFile)return{code:C,...w,diagnostics:b,dependencies:[...y]};let E=B.resolve(o,t.outFile);return en(B.dirname(E),{recursive:!0}),await Bun.write(E,C),{code:C,outFile:E,...N?{routes:N,runtime:T}:{},..._?{messages:_}:{},...w,diagnostics:b,dependencies:[...y]}}async function qr(t,e={}){return Ye({...e,screens:{main:t},routed:!1})}function nn(t,e={}){return qr(t,e)}var rn=["native.config.json","stx-native.config.json"];function Kr(t=process.cwd(),e){let n=e?U.resolve(t,e):rn.map((f)=>U.join(t,f)).find((f)=>me(f));if(!n)return null;if(!me(n))throw Error(`Native config not found: ${n}`);let r=JSON.parse(Jr(n,"utf8")),o=Object.entries(r.screens??{});if(o.length===0)throw Error(`${U.basename(n)} must name at least one screen in "screens"`);let a={};for(let[f,g]of o){if(!/^[A-Z][\w-]*$/i.test(f))throw Error(`Invalid native screen name: ${f}`);if(typeof g!=="string"||!g.endsWith(".stx"))throw Error(`Screen ${f} must name a .stx file`);if(a[f]=U.resolve(U.dirname(n),g),!me(a[f]))throw Error(`Screen ${f} not found: ${a[f]}`)}let d=r.initialScreen||o[0][0];if(!a[d])throw Error(`Initial screen ${d} is not in screens`);if(r.app!==void 0&&typeof r.app!=="string")throw Error(`"app" must name the app script's file`);let l=r.app?U.resolve(U.dirname(n),r.app):void 0;if(l&&!me(l))throw Error(`App script not found: ${l}`);return{initialScreen:d,screens:a,file:n,...l?{app:l}:{}}}async function Eo(t,e={}){let n=U.resolve(e.cwd??process.cwd()),r=e.format??"ir";if(r!=="ir"&&r!=="bundle")throw Error(`Unknown compile format: ${r}. Expected ir or bundle.`);let o=t?null:Kr(n,e.config);if(!t&&!o)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${rn[0]}`);let a,d=[];if(r==="bundle"){let f=o?await Ye({screens:o.screens,initialScreen:o.initialScreen,minify:e.minify,root:n,...o.app?{app:o.app}:{}}):await nn(U.resolve(n,t),{minify:e.minify});a=f.code,d=f.diagnostics}else{let f=async(h)=>{let p=await ge(h);return d.push(...p.diagnostics.map((S)=>({level:"warning",message:[S.kind,S.tag,S.name].filter(Boolean).join(": ")}))),p.document},g=o?{initialScreen:o.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(o.screens).map(async([h,p])=>[h,await f(p)])))}:await f(U.resolve(n,t));a=JSON.stringify(g,null,2)}if(!e.output)return{output:a,diagnostics:d};let l=U.resolve(n,e.output);return Gr(U.dirname(l),{recursive:!0}),await Bun.write(l,a),{output:a,written:l,diagnostics:d}}export{Eo as runNativeCompile};
|