@stacksjs/stx 0.2.760 → 0.2.761

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.
Files changed (241) hide show
  1. package/dist/chunk-00nz3pas.js +2 -0
  2. package/dist/{chunk-3nxe5xmy.js → chunk-0fs9kx0h.js} +3 -3
  3. package/dist/{chunk-42hcspws.js → chunk-0kq0k4pg.js} +2 -2
  4. package/dist/chunk-0nynnmya.js +2 -0
  5. package/dist/{chunk-qw9kgzb3.js → chunk-0q5dm9r2.js} +5 -5
  6. package/dist/{chunk-f4gqzg1y.js → chunk-0wj31pqy.js} +2 -2
  7. package/dist/chunk-13v3vgb6.js +2 -0
  8. package/dist/chunk-18gazs55.js +2 -0
  9. package/dist/chunk-1a9h6r9f.js +2 -0
  10. package/dist/chunk-1p8t2ekg.js +2 -0
  11. package/dist/chunk-1rcntvgx.js +2 -0
  12. package/dist/chunk-1w5gtkd6.js +2 -0
  13. package/dist/{chunk-0y2zzqsq.js → chunk-23t9anc0.js} +76 -76
  14. package/dist/chunk-298gj90a.js +2 -0
  15. package/dist/{chunk-0ggwm837.js → chunk-2cbd1ew6.js} +101 -101
  16. package/dist/{chunk-h692k9xn.js → chunk-2typf9dh.js} +4 -4
  17. package/dist/chunk-2wnfqrv5.js +26 -0
  18. package/dist/chunk-2wq0h5ye.js +2 -0
  19. package/dist/{chunk-prej5pk6.js → chunk-2zd51tj4.js} +2 -2
  20. package/dist/chunk-2zg3jmy7.js +2 -0
  21. package/dist/{chunk-ztdjdxjt.js → chunk-319aez2f.js} +3 -3
  22. package/dist/{chunk-7g9vd5fv.js → chunk-37y8sg48.js} +2 -2
  23. package/dist/{chunk-j2mpqa4p.js → chunk-3csfmhg0.js} +2 -2
  24. package/dist/{chunk-jb1dk0w7.js → chunk-3mz088mb.js} +2 -2
  25. package/dist/chunk-3wxb7mfb.js +2 -0
  26. package/dist/{chunk-cehjp06v.js → chunk-42zqmcnc.js} +3 -3
  27. package/dist/{chunk-y8srg0q3.js → chunk-45g1w1ct.js} +3 -3
  28. package/dist/{chunk-89h4snzd.js → chunk-4833k99b.js} +2 -2
  29. package/dist/{chunk-jevd16gq.js → chunk-48g9wez2.js} +30 -30
  30. package/dist/{chunk-vtv7165t.js → chunk-4c0qcjac.js} +2 -2
  31. package/dist/{chunk-wz5m7ybz.js → chunk-4rxmxc1p.js} +2 -2
  32. package/dist/chunk-4tgn1frg.js +3 -0
  33. package/dist/chunk-5fg8hqq0.js +2 -0
  34. package/dist/chunk-5x0g7e9y.js +2 -0
  35. package/dist/{chunk-83ezv8yz.js → chunk-5yhv5eqq.js} +3 -3
  36. package/dist/{chunk-afj19nsj.js → chunk-61qh74q1.js} +5 -5
  37. package/dist/chunk-64pdwfef.js +177 -0
  38. package/dist/{chunk-94ymndc5.js → chunk-6fz2n9w6.js} +43 -43
  39. package/dist/chunk-72ns4q88.js +2 -0
  40. package/dist/chunk-7fwcnech.js +2 -0
  41. package/dist/{chunk-g4e6egrr.js → chunk-7y1rpd4g.js} +8 -8
  42. package/dist/chunk-7z2mebp5.js +2 -0
  43. package/dist/chunk-803qm5tk.js +2 -0
  44. package/dist/chunk-86cg9qqm.js +2 -0
  45. package/dist/{chunk-gs6wc7sr.js → chunk-89801pjp.js} +5 -5
  46. package/dist/chunk-8h5mqs28.js +2 -0
  47. package/dist/chunk-8jh2b5k2.js +2 -0
  48. package/dist/{chunk-yp6w740k.js → chunk-8rk79ha1.js} +2 -2
  49. package/dist/{chunk-hfbzfrpv.js → chunk-8vs5y4h7.js} +14 -14
  50. package/dist/{chunk-kpr09x3g.js → chunk-8y54tpbr.js} +7 -7
  51. package/dist/{chunk-s4y26fk6.js → chunk-8yyq3nfg.js} +2 -2
  52. package/dist/chunk-927ta2dn.js +2 -0
  53. package/dist/chunk-940wny2b.js +2 -0
  54. package/dist/{chunk-m220n98m.js → chunk-98t1cv8x.js} +2 -2
  55. package/dist/{chunk-sgm6tg8h.js → chunk-9k8ztdcc.js} +2 -2
  56. package/dist/{chunk-n7s4n62j.js → chunk-9nhyq39s.js} +3 -3
  57. package/dist/{chunk-n8s5301s.js → chunk-aa1y9j3p.js} +2 -2
  58. package/dist/chunk-ad9dt9rk.js +2 -0
  59. package/dist/chunk-ak4w2emd.js +2 -0
  60. package/dist/{chunk-tb56j1zt.js → chunk-ak93e1zz.js} +5 -5
  61. package/dist/{chunk-jt28zh50.js → chunk-b0z2n941.js} +2 -2
  62. package/dist/{chunk-xgegyttg.js → chunk-b51p56k5.js} +2 -2
  63. package/dist/{chunk-r4sawwmp.js → chunk-b7x8b83z.js} +1 -1
  64. package/dist/chunk-b8dtz3v8.js +2 -0
  65. package/dist/{chunk-q9npggak.js → chunk-bjhesw78.js} +8 -8
  66. package/dist/{chunk-w8p1y4c0.js → chunk-bvctccab.js} +4 -4
  67. package/dist/chunk-c5tkxjb0.js +2 -0
  68. package/dist/{chunk-hk98vptc.js → chunk-cdcrd33m.js} +2 -2
  69. package/dist/chunk-cgh0k52q.js +2 -0
  70. package/dist/chunk-ctdw7fh4.js +2 -0
  71. package/dist/{chunk-asp7ett1.js → chunk-dnsf934e.js} +9 -9
  72. package/dist/{chunk-7r7j7vwt.js → chunk-ds6mbfdq.js} +3 -3
  73. package/dist/chunk-e2q79dfs.js +2 -0
  74. package/dist/chunk-e5vn76f5.js +2 -0
  75. package/dist/{chunk-9s1qnf90.js → chunk-eb6p3p62.js} +2 -2
  76. package/dist/chunk-emhbj3xd.js +2 -0
  77. package/dist/{chunk-3cn9y08d.js → chunk-evxp3wmv.js} +7 -7
  78. package/dist/{chunk-z8k3fx4r.js → chunk-f8p8ggvw.js} +4 -4
  79. package/dist/chunk-fjfrgef4.js +2 -0
  80. package/dist/chunk-fke4s0kk.js +33 -0
  81. package/dist/{chunk-30j6mbrf.js → chunk-frybxj35.js} +7 -7
  82. package/dist/{chunk-4s9kytdz.js → chunk-fxmc5006.js} +2 -2
  83. package/dist/chunk-fxnk5ee8.js +2 -0
  84. package/dist/chunk-fys1patf.js +2 -0
  85. package/dist/{chunk-6ts3sthp.js → chunk-g4k0svq6.js} +2 -2
  86. package/dist/chunk-g9efdc5v.js +2 -0
  87. package/dist/chunk-gpvfswgj.js +2 -0
  88. package/dist/chunk-hnen9b45.js +2 -0
  89. package/dist/chunk-jacb7aw1.js +2 -0
  90. package/dist/{chunk-4zw118tn.js → chunk-jgk5j35w.js} +4 -4
  91. package/dist/{chunk-7v2srnpv.js → chunk-jn78c13y.js} +10 -10
  92. package/dist/chunk-jq1698j4.js +2 -0
  93. package/dist/{chunk-pwmkhs7z.js → chunk-jyp2mmts.js} +2 -2
  94. package/dist/{chunk-eazvp48w.js → chunk-jzajpmke.js} +7 -7
  95. package/dist/chunk-k0jkpw0q.js +2 -0
  96. package/dist/{chunk-3kfbs0mw.js → chunk-k2ex94n8.js} +1 -1
  97. package/dist/{chunk-m00c7sh0.js → chunk-k9247v28.js} +1 -1
  98. package/dist/chunk-kdqnest3.js +2 -0
  99. package/dist/{chunk-xsf7ax50.js → chunk-kj9m0vc6.js} +3 -3
  100. package/dist/chunk-krsg6dgz.js +3 -0
  101. package/dist/chunk-m5740sd3.js +2 -0
  102. package/dist/{chunk-myynywry.js → chunk-mdvtermb.js} +2 -2
  103. package/dist/chunk-mebf9vwb.js +2 -0
  104. package/dist/chunk-nm2r4se1.js +2 -0
  105. package/dist/chunk-p2j38381.js +2 -0
  106. package/dist/{chunk-5vmbycy5.js → chunk-p88yh4wt.js} +2 -2
  107. package/dist/{chunk-fjxhga6w.js → chunk-pqbxa0r7.js} +2 -2
  108. package/dist/chunk-q245q8z1.js +2 -0
  109. package/dist/{chunk-5q9ss7ty.js → chunk-q3azy64b.js} +4 -4
  110. package/dist/chunk-qm3jbse5.js +2 -0
  111. package/dist/{chunk-rcfmwx8r.js → chunk-qx0np0hy.js} +2 -2
  112. package/dist/{chunk-qwsgc5rc.js → chunk-qystt1qc.js} +1 -1
  113. package/dist/{chunk-ej1jkt9a.js → chunk-qyzjkvme.js} +6 -6
  114. package/dist/chunk-r13fwtas.js +2 -0
  115. package/dist/{chunk-dh9aagwm.js → chunk-r1tp2gnr.js} +1 -1
  116. package/dist/chunk-r5tsewzd.js +2 -0
  117. package/dist/{chunk-vvc39v6p.js → chunk-r6yb0540.js} +5 -5
  118. package/dist/{chunk-pes27snj.js → chunk-r8zhed35.js} +3 -3
  119. package/dist/{chunk-hmydy949.js → chunk-rh2qth8r.js} +5 -5
  120. package/dist/chunk-rha8sv1h.js +3 -0
  121. package/dist/{chunk-vh1d5eqk.js → chunk-t2cq4bpe.js} +6 -6
  122. package/dist/chunk-tfy1m821.js +2 -0
  123. package/dist/{chunk-465resq9.js → chunk-tpfxvw4q.js} +17 -17
  124. package/dist/{chunk-t6qn1374.js → chunk-tshpcvcy.js} +2 -2
  125. package/dist/{chunk-xabs41cv.js → chunk-ttqs99jj.js} +2 -2
  126. package/dist/chunk-v1ff2dfp.js +7 -0
  127. package/dist/chunk-vc3ppphz.js +2 -0
  128. package/dist/{chunk-q49ykyq9.js → chunk-vv8dn70r.js} +14 -14
  129. package/dist/{chunk-3m9vrhja.js → chunk-vvs28yqw.js} +8 -8
  130. package/dist/chunk-w2pch5xn.js +4 -0
  131. package/dist/chunk-w512gnft.js +2 -0
  132. package/dist/{chunk-j4snweyz.js → chunk-wby7qzha.js} +3 -3
  133. package/dist/{chunk-bsgg8zzk.js → chunk-wghtdgwj.js} +2 -2
  134. package/dist/chunk-wk8y89q2.js +25 -0
  135. package/dist/{chunk-19safa6y.js → chunk-wmnzapn8.js} +2 -2
  136. package/dist/chunk-wmxsaxt0.js +2 -0
  137. package/dist/chunk-wq1vs94k.js +2 -0
  138. package/dist/chunk-wwnqbv9j.js +3 -0
  139. package/dist/{chunk-rprewgyj.js → chunk-wycrtkw4.js} +6 -6
  140. package/dist/chunk-x1q7b7jg.js +2 -0
  141. package/dist/chunk-x1x69g3s.js +2 -0
  142. package/dist/{chunk-gs373714.js → chunk-x5seqmrv.js} +2 -2
  143. package/dist/{chunk-frk6rzrq.js → chunk-x7q4tp3f.js} +4 -4
  144. package/dist/{chunk-bsq9zg9j.js → chunk-xt034729.js} +6 -6
  145. package/dist/chunk-y5emxzbt.js +2 -0
  146. package/dist/chunk-y6mqq78g.js +2 -0
  147. package/dist/{chunk-v5afjcy3.js → chunk-yh5658q8.js} +1 -1
  148. package/dist/{chunk-2qz891k4.js → chunk-yhbsvf65.js} +10 -10
  149. package/dist/{chunk-se28p2xy.js → chunk-yjzk7rwt.js} +6 -6
  150. package/dist/chunk-yn3kff5k.js +2 -0
  151. package/dist/chunk-ynjm2tm0.js +2 -0
  152. package/dist/chunk-yp80rx17.js +2 -0
  153. package/dist/chunk-z5xermzg.js +2 -0
  154. package/dist/{chunk-j04v4rgf.js → chunk-zhrz4zvw.js} +5 -5
  155. package/dist/cli.js +20 -20
  156. package/dist/composable-loader.d.ts +1 -1
  157. package/dist/composable-loader.js +47 -10
  158. package/dist/craft-entry.js +2 -2
  159. package/dist/craft.js +2 -2
  160. package/dist/message-catalogs.d.ts +39 -0
  161. package/dist/message-catalogs.js +128 -0
  162. package/dist/native/compiler/bundle.js +3 -33
  163. package/dist/process.d.ts +1 -1
  164. package/dist/process.js +87 -22
  165. package/dist/pwa.js +3 -3
  166. package/dist/ssg.js +14 -14
  167. package/dist/store-loader.d.ts +27 -3
  168. package/dist/store-loader.js +115 -10
  169. package/dist/types/config-types.d.ts +1 -0
  170. package/package.json +5 -5
  171. package/dist/chunk-0b7f2mby.js +0 -2
  172. package/dist/chunk-0j7e56zm.js +0 -2
  173. package/dist/chunk-1khg5vjs.js +0 -2
  174. package/dist/chunk-3h2yz805.js +0 -2
  175. package/dist/chunk-3kmwgpm1.js +0 -2
  176. package/dist/chunk-3wfewscj.js +0 -2
  177. package/dist/chunk-4tz00fkp.js +0 -2
  178. package/dist/chunk-52q8184e.js +0 -2
  179. package/dist/chunk-59ytzyp1.js +0 -2
  180. package/dist/chunk-5e2ez5n0.js +0 -2
  181. package/dist/chunk-6ndeycxk.js +0 -2
  182. package/dist/chunk-75r09rqt.js +0 -2
  183. package/dist/chunk-76679dw7.js +0 -33
  184. package/dist/chunk-7h5d35bf.js +0 -2
  185. package/dist/chunk-7kac7hdw.js +0 -2
  186. package/dist/chunk-7nz28a6c.js +0 -16
  187. package/dist/chunk-82ybmdqk.js +0 -2
  188. package/dist/chunk-8av44gw2.js +0 -2
  189. package/dist/chunk-8frs2dtp.js +0 -2
  190. package/dist/chunk-8prq9t3b.js +0 -2
  191. package/dist/chunk-8sxngenk.js +0 -2
  192. package/dist/chunk-9epeb4sn.js +0 -2
  193. package/dist/chunk-9zmb7dcv.js +0 -2
  194. package/dist/chunk-abs1k04e.js +0 -2
  195. package/dist/chunk-akgt21vw.js +0 -2
  196. package/dist/chunk-b561wv5x.js +0 -2
  197. package/dist/chunk-bfdd0nmc.js +0 -2
  198. package/dist/chunk-c05r0rzw.js +0 -3
  199. package/dist/chunk-c7yjhjr2.js +0 -2
  200. package/dist/chunk-c9xq89nt.js +0 -2
  201. package/dist/chunk-cpep999n.js +0 -2
  202. package/dist/chunk-cr7mn65s.js +0 -2
  203. package/dist/chunk-dqs4bgec.js +0 -2
  204. package/dist/chunk-e30kgg28.js +0 -2
  205. package/dist/chunk-e3fkq9gb.js +0 -2
  206. package/dist/chunk-e9kajy9a.js +0 -2
  207. package/dist/chunk-eab8na0z.js +0 -2
  208. package/dist/chunk-ec5q50ve.js +0 -2
  209. package/dist/chunk-ec8gn2m0.js +0 -2
  210. package/dist/chunk-ex2397dc.js +0 -2
  211. package/dist/chunk-exg7ry7b.js +0 -2
  212. package/dist/chunk-f4j42tsg.js +0 -2
  213. package/dist/chunk-fj105fff.js +0 -2
  214. package/dist/chunk-gk775pcy.js +0 -177
  215. package/dist/chunk-ha6tr22a.js +0 -2
  216. package/dist/chunk-htc7pasb.js +0 -2
  217. package/dist/chunk-jfvr1135.js +0 -2
  218. package/dist/chunk-k3wnmpt3.js +0 -2
  219. package/dist/chunk-kb8654dp.js +0 -4
  220. package/dist/chunk-kfqdx75m.js +0 -2
  221. package/dist/chunk-mmdfjmgk.js +0 -25
  222. package/dist/chunk-mreh1t5x.js +0 -2
  223. package/dist/chunk-n839v6az.js +0 -2
  224. package/dist/chunk-ptzzpf97.js +0 -2
  225. package/dist/chunk-py7g5hxd.js +0 -2
  226. package/dist/chunk-qgsrxyh9.js +0 -2
  227. package/dist/chunk-qmxcs806.js +0 -2
  228. package/dist/chunk-qvcs4f4v.js +0 -2
  229. package/dist/chunk-qz9fzz5k.js +0 -2
  230. package/dist/chunk-rh90yh1c.js +0 -2
  231. package/dist/chunk-s0wst4wj.js +0 -2
  232. package/dist/chunk-sj5t0tnv.js +0 -2
  233. package/dist/chunk-stddpecv.js +0 -2
  234. package/dist/chunk-t4mpq6t0.js +0 -3
  235. package/dist/chunk-tb6jcr2v.js +0 -2
  236. package/dist/chunk-tdjw105v.js +0 -2
  237. package/dist/chunk-tn40nh9e.js +0 -3
  238. package/dist/chunk-tp2g09ca.js +0 -3
  239. package/dist/chunk-wpgq0tq4.js +0 -2
  240. package/dist/chunk-yme43vbp.js +0 -2
  241. package/dist/chunk-zg5xh20b.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{W,Oe}from"./chunk-0ggwm837.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Yt(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Oe(t,s);if(p>s){c=p;continue}let a=W(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
- export{Yt};
2
+ import{W,Ne}from"./chunk-2cbd1ew6.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Zt(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Ne(t,s);if(p>s){c=p;continue}let a=W(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
+ export{Zt};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{kc,r,fe}from"./chunk-0ggwm837.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-c05r0rzw.js";import o from"fs";import u from"path";var Rf=new Map,m=new Map;async function bh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){n=s;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function vh(e){m.delete(e)}function wh(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function xh(e){x=e}async function Af(e=!1){let t=x??await import("./chunk-n839v6az.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function Pf(){if(S===null){let{getRouterScript:e}=await import("./chunk-e3fkq9gb.js");S=e()}return S}var y={};async function Sh(e,t=!1){let n=e==="runtime"?await Af(t):await Pf(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==n)s={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:n,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function kh(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let s=c.keys().next().value;p-=c.get(s).length*2,c.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(u.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function zo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function _h(){m.clear(),fe(),kc(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function ar(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${gs(e)}.html`),s=u.join(n,`${gs(e)}.meta.json`);if(!await r(i)||!await r(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==et())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await r(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function cr(e,t,n,i){try{if(!i.cachePath)return;let s=u.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=u.join(s,`${gs(e)}.html`),a=u.join(s,`${gs(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:et(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Rf.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function gs(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
- export{Rf,bh,vh,wh,xh,Af,Pf,Sh,kh,zo,_h,ar,cr,gs};
2
+ import{_c,r,fe}from"./chunk-2cbd1ew6.js";import{tt}from"./chunk-3csfmhg0.js";import{l}from"./chunk-4tgn1frg.js";import o from"fs";import u from"path";var Af=new Map,m=new Map;async function Eh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){n=s;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function Th(e){m.delete(e)}function $h(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function Rh(e){x=e}async function Pf(e=!1){let t=x??await import("./chunk-18gazs55.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function If(){if(S===null){let{getRouterScript:e}=await import("./chunk-8h5mqs28.js");S=e()}return S}var y={};async function Ah(e,t=!1){let n=e==="runtime"?await Pf(t):await If(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==n)s={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:n,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function Ph(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let s=c.keys().next().value;p-=c.get(s).length*2,c.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(u.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function Vo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function Ih(){m.clear(),fe(),_c(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function cr(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${ms(e)}.html`),s=u.join(n,`${ms(e)}.meta.json`);if(!await r(i)||!await r(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==tt())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await r(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function lr(e,t,n,i){try{if(!i.cachePath)return;let s=u.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=u.join(s,`${ms(e)}.html`),a=u.join(s,`${ms(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:tt(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Af.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function ms(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
+ export{Af,Eh,Th,$h,Rh,Pf,If,Ah,Ph,Vo,Ih,cr,lr,ms};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import i from"path";var ln=".stx",o="STX_DIR",e=null;function Sc(t){e=t?.trim()||null}function gr(){return process.env[o]?.trim()||e||ln}function l(t=process.cwd(),...n){let r=gr();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function mr(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==ln&&!n.startsWith(`${ln}/`))return t;let r=n.slice(ln.length+1);return r?i.join(gr(),r):gr()}
3
+ export{ln,Sc,gr,l,mr};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{va,xa,Sa,ka,fh}from"./chunk-8vs5y4h7.js";import"./chunk-48g9wez2.js";import"./chunk-0q5dm9r2.js";import"./chunk-r8zhed35.js";import"./chunk-23t9anc0.js";import"./chunk-7y1rpd4g.js";import"./chunk-b0z2n941.js";import"./chunk-wk8y89q2.js";import"./chunk-yhbsvf65.js";import"./chunk-bjhesw78.js";import"./chunk-krsg6dgz.js";import"./chunk-9k8ztdcc.js";import"./chunk-vvs28yqw.js";import"./chunk-frybxj35.js";import"./chunk-k2ex94n8.js";import"./chunk-4rxmxc1p.js";import"./chunk-vv8dn70r.js";import"./chunk-kj9m0vc6.js";import"./chunk-8rk79ha1.js";import"./chunk-q3azy64b.js";import"./chunk-evxp3wmv.js";import"./chunk-f8p8ggvw.js";import"./chunk-2cbd1ew6.js";import"./chunk-wghtdgwj.js";import"./chunk-x5seqmrv.js";import"./chunk-tpfxvw4q.js";import"./chunk-4833k99b.js";import"./chunk-b51p56k5.js";export{va as buildNative,fh as default,xa as findCraftBinary,ka as getAvailableFormats,Sa as getAvailableTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ul,Wl,ql,Kl,Gl,Xl,Jl,Yl,Zl,Ql,ym}from"./chunk-xt034729.js";export{Ul as createIslandRegistry,ym as default,Ql as generateIslandManifest,ql as generatePartialHydrationCSS,Xl as hydrateAll,Gl as hydrateByStrategy,Kl as hydrateIsland,Jl as isHydrated,Yl as onHydrated,Wl as processPartialHydrationDirectives,Zl as processStaticDirectives};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function Ve(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function Cn(e){if(e.entries.length===0)return"[]";return`[
2
+ import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function Ue(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function En(e){if(e.entries.length===0)return"[]";return`[
3
3
  ${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
4
4
  `)}
5
- ]`}function Ei(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
- export{Ve,Cn,Ei};
5
+ ]`}function $i(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
+ export{Ue,En,$i};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{ue}from"./chunk-z8k3fx4r.js";import{Fe,O}from"./chunk-gs373714.js";import{gc}from"./chunk-5q9ss7ty.js";import{l}from"./chunk-c05r0rzw.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function rn(s,c={}){let o=m.resolve(s,c.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let p=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=p.pop(),u=n.lastIndexOf("."),d=u>=0?n.slice(u+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(u>=0)n=n.slice(0,u);if(n!=="index")p.push(n);let r=new Set,h=p.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==p.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,a)=>{let p=e.pattern.split("/"),n=a.pattern.split("/"),u=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(p.length,n.length);d++){let g=u(n[d])-u(p[d]);if(g)return g}return e.pattern.localeCompare(a.pattern)||e.method.localeCompare(a.method)})}async function ko(s,c){let o=l(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of c){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:a}=ue(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${a.map((p)=>`${JSON.stringify(p)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
3
- `);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function _o(s,c,o={}){let i=rn(s,o);await ko(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
4
- `)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(c,n),a),f.push({...t,filePath:n})}return f}function E(s,c){let o=s.map((i)=>({route:i,...ue(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await c(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Co(s,c){return E(c,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function ch(s,c){if(!c)return async()=>null;let o=c===!0?{}:c,i=rn(s,o);return await ko(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=rn(s,o);await ko(s,t);let{loadStxConfig:e}=await import("./chunk-c9xq89nt.js"),a=O((await e(s)).runtimeConfig);return await Fe(a,()=>E(t,async(p)=>{let n=await Bun.build({entrypoints:[p.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
5
- `));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function Eo(s,c,o){if(gc(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(c,typeof o==="object"?o.dir??"server/api":"server/api"),t=(a)=>{try{return v.realpathSync(a)}catch{return m.resolve(a)}},e=t(s);return[f,m.resolve(c,"server"),m.resolve(c,".output/server")].some((a)=>{let p=t(a);return e===p||e.startsWith(`${p}${m.sep}`)})}
6
- export{rn,ko,_o,Co,ch,Eo};
2
+ import{ue}from"./chunk-f8p8ggvw.js";import{ze,O}from"./chunk-x5seqmrv.js";import{mc}from"./chunk-q3azy64b.js";import{l}from"./chunk-4tgn1frg.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function sn(s,c={}){let o=m.resolve(s,c.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let p=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=p.pop(),u=n.lastIndexOf("."),d=u>=0?n.slice(u+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(u>=0)n=n.slice(0,u);if(n!=="index")p.push(n);let r=new Set,h=p.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==p.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,a)=>{let p=e.pattern.split("/"),n=a.pattern.split("/"),u=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(p.length,n.length);d++){let g=u(n[d])-u(p[d]);if(g)return g}return e.pattern.localeCompare(a.pattern)||e.method.localeCompare(a.method)})}async function Co(s,c){let o=l(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of c){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:a}=ue(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${a.map((p)=>`${JSON.stringify(p)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
3
+ `);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function Eo(s,c,o={}){let i=sn(s,o);await Co(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
4
+ `)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(c,n),a),f.push({...t,filePath:n})}return f}function E(s,c){let o=s.map((i)=>({route:i,...ue(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await c(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function To(s,c){return E(c,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function hh(s,c){if(!c)return async()=>null;let o=c===!0?{}:c,i=sn(s,o);return await Co(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=sn(s,o);await Co(s,t);let{loadStxConfig:e}=await import("./chunk-emhbj3xd.js"),a=O((await e(s)).runtimeConfig);return await ze(a,()=>E(t,async(p)=>{let n=await Bun.build({entrypoints:[p.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
5
+ `));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function $o(s,c,o){if(mc(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(c,typeof o==="object"?o.dir??"server/api":"server/api"),t=(a)=>{try{return v.realpathSync(a)}catch{return m.resolve(a)}},e=t(s);return[f,m.resolve(c,"server"),m.resolve(c,".output/server")].some((a)=>{let p=t(a);return e===p||e.startsWith(`${p}${m.sep}`)})}
6
+ export{sn,Co,Eo,To,hh,$o};
@@ -0,0 +1,177 @@
1
+ // @bun
2
+ import"./chunk-tpfxvw4q.js";import{Ks,Ei,pl}from"./chunk-b51p56k5.js";import"./chunk-4833k99b.js";import"./chunk-2cbd1ew6.js";import"./chunk-x5seqmrv.js";import"./chunk-wghtdgwj.js";import"./chunk-8rk79ha1.js";import"./chunk-f8p8ggvw.js";import{a}from"./chunk-vv8dn70r.js";import"./chunk-evxp3wmv.js";import"./chunk-q3azy64b.js";import"./chunk-4rxmxc1p.js";import{yt,Ke,ye,on,Ae,tr,nr,Ge}from"./chunk-7y1rpd4g.js";import{i}from"./chunk-23t9anc0.js";import"./chunk-bjhesw78.js";import"./chunk-yhbsvf65.js";import{ps}from"./chunk-vvs28yqw.js";import"./chunk-wk8y89q2.js";import"./chunk-b0z2n941.js";import{mt}from"./chunk-jzajpmke.js";import"./chunk-wmnzapn8.js";import"./chunk-61qh74q1.js";import{es}from"./chunk-x7q4tp3f.js";import{Mr}from"./chunk-v1ff2dfp.js";import{Dr,Qs,eo}from"./chunk-qyzjkvme.js";import"./chunk-krsg6dgz.js";import"./chunk-9k8ztdcc.js";import"./chunk-frybxj35.js";import"./chunk-k2ex94n8.js";import"./chunk-kj9m0vc6.js";import{existsSync as _e,mkdirSync as Di,readFileSync as Li}from"fs";import G from"path";import{existsSync as En,mkdirSync as Rn,realpathSync as Ti,rmSync as _n}from"fs";import H from"path";import{existsSync as ui}from"fs";import Z from"path";var Cn="data-stx-b",ft=new Set(Ei),Pn=new Set(Ks);function Oe(e){if(e==="ref"||e==="data-stx-ref")return"ref";if(e.startsWith("::"))return null;if(e.startsWith("@bind:")||e.startsWith("x-bind:"))return"attr";if(e.startsWith("@")||e.startsWith(":")){let t=e.slice(1).split(".")[0];if(ft.has(t))return t==="if"?"if":t;if(t==="for"||t==="else"||t==="else-if"||t==="elseif")return"for";if(pl(t))return"event";if(e.startsWith("@"))return"event";return"attr"}if(e.startsWith("x-")){let t=e.split(".")[0];if(!Pn.has(t))return"attr";let n=t.slice(2);if(n==="cloak"||n==="data"||n==="bind")return null;if(n==="tooltip"||n==="tooltip-position")return null;return ft.has(n)?n==="if"?"if":n:"attr"}return null}function Mn(e){let t=[];for(let[n,r]of e){let s=Oe(n);if(s)t.push({name:n,value:r,kind:s})}return t}var Bn=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,Ee=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function pt(e){let t=[],n=0;return{html:e.replace(Bn,(s,o,c)=>{if(!c||!/[:@]|x-/.test(c))return s;let l=[];Ee.lastIndex=0;for(let m=Ee.exec(c);m;m=Ee.exec(c))l.push([m[1],m[2]??m[3]??m[4]??""]);let d=Mn(l);if(!d.length)return s;let p={id:n++,bindings:d};if(d.some((m)=>m.kind==="for"))p.template=!0;t.push(p);let h=s.endsWith("/>");return`${s.slice(0,h?-2:-1).trimEnd()} ${Cn}="${p.id}"${h?"/>":">"}`}),manifest:{entries:t}}}import xr from"path";function fe(e){let t=e&&/^(\d+(?:\.\d+)?|\.\d+)(px|rem)?$/.exec(e.trim());if(!t)return;let n=Number(t[1])*(t[2]==="rem"?16:1);return Number.isFinite(n)?n:void 0}function Ie(e,t){if(!ye[e])return;return fe(t?.get(on(e))??ye[e].value)}function Ce(e,t){let n=tr[e];if(!n)return;return fe(t?.get(Ge(n))??Ae[n]?.value)}function Pe(e,t){let n=nr[e];if(!n)return;let r=fe(t?.get(Ge(n.size))??Ae[n.size]?.value),s=fe(t?.get(Ge(n.leading))??Ae[n.leading]?.value);if(r===void 0||s===void 0)return;return{fontSize:r,lineHeight:s}}var Dn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},vt=Be({}),gt,ht=null;function pe(){let e=globalThis.__stxNativeStyleConfig;if(!e)return vt;if(e!==gt)gt=e,ht=Be(e);return ht}function St(e,t=new Map,n=""){for(let[r,s]of Object.entries(e??{})){let o=r==="DEFAULT"?n.replace(/-$/,""):`${n}${r}`;if(typeof s==="string")t.set(o,s);else if(s&&typeof s==="object")St(s,t,`${o}-`)}return t}function wt(e){let t={};for(let[n,r]of Object.entries(e??{})){let s=typeof r==="number"?r:Number.parseFloat(String(r));if(Number.isFinite(s))t[n]=s}return t}function Be(e){return{shortcuts:new Map(Object.entries(e.shortcuts??{}).filter(([,t])=>typeof t==="string")),colors:St(e.colors),fontFamily:new Map(Object.entries(e.fontFamily??{}).map(([t,n])=>[t,Array.isArray(n)?n.join(", "):n])),breakpoints:new Map(Object.entries({...Dn,...wt(e.breakpoints)}))}}var Me={};function bt(e){Me=e??{},vt=Be(Me)}async function xt(e,t){let n=Me;bt(e);try{return await t()}finally{bt(n)}}function Nt(e){if(!e)return{};let t=e.theme??{},n=Object.fromEntries(Object.entries(e.shortcuts??{}).filter(([,r])=>typeof r==="string"));return{...Object.keys(n).length?{shortcuts:n}:{},...t.fontFamily?{fontFamily:JSON.parse(JSON.stringify(t.fontFamily))}:{},...t.colors?{colors:JSON.parse(JSON.stringify(t.colors))}:{},...t.screens?{breakpoints:wt(t.screens)}:{}}}function kt(e){return pe().shortcuts.get(e)}function Tt(e){return pe().colors.get(e)}function De(e){return pe().breakpoints.get(e)}function ge(e){return pe().fontFamily.get(e)}var _t=/^--[\w\u0080-\uFFFF-]+$/u;function Rt(e,t){if(!/var\(/i.test(e))return e;let n="",r="",s=!1;for(let o=0;o<e.length;o++){let c=e[o];if(c==="\\"){n+=e.slice(o,o+2),o++;continue}if(r){if(n+=c,c===r)r="";continue}if(c==='"'||c==="'"){r=c,n+=c;continue}if(e.slice(o,o+4).toLowerCase()!=="var("||o>0&&/[\w-]/.test(e[o-1])){n+=c;continue}let l=1,d=-1,p="",h=o+4;for(;h<e.length;h++){let y=e[h];if(y==="\\"){h++;continue}if(p){if(y===p)p="";continue}if(y==='"'||y==="'"){p=y;continue}if(y==="(")l++;if(y===")"&&--l===0)break;if(y===","&&l===1&&d===-1)d=h}if(l!==0)return;let f=e.slice(o+4,d===-1?h:d).trim();if(!_t.test(f))return;let m=t(f,d===-1?void 0:e.slice(d+1,h).trim());if(m===void 0||n.length+m.length>65536)return;n+=m,s=!0,o=h}return s&&n.length>65536?void 0:n}function ae(e,t){let n=new Map,r=new Set;for(let[g,u]of e){let w=g.trim();if(!_t.test(w))continue;if(typeof u==="string"||typeof u==="number"&&Number.isFinite(u))n.set(w,String(u).trim())}let s=new Map,o=new Set;for(let[g,u]of n){let w=new Set,b=(N,S=0)=>S>64?void 0:Rt(N,(k,x)=>(w.add(k),x===void 0?"":b(x,S+1)));if(b(u)===void 0)o.add(g);s.set(g,w)}let c=new Map,l=new Map,d=[],p=new Set,h=0;function f(g,u=0){if(u>64){o.add(g);return}c.set(g,h),l.set(g,h++),d.push(g),p.add(g);for(let N of s.get(g)??[]){if(!n.has(N))continue;if(!c.has(N)){if(f(N,u+1),l.has(N))l.set(g,Math.min(l.get(g),l.get(N)))}else if(p.has(N))l.set(g,Math.min(l.get(g),c.get(N)))}if(l.get(g)!==c.get(g))return;let w=[],b;do b=d.pop(),p.delete(b),w.push(b);while(b!==g);if(w.length>1||s.get(g)?.has(g))w.forEach((N)=>o.add(N))}for(let g of n.keys())if(!c.has(g))f(g);let m=new Map;function y(g,u){if(r.add(g),m.has(g))return m.get(g);let w=n.get(g),b=w===void 0||/^(?:inherit|unset)$/i.test(w)?t?.get(g):o.has(g)||/^(?:initial|revert|revert-layer)$/i.test(w)?void 0:v(w,u+1);return m.set(g,b),b}function v(g,u=0){if(u>64)return;return Rt(g,(w,b)=>y(w,u)??(b===void 0?void 0:v(b,u+1)))}return{resolve:v,used:r,computed(){let g=new Map(t);for(let u of n.keys())g.set(u,y(u,0));return g}}}function Le(e){if(e.display==="flex"&&e.flexDirection==null)return{...e,flexDirection:"row"};return e}var At=new Set(["display","gridColumns","gridTemplateColumns","gridTemplateRows","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","order","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","objectFit","objectPosition","tintColor","transform","overflow","pointerEvents","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),Ln=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","order","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),Et=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"]),Ot=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,$n=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(px|rem|em)?$/i,jn=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),Vn=new Set(["perspective","scale","scaleX","scaleY","translateX","translateY"]);function Wn(e){if(typeof e!=="string")return e;let t=$n.exec(e);return t?Number(t[1])*(/^r?em$/i.test(t[2]||"")?16:1):e}function ie(e){return typeof e==="number"&&Number.isFinite(e)}function Fn(e,t){if(e==="shadowOffset"&&t&&typeof t==="object"&&!Array.isArray(t)){let{width:n,height:r}=t;return ie(n)&&ie(r)?{width:n,height:r}:void 0}if(e==="transform"&&Array.isArray(t)){let n=[];for(let r of t){if(!r||typeof r!=="object"||Array.isArray(r)||Object.keys(r).length!==1)return;let[s,o]=Object.entries(r)[0];if(Vn.has(s)&&ie(o))n.push({[s]:o});else if(jn.has(s)&&typeof o==="string"&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/.test(o))n.push({[s]:o});else return}return n}return}function Xn(e){let t=[],n=0,r=0,s="";for(let o=0;o<=e.length;o++){let c=e[o];if(c==="\\"){o++;continue}if(s){if(c===s)s="";continue}if(c==='"'||c==="'"){s=c;continue}if(c==="(")r++;if(c===")")r=Math.max(0,r-1);if(o!==e.length&&(c!==";"||r))continue;let l=e.slice(n,o),d=l.indexOf(":");if(d!==-1)t.push([l.slice(0,d).trim(),l.slice(d+1).trim()]);n=o+1}return t}function zn(e,t){let n;if(typeof e==="string"){if(e=e.trim(),!e)return[];try{e=JSON.parse(e)}catch{}}if(typeof e==="string")n=Xn(e);else if(e&&typeof e==="object"&&!Array.isArray(e))n=Object.entries(e);else{if(e!=null&&e!==!1)t({kind:"non-numeric-style",name:"style"});return[]}return n}function he(e,t=()=>{},n={}){let r=zn(e,t),s=ae(r,n.inheritedVariables);return n.onVariables?.(s.computed()),Un(r,s,t)}function Un(e,t,n){let r={},s=[];for(let[o,c]of e){if(o.trim().startsWith("--")){s.push(o.trim());continue}let l=At.has(o)||o.trim().startsWith("--")?o:o.trim().toLowerCase().replace(/-([a-z])/g,(h,f)=>f.toUpperCase());if(!At.has(l)){n({kind:"unknown-style",name:l});continue}if(c==null||c==="")continue;let d=typeof c==="string"?t.resolve(c.trim()):c;if(d===void 0){n({kind:"non-numeric-style",name:l});continue}if(d==="")continue;if(l==="pointerEvents"){if(typeof d==="string"&&["auto","none","box-none","box-only"].includes(d))r.pointerEvents=d;else n({kind:"unknown-style",name:`pointerEvents:${String(d)}`});continue}if(l==="objectFit"){let h=typeof d==="string"?d.trim().toLowerCase():"";if(["fill","contain","cover","none","scale-down"].includes(h))r.objectFit=h;else n({kind:"unknown-style",name:`objectFit:${String(d)}`});continue}if(l==="objectPosition"){let h=typeof d==="string"?d.trim().toLowerCase().replace(/\s+/g," "):"",f=h.split(" ");if(f.length===1)f.push("center");if(["top","bottom"].includes(f[0])||["left","right"].includes(f[1]))f.reverse();let m=(y)=>y.endsWith("%")&&Ot.test(y.slice(0,-1))&&Number.isFinite(Number(y.slice(0,-1)));if(f.length===2&&(["left","center","right"].includes(f[0])||m(f[0]))&&(["top","center","bottom"].includes(f[1])||m(f[1])))r.objectPosition=h;else n({kind:"unknown-style",name:`objectPosition:${String(d)}`});continue}let p;if(Ln.has(l)||Et.has(l)){if(p=Wn(d),!ie(p)&&!(Et.has(l)&&typeof p==="string"&&p.endsWith("%")&&Ot.test(p.slice(0,-1))&&Number.isFinite(Number(p.slice(0,-1)))))p=void 0}else if(l==="display"&&d==="inline-flex")p="flex";else if(l==="shadowOffset"||l==="transform")p=Fn(l,d);else if(l==="gridTemplateColumns"||l==="gridTemplateRows")p=ie(d)||typeof d==="string"?d:void 0;else if(l==="fontWeight"&&ie(d))p=String(d);else if(typeof d==="string")p=d;if(p===void 0)n({kind:"non-numeric-style",name:l});else r[l]=p}for(let o of s)if(!t.used.has(o))n({kind:"unknown-style",name:o});return r}var Hn={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"}},je={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},It={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},Ct={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function ne(e){let t=e.lastIndexOf("/");if(t>0&&(!e.endsWith("]")||/\/\[[\d.]+%?\]$/.test(e))){let r=ne(e.slice(0,t)),s=e.slice(t+1),o=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!r||!Number.isFinite(o))return;return qn(r,o/100)}if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="black")return"#000000";if(e==="white")return"#ffffff";let n=e.split("-");if(n.length===2){let[r,s]=n,o=Hn[r];if(o&&typeof o==="object")return o[s]}if(e.startsWith("[")&&e.endsWith("]")){let r=e.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(r)?r:void 0}return}function Ve(e){return ne(e.trim())}function qn(e,t){if(e==="transparent")return e;let n=e.startsWith("#")?e.slice(1):"";if(n.length===3)n=n.split("").map((s)=>s+s).join("");if(n.length===8)n=n.slice(0,6);if(n.length!==6)return;let r=Math.round(Math.min(1,Math.max(0,t))*255);return`#${n}${r.toString(16).padStart(2,"0")}`}function $e(e,t=16){if(!e.startsWith("[")||!e.endsWith("]"))return;let n=e.slice(1,-1),r=Number.parseFloat(n);if(!Number.isFinite(r))return;if(n.endsWith("rem"))return r*16;if(n.endsWith("em"))return r*t;return r}function X(e){if(e.startsWith("[")&&e.endsWith("]")){let t=e.slice(1,-1);if(t.endsWith("%"))return;let n=t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t);return Number.isFinite(n)?n:void 0}return je[e]??Ce(e)}function be(e){let t=/^\[(-?\d*\.?\d+)%\]$/.exec(e);if(t)return`${Number.parseFloat(t[1])}%`;return X(e)}var Gn={flex:(e,t)=>(t.display="flex",!0),block:(e,t)=>(t.display="flex",!0),hidden:(e,t)=>(t.display="none",!0),grid:(e,t)=>(t.display="grid",!0),"flex-row":(e,t)=>(t.flexDirection="row",!0),"flex-col":(e,t)=>(t.flexDirection="column",!0),"flex-row-reverse":(e,t)=>(t.flexDirection="row-reverse",!0),"flex-col-reverse":(e,t)=>(t.flexDirection="column-reverse",!0),"flex-wrap":(e,t)=>(t.flexWrap="wrap",!0),"flex-nowrap":(e,t)=>(t.flexWrap="nowrap",!0),"flex-wrap-reverse":(e,t)=>(t.flexWrap="wrap-reverse",!0),"flex-1":(e,t)=>(t.flex=1,t.flexGrow=1,t.flexShrink=1,t.flexBasis=0,!0),"flex-auto":(e,t)=>(t.flexGrow=1,t.flexShrink=1,!0),"flex-initial":(e,t)=>(t.flexGrow=0,t.flexShrink=1,!0),"flex-none":(e,t)=>(t.flexGrow=0,t.flexShrink=0,!0),grow:(e,t)=>(t.flexGrow=1,!0),"grow-0":(e,t)=>(t.flexGrow=0,!0),shrink:(e,t)=>(t.flexShrink=1,!0),"shrink-0":(e,t)=>(t.flexShrink=0,!0),"order-first":(e,t)=>(t.order=-9999,!0),"order-last":(e,t)=>(t.order=9999,!0),"order-none":(e,t)=>(t.order=0,!0),"justify-start":(e,t)=>(t.justifyContent="flex-start",!0),"justify-center":(e,t)=>(t.justifyContent="center",!0),"justify-end":(e,t)=>(t.justifyContent="flex-end",!0),"justify-between":(e,t)=>(t.justifyContent="space-between",!0),"justify-around":(e,t)=>(t.justifyContent="space-around",!0),"justify-evenly":(e,t)=>(t.justifyContent="space-evenly",!0),"items-start":(e,t)=>(t.alignItems="flex-start",!0),"items-center":(e,t)=>(t.alignItems="center",!0),"items-end":(e,t)=>(t.alignItems="flex-end",!0),"items-stretch":(e,t)=>(t.alignItems="stretch",!0),"items-baseline":(e,t)=>(t.alignItems="baseline",!0),"self-auto":(e,t)=>(t.alignSelf="auto",!0),"self-start":(e,t)=>(t.alignSelf="flex-start",!0),"self-center":(e,t)=>(t.alignSelf="center",!0),"self-end":(e,t)=>(t.alignSelf="flex-end",!0),"self-stretch":(e,t)=>(t.alignSelf="stretch",!0),"self-baseline":(e,t)=>(t.alignSelf="baseline",!0),"min-w-0":(e,t)=>(t.minWidth=0,!0),"aspect-square":(e,t)=>(t.aspectRatio=1,!0),"aspect-video":(e,t)=>(t.aspectRatio=1.7777777777777777,!0),"border-solid":(e,t)=>(t.borderStyle="solid",!0),"border-dashed":(e,t)=>(t.borderStyle="dashed",!0),"border-dotted":(e,t)=>(t.borderStyle="dotted",!0),group:()=>!0,peer:()=>!0,"inset-0":(e,t)=>(t.top=0,t.right=0,t.bottom=0,t.left=0,!0),"mx-auto":(e,t)=>(t.alignSelf="center",!0),fixed:(e,t)=>(t.position="absolute",!0),sticky:()=>!0,"sr-only":(e,t)=>(t.position="absolute",t.width=1,t.height=1,t.overflow="hidden",!0),inline:()=>!0,"inline-block":()=>!0,contents:()=>!0,"align-top":()=>!0,"align-middle":()=>!0,"align-bottom":()=>!0,"align-baseline":()=>!0,"align-text-top":()=>!0,"whitespace-normal":()=>!0,"whitespace-pre":()=>!0,"whitespace-pre-line":()=>!0,"whitespace-pre-wrap":()=>!0,"whitespace-nowrap":()=>!0,"break-words":()=>!0,"break-all":()=>!0,"break-normal":()=>!0,"object-cover":()=>!0,"object-contain":()=>!0,"object-fill":()=>!0,"object-center":()=>!0,"tracking-tighter":(e,t)=>(t.letterSpacing=-0.8,!0),"tracking-tight":(e,t)=>(t.letterSpacing=-0.4,!0),"tracking-normal":(e,t)=>(t.letterSpacing=0,!0),"tracking-wide":(e,t)=>(t.letterSpacing=0.4,!0),"tracking-wider":(e,t)=>(t.letterSpacing=0.8,!0),"tracking-widest":(e,t)=>(t.letterSpacing=1.6,!0),"tabular-nums":()=>!0,"inline-flex":(e,t)=>(t.display="flex",!0),truncate:()=>!0,relative:(e,t)=>(t.position="relative",!0),absolute:(e,t)=>(t.position="absolute",!0),"pointer-events-none":(e,t)=>(t.pointerEvents="none",!0),"pointer-events-auto":(e,t)=>(t.pointerEvents="auto",!0),"overflow-visible":(e,t)=>(t.overflow="visible",!0),"overflow-hidden":(e,t)=>(t.overflow="hidden",!0),"overflow-scroll":(e,t)=>(t.overflow="scroll",!0),"overflow-x-auto":()=>!0,"overflow-x-scroll":()=>!0,"overflow-y-auto":()=>!0,"overflow-y-scroll":()=>!0,"font-sans":(e,t)=>(t.fontFamily=ge("sans")??"sans-serif",!0),"font-serif":(e,t)=>(t.fontFamily=ge("serif")??"serif",!0),"font-mono":(e,t)=>(t.fontFamily=ge("mono")??"monospace",!0),"font-thin":(e,t)=>(t.fontWeight="100",!0),"font-extralight":(e,t)=>(t.fontWeight="200",!0),"font-light":(e,t)=>(t.fontWeight="300",!0),"font-normal":(e,t)=>(t.fontWeight="400",!0),"font-medium":(e,t)=>(t.fontWeight="500",!0),"font-semibold":(e,t)=>(t.fontWeight="600",!0),"font-bold":(e,t)=>(t.fontWeight="bold",!0),"font-extrabold":(e,t)=>(t.fontWeight="800",!0),"font-black":(e,t)=>(t.fontWeight="900",!0),italic:(e,t)=>(t.fontStyle="italic",!0),"not-italic":(e,t)=>(t.fontStyle="normal",!0),"text-left":(e,t)=>(t.textAlign="left",!0),"text-center":(e,t)=>(t.textAlign="center",!0),"text-right":(e,t)=>(t.textAlign="right",!0),"text-justify":(e,t)=>(t.textAlign="justify",!0),uppercase:(e,t)=>(t.textTransform="uppercase",!0),lowercase:(e,t)=>(t.textTransform="lowercase",!0),capitalize:(e,t)=>(t.textTransform="capitalize",!0),"normal-case":(e,t)=>(t.textTransform="none",!0),underline:(e,t)=>(t.textDecorationLine="underline",!0),"line-through":(e,t)=>(t.textDecorationLine="line-through",!0),"no-underline":(e,t)=>(t.textDecorationLine="none",!0)};function Jn(e,t){if(!e.startsWith("bg-"))return!1;let n=e.slice(3),r=ne(n);if(r)return t.backgroundColor=r,!0;return!1}function Pt(e,t){if(!e.startsWith("text-"))return!1;let n=e.slice(5),r=Pe(n);if(r)return Object.assign(t,r),!0;if(It[n])return t.fontSize=It[n],!0;if(n.startsWith("[")&&n.endsWith("]")){let o=n.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(o)){let c=o.endsWith("rem")||o.endsWith("em")?Number.parseFloat(o)*16:Number.parseFloat(o);if(Number.isFinite(c))return t.fontSize=c,!0}}let s=ne(n);if(s)return t.color=s,!0;return!1}var Kn=new Set(["t","tr","r","br","b","bl","l","tl"]);function Yn(e,t){let n=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(e);if(n&&Kn.has(n[1]))return t.gradientDirection=`to-${n[1]}`,!0;let r=/^(from|via|to)-(.+)$/.exec(e);if(!r)return!1;let s=ne(r[2]);if(!s)return!1;if(r[1]==="from")t.gradientFrom=s;else if(r[1]==="via")t.gradientVia=s;else t.gradientTo=s;return!0}function Qn(e,t){for(let n of["fill","stroke"]){let r=`${n}-`;if(!e.startsWith(r))continue;let s=e.slice(r.length);if(s==="none")return t[n]="none",!0;if(n==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return t.strokeWidth=Number.parseFloat(s),!0;if(n==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return t.strokeWidth=Number.parseFloat(s.slice(1)),!0;let o=ne(s);if(o)return t[n]=o,!0}return!1}function Zn(e,t){if(e.startsWith("p-")){let n=X(e.slice(2));if(n!==void 0)return t.padding=n,!0}if(e.startsWith("px-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingHorizontal=n,!0}if(e.startsWith("py-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingVertical=n,!0}if(e.startsWith("pt-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingTop=n,!0}if(e.startsWith("pr-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingRight=n,!0}if(e.startsWith("pb-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingBottom=n,!0}if(e.startsWith("pl-")){let n=X(e.slice(3));if(n!==void 0)return t.paddingLeft=n,!0}return!1}function Bt(e,t){if(/^-(?:m|mx|my|mt|mr|mb|ml)-/.test(e)){let n={};if(!Bt(e.slice(1),n))return!1;let r=Object.entries(n);if(r.some(([,s])=>typeof s!=="number"))return!1;for(let[s,o]of r)t[s]=-o;return!0}if(e.startsWith("m-")){let n=X(e.slice(2));if(n!==void 0)return t.margin=n,!0}if(e.startsWith("mx-")){let n=X(e.slice(3));if(n!==void 0)return t.marginHorizontal=n,!0}if(e.startsWith("my-")){let n=X(e.slice(3));if(n!==void 0)return t.marginVertical=n,!0}if(e.startsWith("mt-")){let n=X(e.slice(3));if(n!==void 0)return t.marginTop=n,!0}if(e.startsWith("mr-")){let n=X(e.slice(3));if(n!==void 0)return t.marginRight=n,!0}if(e.startsWith("mb-")){let n=X(e.slice(3));if(n!==void 0)return t.marginBottom=n,!0}if(e.startsWith("ml-")){let n=X(e.slice(3));if(n!==void 0)return t.marginLeft=n,!0}return!1}function er(e,t){if(!e.startsWith("w-"))return!1;let n=e.slice(2);if(n==="full")return t.width="100%",!0;if(n==="screen")return t.width="100%",!0;if(n==="auto")return t.width="auto",!0;if(n.includes("/")){let[s,o]=n.split("/"),c=Number.parseInt(s)/Number.parseInt(o)*100;return t.width=`${c}%`,!0}let r=be(n);if(r!==void 0)return t.width=r,!0;return!1}function rr(e,t){if(!e.startsWith("h-"))return!1;let n=e.slice(2);if(n==="full")return t.height="100%",!0;if(n==="screen")return t.height="100%",!0;if(n==="auto")return t.height="auto",!0;let r=be(n);if(r!==void 0)return t.height=r,!0;return!1}function ir(e,t){if(e==="rounded")return t.borderRadius=Ct.DEFAULT,!0;if(!e.startsWith("rounded-"))return!1;let n=e.slice(8);if(n==="")return!1;let r=/^(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(n),s=Ct[r[2]]??Ie(r[2])??$e(r[2]);if(s===void 0)return!1;let o={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],tl:["borderTopLeftRadius"],tr:["borderTopRightRadius"],bl:["borderBottomLeftRadius"],br:["borderBottomRightRadius"]};for(let c of r[1]?o[r[1]]:["borderRadius"])t[c]=s;return!0}function sr(e,t){let n=/^border(?:-([trblxy]))?(?:-(\d+|\[[^\]]+\]))?$/.exec(e);if(!n)return!1;let[,r="",s]=n,o=s===void 0?1:Number(s);if(s?.startsWith("[")){let l=/^\[(\d+(?:\.\d+)?|\.\d+)(px|rem)?\]$/.exec(s);if(!l)return!1;o=Number(l[1])*(l[2]==="rem"?16:1)}if(!Number.isFinite(o)||o<0)return!1;let c={"":["borderWidth"],t:["borderTopWidth"],r:["borderRightWidth"],b:["borderBottomWidth"],l:["borderLeftWidth"],x:["borderLeftWidth","borderRightWidth"],y:["borderTopWidth","borderBottomWidth"]};for(let l of c[r])t[l]=o;return!0}function or(e,t){if(!e.startsWith("border-"))return!1;let n=e.slice(7),r=ne(n);if(r)return t.borderColor=r,!0;return!1}function ar(e,t){if(!e.startsWith("opacity-"))return!1;let n=Number.parseInt(e.slice(8));if(!Number.isNaN(n))return t.opacity=n/100,!0;return!1}function cr(e,t,n){if(e.startsWith("tracking-[")){let r=$e(e.slice(9),n);if(r===void 0)return!1;return t.letterSpacing=r,!0}if(e.startsWith("leading-")){let r=e.slice(8),s=n,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},c=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*s:$e(r,s):o[r]!==void 0?o[r]*s:je[r];if(c===void 0||!Number.isFinite(c))return!1;return t.lineHeight=c,!0}return!1}function lr(e,t){let n=/^(-?)(inset-x|inset-y|inset|top|right|bottom|left)-(.+)$/.exec(e);if(!n)return!1;let r=n[3],s=/^\[(-?[\d.]+)px\]$/.exec(r),o=s?Number(s[1]):je[r];if(o===void 0||!Number.isFinite(o))return!1;let c=n[1]?-o:o,l=n[2]==="inset"?["top","right","bottom","left"]:n[2]==="inset-x"?["left","right"]:n[2]==="inset-y"?["top","bottom"]:[n[2]];for(let d of l)t[d]=c;return!0}function ur(e,t){let n=/^grid-cols-\[(.+)\]$/.exec(e);if(n)return t.gridColumns=n[1].split("_").filter(Boolean).length,!0;let r=/^grid-cols-(\d+)$/.exec(e);if(!r)return!1;return t.gridColumns=Number(r[1]),!0}function dr(e,t){if(!e.startsWith("size-"))return!1;let n=e.slice(5),r=n==="full"?"100%":be(n);if(r===void 0)return!1;return t.width=r,t.height=r,!0}var fr={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function pr(e,t){let n=/^(min|max)-(w|h)-(.+)$/.exec(e);if(!n)return!1;let[,r,s,o]=n,c=o==="full"||o==="screen"?"100%":o==="none"?void 0:s==="w"&&r==="max"&&fr[o]||be(o);if(c===void 0&&o!=="none")return!1;let l=`${r}${s==="w"?"Width":"Height"}`;if(c===void 0)delete t[l];else t[l]=c;return!0}function gr(e,t){let n=/^(-?)(top|right|bottom|left)-(.+)$/.exec(e);if(!n)return!1;let r=n[3]==="full"?"100%":X(n[3]);if(r===void 0)return!1;return t[n[2]]=typeof r==="number"&&n[1]?-r:r,!0}function hr(e,t){let n=/^(-?)translate-(x|y)-(.+)$/.exec(e);if(!n)return!1;let r=n[3],s;if(r.startsWith("[")){let l=/^\[([+-]?(?:\d+\.?\d*|\.\d+))(px|rem|em)?\]$/.exec(r);if(!l)return!1;s=Number(l[1])*(l[2]?.endsWith("em")?16:1)}else s=X(r);if(s===void 0||!Number.isFinite(s))return!1;if(n[1])s=-s;let o=n[2]==="x"?"translateX":"translateY",c=o==="translateX"?{translateX:s}:{translateY:s};return t.transform=[...(t.transform??[]).filter((l)=>!(o in l)),c],!0}function mr(e,t){let n=/^space-(x|y)-(.+)$/.exec(e);if(!n)return!1;let r=X(n[2]);if(r===void 0)return!1;return t.gap=r,!0}function yr(e,t){if(e.startsWith("gap-")){let n=X(e.slice(4));if(n!==void 0)return t.gap=n,!0}if(e.startsWith("gap-x-")){let n=X(e.slice(6));if(n!==void 0)return t.columnGap=n,!0}if(e.startsWith("gap-y-")){let n=X(e.slice(6));if(n!==void 0)return t.rowGap=n,!0}return!1}function br(e,t){let r={"shadow-none":[0,0,0,0],"shadow-xs":[1,1,0.05,1],"shadow-sm":[2,1,0.1,2],shadow:[3,2,0.12,3],"shadow-md":[6,4,0.15,4],"shadow-lg":[10,6,0.18,8],"shadow-xl":[16,10,0.2,12],"shadow-2xl":[24,16,0.25,18]}[e];if(!r)return!1;let[s,o,c,l]=r;return Object.assign(t,{shadowColor:"#000000",shadowOpacity:c,shadowRadius:s,shadowOffset:{width:0,height:o},elevation:l}),!0}function vr(e){let t=/^divide-(?:(y|x)(?:-(.+))?|(.+))$/.exec(e);if(!t)return null;if(t[2]==="reverse")return"";if(t[1])return`border-${t[1]==="y"?"t":"l"}${t[2]?`-${t[2]}`:""}`;return`border-${t[3]}`}var Dt=new Set(["aria-selected","aria-pressed","aria-checked","aria-expanded"]),Sr=new Set(["hover","group-hover","peer-hover","active","group-active","visited","placeholder","selection","print","motion-safe"]),wr=/^(?:transition(?:-[a-z]+)?|animate-\S+|scroll-[mp][trblxyse]?-\S+|snap-\S+|overscroll-\S+|duration-\S+|ease-\S+|delay-\S+|will-change-\S+|cursor-\S+|select-(?:none|text|all|auto)|outline-none|outline-0|appearance-none|scroll-smooth|scroll-auto|antialiased|subpixel-antialiased|touch-\S+|resize(?:-\S+)?|backdrop-blur(?:-\S+)?|isolate|contain-\S+)$/;function Lt(e){let t=[],n=0,r=0;for(let s=0;s<e.length;s++){let o=e[s];if(o==="[")n++;else if(o==="]")n=Math.max(0,n-1);else if(o===":"&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}function $t(e,t=new Set){let n=Lt(e),r=n[n.length-1],s=t.has(r)?void 0:kt(r);if(s===void 0)return[e];let o=n.slice(0,-1).map((l)=>`${l}:`).join(""),c=new Set(t).add(r);return s.split(/\s+/).filter(Boolean).flatMap((l)=>$t(`${o}${l}`,c))}function ve(e,t,n={}){let r=new Map,s=(v,g)=>{if(!r.has(v))r.set(v,{...g,classes:[],authored:new Map});return r.get(v)};s("base",{});let o=[],c=[],l=e.split(/\s+/).filter(Boolean);if(n.rules){let v=new Set(l);for(let g of Object.keys(n.rules))if(g.includes(".")&&g.split(".").every((u)=>v.has(u)))c.push(g);c.sort((g,u)=>g.split(".").length-u.split(".").length)}for(let v of l){if(n.rules&&Object.hasOwn(n.rules,v)){o.push(v);continue}for(let g of $t(v)){let u=Lt(g),w=u.pop(),b=u.some((C)=>C.startsWith("focus"));if(u.some((C)=>/^(?:group-|peer-)?focus(?:-visible|-within)?$/.test(C))&&/^(?:ring|outline)(?:-|$)/.test(w))continue;if(wr.test(w)||!b&&u.some((C)=>Sr.has(C)))continue;let N,S,k=!1,x,A=[];for(let C of u){let E=De(C),O=C.startsWith("max-")?De(C.slice(4)):void 0;if(E!==void 0&&N===void 0)N=E;else if(O!==void 0&&S===void 0)S=O-0.02;else if(C==="disabled"&&!k)k=!0;else if(Dt.has(C)&&x===void 0)x=C;else A.push(C)}let M=[...A,w].join(":"),j=N!==void 0||S!==void 0,_=k?s("disabled",{disabled:!0}):x?s(`state:${x}`,{state:x}):j?s(`range:${N??0}:${S??""}`,{min:N??0,max:S}):r.get("base");if((k||x)&&(j||k&&x)){r.get("base").authored.set(g,v),r.get("base").classes.push(g);continue}if(_.classes.push(M),!_.authored.has(M))_.authored.set(M,v===g?g:`${v} (${g})`)}}let d=[...o,...c],p=(v,g)=>g.map((u)=>v.authored.get(u)??u),h=r.get("base"),f=me(h.classes.join(" "),t,n),m=new Map;if(d.length){let v=(w)=>w?he(w,()=>{},{inheritedVariables:t}):{},g={},u={};for(let w of d){let b=n.rules[w];g={...g,...v(b.light)},u={...u,...v(b.dark)};for(let N of b.responsive??[]){let S=`${N.min}:${N.max??""}`,k=m.get(S)??{min:N.min,...N.max===void 0?{}:{max:N.max},style:{}};if(k.style={...k.style,...v(N.light)},N.dark)k.dark={...k.dark,...v(N.dark)};m.set(S,k)}}if(f.style={...g,...f.style},Object.keys(u).length)f.dark={...u,...f.dark}}f.unknown=p(h,f.unknown);let y=[];for(let v of r.values()){if(v===h)continue;let g=me(v.classes.join(" "),t,{appearance:n.appearance});f.unknown=[...new Set([...f.unknown,...p(v,g.unknown)])];let u={style:g.style,...g.dark?{dark:g.dark}:{}};if(v.disabled)f.disabled=u;else if(v.state)(f.states??={})[v.state]=u;else y.push({min:v.min??0,...v.max===void 0?{}:{max:v.max},...u})}for(let v of m.values()){let g=y.find((u)=>u.min===v.min&&u.max===v.max);if(g){if(g.style={...v.style,...g.style},v.dark||g.dark)g.dark={...v.dark,...g.dark}}else y.push(v)}if(y.length)f.responsive=y.sort((v,g)=>v.min-g.min||(v.max??1/0)-(g.max??1/0));return f}function me(e,t,n={}){let r=[],s=[],o=[],c=[],l={focus:{classes:[],originals:new Map},focusWithin:{classes:[],originals:new Map}},d=new Map;function p(b,N){let S=/^(bg|text|border(?:-[trblxy])?|from|via|to|fill|stroke|divide|decoration|caret|accent)-(.+?)(\/[^\s]+)?$/.exec(b),k=S&&Tt(S[2]);if(S&&k){let _=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+?)\s*)?\)$/.exec(k),C=_?t?.get(_[1])??_[2]:k;if(C&&/^(?:#[0-9a-f]{3,8}|rgba?\(.+\)|hsla?\(.+\))$/i.test(C))return[`${S[1]}-[${C.replace(/\s+/g,"")}]${S[3]||""}`]}let x=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(b),A=x&&yt[x[2]];if(A){let _=t?.get(Ke(x[2]));return[`${x[1]}-${_===void 0?A[N]:`[${_}]`}${x[3]||""}`]}let M=/^rounded-(?:(tl|tr|bl|br|t|b|l|r)-)?(.+)$/.exec(b);if(M&&ye[M[2]]){let _=Ie(M[2],t);return _===void 0?void 0:[`rounded-${M[1]?`${M[1]}-`:""}[${_}px]`]}let j=b.startsWith("text-")?b.slice(5):"";if(nr[j]){let _=Pe(j,t);return _&&[`text-[${_.fontSize}px]`,`leading-[${_.lineHeight}px]`]}for(let _ of Object.keys(tr)){if(!b.endsWith(`-${_}`))continue;let C=Ce(_,t);return C===void 0?void 0:[`${b.slice(0,-_.length)}[${C}px]`]}return[b]}function h(b,N){if(!d.has(b))d.set(b,new Set);return d.get(b).add(N),b}let f=[],m=new Map;for(let b of e.split(/\s+/).filter(Boolean)){let N=b.startsWith("dark:")?b.slice(5):b,S=vr(N);if(S!==null){let A=S&&`${b===N?"":"dark:"}${S}`;if(A)f.push(A),m.set(A,b);continue}let k=/^(dark:)?(focus|focus-within):(dark:)?(.+)$/.exec(b),x=k?.[2]==="focus"?"focus":"focusWithin";if(k&&n[x]&&!(k[1]&&k[3])){let A=`${k[1]||k[3]?"dark:":""}${k[4]}`,M=l[x];M.classes.push(A),M.originals.set(A,[...M.originals.get(A)??[],b]);continue}if(b.startsWith("dark:")){let A=p(b.slice(5),"dark");if(!A)c.push(b);else s.push(...A.map((M)=>h(M,b)))}else if(!b.includes(":")||b.startsWith("[")){let A=p(b,n.appearance??"light"),M=p(b,"dark");if(!A||!M){c.push(b);continue}if(r.push(...A.map((j)=>h(j,b))),M.join(" ")!==A.join(" "))o.push(...M.map((j)=>h(j,b)))}else c.push(b)}let y=[],v=Mt(r,y),g={style:v,unknown:y},u=[...n.appearance===void 0?o:[],...s];if(u.length)g.dark=Mt(u,y);if(v.transform&&g.dark?.transform){let b=new Set(g.dark.transform.flatMap((N)=>Object.keys(N)));g.dark.transform=[...v.transform.filter((N)=>!Object.keys(N).some((S)=>b.has(S))),...g.dark.transform]}for(let b of r){if(b==="truncate"||b==="whitespace-nowrap")g.numberOfLines=1;let N=/^object-(cover|contain|fill)$/.exec(b);if(N)g.resizeMode=N[1]==="fill"?"stretch":N[1];let S=/^line-clamp-(\d+)$/.exec(b);if(S)g.numberOfLines=Number(S[1]);if(!g.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(b))g.icon=b}let w=y.flatMap((b)=>[...d.get(b)??[b]]);if(g.unknown=[...new Set([...w.filter((b)=>!/^line-clamp-\d+$/.test(b)),...c])],f.length){let b=me(f.join(" "),t,{appearance:n.appearance});g.divide={style:b.style,...b.dark?{dark:b.dark}:{}},g.unknown=[...new Set([...g.unknown,...b.unknown.map((N)=>m.get(N)??N)])]}for(let b of["focus","focusWithin"]){let N=l[b];if(!N.classes.length)continue;let S=me(N.classes.join(" "),t,{appearance:n.appearance});g[b]={style:S.style,dark:S.dark},g.unknown=[...new Set([...g.unknown,...S.unknown.flatMap((k)=>N.originals.get(k)??[k])])];for(let k of N.classes)if(/^(?:dark:)?(?:truncate|line-clamp-\d+|i-[a-z0-9]+-.+)$/.test(k))g.unknown.push(...N.originals.get(k))}return g}function Mt(e,t){let n={},r=Array.isArray(e)?e:e.split(/\s+/).filter(Boolean),s={};for(let c of r)if(c.startsWith("text-"))Pt(c,s);let o=typeof s.fontSize==="number"?s.fontSize:16;for(let c of r){if(/^i-[a-z0-9]+-/.test(c))continue;let l=Gn[c];if(l){l("",n);continue}if(br(c,n))continue;if(Yn(c,n))continue;if(Jn(c,n))continue;if(Qn(c,n))continue;if(Pt(c,n))continue;if(Zn(c,n))continue;if(Bt(c,n))continue;if(er(c,n))continue;if(rr(c,n))continue;if(ir(c,n))continue;if(sr(c,n))continue;if(or(c,n))continue;if(ar(c,n))continue;if(yr(c,n))continue;if(cr(c,n,o))continue;if(dr(c,n))continue;if(pr(c,n))continue;if(ur(c,n))continue;let d=/^aspect-\[(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)\]$/.exec(c);if(d&&Number(d[2])>0){n.aspectRatio=Number(d[1])/Number(d[2]);continue}let p=/^z-\[(-?\d+)\]$/.exec(c)??/^z-(\d+)$/.exec(c);if(p){n.zIndex=Number(p[1]);continue}if(c==="z-auto")continue;if(lr(c,n))continue;let h=/^order-\[(-?\d+)\]$/.exec(c)??/^order-(-?\d+)$/.exec(c);if(h){n.order=Number(h[1]);continue}if(gr(c,n))continue;if(hr(c,n))continue;if(mr(c,n))continue;if(t?.push(c),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${c}`)}return n}var jt=new Map;function Vt(e,t){if(!e)return;let n=e.trim(),r=n.lastIndexOf("-"),s=r===-1?t[n]:t[n.slice(0,r)],o=r===-1?s:s?.[n.slice(r+1)];if(typeof o==="string"&&/^#[\da-f]{3,8}$/i.test(o))return o;return Ve(n)??Ve(`[${n}]`)}function Nr(e){let t=e.roles??{},n=e.shapes??{},r=e.density??{},s={...e.theme?.colors,...e.theme?.extend?.colors},o=[],c=[];for(let[l,d]of Object.entries(t)){if(!yt[l])continue;let p=Vt(typeof d==="string"?d:d?.light,s),h=Vt(typeof d==="string"?d:d?.dark,s);if(p)o.push(`${Ke(l)}: ${p};`);if(h)c.push(`${Ke(l)}: ${h};`)}for(let[l,d]of Object.entries(n))if(ye[l])o.push(`${on(l)}: ${d};`);for(let[l,d]of Object.entries(r))if(Ae[l])o.push(`${Ge(l)}: ${d};`);return[o.length?`:root { ${o.join(" ")} }`:"",c.length?`.dark { ${c.join(" ")} }`:""].filter(Boolean).join(`
3
+ `)}async function kr(e){let{resolveUserCssConfig:t}=await import("./chunk-wq1vs94k.js"),n=await t(e);return n?Nr(n):""}function Wt(e){let t=xr.resolve(e),n=jt.get(t);if(!n)n=kr(t).catch(()=>""),jt.set(t,n);return n}var Xt={"aria-pressed":"selected","aria-selected":"selected","aria-checked":"checked","aria-disabled":"disabled","aria-expanded":"expanded","aria-busy":"busy"},Ft={alert:"alert",button:"button",checkbox:"checkbox",combobox:"combobox",header:"header",heading:"header",image:"image",img:"image",link:"link",menu:"menu",menubar:"menubar",menuitem:"menuitem",none:"none",presentation:"none",progressbar:"progressbar",radio:"radio",scrollbar:"scrollbar",search:"search",searchbox:"search",slider:"adjustable",spinbutton:"spinbutton",switch:"switch",tab:"tab",tablist:"tablist",timer:"timer",toolbar:"toolbar"};function Tr(e){return e==="role"||e==="aria-label"||e==="aria-valuetext"||e in Xt}function Rr(e,t){if(t===void 0||t===null)return;let n=String(t).trim().toLowerCase();if(n==="mixed")return e==="aria-checked"?"mixed":!0;if(n==="undefined")return;return n===""||n==="true"}function _r(e){if(e===void 0||e===null)return null;for(let t of String(e).trim().toLowerCase().split(/\s+/))if(Ft[t])return Ft[t];return null}function Ar(e,t,n){if(e==="aria-label")return{accessibilityLabel:t===void 0||t===null||t===""?null:String(t)};if(e==="aria-valuetext")return{accessibilityValue:t===void 0||t===null||t===""?null:String(t)};if(e==="role")return{accessibilityRole:_r(t)};let r=Xt[e];if(!r)return;let s=n.accessibilityState,o=s&&typeof s==="object"?{...s}:{},c=Rr(e,t);if(c===void 0)delete o[r];else o[r]=c;return{accessibilityState:Object.keys(o).length?o:null}}function Er(e){let t=e.accessibilityState&&typeof e.accessibilityState==="object"?e.accessibilityState:void 0,n={};for(let[s,o]of Object.entries(e)){if(!Tr(s))continue;let c=Ar(s,o,n);if(c)Object.assign(n,c)}for(let s of["accessibilityLabel","accessibilityRole","accessibilityValue"])if(e[s]===void 0&&n[s]!==void 0&&n[s]!==null)e[s]=n[s];let r=n.accessibilityState;if(r)e.accessibilityState={...r,...t}}var We=["accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue"];function Fe(e,t){let n={...e};if(Er(n),t==="Image"&&n.accessibilityLabel===void 0&&e.alt!=null&&e.alt!=="")n.accessibilityLabel=String(e.alt);return Object.fromEntries(We.filter((r)=>(r in n)).map((r)=>[r,n[r]]))}var Ut=["keyboardType","secureTextEntry","returnKeyType","autoCapitalize","autoCorrect","editable","autoComplete"],Or=new Set(["type","inputmode","inputMode","enterkeyhint","enterKeyHint","autoCapitalize","autoCorrect","spellcheck","readonly","readOnly","disabled",...Ut]),Ir={numeric:"number-pad",decimal:"decimal-pad",tel:"phone-pad",email:"email-address",url:"url",search:"web-search",text:"default"},Cr={email:{keyboardType:"email-address",verbatim:!0,autoComplete:"email"},tel:{keyboardType:"phone-pad",autoComplete:"tel"},url:{keyboardType:"url",verbatim:!0,autoComplete:"url"},number:{keyboardType:"decimal-pad"},search:{keyboardType:"web-search",returnKeyType:"search"},password:{secure:!0,verbatim:!0}},Pr={enter:"default",done:"done",go:"go",next:"next",previous:"default",search:"search",send:"send"};function se(e){return e===void 0||e===null?"":String(e).trim().toLowerCase()}function zt(e){if(e===void 0||e===null||e===!1)return!1;return se(e)!=="false"}function Xe(e,...t){for(let n of t)if(e[n]!==void 0&&e[n]!==null)return e[n];return}function Ht(e,t){if(e!=="TextInput")return{};let n={},r=se(t.type),s=Cr[r]??{},o=se(Xe(t,"inputmode","inputMode")),c=Ir[o]??s.keyboardType;if(c&&c!=="default")n.keyboardType=c;if(s.secure)n.secureTextEntry=!0;let l=se(Xe(t,"enterkeyhint","enterKeyHint")),d=Pr[l]??s.returnKeyType;if(d&&d!=="default")n.returnKeyType=d;let p=se(t.autoCapitalize);if(p==="off"||p==="none")n.autoCapitalize="none";else if(p==="on")n.autoCapitalize="sentences";else if(!p&&s.verbatim)n.autoCapitalize="none";let h=t.autoCorrect;if(h==="off"||h==="false"||se(t.spellcheck)==="false"||h===void 0&&s.verbatim)n.autoCorrect=!1;else if(h==="on"||h==="true")n.autoCorrect=!0;if(zt(Xe(t,"readonly","readOnly"))||zt(t.disabled))n.editable=!1;if(s.autoComplete)n.autoComplete=s.autoComplete;return Object.fromEntries(Object.entries(n).filter(([f])=>t[f]===void 0||Br(f,t[f])))}function Br(e,t){if(e==="autoCapitalize")return t==="off"||t==="on";if(e==="autoCorrect")return typeof t==="string";return!1}function qt(e){let t=Ht(e.type,e.props);if(!Object.keys(t).length)return;e._textEntrySource=Object.fromEntries(Ut.filter((n)=>(n in e.props)).map((n)=>[n,e.props[n]])),Object.assign(e.props,t)}var ze={"region-change-complete":"onRegionChangeComplete",regionchangecomplete:"onRegionChangeComplete",click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",onchange:"onChange",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll","scroll-begin-drag":"onScrollBeginDrag",scrollbegindrag:"onScrollBeginDrag","scroll-end-drag":"onScrollEndDrag",scrollenddrag:"onScrollEndDrag","momentum-scroll-begin":"onMomentumScrollBegin",momentumscrollbegin:"onMomentumScrollBegin","momentum-scroll-end":"onMomentumScrollEnd",momentumscrollend:"onMomentumScrollEnd","page-selected":"onPageSelected",pageselected:"onPageSelected",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError",play:"onPlay",playing:"onPlay",pause:"onPause",ended:"onEnd",end:"onEnd",timeupdate:"onProgress",progress:"onProgress",loadedmetadata:"onLoad",enterpictureinpicture:"onPictureInPictureStart",leavepictureinpicture:"onPictureInPictureStop"};var He={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText",animate:"Animate"},qe=new Set(Object.values(He));var Kt=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Yt=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight","attributeName","keyTimes","repeatCount"];function z(e){let t=typeof e==="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function ee(e){return Math.round(e*1000)/1000}function Je(e){if(Array.isArray(e)&&e.length===4&&e.every((n)=>Number.isFinite(Number(n))))return e.map(Number);let t=String(e??"").trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some((n)=>!Number.isFinite(n))||t[2]<=0||t[3]<=0)return null;return t}function Lr(e){let t=String(e??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return t.length%2?t.slice(0,-1):t}var Gt=/[MLHVCSQTAZ]/i,Ue=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function $r(e){let t=[],n=e,r=Gt.exec(n);while(r){let s=r.index;n=n.slice(s);let o=n[0];n=n.slice(1);let c=Gt.exec(n),l=c?n.slice(0,c.index):n,d;if(o==="A"||o==="a"){d=[];let p=0,h=l.trim(),f=0;while(f<h.length){let m=p%7,y=h.slice(f).replace(/^[\s,]+/,"");if(f=h.length-y.length,!y)break;if(m===3||m===4)d.push(y[0]==="1"?1:0),f+=1;else{Ue.lastIndex=0;let v=Ue.exec(y);if(!v||v.index!==0)break;d.push(Number.parseFloat(v[0])),f+=v[0].length}p++}}else d=(l.match(Ue)||[]).map(Number.parseFloat);t.push({command:o,args:d}),r=c}return t}function jr(e,t,n,r,s,o,c,l,d){if(e===l&&t===d)return[];let p=Math.abs(n),h=Math.abs(r);if(!p||!h)return[1,l,d];let f=s*Math.PI/180,m=Math.cos(f),y=Math.sin(f),v=(e-l)/2,g=(t-d)/2,u=m*v+y*g,w=-y*v+m*g,b=u*u/(p*p)+w*w/(h*h);if(b>1)p*=Math.sqrt(b),h*=Math.sqrt(b);let N=p*p*h*h-p*p*w*w-h*h*u*u,S=p*p*w*w+h*h*u*u,k=Math.sqrt(Math.max(0,N/S));if(o===c)k=-k;let x=k*(p*w)/h,A=k*-(h*u)/p,M=m*x-y*A+(e+l)/2,j=y*x+m*A+(t+d)/2,_=(B,W,P,L)=>{let Y=B*L-W*P<0?-1:1,Q=(B*P+W*L)/(Math.hypot(B,W)*Math.hypot(P,L));return Y*Math.acos(Math.min(1,Math.max(-1,Q)))},C=_(1,0,(u-x)/p,(w-A)/h),E=_((u-x)/p,(w-A)/h,(-u-x)/p,(-w-A)/h);if(!c&&E>0)E-=2*Math.PI;if(c&&E<0)E+=2*Math.PI;let O=Math.max(1,Math.ceil(Math.abs(E)/(Math.PI/2))),V=E/O,T=1.3333333333333333*Math.tan(V/4),R=[],I=(B)=>{let W=p*Math.cos(B),P=h*Math.sin(B);return[m*W-y*P+M,y*W+m*P+j]},D=(B)=>{let W=-p*Math.sin(B),P=h*Math.cos(B);return[m*W-y*P,y*W+m*P]},F=C;for(let B=0;B<O;B++){let W=F+V,[P,L]=I(F),[Y,Q]=D(F),[U,J]=I(W),[te,q]=D(W);R.push(2,P+T*Y,L+T*Q,U-T*te,J-T*q,B===O-1?l:U,B===O-1?d:J),F=W}return R}function Qt(e){let t=[],n=0,r=0,s=0,o=0,c=0,l=0,d=0,p=0,h="";for(let{command:f,args:m}of $r(String(e??""))){let y=f===f.toLowerCase(),v=f.toUpperCase(),g=()=>y?n:0,u=()=>y?r:0,w=0,b=(S)=>{if(w+S>m.length)return null;let k=m.slice(w,w+S);return w+=S,k};if(v==="Z"){t.push(4),n=s,r=o,h="Z";continue}let N=!0;while(w<m.length||N&&v==="Z"){switch(v){case"M":{let S=b(2);if(!S)return t;if(n=S[0]+g(),r=S[1]+u(),N)t.push(0,n,r),s=n,o=r;else t.push(1,n,r);h=N?"M":"L";break}case"L":{let S=b(2);if(!S)return t;n=S[0]+g(),r=S[1]+u(),t.push(1,n,r),h="L";break}case"H":{let S=b(1);if(!S)return t;n=S[0]+g(),t.push(1,n,r),h="L";break}case"V":{let S=b(1);if(!S)return t;r=S[0]+u(),t.push(1,n,r),h="L";break}case"C":{let S=b(6);if(!S)return t;let k=S[0]+g(),x=S[1]+u();c=S[2]+g(),l=S[3]+u(),n=S[4]+g(),r=S[5]+u(),t.push(2,k,x,c,l,n,r),h="C";break}case"S":{let S=b(4);if(!S)return t;let k=h==="C"?2*n-c:n,x=h==="C"?2*r-l:r;c=S[0]+g(),l=S[1]+u(),n=S[2]+g(),r=S[3]+u(),t.push(2,k,x,c,l,n,r),h="C";break}case"Q":{let S=b(4);if(!S)return t;d=S[0]+g(),p=S[1]+u(),n=S[2]+g(),r=S[3]+u(),t.push(3,d,p,n,r),h="Q";break}case"T":{let S=b(2);if(!S)return t;d=h==="Q"?2*n-d:n,p=h==="Q"?2*r-p:r,n=S[0]+g(),r=S[1]+u(),t.push(3,d,p,n,r),h="Q";break}case"A":{let S=b(7);if(!S)return t;let k=S[5]+g(),x=S[6]+u();t.push(...jr(n,r,S[0],S[1],S[2],S[3],S[4],k,x)),n=k,r=x,h="A";break}default:return t}N=!1}}return t.map((f)=>ee(f))}function Jt(e,t,n,r){if(n<=0||r<=0)return[];let s=0.5522847498;return[0,e+n,t,2,e+n,t+s*r,e+s*n,t+r,e,t+r,2,e-s*n,t+r,e-n,t+s*r,e-n,t,2,e-n,t-s*r,e-s*n,t-r,e,t-r,2,e+s*n,t-r,e+n,t-s*r,e+n,t,4].map(ee)}function Ye(e,t){switch(e){case"Path":return Qt(String(t.d??""));case"Line":return[0,z(t.x1),z(t.y1),1,z(t.x2),z(t.y2)].map(ee);case"Rect":{let n=z(t.x),r=z(t.y),s=z(t.width),o=z(t.height);if(s<=0||o<=0)return[];let c=t.rx===void 0?z(t.ry):z(t.rx),l=t.ry===void 0?c:z(t.ry);if(c=Math.min(Math.max(0,c),s/2),l=Math.min(Math.max(0,l),o/2),!c||!l)return[0,n,r,1,n+s,r,1,n+s,r+o,1,n,r+o,4].map(ee);let d=0.5522847498;return[0,n+c,r,1,n+s-c,r,2,n+s-c+d*c,r,n+s,r+l-d*l,n+s,r+l,1,n+s,r+o-l,2,n+s,r+o-l+d*l,n+s-c+d*c,r+o,n+s-c,r+o,1,n+c,r+o,2,n+c-d*c,r+o,n,r+o-l+d*l,n,r+o-l,1,n,r+l,2,n,r+l-d*l,n+c-d*c,r,n+c,r,4].map(ee)}case"Circle":return Jt(z(t.cx),z(t.cy),z(t.r),z(t.r));case"Ellipse":return Jt(z(t.cx),z(t.cy),z(t.rx),z(t.ry));case"Polyline":case"Polygon":{let n=Lr(t.points);if(n.length<4)return[];let r=[0,n[0],n[1]];for(let s=2;s<n.length;s+=2)r.push(1,n[s],n[s+1]);if(e==="Polygon")r.push(4);return r.map(ee)}default:return null}}function Vr(e){let t=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/.exec(String(e??""));if(!t)return null;let n=Number(t[1])/(t[2]==="ms"?1000:1);return n>0?n:null}function Wr(e){if(e.attributeName!=="d")return null;let t=Vr(e.dur),n=String(e.values??"").split(";").map((l)=>l.trim()).filter(Boolean);if(t===null||n.length<2)return null;let r=n.map(Qt);if(r.some((l)=>!l.length))return null;let s=String(e.keyTimes??"").split(";").map((l)=>l.trim()).filter(Boolean).map(Number),c=s.length===r.length&&s[0]===0&&s[s.length-1]===1&&s.every((l,d)=>Number.isFinite(l)&&(d===0||l>=s[d-1]))?s.map(ee):r.map((l,d)=>ee(d/(r.length-1)));return{frames:r,frameTimes:c,duration:t}}function Qe(e){let t=Wr(e),n={frames:t?.frames??null,frameTimes:t?.frameTimes??null,duration:t?.duration??null};for(let[r,s]of Object.entries(n))if(s===null)delete e[r];else e[r]=s;return n}var Fr=[...Yt,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","barStyle","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","contentContainerStyle","currentTime","defaultSource","defaultValue","ellipsizeMode","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","ios_backgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","listRole","maxLength","mostRecentEventCount","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","objectFit","objectPosition","onEndReachedThreshold","pageIndex","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","sheetDetents","selectedDetent","grabberVisible","tintColor","clearButtonMode","nonModal","dismissOnOutsideTap","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize","initialRegion","tileOverlay","edgePadding","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","mapType","fillColor","strokeColor","pinColor","showsCompass","showsScale","cameraPitch","cameraHeading","autoScrollBottom","scrollKey","pictureInPicture","transitionID"],Zt=new Set(["alwaysBounceHorizontal","alwaysBounceVertical","animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible","nonModal","dismissOnOutsideTap","fitToBounds","showsUserLocation","zoomEnabled","rotateEnabled","pitchEnabled","showsCompass","showsScale","pictureInPicture","grabberVisible"]),Xr=new Map(Fr.map((e)=>[en(e),e]));function en(e){return e.replace(/[-_]/g,"").toLowerCase()}function Ze(e,t){if((t==="Image"||t==="Video")&&e.toLowerCase()==="src")return"source";return Xr.get(en(e))??e}var zr={view:"View",sidebar:"Sidebar",splitview:"SplitView",textinput:"TextInput",pressable:"Pressable",icon:"Icon",text:"Text",button:"Button",image:"Image",img:"Image",video:"Video",map:"Map",mappolyline:"MapPolyline",mappolygon:"MapPolygon",mapmarker:"MapMarker",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",checkbox:"Checkbox",slider:"Slider",picker:"Picker",segmentedcontrol:"SegmentedControl",nativesegmentedcontrol:"SegmentedControl",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function tn(e){return zr[e.toLowerCase()]||e}var Ur={"circle-pause":"pause.circle","cloud-alert":"exclamationmark.icloud","key-round":"key",paperclip:"paperclip","rotate-cw":"arrow.clockwise","route-off":"location.slash",syringe:"syringe","volume-1":"speaker.wave.1",activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",apple:"leaf",archive:"archivebox",armchair:"sofa","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette",backpack:"backpack","badge-check":"checkmark.seal","badge-x":"xmark.seal",ban:"nosign","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100","battery-charging":"battery.100.bolt",bean:"leaf",bed:"bed.double",beef:"fork.knife",bell:"bell","bell-off":"bell.slash","bell-ring":"bell.and.waves.left.and.right",bike:"figure.outdoor.cycle",blocks:"square.grid.2x2",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",box:"shippingbox",brain:"brain",building:"building","building-2":"building.2",cable:"cable.connector","cake-slice":"birthday.cake",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-minus":"calendar.badge.minus","calendar-minus-2":"calendar.badge.minus","calendar-off":"calendar.badge.exclamationmark","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath","calendar-x":"calendar.badge.exclamationmark","calendar-x-2":"calendar.badge.exclamationmark",camera:"camera",carrot:"carrot","chart-bar":"chart.bar","chart-column":"chart.bar","chart-line":"chart.xyaxis.line","chart-no-axes-gantt":"chart.bar.doc.horizontal",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-arrow-out-up-left":"arrow.uturn.backward.circle","circle-minus":"minus.circle","circle-arrow-down":"arrow.down.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-dot":"smallcircle.filled.circle","circle-help":"questionmark.circle","circle-question-mark":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock","clock-12":"clock","clock-2":"clock","clock-3":"clock","clock-4":"clock","clock-8":"clock","clock-alert":"clock.badge.exclamationmark",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",cookie:"birthday.cake",copy:"doc.on.doc","credit-card":"creditcard","cup-soda":"takeoutbag.and.cup.and.straw",cylinder:"cylinder",disc:"opticaldisc",download:"arrow.down.circle",droplet:"drop",droplets:"drop",drumstick:"fork.knife",dumbbell:"dumbbell",edit:"pencil",egg:"frying.pan","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",fish:"fish",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift","glass-water":"waterbottle",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",hamburger:"takeoutbag.and.cup.and.straw","hand-fist":"hand.raised",heart:"heart","heart-off":"heart.slash","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",hourglass:"hourglass",house:"house","id-card":"person.text.rectangle",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-dashboard":"rectangle.3.group","layout-grid":"square.grid.2x2",leaf:"leaf",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",megaphone:"megaphone",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble","messages-square":"bubble.left.and.bubble.right",mic:"mic",milk:"waterbottle",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note","music-2":"music.note",nut:"leaf",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","rectangle-horizontal":"rectangle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",salad:"leaf",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass","scan-line":"barcode.viewfinder",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart",shuffle:"shuffle","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",soup:"mug",sparkles:"sparkles",sprout:"leaf",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront","stretch-horizontal":"rectangle.split.1x2",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis","triangle-alert":"exclamationmark.triangle",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-check":"person.crop.circle.badge.checkmark","user-minus":"person.badge.minus","user-plus":"person.badge.plus","user-round":"person","user-round-check":"person.crop.circle.badge.checkmark","user-round-minus":"person.crop.circle.badge.minus","user-round-plus":"person.crop.circle.badge.plus","user-round-x":"person.crop.circle.badge.xmark","user-x":"person.crop.circle.badge.xmark",users:"person.2","users-round":"person.2",utensils:"fork.knife",video:"video","volume-2":"speaker.wave.2",warehouse:"building.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wheat:"laurel.leading",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",wine:"wineglass",x:"xmark","x-circle":"xmark.circle",zap:"bolt"},nn={lucide:Ur,hugeicons:{"workout-run":"figure.run"}};function ce(e,t=!1){let n=String(e??"").trim();if(!n)return{symbol:"questionmark.square.dashed",known:!1};if(t)return{symbol:n,known:!0};let r=/^i-([a-z0-9]+)-(.+)$/.exec(n)??/^([a-z0-9]+):(.+)$/.exec(n),s=r?r[1]:"lucide",o=r?r[2]:n,c=Object.hasOwn(nn,s)?nn[s]:void 0;if(c&&Object.hasOwn(c,o))return{symbol:c[o],iconify:`i-${s}-${o}`,known:!0};if(!r&&n.includes("."))return{symbol:n,known:!0};return{symbol:"questionmark.square.dashed",iconify:r?n:`i-lucide-${o}`,known:!1}}function et(e){return e.split(/\s+/).find((t)=>/^i-[a-z0-9]+-[a-z0-9-]+$/.test(t))}import{generate as Se,parse as Hr}from"@stacksjs/ts-css/parse";var qr=/^(?::hover|:active|:visited|:focus|:focus-visible|:focus-within)$/;function Gr(e){let t=e.replace(/\s+/g,"").toLowerCase();if(!t||t==="all"||t==="screen")return{};if(/^(?:screenand)?\(prefers-color-scheme:dark\)$/.test(t))return{dark:!0};if(/^(?:screenand)?\(prefers-color-scheme:light\)$/.test(t))return{};if(/prefers-reduced-motion|\(hover|\(pointer|print|forced-colors|prefers-contrast/.test(t))return"skip";let n=t.replace(/^screenand/,"").split("and"),r={};for(let s of n){let o=/^\((min|max)-width:([\d.]+)(px|rem|em)\)$/.exec(s);if(!o)return;r[o[1]]=Number(o[2])*(o[3]==="px"?1:16)}return r}async function rn(e,t){let n={},r=new Set,s=(p)=>{if(r.has(p))return;r.add(p),t(p,[...p.matchAll(/\.(-?[a-z_][\w-]*)/gi)].map((h)=>h[1]))},o=(p,h,f)=>{if(!h.trim())return;let m=n[p]??={},y=f.dark?"dark":"light";if(f.min===void 0&&f.max===void 0){m[y]=m[y]?`${m[y]};${h}`:h;return}let v=m.responsive??=[],g=f.min??0,u=v.find((w)=>w.min===g&&w.max===f.max);if(!u)v.push(u={min:g,...f.max===void 0?{}:{max:f.max}});u[y]=u[y]?`${u[y]};${h}`:h};function c(p,h){for(let f of p){if(f.type==="Atrule"){let v=f.name.toLowerCase();if(["font-face","keyframes","-webkit-keyframes","import","charset","property","page","layer"].includes(v)){if(v==="layer"&&f.block)c(f.block.children,h);continue}if(v!=="media"||!f.block){s(`@${v}`);continue}let g=f.prelude?Se(f.prelude):"",u=Gr(g);if(u==="skip")continue;if(!u){s(`@media ${g}`);continue}c(f.block.children,{dark:h.dark||u.dark,min:u.min??h.min,max:u.max??h.max});continue}if(f.type!=="Rule"||f.block.type!=="Block")continue;let m=[...f.block.children].filter((v)=>v.type==="Declaration").map((v)=>Se(v)).join(";"),y=f.prelude.type==="SelectorList"?[...f.prelude.children].map(Se):[Se(f.prelude)];for(let v of y){let g=/^(?:(?:html|:root)?\.dark\s+)?((?:\.-?[a-z_][\w-]*)+)((?::{1,2}[a-z-]+)*)$/i.exec(v.trim());if(!g){if(!/^(?:html|:root|body|\*|::?[a-z-]+)/i.test(v.trim()))s(v.trim());continue}let u=g[2];if(u){if(!qr.test(u))s(v.trim());continue}let w=h.dark||/^(?:(?:html|:root)?\.dark\s+)/i.test(v.trim());o(g[1].slice(1),m,{dark:w,min:h.min,max:h.max})}}}let l="",d=!0;await new HTMLRewriter().on("style",{element(p){l="";let h=p.getAttribute("type");d=!h||h.toLowerCase()==="text/css",p.onEndTag(()=>{if(!d)return;try{let f=Hr(l);if(f.type==="StyleSheet")c(f.children,{})}catch{s("invalid stylesheet")}})},text(p){l+=p.text}}).transform(new Response(e)).text();for(let p of Object.values(n))p.responsive?.sort((h,f)=>h.min-f.min||(h.max??1/0)-(f.max??1/0));return n}import{generate as le,parse as sn}from"@stacksjs/ts-css/parse";async function an(e,t){let n={light:new Map,dark:new Map},r=new Set,s=(f)=>{if(!r.has(f))r.add(f),t(f)},o=(f,m,y)=>{for(let v of y){let g=n[v].get(f);if(!g||Number(m.important)>Number(g.important)||m.important===g.important&&m.specificity>=g.specificity)n[v].set(f,m)}},c=(f)=>{if(f.type==="Declaration")return f.property.startsWith("--");if(f.type==="Rule"||f.type==="Atrule")return!!f.block&&[...f.block.children].some(c);return!1},l=(f)=>{let m=f.replace(/\s+/g,"").toLowerCase();if(!m||m==="all"||m==="screen")return["light","dark"];let y=/^(?:screenand)?\(prefers-color-scheme:(light|dark)\)$/.exec(m);return y?[y[1]]:void 0};function d(f,m){for(let y of f){if(!c(y))continue;if(y.type==="Atrule"){let g=y.prelude?le(y.prelude):"",u=y.name.toLowerCase()==="media"?l(g):void 0;if(!u){s(`@${y.name} ${g}`.trim());continue}d(y.block.children,m.filter((w)=>u.includes(w)));continue}if(y.type!=="Rule")continue;let v=y.prelude.type==="SelectorList"?[...y.prelude.children].map(le):[le(y.prelude)];for(let g of v){let u=/^(html|:root)?(?:\.(dark|light))?$/.exec(g.trim());if(!u||!u[1]&&!u[2]){s(g);continue}let w=(u[1]===":root"?10:u[1]?1:0)+(u[2]?10:0);for(let b of y.block.children){if(b.type!=="Declaration"){if(c(b))s(`nested rule in ${g}`);continue}if(!b.property.startsWith("--"))continue;let N={value:le(b.value),important:!!b.important,specificity:w};o(b.property,N,m.filter((S)=>!u[2]||u[2]===S))}}}}let p="",h;return await new HTMLRewriter().on("html",{element(f){let m=f.getAttribute("style");if(!m)return;try{let y=sn(m,{context:"declarationList"});if(y.type!=="DeclarationList")return;for(let v of y.children)if(v.type==="Declaration"&&v.property.startsWith("--"))o(v.property,{value:le(v.value),important:!!v.important,specificity:1000},["light","dark"])}catch{s("invalid document inline theme")}}}).on("style",{element(f){p="";let m=f.getAttribute("type");h=!m||m.toLowerCase()==="text/css"?l(f.getAttribute("media")??""):void 0,f.onEndTag(()=>{try{let y=sn(p);if(y.type!=="StyleSheet")return;if(!h){if([...y.children].some(c))s("style type/media");return}d(y.children,h)}catch{s("invalid stylesheet")}})},text(f){p+=f.text}}).transform(new Response(e)).text(),{light:[...n.light].map(([f,m])=>[f,m.value]),dark:[...n.dark].map(([f,m])=>[f,m.value])}}function K(e,t={},n={},r={},s=[]){return{type:e,props:t,style:n,events:r,children:s}}function cn(e,t,n={}){return{version:"1.0.0",root:e,script:t,meta:{source:n.source||"unknown",compiledAt:n.compiledAt||Date.now(),headwindConfig:n.headwindConfig}}}var Jr=/^(?:key(?:down|up|press)|mouse[a-z]+|pointer[a-z]+|dbl(?:click)?|contextmenu|wheel|drag[a-z]*|drop|copy|cut|paste|beforeinput|compositionstart|compositionupdate|compositionend|animation[a-z]+|transition[a-z]+|resize|hashchange|popstate|beforeunload|unload|visibilitychange|selectionchange|selectstart|auxclick)$/,ln=new Set(["script","style","head","meta","link","title","base","noscript"]),un=new Set(["template","body","html","main","fragment"]),we=new Set,Kr=new Set(["onBlur","onChange","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onPageSelected","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPictureInPictureStart","onPictureInPictureStop","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRegionChangeComplete","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),xe=new Set(["Sidebar","SplitView","View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","Link","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","Map","MapPolyline","MapPolygon","MapMarker","FlatList","SectionList","Switch","Checkbox","Slider","Picker","SegmentedControl","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...qe]),Yr=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"]]),dn=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Qr={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function re(e){return e.replace(/&(#x?[0-9a-f]+|\w+);/gi,(t,n)=>{let r=Qr[n.toLowerCase()];if(r!==void 0)return r;if(n[0]==="#"){let s=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):t}return t})}function tt(e){if(!e.includes("{{"))return null;let t=[],n=0;for(let r of e.matchAll(/\{\{([\s\S]+?)\}\}/g)){if(r.index>n)t.push(JSON.stringify(e.slice(n,r.index)));t.push(`(${r[1].trim()})`),n=r.index+r[0].length}if(!t.some((r)=>r.startsWith("(")))return null;if(n<e.length)t.push(JSON.stringify(e.slice(n)));if(t.length===1)return t[0].slice(1,-1);return`[${t.join(", ")}].map(__stxPart => __stxPart == null ? '' : __stxPart).join('')`}function fn(e,t,n,r={}){let s=r.inheritedVariables,o={},c={},l={},d=[],p="",h={};for(let[v,g]of t){let u=v.toLowerCase();if(u==="class"||u==="classname"){p=p?`${p} ${g}`:g;continue}if(u==="style"){h={...h,...Zr(e,g,n,{...r,onVariables(S){s=S,r.onVariables?.(S)}})};continue}if(u.startsWith(":")||u.startsWith("x-")&&u!=="x-cloak"){l[u.startsWith(":")?u.slice(1):u.slice(2)]=re(g);continue}if(u==="x-cloak")continue;if(u.startsWith("@")||u.startsWith("v-on:")){let S=u.startsWith("@")?u.slice(1):u.slice(5),[k]=S.split("."),x=ze[k]??(k.startsWith("on")?k:"");if(!x||!Kr.has(x)){if(Jr.test(k)||/\./.test(S))n.push({kind:"unread-event",tag:e,name:v});continue}c[x]=re(g);continue}if(u==="key"){o.key=g;continue}let w=re(g),b=tt(w);if(b){l[u]=b,d.push(u);continue}let N=Ze(v);if(w===""&&Zt.has(N)){o[N]=!0;continue}try{o[N]=JSON.parse(w)}catch{o[N]=w}}let f=o["data-native"]?o["data-native"]==="TextInput":e==="textarea"||e==="input"&&!["checkbox","radio","hidden"].includes(String(o.type??"text").toLowerCase()),m=p?ve(p,s,{focus:f,focusWithin:!0,rules:r.rules}):void 0;for(let v of new Set(m?.unknown??[]))n.push({kind:"unknown-class",tag:e,name:v});let y=Le({...m?.style,...h});return{props:o,style:y,events:c,bindings:l,classes:p,inline:h,templated:d}}function Zr(e,t,n,r){return he(re(t),(s)=>n.push({...s,tag:e}),r)}function nt(e){return e.children.map((t)=>typeof t==="string"?t:nt(t)).join("").replace(/\s+/g," ").trim()}function ei(e,t){let n=e.node;if(n.props["data-stx-native-template"])return n.children=n.children.map((o)=>typeof o==="string"?K("Text",{},{},{},[o]):o),n;let r=n.children.filter((o)=>typeof o!=="string"),s=n.children.filter((o)=>typeof o==="string").join("").trim();if(e.tag==="button"&&n.type==="Button"&&!e.declaredNative&&r.length>0)return n.type="Pressable",n.props.role??="button",n.children=n.children.flatMap((o)=>typeof o==="string"?o.trim()?[K("Text",{},{},{},[o.trim()])]:[]:[o]),n;if(n.type==="Button"&&r.length===0)return n.children=s?[s]:[],n;if(n.type==="Svg"||n.type==="G")return n.children=r,n;if(n.type==="SvgText"){let o=nt(n);return n.children=o?[o]:[],n}if(dn.has(n.type)&&r.length===0&&s)return n.type="Text",n.children=[s],n;if(n.type==="Text"&&!s&&r.length===0&&typeof n.props.text==="string")return n.children=n.props.text?[n.props.text]:[],delete n.props.text,n;if(n.type==="Text"&&r.length>0){if(/(?:^|\s)(?:inline-)?(?:flex|grid)(?:\s|$)/.test(n._classes??"")||r.some((l)=>l.type!=="Text"))return n.type="View",n.children=n.children.map((l)=>typeof l==="string"?K("Text",{},{},{},[l]):l),n;let c=nt(n);return t.push({kind:"flattened-text",tag:e.tag}),n.children=c?[c]:[],n}if(dn.has(n.type)&&r.length>0)n.children=r;return n}async function ti(e,t={}){e=await ue(e);let n=[],r=await an(e,(u)=>n.push({kind:"unsupported-theme-rule",tag:"style",name:u})),s=ae(r.light).computed(),o=new Set([...e.matchAll(/\sclass(?:name)?\s*=\s*"([^"]*)"/gi)].flatMap((u)=>u[1].split(/\s+/))),c=await rn(e,(u,w)=>{if(!w.length||w.some((b)=>o.has(b)))n.push({kind:"unsupported-style-rule",tag:"style",name:u})}),l=[],d=[],p=new Set;function h(u){let w=d[d.length-1];if(!w)l.push(u);else if(!w.dropped)w.node.children.push(u)}function f(u){let w=u.node.style.fontFamily,b=(S)=>{if(u.tag!=="html"&&u.node._styleSource)S._styleAncestors=[u.node._styleSource,...S._styleAncestors??[]];if(w&&S.style.fontFamily===void 0)S._layoutDefaults={...S._layoutDefaults,fontFamily:w},S.style={fontFamily:w,...S.style}};if(u.node.bindings&&Object.keys(u.node.bindings).length>0){let S=u.node.children,k=S.filter((A)=>typeof A!=="string"),x=k.length===1&&k.length===S.length?k[0]:K("View",{},{},{},S);if(x.bindings={...u.node.bindings,...x.bindings},x.bindingId===void 0&&u.node.bindingId!==void 0)x.bindingId=u.node.bindingId;b(x),h(x);return}let N=d[d.length-1];for(let S of u.node.children){if(typeof S==="string"){if(N&&!N.dropped)N.node.children.push(S);continue}if(b(S),!N)l.push(S);else if(!N.dropped)N.node.children.push(S)}}function m(u,w){let b=d[d.length-1];if(u==="svg"||b?.svg)return y(u,w,b);let N=ln.has(u)&&!we.has(u),S=d[d.length-1]?.dropped??!1,k=b?.variables??s,{props:x,style:A,events:M,bindings:j,classes:_,inline:C,templated:E}=N||S?{props:{},style:{},events:{},bindings:{},classes:"",inline:{},templated:[]}:fn(u,w,n,{inheritedVariables:k,onVariables:(D)=>{k=D},rules:c});if(u==="html")k=s;let O=x["data-native"],V=u==="template"&&w.some(([D])=>[":for","x-for","@for"].includes(D)),T;if(V)T="View",x["data-stx-native-template"]=!0;else if(typeof O==="string"&&xe.has(O))T=O,delete x["data-native"];else{if(T=we.has(u)?"View":tn(u),(u==="i"||u==="span")&&/(?:^|\s)i-[a-z0-9]+-[a-z0-9-]+(?:\s|$)/.test(_))T="Icon";else if(u==="i"&&w.some(([D])=>/^(?::|x-)class$/i.test(D)))T="Icon";if(u==="input"){let D=String(x.type??"text").toLowerCase();if(D==="checkbox")T="Checkbox",x.formValue=x.value??"on",x.checked=x.checked===""||x.checked===!0||x.checked==="true",x.value=x.checked;else if(D==="hidden")T="View",A.display="none",C.display="none";else if(D==="radio")T="View",x.accessibilityRole="radio",n.push({kind:"unsupported-control",tag:u,name:"input:radio"})}}if(!S&&T===u&&!xe.has(T)&&!ln.has(u)&&!un.has(u)&&!p.has(u))p.add(u),n.push({kind:"unmapped-tag",tag:u});if((N||we.has(u))&&!p.has(`drop:${u}`))p.add(`drop:${u}`),n.push({kind:"dropped-subtree",tag:u});if(T==="View"&&/(?:^|\s)overflow-x-(?:auto|scroll)(?:\s|$)/.test(_))T="ScrollView",x.horizontal=!0,x.showsHorizontalScrollIndicator??=!1;else if(T==="View"&&/(?:^|\s)overflow-y-(?:auto|scroll)(?:\s|$)/.test(_))T="ScrollView";if(u==="form")x["data-stx-form"]=!0;if(u==="button"&&x.type===void 0)x.type="submit";if(u==="textarea"&&T==="TextInput")x.multiline??=!0;if((T==="Video"||T==="Image")&&x.source===void 0&&x.src!==void 0)x.source=x.src,delete x.src;if(T==="Icon"){let D=ve(_).icon,F=String(x.symbol||x.name||D||""),B=ce(F,Boolean(x.symbol));if(F.trim()&&!B.known)n.push({kind:"unknown-icon",tag:u,name:F});if(x.symbol=B.symbol,B.iconify)x.iconify=B.iconify}if(T==="FlatList"||T==="SectionList"){let D=new Set([...Object.keys(x),...Object.keys(j)].map((F)=>F.toLowerCase()));for(let[F,B]of Yr)if(D.has(F))n.push({kind:"unsupported-list-prop",tag:T,name:B})}let R=K(T,x,A,M);R._inlineStyle=C,R._styleSource=re(w.find(([D])=>D==="style")?.[1]??"");let I=x["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))R.bindingId=I;if(delete x["data-stx-b"],_)R._classes=_;if(Object.keys(j).length>0)R.bindings=j;if(E.length>0)R._templated=E;if(typeof x.key==="string")R.key=x.key,delete x.key;return{tag:u,node:R,variables:k,declaredNative:typeof O==="string"&&xe.has(O),dropped:N||S||we.has(u)||T==="Video",discard:N||S,unwrap:un.has(u)&&!V&&T!=="ScrollView"&&!(typeof O==="string"&&xe.has(O))}}function y(u,w,b){let N=b?.dropped??!1,S=He[u];if(N||!S){if(!N&&!p.has(`drop:${u}`))p.add(`drop:${u}`),n.push({kind:Kt.has(u)?"dropped-subtree":"unmapped-tag",tag:u});return{tag:u,node:K("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let k=b?.variables??s,{props:x,style:A,events:M,bindings:j,classes:_,inline:C,templated:E}=fn(u,w,n,{inheritedVariables:k,onVariables:(R)=>{k=R},rules:c});if(S==="Svg"){let R=Je(x.viewBox);if(R)x.viewBox=R;else delete x.viewBox;for(let I of["width","height"]){if(typeof x[I]==="number"&&A[I]===void 0)A[I]=x[I];delete x[I]}}if(typeof x.strokeDasharray==="string"||typeof x.strokeDasharray==="number"){let R=String(x.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);x.strokeDasharray=R}let O=Ye(S,x);if(O)x.geometry=O;if(S==="Animate")Qe(x);let V=K(S,x,A,M);V._inlineStyle=C,V._styleSource=re(w.find(([R])=>R==="style")?.[1]??"");let T=x["data-stx-b"];if(typeof T==="number"&&Number.isInteger(T))V.bindingId=T;if(delete x["data-stx-b"],_)V._classes=_;if(Object.keys(j).length>0)V.bindings=j;if(E.length>0)V._templated=E;if(typeof x.key==="string")V.key=x.key,delete x.key;return{tag:u,node:V,variables:k,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(u){let w=u.tagName.toLowerCase(),b=m(w,[...u.attributes]),N=!0;try{u.onEndTag(()=>{if(d.pop(),b.discard)return;if(b.unwrap)f(b);else h(ei(b,n))})}catch{N=!1}if(N)d.push(b);else if(!b.discard)h(b.node)},text(u){let w=d[d.length-1];if(!w||w.dropped)return;let b=ni(re(u.text),w.inMustache===!0);w.inMustache=b.inside;let N=b.text;if(!N.trim())return;w.node.children.push(N)}}).transform(new Response(e)).text(),l.length===0)throw Error(`No element to translate in the rendered output of ${t.source??"unknown"}`);let v=l.length===1?l[0]:K("View",{},{},{},l);if(r.light.length||r.dark.length)v._stylesheetTheme=r;if(Object.keys(c).length)v._stylesheetRules=c;let g=(u)=>{ri(u);let w=Fe(u.props,u.type);if(Object.keys(w).length)u._accessibilitySource=Object.fromEntries(We.filter((b)=>(b in u.props)).map((b)=>[b,u.props[b]])),Object.assign(u.props,w);qt(u);for(let b of u.children)if(typeof b!=="string")g(b)};return g(v),pn(v),{root:v,diagnostics:n}}function pn(e){if(["ScrollView","FlatList","SectionList"].includes(e.type))return!e.props.horizontal&&(Number(e.style.flex)>0||Number(e.style.flexGrow)>0);if(!e.children.map((n)=>typeof n==="string"?!1:pn(n)).some(Boolean)||!["View","SafeAreaView","KeyboardAvoidingView"].includes(e.type))return!1;if(e.style.height!==void 0||e.style.maxHeight!==void 0)return!1;if(e.style.flex===0||e.style.flexGrow===0||e.style.flexShrink===0)return!1;if(e.style.flex===void 0&&e.style.flexGrow===void 0)e._layoutDefaults={flex:1,flexGrow:1,flexShrink:1,flexBasis:0},e.style={...e._layoutDefaults,...e.style};return!0}function ni(e,t){let n="",r=0;while(r<e.length){if(!t&&e.startsWith("{{",r)){t=!0,n+="{{",r+=2;continue}if(t&&e.startsWith("}}",r)){t=!1,n+="}}",r+=2;continue}let s=e[r];if(!t&&/\s/.test(s)){if(!n.endsWith(" "))n+=" ";while(r<e.length&&/\s/.test(e[r]))r++;continue}n+=s,r++}return{text:n,inside:t}}function ri(e){if(e.props["data-stx-native-template"])return;if(e.bindings?.text||e.children.length===0)return;let t=e.children.filter((r)=>typeof r==="string");if(t.length<e.children.length){let r=e.type==="Button"||e.type==="Text"?null:tt(t.join(""));if(!r)return;e.bindings={...e.bindings,text:r},e._templated=[...e._templated??[],"text"],e.children=e.children.filter((s)=>typeof s!=="string");return}let n=tt(e.children.join(""));if(!n)return;if(e.type!=="Button")e.bindings={...e.bindings,text:n},e._templated=[...e._templated??[],"text"],e.children=[];else{e.type="Pressable",e.props.role??="button";let r=K("Text",{},{},{},[]);r.bindings={text:n},r._templated=["text"],e.children=[r]}}async function gn(e,t={}){let{root:n,diagnostics:r}=await ti(e,t),s=t.script??{exports:{},functions:[],code:""};return{document:cn(n,s,{source:t.source??"unknown"}),diagnostics:r}}function ii(e){let t="",n=0;for(let r=e.indexOf("<");r!==-1;r=e.indexOf("<",r+1)){if(!/[a-z]/i.test(e[r+1]??""))continue;let s=r+1,o="";for(;s<e.length;s++){let l=e[s];if(o){if(l===o)o="";continue}if(l==='"'||l==="'")o=l;else if(l===">"||l==="<")break}if(e[s]!==">"||e[s-1]!=="/")continue;let c=e.slice(r,s+1).replace(/"[^"]*"|'[^']*'/g,'""');if(!/\sdata-native-exclude(?=[\s=/>])/i.test(c))continue;t+=e.slice(n,r),n=s+1,r=s}return n?t+e.slice(n):e}async function ue(e){if(!/\bdata-native-exclude\b/i.test(e))return e;if(e=ii(e),!/\bdata-native-exclude\b/i.test(e))return e;return new HTMLRewriter().on("[data-native-exclude]",{element(t){t.remove()}}).transform(new Response(e)).text()}var hn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,si=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,oi=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,mn=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function rt(e){let t=[];hn.lastIndex=0;for(let o of e.matchAll(hn)){let c=o[1]??"";if(/\bserver\b/.test(c))continue;t.push(o[2].trim())}let n=t.filter(Boolean).join(`
4
+
5
+ `),r=[];for(let o of[si,oi]){o.lastIndex=0;for(let c of n.matchAll(o))if(!r.includes(c[1]))r.push(c[1])}let s={};mn.lastIndex=0;for(let o of n.matchAll(mn)){let c=o[2];try{s[o[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{s[o[1]]=c}}return{exports:s,functions:r,code:n}}var oe="[data-native-chrome]";function ai(e){let t=(e??"").trim().toLowerCase();return t==="tabs"||t==="bar"?t:""}function yn(e,t){let n=ce(e);if(!n.known&&/^i-|:/.test(e))t?.(e);return n.known||/^i-|:/.test(e)?n.symbol:e}function ci(e){let t=(e??"").trim();if(!t.startsWith("/")||t.startsWith("//"))return null;return t}function bn(e){return e.replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/\s+/g," ").trim()}async function vn(e,t){if(!/\bdata-native-chrome\b/i.test(e))return{html:e,chrome:null};let n=[],r=[],s=new Set,o=[],c=[],l=null,d=null,p=!1;if(await new HTMLRewriter().on(oe,{element(m){p=!0;let y=m.getAttribute("data-stx-scope");if(y)s.add(y);n.push(ai(m.getAttribute("data-native-chrome"))),m.onEndTag(()=>{n.pop()})}}).on("[data-stx-component-wrapper]",{element(m){let y={scope:m.getAttribute("data-stx-scope")??"",children:0,chrome:0};o.push(y),m.onEndTag(()=>{if(o.pop(),y.scope&&y.children>0&&y.chrome===y.children)s.add(y.scope)})}}).on("[data-stx-component-wrapper] > *",{element(m){let y=o[o.length-1];if(!y)return;if(y.children++,m.hasAttribute("data-native-chrome"))y.chrome++}}).on(`${oe} [data-stx-scope]`,{element(m){let y=m.getAttribute("data-stx-scope");if(y)s.add(y)}}).on(`${oe} script[data-stx-component-factories]`,{element(m){let y=[...m.attributes].map(([v,g])=>g===""?v:`${v}="${g.replace(/"/g,"&quot;")}"`).join(" ");l="",m.onEndTag(()=>{c.push(`<script ${y}>${l}</script>`),l=null})},text(m){if(l!==null)l+=m.text}}).on(`${oe} a`,{element(m){let y=ci(m.getAttribute("href")),v=n[n.length-1]??"";if(!y||!v)return;let g=m.getAttribute("data-native-icon")||et(m.getAttribute("class")??""),u={path:y,title:"",region:v,label:m.getAttribute("aria-label")||m.getAttribute("title")||"",...g?{symbol:yn(g,t)}:{}};d=u,m.onEndTag(()=>{if(u.title=bn(u.title)||bn(u.label),r.push(u),d===u)d=null})},text(m){if(d)d.title+=m.text}}).on(`${oe} a *`,{element(m){if(!d||d.symbol)return;let y=m.getAttribute("data-native-icon")||et(m.getAttribute("class")??"");if(y)d.symbol=yn(y,t)}}).transform(new Response(e)).text(),!p)return{html:e,chrome:null};let h=await new HTMLRewriter().on(oe,{element(m){m.remove()}}).on("script[data-stx-owner]",{element(m){if(s.has(m.getAttribute("data-stx-owner")??""))m.remove()}}).transform(new Response(e)).text(),f=(m)=>r.filter((y)=>y.region===m).map(({path:y,title:v,symbol:g})=>({path:y,title:v,...g?{symbol:g}:{}}));return{html:c.join(`
6
+ `)+h,chrome:{tabs:f("tabs"),bar:f("bar")}}}var Ne=/<script\b([^>]*\bdata-stx-scoped\b[^>]*)>([\s\S]*?)<\/script>/gi,Sn=/function\s+(__stx_setup_[\w$]+)\s*\(/,li=/\bdata-stx-owner\s*=\s*["']([^"']+)["']/i;function it(e){Ne.lastIndex=0;for(let t of e.matchAll(Ne)){let n=t[2].trim(),r=Sn.exec(n)?.[1];if(r)return{name:r,code:n}}return null}function wn(e){let t=[];Ne.lastIndex=0;for(let n of e.matchAll(Ne)){let r=n[1],s=n[2].trim(),o=li.exec(r)?.[1],c=/\bdata-stx-component-factories\b/i.test(r);if(!s||!o&&!c&&!Sn.test(s))continue;t.push(o?{code:s,owner:o}:{code:s})}return t}function di(){let e=[Z.join(import.meta.dir,"..","primitives"),Z.join(import.meta.dir,"native","primitives")];for(let t of e)if(ui(Z.join(t,"View.stx")))return t;return e[0]}async function fi(e,t,n={}){e=await ue(e);let r=n.root??Z.dirname(t),s=await a(r),o=typeof s.root==="string"&&s.root?Z.resolve(r,s.root):r,c=(E,O)=>E?Z.isAbsolute(E)?E:Z.resolve(o,E):Z.join(o,O),l={root:r,layoutsDir:c(s.layoutsDir,"layouts"),partialsDir:c(s.partialsDir,"partials"),storesDir:c(s.storesDir,"stores"),componentsDir:n.componentsDir??(s.componentsDir?c(s.componentsDir,"components"):Z.join(o,"components")),buildMode:"serve",cache:!1,_targetComponentDirs:[di()],_targetComponentFallbackNames:["Button","Checkbox","Switch","TextInput","Image","Video"],_nativeHostAttrs:!0,skipEventDirectives:!0,_pluginComponentDirs:s._pluginComponentDirs??[]},d={...n.context??{},__stx_inject_css:!1,__stx_native_screen:!0},p=new Set([t]),h=await i(e,d,t,l,p),f=[],{html:m,chrome:y}=await vn(await ue(h),(E)=>{f.push({kind:"unknown-icon",tag:"data-native-chrome",name:E})}),{html:v,manifest:g}=pt(await ue(m)),u=await Wt(r),{document:w,diagnostics:b}=await gn(u?`<style>${u}</style>${v}`:v,{source:t,script:rt(e)});b.unshift(...f),pi(w.root,g);let N=d.__stx_runtime_head;if(typeof N?.title==="string"&&N.title.trim())w.title=N.title.trim();if(y)w.chrome=y;let S=it(v),k=wn(v);if(rt(e).code.trim()){let E=await ps(e,t,n.context,{forceClientSetup:!0}),O=it(E.setupCode??"");if(S=O??S,O&&!k.some((V)=>V.code===O.code))k.push({code:O.code})}let{buildModuleRegistryScript:x,registeredModuleIdsIn:A,registeredModuleNamesIn:M}=await import("./chunk-803qm5tk.js"),j=async()=>{let E=[],O=k.map((T)=>T.code),V=await x(A(...O),{collectInputs:E,names:M(...O)});for(let T of E)p.add(T);return V},_=await j();if([...k.map((E)=>E.code),_??""].some((E)=>/\buseStore\s*\(/.test(E))&&/<script\b[^>]*\bdata-stx-stores\b/i.test(v)){let{getStoreScriptFor:E}=await import("./chunk-c5tkxjb0.js"),O=[...k],V="";for(let T=0;T<8;T++){let R=await E(l.storesDir,[...O.map((I)=>I.code),_],{sharedModules:!0});if(!R)break;if(R.stores.join()===V)break;V=R.stores.join(),k.splice(0,k.length,{code:R.code,...R.functions?{stores:R.functions}:{}},...O);for(let I of new Bun.Glob("*.ts").scanSync({cwd:l.storesDir,absolute:!0}))p.add(I);_=await j()}}if(_)k.unshift({code:_,registry:!0});return{document:w,manifest:g,setup:S,scripts:k,diagnostics:b,html:v,dependencies:[...p]}}function pi(e,t){let n=new Map(t.entries.map((o)=>[o.id,o])),r=t.entries.reduce((o,c)=>Math.max(o,c.id),-1)+1,s=(o)=>{if(o._templated?.length&&o.bindings){if(o.bindingId===void 0||!n.has(o.bindingId)){let l={id:o.bindingId??r++,bindings:[]};o.bindingId=l.id,n.set(l.id,l),t.entries.push(l)}let c=n.get(o.bindingId);for(let l of o._templated){let d=`:${l}`,p=Oe(d);if(p&&!c.bindings.some((h)=>h.name===d))c.bindings.push({name:d,value:o.bindings[l],kind:p})}}for(let c of o.children)if(typeof c!=="string")s(c)};s(e)}async function ke(e,t={}){return fi(await Bun.file(e).text(),e,t)}var so=Symbol("stx.nativeWebStorage.raw");var de="__app";var yi=(e)=>Bun.hash(e).toString(36);var bi=/^ {2}try \{ factories\[("[0-9a-f]+")\] = factories\[\1\] \|\| /gm,vi=/^\(function\(__scopeId\) \{([\s\S]*)\}\)\("([^"\\]+)"\);\s*$/;function st(e){if(!e.startsWith(`(function() {
7
+ const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
8
+ `)||!e.endsWith(`
9
+ })();`))return null;let t=[...e.matchAll(bi)];if(t.length===0)return null;let n=[],r=105;for(let[s,o]of t.entries()){if(o.index!==r)return null;let c=JSON.parse(o[1]),l=o.index+o[0].length,d=`; }
10
+ catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(c)} + ' failed to register; instances of it will not hydrate.', e); }`,p=e.indexOf(d,l);if(p<0||!e.slice(l,p).startsWith("function(__scopeId) {")&&!e.slice(l,p).startsWith("function (__scopeId) {"))return null;let h=t[s+1];if(r=p+d.length,h?e[r]!==`
11
+ `||h.index!==r+1:e.slice(r)!==`
12
+ })();`)return null;n.push({id:c,body:e.slice(l,p),text:e.slice(o.index,p+d.length)}),r=h?r+1:r}return n}function xn(e){let t=new Map;for(let{scripts:p}of e)for(let h of p)for(let f of(h.registry||h.owner?null:st(h.code))??[])t.set(f.body,f.id);let n=(p)=>t.get(p)??yi(p),r=new Map,s=(p)=>{let h=p.owner?vi.exec(p.code):null;return h?{body:`function(__scopeId) {${h[1]}}`,scope:h[2]}:null},o=(p,h)=>{let f=n(h),m=r.get(f)??new Set;m.add(p),r.set(f,m)},c=(p)=>(r.get(n(p))?.size??0)>1;for(let{name:p,scripts:h}of e)for(let f of h){if(f.registry)continue;for(let y of(f.owner?null:st(f.code))??[])o(p,y.body);let m=s(f);if(m)o(p,m.body);for(let y of f.stores??[])o(p,y)}let l=new Map,d=new Map;for(let{name:p,scripts:h}of e)d.set(p,h.map((f)=>{if(f.registry)return f;let m=f.owner?null:st(f.code);if(m){let v=m.filter((w)=>c(w.body));if(v.length===0)return f;for(let{body:w}of v)l.set(n(w),w);let g=m.filter((w)=>!v.includes(w)),u=v.map((w)=>JSON.stringify(w.id)).join(", ");return{...f,code:`(function() {
13
+ const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
14
+ ${g.map((w)=>`${w.text}
15
+ `).join("")} [${u}].forEach(function (id) { factories[id] = factories[id] || runtime.components[id]; });
16
+ })();`}}if(f.stores?.some(c)){for(let v of f.stores.filter(c))l.set(n(v),v);return{code:`;(function() {
17
+ ${f.stores.map((v)=>c(v)?`runtime.components[${JSON.stringify(n(v))}]();`:`(${v})();`).join(`
18
+ `)}
19
+ })();`}}let y=s(f);if(y&&c(y.body))return l.set(n(y.body),y.body),{...f,code:`runtime.components[${JSON.stringify(n(y.body))}](${JSON.stringify(y.scope)});`};return f}));return{bodies:l,screens:d}}var Si=[["props",()=>({})],["style",()=>({})],["events",()=>({})],["children",()=>[]],["_inlineStyle",()=>({})],["_styleSource",()=>""]];var wi=new Set(["text","html","show","if","for","model","class","style","ref"]);function xi(e){if(e.startsWith("@"))return"event";if(e.startsWith(":")&&wi.has(e.slice(1)))return e.slice(1);return"attr"}function Ni(e,t){if(typeof t==="string")return e==="";if(Array.isArray(t))return Array.isArray(e)&&e.length===0;return!!e&&typeof e==="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length===0}class ot extends Error{}function Nn(e){let t={...e};if(Object.prototype.hasOwnProperty.call(t,"~"))throw new ot;let n=0;if(Si.forEach(([r,s],o)=>{if(!Object.prototype.hasOwnProperty.call(t,r))n|=1<<o;else if(Ni(t[r],s()))delete t[r]}),Array.isArray(t.children))t.children=t.children.map((r)=>typeof r==="string"?r:Nn(r));if(n)t["~"]=n;return t}function kn(e){try{return{...e,root:Nn(e.root)}}catch(t){if(t instanceof ot)return null;throw t}}var ki=["kind","name","value"].join();function Tn(e){if(Object.keys(e).some((n)=>n!=="entries"))return null;let t=[];for(let n of e.entries){if(Object.keys(n).some((s)=>s!=="id"&&s!=="bindings"&&!(s==="template"&&n.template===!0)))return null;let r=[];for(let s of n.bindings){if(Object.keys(s).sort().join()!==ki||typeof s.value!=="string")return null;r.push(s.kind===xi(s.name)?[s.name,s.value]:[s.name,s.value,s.kind])}t.push(n.template?[n.id,r,1]:[n.id,r])}return t}async function Ri(e){try{let{loadCssEngineConfig:t}=await import("./chunk-wq1vs94k.js");return Nt(await t(e))}catch{return{}}}var Te="__runtime",_i="__messages";function Re(e){let n=[H.join(import.meta.dir,"..","runtime",`${e}.ts`),H.join(import.meta.dir,"..","runtime",`${e}.js`),H.join(import.meta.dir,"native","runtime",`${e}.js`)].find((r)=>En(r));if(!n)throw Error(`Native runtime module ${e} is missing`);return n}async function at(e,t,n,r,s){let o={name:"stx-screen-inputs",setup(l){l.onLoad({filter:/.*/,namespace:"file"},({path:d})=>{r.add(d);let p=s?.get(d);return p===void 0?void 0:{contents:p,loader:"js"}})}},c=await Bun.build({entrypoints:[e],target:"browser",format:"iife",minify:n,plugins:[o,...t],define:{"process.env.NODE_ENV":JSON.stringify(n?"production":"development")}});if(!c.success){let l=c.logs.map((d)=>String(d.message??d)).join(`
20
+ `);throw Error(`Could not bundle ${e}:
21
+ ${l}`)}return(await c.outputs[0].text()).trim()}function Ai(e,t){return Mr(e,t)}function Oi(e,t){return`export default globalThis.__stxNativeRuntime.messages(${JSON.stringify(e)}, ${JSON.stringify(t)});`}function Ii(e){let t=new Map;for(let[n,{language:r,area:s}]of e.files){let o=Oi(r,s);t.set(n,o),t.set(Ti(n),o)}return t}function An(e){let t=new Set;for(let n of e.matchAll(/__stxNativeRuntime\.messages\(\s*"[\w-]+"\s*,\s*"([\w/-]+)"\s*\)/g))t.add(n[1]);return[...t].sort()}function Ci(e,t){let n=H.isAbsolute(e.meta.source)?H.relative(t,e.meta.source).split(H.sep).join("/"):e.meta.source;return{...e,script:{exports:e.script.exports,functions:[],code:""},meta:{...e.meta,source:n,compiledAt:0}}}function Pi(e){let t=new Map,n=e.flatMap(({name:l,document:d})=>{let{_stylesheetRules:p,_stylesheetTheme:h}=d.root;return p===void 0&&h===void 0?[]:[{name:l,rules:p??{},theme:h}]});for(let{rules:l}of n)for(let[d,p]of Object.entries(l)){let h=JSON.stringify(p),f=t.get(d)??new Map,m=f.get(h);if(m)m.count++;else f.set(h,{value:p,count:1});t.set(d,f)}let r={},s=new Map;for(let[l,d]of t){let[p,h]=[...d].sort(([,f],[,m])=>m.count-f.count)[0];r[l]=h.value,s.set(l,p)}let o={},c=new Map;for(let{name:l,rules:d,theme:p}of n){let h={};for(let[m,y]of Object.entries(d))if(JSON.stringify(y)!==s.get(m))h[m]=y;let f=null;if(p!==void 0)f=Bun.hash(JSON.stringify(p)).toString(36),o[f]=p;c.set(l,{order:Object.keys(d),own:h,theme:f})}return{rules:r,themes:o,screens:c}}function Mi(e){let{_stylesheetRules:t,_stylesheetTheme:n,...r}=e.root;return{...e,root:r}}async function ct(e){let t=Object.keys(e.screens);if(t.length===0)throw Error("screens must name at least one .stx file");let n=e.routed??!0,r=e.initialScreen??t[0];if(!e.screens[r])throw Error(`Initial screen ${r} is not in screens`);let s=H.resolve(e.root??process.cwd());if(e.messages&&!e.routesDir)throw Error("messages ship a language at a time beside route files: they need routesDir");if(e.sharedRuntime&&!e.routesDir)throw Error("sharedRuntime is the route files' runtime: it needs routesDir");if(e.messages&&!e.sharedRuntime)throw Error("messages are read by the shared runtime: they need sharedRuntime");if(e.messages&&e.outFile)throw Error("messages leave the languages out of the screens' code, which the one-file bundle cannot read: build it without messages");let o=e.messages?await Ai(s,e.messages):null,c=e.styleConfig??await Ri(s),l=o?Ii(o):null,d=[],p=async()=>{for(let T of t){let R=H.resolve(s,e.screens[T]);if(!R.endsWith(".stx"))throw Error(`Screen ${T} must name a .stx file`);d.push({name:T,file:R,compiled:await ke(R,{root:s})})}};await xt(c,()=>l?es(l,p):p());let h=Re("jsc-globals"),f=Re("shared-screen"),m=e.app?H.resolve(s,e.app):null;if(m&&!En(m))throw Error(`The app script ${e.app} does not exist`);if(m&&!n)throw Error("An app script needs a routed bundle");if(m&&e.screens[de])throw Error(`${de} is the app script's route, not a screen name`);let y=e.browser;if(e.screens[Te])throw Error(`${Te} is the runtime prelude's file, not a screen name`);let v=mt();if(y&&e.routesDir)throw Error("A browser screen is one route; routesDir is for device hosts");let g=new Set(d.flatMap(({compiled:T})=>T.dependencies)),u=null;if(e.routesDir&&e.sharedRuntime&&e.shareModules!==!1&&process.env.STX_NATIVE_SHARE_MODULES!=="0"){let T=[],R=d.map(({name:D,compiled:F})=>{let B=F.scripts.filter((W)=>!W.registry).map((W)=>W.code);return{name:D,ids:Dr(...B),names:Qs(...B)}}),I=()=>eo(R,{collectInputs:T});if(u=await(l?es(l,I):I()),u)for(let D of T)g.add(D)}let w=u,b=e.routesDir&&e.sharedRuntime&&e.shareModules!==!1&&process.env.STX_NATIVE_SHARE_MODULES!=="0"?xn(d.map(({name:T,compiled:R})=>({name:T,scripts:R.scripts}))):null,N=Pi(d.map(({name:T,compiled:R})=>({name:T,document:R.document}))),S=(T,R,I)=>{let D=n?`var routeName = g.__stxNativeRoute || ${JSON.stringify(r)};
22
+ var isApp = ${m?`routeName === ${JSON.stringify(de)}`:"false"};
23
+ if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));
24
+ if (isApp ? ${!R} : ${JSON.stringify(T.map(({name:U})=>U))}.indexOf(routeName) === -1) throw new Error(['This bundle does not hold the native screen', routeName].join(' '));`:`var routeName = 'main';
25
+ var isApp = false;`,F=T.map(({name:U,compiled:J},te)=>{let q=I?N.screens.get(U):void 0,lt=Ci(q?Mi(J.document):J.document,s),ut=I?kn(lt):null,dt=I?Tn(J.manifest):null;return`${te===0?"if":"else if"} (routeName === ${JSON.stringify(n?U:"main")}) {
26
+ nativeDocument = ${ut?`runtime.document(${JSON.stringify(ut)})`:JSON.stringify(lt)};${q?`
27
+ nativeDocument.root._stylesheetRules = runtime.stylesheetRules(${JSON.stringify(q.order)}, ${JSON.stringify(q.own)});${q.theme?`
28
+ nativeDocument.root._stylesheetTheme = runtime.themes[${JSON.stringify(q.theme)}];`:""}`:""}
29
+ manifest = ${dt?`runtime.manifest(${JSON.stringify(dt)})`:JSON.stringify(J.manifest)};
30
+ }`}).join(`
31
+ `),B=T.map(({name:U,compiled:J},te)=>`${te===0?"if":"else if"} (routeName === ${JSON.stringify(n?U:"main")}) {
32
+ g.__stx_latestSetup = null;
33
+ ${(I&&b?.screens.get(U)||J.scripts).map((q)=>I&&q.registry&&w?.routes.has(U)?w.routes.get(U):q.owner?` g.__stx_componentSetups = g.__stx_componentSetups || {};
34
+ // Kept by id as well as run once: a :for or :if clone of this component
35
+ // has no script to copy, and is set up from this (component hydration).
36
+ g.__stx_componentSetups[${JSON.stringify(q.owner)}] = function() {
37
+ ${q.code}
38
+ };
39
+ g.__STX_SETUP_ROOT__ = screen && screen.scopeRoot(${JSON.stringify(q.owner)});
40
+ try { g.__stx_componentSetups[${JSON.stringify(q.owner)}](); }
41
+ finally { g.__STX_SETUP_ROOT__ = null; }`:q.code).join(`
42
+ `)}
43
+ }`).join(`
44
+ `),W=R&&m,P=y?Re("browser-screen"):null,L=y?Bun.resolveSync(y.platformModule,s):null;return`
45
+ ${I?`var runtime = globalThis.__stxNativeRuntime;
46
+ if (!runtime || runtime.version !== ${JSON.stringify(I)}) throw new Error('This screen needs the stx native runtime it was built with: evaluate ${Te}.js from the same build first');
47
+ var installJSCGlobals = runtime.installJSCGlobals;
48
+ var prepareNativeApp = runtime.prepareNativeApp;
49
+ var prepareSharedNativeScreen = runtime.prepareSharedNativeScreen;`:`import { installJSCGlobals } from ${JSON.stringify(h)};
50
+ import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(f)};`}
51
+ ${y?`import { createBrowserScreenBridge } from ${JSON.stringify(P)};
52
+ import { createBrowserPlatform } from ${JSON.stringify(L)};`:""}
53
+ ${W?`import * as nativeAppModule from ${JSON.stringify(m)};`:"var nativeAppModule = null;"}
54
+ ${y?"(async function() {":""}
55
+ var g = globalThis;
56
+ installJSCGlobals(g);
57
+ g.__stxNativeStyleConfig = ${I?"runtime.styleConfig":JSON.stringify(c)};
58
+ ${y?`var browserPlatform = await createBrowserPlatform(${JSON.stringify(y.platformOptions??{})});
59
+ var browserBridge = createBrowserScreenBridge(browserPlatform, ${JSON.stringify(y)});
60
+ var bridge = browserBridge;
61
+ g.__stxNativeRoute = ${JSON.stringify(r)};`:"var bridge = g.__stxNativeBridge;"}
62
+ if (!bridge) throw new Error('Missing __stxNativeBridge');
63
+ var routeNames = ${I?"runtime.routeNames":JSON.stringify(n?t:["main"])};
64
+ var shareStorage = ${I?"runtime.shareStorage":JSON.stringify(e.shareStorage??{})};
65
+ ${D}
66
+ g.__stxNativeRoute = routeName;
67
+ var nativeDocument;
68
+ var manifest;
69
+ ${F}
70
+ var screen = null;
71
+ var app = null;
72
+ if (isApp) {
73
+ app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames, shareStorage: shareStorage });
74
+ g.__stxNativeUnmount = function() { app.unmount(); };
75
+ }
76
+ else {
77
+ screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames, shareStorage: shareStorage });
78
+ g.__stx_host = screen.host;
79
+ g.__stxNativeUnmount = function() { screen.unmount(); };
80
+ }
81
+ ${I?"runtime.startSignals();":v}
82
+ var pageSetup = g.__stx_latestSetup;
83
+ var pageRuntimeSetup = g.stx && g.stx._latestSetup;
84
+ ${B}
85
+ // The screen's setup is the native host's to run. A screen script publishes
86
+ // it where a page's document runtime adopts its own, and in a browser that
87
+ // runtime's DOMContentLoaded and stx:load ran it a second time: another copy
88
+ // of the screen, mounted beside this one. Take it, and hand the page back
89
+ // whatever setup it had.
90
+ var screenSetup = g.__stx_latestSetup || null;
91
+ g.__stx_latestSetup = pageSetup;
92
+ if (g.stx) g.stx._latestSetup = pageRuntimeSetup || null;
93
+ if (isApp) app.start(nativeAppModule);
94
+ else screen.mount(g.stx, screenSetup);
95
+ ${y?`var stopApp = nativeAppModule && typeof nativeAppModule.default === 'function' ? nativeAppModule.default(g.craft) : null;
96
+ var unmount = g.__stxNativeUnmount;
97
+ var ended = false;
98
+ g.__stxNativeUnmount = function() { if (ended) return; ended = true; if (typeof stopApp === 'function') stopApp(); unmount(); browserBridge.dispose(); };
99
+ g.addEventListener('pagehide', function(event) { if (!event.persisted) g.__stxNativeUnmount(); });
100
+ })().catch(function(error) { console.error('[stx browser screen]', error); var node = document.querySelector(${JSON.stringify(y.container)}); if (node) { node.textContent = 'This screen could not start. Reload to try again.'; node.setAttribute('role', 'alert'); } });`:""}
101
+ `},k=(T)=>({name:"stx-native-shared-screens",setup(R){R.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),R.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:T,loader:"js"}))}}),x=d.flatMap(({compiled:T})=>T.diagnostics).map((T)=>({level:"warning",message:[T.kind,T.tag,T.name].filter(Boolean).join(": ")})),A=d.filter(({compiled:T})=>T.document.chrome),M=A.length?{chrome:Object.fromEntries(A.map(({name:T,compiled:R})=>[T,R.document.chrome]))}:{},j=e.minify??!1,_,C,E;if(e.routesDir){let T=H.resolve(s,e.routesDir);Rn(T,{recursive:!0});let R=`
102
+ import { installJSCGlobals } from ${JSON.stringify(h)};
103
+ import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(f)};
104
+ ${e.sharedRuntime?`import { expandDocument, expandManifest } from ${JSON.stringify(Re("compact-document"))};`:"var expandDocument = null, expandManifest = null;"}
105
+ globalThis.__stxNativeRuntime = {
106
+ version: '__STX_NATIVE_RUNTIME_VERSION__',
107
+ // What every route of this build shares, held once instead of in each
108
+ // route file: the app's style vocabulary, its route names and shared
109
+ // storage keys, and the rules and themes of the stylesheets its screens carry.
110
+ styleConfig: ${JSON.stringify(c)},
111
+ routeNames: ${JSON.stringify(n?t:["main"])},
112
+ shareStorage: ${JSON.stringify(e.shareStorage??{})},
113
+ stylesheetRules: function(order, own) {
114
+ var rules = {};
115
+ var shared = this.rules;
116
+ for (var i = 0; i < order.length; i++) rules[order[i]] = Object.prototype.hasOwnProperty.call(own, order[i]) ? own[order[i]] : shared[order[i]];
117
+ return rules;
118
+ },
119
+ rules: ${JSON.stringify(N.rules)},
120
+ themes: ${JSON.stringify(N.themes)},
121
+ // The modules more than one route reaches (client-module-registry.ts),
122
+ // each run the first time a route asks for it, and once.
123
+ chunks: {${w?[...w.chunks].map(([P,L])=>`
124
+ ${JSON.stringify(P)}: ${L}`).join(","):""}},
125
+ // The component code the routes have in common: the functions that set up
126
+ // a component, by content, which a route's factories and calls name.
127
+ components: {${b?[...b.bodies].sort(([P],[L])=>P<L?-1:1).map(([P,L])=>`
128
+ ${JSON.stringify(P)}: ${L}`).join(","):""}},
129
+ chunk: function(name) {
130
+ var loaded = this.loaded || (this.loaded = {});
131
+ if (Object.prototype.hasOwnProperty.call(loaded, name)) return loaded[name];
132
+ var runtime = this;
133
+ return (loaded[name] = this.chunks[name](function(chunk) { return runtime.chunk(chunk); }));
134
+ },
135
+ // A route's document and binding manifest, as compact as it carries them (compact-document.ts).
136
+ document: expandDocument,
137
+ manifest: expandManifest,
138
+ installJSCGlobals: installJSCGlobals,
139
+ prepareNativeApp: prepareNativeApp,
140
+ prepareSharedNativeScreen: prepareSharedNativeScreen,
141
+ // Each screen starts its own signals runtime, after its host is in place.
142
+ startSignals: function() {
143
+ ${v}
144
+ },
145
+ // A language's messages for an area (the compile's \`messages\`), read the
146
+ // first time they are looked into: a screen never parses a language it
147
+ // is not shown in, nor an area it does not use.
148
+ messages: function(language, area) {
149
+ var g = globalThis;
150
+ var loaded = g.__stxNativeMessages || (g.__stxNativeMessages = {});
151
+ function table() {
152
+ var forLanguage = loaded[language] || (loaded[language] = {});
153
+ if (Object.prototype.hasOwnProperty.call(forLanguage, area)) return forLanguage[area];
154
+ var value = null;
155
+ if (typeof g.__stxNativeReadMessages === 'function') {
156
+ try {
157
+ var text = g.__stxNativeReadMessages(language, area);
158
+ if (typeof text === 'string') value = JSON.parse(text);
159
+ }
160
+ catch (error) { console.error('[stx native] could not read the ' + language + ' messages for ' + area, error); }
161
+ }
162
+ forLanguage[area] = value;
163
+ return value;
164
+ }
165
+ var own = Object.prototype.hasOwnProperty;
166
+ return new Proxy({}, {
167
+ get: function(target, name) { var messages = table(); return messages && own.call(messages, name) ? messages[name] : undefined; },
168
+ has: function(target, name) { var messages = table(); return !!messages && own.call(messages, name); },
169
+ ownKeys: function() { var messages = table(); return messages ? Object.keys(messages) : []; },
170
+ getOwnPropertyDescriptor: function(target, name) {
171
+ var messages = table();
172
+ return messages && own.call(messages, name) ? { value: messages[name], writable: false, enumerable: true, configurable: true } : undefined;
173
+ },
174
+ });
175
+ },
176
+ };
177
+ `,I,D=H.join(T,`${Te}.js`);if(e.sharedRuntime){let P=await at("stx:native-shared-screens",[k(R)],j,g);I=Bun.hash(P).toString(36),C=D,await Bun.write(C,P.replace("__STX_NATIVE_RUNTIME_VERSION__",I))}else _n(D,{force:!0});let F=H.join(T,_i);_n(F,{recursive:!0,force:!0});let B={},W=[...d.map((P)=>({name:P.name,screens:[P],app:!1})),...m?[{name:de,screens:[],app:!0}]:[]];_={};for(let P=0;P<W.length;P+=6)await Promise.all(W.slice(P,P+6).map(async(L)=>{let Y=H.join(T,`${L.name}.js`),Q=await at("stx:native-shared-screens",[k(S(L.screens,L.app,I))],j,g,l??void 0);if(await Bun.write(Y,Q),_[L.name]=Y,o){let U=new Set(An(Q));for(let J of w?.reads.get(L.name)??[])for(let te of An(w?.chunks.get(J)??""))U.add(te);B[L.name]=[...U].sort()}}));if(o){for(let[L,Y]of o.data)for(let[Q,U]of Y)await Bun.write(H.join(F,L,`${Q}.json`),U);let P=Object.fromEntries(Object.keys(B).sort().map((L)=>[L,B[L]]));await Bun.write(H.join(F,"routes.json"),JSON.stringify(P));for(let L of o.files.keys())g.add(L);E={dir:F,languages:[...o.data.keys()],routes:P}}if(!e.outFile)return{code:"",routes:_,runtime:C,...E?{messages:E}:{},...M,diagnostics:x,dependencies:[...g]}}let O=await at("stx:native-shared-screens",[k(S(d,!0))],j,g);if(!e.outFile)return{code:O,...M,diagnostics:x,dependencies:[...g]};let V=H.resolve(s,e.outFile);return Rn(H.dirname(V),{recursive:!0}),await Bun.write(V,O),{code:O,outFile:V,..._?{routes:_,runtime:C}:{},...E?{messages:E}:{},...M,diagnostics:x,dependencies:[...g]}}async function Bi(e,t={}){return ct({...t,screens:{main:e},routed:!1})}function On(e,t={}){return Bi(e,t)}var In=["native.config.json","stx-native.config.json"];function $i(e=process.cwd(),t){let n=t?G.resolve(e,t):In.map((d)=>G.join(e,d)).find((d)=>_e(d));if(!n)return null;if(!_e(n))throw Error(`Native config not found: ${n}`);let r=JSON.parse(Li(n,"utf8")),s=Object.entries(r.screens??{});if(s.length===0)throw Error(`${G.basename(n)} must name at least one screen in "screens"`);let o={};for(let[d,p]of s){if(!/^[A-Z][\w-]*$/i.test(d))throw Error(`Invalid native screen name: ${d}`);if(typeof p!=="string"||!p.endsWith(".stx"))throw Error(`Screen ${d} must name a .stx file`);if(o[d]=G.resolve(G.dirname(n),p),!_e(o[d]))throw Error(`Screen ${d} not found: ${o[d]}`)}let c=r.initialScreen||s[0][0];if(!o[c])throw Error(`Initial screen ${c} is not in screens`);if(r.app!==void 0&&typeof r.app!=="string")throw Error(`"app" must name the app script's file`);let l=r.app?G.resolve(G.dirname(n),r.app):void 0;if(l&&!_e(l))throw Error(`App script not found: ${l}`);return{initialScreen:c,screens:o,file:n,...l?{app:l}:{}}}async function Va(e,t={}){let n=G.resolve(t.cwd??process.cwd()),r=t.format??"ir";if(r!=="ir"&&r!=="bundle")throw Error(`Unknown compile format: ${r}. Expected ir or bundle.`);let s=e?null:$i(n,t.config);if(!e&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${In[0]}`);let o,c=[];if(r==="bundle"){let d=s?await ct({screens:s.screens,initialScreen:s.initialScreen,minify:t.minify,root:n,...s.app?{app:s.app}:{}}):await On(G.resolve(n,e),{minify:t.minify});o=d.code,c=d.diagnostics}else{let d=async(h)=>{let f=await ke(h);return c.push(...f.diagnostics.map((m)=>({level:"warning",message:[m.kind,m.tag,m.name].filter(Boolean).join(": ")}))),f.document},p=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([h,f])=>[h,await d(f)])))}:await d(G.resolve(n,e));o=JSON.stringify(p,null,2)}if(!t.output)return{output:o,diagnostics:c};let l=G.resolve(n,t.output);return Di(G.dirname(l),{recursive:!0}),await Bun.write(l,o),{output:o,written:l,diagnostics:c}}export{Va as runNativeCompile};