@stacksjs/stx 0.2.837 → 0.2.839

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 (238) hide show
  1. package/dist/builtins/image-delivery.js +7 -3
  2. package/dist/chunk-02cntwd8.js +2 -0
  3. package/dist/chunk-07hvjvj1.js +2 -0
  4. package/dist/{chunk-gh62p9mx.js → chunk-11y84h2d.js} +2 -2
  5. package/dist/{chunk-3bjnrmha.js → chunk-1b1ntgt7.js} +2 -2
  6. package/dist/{chunk-z25w7kmr.js → chunk-1m16mvt4.js} +4 -4
  7. package/dist/{chunk-rj68w7em.js → chunk-1zfxmjrf.js} +55 -55
  8. package/dist/{chunk-4ntm3dtk.js → chunk-23r3rby6.js} +2 -2
  9. package/dist/chunk-23zzbsms.js +2 -0
  10. package/dist/{chunk-ya6bp08c.js → chunk-2fj5zev7.js} +1 -1
  11. package/dist/{chunk-29f6vmyz.js → chunk-2j5yane9.js} +4 -4
  12. package/dist/chunk-2pgc087j.js +2 -0
  13. package/dist/{chunk-yeg4cahs.js → chunk-31cnrpd1.js} +9 -9
  14. package/dist/{chunk-ac9ncbfw.js → chunk-321e41ck.js} +3 -3
  15. package/dist/{chunk-hrcpq9k1.js → chunk-3tydmgwh.js} +5 -5
  16. package/dist/chunk-41sh9y5w.js +2 -0
  17. package/dist/chunk-4654xm1h.js +2 -0
  18. package/dist/{chunk-amg6kr1p.js → chunk-4657mnht.js} +4 -4
  19. package/dist/{chunk-s33andzg.js → chunk-4dxq7ft1.js} +2 -2
  20. package/dist/chunk-4eagsz5d.js +2 -0
  21. package/dist/{chunk-f7jgda7x.js → chunk-4j08cbjd.js} +5 -5
  22. package/dist/{chunk-ykyf7513.js → chunk-4w3qpewn.js} +3 -3
  23. package/dist/{chunk-tx8wk6h7.js → chunk-4y6hes3h.js} +2 -2
  24. package/dist/chunk-53j9wakh.js +2 -0
  25. package/dist/{chunk-j97zjjkh.js → chunk-5hmm01av.js} +5 -5
  26. package/dist/chunk-5t93dqft.js +2 -0
  27. package/dist/{chunk-2x9zhezb.js → chunk-6wrf6302.js} +2 -2
  28. package/dist/chunk-78nsbzcm.js +2 -0
  29. package/dist/{chunk-vpnyqf0h.js → chunk-7cg2f588.js} +4 -4
  30. package/dist/chunk-7ka7pvj9.js +2 -0
  31. package/dist/chunk-7m0r7mq9.js +2 -0
  32. package/dist/chunk-7mz6ze0x.js +2 -0
  33. package/dist/{chunk-ckg6q98b.js → chunk-7t57cnz9.js} +5 -5
  34. package/dist/chunk-7t9951at.js +2 -0
  35. package/dist/{chunk-jr0r5pzw.js → chunk-7vhm0jj5.js} +2 -2
  36. package/dist/{chunk-vfj9wp11.js → chunk-8370x30n.js} +2 -2
  37. package/dist/chunk-8913k8g7.js +3 -0
  38. package/dist/{chunk-txd2js5v.js → chunk-89d3h8mp.js} +14 -14
  39. package/dist/chunk-8byydry7.js +2 -0
  40. package/dist/chunk-8c363c2r.js +2 -0
  41. package/dist/chunk-8em568fw.js +2 -0
  42. package/dist/{chunk-n0zdxcfh.js → chunk-8h0pnn5p.js} +6 -6
  43. package/dist/{chunk-em8tv6nz.js → chunk-8pj4v1eh.js} +2 -2
  44. package/dist/{chunk-8z1p3mag.js → chunk-8q3pyq6a.js} +3 -3
  45. package/dist/{chunk-z0ynyz62.js → chunk-8qbp5skx.js} +7 -7
  46. package/dist/chunk-8w0n2rae.js +2 -0
  47. package/dist/{chunk-9snk4mzf.js → chunk-8y3f5fyg.js} +6 -6
  48. package/dist/chunk-8z3yjex0.js +2 -0
  49. package/dist/chunk-8zzepd7g.js +2 -0
  50. package/dist/{chunk-c3dg8qdn.js → chunk-97k72dfh.js} +2 -2
  51. package/dist/chunk-98258444.js +2 -0
  52. package/dist/{chunk-s53wjw7y.js → chunk-9xps62ek.js} +2 -2
  53. package/dist/{chunk-52g026sc.js → chunk-a1s5wqw4.js} +2 -2
  54. package/dist/{chunk-myje6fhm.js → chunk-a9tzjqny.js} +5 -5
  55. package/dist/{chunk-ztkd6mxj.js → chunk-aekq1zyn.js} +6 -6
  56. package/dist/chunk-aywvbcae.js +2 -0
  57. package/dist/chunk-aza2zrhk.js +54 -0
  58. package/dist/chunk-b0fkvrat.js +2 -0
  59. package/dist/chunk-b6w3457c.js +2 -0
  60. package/dist/{chunk-fvgk1w9s.js → chunk-bp918end.js} +2 -2
  61. package/dist/chunk-bq7qcndg.js +3 -0
  62. package/dist/chunk-c18pafmf.js +3 -0
  63. package/dist/chunk-c2v38ghp.js +2 -0
  64. package/dist/{chunk-c9vxm8yq.js → chunk-ca3c5qx2.js} +31 -31
  65. package/dist/chunk-cax1wts7.js +2 -0
  66. package/dist/{chunk-vkynagtn.js → chunk-cw1ar3dq.js} +4 -4
  67. package/dist/{chunk-bky02g7k.js → chunk-d0dzzpfx.js} +2 -2
  68. package/dist/{chunk-sz88tmbm.js → chunk-d1vkjxb1.js} +5 -5
  69. package/dist/chunk-d2mdh669.js +2 -0
  70. package/dist/chunk-d44g9sek.js +2 -0
  71. package/dist/chunk-d5vr9g4b.js +2 -0
  72. package/dist/{chunk-yw1s8kyj.js → chunk-dgn87554.js} +4 -4
  73. package/dist/{chunk-8q7ah3ct.js → chunk-efdfkfp1.js} +3 -3
  74. package/dist/{chunk-33czswpt.js → chunk-f1hkagxk.js} +3 -3
  75. package/dist/chunk-f69cmsz9.js +2 -0
  76. package/dist/{chunk-55e46spy.js → chunk-g7rsd8st.js} +5 -5
  77. package/dist/chunk-gaxx0z19.js +2 -0
  78. package/dist/chunk-gft9pg9n.js +2 -0
  79. package/dist/{chunk-3y9jtfzr.js → chunk-gpschnvk.js} +12 -12
  80. package/dist/chunk-h8h79939.js +2 -0
  81. package/dist/{chunk-q5pwvr98.js → chunk-jc5y35b7.js} +1 -1
  82. package/dist/{chunk-3r65z9vs.js → chunk-jjyt3tsv.js} +2 -2
  83. package/dist/{chunk-q14j0wsq.js → chunk-jzh0n2ct.js} +9 -9
  84. package/dist/{chunk-vfxkn1pe.js → chunk-kd6r7z27.js} +3 -3
  85. package/dist/chunk-ksc83y9t.js +2 -0
  86. package/dist/{chunk-02kycznh.js → chunk-ksr6c2kh.js} +5 -5
  87. package/dist/{chunk-rnm8ejpz.js → chunk-m5bj2jnb.js} +2 -2
  88. package/dist/chunk-mad4g0yx.js +2 -0
  89. package/dist/{chunk-b7tb00nz.js → chunk-mhyd24bg.js} +2 -2
  90. package/dist/chunk-mtjt2z77.js +2 -0
  91. package/dist/{chunk-0psdpeq8.js → chunk-mv49hr9y.js} +1 -1
  92. package/dist/chunk-mzj71r0m.js +3 -0
  93. package/dist/chunk-n7pvz99f.js +2 -0
  94. package/dist/chunk-n8a4jm0p.js +3 -0
  95. package/dist/chunk-nb2tedk0.js +2 -0
  96. package/dist/chunk-ndyj1d0z.js +2 -0
  97. package/dist/{chunk-n4qznmkm.js → chunk-ngnr831a.js} +5 -5
  98. package/dist/chunk-nhk0aat9.js +2 -0
  99. package/dist/{chunk-vntth7mg.js → chunk-nk7nxzxf.js} +2 -2
  100. package/dist/chunk-np6h1ct6.js +2 -0
  101. package/dist/{chunk-50w73wey.js → chunk-nsnzgdjt.js} +1 -1
  102. package/dist/{chunk-7y78ffds.js → chunk-p83h2dbg.js} +52 -52
  103. package/dist/{chunk-dv11h4f0.js → chunk-p9d2txcg.js} +1 -1
  104. package/dist/chunk-phxkmjnw.js +2 -0
  105. package/dist/chunk-pjkdn8zf.js +2 -0
  106. package/dist/{chunk-64b0yzrm.js → chunk-pqg6j26p.js} +3 -3
  107. package/dist/{chunk-xtqapjz3.js → chunk-q0s0kc66.js} +2 -2
  108. package/dist/chunk-q88w2rv9.js +2 -0
  109. package/dist/{chunk-v3xyb3ws.js → chunk-qfvddpcg.js} +2 -2
  110. package/dist/{chunk-e75dntfb.js → chunk-qk079ca7.js} +2 -2
  111. package/dist/{chunk-a40hrcq2.js → chunk-r0ssa1xd.js} +2 -2
  112. package/dist/chunk-r5bhgyes.js +2 -0
  113. package/dist/chunk-rdn1d4bf.js +42 -0
  114. package/dist/{chunk-7bvvv74e.js → chunk-rk2ex6qx.js} +3 -3
  115. package/dist/chunk-rmc6dfj4.js +2 -0
  116. package/dist/chunk-rsn9rh07.js +2 -0
  117. package/dist/chunk-rt29w5ns.js +2 -0
  118. package/dist/chunk-ryrdx5mw.js +2 -0
  119. package/dist/chunk-rzfbffnv.js +2 -0
  120. package/dist/chunk-s85chp3w.js +2 -0
  121. package/dist/chunk-s92f8w68.js +2 -0
  122. package/dist/chunk-sm9f980t.js +2 -0
  123. package/dist/chunk-st75663x.js +2 -0
  124. package/dist/chunk-sv2d6nfe.js +2 -0
  125. package/dist/{chunk-7k9yahng.js → chunk-t0jed809.js} +6 -6
  126. package/dist/{chunk-s5dhvnnd.js → chunk-t3p0jy0s.js} +6 -6
  127. package/dist/{chunk-f49x34sr.js → chunk-v3q126ys.js} +2 -2
  128. package/dist/{chunk-ees0kc6z.js → chunk-v49rvx9y.js} +114 -114
  129. package/dist/{chunk-kw5gra2z.js → chunk-v4ybemgb.js} +2 -2
  130. package/dist/chunk-vcx6dy59.js +2 -0
  131. package/dist/{chunk-q3pw43jm.js → chunk-vr6qa0g2.js} +14 -14
  132. package/dist/chunk-w5h67xec.js +2 -0
  133. package/dist/{chunk-vyv76w55.js → chunk-wbgc2n04.js} +2 -2
  134. package/dist/{chunk-p5r2p459.js → chunk-whmqfr3y.js} +6 -6
  135. package/dist/{chunk-nyg0nbjj.js → chunk-x110ssw2.js} +3 -3
  136. package/dist/{chunk-fwktw49p.js → chunk-x4f7efgp.js} +6 -6
  137. package/dist/chunk-x5wkbcsf.js +2 -0
  138. package/dist/{chunk-w0a6yz73.js → chunk-xbcnnk8x.js} +5 -5
  139. package/dist/{chunk-84nw3921.js → chunk-xmsf1bnx.js} +3 -3
  140. package/dist/{chunk-af50ebx1.js → chunk-xvhxxj4g.js} +92 -92
  141. package/dist/{chunk-dhdezdt2.js → chunk-xx3reejx.js} +2 -2
  142. package/dist/chunk-y64qhgv1.js +2 -0
  143. package/dist/{chunk-52t0qpx6.js → chunk-y68xstqy.js} +1 -1
  144. package/dist/chunk-yg5a54pj.js +2 -0
  145. package/dist/chunk-yjskeqaj.js +2 -0
  146. package/dist/{chunk-qmqc9p98.js → chunk-yn17484y.js} +6 -6
  147. package/dist/{chunk-dc0cde6n.js → chunk-ynf16yz4.js} +3 -3
  148. package/dist/chunk-yxqzarzh.js +2 -0
  149. package/dist/chunk-z4g64re8.js +3 -0
  150. package/dist/{chunk-ms3v5nat.js → chunk-zg44cf8a.js} +7 -7
  151. package/dist/{chunk-s6r54dyf.js → chunk-zjqvbcwa.js} +2 -2
  152. package/dist/{chunk-0rvntfhj.js → chunk-zvy88beh.js} +3 -3
  153. package/dist/{chunk-ycf2qbmz.js → chunk-zyeg9t2t.js} +2 -2
  154. package/dist/cli.js +20 -20
  155. package/dist/compression.js +3 -3
  156. package/dist/craft-entry.js +2 -2
  157. package/dist/craft.js +2 -2
  158. package/dist/dev-server/port-utils.js +2 -1
  159. package/dist/expressions.js +1 -1
  160. package/dist/html-masking.d.ts +2 -0
  161. package/dist/html-masking.js +23 -0
  162. package/dist/image-optimization/processor.js +2 -2
  163. package/dist/includes.js +5 -4
  164. package/dist/misc-directives.js +2 -2
  165. package/dist/pwa.js +3 -3
  166. package/dist/ssg.js +16 -16
  167. package/dist/utils.js +37 -7
  168. package/package.json +5 -5
  169. package/dist/chunk-0a36jnq4.js +0 -2
  170. package/dist/chunk-0rnfywsx.js +0 -2
  171. package/dist/chunk-1bpx9b0m.js +0 -2
  172. package/dist/chunk-1n04yp1x.js +0 -2
  173. package/dist/chunk-205gzszh.js +0 -54
  174. package/dist/chunk-29ptxt2j.js +0 -2
  175. package/dist/chunk-2nxxhcyy.js +0 -2
  176. package/dist/chunk-3ahpedfv.js +0 -3
  177. package/dist/chunk-68f2xqw4.js +0 -2
  178. package/dist/chunk-6aak0b7c.js +0 -2
  179. package/dist/chunk-6cv4kv7w.js +0 -2
  180. package/dist/chunk-72n804gy.js +0 -2
  181. package/dist/chunk-7efkc3gk.js +0 -2
  182. package/dist/chunk-830s2hfc.js +0 -2
  183. package/dist/chunk-87599134.js +0 -2
  184. package/dist/chunk-91zpxwx0.js +0 -2
  185. package/dist/chunk-9w3r1ch2.js +0 -3
  186. package/dist/chunk-a1hxz8q4.js +0 -2
  187. package/dist/chunk-a4k7neqx.js +0 -2
  188. package/dist/chunk-a579jdwb.js +0 -2
  189. package/dist/chunk-ahd8jdzx.js +0 -2
  190. package/dist/chunk-ay7ggc4k.js +0 -2
  191. package/dist/chunk-bc4x45vx.js +0 -2
  192. package/dist/chunk-c7hw37ww.js +0 -2
  193. package/dist/chunk-ca8bj7ga.js +0 -2
  194. package/dist/chunk-cfrgrnej.js +0 -2
  195. package/dist/chunk-chcvz6y7.js +0 -42
  196. package/dist/chunk-cw8vpk41.js +0 -2
  197. package/dist/chunk-d75s3a90.js +0 -2
  198. package/dist/chunk-db1c0c3c.js +0 -2
  199. package/dist/chunk-dkh794nh.js +0 -2
  200. package/dist/chunk-f6vzn90z.js +0 -2
  201. package/dist/chunk-gcxtgezg.js +0 -2
  202. package/dist/chunk-gtj8wy95.js +0 -2
  203. package/dist/chunk-h4tbpr7p.js +0 -2
  204. package/dist/chunk-hjvv9dbw.js +0 -2
  205. package/dist/chunk-hqp6cj7g.js +0 -2
  206. package/dist/chunk-j0w048sj.js +0 -2
  207. package/dist/chunk-jd5e3s4e.js +0 -2
  208. package/dist/chunk-k761q7s7.js +0 -2
  209. package/dist/chunk-k79ftcxh.js +0 -2
  210. package/dist/chunk-m3tnxk01.js +0 -2
  211. package/dist/chunk-mad9bbcp.js +0 -2
  212. package/dist/chunk-mca71wrp.js +0 -2
  213. package/dist/chunk-mdtysd2d.js +0 -2
  214. package/dist/chunk-mjf4naae.js +0 -3
  215. package/dist/chunk-nmtya57z.js +0 -3
  216. package/dist/chunk-nxfyjw59.js +0 -2
  217. package/dist/chunk-pe5qqem0.js +0 -2
  218. package/dist/chunk-ptcvxx5v.js +0 -2
  219. package/dist/chunk-pvab0bq4.js +0 -2
  220. package/dist/chunk-pwv77cyb.js +0 -2
  221. package/dist/chunk-qaswy58a.js +0 -2
  222. package/dist/chunk-qgrhcg7f.js +0 -2
  223. package/dist/chunk-ra967vfn.js +0 -3
  224. package/dist/chunk-s3j5vxy9.js +0 -3
  225. package/dist/chunk-t612xpa4.js +0 -2
  226. package/dist/chunk-tesbhpbp.js +0 -2
  227. package/dist/chunk-tvw571ab.js +0 -2
  228. package/dist/chunk-txzap6yn.js +0 -2
  229. package/dist/chunk-vqpypnys.js +0 -2
  230. package/dist/chunk-w39cfxa6.js +0 -2
  231. package/dist/chunk-wrr61y84.js +0 -2
  232. package/dist/chunk-x50xn4w1.js +0 -2
  233. package/dist/chunk-xefcgvy6.js +0 -2
  234. package/dist/chunk-xhabjf42.js +0 -2
  235. package/dist/chunk-xrspzeqx.js +0 -2
  236. package/dist/chunk-y191vfqa.js +0 -2
  237. package/dist/chunk-y2sdtw2t.js +0 -2
  238. package/dist/chunk-zrrxw94h.js +0 -2
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function xl(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Sl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function kl(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function _g(n,s){let e=xl(n),a=s&&d.existsSync(s)?Sl(s):[];return kl([...e,...a])}function Cg(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function Sl(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function kl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function _l(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Cg(n,s){let e=Sl(n),a=s&&d.existsSync(s)?kl(s):[];return _l([...e,...a])}function Eg(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{xl,Sl,kl,_g,Cg};
8
+ export{Sl,kl,_l,Cg,Eg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oe,w,S,C,Z}from"./chunk-af50ebx1.js";import{k}from"./chunk-4ntm3dtk.js";import{I,$n}from"./chunk-s6r54dyf.js";import{a}from"./chunk-7y78ffds.js";import{ye,rn,sn,on}from"./chunk-vkynagtn.js";import{vt}from"./chunk-q14j0wsq.js";import{ht,Vn,Jt,le}from"./chunk-33czswpt.js";import{E,Tn}from"./chunk-jr0r5pzw.js";import h from"path";var v=new Map,A=new Map,F=w(64),R=new Map,Y=["composables","functions"];function H(e){let s=h.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function ee(e){if(e)return h.resolve(e);let s=`<default>:${process.cwd()}`,r=R.get(s);if(r!==void 0)return r;let t=await te();if(t!==null)R.set(s,t);return t}async function te(){let e=await a(),s=e.root||process.cwd(),r=e.composablesDir;if(r)return h.resolve(s,r);for(let t of Y){let n=h.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let i of c.scan({cwd:n,absolute:!0}))if(!H(i))return n}catch{}}return null}async function W(e){let s=Array.isArray(e)?e:e?[h.resolve(e)]:(await a())._layerComposableDirs??[await ee()].filter((t)=>!!t),r=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let i=h.relative(t,c);if(!H(c)&&!r.has(i))r.set(i,c)}}catch{}}return{key:s.join("\x00"),files:[...r.values()].sort()}}async function vo(e){let{files:s}=await W(e),r=Z({loader:"ts",target:"browser",define:C()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),i=r.scan(c).exports.filter((u)=>u!=="default");if(i.length>0)t.push({file:n,names:i})}catch{}return t}function ne(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function P(e,s){let r=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?r.has(n):ne(e,n))t.add(n);return t}var J=w(64);function X(e,s){let r=S(e,s.size),t=J.get(r);if(t)return t;let n;try{n=Oe(e,s)}catch{n=P(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let i of c)for(let u of i[1].split(",")){let f=u.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return J.set(r,n),n}function se(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var L=w(256);function oe(e,s){let r=new Set(s),t="",n=0,c=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)){t+=e.slice(n,i.index),n=i.index+i[0].length;let u=i[1]??"",f=i[2]??"",d=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(u),m=d?(d[1]??d[2]??d[3]??"").trim():void 0;if(!se(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let y=P(f,r);if(y.size===0)continue;let _=S(f,[...y].sort().join(",")),b=L.get(_);if(!b)b=X(f,y),L.set(_,b);for(let B of b)c.add(B)}t+=e.slice(n);for(let i of P(t,r))c.add(i);return c}function ie(e,s,r){let t=new Map;for(let{file:f,names:d}of e)for(let m of d)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let d=[];for(let m of X(f,n))d.push(t.get(m));return d},i=new Set,u=r.flatMap((f,d)=>d===0?[...oe(f,t.keys())].map((m)=>t.get(m)):c(f));while(u.length>0){let f=[];for(let d of u){if(i.has(d))continue;i.add(d);for(let m of c(s.get(d)??""))if(!i.has(m))f.push(m)}u=f}return i}async function ph(e,s,r,t){let{key:n,files:c}=await W(e);if(!n)return null;let i=()=>[...new Set([...c,...c.flatMap((o)=>ye(o))])],u=ht(i());if(c.length===0)return le(v,n,u,""),null;c.sort();let f=Z({loader:"ts",target:"browser",define:C()}),d=Jt(A,n,u);if(!d){let o=new Map,l=[];for(let p of c)try{let x=await Bun.file(p).text();o.set(p,x);let g=f.scan(x).exports.filter((V)=>V!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}d=le(A,n,u,{codeByFile:o,modules:l})}let{codeByFile:m,modules:y}=d,_;if(s===void 0)_=new Set(c);else{let o=r?[s,...r]:[s],l=S(o.join("\x00"),n,o.length,u),p=F.get(l);if(_=p??ie(y,m,o),!p)F.set(l,_)}if(_.size===0)return null;let b=c.filter((o)=>_.has(o)),B=()=>{if(!t)return;for(let o of b)t.push(o,...ye(o))},N=`${n}\x00${b.join("\x00")}\x00${sn()}`,U=Jt(v,N,u);if(U!==void 0)return B(),U||null;let D=[],M=new Set,T=new Set;for(let o of b)try{let l=m.get(o)??await Bun.file(o).text(),p=h.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])T.add(g[1]);let x=[];try{for(let g of f.scan(l).exports)if(g!=="default")M.add(g),x.push(g)}catch{}if(l=I(l),rn(l))l=await on(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),l=vt(l);l=$n(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),D.push(`// Composable: ${p}
2
+ import{Oe,w,S,C,Z}from"./chunk-xvhxxj4g.js";import{k}from"./chunk-23r3rby6.js";import{I,Rn}from"./chunk-zjqvbcwa.js";import{a}from"./chunk-p83h2dbg.js";import{ye,sn,on,an}from"./chunk-cw1ar3dq.js";import{vt}from"./chunk-jzh0n2ct.js";import{ht,Un,Yt,le}from"./chunk-f1hkagxk.js";import{E,$n}from"./chunk-7vhm0jj5.js";import h from"path";var v=new Map,A=new Map,F=w(64),R=new Map,Y=["composables","functions"];function H(e){let s=h.basename(e,".ts");return s==="index"||s==="types"||e.endsWith(".d.ts")}async function ee(e){if(e)return h.resolve(e);let s=`<default>:${process.cwd()}`,r=R.get(s);if(r!==void 0)return r;let t=await te();if(t!==null)R.set(s,t);return t}async function te(){let e=await a(),s=e.root||process.cwd(),r=e.composablesDir;if(r)return h.resolve(s,r);for(let t of Y){let n=h.resolve(s,t);try{let c=new Bun.Glob("**/*.ts");for await(let i of c.scan({cwd:n,absolute:!0}))if(!H(i))return n}catch{}}return null}async function W(e){let s=Array.isArray(e)?e:e?[h.resolve(e)]:(await a())._layerComposableDirs??[await ee()].filter((t)=>!!t),r=new Map;for(let t of s){let n=new Bun.Glob("**/*.ts");try{for await(let c of n.scan({cwd:t,absolute:!0})){let i=h.relative(t,c);if(!H(c)&&!r.has(i))r.set(i,c)}}catch{}}return{key:s.join("\x00"),files:[...r.values()].sort()}}async function xo(e){let{files:s}=await W(e),r=Z({loader:"ts",target:"browser",define:C()}),t=[];for(let n of s)try{let c=await Bun.file(n).text(),i=r.scan(c).exports.filter((u)=>u!=="default");if(i.length>0)t.push({file:n,names:i})}catch{}return t}function ne(e,s){return new RegExp(`\\b${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(e)}function P(e,s){let r=new Set(e.match(/\w+/g)),t=new Set;for(let n of s)if(/^\w+$/.test(n)?r.has(n):ne(e,n))t.add(n);return t}var J=w(64);function X(e,s){let r=S(e,s.size),t=J.get(r);if(t)return t;let n;try{n=Oe(e,s)}catch{n=P(e,s)}let c=[...e.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...e.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let i of c)for(let u of i[1].split(",")){let f=u.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(f&&s.has(f))n.add(f)}return J.set(r,n),n}function se(e){return!e||/^(?:module|(?:text|application)\/(?:java|ecma)script|application\/stx-[\w-]+)$/i.test(e)}var L=w(256);function oe(e,s){let r=new Set(s),t="",n=0,c=new Set;for(let i of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)){t+=e.slice(n,i.index),n=i.index+i[0].length;let u=i[1]??"",f=i[2]??"",d=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(u),m=d?(d[1]??d[2]??d[3]??"").trim():void 0;if(!se(m)){if(!/json/i.test(m??""))t+=` ${f} `;continue}let y=P(f,r);if(y.size===0)continue;let _=S(f,[...y].sort().join(",")),b=L.get(_);if(!b)b=X(f,y),L.set(_,b);for(let B of b)c.add(B)}t+=e.slice(n);for(let i of P(t,r))c.add(i);return c}function ie(e,s,r){let t=new Map;for(let{file:f,names:d}of e)for(let m of d)if(!t.has(m))t.set(m,f);let n=new Set(t.keys()),c=(f)=>{let d=[];for(let m of X(f,n))d.push(t.get(m));return d},i=new Set,u=r.flatMap((f,d)=>d===0?[...oe(f,t.keys())].map((m)=>t.get(m)):c(f));while(u.length>0){let f=[];for(let d of u){if(i.has(d))continue;i.add(d);for(let m of c(s.get(d)??""))if(!i.has(m))f.push(m)}u=f}return i}async function fh(e,s,r,t){let{key:n,files:c}=await W(e);if(!n)return null;let i=()=>[...new Set([...c,...c.flatMap((o)=>ye(o))])],u=ht(i());if(c.length===0)return le(v,n,u,""),null;c.sort();let f=Z({loader:"ts",target:"browser",define:C()}),d=Yt(A,n,u);if(!d){let o=new Map,l=[];for(let p of c)try{let x=await Bun.file(p).text();o.set(p,x);let g=f.scan(x).exports.filter((V)=>V!=="default");if(g.length>0)l.push({file:p,names:g})}catch{o.set(p,"")}d=le(A,n,u,{codeByFile:o,modules:l})}let{codeByFile:m,modules:y}=d,_;if(s===void 0)_=new Set(c);else{let o=r?[s,...r]:[s],l=S(o.join("\x00"),n,o.length,u),p=F.get(l);if(_=p??ie(y,m,o),!p)F.set(l,_)}if(_.size===0)return null;let b=c.filter((o)=>_.has(o)),B=()=>{if(!t)return;for(let o of b)t.push(o,...ye(o))},N=`${n}\x00${b.join("\x00")}\x00${on()}`,U=Yt(v,N,u);if(U!==void 0)return B(),U||null;let D=[],M=new Set,T=new Set;for(let o of b)try{let l=m.get(o)??await Bun.file(o).text(),p=h.basename(o,".ts");for(let g of l.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])T.add(g[1]);let x=[];try{for(let g of f.scan(l).exports)if(g!=="default")M.add(g),x.push(g)}catch{}if(l=I(l),sn(l))l=await an(l,o,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),l=vt(l);l=Rn(l),l=l.replace(/^export\s+(default\s+)?/gm,""),l=f.transformSync(l),D.push(`// Composable: ${p}
3
3
  ${l.trim()}`)}catch(l){console.warn(`[stx] Failed to load composable ${o}:`,l)}if(D.length===0||M.size===0)return le(v,N,u,""),null;let q=[...M].map((o)=>` try { if (!(${JSON.stringify(o)} in __c)) __c[${JSON.stringify(o)}] = ${o}; } catch (e) {}`).join(`
4
4
  `),z=JSON.stringify([...M]),j=D.join(`
5
5
 
@@ -29,5 +29,5 @@ ${q}
29
29
  window[__n] = __c[__n];
30
30
  __published[__n] = true;
31
31
  }
32
- })();`,G=E()?Tn(O):O;return u=ht(i()),le(v,N,u,G),B(),G}function fh(){v.clear(),Vn(),A.clear(),F.clear(),R.clear()}
33
- export{vo,ph,fh};
32
+ })();`,G=E()?$n(O):O;return u=ht(i()),le(v,N,u,G),B(),G}function gh(){v.clear(),Un(),A.clear(),F.clear(),R.clear()}
33
+ export{xo,fh,gh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vt}from"./chunk-yw1s8kyj.js";function eo(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Vt(e),i=`
2
+ import{Ut}from"./chunk-dgn87554.js";function to(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Ut(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -43,12 +43,12 @@ if ('serviceWorker' in navigator) {
43
43
  });
44
44
  }
45
45
  </script>
46
- <!-- End stx PWA -->`,i}function Oi(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=eo(n);return e.slice(0,o)+i+`
47
- `+e.slice(o)}return e+eo(n)}let t=eo(n);return e.replace("</head>",`${t}
48
- </head>`)}function Eg(e){if(!e.pwa?.enabled)return"";return`<script>
46
+ <!-- End stx PWA -->`,i}function Ni(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=to(n);return e.slice(0,o)+i+`
47
+ `+e.slice(o)}return e+to(n)}let t=to(n);return e.replace("</head>",`${t}
48
+ </head>`)}function Tg(e){if(!e.pwa?.enabled)return"";return`<script>
49
49
  if ('serviceWorker' in navigator) {
50
50
  window.addEventListener('load', function() {
51
- navigator.serviceWorker.register('/${Vt(e)}')
51
+ navigator.serviceWorker.register('/${Ut(e)}')
52
52
  .then(function(registration) {
53
53
  console.log('[PWA] Service Worker registered:', registration.scope);
54
54
  })
@@ -57,5 +57,5 @@ if ('serviceWorker' in navigator) {
57
57
  });
58
58
  });
59
59
  }
60
- </script>`}function Tg(){return'<link rel="manifest" href="/manifest.json">'}function $g(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
- export{eo,Oi,Eg,Tg,$g};
60
+ </script>`}function $g(){return'<link rel="manifest" href="/manifest.json">'}function Rg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
+ export{to,Ni,Tg,$g,Rg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ti,ni,ri,si,Es,Ts,Kh,Xh,Gh,Jh,$s,Yh}from"./chunk-zg44cf8a.js";import"./chunk-89d3h8mp.js";export{Yh as generateDefaultRobotsTxt,$s as generateRobotsTxt,Xh as generateSitemap,Gh as generateSitemapIndex,si as injectSeoTags,Es as metaDirective,ti as processMetaDirectives,ri as processSeoDirective,ni as processStructuredData,Kh as registerSeoDirectives,Jh as scanForSitemapEntries,Ts as structuredDataDirective};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{m,h,p}from"./chunk-af50ebx1.js";import{F}from"./chunk-7y78ffds.js";import{i}from"./chunk-rj68w7em.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Lm(e,t={},o={}){let n={...F,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,y,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((f)=>setTimeout(f,0))}else{let u=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)u.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,y,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,y,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,y,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,y,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{m,h,p}from"./chunk-xvhxxj4g.js";import{F}from"./chunk-p83h2dbg.js";import{i}from"./chunk-1zfxmjrf.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function jm(e,t={},o={}){let n={...F,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,y,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((f)=>setTimeout(f,0))}else{let u=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)u.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,y,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,y,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,y,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,y,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(d.name,i(d.content,y,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{m,h,p}from"./chunk-af50ebx1.js";import{F}from"./chunk-7y78ffds.js";import
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await va(d,u))});await Promise.all(x)}r.close()}catch(a){r.error(a)}}})}async function va(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await xa(d,u))});await Promise.all(x)}r.close()}catch(a){r.error(a)}}})}async function xa(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${n}\`);
23
23
  </script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${p(n)}</div>');
26
- </script>`}}var pu=`
26
+ </script>`}}var fu=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function jm(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(pu),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await va(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Bm(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),S=a[0].trim(),g=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=S,`<div data-suspense="${r}">${g}</div>`})}function Fm(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function zm(e,t={},o={}){let n={...F,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let x=await i(c,y,e,n,E);for(let d=0;d<x.length;d+=s)r.enqueue(x.slice(d,d+s))}else{let x=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)x.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let b=0;for(let f of x){if(f.start>b){let _=c.slice(b,f.start);if(_.trim()){let C=await i(_,y,e,n,E);r.enqueue(C)}}let v=await i(f.content,y,e,n,E);r.enqueue(v),b=f.end}if(b<c.length){let f=c.slice(b);if(f.trim()){let v=await i(f,y,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function Hm(e,t={}){let o={...F,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,g={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];g[l]=R}let y=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await m(r,R,e),i(y,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!g[l])return`<div class="error-message">Section "${p(l)}" not found in template "${p(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await m(r,w,e);let x=new Set;return await i(g[l],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return h("Expression",x,e,g[l]||"",0,g[l]||"")}},getSections:()=>Object.keys(g),getTemplate:()=>S}}var fu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},gu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),g=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
46
+ </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function Bm(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(fu),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await xa(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Fm(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),S=a[0].trim(),g=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=S,`<div data-suspense="${r}">${g}</div>`})}function zm(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function Hm(e,t={},o={}){let n={...F,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let x=await i(c,y,e,n,E);for(let d=0;d<x.length;d+=s)r.enqueue(x.slice(d,d+s))}else{let x=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)x.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let b=0;for(let f of x){if(f.start>b){let _=c.slice(b,f.start);if(_.trim()){let C=await i(_,y,e,n,E);r.enqueue(C)}}let v=await i(f.content,y,e,n,E);r.enqueue(v),b=f.end}if(b<c.length){let f=c.slice(b);if(f.trim()){let v=await i(f,y,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function Vm(e,t={}){let o={...F,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,g={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];g[l]=R}let y=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await m(r,R,e),i(y,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!g[l])return`<div class="error-message">Section "${p(l)}" not found in template "${p(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await m(r,w,e);let x=new Set;return await i(g[l],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return h("Expression",x,e,g[l]||"",0,g[l]||"")}},getSections:()=>Object.keys(g),getTemplate:()=>S}}var gu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},mu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),g=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${g?`{${g}}`:"{}"}
50
50
  </script>
51
- </div>`}};function Vm(e={}){let t=[];if(e.streaming?.enabled)t.push(fu);if(e.hydration?.enabled)t.push(gu);return t}async function Um(e,t,o,n={}){return e}function Wm(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function qm(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function Um(e={}){let t=[];if(e.streaming?.enabled)t.push(gu);if(e.hydration?.enabled)t.push(mu);return t}async function Wm(e,t,o,n={}){return e}function qm(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function Km(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{Lm,va,pu,jm,Bm,Fm,zm,Hm,fu,gu,Vm,Um,Wm,qm};
194
+ export{jm,xa,fu,Bm,Fm,zm,Hm,Vm,gu,mu,Um,Wm,qm,Km};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{sr,i}from"./chunk-1zfxmjrf.js";import"./chunk-31cnrpd1.js";import"./chunk-aza2zrhk.js";import"./chunk-4dxq7ft1.js";import"./chunk-rdn1d4bf.js";import"./chunk-n8a4jm0p.js";import"./chunk-4w3qpewn.js";import"./chunk-1b1ntgt7.js";import"./chunk-jzh0n2ct.js";import{ve}from"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-mzj71r0m.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{Ne,Vs,Us}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{sr as buildModulesTag,ve as injectRouterScript,i as processDirectives,Vs as processJsonDirective,Us as processOnceDirective,Ne as validateClientScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zg}from"./chunk-8913k8g7.js";import"./chunk-yn17484y.js";import"./chunk-xx3reejx.js";import"./chunk-ksr6c2kh.js";import"./chunk-n8a4jm0p.js";import"./chunk-aekq1zyn.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Zg as startProductionServer};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Fr}from"./chunk-vfxkn1pe.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
3
- `),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of Fr(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
2
+ import{zr}from"./chunk-kd6r7z27.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
3
+ `),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of zr(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{im}from"./chunk-zyeg9t2t.js";import"./chunk-yn17484y.js";import"./chunk-xbcnnk8x.js";import"./chunk-xx3reejx.js";import"./chunk-ksr6c2kh.js";import"./chunk-1zfxmjrf.js";import"./chunk-31cnrpd1.js";import"./chunk-aza2zrhk.js";import"./chunk-4dxq7ft1.js";import"./chunk-rdn1d4bf.js";import"./chunk-n8a4jm0p.js";import"./chunk-4w3qpewn.js";import"./chunk-1b1ntgt7.js";import"./chunk-jzh0n2ct.js";import"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-mzj71r0m.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{im as buildForProduction};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Xe(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function se(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
3
- `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Za(e,n){let r=Xe(e);try{return await n(r)}finally{se(r)}}
4
- export{Xe,se,Za};
3
+ `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Qa(e,n){let r=Xe(e);try{return await n(r)}finally{se(r)}}
4
+ export{Xe,se,Qa};
@@ -298,5 +298,5 @@ catch (error) {
298
298
  init();
299
299
  }
300
300
  })();
301
- </script>`}var Ag={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Pg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Ig={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Og={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},no=[Ag,Pg,Ig,Og];function my(t){return[...t,...no]}
302
- export{Ag,Pg,Ig,Og,no,my};
301
+ </script>`}var Pg={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Ig={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Og={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Ng={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},ro=[Pg,Ig,Og,Ng];function hy(t){return[...t,...ro]}
302
+ export{Pg,Ig,Og,Ng,ro,hy};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function Jm(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function Ym(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function Zm(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
2
+ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function Ym(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function Zm(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function Qm(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
3
3
  <div
4
4
  class="stx-transition-wrapper"
5
5
  data-transition="${l}"
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
41
41
  });
42
42
  })();
43
43
  </script>
44
- `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function Qm(){return`
44
+ `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function eh(){return`
45
45
  /* STX Transition Presets */
46
46
 
47
47
  /* Fade */
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
228
228
  opacity: 1;
229
229
  max-height: 1000px;
230
230
  }
231
- `}function eh(){return`
231
+ `}function th(){return`
232
232
  // STX Transition Runtime
233
233
  (function() {
234
234
  if (typeof window === 'undefined') return;
@@ -317,5 +317,5 @@ else {
317
317
 
318
318
  console.log('[stx] Transition runtime initialized');
319
319
  })();
320
- `}function th(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
- export{Jm,Ym,Zm,Qm,eh,th};
320
+ `}function nh(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
+ export{Ym,Zm,Qm,eh,th,nh};
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{gr}from"./chunk-29f6vmyz.js";import{$r}from"./chunk-txd2js5v.js";import{a}from"./chunk-7y78ffds.js";import{B,Ze}from"./chunk-ybq56wam.js";import{fc}from"./chunk-2x9zhezb.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function cr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new gr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function we(e){return e.includes("data-stx-runtime")}function dc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=cr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
- `+e.slice(t);let n=$r(e);if(n!==null)return`${e.slice(0,n)}
2
+ import{mr}from"./chunk-2j5yane9.js";import{Rr}from"./chunk-89d3h8mp.js";import{a}from"./chunk-p83h2dbg.js";import{B,Ze}from"./chunk-ybq56wam.js";import{gc}from"./chunk-6wrf6302.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function lr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new mr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function we(e){return e.includes("data-stx-runtime")}function pc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=lr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
+ `+e.slice(t);let n=Rr(e);if(n!==null)return`${e.slice(0,n)}
4
4
  ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
5
5
  `+e.slice(o)}if(B(e))return Ze(e,(o)=>`${o}
6
6
  ${r}`);return`${r}
7
- ${e}`}async function lr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-830s2hfc.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-830s2hfc.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function pc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${fc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
7
+ ${e}`}async function ur(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-7mz6ze0x.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-7mz6ze0x.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function fc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${gc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
8
8
  ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ve(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-830s2hfc.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
9
+ ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ve(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-7mz6ze0x.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
10
10
  `)}"></script>
11
11
  `}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${g(i)};</script>
12
- `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-830s2hfc.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
12
+ `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-7mz6ze0x.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
13
13
  </body>`+e.slice(d+7)}
14
- export{cr,G,we,dc,lr,pc,ve};
14
+ export{lr,G,we,pc,ur,fc,ve};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wn,ng,rg,sg,og,ig,m,ag,yi,cg,Xc,Gc}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{wn as STX_ENGINE_BINDING_NAMES,yi as convertToCommonJS,Xc as extractScriptFromTemplate,m as extractVariables,Gc as hasVariables,ag as isCompleteImport,ig as isMissingBindingFailure,sg as isModuleResolutionFailure,og as isSyntaxFailure,cg as splitDeclaration,ng as stripTypeScript,rg as withoutStxReferrer};
@@ -0,0 +1,54 @@
1
+ // @bun
2
+ import{T,u,f,P,d,K}from"./chunk-89d3h8mp.js";import{V,Os,Ne,pe,Pt,Cr,Be,Fe,r,h,ke,_}from"./chunk-xvhxxj4g.js";import{ct}from"./chunk-23r3rby6.js";import{I}from"./chunk-zjqvbcwa.js";import{oe}from"./chunk-1b1ntgt7.js";import{B,Ze}from"./chunk-ybq56wam.js";import{E,Tn}from"./chunk-7vhm0jj5.js";import C from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let n=e;n<c.length;n++){let y=c[n];if(y==="("||y==="["||y==="{")a++;else if(y===")"||y==="]"||y==="}")a--;else if(y===","&&a===0)return n}return-1}function $e(c,e,a){let n=c,y=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),s=y.exec(n);while(s){let g=s.index,t=g+s[0].length-1,D=1,W=t+1;while(W<n.length&&D>0){if(n[W]==="(")D++;else if(n[W]===")")D--;W++}if(D!==0)break;let re=n.substring(t+1,W-1),N=`${a}(${re})`;n=n.substring(0,g)+N+n.substring(W),y.lastIndex=g+N.length,s=y.exec(n)}return n}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],n=new Set,y=0,s=0,g=e.length,t=(N)=>{s++;while(s<g){if(e[s]==="\\"){s+=2;continue}if(e[s]===N){s++;return}s++}},D=()=>{s++;while(s<g){if(e[s]==="\\"){s+=2;continue}if(e[s]==="`"){s++;return}if(e[s]==="$"&&e[s+1]==="{"){s+=2;let N=1;while(s<g&&N>0)if(e[s]==="{")N++,s++;else if(e[s]==="}")N--,s++;else if(e[s]==="'"||e[s]==='"')t(e[s]);else if(e[s]==="`")D();else s++;continue}s++}},W=()=>{if(e[s]==="/"&&e[s+1]==="/"){while(s<g&&e[s]!==`
3
+ `)s++;return!0}if(e[s]==="/"&&e[s+1]==="*"){s+=2;while(s<g-1&&!(e[s]==="*"&&e[s+1]==="/"))s++;return s+=2,!0}return!1},re=()=>{if(y!==0)return;let N=e.slice(s).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let Z=N[2];if(!n.has(Z))a.push(Z),n.add(Z);return}let te=e.slice(s).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(te){let Z=te[1];if(!n.has(Z))a.push(Z),n.add(Z);return}let Y=e.slice(s).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let Z=Y[1];if(!n.has(Z))a.push(Z),n.add(Z)}};while(s<g){if(W())continue;if(e[s]==="'"||e[s]==='"'){t(e[s]);continue}if(e[s]==="`"){D();continue}if(e[s]==="{"){y++,s++;continue}if(e[s]==="}"){y--,s++;continue}if(y===0&&/[a-z]/i.test(e[s])&&(s===0||/\s|[;{}()]/.test(e[s-1])))re();s++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((n)=>n.trim()).filter(Boolean);return`
4
+ (function() {
5
+ ${ct("var",a)}
6
+ var __destroyHooks = [];
7
+ var __origOnDestroy = onDestroy;
8
+ onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
9
+
10
+ ${c}
11
+ ${e}})();
12
+ `}function Re(c,e){let n=he(c).split(",").map((g)=>g.trim()).filter(Boolean),y=new Set(V(c,!0).split(",").map((g)=>g.trim())),s=n.map((g)=>y.has(g)?` try { ${g}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(g)}, ${Os(g)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(g)}] = ${g}; } catch (e) { /* not actually top-level */ }`).join(`
13
+ `);return`
14
+ // Register scope variables for STX runtime
15
+ if (!window.stx._scopes) window.stx._scopes = {};
16
+ var __scopeRegistration = window.stx._scopes['${e}'] || { __destroyCallbacks: __destroyHooks };
17
+ ${s}
18
+ // #1767: when the bundler renamed a component const that collided with an
19
+ // inlined import (foo -> foo2), rebind the ORIGINAL template name to the
20
+ // renamed declaration so it resolves to the component's value, not the
21
+ // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
22
+ try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
23
+ if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
24
+ window.stx._scopes['${e}'] = __scopeRegistration;
25
+ `}function Ie(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,n)=>n===e?a:'<script data-stx-scoped data-stx-run="always"')}function ue(c,e){let a=Re(c,e);return Me(ve(c,a),e)}function Me(c,e){let a=`
26
+ (function() {
27
+ var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
28
+ var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
29
+ if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
30
+ if (__stxScopeEl && typeof window !== 'undefined' && window.stx) {
31
+ if (!window.stx._scopes) window.stx._scopes = {};
32
+ window.stx._scopes['${e}'] = {};
33
+ }
34
+ var __stxEndEffects = (typeof window !== 'undefined' && window.stx && window.stx._beginEffects) ? window.stx._beginEffects() : null;
35
+ try {`,n=`
36
+ } finally {
37
+ // The body's effects end where its onDestroy callbacks run: with the scope
38
+ // when the partial has a root, with the page when it has none.
39
+ if (__stxEndEffects) {
40
+ var __stxDisposeEffects = __stxEndEffects();
41
+ var __stxRegistered = __stxScopeEl && window.stx._scopes && window.stx._scopes['${e}'];
42
+ if (__stxRegistered) __stxRegistered.__disposeEffects = __stxDisposeEffects;
43
+ else if (window.stx._destroyCallbacks) window.stx._destroyCallbacks.push(__stxDisposeEffects);
44
+ }
45
+ if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
+ }
47
+ })();`;return a+c+n}function Te(c,e){if(B(c)){let s=B(c).tag.match(/data-stx-scope="([^"]*)"/);if(s)return{html:c,mergedIntoExisting:s[1],stamped:!0,root:"body"};return{html:Ze(c,(g,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Pt(c),n=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(n){let y=n[1]+n[2],s=n[1].slice(1),g=y.match(/data-stx-scope="([^"]*)"/);if(g)return{html:c,mergedIntoExisting:g[1],stamped:!0,root:s};let t=c.slice(0,a),D=n[1],W=n[2];return{html:`${t}${D} data-stx-scope="${e}"${W}${c.slice(a+n[0].length)}`,mergedIntoExisting:null,stamped:!0,root:s}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=C.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),n=e.__stx_scope_seq;return n?`stx_scope_${a}_${++n.n}_${n.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,de=new Set;function Oh(){le.clear(),de.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Mf(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),n=[],y=0,s=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,g;while((g=s.exec(a))!==null){let t=g[1]==="/",D=g[2],W=g[3]==="/"||Ce.has(D.toLowerCase());if(t){y=Math.max(0,y-1);continue}if(y===0)n.push(D);if(!W)y++}return n}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var Ye=new T(500),lc=new Set;function Nh(){lc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return lc}async function cs(c,e,a,n,y,s=new Set){let g=n.partialsDir||C.join(C.dirname(a),"partials");if(g&&!C.isAbsolute(g))g=C.resolve(process.cwd(),g);let t=$e(c,"@partial","@include"),D=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(m,k,x)=>{let p=k.trim(),i=`${a}:${p}`;if(D.has(i))return"";return D.add(i),k});{let m=/@includeIf\s*\(/g,k;while((k=m.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,w=p+1;while(w<t.length&&i>0){if(t[w]==="(")i++;else if(t[w]===")")i--;w++}if(i!==0)break;let l=t.substring(p+1,w-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){m.lastIndex=w;continue}let O=o[1],z=W(O,g,a),R="";if(z&&await Bun.file(z).exists())y.add(z),R=`@include(${l})`;t=t.substring(0,x)+R+t.substring(w),m.lastIndex=0}}for(let[m,k]of[["@includeWhen",!1],["@includeUnless",!0]]){let x=new RegExp(`${m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),p;while((p=x.exec(t))!==null){let i=p.index,w=i+p[0].length-1,l=1,o=w+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(w+1,o-1),z=ae(O,0);if(z===-1){x.lastIndex=o;continue}let R=O.substring(0,z).trim(),H=O.substring(z+1).trim(),F=H.match(/^\s*['"]([^'"]+)['"]/);if(!F){x.lastIndex=o;continue}let b=F[1],J=H.substring(F[0].length),j,M=ae(J,0);if(M!==-1)j=J.substring(M+1).trim();try{let A=`Boolean(${R})`,L;if(f(A)){let ie=d(A,Object.keys(e));L=Boolean(ie(...Object.values(e)))}else L=Boolean(u(A,e));let ee=k?!L:L,ne="";if(ee){let ie=W(b,g,a);if(ie&&await Bun.file(ie).exists())y.add(ie);ne=`@include('${b}'${j?`, ${j}`:""})`}t=t.substring(0,i)+ne+t.substring(o),x.lastIndex=0}catch(A){let L=A instanceof Error?A.message:String(A),ee=h("Include",`Error evaluating ${m} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),x.lastIndex=0}}}{let m=/@each\s*\(/g,k;while((k=m.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,w=p+1;while(w<t.length&&i>0){if(t[w]==="(")i++;else if(t[w]===")"){if(i--,i===0)break}w++}if(i!==0)break;let l=t.substring(p+1,w),o=t.substring(x,w+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){m.lastIndex=0,t=t.replace(o,"");continue}let[,z,R,H,F]=O;try{let b,J=R.trim();if(f(J))b=d(J,Object.keys(e))(...Object.values(e));else b=u(J,e);let j="";if(Array.isArray(b)&&b.length>0)for(let M of b){let A={...e,[H]:M},L=await te(z,A,c,x);j+=L}else if(F)j=await te(F,{},c,x);t=t.substring(0,x)+j+t.substring(w+1),m.lastIndex=0}catch(b){let J=b instanceof Error?b.message:String(b);t=t.substring(0,x)+h("Each",`Error in @each: ${J}`,a,c,x)+t.substring(w+1),m.lastIndex=0}}}{let m=/@includeFirst\s*\(/g,k;while((k=m.exec(t))!==null){let x=k.index,p=x+k[0].length-1,i=1,w=p+1;while(w<t.length&&i>0){if(t[w]==="(")i++;else if(t[w]===")"){if(i--,i===0)break}w++}if(i!==0)break;let l=t.substring(p+1,w),o=t.substring(x,w+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){m.lastIndex=0,t=t.replace(o,"");continue}let z=O[1],R=l.slice(O[0].length),H,F=R.match(/^\s*,\s*\{/);if(F){R=R.slice(F[0].length-1);let j=1,M=1;while(M<R.length&&j>0){if(R[M]==="{")j++;else if(R[M]==="}"){if(j--,j===0)break}M++}H=R.substring(0,M+1),R=R.slice(M+1)}let b,J=R.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(J)b=J[1];try{let j=JSON.parse(z.replace(/'/g,'"')),M={};if(H)try{M=P(H,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(n.debug){let ne=h("Include",`Error parsing includeFirst variables: ${ee}`,a,c,x,o);t=t.replace(o,()=>ne)}else t=t.replace(o,()=>b||"");continue}let A=!1;for(let L of j){let ee=W(L,g,a);if(!ee)continue;if(await r(ee)){let ne=await te(L,M,c,x);t=t.replace(o,()=>ne),A=!0;break}}if(!A)if(b!==void 0)t=t.replace(o,()=>b);else if(n.debug){let L=h("Include",`None of the includeFirst paths exist: ${z}`,a,c,x,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let M=j instanceof Error?j.message:String(j),A=h("Include",`Error processing @includeFirst: ${M}`,a,c,x,o);t=t.replace(o,()=>A)}m.lastIndex=0}}function W(m,k,x){try{let p=m;if(!m.endsWith(".stx"))p=`${m}.stx`;let i=C.resolve(k),w=C.resolve(C.dirname(x)),l;if(!p.startsWith("./")&&!p.startsWith("../")){for(let F of n._layerPartialDirs??[]){let b=C.resolve(F,p);if(b.startsWith(`${C.resolve(F)}${C.sep}`)&&ye(b))return b}l=C.resolve(k,p)}else l=C.resolve(w,p);let o=C.normalize(l),O=o.startsWith(i+C.sep)||o===i,z=o.startsWith(w+C.sep)||o===w,R=!1,H=C.dirname(w);if(o.startsWith(H+C.sep)){if(!C.relative(H,o).split(C.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))R=!0}if(!O&&!z&&!R)return console.error(`Security: Path traversal attempt blocked for include path: ${m}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${w}`),null;return o}catch(p){return console.error(`Error resolving path ${m}: ${p}`),null}}let re=C.resolve(a);s.add(re);function N(m,k,x,p){return n.onIncludeError?.({includePath:m,templatePath:a,message:k,partialsDir:g}),h("Include",k,a,x,p)}async function te(m,k={},x,p){let i=W(m,g,a);if(!i)return N(m,`Could not resolve path for include: ${m}`,x,p);let w=C.resolve(i);if(s.has(w)){let l=[...s,w].map((o)=>C.basename(o)).join(" -> ");return N(m,`Circular include detected: ${l}`,x,p)}try{y.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(v){let q=v instanceof Error?v.message:String(v);return N(m,`Error loading include file ${m}: ${q}`,x,p)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:v}=await import("./chunk-s85chp3w.js");l=v(l,e)}if(l&&(n.debug||!E()&&!Tn()))try{let{warnUnbalancedTags:v}=await import("./chunk-yg5a54pj.js");v(l,i)}catch{}try{let{processESImports:v}=await import("./chunk-f69cmsz9.js");l=await v(l,e,i,n,y)}catch(v){if(n.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,v instanceof Error?v.message:v)}let o=l,O=pe(o);if(O)o=O.content.trim();let R=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),H="";if(R)H=`<style${R[1]}>${R[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(v,q,S)=>{if(!me(q))return"";return F.push({attrs:q,body:S}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let b={...e};b.__stx_signals_gate=ke(l,i);for(let[v,q]of Object.entries(k))b[v]=q;let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(J)].sort((v,q)=>{let S=(v[1]||"").includes("server"),X=(q[1]||"").includes("server");return Number(X)-Number(S)}),M="",A=null,L=!1,ee=!1;for(let v of j){let q=v[1]||"",S=v[2]||"";if(me(q))continue;let X=q.includes("server"),be=Be(q);if(!X&&!/\bsrc\s*=/i.test(q))Ne(S,i,n.strict);if(!X&&S.trim()){let{interpolateScriptExpressions:U}=await import("./chunk-nb2tedk0.js");S=U(S,b,m)}let ce="";try{let{extractAndStripCssImports:U,renderVendorStyleTags:Q}=await import("./chunk-c2v38ghp.js"),se=U(S,{filePath:i,projectRoot:process.cwd()});S=se.code,ce=Q(se.styles)}catch(U){if(n.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,U instanceof Error?U.message:U)}if(be&&S.trim())S=Fe(S);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-c2v38ghp.js");S=Q(S).code;let{hasUserImports:se,bundleClientScript:Se}=await import("./chunk-8byydry7.js");if(se(S))S=await Se(S,i,{projectRoot:process.cwd()})}catch(Q){if(n.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:U}=await import("./chunk-sm9f980t.js");S=U(S)}let ge=Ee(S);if(!X){let{extractBridgeData:U,generateServerDataBridge:Q}=await import("./chunk-c2v38ghp.js"),se=Q(S,U(b));if(se)S=`${se}
48
+ ${S}`}if(ge&&!X){L=!0,A=fe(i,e);let U=I(S),Q=ue(U,A);M+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${A}">${Q}</script>
49
+ `;continue}if(X)try{let{extractVariables:U}=await import("./chunk-aywvbcae.js");await U(S,b,i)}catch(U){if(n.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,U)}if(!X&&!ge){let U=q.replace(/\bclient\b/i,"").trim();A=fe(i,e);let Q=I(S),se=ue(Q,A);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(se))ee=!0;M+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${A}"${U?` ${U}`:""}>${se}</script>
50
+ `}}if(F.length>0){let{interpolateScriptExpressions:v}=await import("./chunk-nb2tedk0.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q,S)=>{let X=F[Number(S)];return`<script${X.attrs}>${v(X.body,b,m)}</script>`})}if(A){let v=Te(o,A);if(o=v.html,v.mergedIntoExisting){let S=A,X=v.mergedIntoExisting;M=M.split(`'${S}'`).join(`'${X}'`).split(`"${S}"`).join(`"${X}"`),A=X}else if(!v.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${C.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(v.stamped&&v.root!=="body"&&(L||ee)&&!de.has(i)){let S=Mf(o);if(S.length>1)de.add(i),console.warn(`[stx] ${C.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${S.length} top-level elements (${S.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let q=v.stamped&&v.root!==null&&Cr(v.root);M=Ie(M,q?A:null)}if(o.includes("@include")||o.includes("@partial"))o=await cs(o,b,i,n,y,s);let{processLoops:ne,reportDeferredLoopWarnings:ie}=await import("./chunk-rsn9rh07.js"),G=ne(o,b,i,void 0,!0);G=oe(G,b,i),G=ie(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-8w0n2rae.js");if(G=xe(G,b,i,n),G=we(G,b,i),G=_e(G,b,i,n),G=_(G,b,i),H)G+=`
51
+ `+H;if(M)G+=`
52
+ `+M;return G}catch(l){if(l instanceof K)throw l;let o=l instanceof Error?l.message:String(l);return N(m,`Error processing include ${m}: ${o}`,x,p)}}let Y=/@include\s*\(/g,Z;while((Z=Y.exec(t))!==null){let m=Z.index,k=m+Z[0].length-1,x=1,p=k+1;while(p<t.length&&x>0){if(t[p]==="(")x++;else if(t[p]===")")x--;p++}if(x!==0)break;let i=t.substring(m,p),w=t.substring(k+1,p-1),l=w.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=p;continue}let o=l[1],O,z=w.substring(l[0].length),R=ae(z,0);if(R!==-1)O=z.substring(R+1).trim();let H={};if(O)try{H=P(O,e)}catch(b){let J=b instanceof Error?b.message:String(b);t=t.replace(i,h("Include",`Error parsing include variables for ${o}: ${J}`,a,c,m)),Y.lastIndex=0;continue}let F=await te(o,H,c,m);t=t.substring(0,m)+F+t.substring(p),Y.lastIndex=0}return t}function ls(c,e){let a=c;function n(y,s,g,t){let D=y,W=!0;while(W){W=!1;let re=new RegExp(`@${s}\\(['"]([^'"]+)['"]\\)`),N=D.match(re);if(!N||N.index===void 0)break;let te=N.index,Y=N[1],Z=te+N[0].length,m=new RegExp(`@${s}\\(`),k=new RegExp(`@${g}(?![a-z])`),x=1,p=Z,i=-1;while(x>0&&p<D.length){let l=D.slice(p),o=l.match(m),O=l.match(k),z=o?p+o.index:1/0,R=O?p+O.index:1/0;if(z<R)x++,p=z+(o[0].length||1);else if(R<1/0){if(x--,x===0){i=R;break}p=R+g.length+1}else break}if(i===-1)break;let w=D.slice(Z,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(w);else e[Y].push(w);D=D.substring(0,te)+D.substring(i+`@${g}`.length),W=!0}return D}return a=n(a,"push","endpush",!1),a=n(a,"prepend","endprepend",!0),a}function us(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,n)=>{if(!e[n]||e[n].length===0)return"";return e[n].join(`
53
+ `)})}
54
+ export{Oh,Mf,Ye,lc,Nh,cs,ls,us};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Sl,kl,_l,Cg,Eg}from"./chunk-8pj4v1eh.js";export{kl as auditBuildOutput,Sl as auditConfig,_l as calculateAuditResult,Eg as formatAuditResult,Cg as runPwaAudit};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{to,Ni,Tg,$g,Rg}from"./chunk-8qbp5skx.js";import"./chunk-dgn87554.js";export{$g as generateManifestLink,to as generatePwaTags,Tg as generateSwRegistrationScript,Rg as generateThemeColorMeta,Ni as injectPwaTags};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function c(i){if(!i.startsWith("/")||/[?#\\]/.test(i))throw Error(`Invalid route rule pattern: ${i}`);let t=i==="/"?[]:i.slice(1).split("/");if(t.some((r,e)=>!r||r.includes("*")&&r!=="*"&&r!=="**"||r==="**"&&e!==t.length-1||r.startsWith(":")&&!/^:[\w]+$/.test(r)))throw Error(`Unsupported route rule pattern: ${i}`);return t}function bo(i){for(let[t,r]of Object.entries(i)){if(c(t),!r||typeof r!=="object"||Object.keys(r).some((e)=>e!=="rendering"&&e!=="cache"))throw Error(`Unsupported route rule for ${t}`);if(r.rendering!==void 0&&r.rendering!=="prerender"&&r.rendering!=="dynamic")throw Error(`Unsupported rendering mode for ${t}`);if(r.cache!==void 0&&r.cache!==!1){let e=r.cache;if(!e||e.public!==!0||Object.keys(e).some((n)=>!["public","maxAge","swr"].includes(n))||!Number.isFinite(e.maxAge)||e.maxAge<=0||e.swr!==void 0&&(!Number.isFinite(e.swr)||e.swr<0))throw Error(`Route cache for ${t} requires public: true, maxAge > 0 and swr >= 0`);if(r.rendering==="prerender")throw Error(`Prerendered route ${t} cannot revalidate; use dynamic rendering with cache`)}}}function Mn(i={}){bo(i);let t=(e)=>e==="**"?0:e==="*"?1:e.startsWith(":")?2:3,r=Object.entries(i).map(([e,n])=>({pattern:e,parts:c(e),rule:n}));return r.sort((e,n)=>{for(let o=0;o<Math.max(e.parts.length,n.parts.length);o++){let s=(n.parts[o]===void 0?4:t(n.parts[o]))-(e.parts[o]===void 0?4:t(e.parts[o]));if(s)return s}return e.pattern.localeCompare(n.pattern)}),(e)=>{let n=e==="/"?[]:e.replace(/\/$/,"").slice(1).split("/");return r.find(({parts:o})=>o.every((s,u)=>s==="**"||n[u]!==void 0&&(s==="*"||s.startsWith(":")||s===n[u]))&&(o.at(-1)==="**"||o.length===n.length))?.rule??{}}}
3
- export{bo,Mn};
2
+ function c(i){if(!i.startsWith("/")||/[?#\\]/.test(i))throw Error(`Invalid route rule pattern: ${i}`);let t=i==="/"?[]:i.slice(1).split("/");if(t.some((r,e)=>!r||r.includes("*")&&r!=="*"&&r!=="**"||r==="**"&&e!==t.length-1||r.startsWith(":")&&!/^:[\w]+$/.test(r)))throw Error(`Unsupported route rule pattern: ${i}`);return t}function wo(i){for(let[t,r]of Object.entries(i)){if(c(t),!r||typeof r!=="object"||Object.keys(r).some((e)=>e!=="rendering"&&e!=="cache"))throw Error(`Unsupported route rule for ${t}`);if(r.rendering!==void 0&&r.rendering!=="prerender"&&r.rendering!=="dynamic")throw Error(`Unsupported rendering mode for ${t}`);if(r.cache!==void 0&&r.cache!==!1){let e=r.cache;if(!e||e.public!==!0||Object.keys(e).some((n)=>!["public","maxAge","swr"].includes(n))||!Number.isFinite(e.maxAge)||e.maxAge<=0||e.swr!==void 0&&(!Number.isFinite(e.swr)||e.swr<0))throw Error(`Route cache for ${t} requires public: true, maxAge > 0 and swr >= 0`);if(r.rendering==="prerender")throw Error(`Prerendered route ${t} cannot revalidate; use dynamic rendering with cache`)}}}function Dn(i={}){wo(i);let t=(e)=>e==="**"?0:e==="*"?1:e.startsWith(":")?2:3,r=Object.entries(i).map(([e,n])=>({pattern:e,parts:c(e),rule:n}));return r.sort((e,n)=>{for(let o=0;o<Math.max(e.parts.length,n.parts.length);o++){let s=(n.parts[o]===void 0?4:t(n.parts[o]))-(e.parts[o]===void 0?4:t(e.parts[o]));if(s)return s}return e.pattern.localeCompare(n.pattern)}),(e)=>{let n=e==="/"?[]:e.replace(/\/$/,"").slice(1).split("/");return r.find(({parts:o})=>o.every((s,u)=>s==="**"||n[u]!==void 0&&(s==="*"||s.startsWith(":")||s===n[u]))&&(o.at(-1)==="**"||o.length===n.length))?.rule??{}}}
3
+ export{wo,Dn};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Xe,se,Qa}from"./chunk-9xps62ek.js";import v from"fs";import g from"path";import V from"crypto";var ee=[320,640,768,1024,1280,1536,1920],te=["webp","jpeg"],ne=80,T=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Ln(){return await d()!==null}async function he(){return!0}async function $e(t,e={}){let{widths:a=ee,formats:n=te,quality:r=ne,fit:m="cover",placeholder:l="none",outputDir:o=".stx/images",baseUrl:c="/images"}=e,i,h;if(typeof t==="string"){if(h=t,!await Bun.file(t).exists())throw new Jr(`Image not found: ${t}`,"NOT_FOUND");i=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else h="buffer-input",i=t;let b=V.createHash("sha256").update(i).digest("hex").slice(0,12),j=await Gr(i),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(o,{recursive:!0});let B=[],A=g.basename(h,g.extname(h)),f=a.filter((s)=>s<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((s,p)=>s-p);for(let s of f){let p=Math.round(s/F);for(let w of n){let S=`${A}-${s}w-${b}.${w}`,P=g.join(o,S),q=`${c}/${S}`,E=await Kl(i,{width:s,height:p,format:w,quality:r,fit:m});await Bun.write(P,E),B.push({path:P,url:q,width:s,height:p,format:w,size:E.length})}}let y;if(l!=="none")y=await D(i,l);return{src:h,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function Gr(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return L(e)}function L(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let r=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:r,format:"jpeg",hasAlpha:!1}}let n=t.readUInt16BE(e+2);e+=2+n}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,n=t.readUInt16LE(28)&16383;return{width:a,height:n,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),n=(a&16383)+1,r=(a>>14&16383)+1;return{width:n,height:r,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new Jr("Unable to parse image dimensions","PARSE_ERROR")}async function Kl(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}let{processImage:n}=await import("ts-images");return await Qa("img",async(r)=>{let m=g.join(r,`out.${e.format}`);return await n({input:t,output:m,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(m).arrayBuffer())})}async function D(t,e){let a=await d();if(e==="blur"&&a){let c=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),i=await Gr(t);return`data:${U[i.format]||"image/jpeg"};base64,${c}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(c)=>{let i=await a(c).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let{generatePlaceholder:n}=await import("ts-images"),r=await Gr(t),m=Xe("ph"),l=g.join(m,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(l,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",i=await n(l,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&i.dominantColor)return i.dominantColor;if(i.dataURL)return i.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{se(m)}}function mt(t,e){return(e?t.filter((n)=>n.format===e):t).sort((n,r)=>n.width-r.width).map((n)=>`${n.url} ${n.width}w`).join(", ")}function Jt(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,n)=>{let r=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(n[0].replace(/\D/g,""))||0)-r}).map(([a,n])=>`(max-width: ${a}) ${n}`).join(", ")+", 100vw"}function jn(t){let e=t.filter((n)=>n.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((n,r)=>n.width-r.width);return a[Math.floor(a.length/2)]}function Bn(t){let e=new Map;for(let a of t){let n=e.get(a.format)||[];n.push(a),e.set(a.format,n)}return e}function Fn(t){let e=g.extname(t).toLowerCase();return T.includes(e)}function re(t){return U[t]||"application/octet-stream"}function zn(t){return t.reduce((e,a)=>e+a.size,0)}function Hn(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class Jr extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
+ export{ee,te,ne,Ln,he,$e,Gr,Kl,mt,Jt,jn,Bn,Fn,re,zn,Hn,Jr};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import t from"fs";import r from"path";var en="resources/assets",er="assets";function tr(o=process.cwd()){let s=r.resolve(o,en);return t.existsSync(s)&&t.statSync(s).isDirectory()?s:null}
3
+ export{en,er,tr};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Se,bi,wi,lg,Dt,Jc,ug,Yc,Zh,Le,vn,je}from"./chunk-xvhxxj4g.js";import{sl,s}from"./chunk-x4f7efgp.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Se as BROWSER_CORE_IMPORTS,lg as STX_AUTO_IMPORTS,bi as extractAndStripCssImports,Le as extractBridgeData,sl as findInterpolationEnd,Yc as generateAutoImportDestructuring,Zh as generateBrowserAutoImportDestructuring,vn as generateServerDataBridge,Dt as injectBrowserCoreAutoImports,je as processClientScript,ug as referencesName,wi as renderVendorStyleTags,s as stripCommentsAndLiterals,Jc as transformAutoImports};