@jucie.io/cli 1.0.9 → 1.0.20

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 (629) hide show
  1. package/dist/jucie.js +223 -163
  2. package/dist/stage/chunks/addAction-3QC2Z4ZR.js +1 -0
  3. package/dist/stage/chunks/addAnimationBinding-N3UW27JM.js +1 -0
  4. package/dist/stage/chunks/addAttribute-MEJIGMHV.js +1 -0
  5. package/dist/stage/chunks/addComponent-AQQI46C3.js +1 -0
  6. package/dist/stage/chunks/addComputed-2JNIUCEP.js +1 -0
  7. package/dist/stage/chunks/addEvent-PN6P6KR5.js +1 -0
  8. package/dist/stage/chunks/addLifecycleHook-D2UKKFVW.js +1 -0
  9. package/dist/stage/chunks/addNode-UXIXDXSD.js +1 -0
  10. package/dist/stage/chunks/addOption-AFCUFOT7.js +1 -0
  11. package/dist/stage/chunks/addParamToRoute-6LOHCID7.js +1 -0
  12. package/dist/stage/chunks/addState-RSEYKWQO.js +1 -0
  13. package/dist/stage/chunks/addStore-AK2FTEON.js +1 -0
  14. package/dist/stage/chunks/addToken-35LUBJPE.js +1 -0
  15. package/dist/stage/chunks/addTree-CU7MJAKT.js +1 -0
  16. package/dist/stage/chunks/addValue-LIQSHZFR.js +1 -0
  17. package/dist/stage/chunks/{aiAttachmentContracts-4GX7AD4P.js → aiAttachmentContracts-KGD3EHZQ.js} +1 -1
  18. package/dist/stage/chunks/{aiMessagesContracts-3IZEU24J.js → aiMessagesContracts-QWUORKI3.js} +1 -1
  19. package/dist/stage/chunks/aiRelay-LW2UZKRR.js +1 -0
  20. package/dist/stage/chunks/{aiSessionContracts-SCDHZZA3.js → aiSessionContracts-RQKGQY4N.js} +1 -1
  21. package/dist/stage/chunks/assets-5J5INILR.js +1 -0
  22. package/dist/stage/chunks/capture-VQE5664P.js +1 -0
  23. package/dist/stage/chunks/{chunk-GG4NWMR6.js → chunk-2JXGTRSC.js} +1 -1
  24. package/dist/stage/chunks/{chunk-BS35FNXF.js → chunk-3GPQ3HYG.js} +1 -1
  25. package/dist/stage/chunks/chunk-3KR3JD5T.js +1 -0
  26. package/dist/stage/chunks/chunk-457GNGEV.js +1 -0
  27. package/dist/stage/chunks/chunk-4KXBOJIC.js +1 -0
  28. package/dist/stage/chunks/chunk-4UJAZNZX.js +1 -0
  29. package/dist/stage/chunks/{chunk-TS6FANUG.js → chunk-5N7NET6A.js} +1 -1
  30. package/dist/stage/chunks/chunk-5RVLCYPU.js +1 -0
  31. package/dist/stage/chunks/chunk-6JNM2JPA.js +1 -0
  32. package/dist/stage/chunks/{chunk-SRRJXNKG.js → chunk-7C53OCBB.js} +1 -1
  33. package/dist/stage/chunks/chunk-7DIGILX7.js +1 -0
  34. package/dist/stage/chunks/{chunk-LOMYBRPE.js → chunk-7H7BUWZP.js} +1 -1
  35. package/dist/stage/chunks/chunk-7SM7WG53.js +1 -0
  36. package/dist/stage/chunks/{chunk-6ZZBJPN5.js → chunk-A7T3U7OZ.js} +1 -1
  37. package/dist/stage/chunks/chunk-AOLXVYBO.js +1 -0
  38. package/dist/stage/chunks/{chunk-OB6WEYNB.js → chunk-ATDHO5ME.js} +1 -1
  39. package/dist/stage/chunks/{chunk-V4F2T2VR.js → chunk-BCDDG7CW.js} +1 -1
  40. package/dist/stage/chunks/chunk-CB4COXKW.js +1 -0
  41. package/dist/stage/chunks/{chunk-4XNQRZ5E.js → chunk-CM6UENYI.js} +1 -1
  42. package/dist/stage/chunks/{chunk-K6PCHHH7.js → chunk-CVWMERPH.js} +1 -1
  43. package/dist/stage/chunks/{chunk-XKEDVW6X.js → chunk-DDCGP5GM.js} +1 -1
  44. package/dist/stage/chunks/chunk-DOGIABU3.js +1 -0
  45. package/dist/stage/chunks/{chunk-SMO45CB3.js → chunk-DUMMXI6I.js} +1 -1
  46. package/dist/stage/chunks/{chunk-HI7ALMQD.js → chunk-E3LBHSMZ.js} +1 -1
  47. package/dist/stage/chunks/chunk-E7JXTPFA.js +1 -0
  48. package/dist/stage/chunks/chunk-GBE5QYRO.js +1 -0
  49. package/dist/stage/chunks/{chunk-BEYPHEBR.js → chunk-GFV4SJGI.js} +1 -1
  50. package/dist/stage/chunks/{chunk-NYG3CJEJ.js → chunk-GILBTTLF.js} +1 -1
  51. package/dist/stage/chunks/chunk-GPV2ZFME.js +1 -0
  52. package/dist/stage/chunks/chunk-HBNF34QX.js +1 -0
  53. package/dist/stage/chunks/{chunk-GIVV5ZCM.js → chunk-HREW6EFQ.js} +1 -1
  54. package/dist/stage/chunks/chunk-HZ7KMV42.js +1 -0
  55. package/dist/stage/chunks/{chunk-U2OFNNHI.js → chunk-HZXJUIIX.js} +1 -1
  56. package/dist/stage/chunks/{chunk-5SOTDESD.js → chunk-IE6IKN6P.js} +1 -1
  57. package/dist/stage/chunks/chunk-IWO4MU2F.js +1 -0
  58. package/dist/stage/chunks/chunk-J7XIIFXF.js +1 -0
  59. package/dist/stage/chunks/chunk-JG62FTV2.js +1 -0
  60. package/dist/stage/chunks/{chunk-L7VQYHXR.js → chunk-JGELXWD3.js} +1 -1
  61. package/dist/stage/chunks/chunk-JKJRK7ER.js +1 -0
  62. package/dist/stage/chunks/{chunk-PU3DZ3MV.js → chunk-JPPPL527.js} +1 -1
  63. package/dist/stage/chunks/chunk-JRCZXEL2.js +1 -0
  64. package/dist/stage/chunks/{chunk-ODSNVDNS.js → chunk-K33QXMAS.js} +1 -1
  65. package/dist/stage/chunks/{chunk-EPBR3BES.js → chunk-K4R2DLAT.js} +1 -1
  66. package/dist/stage/chunks/{chunk-C3DY5XVP.js → chunk-MA3WBBC6.js} +1 -1
  67. package/dist/stage/chunks/chunk-MHU6JTZC.js +1 -0
  68. package/dist/stage/chunks/{chunk-D6NZE747.js → chunk-MO2MHTOQ.js} +1 -1
  69. package/dist/stage/chunks/chunk-MQKISAKO.js +1 -0
  70. package/dist/stage/chunks/{chunk-ARGFDBBK.js → chunk-ND3BSJOS.js} +1 -1
  71. package/dist/stage/chunks/chunk-NGQ7GQSH.js +1 -0
  72. package/dist/stage/chunks/{chunk-VQ7C6EUZ.js → chunk-NM4FV6YK.js} +1 -1
  73. package/dist/stage/chunks/chunk-NOHQVE3L.js +1 -0
  74. package/dist/stage/chunks/{chunk-MLL2ANA6.js → chunk-O6ZKHW5L.js} +1 -1
  75. package/dist/stage/chunks/{chunk-GDGHGTYN.js → chunk-PBDA5G7U.js} +1 -1
  76. package/dist/stage/chunks/{chunk-RZ74UWF3.js → chunk-PBDSKQIQ.js} +1 -1
  77. package/dist/stage/chunks/chunk-PJFVW637.js +1 -0
  78. package/dist/stage/chunks/{chunk-AJVQKPCQ.js → chunk-PRXT2NXZ.js} +1 -1
  79. package/dist/stage/chunks/chunk-QAUB5H3S.js +1 -0
  80. package/dist/stage/chunks/{chunk-BVAPODQ7.js → chunk-QDH6OIAL.js} +1 -1
  81. package/dist/stage/chunks/{chunk-TEUB5MUS.js → chunk-QM4IVTLC.js} +1 -1
  82. package/dist/stage/chunks/chunk-QUWCLSNF.js +1 -0
  83. package/dist/stage/chunks/{chunk-P3WBUN2B.js → chunk-QVOXRLEG.js} +1 -1
  84. package/dist/stage/chunks/chunk-RAHM76FI.js +1 -0
  85. package/dist/stage/chunks/chunk-RONEQF2M.js +1 -0
  86. package/dist/stage/chunks/{chunk-V7BNWQS6.js → chunk-RPTOBIKP.js} +1 -1
  87. package/dist/stage/chunks/{chunk-LR6DSVPP.js → chunk-RSWDPV5U.js} +1 -1
  88. package/dist/stage/chunks/chunk-SSSTBYOF.js +1 -0
  89. package/dist/stage/chunks/{chunk-OPVVANFS.js → chunk-SV2PSWLZ.js} +1 -1
  90. package/dist/stage/chunks/{chunk-LKQDYABR.js → chunk-TDXJNI7H.js} +1 -1
  91. package/dist/stage/chunks/chunk-TFGNKPAQ.js +1 -0
  92. package/dist/stage/chunks/chunk-TYA35RCB.js +1 -0
  93. package/dist/stage/chunks/{chunk-TBDEUSP4.js → chunk-UJZNQZVK.js} +1 -1
  94. package/dist/stage/chunks/{chunk-5PUPZLDN.js → chunk-UN7EZPD7.js} +1 -1
  95. package/dist/stage/chunks/chunk-UOBNXO4G.js +1 -0
  96. package/dist/stage/chunks/chunk-UVV4NANW.js +97 -0
  97. package/dist/stage/chunks/{chunk-5OOKGI32.js → chunk-V5TNO5LS.js} +1 -1
  98. package/dist/stage/chunks/chunk-VHRU6H4C.js +1 -0
  99. package/dist/stage/chunks/chunk-VP2XJ5UI.js +1 -0
  100. package/dist/stage/chunks/{chunk-ZCAGAEP2.js → chunk-VQDQA3ID.js} +1 -1
  101. package/dist/stage/chunks/chunk-VZJTFJZN.js +1 -0
  102. package/dist/stage/chunks/chunk-WCL6XNDN.js +1 -0
  103. package/dist/stage/chunks/chunk-WKUYNMPE.js +1 -0
  104. package/dist/stage/chunks/chunk-WWWIZ7VG.js +1 -0
  105. package/dist/stage/chunks/{chunk-QG2BGE2O.js → chunk-X2R3VYWI.js} +1 -1
  106. package/dist/stage/chunks/{chunk-CVDUFBBG.js → chunk-X5HHNNED.js} +1 -1
  107. package/dist/stage/chunks/{chunk-ZEWKYCOX.js → chunk-X5INDUEQ.js} +1 -1
  108. package/dist/stage/chunks/chunk-XBUV5F3F.js +1 -0
  109. package/dist/stage/chunks/{chunk-HBEWYDHO.js → chunk-XPWU54SD.js} +1 -1
  110. package/dist/stage/chunks/chunk-YFURTAAV.js +1 -0
  111. package/dist/stage/chunks/chunk-YRI4I37X.js +1 -0
  112. package/dist/stage/chunks/chunk-ZCUNR3XN.js +1 -0
  113. package/dist/stage/chunks/clearDestination-TFFJZYZU.js +1 -0
  114. package/dist/stage/chunks/clearName-LAT5C4G3.js +1 -0
  115. package/dist/stage/chunks/clearOptionsExpression-QHE4GD2Y.js +1 -0
  116. package/dist/stage/chunks/clearRender-XEMKLRCM.js +1 -0
  117. package/dist/stage/chunks/clearRepeat-OJXLCGGV.js +1 -0
  118. package/dist/stage/chunks/contentEditor-H4QUMYKV.js +1 -0
  119. package/dist/stage/chunks/createAction-X7WWJ6BN.js +1 -0
  120. package/dist/stage/chunks/createAnimation-TYRSVQNL.js +1 -0
  121. package/dist/stage/chunks/createComputed-NVI2BGGF.js +1 -0
  122. package/dist/stage/chunks/createTextContent-R4ZOE6SM.js +1 -0
  123. package/dist/stage/chunks/createValue-GRZQQ5RR.js +1 -0
  124. package/dist/stage/chunks/design-2S7QAGYM.js +15 -0
  125. package/dist/stage/chunks/dev-PZI3DDXQ.js +1 -0
  126. package/dist/stage/chunks/disconnectNode-RRO6QPMX.js +1 -0
  127. package/dist/stage/chunks/{history-BNHS2T3X.js → history-5FAKKGJY.js} +1 -1
  128. package/dist/stage/chunks/{id-T5EU463K.js → id-G47WSCWG.js} +1 -1
  129. package/dist/stage/chunks/main-GPY4VWAB.js +1 -0
  130. package/dist/stage/chunks/{main-TUNP7F4N.js → main-OLXPOBOM.js} +1 -1
  131. package/dist/stage/chunks/{main-DDWQFH23.js → main-QADVRVCC.js} +1 -1
  132. package/dist/stage/chunks/main-RMI3HY2B.js +1 -0
  133. package/dist/stage/chunks/moveNodeToLastChildOf-SGHEMUMS.js +1 -0
  134. package/dist/stage/chunks/{nodeGraph-ZXVLUHBH.js → nodeGraph-UGMYCUUO.js} +1 -1
  135. package/dist/stage/chunks/{normalizeEventName-6HVMB5GN.js → normalizeEventName-Y34QRO25.js} +1 -1
  136. package/dist/stage/chunks/preview-UBVA3QQU.js +1 -0
  137. package/dist/stage/chunks/removeAction-UIZVYC4K.js +1 -0
  138. package/dist/stage/chunks/removeAnimationBinding-PD2IRVQZ.js +1 -0
  139. package/dist/stage/chunks/removeAttribute-HCDVVDSZ.js +1 -0
  140. package/dist/stage/chunks/removeComputed-2UWAXEAM.js +1 -0
  141. package/dist/stage/chunks/removeEvent-GBW7REQV.js +1 -0
  142. package/dist/stage/chunks/removeLifecycleHook-V4BK7NPV.js +1 -0
  143. package/dist/stage/chunks/removeNode-H7TWCLTZ.js +1 -0
  144. package/dist/stage/chunks/removeOption-4SMMGXLO.js +1 -0
  145. package/dist/stage/chunks/removeParamFromRoute-2Q2PYYP5.js +1 -0
  146. package/dist/stage/chunks/removeState-X4UQTIPT.js +1 -0
  147. package/dist/stage/chunks/removeStore-B3WQQP3D.js +1 -0
  148. package/dist/stage/chunks/removeToken-3QTFHQF6.js +1 -0
  149. package/dist/stage/chunks/removeValue-QIQBSOHR.js +1 -0
  150. package/dist/stage/chunks/setDestination-26OTLIOX.js +1 -0
  151. package/dist/stage/chunks/setHomePage-GBSAVDQC.js +1 -0
  152. package/dist/stage/chunks/setHtmlId-PZQQWCXU.js +1 -0
  153. package/dist/stage/chunks/setName-C26SXODP.js +1 -0
  154. package/dist/stage/chunks/setNodeLayout-PZMYT6M2.js +1 -0
  155. package/dist/stage/chunks/setOptionsExpression-PQ3JOVEW.js +1 -0
  156. package/dist/stage/chunks/setRender-MNCOTE35.js +1 -0
  157. package/dist/stage/chunks/setRepeat-GIOC7YT4.js +1 -0
  158. package/dist/stage/chunks/setTagName-FA7BMEUS.js +1 -0
  159. package/dist/stage/chunks/updateAction-TUQLHSJE.js +1 -0
  160. package/dist/stage/chunks/updateAnimationBinding-I3AQNLO2.js +1 -0
  161. package/dist/stage/chunks/updateAttribute-TLLDGUPR.js +1 -0
  162. package/dist/stage/chunks/updateBounds-KL4N7VYO.js +1 -0
  163. package/dist/stage/chunks/updateComputed-JGJIIC4A.js +1 -0
  164. package/dist/stage/chunks/updateEvent-YOKH67TX.js +1 -0
  165. package/dist/stage/chunks/updateHtml-Z4XI7SYU.js +1 -0
  166. package/dist/stage/chunks/updateLifecycleHook-4555YGGM.js +1 -0
  167. package/dist/stage/chunks/updateOption-YUFQYF43.js +1 -0
  168. package/dist/stage/chunks/updateRoute-42OSDVLS.js +1 -0
  169. package/dist/stage/chunks/updateState-3RQX5YED.js +1 -0
  170. package/dist/stage/chunks/updateStyle-I5NO4TOV.js +1 -0
  171. package/dist/stage/chunks/updateToken-AFJYTJ7R.js +1 -0
  172. package/dist/stage/chunks/updateValue-XGRBUCOT.js +1 -0
  173. package/dist/stage/chunks/{user-LKHAFHX4.js → user-CK5IAVFH.js} +1 -1
  174. package/dist/stage/chunks/{validateStorePayload-PJ5AD64S.js → validateStorePayload-3HAVFGVL.js} +1 -1
  175. package/dist/stage/chunks/{viewport-ANZ3RTUP.js → viewport-CQRIOXC6.js} +1 -1
  176. package/dist/stage/chunks/window-7JZPBAP7.js +1 -0
  177. package/dist/stage/design.js +1 -1
  178. package/dist/stage/dev.js +1 -1
  179. package/dist/stage/preview.js +1 -1
  180. package/dist/stage/prod.js +1 -1
  181. package/dist/stage-bundles/preact/chunks/addComponent-3JC5NC3Y.js +1 -0
  182. package/dist/stage-bundles/preact/chunks/addNode-QXU2P4AE.js +1 -0
  183. package/dist/stage-bundles/preact/chunks/addTree-S73GXWZP.js +1 -0
  184. package/dist/stage-bundles/{vue/chunks/aiAttachmentContracts-V3EW4BHI.js → preact/chunks/aiAttachmentContracts-7LLE57FI.js} +1 -1
  185. package/dist/stage-bundles/{vue/chunks/aiMessagesContracts-ZGHZJ7EU.js → preact/chunks/aiMessagesContracts-RAR7ENH4.js} +1 -1
  186. package/dist/stage-bundles/preact/chunks/aiRelay-C6ZJ3PUF.js +1 -0
  187. package/dist/stage-bundles/preact/chunks/{aiSessionContracts-WAMOGHSG.js → aiSessionContracts-NHU57TUZ.js} +1 -1
  188. package/dist/stage-bundles/preact/chunks/assets-6LM3GVQU.js +1 -0
  189. package/dist/stage-bundles/preact/chunks/capture-ON3BO6WE.js +1 -0
  190. package/dist/stage-bundles/preact/chunks/chunk-2Z2RXHNK.js +1 -0
  191. package/dist/stage-bundles/preact/chunks/chunk-3WCN6R5H.js +1 -0
  192. package/dist/stage-bundles/preact/chunks/chunk-45YNKT2X.js +1 -0
  193. package/dist/stage-bundles/preact/chunks/chunk-4Q5R44ZZ.js +1 -0
  194. package/dist/stage-bundles/preact/chunks/chunk-7I5TQOE2.js +1 -0
  195. package/dist/stage-bundles/preact/chunks/chunk-7YVQSQRP.js +1 -0
  196. package/dist/stage-bundles/preact/chunks/chunk-AOGIMUZ2.js +103 -0
  197. package/dist/stage-bundles/preact/chunks/chunk-BGQJ5B3Q.js +1 -0
  198. package/dist/stage-bundles/preact/chunks/chunk-CGCD6S33.js +6 -0
  199. package/dist/stage-bundles/preact/chunks/chunk-DWW3567Q.js +1 -0
  200. package/dist/stage-bundles/preact/chunks/chunk-G3PYA3EU.js +1 -0
  201. package/dist/stage-bundles/preact/chunks/chunk-H5NHEM4C.js +1 -0
  202. package/dist/stage-bundles/preact/chunks/chunk-IG2Y3H6O.js +1 -0
  203. package/dist/stage-bundles/preact/chunks/chunk-IWTWZA3T.js +1 -0
  204. package/dist/stage-bundles/preact/chunks/chunk-LXD22ETU.js +1 -0
  205. package/dist/stage-bundles/preact/chunks/chunk-M577WNTV.js +1 -0
  206. package/dist/stage-bundles/preact/chunks/chunk-NFKUJQZH.js +1 -0
  207. package/dist/stage-bundles/preact/chunks/chunk-NKDO4J6J.js +1 -0
  208. package/dist/stage-bundles/preact/chunks/chunk-SCJKRPIZ.js +1 -0
  209. package/dist/stage-bundles/preact/chunks/{chunk-O24ISLGT.js → chunk-ULVFWUAU.js} +1 -1
  210. package/dist/stage-bundles/preact/chunks/contentEditor-7BYCT3TH.js +1 -0
  211. package/dist/stage-bundles/preact/chunks/design-3DHGUCPX.js +15 -0
  212. package/dist/stage-bundles/preact/chunks/{history-VAAFKC4E.js → history-CMF3VYTT.js} +1 -1
  213. package/dist/stage-bundles/preact/chunks/main-3VRCGPRY.js +1 -0
  214. package/dist/stage-bundles/preact/chunks/{main-KFGWT6OT.js → main-DH4JOS22.js} +1 -1
  215. package/dist/stage-bundles/preact/chunks/{main-MVCLW2IY.js → main-FAFZABOS.js} +1 -1
  216. package/dist/stage-bundles/preact/chunks/main-S7RT75O6.js +1 -0
  217. package/dist/stage-bundles/preact/chunks/moveNodeToLastChildOf-CWSWITHI.js +1 -0
  218. package/dist/stage-bundles/preact/chunks/{nodeGraph-JS64VAAQ.js → nodeGraph-UNI2HUNX.js} +1 -1
  219. package/dist/stage-bundles/preact/chunks/preview-YOYSHYJF.js +1 -0
  220. package/dist/stage-bundles/preact/chunks/setNodeLayout-KQVZJBYW.js +1 -0
  221. package/dist/stage-bundles/preact/chunks/{user-FCPIGR7X.js → user-H5DKMGWA.js} +1 -1
  222. package/dist/stage-bundles/preact/chunks/{viewport-LLBH2LJW.js → viewport-ZRWTVYC3.js} +1 -1
  223. package/dist/stage-bundles/preact/chunks/window-IMPT5I3D.js +1 -0
  224. package/dist/stage-bundles/preact/entry.js +1 -1
  225. package/dist/stage-bundles/preact/framework-compat.js +1 -1
  226. package/dist/stage-bundles/preact/framework-hooks.js +1 -1
  227. package/dist/stage-bundles/preact/framework-jsx-runtime.js +1 -1
  228. package/dist/stage-bundles/preact/framework.js +1 -1
  229. package/dist/stage-bundles/preact/sdk.js +1 -1
  230. package/dist/stage-bundles/react/chunks/{addAction-BMIMOFKC.js → addAction-EGLGEGTS.js} +1 -1
  231. package/dist/stage-bundles/react/chunks/addAnimationBinding-WCB5VZLU.js +1 -0
  232. package/dist/stage-bundles/react/chunks/{addAttribute-2WJG6MQQ.js → addAttribute-2MZ3OFUE.js} +1 -1
  233. package/dist/stage-bundles/react/chunks/addComponent-3JC5NC3Y.js +1 -0
  234. package/dist/stage-bundles/react/chunks/{addComputed-WNYOBBU3.js → addComputed-7JLBFD6I.js} +1 -1
  235. package/dist/stage-bundles/react/chunks/{addEvent-KKSUEWJZ.js → addEvent-HOBNKM2F.js} +1 -1
  236. package/dist/stage-bundles/react/chunks/{addLifecycleHook-KXJ6HEKQ.js → addLifecycleHook-GHYL7FRH.js} +1 -1
  237. package/dist/stage-bundles/react/chunks/addNode-QXU2P4AE.js +1 -0
  238. package/dist/stage-bundles/react/chunks/{addOption-6OBUAJDH.js → addOption-PVXGN7AJ.js} +1 -1
  239. package/dist/stage-bundles/react/chunks/addParamToRoute-VL2VOFZS.js +1 -0
  240. package/dist/stage-bundles/react/chunks/{addState-BH7Q5V6N.js → addState-U2NWEGWV.js} +1 -1
  241. package/dist/stage-bundles/react/chunks/addStore-AQMFKH33.js +1 -0
  242. package/dist/stage-bundles/react/chunks/{addToken-DFONVP3M.js → addToken-XF2FFA52.js} +1 -1
  243. package/dist/stage-bundles/react/chunks/addTree-S73GXWZP.js +1 -0
  244. package/dist/stage-bundles/react/chunks/{addValue-6SJ7KR7G.js → addValue-O7YXXMST.js} +1 -1
  245. package/dist/stage-bundles/{preact/chunks/aiAttachmentContracts-V3EW4BHI.js → react/chunks/aiAttachmentContracts-7LLE57FI.js} +1 -1
  246. package/dist/stage-bundles/{preact/chunks/aiMessagesContracts-ZGHZJ7EU.js → react/chunks/aiMessagesContracts-RAR7ENH4.js} +1 -1
  247. package/dist/stage-bundles/react/chunks/aiRelay-C6ZJ3PUF.js +1 -0
  248. package/dist/stage-bundles/{vue/chunks/aiSessionContracts-WAMOGHSG.js → react/chunks/aiSessionContracts-NHU57TUZ.js} +1 -1
  249. package/dist/stage-bundles/react/chunks/assets-6LM3GVQU.js +1 -0
  250. package/dist/stage-bundles/react/chunks/capture-6GFKGXIT.js +1 -0
  251. package/dist/stage-bundles/react/chunks/chunk-2Z2RXHNK.js +1 -0
  252. package/dist/stage-bundles/react/chunks/chunk-3WCN6R5H.js +1 -0
  253. package/dist/stage-bundles/react/chunks/chunk-45YNKT2X.js +1 -0
  254. package/dist/stage-bundles/react/chunks/chunk-4Q5R44ZZ.js +1 -0
  255. package/dist/stage-bundles/react/chunks/chunk-7I5TQOE2.js +1 -0
  256. package/dist/stage-bundles/react/chunks/chunk-7YVQSQRP.js +1 -0
  257. package/dist/stage-bundles/react/chunks/chunk-BGQJ5B3Q.js +1 -0
  258. package/dist/stage-bundles/react/chunks/chunk-CGCD6S33.js +6 -0
  259. package/dist/stage-bundles/react/chunks/chunk-G3PYA3EU.js +1 -0
  260. package/dist/stage-bundles/react/chunks/{chunk-5HITMZZP.js → chunk-G5RN6RXS.js} +1 -1
  261. package/dist/stage-bundles/react/chunks/chunk-HJOMUN4M.js +49 -0
  262. package/dist/stage-bundles/react/chunks/chunk-IG2Y3H6O.js +1 -0
  263. package/dist/stage-bundles/react/chunks/chunk-IWTWZA3T.js +1 -0
  264. package/dist/stage-bundles/react/chunks/{chunk-FCMIFWSU.js → chunk-KLPU3QNW.js} +1 -1
  265. package/dist/stage-bundles/react/chunks/chunk-LXD22ETU.js +1 -0
  266. package/dist/stage-bundles/react/chunks/chunk-M577WNTV.js +1 -0
  267. package/dist/stage-bundles/react/chunks/chunk-NFKUJQZH.js +1 -0
  268. package/dist/stage-bundles/react/chunks/chunk-NKDO4J6J.js +1 -0
  269. package/dist/stage-bundles/react/chunks/{chunk-76SRFCJO.js → chunk-P3ZDKQWG.js} +1 -1
  270. package/dist/stage-bundles/react/chunks/chunk-SCJKRPIZ.js +1 -0
  271. package/dist/stage-bundles/react/chunks/chunk-U66LRTNF.js +1 -0
  272. package/dist/stage-bundles/react/chunks/chunk-UCLSDDOL.js +1 -0
  273. package/dist/stage-bundles/{vue/chunks/chunk-O24ISLGT.js → react/chunks/chunk-ULVFWUAU.js} +1 -1
  274. package/dist/stage-bundles/react/chunks/clearDestination-IGKNL7FN.js +1 -0
  275. package/dist/stage-bundles/react/chunks/clearName-HJ7ZTHBU.js +1 -0
  276. package/dist/stage-bundles/react/chunks/clearOptionsExpression-NZQFL64E.js +1 -0
  277. package/dist/stage-bundles/react/chunks/clearRender-NPVDTNFA.js +1 -0
  278. package/dist/stage-bundles/react/chunks/clearRepeat-7YFYZODP.js +1 -0
  279. package/dist/stage-bundles/react/chunks/contentEditor-7BYCT3TH.js +1 -0
  280. package/dist/stage-bundles/react/chunks/{createAction-ITB7SY4A.js → createAction-73YUTK3T.js} +1 -1
  281. package/dist/stage-bundles/react/chunks/createAnimation-2WQSMYT5.js +1 -0
  282. package/dist/stage-bundles/react/chunks/{createComputed-BMWO4U4T.js → createComputed-DMX7CJA3.js} +1 -1
  283. package/dist/stage-bundles/react/chunks/{createTextContent-ZVU57TXU.js → createTextContent-4Z4YATBO.js} +1 -1
  284. package/dist/stage-bundles/react/chunks/createValue-DXQSLOBG.js +1 -0
  285. package/dist/stage-bundles/react/chunks/design-6KSNU4OK.js +15 -0
  286. package/dist/stage-bundles/react/chunks/{disconnectNode-PNUX55O2.js → disconnectNode-2CLWVIQP.js} +1 -1
  287. package/dist/stage-bundles/{vue/chunks/history-VAAFKC4E.js → react/chunks/history-CMF3VYTT.js} +1 -1
  288. package/dist/stage-bundles/react/chunks/{id-UUBDNSND.js → id-ZIAZZ5AS.js} +1 -1
  289. package/dist/stage-bundles/react/chunks/main-3VRCGPRY.js +1 -0
  290. package/dist/stage-bundles/{vue/chunks/main-KFGWT6OT.js → react/chunks/main-DH4JOS22.js} +1 -1
  291. package/dist/stage-bundles/react/chunks/{main-XBZULJGK.js → main-FAFZABOS.js} +1 -1
  292. package/dist/stage-bundles/react/chunks/main-S7RT75O6.js +1 -0
  293. package/dist/stage-bundles/react/chunks/moveNodeToLastChildOf-CWSWITHI.js +1 -0
  294. package/dist/stage-bundles/{vue/chunks/nodeGraph-JS64VAAQ.js → react/chunks/nodeGraph-UNI2HUNX.js} +1 -1
  295. package/dist/stage-bundles/react/chunks/{normalizeEventName-3CSULWE4.js → normalizeEventName-SNBYJDUY.js} +1 -1
  296. package/dist/stage-bundles/react/chunks/preview-KOCHK3AH.js +1 -0
  297. package/dist/stage-bundles/react/chunks/removeAction-T4M5EJN7.js +1 -0
  298. package/dist/stage-bundles/react/chunks/removeAnimationBinding-AIISPC33.js +1 -0
  299. package/dist/stage-bundles/react/chunks/removeAttribute-DCKZLM55.js +1 -0
  300. package/dist/stage-bundles/react/chunks/removeComputed-WSA5GNVZ.js +1 -0
  301. package/dist/stage-bundles/react/chunks/removeEvent-2YZ55HD6.js +1 -0
  302. package/dist/stage-bundles/react/chunks/removeLifecycleHook-SBPJNF5P.js +1 -0
  303. package/dist/stage-bundles/react/chunks/{removeNode-QSDSWHNG.js → removeNode-5HXQ63V3.js} +1 -1
  304. package/dist/stage-bundles/react/chunks/removeOption-SYIFB4XW.js +1 -0
  305. package/dist/stage-bundles/react/chunks/removeParamFromRoute-HAYP3WTT.js +1 -0
  306. package/dist/stage-bundles/react/chunks/removeState-SGJVQ66N.js +1 -0
  307. package/dist/stage-bundles/react/chunks/removeStore-YVBTGA3I.js +1 -0
  308. package/dist/stage-bundles/react/chunks/removeToken-AIDV7DUM.js +1 -0
  309. package/dist/stage-bundles/react/chunks/removeValue-UP5ZFN3U.js +1 -0
  310. package/dist/stage-bundles/react/chunks/setDestination-NCPAVIIK.js +1 -0
  311. package/dist/stage-bundles/react/chunks/setHomePage-O2JYOG6H.js +1 -0
  312. package/dist/stage-bundles/react/chunks/setHtmlId-2W7YW47O.js +1 -0
  313. package/dist/stage-bundles/react/chunks/setName-NKRZPBGG.js +1 -0
  314. package/dist/stage-bundles/react/chunks/setNodeLayout-KQVZJBYW.js +1 -0
  315. package/dist/stage-bundles/react/chunks/{setOptionsExpression-3MOFK54D.js → setOptionsExpression-K5EQXJEY.js} +1 -1
  316. package/dist/stage-bundles/react/chunks/{setRender-WJRTHRML.js → setRender-7XMGQ7ZK.js} +1 -1
  317. package/dist/stage-bundles/react/chunks/{setRepeat-JD6QROHI.js → setRepeat-WN4WZJUN.js} +1 -1
  318. package/dist/stage-bundles/react/chunks/setTagName-U6UJNJLE.js +1 -0
  319. package/dist/stage-bundles/react/chunks/{updateAction-ZW4KGOAQ.js → updateAction-3KSR6ZIJ.js} +1 -1
  320. package/dist/stage-bundles/react/chunks/updateAnimationBinding-HVVHLFBO.js +1 -0
  321. package/dist/stage-bundles/react/chunks/{updateAttribute-HFPDXXBZ.js → updateAttribute-XXZL2P43.js} +1 -1
  322. package/dist/stage-bundles/react/chunks/updateBounds-5M7YQRO3.js +1 -0
  323. package/dist/stage-bundles/react/chunks/{updateComputed-OOBDA4XY.js → updateComputed-7QA6XZIC.js} +1 -1
  324. package/dist/stage-bundles/react/chunks/{updateEvent-LCGAPMAI.js → updateEvent-R52PL2G4.js} +1 -1
  325. package/dist/stage-bundles/react/chunks/updateHtml-YBJJSWQW.js +1 -0
  326. package/dist/stage-bundles/react/chunks/{updateLifecycleHook-RCS2QC44.js → updateLifecycleHook-4RA2U4TR.js} +1 -1
  327. package/dist/stage-bundles/react/chunks/{updateOption-PPZLK4X3.js → updateOption-5U23ZUWV.js} +1 -1
  328. package/dist/stage-bundles/react/chunks/updateRoute-TFQFFFSZ.js +1 -0
  329. package/dist/stage-bundles/react/chunks/{updateState-LRZJPENX.js → updateState-JCUSBQOL.js} +1 -1
  330. package/dist/stage-bundles/react/chunks/updateStyle-JASLFXVX.js +1 -0
  331. package/dist/stage-bundles/react/chunks/updateToken-24P2P2SF.js +1 -0
  332. package/dist/stage-bundles/react/chunks/{updateValue-NTA7TSYR.js → updateValue-TSVJM3PO.js} +1 -1
  333. package/dist/stage-bundles/{vue/chunks/user-FCPIGR7X.js → react/chunks/user-H5DKMGWA.js} +1 -1
  334. package/dist/stage-bundles/react/chunks/{validateStorePayload-VVQBPX4I.js → validateStorePayload-HCBPC7HR.js} +1 -1
  335. package/dist/stage-bundles/{vue/chunks/viewport-LLBH2LJW.js → react/chunks/viewport-ZRWTVYC3.js} +1 -1
  336. package/dist/stage-bundles/react/chunks/window-IMPT5I3D.js +1 -0
  337. package/dist/stage-bundles/react/entry.js +1 -1
  338. package/dist/stage-bundles/react/framework-dom-client.js +1 -1
  339. package/dist/stage-bundles/react/framework-dom.js +1 -1
  340. package/dist/stage-bundles/react/framework-jsx-runtime.js +1 -1
  341. package/dist/stage-bundles/react/framework.js +1 -1
  342. package/dist/stage-bundles/react/sdk.js +1 -1
  343. package/dist/stage-bundles/vue/chunks/addComponent-NG2BML2S.js +1 -0
  344. package/dist/stage-bundles/vue/chunks/addNode-UNXHE5VL.js +1 -0
  345. package/dist/stage-bundles/vue/chunks/addTree-MFMYQTGN.js +1 -0
  346. package/dist/stage-bundles/{react/chunks/aiAttachmentContracts-IIM7E4TZ.js → vue/chunks/aiAttachmentContracts-7LLE57FI.js} +1 -1
  347. package/dist/stage-bundles/{react/chunks/aiMessagesContracts-LVR4HAGR.js → vue/chunks/aiMessagesContracts-RAR7ENH4.js} +1 -1
  348. package/dist/stage-bundles/vue/chunks/aiRelay-C6ZJ3PUF.js +1 -0
  349. package/dist/stage-bundles/{react/chunks/aiSessionContracts-MWOX56DC.js → vue/chunks/aiSessionContracts-NHU57TUZ.js} +1 -1
  350. package/dist/stage-bundles/vue/chunks/assets-6LM3GVQU.js +1 -0
  351. package/dist/stage-bundles/vue/chunks/capture-XURVK5HZ.js +1 -0
  352. package/dist/stage-bundles/vue/chunks/chunk-2Z2RXHNK.js +1 -0
  353. package/dist/stage-bundles/vue/chunks/chunk-4M7L75C7.js +1 -0
  354. package/dist/stage-bundles/vue/chunks/chunk-4Q5R44ZZ.js +1 -0
  355. package/dist/stage-bundles/vue/chunks/chunk-7YVQSQRP.js +1 -0
  356. package/dist/stage-bundles/vue/chunks/chunk-BJPSGTXJ.js +1 -0
  357. package/dist/stage-bundles/vue/chunks/chunk-CGCD6S33.js +6 -0
  358. package/dist/stage-bundles/vue/chunks/chunk-F7DSZRND.js +1 -0
  359. package/dist/stage-bundles/vue/chunks/chunk-GW7KMMRR.js +1 -0
  360. package/dist/stage-bundles/vue/chunks/chunk-HYSOOJLT.js +1 -0
  361. package/dist/stage-bundles/vue/chunks/chunk-IG2Y3H6O.js +1 -0
  362. package/dist/stage-bundles/vue/chunks/chunk-IWTWZA3T.js +1 -0
  363. package/dist/stage-bundles/vue/chunks/chunk-K5IR3PSI.js +1 -0
  364. package/dist/stage-bundles/vue/chunks/chunk-LXD22ETU.js +1 -0
  365. package/dist/stage-bundles/vue/chunks/chunk-NFKUJQZH.js +1 -0
  366. package/dist/stage-bundles/vue/chunks/chunk-NKDO4J6J.js +1 -0
  367. package/dist/stage-bundles/vue/chunks/chunk-QFJRB6B2.js +103 -0
  368. package/dist/stage-bundles/vue/chunks/chunk-SCJKRPIZ.js +1 -0
  369. package/dist/stage-bundles/{react/chunks/chunk-PPHD3O2M.js → vue/chunks/chunk-ULVFWUAU.js} +1 -1
  370. package/dist/stage-bundles/vue/chunks/chunk-USKXWFBI.js +1 -0
  371. package/dist/stage-bundles/vue/chunks/contentEditor-7BYCT3TH.js +1 -0
  372. package/dist/stage-bundles/vue/chunks/design-4GTDZLD2.js +15 -0
  373. package/dist/stage-bundles/{react/chunks/history-7CH6VXP4.js → vue/chunks/history-CMF3VYTT.js} +1 -1
  374. package/dist/stage-bundles/vue/chunks/main-4HW35P75.js +1 -0
  375. package/dist/stage-bundles/vue/chunks/main-BVDJS6IT.js +1 -0
  376. package/dist/stage-bundles/{react/chunks/main-D4CUN7NH.js → vue/chunks/main-DH4JOS22.js} +1 -1
  377. package/dist/stage-bundles/vue/chunks/{main-HQ4XJKUM.js → main-PALLSI3C.js} +1 -1
  378. package/dist/stage-bundles/vue/chunks/moveNodeToLastChildOf-BLKABBSO.js +1 -0
  379. package/dist/stage-bundles/{react/chunks/nodeGraph-2AX6JUZ4.js → vue/chunks/nodeGraph-UNI2HUNX.js} +1 -1
  380. package/dist/stage-bundles/vue/chunks/preview-QUDMZGVG.js +1 -0
  381. package/dist/stage-bundles/vue/chunks/setNodeLayout-KQVZJBYW.js +1 -0
  382. package/dist/stage-bundles/{react/chunks/user-3YXEQVFB.js → vue/chunks/user-H5DKMGWA.js} +1 -1
  383. package/dist/stage-bundles/vue/chunks/viewport-ZRWTVYC3.js +1 -0
  384. package/dist/stage-bundles/vue/chunks/window-IMPT5I3D.js +1 -0
  385. package/dist/stage-bundles/vue/entry.js +1 -1
  386. package/dist/stage-bundles/vue/framework-jsx-runtime.js +1 -1
  387. package/dist/stage-bundles/vue/framework.js +1 -1
  388. package/dist/stage-bundles/vue/sdk.js +1 -1
  389. package/dist/stage-src/dev/entry.js +8 -17
  390. package/dist/stage-src/dev/server.js +77 -24
  391. package/dist/stage-src/preview/bootstrap.js +0 -2
  392. package/package.json +16 -21
  393. package/dist/stage/chunks/addAction-FSI6BXB4.js +0 -1
  394. package/dist/stage/chunks/addAnimationBinding-Y4VROY4L.js +0 -1
  395. package/dist/stage/chunks/addAttribute-ZPJGNPHK.js +0 -1
  396. package/dist/stage/chunks/addComponent-VWD6O7CQ.js +0 -1
  397. package/dist/stage/chunks/addComputed-FQVHDUIE.js +0 -1
  398. package/dist/stage/chunks/addEvent-54ZE2DVJ.js +0 -1
  399. package/dist/stage/chunks/addLifecycleHook-VCCSTQ3G.js +0 -1
  400. package/dist/stage/chunks/addNode-IWTESHU3.js +0 -1
  401. package/dist/stage/chunks/addOption-ISGTUY6U.js +0 -1
  402. package/dist/stage/chunks/addParamToRoute-CRDV7MVF.js +0 -1
  403. package/dist/stage/chunks/addState-N3MBR533.js +0 -1
  404. package/dist/stage/chunks/addStore-PHY52777.js +0 -1
  405. package/dist/stage/chunks/addToken-QSTDKYFU.js +0 -1
  406. package/dist/stage/chunks/addValue-NBDF57UK.js +0 -1
  407. package/dist/stage/chunks/aiRelay-FDHMGC33.js +0 -1
  408. package/dist/stage/chunks/assets-RXVS3AKR.js +0 -1
  409. package/dist/stage/chunks/capture-XQFI2T7B.js +0 -1
  410. package/dist/stage/chunks/chunk-2YZN7IFG.js +0 -1
  411. package/dist/stage/chunks/chunk-32WBU6VH.js +0 -1
  412. package/dist/stage/chunks/chunk-33W74KNB.js +0 -37
  413. package/dist/stage/chunks/chunk-45CXRNTO.js +0 -1
  414. package/dist/stage/chunks/chunk-45LFQ7GZ.js +0 -1
  415. package/dist/stage/chunks/chunk-4MTM6BM7.js +0 -1
  416. package/dist/stage/chunks/chunk-4Y2YKFNP.js +0 -1
  417. package/dist/stage/chunks/chunk-55KIFGBN.js +0 -1
  418. package/dist/stage/chunks/chunk-5GOTVZFC.js +0 -1
  419. package/dist/stage/chunks/chunk-6EIGTDJQ.js +0 -1
  420. package/dist/stage/chunks/chunk-7L4V7JRT.js +0 -1
  421. package/dist/stage/chunks/chunk-D3V5OTLH.js +0 -1
  422. package/dist/stage/chunks/chunk-DCOWKGJI.js +0 -1
  423. package/dist/stage/chunks/chunk-DSKLC3WF.js +0 -1
  424. package/dist/stage/chunks/chunk-EO7UBT4B.js +0 -1
  425. package/dist/stage/chunks/chunk-FSECMWCM.js +0 -1
  426. package/dist/stage/chunks/chunk-FTRUORC5.js +0 -1
  427. package/dist/stage/chunks/chunk-G37FCH35.js +0 -1
  428. package/dist/stage/chunks/chunk-GURTWV7H.js +0 -1
  429. package/dist/stage/chunks/chunk-H3VC542J.js +0 -1
  430. package/dist/stage/chunks/chunk-IERYKQMJ.js +0 -1
  431. package/dist/stage/chunks/chunk-IEXI4PPB.js +0 -1
  432. package/dist/stage/chunks/chunk-K7MC6G4X.js +0 -1
  433. package/dist/stage/chunks/chunk-KCVDFPJI.js +0 -1
  434. package/dist/stage/chunks/chunk-L4CU73MS.js +0 -1
  435. package/dist/stage/chunks/chunk-LOILFK74.js +0 -55
  436. package/dist/stage/chunks/chunk-MXIF2FGR.js +0 -1
  437. package/dist/stage/chunks/chunk-OWARHUEW.js +0 -1
  438. package/dist/stage/chunks/chunk-P4ODI2G4.js +0 -1
  439. package/dist/stage/chunks/chunk-PUPSHZWC.js +0 -1
  440. package/dist/stage/chunks/chunk-QTBRJH2Q.js +0 -1
  441. package/dist/stage/chunks/chunk-SECM4LZZ.js +0 -1
  442. package/dist/stage/chunks/chunk-TAMEB64F.js +0 -1
  443. package/dist/stage/chunks/chunk-TIIQLNVN.js +0 -1
  444. package/dist/stage/chunks/chunk-U3IV5DRQ.js +0 -1
  445. package/dist/stage/chunks/chunk-X6HJCJ3C.js +0 -1
  446. package/dist/stage/chunks/chunk-YMUEID4R.js +0 -1
  447. package/dist/stage/chunks/chunk-YN5VQBDN.js +0 -1
  448. package/dist/stage/chunks/chunk-YZBMJY7E.js +0 -1
  449. package/dist/stage/chunks/clearDestination-P3FTW7VJ.js +0 -1
  450. package/dist/stage/chunks/clearName-EUYRSZED.js +0 -1
  451. package/dist/stage/chunks/clearOptionsExpression-DF4IPDKH.js +0 -1
  452. package/dist/stage/chunks/clearRender-IUKXUT2E.js +0 -1
  453. package/dist/stage/chunks/clearRepeat-HR5C5VWU.js +0 -1
  454. package/dist/stage/chunks/contentEditor-PCXXWARK.js +0 -1
  455. package/dist/stage/chunks/createAction-XVCUAVTP.js +0 -1
  456. package/dist/stage/chunks/createAnimation-YAXYGTZ2.js +0 -1
  457. package/dist/stage/chunks/createComputed-6XPJKJMP.js +0 -1
  458. package/dist/stage/chunks/createTextContent-BL7YGYP5.js +0 -1
  459. package/dist/stage/chunks/createValue-QMG7LOR4.js +0 -1
  460. package/dist/stage/chunks/design-SPZTUDPC.js +0 -15
  461. package/dist/stage/chunks/dev-24ZWZ22W.js +0 -1
  462. package/dist/stage/chunks/disconnectNode-OY65I4GB.js +0 -1
  463. package/dist/stage/chunks/main-BLNWJ3UJ.js +0 -1
  464. package/dist/stage/chunks/main-NTDWDKF7.js +0 -1
  465. package/dist/stage/chunks/moveNodeToLastChildOf-PRI4OYRB.js +0 -1
  466. package/dist/stage/chunks/normalizeLayoutContext-OIXYBNTH.js +0 -1
  467. package/dist/stage/chunks/preview-EIG4E5G5.js +0 -1
  468. package/dist/stage/chunks/react-G5SWVCZA.js +0 -1
  469. package/dist/stage/chunks/removeAction-H3EDG2CG.js +0 -1
  470. package/dist/stage/chunks/removeAnimationBinding-JRXL2AOH.js +0 -1
  471. package/dist/stage/chunks/removeAttribute-6RYM7MYC.js +0 -1
  472. package/dist/stage/chunks/removeComputed-3HL3BXKY.js +0 -1
  473. package/dist/stage/chunks/removeEvent-CP3SVSHQ.js +0 -1
  474. package/dist/stage/chunks/removeLifecycleHook-Q76BUDFU.js +0 -1
  475. package/dist/stage/chunks/removeNode-OFMYW2LY.js +0 -1
  476. package/dist/stage/chunks/removeOption-Y6QYTQ7C.js +0 -1
  477. package/dist/stage/chunks/removeParamFromRoute-MHUMB7RO.js +0 -1
  478. package/dist/stage/chunks/removeState-HEDFV7HD.js +0 -1
  479. package/dist/stage/chunks/removeStore-BQDKUY3I.js +0 -1
  480. package/dist/stage/chunks/removeToken-6K5JDRMK.js +0 -1
  481. package/dist/stage/chunks/removeValue-OTRFOOIB.js +0 -1
  482. package/dist/stage/chunks/setDestination-3H4RDE7F.js +0 -1
  483. package/dist/stage/chunks/setHomePage-UZUWIELK.js +0 -1
  484. package/dist/stage/chunks/setHtmlId-V2DQ2Z6D.js +0 -1
  485. package/dist/stage/chunks/setName-QKDRLH7I.js +0 -1
  486. package/dist/stage/chunks/setNodeLayout-O53CNHES.js +0 -1
  487. package/dist/stage/chunks/setOptionsExpression-4NFPAI24.js +0 -1
  488. package/dist/stage/chunks/setRender-XQJWRRYD.js +0 -1
  489. package/dist/stage/chunks/setRepeat-PAW7YMSY.js +0 -1
  490. package/dist/stage/chunks/setTagName-Y7O7I6SO.js +0 -1
  491. package/dist/stage/chunks/updateAction-XSXILF2R.js +0 -1
  492. package/dist/stage/chunks/updateAnimationBinding-LQTVD3O6.js +0 -1
  493. package/dist/stage/chunks/updateAttribute-5MWAVQAV.js +0 -1
  494. package/dist/stage/chunks/updateBounds-3L2AJ72O.js +0 -1
  495. package/dist/stage/chunks/updateComputed-UALAJ4RF.js +0 -1
  496. package/dist/stage/chunks/updateEvent-NXMQSGDQ.js +0 -1
  497. package/dist/stage/chunks/updateHtml-AEMCHPUQ.js +0 -1
  498. package/dist/stage/chunks/updateLifecycleHook-6MCUOVJH.js +0 -1
  499. package/dist/stage/chunks/updateOption-JCNXPYXP.js +0 -1
  500. package/dist/stage/chunks/updateRoute-CI3GOLVJ.js +0 -1
  501. package/dist/stage/chunks/updateState-QJID3WQV.js +0 -1
  502. package/dist/stage/chunks/updateStyle-FR7K7R73.js +0 -1
  503. package/dist/stage/chunks/updateToken-JX6R3YU7.js +0 -1
  504. package/dist/stage/chunks/updateValue-2B5ZNGZI.js +0 -1
  505. package/dist/stage/chunks/window-RFC7WGLM.js +0 -1
  506. package/dist/stage-bundles/preact/chunks/addComponent-Y2AQ2FGZ.js +0 -1
  507. package/dist/stage-bundles/preact/chunks/addNode-2E5QNYOA.js +0 -1
  508. package/dist/stage-bundles/preact/chunks/aiRelay-WDZAC42R.js +0 -1
  509. package/dist/stage-bundles/preact/chunks/assets-NU56BTDG.js +0 -1
  510. package/dist/stage-bundles/preact/chunks/capture-XBPXL4U7.js +0 -1
  511. package/dist/stage-bundles/preact/chunks/chunk-2BGFXNGU.js +0 -1
  512. package/dist/stage-bundles/preact/chunks/chunk-34CHXN5I.js +0 -1
  513. package/dist/stage-bundles/preact/chunks/chunk-67H474GN.js +0 -1
  514. package/dist/stage-bundles/preact/chunks/chunk-ACPGC7BJ.js +0 -1
  515. package/dist/stage-bundles/preact/chunks/chunk-E4RDZ324.js +0 -1
  516. package/dist/stage-bundles/preact/chunks/chunk-FCRFPWU3.js +0 -97
  517. package/dist/stage-bundles/preact/chunks/chunk-JHWED3SX.js +0 -1
  518. package/dist/stage-bundles/preact/chunks/chunk-JRXMDYLE.js +0 -1
  519. package/dist/stage-bundles/preact/chunks/chunk-KISNK4R4.js +0 -1
  520. package/dist/stage-bundles/preact/chunks/chunk-LEELNBJC.js +0 -1
  521. package/dist/stage-bundles/preact/chunks/chunk-LHON3DKO.js +0 -1
  522. package/dist/stage-bundles/preact/chunks/chunk-PYIGBTL4.js +0 -6
  523. package/dist/stage-bundles/preact/chunks/chunk-QKFDVU2Q.js +0 -1
  524. package/dist/stage-bundles/preact/chunks/chunk-UQFZUWFP.js +0 -1
  525. package/dist/stage-bundles/preact/chunks/contentEditor-6WQFOUKV.js +0 -1
  526. package/dist/stage-bundles/preact/chunks/design-QOLOMJCH.js +0 -15
  527. package/dist/stage-bundles/preact/chunks/main-K2WJEG5C.js +0 -1
  528. package/dist/stage-bundles/preact/chunks/main-ZXFODV6O.js +0 -1
  529. package/dist/stage-bundles/preact/chunks/moveNodeToLastChildOf-OZ6F2NPU.js +0 -1
  530. package/dist/stage-bundles/preact/chunks/normalizeLayoutContext-WRK6FVHM.js +0 -1
  531. package/dist/stage-bundles/preact/chunks/preact-NBJKI6EE.js +0 -1
  532. package/dist/stage-bundles/preact/chunks/preview-AFX7D63A.js +0 -1
  533. package/dist/stage-bundles/preact/chunks/setNodeLayout-QNVAVAMX.js +0 -1
  534. package/dist/stage-bundles/preact/chunks/window-TFWZNZUJ.js +0 -1
  535. package/dist/stage-bundles/react/chunks/addAnimationBinding-7TFETALG.js +0 -1
  536. package/dist/stage-bundles/react/chunks/addComponent-P7BXPI75.js +0 -1
  537. package/dist/stage-bundles/react/chunks/addNode-4MPFG7L5.js +0 -1
  538. package/dist/stage-bundles/react/chunks/addParamToRoute-VX2GDCCP.js +0 -1
  539. package/dist/stage-bundles/react/chunks/addStore-F3E5UJ5H.js +0 -1
  540. package/dist/stage-bundles/react/chunks/aiRelay-3CLWLKMV.js +0 -1
  541. package/dist/stage-bundles/react/chunks/assets-UN6U4NZV.js +0 -1
  542. package/dist/stage-bundles/react/chunks/capture-5GIKSRCZ.js +0 -1
  543. package/dist/stage-bundles/react/chunks/chunk-2BGFXNGU.js +0 -1
  544. package/dist/stage-bundles/react/chunks/chunk-32U4X4HZ.js +0 -6
  545. package/dist/stage-bundles/react/chunks/chunk-34CHXN5I.js +0 -1
  546. package/dist/stage-bundles/react/chunks/chunk-5OEIZ3PD.js +0 -1
  547. package/dist/stage-bundles/react/chunks/chunk-ADVOIRI5.js +0 -43
  548. package/dist/stage-bundles/react/chunks/chunk-ATUQUJRM.js +0 -1
  549. package/dist/stage-bundles/react/chunks/chunk-BXIWQYSY.js +0 -1
  550. package/dist/stage-bundles/react/chunks/chunk-GYBL4LBC.js +0 -1
  551. package/dist/stage-bundles/react/chunks/chunk-HLPDOSGP.js +0 -1
  552. package/dist/stage-bundles/react/chunks/chunk-KISNK4R4.js +0 -1
  553. package/dist/stage-bundles/react/chunks/chunk-NDUX5RLD.js +0 -1
  554. package/dist/stage-bundles/react/chunks/chunk-PSQ4TIJA.js +0 -1
  555. package/dist/stage-bundles/react/chunks/chunk-QKFDVU2Q.js +0 -1
  556. package/dist/stage-bundles/react/chunks/chunk-UQFZUWFP.js +0 -1
  557. package/dist/stage-bundles/react/chunks/clearDestination-ESJ4RTEB.js +0 -1
  558. package/dist/stage-bundles/react/chunks/clearName-XLFUSVVX.js +0 -1
  559. package/dist/stage-bundles/react/chunks/clearOptionsExpression-T5UZGD3M.js +0 -1
  560. package/dist/stage-bundles/react/chunks/clearRender-QOV6MKSA.js +0 -1
  561. package/dist/stage-bundles/react/chunks/clearRepeat-KGDHK6I5.js +0 -1
  562. package/dist/stage-bundles/react/chunks/contentEditor-VQUII3R3.js +0 -1
  563. package/dist/stage-bundles/react/chunks/createAnimation-5GYHDNS4.js +0 -1
  564. package/dist/stage-bundles/react/chunks/createValue-Q2VRKXEI.js +0 -1
  565. package/dist/stage-bundles/react/chunks/design-Z6J5JRDV.js +0 -15
  566. package/dist/stage-bundles/react/chunks/main-OAJ3EVVU.js +0 -1
  567. package/dist/stage-bundles/react/chunks/main-WER4YJAR.js +0 -1
  568. package/dist/stage-bundles/react/chunks/moveNodeToLastChildOf-DQR5GURK.js +0 -1
  569. package/dist/stage-bundles/react/chunks/normalizeLayoutContext-34DZRL3Q.js +0 -1
  570. package/dist/stage-bundles/react/chunks/preview-5V5GS6PZ.js +0 -1
  571. package/dist/stage-bundles/react/chunks/react-YDAQ4KLN.js +0 -1
  572. package/dist/stage-bundles/react/chunks/removeAction-7V4VV5SS.js +0 -1
  573. package/dist/stage-bundles/react/chunks/removeAnimationBinding-26LUMVXH.js +0 -1
  574. package/dist/stage-bundles/react/chunks/removeAttribute-AZK5TQQM.js +0 -1
  575. package/dist/stage-bundles/react/chunks/removeComputed-HIYYBG3M.js +0 -1
  576. package/dist/stage-bundles/react/chunks/removeEvent-A7AUWPIF.js +0 -1
  577. package/dist/stage-bundles/react/chunks/removeLifecycleHook-Z5ZHFYSE.js +0 -1
  578. package/dist/stage-bundles/react/chunks/removeOption-7JZTAHTB.js +0 -1
  579. package/dist/stage-bundles/react/chunks/removeParamFromRoute-JBZOXNDA.js +0 -1
  580. package/dist/stage-bundles/react/chunks/removeState-RIXJ6YEL.js +0 -1
  581. package/dist/stage-bundles/react/chunks/removeStore-PKBJRCYZ.js +0 -1
  582. package/dist/stage-bundles/react/chunks/removeToken-WRU2GN7O.js +0 -1
  583. package/dist/stage-bundles/react/chunks/removeValue-KRNKQVF5.js +0 -1
  584. package/dist/stage-bundles/react/chunks/setDestination-DUGBRV24.js +0 -1
  585. package/dist/stage-bundles/react/chunks/setHomePage-GJLGWZHJ.js +0 -1
  586. package/dist/stage-bundles/react/chunks/setHtmlId-F5SPBYD7.js +0 -1
  587. package/dist/stage-bundles/react/chunks/setName-DAQAN7JR.js +0 -1
  588. package/dist/stage-bundles/react/chunks/setNodeLayout-X4PQKKZT.js +0 -1
  589. package/dist/stage-bundles/react/chunks/setTagName-42MJSWMZ.js +0 -1
  590. package/dist/stage-bundles/react/chunks/updateAnimationBinding-QETT3JF2.js +0 -1
  591. package/dist/stage-bundles/react/chunks/updateBounds-HOTYUCG4.js +0 -1
  592. package/dist/stage-bundles/react/chunks/updateHtml-VQAIKLEG.js +0 -1
  593. package/dist/stage-bundles/react/chunks/updateRoute-FPAKZBCT.js +0 -1
  594. package/dist/stage-bundles/react/chunks/updateStyle-M7YKN6C4.js +0 -1
  595. package/dist/stage-bundles/react/chunks/updateToken-LOI6M4XH.js +0 -1
  596. package/dist/stage-bundles/react/chunks/viewport-7ICM5NZY.js +0 -1
  597. package/dist/stage-bundles/react/chunks/window-SG66BA4O.js +0 -1
  598. package/dist/stage-bundles/vue/chunks/addComponent-Y2AQ2FGZ.js +0 -1
  599. package/dist/stage-bundles/vue/chunks/addNode-5OXCF22G.js +0 -1
  600. package/dist/stage-bundles/vue/chunks/aiRelay-WDZAC42R.js +0 -1
  601. package/dist/stage-bundles/vue/chunks/assets-NU56BTDG.js +0 -1
  602. package/dist/stage-bundles/vue/chunks/capture-UZVRGVM7.js +0 -1
  603. package/dist/stage-bundles/vue/chunks/chunk-7CCYKDAJ.js +0 -97
  604. package/dist/stage-bundles/vue/chunks/chunk-ACPGC7BJ.js +0 -1
  605. package/dist/stage-bundles/vue/chunks/chunk-FYWE2MO5.js +0 -1
  606. package/dist/stage-bundles/vue/chunks/chunk-ILXSVZXQ.js +0 -1
  607. package/dist/stage-bundles/vue/chunks/chunk-IZT2KVTW.js +0 -1
  608. package/dist/stage-bundles/vue/chunks/chunk-JRXMDYLE.js +0 -1
  609. package/dist/stage-bundles/vue/chunks/chunk-PYIGBTL4.js +0 -6
  610. package/dist/stage-bundles/vue/chunks/chunk-QKFDVU2Q.js +0 -1
  611. package/dist/stage-bundles/vue/chunks/chunk-RMSX6LWP.js +0 -1
  612. package/dist/stage-bundles/vue/chunks/chunk-TSL6VG3R.js +0 -1
  613. package/dist/stage-bundles/vue/chunks/chunk-TTTOAB6J.js +0 -1
  614. package/dist/stage-bundles/vue/chunks/chunk-UDTKG2KI.js +0 -1
  615. package/dist/stage-bundles/vue/chunks/chunk-UIC3GAEE.js +0 -1
  616. package/dist/stage-bundles/vue/chunks/contentEditor-EUDU6PBV.js +0 -1
  617. package/dist/stage-bundles/vue/chunks/design-LU5XWCLC.js +0 -15
  618. package/dist/stage-bundles/vue/chunks/main-R652XLC3.js +0 -1
  619. package/dist/stage-bundles/vue/chunks/main-X6SC5JYU.js +0 -1
  620. package/dist/stage-bundles/vue/chunks/moveNodeToLastChildOf-H4TZ5UMP.js +0 -1
  621. package/dist/stage-bundles/vue/chunks/normalizeLayoutContext-KGEMYC4Y.js +0 -1
  622. package/dist/stage-bundles/vue/chunks/preview-52FXOKBF.js +0 -1
  623. package/dist/stage-bundles/vue/chunks/setNodeLayout-GY4G7UZR.js +0 -1
  624. package/dist/stage-bundles/vue/chunks/vue-62USAR6D.js +0 -1
  625. package/dist/stage-bundles/vue/chunks/window-TFWZNZUJ.js +0 -1
  626. package/dist/stage-src/preview/routes/js.js +0 -100
  627. package/dist/stage-src/preview/routes/preview.js +0 -21
  628. package/dist/stage-src/preview/server.js +0 -99
  629. package/dist/stage-src/preview/views/index.js +0 -18
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-CGCD6S33.js";import{a as f}from"./chunk-CYURWEXX.js";import{a as u}from"./chunk-GUI7FIZD.js";import{a as g}from"./chunk-IKKRB6BS.js";import{a as l}from"./chunk-7VDUBBVE.js";import{a as m}from"./chunk-A52FDU5E.js";import{a as c}from"./chunk-6S7QQT47.js";import{a as p}from"./chunk-PU62K33G.js";import{a as d}from"./chunk-KTWXYDG7.js";import{a as i}from"./chunk-EWEPEODY.js";import{a as h}from"./chunk-HAN4CMBX.js";import{a as s}from"./chunk-ZUPNPSUB.js";var S=o("store:action",n=>{let r=n("state")?.ref([".stores"])??null;if(!r)throw new Error("Stores not found");return{add:{namespace:"scene-graph",schema:["String"],handler:e=>u(r,e)},update:{namespace:"scene-graph",schema:["String","Number","Object"],handler:(e,t,a)=>g(r,e,t,a)},remove:{namespace:"scene-graph",schema:["String","Number"],handler:(e,t)=>l(r,e,t)}}});var C=o("store:computed",n=>{let r=n("state")?.ref([".stores"])??null;if(!r)throw new Error("Stores not found");return{add:{schema:["String"],namespace:"scene-graph",handler:e=>{i(r,e)}},update:{schema:["String","Number","Object"],namespace:"scene-graph",handler:(e,t,a)=>{h(r,e,t,a)}},remove:{schema:["String","Number"],namespace:"scene-graph",handler:(e,t)=>{f(r,e,t)}}}});var b=o("store:state",n=>{let r=n("state")?.ref([".stores"])??null;if(!r)throw new Error("Stores not found");return{add:{schema:["String","String"],namespace:"scene-graph",handler:(e,t)=>{c(r,e,t)}},update:{schema:["String","Number","Object"],namespace:"scene-graph",handler:(e,t,a)=>{p(r,e,t,a)}},remove:{schema:["String","Number"],namespace:"scene-graph",handler:(e,t)=>{d(r,e,t)}}}});var v=o("store",n=>{let r=n("state")?.ref([".stores"])??null;if(!r)throw new Error("Stores not found");return{get:{namespace:"scene-graph",handler:e=>e?r.get([e]):r.get()??{}},add:{schema:["String"],namespace:"scene-graph",handler:e=>s(r,e)},remove:{schema:["String"],namespace:"scene-graph",handler:e=>{m(r,e)}}}});var Q=[S,C,b,v];export{S as a,C as b,b as c,v as d,Q as e};
@@ -0,0 +1,6 @@
1
+ import{a as ue,d as se,e as F}from"./chunk-ULVFWUAU.js";import{a as D,e as re,f as r,g as d,h as u,i as o}from"./chunk-UCLSDDOL.js";var Me=(f=>typeof D<"u"?D:typeof Proxy<"u"?new Proxy(f,{get:(t,e)=>(typeof D<"u"?D:t)[e]}):f)(function(f){if(typeof D<"u")return D.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')}),be=(f,t)=>setTimeout(()=>{f(new Error("Timeout waiting for connect"))},t);function z(f){return f!=null&&typeof f.postMessage=="function"}function ve(f){return typeof f?.on=="function"&&typeof f?.removeListener=="function"&&!("onmessage"in f)}function Ce(f){return f!=null&&typeof f=="object"&&"data"in f?{data:f.data}:{data:f}}function ce(f){if(!f||!ve(f))return f;let t=null,e=null,s=null,i=(n,h)=>{if(h)try{f.removeListener(n,h)}catch{}return null};return{postMessage(...n){return f.postMessage(...n)},start(){typeof f.start=="function"&&f.start()},close(){t=i("message",t),e=i("error",e),s=i("close",s);try{typeof f.close=="function"&&f.close()}catch{}},set onmessage(n){t=i("message",t),typeof n=="function"&&(t=h=>n(Ce(h)),f.on("message",t))},get onmessage(){return t},set onerror(n){e=i("error",e),typeof n=="function"&&(e=n,f.on("error",e))},get onerror(){return e},set onclose(n){s=i("close",s),typeof n=="function"&&(s=n,f.on("close",s))},get onclose(){return s}}}var a,p,N,b,q,B,T,w,W,l,Q,ne,fe,Ee,de,Y,pe,oe,ae,me,L,Se,Ae=(a=class{constructor(t,e=F(),s={}){d(this,l);d(this,p,null);d(this,N,!1);d(this,b,null);d(this,q,!1);d(this,B,null);d(this,T,new Map);d(this,w,new Map);d(this,W,1e3);if(u(this,W,s.timeoutMs??1e3),t=ce(t),t){if(typeof t.postMessage!="function")throw new Error("Port must be an object with postMessage");u(this,p,t),u(this,b,e),r(this,p).onmessage=i=>o(this,l,pe).call(this,i),r(this,p).onerror=i=>o(this,l,Se).call(this,i),o(this,l,fe).call(this),u(this,N,!0),typeof r(this,p).start=="function"&&r(this,p).start()}}static get EVENTS(){return{CONNECT:"CONNECT",CONFIRM_CONNECT:"CONFIRM_CONNECT",DISCONNECT:"DISCONNECT",RESPONSE:"RESPONSE",ENABLE:"ENABLE",ERROR:"ERROR",MESSAGE:"MESSAGE",GATHER:"GATHER",WARNING:"WARNING",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}}get enabled(){return r(this,N)}static connect({port:t,options:e={}}){e={...a.defaultOptions,...e},t=ce(t);let s=F();return new Promise((i,n)=>{let h=0,y=null,E=!1,S=()=>{y&&clearTimeout(y);try{t.onmessage=null}catch{}try{t.onerror=null}catch{}};if(e.primary){if(t.onmessage=I=>{let P=I?.data;if(!Array.isArray(P)||P.length<2)return;let[A,M]=P;if(A===a.EVENTS.CONNECT)try{t.postMessage([a.EVENTS.CONFIRM_CONNECT,{rid:M?.rid,sid:M?.sid}]),E=!0,S(),i(new a(t,M?.sid,{timeoutMs:e.timeoutMs}))}catch(x){S(),n(x)}},t.onerror=I=>{E||(E=!0,S(),n(I))},typeof t.start=="function")try{t.start()}catch{}}else{let I=()=>{if(h>=e.maxRetries){E||(S(),n(new Error("Max retries reached")));return}let A=Math.min(e.baseDelay*2**h,e.maxDelay),M=Math.floor(A*e.jitter*Math.random());y=setTimeout(P,A+M)},P=()=>{h+=1;try{t.postMessage([a.EVENTS.CONNECT,{rid:F(),sid:s}])}catch(A){S(),n(A);return}I()};if(t.onmessage=A=>{let M=A?.data;if(!Array.isArray(M)||M.length<2)return;let[x,H]=M;if(!(!H?.sid||!H?.rid))switch(x){case a.EVENTS.CONFIRM_CONNECT:{if(E)return;E=!0,S(),i(new a(t,H?.sid,{timeoutMs:e.timeoutMs}));break}case a.EVENTS.ERROR:{if(E)return;E=!0,S(),n(new Error("Handshake error"));break}default:break}},t.onerror=A=>{E||(E=!0,S(),n(A))},typeof t.start=="function")try{t.start()}catch{}P()}})}get sid(){return r(this,b)}close(){r(this,q)||(u(this,q,!0),console.warn(`[Port] close() \u2014 sid: ${r(this,b)}, pending: ${r(this,T).size}, enabled: ${r(this,N)}`),o(this,l,L).call(this,a.EVENTS.DISCONNECT,{sid:r(this,b)}),o(this,l,ne).call(this))}emit(t){return r(this,p)?r(this,N)?o(this,l,de).call(this,t):Promise.resolve(null):Promise.reject(new Error("No port available"))}request(t,e){return r(this,p)?r(this,N)?o(this,l,Y).call(this,a.EVENTS.MESSAGE,t,e):Promise.resolve(null):Promise.reject(new Error("No port available"))}gather(t,e){return r(this,p)?r(this,N)?o(this,l,Y).call(this,a.EVENTS.GATHER,t,e):Promise.resolve(null):Promise.reject(new Error("No port available"))}async enable(){return r(this,p)?(u(this,N,await o(this,l,Y).call(this,a.EVENTS.ENABLE,!0)),r(this,N)):Promise.reject(new Error("No port available"))}async disable(){return r(this,p)?(u(this,N,await o(this,l,Y).call(this,a.EVENTS.ENABLE,!1)),r(this,N)):Promise.reject(new Error("No port available"))}onMessage(t){if(typeof t!="function")throw new Error("Listener must be a function");if(r(this,w).has(a.EVENTS.MESSAGE))throw new Error("A listener is already registered. Remove the existing listener before adding a new one.");return r(this,w).set(a.EVENTS.MESSAGE,t),()=>{r(this,w).get(a.EVENTS.MESSAGE)===t&&r(this,w).delete(a.EVENTS.MESSAGE)}}onEnable(t){if(typeof t!="function")throw new Error("Listener must be a function");return r(this,w).set(a.EVENTS.ENABLE,t),()=>r(this,w).delete(a.EVENTS.ENABLE)}onError(t){if(typeof t!="function")throw new Error("Listener must be a function");if(r(this,w).has(a.EVENTS.ERROR))throw new Error("A listener is already registered. Remove the existing listener before adding a new one.");return r(this,w).set(a.EVENTS.ERROR,t),()=>r(this,w).delete(a.EVENTS.ERROR)}onDisconnect(t){if(typeof t!="function")throw new Error("Listener must be a function");return r(this,w).set(a.EVENTS.DISCONNECT,t),()=>r(this,w).delete(a.EVENTS.DISCONNECT)}},p=new WeakMap,N=new WeakMap,b=new WeakMap,q=new WeakMap,B=new WeakMap,T=new WeakMap,w=new WeakMap,W=new WeakMap,l=new WeakSet,Q=function(t){if(r(this,q))return;u(this,q,!0),console.warn(`[Port] disconnect detected \u2014 sid: ${r(this,b)}, reason: ${t}`);let e=r(this,w).get(a.EVENTS.DISCONNECT);if(o(this,l,ne).call(this),e)try{e(t)}catch(s){console.error("Port onDisconnect listener error:",s)}},ne=function(){if(r(this,p)){o(this,l,Ee).call(this),r(this,p).onmessage=null,r(this,p).onerror=null;try{typeof r(this,p).stop=="function"&&r(this,p).stop()}catch{}try{typeof r(this,p).close=="function"&&r(this,p).close()}catch{}}for(let[t,e]of r(this,T))e.timeout&&clearTimeout(e.timeout),e.resolve?.(void 0);r(this,T).clear(),u(this,p,null),u(this,N,!1),r(this,w).clear()},fe=function(){let t=r(this,p);if(!t)return;let e=()=>o(this,l,Q).call(this,"peer-lost");try{"onclose"in t?t.onclose=e:typeof t.addEventListener=="function"?(t.addEventListener("close",e),u(this,B,e)):typeof t.on=="function"&&(t.on("close",e),u(this,B,e))}catch{}},Ee=function(){let t=r(this,p);if(t)try{r(this,B)?(typeof t.removeEventListener=="function"?t.removeEventListener("close",r(this,B)):typeof t.removeListener=="function"&&t.removeListener("close",r(this,B)),u(this,B,null)):"onclose"in t&&(t.onclose=null)}catch{}},de=function(t){try{return o(this,l,L).call(this,a.EVENTS.MESSAGE,{sid:r(this,b),rid:null,payload:t})}catch(e){return Promise.reject(e)}},Y=function(t,e,s=r(this,W)){return new Promise((i,n)=>{try{let h=F(),y=be(()=>{r(this,T).delete(h);let E=Array.isArray(e)?e[1]:t;console.warn(`[Port] request TIMEOUT \u2014 sid: ${r(this,b)}, rid: ${h}, event: ${E}, ms: ${s}`),n(new Error("Request timeout"))},s);r(this,T).set(h,{resolve:i,reject:n,timeout:y}),o(this,l,L).call(this,t,{sid:r(this,b),rid:h,payload:e})}catch(h){n(h)}})},pe=function(t){let e=t?.data;if(!Array.isArray(e)||e.length<2)return;let[s,i]=e||[];if(!(i?.sid&&i.sid!==r(this,b)))switch(s){case a.EVENTS.RESPONSE:o(this,l,ae).call(this,i?.rid,i?.payload,"resolve");return;case a.EVENTS.ERROR:let n=i?.payload instanceof Error?i.payload.message:String(i?.payload);o(this,l,ae).call(this,i?.rid,new Error(n),"reject");return;case a.EVENTS.MESSAGE:o(this,l,oe).call(this,i?.rid,i?.payload,!1);return;case a.EVENTS.GATHER:o(this,l,oe).call(this,i?.rid,i?.payload,!0);return;case a.EVENTS.ENABLE:o(this,l,me).call(this,i?.rid,i?.payload);return;case a.EVENTS.DISCONNECT:o(this,l,Q).call(this,"closed");return;default:return}},oe=async function(t,e,s=!1){try{let i=r(this,w).get(a.EVENTS.MESSAGE),n=i?await i(e,{isRequest:!!t,isGather:s}):null;return t?o(this,l,L).call(this,a.EVENTS.RESPONSE,{rid:t,payload:n??null}):void 0}catch(i){let n=i instanceof Error?i.message:String(i);o(this,l,L).call(this,a.EVENTS.ERROR,{rid:t,payload:n})}},ae=function(t,e,s){let i=r(this,T).get(t);i&&(i.timeout&&clearTimeout(i.timeout),r(this,T).delete(t),s==="resolve"?i.resolve(e):i.reject(e))},me=function(t,e){u(this,N,e);let s=r(this,w).get(a.EVENTS.ENABLE);return s&&s(e),o(this,l,L).call(this,a.EVENTS.RESPONSE,{rid:t,payload:e})},L=function(t,e){if(!r(this,p))return console.warn(`[Port] #postMessage but port is null \u2014 type: ${t}, sid: ${r(this,b)}`),!1;try{r(this,p).postMessage([t,e])}catch(s){return console.error(`[Port] #postMessage FAILED \u2014 type: ${t}, sid: ${r(this,b)}`,s.message),s?.name!=="DataCloneError"&&o(this,l,Q).call(this,"peer-lost"),!1}return!0},Se=function(t){console.error("onerror",t)},re(a,"defaultOptions",{primary:!1,maxRetries:10,baseDelay:200,maxDelay:2e3,jitter:.2,timeoutMs:1e3}),a);var g={HANDSHAKE:"HANDSHAKE",MESSAGE:"MESSAGE",GATHER:"GATHER",SUBSCRIBE:"SUBSCRIBE",UNSUBSCRIBE:"UNSUBSCRIBE",SYNC:"SYNC"};var Oe=ue("channelContracts",[Object]),m,R,K,$,v,G,V,O,j,U,C,ie,c,le,k,he,X,Z,_,ye,ee,J,te,we,ge,Ne,Be=(ie=class extends se{constructor(){super(...arguments);d(this,c);d(this,m,null);d(this,R,null);d(this,K,1e3);d(this,$,new Map);d(this,v,new Map);d(this,G,[]);d(this,V,!1);d(this,O,null);d(this,j,!1);d(this,U,null);d(this,C,{enable:new Set,disable:new Set,connect:new Set,disconnect:new Set});d(this,ee,async([t,e,s,i,n])=>{let h=[];switch(t){case g.MESSAGE:let y=r(this,v).get(e);if(y)for(let E of y){if(!o(this,c,Ne).call(this,e,s,E.schema))continue;let S=await E.subscriber(...s);h.push(S),E.once&&r(this,v).get(e).delete(E)}break;case g.SUBSCRIBE:case g.UNSUBSCRIBE:s!=null?r(this,$).set(e,s):r(this,$).delete(e);break}return h.length>0?h[0]:null});d(this,J,(t,e,s)=>{switch(t){case"ENABLE":e===!0?r(this,C).enable.forEach(i=>i(s)):r(this,C).disable.forEach(i=>i(s));break;case"CONNECT":r(this,C).connect.forEach(i=>i(s));break}});d(this,te,t=>{console.error("Channel error:",t)})}initialize(t,e){if(e.port!=null&&!z(e.port))throw new Error("Configured port must have postMessage");if(u(this,R,e.port),u(this,K,e.timeout??1e3),e.subscriptions&&e.subscriptions.length)for(let s of e.subscriptions)r(this,G).push(s)}actions(){let t={ready:()=>r(this,V),portProvider:e=>{if(typeof e!="function")throw new Error("portProvider must be a function");return u(this,O,e),t},connect:async(e,s)=>{try{if(u(this,R,e??r(this,R)),z(r(this,R))||r(this,O)&&u(this,R,await r(this,O).call(this)),!z(r(this,R)))throw new Error("No port provided and no portProvider set");if(r(this,m)){let n=r(this,m);u(this,m,null),u(this,V,!1),n.close()}u(this,m,await Ae.connect({port:r(this,R),options:{timeoutMs:r(this,K)}}));let i=r(this,m);i.onMessage(async n=>await r(this,ee).call(this,n)),i.onEnable(n=>r(this,J).call(this,"ENABLE",n,t)),i.onError(r(this,te)),i.onDisconnect(n=>{r(this,m)===i&&o(this,c,we).call(this,n)}),u(this,V,!0);for(let[n,h]of r(this,v)){let y;for(let E of h)E.timeoutMs!==void 0&&(y===void 0||E.timeoutMs>y)&&(y=E.timeoutMs);r(this,m).emit([g.SUBSCRIBE,n,y])}if(r(this,G).length>0){let n=r(this,G);u(this,G,[]);for(let h of n)o(this,c,le).call(this,h)}if(await o(this,c,ye).call(this),r(this,J).call(this,"CONNECT",!0,t),s&&typeof s=="function"){let n=s(t);typeof n=="function"&&u(this,O,n),s=null}return t}catch(i){return console.error("Channel error:",i),!1}},reconnect:e=>{if(!z(e))throw new Error("reconnect requires a valid port");return t.connect(e)},onEnable:e=>{if(typeof e!="function")throw new Error("Listener must be a function");return r(this,C).enable.add(e),()=>r(this,C).enable.delete(e)},onDisable:e=>{if(typeof e!="function")throw new Error("Listener must be a function");return r(this,C).disable.add(e),()=>r(this,C).disable.delete(e)},onDisconnect:e=>{if(typeof e!="function")throw new Error("Listener must be a function");return r(this,C).disconnect.add(e),()=>r(this,C).disconnect.delete(e)},disconnect:()=>{if(r(this,m)){u(this,O,null),r(this,C).disconnect.forEach(e=>e("closed",t));for(let e of r(this,v).keys())r(this,m).emit([g.UNSUBSCRIBE,e]);r(this,m).close(),u(this,m,null),u(this,V,!1),r(this,v).clear(),r(this,$).clear(),u(this,G,[])}},use:(...e)=>{if(r(this,V)){for(let s of e)o(this,c,le).call(this,s);return t}for(let s of e)r(this,G).push(s);return t},publish:(e,...s)=>(o(this,c,X).call(this,g.MESSAGE,e,s),t),request:(e,...s)=>o(this,c,Z).call(this,g.MESSAGE,e,s),gather:(e,...s)=>o(this,c,_).call(this,g.GATHER,e,s),subscribe:(e,s)=>o(this,c,k).call(this,e,void 0,s,!1),subscribeOnce:(e,s)=>o(this,c,k).call(this,e,void 0,s,!0),unsubscribe:(e,s)=>o(this,c,he).call(this,e,s),to:(...e)=>({publish:(s,...i)=>{o(this,c,X).call(this,g.MESSAGE,s,i,e)},request:(s,...i)=>o(this,c,Z).call(this,g.MESSAGE,s,i,e),gather:(s,...i)=>o(this,c,_).call(this,g.GATHER,s,i,e)}),namespace:e=>({publish:(s,...i)=>{let n=e?`${e}/${s}`:s;return o(this,c,X).call(this,g.MESSAGE,n,i),t},request:(s,...i)=>{let n=e?`${e}/${s}`:s;return o(this,c,Z).call(this,g.MESSAGE,n,i)},gather:(s,...i)=>{let n=e?`${e}/${s}`:s;return o(this,c,_).call(this,g.GATHER,n,i)},subscribe:(s,i)=>{let n=e?`${e}/${s}`:s;return o(this,c,k).call(this,n,void 0,i,!1),t},subscribeOnce:(s,i)=>{let n=e?`${e}/${s}`:s;return o(this,c,k).call(this,n,void 0,i,!0),t},unsubscribe:(s,i)=>{let n=e?`${e}/${s}`:s;return o(this,c,he).call(this,n,i),t}})};return u(this,U,t),t}},m=new WeakMap,R=new WeakMap,K=new WeakMap,$=new WeakMap,v=new WeakMap,G=new WeakMap,V=new WeakMap,O=new WeakMap,j=new WeakMap,U=new WeakMap,C=new WeakMap,c=new WeakSet,le=function(t){if(t&&typeof t=="function"){let e=t._name,s=t(this.inject),i=Object.entries(s);for(let[n,h]of i){let{handler:y,schema:E,namespace:S,once:I,timeoutMs:P}=h,A=S?`${S}/${e}:${n}`:`${e}:${n}`,M=(...x)=>{try{return y(...x)}catch(H){console.error(`Errow with ${A}:`,H)}};o(this,c,k).call(this,A,E,M,I,P)}}},k=function(t,e,s,i=!1,n=void 0){r(this,v).has(t)||r(this,v).set(t,new Set);let h={event:t,schema:e,subscriber:s,once:i,timeoutMs:n};return r(this,v).get(t).add(h),r(this,m)&&r(this,m).emit([g.SUBSCRIBE,t,n]),()=>r(this,v).get(t)?.delete(h)},he=function(t,e){if(!r(this,v).has(t))return;let s=r(this,v).get(t);for(let i of s.values())if(i.subscriber===e)return s.delete(i),e},X=function(t,e,s,i=null){if(!r(this,m)){console.warn(`[Channel] publish "${e}" dropped \u2014 not connected`);return}r(this,m).emit([t,e,s,i])},Z=function(t,e,s,i=null){return r(this,m)?r(this,m).request([t,e,s,i],r(this,$).get(e)):Promise.reject(new Error(`Channel not connected \u2014 request "${e}" dropped`))},_=function(t,e,s,i=null){return r(this,m)?r(this,m).gather([t,e,s,i],r(this,$).get(e)):Promise.reject(new Error(`Channel not connected \u2014 gather "${e}" dropped`))},ye=async function(){try{let t=await r(this,m).request([g.SYNC]);if(Array.isArray(t))for(let[e,s]of t)r(this,$).set(e,s)}catch{}},ee=new WeakMap,J=new WeakMap,te=new WeakMap,we=function(t){u(this,m,null),u(this,V,!1),r(this,$).clear(),r(this,C).disconnect.forEach(e=>{try{e(t,r(this,U))}catch(s){console.error("Channel onDisconnect listener error:",s)}}),o(this,c,ge).call(this)},ge=async function(){if(!(r(this,j)||!r(this,O))){u(this,j,!0);try{let t=await r(this,O).call(this);if(!z(t))throw new Error("portProvider did not return a usable port");await r(this,U).connect(t)}catch(t){console.error("[Channel] reconnect failed:",t?.message??t)}finally{u(this,j,!1)}}},Ne=function(t,e,s){if(s===void 0||s==="*"||s===null||e===void 0)return!0;if(Array.isArray(s)){if(s.length===1&&s[0]==="*")return!0;let i=s.length,n=e.length;if(i!==n)return console.warn(`
2
+ Event:`,t,`
3
+ Expected:`,s,`
4
+ Received:`,e.map(h=>typeof h)),!1;for(let h=0;h<i;h++){let y=s[h],E=e[h],S;if(Array.isArray(E)?S="Array":E===null?S="null":S=Object.prototype.toString.call(E).slice(8,-1),y==="Object"&&S==="Array"||y!==S)return console.warn(`
5
+ Event:`,t,`
6
+ Value:`,E),!1}}return!0},re(ie,"manifest",{name:"Channel",dependencies:[],version:"1.0.0",namespace:"channel",description:"Channel extension for message passing between systems",defaults:{port:null,subscriptions:[],timeout:1e3}}),ie);export{Oe as a,Be as b};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-H5NHEM4C.js";import{e as d}from"./chunk-NRRFAMFA.js";import{c as u,h as p}from"./chunk-RYWOKFM7.js";import{c as w}from"./chunk-UCLSDDOL.js";var M=new Set(["className","style","id","ref","key"]),P=new Set(["key","ref"]);function f(e,o){let r={},n={};if(!e)return{dom:r,props:n};let s=o?.props,i=s?.length?new Set(s.map(t=>typeof t=="string"?t:t?.name).filter(t=>t&&!P.has(t))):null;for(let t in e)i?.has(t)?n[t]=e[t]:M.has(t)||t.startsWith("data-")||/^on[A-Z]/.test(t)?r[t]=e[t]:n[t]=e[t];return{dom:r,props:n}}var x=[];function h(e){return e}function T(e){typeof e=="function"&&x.push(e)}async function l(){let e=await import("/user-main.js");if(!(e&&"__jucieMainStub"in e&&e.__jucieMainStub)){if(typeof e?.default!="function")throw new Error("[jucie] src/main.js must default-export setup(...), e.g. export default setup((app) => { ... })");T(e.default)}}function S(e){return x.reduceRight((o,r)=>{let n=r(o);return n===void 0?o:n},e)}var m=!1;async function g(){m||(m=!0,await l())}var y=Symbol("@jucie/runtime"),E=e=>{globalThis[y]=e},b=()=>globalThis[y];var O={};w(O,{createElement:()=>u,createHost:()=>_,createRef:()=>v,createTrigger:()=>R,hostRootProps:()=>I,loadProjectMain:()=>l,provideJucie:()=>E,render:()=>p,renderSource:()=>J,setup:()=>h,splitInstanceOverrides:()=>f,useJucie:()=>b,useRef:()=>d,useSyncExternalStore:()=>a});function v(){return{current:null}}function R(){let e=0,o=[],r=!1,n=c=>(o.push(c),()=>{o=o.filter(j=>j!==c)}),s=()=>e;return[()=>a(n,s,s),()=>{r||(r=!0,Promise.resolve().then(()=>{r=!1,e++,o.forEach(c=>c())}))}]}function _(e,o){let r=null,n=()=>o(r),s=()=>p(S(u(n)),e);return{jucie:n,async mount(i){return await g(),r=i,s(),this},navigate(i){r=i,s()}}}function I(){return{}}function J(e,o,r){let{dom:n,props:s}=f(o,r),{key:i,...t}=n||{};return u(e,{...s,...t,key:i})}export{f as a,h as b,l as c,E as d,b as e,v as f,R as g,_ as h,I as i,J as j,O as k};
@@ -0,0 +1 @@
1
+ import{a as T}from"./chunk-OQM5TMCK.js";import{f as D}from"./chunk-M577WNTV.js";import{b as P}from"./chunk-SCJKRPIZ.js";import{e as w}from"./chunk-4Q5R44ZZ.js";import{b as S}from"./chunk-HE7IQLGK.js";import{a as L}from"./chunk-DLHF7QB4.js";import{b as I}from"./chunk-7UENQJSC.js";function j({name:t,mode:s,...r}={}){return I({name:t,mode:s??"value",...r})}function k(t,s,r={}){let c=typeof r=="string"?{value:r}:r;return t.push([s,"className"],j({mode:"value",...c}))}function _(t,s,r="app",c={}){let{onWarn:z}=c,d=[],m={},p=(E,F)=>{let{type:y,children:a,styles:M,style:O,text:g,ref:v,bounds:x,attributes:N,className:h,layout:R,specificPatterns:W,...b}=E,o=D(t,y,b,F);if(d.push(o),v&&(m[v]=o),y==="frame"&&x){let{x:e,y:l}=x,f=t.get([o,"bounds"])??{};t.set([o,"bounds"],{...f,...e!=null?{x:e}:{},...l!=null?{y:l}:{}})}let C=b.name;if(C&&t.set([o,"name"],C),Array.isArray(N))for(let e of N)e?.name&&T(t,o,e.name,e);if(Array.isArray(h))for(let e of h)typeof e=="string"&&e.trim()&&k(t,o,e.trim());let i=M||O;i&&Object.keys(i).length>0&&S(t,o,{...i});let u=i?.display??t.get([o,"style","default","display"]),n=R??(u==="flex"||u==="grid"?u:null),A=n!=null&&n!=="none";if(A)try{P(t,o,n)}catch(e){z?.("setNodeLayout failed for parent",{id:o,error:e.message})}return g&&!(a?.length>0)&&t.set([o,"textContent"],L({value:g,specificPatterns:W})),a&&a.length>0&&a.forEach(e=>{if(n==="flex"||n==="grid"){let f=e.styles||e.style||{};f.position!=="absolute"&&(e={...e,styles:{width:"auto",height:"auto",top:"auto",left:"auto",...f}})}let l=p(e,o);A&&w(t,l,o)}),o};return{rootId:p(s,r),createdIds:d,treeMap:m}}export{j as a,k as b,_ as c};
@@ -0,0 +1 @@
1
+ import{a as y,b as N,c as b,d as v,e as x,f as k,g as O,h as P,i as I,j as U,l as w}from"./chunk-NRRFAMFA.js";import{a as _,c,d as S,e as p,f as d,g as f,h as m,i as V,j as A,k as R}from"./chunk-RYWOKFM7.js";function Z(e,t){for(var n in t)e[n]=t[n];return e}function L(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function q(e,t){var n=t(),r=y({t:{__:n,u:t}}),o=r[0].t,u=r[1];return v(function(){o.__=n,o.u=t,D(o)&&u({t:o})},[e,n,t]),b(function(){return D(o)&&u({t:o}),e(function(){D(o)&&u({t:o})})},[e]),n}function D(e){try{return!((t=e.__)===(n=e.u())&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}var t,n}function G(e){e()}function J(e){return e}function K(){return[!1,G]}var Q=v;function T(e,t){this.props=e,this.context=t}function re(e,t){function n(o){var u=this.props.ref;return u!=o.ref&&u&&(typeof u=="function"?u(null):u.current=null),t?!t(this.props,o)||u!=o.ref:L(this.props,o)}function r(o){return this.shouldComponentUpdate=n,c(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(T.prototype=new d).isPureReactComponent=!0,T.prototype.shouldComponentUpdate=function(e,t){return L(this.props,e)||L(this.state,t)};var F=_.__b;_.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),F&&F(e)};var oe=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ue(e){function t(n){var r=Z({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=oe,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var W=function(e,t){return e==null?null:f(f(e).map(t))},ae={map:W,forEach:W,count:function(e){return e?f(e).length:0},only:function(e){var t=f(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:f},_e=_.__e;_.__e=function(e,t,n,r){if(e.then){for(var o,u=t;u=u.__;)if((o=u.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),o.__c(e,t)}_e(e,t,n,r)};var z=_.unmount;function X(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Z({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return X(r,t,n)})),e}function ee(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return ee(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function E(){this.__u=0,this.o=null,this.__b=null}function te(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function ie(e){var t,n,r,o=null;function u(a){if(t||(t=e()).then(function(i){i&&(o=i.default||i),r=!0},function(i){n=i,r=!0}),n)throw n;if(!r)throw t;return o?c(o,a):null}return u.displayName="Lazy",u.__f=!0,u}function h(){this.i=null,this.l=null}_.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),z&&z(e)},(E.prototype=new d).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=te(r.__v),u=!1,a=function(){u||r.__z||(u=!0,n.__R=null,o?o(l):l())};n.__R=a;var i=n.__P;n.__P=null;var l=function(){if(!--r.__u){if(r.state.__a){var s=r.state.__a;r.__v.__k[0]=ee(s,s.__c.__P,s.__c.__O)}var g;for(r.setState({__a:r.__b=null});g=r.o.pop();)g.__P=i,g.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},E.prototype.componentWillUnmount=function(){this.o=[]},E.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=X(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&c(p,null,e.fallback);return o&&(o.__u&=-33),[c(p,null,t.__a?null:e.children),o]};var H=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function le(e){return this.getChildContext=function(){return e.context},e.children}function se(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){m(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(o,u){this.childNodes.push(o),t.h.insertBefore(o,u)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.h.removeChild(o)}}}m(c(le,{context:t.context},e.__v),t.v)}function ce(e,t){var n=c(se,{__v:e,h:t});return n.containerInfo=t,n}(h.prototype=new d).__a=function(e){var t=this,n=te(t.__v),r=t.l.get(e);return r[0]++,function(o){var u=function(){t.props.revealOrder?(r.push(o),H(t,e,r)):o()};n?n(u):u()}},h.prototype.render=function(e){this.i=null,this.l=new Map;var t=f(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},h.prototype.componentDidUpdate=h.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){H(e,n,t)})};var ne=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,pe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,de=/[A-Z0-9]/g,me=typeof document<"u",ve=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function he(e,t,n){return t.__k==null&&(t.textContent=""),m(e,t),typeof n=="function"&&n(),e?e.__c:null}function ye(e,t,n){return V(e,t),typeof n=="function"&&n(),e?e.__c:null}d.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(d.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var $=_.event;_.event=function(e){return $&&(e=$(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var M,be={configurable:!0,get:function(){return this.class}},B=_.vnode;_.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},u=r.indexOf("-")==-1;for(var a in n){var i=n[a];if(!(a==="value"&&"defaultValue"in n&&i==null||me&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&i===!0?i="":l==="translate"&&i==="no"?i=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||ve(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":pe.test(a)&&(a=l):l=a="oninput":u&&fe.test(a)?a=a.replace(de,"-$&").toLowerCase():i===null&&(i=void 0),l==="oninput"&&o[a=l]&&(a="oninputCapture"),o[a]=i}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=f(n.children).forEach(function(s){s.props.selected=o.value.indexOf(s.props.value)!=-1})),o.defaultValue!=null&&(o.value=f(n.children).forEach(function(s){s.props.selected=o.multiple?o.defaultValue.indexOf(s.props.value)!=-1:o.defaultValue==s.props.value}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",be)):n.className&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=ne,B&&B(e)};var j=_.__r;_.__r=function(e){j&&j(e),M=e.__c};var Y=_.diffed;_.diffed=function(e){Y&&Y(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),M=null};var Ee={ReactCurrentDispatcher:{current:{readContext:function(e){return M.__n[e.__c].props.value},useCallback:P,useContext:I,useDebugValue:U,useDeferredValue:J,useEffect:b,useId:w,useImperativeHandle:k,useInsertionEffect:Q,useLayoutEffect:v,useMemo:O,useReducer:N,useRef:x,useState:y,useSyncExternalStore:q,useTransition:K}}},we="18.3.1";function Ce(e){return c.bind(null,e)}function C(e){return!!e&&e.$$typeof===ne}function ge(e){return C(e)&&e.type===p}function Se(e){return!!e&&typeof e.displayName=="string"&&e.displayName.indexOf("Memo(")==0}function Re(e){return C(e)?A.apply(null,arguments):e}function Ne(e){return!!e.__k&&(m(null,e),!0)}function xe(e){return e&&(e.base||e.nodeType===1&&e)||null}var ke=function(e,t){return e(t)},Oe=function(e,t){var n,r=_.debounceRendering;_.debounceRendering=function(u){n=u};try{var o=e(t);return n&&n(),o}finally{_.debounceRendering=r}},Pe=C,De={useState:y,useId:w,useReducer:N,useEffect:b,useLayoutEffect:v,useInsertionEffect:Q,useTransition:K,useDeferredValue:J,useSyncExternalStore:q,startTransition:G,useRef:x,useImperativeHandle:k,useMemo:O,useCallback:P,useContext:I,useDebugValue:U,version:"18.3.1",Children:ae,render:he,hydrate:ye,unmountComponentAtNode:Ne,createPortal:ce,createElement:c,createContext:R,createFactory:Ce,cloneElement:Re,createRef:S,Fragment:p,isValidElement:C,isElement:Pe,isFragment:ge,isMemo:Se,findDOMNode:xe,Component:d,PureComponent:T,memo:re,forwardRef:ue,flushSync:Oe,unstable_batchedUpdates:ke,StrictMode:p,Suspense:E,SuspenseList:h,lazy:ie,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ee};export{q as a,G as b,J as c,K as d,Q as e,T as f,re as g,ue as h,ae as i,E as j,ie as k,h as l,ce as m,he as n,ye as o,Ee as p,we as q,Ce as r,C as s,ge as t,Se as u,Re as v,Ne as w,xe as x,ke as y,Oe as z,Pe as A,De as B};
@@ -0,0 +1 @@
1
+ function p(o,e,s){let i=o.get([e,"style"]);if(!(!i||!s.length))for(let r in i){let n=i[r];if(!(!n||typeof n!="object")){for(let t of s)t in n&&o.remove([e,"style",r,t]);for(let t in n){if(!t.startsWith(":")&&!t.startsWith("&."))continue;let f=n[t];if(!(!f||typeof f!="object"))for(let c of s)c in f&&o.remove([e,"style",r,t,c])}}}}var y=["top","left","right","bottom"];function S(o,e){p(o,e,y)}export{p as a,S as b};
@@ -0,0 +1 @@
1
+ function i(e,n){return e.has([n])?e.get(["app","children"])?.includes(n)?"root":e.get(["temp","children"])?.includes(n)?"temp":e.get(["components","children"])?.includes(n)?"components":"nested":null}export{i as a};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-J5QMLA3Z.js";import{a as t}from"./chunk-DLHF7QB4.js";function l(r,i,e){if(s(r,i))return;let c="",f;return typeof e=="string"?c=e:e!=null&&typeof e=="object"&&(c=e.value??"",Object.prototype.hasOwnProperty.call(e,"specificPatterns")&&(f=e.specificPatterns)),r.set([i,"textContent"],t({value:c,specificPatterns:f}))}function y(r,i,e){if(Array.isArray(e))return r.set([i,"textSegments"],e)}export{l as a,y as b};
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-2Z2RXHNK.js";import{c as d}from"./chunk-7I5TQOE2.js";var g=[{key:"iPhone 15",category:"phone",width:393,height:852},{key:"iPhone SE",category:"phone",width:375,height:667},{key:"Pixel 8",category:"phone",width:412,height:915},{key:"Galaxy S24",category:"phone",width:360,height:780},{key:"iPad Air",category:"tablet",width:820,height:1180},{key:"iPad Mini",category:"tablet",width:768,height:1024},{key:"Surface Pro",category:"tablet",width:912,height:1368},{key:"Desktop",category:"desktop",width:1280,height:800},{key:"Desktop Large",category:"desktop",width:1920,height:1080},{key:"custom",category:"custom",width:null,height:null}];function p(e){return g.find(t=>t.key===e)??null}function l(){return g.map(e=>e.key)}var c={width:360,height:740,x:0,y:0};function m(e,t={}){if(e==="custom")return{name:t.name||"Custom",bounds:{width:t.width??c.width,height:t.height??c.height,x:0,y:0}};let r=p(e);if(!r)throw new Error(`Unknown frame preset "${e}". Available: ${l().join(", ")}`);return{name:e,bounds:{width:r.width,height:r.height,x:0,y:0}}}function x(e={}){let t=e.frame??e.viewport;if(!t)return e;let{frame:r,viewport:o,width:i,height:s,name:y,bounds:h,...w}=e,{name:f,bounds:n}=m(t,{name:y,width:i,height:s});return{...w,frame:t,name:f,bounds:{x:h?.x??n.x??0,y:h?.y??n.y??0,width:h?.width??n.width,height:h?.height??n.height}}}function k(e={}){let[t,r]=a("frame",x(e));return r.route={path:`${t}`},[t,r]}function u(e,t,r={}){let[o,i]=t==="frame"?k(r):a(t,r);return e.set([o],i),o}function E(e,t,r,o="app"){let i=u(e,t,r);return d(e,i,o),i}export{g as a,p as b,l as c,m as d,u as e,E as f};
@@ -0,0 +1 @@
1
+ var b="\uFFFC";function d(t,r){let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let o of n)if(t[o]!==r[o])return!1;return!0}function k(t,r){return t.descriptor||r.descriptor?!1:d(t.formats,r.formats)}function m(t){if(!t||t.length===0)return[];let r=[{...t[0],formats:{...t[0].formats}}];for(let n=1;n<t.length;n++){let i=r[r.length-1],o=t[n];k(i,o)?i.text+=o.text:r.push({...o,formats:{...o.formats}})}return r}function h(t){return[{text:t??"",formats:{}}]}function E(t,r={}){return{text:b,descriptor:t,formats:{...r}}}function F(t,r,n,i){if(!t||t.length===0)return h(i);let o=[];for(let s of t)for(let l=0;l<s.text.length;l++)o.push({ch:s.text[l],formats:s.formats,descriptor:s.descriptor});let c=r<o.length?o[Math.min(r,o.length-1)]:o.length>0?o[o.length-1]:null,f=c&&!c.descriptor?{...c.formats}:{};if(o.splice(r,n,...i.split("").map(s=>({ch:s,formats:f}))),o.length===0)return h("");let e=[],u=x(o[0]);for(let s=1;s<o.length;s++){let l=o[s];!u.descriptor&&!l.descriptor&&d(u.formats,l.formats)?u.text+=l.ch:(e.push(u),u=x(l))}return e.push(u),e}function x(t){let r={text:t.ch,formats:t.formats};return t.descriptor&&(r.descriptor=t.descriptor),r}function T(t,r,n,i){if(!t||t.length===0||r>=n)return t;let o=g(t,[r,n]),c=0,f=o.map(e=>{let u=c,s=c+e.text.length;if(c=s,u>=r&&s<=n){let l={text:e.text,formats:{...e.formats,...i}};return e.descriptor&&(l.descriptor=e.descriptor),l}return e});return m(f)}function j(t,r,n,i){if(!t||t.length===0||r>=n)return t;let o=g(t,[r,n]),c=0,f=o.map(e=>{let u=c,s=c+e.text.length;if(c=s,u>=r&&s<=n&&e.formats[i]!==void 0){let{[i]:l,...S}=e.formats,a={text:e.text,formats:S};return e.descriptor&&(a.descriptor=e.descriptor),a}return e});return m(f)}function v(t,r,n){if(!t||t.length===0)return{};if(r===n){let f=0;for(let e of t){let u=f+e.text.length;if(r<u||r===u&&e===t[t.length-1])return{...e.formats};f=u}return{}}let i=[],o=0;for(let f of t){let e=o+f.text.length;e>r&&o<n&&i.push(f),o=e}if(i.length===0)return{};if(i.length===1)return{...i[0].formats};let c={...i[0].formats};for(let f=1;f<i.length;f++){let e=i[f].formats;for(let u of Object.keys(c))(!(u in e)||e[u]!==c[u])&&delete c[u]}return c}function A(t){if(!t)return"?";let r=(n,i=10)=>n.length>i?n.slice(0,i)+"\u2026":n;return t.mode==="binding"&&t.binding?r(t.binding.slice(1).join(".")):t.mode==="computed"&&t.computed||t.mode==="code"?"\u0192n\u2026":t.mode==="value"&&t.value!=null?r(String(t.value)):"\xA0"}function p(t,r){let n={text:r??t.text,formats:{...t.formats}};return t.descriptor&&(n.descriptor=t.descriptor),n}function g(t,r){let n=t.map(i=>p(i));for(let i of r){let o=[],c=0;for(let f of n){let e=c+f.text.length;if(f.descriptor)o.push(f);else if(i>c&&i<e){let u=i-c;o.push(p(f,f.text.slice(0,u))),o.push(p(f,f.text.slice(u)))}else o.push(f);c=e}n=o}return n}export{b as a,h as b,E as c,F as d,T as e,j as f,v as g,A as h};
@@ -0,0 +1 @@
1
+ var e=[{name:"Mobile",type:"mobile",min:320,editable:!1},{name:"Tablet",type:"mobile",min:768,editable:!1},{name:"Desktop",type:"desktop",min:1280,editable:!1}];export{e as a};
@@ -0,0 +1 @@
1
+ import{b as p,e as c}from"./chunk-4Q5R44ZZ.js";import{a as f}from"./chunk-HE7IQLGK.js";function s(o,t,l,{breakpoint:e="default",interactionState:i}={}){let r=f(e),n=i??o.get([t,".interactionState"])??[];return o.remove([t,"style",r,...n,l])}function m(o,t,l){o.update([t,"style","default"],(e={})=>({...e,display:l}))}var y={block:"block",flex:"flex",grid:"grid"};function b(o,t,l){let e=l==null||l===""?"none":l;p(o,t,{layout:e}),e==="none"?s(o,t,"display"):y[e]&&m(o,t,y[e]);let i=o.get([t,"children"])??[];for(let r of i)c(o,r,t);if(o.get([t,"type"])==="slot"){let r=o.findAllWhen("id","is",t);for(let n of r){let a=o.get(n.slice(0,-1));for(let u of a?.children??[])c(o,u,t)}}return{id:t,layout:e,childrenUpdated:i.length}}export{s as a,b};
@@ -1 +1 @@
1
- import{e as I,f as o,g as m,h as w,i as u}from"./chunk-UCLSDDOL.js";var A={PRIMITIVE:0,OBJECT:1,ARRAY:2,RESERVED:3},Ce=class _{constructor(e){this.flags=0,e!==void 0&&(typeof e=="function"?this.flags|=1:e instanceof Set||e instanceof Map?(this.value=e,this.originalType=A.PRIMITIVE):typeof e=="object"&&e!==null&&!Array.isArray(e)?(this._children=new Map(Object.entries(e).map(([t,r])=>[t,new _(r)])),this.flags|=16,this.originalType=A.OBJECT):Array.isArray(e)?(this._children=new Map(e.map((t,r)=>[r,new _(t)])),this.flags|=16,this.originalType=A.ARRAY):(this.value=e,this.originalType=A.PRIMITIVE))}get isFunction(){return(this.flags&1)!==0}set isFunction(e){this.flags=e?this.flags|1:this.flags&-2}get isSetOnce(){return(this.flags&2)!==0}set isSetOnce(e){this.flags=e?this.flags|2:this.flags&-3}get cached(){return(this.flags&4)!==0}set cached(e){this.flags=e?this.flags|4:this.flags&-5}get executed(){return(this.flags&8)!==0}set executed(e){this.flags=e?this.flags|8:this.flags&-9}get hasChildrenFlag(){return(this.flags&16)!==0}set hasChildrenFlag(e){this.flags=e?this.flags|16:this.flags&-17}get isFixed(){return(this.flags&32)!==0}set isFixed(e){this.flags=e?this.flags|32:this.flags&-33}get originalType(){return this.flags>>6&3}set originalType(e){this.flags=this.flags&-193|(e&3)<<6}get children(){return this._children||(this._children=new Map,this.hasChildrenFlag=!0),this._children}hasChildren(){return this.hasChildrenFlag&&this._children&&this._children.size>0}isEmpty(){return this.value===void 0&&(!this._children||this._children.size===0)}get cachedResult(){return this._cachedResult}set cachedResult(e){this._cachedResult=e}get cachedAt(){return this._cachedAt}set cachedAt(e){this._cachedAt=e}get(e){let t=e.shift();if(t===void 0){if(this.flags&1){if((this.flags&6)===6)return this.cachedResult;let r=this.value();return this.flags&2&&(this.flags|=4,this.cachedResult=r,this.cachedAt=Date.now()),this.flags|=8,r}return this.value!==void 0?this.value:this.hasChildren()?this._reconstructFromChildren():void 0}if(this._children?.has(t))return this._children.get(t).get(e)}set(e,t){let r=e.shift();if(r===void 0){if(this.isFixed)throw new Error("Cannot overwrite fixed value at path. Use clearFixed() first if you need to modify it.");return t instanceof Set||t instanceof Map?(this.value=t,this.flags=0,this.originalType=A.PRIMITIVE):typeof t=="object"&&t!==null&&!Array.isArray(t)&&typeof t!="function"?this._syncObjectChildren(t):Array.isArray(t)?this._syncArrayChildren(t):(this.value=t,this.flags=typeof t=="function"?1:0,this.originalType=A.PRIMITIVE),this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).set(e,t),this}setOnce(e,t){let r=e.shift();if(r===void 0){if(this.isFixed)throw new Error("Cannot overwrite fixed value at path. Use clearFixed() first if you need to modify it.");return t instanceof Set||t instanceof Map?(this.value=t,this.flags=2,this.originalType=A.PRIMITIVE):typeof t=="object"&&t!==null&&!Array.isArray(t)&&typeof t!="function"?(this._syncObjectChildren(t),this.flags=this.flags|2):Array.isArray(t)?(this._syncArrayChildren(t),this.flags=this.flags|2):(this.value=t,this.flags=typeof t=="function"?3:2,this.originalType=A.PRIMITIVE),this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).setOnce(e,t),this}has(e){let t=e.shift();return t===void 0?this.value!==void 0||this.hasChildren():this._children?.has(t)?this._children.get(t).has(e):!1}hasValue(e){let t=e.shift();return t===void 0?this.value!==void 0:this._children?.has(t)?this._children.get(t).hasValue(e):!1}remove(e){let t=e.shift();if(t===void 0)return this.value=void 0,this._children=void 0,this.flags=this.flags&-32,this;if(this._children?.has(t)){let r=this._children.get(t);r.remove(e),r.isEmpty()&&this._children.delete(t)}return this}clearCache(e){let t=e.shift();return t===void 0?(this.flags=this.flags&-5,this.cachedResult=null,this.cachedAt=null,this):(this._children?.has(t)&&this._children.get(t).clearCache(e),this)}fixed(e,t){let r=e.shift();if(r===void 0){if(this.value!==void 0&&this.isFixed)throw new Error("Value at path is already fixed and cannot be changed. Use clearFixed() first if needed.");return this.value=t,this.flags=(typeof t=="function"?1:0)|32,this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).fixed(e,t),this}clearFixed(e){let t=e.shift();return t===void 0?this.isFixed?(this.flags=this.flags&-33,this):(console.warn("Attempted to clear fixed flag on non-fixed value"),this):(this._children?.has(t)&&this._children.get(t).clearFixed(e),this)}isFixedValue(e){let t=e.shift();return t===void 0?this.isFixed:this._children?.has(t)?this._children.get(t).isFixedValue(e):!1}_syncObjectChildren(e){let t=new Set(Object.keys(e)),r=new Set(this.children.keys());for(let n of r)t.has(n)||this.children.delete(n);for(let[n,s]of Object.entries(e))if(this.children.has(n)||this.children.set(n,new _),typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof s!="function")this.children.get(n)._syncObjectChildren(s);else if(Array.isArray(s))this.children.get(n)._syncArrayChildren(s);else{let l=this.children.get(n);l.value=s,l.flags=typeof s=="function"?1:0}this.value=void 0,this.flags=this.flags&-2,this.originalType=A.OBJECT}_syncArrayChildren(e){let t=new Set(e.map((n,s)=>s)),r=new Set(this.children.keys());for(let n of r)typeof n=="number"&&!t.has(n)&&this.children.delete(n);for(let n=0;n<e.length;n++){let s=e[n];if(this.children.has(n)||this.children.set(n,new _),typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof s!="function")this.children.get(n)._syncObjectChildren(s);else if(Array.isArray(s))this.children.get(n)._syncArrayChildren(s);else{let l=this.children.get(n);l.value=s,l.flags=typeof s=="function"?1:0}}this.value=void 0,this.flags=this.flags&-2,this.originalType=A.ARRAY}_reconstructFromChildren(){if(!(!this._children||this._children.size===0))if(this.originalType===A.ARRAY){let e=[];for(let[t,r]of this._children)typeof t=="number"&&(e[t]=r.get([]));return e}else{let e={};for(let[t,r]of this._children)e[t]=r.get([]);return e}}},at=class Ee{static create(e){return new Ee(e)}constructor(e={}){return this.load(e)}load(e){return this.root=new Ce(e),this}get(e){let t=Array.isArray(e)?[...e]:[e];return this.root.get(t)}update(e,t){let r=Array.isArray(e)?[...e]:[e],n=this.root.get([...r]),s=t(n);return this.root.set([...r],s),this}set(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.set(r,t),this}setOnce(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.setOnce(r,t),this}fixed(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.fixed(r,t),this}has(e){let t=Array.isArray(e)?[...e]:[e];return this.root.has(t)}hasValue(e){let t=Array.isArray(e)?[...e]:[e];return this.root.hasValue(t)}remove(e){let t=Array.isArray(e)?[...e]:[e];return this.root.remove(t),this}clearCache(e){let t=Array.isArray(e)?[...e]:[e];return this.root.clearCache(t),this}clearFixed(e){let t=Array.isArray(e)?[...e]:[e];return this.root.clearFixed(t),this}isFixed(e){let t=Array.isArray(e)?[...e]:[e];return this.root.isFixedValue(t)}export(){return this._exportNode(this.root)}static import(e){let t=new Ee;return t.root=t._importNode(e),t}_exportNode(e){let t={flags:e.flags};if(e.isFunction)t.type="function",t.skipped=!0;else if(e.hasChildren()){t.type="map",t.value=[];for(let[r,n]of e._children)t.value.push([r,this._exportNode(n)]);e.value!==void 0&&(t.nodeValue=e.value)}else e.value!==void 0?(t.type="primitive",t.value=e.value):t.type="empty";return t}_importNode(e){let t=new Ce;switch(t.flags=e.flags||0,e.type){case"function":t.value=void 0,t.flags=t.flags&-16;break;case"primitive":t.value=e.value;break;case"map":if(e.value&&e.value.length>0){t._children=new Map;for(let[r,n]of e.value){let s=typeof r=="string"&&/^\d+$/.test(r)?parseInt(r,10):r;t._children.set(s,this._importNode(n))}t.hasChildrenFlag=!0}e.nodeValue!==void 0&&(t.value=e.nodeValue);break;case"empty":default:break}return t}};var B=Object.freeze(Object.create(null));function lt(i){if(globalThis.queueMicrotask&&typeof globalThis.queueMicrotask=="function"){globalThis.queueMicrotask(i);return}setTimeout(i,0)}var E,$,Be,ot=(Be=class{constructor(i,e){m(this,E);m(this,$);w(this,E,i),w(this,$,e)}on(i,e){return o(this,$).subscribe(i,B,o(this,E),e)}once(i,e){return o(this,$).once(i,B,o(this,E),e)}broadcast(i,...e){o(this,$).publish(i,o(this,E),B,e)}from(i){return{subscribe:(e,t)=>o(this,$).subscribe(e,i,o(this,E),t),once:(e,t)=>o(this,$).once(e,i,o(this,E),t)}}to(i){return{publish:(e,...t)=>o(this,$).publish(e,o(this,E),i,t),publishAsync:(e,...t)=>o(this,$).publishAsync(e,o(this,E),i,t)}}},E=new WeakMap,$=new WeakMap,Be),X,T,ee,Z,We,K,M,$e,ze,Ie,ht=(M=class{constructor({onError:e=null}={}){m(this,Z);m(this,X,new WeakMap);m(this,T,new Map);m(this,ee,null);w(this,ee,e),this.createChannel(B)}static create(e={}){return new M(e)}channel(e){return this.createChannel(e)}createChannel(e){if(o(this,X).has(e))return o(this,X).get(e);let t=new ot(e,this);return o(this,X).set(e,t),t}subscribe(e,t,r,n){let s={from:t,to:r,handler:n};return u(this,Z,We).call(this,e).add(s),()=>{let l=o(this,T).get(e);l&&l.delete(s)}}once(e,t,r,n){let s=null,l=a=>{try{n(a)}finally{s&&s()}};return s=this.subscribe(e,t,r,l),s}offAllFor(e){for(let t of o(this,T).values())for(let r of Array.from(t))(r.from===e||r.to===e)&&t.delete(r)}listenerCount(e){let t=o(this,T).get(e);return t?t.size:0}publish(e,t,r,n){u(this,Z,Ie).call(this,e,t,r,n)}publishAsync(e,t,r,n){lt(()=>u(this,Z,Ie).call(this,e,t,r,n))}broadcast(e,t,r){this.publish(e,t,B,r)}},X=new WeakMap,T=new WeakMap,ee=new WeakMap,Z=new WeakSet,We=function(e){let t=o(this,T).get(e);return t||(t=new Set,o(this,T).set(e,t)),t},K=new WeakSet,$e=function(e,t){return e===B||t===B||e===t},ze=function(e,t,r,n){var s,l;return u(s=M,K,$e).call(s,e,r)&&u(l=M,K,$e).call(l,t,n)},Ie=function(e,t,r,n){var l;let s=o(this,T).get(e);if(!(!s||s.size===0)){for(let a of s)if(a.to!==t&&u(l=M,K,ze).call(l,t,r,a.from,a.to))try{a.handler(...n)}catch(f){o(this,ee)&&o(this,ee).call(this,f,{event:e,from:t,to:r,listener:a})}}},m(M,K),M),H={trace:10,debug:20,info:30,warn:40,error:50,silent:90},N,C,x,J,ct=(J=class{constructor({level:e="info",sinks:t=[],base:r={}}={}){m(this,N);m(this,C);m(this,x);w(this,N,H[e]??H.info),w(this,C,t),w(this,x,r)}static create(e={}){return new J(e)}setLevel(e){w(this,N,H[e]??o(this,N))}child(e={},t=[]){return new J({level:this.level,sinks:[...o(this,C),...t],base:{...o(this,x),...e}})}get level(){return Object.entries(H).find(([e,t])=>t===o(this,N))?.[0]??"info"}log(e,t,r={}){if((H[e]??H.info)<o(this,N))return;let n={t:Date.now(),level:e,msg:t,...o(this,x),...r};for(let s of o(this,C))s(n)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}progress(e,t,r="",n={}){let s={t:Date.now(),type:"progress",level:"info",msg:r,current:e,total:t,message:r,percentage:Math.round(e/t*100),...o(this,x),...n};for(let l of o(this,C))l(s)}metric(e,t,r="ms",n={}){let s={t:Date.now(),type:"metric",level:"info",msg:`${e}: ${t}${r}`,name:e,value:t,unit:r,...o(this,x),...n};for(let l of o(this,C))l(s)}},N=new WeakMap,C=new WeakMap,x=new WeakMap,J),ut=i=>{let{t:e,level:t,msg:r,ns:n,...s}=i,l=new Date(e).toISOString(),a=t==="error"?console.error:t==="warn"?console.warn:console.log,f=`${n?`[${n}] `:""}${r}`;Object.keys(s).length>0?a(`[${l}] ${t.toUpperCase()} ${f}`,s):a(`[${l}] ${t.toUpperCase()} ${f}`)},ft=(i=1e3)=>{let e=[];return{sink:t=>{e.push(t),e.length>i&&e.shift()},read:()=>e.slice(),clear:()=>{e.length=0}}};function dt(i,e,t="value"){if(Array.isArray(e)){for(let n of e)if(xe(i,n))return!0;let r=e.map(de).join(" | ");throw new TypeError(`${t} must be one of: ${r}. Got ${de(i)}`)}if(!xe(i,e))throw new TypeError(`${t} must be ${de(e)}. Got ${de(i)}`);return!0}function xe(i,e){return e===String?typeof i=="string":e===Number?typeof i=="number"&&!isNaN(i):e===Boolean?typeof i=="boolean":e===Symbol?typeof i=="symbol":e===BigInt?typeof i=="bigint":e===Function?typeof i=="function":e===Array?Array.isArray(i):e===Object?i!==null&&typeof i=="object"&&!Array.isArray(i):i instanceof e}function de(i){return i===String?"String":i===Number?"Number":i===Boolean?"Boolean":i===Array?"Array":i===Object?"Object":i===Function?"Function":i===Date?"Date":i===RegExp?"RegExp":i===Promise?"Promise":i===Map?"Map":i===Set?"Set":i===WeakMap?"WeakMap":i===WeakSet?"WeakSet":i===Symbol?"Symbol":i===BigInt?"BigInt":i===Error?"Error":typeof i=="string"?"string":typeof i=="number"?"number":typeof i=="boolean"?"boolean":typeof i=="symbol"?"symbol":typeof i=="bigint"?"bigint":typeof i=="function"?"function":Array.isArray(i)?"Array":i===null?"null":i===void 0?"undefined":typeof i=="object"?i.constructor?.name||"Object":"unknown"}function ke(i,e="value"){return t=>dt(t,i,e)}var Ae=new Map,Se=new WeakMap,Re=i=>{if(Se.has(i))return Se.get(i)},ue=(i,e=[],...t)=>{let r=e.length>0?ke(e,"return value"):null;if(Ae.has(i))return console.warn(`Definition type "${i}" already exists`),Ae.get(i);let n=(...s)=>{if(s.length===0)throw new Error("At least one argument is required");let[l,a]=s,f=typeof l=="string"?l:void 0,d=typeof l=="function"?l:a;ke(Function,"factory")(d);let c=(...p)=>{try{let g=d.apply(null,[...p,...t]);if(r&&g===void 0)throw new Error(`Factory ${i} must return a value for ${f}`);return r&&r(g),g}catch(g){throw console.error(`Error creating definition "${f}"`,g),g}};return Object.defineProperty(c,"_name",{value:f,enumerable:!1,configurable:!1}),Se.set(c,i),c};return Ae.set(i,n),n},Oe=i=>i&&i.constructor&&i.constructor.name==="AsyncFunction",gt=(i,e)=>Oe(e)||i.some(Oe),Fe=(i,e)=>e.length===0?i:e.length===1&&Array.isArray(e[0])?e[0]:e,ge=i=>i?Array.isArray(i)?i:[i]:[],v=Object.freeze({MISSING_DEP:"MISSING_DEP",CYCLE:"CYCLE",NS_TAKEN:"NS_TAKEN",CONTRACT:"CONTRACT",RESERVED_NS:"RESERVED_NS",VERSION:"VERSION",INVALID_MANIFEST:"INVALID_MANIFEST"}),V=class extends Error{constructor(i,e,t={}){super(i),this.name="EngineError",this.code=e,Object.assign(this,t)}},pt=new Set(["__proto__","prototype","constructor"]),De=new Set(["use","install","uninstall","cache","relay","log","debug"]),we=64,be=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function ve(i,e="key"){if(pt.has(i))throw new Error(`Illegal key "${i}" in ${e}`)}function U(i){if(ve(i,"namespace"),typeof i!="string")throw new Error(`Namespace must be a string, got ${typeof i}`);if(!be.test(i))throw new Error(`Invalid namespace "${i}". Must be a valid JS identifier`);if(i.length>we)throw new Error(`Namespace "${i}" too long (max ${we} chars)`);if(De.has(i))throw new V(`Namespace "${i}" is reserved. Reserved namespaces: [${[...De].join(", ")}]`,v.RESERVED_NS,{namespace:i});return i}function Ve(i){let e=i?.manifest,t=e?.name??"<unknown service>";if(!e?.namespace||typeof i.install!="function")throw new Error(`${t} must have a namespace and install method`);if(U(e.namespace),Object.prototype.hasOwnProperty.call(e,"default"))throw new Error(`Manifest for "${t}" has a "default" key \u2014 did you mean "defaults"?`);if(e.defaults!=null&&(typeof e.defaults!="object"||Array.isArray(e.defaults)))throw new Error(`Manifest "defaults" for "${t}" must be a plain object`);if(e.dependencies!=null){if(!Array.isArray(e.dependencies))throw new Error(`Manifest "dependencies" for "${t}" must be an array`);for(let r of e.dependencies)if(!r?.manifest?.namespace||typeof r.install!="function")throw new Error(`Dependency of "${t}" is not an installable service (needs a manifest.namespace and install method)`)}return e.provides!=null&&Ge(e.provides,t),e.requires!=null&&yt(e.requires,t),e}function Ge(i,e="<unknown>"){if(typeof i!="object"||Array.isArray(i)||i===null)throw new Error(`Manifest "provides" for "${e}" must be a plain object`);for(let[t,r]of Object.entries(i)){if(ve(t,`provides:${e}`),!be.test(t))throw new Error(`Invalid provides key "${t}" in "${e}". Must be a valid JS identifier`);if(typeof r!="object"||Array.isArray(r)||r===null)throw new Error(`Provides descriptor for "${e}.${t}" must be a plain object`)}}function yt(i,e="<unknown>"){if(typeof i!="object"||Array.isArray(i)||i===null)throw new Error(`Manifest "requires" for "${e}" must be a plain object`);for(let[t,r]of Object.entries(i)){if(ve(t,`requires:${e}`),!be.test(t))throw new Error(`Invalid requires key "${t}" in "${e}". Must be a valid JS identifier`);if(typeof r!="string")throw new Error(`Requires range for "${e}" -> "${t}" must be a version string`)}}function Le(i,e,t="member"){if(ve(i,`${t}:${e}`),typeof i!="string")throw new Error(`${t} name in ${e} must be a string`);if(!be.test(i))throw new Error(`Invalid ${t} name "${i}" in ${e}`);if(i.length>we)throw new Error(`${t} name "${i}" in ${e} too long (max ${we})`);return i}var pe=()=>{let i=["DEVELOPMENT","TEST","DEV"];return typeof process<"u"?i.includes("production".toUpperCase()):typeof globalThis<"u"&&globalThis.__ENV__?.NODE_ENV?i.includes(globalThis.__ENV__.NODE_ENV.toUpperCase()):!1},mt=/^(\d+)\.(\d+)\.(\d+)(?:-[\w.]+)?$/;function Pe(i){let e=mt.exec(i);return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function qe(i,e){if(e==="*")return!0;let t=e[0]==="^"||e[0]==="~"?e[0]:"",r=t?e.slice(1):e,n=Pe(i),s=Pe(r);if(!n||!s)return!0;let[l,a,f]=n,[d,c,p]=s;return t==="^"?d>0?l===d&&(a>c||a===c&&f>=p):c>0?l===0&&a===c&&f>=p:l===0&&a===0&&f===p:t==="~"?l===d&&a===c&&f>=p:l===d&&a===c&&f===p}var oe=i=>i!=null&&typeof i.then=="function",Ue=new Set;function wt(i,e){let t=null,r=1/0;for(let n of e){let s=bt(i.toLowerCase(),n.toLowerCase());s<r&&s<=Math.max(2,Math.floor(i.length/2))&&(r=s,t=n)}return t}function bt(i,e){if(i.length===0)return e.length;if(e.length===0)return i.length;let t=Array.from({length:e.length+1},(r,n)=>n);for(let r=1;r<=i.length;r++){let n=r;for(let s=1;s<=e.length;s++){let l=i[r-1]===e[s-1]?0:1,a=Math.min(t[s]+1,n+1,t[s-1]+l);t[s-1]=n,n=a}t[e.length]=n}return t[e.length]}var j,te,re,W,k,R,z,G,Y,S,ie,h,ce,Ye,Je,Ze,ye,Ke,He,Qe,Xe,et,tt,Me,L,Te,rt,it,nt,st,je,me,P,_e,q,D,Tt=(D=class{constructor(e={}){m(this,h);m(this,j,new WeakMap);m(this,te,new WeakMap);m(this,re,new WeakMap);m(this,W,new WeakMap);m(this,k,new WeakMap);m(this,R,new WeakMap);m(this,z,new WeakMap);m(this,G);m(this,Y);m(this,S);m(this,ie);w(this,G,e),w(this,ie,at.create(e.cache)),w(this,Y,ht.create(e.relay)),w(this,S,ct.create({level:e.log?.level??(pe()?"debug":"info"),sinks:e.log?.sinks??[ut,ft(2e3).sink]}))}static create(){return new D}static configure(e={}){return{create:()=>new D(e)}}get cache(){return o(this,ie)}get relay(){return o(this,Y)}get log(){return o(this,S)}use(...e){return u(this,h,ye).call(this,e,this)}install(...e){return u(this,h,ce).call(this,this,e,new Set)}check(...e){return D.check(...e,{_installedManifests:u(this,h,L).call(this,this)})}static check(...e){let t=e[e.length-1],r=t&&typeof t=="object"&&"_installedManifests"in t,n=r?e.slice(0,-1):e,s=r?t._installedManifests:new Map,l=[],a=[],f=new Map;for(let[c,p]of s)f.set(c,p);let d=(c,p)=>{try{Ve(c)}catch(b){l.push({code:v.INVALID_MANIFEST,service:c?.manifest?.name||"<unknown>",message:b.message});return}let g=c.manifest,y=g.namespace;if(p.has(y)){l.push({code:v.CYCLE,chain:[...p,y],message:`Circular dependency: ${[...p,y].join(" -> ")}`});return}if(!f.has(y)){if(p.add(y),f.set(y,g),g.dependencies?.length)for(let b of g.dependencies)d(b,new Set(p));if(g.requires){let b=g.name||y;for(let[ae,fe]of Object.entries(g.requires)){let le=f.get(ae);if(!le){l.push({code:v.MISSING_DEP,service:b,requires:ae,message:`Service "${b}" requires "${ae}", but it is not in the service set`});continue}fe!=="*"&&le.version&&(qe(le.version,fe)||l.push({code:v.VERSION,service:b,requires:ae,expected:fe,actual:le.version,message:`Service "${b}" requires "${ae}" at "${fe}", but version is "${le.version}"`}))}}if(g.provides)try{Ge(g.provides,g.name||y)}catch(b){l.push({code:v.CONTRACT,namespace:y,message:b.message})}typeof c.install=="function"&&g.provides&&a.push({namespace:y,message:`Cannot verify that "${y}" actions match provides without running install()`}),p.delete(y)}};for(let c of n)d(c,new Set);return{ok:l.length===0,errors:l,warnings:a}}services(){let e=o(this,k).get(this),t=o(this,j).get(this);if(!e)return[];let r=[];for(let[n,s]of e){let l=t?.get(n),a=l?Object.keys(l):[];r.push({namespace:n,manifest:{...s},surface:a})}return r}graph(){let e=o(this,k).get(this);if(!e)return[];let t=[];for(let[r,n]of e){if(n.dependencies?.length)for(let s of n.dependencies)t.push({from:r,to:s.manifest?.namespace||"<unknown>"});if(n.requires)for(let s of Object.keys(n.requires))t.some(l=>l.from===r&&l.to===s)||t.push({from:r,to:s})}return t}trace(e,t){let r=o(this,re).get(this)?.get(e)||[],n=o(this,j).get(this)?.get(e),s=n&&t in n;return{namespace:e,action:t,exists:!!s,middleware:r.map((l,a)=>({index:a,name:l.name||"<anonymous>"}))}}uninstall(...e){return u(this,h,Ze).call(this,this,e)}},j=new WeakMap,te=new WeakMap,re=new WeakMap,W=new WeakMap,k=new WeakMap,R=new WeakMap,z=new WeakMap,G=new WeakMap,Y=new WeakMap,S=new WeakMap,ie=new WeakMap,h=new WeakSet,ce=function(e,t,r=new Set){let n=[...t],s=()=>{for(;n.length>0;){let l=u(this,h,Ye).call(this,e,n.shift(),r);if(oe(l))return l.then(s)}return u(this,h,Je).call(this,e),e};return s()},Ye=function(e,t,r){Ve(t);let n=t.manifest,s=n.namespace;if(r.has(s))throw new V(`Circular service dependency: ${[...r,s].join(" -> ")}`,v.CYCLE,{chain:[...r,s]});if(Object.prototype.hasOwnProperty.call(e,s)){let c=u(this,h,L).call(this,e).get(s),p=c?.name?` (owned by "${c.name}" v${c.version||"?"})`:"";throw new V(`Namespace "${s}" is already installed${p}. Use .configure() to create a unique instance, or .uninstall("${s}") first.`,v.NS_TAKEN,{namespace:s})}u(this,h,L).call(this,e).set(s,n);let l=t.config||t.manifest.defaults||{},a=u(this,h,P).call(this,e,s),f=u(this,h,_e).call(this,e,s,a,l,t.manifest);r.add(s);let d=()=>{n.requires&&u(this,h,tt).call(this,e,n);let c=u(this,h,q).call(this,e,s,a,l,t.manifest),p=t.install(c,l);if(oe(p))return p.then(g=>{u(this,h,ye).call(this,g,e),r.delete(s)});u(this,h,ye).call(this,p,e),r.delete(s)};if(t.manifest.dependencies?.length){let c=t.manifest.dependencies.filter(y=>y.unique),p=t.manifest.dependencies.filter(y=>!y.unique&&!Object.prototype.hasOwnProperty.call(e,y.manifest.namespace)),g;if(c.length>0&&(g=u(this,h,ce).call(this,f,c,r)),p.length>0&&(g=oe(g)?g.then(()=>u(this,h,ce).call(this,e,p,r)):u(this,h,ce).call(this,e,p,r)),oe(g))return g.then(d)}return d()},Je=function(e){let t=o(this,R).get(e);if(t?.size){for(let[r,n]of t)try{n()}finally{t.delete(r)}o(this,R).delete(e)}},Ze=function(e,t){let r=o(this,z).get(e),n=o(this,j).get(e),s=o(this,te).get(e),l=u(this,h,me).call(this,e);for(let a of t){r?.get(a)?.(),r?.delete(a);let f=n?.get(a);if(f&&o(this,Y).offAllFor(f),l?.delete(a),o(this,R).get(e)?.delete(a),o(this,W).get(e)?.delete(a),o(this,k).get(e)?.delete(a),Object.prototype.hasOwnProperty.call(e,a)&&delete e[a],n?.delete(a),s?.delete(a),s)for(let d of s.values())Object.prototype.hasOwnProperty.call(d,a)&&delete d[a]}return r&&r.size===0&&o(this,z).delete(e),this},ye=function(e,t=this){for(let r of e)if(r)switch(Re(r)){case"MIDDLEWARE":u(this,h,Qe).call(this,r,t);break;case"GETTERS":u(this,h,He).call(this,r,t);break;case"ACTIONS":u(this,h,Ke).call(this,r,t);break;case"INITIALIZE":u(this,h,Xe).call(this,r,t);break;case"UNINSTALL":u(this,h,et).call(this,r,t);break;default:throw new Error(`Unknown definition type: ${Re(r)}`)}return this},Ke=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s),a=u(this,h,me).call(this,t).get(r)||[];for(let[c,p]of Object.entries(l)){if(c=Le(c,r,"action"),Object.prototype.hasOwnProperty.call(n,c))throw new Error(`Action "${r}.${c}" already exists on this target`);let g=u(this,h,rt).call(this,r,c,p,n);if(a.length===0){n[c]=g;continue}let y=u(this,h,it).call(this,a,g);n[c]=(...b)=>y(c,{namespace:r,action:c,args:b})}let f=u(this,h,L).call(this,t).get(r);u(this,h,Me).call(this,r,Object.keys(l),f);let d=o(this,W).get(t);return d||(d=new Set,o(this,W).set(t,d)),d.add(r),u(this,h,Te).call(this,t,r,n)},He=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s);for(let[f,d]of Object.entries(l)){Le(f,r,"getter");let c=d.bind(n);Object.defineProperty(n,f,{get:()=>c(),enumerable:!0,configurable:!1})}let a=u(this,h,L).call(this,t).get(r);return u(this,h,Me).call(this,r,Object.keys(l),a),u(this,h,Te).call(this,t,r,n)},Qe=function(e,t=this){let r=U(e._name);if(o(this,W).get(t)?.has(r))throw new Error(`Middleware for "${r}" must be installed before its actions (middleware does not apply retroactively)`);let n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s),a=u(this,h,me).call(this,t),f=a.get(r)||[],d=ge(l).map(c=>{if(typeof c!="function")throw new Error("Middleware must be a function");return c});return a.set(r,f.concat(d)),this},Xe=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=()=>e(s),a=o(this,R).get(t);return a||(a=new Map,o(this,R).set(t,a)),a.set(r,l),this},et=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=()=>e(s),a=o(this,z).get(t);return a||(a=new Map,o(this,z).set(t,a)),a.set(r,l),this},tt=function(e,t){let r=t.name||t.namespace,n=u(this,h,L).call(this,e);for(let[s,l]of Object.entries(t.requires)){let a=n.get(s);if(!a){let f=[...n.keys()].filter(d=>d!==t.namespace);throw new V(`Service "${r}" requires "${s}", but it is not installed. Installed namespaces: [${f.join(", ")}]`,v.MISSING_DEP,{service:r,requires:s})}if(l!=="*"&&a.version&&!qe(a.version,l))throw new V(`Service "${r}" requires "${s}" at version "${l}", but installed version is "${a.version}"`,v.VERSION,{service:r,requires:s,expected:l,actual:a.version})}},Me=function(e,t,r){if(!r?.provides)return;let n=Object.keys(r.provides),s=new Set(t),l=n.filter(f=>!s.has(f)),a=[...s].filter(f=>!n.includes(f));if(l.length>0)throw new V(`Contract violation in "${e}": manifest.provides declares [${l.join(", ")}] but the implementation does not provide them`,v.CONTRACT,{namespace:e,missing:l});a.length>0&&pe()&&o(this,S).warn(`Service "${e}" provides [${a.join(", ")}] not declared in manifest.provides. Consider adding them to the contract.`)},L=function(e){let t=o(this,k).get(e);return t||(t=new Map,o(this,k).set(e,t)),t},Te=function(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)?r=e[t]:Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),o(this,j).get(e)?.set(t,r),e},rt=function(e,t,r,n){let s=r.bind(n),l=a=>{throw a.action=t,a.namespace=e,o(this,S).error(`Error in action "${e}.${t}"`,{error:a}),a};return Oe(s)?async(...a)=>{try{return await s(...a)}catch(f){l(f)}}:(...a)=>{try{return s(...a)}catch(f){l(f)}}},it=function(e,t){return gt(ge(e),t)?u(this,h,st).call(this,e,t):u(this,h,nt).call(this,e,t)},nt=function(e,t){let r=ge(e);return(n,s)=>{let l=-1,a=(f,d)=>{if(f<=l)throw new Error("next() called multiple times");l=f;let c=r[f];if(!c){let g=t(...d);if(pe()&&oe(g)){let y=`${s.namespace}.${n}`;Ue.has(y)||(Ue.add(y),o(this,S).warn(`Action "${y}" returned a Promise but is not declared async; its middleware composes synchronously, so code after next() runs before the action settles. Declare the action async to compose the chain asynchronously.`))}return g}let p={...s,args:d};return u(this,h,je).call(this,c,n,p,(...g)=>{let y=Fe(d,g);return a(f+1,y)})};return a(0,s.args)}},st=function(e,t){let r=ge(e);return async(n,s)=>{let l=-1,a=async(f,d)=>{if(f<=l)throw new Error("next() called multiple times");l=f;let c=r[f];if(!c)return await t(...d);let p={...s,args:d};return await u(this,h,je).call(this,c,n,p,(...g)=>{let y=Fe(d,g);return a(f+1,y)})};return a(0,s.args)}},je=function(e,t,r,n){try{return e(t,r,n)}catch(s){throw s.middleware=e.name||"<anon>",s.action=t,s}},me=function(e){let t=o(this,re).get(e);return t||(t=new Map,o(this,re).set(e,t)),t},P=function(e,t){let r=o(this,j).get(e);if(r||(r=new Map,o(this,j).set(e,r)),r.has(t))return r.get(t);let n=Object.create(null);return r.set(t,n),n},_e=function(e,t,r,n=o(this,G)||{},s={}){let l=o(this,te).get(e);if(l||(l=new Map,o(this,te).set(e,l)),l.has(t))return l.get(t);let a={log:o(this,S).child({ns:t},s.log?.sinks||[]),relay:o(this,Y).createChannel(r),cache:o(this,ie),config:n},f=new Proxy(a,{get(d,c,p){return c in d?Reflect.get(d,c,p):Reflect.get(e,c,p)},has(d,c){return c in d||c in e}});return l.set(t,f),f},q=function(e,t,r,n=o(this,G)||{},s={}){let l=o(this,G)?.strictInject===!0;return(...a)=>{let f=u(this,h,_e).call(this,e,t,r,n,s);if(!a||a.length===0)return f;for(let c of a)if(!(c in f)){let p=Object.keys(f),g=wt(c,p),y=`inject("${c}") in "${t}" resolved to undefined \u2014 "${c}" is not an installed namespace or built-in. Available: [${p.join(", ")}]`+(g?`. Did you mean "${g}"?`:"");if(l)throw new V(y,v.MISSING_DEP,{service:t,requires:c});pe()&&o(this,S).warn(y)}if(a.length===1)return f[a[0]];let d=new Array(a.length);for(let c=0;c<a.length;c++)d[c]=f[a[c]];return d}},D),vt=ue("MIDDLEWARE",[Function,Array]),At=ue("ACTIONS",[Object]),Et=ue("UNINSTALL"),$t=ue("INITIALIZE"),It=ue("GETTERS",[Object]),ne,Ne,O,F,Q,se,St=(se=class{constructor(e){m(this,F);m(this,ne);m(this,Ne);m(this,O,{MIDDLEWARE:null,GETTERS:null,ACTIONS:null,INITIALIZE:null,UNINSTALL:null});I(this,"defineMiddleware",e=>u(this,F,Q).call(this,"MIDDLEWARE",e,vt));I(this,"defineGetters",e=>u(this,F,Q).call(this,"GETTERS",e,It));I(this,"defineActions",e=>u(this,F,Q).call(this,"ACTIONS",e,At));I(this,"defineInitialize",e=>u(this,F,Q).call(this,"INITIALIZE",e,$t));I(this,"defineUninstall",e=>u(this,F,Q).call(this,"UNINSTALL",e,Et));w(this,ne,e)}static create(e){return new se(e)}_toArray(){return[o(this,O).MIDDLEWARE,o(this,O).GETTERS,o(this,O).ACTIONS,o(this,O).INITIALIZE,o(this,O).UNINSTALL].filter(Boolean)}},ne=new WeakMap,Ne=new WeakMap,O=new WeakMap,F=new WeakSet,Q=function(e,t,r){if(o(this,O)[e])throw new Error(`${e} already defined for ${o(this,ne)}`);o(this,O)[e]=r(o(this,ne),t)},se);function Ot({namespace:i,version:e="1.0.0",provides:t={},overrides:r={}}={}){var s;if(!i)throw new Error("stub() requires a namespace");let n={};for(let[l,a]of Object.entries(t))r[l]?n[l]=r[l]:a.async?n[l]=async()=>{}:n[l]=()=>{};return s=class extends Mt{actions(){return n}},I(s,"manifest",{name:`Stub<${i}>`,namespace:i,version:e,provides:t}),s}var he,Mt=(he=class{static stub(i){return Ot(i)}static configure(i={}){return{install:(e,t)=>this.install(e,t),manifest:this.manifest,config:{...this.config||this.manifest.defaults||{},...i},unique:!0,configured:!0}}static install(i,e){let{namespace:t}=this.manifest;U(t);let r=new this;Object.defineProperty(r,"config",{value:Object.freeze({...e}),writable:!1,configurable:!1,enumerable:!1}),Object.defineProperty(r,"inject",{value:(...s)=>i(...s),writable:!1,configurable:!1,enumerable:!1});let n=St.create(t);if(r.setup){let s={defineActions:a=>n.defineActions(()=>a(i,e)),defineMiddleware:a=>n.defineMiddleware(()=>a(i,e)),defineGetters:a=>n.defineGetters(()=>a(i,e)),defineInitialize:a=>n.defineInitialize(()=>a(i,e)),defineUninstall:a=>n.defineUninstall(()=>a(i,e))},l=r.setup(s,i,e);return l?.then?l.then(()=>n._toArray()):n._toArray()}return r.middleware&&n.defineMiddleware(()=>r.middleware(i,e)),r.getters&&n.defineGetters(()=>r.getters(i,e)),r.actions&&n.defineActions(()=>r.actions(i,e)),r.initialize&&n.defineInitialize(()=>r.initialize(i,e)),r.uninstall&&n.defineUninstall(()=>r.uninstall(i,e)),n._toArray()}},I(he,"manifest",{name:"base",dependencies:[],version:"1.0.0",description:"Base extension template"}),I(he,"config",null),I(he,"unique",!1),he),jt=Symbol("jucie.engine");var Lt=(i=21)=>crypto.getRandomValues(new Uint8Array(i)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");export{ue as a,Tt as b,Mt as c,Lt as d};
1
+ import{e as I,f as o,g as m,h as w,i as u}from"./chunk-UCLSDDOL.js";var A={PRIMITIVE:0,OBJECT:1,ARRAY:2,RESERVED:3},Ce=class _{constructor(e){this.flags=0,e!==void 0&&(typeof e=="function"?this.flags|=1:e instanceof Set||e instanceof Map?(this.value=e,this.originalType=A.PRIMITIVE):typeof e=="object"&&e!==null&&!Array.isArray(e)?(this._children=new Map(Object.entries(e).map(([t,r])=>[t,new _(r)])),this.flags|=16,this.originalType=A.OBJECT):Array.isArray(e)?(this._children=new Map(e.map((t,r)=>[r,new _(t)])),this.flags|=16,this.originalType=A.ARRAY):(this.value=e,this.originalType=A.PRIMITIVE))}get isFunction(){return(this.flags&1)!==0}set isFunction(e){this.flags=e?this.flags|1:this.flags&-2}get isSetOnce(){return(this.flags&2)!==0}set isSetOnce(e){this.flags=e?this.flags|2:this.flags&-3}get cached(){return(this.flags&4)!==0}set cached(e){this.flags=e?this.flags|4:this.flags&-5}get executed(){return(this.flags&8)!==0}set executed(e){this.flags=e?this.flags|8:this.flags&-9}get hasChildrenFlag(){return(this.flags&16)!==0}set hasChildrenFlag(e){this.flags=e?this.flags|16:this.flags&-17}get isFixed(){return(this.flags&32)!==0}set isFixed(e){this.flags=e?this.flags|32:this.flags&-33}get originalType(){return this.flags>>6&3}set originalType(e){this.flags=this.flags&-193|(e&3)<<6}get children(){return this._children||(this._children=new Map,this.hasChildrenFlag=!0),this._children}hasChildren(){return this.hasChildrenFlag&&this._children&&this._children.size>0}isEmpty(){return this.value===void 0&&(!this._children||this._children.size===0)}get cachedResult(){return this._cachedResult}set cachedResult(e){this._cachedResult=e}get cachedAt(){return this._cachedAt}set cachedAt(e){this._cachedAt=e}get(e){let t=e.shift();if(t===void 0){if(this.flags&1){if((this.flags&6)===6)return this.cachedResult;let r=this.value();return this.flags&2&&(this.flags|=4,this.cachedResult=r,this.cachedAt=Date.now()),this.flags|=8,r}return this.value!==void 0?this.value:this.hasChildren()?this._reconstructFromChildren():void 0}if(this._children?.has(t))return this._children.get(t).get(e)}set(e,t){let r=e.shift();if(r===void 0){if(this.isFixed)throw new Error("Cannot overwrite fixed value at path. Use clearFixed() first if you need to modify it.");return t instanceof Set||t instanceof Map?(this.value=t,this.flags=0,this.originalType=A.PRIMITIVE):typeof t=="object"&&t!==null&&!Array.isArray(t)&&typeof t!="function"?this._syncObjectChildren(t):Array.isArray(t)?this._syncArrayChildren(t):(this.value=t,this.flags=typeof t=="function"?1:0,this.originalType=A.PRIMITIVE),this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).set(e,t),this}setOnce(e,t){let r=e.shift();if(r===void 0){if(this.isFixed)throw new Error("Cannot overwrite fixed value at path. Use clearFixed() first if you need to modify it.");return t instanceof Set||t instanceof Map?(this.value=t,this.flags=2,this.originalType=A.PRIMITIVE):typeof t=="object"&&t!==null&&!Array.isArray(t)&&typeof t!="function"?(this._syncObjectChildren(t),this.flags=this.flags|2):Array.isArray(t)?(this._syncArrayChildren(t),this.flags=this.flags|2):(this.value=t,this.flags=typeof t=="function"?3:2,this.originalType=A.PRIMITIVE),this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).setOnce(e,t),this}has(e){let t=e.shift();return t===void 0?this.value!==void 0||this.hasChildren():this._children?.has(t)?this._children.get(t).has(e):!1}hasValue(e){let t=e.shift();return t===void 0?this.value!==void 0:this._children?.has(t)?this._children.get(t).hasValue(e):!1}remove(e){let t=e.shift();if(t===void 0)return this.value=void 0,this._children=void 0,this.flags=this.flags&-32,this;if(this._children?.has(t)){let r=this._children.get(t);r.remove(e),r.isEmpty()&&this._children.delete(t)}return this}clearCache(e){let t=e.shift();return t===void 0?(this.flags=this.flags&-5,this.cachedResult=null,this.cachedAt=null,this):(this._children?.has(t)&&this._children.get(t).clearCache(e),this)}fixed(e,t){let r=e.shift();if(r===void 0){if(this.value!==void 0&&this.isFixed)throw new Error("Value at path is already fixed and cannot be changed. Use clearFixed() first if needed.");return this.value=t,this.flags=(typeof t=="function"?1:0)|32,this}let n=this.children;return n.has(r)||n.set(r,new _),n.get(r).fixed(e,t),this}clearFixed(e){let t=e.shift();return t===void 0?this.isFixed?(this.flags=this.flags&-33,this):(console.warn("Attempted to clear fixed flag on non-fixed value"),this):(this._children?.has(t)&&this._children.get(t).clearFixed(e),this)}isFixedValue(e){let t=e.shift();return t===void 0?this.isFixed:this._children?.has(t)?this._children.get(t).isFixedValue(e):!1}_syncObjectChildren(e){let t=new Set(Object.keys(e)),r=new Set(this.children.keys());for(let n of r)t.has(n)||this.children.delete(n);for(let[n,s]of Object.entries(e))if(this.children.has(n)||this.children.set(n,new _),typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof s!="function")this.children.get(n)._syncObjectChildren(s);else if(Array.isArray(s))this.children.get(n)._syncArrayChildren(s);else{let l=this.children.get(n);l.value=s,l.flags=typeof s=="function"?1:0}this.value=void 0,this.flags=this.flags&-2,this.originalType=A.OBJECT}_syncArrayChildren(e){let t=new Set(e.map((n,s)=>s)),r=new Set(this.children.keys());for(let n of r)typeof n=="number"&&!t.has(n)&&this.children.delete(n);for(let n=0;n<e.length;n++){let s=e[n];if(this.children.has(n)||this.children.set(n,new _),typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof s!="function")this.children.get(n)._syncObjectChildren(s);else if(Array.isArray(s))this.children.get(n)._syncArrayChildren(s);else{let l=this.children.get(n);l.value=s,l.flags=typeof s=="function"?1:0}}this.value=void 0,this.flags=this.flags&-2,this.originalType=A.ARRAY}_reconstructFromChildren(){if(!(!this._children||this._children.size===0))if(this.originalType===A.ARRAY){let e=[];for(let[t,r]of this._children)typeof t=="number"&&(e[t]=r.get([]));return e}else{let e={};for(let[t,r]of this._children)e[t]=r.get([]);return e}}},at=class Ee{static create(e){return new Ee(e)}constructor(e={}){return this.load(e)}load(e){return this.root=new Ce(e),this}get(e){let t=Array.isArray(e)?[...e]:[e];return this.root.get(t)}update(e,t){let r=Array.isArray(e)?[...e]:[e],n=this.root.get([...r]),s=t(n);return this.root.set([...r],s),this}set(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.set(r,t),this}setOnce(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.setOnce(r,t),this}fixed(e,t){let r=Array.isArray(e)?[...e]:[e];return this.root.fixed(r,t),this}has(e){let t=Array.isArray(e)?[...e]:[e];return this.root.has(t)}hasValue(e){let t=Array.isArray(e)?[...e]:[e];return this.root.hasValue(t)}remove(e){let t=Array.isArray(e)?[...e]:[e];return this.root.remove(t),this}clearCache(e){let t=Array.isArray(e)?[...e]:[e];return this.root.clearCache(t),this}clearFixed(e){let t=Array.isArray(e)?[...e]:[e];return this.root.clearFixed(t),this}isFixed(e){let t=Array.isArray(e)?[...e]:[e];return this.root.isFixedValue(t)}export(){return this._exportNode(this.root)}static import(e){let t=new Ee;return t.root=t._importNode(e),t}_exportNode(e){let t={flags:e.flags};if(e.isFunction)t.type="function",t.skipped=!0;else if(e.hasChildren()){t.type="map",t.value=[];for(let[r,n]of e._children)t.value.push([r,this._exportNode(n)]);e.value!==void 0&&(t.nodeValue=e.value)}else e.value!==void 0?(t.type="primitive",t.value=e.value):t.type="empty";return t}_importNode(e){let t=new Ce;switch(t.flags=e.flags||0,e.type){case"function":t.value=void 0,t.flags=t.flags&-16;break;case"primitive":t.value=e.value;break;case"map":if(e.value&&e.value.length>0){t._children=new Map;for(let[r,n]of e.value){let s=typeof r=="string"&&/^\d+$/.test(r)?parseInt(r,10):r;t._children.set(s,this._importNode(n))}t.hasChildrenFlag=!0}e.nodeValue!==void 0&&(t.value=e.nodeValue);break;case"empty":default:break}return t}};var B=Object.freeze(Object.create(null));function lt(i){if(globalThis.queueMicrotask&&typeof globalThis.queueMicrotask=="function"){globalThis.queueMicrotask(i);return}setTimeout(i,0)}var E,$,Be,ot=(Be=class{constructor(i,e){m(this,E);m(this,$);w(this,E,i),w(this,$,e)}on(i,e){return o(this,$).subscribe(i,B,o(this,E),e)}once(i,e){return o(this,$).once(i,B,o(this,E),e)}broadcast(i,...e){o(this,$).publish(i,o(this,E),B,e)}from(i){return{subscribe:(e,t)=>o(this,$).subscribe(e,i,o(this,E),t),once:(e,t)=>o(this,$).once(e,i,o(this,E),t)}}to(i){return{publish:(e,...t)=>o(this,$).publish(e,o(this,E),i,t),publishAsync:(e,...t)=>o(this,$).publishAsync(e,o(this,E),i,t)}}},E=new WeakMap,$=new WeakMap,Be),X,T,ee,Z,We,K,M,$e,ze,Ie,ht=(M=class{constructor({onError:e=null}={}){m(this,Z);m(this,X,new WeakMap);m(this,T,new Map);m(this,ee,null);w(this,ee,e),this.createChannel(B)}static create(e={}){return new M(e)}channel(e){return this.createChannel(e)}createChannel(e){if(o(this,X).has(e))return o(this,X).get(e);let t=new ot(e,this);return o(this,X).set(e,t),t}subscribe(e,t,r,n){let s={from:t,to:r,handler:n};return u(this,Z,We).call(this,e).add(s),()=>{let l=o(this,T).get(e);l&&l.delete(s)}}once(e,t,r,n){let s=null,l=a=>{try{n(a)}finally{s&&s()}};return s=this.subscribe(e,t,r,l),s}offAllFor(e){for(let t of o(this,T).values())for(let r of Array.from(t))(r.from===e||r.to===e)&&t.delete(r)}listenerCount(e){let t=o(this,T).get(e);return t?t.size:0}publish(e,t,r,n){u(this,Z,Ie).call(this,e,t,r,n)}publishAsync(e,t,r,n){lt(()=>u(this,Z,Ie).call(this,e,t,r,n))}broadcast(e,t,r){this.publish(e,t,B,r)}},X=new WeakMap,T=new WeakMap,ee=new WeakMap,Z=new WeakSet,We=function(e){let t=o(this,T).get(e);return t||(t=new Set,o(this,T).set(e,t)),t},K=new WeakSet,$e=function(e,t){return e===B||t===B||e===t},ze=function(e,t,r,n){var s,l;return u(s=M,K,$e).call(s,e,r)&&u(l=M,K,$e).call(l,t,n)},Ie=function(e,t,r,n){var l;let s=o(this,T).get(e);if(!(!s||s.size===0)){for(let a of s)if(a.to!==t&&u(l=M,K,ze).call(l,t,r,a.from,a.to))try{a.handler(...n)}catch(f){o(this,ee)&&o(this,ee).call(this,f,{event:e,from:t,to:r,listener:a})}}},m(M,K),M),H={trace:10,debug:20,info:30,warn:40,error:50,silent:90},N,C,x,J,ct=(J=class{constructor({level:e="info",sinks:t=[],base:r={}}={}){m(this,N);m(this,C);m(this,x);w(this,N,H[e]??H.info),w(this,C,t),w(this,x,r)}static create(e={}){return new J(e)}setLevel(e){w(this,N,H[e]??o(this,N))}child(e={},t=[]){return new J({level:this.level,sinks:[...o(this,C),...t],base:{...o(this,x),...e}})}get level(){return Object.entries(H).find(([e,t])=>t===o(this,N))?.[0]??"info"}log(e,t,r={}){if((H[e]??H.info)<o(this,N))return;let n={t:Date.now(),level:e,msg:t,...o(this,x),...r};for(let s of o(this,C))s(n)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}progress(e,t,r="",n={}){let s={t:Date.now(),type:"progress",level:"info",msg:r,current:e,total:t,message:r,percentage:Math.round(e/t*100),...o(this,x),...n};for(let l of o(this,C))l(s)}metric(e,t,r="ms",n={}){let s={t:Date.now(),type:"metric",level:"info",msg:`${e}: ${t}${r}`,name:e,value:t,unit:r,...o(this,x),...n};for(let l of o(this,C))l(s)}},N=new WeakMap,C=new WeakMap,x=new WeakMap,J),ut=i=>{let{t:e,level:t,msg:r,ns:n,...s}=i,l=new Date(e).toISOString(),a=t==="error"?console.error:t==="warn"?console.warn:console.log,f=`${n?`[${n}] `:""}${r}`;Object.keys(s).length>0?a(`[${l}] ${t.toUpperCase()} ${f}`,s):a(`[${l}] ${t.toUpperCase()} ${f}`)},ft=(i=1e3)=>{let e=[];return{sink:t=>{e.push(t),e.length>i&&e.shift()},read:()=>e.slice(),clear:()=>{e.length=0}}};function dt(i,e,t="value"){if(Array.isArray(e)){for(let n of e)if(xe(i,n))return!0;let r=e.map(de).join(" | ");throw new TypeError(`${t} must be one of: ${r}. Got ${de(i)}`)}if(!xe(i,e))throw new TypeError(`${t} must be ${de(e)}. Got ${de(i)}`);return!0}function xe(i,e){return e===String?typeof i=="string":e===Number?typeof i=="number"&&!isNaN(i):e===Boolean?typeof i=="boolean":e===Symbol?typeof i=="symbol":e===BigInt?typeof i=="bigint":e===Function?typeof i=="function":e===Array?Array.isArray(i):e===Object?i!==null&&typeof i=="object"&&!Array.isArray(i):i instanceof e}function de(i){return i===String?"String":i===Number?"Number":i===Boolean?"Boolean":i===Array?"Array":i===Object?"Object":i===Function?"Function":i===Date?"Date":i===RegExp?"RegExp":i===Promise?"Promise":i===Map?"Map":i===Set?"Set":i===WeakMap?"WeakMap":i===WeakSet?"WeakSet":i===Symbol?"Symbol":i===BigInt?"BigInt":i===Error?"Error":typeof i=="string"?"string":typeof i=="number"?"number":typeof i=="boolean"?"boolean":typeof i=="symbol"?"symbol":typeof i=="bigint"?"bigint":typeof i=="function"?"function":Array.isArray(i)?"Array":i===null?"null":i===void 0?"undefined":typeof i=="object"?i.constructor?.name||"Object":"unknown"}function ke(i,e="value"){return t=>dt(t,i,e)}var Ae=new Map,Se=new WeakMap,Re=i=>{if(Se.has(i))return Se.get(i)},ue=(i,e=[],...t)=>{let r=e.length>0?ke(e,"return value"):null;if(Ae.has(i))return console.warn(`Definition type "${i}" already exists`),Ae.get(i);let n=(...s)=>{if(s.length===0)throw new Error("At least one argument is required");let[l,a]=s,f=typeof l=="string"?l:void 0,d=typeof l=="function"?l:a;ke(Function,"factory")(d);let c=(...p)=>{try{let g=d.apply(null,[...p,...t]);if(r&&g===void 0)throw new Error(`Factory ${i} must return a value for ${f}`);return r&&r(g),g}catch(g){throw console.error(`Error creating definition "${f}"`,g),g}};return Object.defineProperty(c,"_name",{value:f,enumerable:!1,configurable:!1}),Se.set(c,i),c};return Ae.set(i,n),n},Oe=i=>i&&i.constructor&&i.constructor.name==="AsyncFunction",gt=(i,e)=>Oe(e)||i.some(Oe),Fe=(i,e)=>e.length===0?i:e.length===1&&Array.isArray(e[0])?e[0]:e,ge=i=>i?Array.isArray(i)?i:[i]:[],v=Object.freeze({MISSING_DEP:"MISSING_DEP",CYCLE:"CYCLE",NS_TAKEN:"NS_TAKEN",CONTRACT:"CONTRACT",RESERVED_NS:"RESERVED_NS",VERSION:"VERSION",INVALID_MANIFEST:"INVALID_MANIFEST"}),V=class extends Error{constructor(i,e,t={}){super(i),this.name="EngineError",this.code=e,Object.assign(this,t)}},pt=new Set(["__proto__","prototype","constructor"]),De=new Set(["use","install","uninstall","cache","relay","log","debug"]),we=64,be=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function ve(i,e="key"){if(pt.has(i))throw new Error(`Illegal key "${i}" in ${e}`)}function U(i){if(ve(i,"namespace"),typeof i!="string")throw new Error(`Namespace must be a string, got ${typeof i}`);if(!be.test(i))throw new Error(`Invalid namespace "${i}". Must be a valid JS identifier`);if(i.length>we)throw new Error(`Namespace "${i}" too long (max ${we} chars)`);if(De.has(i))throw new V(`Namespace "${i}" is reserved. Reserved namespaces: [${[...De].join(", ")}]`,v.RESERVED_NS,{namespace:i});return i}function Ve(i){let e=i?.manifest,t=e?.name??"<unknown service>";if(!e?.namespace||typeof i.install!="function")throw new Error(`${t} must have a namespace and install method`);if(U(e.namespace),Object.prototype.hasOwnProperty.call(e,"default"))throw new Error(`Manifest for "${t}" has a "default" key \u2014 did you mean "defaults"?`);if(e.defaults!=null&&(typeof e.defaults!="object"||Array.isArray(e.defaults)))throw new Error(`Manifest "defaults" for "${t}" must be a plain object`);if(e.dependencies!=null){if(!Array.isArray(e.dependencies))throw new Error(`Manifest "dependencies" for "${t}" must be an array`);for(let r of e.dependencies)if(!r?.manifest?.namespace||typeof r.install!="function")throw new Error(`Dependency of "${t}" is not an installable service (needs a manifest.namespace and install method)`)}return e.provides!=null&&Ge(e.provides,t),e.requires!=null&&yt(e.requires,t),e}function Ge(i,e="<unknown>"){if(typeof i!="object"||Array.isArray(i)||i===null)throw new Error(`Manifest "provides" for "${e}" must be a plain object`);for(let[t,r]of Object.entries(i)){if(ve(t,`provides:${e}`),!be.test(t))throw new Error(`Invalid provides key "${t}" in "${e}". Must be a valid JS identifier`);if(typeof r!="object"||Array.isArray(r)||r===null)throw new Error(`Provides descriptor for "${e}.${t}" must be a plain object`)}}function yt(i,e="<unknown>"){if(typeof i!="object"||Array.isArray(i)||i===null)throw new Error(`Manifest "requires" for "${e}" must be a plain object`);for(let[t,r]of Object.entries(i)){if(ve(t,`requires:${e}`),!be.test(t))throw new Error(`Invalid requires key "${t}" in "${e}". Must be a valid JS identifier`);if(typeof r!="string")throw new Error(`Requires range for "${e}" -> "${t}" must be a version string`)}}function Le(i,e,t="member"){if(ve(i,`${t}:${e}`),typeof i!="string")throw new Error(`${t} name in ${e} must be a string`);if(!be.test(i))throw new Error(`Invalid ${t} name "${i}" in ${e}`);if(i.length>we)throw new Error(`${t} name "${i}" in ${e} too long (max ${we})`);return i}var pe=()=>{let i=["DEVELOPMENT","TEST","DEV"];return typeof process<"u"?i.includes("production".toUpperCase()):typeof globalThis<"u"&&globalThis.__ENV__?.NODE_ENV?i.includes(globalThis.__ENV__.NODE_ENV.toUpperCase()):!1},mt=/^(\d+)\.(\d+)\.(\d+)(?:-[\w.]+)?$/;function Pe(i){let e=mt.exec(i);return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function qe(i,e){if(e==="*")return!0;let t=e[0]==="^"||e[0]==="~"?e[0]:"",r=t?e.slice(1):e,n=Pe(i),s=Pe(r);if(!n||!s)return!0;let[l,a,f]=n,[d,c,p]=s;return t==="^"?d>0?l===d&&(a>c||a===c&&f>=p):c>0?l===0&&a===c&&f>=p:l===0&&a===0&&f===p:t==="~"?l===d&&a===c&&f>=p:l===d&&a===c&&f===p}var oe=i=>i!=null&&typeof i.then=="function",Ue=new Set;function wt(i,e){let t=null,r=1/0;for(let n of e){let s=bt(i.toLowerCase(),n.toLowerCase());s<r&&s<=Math.max(2,Math.floor(i.length/2))&&(r=s,t=n)}return t}function bt(i,e){if(i.length===0)return e.length;if(e.length===0)return i.length;let t=Array.from({length:e.length+1},(r,n)=>n);for(let r=1;r<=i.length;r++){let n=r;for(let s=1;s<=e.length;s++){let l=i[r-1]===e[s-1]?0:1,a=Math.min(t[s]+1,n+1,t[s-1]+l);t[s-1]=n,n=a}t[e.length]=n}return t[e.length]}var j,te,re,W,k,R,z,G,Y,S,ie,h,ce,Ye,Je,Ze,ye,Ke,He,Qe,Xe,et,tt,Me,L,Te,rt,it,nt,st,je,me,P,_e,q,D,Tt=(D=class{constructor(e={}){m(this,h);m(this,j,new WeakMap);m(this,te,new WeakMap);m(this,re,new WeakMap);m(this,W,new WeakMap);m(this,k,new WeakMap);m(this,R,new WeakMap);m(this,z,new WeakMap);m(this,G);m(this,Y);m(this,S);m(this,ie);w(this,G,e),w(this,ie,at.create(e.cache)),w(this,Y,ht.create(e.relay)),w(this,S,ct.create({level:e.log?.level??(pe()?"debug":"info"),sinks:e.log?.sinks??[ut,ft(2e3).sink]}))}static create(){return new D}static configure(e={}){return{create:()=>new D(e)}}get cache(){return o(this,ie)}get relay(){return o(this,Y)}get log(){return o(this,S)}use(...e){return u(this,h,ye).call(this,e,this)}install(...e){return u(this,h,ce).call(this,this,e,new Set)}check(...e){return D.check(...e,{_installedManifests:u(this,h,L).call(this,this)})}static check(...e){let t=e[e.length-1],r=t&&typeof t=="object"&&"_installedManifests"in t,n=r?e.slice(0,-1):e,s=r?t._installedManifests:new Map,l=[],a=[],f=new Map;for(let[c,p]of s)f.set(c,p);let d=(c,p)=>{try{Ve(c)}catch(b){l.push({code:v.INVALID_MANIFEST,service:c?.manifest?.name||"<unknown>",message:b.message});return}let g=c.manifest,y=g.namespace;if(p.has(y)){l.push({code:v.CYCLE,chain:[...p,y],message:`Circular dependency: ${[...p,y].join(" -> ")}`});return}if(!f.has(y)){if(p.add(y),f.set(y,g),g.dependencies?.length)for(let b of g.dependencies)d(b,new Set(p));if(g.requires){let b=g.name||y;for(let[ae,fe]of Object.entries(g.requires)){let le=f.get(ae);if(!le){l.push({code:v.MISSING_DEP,service:b,requires:ae,message:`Service "${b}" requires "${ae}", but it is not in the service set`});continue}fe!=="*"&&le.version&&(qe(le.version,fe)||l.push({code:v.VERSION,service:b,requires:ae,expected:fe,actual:le.version,message:`Service "${b}" requires "${ae}" at "${fe}", but version is "${le.version}"`}))}}if(g.provides)try{Ge(g.provides,g.name||y)}catch(b){l.push({code:v.CONTRACT,namespace:y,message:b.message})}typeof c.install=="function"&&g.provides&&a.push({namespace:y,message:`Cannot verify that "${y}" actions match provides without running install()`}),p.delete(y)}};for(let c of n)d(c,new Set);return{ok:l.length===0,errors:l,warnings:a}}services(){let e=o(this,k).get(this),t=o(this,j).get(this);if(!e)return[];let r=[];for(let[n,s]of e){let l=t?.get(n),a=l?Object.keys(l):[];r.push({namespace:n,manifest:{...s},surface:a})}return r}graph(){let e=o(this,k).get(this);if(!e)return[];let t=[];for(let[r,n]of e){if(n.dependencies?.length)for(let s of n.dependencies)t.push({from:r,to:s.manifest?.namespace||"<unknown>"});if(n.requires)for(let s of Object.keys(n.requires))t.some(l=>l.from===r&&l.to===s)||t.push({from:r,to:s})}return t}trace(e,t){let r=o(this,re).get(this)?.get(e)||[],n=o(this,j).get(this)?.get(e),s=n&&t in n;return{namespace:e,action:t,exists:!!s,middleware:r.map((l,a)=>({index:a,name:l.name||"<anonymous>"}))}}uninstall(...e){return u(this,h,Ze).call(this,this,e)}},j=new WeakMap,te=new WeakMap,re=new WeakMap,W=new WeakMap,k=new WeakMap,R=new WeakMap,z=new WeakMap,G=new WeakMap,Y=new WeakMap,S=new WeakMap,ie=new WeakMap,h=new WeakSet,ce=function(e,t,r=new Set){let n=[...t],s=()=>{for(;n.length>0;){let l=u(this,h,Ye).call(this,e,n.shift(),r);if(oe(l))return l.then(s)}return u(this,h,Je).call(this,e),e};return s()},Ye=function(e,t,r){Ve(t);let n=t.manifest,s=n.namespace;if(r.has(s))throw new V(`Circular service dependency: ${[...r,s].join(" -> ")}`,v.CYCLE,{chain:[...r,s]});if(Object.prototype.hasOwnProperty.call(e,s)){let c=u(this,h,L).call(this,e).get(s),p=c?.name?` (owned by "${c.name}" v${c.version||"?"})`:"";throw new V(`Namespace "${s}" is already installed${p}. Use .configure() to create a unique instance, or .uninstall("${s}") first.`,v.NS_TAKEN,{namespace:s})}u(this,h,L).call(this,e).set(s,n);let l=t.config||t.manifest.defaults||{},a=u(this,h,P).call(this,e,s),f=u(this,h,_e).call(this,e,s,a,l,t.manifest);r.add(s);let d=()=>{n.requires&&u(this,h,tt).call(this,e,n);let c=u(this,h,q).call(this,e,s,a,l,t.manifest),p=t.install(c,l);if(oe(p))return p.then(g=>{u(this,h,ye).call(this,g,e),r.delete(s)});u(this,h,ye).call(this,p,e),r.delete(s)};if(t.manifest.dependencies?.length){let c=t.manifest.dependencies.filter(y=>y.unique),p=t.manifest.dependencies.filter(y=>!y.unique&&!Object.prototype.hasOwnProperty.call(e,y.manifest.namespace)),g;if(c.length>0&&(g=u(this,h,ce).call(this,f,c,r)),p.length>0&&(g=oe(g)?g.then(()=>u(this,h,ce).call(this,e,p,r)):u(this,h,ce).call(this,e,p,r)),oe(g))return g.then(d)}return d()},Je=function(e){let t=o(this,R).get(e);if(t?.size){for(let[r,n]of t)try{n()}finally{t.delete(r)}o(this,R).delete(e)}},Ze=function(e,t){let r=o(this,z).get(e),n=o(this,j).get(e),s=o(this,te).get(e),l=u(this,h,me).call(this,e);for(let a of t){r?.get(a)?.(),r?.delete(a);let f=n?.get(a);if(f&&o(this,Y).offAllFor(f),l?.delete(a),o(this,R).get(e)?.delete(a),o(this,W).get(e)?.delete(a),o(this,k).get(e)?.delete(a),Object.prototype.hasOwnProperty.call(e,a)&&delete e[a],n?.delete(a),s?.delete(a),s)for(let d of s.values())Object.prototype.hasOwnProperty.call(d,a)&&delete d[a]}return r&&r.size===0&&o(this,z).delete(e),this},ye=function(e,t=this){for(let r of e)if(r)switch(Re(r)){case"MIDDLEWARE":u(this,h,Qe).call(this,r,t);break;case"GETTERS":u(this,h,He).call(this,r,t);break;case"ACTIONS":u(this,h,Ke).call(this,r,t);break;case"INITIALIZE":u(this,h,Xe).call(this,r,t);break;case"UNINSTALL":u(this,h,et).call(this,r,t);break;default:throw new Error(`Unknown definition type: ${Re(r)}`)}return this},Ke=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s),a=u(this,h,me).call(this,t).get(r)||[];for(let[c,p]of Object.entries(l)){if(c=Le(c,r,"action"),Object.prototype.hasOwnProperty.call(n,c))throw new Error(`Action "${r}.${c}" already exists on this target`);let g=u(this,h,rt).call(this,r,c,p,n);if(a.length===0){n[c]=g;continue}let y=u(this,h,it).call(this,a,g);n[c]=(...b)=>y(c,{namespace:r,action:c,args:b})}let f=u(this,h,L).call(this,t).get(r);u(this,h,Me).call(this,r,Object.keys(l),f);let d=o(this,W).get(t);return d||(d=new Set,o(this,W).set(t,d)),d.add(r),u(this,h,Te).call(this,t,r,n)},He=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s);for(let[f,d]of Object.entries(l)){Le(f,r,"getter");let c=d.bind(n);Object.defineProperty(n,f,{get:()=>c(),enumerable:!0,configurable:!1})}let a=u(this,h,L).call(this,t).get(r);return u(this,h,Me).call(this,r,Object.keys(l),a),u(this,h,Te).call(this,t,r,n)},Qe=function(e,t=this){let r=U(e._name);if(o(this,W).get(t)?.has(r))throw new Error(`Middleware for "${r}" must be installed before its actions (middleware does not apply retroactively)`);let n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=e(s),a=u(this,h,me).call(this,t),f=a.get(r)||[],d=ge(l).map(c=>{if(typeof c!="function")throw new Error("Middleware must be a function");return c});return a.set(r,f.concat(d)),this},Xe=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=()=>e(s),a=o(this,R).get(t);return a||(a=new Map,o(this,R).set(t,a)),a.set(r,l),this},et=function(e,t=this){let r=U(e._name),n=u(this,h,P).call(this,t,r),s=u(this,h,q).call(this,t,r,n),l=()=>e(s),a=o(this,z).get(t);return a||(a=new Map,o(this,z).set(t,a)),a.set(r,l),this},tt=function(e,t){let r=t.name||t.namespace,n=u(this,h,L).call(this,e);for(let[s,l]of Object.entries(t.requires)){let a=n.get(s);if(!a){let f=[...n.keys()].filter(d=>d!==t.namespace);throw new V(`Service "${r}" requires "${s}", but it is not installed. Installed namespaces: [${f.join(", ")}]`,v.MISSING_DEP,{service:r,requires:s})}if(l!=="*"&&a.version&&!qe(a.version,l))throw new V(`Service "${r}" requires "${s}" at version "${l}", but installed version is "${a.version}"`,v.VERSION,{service:r,requires:s,expected:l,actual:a.version})}},Me=function(e,t,r){if(!r?.provides)return;let n=Object.keys(r.provides),s=new Set(t),l=n.filter(f=>!s.has(f)),a=[...s].filter(f=>!n.includes(f));if(l.length>0)throw new V(`Contract violation in "${e}": manifest.provides declares [${l.join(", ")}] but the implementation does not provide them`,v.CONTRACT,{namespace:e,missing:l});a.length>0&&pe()&&o(this,S).warn(`Service "${e}" provides [${a.join(", ")}] not declared in manifest.provides. Consider adding them to the contract.`)},L=function(e){let t=o(this,k).get(e);return t||(t=new Map,o(this,k).set(e,t)),t},Te=function(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)?r=e[t]:Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),o(this,j).get(e)?.set(t,r),e},rt=function(e,t,r,n){let s=r.bind(n),l=a=>{throw a.action=t,a.namespace=e,o(this,S).error(`Error in action "${e}.${t}"`,{error:a}),a};return Oe(s)?async(...a)=>{try{return await s(...a)}catch(f){l(f)}}:(...a)=>{try{return s(...a)}catch(f){l(f)}}},it=function(e,t){return gt(ge(e),t)?u(this,h,st).call(this,e,t):u(this,h,nt).call(this,e,t)},nt=function(e,t){let r=ge(e);return(n,s)=>{let l=-1,a=(f,d)=>{if(f<=l)throw new Error("next() called multiple times");l=f;let c=r[f];if(!c){let g=t(...d);if(pe()&&oe(g)){let y=`${s.namespace}.${n}`;Ue.has(y)||(Ue.add(y),o(this,S).warn(`Action "${y}" returned a Promise but is not declared async; its middleware composes synchronously, so code after next() runs before the action settles. Declare the action async to compose the chain asynchronously.`))}return g}let p={...s,args:d};return u(this,h,je).call(this,c,n,p,(...g)=>{let y=Fe(d,g);return a(f+1,y)})};return a(0,s.args)}},st=function(e,t){let r=ge(e);return async(n,s)=>{let l=-1,a=async(f,d)=>{if(f<=l)throw new Error("next() called multiple times");l=f;let c=r[f];if(!c)return await t(...d);let p={...s,args:d};return await u(this,h,je).call(this,c,n,p,(...g)=>{let y=Fe(d,g);return a(f+1,y)})};return a(0,s.args)}},je=function(e,t,r,n){try{return e(t,r,n)}catch(s){throw s.middleware=e.name||"<anon>",s.action=t,s}},me=function(e){let t=o(this,re).get(e);return t||(t=new Map,o(this,re).set(e,t)),t},P=function(e,t){let r=o(this,j).get(e);if(r||(r=new Map,o(this,j).set(e,r)),r.has(t))return r.get(t);let n=Object.create(null);return r.set(t,n),n},_e=function(e,t,r,n=o(this,G)||{},s={}){let l=o(this,te).get(e);if(l||(l=new Map,o(this,te).set(e,l)),l.has(t))return l.get(t);let a={log:o(this,S).child({ns:t},s.log?.sinks||[]),relay:o(this,Y).createChannel(r),cache:o(this,ie),config:n},f=new Proxy(a,{get(d,c,p){return c in d?Reflect.get(d,c,p):Reflect.get(e,c,p)},has(d,c){return c in d||c in e}});return l.set(t,f),f},q=function(e,t,r,n=o(this,G)||{},s={}){let l=o(this,G)?.strictInject===!0;return(...a)=>{let f=u(this,h,_e).call(this,e,t,r,n,s);if(!a||a.length===0)return f;for(let c of a)if(!(c in f)){let p=Object.keys(f),g=wt(c,p),y=`inject("${c}") in "${t}" resolved to undefined \u2014 "${c}" is not an installed namespace or built-in. Available: [${p.join(", ")}]`+(g?`. Did you mean "${g}"?`:"");if(l)throw new V(y,v.MISSING_DEP,{service:t,requires:c});pe()&&o(this,S).warn(y)}if(a.length===1)return f[a[0]];let d=new Array(a.length);for(let c=0;c<a.length;c++)d[c]=f[a[c]];return d}},D),vt=ue("MIDDLEWARE",[Function,Array]),At=ue("ACTIONS",[Object]),Et=ue("UNINSTALL"),$t=ue("INITIALIZE"),It=ue("GETTERS",[Object]),ne,Ne,O,F,Q,se,St=(se=class{constructor(e){m(this,F);m(this,ne);m(this,Ne);m(this,O,{MIDDLEWARE:null,GETTERS:null,ACTIONS:null,INITIALIZE:null,UNINSTALL:null});I(this,"defineMiddleware",e=>u(this,F,Q).call(this,"MIDDLEWARE",e,vt));I(this,"defineGetters",e=>u(this,F,Q).call(this,"GETTERS",e,It));I(this,"defineActions",e=>u(this,F,Q).call(this,"ACTIONS",e,At));I(this,"defineInitialize",e=>u(this,F,Q).call(this,"INITIALIZE",e,$t));I(this,"defineUninstall",e=>u(this,F,Q).call(this,"UNINSTALL",e,Et));w(this,ne,e)}static create(e){return new se(e)}_toArray(){return[o(this,O).MIDDLEWARE,o(this,O).GETTERS,o(this,O).ACTIONS,o(this,O).INITIALIZE,o(this,O).UNINSTALL].filter(Boolean)}},ne=new WeakMap,Ne=new WeakMap,O=new WeakMap,F=new WeakSet,Q=function(e,t,r){if(o(this,O)[e])throw new Error(`${e} already defined for ${o(this,ne)}`);o(this,O)[e]=r(o(this,ne),t)},se);function Ot({namespace:i,version:e="1.0.0",provides:t={},overrides:r={}}={}){var s;if(!i)throw new Error("stub() requires a namespace");let n={};for(let[l,a]of Object.entries(t))r[l]?n[l]=r[l]:a.async?n[l]=async()=>{}:n[l]=()=>{};return s=class extends Mt{actions(){return n}},I(s,"manifest",{name:`Stub<${i}>`,namespace:i,version:e,provides:t}),s}var he,Mt=(he=class{static stub(i){return Ot(i)}static configure(i={}){return{install:(e,t)=>this.install(e,t),manifest:this.manifest,config:{...this.config||this.manifest.defaults||{},...i},unique:!0,configured:!0}}static install(i,e){let{namespace:t}=this.manifest;U(t);let r=new this;Object.defineProperty(r,"config",{value:Object.freeze({...e}),writable:!1,configurable:!1,enumerable:!1}),Object.defineProperty(r,"inject",{value:(...s)=>i(...s),writable:!1,configurable:!1,enumerable:!1});let n=St.create(t);if(r.setup){let s={defineActions:a=>n.defineActions(()=>a(i,e)),defineMiddleware:a=>n.defineMiddleware(()=>a(i,e)),defineGetters:a=>n.defineGetters(()=>a(i,e)),defineInitialize:a=>n.defineInitialize(()=>a(i,e)),defineUninstall:a=>n.defineUninstall(()=>a(i,e))},l=r.setup(s,i,e);return l?.then?l.then(()=>n._toArray()):n._toArray()}return r.middleware&&n.defineMiddleware(()=>r.middleware(i,e)),r.getters&&n.defineGetters(()=>r.getters(i,e)),r.actions&&n.defineActions(()=>r.actions(i,e)),r.initialize&&n.defineInitialize(()=>r.initialize(i,e)),r.uninstall&&n.defineUninstall(()=>r.uninstall(i,e)),n._toArray()}},I(he,"manifest",{name:"base",dependencies:[],version:"1.0.0",description:"Base extension template"}),I(he,"config",null),I(he,"unique",!1),he),jt=Symbol("jucie.engine");var Lt=(i=21)=>crypto.getRandomValues(new Uint8Array(i)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");export{ue as a,Tt as b,At as c,Mt as d,Lt as e};
@@ -0,0 +1 @@
1
+ import{a as F,b as S,c as T,d as v,e as A,f as W,g as P}from"./chunk-NFKUJQZH.js";import{a as k,b as p}from"./chunk-LXD22ETU.js";import{a as N}from"./chunk-CGCD6S33.js";import"./chunk-ULVFWUAU.js";import"./chunk-J5QMLA3Z.js";import"./chunk-DLHF7QB4.js";import"./chunk-7UENQJSC.js";import"./chunk-RFFN4NF4.js";import"./chunk-EXXAK3BP.js";import"./chunk-UCLSDDOL.js";var J=N("contentEditor",$=>{let[_,a,E,b]=$("cache","channel","contentEditor","state"),m=b.ref(["nodes"]),e=null,l=null,h=null,f=[];if(!m)throw new Error("Nodes not found");function D(t){l&&(e.segments=t,p(m,l,t))}function d(){if(!e||!l)return;let{start:t,end:n}=e.getSelection(),o=e.segments,i=o?P(o,t,n):{};a.to("editor").publish("textFormat:selection",{formats:i,start:t,end:n})}function L(t){if(!e||!l)return;e.segments||(e.segments=S(e.content));let n=E.applyFormat(e,t,A);n&&(p(m,l,n),d())}function q(t){if(!e||!l||!e.segments)return;let n=E.removeFormat(e,t,W);n&&(p(m,l,n),d())}function B(){if(!e||!l)return;e.segments||(e.segments=S(e.content));let{start:t,end:n}=e.getSelection(),o=e.segments;n>t&&(o=v(o,t,n-t,""));let i={mode:"value",value:null,binding:null,computed:null,code:null,error:null};o=v(o,t,0,F);let r=0,s=[],u=t;for(let c of o){let y=r+c.text.length,g=u-r;!c.descriptor&&g>=0&&g<c.text.length&&c.text[g]===F?(g>0&&s.push({text:c.text.slice(0,g),formats:{...c.formats}}),s.push(T(i)),g+1<c.text.length&&s.push({text:c.text.slice(g+1),formats:{...c.formats}}),u=-1):s.push(c),r=y}let x=t+1;e.setPendingSelection(x,x),D(s)}function H(t){return t?!(t.mode==="binding"&&t.binding?.length||t.mode==="computed"&&t.computed||t.mode==="code"&&t.code||t.mode==="value"&&t.value!=null):!0}function O({segIndex:t,descriptor:n}){if(!e||!l||!e.segments)return;let o=[...e.segments];if(!o[t]?.descriptor)return;let i=H(n),r=0;for(let s=0;s<t;s++)r+=o[s].text.length;i?o.splice(t,1):(r+=1,o[t]={...o[t],descriptor:{...n}}),e.setPendingSelection(r,r),D(o)}function w(t){let n=t.target.closest(".descriptor-pill");if(!n||!e?.segments)return;let o=Number(n.dataset.segIndex),i=e.segments[o];if(!i?.descriptor)return;let r=n.getBoundingClientRect();a.to("editor").publish("textFormat:descriptorClick",{descriptor:i.descriptor,segIndex:o,rect:{left:r.left,top:r.top,right:r.right,bottom:r.bottom,width:r.width,height:r.height}})}function R(t){let n=t.target.closest("[data-rid]");if(n&&n.isContentEditable){let o=n.dataset.rid;if(o===h)return;let i=n.dataset.nodeId;if(!i)return;U(o,i,n);return}a.to("renderWorker").publish("contentEditor:end",h,l),C()}function U(t,n,o){let i=h;e&&(e.destroy(),e=null),l=n,h=t;let r=b.get(["nodes",n,"textSegments"])??null;if(!r){let s=b.get(["nodes",n,"textContent"]),u=typeof s=="string"?s:s?.value??o.textContent??"";r=S(u),p(m,n,r)}e=E.create(o,{segments:r,shiftSegments:v,onInput:(s,u)=>{k(m,n,{value:s}),u&&p(m,n,u),d()},onWheel:({deltaX:s,deltaY:u,ctrlKey:x,x:c,y})=>{a.to("renderWorker").publish("contentEditor:wheel",{deltaX:s,deltaY:u,ctrlKey:x,x:c,y})}}),e.on("mouseup",()=>setTimeout(d,0)),e.on("keyup",()=>d()),e.on("click",w),a.to("renderWorker").publish("contentEditor:switch",{oldRid:i,newRid:t,newId:n})}function C(){document.removeEventListener("mousedown",R,!0);for(let t of f)t&&typeof t=="function"&&t();f.length=0,e&&(e.destroy(),e=null),window.getSelection()?.removeAllRanges(),l=null,h=null}return{start:{schema:["String","String"],namespace:"stage",handler:(t,n)=>{try{C();let o=document.querySelector(`[data-rid="${t}"]`);if(!o)throw new Error(`ContentEditor.start: $el not found for rid ${t}`);l=n,h=t;let i=b.get(["nodes",n,"textSegments"])??null;if(!i){let r=b.get(["nodes",n,"textContent"]),s=typeof r=="string"?r:r?.value??o.textContent??"";i=S(s),p(m,n,i)}e=E.create(o,{segments:i,shiftSegments:v,onInput:(r,s)=>{k(m,n,{value:r}),s&&p(m,n,s),d()},onWheel:({deltaX:r,deltaY:s,ctrlKey:u,x,y:c})=>{a.to("renderWorker").publish("contentEditor:wheel",{deltaX:r,deltaY:s,ctrlKey:u,x,y:c})}}),f.push(e.on("mouseup",()=>setTimeout(d,0))),f.push(e.on("keyup",()=>d())),f.push(e.on("click",w)),f.push(a.namespace("stage").subscribe("textFormat:apply",L)),f.push(a.namespace("stage").subscribe("textFormat:remove",q)),f.push(a.namespace("stage").subscribe("textFormat:insertDescriptor",B)),f.push(a.namespace("stage").subscribe("textFormat:updateDescriptor",O)),document.addEventListener("mousedown",R,!0)}catch(o){return console.error(o),null}}},end:{schema:["String","String"],namespace:"stage",handler:()=>{C()}}}});export{J as contentEditorContracts};
@@ -0,0 +1,15 @@
1
+ import{a as T,b as ht,c as ft,d as gt,e as xt,f as It}from"./chunk-7YVQSQRP.js";import{a as lt,b as pe,c as ut,d as Ge,e as yt,f as wt,g as bt,h as St,i as Be,j as Nt}from"./chunk-AOGIMUZ2.js";import"./chunk-NFKUJQZH.js";import"./chunk-45YNKT2X.js";import"./chunk-NKDO4J6J.js";import"./chunk-LXD22ETU.js";import"./chunk-BGQJ5B3Q.js";import{b as mt}from"./chunk-CGCD6S33.js";import{a as dt,b as ct,c as pt,d as ce}from"./chunk-ULVFWUAU.js";import"./chunk-CYURWEXX.js";import"./chunk-GUI7FIZD.js";import"./chunk-IKKRB6BS.js";import"./chunk-7VDUBBVE.js";import"./chunk-N6I4COF2.js";import"./chunk-A52FDU5E.js";import"./chunk-6S7QQT47.js";import"./chunk-PU62K33G.js";import"./chunk-KTWXYDG7.js";import"./chunk-EWEPEODY.js";import"./chunk-HAN4CMBX.js";import"./chunk-Q3ZV7EKU.js";import"./chunk-F5MJNV7Y.js";import"./chunk-EPVRMHC2.js";import"./chunk-YB7FA4Y3.js";import"./chunk-ZUPNPSUB.js";import"./chunk-YCGY2NRE.js";import"./chunk-NXBFOI3Z.js";import"./chunk-E6KR5RXO.js";import"./chunk-I57W7UZN.js";import"./chunk-LUY5LC7Z.js";import"./chunk-IBDKDP7T.js";import"./chunk-5CWWFBNY.js";import"./chunk-BWJHUHDJ.js";import"./chunk-QFFVADTJ.js";import"./chunk-QD56IMFS.js";import"./chunk-CNZYL2VV.js";import"./chunk-MGH62JQ4.js";import"./chunk-YCMBBPKT.js";import"./chunk-NHY2XYCH.js";import"./chunk-XFHQ45KR.js";import"./chunk-XTAXESM6.js";import"./chunk-QJ33JO3T.js";import"./chunk-XE3A5HPY.js";import"./chunk-GEOQWCYL.js";import"./chunk-CC3CCH2E.js";import"./chunk-GM4D3DPT.js";import"./chunk-Q3IER3MW.js";import"./chunk-DHPGPV5T.js";import"./chunk-FAYUYASQ.js";import"./chunk-ICWQHFOI.js";import"./chunk-AS76ZLXK.js";import"./chunk-HCRWHPFW.js";import"./chunk-6KW4HPGN.js";import"./chunk-CAAW6MG4.js";import"./chunk-3WCN6R5H.js";import"./chunk-G3PYA3EU.js";import"./chunk-OQM5TMCK.js";import"./chunk-BL6GQ6ID.js";import"./chunk-K5BNCYT7.js";import"./chunk-LHK7LQPZ.js";import"./chunk-GK5XUHQG.js";import"./chunk-TX5TCU2H.js";import{a as Ze,c as kt}from"./chunk-M577WNTV.js";import{a as vt}from"./chunk-2Z2RXHNK.js";import"./chunk-7I5TQOE2.js";import"./chunk-J5QMLA3Z.js";import"./chunk-IWTWZA3T.js";import"./chunk-IV6PINVX.js";import"./chunk-A25WFH3U.js";import"./chunk-MUZZUB5Y.js";import"./chunk-TPCJQIUG.js";import"./chunk-SCJKRPIZ.js";import"./chunk-4Q5R44ZZ.js";import"./chunk-IG2Y3H6O.js";import"./chunk-HE7IQLGK.js";import"./chunk-Z3M6DQKZ.js";import"./chunk-PPDOTRNT.js";import"./chunk-DWW3567Q.js";import"./chunk-H5NHEM4C.js";import"./chunk-NRRFAMFA.js";import"./chunk-RYWOKFM7.js";import"./chunk-DLHF7QB4.js";import"./chunk-7UENQJSC.js";import"./chunk-RFFN4NF4.js";import"./chunk-EXXAK3BP.js";import{e as C,f as d,g as f,h as u,i as y,j as Je}from"./chunk-UCLSDDOL.js";var vn={"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-5":{input:2,output:10},"claude-opus-5":{input:5,output:25}},qn=vn["claude-sonnet-4-6"];var E=dt("AI_OPERATIONS",[Object]);function le(r){let e=r._name,t=r();return{namespace:e,operations:Object.entries(t).map(([n,s])=>({name:n,fullName:`${e}:${n}`,alias:s.alias||null,mcpName:s.mcpName||null,description:s.description||"",schema:s.schema||[],examples:s.examples||[],returns:s.returns||"Object"}))}}function Qe(r,e,t){if(!Array.isArray(e)||e.length===0)return!0;let n=e[0];if(typeof n!="object"||Array.isArray(n))return console.warn(`Schema for ${t} should be an object with named parameters`),!0;for(let[s,o]of Object.entries(n)){let a=typeof o=="string"&&o.endsWith("?"),c=a?o.slice(0,-1):o,i=r[s];if(!(s in r)||i===void 0){if(a)continue;throw new Error(`Missing required parameter "${s}" in ${t}`)}let p=Array.isArray(i)?"Array":i===null?"Null":typeof i=="object"?"Object":i.constructor.name;if(p!==c&&c!=="Any")throw new Error(`Parameter "${s}" in ${t} must be of type ${c}, got ${p}`)}return!0}var kn=2,In={name:"respond",description:"Send a conversational response to the user. Use this for greetings, questions, clarifications, status updates, or when the build task is fully complete.",input_schema:{type:"object",properties:{message:{type:"string",description:"Your conversational response to the user"}},required:["message"]}},Nn={name:"screenshot",description:"Render the current scene and look at it. Captures the full scrollable page, scaled to fit one review image when content is very tall. The JSX returned after each edit shows structure; a screenshot shows what the user will actually see. Use it to check your own work \u2014 after building a section, whenever layout could be wrong (overlapping elements, content overflowing its container, text the same colour as its background, collapsed or stretched spacing), and before you finish. Cheap relative to rebuilding something that turned out broken.",input_schema:{type:"object",properties:{reason:{type:"string",description:"What you are checking for (one short sentence)"},frameIds:{type:"array",items:{type:"string"},description:"Frame node ids to capture. Omit to capture every frame \u2014 prefer naming the frame you just changed."},fullPage:{type:"boolean",description:"Include all scroll-hidden content (default true). Set false for a viewport-only shot when checking a small visible region."}}}};function et(r){let e=An(r);return[In,Nn,...e.map(Cn)]}function Cn(r){let e=r.operations.map(t=>{let n=Array.isArray(t.schema)?t.schema[0]:null,s=n&&typeof n=="object"?Object.entries(n).map(([a,c])=>`${a}: ${c}`).join(", "):"",o=(t.examples??[]).slice(0,kn).map(a=>{let c=a.description?` \u2014 ${a.description}`:"";return`
2
+ Example: ${JSON.stringify(a.args)}${c}`}).join("");return` ${t.name} \u2014 ${t.description}
3
+ Args: { ${s} }${o}`}).join(`
4
+
5
+ `);return{name:r.namespace,description:`${r.namespace} operations. Put every operation for the current step in "ops" \u2014 they run in order, and {{ref}} values set by one are resolved for later ones. Batch aggressively: one call with ten operations costs a fraction of ten calls with one. You still see the re-rendered scene after each call.
6
+
7
+ ${e}`,input_schema:{type:"object",properties:{ops:{type:"array",description:"Operations to run, in order. Preferred over the single-operation form below.",items:{type:"object",properties:{op:{type:"string",description:`Operation name within ${r.namespace}`},args:{type:"object",description:"Arguments matching the operation's schema. A JSON object, not a string containing JSON."},ref:{type:"string",description:"Optional {{name}} reference for cross-operation use"}},required:["op","args"]}},op:{type:"string",description:`Single operation name within ${r.namespace}. Use "ops" instead when running more than one.`},args:{type:"object",description:"Arguments matching the operation's schema (single-operation form). A JSON object, not a string containing JSON."},ref:{type:"string",description:"Optional {{name}} reference for cross-operation use (single-operation form)"},message:{type:"string",description:"Short explanation of what you are doing (1 sentence)"}}}}}function An(r){return!Array.isArray(r)||r.length===0?[]:r[0]?.namespace&&Array.isArray(r[0]?.operations)?r:r.map(e=>le(e))}var On=new Set(["parent","parentId","nodeId"]),Y,me,V,B,he,Ct,At,ue=class extends ce{constructor(){super(...arguments);f(this,he);f(this,Y,new Map);f(this,me,[]);f(this,V,new Map);f(this,B,new Map)}getters(){return{operationsMetadata:()=>this.getOperationsMetadata(),anthropicTools:()=>this.getAnthropicTools()}}actions(){return{use:(...t)=>{for(let n of t)y(this,he,Ct).call(this,n);return this},has:t=>d(this,Y).has(t),resolveType:t=>this.resolveType(t),describeUnresolved:t=>this.describeUnresolved(t),executeOperation:(t,n,s)=>this.executeOperation(t,n,s),executeBatch:t=>this.executeBatch(t)}}resolveType(t){return typeof t!="string"||!t?null:t.includes(":")?d(this,Y).has(t)?t:null:d(this,V).get(t)??d(this,B).get(t)??null}describeUnresolved(t){if(this.resolveType(t))return null;if(typeof t=="string"&&!t.includes(":")&&d(this,B).has(t)&&d(this,B).get(t)===null){let n=[];for(let[o,a]of d(this,Y))a.name===t&&n.push(a.alias?`${o} (alias: ${a.alias})`:o);let s=n.length?n.join(" or "):t;return`Ambiguous operation: "${t}". Use ${s}.`}return`Unknown operation: ${t}`}getOperationsMetadata(){return d(this,me).map(t=>le(t))}getAnthropicTools(){return et(d(this,me))}async executeOperation(t,n,s=null){let o=this.resolveType(t),a=d(this,Y).get(o);if(!a)throw new Error(this.describeUnresolved(t));try{Qe(n,a.schema,t)}catch(c){throw console.error(`Validation failed for ${t}:`,c),c}try{return{result:await a.handler(n),ref:s}}catch(c){throw console.error(`Handler failed for ${t}:`,c),c}}async executeBatch(t){let{operations:n,description:s,expectation:o}=t;console.log("AiOperations: Executing batch",{count:n.length,description:s});let a=new Map,c=[],i=[];try{for(let p=0;p<n.length;p++){let l=n[p];console.log(`AiOperations: Executing [${p+1}/${n.length}] ${l.type}`);let m=y(this,he,At).call(this,l.args,a),{result:h}=await this.executeOperation(l.type,m,l.ref),g=h.id??h.rootId;if(l.ref&&g&&(a.set(l.ref,g),i.push(g)),h.treeMap)for(let[x,N]of Object.entries(h.treeMap))a.set(x,N),i.push(N);h.createdIds?.length&&i.push(...h.createdIds),c.push({operation:l.type,success:!0,result:h})}return console.log("AiOperations: Execution complete",{total:n.length,successful:c.length,createdIds:i}),{success:!0,description:s,expectation:o,results:c,createdIds:i,refMap:Object.fromEntries(a)}}catch(p){return console.error("AiOperations: Batch execution failed",p),{success:!1,description:s,error:p.message,failedAt:c.length,results:c}}}};Y=new WeakMap,me=new WeakMap,V=new WeakMap,B=new WeakMap,he=new WeakSet,Ct=function(t){let n=this.inject("log");if(!t||typeof t!="function")throw new Error("Operation factory must be a function");let s=t._name;if(!s)throw new Error("Operation factory must have a _name property (use defineAiOperations)");n.info(`AiOperations: Registering operations for namespace "${s}"`),d(this,me).push(t);let o=t(this.inject);for(let[a,c]of Object.entries(o)){let{handler:i,schema:p,description:l,examples:m,returns:h,alias:g}=c,x=`${s}:${a}`;if(!i||typeof i!="function")throw new Error(`Operation ${x} must have a handler function`);l||console.warn(`Operation ${x} missing description`),d(this,Y).set(x,{namespace:s,name:a,handler:i,schema:p||[],description:l||"",examples:m||[],returns:h||"Object",alias:g||null}),g&&(d(this,V).has(g)&&d(this,V).get(g)!==x&&console.warn(`AiOperations: alias "${g}" already registered for ${d(this,V).get(g)}, overriding with ${x}`),d(this,V).set(g,x)),d(this,B).has(a)&&d(this,B).get(a)!==x?d(this,B).set(a,null):d(this,B).set(a,x)}},At=function(t,n){return t&&JSON.parse(JSON.stringify(t),(s,o)=>{if(s==="ref")return o;if(typeof o=="string"&&o.match(/^\{\{.*\}\}$/)){let a=n.get(o)??n.get(o.replace(/\.[^}]+(?=\}\}$)/,""));if(a)return a;if(On.has(s))throw new Error(`Unresolved reference "${o}" in "${s}". {{refs}} only resolve within the same tool call \u2014 use the real node id reported by the previous operation.`);return o}return o})},C(ue,"manifest",{name:"AiOperations",namespace:"aiOps",version:"1.0.0",description:"AI operation registry and executor",author:"",license:"MIT",homepage:""});function tt(r){let e=window.getSelection();if(e.rangeCount===0)return{start:0,end:0};let t=e.getRangeAt(0),n=t.cloneRange();n.selectNodeContents(r),n.setEnd(t.startContainer,t.startOffset);let s=n.toString().length,o=t.cloneRange();o.selectNodeContents(r),o.setEnd(t.endContainer,t.endOffset);let a=o.toString().length;return{start:Math.min(s,a),end:Math.max(s,a)}}function _n(r,e){let t=r.parentElement;for(;t&&t!==e;){if(t.contentEditable==="false")return!0;t=t.parentElement}return!1}function nt(r,e){let t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),n=0,s=null;for(let o=t.nextNode();o;o=t.nextNode()){if(s=o,e<=n+o.length){if(_n(o,r)){n+=o.length;continue}return{node:o,offset:e-n}}n+=o.length}return s?{node:s,offset:s.length}:null}function ot(r,e){if(!r?.isConnected||e<0)return;let t=nt(r,e);if(!t)return;let n=document.createRange();n.setStart(t.node,t.offset),n.collapse(!0);let s=window.getSelection();s.removeAllRanges(),s.addRange(n)}function Ot(r,e,t){if(!r?.isConnected||e<0)return;if(e===t){ot(r,e);return}let n=nt(r,e),s=nt(r,t);if(!n||!s)return;let o=document.createRange();o.setStart(n.node,n.offset),o.setEnd(s.node,s.offset);let a=window.getSelection();a.removeAllRanges(),a.addRange(o)}function _t(r,e,t=0,n=""){return r.slice(0,e)+n+r.slice(e+t)}function Et(r,e){let t=o=>/[\s\n]/.exec(o),n=e-1,s=e;for(;n>=0&&!t(r[n]);)n-=1;for(n=Math.max(0,n+1);s<r.length&&!t(r[s]);)s+=1;return s=Math.max(n,s),[n,s]}function We({pattern:r,word:e,match:t,regexMatch:n,triggerLen:s,start:o,end:a,cursorPos:c}){let i=c-o;return{pattern:r,word:e,match:t,regexMatch:n,start:o,end:a,query:e.slice(s,i)}}function Rt(r,e,t=[]){if(!r||e===0||t.length===0)return[];let[n,s]=Et(r,e),o=r.slice(n,s);if(!o)return[];let a=[];for(let c of t){if(c.regex){let l=o.match(c.trigger);l&&a.push(We({pattern:c,word:o,match:l[0],regexMatch:l,triggerLen:1,start:n,end:s,cursorPos:e}));continue}let i=c.trigger,p=i.length;c.exact&&o===i?a.push(We({pattern:c,word:o,match:i,regexMatch:null,triggerLen:p,start:n,end:s,cursorPos:e})):c.startsWith&&o.startsWith(i)?a.push(We({pattern:c,word:o,match:i,regexMatch:null,triggerLen:p,start:n,end:s,cursorPos:e})):c.endsWith&&o.endsWith(i)&&a.push(We({pattern:c,word:o,match:i,regexMatch:null,triggerLen:p,start:n,end:s,cursorPos:e}))}return a}var En=new Set(["insertText","insertParagraph","insertLineBreak","deleteContentBackward","deleteContentForward"]),Rn={childList:!0,characterData:!0,subtree:!0},F,ge,X,Oe,O,M,b,A,K,ye,we,be,Se,J,xe,se,I,Tt,Ae,_e,Ee,Re,je,Te,He,Ue,Me,z,fe=class fe{constructor(e,{onInput:t,onBlur:n,onWheel:s,segments:o,shiftSegments:a}={},c={}){f(this,I);f(this,F,[]);f(this,ge,[]);f(this,X,[]);f(this,Oe,{});f(this,O,"");f(this,M,null);f(this,b,0);f(this,A,0);f(this,K,0);f(this,ye,{content:"",start:0,end:0});f(this,we,!1);f(this,be,null);f(this,Se,!1);f(this,J,null);f(this,xe,null);f(this,se,null);f(this,_e,e=>{e.stopPropagation(),e.preventDefault();let t=e.clipboardData;if(!t)return;let n=t.getData("text/plain")||t.getData("text/html");if(!n)return;let s=n;if(n!==t.getData("text/plain")){let o=document.createElement("div");o.innerHTML=n,s=o.textContent||""}y(this,I,Ae).call(this),y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b),s)});f(this,Ee,e=>{switch(console.log("beforeinput",e),e.stopPropagation(),En.has(e.inputType)&&e.preventDefault(),y(this,I,Ae).call(this),e.inputType){case"insertText":y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b),e.data??"");break;case"insertParagraph":case"insertLineBreak":y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b),`
8
+ `);break;case"deleteContentBackward":d(this,b)!==d(this,A)?y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b),""):y(this,I,z).call(this,Math.max(0,d(this,b)-1),Math.min(1,d(this,b)),"");break;case"deleteContentForward":d(this,b)!==d(this,A)?y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b),""):y(this,I,z).call(this,d(this,b),1,"");break}});f(this,Re,()=>{this.onBlur?.(d(this,O))});f(this,je,e=>{e.preventDefault(),this.onWheel({deltaX:e.deltaX,deltaY:e.deltaY,ctrlKey:e.ctrlKey,x:e.clientX,y:e.clientY})});f(this,Te,e=>{e.key===" "&&(e.preventDefault(),y(this,I,Ae).call(this),y(this,I,z).call(this,d(this,b),d(this,A)-d(this,b)," "))});f(this,He,()=>{if(!(d(this,we)||d(this,Se))){if(d(this,se)){let{start:e,end:t}=d(this,se);u(this,se,null),Ot(this.$el,e,t),u(this,b,e),u(this,A,t);return}ot(this.$el,d(this,K))}});f(this,Ue,()=>{u(this,Se,!0)});f(this,Me,()=>{u(this,Se,!1),u(this,O,this.$el.textContent||""),this.onInput?.(d(this,O),d(this,M))});this.$el=e,this.onInput=t,this.onBlur=n,this.onWheel=s,u(this,M,o??null),u(this,xe,a??null),u(this,ge,c.inheritedPatterns??[]),u(this,Oe,c),y(this,I,Tt).call(this)}static create(e,t={},n={}){if(this.instances.has(e))return this.instances.get(e);let s=new fe(e,t,n);return fe.instances.set(e,s),s}get content(){return d(this,O)}get segments(){return d(this,M)}set segments(e){u(this,M,e)}get cursor(){return{start:d(this,b),end:d(this,A)}}getSelection(){return y(this,I,Ae).call(this),{start:d(this,b),end:d(this,A)}}setPendingSelection(e,t){u(this,se,{start:e,end:t})}on(e,t,n=!1){this.$el.addEventListener(e,t,n);let s={eventName:e,callback:t,options:n};return d(this,X).push(s),()=>{this.$el.removeEventListener(e,t,n);let o=d(this,X).indexOf(s);o!==-1&&d(this,X).splice(o,1)}}onMatch(e,t,{exact:n=!0,startsWith:s=!1,endsWith:o=!1}={}){let a=e instanceof RegExp,c={trigger:a?e:e?.trim?.(),regex:a,exact:n,startsWith:s,endsWith:o,callback:t};return d(this,F).push(c),()=>{let i=d(this,F).indexOf(c);i!==-1&&d(this,F).splice(i,1)}}reset(){u(this,O,d(this,ye).content),u(this,K,d(this,ye).start),this.onInput?.(d(this,O))}destroy(){if(!d(this,we)){u(this,we,!0),d(this,be)?.disconnect(),this.$el.removeEventListener("paste",d(this,_e)),this.$el.removeEventListener("beforeinput",d(this,Ee)),this.$el.removeEventListener("blur",d(this,Re)),this.$el.removeEventListener("compositionstart",d(this,Ue)),this.$el.removeEventListener("compositionend",d(this,Me)),this.$el.removeEventListener("keydown",d(this,Te)),d(this,J)&&(document.removeEventListener("wheel",d(this,J),{passive:!1,capture:!0}),u(this,J,null));for(let{eventName:e,callback:t,options:n}of d(this,X))this.$el.removeEventListener(e,t,n);u(this,X,[]),u(this,F,[]),fe.instances.delete(this.$el),d(this,Oe).onDestroy?.(this)}}};F=new WeakMap,ge=new WeakMap,X=new WeakMap,Oe=new WeakMap,O=new WeakMap,M=new WeakMap,b=new WeakMap,A=new WeakMap,K=new WeakMap,ye=new WeakMap,we=new WeakMap,be=new WeakMap,Se=new WeakMap,J=new WeakMap,xe=new WeakMap,se=new WeakMap,I=new WeakSet,Tt=function(){u(this,O,this.$el.textContent||"");let{start:e,end:t}=tt(this.$el);u(this,b,e),u(this,A,t),u(this,K,e),u(this,ye,{content:d(this,O),start:e,end:t}),this.$el.addEventListener("paste",d(this,_e)),this.$el.addEventListener("beforeinput",d(this,Ee)),this.$el.addEventListener("blur",d(this,Re)),this.$el.addEventListener("compositionstart",d(this,Ue)),this.$el.addEventListener("compositionend",d(this,Me)),this.$el.tagName==="BUTTON"&&this.$el.addEventListener("keydown",d(this,Te)),u(this,be,new MutationObserver(d(this,He))),d(this,be).observe(this.$el,Rn),this.onWheel&&(u(this,J,d(this,je)),document.addEventListener("wheel",d(this,J),{passive:!1,capture:!0}))},Ae=function(){let{start:e,end:t}=tt(this.$el);u(this,b,e),u(this,A,t)},_e=new WeakMap,Ee=new WeakMap,Re=new WeakMap,je=new WeakMap,Te=new WeakMap,He=new WeakMap,Ue=new WeakMap,Me=new WeakMap,z=function(e,t,n){u(this,O,_t(d(this,O),e,t,n)),u(this,K,e+n.length),d(this,M)&&d(this,xe)&&u(this,M,d(this,xe).call(this,d(this,M),e,t,n));let s=d(this,ge).length?[...d(this,F),...d(this,ge)]:d(this,F),o=Rt(d(this,O),d(this,K),s);for(let a of o)a.pattern.callback({word:a.word,trigger:a.match,start:a.start,end:a.end,query:a.query,match:a.regexMatch});this.onInput?.(d(this,O),d(this,M))},C(fe,"instances",new WeakMap);var Z=fe;var ae,Q,re,ve=class extends ce{constructor(){super(...arguments);f(this,ae,[]);f(this,Q,[]);f(this,re,new Set)}actions(){return{create:(t,n={})=>{try{if(!(t instanceof HTMLElement))throw new Error("ContentEditor.create: $el must be an HTMLElement");t.isContentEditable||(t.contentEditable="true");let s=Z.create(t,n,{inheritedPatterns:d(this,ae),onDestroy:o=>{for(let{eventName:a,callback:c,options:i}of d(this,Q))o.$el.removeEventListener(a,c,i);d(this,re).delete(o),Z.instances.delete(t)}});for(let{eventName:o,callback:a,options:c}of d(this,Q))t.addEventListener(o,a,c);return d(this,re).add(s),s}catch(s){return console.error(s),null}},getTarget:t=>Z.instances.get(t),onMatch:(t,n,s={})=>{let o=t instanceof RegExp,a={trigger:o?t:t?.trim?.(),regex:o,exact:s.exact??!0,startsWith:s.startsWith??!1,endsWith:s.endsWith??!1,callback:n};return d(this,ae).push(a),()=>{let c=d(this,ae).indexOf(a);c!==-1&&d(this,ae).splice(c,1)}},on:(t,n,s=!1)=>{let o={eventName:t,callback:n,options:s};d(this,Q).push(o);for(let a of d(this,re))a.$el.addEventListener(t,n,s);return()=>{let a=d(this,Q).indexOf(o);a!==-1&&d(this,Q).splice(a,1);for(let c of d(this,re))c.$el.removeEventListener(t,n,s)}},applyFormat:(t,n,s)=>{if(!t)return null;let{start:o,end:a}=t.getSelection();if(o===a)return null;let c=t.segments;if(!c)return null;let i=s(c,o,a,n);return t.segments=i,t.setPendingSelection(o,a),i},removeFormat:(t,n,s)=>{if(!t)return null;let{start:o,end:a}=t.getSelection();if(o===a)return null;let c=t.segments;if(!c)return null;let i=s(c,o,a,n);return t.segments=i,t.setPendingSelection(o,a),i},reset:t=>Z.instances.get(t)?.reset(),destroy:t=>Z.instances.get(t)?.destroy()}}};ae=new WeakMap,Q=new WeakMap,re=new WeakMap,C(ve,"manifest",{name:"Content Editor",namespace:"contentEditor",version:"1.0.0",description:"Content editor extension"});function ze(r,e){let t=null,n=0;return typeof r=="function"?(t=r,typeof e=="number"&&(n=e)):typeof r=="number"&&(n=r),(...s)=>new Promise((o,a)=>{setTimeout(()=>{try{let c=t?t(...s):void 0;o(c)}catch(c){a(c)}},n)})}var Tn=Object.defineProperty,$=(r,e)=>Tn(r,"name",{value:e,configurable:!0}),ke,ee=(ke=class{constructor(e=""){this.isMarker=!0,this.description=e}},$(ke,"Marker"),ke),Fe,S,Ie,ie,v,te,W,P,ne,D,Mt,qe,$t,$e,Ut=(Fe=class extends Ge{constructor(){super(...arguments);f(this,D);f(this,S,[]);f(this,Ie,!1);f(this,ie,new Set);f(this,v,0);f(this,te,!1);f(this,W,new Map);f(this,P,!0);f(this,ne,!1);C(this,"onUndoRedo",null);f(this,qe,ze(()=>{y(this,D,$e).call(this),u(this,ne,!1)}));C(this,"undo",ze(e=>{if(!this.onUndoRedo)throw new Error("Undo/redo handler is required for undo operation");if(y(this,D,$e).call(this),d(this,v)<=0)return!1;if(u(this,P,!1),!(d(this,S)[d(this,v)]instanceof ee))return console.warn("Expected to be at a marker for undo operation"),!1;let t=new Set,n=d(this,v)-1;for(;n>0;){let s=d(this,S)[n];if(s instanceof ee)break;t.add(wt(s)),n--}return u(this,v,n),this.onUndoRedo(Array.from(t)),e&&typeof e=="function"&&e(),u(this,P,!0),!0}));C(this,"redo",ze(e=>{if(!this.onUndoRedo)throw new Error("Undo/redo handler is required for redo operation");if(d(this,v)>=d(this,S).length-1)return!1;if(u(this,P,!1),!(d(this,S)[d(this,v)]instanceof ee))return console.warn("Expected to be at a marker for redo operation"),!1;let t=new Set;for(Je(this,v)._++;d(this,v)<d(this,S).length;){let n=d(this,S)[d(this,v)];if(n instanceof ee)break;t.add(n),Je(this,v)._++}return this.onUndoRedo(t),e&&typeof e=="function"&&e(),u(this,P,!0),!0}))}initialize(e){this.onUndoRedo=t=>e.apply(t)}actions(e){return{undo:$(t=>this.undo(t),"undo"),redo:$(t=>this.redo(t),"redo"),canUndo:$(()=>this.canUndo(),"canUndo"),canRedo:$(()=>this.canRedo(),"canRedo"),group:$(t=>this.group(t),"group"),commit:$(t=>this.commit(t),"commit"),onCommit:$(t=>this.onCommit(t),"onCommit"),addMarker:$(t=>this.addMarker(t),"addMarker"),size:$(()=>this.size(),"size"),start:$(()=>y(this,D,Mt).call(this),"start")}}onStateChange(e,t,n){if(!d(this,Ie)||!d(this,P)||t.method==="apply")return;let s=d(this,W).get(e.address),o=s?{...t,from:s.from}:t;d(this,W).set(e.address,o),!n&&!d(this,te)&&y(this,D,$t).call(this)}addMarker(e=""){y(this,D,$e).call(this,e),u(this,v,d(this,S).length-1)}canUndo(){return d(this,v)>0}canRedo(){return d(this,v)<d(this,S).length-1}size(){return d(this,S).length}group(e){return u(this,te,!0),typeof e=="function"?(e(this),this.commit()):()=>this.commit()}commit(e=""){return y(this,D,$e).call(this,e),u(this,te,!1),this}pause(){u(this,P,!1)}resume(){u(this,P,!0)}onCommit(e){return d(this,ie).add(e),()=>{d(this,ie).delete(e)}}reset(){u(this,S,[new ee("History Start")]),u(this,ie,new Set),u(this,v,0),u(this,te,!1),u(this,W,new Map),u(this,P,!0),u(this,ne,!1),u(this,Ie,!1),this.onUndoRedo=null}},S=new WeakMap,Ie=new WeakMap,ie=new WeakMap,v=new WeakMap,te=new WeakMap,W=new WeakMap,P=new WeakMap,ne=new WeakMap,D=new WeakSet,Mt=function(){u(this,S,[new ee("History Start")]),u(this,v,0),u(this,Ie,!0),d(this,W).clear(),u(this,te,!1),u(this,ne,!1)},qe=new WeakMap,$t=function(){d(this,ne)||(u(this,ne,!0),d(this,qe).call(this))},$e=function(e=""){if(d(this,W).size===0)return;d(this,v)<d(this,S).length-1&&d(this,S).splice(d(this,v)+1);let t=Array.from(d(this,W).values());for(d(this,S).push(...t),d(this,ie).forEach(n=>n(t)),d(this,S)[d(this,S).length-1]instanceof ee||d(this,S).push(new ee(e||Date.now().toString()));d(this,S).length>this.options.maxSize;)d(this,S).shift();d(this,W).clear(),u(this,v,d(this,S).length-1)},C(Fe,"name","history"),C(Fe,"options",{maxSize:100}),Fe);var Un=Object.defineProperty,Pe=(r,e)=>Un(r,"name",{value:e,configurable:!0}),st,oe,q,Ne,de,De,_,Dt,Lt,at,Ye,Gt,Pt=(st=class extends Ge{constructor(e={}){super(e);f(this,_);f(this,oe,new Set);f(this,q,new Map);f(this,Ne,!1);f(this,de,!1);f(this,De,0);u(this,De,e.debounce??0)}actions(){return{addListener:Pe(e=>{if(typeof e=="function")return y(this,_,at).call(this,e)},"addListener"),subscribe:Pe(e=>{if(typeof e=="function")return y(this,_,at).call(this,e)},"subscribe"),unsubscribe:Pe(e=>{if(typeof e=="function")return y(this,_,Ye).call(this,e)},"unsubscribe"),removeListener:Pe(e=>y(this,_,Ye).call(this,e),"removeListener"),clear:Pe(()=>y(this,_,Gt).call(this),"clear")}}onStateChange(e,t){!d(this,de)||t.method==="apply"||y(this,_,Dt).call(this,e,t)}},oe=new WeakMap,q=new WeakMap,Ne=new WeakMap,de=new WeakMap,De=new WeakMap,_=new WeakSet,Dt=function(e,t){d(this,q).has(e.address)&&d(this,q).delete(e.address),d(this,q).set(e.address,t),y(this,_,Lt).call(this)},Lt=function(){if(!d(this,Ne)){u(this,Ne,!0);try{setTimeout(()=>{let e=Array.from(d(this,q).values());d(this,q).clear();for(let t of d(this,oe))try{t(e)}catch(n){console.error("Error in onChange listener:",n)}u(this,Ne,!1)},d(this,De))}catch(e){console.error(e)}}},at=function(e){return d(this,oe).add(e),u(this,de,!0),()=>y(this,_,Ye).call(this,e)},Ye=function(e){typeof e=="function"&&(d(this,oe).delete(e),d(this,oe).size===0&&u(this,de,!1))},Gt=function(){d(this,oe).clear(),d(this,q).clear(),u(this,de,!1)},C(st,"name","onChange"),st);function Bt(){let r=window.innerWidth,e=window.innerHeight,n=document.body.style.transform||"",s={x:0,y:0},o=1;if(n){let a=n.match(/translate\(([^,]+),\s*([^)]+)\)/);a&&(s.x=parseFloat(a[1].replace("px",""))||0,s.y=parseFloat(a[2].replace("px",""))||0);let c=n.match(/scale\(([^)]+)\)/);c&&(o=parseFloat(c[1]))}return{scroll:s,scale:o,width:r,height:e}}var Wt=E("node",r=>({create:{description:'Create a new node in the scene graph. type is a prototype name (e.g. div, header, p, button, frame). Optional props (e.g. name, frame). parent is the id of the container to create the node INSIDE \u2014 always pass it when a container exists. It falls back to "app" (the canvas root), which is only correct for frames; creating at the root and moving the node afterwards costs two operations instead of one and re-renders the scene twice.',alias:"create",mcpName:"create_node",schema:[{type:"String",props:"Object?",parent:"String?"}],examples:[{args:{type:"button",parent:"nd_hero"},description:"Create a button inside an existing container \u2014 pass that container id as parent"},{args:{type:"frame",props:{frame:"iPhone SE",name:"Home"},parent:"app"},description:"Frames are the exception \u2014 they belong at the canvas root"},{args:{type:"nav",parent:"nd_header"},description:"Create a nav inside an existing header"}],returns:"{ id: String, type: String }",handler:async e=>{let t=r("state"),{addNode:n}=await import("./addNode-QXU2P4AE.js"),s=t.ref(["nodes"]),{type:o,props:a,parent:c="app"}=e,i=n(s,o,a,c);if(i instanceof Error)throw i;if(o==="frame"){let l=(s.get(["app","children"])??[]).filter(m=>m!==i);if(l.length>0){let m=0;for(let g of l){let x=s.get([g,"bounds"]);x&&(m=Math.max(m,(x.x??0)+(x.width??0)))}let{updateBounds:h}=await import("./updateBounds-5M7YQRO3.js");h(s,i,{x:m+100,y:0})}}return{id:i,type:o}}},updateStyle:{description:'Update styles for a node. Optional breakpoint targets a variant: "@720" (responsive), ":hover" (pseudo-state), "&.is-active" (custom state).',mcpName:"update_style",schema:[{nodeId:"String",styles:"Object",breakpoint:"String?"}],examples:[{args:{nodeId:"nd_123",styles:{"background-color":"#2563eb",padding:"16px","border-radius":"8px"}},description:"Set background, padding, and border radius"},{args:{nodeId:"nd_123",styles:{"background-color":"#1d4ed8"},breakpoint:":hover"},description:"Set hover background"}],returns:"{ id: String, styles: Object }",handler:async e=>{let t=r("state"),{updateStyle:n}=await import("./updateStyle-JASLFXVX.js"),s=t.ref(["nodes"]),{nodeId:o,styles:a,breakpoint:c}=e,i=["display","position"].filter(h=>h in a),p={};c&&(c.startsWith(":")||c.startsWith("&")?p.interactionState=[c]:p.breakpoint=c);let l=n(s,o,{...a},p),m={id:o,styles:l};return i.length&&(m.warning=`Ignored ${i.join(", ")} \u2014 use node:setAutoLayout to change layout mode.`),m}},updateText:{description:"Set text content for a node. Use {{expression}} syntax for dynamic values.",mcpName:"update_text",schema:[{nodeId:"String",value:"String"}],examples:[{args:{nodeId:"nd_heading",value:"Welcome"},description:'Set static text to "Welcome"'},{args:{nodeId:"nd_label",value:"{{user.name}}"},description:"Set dynamic text with expression"}],returns:"{ id: String, textContent: Object }",handler:async e=>{let t=r("state"),{createTextContent:n}=await import("./createTextContent-4Z4YATBO.js"),s=t.ref(["nodes"]),{nodeId:o,value:a}=e,c=n({value:a});return s.set([o,"textContent"],c),{id:o,textContent:c}}},move:{description:"Move a node to be the last child of another node",mcpName:"move_node",schema:[{nodeId:"String",parentId:"String"}],examples:[{args:{nodeId:"nd_link",parentId:"nd_nav"},description:"Move link into nav"}],returns:"{ id: String, movedTo: String, success: Boolean }",handler:async e=>{let t=r("state"),{disconnectNode:n}=await import("./disconnectNode-2CLWVIQP.js"),{moveNodeToLastChildOf:s}=await import("./moveNodeToLastChildOf-CWSWITHI.js"),o=t.ref(["nodes"]),{nodeId:a,parentId:c}=e;n(o,a);let i=s(o,a,c);return{id:a,movedTo:c,success:i}}},remove:{description:"Remove a node and all its descendants from the scene graph",alias:"removeNode",mcpName:"remove_node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_old_element"},description:"Remove an element"}],returns:"{ id: String, removed: Boolean, removedNodes: Object }",handler:async e=>{let t=r("state"),{removeNode:n}=await import("./removeNode-5HXQ63V3.js"),s=t.ref(["nodes"]),{nodeId:o}=e,[a,c]=n(s,o);return{id:a,removed:!0,removedNodes:c}}},setAutoLayout:{description:'Set the layout mode of a container node ("none" | "block" | "flex" | "grid"). Sets layout on the parent and the corresponding display style, and normalizes all direct children so they flow correctly. Always use this instead of setting display via updateStyle.',alias:"setLayout",mcpName:"set_layout",schema:[{nodeId:"String",layout:"String"}],examples:[{args:{nodeId:"nd_container",layout:"flex"},description:"Enable flex auto-layout on a container"},{args:{nodeId:"nd_container",layout:"none"},description:"Disable auto-layout, reverting children to absolute positioning"}],returns:"{ id: String, layout: String, childrenUpdated: Number }",handler:async e=>{let t=r("state"),{setNodeLayout:n}=await import("./setNodeLayout-KQVZJBYW.js"),s=t.ref(["nodes"]),{nodeId:o,layout:a}=e;return n(s,o,a)}},setName:{description:"Set a display name on a node. Names appear in get_scene output and make the tree readable. Pass an empty string to clear back to the default (tag name).",mcpName:"set_name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_123",name:"Hero Section"},description:"Name a section"}],returns:"{ id: String, name: String }",handler:async e=>{let n=r("state").ref(["nodes"]),{nodeId:s,name:o}=e;if(o===""){let{clearName:c}=await import("./clearName-HJ7ZTHBU.js");return c(n,s),{id:s,name:""}}let{setName:a}=await import("./setName-NKRZPBGG.js");return a(n,s,o),{id:s,name:o}}},clearName:{description:"Clear the display name from a node, reverting to its tag name.",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_123"},description:"Clear name back to default"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{clearName:n}=await import("./clearName-HJ7ZTHBU.js"),s=t.ref(["nodes"]),{nodeId:o}=e;return n(s,o),{id:o}}},addComponent:{description:"Convert an existing node into a reusable local component. Nested nodes are replaced in-place by an instance; direct children of app/temp become the component artboard only (no instance). Returns componentId and instanceId (null when promoted from app/temp).",mcpName:"add_component",schema:[{nodeId:"String",name:"String?"}],examples:[{args:{nodeId:"nd_card",name:"Card"},description:"Convert a card node into a reusable component"}],returns:"{ instanceId: String | null, componentId: String, name: String }",handler:async e=>{let t=r("state"),{addComponent:n}=await import("./addComponent-3JC5NC3Y.js"),s=t.ref(["nodes"]),{nodeId:o,name:a=""}=e,{componentId:c,instanceId:i}=n(s,o,a);return{instanceId:i,componentId:c,name:a}}}}));var jt=E("tree",r=>({create:{description:'Create a nested tree of nodes recursively (use for complex structures like page sections). FRAMES are the only tree that belongs at the root \u2014 they MUST have parent "app". Every other tree must be created directly into its container by passing that container id as parent. Never create at the root and move afterwards: that costs two operations per node and re-renders the scene twice.',alias:"createTree",schema:[{tree:"Object",parent:"String?"}],examples:[{args:{tree:{type:"frame",name:"Home",frame:"iPhone SE",bounds:{x:0,y:400},styles:{display:"flex","flex-direction":"column",overflow:"hidden"},children:[{type:"header",styles:{padding:"16px"},children:[{type:"h1",text:"App Name"}]},{type:"main",styles:{flex:"1"}},{type:"footer",styles:{padding:"16px"},text:"Footer"}]},parent:"app"},description:'A FRAME goes at the canvas root \u2014 parent "app"'},{args:{tree:{type:"section",name:"Hero Section",styles:{display:"flex","flex-direction":"column",gap:"24px",padding:"64px"},children:[{type:"h1",name:"Headline",text:"Build faster"},{type:"p",name:"Subheadline",text:"Ship in minutes, not weeks."},{type:"button",name:"CTA Button",text:"Get started"}]},parent:"nd_home_frame"},description:"Everything that is NOT a frame is created directly inside its container \u2014 pass the container id, do not create at the root and move it"}],returns:"{ rootId: String, createdIds: Array, treeMap: Object }",handler:async e=>{let t=r("state"),n=r("log"),{addTree:s}=await import("./addTree-S73GXWZP.js"),o=t.ref(["nodes"]),{tree:a,parent:c="app"}=e,{rootId:i,createdIds:p,treeMap:l}=s(o,a,c,{onWarn:(m,h)=>n.warn(m,h)});return{id:i,rootId:i,createdIds:p,treeMap:l,type:"tree"}}}}));var Ht=E("behavior",r=>({addEvent:{description:'Add or replace an event handler on a node (replaces any existing handler with the same name). Event names use React-style onX format (onClick, onSubmit, onInput, onChange, onMouseEnter, etc.); lowercase names like "click" or "submit" are auto-normalized. Use binding for zero-arg store actions (e.g. "$store.myStore.doSomething"); use code when you need arguments or complex logic \u2014 code MUST be a complete function expression: function (ctx, event) { ... }. Access stores inside the handler via ctx.$store.<storeName>.',mcpName:"add_event",schema:[{nodeId:"String",name:"String",binding:"String?",code:"String?",mode:"String?"}],examples:[{args:{nodeId:"nd_btn",name:"onClick",binding:"$store.default.increment"},description:"Call store action on click"},{args:{nodeId:"nd_btn",name:"onClick",code:`function (ctx, event) {
9
+ ctx.$store.todo.items.push({ text: ctx.$store.todo.newTodo, done: false })
10
+ ctx.$store.todo.newTodo = ""
11
+ }`},description:"Add click handler with code"},{args:{nodeId:"nd_form",name:"onSubmit",code:`function (ctx, event) {
12
+ event.preventDefault()
13
+ }`},description:"Prevent default on form submit"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{addEvent:n}=await import("./addEvent-HOBNKM2F.js"),{updateEvent:s}=await import("./updateEvent-R52PL2G4.js"),{normalizeEventName:o}=await import("./normalizeEventName-SNBYJDUY.js"),a=t.ref(["nodes"]),{nodeId:c,name:i,binding:p,code:l,mode:m}=e,h=o(i);if((a.get([c,"events"])??[]).find(N=>N.name===h)||n(a,c,h),p!==void 0){let N=(a.get([c,"events"])??[]).find(R=>R.name===h)??{name:h};s(a,c,h,{...N,mode:"binding",binding:p.split("."),code:null})}else if(l!==void 0){let N=(a.get([c,"events"])??[]).find(R=>R.name===h)??{name:h};s(a,c,h,{...N,mode:m??"code",code:l,binding:null})}return{id:c,name:h}}},updateEvent:{description:"Update an existing event handler by name",schema:[{nodeId:"String",name:"String",event:"Object"}],examples:[{args:{nodeId:"nd_btn",name:"onClick",event:{mode:"code",code:'alert("hi")'}},description:"Update onClick handler"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{updateEvent:n}=await import("./updateEvent-R52PL2G4.js"),{normalizeEventName:s}=await import("./normalizeEventName-SNBYJDUY.js"),o=t.ref(["nodes"]),{nodeId:a,name:c,event:i}=e,p=s(c),l=i?.name!==void 0?{...i,name:s(i.name)}:{...i,name:p};return n(o,a,p,l),{id:a,name:p}}},removeEvent:{description:"Remove an event handler by name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_btn",name:"onClick"},description:"Remove onClick handler"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{removeEvent:n}=await import("./removeEvent-2YZ55HD6.js"),{normalizeEventName:s}=await import("./normalizeEventName-SNBYJDUY.js"),o=t.ref(["nodes"]),{nodeId:a,name:c}=e,i=s(c);return n(o,a,i),{id:a,name:i}}},updateRoute:{description:"Set the route path on a frame node for multi-page navigation",schema:[{nodeId:"String",route:"Any"}],examples:[{args:{nodeId:"nd_frame",route:"/about"},description:"Set route path"},{args:{nodeId:"nd_frame",route:{path:"/users/:id"}},description:"Set route with params"}],returns:"{ id: String, route: Object }",handler:async e=>{let t=r("state"),{updateRoute:n}=await import("./updateRoute-TFQFFFSZ.js"),s=t.ref(["nodes"]),{nodeId:o,route:a}=e,c=typeof a=="string"?{path:a}:a;return n(s,o,c),{id:o,route:c}}},setHomePage:{description:"Mark a frame as the home page (root route)",schema:[{nodeId:"String",isHomePage:"Any"}],examples:[{args:{nodeId:"nd_frame",isHomePage:!0},description:"Set as home page"}],returns:"{ id: String, isHomePage: Any }",handler:async e=>{let t=r("state"),{setHomePage:n}=await import("./setHomePage-O2JYOG6H.js"),s=t.ref(["nodes"]),{nodeId:o,isHomePage:a}=e;return n(s,o,a),{id:o,isHomePage:a}}},setDestination:{description:"Set a navigation destination on a link or button node",schema:[{nodeId:"String",destination:"Any"}],examples:[{args:{nodeId:"nd_link",destination:"/about"},description:"Navigate to /about on click"}],returns:"{ id: String, destination: Object }",handler:async e=>{let t=r("state"),{setDestination:n}=await import("./setDestination-NCPAVIIK.js"),s=t.ref(["nodes"]),{nodeId:o,destination:a}=e,c=typeof a=="string"?{path:a}:a;return n(s,o,c),{id:o,destination:c}}},clearDestination:{description:"Remove the navigation destination from a node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_link"},description:"Clear navigation destination"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{clearDestination:n}=await import("./clearDestination-IGKNL7FN.js"),s=t.ref(["nodes"]),{nodeId:o}=e;return n(s,o),{id:o}}},setRepeat:{description:'Repeat a node for each item in a data binding (loop). binding is a dot-path on ctx (e.g. "$store.todo.items").',schema:[{nodeId:"String",binding:"String",as:"String?",index:"String?",key:"Any?",keyOn:"Any?"}],examples:[{args:{nodeId:"nd_card",binding:"$store.todo.items",as:"$item"},description:"Repeat card for each item in the todo store"}],returns:"{ id: String, binding: String }",handler:async e=>{let t=r("state"),{setRepeat:n}=await import("./setRepeat-WN4WZJUN.js"),s=t.ref(["nodes"]),{nodeId:o,binding:a,as:c,index:i,key:p,keyOn:l}=e,m=a.split(".");return n(s,o,{descriptor:{mode:"binding",binding:m},as:c,index:i,key:p,keyOn:l}),{id:o,binding:a}}},clearRepeat:{description:"Remove repeat binding from a node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_card"},description:"Stop repeating"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{clearRepeat:n}=await import("./clearRepeat-7YFYZODP.js"),s=t.ref(["nodes"]),{nodeId:o}=e;return n(s,o),{id:o}}},setRender:{description:'Conditionally show/hide a node based on an expression. Pass an expression that uses ctx (e.g. "ctx.$store.user.isAdmin"); it is wrapped as a computed function automatically. Stores are at ctx.$store.<name>; loop vars at ctx.$item / ctx.$index.',schema:[{nodeId:"String",value:"String"}],examples:[{args:{nodeId:"nd_admin",value:"ctx.$store.user.isAdmin"},description:"Show only for admins"}],returns:"{ id: String, value: String }",handler:async e=>{let t=r("state"),{setRender:n}=await import("./setRender-7XMGQ7ZK.js"),s=t.ref(["nodes"]),{nodeId:o,value:a}=e,c=`function (ctx) {
14
+ return ${a}
15
+ }`;return n(s,o,{mode:"computed",computed:c}),{id:o,value:a}}},clearRender:{description:"Remove conditional rendering from a node (always show)",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_admin"},description:"Always render"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{clearRender:n}=await import("./clearRender-NPVDTNFA.js"),s=t.ref(["nodes"]),{nodeId:o}=e;return n(s,o),{id:o}}},addState:{description:'Register a custom state class on a node (e.g. "is-active"). Style it with updateStyle breakpoint "&.is-active".',schema:[{nodeId:"String",stateName:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active"},description:"Add active state"}],returns:"{ id: String, stateName: String }",handler:async e=>{let t=r("state"),{addState:n}=await import("./addState-U2NWEGWV.js"),s=t.ref(["nodes"]),{nodeId:o,stateName:a}=e;return n(s,o,a),{id:o,stateName:a}}},updateState:{description:"Set the expression that controls when a state is active",schema:[{nodeId:"String",stateName:"String",expression:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active",expression:'$router.currentRoute?.path === "/"'},description:"Activate on home route"}],returns:"{ id: String, stateName: String }",handler:async e=>{let t=r("state"),{updateState:n}=await import("./updateState-JCUSBQOL.js"),s=t.ref(["nodes"]),{nodeId:o,stateName:a,expression:c}=e;return n(s,o,a,{name:a,mode:"computed",computed:c??null}),{id:o,stateName:a}}},removeState:{description:"Remove a custom state from a node",schema:[{nodeId:"String",stateName:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active"},description:"Remove active state"}],returns:"{ id: String, stateName: String }",handler:async e=>{let t=r("state"),{removeState:n}=await import("./removeState-SGJVQ66N.js"),s=t.ref(["nodes"]),{nodeId:o,stateName:a}=e;return n(s,o,a),{id:o,stateName:a}}},updateBounds:{description:"Update the position and size of a node",schema:[{nodeId:"String",bounds:"Object"}],examples:[{args:{nodeId:"nd_frame",bounds:{x:500,y:0,width:375,height:667}},description:"Position a frame"}],returns:"{ id: String, bounds: Object }",handler:async e=>{let t=r("state"),{updateBounds:n}=await import("./updateBounds-5M7YQRO3.js"),s=t.ref(["nodes"]),{nodeId:o,bounds:a}=e;return n(s,o,a),{id:o,bounds:a}}},setHtmlId:{description:"Set the HTML id attribute on a node",schema:[{nodeId:"String",id:"String"}],examples:[{args:{nodeId:"nd_section",id:"hero-section"},description:"Set HTML id for anchor links"}],returns:"{ id: String, htmlId: String }",handler:async e=>{let t=r("state"),{setHtmlId:n}=await import("./setHtmlId-2W7YW47O.js"),s=t.ref(["nodes"]),{nodeId:o,id:a}=e;return n(s,o,a),{id:o,htmlId:a}}},addAttribute:{description:"Add a custom HTML attribute to a node",schema:[{nodeId:"String",name:"String",value:"Any?",mode:"String?"}],examples:[{args:{nodeId:"nd_img",name:"src",value:"/hero.png"},description:"Set image source"},{args:{nodeId:"nd_img",name:"alt",value:"Hero image"},description:"Set alt text"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{addAttribute:n}=await import("./addAttribute-2MZ3OFUE.js"),s=t.ref(["nodes"]),{nodeId:o,name:a,value:c,mode:i}=e;return n(s,o,{name:a,value:c,mode:i}),{id:o,name:a}}},updateAttribute:{description:'Update or upsert an attribute by name. For two-way input binding use name "model", mode "binding", and binding "$store.path". model XOR value/checked \u2014 setting model clears value and checked; setting value or checked clears model.',schema:[{nodeId:"String",name:"String",mode:"String?",value:"Any?",binding:"Any?",computed:"String?",code:"String?"}],examples:[{args:{nodeId:"nd_img",name:"src",value:"/new-hero.png"},description:"Change image source"},{args:{nodeId:"nd_email",name:"model",mode:"binding",binding:"$store.form.email"},description:"Two-way bind input to store"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{updateAttribute:n}=await import("./updateAttribute-XXZL2P43.js"),s=t.ref(["nodes"]),{nodeId:o,...a}=e;return typeof a.binding=="string"&&(a.binding=a.binding.split(".")),a.name==="model"&&a.mode==null&&(a.mode="binding"),n(s,o,a.name,a),{id:o,name:a.name}}},removeAttribute:{description:"Remove an attribute by name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_img",name:"src"},description:"Remove src attribute"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{removeAttribute:n}=await import("./removeAttribute-DCKZLM55.js"),s=t.ref(["nodes"]),{nodeId:o,name:a}=e;return n(s,o,a),{id:o,name:a}}},addLifecycleHook:{description:'Add a lifecycle hook to a node (mount, unmount, update). mode is "code" with a code string, or "binding" with a store action binding.',schema:[{nodeId:"String",key:"String",code:"String?",binding:"String?"}],examples:[{args:{nodeId:"nd_page",key:"mount",code:'console.log("mounted")'},description:"Run code on mount"},{args:{nodeId:"nd_page",key:"mount",binding:"cart.load"},description:"Call a store action on mount"}],returns:"{ id: String, key: String }",handler:async e=>{let t=r("state"),{addLifecycleHook:n}=await import("./addLifecycleHook-GHYL7FRH.js"),{updateLifecycleHook:s}=await import("./updateLifecycleHook-4RA2U4TR.js"),o=t.ref(["nodes"]),{nodeId:a,key:c,code:i,binding:p}=e;return n(o,a,c),(i!==void 0||p!==void 0)&&s(o,a,c,{key:c,mode:i!==void 0?"code":"binding",code:i??"",binding:p??null}),{id:a,key:c}}},updateLifecycleHook:{description:"Update a lifecycle hook by key. hook may include key, mode, code, binding.",schema:[{nodeId:"String",key:"String",hook:"Object"}],returns:"{ id: String, key: String }",handler:async e=>{let t=r("state"),{updateLifecycleHook:n}=await import("./updateLifecycleHook-4RA2U4TR.js"),s=t.ref(["nodes"]),{nodeId:o,key:a,hook:c}=e,i=(s.get([o,"lifecycle"])??[]).find(p=>p.key===a)??{key:a};return n(s,o,a,{...i,...c}),{id:o,key:a}}},removeLifecycleHook:{description:"Remove a lifecycle hook by key.",schema:[{nodeId:"String",key:"String"}],returns:"{ id: String, key: String }",handler:async e=>{let t=r("state"),{removeLifecycleHook:n}=await import("./removeLifecycleHook-SBPJNF5P.js");return n(t.ref(["nodes"]),e.nodeId,e.key),{id:e.nodeId,key:e.key}}},addOption:{description:"Add a static option to a select node.",schema:[{nodeId:"String",value:"String",label:"String?"}],examples:[{args:{nodeId:"nd_select",value:"us",label:"United States"},description:"Add a select option"}],returns:"{ id: String, value: String }",handler:async e=>{let t=r("state"),{addOption:n}=await import("./addOption-PVXGN7AJ.js"),s=t.ref(["nodes"]),{nodeId:o,value:a,label:c}=e;return n(s,o,{value:a,label:c??a}),{id:o,value:a}}},updateOption:{description:"Update a select option by its current value. Pass the old value to look up, and optionally a new value/label.",schema:[{nodeId:"String",value:"String",newValue:"String?",label:"String?"}],returns:"{ id: String, value: String }",handler:async e=>{let t=r("state"),{updateOption:n}=await import("./updateOption-5U23ZUWV.js"),s=t.ref(["nodes"]),{nodeId:o,value:a,newValue:c,label:i}=e,p=c??a;return n(s,o,a,{value:p,label:i??p}),{id:o,value:p}}},removeOption:{description:"Remove a select option by value.",schema:[{nodeId:"String",value:"String"}],returns:"{ id: String, value: String }",handler:async e=>{let t=r("state"),{removeOption:n}=await import("./removeOption-SYIFB4XW.js");return n(t.ref(["nodes"]),e.nodeId,e.value),{id:e.nodeId,value:e.value}}},setOptionsExpression:{description:"Bind a select node's options to a data expression instead of a static list. binding is a {{expression}} returning an array; valueKey/labelKey pick fields from each item.",schema:[{nodeId:"String",binding:"String",valueKey:"String?",labelKey:"String?"}],examples:[{args:{nodeId:"nd_select",binding:"{{countries}}",valueKey:"code",labelKey:"name"},description:"Populate options from a store"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{setOptionsExpression:n}=await import("./setOptionsExpression-K5EQXJEY.js"),s=t.ref(["nodes"]),{nodeId:o,binding:a,valueKey:c,labelKey:i}=e;return n(s,o,{binding:a,valueKey:c,labelKey:i}),{id:o}}},clearOptionsExpression:{description:"Switch a select node back to its static options list.",schema:[{nodeId:"String"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{clearOptionsExpression:n}=await import("./clearOptionsExpression-NZQFL64E.js");return n(t.ref(["nodes"]),e.nodeId),{id:e.nodeId}}},setTagName:{description:"Change the HTML tag of an element node (e.g. div to section).",mcpName:"set_tag_name",schema:[{nodeId:"String",tagName:"String"}],examples:[{args:{nodeId:"nd_box",tagName:"section"},description:"Make a div semantic"}],returns:"{ id: String, tagName: String }",handler:async e=>{let t=r("state"),{setTagName:n}=await import("./setTagName-U6UJNJLE.js"),s=t.ref(["nodes"]),{nodeId:o,tagName:a}=e;return n(s,o,a),{id:o,tagName:a}}},updateHtml:{description:"Set the inner HTML of a template node (raw HTML embed).",schema:[{nodeId:"String",html:"String"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{updateHtml:n}=await import("./updateHtml-YBJJSWQW.js");return n(t.ref(["nodes"]),e.nodeId,e.html),{id:e.nodeId}}},addRouteParam:{description:"Add a route parameter to a frame route (e.g. an :id segment). Set key to name it; optional marks it optional.",schema:[{nodeId:"String",key:"String?",optional:"Boolean?"}],examples:[{args:{nodeId:"nd_frame",key:"id"},description:"Add an :id param to the route"}],returns:"{ id: String, index: Number }",handler:async e=>{let t=r("state"),{addParamToRoute:n}=await import("./addParamToRoute-VL2VOFZS.js"),s=t.ref(["nodes"]),{nodeId:o,key:a,optional:c}=e;n(s,o);let p=(s.get([o,"route","params"])??[]).length-1;return(a!==void 0||c!==void 0)&&s.set([o,"route","params",p],{key:a??null,optional:c??!1}),{id:o,index:p}}},removeRouteParam:{description:"Remove a route parameter from a frame route by index.",schema:[{nodeId:"String",index:"Number"}],returns:"{ id: String, index: Number }",handler:async e=>{let t=r("state"),{removeParamFromRoute:n}=await import("./removeParamFromRoute-HAYP3WTT.js");return n(t.ref(["nodes"]),e.nodeId,e.index),{id:e.nodeId,index:e.index}}}}));var zt=E("token",r=>({create:{description:'Create a design token. path is the token name (e.g. "color/primary"), type is the token kind (color, dimension, fontFamily, etc.), value is the CSS value. Reference tokens in styles via the slugged path (slashes/dots become dashes): path "color/primary" \u2192 var(--color-primary).',mcpName:"create_token",schema:[{path:"String",value:"String",type:"String?"}],examples:[{args:{path:"color/primary",value:"#3B82F6",type:"color"},description:"Create a primary color token"},{args:{path:"spacing/lg",value:"24px",type:"dimension"},description:"Create a spacing token"}],returns:"{ id: String, path: String }",handler:async e=>{let t=r("state"),{addToken:n}=await import("./addToken-XF2FFA52.js"),s=t.ref(["tokens"]),{path:o,value:a,type:c}=e;return{id:n(s,{$path:o,$value:a,...c!==void 0?{$type:c}:{}}),path:o}}},update:{description:"Update a design token. changes may include path, value, or type.",mcpName:"update_token",schema:[{tokenId:"String",changes:"Object"}],examples:[{args:{tokenId:"tk_abc",changes:{value:"#EF4444"}},description:"Change a token value"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{updateToken:n}=await import("./updateToken-24P2P2SF.js"),s=t.ref(["tokens"]),{tokenId:o,changes:a={}}=e,c={};return a.path!==void 0&&(c.$path=a.path),a.value!==void 0&&(c.$value=a.value),a.type!==void 0&&(c.$type=a.type),n(s,o,c),{id:o}}},delete:{description:"Delete a design token by id.",mcpName:"delete_token",schema:[{tokenId:"String"}],examples:[{args:{tokenId:"tk_abc"},description:"Delete a token"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{removeToken:n}=await import("./removeToken-AIDV7DUM.js"),s=t.ref(["tokens"]);return n(s,e.tokenId),{id:e.tokenId}}}}));function rt(r,e){if(r==null||typeof r!="string")return r;switch(e){case"number":return r===""?0:Number(r);case"boolean":return r==="true"||r==="1";case"array":case"object":if(!r||r==="")return e==="array"?[]:{};try{return JSON.parse(r)}catch{return e==="array"?[]:{}}default:return r}}function Ce(r,{key:e,name:t,index:n}){let s=e??t;return s!==void 0?r.findIndex(o=>(o.key??o.name)===s):n??-1}var Ft=E("store",r=>({create:{description:"Create a data store. Stores hold reactive values, computed properties, and actions that nodes can bind to (via repeat, model, render, or {{expressions}}). The store id is its name. Optionally pass state/computed/actions arrays to seed the store in one call. Store actions and computed use this for state (e.g. function () { this.items = []; }), not a context first argument.",alias:"createStore",mcpName:"create_store",schema:[{name:"String",state:"Array?",computed:"Array?",actions:"Array?"}],examples:[{args:{name:"todo",state:[{key:"newText",type:"string",value:""},{key:"items",type:"array",value:[]}],actions:[{name:"addTodo",code:'function () { const text = this.newText.trim(); if (!text) return; this.items = [...this.items, { text, done: false }]; this.newText = ""; }'}]},description:"Create a todo store with state and actions in one call"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{validateStorePayload:n}=await import("./validateStorePayload-HCBPC7HR.js"),{addStore:s}=await import("./addStore-AQMFKH33.js"),{createValue:o}=await import("./createValue-DXQSLOBG.js"),{createComputed:a}=await import("./createComputed-DMX7CJA3.js"),{createAction:c}=await import("./createAction-73YUTK3T.js");n(e);let i=t.ref([".stores"]),p=s(i,e.name);return e.state?.length&&i.set([p,"state"],e.state.map(l=>o({key:l.key,type:l.type,value:rt(l.value,l.type)}))),e.computed?.length&&i.set([p,"computed"],e.computed.map(l=>a({name:l.name,code:l.code}))),e.actions?.length&&i.set([p,"actions"],e.actions.map(l=>c({name:l.name,code:l.code}))),{id:p}}},remove:{description:"Remove a data store and everything in it.",alias:"removeStore",schema:[{storeId:"String"}],returns:"{ id: String }",handler:async e=>{let t=r("state"),{removeStore:n}=await import("./removeStore-YVBTGA3I.js");return n(t.ref([".stores"]),e.storeId),{id:e.storeId}}},addValue:{description:"Add a reactive value to a store. key is the value name, type is string/number/boolean/array/object, value is the initial value.",mcpName:"add_store_value",schema:[{storeId:"String",key:"String?",type:"String?",value:"String?"}],examples:[{args:{storeId:"cart",key:"items",type:"array",value:"[]"},description:"Add an items array to the cart store"}],returns:"{ storeId: String, key: String, index: Number }",handler:async e=>{let t=r("state"),{addValue:n}=await import("./addValue-O7YXXMST.js"),{updateValue:s}=await import("./updateValue-TSVJM3PO.js"),o=t.ref([".stores"]),{storeId:a,key:c,type:i,value:p}=e;n(o,a,i);let l=o.get([a,"state"])??[],m=0,h=l[m];if(c!==void 0||p!==void 0){let g=i??h.type;s(o,a,m,{key:c??h.key,type:g,value:rt(p??h.value,g)})}return{storeId:a,key:c??h.key,index:m}}},updateValue:{description:"Update a store value by key (or index). changes may include key, type, value.",schema:[{storeId:"String",key:"String?",index:"Number?",changes:"Object"}],examples:[{args:{storeId:"cart",key:"items",changes:{value:'[{"id":1}]'}},description:"Set the items value"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{updateValue:n}=await import("./updateValue-TSVJM3PO.js"),s=t.ref([".stores"]),{storeId:o,changes:a={}}=e,c=s.get([o,"state"])??[],i=Ce(c,e);if(i<0)throw new Error(`store value not found: ${e.key??e.index} in ${o}`);let p={...c[i],...a};return a.value!==void 0&&(p.value=rt(p.value,p.type)),n(s,o,i,p),{storeId:o,index:i}}},removeValue:{description:"Remove a store value by key (or index).",schema:[{storeId:"String",key:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{removeValue:n}=await import("./removeValue-UP5ZFN3U.js"),s=t.ref([".stores"]),o=s.get([e.storeId,"state"])??[],a=Ce(o,e);if(a<0)throw new Error(`store value not found: ${e.key??e.index} in ${e.storeId}`);return n(s,e.storeId,a),{storeId:e.storeId,index:a}}},addComputed:{description:"Add a computed property to a store. code is a function body string: function () { ... } with store state available on this (e.g. this.items).",schema:[{storeId:"String",name:"String?",code:"String?"}],examples:[{args:{storeId:"cart",name:"total",code:"function () { return this.items.reduce((s, i) => s + i.price, 0); }"},description:"Add a cart total computed"}],returns:"{ storeId: String, name: String, index: Number }",handler:async e=>{let t=r("state"),{addComputed:n}=await import("./addComputed-7JLBFD6I.js"),{updateComputed:s}=await import("./updateComputed-7QA6XZIC.js"),o=t.ref([".stores"]),{storeId:a,name:c,code:i}=e;n(o,a);let p=o.get([a,"computed"])??[],l=0,m=p[l];return(c!==void 0||i!==void 0)&&s(o,a,l,{name:c??m.name,code:i??m.code}),{storeId:a,name:c??m.name,index:l}}},updateComputed:{description:"Update a store computed property by name (or index). changes may include name, code.",schema:[{storeId:"String",name:"String?",index:"Number?",changes:"Object"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{updateComputed:n}=await import("./updateComputed-7QA6XZIC.js"),s=t.ref([".stores"]),{storeId:o,changes:a={}}=e,c=s.get([o,"computed"])??[],i=Ce(c,e);if(i<0)throw new Error(`store computed not found: ${e.name??e.index} in ${o}`);return n(s,o,i,{...c[i],...a}),{storeId:o,index:i}}},removeComputed:{description:"Remove a store computed property by name (or index).",schema:[{storeId:"String",name:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{removeComputed:n}=await import("./removeComputed-WSA5GNVZ.js"),s=t.ref([".stores"]),o=s.get([e.storeId,"computed"])??[],a=Ce(o,e);if(a<0)throw new Error(`store computed not found: ${e.name??e.index} in ${e.storeId}`);return n(s,e.storeId,a),{storeId:e.storeId,index:a}}},addAction:{description:"Add an action to a store. code is a function body string: function () { ... } that can read and mutate store values via this (e.g. this.items).",schema:[{storeId:"String",name:"String?",code:"String?"}],examples:[{args:{storeId:"cart",name:"clear",code:"function () { this.items = []; }"},description:"Add a clear-cart action"}],returns:"{ storeId: String, name: String, index: Number }",handler:async e=>{let t=r("state"),{addAction:n}=await import("./addAction-EGLGEGTS.js"),{updateAction:s}=await import("./updateAction-3KSR6ZIJ.js"),o=t.ref([".stores"]),{storeId:a,name:c,code:i}=e;n(o,a);let p=o.get([a,"actions"])??[],l=0,m=p[l];return(c!==void 0||i!==void 0)&&s(o,a,l,{name:c??m.name,code:i??m.code}),{storeId:a,name:c??m.name,index:l}}},updateAction:{description:"Update a store action by name (or index). changes may include name, code.",schema:[{storeId:"String",name:"String?",index:"Number?",changes:"Object"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{updateAction:n}=await import("./updateAction-3KSR6ZIJ.js"),s=t.ref([".stores"]),{storeId:o,changes:a={}}=e,c=s.get([o,"actions"])??[],i=Ce(c,e);if(i<0)throw new Error(`store action not found: ${e.name??e.index} in ${o}`);return n(s,o,i,{...c[i],...a}),{storeId:o,index:i}}},removeAction:{description:"Remove a store action by name (or index).",schema:[{storeId:"String",name:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let t=r("state"),{removeAction:n}=await import("./removeAction-T4M5EJN7.js"),s=t.ref([".stores"]),o=s.get([e.storeId,"actions"])??[],a=Ce(o,e);if(a<0)throw new Error(`store action not found: ${e.name??e.index} in ${e.storeId}`);return n(s,e.storeId,a),{storeId:e.storeId,index:a}}}}));var qt=E("animation",r=>({create:{description:'Create an animation asset. keyframes is a Web Animations API keyframe array (e.g. [{ opacity: 0 }, { opacity: 1 }]). scope is "project" (reusable) or "node". Bind it to nodes with animation:bind.',mcpName:"create_animation",schema:[{name:"String",keyframes:"Array",duration:"Number?",easing:"String?",iterations:"Number?",fill:"String?",scope:"String?"}],examples:[{args:{name:"Fade In",keyframes:[{opacity:0},{opacity:1}],duration:400,easing:"ease-out",scope:"project"},description:"Create a reusable fade-in animation"}],returns:"{ id: String, name: String }",handler:async e=>{let t=r("state"),{createAnimation:n}=await import("./createAnimation-2WQSMYT5.js"),{createAnimationId:s}=await import("./id-ZIAZZ5AS.js"),o=t.ref(["animations"]),{name:a,keyframes:c,duration:i,easing:p,iterations:l,fill:m,scope:h}=e,g=s();return o.set([g],n({name:a,keyframes:c,duration:i,easing:p,iterations:l,fill:m,scope:h??"project"})),{id:g,name:a}}},update:{description:"Update an animation asset. changes may include name, keyframes, duration, easing, iterations, fill, direction, delay.",schema:[{animationId:"String",changes:"Object"}],examples:[{args:{animationId:"anim_abc",changes:{duration:600}},description:"Slow an animation down"}],returns:"{ id: String }",handler:async e=>{let n=r("state").ref(["animations"]),{animationId:s,changes:o={}}=e;if(!n.get([s]))throw new Error(`animation not found: ${s}`);for(let[c,i]of Object.entries(o))n.set([s,c],i);return{id:s}}},delete:{description:"Delete an animation asset by id. Does not remove bindings that reference it.",schema:[{animationId:"String"}],returns:"{ id: String }",handler:async e=>(r("state").ref(["animations"]).remove([e.animationId]),{id:e.animationId})},bind:{description:'Bind an animation to a node. play is the trigger: "mount", "click", "hover", etc. Set reverse to a trigger to play backwards on that event.',mcpName:"bind_animation",schema:[{nodeId:"String",animationId:"String",play:"String?",reverse:"String?"}],examples:[{args:{nodeId:"nd_hero",animationId:"anim_abc",play:"mount"},description:"Fade the hero in on mount"}],returns:"{ nodeId: String, animationId: String, index: Number }",handler:async e=>{let t=r("state"),{addAnimationBinding:n}=await import("./addAnimationBinding-WCB5VZLU.js"),s=t.ref(["nodes"]),{nodeId:o,animationId:a,play:c,reverse:i}=e,p={id:a,play:c??"mount"};return i!==void 0&&(p.reverse=i),n(s,o,p),{nodeId:o,animationId:a}}},unbind:{description:"Remove an animation binding from a node by animation id.",schema:[{nodeId:"String",animationId:"String"}],returns:"{ nodeId: String, animationId: String }",handler:async e=>{let t=r("state"),{removeAnimationBinding:n}=await import("./removeAnimationBinding-AIISPC33.js");return n(t.ref(["nodes"]),e.nodeId,e.animationId),{nodeId:e.nodeId,animationId:e.animationId}}},updateBinding:{description:"Update an animation binding on a node by animation id. binding may include play, reverse, or id.",schema:[{nodeId:"String",animationId:"String",binding:"Object"}],returns:"{ nodeId: String, animationId: String }",handler:async e=>{let t=r("state"),{updateAnimationBinding:n}=await import("./updateAnimationBinding-HVVHLFBO.js");return n(t.ref(["nodes"]),e.nodeId,e.animationId,e.binding),{nodeId:e.nodeId,animationId:e.animationId}}}}));var Yt=[Wt,jt,Ht,zt,Ft,qt];var it=[{type:"graphic",displayName:"Rectangle",category:"shapes",keywords:["rectangle"],shape:"rectangle"},{type:"graphic",displayName:"Rounded Rectangle",category:"shapes",keywords:["rounded","rectangle"],shape:"roundedRectangle"},{type:"graphic",displayName:"Ellipse",category:"shapes",keywords:["ellipse"],shape:"ellipse"},{type:"graphic",displayName:"Triangle",category:"shapes",keywords:["triangle"],shape:"triangle"}];var Vt=[{type:"aside",displayName:"Aside",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"aside"},{type:"footer",displayName:"Footer",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"footer"},{type:"form",displayName:"Form",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"form"},{type:"header",displayName:"Header",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"header"},{type:"main",displayName:"Main",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"main"},{type:"section",displayName:"Section",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"section"},{type:"article",displayName:"Article",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"article"},{type:"nav",displayName:"Nav",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"nav"},{type:"div",displayName:"Div",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"div"},{type:"template",displayName:"Template",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"template"}];var Xt=[{type:"h1",displayName:"Heading 1",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h1"},{type:"h2",displayName:"Heading 2",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h2"},{type:"h3",displayName:"Heading 3",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h3"},{type:"h4",displayName:"Heading 4",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h4"},{type:"h5",displayName:"Heading 5",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h5"},{type:"h6",displayName:"Heading 6",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h6"},{type:"p",displayName:"Paragraph",category:"text",swapGroup:"text",keywords:["text"],tagName:"p"},{type:"label",displayName:"Label",category:"text",swapGroup:"text",keywords:["text"],tagName:"label"},{type:"span",displayName:"Span",category:"text",swapGroup:"text",keywords:["text"],tagName:"span"},{type:"blockquote",displayName:"Blockquote",category:"text",swapGroup:null,keywords:["text"],tagName:"blockquote"},{type:"pre",displayName:"Preformatted",category:"text",swapGroup:null,keywords:["text"],tagName:"pre"},{type:"codeElement",displayName:"Code",category:"text",swapGroup:"text",keywords:["text"],tagName:"code"},{type:"strong",displayName:"Strong",category:"text",swapGroup:"text",keywords:["text"],tagName:"strong"},{type:"em",displayName:"Emphasis",category:"text",swapGroup:"text",keywords:["text"],tagName:"em"},{type:"small",displayName:"Small",category:"text",swapGroup:"text",keywords:["text"],tagName:"small"},{type:"mark",displayName:"Mark",category:"text",swapGroup:null,keywords:["text"],tagName:"mark"},{type:"hr",displayName:"Horizontal Rule",category:"text",swapGroup:null,keywords:["text","divider"],tagName:"hr"},{type:"br",displayName:"Line Break",category:"text",swapGroup:null,keywords:["text"],tagName:"br"}];var Kt=[{type:"button",displayName:"Button",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"button"},{type:"a",displayName:"Link",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"a"},{type:"details",displayName:"Details",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"details"},{type:"summary",displayName:"Summary",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"summary"},{type:"dialog",displayName:"Dialog",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"dialog"}];var Jt=[{type:"radio",displayName:"Radio",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"textInput",displayName:"Text",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"checkbox",displayName:"Checkbox",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"phone",displayName:"Phone",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"email",displayName:"Email",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"password",displayName:"Password",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"select",displayName:"Select",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"select"},{type:"textarea",displayName:"Textarea",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"textarea"},{type:"number",displayName:"Number",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"date",displayName:"Date",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"range",displayName:"Range",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"file",displayName:"File Upload",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"search",displayName:"Search",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"color",displayName:"Color Picker",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"hidden",displayName:"Hidden",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"}];var Zt=[{type:"img",displayName:"Image",category:"media",swapGroup:null,keywords:["media"],tagName:"img"},{type:"video",displayName:"Video",category:"media",swapGroup:null,keywords:["media"],tagName:"video"},{type:"audio",displayName:"Audio",category:"media",swapGroup:null,keywords:["media"],tagName:"audio"},{type:"iframe",displayName:"Iframe",category:"media",swapGroup:null,keywords:["media"],tagName:"iframe"},{type:"figure",displayName:"Figure",category:"media",swapGroup:null,keywords:["media"],tagName:"figure"},{type:"figcaption",displayName:"Figcaption",category:"media",swapGroup:null,keywords:["media"],tagName:"figcaption"}];var Qt=[{type:"ol",displayName:"Ordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ol"},{type:"ul",displayName:"Unordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ul"},{type:"li",displayName:"List Item",category:"lists",swapGroup:null,keywords:["lists"],tagName:"li"},{type:"dl",displayName:"Definition List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"dl"},{type:"dt",displayName:"Definition Term",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dt"},{type:"dd",displayName:"Definition Description",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dd"}];var en=[{type:"table",displayName:"Table",category:"tables",swapGroup:null,keywords:["tables"],tagName:"table"},{type:"thead",displayName:"Table Head",category:"tables",swapGroup:null,keywords:["tables"],tagName:"thead"},{type:"tbody",displayName:"Table Body",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tbody"},{type:"tfoot",displayName:"Table Foot",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tfoot"},{type:"tr",displayName:"Table Row",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tr"},{type:"th",displayName:"Table Header Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"th"},{type:"td",displayName:"Table Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"td"}];var tn=[{type:"fieldset",displayName:"Fieldset",category:"form",swapGroup:null,keywords:["form"],tagName:"fieldset"},{type:"legend",displayName:"Legend",category:"form",swapGroup:null,keywords:["form"],tagName:"legend"},{type:"meter",displayName:"Meter",category:"form",swapGroup:null,keywords:["form"],tagName:"meter"},{type:"progress",displayName:"Progress",category:"form",swapGroup:null,keywords:["form"],tagName:"progress"}];var nn=[{type:"slot",displayName:"Slot",category:"special",swapGroup:null,keywords:["slot","placeholder","component","template"],tagName:"slot"}];var on=[...Vt,...Xt,...Kt,...Jt,...Zt,...Qt,...en,...tn,...nn];var sn={jui_fadeIn:{name:"Fade In",category:"entrance",defaultPlay:"mount",duration:600,easing:"ease",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0"}},{offset:1,properties:{opacity:"1"}}]},jui_fadeInUp:{name:"Fade In Up",category:"entrance",defaultPlay:"mount",duration:600,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateY(30px)"}},{offset:1,properties:{opacity:"1",transform:"translateY(0)"}}]},jui_fadeInDown:{name:"Fade In Down",category:"entrance",defaultPlay:"mount",duration:600,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateY(-30px)"}},{offset:1,properties:{opacity:"1",transform:"translateY(0)"}}]},jui_slideInLeft:{name:"Slide In Left",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateX(-60px)"}},{offset:1,properties:{opacity:"1",transform:"translateX(0)"}}]},jui_slideInRight:{name:"Slide In Right",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateX(60px)"}},{offset:1,properties:{opacity:"1",transform:"translateX(0)"}}]},jui_slideInUp:{name:"Slide In Up",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateY(60px)"}},{offset:1,properties:{opacity:"1",transform:"translateY(0)"}}]},jui_slideInDown:{name:"Slide In Down",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"translateY(-60px)"}},{offset:1,properties:{opacity:"1",transform:"translateY(0)"}}]},jui_scaleIn:{name:"Scale In",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"scale(0.8)"}},{offset:1,properties:{opacity:"1",transform:"scale(1)"}}]},jui_zoomIn:{name:"Zoom In",category:"entrance",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"0",transform:"scale(0.3)"}},{offset:1,properties:{opacity:"1",transform:"scale(1)"}}]}};var an={jui_fadeOut:{name:"Fade Out",category:"exit",defaultPlay:"mount",duration:600,easing:"ease",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"1"}},{offset:1,properties:{opacity:"0"}}]},jui_fadeOutDown:{name:"Fade Out Down",category:"exit",defaultPlay:"mount",duration:600,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"1",transform:"translateY(0)"}},{offset:1,properties:{opacity:"0",transform:"translateY(30px)"}}]},jui_slideOutLeft:{name:"Slide Out Left",category:"exit",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"1",transform:"translateX(0)"}},{offset:1,properties:{opacity:"0",transform:"translateX(-60px)"}}]},jui_slideOutRight:{name:"Slide Out Right",category:"exit",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"1",transform:"translateX(0)"}},{offset:1,properties:{opacity:"0",transform:"translateX(60px)"}}]},jui_scaleOut:{name:"Scale Out",category:"exit",defaultPlay:"mount",duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards",keyframes:[{offset:0,properties:{opacity:"1",transform:"scale(1)"}},{offset:1,properties:{opacity:"0",transform:"scale(0.8)"}}]}};var rn={jui_pulse:{name:"Pulse",category:"emphasis",defaultPlay:"pointerenter",defaultReset:"pointerleave",duration:1e3,easing:"ease-in-out",fill:"none",keyframes:[{offset:0,properties:{transform:"scale(1)"}},{offset:.5,properties:{transform:"scale(1.05)"}},{offset:1,properties:{transform:"scale(1)"}}]},jui_bounce:{name:"Bounce",category:"emphasis",defaultPlay:"pointerenter",defaultReset:"pointerleave",duration:800,easing:"cubic-bezier(0.28, 0.84, 0.42, 1)",fill:"none",keyframes:[{offset:0,properties:{transform:"translateY(0)"}},{offset:.2,properties:{transform:"translateY(0)"}},{offset:.4,properties:{transform:"translateY(-20px)"}},{offset:.5,properties:{transform:"translateY(0)"}},{offset:.6,properties:{transform:"translateY(-10px)"}},{offset:.8,properties:{transform:"translateY(0)"}},{offset:1,properties:{transform:"translateY(0)"}}]},jui_shake:{name:"Shake",category:"emphasis",defaultPlay:"pointerenter",defaultReset:"pointerleave",duration:600,easing:"ease-in-out",fill:"none",keyframes:[{offset:0,properties:{transform:"translateX(0)"}},{offset:.1,properties:{transform:"translateX(-8px)"}},{offset:.2,properties:{transform:"translateX(8px)"}},{offset:.3,properties:{transform:"translateX(-8px)"}},{offset:.4,properties:{transform:"translateX(8px)"}},{offset:.5,properties:{transform:"translateX(-4px)"}},{offset:.6,properties:{transform:"translateX(4px)"}},{offset:.7,properties:{transform:"translateX(-2px)"}},{offset:.8,properties:{transform:"translateX(2px)"}},{offset:1,properties:{transform:"translateX(0)"}}]}};var dn={jui_flash:{name:"Flash",category:"attention",defaultPlay:"pointerenter",defaultReset:"pointerleave",duration:800,easing:"ease-in-out",fill:"none",keyframes:[{offset:0,properties:{opacity:"1"}},{offset:.25,properties:{opacity:"0"}},{offset:.5,properties:{opacity:"1"}},{offset:.75,properties:{opacity:"0"}},{offset:1,properties:{opacity:"1"}}]},jui_heartbeat:{name:"Heartbeat",category:"attention",defaultPlay:"pointerenter",defaultReset:"pointerleave",duration:1200,easing:"ease-in-out",fill:"none",keyframes:[{offset:0,properties:{transform:"scale(1)"}},{offset:.14,properties:{transform:"scale(1.3)"}},{offset:.28,properties:{transform:"scale(1)"}},{offset:.42,properties:{transform:"scale(1.3)"}},{offset:.7,properties:{transform:"scale(1)"}},{offset:1,properties:{transform:"scale(1)"}}]}};var cn={...sn,...an,...rn,...dn};var pn=T("ledger",r=>{let[e,t]=r("state","socket");return e.ledger.addChangeListener(n=>{n.length&&t.publish("ledger:sync",n)}),{apply:{handler:n=>{e.ledger.apply(n)}}}});var ln=T("presence",r=>{let e=r("channel");return{join:{handler:(t,n)=>{e.to("renderWorker").publish("user:connect",t,n)}},leave:{handler:t=>{e.to("renderWorker").publish("user:disconnect",t)}},update:{handler:(t,n)=>{e.to("renderWorker").publish("user:update",t,n)}},snapshot:{handler:t=>{e.to("renderWorker").publish("user:setAll",t)}}}});var un=T("assets",r=>{let[e,t,n]=r("cache","channel","socket"),s=o=>{e.set(["assets"],o),t.to("editor").publish("assets:set",o)};return n.onConnect(async()=>{try{s(await n.request("assets:requestSnapshot")??{})}catch{}}),{set:{handler:o=>s(o??{})},update:{handler:o=>s({...e.get(["assets"])??{},...o})},remove:{handler:o=>{let a={...e.get(["assets"])??{}};delete a[o],s(a)}}}});function mn(r,e,t){let n=e.getSelectedRids?.()??[],s=r.get(["nodes"])??{},o=n.length>0?e.getIds(n):[],a=n.length>0?$n(s,o,n,e):Mn(e);return{framework:t.get(["config","framework"])??"react",componentCatalog:e.getMeta(),stores:r.get([".stores"])??{},tokens:r.get(["tokens"])??{},animations:r.get(["animations"])??{},...a,availableFrames:kt(),layoutHints:Pn(s,n)}}function Mn(r){return{scope:"global",jsx:r.projectPuppetJsx("app",{maxDepth:8})}}function $n(r,e,t,n){let s=Ln(r,e[0])??"app";return{scope:"local",selectedIds:e,jsx:n.projectPuppetJsx(s)}}function Pn(r,e){let t={viewportPositions:[],usedPositions:[],containerLayouts:{},suggestedViewportPosition:null},n=0;return Object.entries(r).forEach(([s,o])=>{if(o.type==="frame"&&o.bounds){let{top:a,left:c,width:i,height:p}=o.bounds,l={id:s,name:o.name,top:a||0,left:c||0,width:i||375,height:p||667};t.viewportPositions.push(l);let m=l.left+l.width;m>n&&(n=m)}if(o.type!=="frame"&&o.style?.default?.position==="absolute"){let{top:a,left:c,width:i,height:p}=o.style.default;t.usedPositions.push({id:s,top:parseInt(a)||0,left:parseInt(c)||0,width:parseInt(i)||100,height:parseInt(p)||50})}(o.layout==="flex"||o.style?.default?.display==="flex")&&(t.containerLayouts[s]="flex"),(o.layout==="grid"||o.style?.default?.display==="grid")&&(t.containerLayouts[s]="grid")}),t.suggestedViewportPosition={top:0,left:n+50},t}function Dn(r,e){for(let[t,n]of Object.entries(r))if(n.children?.includes(e))return t;return null}function Ln(r,e){let t=e;for(;t;){let n=r[t];if(!n)return null;if(n.type==="frame")return t;t=Dn(r,t)}return null}var Gn=5e3,Bn=50,Wn=40,jn=2e3;function Hn(r){let e=Object.keys(r),t=new Set(e);return e.filter(n=>{let s=new Set([n]),o=r[n]?.parentRid;for(;o&&!s.has(o);){if(t.has(o))return!1;s.add(o),o=r[o]?.parentRid}return!0})}function zn(r,e=[],t=jn){let n=Hn(r.updated??{});return n.length===0&&r.fullSync?e.length?e:null:n.length>t?null:n}function Fn(r,e){return e.length<r.length}var hn=T("ai:stage",r=>{let[e,t,n,s,o]=r("state","sceneCompiler","cache","log","aiOps");function a(p=Gn){return new Promise(l=>{let m={},h=new Set,g=null,x=!1,N=!1,R=()=>{clearTimeout(k),clearTimeout(g),j(),l(x?{updated:m,removed:[...h],fullSync:N}:null)},k=setTimeout(R,p),j=t.addNodeGraphListener((H,Ve,Xe)=>{x=!0,Xe?N=!0:Object.assign(m,H??{}),(Ve??[]).forEach(Ke=>h.add(Ke)),clearTimeout(g),g=setTimeout(R,Bn)})})}function c(p){if(!p?.length)return[];try{return t.getIds(p)??[]}catch{return p}}function i(p,l=[]){if(!p)return{delta:!0,settled:!1,changedJsx:"",removedIds:[]};let m=zn(p,l);if(m===null)return null;let h=m.length?t.projectPuppetJsx(m):"";if(m.length>Wn){let g=t.projectPuppetJsx("app",{maxDepth:8});if(Fn(h,g))return null}return{delta:!0,settled:!0,changedJsx:h,removedIds:c(p.removed)}}return{"context:capture":{timeoutMs:15e3,handler:async({awaitRender:p,delta:l,focusIds:m=[]}={})=>{try{let h=p?await a():null;if(l){let g=i(h,m);if(g)return g}return mn(e,t,n)}catch(h){throw s.error("ai context capture failed",{error:h.message}),h}}},"operations:execute":{timeoutMs:6e4,handler:async({batch:p}={})=>{try{e.history.group();try{return await o.executeBatch(p??{operations:[]})}finally{e.history.commit(p?.description||p?.message||"AI changes")}}catch(l){throw s.error("ai operations execute failed",{error:l.message}),l}}}}});var fn=T("ai:sessions",r=>{let[e,t]=r("cache","channel");return{set:{handler:n=>{e.set(["ai","sessions"],n),t.to("editor").publish("ai:sessions:set",n)}}}});var gn=T("screenshot",r=>{let[e,t,n]=r("state","cache","channel");return{capture:{timeoutMs:12e4,handler:async({frameIds:s=null,limit:o=null,fullPage:a=!0,maxWidth:c=null,maxHeight:i=null}={})=>{let p=e.get(["nodes"]),l=p?.app?.children??[],m=s?.length?new Set(s):null,h=l.filter(k=>p[k]?.type==="frame").filter(k=>!m||m.has(k)).map(k=>({id:k,name:p[k].name||k,bounds:p[k].bounds})),g=m?[...m].filter(k=>!h.some(j=>j.id===k)):[],x=h.length;o&&h.length>o&&(h=h.slice(0,o));let N=t.get(["config"]),R=[];for(let k of h){let j={config:{basePath:N.basePath??`http://localhost:${N.port}`,view:"screen-capture",type:N.type||"local",nodeId:k.id},width:k.bounds?.width??1440,height:k.bounds?.height??900,result:"base64",fullPage:a};c!=null&&(j.maxWidth=c),i!=null&&(j.maxHeight=i);let H=await n.to("electronMain").request("screenCapture:capture",j);R.push({id:k.id,name:k.name,imageData:`data:image/jpeg;base64,${H.base64}`,scale:H.scale??1,naturalSize:H.naturalSize??null,outputSize:H.outputSize??null,scaled:H.scaled??!1})}return{frames:R,dropped:Math.max(0,x-R.length),...g.length?{missing:g}:{}}}}}});var yn=pt("sync",r=>{let[e,t,n,s]=r("channel","sceneCompiler","state","cache");return{push:()=>{e.to("renderWorker").publish("sync:set",{graph:t.getNodeGraph()??{},viewport:t.getViewport(),selectedRids:t.getSelectedRids(),focalRid:t.getFocalRid()}),e.to("editor").publish("sync:set",{graph:t.getNodeGraph()??{},stores:n.get([".stores"])??{},tokens:n.get(["tokens"])??{},animations:n.get(["animations"])??{},assets:s.get(["assets"])??{},libraryClassNames:n.get(["libraryClassNames"])??[],components:t.getMeta(),aiSessions:s.get(["ai","sessions"])??[]})}}});var mr=async(r,e)=>{try{let t={...Nt,...r},n=(await import("/components.js"))?.default??{},s=Be(t.$el||"app"),o=Be("temp"),a=Be("components"),c=Bt(),i=ct.create().install(gt,lt.configure({plugins:[yt,St.configure({actorId:crypto.randomUUID()}),Ut,bt,Pt]}),ut.configure(t),ue,mt,ht.configure(xt(t,{auth:e??null})),ft.configure({visibility:!0,focus:!1,freeze:!0,sleepDetection:{enabled:!0,threshold:1e4}}),ve);i.cache.load({config:t,token:e,$app:s,$temp:o,$components:a,viewport:c}),i.aiOps.use(...Yt);let[p,l]=await Promise.all([fetch(new URL("scene/snapshot",t.basePath)).then(h=>h.json()),fetch(new URL("ai/chats",t.basePath)).then(h=>h.ok?h.json():null).catch(()=>null)]);i.use(yn),i.state.ledger.hydrate(p),i.state.history.start(),i.sceneCompiler.loadPrototypes(vt),i.sceneCompiler.loadSources(n),await i.sceneCompiler.create("app","app"),await i.sceneCompiler.create("temp","temp",{mode:"temp"}),await i.sceneCompiler.create("components","components",{mode:"components"}),l?.sessions&&i.cache.set(["ai","sessions"],l.sessions),i.socket.use(pn,ln,un,It,hn,fn,gn),i.windowBridge.register("parent",window.parent,"*"),i.windowBridge.subscribe("jucie:channel:close",()=>{try{i.channel.disconnect()}catch(h){console.warn("[stage] channel disconnect failed",h)}return!0}),i.channel.portProvider(async()=>await i.windowBridge.to("parent").request("jucie:port:request",t.id));let m=await i.channel.connect();if(m){let{nodeGraphContracts:h}=await import("./nodeGraph-UNI2HUNX.js"),{historyContracts:g}=await import("./history-CMF3VYTT.js"),{userContracts:x}=await import("./user-H5DKMGWA.js"),{assetsContracts:N}=await import("./assets-6LM3GVQU.js"),{aiContracts:R}=await import("./aiRelay-C6ZJ3PUF.js"),{aiSessionContracts:k}=await import("./aiSessionContracts-NHU57TUZ.js"),{aiMessagesContracts:j}=await import("./aiMessagesContracts-RAR7ENH4.js"),{aiAttachmentContracts:H}=await import("./aiAttachmentContracts-7LLE57FI.js"),{contentEditorContracts:Ve}=await import("./contentEditor-7BYCT3TH.js"),{viewportContracts:Xe}=await import("./viewport-ZRWTVYC3.js"),{contracts:Ke}=await import("./main-S7RT75O6.js"),{contracts:wn}=await import("./main-FAFZABOS.js"),{contracts:bn}=await import("./main-DH4JOS22.js"),{contracts:Sn}=await import("./main-3VRCGPRY.js");return m.use(Xe,h,g,x,N,R,k,j,H,Ve,...Ke,...wn,...bn,...Sn),i.channel.to("editor").publish("elements:set",on),i.channel.to("editor").publish("frames:set",Ze),i.channel.to("editor").publish("graphics:set",it),i.channel.to("editor").publish("globalAnimations:set",cn),i.channel.to("editor").publish("components:set",i.sceneCompiler.getMeta()),i.channel.to("editor").publish("assets:set",i.cache.get(["assets"])??{}),i.channel.to("editor").publish("ai:sessions:set",i.cache.get(["ai","sessions"])??[]),pe(()=>i.state.get(["nodes"]),w=>{if(!w)return;let U=Object.keys(w).filter(G=>w[G]?.type==="component"),L=[...i.sceneCompiler.getMeta()];for(let G of U){let Le=w[G];L.push({displayName:Le.name||G,category:"local",keywords:[Le.name,"component"],library:null,tagName:G})}i.channel.to("editor").publish("components:set",L)}),pe(()=>i.state.get(["tokens"]),w=>{i.channel.to("editor").publish("tokens:set",w??{}),i.channel.to("panel-tokens").publish("token:set",w??{})}),pe(()=>i.state.get([".stores"]),w=>{i.channel.to("editor").publish("stores:set",w??{})}),pe(()=>i.state.get(["libraryClassNames"]),w=>{i.channel.to("editor").publish("libraryClassNames:set",w??[])}),pe(()=>{let w=i.state.get(["animations"])??{};return Object.entries(w).map(([U,L])=>({id:U,...L}))},w=>{i.channel.to("editor").publish("animations:set",w??[])}),i.sceneCompiler.addNodeGraphListener((w,U,L)=>{L?m.to("renderWorker","editor").publish("nodeGraph:set",w):m.to("renderWorker","editor").publish("nodeGraph:update",w,U),i.sceneCompiler.projectPuppetJsx(["app"])}),i.sceneCompiler.startNodeGraph(),i.pageLifecycle.on("hidden",()=>{i.sceneCompiler.pauseNodeGraph()}),i.pageLifecycle.on("visible",()=>{i.sceneCompiler.forceNodeGraph()}),i.pageLifecycle.on("resume",()=>{i.socket.ready()||i.socket.connect(),i.sceneCompiler.forceNodeGraph()}),i.pageLifecycle.on("beforeclose",()=>{i.channel.disconnect()}),m.subscribe("selection:rids:set",w=>{i.sceneCompiler.setSelectedRids(w)}),m.subscribe("selection:focalRid:set",w=>{i.sceneCompiler.setFocalRid(w||null)}),m.subscribe("animation:preview:play",(w,U)=>{for(let L of U){let G=i.sceneCompiler.animate(L,w,{fill:"none"}),Le=Array.isArray(G)?G:G?[G]:[];for(let xn of Le)xn.addEventListener("finish",()=>{m.to("editor").publish("animation:preview:finished",w)},{once:!0})}}),m.subscribe("animation:preview:stop",(w,U)=>{for(let L of U)i.sceneCompiler.cancelAnimation(L,w)}),m.subscribe("animation:preview:seek",(w,U)=>{i.sceneCompiler.seekAnimation(w,U)}),i.channel.onEnable(i.sync.push),i.sync.push(),t}else throw new Error("Stage channel failed to connect")}catch(t){return{error:t.message}}};export{mr as createDesignBootstrap};