@ecopages/radiant 0.1.8 → 0.3.0-alpha.0

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 (442) hide show
  1. package/README.md +289 -34
  2. package/dist/chunk-0y78f8hj.js +4 -0
  3. package/dist/chunk-0y78f8hj.js.map +10 -0
  4. package/dist/chunk-0zq7e1ne.js +4 -0
  5. package/dist/chunk-0zq7e1ne.js.map +10 -0
  6. package/dist/chunk-13ydx769.js +4 -0
  7. package/dist/chunk-13ydx769.js.map +10 -0
  8. package/dist/chunk-147yvtsn.js +4 -0
  9. package/dist/chunk-147yvtsn.js.map +10 -0
  10. package/dist/chunk-17earqbr.js +4 -0
  11. package/dist/chunk-17earqbr.js.map +10 -0
  12. package/dist/chunk-1w1dm68j.js +4 -0
  13. package/dist/chunk-1w1dm68j.js.map +10 -0
  14. package/dist/chunk-2tgrfv09.js +4 -0
  15. package/dist/chunk-2tgrfv09.js.map +10 -0
  16. package/dist/chunk-3b033cgq.js +4 -0
  17. package/dist/chunk-3b033cgq.js.map +10 -0
  18. package/dist/chunk-42tyhfvh.js +4 -0
  19. package/dist/chunk-42tyhfvh.js.map +10 -0
  20. package/dist/chunk-4cc2syf5.js +4 -0
  21. package/dist/chunk-4cc2syf5.js.map +10 -0
  22. package/dist/chunk-4fqkmpra.js +4 -0
  23. package/dist/chunk-4fqkmpra.js.map +10 -0
  24. package/dist/chunk-4srpf0y5.js +4 -0
  25. package/dist/chunk-4srpf0y5.js.map +10 -0
  26. package/dist/chunk-57w3vmme.js +4 -0
  27. package/dist/chunk-57w3vmme.js.map +10 -0
  28. package/dist/chunk-5a2xez36.js +4 -0
  29. package/dist/chunk-5a2xez36.js.map +10 -0
  30. package/dist/chunk-5bym7y1d.js +4 -0
  31. package/dist/chunk-5bym7y1d.js.map +10 -0
  32. package/dist/chunk-5td6v9k3.js +4 -0
  33. package/dist/chunk-5td6v9k3.js.map +10 -0
  34. package/dist/chunk-60015zxq.js +4 -0
  35. package/dist/chunk-60015zxq.js.map +10 -0
  36. package/dist/chunk-60q4y3k5.js +4 -0
  37. package/dist/chunk-60q4y3k5.js.map +10 -0
  38. package/dist/chunk-6kdxrppw.js +4 -0
  39. package/dist/chunk-6kdxrppw.js.map +10 -0
  40. package/dist/chunk-6z34stya.js +4 -0
  41. package/dist/chunk-6z34stya.js.map +10 -0
  42. package/dist/chunk-73x7jpdd.js +4 -0
  43. package/dist/chunk-73x7jpdd.js.map +10 -0
  44. package/dist/chunk-84fc8cz9.js +4 -0
  45. package/dist/chunk-84fc8cz9.js.map +10 -0
  46. package/dist/chunk-8dexhy6c.js +4 -0
  47. package/dist/chunk-8dexhy6c.js.map +10 -0
  48. package/dist/chunk-8n2dhx28.js +4 -0
  49. package/dist/chunk-8n2dhx28.js.map +10 -0
  50. package/dist/chunk-8tvt04cm.js +4 -0
  51. package/dist/chunk-8tvt04cm.js.map +10 -0
  52. package/dist/chunk-8vak8w5w.js +4 -0
  53. package/dist/chunk-8vak8w5w.js.map +10 -0
  54. package/dist/chunk-8xy18qmz.js +4 -0
  55. package/dist/chunk-8xy18qmz.js.map +9 -0
  56. package/dist/chunk-9554n9t4.js +4 -0
  57. package/dist/chunk-9554n9t4.js.map +10 -0
  58. package/dist/chunk-9ascmjk3.js +4 -0
  59. package/dist/chunk-9ascmjk3.js.map +10 -0
  60. package/dist/chunk-9gjmqxp2.js +4 -0
  61. package/dist/chunk-9gjmqxp2.js.map +10 -0
  62. package/dist/chunk-a7hzs37s.js +4 -0
  63. package/dist/chunk-a7hzs37s.js.map +10 -0
  64. package/dist/chunk-aajhkdmn.js +4 -0
  65. package/dist/chunk-aajhkdmn.js.map +10 -0
  66. package/dist/chunk-agjb2a3r.js +4 -0
  67. package/dist/chunk-agjb2a3r.js.map +10 -0
  68. package/dist/chunk-ak97hp4w.js +4 -0
  69. package/dist/chunk-ak97hp4w.js.map +10 -0
  70. package/dist/chunk-bmhn4nbp.js +4 -0
  71. package/dist/chunk-bmhn4nbp.js.map +10 -0
  72. package/dist/chunk-c8vqg7r1.js +4 -0
  73. package/dist/chunk-c8vqg7r1.js.map +10 -0
  74. package/dist/chunk-cbvd18v1.js +4 -0
  75. package/dist/chunk-cbvd18v1.js.map +10 -0
  76. package/dist/chunk-chyn72n9.js +4 -0
  77. package/dist/chunk-chyn72n9.js.map +10 -0
  78. package/dist/chunk-cvz9mrxa.js +4 -0
  79. package/dist/chunk-cvz9mrxa.js.map +10 -0
  80. package/dist/chunk-d0n7njdy.js +4 -0
  81. package/dist/chunk-d0n7njdy.js.map +10 -0
  82. package/dist/chunk-d4v5qpxa.js +4 -0
  83. package/dist/chunk-d4v5qpxa.js.map +10 -0
  84. package/dist/chunk-d7hh3ze6.js +4 -0
  85. package/dist/chunk-d7hh3ze6.js.map +10 -0
  86. package/dist/chunk-d98q3myg.js +4 -0
  87. package/dist/chunk-d98q3myg.js.map +10 -0
  88. package/dist/chunk-dscj0sk9.js +4 -0
  89. package/dist/chunk-dscj0sk9.js.map +10 -0
  90. package/dist/chunk-dx1wqc00.js +4 -0
  91. package/dist/chunk-dx1wqc00.js.map +10 -0
  92. package/dist/chunk-g0gz7ypq.js +4 -0
  93. package/dist/chunk-g0gz7ypq.js.map +10 -0
  94. package/dist/chunk-hkmm3dj9.js +4 -0
  95. package/dist/chunk-hkmm3dj9.js.map +10 -0
  96. package/dist/chunk-hn4j8rt5.js +4 -0
  97. package/dist/chunk-hn4j8rt5.js.map +10 -0
  98. package/dist/chunk-jce9gqqw.js +4 -0
  99. package/dist/chunk-jce9gqqw.js.map +10 -0
  100. package/dist/chunk-jg20mzg8.js +4 -0
  101. package/dist/chunk-jg20mzg8.js.map +10 -0
  102. package/dist/chunk-jkb2y7c8.js +4 -0
  103. package/dist/chunk-jkb2y7c8.js.map +10 -0
  104. package/dist/chunk-k5hr781q.js +4 -0
  105. package/dist/chunk-k5hr781q.js.map +10 -0
  106. package/dist/chunk-ksv01cey.js +4 -0
  107. package/dist/chunk-ksv01cey.js.map +10 -0
  108. package/dist/chunk-mpjnqmbq.js +4 -0
  109. package/dist/chunk-mpjnqmbq.js.map +10 -0
  110. package/dist/chunk-mqxmfvyp.js +4 -0
  111. package/dist/chunk-mqxmfvyp.js.map +10 -0
  112. package/dist/chunk-ms6a9zdt.js +4 -0
  113. package/dist/chunk-ms6a9zdt.js.map +10 -0
  114. package/dist/chunk-nerd6fmg.js +4 -0
  115. package/dist/chunk-nerd6fmg.js.map +10 -0
  116. package/dist/chunk-nw171z6m.js +4 -0
  117. package/dist/chunk-nw171z6m.js.map +10 -0
  118. package/dist/chunk-p6pxdvkk.js +4 -0
  119. package/dist/chunk-p6pxdvkk.js.map +10 -0
  120. package/dist/chunk-paehjz94.js +4 -0
  121. package/dist/chunk-paehjz94.js.map +10 -0
  122. package/dist/chunk-par0t822.js +4 -0
  123. package/dist/chunk-par0t822.js.map +10 -0
  124. package/dist/chunk-qaagk55a.js +4 -0
  125. package/dist/chunk-qaagk55a.js.map +10 -0
  126. package/dist/chunk-qbnedp0y.js +4 -0
  127. package/dist/chunk-qbnedp0y.js.map +10 -0
  128. package/dist/chunk-qd28hvdx.js +4 -0
  129. package/dist/chunk-qd28hvdx.js.map +10 -0
  130. package/dist/chunk-qdj6r8jn.js +4 -0
  131. package/dist/chunk-qdj6r8jn.js.map +10 -0
  132. package/dist/chunk-qe6sjr27.js +4 -0
  133. package/dist/chunk-qe6sjr27.js.map +10 -0
  134. package/dist/chunk-r1cvaz1t.js +4 -0
  135. package/dist/chunk-r1cvaz1t.js.map +10 -0
  136. package/dist/chunk-r75y7ydb.js +4 -0
  137. package/dist/chunk-r75y7ydb.js.map +10 -0
  138. package/dist/chunk-s4qgct1z.js +4 -0
  139. package/dist/chunk-s4qgct1z.js.map +10 -0
  140. package/dist/chunk-scfk041e.js +4 -0
  141. package/dist/chunk-scfk041e.js.map +10 -0
  142. package/dist/chunk-t6x9e177.js +4 -0
  143. package/dist/chunk-t6x9e177.js.map +10 -0
  144. package/dist/chunk-t7a1bbxq.js +4 -0
  145. package/dist/chunk-t7a1bbxq.js.map +10 -0
  146. package/dist/chunk-tyysm4gk.js +4 -0
  147. package/dist/chunk-tyysm4gk.js.map +10 -0
  148. package/dist/chunk-vpfm9yw8.js +4 -0
  149. package/dist/chunk-vpfm9yw8.js.map +10 -0
  150. package/dist/chunk-w50v38rv.js +4 -0
  151. package/dist/chunk-w50v38rv.js.map +10 -0
  152. package/dist/chunk-x0522ksh.js +4 -0
  153. package/dist/chunk-x0522ksh.js.map +10 -0
  154. package/dist/chunk-xd1xn3vy.js +4 -0
  155. package/dist/chunk-xd1xn3vy.js.map +10 -0
  156. package/dist/chunk-zb7wh7w4.js +4 -0
  157. package/dist/chunk-zb7wh7w4.js.map +10 -0
  158. package/dist/chunk-zj9ez73m.js +4 -0
  159. package/dist/chunk-zj9ez73m.js.map +10 -0
  160. package/dist/context/context-consumer-bootstrap.d.ts +41 -0
  161. package/dist/context/context-consumer-bootstrap.js +3 -0
  162. package/dist/context/context-consumer-bootstrap.js.map +9 -0
  163. package/dist/context/context-consumer-runtime.d.ts +34 -0
  164. package/dist/context/context-consumer-runtime.js +3 -0
  165. package/dist/context/context-consumer-runtime.js.map +9 -0
  166. package/dist/context/context-provider.d.ts +50 -2
  167. package/dist/context/context-provider.js +2 -279
  168. package/dist/context/context-provider.js.map +3 -6
  169. package/dist/context/context-ssr-bridge.d.ts +16 -0
  170. package/dist/context/context-ssr-bridge.js +3 -0
  171. package/dist/context/context-ssr-bridge.js.map +9 -0
  172. package/dist/context/create-context.js +2 -6
  173. package/dist/context/create-context.js.map +3 -4
  174. package/dist/context/decorators/consume-context.d.ts +10 -6
  175. package/dist/context/decorators/consume-context.js +2 -64
  176. package/dist/context/decorators/consume-context.js.map +3 -5
  177. package/dist/context/decorators/context-selection-delivery.d.ts +1 -0
  178. package/dist/context/decorators/context-selection-delivery.js +3 -0
  179. package/dist/context/decorators/context-selection-delivery.js.map +9 -0
  180. package/dist/context/decorators/context-selector.d.ts +29 -9
  181. package/dist/context/decorators/context-selector.js +2 -71
  182. package/dist/context/decorators/context-selector.js.map +3 -5
  183. package/dist/context/decorators/legacy/consume-context.d.ts +3 -0
  184. package/dist/context/decorators/legacy/consume-context.js +3 -0
  185. package/dist/context/decorators/legacy/consume-context.js.map +9 -0
  186. package/dist/context/decorators/legacy/context-selector-field.d.ts +8 -0
  187. package/dist/context/decorators/legacy/context-selector-field.js +3 -0
  188. package/dist/context/decorators/legacy/context-selector-field.js.map +9 -0
  189. package/dist/context/decorators/legacy/context-selector.d.ts +4 -0
  190. package/dist/context/decorators/legacy/context-selector.js +3 -0
  191. package/dist/context/decorators/legacy/context-selector.js.map +9 -0
  192. package/dist/context/decorators/legacy/provide-context.d.ts +4 -0
  193. package/dist/context/decorators/legacy/provide-context.js +3 -0
  194. package/dist/context/decorators/legacy/provide-context.js.map +9 -0
  195. package/dist/context/decorators/on-context-update.d.ts +31 -0
  196. package/dist/context/decorators/on-context-update.js +3 -0
  197. package/dist/context/decorators/on-context-update.js.map +9 -0
  198. package/dist/context/decorators/provide-context.d.ts +18 -7
  199. package/dist/context/decorators/provide-context.js +2 -291
  200. package/dist/context/decorators/provide-context.js.map +3 -7
  201. package/dist/context/decorators/standard/consume-context.d.ts +3 -0
  202. package/dist/context/decorators/standard/consume-context.js +3 -0
  203. package/dist/context/decorators/standard/consume-context.js.map +9 -0
  204. package/dist/context/decorators/standard/context-selector-field.d.ts +8 -0
  205. package/dist/context/decorators/standard/context-selector-field.js +3 -0
  206. package/dist/context/decorators/standard/context-selector-field.js.map +9 -0
  207. package/dist/context/decorators/standard/context-selector.d.ts +5 -0
  208. package/dist/context/decorators/standard/context-selector.js +3 -0
  209. package/dist/context/decorators/standard/context-selector.js.map +9 -0
  210. package/dist/context/decorators/standard/provide-context.d.ts +4 -0
  211. package/dist/context/decorators/standard/provide-context.js +3 -0
  212. package/dist/context/decorators/standard/provide-context.js.map +9 -0
  213. package/dist/context/events.d.ts +3 -2
  214. package/dist/context/events.js +2 -53
  215. package/dist/context/events.js.map +3 -4
  216. package/dist/context/hydration-script.d.ts +17 -0
  217. package/dist/context/hydration-script.js +3 -0
  218. package/dist/context/hydration-script.js.map +9 -0
  219. package/dist/core/custom-element-metadata.d.ts +3 -0
  220. package/dist/core/custom-element-metadata.js +3 -0
  221. package/dist/core/custom-element-metadata.js.map +9 -0
  222. package/dist/core/hydration-codec.d.ts +24 -0
  223. package/dist/core/hydration-codec.js +3 -0
  224. package/dist/core/hydration-codec.js.map +9 -0
  225. package/dist/core/radiant-component-ssr.d.ts +29 -0
  226. package/dist/core/radiant-component-ssr.js +3 -0
  227. package/dist/core/radiant-component-ssr.js.map +9 -0
  228. package/dist/core/radiant-component.d.ts +106 -0
  229. package/dist/core/radiant-component.js +3 -0
  230. package/dist/core/radiant-component.js.map +9 -0
  231. package/dist/core/radiant-element.d.ts +283 -23
  232. package/dist/core/radiant-element.js +2 -82
  233. package/dist/core/radiant-element.js.map +3 -4
  234. package/dist/core/reactive-jsx-value.d.ts +10 -0
  235. package/dist/core/reactive-jsx-value.js +3 -0
  236. package/dist/core/reactive-jsx-value.js.map +9 -0
  237. package/dist/core/reactive-prop-metadata.d.ts +7 -0
  238. package/dist/core/reactive-prop-metadata.js +3 -0
  239. package/dist/core/reactive-prop-metadata.js.map +9 -0
  240. package/dist/core/slot-projection.d.ts +34 -0
  241. package/dist/core/slot-projection.js +3 -0
  242. package/dist/core/slot-projection.js.map +9 -0
  243. package/dist/core/ssr-hydration-binding.d.ts +14 -0
  244. package/dist/core/ssr-hydration-binding.js +2 -0
  245. package/dist/core/ssr-hydration-binding.js.map +9 -0
  246. package/dist/core/ssr-preparation.d.ts +18 -0
  247. package/dist/core/ssr-preparation.js +3 -0
  248. package/dist/core/ssr-preparation.js.map +9 -0
  249. package/dist/decorators/bound.d.ts +2 -6
  250. package/dist/decorators/bound.js +2 -23
  251. package/dist/decorators/bound.js.map +3 -4
  252. package/dist/decorators/bridge.d.ts +8 -0
  253. package/dist/decorators/bridge.js +3 -0
  254. package/dist/decorators/bridge.js.map +9 -0
  255. package/dist/decorators/custom-element.d.ts +3 -1
  256. package/dist/decorators/custom-element.js +2 -14
  257. package/dist/decorators/custom-element.js.map +3 -4
  258. package/dist/decorators/debounce.d.ts +6 -1
  259. package/dist/decorators/debounce.js +2 -20
  260. package/dist/decorators/debounce.js.map +3 -4
  261. package/dist/decorators/event.d.ts +3 -2
  262. package/dist/decorators/event.js +2 -46
  263. package/dist/decorators/event.js.map +3 -5
  264. package/dist/decorators/legacy/bound.d.ts +9 -0
  265. package/dist/decorators/legacy/bound.js +3 -0
  266. package/dist/decorators/legacy/bound.js.map +9 -0
  267. package/dist/decorators/legacy/custom-element.d.ts +6 -0
  268. package/dist/decorators/legacy/custom-element.js +3 -0
  269. package/dist/decorators/legacy/custom-element.js.map +9 -0
  270. package/dist/decorators/legacy/debounce.d.ts +1 -0
  271. package/dist/decorators/legacy/debounce.js +3 -0
  272. package/dist/decorators/legacy/debounce.js.map +9 -0
  273. package/dist/decorators/legacy/event.d.ts +9 -0
  274. package/dist/decorators/legacy/event.js +3 -0
  275. package/dist/decorators/legacy/event.js.map +9 -0
  276. package/dist/decorators/legacy/instance-initializers.d.ts +17 -0
  277. package/dist/decorators/legacy/instance-initializers.js +3 -0
  278. package/dist/decorators/legacy/instance-initializers.js.map +9 -0
  279. package/dist/decorators/legacy/on-event.d.ts +17 -0
  280. package/dist/decorators/legacy/on-event.js +3 -0
  281. package/dist/decorators/legacy/on-event.js.map +9 -0
  282. package/dist/decorators/legacy/on-updated.d.ts +6 -0
  283. package/dist/decorators/legacy/on-updated.js +3 -0
  284. package/dist/decorators/legacy/on-updated.js.map +9 -0
  285. package/dist/decorators/legacy/query-slot.d.ts +3 -0
  286. package/dist/decorators/legacy/query-slot.js +3 -0
  287. package/dist/decorators/legacy/query-slot.js.map +9 -0
  288. package/dist/decorators/legacy/query.d.ts +23 -0
  289. package/dist/decorators/legacy/query.js +3 -0
  290. package/dist/decorators/legacy/query.js.map +9 -0
  291. package/dist/decorators/{reactive-field.d.ts → legacy/reactive-field.d.ts} +2 -2
  292. package/dist/decorators/legacy/reactive-field.js +3 -0
  293. package/dist/decorators/legacy/reactive-field.js.map +9 -0
  294. package/dist/decorators/{reactive-prop.d.ts → legacy/reactive-prop.d.ts} +4 -3
  295. package/dist/decorators/legacy/reactive-prop.js +3 -0
  296. package/dist/decorators/legacy/reactive-prop.js.map +9 -0
  297. package/dist/decorators/legacy/signal.d.ts +10 -0
  298. package/dist/decorators/legacy/signal.js +3 -0
  299. package/dist/decorators/legacy/signal.js.map +9 -0
  300. package/dist/decorators/on-event.d.ts +6 -17
  301. package/dist/decorators/on-event.js +2 -47
  302. package/dist/decorators/on-event.js.map +3 -4
  303. package/dist/decorators/on-updated.d.ts +3 -4
  304. package/dist/decorators/on-updated.js +2 -29
  305. package/dist/decorators/on-updated.js.map +3 -4
  306. package/dist/decorators/prop.d.ts +14 -0
  307. package/dist/decorators/prop.js +3 -0
  308. package/dist/decorators/prop.js.map +9 -0
  309. package/dist/decorators/query-slot.d.ts +13 -0
  310. package/dist/decorators/query-slot.js +3 -0
  311. package/dist/decorators/query-slot.js.map +9 -0
  312. package/dist/decorators/query.d.ts +7 -35
  313. package/dist/decorators/query.js +2 -36
  314. package/dist/decorators/query.js.map +3 -4
  315. package/dist/decorators/signal.d.ts +23 -0
  316. package/dist/decorators/signal.js +3 -0
  317. package/dist/decorators/signal.js.map +9 -0
  318. package/dist/decorators/standard/bound.d.ts +2 -0
  319. package/dist/decorators/standard/bound.js +3 -0
  320. package/dist/decorators/standard/bound.js.map +9 -0
  321. package/dist/decorators/standard/custom-element.d.ts +1 -0
  322. package/dist/decorators/standard/custom-element.js +3 -0
  323. package/dist/decorators/standard/custom-element.js.map +9 -0
  324. package/dist/decorators/standard/debounce.d.ts +2 -0
  325. package/dist/decorators/standard/debounce.js +3 -0
  326. package/dist/decorators/standard/debounce.js.map +9 -0
  327. package/dist/decorators/standard/event.d.ts +9 -0
  328. package/dist/decorators/standard/event.js +3 -0
  329. package/dist/decorators/standard/event.js.map +9 -0
  330. package/dist/decorators/standard/on-event.d.ts +17 -0
  331. package/dist/decorators/standard/on-event.js +3 -0
  332. package/dist/decorators/standard/on-event.js.map +9 -0
  333. package/dist/decorators/standard/on-updated.d.ts +2 -0
  334. package/dist/decorators/standard/on-updated.js +3 -0
  335. package/dist/decorators/standard/on-updated.js.map +9 -0
  336. package/dist/decorators/standard/query-slot.d.ts +8 -0
  337. package/dist/decorators/standard/query-slot.js +3 -0
  338. package/dist/decorators/standard/query-slot.js.map +9 -0
  339. package/dist/decorators/standard/query.d.ts +2 -0
  340. package/dist/decorators/standard/query.js +3 -0
  341. package/dist/decorators/standard/query.js.map +9 -0
  342. package/dist/decorators/standard/reactive-field.d.ts +2 -0
  343. package/dist/decorators/standard/reactive-field.js +3 -0
  344. package/dist/decorators/standard/reactive-field.js.map +9 -0
  345. package/dist/decorators/standard/reactive-prop.d.ts +2 -0
  346. package/dist/decorators/standard/reactive-prop.js +3 -0
  347. package/dist/decorators/standard/reactive-prop.js.map +9 -0
  348. package/dist/decorators/standard/signal.d.ts +33 -0
  349. package/dist/decorators/standard/signal.js +3 -0
  350. package/dist/decorators/standard/signal.js.map +9 -0
  351. package/dist/decorators/state.d.ts +11 -0
  352. package/dist/decorators/state.js +3 -0
  353. package/dist/decorators/state.js.map +9 -0
  354. package/dist/helpers/create-event-listener.d.ts +28 -0
  355. package/dist/helpers/create-event-listener.js +3 -0
  356. package/dist/helpers/create-event-listener.js.map +9 -0
  357. package/dist/helpers/create-event.d.ts +9 -0
  358. package/dist/helpers/create-event.js +3 -0
  359. package/dist/helpers/create-event.js.map +9 -0
  360. package/dist/helpers/create-query-slot.d.ts +20 -0
  361. package/dist/helpers/create-query-slot.js +3 -0
  362. package/dist/helpers/create-query-slot.js.map +9 -0
  363. package/dist/helpers/create-query.d.ts +27 -0
  364. package/dist/helpers/create-query.js +3 -0
  365. package/dist/helpers/create-query.js.map +9 -0
  366. package/dist/helpers/debounce.d.ts +39 -0
  367. package/dist/helpers/debounce.js +3 -0
  368. package/dist/helpers/debounce.js.map +9 -0
  369. package/dist/helpers/index.d.ts +5 -0
  370. package/dist/helpers/index.js +3 -0
  371. package/dist/helpers/index.js.map +9 -0
  372. package/dist/index.d.ts +24 -6
  373. package/dist/index.js +2 -716
  374. package/dist/index.js.map +3 -21
  375. package/dist/server/context-ssr.d.ts +27 -0
  376. package/dist/server/context-ssr.js +3 -0
  377. package/dist/server/context-ssr.js.map +9 -0
  378. package/dist/server/install-light-dom-shim.d.ts +1 -0
  379. package/dist/server/install-light-dom-shim.js +3 -0
  380. package/dist/server/install-light-dom-shim.js.map +10 -0
  381. package/dist/server/light-dom-shim.d.ts +53 -0
  382. package/dist/server/light-dom-shim.js +3 -0
  383. package/dist/server/light-dom-shim.js.map +9 -0
  384. package/dist/server/project-root.d.ts +20 -0
  385. package/dist/server/project-root.js +3 -0
  386. package/dist/server/project-root.js.map +11 -0
  387. package/dist/server/render-component.d.ts +195 -0
  388. package/dist/server/render-component.js +3 -0
  389. package/dist/server/render-component.js.map +10 -0
  390. package/dist/signals/host-resource.d.ts +59 -0
  391. package/dist/signals/host-resource.js +3 -0
  392. package/dist/signals/host-resource.js.map +10 -0
  393. package/dist/signals/host-signal.d.ts +45 -0
  394. package/dist/signals/host-signal.js +3 -0
  395. package/dist/signals/host-signal.js.map +9 -0
  396. package/dist/signals/hydration-script.d.ts +11 -0
  397. package/dist/signals/hydration-script.js +3 -0
  398. package/dist/signals/hydration-script.js.map +9 -0
  399. package/dist/tools/escape-script-json.d.ts +5 -0
  400. package/dist/tools/escape-script-json.js +3 -0
  401. package/dist/tools/escape-script-json.js.map +9 -0
  402. package/dist/tools/event-emitter.d.ts +1 -1
  403. package/dist/tools/event-emitter.js +2 -22
  404. package/dist/tools/event-emitter.js.map +3 -4
  405. package/dist/tools/index.d.ts +2 -0
  406. package/dist/tools/index.js +2 -28
  407. package/dist/tools/index.js.map +3 -5
  408. package/dist/tools/render-jsx-template.d.ts +5 -0
  409. package/dist/tools/render-jsx-template.js +3 -0
  410. package/dist/tools/render-jsx-template.js.map +9 -0
  411. package/dist/tools/stringify-typed.d.ts +4 -6
  412. package/dist/tools/stringify-typed.js +2 -8
  413. package/dist/tools/stringify-typed.js.map +3 -4
  414. package/dist/types.d.ts +79 -0
  415. package/dist/types.js +3 -0
  416. package/dist/types.js.map +10 -0
  417. package/dist/utils/attribute-utils.d.ts +2 -0
  418. package/dist/utils/attribute-utils.js +2 -137
  419. package/dist/utils/attribute-utils.js.map +3 -4
  420. package/dist/utils/index.js +2 -137
  421. package/dist/utils/index.js.map +3 -4
  422. package/package.json +108 -44
  423. package/size-budget.json +22 -0
  424. package/dist/context/index.d.ts +0 -7
  425. package/dist/context/index.js +0 -338
  426. package/dist/context/index.js.map +0 -16
  427. package/dist/core/index.d.ts +0 -1
  428. package/dist/core/index.js +0 -83
  429. package/dist/core/index.js.map +0 -10
  430. package/dist/decorators/reactive-field.js +0 -27
  431. package/dist/decorators/reactive-field.js.map +0 -10
  432. package/dist/decorators/reactive-prop.js +0 -215
  433. package/dist/decorators/reactive-prop.js.map +0 -11
  434. package/dist/decorators.d.ts +0 -7
  435. package/dist/decorators.js +0 -401
  436. package/dist/decorators.js.map +0 -18
  437. package/dist/mixins/index.d.ts +0 -1
  438. package/dist/mixins/index.js +0 -24
  439. package/dist/mixins/index.js.map +0 -10
  440. package/dist/mixins/with-kita.d.ts +0 -15
  441. package/dist/mixins/with-kita.js +0 -24
  442. package/dist/mixins/with-kita.js.map +0 -10
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/ssr-preparation.ts"],
4
+ "sourcesContent": [
5
+ "type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol();\nexport const SSR_PREPARATION_RUNNING = Symbol();\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n"
6
+ ],
7
+ "mappings": "AAEA,IAAM,EAA4B,OAAO,EAC5B,EAA0B,OAAO,EASvC,SAAS,CAA8B,CAAC,EAAc,EAAwC,CAEpG,IAAM,EADS,EACkB,GAEjC,GAAI,MAAM,QAAQ,CAAiB,EAAG,CACrC,EAAkB,KAAK,CAAQ,EAC/B,OAGD,OAAO,eAAe,EAAM,EAA2B,CACtD,MAAO,CAAC,CAAQ,EAChB,aAAc,EACf,CAAC,EASK,SAAS,CAA0B,CAAC,EAAoB,CAC9D,IAAM,EAAS,EACT,EAAY,EAAO,GAEzB,GAAI,CAAC,MAAM,QAAQ,CAAS,EAC3B,OAGD,EAAO,GAA2B,GAElC,GAAI,CACH,QAAW,KAAY,EACtB,EAAS,SAET,CACD,OAAO,EAAO",
8
+ "debugId": "1DDCC51925B4B7D964756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{La as d}from"./chunk-8tvt04cm.js";import{ob as h}from"./chunk-42tyhfvh.js";function A(j){return(k,q)=>{d(k,(b)=>{let u=h(b,j);b.registerConnectedCallback(()=>{Object.defineProperty(b,q,{get(){return u},enumerable:!0,configurable:!0})})})}}
2
+ export{A as oa};
3
+
4
+ //# debugId=35F6D559C1C015C164756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/legacy/event.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { createEvent } from '../../helpers/create-event';\nimport type { EventEmitterConfig } from '../../tools/event-emitter';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn (proto: RadiantElement, propertyKey: string) => {\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tconst emitter = createEvent(element, eventConfig);\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tObject.defineProperty(element, propertyKey, {\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn emitter;\n\t\t\t\t\t},\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "wFAWO,GAAS,CAAK,CAAC,EAAiC,CACtD,MAAO,CAAC,EAAuB,IAAwB,CACtD,EAAkC,EAAO,CAAC,IAAY,CACrD,IAAM,EAAU,EAAY,EAAS,CAAW,EAEhD,EAAQ,0BAA0B,IAAM,CACvC,OAAO,eAAe,EAAS,EAAa,CAC3C,GAAG,EAAG,CACL,OAAO,GAER,WAAY,GACZ,aAAc,EACf,CAAC,EACD,EACD",
8
+ "debugId": "35F6D559C1C015C164756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{tb as b}from"./chunk-nw171z6m.js";function u(j){return function(k,m){m.addInitializer(function(){b(this,j,k.bind(this))})}}
2
+ export{u as Ka};
3
+
4
+ //# debugId=8BF971522BB242AB64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/standard/on-event.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { createEventListener } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport type { Method } from '../../types';\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n\treturn function <T extends Method>(originalMethod: T, context: ClassMethodDecoratorContext): void {\n\t\tcontext.addInitializer(function (this: any) {\n\t\t\tcreateEventListener(this as RadiantElement, eventConfig, originalMethod.bind(this));\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "yCAmBO,SAAS,CAAO,CAAC,EAA4B,CACnD,OAAO,QAA2B,CAAC,EAAmB,EAA4C,CACjG,EAAQ,eAAe,QAAS,EAAY,CAC3C,EAAoB,KAAwB,EAAa,EAAe,KAAK,IAAI,CAAC,EAClF",
8
+ "debugId": "8BF971522BB242AB64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{u as w,w as y}from"./chunk-vpfm9yw8.js";import{La as q}from"./chunk-8tvt04cm.js";function G(f){return(A,h)=>{let j=(b,c)=>{b[h]=c},k=(b,c={})=>{if(b[h])return!0;return y(b,f,(B)=>{j(b,B)},c)};q(A,(b)=>{w(b,f,(c)=>{j(b,c)}),b.registerConnectedCallback(()=>{if(k(b,{emitMounted:!0}))return;queueMicrotask(()=>{k(b,{emitMounted:!0})})})})}}
2
+ export{G as i};
3
+
4
+ //# debugId=26A41C95431F5F9B64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/legacy/consume-context.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../../core/radiant-element';\nimport { registerLegacyInstanceInitializer } from '../../../decorators/legacy/instance-initializers';\nimport { bootstrapSsrConsumedContext, connectConsumedContext } from '../../context-consumer-bootstrap';\nimport type { UnknownContext } from '../../types';\n\nexport function consumeContext(context: UnknownContext) {\n\treturn (proto: RadiantElement, propertyKey: string) => {\n\t\tconst assignContextProvider = (element: RadiantElement, provider: unknown) => {\n\t\t\t(element as any)[propertyKey] = provider;\n\t\t};\n\t\tconst initializeConsumedContextForHost = (element: RadiantElement, options: { emitMounted?: boolean } = {}) => {\n\t\t\tif ((element as any)[propertyKey]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn connectConsumedContext(\n\t\t\t\telement,\n\t\t\t\tcontext,\n\t\t\t\t(provider) => {\n\t\t\t\t\tassignContextProvider(element, provider);\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t);\n\t\t};\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tbootstrapSsrConsumedContext(element, context, (provider) => {\n\t\t\t\tassignContextProvider(element, provider);\n\t\t\t});\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tif (initializeConsumedContextForHost(element, { emitMounted: true })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tinitializeConsumedContextForHost(element, { emitMounted: true });\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "8FAKO,GAAS,CAAc,CAAC,EAAyB,CACvD,MAAO,CAAC,EAAuB,IAAwB,CACtD,IAAM,EAAwB,CAAC,EAAyB,IAAsB,CAC5E,EAAgB,GAAe,GAE3B,EAAmC,CAAC,EAAyB,EAAqC,CAAC,IAAM,CAC9G,GAAK,EAAgB,GACpB,MAAO,GAGR,OAAO,EACN,EACA,EACA,CAAC,IAAa,CACb,EAAsB,EAAS,CAAQ,GAExC,CACD,GAGD,EAAkC,EAAO,CAAC,IAAY,CACrD,EAA4B,EAAS,EAAS,CAAC,IAAa,CAC3D,EAAsB,EAAS,CAAQ,EACvC,EAED,EAAQ,0BAA0B,IAAM,CACvC,GAAI,EAAiC,EAAS,CAAE,YAAa,EAAK,CAAC,EAClE,OAGD,eAAe,IAAM,CACpB,EAAiC,EAAS,CAAE,YAAa,EAAK,CAAC,EAC/D,EACD,EACD",
8
+ "debugId": "26A41C95431F5F9B64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{r as A}from"./chunk-d98q3myg.js";import{s as E}from"./chunk-qaagk55a.js";import{Oa as z}from"./chunk-nerd6fmg.js";function L(j){return function(F,G,H){return z(E(j),A(j),F,G,H)}}
2
+ export{L as q};
3
+
4
+ //# debugId=7E2D0322C77E94BB64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/on-context-update.ts"],
4
+ "sourcesContent": [
5
+ "import type { StandardOrLegacyMethodDecoratorArgs } from '../../types';\nimport type { RadiantElement } from '../../core/radiant-element';\nimport type { Context, ContextType, UnknownContext } from '../types';\nimport { contextSelector as legacyContextSelectorMethod } from './legacy/context-selector';\nimport { contextSelector as standardContextSelectorMethod } from './standard/context-selector';\nimport { methodDecoratorBridge } from '../../decorators/bridge';\n\ntype ContextUpdateMethod<Selected> = (value: Selected) => unknown;\n\ntype OnContextUpdateDecorator<Selected> = {\n\t<Host extends RadiantElement, TMethod extends ContextUpdateMethod<Selected>>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\t): void;\n\t(\n\t\tprotoOrTarget: RadiantElement,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<ContextUpdateMethod<Selected>>,\n\t): TypedPropertyDescriptor<ContextUpdateMethod<Selected>> | void;\n};\n\nexport type OnContextUpdateOptions<T extends UnknownContext, Selected = ContextType<T>> = {\n\t/** Context token to resolve from ancestor providers. */\n\tcontext: T;\n\t/** Optional projection that narrows the resolved context before delivery. */\n\tselect?: (context: ContextType<T>) => Selected;\n\t/** Whether client-side event-channel subscriptions should stay active after the first value. */\n\tsubscribe?: boolean;\n\t/** Whether RadiantComponent hosts should schedule `requestUpdate()` after delivery. */\n\trequestUpdate?: boolean;\n};\n\n/**\n * Subscribes a method to the current value, or a selected slice, of a context.\n *\n * The decorated method is invoked during SSR when an ambient provider is\n * available, and on the client it keeps receiving updates according to the\n * `subscribe` option.\n *\n * On `RadiantComponent` hosts, each delivery also schedules `requestUpdate()`\n * unless `requestUpdate: false` is set explicitly.\n *\n * @param options Context subscription configuration.\n */\nexport function onContextUpdate<T extends Context<unknown, unknown>, Selected = ContextType<T>>(\n\toptions: OnContextUpdateOptions<T, Selected>,\n): OnContextUpdateDecorator<Selected> {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): TypedPropertyDescriptor<ContextUpdateMethod<Selected>> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardContextSelectorMethod(options),\n\t\t\tlegacyContextSelectorMethod(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t) as TypedPropertyDescriptor<ContextUpdateMethod<Selected>> | void;\n\t} as OnContextUpdateDecorator<Selected>;\n}\n"
6
+ ],
7
+ "mappings": "qIA4CO,GAAS,LAA+E,CAC9F,EACqC,CACrC,OAAO,QAAS,CACf,EACA,EACA,EACgE,CAChE,OAAO,EACN,EAA8B,CAAO,EACrC,EAA4B,CAAO,EACnC,EACA,EACA,CACD",
8
+ "debugId": "7E2D0322C77E94BB64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{rb as t}from"./chunk-qd28hvdx.js";function s(n={}){return function(l,e){let r=String(e.name);e.addInitializer(function(){let o=t(this,n);Object.defineProperty(this,r,{get(){return o.value},enumerable:!0,configurable:!0})})}}
2
+ export{s as ba};
3
+
4
+ //# debugId=8E4F32AF0CE8F85264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/standard/query-slot.ts"],
4
+ "sourcesContent": [
5
+ "import { createQuerySlot } from '../../helpers/create-query-slot';\nimport type { QuerySlotConfig } from '../query-slot';\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot(options: QuerySlotConfig = {}) {\n\treturn function <T extends SlotQueryHost, V extends Element | Element[]>(\n\t\t_: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuerySlot<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "yCASO,SAAS,CAAS,CAAC,EAA2B,CAAC,EAAG,CACxD,OAAO,QAAiE,CACvE,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAmB,KAAM,CAAO,EAEjD,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
8
+ "debugId": "8E4F32AF0CE8F85264756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{la as E}from"./chunk-t6x9e177.js";import{ma as F}from"./chunk-5a2xez36.js";function L(q,j){if(typeof j<"u"){if(typeof j==="object")return F()(q,j);return E()(q,j)}let G=q??{};return function(H,A){if(typeof A==="object")return F(G)(H,A);return E(G)(H,A)}}
2
+ export{L as ka};
3
+
4
+ //# debugId=C219C5D63128E17C64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/signal.ts"],
4
+ "sourcesContent": [
5
+ "import type {\n\tLegacyFieldDecoratorArgs,\n\tStandardFieldDecoratorArgs,\n\tStandardOrLegacyFieldDecoratorArgs,\n} from '../types';\nimport { signal as legacySignal, type SignalDecoratorOptions } from './legacy/signal';\nimport { signal as standardSignal } from './standard/signal';\n\nexport type { SignalDecoratorOptions } from './standard/signal';\n\n/**\n * Declares a host-aware writable signal field.\n *\n * The decorated member becomes a real `WritableSignal` instance that JSX can\n * consume directly in child or attribute positions. By default the decorator\n * creates a host-owned signal, but it can also connect an existing shared\n * signal through the `source` option or a signal-valued field initializer.\n *\n * Connected signals still flow through Radiant's update callback channel so\n * `@onUpdated(...)` and `this.$.name` bindings continue to work. On\n * `RadiantComponent`, any signal or store reads performed during `render()`\n * now participate in rerender invalidation directly, which makes module-level\n * shared stores a natural fit without prop-bridging them through a second\n * reactive layer.\n *\n * When `hydrate` is provided, SSR host output appends a keyed JSON script so\n * the client can restore the signal's initial value during hydration.\n */\nexport function signal(\n\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n): any;\nexport function signal(options?: SignalDecoratorOptions): any;\nexport function signal(\n\tprotoOrOptions?: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'] | SignalDecoratorOptions,\n\tnameOrContext?: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n): any {\n\tif (typeof nameOrContext !== 'undefined') {\n\t\tif (typeof nameOrContext === 'object') {\n\t\t\treturn standardSignal()(protoOrOptions as StandardFieldDecoratorArgs['protoOrTarget'], nameOrContext);\n\t\t}\n\n\t\treturn legacySignal()(protoOrOptions as LegacyFieldDecoratorArgs['protoOrTarget'], nameOrContext);\n\t}\n\n\tconst options = (protoOrOptions ?? {}) as SignalDecoratorOptions;\n\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tcontextOrName: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\tif (typeof contextOrName === 'object') {\n\t\t\treturn standardSignal(options)(\n\t\t\t\tprotoOrTarget as StandardFieldDecoratorArgs['protoOrTarget'],\n\t\t\t\tcontextOrName as StandardFieldDecoratorArgs['nameOrContext'],\n\t\t\t);\n\t\t}\n\n\t\treturn legacySignal(options)(\n\t\t\tprotoOrTarget as LegacyFieldDecoratorArgs['protoOrTarget'],\n\t\t\tcontextOrName as LegacyFieldDecoratorArgs['nameOrContext'],\n\t\t);\n\t};\n}\n"
6
+ ],
7
+ "mappings": "wFAiCO,GAAS,CAAM,CACrB,EACA,EACM,CACN,GAAI,OAAO,EAAkB,IAAa,CACzC,GAAI,OAAO,IAAkB,SAC5B,OAAO,EAAe,EAAE,EAA+D,CAAa,EAGrG,OAAO,EAAa,EAAE,EAA6D,CAAa,EAGjG,IAAM,EAAW,GAAkB,CAAC,EAEpC,OAAO,QAAS,CACf,EACA,EACM,CACN,GAAI,OAAO,IAAkB,SAC5B,OAAO,EAAe,CAAO,EAC5B,EACA,CACD,EAGD,OAAO,EAAa,CAAO,EAC1B,EACA,CACD",
8
+ "debugId": "C219C5D63128E17C64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ function x(v,f,w){let j=w.value;return{configurable:!0,get(){if(this===v.prototype||Object.hasOwn(this,f))return j;let q=j.bind(this);return Object.defineProperty(this,f,{value:q,configurable:!0,writable:!0}),q}}}
2
+ export{x as xa};
3
+
4
+ //# debugId=1F77B54CD2D2D68064756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/legacy/bound.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../core/radiant-element';\n\n/**\n * A decorator to bind a method to the instance.\n * @param target {@link RadiantElement}\n * @param propertyKey string\n * @param descriptor {@link PropertyDescriptor}\n * @returns\n */\nexport function bound(target: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\tconst originalMethod = descriptor.value;\n\n\treturn {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\tif (this === (target as any).prototype || Object.hasOwn(this, propertyKey)) {\n\t\t\t\treturn originalMethod;\n\t\t\t}\n\n\t\t\tconst boundMethod = originalMethod.bind(this);\n\t\t\tObject.defineProperty(this, propertyKey, {\n\t\t\t\tvalue: boundMethod,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t});\n\t\t\treturn boundMethod;\n\t\t},\n\t};\n}\n"
6
+ ],
7
+ "mappings": "AASO,SAAS,CAAK,CAAC,EAAwB,EAAqB,EAAoD,CACtH,IAAM,EAAiB,EAAW,MAElC,MAAO,CACN,aAAc,GACd,GAAG,EAAG,CACL,GAAI,OAAU,EAAe,WAAa,OAAO,OAAO,KAAM,CAAW,EACxE,OAAO,EAGR,IAAM,EAAc,EAAe,KAAK,IAAI,EAM5C,OALA,OAAO,eAAe,KAAM,EAAa,CACxC,MAAO,EACP,aAAc,GACd,SAAU,EACX,CAAC,EACM,EAET",
8
+ "debugId": "1F77B54CD2D2D68064756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{t as A}from"./chunk-5td6v9k3.js";import{v as w,x as z}from"./chunk-vpfm9yw8.js";function L(B){let{context:h,select:j,subscribe:E=!0}=B;return function(I,k){let F=String(k.name);return k.addInitializer(function(){let g=A(this,(G)=>{let H=this;H[F]=G},!0);if(w(this,h,g,j))return;let q=()=>{z(this,h,g,{select:j,subscribe:E})};this.registerConnectedCallback(()=>{q()}),queueMicrotask(q)}),function(g){return g}}}
2
+ export{L as m};
3
+
4
+ //# debugId=80F3FE5E70AD98A264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/standard/context-selector-field.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../../core/radiant-element';\nimport { bootstrapSsrContextSelection, connectContextSelection } from '../../context-consumer-bootstrap';\nimport type { Context, ContextType } from '../../types';\nimport { createContextSelectionDelivery } from '../context-selection-delivery';\n\nexport type ContextSelectorFieldOptions<T extends Context<unknown, unknown>, Selected = ContextType<T>> = {\n\tcontext: T;\n\tselect?: (context: ContextType<T>) => Selected;\n\tsubscribe?: boolean;\n};\n\nexport function contextSelectorField<T extends Context<unknown, unknown>, Selected = ContextType<T>>(\n\toptions: ContextSelectorFieldOptions<T, Selected>,\n) {\n\tconst { context, select, subscribe = true } = options;\n\n\treturn function <Host extends RadiantElement>(\n\t\t_: undefined,\n\t\tfieldContext: ClassFieldDecoratorContext<Host, Selected>,\n\t) {\n\t\tconst propertyName = String(fieldContext.name);\n\n\t\tfieldContext.addInitializer(function (this: Host) {\n\t\t\tconst applyValue = createContextSelectionDelivery(\n\t\t\t\tthis,\n\t\t\t\t(value) => {\n\t\t\t\t\tconst record = this as unknown as Record<string, unknown>;\n\t\t\t\t\trecord[propertyName] = value;\n\t\t\t\t},\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tif (bootstrapSsrContextSelection(this, context, applyValue, select as any)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst connectSelection = () => {\n\t\t\t\tconnectContextSelection(this, context, applyValue, {\n\t\t\t\t\tselect: select as any,\n\t\t\t\t\tsubscribe,\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\tconnectSelection();\n\t\t\t});\n\n\t\t\tqueueMicrotask(connectSelection);\n\t\t});\n\n\t\treturn function (this: Host, initialValue: Selected) {\n\t\t\treturn initialValue;\n\t\t};\n\t};\n}\n"
6
+ ],
7
+ "mappings": "6FAWO,GAAS,CAAoF,CACnG,EACC,CACD,IAAQ,UAAS,SAAQ,YAAY,IAAS,EAE9C,OAAO,QAAsC,CAC5C,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAa,IAAI,EA8B7C,OA5BA,EAAa,eAAe,QAAS,EAAa,CACjD,IAAM,EAAa,EAClB,KACA,CAAC,IAAU,CACV,IAAM,EAAS,KACf,EAAO,GAAgB,GAExB,EACD,EAEA,GAAI,EAA6B,KAAM,EAAS,EAAY,CAAa,EACxE,OAGD,IAAM,EAAmB,IAAM,CAC9B,EAAwB,KAAM,EAAS,EAAY,CAClD,OAAQ,EACR,WACD,CAAC,GAGF,KAAK,0BAA0B,IAAM,CACpC,EAAiB,EACjB,EAED,eAAe,CAAgB,EAC/B,EAEM,QAAS,CAAa,EAAwB,CACpD,OAAO",
8
+ "debugId": "80F3FE5E70AD98A264756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ function t(e){return JSON.stringify(e)}
2
+ export{t as b};
3
+
4
+ //# debugId=FD7EEF3FF918CC4E64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/tools/stringify-typed.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For maintaining the type in JSX attributes\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n *\n * // For lower-level JSON string generation outside JSX text children\n * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n\treturn JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
6
+ ],
7
+ "mappings": "AAeO,SAAS,CAAwB,CAAC,EAAyC,CACjF,OAAO,KAAK,UAAU,CAAK",
8
+ "debugId": "FD7EEF3FF918CC4E64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{o as A}from"./chunk-jg20mzg8.js";import{La as w}from"./chunk-8tvt04cm.js";function H({context:j,initialValue:B,hydrate:C,serialize:D}){return(E,f)=>{let k=(b)=>{if(b[f])return;let q=new A(b,{context:j,hydrationKey:f,initialValue:B,hydrate:C,serialize:D});b[f]=q,b.registerContextProvider(f,q),b.connectedContextCallback(j)};w(E,(b)=>{k(b),b.registerConnectedCallback(()=>{k(b)})})}}
2
+ export{H as k};
3
+
4
+ //# debugId=F36478E0A3334CDE64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/legacy/provide-context.ts"],
4
+ "sourcesContent": [
5
+ "import { ContextProvider } from '../../../context/context-provider';\nimport type { UnknownContext } from '../../../context/types';\nimport type { RadiantElement } from '../../../core/radiant-element';\nimport { registerLegacyInstanceInitializer } from '../../../decorators/legacy/instance-initializers';\nimport type { ProvideContextOptions } from '../provide-context';\n\nexport function provideContext<T extends UnknownContext>({\n\tcontext,\n\tinitialValue,\n\thydrate,\n\tserialize,\n}: ProvideContextOptions<T>) {\n\treturn (proto: RadiantElement, propertyKey: string) => {\n\t\tconst initializeProvider = (element: RadiantElement) => {\n\t\t\tif ((element as any)[propertyKey]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst provider = new ContextProvider<T>(element, {\n\t\t\t\tcontext,\n\t\t\t\thydrationKey: propertyKey,\n\t\t\t\tinitialValue,\n\t\t\t\thydrate,\n\t\t\t\tserialize,\n\t\t\t});\n\t\t\t(element as any)[propertyKey] = provider;\n\t\t\telement.registerContextProvider(propertyKey, provider);\n\t\t\telement.connectedContextCallback(context);\n\t\t};\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tinitializeProvider(element);\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tinitializeProvider(element);\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "uFAMO,GAAS,CAAwC,EACvD,UACA,eACA,UACA,aAC4B,CAC5B,MAAO,CAAC,EAAuB,IAAwB,CACtD,IAAM,EAAqB,CAAC,IAA4B,CACvD,GAAK,EAAgB,GACpB,OAGD,IAAM,EAAW,IAAI,EAAmB,EAAS,CAChD,UACA,aAAc,EACd,eACA,UACA,WACD,CAAC,EACA,EAAgB,GAAe,EAChC,EAAQ,wBAAwB,EAAa,CAAQ,EACrD,EAAQ,yBAAyB,CAAO,GAGzC,EAAkC,EAAO,CAAC,IAAY,CACrD,EAAmB,CAAO,EAC1B,EAAQ,0BAA0B,IAAM,CACvC,EAAmB,CAAO,EAC1B,EACD",
8
+ "debugId": "F36478E0A3334CDE64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{Ja as z}from"./chunk-3b033cgq.js";import{Ka as G}from"./chunk-aajhkdmn.js";import{Oa as q}from"./chunk-nerd6fmg.js";function Q(j){return function(H,I,J){return q(G(j),z(j),H,I,J)}}
2
+ export{Q as Ia};
3
+
4
+ //# debugId=C0F80007D719BB0864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/on-event.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElementEventListener } from '../core/radiant-element';\nimport type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport type { OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
6
+ ],
7
+ "mappings": "uIAoBO,GAAS,LAAO,CAAC,EAAwB,CAC/C,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAgB,CAAO,EACvB,EAAc,CAAO,EACrB,EACA,EACA,CACD",
8
+ "debugId": "C0F80007D719BB0864756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{i as z}from"./chunk-agjb2a3r.js";import{l as E}from"./chunk-hkmm3dj9.js";import{Na as w}from"./chunk-nerd6fmg.js";function L(q){return function(F,G){return w(E(q),z(q),F,G)}}
2
+ export{L as h};
3
+
4
+ //# debugId=9BE50727584DE51664756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/consume-context.ts"],
4
+ "sourcesContent": [
5
+ "import type { StandardOrLegacyFieldDecoratorArgs } from '../../types';\nimport type { UnknownContext } from '../types';\nimport { consumeContext as legacyConsumeContext } from './legacy/consume-context';\nimport { consumeContext as standardConsumeContext } from './standard/consume-context';\nimport { fieldDecoratorBridge } from '../../decorators/bridge';\n\n/**\n * Injects the nearest matching context provider onto a decorated field.\n *\n * During SSR the field can be resolved from the active SSR context stack; on\n * the client it falls back to the DOM event-based context channel.\n *\n * @param context Context token to consume from ancestor providers.\n * @returns A standard-or-legacy decorator implementation for the target field.\n */\nexport function consumeContext(context: UnknownContext) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardConsumeContext(context),\n\t\t\tlegacyConsumeContext(context),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t};\n}\n"
6
+ ],
7
+ "mappings": "qIAeO,GAAS,LAAc,CAAC,EAAyB,CACvD,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EACN,EAAuB,CAAO,EAC9B,EAAqB,CAAO,EAC5B,EACA,CACD",
8
+ "debugId": "9BE50727584DE51664756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{t as G}from"./chunk-5td6v9k3.js";import{v as F,x as A}from"./chunk-vpfm9yw8.js";import{La as E}from"./chunk-8tvt04cm.js";function T({context:j,select:k,subscribe:B=!0,requestUpdate:H=!0}){return(J,O,D)=>{let K=D.value;return E(J,(f)=>{let w=G(f,(N)=>{K.call(f,N)},H);F(f,j,w,k),f.registerConnectedCallback(()=>{if(A(f,j,w,{select:k,subscribe:B}))return;queueMicrotask(()=>{A(f,j,w,{select:k,subscribe:B})})})}),D}}
2
+ export{T as r};
3
+
4
+ //# debugId=EFF9D81C3F3096B064756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/legacy/context-selector.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../../core/radiant-element';\nimport { registerLegacyInstanceInitializer } from '../../../decorators/legacy/instance-initializers';\nimport { bootstrapSsrContextSelection, connectContextSelection } from '../../context-consumer-bootstrap';\nimport type { Context, ContextType } from '../../types';\nimport type { OnContextUpdateOptions } from '../on-context-update';\nimport { createContextSelectionDelivery } from '../context-selection-delivery';\n\nexport function contextSelector<T extends Context<unknown, unknown>, Selected = ContextType<T>>({\n\tcontext,\n\tselect,\n\tsubscribe = true,\n\trequestUpdate = true,\n}: OnContextUpdateOptions<T, Selected>) {\n\treturn (proto: RadiantElement, _: string, descriptor: PropertyDescriptor) => {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tconst applySelectedContext = createContextSelectionDelivery(\n\t\t\t\telement,\n\t\t\t\t(value) => {\n\t\t\t\t\toriginalMethod.call(element, value);\n\t\t\t\t},\n\t\t\t\trequestUpdate,\n\t\t\t);\n\n\t\t\tbootstrapSsrContextSelection(element, context, applySelectedContext, select);\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tif (\n\t\t\t\t\tconnectContextSelection(element, context, applySelectedContext, {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tsubscribe,\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tconnectContextSelection(element, context, applySelectedContext, {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tsubscribe,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn descriptor;\n\t};\n}\n"
6
+ ],
7
+ "mappings": "4IAOO,GAAS,LAA+E,EAC9F,UACA,SACA,YAAY,GACZ,gBAAgB,IACuB,CACvC,MAAO,CAAC,EAAuB,EAAW,IAAmC,CAC5E,IAAM,EAAiB,EAAW,MAgClC,OA9BA,EAAkC,EAAO,CAAC,IAAY,CACrD,IAAM,EAAuB,EAC5B,EACA,CAAC,IAAU,CACV,EAAe,KAAK,EAAS,CAAK,GAEnC,CACD,EAEA,EAA6B,EAAS,EAAS,EAAsB,CAAM,EAE3E,EAAQ,0BAA0B,IAAM,CACvC,GACC,EAAwB,EAAS,EAAS,EAAsB,CAC/D,SACA,WACD,CAAC,EAED,OAGD,eAAe,IAAM,CACpB,EAAwB,EAAS,EAAS,EAAsB,CAC/D,SACA,WACD,CAAC,EACD,EACD,EACD,EAEM",
8
+ "debugId": "EFF9D81C3F3096B064756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{fa as G}from"./chunk-8dexhy6c.js";import{Ua as F}from"./chunk-73x7jpdd.js";function Q({type:j,attribute:H,reflect:w,defaultValue:h,bind:A}){if(h!==void 0&&!F(j,h))throw Error(`defaultValue does not match the expected type for ${j.name}`);return function(J,B){let k=String(B.name),C=H??k,E=Symbol(`@ecopages/radiant/reactive-prop:${k}:initializer`);return B.addInitializer(function(){let q=this[E],I=h===void 0?q:h;G(this,k,{type:j,reflect:w,attribute:C,defaultValue:h,bind:A}),this.createReactiveProp(k,{type:j,reflect:w,attribute:C,defaultValue:I,bind:A})}),function(q){return this[E]=q,q}}}
2
+ export{Q as ea};
3
+
4
+ //# debugId=92FEC1ED84282E1E64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/standard/reactive-prop.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement, ReactivePropertyOptions } from '../../core/radiant-element.js';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\nimport { isValueOfType } from '../../utils/attribute-utils';\n\nexport function reactiveProp<P = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<P>) {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n\treturn function <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tconst propertyName = String(context.name);\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/reactive-prop:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst initializerValue = (this as T & Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\t\tconst resolvedDefaultValue = (defaultValue === undefined ? initializerValue : defaultValue) as\n\t\t\t\t| P\n\t\t\t\t| undefined;\n\n\t\t\tregisterReactivePropDefinition(this, propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t\tthis.createReactiveProp(propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: T, value: V) {\n\t\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n"
6
+ ],
7
+ "mappings": "wFAIO,GAAS,CAAyB,EACxC,OACA,YACA,UACA,eACA,QAC8B,CAC9B,GAAI,IAAiB,QAAa,CAAC,EAAc,EAAM,CAAY,EAClE,MAAU,MAAM,qDAAqD,EAAK,MAAM,EAEjF,OAAO,QAAsC,CAAC,EAAc,EAA2C,CACtG,IAAM,EAAe,OAAO,EAAQ,IAAI,EAClC,EAAe,GAAa,EAC5B,EAAsB,OAAO,mCAAmC,eAA0B,EAwBhG,OAtBA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAAgD,GACpE,EAAwB,IAAiB,OAAY,EAAmB,EAI9E,EAA+B,KAAM,EAAc,CAClD,OACA,UACA,UAAW,EACX,eACA,MACD,CAAC,EACD,KAAK,mBAAmB,EAAc,CACrC,OACA,UACA,UAAW,EACX,aAAc,EACd,MACD,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D",
8
+ "debugId": "92FEC1ED84282E1E64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{ab as D}from"./chunk-4cc2syf5.js";import{ub as P}from"./chunk-8xy18qmz.js";var y;function G(){if(y!==void 0)return y;try{let{AsyncLocalStorage:b}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return y=new b,y}catch{return y=null,null}}var z=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function H(){let b=globalThis;return b[z]??=[],b[z]}function U(b){if(b.length===0)return()=>{return};let j=new Map;for(let u of b)j.set(u.getContextKey(),u);let q=G();if(q){let u=q.getStore()??[],J=[...u,j];return q.enterWith(J),()=>{q.enterWith(u)}}let w=H();return w.push(j),()=>{let u=w.lastIndexOf(j);if(u>=0)w.splice(u,1)}}function I(b){let j=G()?.getStore()??H();for(let q=j.length-1;q>=0;q-=1){let w=j[q]?.get(b);if(w)return w}return}function V(b){let j=I(b);if(!j)return;return j.getContext()}D((b)=>I(b));
2
+ export{U as Za,I as _a,V as $a};
3
+
4
+ //# debugId=B67255647C78BF8B64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server/context-ssr.ts"],
4
+ "sourcesContent": [
5
+ "import type { AsyncLocalStorage } from 'node:async_hooks';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = ProviderFrame[];\n\nlet resolvedAsyncLocalStorage: AsyncLocalStorage<ProviderStack> | null | undefined;\n\n/**\n * Lazily resolves `AsyncLocalStorage` from `node:async_hooks`.\n *\n * The dynamic `require` is necessary because browser-based SSR tests import\n * this server-oriented module directly. A top-level static import would break\n * those browser bundles even though normal application SSR runs on the server.\n *\n * On the server (Node.js, Bun, Cloudflare Workers) the import always succeeds.\n * In browser test environments where SSR rendering is exercised without a real\n * server, the fallback global stack is used instead.\n */\nfunction getAsyncLocalStorage(): AsyncLocalStorage<ProviderStack> | null {\n\tif (resolvedAsyncLocalStorage !== undefined) {\n\t\treturn resolvedAsyncLocalStorage;\n\t}\n\n\ttry {\n\t\tconst { AsyncLocalStorage: ALS } = require('node:async_hooks') as typeof import('node:async_hooks');\n\t\tresolvedAsyncLocalStorage = new ALS<ProviderStack>();\n\t\treturn resolvedAsyncLocalStorage;\n\t} catch {\n\t\tresolvedAsyncLocalStorage = null;\n\t\treturn null;\n\t}\n}\n\nconst SSR_CONTEXT_FALLBACK_STACK_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-fallback-stack');\n\nfunction getFallbackStack(): ProviderStack {\n\tconst g = globalThis as typeof globalThis & { [SSR_CONTEXT_FALLBACK_STACK_SYMBOL]?: ProviderStack };\n\tg[SSR_CONTEXT_FALLBACK_STACK_SYMBOL] ??= [];\n\treturn g[SSR_CONTEXT_FALLBACK_STACK_SYMBOL];\n}\n\n/**\n * Pushes a temporary provider frame onto the SSR context stack.\n *\n * On the server, each call creates an isolated `AsyncLocalStorage` context so\n * concurrent renders cannot corrupt each other.\n *\n * In browser test environments where `AsyncLocalStorage` is unavailable, a\n * synchronous global stack is used as a fallback.\n */\nexport function withSsrContextProviders(providers: readonly SsrSerializableContextProvider[]): () => void {\n\tif (providers.length === 0) {\n\t\treturn () => undefined;\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\tconst als = getAsyncLocalStorage();\n\n\tif (als) {\n\t\tconst parentStack = als.getStore() ?? [];\n\t\tconst childStack = [...parentStack, frame];\n\t\tals.enterWith(childStack);\n\n\t\treturn () => {\n\t\t\tals.enterWith(parentStack);\n\t\t};\n\t}\n\n\tconst stack = getFallbackStack();\n\tstack.push(frame);\n\n\treturn () => {\n\t\tconst index = stack.lastIndexOf(frame);\n\t\tif (index >= 0) stack.splice(index, 1);\n\t};\n}\n\n/**\n * Resolves the nearest SSR-visible provider for a given context token.\n *\n * Lookup walks the provider frames from innermost to outermost so nested host\n * serialization behaves the same way as runtime context resolution in the DOM.\n */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getAsyncLocalStorage()?.getStore() ?? getFallbackStack();\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolves the current SSR-visible value for a given context token.\n *\n * This is the ergonomic helper consumed by SSR-aware decorators and component\n * render paths when they only need the context payload instead of the full\n * provider instance.\n */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n"
6
+ ],
7
+ "mappings": "wFAQA,FAAI,EAaJ,SAAS,CAAoB,EAA4C,CACxE,GAAI,IAA8B,OACjC,OAAO,EAGR,GAAI,CACH,IAAQ,kBAAmB,2EAE3B,OADA,EAA4B,IAAI,EACzB,EACN,KAAM,CAEP,OADA,EAA4B,KACrB,MAIT,IAAM,EAAoC,OAAO,IAAI,8CAA8C,EAEnG,SAAS,CAAgB,EAAkB,CAC1C,IAAM,EAAI,WAEV,OADA,EAAE,KAAuC,CAAC,EACnC,EAAE,GAYH,SAAS,CAAuB,CAAC,EAAkE,CACzG,GAAI,EAAU,SAAW,EACxB,MAAO,IAAG,CAAG,QAGd,IAAM,EAAQ,IAAI,IAElB,QAAW,KAAY,EACtB,EAAM,IAAI,EAAS,cAAc,EAAG,CAAQ,EAG7C,IAAM,EAAM,EAAqB,EAEjC,GAAI,EAAK,CACR,IAAM,EAAc,EAAI,SAAS,GAAK,CAAC,EACjC,EAAa,CAAC,GAAG,EAAa,CAAK,EAGzC,OAFA,EAAI,UAAU,CAAU,EAEjB,IAAM,CACZ,EAAI,UAAU,CAAW,GAI3B,IAAM,EAAQ,EAAiB,EAG/B,OAFA,EAAM,KAAK,CAAK,EAET,IAAM,CACZ,IAAM,EAAQ,EAAM,YAAY,CAAK,EACrC,GAAI,GAAS,EAAG,EAAM,OAAO,EAAO,CAAC,GAUhC,SAAS,CAAmD,CAClE,EAC6C,CAC7C,IAAM,EAAQ,EAAqB,GAAG,SAAS,GAAK,EAAiB,EAErE,QAAS,EAAQ,EAAM,OAAS,EAAG,GAAS,EAAG,GAAS,EAAG,CAC1D,IAAM,EAAW,EAAM,IAAQ,IAAI,CAAO,EAE1C,GAAI,EACH,OAAO,EAIT,OAUM,SAAS,CAAgD,CAAC,EAAwC,CACxG,IAAM,EAAW,EAA0B,CAAO,EAElD,GAAI,CAAC,EACJ,OAGD,OAAO,EAAS,WAAW,EAG5B,EAAkC,CAAC,IAAY,EAA0B,CAAO,CAAC",
8
+ "debugId": "B67255647C78BF8B64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ function L(A,j="light"){if(j==="shadow")return A.shadowRoot?[A.shadowRoot]:[];if(j==="both")return A.shadowRoot?[A,A.shadowRoot]:[A];return[A]}function N(A,j){let G="selector"in j?j.selector:`[data-ref="${j.ref}"]`,B=null,H=()=>{let I=L(A,j.scope);if(j?.all)return I.flatMap((E)=>Array.from(E.querySelectorAll(G)));for(let E of I){let K=E.querySelector(G);if(K)return K}return null};return{get value(){if(j?.cache){if(B===null||j?.all&&Array.isArray(B)&&!B.length)B=H();return B}return H()}}}
2
+ export{N as sb};
3
+
4
+ //# debugId=47F01602D6A0DE6664756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/helpers/create-query.ts"],
4
+ "sourcesContent": [
5
+ "type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction getQueryRoots(host: HTMLElement, scope: QueryScope = 'light'): QueryRoot[] {\n\tif (scope === 'shadow') {\n\t\treturn host.shadowRoot ? [host.shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn host.shadowRoot ? [host, host.shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to a host element.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param host The host element to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\thost: HTMLElement,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options?.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options?.cache) {\n\t\t\t\tif (cached === null || (options?.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n"
6
+ ],
7
+ "mappings": "AAuBA,SAAS,CAAa,CAAC,EAAmB,EAAoB,QAAsB,CACnF,GAAI,IAAU,SACb,OAAO,EAAK,WAAa,CAAC,EAAK,UAAU,EAAI,CAAC,EAG/C,GAAI,IAAU,OACb,OAAO,EAAK,WAAa,CAAC,EAAM,EAAK,UAAU,EAAI,CAAC,CAAI,EAGzD,MAAO,CAAC,CAAI,EASN,SAAS,CAAoD,CACnE,EACA,EACiB,CACjB,IAAM,EAAW,aAAc,EAAU,EAAQ,SAAW,cAAc,EAAQ,QAC9E,EAAmB,KAEjB,EAAe,IAAgB,CACpC,IAAM,EAAQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,GAAS,IACZ,OAAO,EAAM,QAAQ,CAAC,IAAS,MAAM,KAAK,EAAK,iBAAiB,CAAQ,CAAC,CAAC,EAG3E,QAAW,KAAQ,EAAO,CACzB,IAAM,EAAQ,EAAK,cAAc,CAAQ,EACzC,GAAI,EACH,OAAO,EAIT,OAAO,MAGR,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,GAAS,MAAO,CACnB,GAAI,IAAW,MAAS,GAAS,KAAO,MAAM,QAAQ,CAAM,GAAK,CAAC,EAAO,OACxE,EAAS,EAAa,EAEvB,OAAO,EAER,OAAO,EAAa,EAEtB",
8
+ "debugId": "47F01602D6A0DE6664756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{u as y,w as A}from"./chunk-vpfm9yw8.js";function G(f){return(D,j)=>{let k=String(j.name),q=(b,c)=>{b[k]=c},w=(b,c={})=>{if(b[k])return!0;return A(b,f,(B)=>{q(b,B)},c)};j.addInitializer(function(){if(y(this,f,(b)=>{q(this,b)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(w(this,{emitMounted:!0}))return;queueMicrotask(()=>{w(this,{emitMounted:!0})})})})}}
2
+ export{G as l};
3
+
4
+ //# debugId=F3A04E8722B07CD364756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/standard/consume-context.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../../core/radiant-element';\nimport { bootstrapSsrConsumedContext, connectConsumedContext } from '../../context-consumer-bootstrap';\nimport type { UnknownContext } from '../../types';\n\nexport function consumeContext(consumedContext: UnknownContext) {\n\treturn <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) => {\n\t\tconst contextName = String(context.name);\n\t\tconst assignContextProvider = (host: T, provider: unknown) => {\n\t\t\t(host as any)[contextName] = provider;\n\t\t};\n\t\tconst initializeConsumedContextForHost = (host: T, options: { emitMounted?: boolean } = {}) => {\n\t\t\tif ((host as any)[contextName]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn connectConsumedContext(\n\t\t\t\thost,\n\t\t\t\tconsumedContext,\n\t\t\t\t(provider) => {\n\t\t\t\t\tassignContextProvider(host, provider);\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t);\n\t\t};\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tif (\n\t\t\t\tbootstrapSsrConsumedContext(\n\t\t\t\t\tthis,\n\t\t\t\t\tconsumedContext,\n\t\t\t\t\t(provider) => {\n\t\t\t\t\t\tassignContextProvider(this, provider);\n\t\t\t\t\t},\n\t\t\t\t\t{ emitMounted: true },\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\tif (initializeConsumedContextForHost(this, { emitMounted: true })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tinitializeConsumedContextForHost(this, { emitMounted: true });\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
+ ],
7
+ "mappings": "+CAIO,SAAS,CAAc,CAAC,EAAiC,CAC/D,MAAO,CAA8B,EAAc,IAA8C,CAChG,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAwB,CAAC,EAAS,IAAsB,CAC5D,EAAa,GAAe,GAExB,EAAmC,CAAC,EAAS,EAAqC,CAAC,IAAM,CAC9F,GAAK,EAAa,GACjB,MAAO,GAGR,OAAO,EACN,EACA,EACA,CAAC,IAAa,CACb,EAAsB,EAAM,CAAQ,GAErC,CACD,GAGD,EAAQ,eAAe,QAAS,EAAU,CACzC,GACC,EACC,KACA,EACA,CAAC,IAAa,CACb,EAAsB,KAAM,CAAQ,GAErC,CAAE,YAAa,EAAK,CACrB,EAEA,OAGD,KAAK,0BAA0B,IAAM,CACpC,GAAI,EAAiC,KAAM,CAAE,YAAa,EAAK,CAAC,EAC/D,OAGD,eAAe,IAAM,CACpB,EAAiC,KAAM,CAAE,YAAa,EAAK,CAAC,EAC5D,EACD,EACD",
8
+ "debugId": "F3A04E8722B07CD364756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{qb as o}from"./chunk-13ydx769.js";function d(n){return(c,u,t)=>{let i=t.value,r=new WeakMap;return t.value=function(...a){let e=r.get(this);if(!e)e=o((...p)=>{return i.apply(this,p)},n),r.set(this,e);e(...a)},t}}
2
+ export{d as Aa};
3
+
4
+ //# debugId=AFD1D9E6D220D0D464756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/legacy/debounce.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { debounce as debounceFunction } from '../../helpers/debounce';\n\nexport function debounce(\n\ttimeout: number,\n): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor {\n\treturn (_target: RadiantElement, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor => {\n\t\tconst originalMethod = descriptor.value;\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<typeof originalMethod>>>();\n\n\t\tdescriptor.value = function debounce(this: object, ...args: Parameters<typeof originalMethod>) {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<typeof originalMethod>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"
6
+ ],
7
+ "mappings": "yCAGO,SAAS,CAAQ,CACvB,EAC2F,CAC3F,MAAO,CAAC,EAAyB,EAAsB,IAAuD,CAC7G,IAAM,EAAiB,EAAW,MAC5B,EAAsB,IAAI,QAehC,OAbA,EAAW,MAAQ,QAAiB,IAAkB,EAAyC,CAC9F,IAAI,EAAY,EAAoB,IAAI,IAAI,EAE5C,GAAI,CAAC,EACJ,EAAY,EAAiB,IAAI,IAAiD,CACjF,OAAO,EAAe,MAAM,KAAM,CAAS,GACzC,CAAO,EACV,EAAoB,IAAI,KAAM,CAAS,EAGxC,EAAU,GAAG,CAAI,GAGX",
8
+ "debugId": "AFD1D9E6D220D0D464756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ class Z extends EventTarget{nodeType;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];parentNode=null;constructor(j){super();this.nodeType=j}append(...j){for(let G of j)this.appendChild(typeof G==="string"?q(G):G)}appendChild(j){if("parentNode"in j&&j.parentNode&&"removeChild"in j.parentNode)j.parentNode.removeChild(j);return this.childNodes.push(j),j.parentNode=this,j}removeChild(j){let G=this.childNodes.indexOf(j);if(G===-1)return j;return this.childNodes.splice(G,1),j.parentNode=null,j}replaceChildren(...j){for(let G of this.childNodes)G.parentNode=null;this.childNodes=[],this.append(...j)}get textContent(){return this.childNodes.map((j)=>j.textContent??"").join("")}set textContent(j){this.replaceChildren(j??"")}}class y extends Z{value;constructor(j){super(Z.TEXT_NODE);this.value=j}get textContent(){return this.value}set textContent(j){this.value=j??""}}class z extends Z{attributes=new Map;fragmentHtml;fragmentText;localName;tagName;constructor(j="div"){super(Z.ELEMENT_NODE);this.localName=j.toLowerCase(),this.tagName=this.localName.toUpperCase()}hasAttribute(j){return this.attributes.has(j)}getAttribute(j){return this.attributes.get(j)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(j,G){this.fragmentHtml=void 0,this.attributes.set(j,String(G))}removeAttribute(j){this.fragmentHtml=void 0,this.attributes.delete(j)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let j=Array.from(this.attributes.entries()).map(([G,J])=>` ${G}="${S(J)}"`).join("");return`<${this.localName}${j}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((j)=>I(j)).join("")}set innerHTML(j){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...L(j))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(j){this.fragmentHtml=void 0,this.fragmentText=j??"",super.textContent=j}setSerializedFragment(j,G,J){this.fragmentHtml=j,this.fragmentText=G,this.attributes=new Map(Object.entries(J)),this.replaceChildren()}}class Q{bubbles;cancelable;composed;type;constructor(j,G={}){this.type=j,this.bubbles=G.bubbles??!1,this.cancelable=G.cancelable??!1,this.composed=G.composed??!1}}class F extends Q{detail;constructor(j,G={}){super(j,G);this.detail=G.detail}}class $ extends z{isConnected=!1;constructor(j="div"){super(j)}insertAdjacentHTML(j,G){this.append(...L(G))}}class P extends ${constructor(){super("script")}}class W{definitions=new Map;define(j,G){if(this.definitions.has(j))return;this.definitions.set(j,G)}get(j){return this.definitions.get(j)}}var _;function q(j){return new y(j)}function D(){let j=globalThis,G=j.customElements;if(typeof j.Node>"u"||typeof j.Element>"u"||typeof j.HTMLElement>"u"||!G||typeof G.define!=="function"||typeof G.get!=="function")return;return j.window??{CustomEvent:j.CustomEvent??F,Element:j.Element,Event:j.Event??Q,EventTarget:j.EventTarget??EventTarget,HTMLScriptElement:j.HTMLScriptElement??j.HTMLElement,HTMLElement:j.HTMLElement,Node:j.Node,customElements:G}}function C(){let j=D();if(j)return j;return k()}function M(){return C(),{prepareHost(j,G={}){if(G.authoredContent!==void 0)j.innerHTML=G.authoredContent}}}function k(){let j=D();if(j)return j;if(_)return _;let G=new W,J=globalThis.Event??Q,K=globalThis.CustomEvent??F,O=globalThis.EventTarget??EventTarget;return _={CustomEvent:K,Element:z,Event:J,EventTarget:O,HTMLScriptElement:P,HTMLElement:$,Node:Z,customElements:G},Object.assign(globalThis,{CustomEvent:K,Element:z,Event:J,EventTarget:O,HTMLScriptElement:P,HTMLElement:$,Node:Z,customElements:G,window:_}),_}function b(j){let G=[],J=0;while(J<j.length){let K=J;if(j.startsWith("<!--",J)){let U=j.indexOf("-->",J+4);J=U===-1?j.length:U+3,G.push(j.slice(K,J));continue}if(j[J]!=="<"){let U=j.indexOf("<",J);J=U===-1?j.length:U,G.push(j.slice(K,J));continue}let O=V(j,J);if(!O){G.push(j.slice(K));break}if(O.type!=="open"||O.selfClosing||B.has(O.tagName)){J=O.end,G.push(j.slice(K,J));continue}J=O.end;let Y=1;while(J<j.length&&Y>0){let U=j.indexOf("<",J);if(U===-1){J=j.length;break}let X=V(j,U);if(!X){J=j.length;break}if(J=X.end,X.type==="comment"||X.type==="declaration")continue;if(X.type==="open"&&!X.selfClosing&&!B.has(X.tagName)){Y+=1;continue}if(X.type==="close")Y-=1}G.push(j.slice(K,J))}return G.filter((K)=>K!=="")}function H(j,G){let J=G.tagName==="script"?new P:new $(G.tagName);return J.setSerializedFragment(j,f(G.innerHtml),G.attributes),J}function S(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function f(j){return j.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function N(j,G){let J;for(let K=G+1;K<j.length;K+=1){let O=j[K];if(J){if(O===J)J=void 0;continue}if(O==='"'||O==="'"){J=O;continue}if(O===">")return K+1}return j.length}function p(j){let G={},J=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let K of j.matchAll(J)){let[,O,Y,U,X]=K;if(!O)continue;G[O]=Y??U??X??""}return G}function V(j,G){if(j.startsWith("<!--",G)){let A=j.indexOf("-->",G+4);return{end:A===-1?j.length:A+3,type:"comment"}}let J=N(j,G),K=j.slice(G+1,J-1).trim();if(K==="")return;if(K.startsWith("!")||K.startsWith("?"))return{end:J,type:"declaration"};if(K.startsWith("/"))return{end:J,type:"close"};let O=/\/\s*$/.test(K),Y=O?K.replace(/\/\s*$/,"").trim():K,U=Y.split(/[\s/>]/,1)[0]?.toLowerCase()??"",X=U.length,R=Y.slice(X).trim(),w=O||B.has(U)?"":v(j,G,J,U);return{attributes:p(R),end:J,innerHtml:w,selfClosing:O,tagName:U,type:"open"}}function v(j,G,J,K){let O=J,Y=1;while(O<j.length&&Y>0){let U=j.indexOf("<",O);if(U===-1)return j.slice(J);let X=V(j,U);if(!X)return j.slice(J);if(X.type==="open"&&X.tagName===K&&!X.selfClosing&&!B.has(K))Y+=1;if(X.type==="close"){if(j.slice(U+2,X.end-1).trim().toLowerCase()===K){if(Y-=1,Y===0)return j.slice(J,U)}}O=X.end}return j.slice(J)}function L(j){return b(j).map((G)=>{if(!G.startsWith("<"))return q(G);let J=V(G,0);if(!J||J.type!=="open")return q(G);return H(G,J)})}function I(j){if(j.nodeType===Z.TEXT_NODE)return j.textContent??"";return"outerHTML"in j&&typeof j.outerHTML==="string"?j.outerHTML:j.textContent??""}var B=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);
2
+ export{C as c,M as d,k as e};
3
+
4
+ //# debugId=1FF05320553C515864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server/light-dom-shim.ts"],
4
+ "sourcesContent": [
5
+ "type MinimalCustomElementRegistry = {\n\tdefine(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;\n\tget(name: string): CustomElementConstructor | undefined;\n};\n\n/**\n * Minimal window-like runtime surface exposed by the SSR light-DOM shim.\n *\n * This is intentionally much smaller than a browser `window`; it only includes\n * the constructors and registry access that Radiant SSR currently needs.\n */\nexport type LightDomShimWindow = {\n\t/** Event constructor exposed to SSR-created components. */\n\tCustomEvent: typeof CustomEvent;\n\t/** Element constructor exposed to SSR-created components. */\n\tElement: typeof Element;\n\t/** Event constructor exposed to SSR-created components. */\n\tEvent: typeof Event;\n\t/** EventTarget constructor exposed to SSR-created components. */\n\tEventTarget: typeof EventTarget;\n\t/** HTMLScriptElement constructor used by slot projection payload parsing. */\n\tHTMLScriptElement: typeof HTMLScriptElement;\n\t/** HTMLElement constructor exposed to SSR-created components. */\n\tHTMLElement: typeof HTMLElement;\n\t/** Node constructor exposed to SSR-created components. */\n\tNode: typeof Node;\n\t/** Custom element registry used while rendering in SSR. */\n\tcustomElements: MinimalCustomElementRegistry;\n};\n\n/** Host preparation options accepted by the server render environment. */\nexport type PrepareServerRenderHostOptions = {\n\t/** Serialized light-DOM content to attach to the host before SSR. */\n\tauthoredContent?: string;\n};\n\n/** Reusable SSR environment used to prepare component hosts before rendering. */\nexport type ServerRenderEnvironment = {\n\t/** Prepares the host instance for rendering, including authored light-DOM content. */\n\tprepareHost(host: HTMLElement, options?: PrepareServerRenderHostOptions): void;\n};\n\ntype ParsedHtmlTag = {\n\tattributes: Record<string, string>;\n\tend: number;\n\tinnerHtml: string;\n\tselfClosing: boolean;\n\ttagName: string;\n\ttype: 'open';\n};\n\ntype ParsedHtmlToken =\n\t| ParsedHtmlTag\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'close';\n\t }\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'comment' | 'declaration';\n\t };\n\ntype MinimalParentNode = Node & ParentNode;\n\nclass MinimalNode extends EventTarget {\n\tstatic readonly ELEMENT_NODE = 1;\n\tstatic readonly TEXT_NODE = 3;\n\n\tpublic childNodes: Node[] = [];\n\tpublic parentNode: MinimalParentNode | null = null;\n\n\tconstructor(public readonly nodeType: number) {\n\t\tsuper();\n\t}\n\n\tappend(...nodes: Array<Node | string>): void {\n\t\tfor (const node of nodes) {\n\t\t\tthis.appendChild(typeof node === 'string' ? createTextNode(node) : node);\n\t\t}\n\t}\n\n\tappendChild<TNode extends Node>(node: TNode): TNode {\n\t\tif ('parentNode' in node && node.parentNode && 'removeChild' in node.parentNode) {\n\t\t\t(node.parentNode as Node & { removeChild(node: Node): Node }).removeChild(node);\n\t\t}\n\n\t\tthis.childNodes.push(node);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = this as unknown as MinimalParentNode;\n\t\treturn node;\n\t}\n\n\tremoveChild<TNode extends Node>(node: TNode): TNode {\n\t\tconst nodeIndex = this.childNodes.indexOf(node);\n\n\t\tif (nodeIndex === -1) {\n\t\t\treturn node;\n\t\t}\n\n\t\tthis.childNodes.splice(nodeIndex, 1);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\treturn node;\n\t}\n\n\treplaceChildren(...nodes: Array<Node | string>): void {\n\t\tfor (const child of this.childNodes) {\n\t\t\t(child as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\t}\n\n\t\tthis.childNodes = [];\n\t\tthis.append(...nodes);\n\t}\n\n\tget textContent(): string | null {\n\t\treturn this.childNodes.map((child) => child.textContent ?? '').join('');\n\t}\n\n\tset textContent(value: string | null) {\n\t\tthis.replaceChildren(value ?? '');\n\t}\n}\n\nclass MinimalTextNode extends MinimalNode {\n\tconstructor(private value: string) {\n\t\tsuper(MinimalNode.TEXT_NODE);\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.value;\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.value = value ?? '';\n\t}\n}\n\nclass MinimalElement extends MinimalNode {\n\tprivate attributes = new Map<string, string>();\n\tprivate fragmentHtml?: string;\n\tprivate fragmentText?: string;\n\n\tpublic readonly localName: string;\n\tpublic readonly tagName: string;\n\n\tconstructor(tagName = 'div') {\n\t\tsuper(MinimalNode.ELEMENT_NODE);\n\t\tthis.localName = tagName.toLowerCase();\n\t\tthis.tagName = this.localName.toUpperCase();\n\t}\n\n\thasAttribute(name: string): boolean {\n\t\treturn this.attributes.has(name);\n\t}\n\n\tgetAttribute(name: string): string | null {\n\t\treturn this.attributes.get(name) ?? null;\n\t}\n\n\tgetAttributeNames(): string[] {\n\t\treturn Array.from(this.attributes.keys());\n\t}\n\n\tsetAttribute(name: string, value: unknown): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.set(name, String(value));\n\t}\n\n\tremoveAttribute(name: string): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.delete(name);\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n\n\tmatches(): boolean {\n\t\treturn false;\n\t}\n\n\tget outerHTML(): string {\n\t\tif (this.fragmentHtml !== undefined) {\n\t\t\treturn this.fragmentHtml;\n\t\t}\n\n\t\tconst attributes = Array.from(this.attributes.entries())\n\t\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t\t.join('');\n\n\t\treturn `<${this.localName}${attributes}>${this.innerHTML}</${this.localName}>`;\n\t}\n\n\tget innerHTML(): string {\n\t\treturn this.childNodes.map((child) => serializeNodeHtml(child)).join('');\n\t}\n\n\tset innerHTML(html: string) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = undefined;\n\t\tthis.replaceChildren(...parseHtmlToNodes(html));\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.fragmentText ?? super.textContent ?? '';\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = value ?? '';\n\t\tsuper.textContent = value;\n\t}\n\n\tsetSerializedFragment(fragmentHtml: string, fragmentText: string, attributes: Record<string, string>): void {\n\t\tthis.fragmentHtml = fragmentHtml;\n\t\tthis.fragmentText = fragmentText;\n\t\tthis.attributes = new Map(Object.entries(attributes));\n\t\tthis.replaceChildren();\n\t}\n}\n\nclass MinimalEvent {\n\tpublic readonly bubbles: boolean;\n\tpublic readonly cancelable: boolean;\n\tpublic readonly composed: boolean;\n\tpublic readonly type: string;\n\n\tconstructor(type: string, eventInitDict: EventInit = {}) {\n\t\tthis.type = type;\n\t\tthis.bubbles = eventInitDict.bubbles ?? false;\n\t\tthis.cancelable = eventInitDict.cancelable ?? false;\n\t\tthis.composed = eventInitDict.composed ?? false;\n\t}\n}\n\nclass MinimalCustomEvent<T = unknown> extends MinimalEvent {\n\tpublic readonly detail: T;\n\n\tconstructor(type: string, eventInitDict: CustomEventInit<T> = {}) {\n\t\tsuper(type, eventInitDict);\n\t\tthis.detail = eventInitDict.detail as T;\n\t}\n}\n\nclass MinimalHTMLElement extends MinimalElement {\n\tpublic isConnected = false;\n\n\tconstructor(tagName = 'div') {\n\t\tsuper(tagName);\n\t}\n\n\tinsertAdjacentHTML(_position: InsertPosition, html: string): void {\n\t\tthis.append(...parseHtmlToNodes(html));\n\t}\n\n\tconnectedCallback?(): void;\n\tattributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n\tdisconnectedCallback?(): void;\n}\n\nclass MinimalHtmlScriptElement extends MinimalHTMLElement {\n\tconstructor() {\n\t\tsuper('script');\n\t}\n}\n\nclass MinimalCustomElementsRegistry implements MinimalCustomElementRegistry {\n\tprivate definitions = new Map<string, CustomElementConstructor>();\n\n\tdefine(name: string, constructor: CustomElementConstructor): void {\n\t\tif (this.definitions.has(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.definitions.set(name, constructor);\n\t}\n\n\tget(name: string): CustomElementConstructor | undefined {\n\t\treturn this.definitions.get(name);\n\t}\n}\n\nlet installedWindow: LightDomShimWindow | undefined;\n\nfunction createTextNode(value: string): Node {\n\treturn new MinimalTextNode(value) as unknown as Node;\n}\n\nfunction getExistingWindowLike(): LightDomShimWindow | undefined {\n\tconst globalScope = globalThis as typeof globalThis & {\n\t\tCustomEvent?: typeof CustomEvent;\n\t\tElement?: typeof Element;\n\t\tEvent?: typeof Event;\n\t\tEventTarget?: typeof EventTarget;\n\t\tHTMLScriptElement?: typeof HTMLScriptElement;\n\t\tHTMLElement?: typeof HTMLElement;\n\t\tNode?: typeof Node;\n\t\tcustomElements?: MinimalCustomElementRegistry;\n\t\twindow?: LightDomShimWindow;\n\t};\n\tconst existingCustomElements = globalScope.customElements;\n\n\tif (\n\t\ttypeof globalScope.Node === 'undefined' ||\n\t\ttypeof globalScope.Element === 'undefined' ||\n\t\ttypeof globalScope.HTMLElement === 'undefined' ||\n\t\t!existingCustomElements ||\n\t\ttypeof existingCustomElements.define !== 'function' ||\n\t\ttypeof existingCustomElements.get !== 'function'\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\tglobalScope.window ?? {\n\t\t\tCustomEvent: (globalScope.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent,\n\t\t\tElement: globalScope.Element,\n\t\t\tEvent: (globalScope.Event ?? MinimalEvent) as typeof Event,\n\t\t\tEventTarget: (globalScope.EventTarget ?? EventTarget) as typeof EventTarget,\n\t\t\tHTMLScriptElement: (globalScope.HTMLScriptElement ?? globalScope.HTMLElement) as typeof HTMLScriptElement,\n\t\t\tHTMLElement: globalScope.HTMLElement,\n\t\t\tNode: globalScope.Node,\n\t\t\tcustomElements: existingCustomElements,\n\t\t}\n\t);\n}\n\n/** Ensures that a minimal window-like SSR runtime is available and returns it. */\nexport function ensureLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\treturn installLightDomShim();\n}\n\n/**\n * Creates a reusable SSR environment that can prepare a component host with\n * authored light-DOM content before rendering.\n *\n * Adapters can reuse a single environment across multiple render calls when\n * they want a single host-preparation entrypoint backed by the installed shim.\n */\n\nexport function createServerRenderEnvironment(): ServerRenderEnvironment {\n\tensureLightDomShim();\n\n\treturn {\n\t\tprepareHost(host: HTMLElement, options: PrepareServerRenderHostOptions = {}): void {\n\t\t\tif (options.authoredContent !== undefined) {\n\t\t\t\thost.innerHTML = options.authoredContent;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Installs the smallest global surface needed to instantiate Radiant custom elements during SSR.\n */\nexport function installLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\tif (installedWindow) {\n\t\treturn installedWindow;\n\t}\n\n\tconst customElements = new MinimalCustomElementsRegistry();\n\tconst EventConstructor = (globalThis.Event ?? MinimalEvent) as typeof Event;\n\tconst CustomEventConstructor = (globalThis.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent;\n\tconst EventTargetConstructor = (globalThis.EventTarget ?? EventTarget) as typeof EventTarget;\n\tinstalledWindow = {\n\t\tCustomEvent: CustomEventConstructor,\n\t\tElement: MinimalElement as unknown as typeof Element,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement as unknown as typeof HTMLScriptElement,\n\t\tHTMLElement: MinimalHTMLElement as unknown as typeof HTMLElement,\n\t\tNode: MinimalNode as unknown as typeof Node,\n\t\tcustomElements,\n\t};\n\n\tObject.assign(globalThis, {\n\t\tCustomEvent: CustomEventConstructor,\n\t\tElement: MinimalElement,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement,\n\t\tHTMLElement: MinimalHTMLElement,\n\t\tNode: MinimalNode,\n\t\tcustomElements,\n\t\twindow: installedWindow,\n\t});\n\n\treturn installedWindow;\n}\n\nfunction collectTopLevelHtmlFragments(html: string): string[] {\n\tconst fragments: string[] = [];\n\tlet index = 0;\n\n\twhile (index < html.length) {\n\t\tconst fragmentStart = index;\n\n\t\tif (html.startsWith('<!--', index)) {\n\t\t\tconst commentEnd = html.indexOf('-->', index + 4);\n\t\t\tindex = commentEnd === -1 ? html.length : commentEnd + 3;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (html[index] !== '<') {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\t\t\tindex = nextTagIndex === -1 ? html.length : nextTagIndex;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst token = parseHtmlTagToken(html, index);\n\n\t\tif (!token) {\n\t\t\tfragments.push(html.slice(fragmentStart));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type !== 'open' || token.selfClosing || voidElementNames.has(token.tagName)) {\n\t\t\tindex = token.end;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tindex = token.end;\n\t\tlet depth = 1;\n\n\t\twhile (index < html.length && depth > 0) {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\t\tif (nextTagIndex === -1) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nestedToken = parseHtmlTagToken(html, nextTagIndex);\n\n\t\t\tif (!nestedToken) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = nestedToken.end;\n\n\t\t\tif (nestedToken.type === 'comment' || nestedToken.type === 'declaration') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'open' && !nestedToken.selfClosing && !voidElementNames.has(nestedToken.tagName)) {\n\t\t\t\tdepth += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'close') {\n\t\t\t\tdepth -= 1;\n\t\t\t}\n\t\t}\n\n\t\tfragments.push(html.slice(fragmentStart, index));\n\t}\n\n\treturn fragments.filter((fragment) => fragment !== '');\n}\n\nfunction createElementFromFragment(fragment: string, tag: ParsedHtmlTag): Node {\n\tconst element =\n\t\ttag.tagName === 'script'\n\t\t\t? (new MinimalHtmlScriptElement() as MinimalElement)\n\t\t\t: new MinimalHTMLElement(tag.tagName);\n\n\telement.setSerializedFragment(fragment, extractTextContent(tag.innerHtml), tag.attributes);\n\treturn element as unknown as Node;\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n\nfunction extractTextContent(html: string): string {\n\treturn html.replace(/<!--.*?-->/gs, '').replace(/<[^>]+>/g, '');\n}\n\nfunction findHtmlTagEnd(html: string, startIndex: number): number {\n\tlet quote: '\"' | \"'\" | undefined;\n\n\tfor (let index = startIndex + 1; index < html.length; index += 1) {\n\t\tconst character = html[index];\n\n\t\tif (quote) {\n\t\t\tif (character === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '\"' || character === \"'\") {\n\t\t\tquote = character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '>') {\n\t\t\treturn index + 1;\n\t\t}\n\t}\n\n\treturn html.length;\n}\n\nfunction parseAttributes(rawAttributes: string): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst attributePattern = /([:^@A-Za-z0-9_.-]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>/]+)))?/g;\n\n\tfor (const match of rawAttributes.matchAll(attributePattern)) {\n\t\tconst [, name, doubleQuoted, singleQuoted, bareValue] = match;\n\n\t\tif (!name) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[name] = doubleQuoted ?? singleQuoted ?? bareValue ?? '';\n\t}\n\n\treturn attributes;\n}\n\nfunction parseHtmlTagToken(html: string, startIndex: number): ParsedHtmlToken | undefined {\n\tif (html.startsWith('<!--', startIndex)) {\n\t\tconst endIndex = html.indexOf('-->', startIndex + 4);\n\t\treturn {\n\t\t\tend: endIndex === -1 ? html.length : endIndex + 3,\n\t\t\ttype: 'comment',\n\t\t};\n\t}\n\n\tconst endIndex = findHtmlTagEnd(html, startIndex);\n\tconst rawToken = html.slice(startIndex + 1, endIndex - 1).trim();\n\n\tif (rawToken === '') {\n\t\treturn undefined;\n\t}\n\n\tif (rawToken.startsWith('!') || rawToken.startsWith('?')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'declaration',\n\t\t};\n\t}\n\n\tif (rawToken.startsWith('/')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'close',\n\t\t};\n\t}\n\n\tconst selfClosing = /\\/\\s*$/.test(rawToken);\n\tconst tagBody = selfClosing ? rawToken.replace(/\\/\\s*$/, '').trim() : rawToken;\n\tconst tagName = tagBody.split(/[\\s/>]/, 1)[0]?.toLowerCase() ?? '';\n\tconst attributesStart = tagName.length;\n\tconst rawAttributes = tagBody.slice(attributesStart).trim();\n\tconst innerHtml =\n\t\tselfClosing || voidElementNames.has(tagName)\n\t\t\t? ''\n\t\t\t: extractInnerHtmlFragment(html, startIndex, endIndex, tagName);\n\n\treturn {\n\t\tattributes: parseAttributes(rawAttributes),\n\t\tend: endIndex,\n\t\tinnerHtml,\n\t\tselfClosing,\n\t\ttagName,\n\t\ttype: 'open',\n\t};\n}\n\nfunction extractInnerHtmlFragment(html: string, startIndex: number, tagEndIndex: number, tagName: string): string {\n\tlet index = tagEndIndex;\n\tlet depth = 1;\n\n\twhile (index < html.length && depth > 0) {\n\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\tif (nextTagIndex === -1) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tconst nextTag = parseHtmlTagToken(html, nextTagIndex);\n\n\t\tif (!nextTag) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tif (\n\t\t\tnextTag.type === 'open' &&\n\t\t\tnextTag.tagName === tagName &&\n\t\t\t!nextTag.selfClosing &&\n\t\t\t!voidElementNames.has(tagName)\n\t\t) {\n\t\t\tdepth += 1;\n\t\t}\n\n\t\tif (nextTag.type === 'close') {\n\t\t\tconst closingName = html\n\t\t\t\t.slice(nextTagIndex + 2, nextTag.end - 1)\n\t\t\t\t.trim()\n\t\t\t\t.toLowerCase();\n\n\t\t\tif (closingName === tagName) {\n\t\t\t\tdepth -= 1;\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\treturn html.slice(tagEndIndex, nextTagIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tindex = nextTag.end;\n\t}\n\n\treturn html.slice(tagEndIndex);\n}\n\nfunction parseHtmlToNodes(html: string): Node[] {\n\treturn collectTopLevelHtmlFragments(html).map((fragment) => {\n\t\tif (!fragment.startsWith('<')) {\n\t\t\treturn createTextNode(fragment);\n\t\t}\n\n\t\tconst tag = parseHtmlTagToken(fragment, 0);\n\n\t\tif (!tag || tag.type !== 'open') {\n\t\t\treturn createTextNode(fragment);\n\t\t}\n\n\t\treturn createElementFromFragment(fragment, tag);\n\t});\n}\n\nfunction serializeNodeHtml(node: Node): string {\n\tif (node.nodeType === MinimalNode.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\n\treturn 'outerHTML' in node && typeof node.outerHTML === 'string' ? node.outerHTML : (node.textContent ?? '');\n}\n\nconst voidElementNames = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'embed',\n\t'hr',\n\t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OAAO,EAAe,CAAQ,EAG/B,OAAO,EAA0B,EAAU,CAAG,EAC9C,EAGF,SAAS,CAAiB,CAAC,EAAoB,CAC9C,GAAI,EAAK,WAAa,EAAY,UACjC,OAAO,EAAK,aAAe,GAG5B,MAAO,cAAe,GAAQ,OAAO,EAAK,YAAc,SAAW,EAAK,UAAa,EAAK,aAAe,GAG1G,IAAM,EAAmB,IAAI,IAAI,CAChC,OACA,OACA,KACA,MACA,QACA,KACA,MACA,QACA,OACA,OACA,QACA,SACA,QACA,KACD,CAAC",
8
+ "debugId": "1FF05320553C515864756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{E as I}from"./chunk-1w1dm68j.js";import{V as U,W as Y}from"./chunk-6kdxrppw.js";import{lb as K,mb as Q}from"./chunk-ksv01cey.js";import{createMarkupNodeLike as _}from"@ecopages/jsx";class ${host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(q,A){this.host=q,this.context=A.context,this.hydrationKey=A.hydrationKey,this.hydrate=A.hydrate,this.serialize=A.serialize,this.pendingHostHydration=Boolean(A.hydrate),this.value=A.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new I(this.context))}setContext=(q,A)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(q)){let B=this.value;if(this.value={...q},A)A(this.value);this.notifySubscribers(this.value,B);return}if(this.isObject(this.value)&&this.isObject(q)){let B={...this.value};if(this.value={...this.value,...q},A)A(this.value);this.notifySubscribers(this.value,B)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let q=this.serialize?this.serialize(this.value):this.value;if(typeof q>"u")return;let A=JSON.stringify(q);if(typeof A!=="string")return;return Y(A)};renderHydrationScriptTag=()=>{let q=this.serializeHydrationValue();if(!q)return;return U({hydrationKey:this.hydrationKey,serializedValue:q})};renderHydrationScript=()=>{let q=this.renderHydrationScriptTag();if(!q)return;return _(q)};subscribe=({select:q,callback:A})=>{this.subscriptions.push({select:q,callback:A})};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let q=this.findHydrationScriptElement();if(!q)return;this.value=this.mergeHydrationValue(K(q,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(q){if(this.hydrate===Object&&this.isObject(q)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...q};return q}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}findHydrationScriptElement(){return Q(this.host,"context",this.hydrationKey)}notifySubscribers=(q,A)=>{for(let B of this.subscriptions){if(!B.select||typeof A>"u"){this.sendSubscriptionUpdate(B,q);continue}let F=B.select(q),G=B.select(A);if(F!==G)this.sendSubscriptionUpdate(B,q)}};sendSubscriptionUpdate=({select:q,callback:A},B)=>{if(!q)A(B);else A(q(B))};handleSubscriptionRequest=({select:q,callback:A,subscribe:B})=>{if(this.tryHydrateFromHost(),B)this.subscribe({select:q,callback:A});if(typeof this.value>"u")return;if(q)A(q(this.value));else A(this.value)};onSubscriptionRequest=(q)=>{let{context:A,callback:B,subscribe:F,select:G,target:Z}=q;if(A!==this.context)return;q.stopPropagation(),Z.dispatchEvent(new I(this.context)),this.handleSubscriptionRequest({select:G,callback:B,subscribe:F})};onContextRequest=(q)=>{let{context:A,callback:B}=q;if(A!==this.context)return;q.stopPropagation(),B(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}
2
+ export{$ as o};
3
+
4
+ //# debugId=12954678E1A01CDC64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/context-provider.ts"],
4
+ "sourcesContent": [
5
+ "import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantElement } from '../core/radiant-element';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport {\n\tContextEventsTypes,\n\tContextOnMountEvent,\n\ttype ContextRequestEvent,\n\ttype ContextSubscription,\n\ttype ContextSubscriptionRequestEvent,\n} from './events';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createContextHydrationScriptTag, escapeContextHydrationJson } from './hydration-script';\nimport type { Context, ContextType, UnknownContext } from './types';\n\ntype ContextProviderOptions<T extends UnknownContext> = {\n\tcontext: UnknownContext;\n\thydrationKey?: string;\n\tinitialValue?: T['__context__'];\n\thydrate?: AttributeTypeConstant;\n\tserialize?: (value: ContextType<T>) => unknown;\n};\n\nexport interface SsrSerializableContextProvider extends SsrSerializableHydrationBinding {\n\t/** Returns the current context payload that should be visible to descendants. */\n\tgetContext(): unknown;\n\t/** Returns the context token used to match nested SSR consumers and providers. */\n\tgetContextKey(): UnknownContext;\n}\n\n/**\n * Represents a context provider that allows setting and getting the context,\n * as well as subscribing to context updates.\n *\n * @template T - The type of the context.\n */\nexport interface IContextProvider<T extends Context<unknown, unknown>> {\n\t/**\n\t * Sets the context with the provided update and invokes the optional callback function.\n\t *\n\t * @param update - The partial update to be applied to the context.\n\t * @param callback - An optional callback function that receives the updated context.\n\t */\n\tsetContext: (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => void;\n\n\t/**\n\t * Gets the current context.\n\t *\n\t * @returns The current context.\n\t */\n\tgetContext: () => ContextType<T>;\n\n\t/**\n\t * Subscribes to context updates.\n\t *\n\t * @param subscription - The subscription object that defines the callback function to be invoked on context updates.\n\t */\n\tsubscribe: (subscription: ContextSubscription<T>) => void;\n}\n\n/**\n * It creates a context provider that allows setting and getting the context,\n * It will also be in charge of notifying the subscribers when the context changes.\n *\n * @template T - The type of the context.\n * @implements IContextProvider\n *\n * @example\n * ```ts\n * export class MyElement extends RadiantElement {\n * provider = new ContextProvider<typeof myContext>(this, {\n * context: myContext,\n * initialValue: {\n * value: 'Hello World',\n * },\n * });\n * ```\n */\nexport class ContextProvider<T extends Context<unknown, unknown>>\n\timplements IContextProvider<T>, SsrSerializableContextProvider\n{\n\tprivate host: RadiantElement;\n\tprivate context: UnknownContext;\n\tprivate hydrationKey?: string;\n\tprivate hydrate?: AttributeTypeConstant;\n\tprivate serialize?: (value: ContextType<T>) => unknown;\n\tprivate pendingHostHydration: boolean;\n\tprivate value: ContextType<T> | undefined;\n\n\tsubscriptions: ContextSubscription<T>[] = [];\n\n\t/**\n\t * Creates a new instance of the ContextProvider.\n\t *\n\t * @param host - The host element that will contain the context provider.\n\t * @param options - The options to configure the context provider.\n\t */\n\tconstructor(host: RadiantElement, options: ContextProviderOptions<T>) {\n\t\tthis.host = host;\n\t\tthis.context = options.context;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.serialize = options.serialize;\n\t\tthis.pendingHostHydration = Boolean(options.hydrate);\n\t\tthis.value = options.initialValue as ContextType<T>;\n\t\tthis.tryHydrateFromHost();\n\n\t\tthis.registerEvents();\n\t\tthis.host.dispatchEvent(new ContextOnMountEvent(this.context));\n\t}\n\n\tsetContext = (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => {\n\t\tthis.tryHydrateFromHost();\n\t\tthis.pendingHostHydration = false;\n\n\t\tif (typeof this.value === 'undefined' && this.isObject(update)) {\n\t\t\tconst oldContext = this.value;\n\t\t\tthis.value = { ...update } as ContextType<T>;\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isObject(this.value) && this.isObject(update)) {\n\t\t\tconst oldContext = { ...this.value };\n\t\t\tthis.value = { ...this.value, ...update };\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t}\n\t};\n\n\tgetContext = () => {\n\t\tthis.tryHydrateFromHost();\n\t\treturn this.value as ContextType<T>;\n\t};\n\n\t/**\n\t * Returns the provider's logical context token.\n\t *\n\t * SSR helpers use this token to resolve the closest matching provider while a\n\t * host subtree is being serialized.\n\t */\n\tgetContextKey = () => {\n\t\treturn this.context;\n\t};\n\n\t/**\n\t * Serializes the current provider value for inclusion in a hydration script.\n\t *\n\t * The serialized payload is JSON-escaped so it can be embedded safely inside a\n\t * `<script type=\"application/json\">` tag.\n\t */\n\tserializeHydrationValue = (): string | undefined => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (!this.hydrate || typeof this.value === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst hydrationValue = this.serialize ? this.serialize(this.value) : this.value;\n\n\t\tif (typeof hydrationValue === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(hydrationValue);\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeContextHydrationJson(serializedValue);\n\t};\n\n\t/**\n\t * Builds the raw HTML hydration script for this provider.\n\t *\n\t * When `hydrationKey` is present, the marker is scoped so sibling or nested\n\t * providers can recover their own payloads without accidentally reading a\n\t * descendant script.\n\t */\n\trenderHydrationScriptTag = (): string | undefined => {\n\t\tconst serializedValue = this.serializeHydrationValue();\n\n\t\tif (!serializedValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createContextHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t};\n\n\t/**\n\t * Wraps the provider hydration script in a minimal JSX node-like value.\n\t *\n\t * This lets JSX-based host renderers append the script without needing a real\n\t * DOM element instance during SSR.\n\t */\n\trenderHydrationScript = (): JsxRenderable | undefined => {\n\t\tconst outerHTML = this.renderHydrationScriptTag();\n\n\t\tif (!outerHTML) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createMarkupNodeLike(outerHTML);\n\t};\n\n\tsubscribe = ({ select, callback }: ContextSubscription<T>) => {\n\t\tthis.subscriptions.push({ select, callback });\n\t};\n\n\tprivate tryHydrateFromHost(): void {\n\t\tif (!this.pendingHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value = this.mergeHydrationValue(\n\t\t\tparseHydrationPayload(hydrationScriptElement, this.value) as ContextType<T>,\n\t\t);\n\t\tthis.pendingHostHydration = false;\n\t}\n\n\tprivate mergeHydrationValue(parsedHydrationValue: ContextType<T>): ContextType<T> {\n\t\tif (\n\t\t\tthis.hydrate === Object &&\n\t\t\tthis.isObject(parsedHydrationValue) &&\n\t\t\t(this.isObject(this.value) || typeof this.value === 'undefined')\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...(this.value ?? {}),\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as ContextType<T>;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate isObject(value: unknown): value is Record<string, unknown> {\n\t\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\treturn findHydrationScript(this.host as Element, 'context', this.hydrationKey);\n\t}\n\n\tprivate notifySubscribers = (newContext: ContextType<T>, prevContext: ContextType<T> | undefined) => {\n\t\tfor (const sub of this.subscriptions) {\n\t\t\tif (!sub.select || typeof prevContext === 'undefined') {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst newSelected = sub.select(newContext);\n\t\t\tconst prevSelected = sub.select(prevContext);\n\t\t\tif (newSelected !== prevSelected) {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate sendSubscriptionUpdate = ({ select, callback }: ContextSubscription<T>, context: ContextType<T>) => {\n\t\tif (!select) callback(context);\n\t\telse callback(select(context));\n\t};\n\n\tprivate handleSubscriptionRequest = ({\n\t\tselect,\n\t\tcallback,\n\t\tsubscribe,\n\t}: {\n\t\tselect?: ContextSubscription<T>['select'];\n\t\tcallback: ContextSubscription<T>['callback'];\n\t\tsubscribe?: boolean;\n\t}) => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (subscribe) this.subscribe({ select, callback });\n\n\t\tif (typeof this.value === 'undefined') return;\n\n\t\tif (select) {\n\t\t\tcallback(select(this.value));\n\t\t} else {\n\t\t\tcallback(this.value as ContextType<T>);\n\t\t}\n\t};\n\n\tprivate onSubscriptionRequest = (event: ContextSubscriptionRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback, subscribe, select, target } = event;\n\t\tif (context !== this.context) return;\n\n\t\tevent.stopPropagation();\n\n\t\t(target as HTMLElement).dispatchEvent(new ContextOnMountEvent(this.context));\n\n\t\tthis.handleSubscriptionRequest({ select, callback, subscribe });\n\t};\n\n\tprivate onContextRequest = (event: ContextRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback } = event;\n\t\tif (context !== this.context) return;\n\t\tevent.stopPropagation();\n\t\tcallback(this);\n\t};\n\n\tprivate registerEvents = () => {\n\t\tthis.host.addEventListener(ContextEventsTypes.SUBSCRIPTION_REQUEST, this.onSubscriptionRequest);\n\t\tthis.host.addEventListener(ContextEventsTypes.CONTEXT_REQUEST, this.onContextRequest);\n\t};\n}\n"
6
+ ],
7
+ "mappings": "oJAAA,yBAAS,gBA8EF,MAAM,CAEb,CACS,KACA,QACA,aACA,QACA,UACA,qBACA,MAER,cAA0C,CAAC,EAQ3C,WAAW,CAAC,EAAsB,EAAoC,CACrE,KAAK,KAAO,EACZ,KAAK,QAAU,EAAQ,QACvB,KAAK,aAAe,EAAQ,aAC5B,KAAK,QAAU,EAAQ,QACvB,KAAK,UAAY,EAAQ,UACzB,KAAK,qBAAuB,QAAQ,EAAQ,OAAO,EACnD,KAAK,MAAQ,EAAQ,aACrB,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACpB,KAAK,KAAK,cAAc,IAAI,EA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,EACzD,GAAI,IAAY,KAAK,QAAS,OAE9B,EAAM,gBAAgB,EAErB,EAAuB,cAAc,IAAI,EAAoB,KAAK,OAAO,CAAC,EAE3E,KAAK,0BAA0B,CAAE,SAAQ,WAAU,WAAU,CAAC,GAGvD,iBAAmB,CAAC,IAA+C,CAC1E,IAAQ,UAAS,YAAa,EAC9B,GAAI,IAAY,KAAK,QAAS,OAC9B,EAAM,gBAAgB,EACtB,EAAS,IAAI,GAGN,eAAiB,IAAM,CAC9B,KAAK,KAAK,gDAA0D,KAAK,qBAAqB,EAC9F,KAAK,KAAK,mCAAqD,KAAK,gBAAgB,EAEtF",
8
+ "debugId": "12954678E1A01CDC64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{render as q}from"@ecopages/jsx";function w(f,k){q(f,k)}
2
+ export{w as a};
3
+
4
+ //# debugId=72CAF556CCD84FB264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/tools/render-jsx-template.ts"],
4
+ "sourcesContent": [
5
+ "import { render, type TemplateResultLike } from '@ecopages/jsx';\n\n/**\n * Renders a JSX template result into a target element by replacing its children.\n */\nexport function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void {\n\trender(template, target);\n}\n"
6
+ ],
7
+ "mappings": "AAAA,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM",
8
+ "debugId": "72CAF556CCD84FB264756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{ob as q}from"./chunk-42tyhfvh.js";function G(z){return function(B,j){j.addInitializer(function(){let A=q(this,z);Object.defineProperty(this,j.name,{get(){return A},enumerable:!0,configurable:!0})})}}
2
+ export{G as pa};
3
+
4
+ //# debugId=EFCF60DE04E1548464756E2164756E21