@stacksjs/stx 0.2.859 → 0.2.861

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 (208) hide show
  1. package/dist/body-close.d.ts +13 -0
  2. package/dist/body-close.js +8 -0
  3. package/dist/{chunk-5va6c7jf.js → chunk-02css3vk.js} +5 -5
  4. package/dist/chunk-0hqr6bff.js +2 -0
  5. package/dist/{chunk-astcp7bc.js → chunk-121cgm3s.js} +4 -4
  6. package/dist/{chunk-xytq7q8j.js → chunk-15jymk6t.js} +2 -2
  7. package/dist/{chunk-gq9h36jf.js → chunk-15rkvc0t.js} +4 -4
  8. package/dist/chunk-15sgdvyd.js +2 -0
  9. package/dist/{chunk-fkh4xece.js → chunk-1jwcp2k0.js} +2 -2
  10. package/dist/{chunk-b1kc0ka1.js → chunk-261t62q4.js} +38 -38
  11. package/dist/chunk-2b4a8tbd.js +3 -0
  12. package/dist/chunk-2fw36w1x.js +2 -0
  13. package/dist/chunk-2jcxsw75.js +2 -0
  14. package/dist/{chunk-t2nhr2tc.js → chunk-2pbhdaka.js} +1 -1
  15. package/dist/chunk-2wba5ypm.js +2 -0
  16. package/dist/chunk-353gnvfe.js +2 -0
  17. package/dist/{chunk-14h4n1sj.js → chunk-36vksrry.js} +2 -2
  18. package/dist/{chunk-0es47pwe.js → chunk-37tefp7s.js} +5 -5
  19. package/dist/{chunk-ktnb1j54.js → chunk-38qp2pg2.js} +2 -2
  20. package/dist/chunk-3cr5y8v1.js +2 -0
  21. package/dist/{chunk-g17q4y5k.js → chunk-3gfd9t8a.js} +2 -2
  22. package/dist/{chunk-ts4t2n6b.js → chunk-3wg9kr5z.js} +4 -4
  23. package/dist/chunk-3y7yp0ka.js +2 -0
  24. package/dist/chunk-41wwqw0q.js +2 -0
  25. package/dist/chunk-4a1y51fs.js +2 -0
  26. package/dist/chunk-4a751brg.js +2 -0
  27. package/dist/{chunk-kpsxhm4x.js → chunk-4jgcd4d9.js} +3 -3
  28. package/dist/{chunk-k8pzk8v9.js → chunk-4rrxrxp6.js} +4 -4
  29. package/dist/chunk-5awhm4na.js +2 -0
  30. package/dist/chunk-5fhp9hxd.js +2 -0
  31. package/dist/{chunk-ywk6t76q.js → chunk-5ka3h8dy.js} +6 -6
  32. package/dist/chunk-5mg443dw.js +2 -0
  33. package/dist/{chunk-9qe4qsc7.js → chunk-5neezkj1.js} +4 -4
  34. package/dist/{chunk-6w5a5ns4.js → chunk-5q4tncfw.js} +5 -5
  35. package/dist/chunk-5x9ajbq0.js +2 -0
  36. package/dist/{chunk-gndxakrh.js → chunk-5xdkmn39.js} +2 -2
  37. package/dist/{chunk-3w3fxcyx.js → chunk-65cbfx5x.js} +2 -2
  38. package/dist/{chunk-hf9pvmq2.js → chunk-68w65mhs.js} +3 -3
  39. package/dist/chunk-6g7tkmty.js +2 -0
  40. package/dist/{chunk-wfd9e224.js → chunk-6nb49h13.js} +9 -9
  41. package/dist/{chunk-6t0xy3wk.js → chunk-6tp0w6hf.js} +2 -2
  42. package/dist/chunk-72bj7ea4.js +2 -0
  43. package/dist/{chunk-tc31my2p.js → chunk-74g64pzt.js} +4 -4
  44. package/dist/{chunk-0yw86e75.js → chunk-76360zky.js} +5 -5
  45. package/dist/{chunk-wdcz6d20.js → chunk-7bajrfb1.js} +2 -2
  46. package/dist/{chunk-2kc0vsnb.js → chunk-7de5y29a.js} +5 -5
  47. package/dist/{chunk-cj9rev2p.js → chunk-7yhhwv07.js} +2 -2
  48. package/dist/chunk-811hh6vp.js +2 -0
  49. package/dist/{chunk-9nh48zvm.js → chunk-830ej8d2.js} +9 -9
  50. package/dist/chunk-8fkmxrat.js +2 -0
  51. package/dist/{chunk-dbm963p9.js → chunk-8hck9qqm.js} +4 -4
  52. package/dist/chunk-8p9npc8y.js +2 -0
  53. package/dist/chunk-9fz3h6sx.js +2 -0
  54. package/dist/chunk-9jr30fns.js +2 -0
  55. package/dist/{chunk-2sq9pdg3.js → chunk-9pyvc0dc.js} +2 -2
  56. package/dist/{chunk-4yfbd8ny.js → chunk-9syvkm5z.js} +6 -6
  57. package/dist/{chunk-a9c3gndq.js → chunk-a6d92kv6.js} +2 -2
  58. package/dist/chunk-a9m6ajd7.js +2 -0
  59. package/dist/{chunk-403a4pqm.js → chunk-aj6vqdf7.js} +3 -3
  60. package/dist/chunk-asr5v51s.js +2 -0
  61. package/dist/{chunk-v9h7s8ce.js → chunk-avp271q4.js} +1 -1
  62. package/dist/{chunk-3248qphb.js → chunk-b1tctqn5.js} +6 -6
  63. package/dist/{chunk-8mdhencj.js → chunk-b7nmgkwa.js} +3 -3
  64. package/dist/{chunk-6e44f8w8.js → chunk-bag9q4m0.js} +30 -30
  65. package/dist/{chunk-7m17m22p.js → chunk-bg0ywp5w.js} +2 -2
  66. package/dist/{chunk-aq8r4rbs.js → chunk-bv14vry8.js} +2 -2
  67. package/dist/chunk-byx82s10.js +2 -0
  68. package/dist/{chunk-q3cyycnh.js → chunk-c2w4wc9f.js} +1 -1
  69. package/dist/chunk-c9y1g61m.js +2 -0
  70. package/dist/chunk-ck5nzbbv.js +2 -0
  71. package/dist/{chunk-yd6ej23e.js → chunk-cq2hedwn.js} +5 -5
  72. package/dist/chunk-cvdm0hgq.js +2 -0
  73. package/dist/{chunk-6mza6zr3.js → chunk-d6216bcw.js} +3 -3
  74. package/dist/{chunk-s4592dy0.js → chunk-dba4bwkd.js} +6 -6
  75. package/dist/{chunk-rgjjt1mb.js → chunk-dt73ww6m.js} +1 -1
  76. package/dist/chunk-e0fxgbcc.js +2 -0
  77. package/dist/{chunk-49j3cn9h.js → chunk-e8nzbz66.js} +2 -2
  78. package/dist/chunk-ed2m6pjf.js +2 -0
  79. package/dist/chunk-ednwdhv0.js +2 -0
  80. package/dist/chunk-egtphftq.js +2 -0
  81. package/dist/{chunk-2w7csg0c.js → chunk-eye156nv.js} +1 -1
  82. package/dist/chunk-fahqq7c4.js +2 -0
  83. package/dist/chunk-fcbpzdyz.js +2 -0
  84. package/dist/{chunk-x9c4njvx.js → chunk-fyfvqd2s.js} +2 -2
  85. package/dist/{chunk-1v95w26e.js → chunk-gc79s0wh.js} +9 -9
  86. package/dist/{chunk-9a3rv0rj.js → chunk-gggadrs4.js} +2 -2
  87. package/dist/{chunk-vj1bwnvs.js → chunk-gjnrmz2q.js} +2 -2
  88. package/dist/{chunk-w1d8t47c.js → chunk-gp1dt8b8.js} +3 -3
  89. package/dist/{chunk-5t1k0dxm.js → chunk-gx96hctv.js} +2 -2
  90. package/dist/chunk-h0dsxxz4.js +2 -0
  91. package/dist/{chunk-1hebvmaj.js → chunk-h2cvfp9y.js} +1 -1
  92. package/dist/{chunk-ews9yzr7.js → chunk-h4aqpf2r.js} +3 -3
  93. package/dist/{chunk-52b6czss.js → chunk-hyea17hp.js} +69 -69
  94. package/dist/chunk-k3yym9zg.js +2 -0
  95. package/dist/chunk-k9fsd6t3.js +2 -0
  96. package/dist/chunk-kepxsjfx.js +2 -0
  97. package/dist/chunk-kh01rvag.js +2 -0
  98. package/dist/{chunk-qd87dk1d.js → chunk-kv40xq53.js} +14 -14
  99. package/dist/{chunk-m1qqqc2j.js → chunk-m3p4hksq.js} +2 -2
  100. package/dist/chunk-mad172af.js +2 -0
  101. package/dist/{chunk-kvc9cwvx.js → chunk-mjkdskeg.js} +1 -1
  102. package/dist/{chunk-wjamjgx6.js → chunk-naj146zq.js} +1 -1
  103. package/dist/chunk-npt0mdzb.js +2 -0
  104. package/dist/{chunk-shke1fcm.js → chunk-nwxjh1gv.js} +3 -3
  105. package/dist/chunk-ptc3yqn3.js +2 -0
  106. package/dist/chunk-pybm7c9p.js +2 -0
  107. package/dist/{chunk-xpg52hsz.js → chunk-q6w7a1vc.js} +3 -3
  108. package/dist/{chunk-26jt4jvh.js → chunk-qjm23ma2.js} +1 -1
  109. package/dist/chunk-qnx71b17.js +2 -0
  110. package/dist/chunk-qx8cav4w.js +2 -0
  111. package/dist/chunk-rb7cwck6.js +2 -0
  112. package/dist/chunk-s1e0t3hv.js +2 -0
  113. package/dist/chunk-s7vfmasx.js +2 -0
  114. package/dist/{chunk-jd4dr23j.js → chunk-scwbttvt.js} +2 -2
  115. package/dist/{chunk-7trdtz0c.js → chunk-sxtvy0sm.js} +2 -2
  116. package/dist/chunk-t7z67vf6.js +2 -0
  117. package/dist/{chunk-qttq8cje.js → chunk-tarvase5.js} +1 -1
  118. package/dist/{chunk-qgxwf9xr.js → chunk-thdnk1kd.js} +3 -3
  119. package/dist/{chunk-ftwdjgzd.js → chunk-tjz3r7rj.js} +5 -5
  120. package/dist/{chunk-yehdcjn1.js → chunk-tm201m9x.js} +2 -2
  121. package/dist/chunk-tqs9pcga.js +2 -0
  122. package/dist/chunk-twjfrywv.js +2 -0
  123. package/dist/{chunk-rwxg4m3h.js → chunk-v0wdgxga.js} +1 -1
  124. package/dist/{chunk-p9jfn4yh.js → chunk-vggtxttf.js} +5 -5
  125. package/dist/chunk-vyna2rsq.js +2 -0
  126. package/dist/chunk-w4gjx2zs.js +18 -0
  127. package/dist/{chunk-v4rrgphj.js → chunk-wrbhq1y2.js} +3 -3
  128. package/dist/{chunk-4a0x737h.js → chunk-x69457q9.js} +4 -4
  129. package/dist/chunk-xhe7pw6e.js +2 -0
  130. package/dist/{chunk-33x46g87.js → chunk-xmy6g81m.js} +1 -1
  131. package/dist/chunk-y86mpnrg.js +2 -0
  132. package/dist/{chunk-ypgegzh2.js → chunk-yj9nyt93.js} +2 -2
  133. package/dist/{chunk-w1stsxm3.js → chunk-z99bf0q0.js} +2 -2
  134. package/dist/chunk-zm0g7ntw.js +2 -0
  135. package/dist/{chunk-618t6hxp.js → chunk-zpkgs5d3.js} +4 -4
  136. package/dist/chunk-zrm2x65c.js +2 -0
  137. package/dist/{chunk-fxxh149b.js → chunk-zs4s9fcq.js} +4 -4
  138. package/dist/cli.js +13 -13
  139. package/dist/craft-entry.js +2 -2
  140. package/dist/craft.js +2 -2
  141. package/dist/index.d.ts +1 -0
  142. package/dist/index.js +1 -0
  143. package/dist/pwa.js +3 -3
  144. package/dist/render.js +2 -6
  145. package/dist/serve.js +2 -6
  146. package/dist/site-builder/build.js +2 -2
  147. package/dist/site-builder/router.js +2 -5
  148. package/dist/site-builder/theme.js +2 -2
  149. package/dist/ssg.js +4 -4
  150. package/package.json +5 -5
  151. package/dist/chunk-13fe3avf.js +0 -2
  152. package/dist/chunk-1p47cg0g.js +0 -2
  153. package/dist/chunk-1z46g29d.js +0 -2
  154. package/dist/chunk-228cbw2p.js +0 -2
  155. package/dist/chunk-2bggrzv0.js +0 -2
  156. package/dist/chunk-2dnd2s2a.js +0 -3
  157. package/dist/chunk-34rh88vd.js +0 -2
  158. package/dist/chunk-3cqp0m62.js +0 -2
  159. package/dist/chunk-3dtzcc9j.js +0 -2
  160. package/dist/chunk-3rgqrs3c.js +0 -2
  161. package/dist/chunk-51kb36f7.js +0 -2
  162. package/dist/chunk-53ezn1tw.js +0 -2
  163. package/dist/chunk-636j1nmd.js +0 -2
  164. package/dist/chunk-756rpwn0.js +0 -2
  165. package/dist/chunk-7pq02v7n.js +0 -2
  166. package/dist/chunk-7sht1rkv.js +0 -2
  167. package/dist/chunk-9rgp005c.js +0 -2
  168. package/dist/chunk-azvx5gaa.js +0 -2
  169. package/dist/chunk-ebk1723c.js +0 -2
  170. package/dist/chunk-emc7zqry.js +0 -2
  171. package/dist/chunk-eppv6knk.js +0 -2
  172. package/dist/chunk-f935fec7.js +0 -2
  173. package/dist/chunk-g0v1shhr.js +0 -2
  174. package/dist/chunk-g5pg0pg1.js +0 -2
  175. package/dist/chunk-g8x32bq2.js +0 -2
  176. package/dist/chunk-g978f9qg.js +0 -18
  177. package/dist/chunk-hk7vjyqa.js +0 -2
  178. package/dist/chunk-jmaw2cdt.js +0 -2
  179. package/dist/chunk-jw75rmpw.js +0 -2
  180. package/dist/chunk-m3fq72f8.js +0 -2
  181. package/dist/chunk-n54twtm7.js +0 -2
  182. package/dist/chunk-np6y9evb.js +0 -2
  183. package/dist/chunk-pk0mxjxw.js +0 -2
  184. package/dist/chunk-q9r13taa.js +0 -2
  185. package/dist/chunk-qqjhq0hb.js +0 -2
  186. package/dist/chunk-qsjkewah.js +0 -2
  187. package/dist/chunk-qw80eta1.js +0 -2
  188. package/dist/chunk-r51bfc2y.js +0 -2
  189. package/dist/chunk-rbrvepr3.js +0 -2
  190. package/dist/chunk-se4ny3q0.js +0 -2
  191. package/dist/chunk-sxvv9w8t.js +0 -2
  192. package/dist/chunk-sy703233.js +0 -2
  193. package/dist/chunk-syzn6mq5.js +0 -2
  194. package/dist/chunk-v3r1wwec.js +0 -2
  195. package/dist/chunk-vd5d1yb9.js +0 -2
  196. package/dist/chunk-vmdsj8r5.js +0 -2
  197. package/dist/chunk-vmg3f76h.js +0 -2
  198. package/dist/chunk-w63c96ce.js +0 -2
  199. package/dist/chunk-wcgca1q6.js +0 -2
  200. package/dist/chunk-wv8qmwqp.js +0 -2
  201. package/dist/chunk-x90f7h2g.js +0 -2
  202. package/dist/chunk-xhnpgey5.js +0 -2
  203. package/dist/chunk-y54pj23g.js +0 -2
  204. package/dist/chunk-yhrkqcqd.js +0 -2
  205. package/dist/chunk-ykxpzjgy.js +0 -2
  206. package/dist/chunk-zhyrhxdp.js +0 -2
  207. package/dist/chunk-zn5tewws.js +0 -2
  208. package/dist/chunk-zvra3bmk.js +0 -2
@@ -25,7 +25,7 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
25
25
  `;n.appendFileSync(this.logFilePath,s,"utf-8")}catch(n){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",n)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let r=this.maxLogFiles-1;r>=1;r--){let i=`${this.logFilePath}.${r}`,s=`${this.logFilePath}.${r+1}`;if(e.existsSync(i))if(r>=this.maxLogFiles-1)e.unlinkSync(i);else e.renameSync(i,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(n){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",n)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((n)=>n.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((n)=>n.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},n={error:0,warning:0,info:0};for(let r of this.errors){let i=r.error.constructor.name;e[i]=(e[i]||0)+1;let s=r.level||"error";n[s]=(n[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:n}}async exportToFile(e,n="json"){let r=await import("fs"),i=await import("path"),s=i.dirname(e);if(!r.existsSync(s))r.mkdirSync(s,{recursive:!0});if(n==="json"){let o=this.errors.map((a)=>({timestamp:a.timestamp.toISOString(),level:a.level||"error",type:a.error.constructor.name,message:a.error.message,stack:a.error.stack,context:a.context}));r.writeFileSync(e,JSON.stringify(o,null,2),"utf-8")}else{let o=this.errors.map((a)=>this.formatEntry(a));r.writeFileSync(e,o.join(`
26
26
 
27
27
  `),"utf-8")}}async flush(){await this.writeQueue}}var z=new ne,En={isDevelopment(){return G()},logDetailedError(e,n){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),n)console.error("Context:",n);console.error("========================")},createErrorReport(e,n){let r=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(n)r.push(`Context: ${JSON.stringify(n,null,2)}`);return r.push("========================"),r.join(`
28
- `)}};function x(e,n,r,i=0){let s=0,o=i,a=null,c=0,p=!1;while(o<e.length){let g=e[o];if(a&&p){p=!1,o++;continue}if(a&&g==="\\"){p=!0,o++;continue}if(p=!1,(g==='"'||g==="'"||g==="`")&&!a){a=g,o++;continue}if(g===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&g==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&g==="}"){c--,o++;continue}if(g==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(g===n)s++;else if(g===r){if(s--,s===0)return o}o++}return-1}function fl(e,n){let r=n,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(n,r),endPos:r}}class R{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let r=this.options?this.options.sizeOf(n):0;if(this.options&&r>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+r>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,r),this.bytes+=r}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var M=new Map,Tt=500;function Ft(e,n){if(n?.includes("g"))return new RegExp(e,n);let r=`${e}:${n||""}`;if(!M.has(r)){if(M.size>=Tt){let i=M.keys().next().value;if(i)M.delete(i)}M.set(r,new RegExp(e,n))}return M.get(r)}class ke{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),r=n.sort().join(","),i=this.pool.find((c)=>c.context.join(",")===r);if(i)return i.func;let s=this.fnCache,o=this.fnCacheMaxSize,a=(...c)=>(p)=>{try{let g=`${r}:${p}`,h=s.get(g);if(!h){if(s.size>=o){let m=s.keys().next().value;if(m)s.delete(m)}h=Function(...n,`
28
+ `)}};function x(e,n,r,i=0){let s=0,o=i,a=null,c=0,p=!1;while(o<e.length){let g=e[o];if(a&&p){p=!1,o++;continue}if(a&&g==="\\"){p=!0,o++;continue}if(p=!1,(g==='"'||g==="'"||g==="`")&&!a){a=g,o++;continue}if(g===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&g==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&g==="}"){c--,o++;continue}if(g==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(g===n)s++;else if(g===r){if(s--,s===0)return o}o++}return-1}function gl(e,n){let r=n,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(n,r),endPos:r}}class R{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let r=this.options?this.options.sizeOf(n):0;if(this.options&&r>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+r>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,r),this.bytes+=r}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var M=new Map,Tt=500;function Ft(e,n){if(n?.includes("g"))return new RegExp(e,n);let r=`${e}:${n||""}`;if(!M.has(r)){if(M.size>=Tt){let i=M.keys().next().value;if(i)M.delete(i)}M.set(r,new RegExp(e,n))}return M.get(r)}class ke{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),r=n.sort().join(","),i=this.pool.find((c)=>c.context.join(",")===r);if(i)return i.func;let s=this.fnCache,o=this.fnCacheMaxSize,a=(...c)=>(p)=>{try{let g=`${r}:${p}`,h=s.get(g);if(!h){if(s.size>=o){let m=s.keys().next().value;if(m)s.delete(m)}h=Function(...n,`
29
29
  'use strict';
30
30
  try {
31
31
  return ${p};
@@ -36,7 +36,7 @@ catch (e) {
36
36
  }
37
37
  throw e;
38
38
  }
39
- `),s.set(g,h)}return h(...c)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:n.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var or=new ke;class Te{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,n){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...n})}setBudgets(e){for(let[n,r]of Object.entries(e))this.setBudget(n,r)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[n,r]of this.budgets.entries())e[n]=r;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let n=this.violationHandlers.indexOf(e);if(n!==-1)this.violationHandlers.splice(n,1)}time(e,n){if(!this.enabled)return n();let r=performance.now(),i=n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}async timeAsync(e,n){if(!this.enabled)return n();let r=performance.now(),i=await n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}checkBudget(e,n){let r=this.budgets.get(e);if(!r)return;let i=n/r.maxTime*100,s=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,o=n>=r.maxTime;if(!s&&!o)return;let a={label:e,actualTime:n,budgetTime:r.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:s};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let p of this.violationHandlers)try{p(a)}catch{}let c=s?`[Performance Warning] "${e}" took ${n.toFixed(2)}ms (${i.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(c);break;case"warn":console.warn(c);break;case"error":console.error(c);break;case"throw":if(o)throw Error(c);else console.warn(c);break}}recordTime(e,n){let r=this.metrics.get(e);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(e,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(e){if(e){let r=this.metrics.get(e);if(!r)return{};let i=this.budgets.get(e);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:i?.maxTime,budgetUtilization:i?r.totalTime/r.count/i.maxTime*100:void 0}}let n={};for(let[r,i]of this.metrics.entries()){let s=this.budgets.get(r);n[r]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:s?.maxTime,budgetUtilization:s?i.totalTime/i.count/s.maxTime*100:void 0}}return n}getViolations(e){if(e)return this.violations.filter((n)=>n.label===e);return[...this.violations]}getViolationStats(){let e={},n=0,r=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)n++;else r++;return{total:this.violations.length,byLabel:e,warnings:n,errors:r}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var re=null;function Rt(){if(!re)re=new Te;return re}var le=new Proxy({},{get(e,n){return Rt()[n]}});var Se=0;async function _(){if(performance.now()-Se<16)return;await new Promise((e)=>setTimeout(e,0)),Se=performance.now()}var $t={maxSanitizeDepth:10,allowBracketNotation:!1},Le={...$t};var U=/\bnew\s+/,V="__stx_safe_ctors",Me=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ie=[...Me,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],Re=ie.map(()=>{return}),se=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),ae=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,U,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],ce=new Set([...Me,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",V]),ue=new Set(["__proto__","constructor","prototype"]);function Ne(e){let n="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)n+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}n+=a,r.push(o)}return{text:n,map:r}}function De(e){return Ne(e).text}var Fe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],ze=(()=>{let e={Date,URL,URLSearchParams},n=Intl;for(let r of Fe)if(typeof n[r]==="function")e[`Intl_${r}`]=n[r];return Object.freeze(Object.assign(Object.create(null),e))})(),Ct=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,$e=/(?<![\w$])new(?![\w$])/g,Ae=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Fe.join(",")}}() are allowed`;function At(e){let{text:n,map:r}=Ne(e),i=[];$e.lastIndex=0;let s;while((s=$e.exec(n))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(n.slice(0,a)))continue;let c=Ct.exec(n.slice(a)),p=c?.[3],g=!c?null:p?`Intl_${p}`:c[2];if(!c||!g||!(g in ze))throw new S(`matched /${U.source}/; ${Ae}`,e);let h=a+c[0].length,m=r[a],y=r[h-1]+1;if(e.slice(m,y)!==n.slice(a,h))throw new S(`matched /${U.source}/; ${Ae}`,e);let E=m+3+c[1].length;i.push({start:E,end:E+c[2].length,key:g})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${V}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,n,r){super(r??`Potentially unsafe expression (${e}): ${n}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=n}}function Js(e){try{return ge(e),null}catch(n){return n instanceof S?n.rule:n instanceof Error?n.message:String(n)}}function je(e,n){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(ce.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,n);if(o==="."&&ue.has(s))throw new S(`matched /.${s}/; property ${s}`,n)}}function Be(e,n=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),p=/^'(?:[^'\\]|\\.)*'$/.test(c),g=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(p||g){let m=c.slice(1,-1);if(ue.has(m))throw new S(`bracket key ${m}`,e);if(!Le.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(n&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function ge(e){let n=e.trim(),r=De(n);je(r,n);let i=Be(n);for(let s of ae){if(s===U)continue;if(s.test(r))throw new S(`matched /${s.source}/`,n)}return{...At(n),dynamicKeys:i}}function Ai(e){return ge(e),e.trim()}var Ys=Symbol("stx.sanitizeCache"),_t=4000,B=new Map;function Ot(e){let n=B.get(e);if(n===void 0){if(n=ae.some((r)=>r.test(e)),B.size>=_t)B.clear();B.set(e,n)}return n}function W(e){let n={},r=e[Ys];n.Math=Math,n.JSON=JSON,n.Date=Date,n.String=String,n.Number=Number,n.Boolean=Boolean,n.Array=Array,n.Object=se,n.parseInt=Number.parseInt,n.parseFloat=Number.parseFloat,n.isNaN=Number.isNaN,n.isFinite=Number.isFinite,n.encodeURIComponent=encodeURIComponent,n.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||Ot(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=oe(s),r?.set(s,o);n[i]=o}else n[i]=s}return n}function oe(e,n=0){if(n>=Le.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>oe(i,n+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=oe(s,n+1);else r[i]=s}return r}function u(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r);return d(e,i)(...s)}catch{return}}function f(e){try{return Ai(e),!0}catch{return!1}}function pl(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r),o=!1,c=d(e,i,()=>{o=!0})(...s);return!o&&Boolean(c)}catch{return!1}}function P(e,n){try{let r=u(e,n);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var He=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),_e=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,It=0,Pt=0;function Lt(e,n){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=_e;for(let s=0;s<16;s++){let o=`c${++It}`,a=`'use strict';if(${r}===${JSON.stringify(_e)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+n);if(c(...i)===o)return c;Pt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Mt=2000,H=new Map;function Oe(e,n){let r=`${e.join(",")}\x00${n}`,i=H.get(r);if(i)return i;let s=Lt(e,n);if(H.size>=Mt)H.clear();return H.set(r,s),s}function at(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var Nt=/^[A-Za-z_$][\w$]*$/;function zt(e){return Nt.test(e)&&!He.has(e)}var Ie=new R(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function d(e,n,r){let i=JSON.stringify([e,n]),s=Ie.get(i);if(!s)s=Dt(e,[...n]),s.sourceBytes+=i.length*2,Ie.set(i,s);return jt(Bt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Dt(e,n){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=ge(e),o=[];for(let m=0;m<n.length;m++){if(!zt(n[m]))continue;if(n[m]===V||n[m]==="Object"||ce.has(n[m]))continue;o.push({key:n[m],index:m})}o.sort((m,y)=>m.key<y.key?-1:1);let a=o.map((m)=>m.key),c=o.map((m)=>m.index),p=`
39
+ `),s.set(g,h)}return h(...c)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:n.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var or=new ke;class Te{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,n){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...n})}setBudgets(e){for(let[n,r]of Object.entries(e))this.setBudget(n,r)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[n,r]of this.budgets.entries())e[n]=r;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let n=this.violationHandlers.indexOf(e);if(n!==-1)this.violationHandlers.splice(n,1)}time(e,n){if(!this.enabled)return n();let r=performance.now(),i=n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}async timeAsync(e,n){if(!this.enabled)return n();let r=performance.now(),i=await n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}checkBudget(e,n){let r=this.budgets.get(e);if(!r)return;let i=n/r.maxTime*100,s=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,o=n>=r.maxTime;if(!s&&!o)return;let a={label:e,actualTime:n,budgetTime:r.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:s};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let p of this.violationHandlers)try{p(a)}catch{}let c=s?`[Performance Warning] "${e}" took ${n.toFixed(2)}ms (${i.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(c);break;case"warn":console.warn(c);break;case"error":console.error(c);break;case"throw":if(o)throw Error(c);else console.warn(c);break}}recordTime(e,n){let r=this.metrics.get(e);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(e,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(e){if(e){let r=this.metrics.get(e);if(!r)return{};let i=this.budgets.get(e);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:i?.maxTime,budgetUtilization:i?r.totalTime/r.count/i.maxTime*100:void 0}}let n={};for(let[r,i]of this.metrics.entries()){let s=this.budgets.get(r);n[r]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:s?.maxTime,budgetUtilization:s?i.totalTime/i.count/s.maxTime*100:void 0}}return n}getViolations(e){if(e)return this.violations.filter((n)=>n.label===e);return[...this.violations]}getViolationStats(){let e={},n=0,r=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)n++;else r++;return{total:this.violations.length,byLabel:e,warnings:n,errors:r}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var re=null;function Rt(){if(!re)re=new Te;return re}var le=new Proxy({},{get(e,n){return Rt()[n]}});var Se=0;async function _(){if(performance.now()-Se<16)return;await new Promise((e)=>setTimeout(e,0)),Se=performance.now()}var $t={maxSanitizeDepth:10,allowBracketNotation:!1},Le={...$t};var U=/\bnew\s+/,V="__stx_safe_ctors",Me=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ie=[...Me,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],Re=ie.map(()=>{return}),se=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),ae=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,U,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],ce=new Set([...Me,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",V]),ue=new Set(["__proto__","constructor","prototype"]);function Ne(e){let n="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)n+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}n+=a,r.push(o)}return{text:n,map:r}}function De(e){return Ne(e).text}var Fe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],ze=(()=>{let e={Date,URL,URLSearchParams},n=Intl;for(let r of Fe)if(typeof n[r]==="function")e[`Intl_${r}`]=n[r];return Object.freeze(Object.assign(Object.create(null),e))})(),Ct=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,$e=/(?<![\w$])new(?![\w$])/g,Ae=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Fe.join(",")}}() are allowed`;function At(e){let{text:n,map:r}=Ne(e),i=[];$e.lastIndex=0;let s;while((s=$e.exec(n))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(n.slice(0,a)))continue;let c=Ct.exec(n.slice(a)),p=c?.[3],g=!c?null:p?`Intl_${p}`:c[2];if(!c||!g||!(g in ze))throw new S(`matched /${U.source}/; ${Ae}`,e);let h=a+c[0].length,m=r[a],y=r[h-1]+1;if(e.slice(m,y)!==n.slice(a,h))throw new S(`matched /${U.source}/; ${Ae}`,e);let E=m+3+c[1].length;i.push({start:E,end:E+c[2].length,key:g})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${V}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,n,r){super(r??`Potentially unsafe expression (${e}): ${n}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=n}}function Js(e){try{return ge(e),null}catch(n){return n instanceof S?n.rule:n instanceof Error?n.message:String(n)}}function je(e,n){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(ce.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,n);if(o==="."&&ue.has(s))throw new S(`matched /.${s}/; property ${s}`,n)}}function Be(e,n=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),p=/^'(?:[^'\\]|\\.)*'$/.test(c),g=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(p||g){let m=c.slice(1,-1);if(ue.has(m))throw new S(`bracket key ${m}`,e);if(!Le.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(n&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function ge(e){let n=e.trim(),r=De(n);je(r,n);let i=Be(n);for(let s of ae){if(s===U)continue;if(s.test(r))throw new S(`matched /${s.source}/`,n)}return{...At(n),dynamicKeys:i}}function Ai(e){return ge(e),e.trim()}var Ys=Symbol("stx.sanitizeCache"),_t=4000,B=new Map;function Ot(e){let n=B.get(e);if(n===void 0){if(n=ae.some((r)=>r.test(e)),B.size>=_t)B.clear();B.set(e,n)}return n}function W(e){let n={},r=e[Ys];n.Math=Math,n.JSON=JSON,n.Date=Date,n.String=String,n.Number=Number,n.Boolean=Boolean,n.Array=Array,n.Object=se,n.parseInt=Number.parseInt,n.parseFloat=Number.parseFloat,n.isNaN=Number.isNaN,n.isFinite=Number.isFinite,n.encodeURIComponent=encodeURIComponent,n.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||Ot(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=oe(s),r?.set(s,o);n[i]=o}else n[i]=s}return n}function oe(e,n=0){if(n>=Le.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>oe(i,n+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=oe(s,n+1);else r[i]=s}return r}function u(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r);return d(e,i)(...s)}catch{return}}function f(e){try{return Ai(e),!0}catch{return!1}}function fl(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r),o=!1,c=d(e,i,()=>{o=!0})(...s);return!o&&Boolean(c)}catch{return!1}}function P(e,n){try{let r=u(e,n);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var He=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),_e=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,It=0,Pt=0;function Lt(e,n){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=_e;for(let s=0;s<16;s++){let o=`c${++It}`,a=`'use strict';if(${r}===${JSON.stringify(_e)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+n);if(c(...i)===o)return c;Pt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Mt=2000,H=new Map;function Oe(e,n){let r=`${e.join(",")}\x00${n}`,i=H.get(r);if(i)return i;let s=Lt(e,n);if(H.size>=Mt)H.clear();return H.set(r,s),s}function at(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var Nt=/^[A-Za-z_$][\w$]*$/;function zt(e){return Nt.test(e)&&!He.has(e)}var Ie=new R(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function d(e,n,r){let i=JSON.stringify([e,n]),s=Ie.get(i);if(!s)s=Dt(e,[...n]),s.sourceBytes+=i.length*2,Ie.set(i,s);return jt(Bt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Dt(e,n){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=ge(e),o=[];for(let m=0;m<n.length;m++){if(!zt(n[m]))continue;if(n[m]===V||n[m]==="Object"||ce.has(n[m]))continue;o.push({key:n[m],index:m})}o.sort((m,y)=>m.key<y.key?-1:1);let a=o.map((m)=>m.key),c=o.map((m)=>m.index),p=`
40
40
  'use strict';
41
41
  try {
42
42
  return ${r};
@@ -48,10 +48,10 @@ catch (e) {
48
48
  throw e;
49
49
  }
50
50
  `,g=i?(m)=>{let y=Oe([V,"Object",...ie,...a,...m],p);return(...E)=>y(ze,se,...Re,...E)}:(m)=>{let y=Oe(["Object",...ie,...a,...m],p);return(...E)=>y(se,...Re,...E)},h=g([]);return{sourceBytes:e.length*2+n.reduce((m,y)=>m+y.length*2,0),contextKeys:n,filteredKeys:a,validEntries:o,validIndices:c,dynamicKeys:s,buildFunc:(m)=>m.length===0?h:g(m)}}function jt(e,n,r){if(r.length===0)return e;let i=r.map((s)=>n.indexOf(s));return(...s)=>{for(let o of i){if(o<0)continue;let a=s[o];if(typeof a==="string"&&ue.has(a))return}return e(...s)}}function Bt(e,n,r,i,s,o){let a=e([]),c=i.every((g,h)=>g.index===h);if(n.length===r.length&&c)return Pe(a,n,e,void 0,o);return Pe((...g)=>{let h=Array(s.length);for(let m=0;m<s.length;m++)h[m]=g[s[m]];return a(...h)},n,e,(g)=>{a=e(g)},o)}function Pe(e,n,r,i,s){let a=/^(\w+) is not defined$/,c=e,p=[],g=new Set(n);return(...h)=>{for(let m=0;m<=8;m++)try{return c(...h)}catch(y){let E=y instanceof Error?y.message:"",v=a.exec(E);if(!(y instanceof ReferenceError)||!v)return;let w=v[1];if(g.has(w)||He.has(w)||ce.has(w))return;if(s?.(w),g.add(w),p.push(w),i)i(p);else c=r(p)}return}}function Zs(e){let n=e.trim();try{let r=De(n);if(/\b(?:eval|function|import|require|process|globalthis|window|document|fetch|bun|deno|buffer|console|reflect|proxy|prototype|constructor|this)\b/i.test(r))return!1;je(r,n),Be(n);for(let i of ae)if(i.test(r))return!1}catch{return!1}return!0}function Ii(e,n){let r=[];n.lastIndex=0;let i;while((i=n.exec(e))!==null){let s=i.index,o=s+i[0].length-1,a=x(e,"(",")",o);if(a===-1){r.push({start:s,end:-1,args:"",call:e.slice(s,Math.min(e.length,s+80))}),n.lastIndex=o+1;continue}r.push({start:s,end:a+1,args:e.slice(o+1,a),call:e.slice(s,a+1)}),n.lastIndex=a+1}return r}function Ht(e,n,r,i){let s="",o=0;for(let a of Ii(e,n)){if(s+=e.slice(o,a.start),a.end===-1){s+=i(a.call),o=a.start;continue}s+=r(a.args,a.call),o=a.end}return s+e.slice(o)}function Vt(e){let n=[],r=0,i=null,s="";for(let o=0;o<e.length;o++){let a=e[o];if(i){if(s+=a,a==="\\"&&o+1<e.length){s+=e[++o];continue}if(a===i)i=null;continue}if(a==="'"||a==='"'||a==="`")i=a;else if(a==="("||a==="["||a==="{")r++;else if(a===")"||a==="]"||a==="}")r--;else if(a===","&&r===0){n.push(s.trim()),s="";continue}s+=a}if(s.trim())n.push(s.trim());return n}function de(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let i="";for(let s=1;s<n.length-1;s++){let o=n[s];if(o==="\\"&&s+1<n.length-1){let a=n[++s];i+=a==="n"?`
51
- `:a==="t"?"\t":a;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[s+1]==="{")return null;i+=o}return i}var Wt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Ut(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let i=Js(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:t.UNSAFE_EXPRESSION};let s=W(n),o;try{o=d(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(at(r))].filter((c)=>!Wt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((p)=>`"${p}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function Ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function ct(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ke(e){if(!e)return"";return Ve.isAbsolute(e)?Ve.relative(process.cwd(),e)||e:e}function pe(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function D(e,n,r,i,s=t.EVALUATION_ERROR){let o=i?` in ${Ke(i)}`:"";return console.warn(`[stx] ${pe(n)}${o}: ${r}`),l(e,`${pe(n)}: ${r}`,s)}function Qs(e,n,r){let i=r?` in ${Ke(r)}`:"";console.warn(`[stx] ${pe(e)}${i}: ${n}`)}function Oi(){return{afterOpen:[],beforeClose:[]}}function Kt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function gl(e,n){if(!Kt(n))return e;let r=n.afterOpen.join(""),i=n.beforeClose.join(""),s=e.lastIndexOf("</head>"),o=r?Pr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var Xe=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Pr(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;Xe.lastIndex=r;let i=Xe.exec(e);return i?r+i[0].length:r}var me="data-stx-color-mode-boot",qe="__STX_COLOR_MODE__",Xt=new Set(["light","dark","auto","system"]),qt=new Set(["auto","system"]),Gt=/^[a-z][\w:-]*$/i,Yt=/^[\w-]+$/;function Jt(e){let n=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Xt.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Yt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!Gt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!qt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:n,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Zt(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function he(e={}){let n=Jt(e),r=Zt(n),i=`(function(){"use strict";var o=window.${qe};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${qe}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${me}>${i}</script>`}function Ir(e,n={}){if(e.includes(me))return e;let r=fe(e);if(r===null)return e;let i=he(n);return`${e.slice(0,r)}
51
+ `:a==="t"?"\t":a;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[s+1]==="{")return null;i+=o}return i}var Wt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Ut(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let i=Js(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:t.UNSAFE_EXPRESSION};let s=W(n),o;try{o=d(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(at(r))].filter((c)=>!Wt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((p)=>`"${p}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function Ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function ct(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ke(e){if(!e)return"";return Ve.isAbsolute(e)?Ve.relative(process.cwd(),e)||e:e}function pe(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function D(e,n,r,i,s=t.EVALUATION_ERROR){let o=i?` in ${Ke(i)}`:"";return console.warn(`[stx] ${pe(n)}${o}: ${r}`),l(e,`${pe(n)}: ${r}`,s)}function Qs(e,n,r){let i=r?` in ${Ke(r)}`:"";console.warn(`[stx] ${pe(e)}${i}: ${n}`)}function Oi(){return{afterOpen:[],beforeClose:[]}}function Kt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function ml(e,n){if(!Kt(n))return e;let r=n.afterOpen.join(""),i=n.beforeClose.join(""),s=e.lastIndexOf("</head>"),o=r?Pr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var Xe=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Pr(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;Xe.lastIndex=r;let i=Xe.exec(e);return i?r+i[0].length:r}var me="data-stx-color-mode-boot",qe="__STX_COLOR_MODE__",Xt=new Set(["light","dark","auto","system"]),qt=new Set(["auto","system"]),Gt=/^[a-z][\w:-]*$/i,Yt=/^[\w-]+$/;function Jt(e){let n=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Xt.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Yt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!Gt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!qt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:n,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Zt(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function he(e={}){let n=Jt(e),r=Zt(n),i=`(function(){"use strict";var o=window.${qe};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${qe}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${me}>${i}</script>`}function Ir(e,n={}){if(e.includes(me))return e;let r=fe(e);if(r===null)return e;let i=he(n);return`${e.slice(0,r)}
52
52
  ${i}${e.slice(r)}`}var fe=Pr,Qt=new RegExp(`<script\\b[^>]*\\b${me}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),Ge=/<meta\b[^>]*\bcharset\b[^>]*>/gi,Ye=/<\/head>/gi;function en(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return e;let r=n.index+n[0].length;Ye.lastIndex=r;let i=Ye.exec(e),s=i?i.index:e.length;Ge.lastIndex=r;let o=Ge.exec(e);if(!o||o.index>=s)return e;if(e.slice(r,o.index).trim()==="")return e;let a=o.index+o[0].length;return`${e.slice(0,r)}
53
- ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function ml(e){return tn(en(e))}function tn(e){let n=Qt.exec(e);if(!n)return e;let r=fe(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let i=e.slice(0,n.index)+e.slice(n.index+n[0].length),s=fe(i);if(s===null)return e;return`${i.slice(0,s)}
54
- ${n[0]}${i.slice(s)}`}var nn="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Qe=`<style data-stx-cloak>[x-cloak]{display:none !important}${nn}</style>`,X="data-stx-html-attrs",q="data-stx-html-class",et=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rn(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function sn(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let i of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function O(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function Y(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function tt(e){let n=O(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${Y(e)}</script>`}function on(e={},n="en"){let r=[],i=[],s="",o=n;for(let[c,p]of Object.entries(e||{})){if(p==null)continue;let g=c.trim();if(!et.test(g))continue;let h=g.toLowerCase();if(h==="lang"){o=String(p);continue}if(h==="class"){s=String(p).trim();continue}r.push(` ${g}="${k(String(p))}"`),i.push(g)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${q}="${k(s)}"`;if(i.length)a+=` ${X}="${k(i.join(" "))}"`;return a}function hl(e={},n={}){let r={...e,...n};if(e.class&&n.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of n.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Or(e,n={}){if(!n||Object.keys(n).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],p=[];for(let[h,m]of Object.entries(n)){if(m==null)continue;let y=h.trim();if(!et.test(y))continue;let E=y.toLowerCase();if(E==="class"){let v=(i.class||"").split(/\s+/).filter(Boolean);for(let w of String(m).split(/\s+/).filter(Boolean))if(!v.includes(w))v.push(w),c.push(w);if(!("class"in i))s.push("class");i.class=v.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(m),E!=="lang")p.push(y)}if(c.length){if(!(q in i))s.push(q);i[q]=c.join(" ")}if(p.length){if(!(X in i))s.push(X);i[X]=p.join(" ")}let g=s.map((h)=>` ${h}="${k(i[h])}"`).join("");return e.replace(r[0],()=>`<html${g}>`)}function yl(e){if(e.includes("data-stx-cloak"))return null;if(e.lastIndexOf("</head>")===-1)return null;return`${Qe}
53
+ ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function hl(e){return tn(en(e))}function tn(e){let n=Qt.exec(e);if(!n)return e;let r=fe(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let i=e.slice(0,n.index)+e.slice(n.index+n[0].length),s=fe(i);if(s===null)return e;return`${i.slice(0,s)}
54
+ ${n[0]}${i.slice(s)}`}var nn="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Qe=`<style data-stx-cloak>[x-cloak]{display:none !important}${nn}</style>`,X="data-stx-html-attrs",q="data-stx-html-class",et=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rn(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function sn(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let i of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function O(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function Y(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function tt(e){let n=O(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${Y(e)}</script>`}function on(e={},n="en"){let r=[],i=[],s="",o=n;for(let[c,p]of Object.entries(e||{})){if(p==null)continue;let g=c.trim();if(!et.test(g))continue;let h=g.toLowerCase();if(h==="lang"){o=String(p);continue}if(h==="class"){s=String(p).trim();continue}r.push(` ${g}="${k(String(p))}"`),i.push(g)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${q}="${k(s)}"`;if(i.length)a+=` ${X}="${k(i.join(" "))}"`;return a}function yl(e={},n={}){let r={...e,...n};if(e.class&&n.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of n.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Or(e,n={}){if(!n||Object.keys(n).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],p=[];for(let[h,m]of Object.entries(n)){if(m==null)continue;let y=h.trim();if(!et.test(y))continue;let E=y.toLowerCase();if(E==="class"){let v=(i.class||"").split(/\s+/).filter(Boolean);for(let w of String(m).split(/\s+/).filter(Boolean))if(!v.includes(w))v.push(w),c.push(w);if(!("class"in i))s.push("class");i.class=v.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(m),E!=="lang")p.push(y)}if(c.length){if(!(q in i))s.push(q);i[q]=c.join(" ")}if(p.length){if(!(X in i))s.push(X);i[X]=p.join(" ")}let g=s.map((h)=>` ${h}="${k(i[h])}"`).join("");return e.replace(r[0],()=>`<html${g}>`)}function bl(e){if(e.includes("data-stx-cloak"))return null;if(e.lastIndexOf("</head>")===-1)return null;return`${Qe}
55
55
  `}function an(e){let n=[],r=0;while(r<e.length){let o=e.slice(r),a=o.match(/^\s+/);if(a){r+=a[0].length;continue}if(o.startsWith("<!--")){let m=e.indexOf("-->",r);if(m===-1)break;r=m+3;continue}let c=o.match(/^<script\b[^>]*>/i);if(c){let m=e.toLowerCase().indexOf("</script>",r+c[0].length);if(m===-1)break;r=m+9;continue}let p=o.match(/^<link\b[^>]*>/i);if(p){n.push(p[0]),r+=p[0].length;continue}let g=o.match(/^<meta\b[^>]*>/i);if(g){n.push(g[0]),r+=g[0].length;continue}let h=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(h){n.push(h[0]),r+=h[0].length;continue}break}if(n.length===0)return{body:e,hoisted:n};let i="",s=0;while(s<e.length&&s<r){let o=e.slice(s),a=o.match(/^<link\b[^>]*>/i);if(a&&n.includes(a[0])){s+=a[0].length;continue}let c=o.match(/^<meta\b[^>]*>/i);if(c&&n.includes(c[0])){s+=c[0].length;continue}let p=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(p&&n.includes(p[0])){s+=p[0].length;continue}i+=e[s],s++}return i+=e.slice(r),{body:i,hoisted:n}}function cn(e,n={},r={}){let{title:i="stx App",lang:s="en",meta:o=[],link:a=[],script:c=[],headRaw:p="",htmlAttrs:g={},bodyClass:h="",bodyAttrs:m={}}=n,y=r.title||i,E=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],v=new Set(o.map(lt).filter(Boolean)),{body:w,hoisted:T}=an(e),A=new Set(T.flatMap((b)=>{let L=sn(b);return L?[lt(L)].filter(Boolean):[]})),ot=[...E.filter((b)=>!v.has(lt(b))),...o].filter((b)=>!A.has(lt(b))).map((b)=>` <meta ${O(b)}>`).join(`
56
56
  `),ut=a.map((b)=>` <link ${O(b)}>`).join(`
57
57
  `),gt=c.map((b)=>{if(b.src)return` <script ${O(b,(L)=>L==="content")}></script>`;if(b.content)return` ${tt(b)}`;return""}).filter(Boolean).join(`
@@ -65,8 +65,8 @@ ${mt.join(`
65
65
  ${ht.join(`
66
66
  `)}
67
67
  </body>
68
- </html>`}var ye=/\s+/y,be=/<(script|style)\b[^>]*>/iy,ln=/<\/script>/gi,un=/<\/style>/gi,Je=/<!DOCTYPE\b/iy,Ze=/<html[\s>]/iy;function Tn(e){let n=0;while(n<e.length){if(ye.lastIndex=n,ye.exec(e)){n=ye.lastIndex;continue}if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n);if(s===-1)return!1;n=s+3;continue}be.lastIndex=n;let i=be.exec(e);if(i){let s=i[1].toLowerCase()==="script"?ln:un;s.lastIndex=be.lastIndex;let o=s.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(Je.lastIndex=n,Je.test(e))return!0;return Ze.lastIndex=n,Ze.test(e)}return!1}function Ni(e){return Tn(e)}function bl(e,n={}){let r=e.lastIndexOf("</head>");if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=n,c=e.slice(0,r),p=[];for(let g of i){let h=lt(g);if(h&&c.includes(h))continue;p.push(` <meta ${O(g)}>`)}for(let g of s){if(g.href&&c.includes(`href="${g.href}"`))continue;p.push(` <link ${O(g)}>`)}for(let g of o)if(g.src){if(c.includes(`src="${g.src}"`))continue;p.push(` <script ${O(g,(h)=>h==="content")}></script>`)}else if(g.content){if(c.includes(Y(g)))continue;p.push(` ${tt(g)}`)}if(a&&!c.includes(a))p.push(` ${a}`);if(p.length===0)return e;return`${e.slice(0,r)}${p.join(`
68
+ </html>`}var ye=/\s+/y,be=/<(script|style)\b[^>]*>/iy,ln=/<\/script>/gi,un=/<\/style>/gi,Je=/<!DOCTYPE\b/iy,Ze=/<html[\s>]/iy;function Tn(e){let n=0;while(n<e.length){if(ye.lastIndex=n,ye.exec(e)){n=ye.lastIndex;continue}if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n);if(s===-1)return!1;n=s+3;continue}be.lastIndex=n;let i=be.exec(e);if(i){let s=i[1].toLowerCase()==="script"?ln:un;s.lastIndex=be.lastIndex;let o=s.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(Je.lastIndex=n,Je.test(e))return!0;return Ze.lastIndex=n,Ze.test(e)}return!1}function Ni(e){return Tn(e)}function wl(e,n={}){let r=e.lastIndexOf("</head>");if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=n,c=e.slice(0,r),p=[];for(let g of i){let h=lt(g);if(h&&c.includes(h))continue;p.push(` <meta ${O(g)}>`)}for(let g of s){if(g.href&&c.includes(`href="${g.href}"`))continue;p.push(` <link ${O(g)}>`)}for(let g of o)if(g.src){if(c.includes(`src="${g.src}"`))continue;p.push(` <script ${O(g,(h)=>h==="content")}></script>`)}else if(g.content){if(c.includes(Y(g)))continue;p.push(` ${tt(g)}`)}if(a&&!c.includes(a))p.push(` ${a}`);if(p.length===0)return e;return`${e.slice(0,r)}${p.join(`
69
69
  `)}
70
- ${e.slice(r)}`}function Nr(e,n={},r={},i){if(i??Ni(e))return e;return cn(e,n,r)}var gn=["og:","article:","book:","profile:","fb:","music:","video:"],pn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Mr(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=dn(e[0],n);if(typeof r!=="string")return r;let i;if(e.length===2){let o=fn(e[1],n);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=n.openGraph,c=n[o]??(ct(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:gn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function dn(e,n){let r=de(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(pn.test(e.trim()))return e.trim();let i=Ut(e,n);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${Ue(i.value)}`,code:t.TYPE_ERROR};return i.value}function fn(e,n){let r=de(e);if(r!==null)return r;let i=Ut(e,n);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${Ue(s)}`,code:t.TYPE_ERROR};return String(s)}var Dr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],eo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],it={links:"link",metas:"meta",scripts:"script",styles:"style"},nt=new Set,rt=new WeakMap;function xe(e){if(nt.has(e))return;nt.add(e),console.warn(e)}function mn(e,n){let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=n.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===n[o-1]?0:1)),s=a}}return r[n.length]}function hn(e,n){let r=e.toLowerCase(),i=n.find((p)=>p.toLowerCase()===r);if(i)return i;let s=it[r];if(s&&n.includes(s))return s;let o,a=1/0;for(let p of n){let g=mn(r,p.toLowerCase());if(g<a)o=p,a=g}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Ee(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=rt.get(e);if(r)return r;let{known:i,source:s}=n,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=it[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let g=Array.isArray(o[c])?o[c]:[];o[c]=[...g,...e[a]],delete o[a],xe(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){xe(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=hn(a,i);xe(p?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return rt.set(e,o),o}var C={},yn=[],J={};function Mi(){return C}function hy(){return J}function yy(){C={},yn.length=0,J={}}function wl(e){C=We(C,Ee(e,{known:eo,source:"useHead()"}))}function st(e,n,r){let i=[...e||[]];for(let s of n||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function We(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:st(e.meta,n.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:st(e.link,n.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Og(e){wl(to(e))}function to(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(i)n.push({property:"og:description",content:i});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(s)n.push({name:"twitter:title",content:s});if(o)n.push({name:"twitter:description",content:o});if(a){n.push({name:"twitter:image",content:a});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:c}}function by(e){if(J={...J,...e},e.title||e.description)Og({title:e.title,description:e.description})}function wy(e){let n=typeof e==="function"?e():e;wl({title:n})}function vy(e=C){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");n.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");n.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)n.push(`<script ${o}>${Y(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";n.push(`<style${i}>${r.content}</style>`)}return n.join(`
71
- `)}function xy(e=C){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function Sy(e=C){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ky(e=C){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),n.name)i.setAttribute("name",n.name);if(n.property)i.setAttribute("property",n.property);document.head.appendChild(i)}i.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(n))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function _y(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(n+=s.trim()+`
72
- `,"")),headContent:n.trim()}}function Cy(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:n[(o||"").trim()]??o,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=We(c,{title:a}),""})}function Ey(e,n,r=""){if(!e.includes("@meta"))return e;return Ht(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Mr(Vt(i),n);if(o.kind==="error")return D("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=n.__stx_runtime_head??{};n.__stx_runtime_head=We(a,{meta:[o.tag]})}return""},(i)=>D("Meta",i,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{R,Ft,le,_,Js,Ai,Ys,u,f,pl,P,at,zt,d,Zs,t,ee,Ar,K,l,Ce,Pi,z,En,x,fl,Ii,Ht,Vt,Ut,Ue,ct,D,Qs,Oi,gl,Pr,Ir,ml,lt,hl,Or,yl,Tn,Ni,bl,Nr,Mr,Dr,eo,Ee,Mi,hy,yy,wl,We,Og,to,by,wy,vy,xy,Sy,ky,_y,Cy,Ey};
70
+ ${e.slice(r)}`}function Nr(e,n={},r={},i){if(i??Ni(e))return e;return cn(e,n,r)}var gn=["og:","article:","book:","profile:","fb:","music:","video:"],pn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Mr(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=dn(e[0],n);if(typeof r!=="string")return r;let i;if(e.length===2){let o=fn(e[1],n);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=n.openGraph,c=n[o]??(ct(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:gn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function dn(e,n){let r=de(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(pn.test(e.trim()))return e.trim();let i=Ut(e,n);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${Ue(i.value)}`,code:t.TYPE_ERROR};return i.value}function fn(e,n){let r=de(e);if(r!==null)return r;let i=Ut(e,n);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${Ue(s)}`,code:t.TYPE_ERROR};return String(s)}var Dr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],eo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],it={links:"link",metas:"meta",scripts:"script",styles:"style"},nt=new Set,rt=new WeakMap;function xe(e){if(nt.has(e))return;nt.add(e),console.warn(e)}function mn(e,n){let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=n.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===n[o-1]?0:1)),s=a}}return r[n.length]}function hn(e,n){let r=e.toLowerCase(),i=n.find((p)=>p.toLowerCase()===r);if(i)return i;let s=it[r];if(s&&n.includes(s))return s;let o,a=1/0;for(let p of n){let g=mn(r,p.toLowerCase());if(g<a)o=p,a=g}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Ee(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=rt.get(e);if(r)return r;let{known:i,source:s}=n,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=it[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let g=Array.isArray(o[c])?o[c]:[];o[c]=[...g,...e[a]],delete o[a],xe(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){xe(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=hn(a,i);xe(p?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return rt.set(e,o),o}var C={},yn=[],J={};function Mi(){return C}function yy(){return J}function by(){C={},yn.length=0,J={}}function vl(e){C=We(C,Ee(e,{known:eo,source:"useHead()"}))}function st(e,n,r){let i=[...e||[]];for(let s of n||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function We(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:st(e.meta,n.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:st(e.link,n.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Ng(e){vl(to(e))}function to(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(i)n.push({property:"og:description",content:i});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(s)n.push({name:"twitter:title",content:s});if(o)n.push({name:"twitter:description",content:o});if(a){n.push({name:"twitter:image",content:a});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:c}}function wy(e){if(J={...J,...e},e.title||e.description)Ng({title:e.title,description:e.description})}function vy(e){let n=typeof e==="function"?e():e;vl({title:n})}function xy(e=C){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");n.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");n.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)n.push(`<script ${o}>${Y(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";n.push(`<style${i}>${r.content}</style>`)}return n.join(`
71
+ `)}function Sy(e=C){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function ky(e=C){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function _y(e=C){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),n.name)i.setAttribute("name",n.name);if(n.property)i.setAttribute("property",n.property);document.head.appendChild(i)}i.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(n))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function Cy(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(n+=s.trim()+`
72
+ `,"")),headContent:n.trim()}}function Ey(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:n[(o||"").trim()]??o,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=We(c,{title:a}),""})}function Ty(e,n,r=""){if(!e.includes("@meta"))return e;return Ht(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Mr(Vt(i),n);if(o.kind==="error")return D("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=n.__stx_runtime_head??{};n.__stx_runtime_head=We(a,{meta:[o.tag]})}return""},(i)=>D("Meta",i,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{R,Ft,le,_,Js,Ai,Ys,u,f,fl,P,at,zt,d,Zs,t,ee,Ar,K,l,Ce,Pi,z,En,x,gl,Ii,Ht,Vt,Ut,Ue,ct,D,Qs,Oi,ml,Pr,Ir,hl,lt,yl,Or,bl,Tn,Ni,wl,Nr,Mr,Dr,eo,Ee,Mi,yy,by,vl,We,Ng,to,wy,vy,xy,Sy,ky,_y,Cy,Ey,Ty};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zi,Hi,Vi,Wg,qg,Kg,Nl,Gg,Xg}from"./chunk-c2w4wc9f.js";export{zi as ImageProcessorCache,Nl as applyTransformations,Wg as clearImageCache,Gg as generateResponsiveVariants,Xg as generateSrcset,Hi as getCachedImageResult,Kg as optimizeImage,qg as processImage,Vi as setCachedImageResult};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Pm(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Im(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Im(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Om(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Nm(){return`
229
+ `}function Om(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Nm(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Mm(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function Mm(){return`
303
+ `}function Dm(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Pm,Im,Om,Nm,Mm};
358
+ export{Im,Om,Nm,Mm,Dm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{hm}from"./chunk-gjnrmz2q.js";import"./chunk-4jgcd4d9.js";import"./chunk-5neezkj1.js";import"./chunk-avp271q4.js";import"./chunk-15rkvc0t.js";import"./chunk-kv40xq53.js";import"./chunk-5q4tncfw.js";import"./chunk-7de5y29a.js";import"./chunk-t5q31st4.js";import"./chunk-b7nmgkwa.js";import"./chunk-2b4a8tbd.js";import"./chunk-aj6vqdf7.js";import"./chunk-v0wdgxga.js";import"./chunk-b1tctqn5.js";import"./chunk-02css3vk.js";import"./chunk-h2cvfp9y.js";import"./chunk-z99bf0q0.js";import"./chunk-6nb49h13.js";import"./chunk-68w65mhs.js";import"./chunk-9pyvc0dc.js";import"./chunk-4rrxrxp6.js";import"./chunk-dba4bwkd.js";import"./chunk-3gfd9t8a.js";import"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{hm as buildForProduction};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zr,co,Qg,Dl,lo}from"./chunk-zpkgs5d3.js";export{Qg as buildModuleRegistryScript,lo as buildSharedModuleRegistries,Dl as exportsMutableBinding,zr as registeredModuleIdsIn,co as registeredModuleNamesIn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fh,gh,mh,hh,yh}from"./chunk-vggtxttf.js";export{gh as createSSRSuspense,hh as generateSuspenseCSS,yh as generateSuspenseRuntime,fh as processSuspenseDirectives,mh as renderSSRSuspense};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function eg(o){return w.test(o)}async function ti(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(eg(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
- export{eg,ti};
2
+ import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function tg(o){return w.test(o)}async function ti(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(tg(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
+ export{tg,ti};
@@ -159,7 +159,7 @@ else {
159
159
  stxIslands.initIslands();
160
160
  }
161
161
  })();
162
- </script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function iu(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
162
+ </script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function au(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
163
163
  <script data-hydrate="${e}">
164
164
  (function() {
165
165
  const island = document.querySelector('[data-island="${e}"]');
@@ -311,7 +311,7 @@ else {
311
311
  });
312
312
  })();
313
313
  </script>
314
- `}function au(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
314
+ `}function cu(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
315
315
  `+v();return r}function u(e,t,n){let r=new RegExp(`@client:${t}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return e.replace(r,(i,d,o)=>{let a={strategy:t};if(d)try{let E=d.split(",").map((h)=>h.trim());for(let h of E){let[m,g]=h.split(":").map((p)=>p.trim());if(m&&g){let p=g.replace(/^['"]|['"]$/g,"");a[m]=p}}}catch{}let s=`island-${Math.random().toString(36).substring(2,9)}`,y=b(o.trim()),f=w(o.trim(),n),c=[];if(a.rootMargin)c.push(`data-root-margin="${a.rootMargin}"`);if(a.threshold!==void 0)c.push(`data-threshold="${a.threshold}"`);if(a.media)c.push(`data-media="${a.media}"`);if(a.event)c.push(`data-event="${a.event}"`);if(y)c.push(`data-component="${y}"`);let x=Object.keys(f).length>0?`
316
316
  <script type="application/json" data-island-props="${s}">${JSON.stringify(f)}</script>`:"",l="";switch(t){case"load":l=I(s);break;case"idle":l=L(s,a);break;case"visible":l=C(s,a);break;case"media":l=S(s,a);break;case"hover":l=k(s);break;case"event":l=H(s,a);break}return`
317
317
  <div data-island="${s}"
@@ -342,7 +342,7 @@ else {
342
342
  }
343
343
  })();
344
344
  </script>
345
- `})}function cu(){return`
345
+ `})}function lu(){return`
346
346
  /* Island base styles */
347
347
  .stx-island {
348
348
  display: contents;
@@ -383,9 +383,9 @@ else {
383
383
  .stx-island.hydrated {
384
384
  opacity: 1;
385
385
  }
386
- `}function lu(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function uu(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function du(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function pu(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function fu(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function gu(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function mu(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
386
+ `}function uu(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function du(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function pu(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function fu(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function gu(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function mu(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function hu(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
387
387
  <script type="application/json" id="stx-island-manifest">
388
388
  ${JSON.stringify(t)}
389
389
  </script>
390
- `}var Um={processPartialHydrationDirectives:au,processStaticDirectives:gu,generatePartialHydrationCSS:cu,generateIslandManifest:mu,createIslandRegistry:iu,hydrateIsland:lu,hydrateByStrategy:uu,hydrateAll:du,isHydrated:pu,onHydrated:fu};
391
- export{iu,au,cu,lu,uu,du,pu,fu,gu,mu,Um};
390
+ `}var Wm={processPartialHydrationDirectives:cu,processStaticDirectives:mu,generatePartialHydrationCSS:lu,generateIslandManifest:hu,createIslandRegistry:au,hydrateIsland:uu,hydrateByStrategy:du,hydrateAll:pu,isHydrated:fu,onHydrated:gu};
391
+ export{au,cu,lu,uu,du,pu,fu,gu,mu,hu,Wm};
@@ -72,7 +72,7 @@ else {
72
72
  ${t}
73
73
  })();
74
74
  </script>
75
- `}function rh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
75
+ `}function sh(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
76
76
  <div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
77
77
  ${d}
78
78
  ${c}
@@ -81,4 +81,4 @@ else {
81
81
  </div>
82
82
  ${h}
83
83
  `})}
84
- export{rh};
84
+ export{sh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{un,No,Mo,Do,Bh,Lo}from"./chunk-15rkvc0t.js";import"./chunk-4rrxrxp6.js";import"./chunk-3gfd9t8a.js";import"./chunk-5rxks14t.js";export{Mo as buildServerApi,Bh as createServerApi,un as discoverServerApi,No as generateApiTypes,Lo as isServerApiSource,Do as productionApiDispatcher};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_,Ai,Ys,u,f,P,at,d,Zs,t,l,x}from"./chunk-9nh48zvm.js";import{Se,Mt,Y,N,Sn,Q,E}from"./chunk-b1kc0ka1.js";import{ur}from"./chunk-3248qphb.js";import{ie}from"./chunk-rwxg4m3h.js";import{Ss}from"./chunk-1hebvmaj.js";var he=1000,me=!1;function xe(n,r){let i=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",o=0,s;while((s=i.exec(n))!==null){let a=s.index+s[0].length,y=s.index+s[0].indexOf("("),b=x(n,"(",")",y);if(b===-1)continue;let p=n.slice(a,b).trim();if(!p)continue;if(!Object.keys(r).some((g)=>new RegExp(`(?:^|[^\\w$.])${g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(p)))continue;let m;try{let g=P(p,r);if(!g||typeof g!=="object")continue;m=JSON.stringify(g)}catch{continue}e+=n.slice(o,a)+m,o=b,i.lastIndex=b}return o===0?n:e+n.slice(o)}function be(n,r){let i=/@component\s*\(/g,e=n,o,s=[];while((o=i.exec(e))!==null){let a=o.index,y=a+o[0].length-1,b=1,p=y+1;while(p<e.length&&b>0){if(e[p]==="(")b++;else if(e[p]===")"){if(b--,b===0)break}p++}if(b!==0)continue;let c=e.substring(y+1,p),m=p+1,g=c.match(/^\s*['"]([^'"]+)['"]/);if(!g)continue;let R=g[1],h=c.slice(g[0].length),O=h.match(/^\s*,\s*/);if(!O)continue;let I=h.slice(O[0].length).trim();if(!I)continue;try{let v=P(I,r),B=JSON.stringify(v),S=`@component('${R}', ${B})`;s.push({start:a,end:m,replacement:S})}catch{continue}}for(let a=s.length-1;a>=0;a--){let{start:y,end:b,replacement:p}=s[a];e=e.substring(0,y)+p+e.substring(b)}return e}function ce(n,r,i){let e=n,o=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),s;while((s=o.exec(e))!==null){let a=s.index,y=a+s[0].length-1,b=1,p=y+1,c=null,m=!1;while(p<e.length&&b>0){let h=e[p];if(m){m=!1,p++;continue}if(h==="\\"&&c){m=!0,p++;continue}if(c){if(h===c)c=null;p++;continue}if(h==='"'||h==="'"||h==="`"){c=h,p++;continue}if(h==="(")b++;else if(h===")"){if(b--,b===0)break}p++}if(b!==0)break;let g=e.substring(y+1,p),R=i(g);e=e.substring(0,a)+R+e.substring(p+1)}return e}function ye(n,r){let i=n;return i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,o)=>{if(o in r)return`:${o}="${o}"`;return e}),i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,o,s)=>{try{if(N(s,r.__stx_client_signal_names||[]))return e;let a=Object.keys(r),y=Object.values(r);Ai(s);let b=!1,c=d(s,a,()=>{b=!0})(...y);if(b)return e;let m=JSON.stringify(c);if(m===void 0){if(!at(s).some((h)=>!(h in r)))return"";return e}let g=Buffer.from(m,"utf8").toString("base64");return`__stx_${o}="${g}"`}catch(a){return e}}),i}var ne="<!--__STX_BREAK__-->",te="<!--__STX_CONTINUE__-->";function ue(n,r){let i=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",o=0;for(let s=i.exec(n);s;s=i.exec(n)){if(!s[1]){let p=s[0].length===3&&s[0]==="{{{"?3:2,c=s[0]==="{!!"?n.indexOf("!!}",i.lastIndex):Se(n,s.index,p);if(c<0)break;i.lastIndex=c+(s[0]==="{!!"?3:p);continue}let a=i.lastIndex,y=!0,b=/^\s*\(/.exec(n.slice(a));if(b){let p=a+b[0].length-1,c=x(n,"(",")",p);if(c<0)break;a=c+1;try{let m=`!!(${n.slice(p+1,c).trim()})`;y=f(m)?Boolean(d(m,Object.keys(r))(...Object.values(r))):Boolean(u(m,r))}catch{y=!1}}if(e+=n.slice(o,s.index),y)return e+(s[1]==="break"?ne:te);o=a,i.lastIndex=a}return e+n.slice(o)}function fe(n){let r=(o)=>o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),i="",e=0;return Sn(n,(o,s,a)=>(i+=le(r(n.slice(e,a))),i+=`\${__stxRenderLoopValue(${a}, (${s}), ${o.length})}`,e=a+o.length,o)),i+le(r(n.slice(e)))}function ge(n,r,i,e){return Q(n,r,i==null?"":String(i),!1,e)}function le(n){let r=n;return r=ce(r,"@break",(i)=>{let e=i.trim();if(!Zs(e))return"";return`\`; if (${e}) { break; } result += \``}),r=ce(r,"@continue",(i)=>{let e=i.trim();if(!Zs(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function Ee(n){let r=/@forelse\s*\(/g,i,e=[],o=/@foreach\s*\(/g,s=/@endforeach/g,a;while((a=o.exec(n))!==null)e.push({pos:a.index,delta:1});while((a=s.exec(n))!==null)e.push({pos:a.index,delta:-1});e.sort((c,m)=>c.pos-m.pos);let y=[],b=0;for(let c of e)b+=c.delta,y.push({pos:c.pos,depth:b});function p(c){let m=0,g=y.length-1,R=0;while(m<=g){let h=m+g>>1;if(y[h].pos<=c)R=y[h].depth,m=h+1;else g=h-1}return R}while((i=r.exec(n))!==null){if(p(i.index)>0)continue;let c=i.index,m=i.index+i[0].length-1,g=1,R=m+1,h=-1;while(R<n.length&&g>0){if(n[R]==="(")g++;else if(n[R]===")"){if(g--,g===0){h=R;break}}R++}if(h===-1)continue;let O=n.substring(m+1,h),I=Mt(O);if(!I)continue;let{arrayExpr:v,itemVar:B}=I,S=h+1,w=1,T=S,K=/@forelse\s*\(/g,L=/@endforelse/g,V=-1;while(w>0&&T<n.length){K.lastIndex=T,L.lastIndex=T;let C=K.exec(n),A=L.exec(n);if(!A)break;if(C&&C.index<A.index)w++,T=C.index+C[0].length;else{if(w--,w===0){V=A.index;break}T=A.index+11}}if(V===-1)continue;let k=n.substring(S,V),Z=V+11,z=-1,D=0,M=0;while(M<k.length){let C=k.indexOf("@",M);if(C===-1)break;let A=k.substring(C);if(/^@forelse\s*\(/.test(A))D++,M=C+1;else if(A.startsWith("@endforelse"))D--,M=C+11;else if(D===0&&A.startsWith("@empty")){if(k.length<=C+6||!/[a-z]/i.test(k[C+6])){z=C;break}M=C+1}else M=C+1}if(z===-1)continue;return{start:c,end:Z,arrayExpr:v,itemVar:B,foreachContent:k.substring(0,z),emptyContent:k.substring(z+6)}}return null}function ae(n,r){let i=n;while(!0){let e=Ee(i);if(!e)break;let{start:o,end:s,arrayExpr:a,itemVar:y,foreachContent:b,emptyContent:p}=e;try{let c;if(f(a))c=d(a,Object.keys(r))(...Object.values(r));else c=u(a,r);let m;if(!Array.isArray(c)||c.length===0)m=p;else m=`@foreach (${a} as ${y})${b}@endforeach`;i=i.substring(0,o)+m+i.substring(s)}catch(c){let m=c instanceof Error?c.message:String(c),g=l("Forelse",`Error in @forelse(${a} as ${y}): ${m}`,t.EVALUATION_ERROR);i=i.substring(0,o)+g+i.substring(s)}}return i}var de="<!--stx:foreach-not-iterable:",_e=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function $e(n,r){return`${de}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function Re(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function hs(n){if(!n.includes(de))return n;return n.replace(_e,(r,i,e)=>(Re(decodeURIComponent(i),decodeURIComponent(e)),""))}function qf(n,r,i,e,o=!1){let s=re(n,r,i,e,o),a=s.next();while(!a.done)a=s.next();return a.value}async function Uo(n,r,i,e,o=!1){let s=re(n,r,i,e,o),a=s.next();while(!a.done)await _(),a=s.next();return a.value}function*re(n,r,i,e,o=!1){let s=n,a=new Set(r.__stx_client_signal_names||[]);for(let c of ur(n))a.add(c);if(a.size)r={...r,__stx_client_signal_names:[...a]};s=ae(s,r);function y(c){let m=/@foreach\s*\(/g,g;while((g=m.exec(c))!==null){let R=g.index,h=g.index+g[0].length-1,O=1,I=h+1,v=-1;while(I<c.length&&O>0){if(c[I]==="(")O++;else if(c[I]===")"){if(O--,O===0){v=I;break}}I++}if(v===-1)continue;let B=c.substring(h+1,v),S=Mt(B);if(!S)continue;let w=R,{arrayExpr:T,itemVar:K}=S,L=v+1,V=1,k=L,Z=/@foreach\s*\(/g,z=/@endforeach/g;while(V>0&&k<c.length){Z.lastIndex=k,z.lastIndex=k;let D=Z.exec(c),M=z.exec(c);if(!M)break;if(D&&D.index<M.index)V++,k=D.index+D[0].length;else{if(V--,V===0){let C=c.substring(L,M.index),A=M.index+11;return{start:w,end:A,arrayExpr:T,itemVar:K,content:C}}k=M.index+11}}}return null}function*b(c,m){let g=c;while(!0){let R=y(g);if(!R)break;let{start:h,end:O,arrayExpr:I,itemVar:v,content:B}=R;try{let S=I.trim(),w;if(f(S))w=d(S,Object.keys(m))(...Object.values(m));else w=u(S,m);let T=!1;if(!Array.isArray(w))if(w instanceof Map)w=Array.from(w),T=!0;else if(w instanceof Set)w=Array.from(w);else if(typeof w==="string")w=Array.from(w);else if(w&&typeof w==="object"&&!(w instanceof Date)&&!(w instanceof RegExp))w=Object.entries(w),T=!0;else{let A=$e(S,i)+l("Foreach",`Error in @foreach: ${S} is not iterable`,t.TYPE_ERROR);g=g.substring(0,h)+A+g.substring(O);continue}let K=e?.loops?.useAltLoopVariable??me,L=v.trim(),V=null,k,Z=!1;if(L.includes("=>")){let A=L.split("=>").map((W)=>W.trim());if(A.length===2&&A[0]&&A[1])V=A[0],k=A[1];else k=L}else if(!L.startsWith("[")&&!L.startsWith("{")&&L.includes(",")){let A=L.split(",").map((W)=>W.trim());if(A.length===2&&A[0]&&A[1])k=A[0],V=A[1],Z=!0;else k=L}else k=L;let z="",D=new Set(Y(`${I} as ${v}`)),M=w,C=m[Ys]??new WeakMap;for(let A=0;A<M.length;A++){if(A%16===0)yield;let W=M[A],se={index:A,iteration:A+1,first:A===0,last:A===M.length-1,count:M.length},j={...m,loop:se,$loop:se,[Ys]:C};if(Array.isArray(m.__stx_client_signal_names))j.__stx_client_signal_names=m.__stx_client_signal_names.filter((H)=>!D.has(H));if(k.startsWith("[")&&k.endsWith("]")){let H=k.slice(1,-1).split(",").map((U)=>U.trim());if(Array.isArray(W))H.forEach((U,X)=>{if(U)j[U]=W[X]});else j[k]=W}else if(k.startsWith("{")&&k.endsWith("}")){let H=k.slice(1,-1).split(",").map((U)=>U.trim()).filter(Boolean);if(W!==null&&typeof W==="object")H.forEach((U)=>{let X=U.indexOf(":"),ee=(X===-1?U:U.slice(0,X)).trim(),oe=X===-1?ee:U.slice(X+1).trim();if(ee&&oe)j[oe]=W[ee]});else j[k]=W}else j[k]=W;if(V)if(!Z&&T&&Array.isArray(W)&&W.length===2)j[V]=W[0],j[k]=W[1];else j[V]=A;let F=ae(B,j);F=yield*re(F,j,i,e,!0),F=ie(F,j,i),F=ue(F,j);let J=F.indexOf(ne),G=F.indexOf(te),q=J<0?G:G<0?J:Math.min(J,G);if(q>=0)F=F.slice(0,q);if(F=E(F,j,i),F=ye(F,j),F=be(F,j),F=xe(F,j),z+=F,q>=0&&q===J)break}g=g.substring(0,h)+z+g.substring(O)}catch(S){let w=l("Foreach",`Error in @foreach(${I.trim()} as ${v.trim()}): ${S instanceof Error?S.message:String(S)}`,t.EVALUATION_ERROR);g=g.substring(0,h)+w+g.substring(O)}}return g}s=yield*b(s,r),s=Ae(s,r,i,e);let p=e?.loops?.maxWhileIterations??he;return s=ke(s,r,p),o?s:hs(s)}function Kf(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function pe(n){return Zs(n)}function Ae(n,r,i,e){let o=n,s=!0;while(s){s=!1;let a=o.match(/@for\s*\(/);if(!a||a.index===void 0)break;let y=a.index,b=y+a[0].length-1,p=x(o,"(",")",b);if(p===-1)break;let c=Kf(o.slice(b+1,p)),m=p+1,g=Ss(o.slice(y),"for","endfor");if(g.length===0)break;let R=g[0].content,h=y+g[0].end;if(!pe(c)){let O=l("For",`Unsafe expression in @for: ${c}`,t.UNSAFE_EXPRESSION);o=o.substring(0,y)+O+o.substring(h),s=!0;continue}try{let O=we(c),I=/@(?:for|foreach|if|unless)\s*\(/.test(R);if(O.length>0&&I){let K=Oe({forExpr:c,content:R,iterVarNames:O,context:r,filePath:i,options:e});o=o.substring(0,y)+K+o.substring(h),s=!0;continue}let v=Object.keys(r),B=Object.values(r),S=fe(R),T=Function(...v,"__stxRenderLoopValue",`
2
+ import{_,Ai,Ys,u,f,P,at,d,Zs,t,l,x}from"./chunk-830ej8d2.js";import{Se,Mt,Y,N,Sn,Q,E}from"./chunk-261t62q4.js";import{ur}from"./chunk-b1tctqn5.js";import{ie}from"./chunk-v0wdgxga.js";import{Ss}from"./chunk-h2cvfp9y.js";var he=1000,me=!1;function xe(n,r){let i=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",o=0,s;while((s=i.exec(n))!==null){let a=s.index+s[0].length,y=s.index+s[0].indexOf("("),b=x(n,"(",")",y);if(b===-1)continue;let p=n.slice(a,b).trim();if(!p)continue;if(!Object.keys(r).some((g)=>new RegExp(`(?:^|[^\\w$.])${g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(p)))continue;let m;try{let g=P(p,r);if(!g||typeof g!=="object")continue;m=JSON.stringify(g)}catch{continue}e+=n.slice(o,a)+m,o=b,i.lastIndex=b}return o===0?n:e+n.slice(o)}function be(n,r){let i=/@component\s*\(/g,e=n,o,s=[];while((o=i.exec(e))!==null){let a=o.index,y=a+o[0].length-1,b=1,p=y+1;while(p<e.length&&b>0){if(e[p]==="(")b++;else if(e[p]===")"){if(b--,b===0)break}p++}if(b!==0)continue;let c=e.substring(y+1,p),m=p+1,g=c.match(/^\s*['"]([^'"]+)['"]/);if(!g)continue;let R=g[1],h=c.slice(g[0].length),O=h.match(/^\s*,\s*/);if(!O)continue;let I=h.slice(O[0].length).trim();if(!I)continue;try{let v=P(I,r),B=JSON.stringify(v),S=`@component('${R}', ${B})`;s.push({start:a,end:m,replacement:S})}catch{continue}}for(let a=s.length-1;a>=0;a--){let{start:y,end:b,replacement:p}=s[a];e=e.substring(0,y)+p+e.substring(b)}return e}function ce(n,r,i){let e=n,o=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),s;while((s=o.exec(e))!==null){let a=s.index,y=a+s[0].length-1,b=1,p=y+1,c=null,m=!1;while(p<e.length&&b>0){let h=e[p];if(m){m=!1,p++;continue}if(h==="\\"&&c){m=!0,p++;continue}if(c){if(h===c)c=null;p++;continue}if(h==='"'||h==="'"||h==="`"){c=h,p++;continue}if(h==="(")b++;else if(h===")"){if(b--,b===0)break}p++}if(b!==0)break;let g=e.substring(y+1,p),R=i(g);e=e.substring(0,a)+R+e.substring(p+1)}return e}function ye(n,r){let i=n;return i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,o)=>{if(o in r)return`:${o}="${o}"`;return e}),i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,o,s)=>{try{if(N(s,r.__stx_client_signal_names||[]))return e;let a=Object.keys(r),y=Object.values(r);Ai(s);let b=!1,c=d(s,a,()=>{b=!0})(...y);if(b)return e;let m=JSON.stringify(c);if(m===void 0){if(!at(s).some((h)=>!(h in r)))return"";return e}let g=Buffer.from(m,"utf8").toString("base64");return`__stx_${o}="${g}"`}catch(a){return e}}),i}var ne="<!--__STX_BREAK__-->",te="<!--__STX_CONTINUE__-->";function ue(n,r){let i=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",o=0;for(let s=i.exec(n);s;s=i.exec(n)){if(!s[1]){let p=s[0].length===3&&s[0]==="{{{"?3:2,c=s[0]==="{!!"?n.indexOf("!!}",i.lastIndex):Se(n,s.index,p);if(c<0)break;i.lastIndex=c+(s[0]==="{!!"?3:p);continue}let a=i.lastIndex,y=!0,b=/^\s*\(/.exec(n.slice(a));if(b){let p=a+b[0].length-1,c=x(n,"(",")",p);if(c<0)break;a=c+1;try{let m=`!!(${n.slice(p+1,c).trim()})`;y=f(m)?Boolean(d(m,Object.keys(r))(...Object.values(r))):Boolean(u(m,r))}catch{y=!1}}if(e+=n.slice(o,s.index),y)return e+(s[1]==="break"?ne:te);o=a,i.lastIndex=a}return e+n.slice(o)}function fe(n){let r=(o)=>o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),i="",e=0;return Sn(n,(o,s,a)=>(i+=le(r(n.slice(e,a))),i+=`\${__stxRenderLoopValue(${a}, (${s}), ${o.length})}`,e=a+o.length,o)),i+le(r(n.slice(e)))}function ge(n,r,i,e){return Q(n,r,i==null?"":String(i),!1,e)}function le(n){let r=n;return r=ce(r,"@break",(i)=>{let e=i.trim();if(!Zs(e))return"";return`\`; if (${e}) { break; } result += \``}),r=ce(r,"@continue",(i)=>{let e=i.trim();if(!Zs(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function Ee(n){let r=/@forelse\s*\(/g,i,e=[],o=/@foreach\s*\(/g,s=/@endforeach/g,a;while((a=o.exec(n))!==null)e.push({pos:a.index,delta:1});while((a=s.exec(n))!==null)e.push({pos:a.index,delta:-1});e.sort((c,m)=>c.pos-m.pos);let y=[],b=0;for(let c of e)b+=c.delta,y.push({pos:c.pos,depth:b});function p(c){let m=0,g=y.length-1,R=0;while(m<=g){let h=m+g>>1;if(y[h].pos<=c)R=y[h].depth,m=h+1;else g=h-1}return R}while((i=r.exec(n))!==null){if(p(i.index)>0)continue;let c=i.index,m=i.index+i[0].length-1,g=1,R=m+1,h=-1;while(R<n.length&&g>0){if(n[R]==="(")g++;else if(n[R]===")"){if(g--,g===0){h=R;break}}R++}if(h===-1)continue;let O=n.substring(m+1,h),I=Mt(O);if(!I)continue;let{arrayExpr:v,itemVar:B}=I,S=h+1,w=1,T=S,K=/@forelse\s*\(/g,L=/@endforelse/g,V=-1;while(w>0&&T<n.length){K.lastIndex=T,L.lastIndex=T;let C=K.exec(n),A=L.exec(n);if(!A)break;if(C&&C.index<A.index)w++,T=C.index+C[0].length;else{if(w--,w===0){V=A.index;break}T=A.index+11}}if(V===-1)continue;let k=n.substring(S,V),Z=V+11,z=-1,D=0,M=0;while(M<k.length){let C=k.indexOf("@",M);if(C===-1)break;let A=k.substring(C);if(/^@forelse\s*\(/.test(A))D++,M=C+1;else if(A.startsWith("@endforelse"))D--,M=C+11;else if(D===0&&A.startsWith("@empty")){if(k.length<=C+6||!/[a-z]/i.test(k[C+6])){z=C;break}M=C+1}else M=C+1}if(z===-1)continue;return{start:c,end:Z,arrayExpr:v,itemVar:B,foreachContent:k.substring(0,z),emptyContent:k.substring(z+6)}}return null}function ae(n,r){let i=n;while(!0){let e=Ee(i);if(!e)break;let{start:o,end:s,arrayExpr:a,itemVar:y,foreachContent:b,emptyContent:p}=e;try{let c;if(f(a))c=d(a,Object.keys(r))(...Object.values(r));else c=u(a,r);let m;if(!Array.isArray(c)||c.length===0)m=p;else m=`@foreach (${a} as ${y})${b}@endforeach`;i=i.substring(0,o)+m+i.substring(s)}catch(c){let m=c instanceof Error?c.message:String(c),g=l("Forelse",`Error in @forelse(${a} as ${y}): ${m}`,t.EVALUATION_ERROR);i=i.substring(0,o)+g+i.substring(s)}}return i}var de="<!--stx:foreach-not-iterable:",_e=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function $e(n,r){return`${de}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function Re(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function hs(n){if(!n.includes(de))return n;return n.replace(_e,(r,i,e)=>(Re(decodeURIComponent(i),decodeURIComponent(e)),""))}function Kf(n,r,i,e,o=!1){let s=re(n,r,i,e,o),a=s.next();while(!a.done)a=s.next();return a.value}async function Uo(n,r,i,e,o=!1){let s=re(n,r,i,e,o),a=s.next();while(!a.done)await _(),a=s.next();return a.value}function*re(n,r,i,e,o=!1){let s=n,a=new Set(r.__stx_client_signal_names||[]);for(let c of ur(n))a.add(c);if(a.size)r={...r,__stx_client_signal_names:[...a]};s=ae(s,r);function y(c){let m=/@foreach\s*\(/g,g;while((g=m.exec(c))!==null){let R=g.index,h=g.index+g[0].length-1,O=1,I=h+1,v=-1;while(I<c.length&&O>0){if(c[I]==="(")O++;else if(c[I]===")"){if(O--,O===0){v=I;break}}I++}if(v===-1)continue;let B=c.substring(h+1,v),S=Mt(B);if(!S)continue;let w=R,{arrayExpr:T,itemVar:K}=S,L=v+1,V=1,k=L,Z=/@foreach\s*\(/g,z=/@endforeach/g;while(V>0&&k<c.length){Z.lastIndex=k,z.lastIndex=k;let D=Z.exec(c),M=z.exec(c);if(!M)break;if(D&&D.index<M.index)V++,k=D.index+D[0].length;else{if(V--,V===0){let C=c.substring(L,M.index),A=M.index+11;return{start:w,end:A,arrayExpr:T,itemVar:K,content:C}}k=M.index+11}}}return null}function*b(c,m){let g=c;while(!0){let R=y(g);if(!R)break;let{start:h,end:O,arrayExpr:I,itemVar:v,content:B}=R;try{let S=I.trim(),w;if(f(S))w=d(S,Object.keys(m))(...Object.values(m));else w=u(S,m);let T=!1;if(!Array.isArray(w))if(w instanceof Map)w=Array.from(w),T=!0;else if(w instanceof Set)w=Array.from(w);else if(typeof w==="string")w=Array.from(w);else if(w&&typeof w==="object"&&!(w instanceof Date)&&!(w instanceof RegExp))w=Object.entries(w),T=!0;else{let A=$e(S,i)+l("Foreach",`Error in @foreach: ${S} is not iterable`,t.TYPE_ERROR);g=g.substring(0,h)+A+g.substring(O);continue}let K=e?.loops?.useAltLoopVariable??me,L=v.trim(),V=null,k,Z=!1;if(L.includes("=>")){let A=L.split("=>").map((W)=>W.trim());if(A.length===2&&A[0]&&A[1])V=A[0],k=A[1];else k=L}else if(!L.startsWith("[")&&!L.startsWith("{")&&L.includes(",")){let A=L.split(",").map((W)=>W.trim());if(A.length===2&&A[0]&&A[1])k=A[0],V=A[1],Z=!0;else k=L}else k=L;let z="",D=new Set(Y(`${I} as ${v}`)),M=w,C=m[Ys]??new WeakMap;for(let A=0;A<M.length;A++){if(A%16===0)yield;let W=M[A],se={index:A,iteration:A+1,first:A===0,last:A===M.length-1,count:M.length},j={...m,loop:se,$loop:se,[Ys]:C};if(Array.isArray(m.__stx_client_signal_names))j.__stx_client_signal_names=m.__stx_client_signal_names.filter((H)=>!D.has(H));if(k.startsWith("[")&&k.endsWith("]")){let H=k.slice(1,-1).split(",").map((U)=>U.trim());if(Array.isArray(W))H.forEach((U,X)=>{if(U)j[U]=W[X]});else j[k]=W}else if(k.startsWith("{")&&k.endsWith("}")){let H=k.slice(1,-1).split(",").map((U)=>U.trim()).filter(Boolean);if(W!==null&&typeof W==="object")H.forEach((U)=>{let X=U.indexOf(":"),ee=(X===-1?U:U.slice(0,X)).trim(),oe=X===-1?ee:U.slice(X+1).trim();if(ee&&oe)j[oe]=W[ee]});else j[k]=W}else j[k]=W;if(V)if(!Z&&T&&Array.isArray(W)&&W.length===2)j[V]=W[0],j[k]=W[1];else j[V]=A;let F=ae(B,j);F=yield*re(F,j,i,e,!0),F=ie(F,j,i),F=ue(F,j);let J=F.indexOf(ne),G=F.indexOf(te),q=J<0?G:G<0?J:Math.min(J,G);if(q>=0)F=F.slice(0,q);if(F=E(F,j,i),F=ye(F,j),F=be(F,j),F=xe(F,j),z+=F,q>=0&&q===J)break}g=g.substring(0,h)+z+g.substring(O)}catch(S){let w=l("Foreach",`Error in @foreach(${I.trim()} as ${v.trim()}): ${S instanceof Error?S.message:String(S)}`,t.EVALUATION_ERROR);g=g.substring(0,h)+w+g.substring(O)}}return g}s=yield*b(s,r),s=Ae(s,r,i,e);let p=e?.loops?.maxWhileIterations??he;return s=ke(s,r,p),o?s:hs(s)}function Gf(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function pe(n){return Zs(n)}function Ae(n,r,i,e){let o=n,s=!0;while(s){s=!1;let a=o.match(/@for\s*\(/);if(!a||a.index===void 0)break;let y=a.index,b=y+a[0].length-1,p=x(o,"(",")",b);if(p===-1)break;let c=Gf(o.slice(b+1,p)),m=p+1,g=Ss(o.slice(y),"for","endfor");if(g.length===0)break;let R=g[0].content,h=y+g[0].end;if(!pe(c)){let O=l("For",`Unsafe expression in @for: ${c}`,t.UNSAFE_EXPRESSION);o=o.substring(0,y)+O+o.substring(h),s=!0;continue}try{let O=we(c),I=/@(?:for|foreach|if|unless)\s*\(/.test(R);if(O.length>0&&I){let K=Oe({forExpr:c,content:R,iterVarNames:O,context:r,filePath:i,options:e});o=o.substring(0,y)+K+o.substring(h),s=!0;continue}let v=Object.keys(r),B=Object.values(r),S=fe(R),T=Function(...v,"__stxRenderLoopValue",`
3
3
  let result = '';
4
4
  for (${c}) {
5
5
  result += \`${S}\`;
@@ -9,7 +9,7 @@ import{_,Ai,Ys,u,f,P,at,d,Zs,t,l,x}from"./chunk-9nh48zvm.js";import{Se,Mt,Y,N,Sn
9
9
  for (${r}) {
10
10
  if (!__renderIteration([${e.join(", ")}])) break;
11
11
  }
12
- `)(...b,(g)=>{let R={...o};e.forEach((B,S)=>{R[B]=g[S]});let h=qf(i,R,p,a,!0);h=ie(h,R,p),h=ue(h,R);let O=h.indexOf(ne),I=h.indexOf(te),v=O<0?I:I<0?O:Math.min(O,I);if(v>=0)h=h.slice(0,v);return c+=E(h,R,p),v<0||v!==O}),c}function ke(n,r,i){let e=n,o=!0;while(o){o=!1;let s=e.match(/@while\s*\(/);if(!s||s.index===void 0)break;let a=s.index,y=a+s[0].length-1,b=x(e,"(",")",y);if(b===-1)break;let p=e.slice(y+1,b),c=Ss(e.slice(a),"while","endwhile");if(c.length===0)break;let m=c[0].content,g=a+c[0].end;if(!pe(p)){let R=l("While",`Unsafe expression in @while: ${p}`,t.UNSAFE_EXPRESSION);e=e.substring(0,a)+R+e.substring(g),o=!0;continue}try{let R=Object.keys(r),h=Object.values(r),O=fe(m),v=Function(...R,"__stxRenderLoopValue",`
12
+ `)(...b,(g)=>{let R={...o};e.forEach((B,S)=>{R[B]=g[S]});let h=Kf(i,R,p,a,!0);h=ie(h,R,p),h=ue(h,R);let O=h.indexOf(ne),I=h.indexOf(te),v=O<0?I:I<0?O:Math.min(O,I);if(v>=0)h=h.slice(0,v);return c+=E(h,R,p),v<0||v!==O}),c}function ke(n,r,i){let e=n,o=!0;while(o){o=!1;let s=e.match(/@while\s*\(/);if(!s||s.index===void 0)break;let a=s.index,y=a+s[0].length-1,b=x(e,"(",")",y);if(b===-1)break;let p=e.slice(y+1,b),c=Ss(e.slice(a),"while","endwhile");if(c.length===0)break;let m=c[0].content,g=a+c[0].end;if(!pe(p)){let R=l("While",`Unsafe expression in @while: ${p}`,t.UNSAFE_EXPRESSION);e=e.substring(0,a)+R+e.substring(g),o=!0;continue}try{let R=Object.keys(r),h=Object.values(r),O=fe(m),v=Function(...R,"__stxRenderLoopValue",`
13
13
  let result = '';
14
14
  let maxIterations = ${i}; // Configurable safety limit
15
15
  let counter = 0;
@@ -22,4 +22,4 @@ import{_,Ai,Ys,u,f,P,at,d,Zs,t,l,x}from"./chunk-9nh48zvm.js";import{Se,Mt,Y,N,Sn
22
22
  }
23
23
  return result;
24
24
  `)(...h,(B,S,w)=>ge(m,B,S,w));e=e.substring(0,a)+v+e.substring(g),o=!0}catch(R){let h=l("While",`Error in @while(${p}): ${R instanceof Error?R.message:String(R)}`,t.EVALUATION_ERROR);e=e.substring(0,a)+h+e.substring(g),o=!0}}return e}
25
- export{hs,qf,Uo,Kf};
25
+ export{hs,Kf,Uo,Gf};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ka,_a,ru,su,ou,iu,Um}from"./chunk-cq2hedwn.js";export{ka as createVirtualList,Um as default,ru as generateVirtualListCSS,ou as processInfiniteListDirectives,iu as processVirtualGridDirectives,_a as processVirtualListDirectives,su as useVirtualList};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{q,De}from"./chunk-b1kc0ka1.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function rn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=De(t,s);if(p>s){c=p;continue}let a=q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
2
+ import{q,De}from"./chunk-261t62q4.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function rn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=De(t,s);if(p>s){c=p;continue}let a=q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
3
  export{rn};