@stacksjs/stx 0.2.570 → 0.2.572
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-01mxer9s.js +2 -0
- package/dist/chunk-09gtbb1w.js +2 -0
- package/dist/{chunk-v9gy8rda.js → chunk-0bt0fbs1.js} +59 -59
- package/dist/{chunk-k0shfsfx.js → chunk-0dz1b6a1.js} +3 -3
- package/dist/{chunk-3m01ym55.js → chunk-0g2ybnht.js} +2 -2
- package/dist/{chunk-jvm6agq7.js → chunk-0q6n3by0.js} +3 -3
- package/dist/chunk-15erabm6.js +2 -0
- package/dist/chunk-194qgkc9.js +2 -0
- package/dist/{chunk-fas9k7sw.js → chunk-1dg5qxg9.js} +5 -5
- package/dist/{chunk-tdv9np5t.js → chunk-1edvsndv.js} +2 -2
- package/dist/{chunk-brkq2s62.js → chunk-1n64749x.js} +3 -3
- package/dist/chunk-1z6c6dyk.js +2 -0
- package/dist/{chunk-36aj0yzt.js → chunk-232jswfm.js} +1 -1
- package/dist/chunk-279jv0yf.js +2 -0
- package/dist/chunk-2a1q5y6r.js +2 -0
- package/dist/{chunk-xfpfs9zq.js → chunk-2ads8rw5.js} +2 -2
- package/dist/chunk-2cqbyb8w.js +2 -0
- package/dist/{chunk-wjazf68a.js → chunk-2crxkm7j.js} +3 -3
- package/dist/{chunk-he2et28k.js → chunk-2jjff8kv.js} +5 -5
- package/dist/chunk-2jsnrfc8.js +2 -0
- package/dist/{chunk-ffxwsa94.js → chunk-2z0trbbm.js} +2 -2
- package/dist/{chunk-ywah1c30.js → chunk-36agnyhe.js} +7 -7
- package/dist/chunk-3gft8zng.js +2 -0
- package/dist/chunk-49gwmcrn.js +2 -0
- package/dist/{chunk-r17t24jr.js → chunk-4bgfpkwx.js} +3 -3
- package/dist/{chunk-dgr561sc.js → chunk-4easd8da.js} +11 -11
- package/dist/chunk-4wfr074d.js +2 -0
- package/dist/{chunk-cbyh8fhn.js → chunk-58tz7tmf.js} +3 -3
- package/dist/chunk-5afw7z6v.js +2 -0
- package/dist/{chunk-9d6dr0dr.js → chunk-5dmkkvs7.js} +2 -2
- package/dist/chunk-5fv4g4et.js +2 -0
- package/dist/{chunk-d8jdr1k4.js → chunk-5t1whxxt.js} +6 -6
- package/dist/{chunk-dkyqkkpj.js → chunk-5vw8493b.js} +3 -3
- package/dist/chunk-604rs9sq.js +2 -0
- package/dist/chunk-636sfxyj.js +2 -0
- package/dist/chunk-6aq3sm83.js +2 -0
- package/dist/chunk-6f4qrd0s.js +2 -0
- package/dist/chunk-6va5pe2m.js +2 -0
- package/dist/{chunk-r8h9b3f8.js → chunk-6wc2t6cd.js} +6 -6
- package/dist/{chunk-2t3bhp2j.js → chunk-707n4pbz.js} +5 -5
- package/dist/{chunk-5s555c1r.js → chunk-74xwzxwz.js} +3 -3
- package/dist/{chunk-nmy7mcbd.js → chunk-79vdkvhf.js} +5 -5
- package/dist/{chunk-mbj9dbrh.js → chunk-7bwkeake.js} +6 -6
- package/dist/chunk-7kh4p06d.js +2 -0
- package/dist/{chunk-8cs45k3f.js → chunk-7t3ykgsm.js} +2 -2
- package/dist/chunk-7xrrzqh7.js +2 -0
- package/dist/{chunk-724zsgbk.js → chunk-83fdt4yj.js} +6 -6
- package/dist/chunk-8jaw6exk.js +2 -0
- package/dist/chunk-8k61b4ae.js +2 -0
- package/dist/{chunk-chythmea.js → chunk-9k7bq97t.js} +1 -1
- package/dist/chunk-9yar9rfq.js +2 -0
- package/dist/{chunk-knpzph55.js → chunk-a6jq7hex.js} +3 -3
- package/dist/{chunk-mw2dravv.js → chunk-anjm087t.js} +5 -5
- package/dist/chunk-asbq9cgs.js +2 -0
- package/dist/{chunk-0zq4btre.js → chunk-b2q8bk8p.js} +2 -2
- package/dist/chunk-b7t8jejd.js +2 -0
- package/dist/chunk-b894fxfc.js +2 -0
- package/dist/{chunk-y3mmeywt.js → chunk-b9r88ysg.js} +2 -2
- package/dist/{chunk-0pzbg1bt.js → chunk-beqkrwt1.js} +2 -2
- package/dist/chunk-bm2q1srp.js +2 -0
- package/dist/{chunk-xjr67xvb.js → chunk-bpdsdbvg.js} +2 -2
- package/dist/{chunk-8zmahjqg.js → chunk-c4zpzxex.js} +6 -6
- package/dist/chunk-cgwyd9aq.js +2 -0
- package/dist/chunk-cvswrbzw.js +2 -0
- package/dist/{chunk-hvzznc50.js → chunk-cyg9w31a.js} +2 -2
- package/dist/chunk-d8206zbp.js +2 -0
- package/dist/chunk-dcpf6kas.js +15 -0
- package/dist/chunk-ensp20xk.js +2 -0
- package/dist/chunk-f10299sf.js +2 -0
- package/dist/chunk-f1apaqfk.js +2 -0
- package/dist/chunk-f4jh9vrj.js +2834 -0
- package/dist/{chunk-rrce2fyv.js → chunk-g66m3g2r.js} +1 -1
- package/dist/chunk-g6zeqvvb.js +2 -0
- package/dist/chunk-ghy82tsc.js +2 -0
- package/dist/{chunk-35kmebz9.js → chunk-gzgc8zk5.js} +4 -4
- package/dist/{chunk-qw4fjtt1.js → chunk-h4k3hyny.js} +2 -2
- package/dist/chunk-jqefcghh.js +31 -0
- package/dist/chunk-jw33eys8.js +2 -0
- package/dist/chunk-jwvzvapp.js +11 -0
- package/dist/{chunk-b76jbdtk.js → chunk-jze68d0z.js} +2 -2
- package/dist/chunk-k6wgh598.js +2 -0
- package/dist/{chunk-c1ys37c9.js → chunk-k7ht6tqe.js} +2 -2
- package/dist/{chunk-q94wdmdp.js → chunk-kgj852hx.js} +4 -4
- package/dist/{chunk-nebtks7j.js → chunk-kzjrgh0b.js} +10 -10
- package/dist/chunk-m2a1fxpb.js +2 -0
- package/dist/chunk-m6mxqepz.js +2 -0
- package/dist/chunk-mbmbaj0m.js +2 -0
- package/dist/{chunk-3tzkqf6e.js → chunk-mr9c2ej6.js} +2 -2
- package/dist/chunk-mzqyv7s5.js +33 -0
- package/dist/chunk-n61v7e3s.js +2 -0
- package/dist/chunk-n6qp05t9.js +2 -0
- package/dist/chunk-nn174xjh.js +2 -0
- package/dist/chunk-ntgy4e1q.js +2 -0
- package/dist/chunk-nw4axkpx.js +2 -0
- package/dist/chunk-p5chk3s9.js +2 -0
- package/dist/{chunk-w8vg3te3.js → chunk-phzs239m.js} +4 -4
- package/dist/{chunk-gwabvrc3.js → chunk-pnag11c4.js} +3 -3
- package/dist/{chunk-tc5zk2ka.js → chunk-pqcvh9pp.js} +1 -1
- package/dist/{chunk-a849hqna.js → chunk-pveafhzg.js} +2 -2
- package/dist/chunk-pw9verqx.js +2 -0
- package/dist/{chunk-rh606w0q.js → chunk-q79kmad5.js} +1 -1
- package/dist/chunk-q83w8edy.js +3 -0
- package/dist/{chunk-je0jxvmj.js → chunk-qcymqscj.js} +5 -5
- package/dist/{chunk-rtc17gy5.js → chunk-qt3x1sh3.js} +3 -3
- package/dist/chunk-qx6tr8mr.js +2 -0
- package/dist/{chunk-q8nw82pz.js → chunk-qzbzn1yf.js} +23 -23
- package/dist/{chunk-kaaxb9c5.js → chunk-r4w1cye7.js} +2 -2
- package/dist/{chunk-ebg20d8s.js → chunk-rfnr4xz6.js} +2 -2
- package/dist/{chunk-dajh1369.js → chunk-rrj5m9xv.js} +2 -2
- package/dist/{chunk-d4ybwtqt.js → chunk-s12b57m9.js} +2 -2
- package/dist/chunk-s34g3awk.js +74 -0
- package/dist/chunk-s6sf70ty.js +2 -0
- package/dist/{chunk-wemq37qe.js → chunk-sfwprq8q.js} +8 -8
- package/dist/chunk-ta8bhz27.js +2 -0
- package/dist/chunk-tc5r2vmw.js +2 -0
- package/dist/chunk-ts80ktq7.js +2 -0
- package/dist/{chunk-9k6r7f3c.js → chunk-tv784gv0.js} +4 -4
- package/dist/{chunk-3wcwtqx1.js → chunk-vp31ff54.js} +2 -2
- package/dist/{chunk-nz0krznq.js → chunk-vr36s2en.js} +2 -2
- package/dist/chunk-vyg8bvkt.js +2 -0
- package/dist/{chunk-9zf49tqg.js → chunk-wwhxgvr8.js} +4 -4
- package/dist/{chunk-ncq5n15k.js → chunk-xckzvbvn.js} +1 -1
- package/dist/chunk-xq2ck69k.js +2 -0
- package/dist/chunk-y4ajd836.js +2 -0
- package/dist/{chunk-j3vwyzvb.js → chunk-ydx3mfpp.js} +7 -7
- package/dist/{chunk-z3smaz4z.js → chunk-yk3wh2xv.js} +3 -3
- package/dist/{chunk-5hxsdkvp.js → chunk-ymawe0y5.js} +2 -2
- package/dist/{chunk-zckbg2vb.js → chunk-zd01r00t.js} +1 -1
- package/dist/chunk-zddzjd60.js +2 -0
- package/dist/chunk-zgxj1q7w.js +2 -0
- package/dist/chunk-zs7qhh40.js +2 -0
- package/dist/{chunk-qh0es7mk.js → chunk-zyk12484.js} +2 -2
- package/dist/cli.js +20 -20
- package/dist/client-script-bundler.js +1 -1
- package/dist/composable-loader.js +3 -2
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/env.d.ts +16 -0
- package/dist/env.js +12 -0
- package/dist/native/compiler/bundle.d.ts +2 -0
- package/dist/native/compiler/bundle.js +51 -12
- package/dist/process.js +3 -3
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +8 -8
- package/dist/store-loader.js +4 -3
- package/package.json +5 -5
- package/dist/chunk-0mw3d5fc.js +0 -2
- package/dist/chunk-1sh80b1c.js +0 -2
- package/dist/chunk-1xyhdpbn.js +0 -2
- package/dist/chunk-20nrvpps.js +0 -2
- package/dist/chunk-2j7tr8wj.js +0 -2
- package/dist/chunk-2mxhp1yy.js +0 -2
- package/dist/chunk-32yj7sbw.js +0 -2
- package/dist/chunk-3ss3vfad.js +0 -2
- package/dist/chunk-4zp2zzch.js +0 -2
- package/dist/chunk-503w9dn3.js +0 -2
- package/dist/chunk-6m406xsn.js +0 -63
- package/dist/chunk-6yja1c8e.js +0 -2
- package/dist/chunk-74va4kza.js +0 -2
- package/dist/chunk-74w81h3v.js +0 -2
- package/dist/chunk-85j8cxfd.js +0 -2
- package/dist/chunk-8bwp2m95.js +0 -2
- package/dist/chunk-8rj08x1d.js +0 -2
- package/dist/chunk-8yn9wxzt.js +0 -31
- package/dist/chunk-98xp5rfe.js +0 -2
- package/dist/chunk-9ah35e2w.js +0 -2
- package/dist/chunk-9d1bs55s.js +0 -2
- package/dist/chunk-9rts16ta.js +0 -2
- package/dist/chunk-a2mztbta.js +0 -33
- package/dist/chunk-ajezxt0s.js +0 -2
- package/dist/chunk-bf572npc.js +0 -2
- package/dist/chunk-cqeccn7x.js +0 -2
- package/dist/chunk-dkyjw3hc.js +0 -3
- package/dist/chunk-dsdxa5x1.js +0 -2
- package/dist/chunk-ectcp21m.js +0 -2
- package/dist/chunk-ewcnyvcd.js +0 -2
- package/dist/chunk-ez7r18ef.js +0 -2
- package/dist/chunk-ffgsaf9e.js +0 -2
- package/dist/chunk-fnnhekdc.js +0 -2
- package/dist/chunk-g8b74qvn.js +0 -2
- package/dist/chunk-ge87hcgb.js +0 -2
- package/dist/chunk-gra2v7xz.js +0 -2
- package/dist/chunk-jg9fydw8.js +0 -2
- package/dist/chunk-k50k9zbw.js +0 -2
- package/dist/chunk-kz131809.js +0 -2834
- package/dist/chunk-mg8yjzkr.js +0 -2
- package/dist/chunk-mjkw1esn.js +0 -2
- package/dist/chunk-n0ra4mv3.js +0 -2
- package/dist/chunk-nspfk500.js +0 -2
- package/dist/chunk-nwyp2xaf.js +0 -2
- package/dist/chunk-pdk87hhe.js +0 -2
- package/dist/chunk-pxcmv1xz.js +0 -2
- package/dist/chunk-re030f77.js +0 -2
- package/dist/chunk-rn80ctkd.js +0 -2
- package/dist/chunk-s7dzs6yg.js +0 -2
- package/dist/chunk-t1tqn3xx.js +0 -2
- package/dist/chunk-tgwdk0gt.js +0 -15
- package/dist/chunk-tma2vac1.js +0 -2
- package/dist/chunk-v0chatw1.js +0 -2
- package/dist/chunk-v9mkambt.js +0 -2
- package/dist/chunk-vwjqbn5y.js +0 -2
- package/dist/chunk-wrvksj26.js +0 -2
- package/dist/chunk-wvjpvs89.js +0 -11
- package/dist/chunk-xkxwg6d4.js +0 -2
- package/dist/chunk-xspkz804.js +0 -2
- package/dist/chunk-xwqyw7zt.js +0 -2
- package/dist/chunk-y3kp87w1.js +0 -2
- package/dist/chunk-ya39wk58.js +0 -2
- package/dist/chunk-ygbdfzqn.js +0 -2
- package/dist/chunk-ypswj8sv.js +0 -2
- package/dist/chunk-yqzhev40.js +0 -2
- package/dist/chunk-z1tnn2pm.js +0 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-ydx3mfpp.js";import"./chunk-vp31ff54.js";import"./chunk-phzs239m.js";import{fr,Vs,Xi}from"./chunk-k7ht6tqe.js";import"./chunk-s12b57m9.js";import{qn,Jn,n,o}from"./chunk-f4jh9vrj.js";import"./chunk-sfwprq8q.js";import"./chunk-36agnyhe.js";import"./chunk-rfnr4xz6.js";import"./chunk-rrj5m9xv.js";import"./chunk-1edvsndv.js";import"./chunk-tv784gv0.js";import{Me}from"./chunk-6wc2t6cd.js";import"./chunk-pnag11c4.js";import{existsSync as ne,mkdirSync as cn,readFileSync as ln}from"fs";import M from"path";import{existsSync as nt,mkdirSync as et}from"fs";import F from"path";import{existsSync as nn}from"fs";import q from"path";var at="data-stx-b",Re=new Set(Vs),ct=new Set(fr);function lt(r){if(r==="ref"||r==="data-stx-ref")return"ref";if(r.startsWith("::"))return null;if(r.startsWith("@bind:")||r.startsWith("x-bind:"))return"attr";if(r.startsWith("@")||r.startsWith(":")){let e=r.slice(1).split(".")[0];if(Re.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(Xi(e))return"event";if(r.startsWith("@"))return"event";return"attr"}if(r.startsWith("x-")){let e=r.split(".")[0];if(!ct.has(e))return"attr";let t=e.slice(2);if(t==="cloak"||t==="data"||t==="bind")return null;if(t==="tooltip"||t==="tooltip-position")return null;return Re.has(t)?t==="if"?"if":t:"attr"}return null}function dt(r){let e=[];for(let[t,i]of r){let s=lt(t);if(s)e.push({name:t,value:i,kind:s})}return e}var ut=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,oe=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function Ae(r){let e=[],t=0;return{html:r.replace(ut,(s,a,c)=>{if(!c||!/[:@]|x-/.test(c))return s;let d=[];oe.lastIndex=0;for(let p=oe.exec(c);p;p=oe.exec(c))d.push([p[1],p[2]??p[3]??p[4]??""]);let l=dt(d);if(!l.length)return s;let g={id:t++,bindings:l};if(l.some((p)=>p.kind==="for"))g.template=!0;e.push(g);let m=s.endsWith("/>");return`${s.slice(0,m?-2:-1).trimEnd()} ${at}="${g.id}"${m?"/>":">"}`}),manifest:{entries:e}}}var se={"region-change-complete":"onRegionChangeComplete",regionchangecomplete:"onRegionChangeComplete",click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll","scroll-begin-drag":"onScrollBeginDrag",scrollbegindrag:"onScrollBeginDrag","scroll-end-drag":"onScrollEndDrag",scrollenddrag:"onScrollEndDrag","momentum-scroll-begin":"onMomentumScrollBegin",momentumscrollbegin:"onMomentumScrollBegin","momentum-scroll-end":"onMomentumScrollEnd",momentumscrollend:"onMomentumScrollEnd",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError",play:"onPlay",playing:"onPlay",pause:"onPause",ended:"onEnd",end:"onEnd",timeupdate:"onProgress",progress:"onProgress",loadedmetadata:"onLoad",enterpictureinpicture:"onPictureInPictureStart",leavepictureinpicture:"onPictureInPictureStop"};var ce={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText"},le=new Set(Object.values(ce));var Ie=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Pe=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight"];function A(r){let e=typeof r==="number"?r:Number.parseFloat(String(r??""));return Number.isFinite(e)?e:0}function j(r){return Math.round(r*1000)/1000}function de(r){if(Array.isArray(r)&&r.length===4&&r.every((t)=>Number.isFinite(Number(t))))return r.map(Number);let e=String(r??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((t)=>!Number.isFinite(t))||e[2]<=0||e[3]<=0)return null;return e}function ft(r){let e=String(r??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var Ee=/[MLHVCSQTAZ]/i,ae=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function pt(r){let e=[],t=r,i=Ee.exec(t);while(i){let s=i.index;t=t.slice(s);let a=t[0];t=t.slice(1);let c=Ee.exec(t),d=c?t.slice(0,c.index):t,l;if(a==="A"||a==="a"){l=[];let g=0,m=d.trim(),u=0;while(u<m.length){let p=g%7,y=m.slice(u).replace(/^[\s,]+/,"");if(u=m.length-y.length,!y)break;if(p===3||p===4)l.push(y[0]==="1"?1:0),u+=1;else{ae.lastIndex=0;let S=ae.exec(y);if(!S||S.index!==0)break;l.push(Number.parseFloat(S[0])),u+=S[0].length}g++}}else l=(d.match(ae)||[]).map(Number.parseFloat);e.push({command:a,args:l}),i=c}return e}function gt(r,e,t,i,s,a,c,d,l){if(r===d&&e===l)return[];let g=Math.abs(t),m=Math.abs(i);if(!g||!m)return[1,d,l];let u=s*Math.PI/180,p=Math.cos(u),y=Math.sin(u),S=(r-d)/2,b=(e-l)/2,f=p*S+y*b,w=-y*S+p*b,v=f*f/(g*g)+w*w/(m*m);if(v>1)g*=Math.sqrt(v),m*=Math.sqrt(v);let x=g*g*m*m-g*g*w*w-m*m*f*f,h=g*g*w*w+m*m*f*f,k=Math.sqrt(Math.max(0,x/h));if(a===c)k=-k;let T=k*(g*w)/m,N=k*-(m*f)/g,_=p*T-y*N+(r+d)/2,B=y*T+p*N+(e+l)/2,P=(I,O,D,U)=>{let re=I*U-O*D<0?-1:1,ie=(I*D+O*U)/(Math.hypot(I,O)*Math.hypot(D,U));return re*Math.acos(Math.min(1,Math.max(-1,ie)))},E=P(1,0,(f-T)/g,(w-N)/m),C=P((f-T)/g,(w-N)/m,(-f-T)/g,(-w-N)/m);if(!c&&C>0)C-=2*Math.PI;if(c&&C<0)C+=2*Math.PI;let V=Math.max(1,Math.ceil(Math.abs(C)/(Math.PI/2))),W=C/V,K=1.3333333333333333*Math.tan(W/4),we=[],xe=(I)=>{let O=g*Math.cos(I),D=m*Math.sin(I);return[p*O-y*D+_,y*O+p*D+B]},Ne=(I)=>{let O=-g*Math.sin(I),D=m*Math.cos(I);return[p*O-y*D,y*O+p*D]},J=E;for(let I=0;I<V;I++){let O=J+W,[D,U]=xe(J),[re,ie]=Ne(J),[ke,Te]=xe(O),[ot,st]=Ne(O);we.push(2,D+K*re,U+K*ie,ke-K*ot,Te-K*st,I===V-1?d:ke,I===V-1?l:Te),J=O}return we}function ht(r){let e=[],t=0,i=0,s=0,a=0,c=0,d=0,l=0,g=0,m="";for(let{command:u,args:p}of pt(String(r??""))){let y=u===u.toLowerCase(),S=u.toUpperCase(),b=()=>y?t:0,f=()=>y?i:0,w=0,v=(h)=>{if(w+h>p.length)return null;let k=p.slice(w,w+h);return w+=h,k};if(S==="Z"){e.push(4),t=s,i=a,m="Z";continue}let x=!0;while(w<p.length||x&&S==="Z"){switch(S){case"M":{let h=v(2);if(!h)return e;if(t=h[0]+b(),i=h[1]+f(),x)e.push(0,t,i),s=t,a=i;else e.push(1,t,i);m=x?"M":"L";break}case"L":{let h=v(2);if(!h)return e;t=h[0]+b(),i=h[1]+f(),e.push(1,t,i),m="L";break}case"H":{let h=v(1);if(!h)return e;t=h[0]+b(),e.push(1,t,i),m="L";break}case"V":{let h=v(1);if(!h)return e;i=h[0]+f(),e.push(1,t,i),m="L";break}case"C":{let h=v(6);if(!h)return e;let k=h[0]+b(),T=h[1]+f();c=h[2]+b(),d=h[3]+f(),t=h[4]+b(),i=h[5]+f(),e.push(2,k,T,c,d,t,i),m="C";break}case"S":{let h=v(4);if(!h)return e;let k=m==="C"?2*t-c:t,T=m==="C"?2*i-d:i;c=h[0]+b(),d=h[1]+f(),t=h[2]+b(),i=h[3]+f(),e.push(2,k,T,c,d,t,i),m="C";break}case"Q":{let h=v(4);if(!h)return e;l=h[0]+b(),g=h[1]+f(),t=h[2]+b(),i=h[3]+f(),e.push(3,l,g,t,i),m="Q";break}case"T":{let h=v(2);if(!h)return e;l=m==="Q"?2*t-l:t,g=m==="Q"?2*i-g:i,t=h[0]+b(),i=h[1]+f(),e.push(3,l,g,t,i),m="Q";break}case"A":{let h=v(7);if(!h)return e;let k=h[5]+b(),T=h[6]+f();e.push(...gt(t,i,h[0],h[1],h[2],h[3],h[4],k,T)),t=k,i=T,m="A";break}default:return e}x=!1}}return e.map((u)=>j(u))}function _e(r,e,t,i){if(t<=0||i<=0)return[];let s=0.5522847498;return[0,r+t,e,2,r+t,e+s*i,r+s*t,e+i,r,e+i,2,r-s*t,e+i,r-t,e+s*i,r-t,e,2,r-t,e-s*i,r-s*t,e-i,r,e-i,2,r+s*t,e-i,r+t,e-s*i,r+t,e,4].map(j)}function ue(r,e){switch(r){case"Path":return ht(String(e.d??""));case"Line":return[0,A(e.x1),A(e.y1),1,A(e.x2),A(e.y2)].map(j);case"Rect":{let t=A(e.x),i=A(e.y),s=A(e.width),a=A(e.height);if(s<=0||a<=0)return[];let c=e.rx===void 0?A(e.ry):A(e.rx),d=e.ry===void 0?c:A(e.ry);if(c=Math.min(Math.max(0,c),s/2),d=Math.min(Math.max(0,d),a/2),!c||!d)return[0,t,i,1,t+s,i,1,t+s,i+a,1,t,i+a,4].map(j);let l=0.5522847498;return[0,t+c,i,1,t+s-c,i,2,t+s-c+l*c,i,t+s,i+d-l*d,t+s,i+d,1,t+s,i+a-d,2,t+s,i+a-d+l*d,t+s-c+l*c,i+a,t+s-c,i+a,1,t+c,i+a,2,t+c-l*c,i+a,t,i+a-d+l*d,t,i+a-d,1,t,i+d,2,t,i+d-l*d,t+c-l*c,i,t+c,i,4].map(j)}case"Circle":return _e(A(e.cx),A(e.cy),A(e.r),A(e.r));case"Ellipse":return _e(A(e.cx),A(e.cy),A(e.rx),A(e.ry));case"Polyline":case"Polygon":{let t=ft(e.points);if(t.length<4)return[];let i=[0,t[0],t[1]];for(let s=2;s<t.length;s+=2)i.push(1,t[s],t[s+1]);if(r==="Polygon")i.push(4);return i.map(j)}default:return null}}var mt=[...Pe,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize","initialRegion","tileOverlay","edgePadding","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","mapType","strokeColor","pinColor","showsCompass","showsScale","cameraPitch","cameraHeading","autoScrollBottom","scrollKey","pictureInPicture","transitionID"],Ce=new Set(["animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","showsCompass","showsScale","pictureInPicture"]),yt=new Map(mt.map((r)=>[Oe(r),r]));function Oe(r){return r.replace(/[-_]/g,"").toLowerCase()}function fe(r){return yt.get(Oe(r))??r}var bt={view:"View",sidebar:"Sidebar",splitview:"SplitView",textinput:"TextInput",pressable:"Pressable",icon:"Icon",text:"Text",button:"Button",image:"Image",img:"Image",video:"Video",map:"Map",mappolyline:"MapPolyline",mapmarker:"MapMarker",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",checkbox:"Checkbox",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function Be(r){return bt[r.toLowerCase()]||r}var St={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox",armchair:"sofa","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette",backpack:"backpack","badge-check":"checkmark.seal","badge-x":"xmark.seal",ban:"nosign","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100","battery-charging":"battery.100.bolt",bed:"bed.double",bell:"bell","bell-off":"bell.slash","bell-ring":"bell.and.waves.left.and.right",bike:"figure.outdoor.cycle",blocks:"square.grid.2x2",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",box:"shippingbox",brain:"brain",building:"building","building-2":"building.2",cable:"cable.connector",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-minus":"calendar.badge.minus","calendar-minus-2":"calendar.badge.minus","calendar-off":"calendar.badge.exclamationmark","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath","calendar-x":"calendar.badge.exclamationmark","calendar-x-2":"calendar.badge.exclamationmark",camera:"camera","chart-bar":"chart.bar","chart-column":"chart.bar","chart-line":"chart.xyaxis.line","chart-no-axes-gantt":"chart.bar.doc.horizontal",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-arrow-out-up-left":"arrow.uturn.backward.circle","circle-minus":"minus.circle","circle-arrow-down":"arrow.down.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-dot":"smallcircle.filled.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock","clock-12":"clock","clock-2":"clock","clock-3":"clock","clock-4":"clock","clock-8":"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",cylinder:"cylinder",disc:"opticaldisc",download:"arrow.down.circle",droplet:"drop",droplets:"drop",dumbbell:"dumbbell",edit:"pencil","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal","hand-fist":"hand.raised",heart:"heart","heart-off":"heart.slash","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",hourglass:"hourglass",house:"house","id-card":"person.text.rectangle",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-dashboard":"rectangle.3.group","layout-grid":"square.grid.2x2",leaf:"leaf",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",megaphone:"megaphone",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble",mic:"mic",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note","music-2":"music.note",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","rectangle-horizontal":"rectangle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass","scan-line":"barcode.viewfinder",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart",shuffle:"shuffle","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",sprout:"leaf",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront","stretch-horizontal":"rectangle.split.1x2",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis","triangle-alert":"exclamationmark.triangle",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-check":"person.crop.circle.badge.checkmark","user-minus":"person.badge.minus","user-plus":"person.badge.plus","user-round":"person","user-round-check":"person.crop.circle.badge.checkmark","user-round-minus":"person.crop.circle.badge.minus","user-round-plus":"person.crop.circle.badge.plus","user-round-x":"person.crop.circle.badge.xmark","user-x":"person.crop.circle.badge.xmark",users:"person.2","users-round":"person.2",video:"video","volume-2":"speaker.wave.2",warehouse:"building.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function pe(r,e=!1){let t=String(r??"").trim();if(!t)return{symbol:"circle",known:!1};if(e)return{symbol:t,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(t)??/^([a-z0-9]+):(.+)$/.exec(t),s=i?i[1]:"lucide",a=i?i[2]:t;if(s==="lucide"){let c=St[a];if(c)return{symbol:c,iconify:`i-lucide-${a}`,known:!0};if(!i&&t.includes("."))return{symbol:t,known:!0}}return{symbol:"circle",iconify:i?t:`i-lucide-${a}`,known:!1}}var vt={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"}},Fe={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},De={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},L={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function X(r){let e=r.lastIndexOf("/");if(e>0&&!r.endsWith("]")){let i=X(r.slice(0,e)),s=r.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return wt(i,a/100)}if(r==="transparent")return"transparent";if(r==="current")return"currentColor";if(r==="black")return"#000000";if(r==="white")return"#ffffff";let t=r.split("-");if(t.length===2){let[i,s]=t,a=vt[i];if(a&&typeof a==="object")return a[s]}if(r.startsWith("[")&&r.endsWith("]")){let i=r.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function wt(r,e){if(r==="transparent")return r;let t=r.startsWith("#")?r.slice(1):"";if(t.length===3)t=t.split("").map((s)=>s+s).join("");if(t.length===8)t=t.slice(0,6);if(t.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${t}${i.toString(16).padStart(2,"0")}`}function ge(r,e=16){if(!r.startsWith("[")||!r.endsWith("]"))return;let t=r.slice(1,-1),i=Number.parseFloat(t);if(!Number.isFinite(i))return;if(t.endsWith("rem"))return i*16;if(t.endsWith("em"))return i*e;return i}function R(r){if(r.startsWith("[")&&r.endsWith("]")){let e=r.slice(1,-1);if(e.endsWith("%"))return;let t=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(t)?t:void 0}return Fe[r]}function Y(r){let e=/^\[(-?\d*\.?\d+)%\]$/.exec(r);if(e)return`${Number.parseFloat(e[1])}%`;return R(r)}var xt={flex:(r,e)=>(e.display="flex",!0),hidden:(r,e)=>(e.display="none",!0),grid:(r,e)=>(e.display="grid",!0),"flex-row":(r,e)=>(e.flexDirection="row",!0),"flex-col":(r,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(r,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(r,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(r,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(r,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(r,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(r,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(r,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(r,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(r,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(r,e)=>(e.flexGrow=1,!0),"grow-0":(r,e)=>(e.flexGrow=0,!0),shrink:(r,e)=>(e.flexShrink=1,!0),"shrink-0":(r,e)=>(e.flexShrink=0,!0),"justify-start":(r,e)=>(e.justifyContent="flex-start",!0),"justify-center":(r,e)=>(e.justifyContent="center",!0),"justify-end":(r,e)=>(e.justifyContent="flex-end",!0),"justify-between":(r,e)=>(e.justifyContent="space-between",!0),"justify-around":(r,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(r,e)=>(e.justifyContent="space-evenly",!0),"items-start":(r,e)=>(e.alignItems="flex-start",!0),"items-center":(r,e)=>(e.alignItems="center",!0),"items-end":(r,e)=>(e.alignItems="flex-end",!0),"items-stretch":(r,e)=>(e.alignItems="stretch",!0),"items-baseline":(r,e)=>(e.alignItems="baseline",!0),"self-auto":(r,e)=>(e.alignSelf="auto",!0),"self-start":(r,e)=>(e.alignSelf="flex-start",!0),"self-center":(r,e)=>(e.alignSelf="center",!0),"self-end":(r,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(r,e)=>(e.alignSelf="stretch",!0),"self-baseline":(r,e)=>(e.alignSelf="baseline",!0),"min-w-0":(r,e)=>(e.minWidth=0,!0),"aspect-square":(r,e)=>(e.aspectRatio=1,!0),"inset-0":(r,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(r,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(r,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(r,e)=>(e.letterSpacing=0,!0),"tracking-wide":(r,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(r,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(r,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(r,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(r,e)=>(e.position="relative",!0),absolute:(r,e)=>(e.position="absolute",!0),"overflow-visible":(r,e)=>(e.overflow="visible",!0),"overflow-hidden":(r,e)=>(e.overflow="hidden",!0),"overflow-scroll":(r,e)=>(e.overflow="scroll",!0),"font-thin":(r,e)=>(e.fontWeight="100",!0),"font-extralight":(r,e)=>(e.fontWeight="200",!0),"font-light":(r,e)=>(e.fontWeight="300",!0),"font-normal":(r,e)=>(e.fontWeight="400",!0),"font-medium":(r,e)=>(e.fontWeight="500",!0),"font-semibold":(r,e)=>(e.fontWeight="600",!0),"font-bold":(r,e)=>(e.fontWeight="bold",!0),"font-extrabold":(r,e)=>(e.fontWeight="800",!0),"font-black":(r,e)=>(e.fontWeight="900",!0),italic:(r,e)=>(e.fontStyle="italic",!0),"not-italic":(r,e)=>(e.fontStyle="normal",!0),"text-left":(r,e)=>(e.textAlign="left",!0),"text-center":(r,e)=>(e.textAlign="center",!0),"text-right":(r,e)=>(e.textAlign="right",!0),"text-justify":(r,e)=>(e.textAlign="justify",!0),uppercase:(r,e)=>(e.textTransform="uppercase",!0),lowercase:(r,e)=>(e.textTransform="lowercase",!0),capitalize:(r,e)=>(e.textTransform="capitalize",!0),"normal-case":(r,e)=>(e.textTransform="none",!0),underline:(r,e)=>(e.textDecorationLine="underline",!0),"line-through":(r,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(r,e)=>(e.textDecorationLine="none",!0)};function Nt(r,e){if(!r.startsWith("bg-"))return!1;let t=r.slice(3),i=X(t);if(i)return e.backgroundColor=i,!0;return!1}function kt(r,e){if(!r.startsWith("text-"))return!1;let t=r.slice(5);if(De[t])return e.fontSize=De[t],!0;if(t.startsWith("[")&&t.endsWith("]")){let s=t.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(s)){let a=s.endsWith("rem")||s.endsWith("em")?Number.parseFloat(s)*16:Number.parseFloat(s);if(Number.isFinite(a))return e.fontSize=a,!0}}let i=X(t);if(i)return e.color=i,!0;return!1}var Tt=new Set(["t","tr","r","br","b","bl","l","tl"]);function Rt(r,e){let t=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(r);if(t&&Tt.has(t[1]))return e.gradientDirection=`to-${t[1]}`,!0;let i=/^(from|via|to)-(.+)$/.exec(r);if(!i)return!1;let s=X(i[2]);if(!s)return!1;if(i[1]==="from")e.gradientFrom=s;else if(i[1]==="via")e.gradientVia=s;else e.gradientTo=s;return!0}function At(r,e){for(let t of["fill","stroke"]){let i=`${t}-`;if(!r.startsWith(i))continue;let s=r.slice(i.length);if(s==="none")return e[t]="none",!0;if(t==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return e.strokeWidth=Number.parseFloat(s),!0;if(t==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return e.strokeWidth=Number.parseFloat(s.slice(1)),!0;let a=X(s);if(a)return e[t]=a,!0}return!1}function Et(r,e){if(r.startsWith("p-")){let t=R(r.slice(2));if(t!==void 0)return e.padding=t,!0}if(r.startsWith("px-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingHorizontal=t,!0}if(r.startsWith("py-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingVertical=t,!0}if(r.startsWith("pt-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingTop=t,!0}if(r.startsWith("pr-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingRight=t,!0}if(r.startsWith("pb-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingBottom=t,!0}if(r.startsWith("pl-")){let t=R(r.slice(3));if(t!==void 0)return e.paddingLeft=t,!0}return!1}function Ve(r,e){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(r)){let t={};if(!Ve(r.slice(1),t))return!1;let i=Object.entries(t);if(i.some(([,s])=>typeof s!=="number"))return!1;for(let[s,a]of i)e[s]=-a;return!0}if(r.startsWith("m-")){let t=R(r.slice(2));if(t!==void 0)return e.margin=t,!0}if(r.startsWith("mx-")){let t=R(r.slice(3));if(t!==void 0)return e.marginHorizontal=t,!0}if(r.startsWith("my-")){let t=R(r.slice(3));if(t!==void 0)return e.marginVertical=t,!0}if(r.startsWith("mt-")){let t=R(r.slice(3));if(t!==void 0)return e.marginTop=t,!0}if(r.startsWith("mr-")){let t=R(r.slice(3));if(t!==void 0)return e.marginRight=t,!0}if(r.startsWith("mb-")){let t=R(r.slice(3));if(t!==void 0)return e.marginBottom=t,!0}if(r.startsWith("ml-")){let t=R(r.slice(3));if(t!==void 0)return e.marginLeft=t,!0}return!1}function _t(r,e){if(!r.startsWith("w-"))return!1;let t=r.slice(2);if(t==="full")return e.width="100%",!0;if(t==="screen")return e.width="100%",!0;if(t==="auto")return e.width="auto",!0;if(t.includes("/")){let[s,a]=t.split("/"),c=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${c}%`,!0}let i=Y(t);if(i!==void 0)return e.width=i,!0;return!1}function It(r,e){if(!r.startsWith("h-"))return!1;let t=r.slice(2);if(t==="full")return e.height="100%",!0;if(t==="screen")return e.height="100%",!0;if(t==="auto")return e.height="auto",!0;let i=Y(t);if(i!==void 0)return e.height=i,!0;return!1}function Pt(r,e){if(!r.startsWith("rounded"))return!1;if(r==="rounded")return e.borderRadius=L.DEFAULT,!0;let t=r.slice(8);if(t==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(t);if(i){let a=ge(i[2]);if(a===void 0)return!1;let c={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let d of i[1]?c[i[1]]:["borderRadius"])e[d]=a;return!0}if(t.startsWith("t-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopLeftRadius=a,e.borderTopRightRadius=a,!0}if(t.startsWith("b-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderBottomLeftRadius=a,e.borderBottomRightRadius=a,!0}if(t.startsWith("l-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopLeftRadius=a,e.borderBottomLeftRadius=a,!0}if(t.startsWith("r-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopRightRadius=a,e.borderBottomRightRadius=a,!0}let s=L[t];if(s!==void 0)return e.borderRadius=s,!0;return!1}function Ct(r,e){if(!r.startsWith("border"))return!1;if(r==="border")return e.borderWidth=1,!0;let t=r.match(/^border-(\d+)$/);if(t)return e.borderWidth=Number.parseInt(t[1]),!0;let i=r.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,s,a]=i,c=a?Number.parseInt(a):1;switch(s){case"t":e.borderTopWidth=c;break;case"r":e.borderRightWidth=c;break;case"b":e.borderBottomWidth=c;break;case"l":e.borderLeftWidth=c;break}return!0}return!1}function Ot(r,e){if(!r.startsWith("border-"))return!1;let t=r.slice(7),i=X(t);if(i)return e.borderColor=i,!0;return!1}function Bt(r,e){if(!r.startsWith("opacity-"))return!1;let t=Number.parseInt(r.slice(8));if(!Number.isNaN(t))return e.opacity=t/100,!0;return!1}function Mt(r,e){if(r.startsWith("tracking-[")){let t=ge(r.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(t===void 0)return!1;return e.letterSpacing=t,!0}if(r.startsWith("leading-")){let t=r.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=t.startsWith("[")?/^\[[\d.]+\]$/.test(t)?Number.parseFloat(t.slice(1,-1))*i:ge(t,i):s[t]!==void 0?s[t]*i:Fe[t];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function Dt(r,e){let t=/^grid-cols-(\d+)$/.exec(r);if(!t)return!1;return e.gridColumns=Number(t[1]),!0}function Lt(r,e){if(!r.startsWith("size-"))return!1;let t=r.slice(5),i=t==="full"?"100%":Y(t);if(i===void 0)return!1;return e.width=i,e.height=i,!0}var Ft={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function Vt(r,e){let t=/^(min|max)-(w|h)-(.+)$/.exec(r);if(!t)return!1;let[,i,s,a]=t,c=a==="full"||a==="screen"?"100%":a==="none"?void 0:s==="w"&&i==="max"&&Ft[a]||Y(a);if(c===void 0&&a!=="none")return!1;let d=`${i}${s==="w"?"Width":"Height"}`;if(c===void 0)delete e[d];else e[d]=c;return!0}function Wt(r,e){let t=/^(-?)(top|right|bottom|left)-(.+)$/.exec(r);if(!t)return!1;let i=t[3]==="full"?"100%":R(t[3]);if(i===void 0)return!1;return e[t[2]]=typeof i==="number"&&t[1]?-i:i,!0}function $t(r,e){let t=/^space-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=R(t[2]);if(i===void 0)return!1;return e.gap=i,!0}function jt(r,e){if(r.startsWith("gap-")){let t=R(r.slice(4));if(t!==void 0)return e.gap=t,!0}if(r.startsWith("gap-x-")){let t=R(r.slice(6));if(t!==void 0)return e.columnGap=t,!0}if(r.startsWith("gap-y-")){let t=R(r.slice(6));if(t!==void 0)return e.rowGap=t,!0}return!1}function Xt(r,e){let i={"shadow-none":[0,0,0,0],"shadow-xs":[1,1,0.05,1],"shadow-sm":[2,1,0.1,2],shadow:[3,2,0.12,3],"shadow-md":[6,4,0.15,4],"shadow-lg":[10,6,0.18,8],"shadow-xl":[16,10,0.2,12],"shadow-2xl":[24,16,0.25,18]}[r];if(!i)return!1;let[s,a,c,d]=i;return Object.assign(e,{shadowColor:"#000000",shadowOpacity:c,shadowRadius:s,shadowOffset:{width:0,height:a},elevation:d}),!0}function Q(r){let e=[],t=[],i=[];function s(l,g){let m=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(l),u=m&&qn[m[2]];return u?`${m[1]}-${u[g]}${m[3]||""}`:l}for(let l of r.split(/\s+/).filter(Boolean))if(l.startsWith("dark:"))t.push(s(l.slice(5),"dark"));else if(!l.includes(":")||l.startsWith("[")){if(e.push(s(l,"light")),s(l,"dark")!==l)i.push(s(l,"dark"))}let a=[],d={style:Le(e.join(" "),a),unknown:a};if(t.length||i.length)d.dark=Le([...i,...t].join(" "),a);for(let l of e){if(l==="truncate")d.numberOfLines=1;let g=/^line-clamp-(\d+)$/.exec(l);if(g)d.numberOfLines=Number(g[1]);if(!d.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(l))d.icon=l}return d.unknown=a.filter((l)=>!/^line-clamp-\d+$/.test(l)),d}function Le(r,e){let t={},i=r.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=xt[s];if(a){a("",t);continue}if(Xt(s,t))continue;if(Rt(s,t))continue;if(Nt(s,t))continue;if(At(s,t))continue;if(kt(s,t))continue;if(Et(s,t))continue;if(Ve(s,t))continue;if(_t(s,t))continue;if(It(s,t))continue;if(Pt(s,t))continue;if(Ct(s,t))continue;if(Ot(s,t))continue;if(Bt(s,t))continue;if(jt(s,t))continue;if(Mt(s,t))continue;if(Lt(s,t))continue;if(Vt(s,t))continue;if(Dt(s,t))continue;if(Wt(s,t))continue;if($t(s,t))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return t}function z(r,e={},t={},i={},s=[]){return{type:r,props:e,style:t,events:i,children:s}}function We(r,e,t={}){return{version:"1.0.0",root:r,script:e,meta:{source:t.source||"unknown",compiledAt:t.compiledAt||Date.now(),headwindConfig:t.headwindConfig}}}var $e=new Set(["script","style","head","meta","link","title","base","noscript"]),je=new Set(["template","body","html","main","fragment"]),Z=new Set,zt=new Set(["onBlur","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPictureInPictureStart","onPictureInPictureStop","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRegionChangeComplete","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),he=new Set(["display","gridColumns","gridTemplateColumns","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),Ut=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),Ht=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"]),Xe=new Set(["Sidebar","SplitView","View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","Map","MapPolyline","MapMarker","FlatList","SectionList","Switch","Checkbox","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...le]),qt=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"],["listrole","listRole"]]),ze=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Gt={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function H(r){return r.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,t)=>{let i=Gt[t.toLowerCase()];if(i!==void 0)return i;if(t[0]==="#"){let s=t[1]==="x"||t[1]==="X"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function Ue(r){return r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function He(r){let e=/^(-?[\d.]+)px$/.exec(r);if(e)return Number.parseFloat(e[1]);let t=/^(-?[\d.]+)r?em$/.exec(r);if(t)return Number.parseFloat(t[1])*16;if(/^-?[\d.]+$/.test(r))return Number.parseFloat(r);return r}function qe(r,e,t){let i={},s={},a={},c="",d={};for(let[m,u]of e){let p=m.toLowerCase();if(p==="class"||p==="classname"){c=c?`${c} ${u}`:u;continue}if(p==="style"){d={...d,...Jt(r,u,t)};continue}if(p.startsWith(":")||p.startsWith("x-")&&p!=="x-cloak"){a[p.startsWith(":")?p.slice(1):p.slice(2)]=H(u);continue}if(p==="x-cloak")continue;if(p.startsWith("@")||p.startsWith("v-on:")){let b=p.startsWith("@")?p.slice(1):p.slice(5),[f]=b.split("."),w=se[f]??(f.startsWith("on")?f:"");if(!w||!zt.has(w)){t.push({kind:"unread-event",tag:r,name:m});continue}s[w]=H(u);continue}if(p==="key"){i.key=u;continue}let y=H(u),S=fe(m);if(y===""&&Ce.has(S)){i[S]=!0;continue}try{i[S]=JSON.parse(y)}catch{i[S]=y}}let l=c?Q(c):void 0;for(let m of new Set(l?.unknown??[]))t.push({kind:"unknown-class",tag:r,name:m});let g={...l?.style,...d};return{props:i,style:g,events:s,bindings:a,classes:c,inline:d}}function Kt(r,e){if(r==="shadowOffset"){if(!e||typeof e!=="object"||Array.isArray(e))return;let{width:t,height:i}=e;return typeof t==="number"&&typeof i==="number"?{width:t,height:i}:void 0}if(r==="transform"){if(!Array.isArray(e))return;let t=e.filter((i)=>Boolean(i)&&typeof i==="object"&&!Array.isArray(i)&&Object.keys(i).length===1).filter((i)=>["number","string"].includes(typeof Object.values(i)[0]));return t.length?t:void 0}return}function Ge(r,e){if(Ut.has(r))return!1;if(Ht.has(r))return/^-?[\d.]+%$/.test(e);return!0}function Jt(r,e,t){let i={},s=H(e);try{let a=JSON.parse(s);if(a&&typeof a==="object"&&!Array.isArray(a)){for(let[c,d]of Object.entries(a)){let l=he.has(c)?c:Ue(c.trim().toLowerCase());if(!he.has(l)){t.push({kind:"unknown-style",tag:r,name:l});continue}if(d===null||d===void 0)continue;let g=typeof d==="string"?He(d):d;if(typeof g==="object"){let m=Kt(l,g);if(m===void 0)t.push({kind:"non-numeric-style",tag:r,name:l});else i[l]=m;continue}if(typeof g!=="string"&&typeof g!=="number")continue;if(typeof g==="string"&&!Ge(l,g)){t.push({kind:"non-numeric-style",tag:r,name:l});continue}i[l]=g}return i}}catch{}for(let a of s.split(";")){let c=a.indexOf(":");if(c===-1)continue;let d=Ue(a.slice(0,c).trim().toLowerCase()),l=a.slice(c+1).trim();if(!d||!l)continue;if(!he.has(d)){t.push({kind:"unknown-style",tag:r,name:d});continue}let g=He(l);if(typeof g==="string"&&!Ge(d,g)){t.push({kind:"non-numeric-style",tag:r,name:d});continue}i[d]=g}return i}function me(r){return r.children.map((e)=>typeof e==="string"?e:me(e)).join("").replace(/\s+/g," ").trim()}function Yt(r,e){let t=r.node,i=t.children.filter((a)=>typeof a!=="string"),s=t.children.filter((a)=>typeof a==="string").join("").trim();if(t.type==="Svg"||t.type==="G")return t.children=i,t;if(t.type==="SvgText"){let a=me(t);return t.children=a?[a]:[],t}if(ze.has(t.type)&&i.length===0&&s)return t.type="Text",t.children=[s],t;if(t.type==="Text"&&!s&&i.length===0&&typeof t.props.text==="string")return t.children=t.props.text?[t.props.text]:[],delete t.props.text,t;if(t.type==="Text"&&i.length>0){let a=me(t);return e.push({kind:"flattened-text",tag:r.tag}),t.children=a?[a]:[],t}if(ze.has(t.type)&&i.length>0)t.children=i;return t}async function Qt(r,e={}){let t=[],i=[],s=[],a=new Set;function c(u){let p=s[s.length-1];if(!p)i.push(u);else if(!p.dropped)p.node.children.push(u)}function d(u){if(u.node.bindings&&Object.keys(u.node.bindings).length>0){let y=u.node.children,S=y.filter((f)=>typeof f!=="string"),b=S.length===1&&S.length===y.length?S[0]:z("View",{},{},{},y);if(b.bindings={...u.node.bindings,...b.bindings},b.bindingId===void 0&&u.node.bindingId!==void 0)b.bindingId=u.node.bindingId;c(b);return}let p=s[s.length-1];for(let y of u.node.children){if(typeof y==="string"){if(p&&!p.dropped)p.node.children.push(y);continue}if(!p)i.push(y);else if(!p.dropped)p.node.children.push(y)}}function l(u,p){let y=s[s.length-1];if(u==="svg"||y?.svg)return g(u,p,y);let S=$e.has(u)&&!Z.has(u),b=s[s.length-1]?.dropped??!1,{props:f,style:w,events:v,bindings:x,classes:h,inline:k}=S||b?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:qe(u,p,t),T=f["data-native"],N;if(typeof T==="string"&&Xe.has(T))N=T,delete f["data-native"];else N=Z.has(u)?"View":Be(u);if(N===u&&!Xe.has(N)&&!$e.has(u)&&!je.has(u)&&!a.has(u))a.add(u),t.push({kind:"unmapped-tag",tag:u});if((S||Z.has(u))&&!a.has(`drop:${u}`))a.add(`drop:${u}`),t.push({kind:"dropped-subtree",tag:u});if(N==="Video"&&f.source===void 0&&f.src!==void 0)f.source=f.src,delete f.src;if(N==="Icon"){let P=Q(h).icon,E=pe(String(f.symbol||f.name||P||""),Boolean(f.symbol));if(f.symbol=E.symbol,E.iconify)f.iconify=E.iconify}if(N==="FlatList"||N==="SectionList"){let P=new Set([...Object.keys(f),...Object.keys(x)].map((E)=>E.toLowerCase()));for(let[E,C]of qt)if(P.has(E))t.push({kind:"unsupported-list-prop",tag:N,name:C})}let _=z(N,f,w,v);_._inlineStyle=k;let B=f["data-stx-b"];if(typeof B==="number"&&Number.isInteger(B))_.bindingId=B;if(delete f["data-stx-b"],h)_._classes=h;if(Object.keys(x).length>0)_.bindings=x;if(typeof f.key==="string")_.key=f.key,delete f.key;return{tag:u,node:_,dropped:S||b||Z.has(u),discard:S||b,unwrap:je.has(u)}}function g(u,p,y){let S=y?.dropped??!1,b=ce[u];if(S||!b){if(!S&&!a.has(`drop:${u}`))a.add(`drop:${u}`),t.push({kind:Ie.has(u)?"dropped-subtree":"unmapped-tag",tag:u});return{tag:u,node:z("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let{props:f,style:w,events:v,bindings:x,classes:h,inline:k}=qe(u,p,t);if(b==="Svg"){let B=de(f.viewBox);if(B)f.viewBox=B;else delete f.viewBox;for(let P of["width","height"]){if(typeof f[P]==="number"&&w[P]===void 0)w[P]=f[P];delete f[P]}}if(typeof f.strokeDasharray==="string"||typeof f.strokeDasharray==="number"){let B=String(f.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);f.strokeDasharray=B}let T=ue(b,f);if(T)f.geometry=T;let N=z(b,f,w,v);N._inlineStyle=k;let _=f["data-stx-b"];if(typeof _==="number"&&Number.isInteger(_))N.bindingId=_;if(delete f["data-stx-b"],h)N._classes=h;if(Object.keys(x).length>0)N.bindings=x;if(typeof f.key==="string")N.key=f.key,delete f.key;return{tag:u,node:N,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(u){let p=u.tagName.toLowerCase(),y=l(p,[...u.attributes]),S=!0;try{u.onEndTag(()=>{if(s.pop(),y.discard)return;if(y.unwrap)d(y);else c(Yt(y,t))})}catch{S=!1}if(S)s.push(y);else if(!y.discard)c(y.node)},text(u){let p=s[s.length-1];if(!p||p.dropped)return;let y=H(u.text).replace(/\s+/g," ");if(!y.trim())return;p.node.children.push(y)}}).transform(new Response(r)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:z("View",{},{},{},i),diagnostics:t}}async function Ke(r,e={}){let{root:t,diagnostics:i}=await Qt(r,e),s=e.script??{exports:{},functions:[],code:""};return{document:We(t,s,{source:e.source??"unknown"}),diagnostics:i}}var Je=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Zt=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,en=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,Ye=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function ye(r){let e=[];Je.lastIndex=0;for(let a of r.matchAll(Je)){let c=a[1]??"";if(/\bserver\b/.test(c))continue;e.push(a[2].trim())}let t=e.filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`),i=[];for(let a of[Zt,en]){a.lastIndex=0;for(let c of t.matchAll(a))if(!i.includes(c[1]))i.push(c[1])}let s={};Ye.lastIndex=0;for(let a of t.matchAll(Ye)){let c=a[2];try{s[a[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{s[a[1]]=c}}return{exports:s,functions:i,code:t}}var ee=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,Qe=/function\s+(__stx_setup_[\w$]+)\s*\(/,tn=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function be(r){ee.lastIndex=0;for(let e of r.matchAll(ee)){let t=e[2].trim(),i=Qe.exec(t)?.[1];if(i)return{name:i,code:t}}return null}function Ze(r){let e=[];ee.lastIndex=0;for(let t of r.matchAll(ee)){let i=t[1],s=t[2].trim(),a=tn.exec(i)?.[1],c=/\bdata-stx-component-factories\b/i.test(i);if(!s||!a&&!c&&!Qe.test(s))continue;e.push(a?{code:s,owner:a}:{code:s})}return e}function rn(){let r=[q.join(import.meta.dir,"..","primitives"),q.join(import.meta.dir,"native","primitives")];for(let e of r)if(nn(q.join(e,"View.stx")))return e;return r[0]}async function on(r,e,t={}){let i=t.root??q.dirname(e),s=await o(i),a={root:i,componentsDir:t.componentsDir??q.join(i,"components"),buildMode:"serve",cache:!1,_targetComponentDirs:[rn()],_pluginComponentDirs:s._pluginComponentDirs??[]},c={...t.context??{},__stx_inject_css:!1},d=new Set([e]),l=await n(r,c,e,a,d),{html:g,manifest:m}=Ae(l),{document:u,diagnostics:p}=await Ke(g,{source:e,script:ye(r)}),y=be(g),S=Ze(g);if(ye(r).code.trim()){let b=await Jn(r,e,t.context,{forceClientSetup:!0}),f=be(b.setupCode??"");if(y=f??y,f&&!S.some((w)=>w.code===f.code))S.push({code:f.code})}return{document:u,manifest:m,setup:y,scripts:S,diagnostics:p,html:g,dependencies:[...d]}}async function te(r,e={}){return on(await Bun.file(r).text(),r,e)}var G="__app";function Se(r){let t=[F.join(import.meta.dir,"..","runtime",`${r}.ts`),F.join(import.meta.dir,"..","runtime",`${r}.js`),F.join(import.meta.dir,"native","runtime",`${r}.js`)].find((i)=>nt(i));if(!t)throw Error(`Native runtime module ${r} is missing`);return t}async function tt(r,e,t,i){let s={name:"stx-screen-inputs",setup(c){c.onLoad({filter:/.*/,namespace:"file"},({path:d})=>{i.add(d);return})}},a=await Bun.build({entrypoints:[r],target:"browser",format:"iife",minify:t,plugins:[s,...e],define:{"process.env.NODE_ENV":JSON.stringify(t?"production":"development")}});if(!a.success){let c=a.logs.map((d)=>String(d.message??d)).join(`
|
|
5
|
+
`);throw Error(`Could not bundle ${r}:
|
|
6
|
+
${c}`)}return(await a.outputs[0].text()).trim()}function sn(r){return{...r,script:{exports:r.script.exports,functions:[],code:""}}}async function ve(r){let e=Object.keys(r.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let t=r.routed??!0,i=r.initialScreen??e[0];if(!r.screens[i])throw Error(`Initial screen ${i} is not in screens`);let s=F.resolve(r.root??process.cwd()),a=[];for(let v of e){let x=F.resolve(s,r.screens[v]);if(!x.endsWith(".stx"))throw Error(`Screen ${v} must name a .stx file`);a.push({name:v,file:x,compiled:await te(x,{root:s})})}let c=Se("jsc-globals"),d=Se("shared-screen"),l=r.app?F.resolve(s,r.app):null;if(l&&!nt(l))throw Error(`The app script ${r.app} does not exist`);if(l&&!t)throw Error("An app script needs a routed bundle");if(l&&r.screens[G])throw Error(`${G} is the app script's route, not a screen name`);let g=r.browser;if(g&&r.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let m=(v,x)=>{let h=t?`var routeName = g.__stxNativeRoute || ${JSON.stringify(i)};
|
|
7
|
+
var isApp = ${l?`routeName === ${JSON.stringify(G)}`:"false"};
|
|
8
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
|
|
9
|
+
if (isApp ? ${!x} : ${JSON.stringify(v.map(({name:E})=>E))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
|
|
10
|
+
var isApp = false;`,k=v.map(({name:E,compiled:C},V)=>`${V===0?"if":"else if"} (routeName === ${JSON.stringify(t?E:"main")}) {
|
|
11
|
+
nativeDocument = ${JSON.stringify(sn(C.document))};
|
|
12
|
+
manifest = ${JSON.stringify(C.manifest)};
|
|
13
|
+
}`).join(`
|
|
14
|
+
`),T=v.map(({name:E,compiled:C},V)=>`${V===0?"if":"else if"} (routeName === ${JSON.stringify(t?E:"main")}) {
|
|
15
|
+
g.__stx_latestSetup = null;
|
|
16
|
+
${C.scripts.map((W)=>W.owner?` g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(W.owner)});
|
|
17
|
+
try {
|
|
18
|
+
${W.code}
|
|
19
|
+
}
|
|
20
|
+
finally { g.__STX_SETUP_ROOT__ = null; }`:W.code).join(`
|
|
21
|
+
`)}
|
|
22
|
+
}`).join(`
|
|
23
|
+
`),N=x&&l,_=g?Se("browser-screen"):null,B=g?Bun.resolveSync(g.platformModule,s):null;return`
|
|
24
|
+
import { installJSCGlobals } from ${JSON.stringify(c)};
|
|
25
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(d)};
|
|
26
|
+
${g?`import { createBrowserScreenBridge } from ${JSON.stringify(_)};
|
|
27
|
+
import { createBrowserPlatform } from ${JSON.stringify(B)};`:""}
|
|
28
|
+
${N?`import * as nativeAppModule from ${JSON.stringify(l)};`:"var nativeAppModule = null;"}
|
|
29
|
+
${g?"(async function() {":""}
|
|
30
|
+
var g = globalThis;
|
|
31
|
+
installJSCGlobals(g);
|
|
32
|
+
${g?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(g.platformOptions??{})});
|
|
33
|
+
var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(g)});
|
|
34
|
+
var bridge = browserBridge;
|
|
35
|
+
g.__stxNativeRoute = ${JSON.stringify(i)};`:"var bridge = g.__stxNativeBridge;"}
|
|
36
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
37
|
+
var routeNames = ${JSON.stringify(t?e:["main"])};
|
|
38
|
+
${h}
|
|
39
|
+
g.__stxNativeRoute = routeName;
|
|
40
|
+
var nativeDocument;
|
|
41
|
+
var manifest;
|
|
42
|
+
${k}
|
|
43
|
+
var screen = null;
|
|
44
|
+
var app = null;
|
|
45
|
+
if (isApp) {
|
|
46
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
47
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
51
|
+
g.__stx_host = screen.host;
|
|
52
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
53
|
+
}
|
|
54
|
+
${Me()}
|
|
55
|
+
var pageSetup = g.__stx_latestSetup;
|
|
56
|
+
var pageRuntimeSetup = g.stx && g.stx._latestSetup;
|
|
57
|
+
${T}
|
|
58
|
+
// The screen's setup is the native host's to run. A screen script publishes
|
|
59
|
+
// it where a page's document runtime adopts its own, and in a browser that
|
|
60
|
+
// runtime's DOMContentLoaded and stx:load ran it a second time: another copy
|
|
61
|
+
// of the screen, mounted beside this one. Take it, and hand the page back
|
|
62
|
+
// whatever setup it had.
|
|
63
|
+
var screenSetup = g.__stx_latestSetup || null;
|
|
64
|
+
g.__stx_latestSetup = pageSetup;
|
|
65
|
+
if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
|
|
66
|
+
if (isApp) app.start(nativeAppModule);
|
|
67
|
+
else screen.mount(g.stx, screenSetup);
|
|
68
|
+
${g?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
|
|
69
|
+
var unmount = g.__stxNativeUnmount;
|
|
70
|
+
var ended = false;
|
|
71
|
+
g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
|
|
72
|
+
g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
|
|
73
|
+
})().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(g.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
|
|
74
|
+
`},u=(v)=>({name:"stx-native-shared-screens",setup(x){x.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),x.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:v,loader:"js"}))}}),p=new Set(a.flatMap(({compiled:v})=>v.dependencies)),y=a.flatMap(({compiled:v})=>v.diagnostics).map((v)=>({level:"warning",message:[v.kind,v.tag,v.name].filter(Boolean).join(": ")})),S=r.minify??!1,b;if(r.routesDir){let v=F.resolve(s,r.routesDir);et(v,{recursive:!0});let x=[...a.map((h)=>({name:h.name,screens:[h],app:!1})),...l?[{name:G,screens:[],app:!0}]:[]];b={};for(let h=0;h<x.length;h+=6)await Promise.all(x.slice(h,h+6).map(async(k)=>{let T=F.join(v,`${k.name}.js`);await Bun.write(T,await tt("stx:native-shared-screens",[u(m(k.screens,k.app))],S,p)),b[k.name]=T}));if(!r.outFile)return{code:"",routes:b,diagnostics:y,dependencies:[...p]}}let f=await tt("stx:native-shared-screens",[u(m(a,!0))],S,p);if(!r.outFile)return{code:f,diagnostics:y,dependencies:[...p]};let w=F.resolve(s,r.outFile);return et(F.dirname(w),{recursive:!0}),await Bun.write(w,f),{code:f,outFile:w,...b?{routes:b}:{},diagnostics:y,dependencies:[...p]}}async function an(r,e={}){return ve({...e,screens:{main:r},routed:!1})}function rt(r,e={}){return an(r,e)}var it=["native.config.json","stx-native.config.json"];function dn(r=process.cwd(),e){let t=e?M.resolve(r,e):it.map((l)=>M.join(r,l)).find((l)=>ne(l));if(!t)return null;if(!ne(t))throw Error(`Native config not found: ${t}`);let i=JSON.parse(ln(t,"utf8")),s=Object.entries(i.screens??{});if(s.length===0)throw Error(`${M.basename(t)} must name at least one screen in "screens"`);let a={};for(let[l,g]of s){if(!/^[A-Z][\w-]*$/i.test(l))throw Error(`Invalid native screen name: ${l}`);if(typeof g!=="string"||!g.endsWith(".stx"))throw Error(`Screen ${l} must name a .stx file`);if(a[l]=M.resolve(M.dirname(t),g),!ne(a[l]))throw Error(`Screen ${l} not found: ${a[l]}`)}let c=i.initialScreen||s[0][0];if(!a[c])throw Error(`Initial screen ${c} is not in screens`);if(i.app!==void 0&&typeof i.app!=="string")throw Error(`"app" must name the app script's file`);let d=i.app?M.resolve(M.dirname(t),i.app):void 0;if(d&&!ne(d))throw Error(`App script not found: ${d}`);return{initialScreen:c,screens:a,file:t,...d?{app:d}:{}}}async function Cr(r,e={}){let t=M.resolve(e.cwd??process.cwd()),i=e.format??"ir";if(i!=="ir"&&i!=="bundle")throw Error(`Unknown compile format: ${i}. Expected ir or bundle.`);let s=r?null:dn(t,e.config);if(!r&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${it[0]}`);let a,c=[];if(i==="bundle"){let l=s?await ve({screens:s.screens,initialScreen:s.initialScreen,minify:e.minify,root:t,...s.app?{app:s.app}:{}}):await rt(M.resolve(t,r),{minify:e.minify});a=l.code,c=l.diagnostics}else{let l=async(m)=>{let u=await te(m);return c.push(...u.diagnostics.map((p)=>({level:"warning",message:[p.kind,p.tag,p.name].filter(Boolean).join(": ")}))),u.document},g=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([m,u])=>[m,await l(u)])))}:await l(M.resolve(t,r));a=JSON.stringify(g,null,2)}if(!e.output)return{output:a,diagnostics:c};let d=M.resolve(t,e.output);return cn(M.dirname(d),{recursive:!0}),await Bun.write(d,a),{output:a,written:d,diagnostics:c}}export{Cr as runNativeCompile};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,i,xn,
|
|
3
|
-
`:l==="t"?"\t":l;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[a+1]==="{")return null;s+=o}return s}var ue=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function et(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=xn(r);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=
|
|
2
|
+
import{t,i,xn,ur,Ce,c}from"./chunk-ydx3mfpp.js";import U from"path";function S(e,n,r,s=0){let a=0,o=s,l=null,u=0,p=!1;while(o<e.length){let d=e[o];if(l&&p){p=!1,o++;continue}if(l&&d==="\\"){p=!0,o++;continue}if(p=!1,(d==='"'||d==="'"||d==="`")&&!l){l=d,o++;continue}if(d===l&&l!=="`"){l=null,o++;continue}if(l==="`"&&d==="$"&&e[o+1]==="{"){u++,o+=2;continue}if(u>0&&d==="}"){u--,o++;continue}if(d==="`"&&l==="`"&&u===0){l=null,o++;continue}if(l){o++;continue}if(d===n)a++;else if(d===r){if(a--,a===0)return o}o++}return-1}function Ns(e,n){let r=[];n.lastIndex=0;let s;while((s=n.exec(e))!==null){let a=s.index,o=a+s[0].length-1,l=S(e,"(",")",o);if(l===-1){r.push({start:a,end:-1,args:"",call:e.slice(a,Math.min(e.length,a+80))}),n.lastIndex=o+1;continue}r.push({start:a,end:l+1,args:e.slice(o+1,l),call:e.slice(a,l+1)}),n.lastIndex=l+1}return r}function Ze(e,n,r,s){let a="",o=0;for(let l of Ns(e,n)){if(a+=e.slice(o,l.start),l.end===-1){a+=s(l.call),o=l.start;continue}a+=r(l.args,l.call),o=l.end}return a+e.slice(o)}function Qe(e){let n=[],r=0,s=null,a="";for(let o=0;o<e.length;o++){let l=e[o];if(s){if(a+=l,l==="\\"&&o+1<e.length){a+=e[++o];continue}if(l===s)s=null;continue}if(l==="'"||l==='"'||l==="`")s=l;else if(l==="("||l==="["||l==="{")r++;else if(l===")"||l==="]"||l==="}")r--;else if(l===","&&r===0){n.push(a.trim()),a="";continue}a+=l}if(a.trim())n.push(a.trim());return n}function O(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let s="";for(let a=1;a<n.length-1;a++){let o=n[a];if(o==="\\"&&a+1<n.length-1){let l=n[++a];s+=l==="n"?`
|
|
3
|
+
`:l==="t"?"\t":l;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[a+1]==="{")return null;s+=o}return s}var ue=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function et(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=xn(r);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=ur(n),o;try{o=c(r,Object.keys(a))(...Object.values(a))}catch(u){return{ok:!1,message:`the expression could not be evaluated: ${u instanceof Error?u.message:String(u)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let l=[...new Set(Ce(r))].filter((u)=>!ue.has(u)&&!(u in a)&&!(u in globalThis));if(l.length>0)return{ok:!1,message:`${l.map((p)=>`"${p}"`).join(", ")} ${l.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function ge(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function Se(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function V(e){if(!e)return"";return U.isAbsolute(e)?U.relative(process.cwd(),e)||e:e}function M(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function _(e,n,r,s,a=t.EVALUATION_ERROR){let o=s?` in ${V(s)}`:"";return console.warn(`[stx] ${M(n)}${o}: ${r}`),i(e,`${M(n)}: ${r}`,a)}function ar(e,n,r){let s=r?` in ${V(r)}`:"";console.warn(`[stx] ${M(e)}${s}: ${n}`)}function Ls(){return{afterOpen:[],beforeClose:[]}}function pe(e){return e.afterOpen.length>0||e.beforeClose.length>0}function Oi(e,n){if(!pe(n))return e;let r=n.afterOpen.join(""),s=n.beforeClose.join(""),a=e.lastIndexOf("</head>"),o=r?gn(e):null,l=s&&a!==-1?a:null;if(o===null&&l===null)return e;if(o!==null&&l!==null)return`${e.slice(0,o)}${r}${e.slice(o,l)}${s}${e.slice(l)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,l)}${s}${e.slice(l)}`}var K=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function gn(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;K.lastIndex=r;let s=K.exec(e);return s?r+s[0].length:r}var L="data-stx-color-mode-boot",F="__STX_COLOR_MODE__",de=new Set(["light","dark","auto","system"]),fe=new Set(["auto","system"]),ye=/^[a-z][\w:-]*$/i,be=/^[\w-]+$/;function Te(e){let n=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",s=e.darkClass===void 0?"dark":e.darkClass,a=e.attribute??null,o=e.autoValue??null,l=e.respectExisting===!0;if(typeof n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!de.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(s!==null&&(typeof s!=="string"||!be.test(s)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(s)}`);if(a!==null&&(typeof a!=="string"||!ye.test(a)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(a)}`);if(o!==null&&!fe.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(s===null&&a===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(l&&a===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:n,initialMode:r==="system"?"auto":r,darkClass:s,attribute:a,autoValue:o,respectExisting:l}}function ve(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function D(e={}){let n=Te(e),r=ve(n),s=`(function(){"use strict";var o=window.${F};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${F}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${L}>${s}</script>`}function mn(e,n={}){if(e.includes(L))return e;let r=N(e);if(r===null)return e;let s=D(n);return`${e.slice(0,r)}
|
|
4
4
|
${s}${e.slice(r)}`}var N=gn,Ee=new RegExp(`<script\\b[^>]*\\b${L}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),W=/<meta\b[^>]*\bcharset\b[^>]*>/gi,q=/<\/head>/gi;function xe(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return e;let r=n.index+n[0].length;q.lastIndex=r;let s=q.exec(e),a=s?s.index:e.length;W.lastIndex=r;let o=W.exec(e);if(!o||o.index>=a)return e;if(e.slice(r,o.index).trim()==="")return e;let l=o.index+o[0].length;return`${e.slice(0,r)}
|
|
5
|
-
${o[0]}${e.slice(r,o.index)}${e.slice(l,a)}${e.slice(a)}`}function
|
|
6
|
-
${n[0]}${s.slice(a)}`}var Y="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",w="data-stx-html-attrs",C="data-stx-html-class",G=/^[A-Za-z_:][\w:.-]*$/;function y(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function we(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ke(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function $e(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let s of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[s[1].toLowerCase()]=s[2]??s[3]??s[4]??"";return r}function k(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,s])=>`${r}="${y(String(s))}"`).join(" ")}function R(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function J(e){let n=k(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${R(e)}</script>`}function Re(e={},n="en"){let r=[],s=[],a="",o=n;for(let[u,p]of Object.entries(e||{})){if(p==null)continue;let d=u.trim();if(!G.test(d))continue;let f=d.toLowerCase();if(f==="lang"){o=String(p);continue}if(f==="class"){a=String(p).trim();continue}r.push(` ${d}="${y(String(p))}"`),s.push(d)}let l=` lang="${y(o)}"`;if(a)l+=` class="${y(a)}"`;if(l+=r.join(""),a)l+=` ${C}="${y(a)}"`;if(s.length)l+=` ${w}="${y(s.join(" "))}"`;return l}function
|
|
5
|
+
${o[0]}${e.slice(r,o.index)}${e.slice(l,a)}${e.slice(a)}`}function Di(e){return Ae(xe(e))}function Ae(e){let n=Ee.exec(e);if(!n)return e;let r=N(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let s=e.slice(0,n.index)+e.slice(n.index+n[0].length),a=N(s);if(a===null)return e;return`${s.slice(0,a)}
|
|
6
|
+
${n[0]}${s.slice(a)}`}var Y="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",w="data-stx-html-attrs",C="data-stx-html-class",G=/^[A-Za-z_:][\w:.-]*$/;function y(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function we(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ke(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function $e(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let s of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[s[1].toLowerCase()]=s[2]??s[3]??s[4]??"";return r}function k(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,s])=>`${r}="${y(String(s))}"`).join(" ")}function R(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function J(e){let n=k(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${R(e)}</script>`}function Re(e={},n="en"){let r=[],s=[],a="",o=n;for(let[u,p]of Object.entries(e||{})){if(p==null)continue;let d=u.trim();if(!G.test(d))continue;let f=d.toLowerCase();if(f==="lang"){o=String(p);continue}if(f==="class"){a=String(p).trim();continue}r.push(` ${d}="${y(String(p))}"`),s.push(d)}let l=` lang="${y(o)}"`;if(a)l+=` class="${y(a)}"`;if(l+=r.join(""),a)l+=` ${C}="${y(a)}"`;if(s.length)l+=` ${w}="${y(s.join(" "))}"`;return l}function Mi(e={},n={}){let r={...e,...n};if(e.class&&n.class){let s=e.class.split(/\s+/).filter(Boolean);for(let a of n.class.split(/\s+/).filter(Boolean))if(!s.includes(a))s.push(a);r.class=s.join(" ")}return r}function hn(e,n={}){if(!n||Object.keys(n).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let s={},a=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,l;while((l=o.exec(r[1]))!==null){let f=l[1];if(!(f in s))a.push(f);s[f]=l[2]??l[3]??l[4]??""}let u=[],p=[];for(let[f,h]of Object.entries(n)){if(h==null)continue;let m=f.trim();if(!G.test(m))continue;let A=m.toLowerCase();if(A==="class"){let E=(s.class||"").split(/\s+/).filter(Boolean);for(let x of String(h).split(/\s+/).filter(Boolean))if(!E.includes(x))E.push(x),u.push(x);if(!("class"in s))a.push("class");s.class=E.join(" ");continue}if(!(m in s))a.push(m);if(s[m]=String(h),A!=="lang")p.push(m)}if(u.length){if(!(C in s))a.push(C);s[C]=u.join(" ")}if(p.length){if(!(w in s))a.push(w);s[w]=p.join(" ")}let d=a.map((f)=>` ${f}="${y(s[f])}"`).join("");return e.replace(r[0],()=>`<html${d}>`)}function Ni(e){if(e.includes("data-stx-cloak"))return null;if(e.lastIndexOf("</head>")===-1)return null;return`${Y}
|
|
7
7
|
`}function Ie(e){let n=[],r=0;while(r<e.length){let o=e.slice(r),l=o.match(/^\s+/);if(l){r+=l[0].length;continue}if(o.startsWith("<!--")){let h=e.indexOf("-->",r);if(h===-1)break;r=h+3;continue}let u=o.match(/^<script\b[^>]*>/i);if(u){let h=e.toLowerCase().indexOf("</script>",r+u[0].length);if(h===-1)break;r=h+9;continue}let p=o.match(/^<link\b[^>]*>/i);if(p){n.push(p[0]),r+=p[0].length;continue}let d=o.match(/^<meta\b[^>]*>/i);if(d){n.push(d[0]),r+=d[0].length;continue}let f=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(f){n.push(f[0]),r+=f[0].length;continue}break}if(n.length===0)return{body:e,hoisted:n};let s="",a=0;while(a<e.length&&a<r){let o=e.slice(a),l=o.match(/^<link\b[^>]*>/i);if(l&&n.includes(l[0])){a+=l[0].length;continue}let u=o.match(/^<meta\b[^>]*>/i);if(u&&n.includes(u[0])){a+=u[0].length;continue}let p=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(p&&n.includes(p[0])){a+=p[0].length;continue}s+=e[a],a++}return s+=e.slice(r),{body:s,hoisted:n}}function _e(e,n={},r={}){let{title:s="stx App",lang:a="en",meta:o=[],link:l=[],script:u=[],headRaw:p="",htmlAttrs:d={},bodyClass:f="",bodyAttrs:h={}}=n,m=r.title||s,A=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],E=new Set(o.map(ke).filter(Boolean)),{body:x,hoisted:B}=Ie(e),te=new Set(B.flatMap((g)=>{let v=$e(g);return v?[ke(v)].filter(Boolean):[]})),ne=[...A.filter((g)=>!E.has(ke(g))),...o].filter((g)=>!te.has(ke(g))).map((g)=>` <meta ${k(g)}>`).join(`
|
|
8
8
|
`),re=l.map((g)=>` <link ${k(g)}>`).join(`
|
|
9
9
|
`),ie=u.map((g)=>{if(g.src)return` <script ${k(g,(v)=>v==="content")}></script>`;if(g.content)return` ${J(g)}`;return""}).filter(Boolean).join(`
|
|
@@ -17,8 +17,8 @@ ${le.join(`
|
|
|
17
17
|
${ce.join(`
|
|
18
18
|
`)}
|
|
19
19
|
</body>
|
|
20
|
-
</html>`}var H=/\s+/y,j=/<(script|style)\b[^>]*>/iy,Me=/<\/script>/gi,Oe=/<\/style>/gi,z=/<!DOCTYPE\b/iy,X=/<html[\s>]/iy;function Pt(e){let n=0;while(n<e.length){if(H.lastIndex=n,H.exec(e)){n=H.lastIndex;continue}if(e.startsWith("<!--",n)){let a=e.indexOf("-->",n);if(a===-1)return!1;n=a+3;continue}j.lastIndex=n;let s=j.exec(e);if(s){let a=s[1].toLowerCase()==="script"?Me:Oe;a.lastIndex=j.lastIndex;let o=a.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(z.lastIndex=n,z.test(e))return!0;return X.lastIndex=n,X.test(e)}return!1}function
|
|
20
|
+
</html>`}var H=/\s+/y,j=/<(script|style)\b[^>]*>/iy,Me=/<\/script>/gi,Oe=/<\/style>/gi,z=/<!DOCTYPE\b/iy,X=/<html[\s>]/iy;function Pt(e){let n=0;while(n<e.length){if(H.lastIndex=n,H.exec(e)){n=H.lastIndex;continue}if(e.startsWith("<!--",n)){let a=e.indexOf("-->",n);if(a===-1)return!1;n=a+3;continue}j.lastIndex=n;let s=j.exec(e);if(s){let a=s[1].toLowerCase()==="script"?Me:Oe;a.lastIndex=j.lastIndex;let o=a.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(z.lastIndex=n,z.test(e))return!0;return X.lastIndex=n,X.test(e)}return!1}function js(e){return Pt(e)}function Li(e,n={}){let r=e.lastIndexOf("</head>");if(r===-1)return e;let{meta:s=[],link:a=[],script:o=[],headRaw:l=""}=n,u=e.slice(0,r),p=[];for(let d of s){let f=ke(d);if(f&&u.includes(f))continue;p.push(` <meta ${k(d)}>`)}for(let d of a){if(d.href&&u.includes(`href="${d.href}"`))continue;p.push(` <link ${k(d)}>`)}for(let d of o)if(d.src){if(u.includes(`src="${d.src}"`))continue;p.push(` <script ${k(d,(f)=>f==="content")}></script>`)}else if(d.content){if(u.includes(R(d)))continue;p.push(` ${J(d)}`)}if(l&&!u.includes(l))p.push(` ${l}`);if(p.length===0)return e;return`${e.slice(0,r)}${p.join(`
|
|
21
21
|
`)}
|
|
22
|
-
${e.slice(r)}`}function yn(e,n={},r={},s){if(s??
|
|
23
|
-
`)}function
|
|
24
|
-
`,"")),headContent:n.trim()}}function
|
|
22
|
+
${e.slice(r)}`}function yn(e,n={},r={},s){if(s??js(e))return e;return _e(e,n,r)}var Ne=["og:","article:","book:","profile:","fb:","music:","video:"],Le=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function bn(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=De(e[0],n);if(typeof r!=="string")return r;let s;if(e.length===2){let o=He(e[1],n);if(typeof o!=="string")return o;s=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,l=n.openGraph,u=n[o]??(Se(l)?l[o]:void 0);s=u===void 0||u===null||typeof u==="object"?"":String(u)}if(!s)return{kind:"empty"};return{kind:"tag",tag:Ne.some((o)=>r.startsWith(o))?{property:r,content:s}:{name:r,content:s}}}function De(e,n){let r=O(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(Le.test(e.trim()))return e.trim();let s=et(e,n);if(!s.ok)return{kind:"error",message:`meta name: ${s.message}`,code:s.code};if(typeof s.value!=="string"||!s.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${ge(s.value)}`,code:t.TYPE_ERROR};return s.value}function He(e,n){let r=O(e);if(r!==null)return r;let s=et(e,n);if(!s.ok)return{kind:"error",message:s.message,code:s.code};let a=s.value;if(a===void 0||a===null||a===!1)return"";if(Array.isArray(a))return a.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof a==="object"&&!(a instanceof Date))return{kind:"error",message:`the content must be text, got ${ge(a)}`,code:t.TYPE_ERROR};return String(a)}var wn=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],cr=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],ee={links:"link",metas:"meta",scripts:"script",styles:"style"},Z=new Set,Q=new WeakMap;function P(e){if(Z.has(e))return;Z.add(e),console.warn(e)}function je(e,n){let r=Array.from({length:n.length+1},(s,a)=>a);for(let s=1;s<=e.length;s++){let a=r[0];r[0]=s;for(let o=1;o<=n.length;o++){let l=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,a+(e[s-1]===n[o-1]?0:1)),a=l}}return r[n.length]}function Pe(e,n){let r=e.toLowerCase(),s=n.find((p)=>p.toLowerCase()===r);if(s)return s;let a=ee[r];if(a&&n.includes(a))return a;let o,l=1/0;for(let p of n){let d=je(r,p.toLowerCase());if(d<l)o=p,l=d}let u=Math.min(e.length,o?.length??0)<=4?1:2;return l<=u?o:void 0}function me(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=Q.get(e);if(r)return r;let{known:s,source:a}=n,o=e;for(let l of Object.keys(e)){if(s.includes(l))continue;let u=ee[l];if(u&&s.includes(u)&&Array.isArray(e[l])){if(o===e)o={...e};let d=Array.isArray(o[u])?o[u]:[];o[u]=[...d,...e[l]],delete o[l],P(`[stx] ${a}.${l} is not a head key; reading it as ${a}.${u}. Rename it to \`${u}\`.`);continue}if(/^styles?$/.test(l)&&!s.includes("style")){P(`[stx] ${a}.${l} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=Pe(l,s);P(p?`[stx] ${a}.${l} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${a}.${l} is not a head key and is ignored. Known keys: ${s.join(", ")}.`)}return Q.set(e,o),o}var b={},Be=[],I={};function Bs(){return b}function fu(){return I}function gu(){b={},Be.length=0,I={}}function ji(e){b=he(b,me(e,{known:cr,source:"useHead()"}))}function he(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:[...e.meta||[],...n.meta||[]],link:[...e.link||[],...n.link||[]],script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function qc(e){ji(lr(e))}function lr(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,s=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(s)n.push({property:"og:description",content:s});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let a=e.twitterTitle??e.title,o=e.twitterDescription??e.description,l=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(a)n.push({name:"twitter:title",content:a});if(o)n.push({name:"twitter:description",content:o});if(l){n.push({name:"twitter:image",content:l});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let u=[];if(e.canonical)u.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:u}}function mu(e){if(I={...I,...e},e.title||e.description)qc({title:e.title,description:e.description})}function hu(e){let n=typeof e==="function"?e():e;ji({title:n})}function yu(e=b){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${T(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([s,a])=>`${s}="${T(a)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let s=Object.entries(r).filter(([a,o])=>o!==void 0).map(([a,o])=>`${a==="httpEquiv"?"http-equiv":a}="${T(String(o))}"`).join(" ");n.push(`<meta ${s}>`)}for(let r of e.link||[]){let s=Object.entries(r).filter(([a,o])=>o!==void 0).map(([a,o])=>`${a}="${T(String(o))}"`).join(" ");n.push(`<link ${s}>`)}for(let r of e.script||[]){let{content:s,...a}=r,o=Object.entries(a).filter(([l,u])=>u!==void 0).map(([l,u])=>{if(typeof u==="boolean")return u?l:"";return`${l}="${T(String(u))}"`}).filter(Boolean).join(" ");if(s)n.push(`<script ${o}>${R(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let s=r.type?` type="${r.type}"`:"";n.push(`<style${s}>${r.content}</style>`)}return n.join(`
|
|
23
|
+
`)}function bu(e=b){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${T(r)}"`).join(" ")}function wu(e=b){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${T(r)}"`).join(" ")}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function vu(e=b){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let s=document.querySelector(r);if(!s){if(s=document.createElement("meta"),n.name)s.setAttribute("name",n.name);if(n.property)s.setAttribute("property",n.property);document.head.appendChild(s)}s.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,s=document.querySelector(r);if(!s)s=document.createElement("link"),document.head.appendChild(s);for(let[a,o]of Object.entries(n))if(o!==void 0)s.setAttribute(a,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let s of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(s);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function xu(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(s,a)=>(n+=a.trim()+`
|
|
24
|
+
`,"")),headContent:n.trim()}}function Su(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,s,a,o)=>{let l=s?a:n[(o||"").trim()]??o,u=n.__stx_runtime_head??{};return n.__stx_runtime_head=he(u,{title:l}),""})}function ku(e,n,r=""){if(!e.includes("@meta"))return e;return Ze(e,/(?<![\w$@])@meta\s*\(/g,(s,a)=>{let o=bn(Qe(s),n);if(o.kind==="error")return _("Meta",a,o.message,r,o.code);if(o.kind==="tag"){let l=n.__stx_runtime_head??{};n.__stx_runtime_head=he(l,{meta:[o.tag]})}return""},(s)=>_("Meta",s,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{S,Ns,Ze,Qe,et,ge,Se,_,ar,Ls,Oi,gn,mn,Di,ke,Mi,hn,Ni,Pt,js,Li,yn,bn,wn,cr,me,Bs,fu,gu,ji,he,qc,lr,mu,hu,yu,bu,wu,vu,xu,Su,ku};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{X,es,ts,ac,kt,Jo,ns,Yo,Ld,Fe,rs,be}from"./chunk-f4jh9vrj.js";import"./chunk-pnag11c4.js";import"./chunk-vp31ff54.js";import{$i,s}from"./chunk-74xwzxwz.js";import"./chunk-tv784gv0.js";import"./chunk-rrj5m9xv.js";import"./chunk-rfnr4xz6.js";import"./chunk-36agnyhe.js";import"./chunk-sfwprq8q.js";import"./chunk-ydx3mfpp.js";import"./chunk-s12b57m9.js";import"./chunk-k7ht6tqe.js";import"./chunk-phzs239m.js";import"./chunk-1edvsndv.js";export{X as BROWSER_CORE_IMPORTS,ac as STX_AUTO_IMPORTS,es as extractAndStripCssImports,Fe as extractBridgeData,$i as findInterpolationEnd,Yo as generateAutoImportDestructuring,Ld as generateBrowserAutoImportDestructuring,rs as generateServerDataBridge,kt as injectBrowserCoreAutoImports,be as processClientScript,ns as referencesName,ts as renderVendorStyleTags,s as stripCommentsAndLiterals,Jo as transformAutoImports};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$t,Ec,Tc,$c,Rc,Ac,d,Pc,bs,Ic,hi,yi}from"./chunk-f4jh9vrj.js";import"./chunk-pnag11c4.js";import"./chunk-vp31ff54.js";import"./chunk-tv784gv0.js";import"./chunk-rrj5m9xv.js";import"./chunk-rfnr4xz6.js";import"./chunk-36agnyhe.js";import"./chunk-sfwprq8q.js";import"./chunk-ydx3mfpp.js";import"./chunk-s12b57m9.js";import"./chunk-k7ht6tqe.js";import"./chunk-phzs239m.js";import"./chunk-1edvsndv.js";export{$t as STX_ENGINE_BINDING_NAMES,bs as convertToCommonJS,hi as extractScriptFromTemplate,d as extractVariables,yi as hasVariables,Pc as isCompleteImport,Ac as isMissingBindingFailure,$c as isModuleResolutionFailure,Rc as isSyntaxFailure,Ic as splitDeclaration,Ec as stripTypeScript,Tc as withoutStxReferrer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ir,Or,Dr,wa,va,xa,ko,Sa,ka}from"./chunk-zd01r00t.js";export{Ir as ImageProcessorCache,ko as applyTransformations,wa as clearImageCache,Sa as generateResponsiveVariants,ka as generateSrcset,Or as getCachedImageResult,xa as optimizeImage,va as processImage,Dr as setCachedImageResult};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function
|
|
3
|
-
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
2
|
+
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function Ri(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
|
|
3
|
+
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function Ai(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Rs(m,e),{config:f,graph:m}}async function Rs(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function tr(e){return O(A(e))}function nr(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
|
|
4
|
+
`)}function Pi(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
|
|
5
|
+
export{Ri,Ai,Rs,tr,nr,Pi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function
|
|
3
|
-
export{
|
|
2
|
+
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Wc(o){return w.test(o)}async function $s(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Wc(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
|
|
3
|
+
export{Wc,$s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{Mt,
|
|
2
|
+
import{N,ue}from"./chunk-f4jh9vrj.js";import{fe,C,Ye}from"./chunk-rfnr4xz6.js";import{nt,Z,_e}from"./chunk-phzs239m.js";import{Ie,oe,T,ie,wo,Ar,vo,Lt}from"./chunk-jqefcghh.js";import{Zr}from"./chunk-79vdkvhf.js";import{jt}from"./chunk-jze68d0z.js";import K from"fs";import A from"path";var{serve:me}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var ee=Q(F.brotliCompress),te=Q(F.gzip),ne=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],re=["text/event-stream","multipart/x-mixed-replace"],se=1024;function ae(t){if(!t)return!1;let e=t.toLowerCase();if(re.some((o)=>e.startsWith(o)))return!1;return ne.some((o)=>e.startsWith(o))}function ce(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function pe(t){if(!t)return null;let e=ce(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function le(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=Y)break;H.delete(o),U-=r.length}}async function Mt(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ae(e.headers.get("content-type")))return e;let r=pe(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(a.length<(o.threshold??se))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await ee(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await te(a),le(g,l);if(l.length>=a.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}class G{now;entries=new N(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",T(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${oe(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await o();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",T(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return a();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):a()}}var de={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function al(t={}){let e=A.resolve(t.outputDir||".output"),o=t.port??3000,r=wo(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=jt(r.routeRules),f=new G,h=Zr(e,r.apiRoutes??[]),g=Bun.file(A.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?C(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let y=A.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Ye(i.html,m);b.set(n.pattern,i),v.set(n.pattern,_e(i.html)),E.set(n.pattern,ue(i.html));let X=A.join(e,n.fragmentPath);if(await Bun.file(X).exists()){let M=await Bun.file(X).text();k.set(n.pattern,m?Ye(M,m):M)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=Z(n.pattern,{page:!0});S.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let B=me({port:o,async fetch(n){return Mt(n,await fe(m??C(),async()=>{let i=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[i])return t.apiRoutes[i](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=A.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=A.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${A.sep}`))try{if(K.existsSync(u)&&K.statSync(u).isFile()){let R=A.extname(u).toLowerCase(),L=de[R]||"application/octet-stream",_=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let M=oe(n),w=null,q={};if(w=s.get(i)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let c=i.match(p);if(c){w=d,u.forEach((R,L)=>{q[R]=c[L+1]});break}}if(!w){let p=nt(i)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=a(i),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(M&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=k.get(w.pattern);if(c){let R=v.get(w.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...T(),...O.cache?{}:{"Cache-Control":Ie}}})}}let d=Ar(n.method),u=b.get(w.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=b.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...T(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:L,cookies:_,status:I,headers:D}=await Lt(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(L)return vo(L,_,D);if(R&&R.length>0){let{renderStreamingPage:P,streamToResponse:z}=await import("./chunk-pw9verqx.js"),j=new Headers({...T(),...D,"Cache-Control":"private, no-store"});for(let V of _??[])j.append("Set-Cookie",V);if(M&&!d){let V=_e(c);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",ue(c)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(P(M&&!d?ie(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",...T(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of _??[])x.append("Set-Cookie",P);for(let[P,z]of Object.entries(D??{}))x.set(P,z);if(x.set("Vary",T(x.get("Vary")).Vary),M&&!d){let P=_e(c);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",ue(c)?"true":"false"),x.set("X-STX-Layout",P.layout),x.set("X-STX-Layout-Group",P.group),new Response(ie(c,r.routerContainer||"main"),{status:I??u.status??200,headers:x})}return new Response(c,{status:I??u.status??200,headers:x})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
|
|
3
|
+
export{Mt,al};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ws,qs,nt,Z,_n,gr,En,mr,hr,Gc,Xc,Kc,Tn,Jc,Yc,Zc,Qc,Ki,Ji,Yi,Gs,Zi,el,rt,st,ot,it,at,ct,Ee,tl}from"./chunk-phzs239m.js";export{En as Router,Zc as abortNavigation,gr as bracketPathToRegex,rt as clearMiddleware,Ji as createClientCookieManager,at as createMiddlewareContext,it as createRouteLocation,Ki as createServerCookieManager,Yi as createStorageManager,Qc as defineMiddleware,Xc as defineRoute,Kc as defineRoutes,mr as findErrorPage,hr as formatRoutes,qs as generateRouteManifest,Ws as generateRouteTypes,Zi as getMiddleware,st as getMiddlewareNames,Ee as getRouterScript,tl as getRouterScriptDev,el as hasMiddleware,nt as isFileRequestPath,ot as loadMiddlewareFromDirectory,_n as matchRoute,Yc as navigateTo,Z as patternToRegex,Gs as registerMiddleware,Jc as resetRoutes,Tn as route,ct as runMiddleware,Gc as setAppUrl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function
|
|
2
|
+
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function od(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
|
|
3
3
|
<div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-async-loading" data-async-loading="${e}">
|
|
5
5
|
${c}
|
|
@@ -226,7 +226,7 @@ catch (error) {
|
|
|
226
226
|
loadComponent();
|
|
227
227
|
})();
|
|
228
228
|
</script>
|
|
229
|
-
`}function
|
|
229
|
+
`}function id(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function ad(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function cd(){return`
|
|
230
230
|
/* STX Async Component Styles */
|
|
231
231
|
.stx-async-component {
|
|
232
232
|
position: relative;
|
|
@@ -300,7 +300,7 @@ catch (error) {
|
|
|
300
300
|
background-size: 200% 100%;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}function
|
|
303
|
+
`}function ld(){return`
|
|
304
304
|
// STX Async Component Runtime
|
|
305
305
|
(function() {
|
|
306
306
|
if (typeof window === 'undefined') return;
|
|
@@ -355,4 +355,4 @@ catch (error) {
|
|
|
355
355
|
console.log('[stx] Async component runtime initialized');
|
|
356
356
|
})();
|
|
357
357
|
`}
|
|
358
|
-
export{
|
|
358
|
+
export{od,id,ad,cd,ld};
|