@stacksjs/stx 0.2.898 → 0.2.899

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 (229) hide show
  1. package/dist/{chunk-qe0t0m38.js → chunk-0b57fgpn.js} +4 -4
  2. package/dist/chunk-0f2d61b3.js +2 -0
  3. package/dist/{chunk-pjj54ddk.js → chunk-0gc1hez6.js} +3 -3
  4. package/dist/chunk-0ht6exrv.js +2 -0
  5. package/dist/{chunk-t3zmfh8w.js → chunk-150cz8qq.js} +7 -7
  6. package/dist/chunk-1pbghytr.js +2 -0
  7. package/dist/chunk-1tb18a92.js +2 -0
  8. package/dist/{chunk-dvjv4c3a.js → chunk-2sz1kh9m.js} +1 -1
  9. package/dist/chunk-2vqamyay.js +2 -0
  10. package/dist/chunk-36mz0nwv.js +2 -0
  11. package/dist/{chunk-q4dcchrt.js → chunk-3k4rteax.js} +13 -13
  12. package/dist/chunk-3m37fzvh.js +2 -0
  13. package/dist/chunk-3my2eef2.js +2 -0
  14. package/dist/{chunk-qcbj1m21.js → chunk-40fpt0r6.js} +10 -10
  15. package/dist/{chunk-khm56bfm.js → chunk-46khhke2.js} +1 -1
  16. package/dist/{chunk-4wh71ddp.js → chunk-472w7t7p.js} +2 -2
  17. package/dist/{chunk-bjmkyead.js → chunk-4e28p8vf.js} +6 -6
  18. package/dist/{chunk-bgfs3mbg.js → chunk-4hk1mjtv.js} +5 -5
  19. package/dist/chunk-4jtewn1v.js +2 -0
  20. package/dist/chunk-4s6w89m2.js +2 -0
  21. package/dist/{chunk-dd074gp5.js → chunk-4wd5sn16.js} +7 -7
  22. package/dist/{chunk-1bft48gk.js → chunk-50wjk5ap.js} +2 -2
  23. package/dist/{chunk-ch9028z3.js → chunk-54x7h3sb.js} +1 -1
  24. package/dist/chunk-5astk182.js +2 -0
  25. package/dist/{chunk-3b3mkgpj.js → chunk-5g5khx0m.js} +2 -2
  26. package/dist/{chunk-zf68afyh.js → chunk-5gnt3qtn.js} +3 -3
  27. package/dist/{chunk-80ky40mm.js → chunk-5jrpzepc.js} +2 -2
  28. package/dist/{chunk-q0y8gv18.js → chunk-5mrt1enm.js} +2 -2
  29. package/dist/{chunk-wg6fmren.js → chunk-5tm1pvt3.js} +2 -2
  30. package/dist/chunk-5tvse0vw.js +2 -0
  31. package/dist/{chunk-ytjn0gq2.js → chunk-5yvgzh6n.js} +2 -2
  32. package/dist/{chunk-n6q1d66k.js → chunk-65g78sge.js} +1 -1
  33. package/dist/chunk-65rx54n6.js +2 -0
  34. package/dist/{chunk-x5bn2svk.js → chunk-67pq803s.js} +2 -2
  35. package/dist/{chunk-neg6ckjg.js → chunk-68r2zs20.js} +4 -4
  36. package/dist/{chunk-2s0q8mjx.js → chunk-6hjcqaqr.js} +2 -2
  37. package/dist/chunk-70ez3njv.js +2 -0
  38. package/dist/chunk-726w7fm2.js +2 -0
  39. package/dist/{chunk-xy8smv5e.js → chunk-73ebyhqq.js} +2 -2
  40. package/dist/chunk-73nazfe5.js +2 -0
  41. package/dist/{chunk-vk2jy6mn.js → chunk-7b3dqeyr.js} +2 -2
  42. package/dist/{chunk-whcrca58.js → chunk-7nn5s0c3.js} +30 -30
  43. package/dist/{chunk-062qfv99.js → chunk-7pfhr4nk.js} +2 -2
  44. package/dist/chunk-7r294vc9.js +2 -0
  45. package/dist/chunk-7rn7w53f.js +2 -0
  46. package/dist/{chunk-5v4e2a02.js → chunk-7z1hqp86.js} +4 -4
  47. package/dist/chunk-81qvg3yd.js +2 -0
  48. package/dist/{chunk-e16ef18k.js → chunk-83hs9905.js} +2 -2
  49. package/dist/chunk-8a9gmbxa.js +2 -0
  50. package/dist/chunk-8jvwapq3.js +2 -0
  51. package/dist/{chunk-g8p4sjy4.js → chunk-8rgy17fj.js} +8 -8
  52. package/dist/{chunk-ns2d6pb9.js → chunk-8v2hsn4d.js} +3 -3
  53. package/dist/{chunk-y1d3j2j7.js → chunk-8xb09hnn.js} +4 -4
  54. package/dist/{chunk-xmg6bmh6.js → chunk-945zygwa.js} +13 -13
  55. package/dist/{chunk-pvm48tse.js → chunk-9ejk9mwk.js} +2 -2
  56. package/dist/{chunk-bw2m1e7g.js → chunk-9hwg13ec.js} +5 -5
  57. package/dist/{chunk-ezpk14gs.js → chunk-9jpsxqaf.js} +1 -1
  58. package/dist/{chunk-0vrt55pp.js → chunk-9m45t60c.js} +80 -80
  59. package/dist/{chunk-jm9rbxj4.js → chunk-9n5san33.js} +14 -14
  60. package/dist/chunk-9vafweyd.js +3 -0
  61. package/dist/{chunk-zwqkbk2m.js → chunk-9w7whtbx.js} +2 -2
  62. package/dist/{chunk-1ph2yhfn.js → chunk-arfpzf17.js} +2 -2
  63. package/dist/chunk-avqxkbrd.js +2 -0
  64. package/dist/{chunk-htx5yezj.js → chunk-ayady5ws.js} +2 -2
  65. package/dist/{chunk-051r7ebx.js → chunk-b6ctdvdf.js} +6 -6
  66. package/dist/{chunk-taeqm3nc.js → chunk-becs8132.js} +5 -5
  67. package/dist/chunk-bmwcgmev.js +2 -0
  68. package/dist/{chunk-67j2m620.js → chunk-bzd387yx.js} +4 -4
  69. package/dist/{chunk-mhrnjaka.js → chunk-c0x9wyj7.js} +4 -4
  70. package/dist/chunk-cgqpn3e2.js +2 -0
  71. package/dist/chunk-cp82351f.js +2 -0
  72. package/dist/chunk-cvxg2rc1.js +2 -0
  73. package/dist/{chunk-v8ewgs1y.js → chunk-d1bwb2kz.js} +3 -3
  74. package/dist/{chunk-05x1rd86.js → chunk-de61k0ab.js} +2 -2
  75. package/dist/chunk-dj8fyaea.js +2 -0
  76. package/dist/chunk-dmc91qke.js +2 -0
  77. package/dist/{chunk-mr34w48c.js → chunk-e0bwzxfd.js} +6 -6
  78. package/dist/{chunk-w2qct5kq.js → chunk-e4xd1ca7.js} +1 -1
  79. package/dist/{chunk-3jxmnnef.js → chunk-e5q1ammf.js} +3 -3
  80. package/dist/{chunk-xvncq3m5.js → chunk-eb5cma4b.js} +2 -2
  81. package/dist/{chunk-3bsz7zj3.js → chunk-eb5v9npc.js} +2 -2
  82. package/dist/{chunk-aj5tsksz.js → chunk-edpsk4bg.js} +5 -5
  83. package/dist/{chunk-6kn2vwtn.js → chunk-eka2e4cm.js} +4 -4
  84. package/dist/{chunk-pnmafbv5.js → chunk-ern5hyvr.js} +1 -1
  85. package/dist/{chunk-41z7f41b.js → chunk-esm0pnpz.js} +2 -2
  86. package/dist/chunk-fe1wmmr5.js +2 -0
  87. package/dist/{chunk-r5ecgcx2.js → chunk-ffytbb4x.js} +5 -5
  88. package/dist/{chunk-vf4ejngv.js → chunk-fksmr50h.js} +6 -6
  89. package/dist/{chunk-nw2zjwcg.js → chunk-fsxk5fsh.js} +8 -8
  90. package/dist/{chunk-htvft92j.js → chunk-ft9h5qbs.js} +4 -4
  91. package/dist/chunk-fznzn35q.js +2 -0
  92. package/dist/{chunk-s94gqce0.js → chunk-g065d7p7.js} +2 -2
  93. package/dist/{chunk-rf0smj4c.js → chunk-g32hc78c.js} +2 -2
  94. package/dist/{chunk-nq60tjkz.js → chunk-gnf1e5q7.js} +2 -2
  95. package/dist/{chunk-bj8pv8m9.js → chunk-gq3gttt5.js} +21 -21
  96. package/dist/chunk-h2gnz7ja.js +2 -0
  97. package/dist/chunk-hc8ks7y3.js +2 -0
  98. package/dist/{chunk-cphc60zw.js → chunk-hdfhaddy.js} +2 -2
  99. package/dist/{chunk-t0ttxayz.js → chunk-hnjeqxqy.js} +2 -2
  100. package/dist/chunk-hpqvq1r9.js +2 -0
  101. package/dist/chunk-hs2a040z.js +2 -0
  102. package/dist/{chunk-xdrp6d7e.js → chunk-javb4e3b.js} +5 -5
  103. package/dist/chunk-jq49238b.js +2 -0
  104. package/dist/chunk-jr3fmkq7.js +2 -0
  105. package/dist/chunk-k2fw6paw.js +2 -0
  106. package/dist/chunk-k352spys.js +2 -0
  107. package/dist/{chunk-1knk403z.js → chunk-k3566kgd.js} +2 -2
  108. package/dist/{chunk-cmg9x1ka.js → chunk-k3ytyhkr.js} +3 -3
  109. package/dist/chunk-k79dvx67.js +2 -0
  110. package/dist/chunk-km1k3c4e.js +2 -0
  111. package/dist/chunk-kvjbpbmw.js +2 -0
  112. package/dist/chunk-mhv84p0x.js +2 -0
  113. package/dist/{chunk-ykax1thr.js → chunk-mjqsz20a.js} +2 -2
  114. package/dist/chunk-mmtyp5z4.js +2 -0
  115. package/dist/{chunk-8hwfdwgn.js → chunk-mry67rsk.js} +6 -6
  116. package/dist/{chunk-ksmn19qw.js → chunk-n3fgrsva.js} +2 -2
  117. package/dist/{chunk-jnwj14eq.js → chunk-n8xjqsze.js} +3 -3
  118. package/dist/{chunk-p3hbsrk9.js → chunk-nc5d3a5r.js} +5 -5
  119. package/dist/chunk-p4hm5srd.js +2 -0
  120. package/dist/{chunk-0jkj8thz.js → chunk-p89rpak1.js} +1 -1
  121. package/dist/{chunk-hxws025y.js → chunk-p92272k0.js} +2 -2
  122. package/dist/{chunk-bh2j50cy.js → chunk-pd31ge72.js} +6 -6
  123. package/dist/chunk-pjpy86c3.js +3 -0
  124. package/dist/chunk-psyqrxg0.js +2 -0
  125. package/dist/chunk-q4yq72wh.js +2 -0
  126. package/dist/{chunk-5xq6eky7.js → chunk-q6p96qq7.js} +7 -7
  127. package/dist/{chunk-115bb91s.js → chunk-qs0zk04y.js} +2 -2
  128. package/dist/{chunk-ta07gj66.js → chunk-qt2mr3f0.js} +31 -16
  129. package/dist/{chunk-a0aqs5a8.js → chunk-qykbjg3z.js} +2 -2
  130. package/dist/chunk-qzx6h6af.js +2 -0
  131. package/dist/{chunk-g5nfqzfh.js → chunk-r0az4z6d.js} +2 -2
  132. package/dist/{chunk-b9npgke0.js → chunk-r9n86na1.js} +39 -39
  133. package/dist/{chunk-zy97etqx.js → chunk-rapr0m13.js} +3 -3
  134. package/dist/{chunk-j1cgj6z2.js → chunk-rrpfn9rr.js} +1 -1
  135. package/dist/chunk-ryp47rwp.js +2 -0
  136. package/dist/{chunk-3qk8vf9m.js → chunk-t14bn66j.js} +3 -3
  137. package/dist/chunk-t9j000tb.js +2 -0
  138. package/dist/{chunk-7h52e87j.js → chunk-tga3nrn6.js} +5 -5
  139. package/dist/chunk-tgwwa872.js +2 -0
  140. package/dist/chunk-v0r6zb87.js +2 -0
  141. package/dist/{chunk-n0jfwsz1.js → chunk-v5v6w6rn.js} +2 -2
  142. package/dist/{chunk-9rjgq8k4.js → chunk-vbmvft7g.js} +1 -1
  143. package/dist/{chunk-kk2p2tgv.js → chunk-vfctk20v.js} +3 -3
  144. package/dist/{chunk-66qfr6b0.js → chunk-vgvxs1ag.js} +2 -2
  145. package/dist/{chunk-rb2zbdqd.js → chunk-vw7crz0z.js} +4 -4
  146. package/dist/chunk-vxtna1b1.js +2 -0
  147. package/dist/chunk-x43x2c6v.js +2 -0
  148. package/dist/chunk-xqx8t9w5.js +2 -0
  149. package/dist/{chunk-sh7a0g09.js → chunk-xr1s56k5.js} +3 -3
  150. package/dist/chunk-y10eaxgc.js +2 -0
  151. package/dist/chunk-ytk4f2j9.js +2 -0
  152. package/dist/chunk-z33r3pzy.js +2 -0
  153. package/dist/chunk-zcys6b06.js +2 -0
  154. package/dist/chunk-zkr42285.js +2 -0
  155. package/dist/chunk-zpwh9bpc.js +2 -0
  156. package/dist/chunk-zrs22j09.js +2 -0
  157. package/dist/chunk-zw6tgr0s.js +2 -0
  158. package/dist/cli.js +19 -19
  159. package/dist/client/signals-scope-disposal-runtime.js +18 -3
  160. package/dist/craft-entry.js +2 -2
  161. package/dist/craft.js +2 -2
  162. package/dist/dynamic-components.js +47 -25
  163. package/dist/pwa.js +3 -3
  164. package/dist/ssg.js +4 -4
  165. package/package.json +5 -5
  166. package/dist/chunk-0hgetg3j.js +0 -2
  167. package/dist/chunk-0k437z3q.js +0 -2
  168. package/dist/chunk-0yh33smh.js +0 -2
  169. package/dist/chunk-0yycygry.js +0 -2
  170. package/dist/chunk-1a7a8cjs.js +0 -2
  171. package/dist/chunk-1p4q6t48.js +0 -2
  172. package/dist/chunk-1z6pqvmf.js +0 -2
  173. package/dist/chunk-2nqmw4dv.js +0 -2
  174. package/dist/chunk-2shw0j2q.js +0 -2
  175. package/dist/chunk-35j7gaj5.js +0 -2
  176. package/dist/chunk-3hd73qqj.js +0 -2
  177. package/dist/chunk-4akw3bym.js +0 -2
  178. package/dist/chunk-4d85str1.js +0 -2
  179. package/dist/chunk-53kcqdjj.js +0 -2
  180. package/dist/chunk-5eq2e6p3.js +0 -2
  181. package/dist/chunk-690518hw.js +0 -2
  182. package/dist/chunk-732gb689.js +0 -2
  183. package/dist/chunk-80xzjxah.js +0 -2
  184. package/dist/chunk-8cs8jckk.js +0 -2
  185. package/dist/chunk-9afkttvz.js +0 -2
  186. package/dist/chunk-a0jhmkpd.js +0 -2
  187. package/dist/chunk-a1s0tfcd.js +0 -3
  188. package/dist/chunk-a2bstyq1.js +0 -2
  189. package/dist/chunk-ah8az9vv.js +0 -2
  190. package/dist/chunk-arr79m90.js +0 -2
  191. package/dist/chunk-cgxmgjk4.js +0 -2
  192. package/dist/chunk-cp5x6kx1.js +0 -2
  193. package/dist/chunk-e28czxw3.js +0 -2
  194. package/dist/chunk-e8szp5wa.js +0 -2
  195. package/dist/chunk-essd43ad.js +0 -2
  196. package/dist/chunk-f60k8j9m.js +0 -2
  197. package/dist/chunk-fsehzmg8.js +0 -2
  198. package/dist/chunk-fsk3rk2x.js +0 -2
  199. package/dist/chunk-g0p2n9tm.js +0 -2
  200. package/dist/chunk-g5axctr0.js +0 -2
  201. package/dist/chunk-ggnhr4r3.js +0 -2
  202. package/dist/chunk-hk241gt2.js +0 -2
  203. package/dist/chunk-hmpmvf5c.js +0 -2
  204. package/dist/chunk-j1ncsbk2.js +0 -2
  205. package/dist/chunk-j9kejcrx.js +0 -2
  206. package/dist/chunk-jhbz5w30.js +0 -2
  207. package/dist/chunk-jvc2qb1n.js +0 -2
  208. package/dist/chunk-jytqf6p6.js +0 -2
  209. package/dist/chunk-k4x680e3.js +0 -2
  210. package/dist/chunk-kfdmm240.js +0 -2
  211. package/dist/chunk-mx5twaps.js +0 -2
  212. package/dist/chunk-nd2bhjdw.js +0 -2
  213. package/dist/chunk-qfxy34d4.js +0 -2
  214. package/dist/chunk-qwt94yh2.js +0 -2
  215. package/dist/chunk-rarsjcs4.js +0 -2
  216. package/dist/chunk-rryzw9x7.js +0 -2
  217. package/dist/chunk-ryj1srqn.js +0 -2
  218. package/dist/chunk-s5j4fpdr.js +0 -2
  219. package/dist/chunk-snkbn5y8.js +0 -2
  220. package/dist/chunk-tbh7r1wh.js +0 -2
  221. package/dist/chunk-tsz03zc9.js +0 -2
  222. package/dist/chunk-v3jyb8k6.js +0 -2
  223. package/dist/chunk-wbp6jgcr.js +0 -2
  224. package/dist/chunk-x6565mhk.js +0 -2
  225. package/dist/chunk-x8yne6s5.js +0 -2
  226. package/dist/chunk-xwgdcc7w.js +0 -2
  227. package/dist/chunk-z4tdnfxd.js +0 -2
  228. package/dist/chunk-zrbyvyn2.js +0 -2
  229. package/dist/chunk-zxjdfgdx.js +0 -3
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- function t(n){if(!n||typeof n!=="object")return!1;let i=n;return typeof i.message==="string"&&(i.name==="BuildMessage"||i.name==="ResolveMessage"||("position"in i))}function o(n){if(n&&typeof n==="object"&&Array.isArray(n.errors))return n.errors;return[n]}function mr(n,i){let e=[];for(let r of o(n)){if(t(r)){let s=r.position||void 0;e.push({file:i||s?.file,line:s?.line,column:s?.column,message:r.message??"",lineText:s?.lineText});continue}e.push({file:i,message:r instanceof Error?r.message:String(r)})}return e}function ze(n,i){return mr(n,i).map((e)=>{let r=e.file?`${e.file}${e.line?`:${e.line}${e.column?`:${e.column}`:""}`:""}`:"",s=e.lineText?`
2
+ function t(n){if(!n||typeof n!=="object")return!1;let i=n;return typeof i.message==="string"&&(i.name==="BuildMessage"||i.name==="ResolveMessage"||("position"in i))}function o(n){if(n&&typeof n==="object"&&Array.isArray(n.errors))return n.errors;return[n]}function hr(n,i){let e=[];for(let r of o(n)){if(t(r)){let s=r.position||void 0;e.push({file:i||s?.file,line:s?.line,column:s?.column,message:r.message??"",lineText:s?.lineText});continue}e.push({file:i,message:r instanceof Error?r.message:String(r)})}return e}function ze(n,i){return hr(n,i).map((e)=>{let r=e.file?`${e.file}${e.line?`:${e.line}${e.column?`:${e.column}`:""}`:""}`:"",s=e.lineText?`
3
3
  ${e.lineText.trim()}`:"";return r?`${r}: ${e.message}${s}`:`${e.message}${s}`}).join(`
4
- `)}export{mr,ze};
4
+ `)}export{hr,ze};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ul,Wl,ql}from"./chunk-cphc60zw.js";import{xe,sr,or,zo,ps,gs,ir,ar,Ho,ms}from"./chunk-1bft48gk.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let I=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,j=()=>{I.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),j()})};if(!S)W(E);let _t=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),j(),!b)W(E)},xt=(w,b)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,V=new Promise((D,H)=>{O=setTimeout(()=>{if(C)C.abort();H(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:C?C.signal:void 0});else if(b){let D=m.fetch||((L,F)=>fetch(L,F)),H={method:"GET",headers:{Accept:"application/json"}};if(w)H.cache="no-cache";if(C)H.signal=C.signal;A=D(b,H).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((F)=>{throw Error(F&&(F.error||F.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,V]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),C=()=>{if(b!==R)return Promise.resolve(I());if(x++,q.set(!0),c===0&&!M())U.set(!0);let V=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(w,T).then((A)=>{if(b!==R||T!==N())return V(),I();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),j(),V(),I()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return V(),I()})},O=`${b} ${T||""}`;return w?v.fresh(O,C):v.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(_t(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),j()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);j()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
2
+ import{Wl,ql,Kl}from"./chunk-hdfhaddy.js";import{xe,or,ir,Ho,gs,ms,ar,cr,Vo,hs}from"./chunk-50wjk5ap.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,f=(p)=>r.get?r.get(p):p,a=()=>f(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let h=o(),t=r.set?r.set(p,h):p;if(h.trim&&typeof t==="string")t=t.trim();if(h.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let h=e.subscribe((t,i)=>p(f(t),f(i)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>f(a.error),a.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,f)=>y().then((a)=>new Promise((p,h)=>{let t=a.transaction("kv",u),i=f(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>h(t.error),t.onabort=()=>h(t.error)}));return{get:(u)=>s("readonly",(f)=>f.get(u)),set:(u,f)=>s("readwrite",(a)=>{a.put(f,u)}),remove:(u)=>s("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>s("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,f=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,h=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!h.size)return i;let n=Array.from(h.entries());return h.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(h.set(n,c),p.add(n),t)return;t=!0,f(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(h.keys()))if(v.indexOf(n)===0)h.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},f=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?f(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(f):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let I=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,j=()=>{I.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),j()})};if(!S)W(E);let _t=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),j(),!b)W(E)},xt=(w,b)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,V=new Promise((D,H)=>{O=setTimeout(()=>{if(C)C.abort();H(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:C?C.signal:void 0});else if(b){let D=m.fetch||((L,F)=>fetch(L,F)),H={method:"GET",headers:{Accept:"application/json"}};if(w)H.cache="no-cache";if(C)H.signal=C.signal;A=D(b,H).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((F)=>{throw Error(F&&(F.error||F.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,V]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),C=()=>{if(b!==R)return Promise.resolve(I());if(x++,q.set(!0),c===0&&!M())U.set(!0);let V=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(w,T).then((A)=>{if(b!==R||T!==N())return V(),I();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),j(),V(),I()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return V(),I()})},O=`${b} ${T||""}`;return w?v.fresh(O,C):v.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(_t(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),j()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);j()}}),d.set(t,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),h.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let a={key:s,promise:f};l.push(a);let p=()=>{let h=l.indexOf(a);if(h!==-1)l.splice(h,1)};return f.then(p,p),f};return{run(s,u){for(let f of l)if(o(f.key,s))return f.promise;for(let f of r)if(o(f.key,s))return f.promise;return y(s,u)},fresh(s,u){for(let h of r)if(o(h.key,s))return h.promise;let f=l.filter((h)=>o(h.key,s)).map((h)=>h.promise);if(!f.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(a);if(h!==-1)r.splice(h,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),f=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:h}=await u.read();if(p)break;if(a+=f.decode(h,{stream:!0}).replace(/\r\n/g,`
3
3
  `),a.length>1048576)throw Error("Broadcast frame too large");let t;while((t=a.indexOf(`
4
4
 
5
5
  `))!==-1){let i=a.slice(0,t);a=a.slice(t+2);let g=i.split(`
@@ -1363,7 +1363,7 @@ else {
1363
1363
  // implementation behind it (#1804).
1364
1364
  useSlots: function() {
1365
1365
  return window.__STX_CURRENT_SLOTS__ || {};
1366
- },`;var fe=` var __bindIfCounter = 0;
1366
+ },`;var he=` var __bindIfCounter = 0;
1367
1367
  // \u2500\u2500 x-else / x-else-if chain support (stacksjs/stx#1734) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1368
1368
  // Returns { name, terminal } for an else/else-if attribute present on el,
1369
1369
  // or null. terminal=true for the catch-all x-else (no further siblings
@@ -1401,7 +1401,7 @@ else {
1401
1401
  }
1402
1402
  return chain;
1403
1403
  }
1404
- `;var he=` // A false :if detaches its subtree before the DOMContentLoaded scope walk
1404
+ `;var fe=` // A false :if detaches its subtree before the DOMContentLoaded scope walk
1405
1405
  // reaches nested components. Capture and bind their caller-owned props while
1406
1406
  // the ancestor chain is still connected, otherwise resolveComponentCallerScope
1407
1407
  // can no longer see the component that declared expressions such as
@@ -9640,7 +9640,17 @@ ${e}
9640
9640
  if (el.__stx_detached_if) {
9641
9641
  var detached = el.__stx_detached_if;
9642
9642
  el.__stx_detached_if = null;
9643
- detached.forEach(function(node) { disposeSubtreeEffects(node); });
9643
+ // A hidden branch leaves with what holds it, and so do the components
9644
+ // in it. A walk of the page cannot find their scopes: the branch is off
9645
+ // the page, which is the only reason this list exists. A component
9646
+ // under an :if that was never true was set up all the same (its script
9647
+ // runs once, at load, for #1737), so the effects its script made kept
9648
+ // running after the router swapped the page out, and every visit to
9649
+ // the page added more (stacksjs/stx#2189).
9650
+ detached.forEach(function(node) {
9651
+ disposeSubtreeEffects(node);
9652
+ disposeSubtreeScopes(node, true);
9653
+ });
9644
9654
  }
9645
9655
  for (var k = 0; k < owned.length; k++) {
9646
9656
  var disposeOwned = el[owned[k]];
@@ -9728,7 +9738,12 @@ ${e}
9728
9738
  catch (e) { console.warn('[stx] scope effect dispose error:', e); }
9729
9739
  }
9730
9740
 
9731
- function disposeSubtreeScopes(root) {
9741
+ // offPage: the subtree is a hidden :if branch, so nothing in it is mounted.
9742
+ // A component in it either mounted and was suspended when the branch hid
9743
+ // (it released everything then) or never mounted at all. Neither is owed an
9744
+ // onDestroy: one without the onMount it pairs with would undo what was
9745
+ // never done.
9746
+ function disposeSubtreeScopes(root, offPage) {
9732
9747
  if (!root || !window.stx || !window.stx._scopes) return;
9733
9748
  // The host reports which scopes live in this subtree: the document finds
9734
9749
  // them with a selector, a native host reads the map it keeps as it builds
@@ -9743,7 +9758,7 @@ ${e}
9743
9758
  // running the hooks again would unmount it twice. (A hidden component's
9744
9759
  // root is detached, so no walk reaches it today; this keeps the next
9745
9760
  // disposal path that does from unmounting it twice.)
9746
- var alreadyReleased = scopeVars.__suspended && !scopeVars.__mounted;
9761
+ var alreadyReleased = offPage ? !scopeVars.__mounted : scopeVars.__suspended && !scopeVars.__mounted;
9747
9762
  if (!alreadyReleased && scopeVars.__destroyCallbacks && Array.isArray(scopeVars.__destroyCallbacks)) {
9748
9763
  for (var j = 0; j < scopeVars.__destroyCallbacks.length; j++) {
9749
9764
  try { scopeVars.__destroyCallbacks[j](); }
@@ -10743,7 +10758,7 @@ finally {
10743
10758
  }
10744
10759
  console.log('[stx:store] useStore:', id);
10745
10760
  return store;
10746
- },`;var ft=` // Storage access is guarded end to end (stacksjs/stx#1793). Every one of
10761
+ },`;var ht=` // Storage access is guarded end to end (stacksjs/stx#1793). Every one of
10747
10762
  // these can throw, and each throw took down the whole client script for the
10748
10763
  // page rather than just the composable:
10749
10764
  //
@@ -10821,7 +10836,7 @@ finally {
10821
10836
  window.addEventListener('storage', handler);
10822
10837
  onDestroy(function() { window.removeEventListener('storage', handler); });
10823
10838
  return s;
10824
- }`;var ht=` function bindStyle(el, expr, passedScope = componentScope, isVisible) {
10839
+ }`;var ft=` function bindStyle(el, expr, passedScope = componentScope, isVisible) {
10825
10840
  // Capture scope at setup time - use passed scope to preserve context
10826
10841
  const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
10827
10842
 
@@ -11799,7 +11814,7 @@ else if (timer === null) {
11799
11814
  subscribe: subscribe
11800
11815
  };
11801
11816
  }
11802
- `;function At(e={}){let o=St(rr(e));try{let r=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(o);return r=r.replace(/\}(var |let |const |function )/g,"};$1"),r}catch{return o}}function St(e){let o=[],l=0,r="console.log(";while(l<e.length){let d=e.indexOf(r,l);if(d===-1){o.push(e.slice(l));break}o.push(e.slice(l,d));let y=1,s=d+r.length;while(s<e.length&&y>0){let u=e[s];if(u==='"'||u==="'"||u==="`"){let h=u;s++;while(s<e.length&&e[s]!==h){if(e[s]==="\\")s++;s++}s++;continue}if(u==="(")y++;else if(u===")")y--;s++}o.push("0"),l=s}return o.join("")}function rr(e={}){return`${ae}${Pe}
11817
+ `;function At(e={}){let o=St(sr(e));try{let r=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(o);return r=r.replace(/\}(var |let |const |function )/g,"};$1"),r}catch{return o}}function St(e){let o=[],l=0,r="console.log(";while(l<e.length){let d=e.indexOf(r,l);if(d===-1){o.push(e.slice(l));break}o.push(e.slice(l,d));let y=1,s=d+r.length;while(s<e.length&&y>0){let u=e[s];if(u==='"'||u==="'"||u==="`"){let f=u;s++;while(s<e.length&&e[s]!==f){if(e[s]==="\\")s++;s++}s++;continue}if(u==="(")y++;else if(u===")")y--;s++}o.push("0"),l=s}return o.join("")}function sr(e={}){return`${ae}${Pe}
11803
11818
  ${Ze(ie,ke,Te)}
11804
11819
 
11805
11820
  ${De}
@@ -11824,15 +11839,15 @@ ${Re}
11824
11839
  ${Fe}
11825
11840
  ${se}
11826
11841
  ${de}
11827
- ${he}
11842
+ ${fe}
11828
11843
  ${Ge}
11829
- ${nt(Wl(),ql(),Ul())}
11844
+ ${nt(ql(),Kl(),Wl())}
11830
11845
 
11831
11846
  ${mt}
11832
11847
  ${lt}
11833
11848
  ${$e}
11834
11849
  ${le}
11835
- ${ht}
11850
+ ${ft}
11836
11851
  ${wt}
11837
11852
  ${qe}
11838
11853
  ${ue}
@@ -11840,7 +11855,7 @@ ${Ke}
11840
11855
  ${Ne}
11841
11856
  ${e.native?Ce:""}
11842
11857
  ${Be}
11843
- ${fe}
11858
+ ${he}
11844
11859
  ${je}
11845
11860
  ${Ve}
11846
11861
  ${ce}
@@ -11848,7 +11863,7 @@ ${gt}
11848
11863
  ${re}
11849
11864
  ${et}
11850
11865
 
11851
- ${ft}
11866
+ ${ht}
11852
11867
 
11853
11868
  var useBroadcastStream = ${ne.toString()};
11854
11869
 
@@ -11880,5 +11895,5 @@ ${ct}
11880
11895
  ${dt}
11881
11896
  ${it}
11882
11897
  })();
11883
- `}var Hh={state:xe,derived:sr,effect:or,batch:zo,onMount:ps,onDestroy:gs,isSignal:ir,isDerived:ar,untrack:Ho,peek:ms,generateSignalsRuntime:At,generateSignalsRuntimeDev:rr};
11884
- export{At,rr,Hh};
11898
+ `}var Vh={state:xe,derived:or,effect:ir,batch:Ho,onMount:gs,onDestroy:ms,isSignal:ar,isDerived:cr,untrack:Vo,peek:hs,generateSignalsRuntime:At,generateSignalsRuntimeDev:sr};
11899
+ export{At,sr,Vh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function I(){let{NODE_ENV:n}=process.env;return n==="production"}function ne(){let{STX_DEBUG:n}=process.env;return!I()||n==="true"}function jn(){let{NODE_ENV:n}=process.env;return n==="test"}function ea(n,t){return t??(n==="compile"||I())}function tt(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
- export{I,ne,jn,ea,tt};
2
+ function I(){let{NODE_ENV:n}=process.env;return n==="production"}function ne(){let{STX_DEBUG:n}=process.env;return!I()||n==="true"}function Bn(){let{NODE_ENV:n}=process.env;return n==="test"}function ta(n,t){return t??(n==="compile"||I())}function tt(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
+ export{I,ne,Bn,ta,tt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{kh,_h}from"./chunk-t14bn66j.js";export{_h as ensureTeleportTargets,kh as processTeleportDirectives};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function nn(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function ko(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function rn(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function ha(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function St(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function ya(e){console.log(` ${O("\u2139")} ${e}`)}function ba(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function _o(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function sn(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function wa(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function on(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{nn,ko,rn,ha,St,ya,ba,_o,sn,wa,on};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function nn(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function _o(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function rn(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function ya(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function St(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function ba(e){console.log(` ${O("\u2139")} ${e}`)}function wa(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Co(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function sn(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function va(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function on(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{nn,_o,rn,ya,St,ba,wa,Co,sn,va,on};