@nodefony/studio 10.0.0-alpha.3 → 10.0.0-alpha.5

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 (276) hide show
  1. package/LICENSE +201 -543
  2. package/README.md +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorate.js +1 -1
  4. package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorateMetadata.js +1 -1
  5. package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorateParam.js +1 -1
  6. package/dist/frontend/assets/{Accordion-DeeP_sUE.js → Accordion-CSYj18pO.js} +1 -1
  7. package/dist/frontend/assets/{ActionsLiveGraph-OtAEmCbe.js → ActionsLiveGraph-BxaCFGtT.js} +1 -1
  8. package/dist/frontend/assets/{ApiKeys-Do5AqihE.js → ApiKeys-C6Qxbzzu.js} +1 -1
  9. package/dist/frontend/assets/{ArchitectureLiveGraph-UVR2nwmV.js → ArchitectureLiveGraph-CJVdJHhW.js} +1 -1
  10. package/dist/frontend/assets/{Audit-CC2uyz48.js → Audit-ClOeY3RC.js} +1 -1
  11. package/dist/frontend/assets/{BackplaneLiveGraph-BsKE3ofy.js → BackplaneLiveGraph-DJ_fyOE3.js} +1 -1
  12. package/dist/frontend/assets/{Breadcrumbs-Di_zerWP.js → Breadcrumbs-BqaXSc5Y.js} +1 -1
  13. package/dist/frontend/assets/{BrickStoreChip-ChQfhXYK.js → BrickStoreChip-CsvDTxGr.js} +1 -1
  14. package/dist/frontend/assets/{Chat-BlyYQbsu.js → Chat-C_s0sg3L.js} +1 -1
  15. package/dist/frontend/assets/{Chip-Bl5u9dbS.js → Chip-BZMdRue_.js} +1 -1
  16. package/dist/frontend/assets/{Cluster-Dxqjasb2.js → Cluster-CngAn0c-.js} +1 -1
  17. package/dist/frontend/assets/Collapse-ixlBE3dZ.js +1 -0
  18. package/dist/frontend/assets/{ConfigPage-Pd1VGrYE.js → ConfigPage-B0fLh-C1.js} +1 -1
  19. package/dist/frontend/assets/{ConnectorCard-COW3xxIY.js → ConnectorCard-BOHv-B1U.js} +1 -1
  20. package/dist/frontend/assets/{Create-BtNi60yz.js → Create-BH4qbdxx.js} +1 -1
  21. package/dist/frontend/assets/{DashboardSupervision-DzES5rH6.js → DashboardSupervision-CYG-QND9.js} +1 -1
  22. package/dist/frontend/assets/{Database-B9ML7R0q.js → Database-Dbf6nzzP.js} +1 -1
  23. package/dist/frontend/assets/{DbLogo-Banbmr1E.js → DbLogo-DWQtpdyh.js} +1 -1
  24. package/dist/frontend/assets/{Documentation-D5GFgWWF.js → Documentation-VD6RebeR.js} +1 -1
  25. package/dist/frontend/assets/{FanOutLiveGraph-C9XplTDk.js → FanOutLiveGraph-DBimHnPZ.js} +1 -1
  26. package/dist/frontend/assets/{Firewall-8mJttiRK.js → Firewall-DFKt54zK.js} +1 -1
  27. package/dist/frontend/assets/{IconAdjustments-D0HfIe2W.js → IconAdjustments-C8dasIxn.js} +1 -1
  28. package/dist/frontend/assets/{IconAdjustmentsAlt-CpX5lLHt.js → IconAdjustmentsAlt-EcHTHWRg.js} +1 -1
  29. package/dist/frontend/assets/{IconAdjustmentsHorizontal-DImXiF4f.js → IconAdjustmentsHorizontal-BapdSASN.js} +1 -1
  30. package/dist/frontend/assets/{IconAffiliate-BlILKrfl.js → IconAffiliate-DO3138F0.js} +1 -1
  31. package/dist/frontend/assets/{IconApps-D42Eh0ms.js → IconApps-DJrfgTWN.js} +1 -1
  32. package/dist/frontend/assets/{IconArchive-B3mckh6a.js → IconArchive-BAp8LI1S.js} +1 -1
  33. package/dist/frontend/assets/{IconArrowDown-x3fexITu.js → IconArrowDown-CJDoBY_w.js} +1 -1
  34. package/dist/frontend/assets/{IconArrowLeft-BW1qFtph.js → IconArrowLeft-DmvfJmth.js} +1 -1
  35. package/dist/frontend/assets/{IconArrowUp-BA1LHiHP.js → IconArrowUp-BhHJpync.js} +1 -1
  36. package/dist/frontend/assets/IconArrowsExchange-CqUqlC4M.js +1 -0
  37. package/dist/frontend/assets/{IconArrowsSplit2-CQ6kodDz.js → IconArrowsSplit2-CaES63LD.js} +1 -1
  38. package/dist/frontend/assets/IconBan-DG_QSYu5.js +1 -0
  39. package/dist/frontend/assets/{IconBook-BBvFf5ZR.js → IconBook-BrHWMCrm.js} +1 -1
  40. package/dist/frontend/assets/{IconCircleCheck-A40shAqp.js → IconCircleCheck-CxgUPqFg.js} +1 -1
  41. package/dist/frontend/assets/{IconCircleDot-DJ3TPKeX.js → IconCircleDot-DXW19sp6.js} +1 -1
  42. package/dist/frontend/assets/IconCircuitResistor-C1I4I0s-.js +1 -0
  43. package/dist/frontend/assets/{IconCode-CKau3qWG.js → IconCode-DpM-J1KJ.js} +1 -1
  44. package/dist/frontend/assets/{IconDeviceDesktop-D5JRHElk.js → IconDeviceDesktop-DvusTMKc.js} +1 -1
  45. package/dist/frontend/assets/{IconDots-DxBL013E.js → IconDots-BV_CET9W.js} +1 -1
  46. package/dist/frontend/assets/{IconDownload-JE7axuwl.js → IconDownload-a2zrZGyV.js} +1 -1
  47. package/dist/frontend/assets/{IconEye-DO2HMGkp.js → IconEye-BrtKo3KV.js} +1 -1
  48. package/dist/frontend/assets/{IconFile-BhdAnR_G.js → IconFile-DF6vWKtb.js} +1 -1
  49. package/dist/frontend/assets/{IconFolder-Yt7HBZMR.js → IconFolder-DyhH98ZZ.js} +1 -1
  50. package/dist/frontend/assets/{IconGitBranch-BMDmzaoq.js → IconGitBranch-CYzRmKaR.js} +1 -1
  51. package/dist/frontend/assets/{IconHeartRateMonitor-CD4lXee2.js → IconHeartRateMonitor-B4XbDH_2.js} +1 -1
  52. package/dist/frontend/assets/{IconHelpCircle-Dn9dibbs.js → IconHelpCircle-DVhyybMg.js} +1 -1
  53. package/dist/frontend/assets/{IconLayoutGrid-BgtRb6yj.js → IconLayoutGrid-nzBpf-EU.js} +1 -1
  54. package/dist/frontend/assets/{IconNetwork-zXiVscld.js → IconNetwork-NwgQKRan.js} +1 -1
  55. package/dist/frontend/assets/{IconPackages-n3HB7b1q.js → IconPackages-BEEY_HA6.js} +1 -1
  56. package/dist/frontend/assets/{IconPencil-DbS-vJyZ.js → IconPencil-E8gbBJZM.js} +1 -1
  57. package/dist/frontend/assets/{IconPlayerPause-C7lj1Zh9.js → IconPlayerPause-BV1n07nh.js} +1 -1
  58. package/dist/frontend/assets/IconPlayerPlay-Bnjmz2tQ.js +1 -0
  59. package/dist/frontend/assets/IconPlus-BS5_mDd8.js +1 -0
  60. package/dist/frontend/assets/{IconPuzzle-CwhG8MRK.js → IconPuzzle-BYwvzqem.js} +1 -1
  61. package/dist/frontend/assets/{IconRecycle-BY_5VEAJ.js → IconRecycle-B17kLeHU.js} +1 -1
  62. package/dist/frontend/assets/{IconSend-BcRgfgxx.js → IconSend-qUoPOahB.js} +1 -1
  63. package/dist/frontend/assets/{IconServer2-C6dpzUEW.js → IconServer2-ePWwwDY5.js} +1 -1
  64. package/dist/frontend/assets/{IconShieldOff-D79HNNIy.js → IconShieldOff-Jf5MYTtm.js} +1 -1
  65. package/dist/frontend/assets/{IconSitemap-Dab03rIE.js → IconSitemap-D6pH6JtB.js} +1 -1
  66. package/dist/frontend/assets/{IconStack2-DyGf4gBB.js → IconStack2-CzLbifuv.js} +1 -1
  67. package/dist/frontend/assets/{IconTerminal2-DSH3YLIn.js → IconTerminal2-BSW455uy.js} +1 -1
  68. package/dist/frontend/assets/{IconUserOff-ChnC-rv1.js → IconUserOff-D-GLuxt0.js} +1 -1
  69. package/dist/frontend/assets/{IconWorld-hgife9QW.js → IconWorld-DwkkngvZ.js} +1 -1
  70. package/dist/frontend/assets/{List-DRlGV5Z9.js → List-VZvMDP2R.js} +1 -1
  71. package/dist/frontend/assets/{LogVisuals-CT7njxyS.js → LogVisuals-CPvlReD2.js} +1 -1
  72. package/dist/frontend/assets/Logs-CZoJR_i7.js +1 -0
  73. package/dist/frontend/assets/{Migrations-B-_naVTR.js → Migrations-DAtdcfuU.js} +1 -1
  74. package/dist/frontend/assets/{ModuleDetail-B0GAuHqs.js → ModuleDetail-CYtdUBpr.js} +1 -1
  75. package/dist/frontend/assets/{Modules-DmjSVmji.js → Modules-CvYA84P3.js} +1 -1
  76. package/dist/frontend/assets/{OrmEntity-BEZx7FYP.js → OrmEntity-HMrZUp7W.js} +1 -1
  77. package/dist/frontend/assets/{OrmOverview-CMxzsr9H.js → OrmOverview-XWo2bGLc.js} +1 -1
  78. package/dist/frontend/assets/{OrmWorker-D93uHZtx.js → OrmWorker-BWuECAHH.js} +1 -1
  79. package/dist/frontend/assets/{Playground-D_rfpkvQ.js → Playground-Be4rftVm.js} +1 -1
  80. package/dist/frontend/assets/{ProbesLiveGraph-BDd95SoY.js → ProbesLiveGraph-CmJtLn7n.js} +1 -1
  81. package/dist/frontend/assets/{Profile-2wi5abhR.js → Profile-avZg2CiQ.js} +1 -1
  82. package/dist/frontend/assets/{ProfileFields-CrS9PGuv.js → ProfileFields-C9mG7djZ.js} +1 -1
  83. package/dist/frontend/assets/{Progress-DInNqOHx.js → Progress-C-uVBbTz.js} +1 -1
  84. package/dist/frontend/assets/{ProtocoleLiveGraph-BW9WiiJR.js → ProtocoleLiveGraph-3KTHkxth.js} +1 -1
  85. package/dist/frontend/assets/{RealtimeConsole-77e0iDl2.js → RealtimeConsole-W_kNUVvD.js} +1 -1
  86. package/dist/frontend/assets/{RingProgress-CDDSa9QM.js → RingProgress-BcurYYhC.js} +1 -1
  87. package/dist/frontend/assets/{Roadmap-CSv00gl7.js → Roadmap-UmBGuO58.js} +1 -1
  88. package/dist/frontend/assets/{RoleSwitch-BVx1Ea5b.js → RoleSwitch-DyhIWh9u.js} +1 -1
  89. package/dist/frontend/assets/{Roles-CvbxUgPg.js → Roles-Cq3RNzS2.js} +1 -1
  90. package/dist/frontend/assets/{RoutesView-D61oUF0X.js → RoutesView-CLHQqjH2.js} +1 -1
  91. package/dist/frontend/assets/{Runtime-UIvgh_gO.js → Runtime-DcWHlgx8.js} +1 -1
  92. package/dist/frontend/assets/{Sessions-Chibt7_c.js → Sessions-KXXZDgao.js} +1 -1
  93. package/dist/frontend/assets/{Skeleton-Bo9zmk9r.js → Skeleton-CYTwt2iv.js} +1 -1
  94. package/dist/frontend/assets/{Slider-CEX_48EM.js → Slider-B3EsNyHw.js} +1 -1
  95. package/dist/frontend/assets/{StoresView-dGRhFCd-.js → StoresView-Bwaz45IX.js} +1 -1
  96. package/dist/frontend/assets/{System-qj1r2iXo.js → System-B2_HCksG.js} +1 -1
  97. package/dist/frontend/assets/{TagsInput-BL_ud2uJ.js → TagsInput-CF7wjb1h.js} +1 -1
  98. package/dist/frontend/assets/{Textarea-BlO8gUlE.js → Textarea-ajvDDbkh.js} +1 -1
  99. package/dist/frontend/assets/{TraceView-Ufd3bDP0.js → TraceView-Jvn87VtQ.js} +1 -1
  100. package/dist/frontend/assets/{Twin-J5wcamTD.js → Twin-BXsNqXZ8.js} +1 -1
  101. package/dist/frontend/assets/{UserProfile-BC6vIHRr.js → UserProfile-C9KCsAyr.js} +1 -1
  102. package/dist/frontend/assets/{Users-D5DFs-rY.js → Users-CFJL0HHJ.js} +1 -1
  103. package/dist/frontend/assets/{Webhooks-DNnY2_6O.js → Webhooks-CJpG8oqL.js} +1 -1
  104. package/dist/frontend/assets/{Workspace-CMTzcN6A.js → Workspace-Te56IBtl.js} +1 -1
  105. package/dist/frontend/assets/_basePickBy-QJXUw_pr.js +1 -0
  106. package/dist/frontend/assets/_baseUniq-DR4vVjyC.js +1 -0
  107. package/dist/frontend/assets/{abnfDiagram-VCTEODGH-Cernzewp.js → abnfDiagram-O67JEVCF-B8pam94f.js} +1 -1
  108. package/dist/frontend/assets/{apiKeysModel-CDXHN9jJ.js → apiKeysModel-BWOmAQaT.js} +1 -1
  109. package/dist/frontend/assets/architecture-7GRP2DOG-CBO_kzGR.js +1 -0
  110. package/dist/frontend/assets/architectureDiagram-NJMV4G6O-6gmizkIP.js +36 -0
  111. package/dist/frontend/assets/{auditFormat-0-j3KQs8.js → auditFormat-CKkFJZWr.js} +1 -1
  112. package/dist/frontend/assets/{auditModel-A_5uW57O.js → auditModel-DHrsrlmP.js} +1 -1
  113. package/dist/frontend/assets/{blockDiagram-I7D4REHJ-JEZGEK5g.js → blockDiagram-BEXU5L5S-CPV6OfBz.js} +15 -4
  114. package/dist/frontend/assets/c4Diagram-YGBWAQC7-BxzOrOd5.js +38 -0
  115. package/dist/frontend/assets/channel-CLVQeto6.js +1 -0
  116. package/dist/frontend/assets/chunk-3FUC2YCW-TJIJwE1t.js +2 -0
  117. package/dist/frontend/assets/{chunk-GVQU2GXP-CJTCPJEH.js → chunk-5DYCD2WN-C6fNpDCq.js} +1 -1
  118. package/dist/frontend/assets/{chunk-PWAF6VOD-8aIc0M2s.js → chunk-742MDFTN-BuWqUJ1x.js} +1 -1
  119. package/dist/frontend/assets/chunk-7INBJB4K-BLEZ8obp.js +62 -0
  120. package/dist/frontend/assets/chunk-7M6MHVWA-DRzYiIPp.js +213 -0
  121. package/dist/frontend/assets/chunk-7PRAP22T-CY3tH-_v.js +1 -0
  122. package/dist/frontend/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  123. package/dist/frontend/assets/{chunk-FOHPRMQF-CoA4358r.js → chunk-FOHPRMQF-DzxwRta7.js} +2 -2
  124. package/dist/frontend/assets/{chunk-SVP7TREG-DDQGdttt.js → chunk-GTNCS2PH-DZtp2P9b.js} +1 -1
  125. package/dist/frontend/assets/{chunk-F27PBJKO-9OJHGb4f.js → chunk-GWA4HPMP-DwZHSyM6.js} +1 -1
  126. package/dist/frontend/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  127. package/dist/frontend/assets/chunk-MBY4JIJT-DU8hh3vE.js +72 -0
  128. package/dist/frontend/assets/chunk-NETBCI7D-PrPyv2qf.js +1 -0
  129. package/dist/frontend/assets/chunk-O7XYJQB3-j8r_wK2Y.js +128 -0
  130. package/dist/frontend/assets/chunk-UA2S7LBM-EhjtOSNT.js +1 -0
  131. package/dist/frontend/assets/{chunk-POPQ4Y6H-DjvzCiTE.js → chunk-WEXAMYUT-DnLgt6Py.js} +1 -1
  132. package/dist/frontend/assets/{chunk-OSK3NFVY-COHJYKGg.js → chunk-Z7XXMR3K-B4DDNjo4.js} +3 -3
  133. package/dist/frontend/assets/{chunk-75Z2AOVW-8XdKJlnw.js → chunk-ZIGJFQKS-D7Dw35HO.js} +2 -2
  134. package/dist/frontend/assets/classDiagram-v2-NBCMYWYE-BtmMp0Pl.js +217 -0
  135. package/dist/frontend/assets/{configModel-DrP4M7xH.js → configModel-DMBA1qQ5.js} +1 -1
  136. package/dist/frontend/assets/{cose-bilkent-JH36ORCC-De3bNEVd.js → cose-bilkent-JH36ORCC-DrgF-lEP.js} +1 -1
  137. package/dist/frontend/assets/cynefin-OW5HDTMX-C57TpIt4.js +1 -0
  138. package/dist/frontend/assets/cynefinDiagram-VND7K2PF-DAC6UAuW.js +62 -0
  139. package/dist/frontend/assets/cytoscape.esm-EK2DW5Qr.js +321 -0
  140. package/dist/frontend/assets/dagre-6A5THRUB-CO85D-6G.js +4 -0
  141. package/dist/frontend/assets/diagram-22UHCM2B-BOX3CQqS.js +200 -0
  142. package/dist/frontend/assets/{diagram-VX7I27RA-C35dzzE2.js → diagram-3UASUU5V-CxvH61Hb.js} +2 -2
  143. package/dist/frontend/assets/{diagram-VSXAHHWV-C2RlE7sA.js → diagram-ATOU4E4O-B5UFYp-C.js} +3 -3
  144. package/dist/frontend/assets/{diagram-S7CK7UJ4-CiH5G7oo.js → diagram-CDSNMT55-BKs0JPfD.js} +3 -3
  145. package/dist/frontend/assets/{diagram-Z3DM3KII-dkqe3QpU.js → diagram-MLGK6HIB-D9BjufDu.js} +1 -1
  146. package/dist/frontend/assets/diagram-MPIPVDR6-CAjYxIoY.js +41 -0
  147. package/dist/frontend/assets/{ebnfDiagram-PWID7BFC-BNGHaYJh.js → ebnfDiagram-ZINNZB2B-DyFbyGL9.js} +1 -1
  148. package/dist/frontend/assets/elk-276RUBZZ-De_z70FL.js +27 -0
  149. package/dist/frontend/assets/{erDiagram-RLTQ6QDP-Bid1pEh4.js → erDiagram-OPXOYQCR-N61HA9T0.js} +15 -15
  150. package/dist/frontend/assets/{eventFlow-DkVb8OS6.js → eventFlow-CGihfe42.js} +1 -1
  151. package/dist/frontend/assets/eventmodeling-NTZA5JFV-BkawB1PZ.js +1 -0
  152. package/dist/frontend/assets/flowDiagram-KWPJA3E3-BubqL8R4.js +1 -0
  153. package/dist/frontend/assets/{ganttDiagram-EL5Y4UJY-Bd8tzKWH.js → ganttDiagram-FUAMR5RP-BDNJ7Bau.js} +2 -2
  154. package/dist/frontend/assets/gitGraph-4MIJSDKK-CAY6QM8x.js +1 -0
  155. package/dist/frontend/assets/{gitGraphDiagram-WWUBYQGX-_DeBz2Y8.js → gitGraphDiagram-X574FWY7-DB39dqwB.js} +4 -4
  156. package/dist/frontend/assets/graphlib-C9Tl7QrK.js +1 -0
  157. package/dist/frontend/assets/{hooks-Cq2g1mUn.js → hooks-uo6JdPzV.js} +1 -1
  158. package/dist/frontend/assets/index-22LA2xX4.css +1 -0
  159. package/dist/frontend/assets/index-BwPukNhM.js +28 -0
  160. package/dist/frontend/assets/info-A6RAGUB7-CIjHym4W.js +1 -0
  161. package/dist/frontend/assets/infoDiagram-VRGFBTTK-jzkh5hxl.js +2 -0
  162. package/dist/frontend/assets/{ishikawaDiagram-5VMMS53U-V6b0BWGR.js → ishikawaDiagram-OU5B5YK6-C-80YGTU.js} +2 -2
  163. package/dist/frontend/assets/{journeyDiagram-3NMN7TZE-Bpqkb9h5.js → journeyDiagram-ZHPQQLJL-CTLmUx34.js} +3 -3
  164. package/dist/frontend/assets/{kanban-definition-UXKFOSKX-iK7pOag1.js → kanban-definition-PNTS6WVX-CNUWj3n8.js} +7 -7
  165. package/dist/frontend/assets/{line-M-d-d1EU.js → line-BFnujzfH.js} +1 -1
  166. package/dist/frontend/assets/{mermaid-parser.core-CjM11pEo.js → mermaid-parser.core-BP-BgE7c.js} +3 -3
  167. package/dist/frontend/assets/mermaid.core-bi0KWxzD.js +44 -0
  168. package/dist/frontend/assets/{mindmap-definition-YA3MSWOX-DmZ6mtFL.js → mindmap-definition-NLK3R4M7-BpydpKOL.js} +24 -24
  169. package/dist/frontend/assets/packet-AYTQ26CC-CfGiptr4.js +1 -0
  170. package/dist/frontend/assets/{pegDiagram-XKGWAZYB-CBbcb55o.js → pegDiagram-GJSIUBJH-B8r97QN1.js} +1 -1
  171. package/dist/frontend/assets/pie-WAS4IAKB-lOu4mWy0.js +1 -0
  172. package/dist/frontend/assets/{pieDiagram-E7YTZNPT-DvIb4hiL.js → pieDiagram-5QR66LMP-kyKeYg-Q.js} +2 -2
  173. package/dist/frontend/assets/{preload-helper-DqwykoZ_.js → preload-helper-DfDauRb0.js} +1 -1
  174. package/dist/frontend/assets/{profileVisuals-ctjaF0gr.js → profileVisuals-D9M9BpAk.js} +1 -1
  175. package/dist/frontend/assets/{quadrantDiagram-AXDQQJYC-xXwWHqU1.js → quadrantDiagram-O4NWA36T-BcqZGb03.js} +3 -3
  176. package/dist/frontend/assets/radar-RG4KPBEZ-CncHVJ-Z.js +1 -0
  177. package/dist/frontend/assets/railroad-74A4TZTK-7mvjY84V.js +1 -0
  178. package/dist/frontend/assets/railroad-abnf-HS5TGJTU-DPThAF5w.js +1 -0
  179. package/dist/frontend/assets/railroad-ebnf-LZEXJU2U-Ck30vOwD.js +1 -0
  180. package/dist/frontend/assets/railroad-peg-WCYAUIDC-fLqqEJcF.js +1 -0
  181. package/dist/frontend/assets/{railroadDiagram-O6MQD6OU-D3MMDWru.js → railroadDiagram-XR7U4H2S-UqD2ngrA.js} +1 -1
  182. package/dist/frontend/assets/{requirementDiagram-BXWQKSXE-nt85uyup.js → requirementDiagram-PLB6GJNP-BCf1UDbg.js} +11 -11
  183. package/dist/frontend/assets/sankeyDiagram-IPEJSGJF-CLBdyFVN.js +40 -0
  184. package/dist/frontend/assets/sequenceDiagram-PO4LG4MO-BtmJQCMb.js +169 -0
  185. package/dist/frontend/assets/stateDiagram-v2-GCMORJYK-KOfXhGJl.js +291 -0
  186. package/dist/frontend/assets/{stores-CLUS0FeB.js → stores-DnaaQoge.js} +1 -1
  187. package/dist/frontend/assets/swimlanes-2SLR337P-CbhPYBmu.js +1 -0
  188. package/dist/frontend/assets/swimlanesDiagram-TC7HE7FX-DERYN-sv.js +8 -0
  189. package/dist/frontend/assets/timeline-definition-EJHVYXUP-DyFLwqcy.js +120 -0
  190. package/dist/frontend/assets/treeView-Q6P3EWNA-DFFnEAvn.js +1 -0
  191. package/dist/frontend/assets/treemap-WGGIJYW6-BibBNuzW.js +1 -0
  192. package/dist/frontend/assets/ui-D72MNfu0.js +319 -0
  193. package/dist/frontend/assets/{useBlockSource-zm0JfWOg.js → useBlockSource-Nwf0PRrs.js} +1 -1
  194. package/dist/frontend/assets/{useSocketLiveData-D5yoLGQm.js → useSocketLiveData-CNS1085V.js} +1 -1
  195. package/dist/frontend/assets/usecaseDiagram-POWQR4AR-DrNt0E-k.js +328 -0
  196. package/dist/frontend/assets/{usersFormat-D4sIKqYw.js → usersFormat-Cj9R_PHR.js} +1 -1
  197. package/dist/frontend/assets/vennDiagram-UO4OBE2U-CdTyOHVa.js +34 -0
  198. package/dist/frontend/assets/wardley-WFR3VGLG-C6RQiZKi.js +1 -0
  199. package/dist/frontend/assets/{wardleyDiagram-VM6X3IG4-D0hzksZQ.js → wardleyDiagram-VNRHLVJA-D8xJmOUJ.js} +3 -3
  200. package/dist/frontend/assets/{xychartDiagram-S5SC5T6Z-4iH1cxcS.js → xychartDiagram-PMCCYNJV-BwyKdA55.js} +3 -3
  201. package/dist/frontend/index.html +13 -13
  202. package/dist/index.js +20 -4
  203. package/dist/nodefony/config/config.js +14 -20
  204. package/dist/nodefony/config/defineModuleConfig.js +33 -0
  205. package/dist/nodefony/controller/StudioController.js +2 -2
  206. package/dist/nodefony/controller/StudioCreateController.js +3 -3
  207. package/dist/nodefony/controller/StudioRealtimeController.js +2 -2
  208. package/dist/nodefony/interfaces/IStudioConfig.js +1 -0
  209. package/dist/nodefony/service/ScaffoldService.js +8 -6
  210. package/dist/types/index.d.ts +43 -0
  211. package/dist/types/nodefony/config/config.d.ts +20 -0
  212. package/dist/types/nodefony/config/defineModuleConfig.d.ts +24 -0
  213. package/dist/types/nodefony/controller/StudioController.d.ts +98 -0
  214. package/dist/types/nodefony/controller/StudioCreateController.d.ts +58 -0
  215. package/dist/types/nodefony/controller/StudioRealtimeController.d.ts +93 -0
  216. package/dist/types/nodefony/interfaces/IStudioConfig.d.ts +19 -0
  217. package/dist/types/nodefony/realtime/clusterOrm.d.ts +30 -0
  218. package/dist/types/nodefony/realtime/clusterSupervision.d.ts +35 -0
  219. package/dist/types/nodefony/realtime/providers.d.ts +134 -0
  220. package/dist/types/nodefony/service/ScaffoldService.d.ts +199 -0
  221. package/package.json +30 -28
  222. package/dist/frontend/assets/Collapse-c8A5_Xw2.js +0 -1
  223. package/dist/frontend/assets/IconArrowsExchange-F0lEv98_.js +0 -1
  224. package/dist/frontend/assets/IconBan-VAlsgp2Z.js +0 -1
  225. package/dist/frontend/assets/IconCircuitResistor-DPBm4VS4.js +0 -1
  226. package/dist/frontend/assets/IconPlayerPlay-BnMxtNtL.js +0 -1
  227. package/dist/frontend/assets/IconPlus-C3Eai0ws.js +0 -1
  228. package/dist/frontend/assets/Logs-BjbwxWdb.js +0 -1
  229. package/dist/frontend/assets/architecture-7GRP2DOG-D19eKeHC.js +0 -1
  230. package/dist/frontend/assets/architectureDiagram-5GKGNRK7-ybI3XK-Z.js +0 -36
  231. package/dist/frontend/assets/c4Diagram-7LVT6UL2-CWZ8fEY-.js +0 -38
  232. package/dist/frontend/assets/channel-Dhikye2V.js +0 -1
  233. package/dist/frontend/assets/chunk-4HAMMTFA-BVE3Ntuo.js +0 -62
  234. package/dist/frontend/assets/chunk-DU6HZSFF-Ddor4J2O.js +0 -127
  235. package/dist/frontend/assets/chunk-GMAD6QVW-T1eAn0xk.js +0 -72
  236. package/dist/frontend/assets/chunk-IMKFNOWR-BrX7FTwU.js +0 -231
  237. package/dist/frontend/assets/chunk-L3NEJ4N5-CIKjoshr.js +0 -1
  238. package/dist/frontend/assets/chunk-P2QGCYS3-B9TYBq1U.js +0 -1
  239. package/dist/frontend/assets/chunk-SHT3W25Y-C_yspRzD.js +0 -168
  240. package/dist/frontend/assets/chunk-TICWLB2K-CKVEp1Rl.js +0 -206
  241. package/dist/frontend/assets/classDiagram-ZZMXUADV-DG8wCuQd.js +0 -1
  242. package/dist/frontend/assets/classDiagram-v2-VYDZK3BY-DG8wCuQd.js +0 -1
  243. package/dist/frontend/assets/cynefin-OW5HDTMX-CSeOsgpk.js +0 -1
  244. package/dist/frontend/assets/cynefinDiagram-5FMLGOSQ-DumbCcQA.js +0 -62
  245. package/dist/frontend/assets/cytoscape.esm-BsO9fSUN.js +0 -321
  246. package/dist/frontend/assets/dagre-C-rnJpZF.js +0 -1
  247. package/dist/frontend/assets/dagre-GXQ25YYZ-C_dPDp-P.js +0 -4
  248. package/dist/frontend/assets/diagram-UQ7AKVKN-KJ4yQtke.js +0 -41
  249. package/dist/frontend/assets/eventmodeling-NTZA5JFV-CMXM4LWU.js +0 -1
  250. package/dist/frontend/assets/flowDiagram-HODETNUW-BtETiN6B.js +0 -1
  251. package/dist/frontend/assets/gitGraph-4MIJSDKK-CwmqWyfB.js +0 -1
  252. package/dist/frontend/assets/graphlib-DS17s2tU.js +0 -1
  253. package/dist/frontend/assets/index-8Y7Th-EF.js +0 -28
  254. package/dist/frontend/assets/index-Bq9SDW24.css +0 -1
  255. package/dist/frontend/assets/info-A6RAGUB7-BNNzbqYr.js +0 -1
  256. package/dist/frontend/assets/infoDiagram-27XIBGKW-BLdr5J8o.js +0 -2
  257. package/dist/frontend/assets/mermaid.core-D0q9HDk7.js +0 -44
  258. package/dist/frontend/assets/packet-AYTQ26CC-CZMkZPcq.js +0 -1
  259. package/dist/frontend/assets/pie-WAS4IAKB-CI0EpLeA.js +0 -1
  260. package/dist/frontend/assets/radar-RG4KPBEZ-CyQDAhu-.js +0 -1
  261. package/dist/frontend/assets/railroad-74A4TZTK-B71O9n_n.js +0 -1
  262. package/dist/frontend/assets/railroad-abnf-HS5TGJTU-Df0ab8ny.js +0 -1
  263. package/dist/frontend/assets/railroad-ebnf-LZEXJU2U-Dcr334FZ.js +0 -1
  264. package/dist/frontend/assets/railroad-peg-WCYAUIDC-mcmVaJ9_.js +0 -1
  265. package/dist/frontend/assets/sankeyDiagram-P5KCCOFB-xg9O2BE4.js +0 -40
  266. package/dist/frontend/assets/sequenceDiagram-WJ2MYXX4-Cug_t4vg.js +0 -162
  267. package/dist/frontend/assets/stateDiagram-D77RDMKH-kjE2O9aM.js +0 -1
  268. package/dist/frontend/assets/stateDiagram-v2-MP3YSRHH-D7X2YGJU.js +0 -1
  269. package/dist/frontend/assets/swimlanes-42K2YHIH-6q0raMmQ.js +0 -1
  270. package/dist/frontend/assets/swimlanesDiagram-VR7AAH4N-BPC18vf0.js +0 -8
  271. package/dist/frontend/assets/timeline-definition-24CTP7MA-D_-APocZ.js +0 -120
  272. package/dist/frontend/assets/treeView-Q6P3EWNA-CC1707mF.js +0 -1
  273. package/dist/frontend/assets/treemap-WGGIJYW6-DBD8zPzq.js +0 -1
  274. package/dist/frontend/assets/ui-KaBQR2GX.js +0 -319
  275. package/dist/frontend/assets/vennDiagram-4TSXK5OY-D2AZPLVm.js +0 -34
  276. package/dist/frontend/assets/wardley-WFR3VGLG-905RnCT1.js +0 -1
@@ -0,0 +1,291 @@
1
+ import{w as e}from"./src-Dvwdl2PF.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as n}from"./src-CmaQbKwl.js";import{H as r,U as i,a,et as o,q as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-O7XYJQB3-j8r_wK2Y.js";import{g as p,s as m}from"./chunk-ZIGJFQKS-D7Dw35HO.js";import"./chunk-742MDFTN-BuWqUJ1x.js";import"./chunk-MBY4JIJT-DU8hh3vE.js";import"./chunk-7PRAP22T-CY3tH-_v.js";import{a as h,i as g,o as _,r as v}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-7INBJB4K-BLEZ8obp.js";import"./chunk-5DYCD2WN-C6fNpDCq.js";import"./chunk-Z7XXMR3K-B4DDNjo4.js";import{t as y}from"./chunk-GWA4HPMP-DwZHSyM6.js";import{t as b}from"./chunk-XXDRQBXY-IULPM7G2.js";import{t as x}from"./chunk-WEXAMYUT-DnLgt6Py.js";import"./chunk-UA2S7LBM-EhjtOSNT.js";import{i as S,r as C}from"./mermaid.core-bi0KWxzD.js";var w=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(j,[2,44],{58:[1,56]}),e(j,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:f,57:k},e(A,[2,17]),e(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(j,[2,46]),e(j,[2,47]),e(A,[2,15]),e(A,[2,19]),e(M,a,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,n,r,i){function a(){let t=n.yytext.indexOf(`%%`);if(t===0)return!1;if(t>0){let r=n.yytext.slice(0,t),i=n.yytext.slice(t);i&&e.lexer.unput(i),n.yytext=r}return!0}switch(t(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return t(P,`Parser`),P.prototype=N,N.Parser=P,new P})();w.parser=w;var T=w,E=`TB`,D=`TB`,O=`dir`,k=`state`,A=`root`,j=`relation`,M=`classDef`,N=`style`,P=`applyClass`,F=`default`,ee=`divider`,te=`fill:none`,ne=`fill: #333`,re=`c`,ie=`markdown`,ae=`normal`,I=`rect`,L=`rectWithTitle`,oe=`stateStart`,se=`stateEnd`,R=`divider`,ce=`roundedWithTitle`,le=`note`,ue=`noteGroup`,z=`statediagram`,de=`${z}-state`,B=`transition`,fe=`note`,pe=`${B} note-edge`,me=`${z}-${fe}`,he=`${z}-cluster`,ge=`${z}-cluster-alt`,V=`parent`,H=`note`,_e=`state`,U=`----`,ve=`${U}${H}`,ye=`${U}${V}`,W=new Map,G=0,be=0,K=new Map,xe=t((e,t,n,r)=>{if(e===R&&n?.id!==void 0&&K.has(n.id)){let e=K.get(n.id);return K.set(t,e),e}let i=be++,a=r?void 0:i;return K.set(t,a),a},`colorSlotFor`);function q(e=``,t=0,n=``,r=U){return`${_e}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}t(q,`stateDomId`);var Se=t((e,t,r,i,a,o,s,l)=>{n.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case k:X(e,t,r,i,a,o,s,l);break;case F:X(e,t,r,i,a,o,s,l);break;case j:{X(e,t.state1,r,i,a,o,s,l),X(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+G,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:te,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,classes:B,look:s};a.push(u),G++}}})},`setupDoc`),Ce=t((e,t=D)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function J(e,t,n){if(!t.id||t.id===`</join></fork>`||t.id===`</choice>`)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}t(J,`insertOrUpdateNode`);function we(e){return e?.classes?.join(` `)??``}t(we,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}t(Y,`getStylesFromDbInfo`);var X=t((e,t,r,i,a,o,s,l)=>{let u=t.id,f=r.get(u),p=we(f),m=Y(f),h=d(),g=p.trim()!==``||m.length>0;if(n.info(`dataFetcher parsedItem`,t,f,m),u!==`root`){let r=I;t.start===!0?r=oe:t.start===!1&&(r=se),t.type!==F&&(r=t.type),W.get(u)||W.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${de}`,cssStyles:m});let d=W.get(u);t.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(t.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[t.description]:[d.description,t.description]):(d.shape=I,d.description=t.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?ce:I),!d.type&&t.doc&&(n.info(`Setting cluster for XCX`,u,Ce(t)),d.type=`group`,d.isGroup=!0,d.dir=Ce(t),d.shape=t.type===ee?R:ce,d.colorIndex=xe(d.shape,u,e,g),d.cssClasses=`${d.cssClasses} ${he} ${o?ge:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:q(u,G),type:d.type,isGroup:d.type===`group`,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(n.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,t.note){let e={labelStyle:``,shape:le,label:t.note.text,labelType:`markdown`,cssClasses:me,cssStyles:[],cssCompiledStyles:[],id:u+ve+`-`+G,domId:q(u,G,H),type:`node`,isGroup:!1,padding:h.flowchart?.padding,look:s,position:t.note.position},n=u+ye,r={labelStyle:``,shape:ue,label:t.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+ye,domId:q(u,G,V),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};G++,r.id=n,e.parentId=n,J(i,r,l),J(i,e,l),J(i,f,l);let o=u,c=e.id;t.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:te,labelStyle:``,classes:pe,pattern:`dashed`,arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,look:s})}else J(i,f,l)}t.doc&&(n.trace(`Adding nodes children `),Se(t,t.doc,r,i,a,!o,s,l))},`dataFetcher`),Te=t(()=>{W.clear(),G=0,be=0,K.clear()},`reset`),Ee=t((e,t=D)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),De={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=b(t,a);c.type=i.type,c.layoutAlgorithm=C(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=t,await S(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let r=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,i=c.nodes.find(e=>e.id===r);if(!r){n.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){n.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){n.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),n.info(`🔗 Wrapped node in <a> tag for:`,r,e.url)})}catch(e){n.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),x(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:Ee},Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Oe=t(()=>new Map,`newClassesList`),Q=t(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=t(e=>JSON.parse(JSON.stringify(e)),`clone`),ke=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Oe(),this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=i,this.getAccDescription=l,this.setAccDescription=r,this.setDiagramTitle=s,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case k:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case j:this.addRelation(t.state1,t.state2,t.description);break;case M:this.addStyleClass(t.id.trim(),t.classes);break;case N:this.handleStyleDef(t);break;case P:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();Te(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){n.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===j){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===k&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==A&&t.stmt!==k||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===ee){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:k,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:A,stmt:A},{id:A,stmt:A,doc:this.rootDoc},!0),{id:A,doc:this.rootDoc}}addState(e,t=F,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))n.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:k,id:u,descriptions:[],type:t,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=t}if(i&&(n.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(n.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(n.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(n.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Oe(),e||(this.links=new Map,a())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){n.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),n.warn(`Adding link`,e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=F){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=F){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(t){let n=y();e(t).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,t=>{let r=e(t.currentTarget),i=r.attr(`title`);if(i===null)return;let a=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.style(`left`,window.scrollX+a.left+(a.right-a.left)/2+`px`).style(`top`,window.scrollY+a.bottom+`px`),n.html(o.sanitize(i)),r.classed(`hover`,!0)}).on(`mouseout`,t=>{n.transition().duration(500).style(`opacity`,0),e(t.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===O)}getDirection(){return this.getDirectionStatement()?.value??E}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:O,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();for(let t of this.nodes)t.wrappingWidth??=e.state?.wrappingWidth,t.isGroup||(t.minWidth??=e.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ee(this.getRootDocV2())}}getConfig(){return d().state}},Ae=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!g(t,r))return``;let i=_(e.look),a=v(n),o=``;for(let e=0;e<h(r);e++){let t=r[e],s=a?`fill: ${n[e%n.length]};`:``,c=`[data-look="${i}"][data-color-id="color-${e}"]`;o+=`
7
+
8
+ /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers
9
+ the body, so what stays visible of \`outer\` is the band behind the label. */
10
+ ${c}.statediagram-cluster rect.outer {
11
+ stroke: ${t};
12
+ ${s}
13
+ }
14
+
15
+ ${c}.statediagram-cluster rect.inner {
16
+ stroke: ${t};
17
+ }
18
+
19
+ /* Concurrency regions. Siblings of one composite share a slot, so a divided composite
20
+ reads as one thing split into parts rather than as several composites. */
21
+ ${c}.statediagram-cluster rect.divider {
22
+ stroke: ${t};
23
+ ${s}
24
+ }
25
+
26
+ /* handDrawn draws the same container as roughjs shapes rather than plain rects, so it
27
+ needs its own rules. \`roundedWithTitle\` and \`divider\` name those groups \`outer\`,
28
+ \`inner\` and \`divider\` to match the classic branch, which is what lets these
29
+ discriminate -- a bare \`.statediagram-cluster path\` rule reached the body as well and
30
+ tinted the whole composite, losing \`compositeBackground\` and diverging from what
31
+ classic and neo do.
32
+
33
+ roughjs emits two paths per shape and marks them: the filled shape carries
34
+ \`stroke="none"\` and the sketched outline carries \`fill="none"\`. Splitting on that is
35
+ what keeps \`fill\` off the outline -- a rough outline is open squiggles, not a closed
36
+ region, so filling it produces smears -- and keeps \`stroke\` off the fill shape, which
37
+ would otherwise gain an edge it was drawn without. */
38
+ ${c}.statediagram-cluster .outer path[stroke='none'] {
39
+ ${s}
40
+ }
41
+
42
+ ${c}.statediagram-cluster .outer path[fill='none'] {
43
+ stroke: ${t};
44
+ }
45
+
46
+ /* No \`.inner\` rule on purpose. The body shape is left entirely alone under handDrawn,
47
+ where a rect's \`inner\` counterpart cannot be recoloured safely: roughjs draws a
48
+ hachure fill as *stroked* lines, so its fill paths carry \`fill="none"\` exactly like
49
+ the outline and no selector separates them. An \`.inner\` stroke rule therefore
50
+ repainted the hatching of every alt composite in the palette colour instead of
51
+ leaving it on \`altBackground\`. The container still reads as palette-coloured: the
52
+ \`outer\` shape spans the whole composite, so its outline already frames the body. */
53
+
54
+ /* Regions split the same way, which is why \`divider\` fills solid rather than taking
55
+ roughjs's default hachure -- see the note on that call. Hatched, both of its paths
56
+ carried \`fill="none"\` and these two rules degenerated: the tint matched nothing and
57
+ the border rule repainted the hatching. */
58
+ ${c}.statediagram-cluster .divider path[stroke='none'] {
59
+ ${s}
60
+ }
61
+
62
+ ${c}.statediagram-cluster .divider path[fill='none'] {
63
+ stroke: ${t};
64
+ }
65
+ `}return o},`genColor`),je={parser:T,get db(){return new ke(2)},renderer:De,styles:t(e=>`
66
+ ${Ae(e)}
67
+ defs [id$="-barbEnd"] {
68
+ fill: ${e.transitionColor};
69
+ stroke: ${e.transitionColor};
70
+ }
71
+ g.stateGroup text {
72
+ fill: ${e.nodeBorder};
73
+ stroke: none;
74
+ font-size: 10px;
75
+ }
76
+ g.stateGroup text {
77
+ fill: ${e.textColor};
78
+ stroke: none;
79
+ font-size: 10px;
80
+
81
+ }
82
+ g.stateGroup .state-title {
83
+ font-weight: bolder;
84
+ fill: ${e.stateLabelColor};
85
+ }
86
+
87
+ g.stateGroup rect {
88
+ fill: ${e.mainBkg};
89
+ stroke: ${e.nodeBorder};
90
+ }
91
+
92
+ g.stateGroup line {
93
+ stroke: ${e.lineColor};
94
+ stroke-width: ${e.strokeWidth||1};
95
+ }
96
+
97
+ .transition {
98
+ stroke: ${e.transitionColor};
99
+ stroke-width: ${e.strokeWidth||1};
100
+ fill: none;
101
+ }
102
+
103
+ .stateGroup .composit {
104
+ fill: ${e.background};
105
+ border-bottom: 1px
106
+ }
107
+
108
+ .stateGroup .alt-composit {
109
+ fill: #e0e0e0;
110
+ border-bottom: 1px
111
+ }
112
+
113
+ .state-note {
114
+ stroke: ${e.noteBorderColor};
115
+ fill: ${e.noteBkgColor};
116
+
117
+ text {
118
+ fill: ${e.noteTextColor};
119
+ stroke: none;
120
+ font-size: 10px;
121
+ }
122
+ }
123
+
124
+ .stateLabel .box {
125
+ stroke: none;
126
+ stroke-width: 0;
127
+ fill: ${e.mainBkg};
128
+ opacity: 0.5;
129
+ }
130
+
131
+ .edgeLabel .label rect {
132
+ fill: ${e.labelBackgroundColor};
133
+ opacity: 0.5;
134
+ }
135
+ .edgeLabel {
136
+ background-color: ${e.edgeLabelBackground};
137
+ p {
138
+ background-color: ${e.edgeLabelBackground};
139
+ }
140
+ rect {
141
+ opacity: 0.5;
142
+ background-color: ${e.edgeLabelBackground};
143
+ fill: ${e.edgeLabelBackground};
144
+ }
145
+ text-align: center;
146
+ }
147
+ .edgeLabel .label text {
148
+ fill: ${e.transitionLabelColor||e.tertiaryTextColor};
149
+ }
150
+ .label div .edgeLabel {
151
+ color: ${e.transitionLabelColor||e.tertiaryTextColor};
152
+ }
153
+
154
+ .stateLabel text {
155
+ fill: ${e.stateLabelColor};
156
+ font-size: 10px;
157
+ font-weight: bold;
158
+ }
159
+
160
+ .node circle.state-start {
161
+ fill: ${e.specialStateColor};
162
+ stroke: ${e.specialStateColor};
163
+ }
164
+
165
+ .node .fork-join {
166
+ fill: ${e.specialStateColor};
167
+ stroke: ${e.specialStateColor};
168
+ }
169
+
170
+ .node circle.state-end {
171
+ fill: ${e.innerEndBackground};
172
+ stroke: ${e.background};
173
+ stroke-width: 1.5
174
+ }
175
+ .end-state-inner {
176
+ fill: ${e.compositeBackground||e.background};
177
+ // stroke: ${e.background};
178
+ stroke-width: 1.5
179
+ }
180
+
181
+ .node rect {
182
+ fill: ${e.stateBkg||e.mainBkg};
183
+ stroke: ${e.stateBorder||e.nodeBorder};
184
+ stroke-width: ${e.strokeWidth||1}px;
185
+ }
186
+ .node polygon {
187
+ fill: ${e.mainBkg};
188
+ stroke: ${e.stateBorder||e.nodeBorder};;
189
+ stroke-width: ${e.strokeWidth||1}px;
190
+ }
191
+ [id$="-barbEnd"] {
192
+ fill: ${e.lineColor};
193
+ }
194
+
195
+ .statediagram-cluster rect {
196
+ fill: ${e.compositeTitleBackground};
197
+ stroke: ${e.stateBorder||e.nodeBorder};
198
+ stroke-width: ${e.strokeWidth||1}px;
199
+ }
200
+
201
+ .cluster-label, .nodeLabel {
202
+ color: ${e.stateLabelColor};
203
+ // line-height: 1;
204
+ }
205
+
206
+ .statediagram-cluster rect.outer {
207
+ rx: 5px;
208
+ ry: 5px;
209
+ }
210
+ .statediagram-state .divider {
211
+ stroke: ${e.stateBorder||e.nodeBorder};
212
+ }
213
+
214
+ .statediagram-state .title-state {
215
+ rx: 5px;
216
+ ry: 5px;
217
+ }
218
+ .statediagram-cluster.statediagram-cluster .inner {
219
+ fill: ${e.compositeBackground||e.background};
220
+ }
221
+ .statediagram-cluster.statediagram-cluster-alt .inner {
222
+ fill: ${e.altBackground?e.altBackground:`#efefef`};
223
+ }
224
+
225
+ .statediagram-cluster .inner {
226
+ rx:0;
227
+ ry:0;
228
+ }
229
+
230
+ .statediagram-state rect.basic {
231
+ rx: 5px;
232
+ ry: 5px;
233
+ }
234
+ .statediagram-state rect.divider {
235
+ stroke-dasharray: 10,10;
236
+ fill: ${e.altBackground?e.altBackground:`#efefef`};
237
+ }
238
+
239
+ .note-edge {
240
+ stroke-dasharray: 5;
241
+ }
242
+
243
+ .statediagram-note rect {
244
+ fill: ${e.noteBkgColor};
245
+ stroke: ${e.noteBorderColor};
246
+ stroke-width: 1px;
247
+ rx: 0;
248
+ ry: 0;
249
+ }
250
+ .statediagram-note rect {
251
+ fill: ${e.noteBkgColor};
252
+ stroke: ${e.noteBorderColor};
253
+ stroke-width: 1px;
254
+ rx: 0;
255
+ ry: 0;
256
+ }
257
+
258
+ .statediagram-note text {
259
+ fill: ${e.noteTextColor};
260
+ }
261
+
262
+ .statediagram-note .nodeLabel {
263
+ color: ${e.noteTextColor};
264
+ }
265
+ .statediagram .edgeLabel {
266
+ color: red; // ${e.noteTextColor};
267
+ }
268
+
269
+ [id$="-dependencyStart"], [id$="-dependencyEnd"] {
270
+ fill: ${e.lineColor};
271
+ stroke: ${e.lineColor};
272
+ stroke-width: ${e.strokeWidth||1};
273
+ }
274
+
275
+ .statediagramTitleText {
276
+ text-anchor: middle;
277
+ font-size: 18px;
278
+ fill: ${e.textColor};
279
+ }
280
+
281
+ [data-look="neo"].statediagram-cluster rect {
282
+ fill: ${e.mainBkg};
283
+ stroke: ${e.useGradient?`url(`+e.svgId+`-gradient)`:e.stateBorder||e.nodeBorder};
284
+ stroke-width: ${e.strokeWidth??1};
285
+ }
286
+ [data-look="neo"].statediagram-cluster rect.outer {
287
+ rx: ${e.radius}px;
288
+ ry: ${e.radius}px;
289
+ filter: ${e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${e.svgId}-drop-shadow)`):`none`}
290
+ }
291
+ `,`getStyles`),init:t(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{je as diagram};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{At as t,Dt as n,Et as r,Lr as i,Ot as a,ci as o,di as s,kt as c,li as l,si as u}from"./ui-KaBQR2GX.js";var d=e(s(),1);function f(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function p(e){return(0,d.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}var m=0;function ee(e,t,n){let r=[],i=[],a=new Map;for(let n of e){let e=n.position||t,r=a.get(e);r?r.push(n):a.set(e,[n])}for(let e of a.values())e.sort((e,t)=>(t.priority??0)-(e.priority??0)||(e.__sequence??0)-(t.__sequence??0)),e.forEach((e,t)=>{t<n?i.push(e):r.push(e)});return{notifications:i,queue:r}}var h=f({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),te=(e=h)=>p(e);function g(e,t){let n=e.getState(),r=t([...n.notifications,...n.queue]);for(let e of r)e.__sequence===void 0&&(e.__sequence=m,m+=1);let i=ee(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ne(e,t=h){let n=e.id||i();return g(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function _(e,t=h){return g(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}function re(e,t=h){return g(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function ie(e=h){g(e,()=>[])}function ae(e=h){let{defaultPosition:t,limit:n}=e.getState();g(e,e=>ee(e,t,n).notifications)}var v={show:ne,hide:_,update:re,clean:ie,cleanQueue:ae,updateState:g},y=class extends Error{status;body;constructor(e,t,n){super(n),this.status=e,this.body=t,this.name=`ApiError`}};function oe(e,t){if(e&&typeof e==`object`){let t=e,n=t.error??t;if(typeof n.message==`string`&&n.message)return n.message}return t}function se(e){return e&&typeof e==`object`&&`result`in e?e.result:e}var ce=-32601;function le(e){let t=e.indexOf(`?`);return t===-1?e:e.slice(0,t)}function ue(e,t){return`${e} ${le(t)}`}function de(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`idem-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}var fe=class{baseUrl;onUnauthorized;onError;socket;socketEnabled;socketBridgeDown=!1;httpOnlyRoutes=new Set;constructor(e={}){this.baseUrl=e.baseUrl??`/nodefony/studio/api`,this.onUnauthorized=e.onUnauthorized,this.onError=e.onError,this.socket=e.socket,this.socketEnabled=e.socketEnabled}async get(e,t){return this.request(`GET`,e,void 0,t)}async post(e,t,n){return this.request(`POST`,e,t,n)}async put(e,t,n){return this.request(`PUT`,e,t,n)}async delete(e,t){return this.request(`DELETE`,e,void 0,t)}async getAbsolute(e,t){return this.send(`GET`,e,void 0,t)}async postAbsolute(e,t,n){return this.send(`POST`,e,t,n)}async patchAbsolute(e,t,n){return this.send(`PATCH`,e,t,n)}async deleteAbsolute(e,t){return this.send(`DELETE`,e,void 0,t)}async request(e,t,n,r){let i=`${this.baseUrl}${t.startsWith(`/`)?t:`/`+t}`;return this.send(e,i,n,r)}canUseSocket(e,t,n){return(e===`GET`||e===`POST`||e===`PUT`||e===`PATCH`||e===`DELETE`)&&this.socket!==void 0&&!this.socketBridgeDown&&(this.socketEnabled?.()??!0)&&this.socket.state===`connected`&&t.startsWith(`/`)&&!n?.signal&&!n?.headers&&!this.httpOnlyRoutes.has(ue(e,t))}learnFromSocketError(e,t,n){let r=n;if(n&&typeof n==`object`&&r.name===`RpcError`){if(r.code===ce){this.socketBridgeDown=!0;return}r.data?.status===405&&this.httpOnlyRoutes.add(ue(e,t))}}async send(e,t,n,r){let i=e!==`GET`&&e!==`HEAD`?de():void 0;if(this.canUseSocket(e,t,r))try{return se(e===`GET`?await this.socket.request(t):await this.socket.mutate(t,{method:e,body:n,idempotencyKey:i}))}catch(n){this.learnFromSocketError(e,t,n)}let a=new Headers(r?.headers);a.set(`Accept`,`application/json`),n!==void 0&&a.set(`Content-Type`,`application/json`),i&&a.set(`Idempotency-Key`,i);let o=await fetch(t,{...r,method:e,headers:a,body:n===void 0?void 0:JSON.stringify(n),credentials:`same-origin`}),s=t.includes(`/api/auth/`);o.status===401&&!s&&this.onUnauthorized?.();let c=(o.headers.get(`Content-Type`)??``).includes(`application/json`),l=c?await o.json():await o.text();if(!o.ok){let n=oe(l,`HTTP ${o.status}`);throw this.onError?.({method:e,status:o.status,message:n,body:l}),new y(o.status,l,`${e} ${t} → HTTP ${o.status}`)}return c?se(l):l}};function b(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function x(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function S(){return pe.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var pe={stubThis:e=>e};function me(e){let{id:t}=e;return{...e,id:x(t),transports:e.transports,type:e.type}}function C(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var w=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function he({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new w({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new w({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new w({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new w({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new w({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new w({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new w({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new w({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!C(t))return new w({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new w({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new w({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new w({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var ge=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},_e=[`cross-platform`,`platform`];function ve(e){if(e&&!(_e.indexOf(e)<0))return e}async function ye(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!S())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:x(t.challenge),user:{...t.user,id:x(t.user.id)},excludeCredentials:t.excludeCredentials?.map(me)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=ge.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw he({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){T(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=b(e))}catch(e){T(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=b(c.getAuthenticatorData())}catch(e){T(`getAuthenticatorData()`,e)}return{id:o,rawId:b(s),response:{attestationObject:b(c.attestationObject),clientDataJSON:b(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:ve(a.authenticatorAttachment)}}function T(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function be(){if(!S())return E.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?E.stubThis(new Promise(e=>e(!1))):E.stubThis(e.isConditionalMediationAvailable())}var E={stubThis:e=>e};function xe({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new w({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new w({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!C(t))return new w({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new w({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new w({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Se(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!S())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(me));let a={...t,challenge:x(t.challenge),allowCredentials:i},o={};if(n){if(!await be())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=ge.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw xe({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=b(u.userHandle)),{id:c,rawId:b(l),response:{authenticatorData:b(u.authenticatorData),clientDataJSON:b(u.clientDataJSON),signature:b(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:ve(s.authenticatorAttachment)}}var D=`/nodefony/security/api/auth`,O=`/nodefony/security/api/webauthn`,Ce=class{api;constructor(e){this.api=e}async login(e){let t=await this.api.postAbsolute(`${D}/login`,e);return t.mfaRequired?{kind:`mfaRequired`,methods:t.methods??[`totp`]}:{kind:`authenticated`,user:t.user}}async verifyTotpLogin(e){let{user:t}=await this.api.postAbsolute(`${D}/login/totp`,{code:e});return t}async me(){let{user:e}=await this.api.getAbsolute(`${D}/me`);return e}async logout(){await this.api.postAbsolute(`${D}/logout`)}async loginWithPasskey(){let e=await Se({optionsJSON:await this.api.postAbsolute(`${O}/login/options`,{})}),{user:t}=await this.api.postAbsolute(`${O}/login/verify`,{response:e});return t}async registerPasskey(){let e=await ye({optionsJSON:await this.api.postAbsolute(`${O}/register/options`,{})}),{credentialId:t}=await this.api.postAbsolute(`${O}/register/verify`,{response:e});return t}async ping(){return this.api.get(`/health`)}},we=`BROWSER_ERROR`,Te=`BROWSER_REJECTION`;function Ee(e){if(typeof window>`u`)return()=>{};let{syslog:t,msgid:n=we,dedupeMs:r=1e3}=e,i=null,a=0,o=e=>{if(r<=0)return!1;let t=Date.now();return e===i&&t-a<r||(i=e,a=t,!1)},s=e=>{let r=e.filename!==void 0&&e.filename!==``?`${e.filename}:${e.lineno}:${e.colno}`:void 0,i=`error|${e.message}|${r??``}`;o(i)||t.log(e.error??e.message,`ERROR`,n,r??``)},c=e=>{let n=e.reason,r=`rejection|${n instanceof Error?n.message:String(n)}`;o(r)||t.log(n,`ERROR`,Te,``)};return window.addEventListener(`error`,s),window.addEventListener(`unhandledrejection`,c),()=>{window.removeEventListener(`error`,s),window.removeEventListener(`unhandledrejection`,c)}}function k(e,t){return e!=null&&e.includes(t)}function A(e,t){if(e==null||t.length===0)return!1;for(let n of t)if(e.includes(n))return!0;return!1}var j=r(`outline`,`activity-heartbeat`,`ActivityHeartbeat`,[[`path`,{d:`M3 12h4.5l1.5 -6l4 12l2 -9l1.5 3h4.5`,key:`svg-0`}]]),De=`ROLE_USER`,M=`ROLE_DEV`,N=`ROLE_SUPERVISOR`,Oe=`ROLE_SECURITY_AUDITOR`,ke=`ROLE_ADMIN`,P=`ROLE_NODEFONY_ADMIN`,Ae=[De,M,N,Oe,ke,P];function F(e,t){return k(t,`ROLE_NODEFONY_ADMIN`)||!e||e.length===0?!0:A(t,e)}var I={devops:[M,N],dev:[M],ops:[N],admin:[P]},je=[{role:N,path:`/nodefony/supervision`,label:`Supervision`,description:`Santé applicative, charge, erreurs, alertes.`,icon:j}],L=`nf.studio.lastUser`,R=`nf.studio.lastMethod`,z=`nf.studio.pendingMethod`;function B(e){try{localStorage.setItem(L,e)}catch{}}function V(e){try{localStorage.setItem(R,e),localStorage.removeItem(z)}catch{}}var Me=class{auth;user=null;status=`idle`;error=null;mfaPending=!1;constructor(e){this.auth=e,u(this)}get isAuthenticated(){return this.status===`authenticated`&&!!this.user}get displayName(){return this.user?.username??`guest`}get roles(){return this.user?.roles??[]}get dashboards(){let e=this.roles;return je.filter(t=>k(e,t.role))}get homePath(){return`/nodefony/workspace`}async checkSession(){this.status=`loading`;try{let e=await this.auth.me();l(()=>{this.user=e,this.status=`authenticated`,this.error=null}),B(e.username);try{let e=localStorage.getItem(z);e&&V(e)}catch{}}catch{l(()=>{this.user=null,this.status=`unauthenticated`,this.error=null})}}async login(e){this.status=`loading`,this.error=null,this.mfaPending=!1;try{let t=await this.auth.login(e);return t.kind===`mfaRequired`?(l(()=>{this.mfaPending=!0,this.status=`idle`}),`mfa_required`):(l(()=>{this.user=t.user,this.status=`authenticated`}),B(t.user.username),V(`password`),`authenticated`)}catch(e){throw l(()=>{this.status=`error`,this.error=e instanceof Error?e.message:String(e)}),e}}async completeMfa(e){this.status=`loading`,this.error=null;try{let t=await this.auth.verifyTotpLogin(e);l(()=>{this.user=t,this.status=`authenticated`,this.mfaPending=!1}),B(t.username),V(`password`)}catch(e){throw l(()=>{this.status=`idle`,this.error=e instanceof Error?e.message:String(e)}),e}}cancelMfa(){l(()=>{this.mfaPending=!1,this.status=`unauthenticated`,this.error=null})}async loginWithPasskey(){this.status=`loading`,this.error=null;try{let e=await this.auth.loginWithPasskey();l(()=>{this.user=e,this.status=`authenticated`}),B(e.username),V(`passkey`)}catch(e){throw l(()=>{this.status=`error`,this.error=e instanceof Error?e.message:String(e)}),e}}registerPasskey(){return this.auth.registerPasskey()}async logout(){try{await this.auth.logout()}catch{}l(()=>{this.user=null,this.status=`unauthenticated`})}clearLocalSession(){l(()=>{this.user=null,this.status=`unauthenticated`})}},Ne=class{client;state=`disconnected`;lastError=null;latencyMs=null;activeSubscriptions=new Map;connectedAt=null;everConnected=!1;reconnectAttempt=0;nextRetryAt=null;endpointUrl=``;framesReceived=0;lastFrameAt=null;lastFrameMethod=null;clientHandlers=new Map;constructor(e,t=``){this.client=e,this.endpointUrl=t,u(this,{},{autoBind:!0}),this.client.onState(e=>{l(()=>{this.state=e,e===`connected`?(this.lastError=null,this.connectedAt=Date.now(),this.everConnected=!0,this.reconnectAttempt=0,this.nextRetryAt=null):(e===`disconnected`||e===`error`)&&(this.connectedAt=null)})}),this.client.onStats(()=>this.syncStats()),this.client.onReconnect(e=>{l(()=>{this.reconnectAttempt=e.attempt,this.nextRetryAt=e.nextRetryAt})}),l(()=>{this.state=this.client.state,this.client.state===`connected`&&(this.connectedAt=Date.now(),this.everConnected=!0)}),this.syncStats()}get isDown(){return this.state===`reconnecting`||this.state===`error`||this.state===`disconnected`&&this.everConnected}retryNow(){this.client.retryNow()}syncStats(){l(()=>{this.framesReceived=this.client.framesReceived,this.lastFrameAt=this.client.lastFrameAt,this.lastFrameMethod=this.client.lastFrameMethod;let e=new Set(this.client.subscribedChannels);for(let t of e)this.activeSubscriptions.has(t)||this.activeSubscriptions.set(t,{channel:t,msgCount:0,lastMessage:null,subscribedAt:Date.now(),rate:0,series:[],protocol:`json-rpc-2.0`,transport:`ws`,kind:`channel`});for(let t of this.activeSubscriptions.keys())e.has(t)||this.activeSubscriptions.delete(t);for(let e of this.activeSubscriptions.values()){let t=this.client.getChannelStats(e.channel);t&&(e.msgCount=t.msgCount,e.lastMessage=t.lastMessage,e.rate=t.rate,e.series=t.series)}})}get isConnected(){return this.state===`connected`}get subscriptionCount(){return this.activeSubscriptions.size}get totalMessages(){let e=0;for(let t of this.activeSubscriptions.values())e+=t.msgCount;return e}reconnect(){this.client.connect()}async connect(e){if(this.state===`connected`||this.state===`connecting`)return;let t=performance.now();try{await Promise.race([this.client.connect(),new Promise((e,t)=>setTimeout(()=>t(Error(`Backend WS pas prêt (P13.4 RealtimeService)`)),3e3))]),l(()=>{this.latencyMs=Math.round(performance.now()-t)})}catch(e){l(()=>{this.lastError=e instanceof Error?e.message:String(e),this.latencyMs=null})}}disconnect(){this.client.disconnect(),l(()=>{this.activeSubscriptions.clear()}),this.clientHandlers.clear()}subscribe(e,t,n={}){if(this.clientHandlers.has(e))return console.warn(`[Connection] already subscribed to ${e}`),()=>this.unsubscribe(e);let r={channel:e,msgCount:0,lastMessage:null,subscribedAt:Date.now(),rate:0,series:[],protocol:n.protocol??`json-rpc-2.0`,transport:n.transport??`ws`,kind:n.kind??`channel`,peer:n.peer},i=(...e)=>{t(...e)},a=this.client.on(e,i);return l(()=>{this.activeSubscriptions.set(e,r)}),this.clientHandlers.set(e,{dispose:a,wrapped:i}),this.client.subscribe(e),()=>this.unsubscribe(e)}unsubscribe(e){this.clientHandlers.get(e)?.dispose(),this.clientHandlers.delete(e),l(()=>{this.activeSubscriptions.delete(e)}),this.client.unsubscribe(e)}simulateMessage(e,t){this.clientHandlers.get(e)?.wrapped(t)}},Pe=`nodefony.studio.theme`,Fe=`nodefony.studio.palette`,Ie=`nodefony.studio.sidebar.rail`,Le=`nodefony.studio.sidebar.groups.v3`,H=`nodefony.studio.sidebar.pinned`,Re=`nf.debugbar.visible`,ze=`nf.realtime.adaptive`,Be=`nf.realtime.live`,Ve=`nf.api.socket`,He=class{theme=`dark`;palette=`nodefony`;rail=!1;collapsedGroups={};pinned=[];navQuery=``;debugBar=!0;adaptiveCadence=!1;realtimeLive=!1;apiViaSocket=!0;constructor(){u(this),this.loadPrefs()}setRealtimeLive(e){this.realtimeLive=e;try{localStorage.setItem(Be,e?`1`:`0`)}catch{}}toggleRealtimeLive(){this.setRealtimeLive(!this.realtimeLive)}setDebugBar(e){this.debugBar=e,this.applyDebugBar()}toggleDebugBar(){this.setDebugBar(!this.debugBar)}applyDebugBar(){try{localStorage.setItem(Re,this.debugBar?`1`:`0`)}catch{}window.__NODEFONY_DEBUGBAR__?.setVisible(this.debugBar)}setTheme(e){this.theme=e,this.persist()}toggleTheme(){this.theme=this.theme===`dark`?`light`:`dark`,this.persist()}toggleRail(){this.rail=!this.rail,this.persist()}setPalette(e){this.palette=e,this.persist()}togglePalette(){this.palette=this.palette===`nodefony`?`orange`:`nodefony`,this.persist()}isGroupCollapsed(e,t=!1){let n=this.collapsedGroups[e];return typeof n==`boolean`?n:t}toggleGroup(e,t=!1){this.collapsedGroups[e]=!this.isGroupCollapsed(e,t),this.persist()}isPinned(e){return this.pinned.includes(e)}togglePin(e){this.pinned=this.isPinned(e)?this.pinned.filter(t=>t!==e):[...this.pinned,e],this.persist()}setNavQuery(e){this.navQuery=e}setAdaptiveCadence(e){this.adaptiveCadence=e,this.persist()}toggleAdaptiveCadence(){this.setAdaptiveCadence(!this.adaptiveCadence)}setApiViaSocket(e){this.apiViaSocket=e;try{localStorage.setItem(Ve,e?`1`:`0`)}catch{}}toggleApiViaSocket(){this.setApiViaSocket(!this.apiViaSocket)}loadPrefs(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(Pe);(e===`light`||e===`dark`||e===`auto`)&&(this.theme=e);let t=localStorage.getItem(Fe);(t===`orange`||t===`nodefony`)&&(this.palette=t),this.rail=localStorage.getItem(Ie)===`1`,this.debugBar=localStorage.getItem(Re)!==`0`,this.adaptiveCadence=localStorage.getItem(ze)===`1`,this.realtimeLive=localStorage.getItem(Be)===`1`,this.apiViaSocket=localStorage.getItem(Ve)!==`0`;let n=localStorage.getItem(Le);if(n){let e=JSON.parse(n);e&&typeof e==`object`&&(this.collapsedGroups=e)}let r=localStorage.getItem(H);if(r){let e=JSON.parse(r);Array.isArray(e)&&(this.pinned=e.filter(e=>typeof e==`string`))}}catch{}}persist(){try{if(typeof localStorage>`u`)return;localStorage.setItem(Pe,this.theme),localStorage.setItem(Fe,this.palette),localStorage.setItem(Ie,this.rail?`1`:`0`),localStorage.setItem(ze,this.adaptiveCadence?`1`:`0`),localStorage.setItem(Le,JSON.stringify(this.collapsedGroups)),localStorage.setItem(H,JSON.stringify(this.pinned))}catch{}}},Ue=class{client;messages=[];currentResponse=``;isStreaming=!1;error=null;constructor(e){this.client=e,u(this)}clear(){this.messages=[],this.currentResponse=``,this.error=null}async send(e){if(!e.trim()||this.isStreaming)return;let t={id:`u-${Date.now()}`,role:`user`,content:e,ts:Date.now()};l(()=>{this.messages.push(t),this.isStreaming=!0,this.currentResponse=``,this.error=null});try{await this.mockStream(e),l(()=>{this.messages.push({id:`a-${Date.now()}`,role:`assistant`,content:this.currentResponse,ts:Date.now()}),this.currentResponse=``,this.isStreaming=!1})}catch(e){l(()=>{this.error=e instanceof Error?e.message:String(e),this.isStreaming=!1})}}async mockStream(e){let t=`[mock] Reçu "${e}". Le pipeline @nodefony/agent (P12) répondra ici en streaming via RealtimeClient + JSON-RPC 2.0.`;for(let e of t.split(``))await new Promise(e=>setTimeout(e,15)),l(()=>this.currentResponse+=e)}},We=`/nodefony/framework/api/admin`,Ge=class{api;producers=[];loading=!1;error=null;env=null;invocations=new Map;constructor(e){this.api=e,u(this,{},{autoBind:!0})}get isProd(){return this.env===`production`}async loadInfo(){try{let e=await this.api.get(`/info`);l(()=>{this.env=typeof e.env==`string`?e.env:null})}catch{}}async loadCatalog(){this.loading=!0,this.error=null;try{let e=await this.api.getAbsolute(We);l(()=>{this.producers=e.producers??[],this.loading=!1})}catch(e){l(()=>{this.error=e instanceof Error?e.message:String(e),this.loading=!1})}}async invoke(e){this.invocations.set(e,{loading:!0});try{let t=await this.api.getAbsolute(e);l(()=>{this.invocations.set(e,{loading:!1,data:t,at:Date.now()})})}catch(t){l(()=>{this.invocations.set(e,{loading:!1,error:t instanceof Error?t.message:String(t),at:Date.now()})})}}reset(){this.producers=[],this.invocations.clear(),this.error=null,this.loading=!1}get endpointCount(){return this.producers.reduce((e,t)=>e+t.endpoints.length,0)}pageCapabilities(e,t=`GET`){for(let n of this.producers)for(let r of n.endpoints)if(r.path===e&&r.method===t)return r.page??null;return null}},U=`/nodefony/profiler/api`,Ke=class{api;recent=[];count=0;loading=!1;error=null;unavailable=!1;selectedId=null;detail=null;detailLoading=!1;detailError=null;autoRefresh=!1;timer=null;constructor(e){this.api=e,u(this,{},{autoBind:!0})}async loadRecent(){this.loading=!0,this.error=null,this.unavailable=!1;try{let e=await this.api.getAbsolute(`${U}/recent`);l(()=>{this.recent=e.entries??[],this.count=e.count??this.recent.length,this.loading=!1})}catch(e){l(()=>{e instanceof y&&e.status===404?this.unavailable=!0:this.error=e instanceof Error?e.message:String(e),this.loading=!1})}}async select(e){this.selectedId=e,this.detail=null,this.detailLoading=!0,this.detailError=null;try{let t=await this.api.getAbsolute(`${U}/${encodeURIComponent(e)}`);l(()=>{this.selectedId===e&&(this.detail=t,this.detailLoading=!1)})}catch(t){l(()=>{this.selectedId===e&&(this.detailError=t instanceof Error?t.message:String(t),this.detailLoading=!1)})}}async clear(){try{await this.api.deleteAbsolute(`${U}/recent`)}catch{}l(()=>{this.recent=[],this.count=0,this.selectedId=null,this.detail=null})}setAutoRefresh(e){this.autoRefresh=e,this.timer&&=(clearInterval(this.timer),null),e&&(this.timer=setInterval(()=>void this.loadRecent(),3e3))}dispose(){this.timer&&clearInterval(this.timer),this.timer=null,this.autoRefresh=!1}},qe=50,Je={success:`teal`,info:`blue`,warning:`yellow`,error:`red`},Ye={success:3e3,info:4e3,warning:6e3,error:1e4},Xe=class{recent=[];constructor(e){u(this,{},{autoBind:!0}),e.onNotice(e=>this.push(e))}push(e){this.recent.push(e),this.recent.length>qe&&this.recent.splice(0,this.recent.length-qe),e.source!==`realtime`&&v.show({color:Je[e.level],title:e.title,message:e.message,autoClose:Ye[e.level],withBorder:!0})}notify(e,t,n={}){this.push({level:e,message:t,title:n.title,source:n.source??`api`,code:n.code,ts:Date.now()})}get realtimeIncidents(){return this.recent.filter(e=>e.source===`realtime`||e.source===`server`).slice().reverse()}clear(){this.recent=[]}},Ze=1/48,Qe=1/6,$e=.008,et={runtime:`Runtime & lancement`,system:`Système & santé`,logs:`Logs`,orm:`Données / ORM`,realtime:`Temps réel`,cluster:`Cluster`,security:`Sécurité`,account:`Mon compte`,ai:`IA`},W=[{id:`account`,label:`Mon compte`,items:[{widgetId:`account.profile`,span:6,h:4},{widgetId:`account.apikeys`,span:6,h:3},{widgetId:`account.sessions`,span:6,h:3}]},{id:`dev`,label:`Développeur`,roles:I.dev,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`system.info`,span:6,h:4},{widgetId:`system.git`,span:4,h:3},{widgetId:`system.uptime`,span:4,h:3},{widgetId:`system.cpu`,span:4,h:4},{widgetId:`system.heap`,span:4,h:4},{widgetId:`system.eventloop`,span:4,h:4},{widgetId:`orm.health`,span:6,h:4},{widgetId:`logs.live`,span:6,h:5}]},{id:`admin`,label:`Admin`,roles:I.admin,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`runtime.modes`,span:6,h:4},{widgetId:`system.health`,span:6,h:3},{widgetId:`orm.health`,span:6,h:4},{widgetId:`realtime.hub`,span:6,h:4},{widgetId:`realtime.channels`,span:6,h:4}]},{id:`supervision`,label:`Supervision`,roles:I.ops,items:[],layout:[{widgetId:`supervision.health`,x:0,y:0,w:1,h:216,z:10},{widgetId:`runtime.mode`,x:0,y:228,w:.2917,h:208,z:2},{widgetId:`system.eventloop`,x:.2997,y:228,w:.2083,h:208,z:3},{widgetId:`system.cpu`,x:.516,y:228,w:.2292,h:208,z:4},{widgetId:`system.heap`,x:.7532,y:228,w:.2292,h:208,z:5},{widgetId:`supervision.correlation`,x:0,y:448,w:1,h:312,z:9},{widgetId:`orm.flow`,x:0,y:772,w:1,h:320,z:7},{widgetId:`supervision.gc`,x:0,y:1104,w:1,h:384,z:8}]},{id:`systeme`,label:`Système`,roles:I.devops,items:[{widgetId:`supervision.health`,span:12,h:6},{widgetId:`system.cpu`,span:4,h:4},{widgetId:`system.heap`,span:4,h:4},{widgetId:`system.eventloop`,span:4,h:4},{widgetId:`supervision.correlation`,span:6,h:5},{widgetId:`supervision.gc`,span:6,h:6},{widgetId:`system.info`,span:6,h:4},{widgetId:`runtime.mode`,span:6,h:4}]},{id:`config`,label:`Configuration`,roles:I.dev,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`runtime.modes`,span:6,h:4},{widgetId:`runtime.vite`,span:4,h:4},{widgetId:`system.info`,span:8,h:4},{widgetId:`system.git`,span:6,h:3},{widgetId:`system.uptime`,span:6,h:3}]},{id:`logs`,label:`Logs`,roles:I.devops,items:[{widgetId:`logs.live`,span:12,h:7},{widgetId:`logs.backplane`,span:12,h:5},{widgetId:`supervision.alerts`,span:6,h:4},{widgetId:`realtime.channels`,span:6,h:4}]},{id:`memoire`,label:`Mémoire`,roles:I.devops,items:[{widgetId:`supervision.memory`,span:8,h:6},{widgetId:`supervision.handles`,span:4,h:6},{widgetId:`supervision.gc`,span:12,h:6},{widgetId:`system.heap`,span:6,h:4},{widgetId:`supervision.correlation`,span:6,h:5}]},{id:`erreurs`,label:`Erreurs`,roles:I.devops,items:[{widgetId:`supervision.errors`,span:6,h:5},{widgetId:`supervision.alerts`,span:6,h:5},{widgetId:`logs.live`,span:12,h:7}]},{id:`blank`,label:`Vierge`,items:[]}];function tt(e){return W.find(t=>t.id===e)?.roles}function nt(e,t){return F(tt(e),t)}var rt=`account`,G=new Map,it={runtime:I.devops,system:I.devops,realtime:I.devops,logs:I.devops,cluster:I.ops,orm:I.dev,ai:I.dev,security:I.admin};function at(e){G.set(e.id,e)}function ot(e){return G.get(e)}function st(e=[]){let t=[];for(let n of G.values())F(n.roles??it[n.category],e)&&t.push(n);return t.sort((e,t)=>e.title.localeCompare(t.title))}function K(e,t){return t<=0?e:Math.round(e/t)*t}function q(e,t,n){return Math.max(t,Math.min(n,e))}function ct(e){let t=[],n=0,r=0,i=0;for(let a of e){let e=q(a.w,.05,1);n>0&&n+e>1+1e-6&&(n=0,r+=i+12,i=0),t.push({id:a.id,x:n,y:r,w:e,h:a.h}),n+=e+$e,i=Math.max(i,a.h)}return t}var J=`nf.workspace.layouts.v3`,Y=`nf.workspace.active.v3`;function X(e){return q(Number.isFinite(e)?e:.33,Qe,1)}function Z(e){return Math.max(96,Number.isFinite(e)?Math.round(e):192)}function Q(e){if(e.layout&&e.layout.length)return{id:e.id,label:e.label,items:e.layout.map(lt)};let t=ct(e.items.map(e=>({id:e.widgetId,w:X((e.span??4)/12),h:Z((e.h??3)*64)})));return{id:e.id,label:e.label,items:t.map((e,t)=>({widgetId:e.id,x:e.x,y:e.y,w:e.w,h:e.h,z:t+1}))}}function lt(e){return{widgetId:e.widgetId,x:q(e.x,0,1),y:Math.max(0,Math.round(e.y)),w:X(e.w),h:Z(e.h),z:e.z}}function ut(e){let t=e;return!!t&&typeof t.widgetId==`string`&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.w==`number`&&typeof t.h==`number`&&typeof t.z==`number`}var dt=class{layouts={};activeId=rt;constructor(){u(this),this.load()}get active(){return this.layouts[this.activeId]??this.layouts.blank??{id:`blank`,label:`Vierge`,items:[]}}get layoutList(){return Object.values(this.layouts)}setActive(e){this.layouts[e]&&(this.activeId=e,this.persist())}hasWidget(e){return this.active.items.some(t=>t.widgetId===e)}topZ(e){return e.reduce((e,t)=>Math.max(e,t.z),0)}addWidget(e){let t=ot(e),n=this.layouts[this.activeId];if(!t||!n||n.items.some(t=>t.widgetId===e))return;let r=X((t.defaultSpan??4)/12),i=Z((t.defaultH??3)*64),a=n.items.reduce((e,t)=>Math.max(e,t.y+t.h),0);n.items.push({widgetId:e,x:0,y:n.items.length?a+8:0,w:r,h:i,z:this.topZ(n.items)+1}),this.persist()}removeWidget(e){let t=this.layouts[this.activeId];t&&(t.items=t.items.filter(t=>t.widgetId!==e),this.persist())}moveTo(e,t,n){let r=this.layouts[this.activeId]?.items.find(t=>t.widgetId===e);r&&(r.x=q(K(t,Ze),0,1-r.w),r.y=Math.max(0,K(n,8)),this.persist())}setSize(e,t,n){let r=this.layouts[this.activeId]?.items.find(t=>t.widgetId===e);r&&(r.w=X(K(t,Ze)),r.h=Z(K(n,8)),r.x=Math.min(r.x,1-r.w),this.persist())}bringToFront(e){let t=this.layouts[this.activeId]?.items,n=t?.find(t=>t.widgetId===e);if(!t||!n)return;let r=this.topZ(t);n.z!==r&&(n.z=r+1,this.persist())}tidy(){let e=this.layouts[this.activeId];if(!e||!e.items.length)return;let t=[...e.items].sort((e,t)=>e.y-t.y||e.x-t.x),n=t.map(e=>({id:e.widgetId,w:e.w,h:e.h})),r=new Map(ct(n).map(e=>[e.id,e]));t.forEach((e,t)=>{let n=r.get(e.widgetId);n&&(e.x=n.x,e.y=n.y,e.z=t+1)}),this.persist()}resetToPreset(){let e=W.find(e=>e.id===this.activeId);e&&(this.layouts[this.activeId]=Q(e),this.persist())}get templates(){return W.map(e=>({id:e.id,label:e.label}))}uniqueId(){let e=`ws_${Date.now().toString(36)}`;for(;this.layouts[e];)e+=`x`;return e}uniqueLabel(e){let t=new Set(Object.values(this.layouts).map(e=>e.label));if(!t.has(e))return e;let n=2;for(;t.has(`${e} ${n}`);)n++;return`${e} ${n}`}createWorkspace(e){let t=e?W.find(t=>t.id===e):null,n=this.uniqueId(),r=this.uniqueLabel(t?.label??`Bureau`),i=t?Q(t).items:[];return this.layouts[n]={id:n,label:r,items:i},this.activeId=n,this.persist(),n}renameWorkspace(e,t){let n=this.layouts[e],r=t.trim();n&&r&&(n.label=r,this.persist())}deleteWorkspace(e){Object.keys(this.layouts).length<=1||!this.layouts[e]||(delete this.layouts[e],this.activeId===e&&(this.activeId=Object.keys(this.layouts)[0]),this.persist())}moveWorkspace(e,t){if(!this.layouts[e]||e===t)return;let n=Object.keys(this.layouts).filter(t=>t!==e),r=t?n.indexOf(t):-1;if(t&&r<0)return;n.splice(r<0?n.length:r,0,e);let i={};for(let e of n)i[e]=this.layouts[e];this.layouts=i,this.persist()}duplicateWorkspace(e){let t=this.layouts[e];if(!t)return;let n=this.uniqueId();this.layouts[n]={id:n,label:this.uniqueLabel(`${t.label} (copie)`),items:t.items.map(e=>({...e}))},this.activeId=n,this.persist()}resetForIdentity(){try{typeof localStorage<`u`&&(localStorage.removeItem(J),localStorage.removeItem(Y))}catch{}this.activeId=rt,this.load()}load(){try{if(typeof localStorage<`u`){let e=localStorage.getItem(J);if(e){let t=JSON.parse(e);if(t&&typeof t==`object`){let e={};for(let[n,r]of Object.entries(t))r&&Array.isArray(r.items)&&(e[n]={id:n,label:r.label??n,items:r.items.filter(ut).map(lt)});if(Object.keys(e).length){this.layouts=e;let t=localStorage.getItem(Y);this.activeId=t&&e[t]?t:Object.keys(e)[0];return}}}}}catch{}let e={};for(let t of W)e[t.id]=Q(t);this.layouts=e,e[this.activeId]||(this.activeId=Object.keys(e)[0]??`account`)}persist(){try{if(typeof localStorage>`u`)return;localStorage.setItem(J,JSON.stringify(this.layouts)),localStorage.setItem(Y,this.activeId)}catch{}}};function ft(){return typeof window>`u`?`ws://127.0.0.1/nodefony/studio/api/realtime`:`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/nodefony/studio/api/realtime`}var pt=class{ui;auth;connection;chat;admin;profiler;notifications;workspace;api;kernel;realtime;browserLog;constructor(){this.ui=new He,this.workspace=new dt,this.kernel=c({name:`STUDIO`,connectOnBoot:!1,realtime:{url:ft(),autoReconnect:!0,reconnectDelay:800,reconnectDelayMax:4e3}});let e=this.kernel.get(`realtime`);if(!e)throw Error(`RootStore : le noyau client n'a pas composé de socket temps réel.`);this.realtime=e,this.browserLog=new t({moduleName:`studio`}),a(),Ee({syslog:this.browserLog}),n({syslog:this.browserLog,publisher:this.realtime}),this.notifications=new Xe(this.realtime),this.api=new fe({socket:this.realtime,socketEnabled:()=>this.ui.apiViaSocket,onUnauthorized:()=>{this.auth?.clearLocalSession()},onError:({method:e,status:t,message:n})=>{t!==401&&e!==`GET`&&this.notifications.notify(`error`,n,{title:`Erreur ${t}`,source:`api`,code:t})}});let r=new Ce(this.api);this.auth=new Me(r),this.connection=new Ne(this.realtime,ft()),this.chat=new Ue(this.realtime),this.admin=new Ge(this.api),this.profiler=new Ke(this.api),o(()=>this.auth.user?.id??null,e=>{this.kernel.setIdentity(e===null?null:{key:String(e)})}),this.kernel.on(`onIdentityChange`,(...e)=>{let[,t]=e;if(this.admin.reset(),t!==null){this.workspace.resetForIdentity();try{if(typeof localStorage<`u`){let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`studio.`)||n.startsWith(`nf.datagrid:`))&&e.push(n)}for(let t of e)localStorage.removeItem(t)}}catch{}}}),this.kernel.boot()}},mt=`__nfStudioStoreContext__`,ht=globalThis,gt=ht[mt]??(ht[mt]=(0,d.createContext)(null)),_t=gt.Provider;function $(){let e=(0,d.useContext)(gt);if(!e)throw Error(`useStore() called outside <StoreProvider>. Wrap your tree with StoreProvider.`);return e}var vt=()=>$().auth,yt=()=>$().ui,bt=()=>$().connection,xt=()=>$().chat,St=()=>$().admin,Ct=()=>$().profiler,wt=()=>$().notifications,Tt=()=>$().workspace;export{k as A,P as C,F as D,I as E,te as F,_ as M,v as N,j as O,h as P,M as S,Ae as T,Qe as _,bt as a,L as b,$ as c,pt as d,q as f,nt as g,at as h,xt as i,y as j,A as k,yt as l,st as m,St as n,wt as o,ot as p,vt as r,Ct as s,_t as t,Tt as u,et as v,N as w,z as x,R as y};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{At as t,Dt as n,Et as r,Lr as i,Ot as a,ci as o,di as s,kt as c,li as l,si as u}from"./ui-D72MNfu0.js";var d=e(s(),1);function f(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function p(e){return(0,d.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}var m=0;function ee(e,t,n){let r=[],i=[],a=new Map;for(let n of e){let e=n.position||t,r=a.get(e);r?r.push(n):a.set(e,[n])}for(let e of a.values())e.sort((e,t)=>(t.priority??0)-(e.priority??0)||(e.__sequence??0)-(t.__sequence??0)),e.forEach((e,t)=>{t<n?i.push(e):r.push(e)});return{notifications:i,queue:r}}var h=f({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),te=(e=h)=>p(e);function g(e,t){let n=e.getState(),r=t([...n.notifications,...n.queue]);for(let e of r)e.__sequence===void 0&&(e.__sequence=m,m+=1);let i=ee(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ne(e,t=h){let n=e.id||i();return g(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function _(e,t=h){return g(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}function re(e,t=h){return g(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function ie(e=h){g(e,()=>[])}function ae(e=h){let{defaultPosition:t,limit:n}=e.getState();g(e,e=>ee(e,t,n).notifications)}var v={show:ne,hide:_,update:re,clean:ie,cleanQueue:ae,updateState:g},y=class extends Error{status;body;constructor(e,t,n){super(n),this.status=e,this.body=t,this.name=`ApiError`}};function oe(e,t){if(e&&typeof e==`object`){let t=e,n=t.error??t;if(typeof n.message==`string`&&n.message)return n.message}return t}function se(e){return e&&typeof e==`object`&&`result`in e?e.result:e}var ce=-32601;function le(e){let t=e.indexOf(`?`);return t===-1?e:e.slice(0,t)}function ue(e,t){return`${e} ${le(t)}`}function de(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`idem-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}var fe=class{baseUrl;onUnauthorized;onError;socket;socketEnabled;socketBridgeDown=!1;httpOnlyRoutes=new Set;constructor(e={}){this.baseUrl=e.baseUrl??`/nodefony/studio/api`,this.onUnauthorized=e.onUnauthorized,this.onError=e.onError,this.socket=e.socket,this.socketEnabled=e.socketEnabled}async get(e,t){return this.request(`GET`,e,void 0,t)}async post(e,t,n){return this.request(`POST`,e,t,n)}async put(e,t,n){return this.request(`PUT`,e,t,n)}async delete(e,t){return this.request(`DELETE`,e,void 0,t)}async getAbsolute(e,t){return this.send(`GET`,e,void 0,t)}async postAbsolute(e,t,n){return this.send(`POST`,e,t,n)}async patchAbsolute(e,t,n){return this.send(`PATCH`,e,t,n)}async deleteAbsolute(e,t){return this.send(`DELETE`,e,void 0,t)}async request(e,t,n,r){let i=`${this.baseUrl}${t.startsWith(`/`)?t:`/`+t}`;return this.send(e,i,n,r)}canUseSocket(e,t,n){return(e===`GET`||e===`POST`||e===`PUT`||e===`PATCH`||e===`DELETE`)&&this.socket!==void 0&&!this.socketBridgeDown&&(this.socketEnabled?.()??!0)&&this.socket.state===`connected`&&t.startsWith(`/`)&&!n?.signal&&!n?.headers&&!this.httpOnlyRoutes.has(ue(e,t))}learnFromSocketError(e,t,n){let r=n;if(n&&typeof n==`object`&&r.name===`RpcError`){if(r.code===ce){this.socketBridgeDown=!0;return}r.data?.status===405&&this.httpOnlyRoutes.add(ue(e,t))}}async send(e,t,n,r){let i=e!==`GET`&&e!==`HEAD`?de():void 0;if(this.canUseSocket(e,t,r))try{return se(e===`GET`?await this.socket.request(t):await this.socket.mutate(t,{method:e,body:n,idempotencyKey:i}))}catch(n){this.learnFromSocketError(e,t,n)}let a=new Headers(r?.headers);a.set(`Accept`,`application/json`),n!==void 0&&a.set(`Content-Type`,`application/json`),i&&a.set(`Idempotency-Key`,i);let o=await fetch(t,{...r,method:e,headers:a,body:n===void 0?void 0:JSON.stringify(n),credentials:`same-origin`}),s=t.includes(`/api/auth/`);o.status===401&&!s&&this.onUnauthorized?.();let c=(o.headers.get(`Content-Type`)??``).includes(`application/json`),l=c?await o.json():await o.text();if(!o.ok){let n=oe(l,`HTTP ${o.status}`);throw this.onError?.({method:e,status:o.status,message:n,body:l}),new y(o.status,l,`${e} ${t} → HTTP ${o.status}`)}return c?se(l):l}};function b(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function x(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function S(){return pe.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var pe={stubThis:e=>e};function me(e){let{id:t}=e;return{...e,id:x(t),transports:e.transports,type:e.type}}function C(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var w=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function he({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new w({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new w({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new w({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new w({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new w({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new w({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new w({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new w({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!C(t))return new w({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new w({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new w({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new w({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var ge=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},_e=[`cross-platform`,`platform`];function ve(e){if(e&&!(_e.indexOf(e)<0))return e}async function ye(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!S())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:x(t.challenge),user:{...t.user,id:x(t.user.id)},excludeCredentials:t.excludeCredentials?.map(me)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=ge.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw he({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){T(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=b(e))}catch(e){T(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=b(c.getAuthenticatorData())}catch(e){T(`getAuthenticatorData()`,e)}return{id:o,rawId:b(s),response:{attestationObject:b(c.attestationObject),clientDataJSON:b(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:ve(a.authenticatorAttachment)}}function T(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function be(){if(!S())return E.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?E.stubThis(new Promise(e=>e(!1))):E.stubThis(e.isConditionalMediationAvailable())}var E={stubThis:e=>e};function xe({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new w({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new w({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!C(t))return new w({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new w({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new w({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Se(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!S())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(me));let a={...t,challenge:x(t.challenge),allowCredentials:i},o={};if(n){if(!await be())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=ge.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw xe({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=b(u.userHandle)),{id:c,rawId:b(l),response:{authenticatorData:b(u.authenticatorData),clientDataJSON:b(u.clientDataJSON),signature:b(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:ve(s.authenticatorAttachment)}}var D=`/nodefony/security/api/auth`,O=`/nodefony/security/api/webauthn`,Ce=class{api;constructor(e){this.api=e}async login(e){let t=await this.api.postAbsolute(`${D}/login`,e);return t.mfaRequired?{kind:`mfaRequired`,methods:t.methods??[`totp`]}:{kind:`authenticated`,user:t.user}}async verifyTotpLogin(e){let{user:t}=await this.api.postAbsolute(`${D}/login/totp`,{code:e});return t}async me(){let{user:e}=await this.api.getAbsolute(`${D}/me`);return e}async logout(){await this.api.postAbsolute(`${D}/logout`)}async loginWithPasskey(){let e=await Se({optionsJSON:await this.api.postAbsolute(`${O}/login/options`,{})}),{user:t}=await this.api.postAbsolute(`${O}/login/verify`,{response:e});return t}async registerPasskey(){let e=await ye({optionsJSON:await this.api.postAbsolute(`${O}/register/options`,{})}),{credentialId:t}=await this.api.postAbsolute(`${O}/register/verify`,{response:e});return t}async ping(){return this.api.get(`/health`)}},we=`BROWSER_ERROR`,Te=`BROWSER_REJECTION`;function Ee(e){if(typeof window>`u`)return()=>{};let{syslog:t,msgid:n=we,dedupeMs:r=1e3}=e,i=null,a=0,o=e=>{if(r<=0)return!1;let t=Date.now();return e===i&&t-a<r||(i=e,a=t,!1)},s=e=>{let r=e.filename!==void 0&&e.filename!==``?`${e.filename}:${e.lineno}:${e.colno}`:void 0,i=`error|${e.message}|${r??``}`;o(i)||t.log(e.error??e.message,`ERROR`,n,r??``)},c=e=>{let n=e.reason,r=`rejection|${n instanceof Error?n.message:String(n)}`;o(r)||t.log(n,`ERROR`,Te,``)};return window.addEventListener(`error`,s),window.addEventListener(`unhandledrejection`,c),()=>{window.removeEventListener(`error`,s),window.removeEventListener(`unhandledrejection`,c)}}function k(e,t){return e!=null&&e.includes(t)}function A(e,t){if(e==null||t.length===0)return!1;for(let n of t)if(e.includes(n))return!0;return!1}var j=r(`outline`,`activity-heartbeat`,`ActivityHeartbeat`,[[`path`,{d:`M3 12h4.5l1.5 -6l4 12l2 -9l1.5 3h4.5`,key:`svg-0`}]]),De=`ROLE_USER`,M=`ROLE_DEV`,N=`ROLE_SUPERVISOR`,Oe=`ROLE_SECURITY_AUDITOR`,ke=`ROLE_ADMIN`,P=`ROLE_NODEFONY_ADMIN`,Ae=[De,M,N,Oe,ke,P];function F(e,t){return k(t,`ROLE_NODEFONY_ADMIN`)||!e||e.length===0?!0:A(t,e)}var I={devops:[M,N],dev:[M],ops:[N],admin:[P]},je=[{role:N,path:`/nodefony/supervision`,label:`Supervision`,description:`Santé applicative, charge, erreurs, alertes.`,icon:j}],L=`nf.studio.lastUser`,R=`nf.studio.lastMethod`,z=`nf.studio.pendingMethod`;function B(e){try{localStorage.setItem(L,e)}catch{}}function V(e){try{localStorage.setItem(R,e),localStorage.removeItem(z)}catch{}}var Me=class{auth;user=null;status=`idle`;error=null;mfaPending=!1;constructor(e){this.auth=e,u(this)}get isAuthenticated(){return this.status===`authenticated`&&!!this.user}get displayName(){return this.user?.username??`guest`}get roles(){return this.user?.roles??[]}get dashboards(){let e=this.roles;return je.filter(t=>k(e,t.role))}get homePath(){return`/nodefony/workspace`}async checkSession(){this.status=`loading`;try{let e=await this.auth.me();l(()=>{this.user=e,this.status=`authenticated`,this.error=null}),B(e.username);try{let e=localStorage.getItem(z);e&&V(e)}catch{}}catch{l(()=>{this.user=null,this.status=`unauthenticated`,this.error=null})}}async login(e){this.status=`loading`,this.error=null,this.mfaPending=!1;try{let t=await this.auth.login(e);return t.kind===`mfaRequired`?(l(()=>{this.mfaPending=!0,this.status=`idle`}),`mfa_required`):(l(()=>{this.user=t.user,this.status=`authenticated`}),B(t.user.username),V(`password`),`authenticated`)}catch(e){throw l(()=>{this.status=`error`,this.error=e instanceof Error?e.message:String(e)}),e}}async completeMfa(e){this.status=`loading`,this.error=null;try{let t=await this.auth.verifyTotpLogin(e);l(()=>{this.user=t,this.status=`authenticated`,this.mfaPending=!1}),B(t.username),V(`password`)}catch(e){throw l(()=>{this.status=`idle`,this.error=e instanceof Error?e.message:String(e)}),e}}cancelMfa(){l(()=>{this.mfaPending=!1,this.status=`unauthenticated`,this.error=null})}async loginWithPasskey(){this.status=`loading`,this.error=null;try{let e=await this.auth.loginWithPasskey();l(()=>{this.user=e,this.status=`authenticated`}),B(e.username),V(`passkey`)}catch(e){throw l(()=>{this.status=`error`,this.error=e instanceof Error?e.message:String(e)}),e}}registerPasskey(){return this.auth.registerPasskey()}async logout(){try{await this.auth.logout()}catch{}l(()=>{this.user=null,this.status=`unauthenticated`})}clearLocalSession(){l(()=>{this.user=null,this.status=`unauthenticated`})}},Ne=class{client;state=`disconnected`;lastError=null;latencyMs=null;activeSubscriptions=new Map;connectedAt=null;everConnected=!1;reconnectAttempt=0;nextRetryAt=null;endpointUrl=``;framesReceived=0;lastFrameAt=null;lastFrameMethod=null;clientHandlers=new Map;constructor(e,t=``){this.client=e,this.endpointUrl=t,u(this,{},{autoBind:!0}),this.client.onState(e=>{l(()=>{this.state=e,e===`connected`?(this.lastError=null,this.connectedAt=Date.now(),this.everConnected=!0,this.reconnectAttempt=0,this.nextRetryAt=null):(e===`disconnected`||e===`error`)&&(this.connectedAt=null)})}),this.client.onStats(()=>this.syncStats()),this.client.onReconnect(e=>{l(()=>{this.reconnectAttempt=e.attempt,this.nextRetryAt=e.nextRetryAt})}),l(()=>{this.state=this.client.state,this.client.state===`connected`&&(this.connectedAt=Date.now(),this.everConnected=!0)}),this.syncStats()}get isDown(){return this.state===`reconnecting`||this.state===`error`||this.state===`disconnected`&&this.everConnected}retryNow(){this.client.retryNow()}syncStats(){l(()=>{this.framesReceived=this.client.framesReceived,this.lastFrameAt=this.client.lastFrameAt,this.lastFrameMethod=this.client.lastFrameMethod;let e=new Set(this.client.subscribedChannels);for(let t of e)this.activeSubscriptions.has(t)||this.activeSubscriptions.set(t,{channel:t,msgCount:0,lastMessage:null,subscribedAt:Date.now(),rate:0,series:[],protocol:`json-rpc-2.0`,transport:`ws`,kind:`channel`});for(let t of this.activeSubscriptions.keys())e.has(t)||this.activeSubscriptions.delete(t);for(let e of this.activeSubscriptions.values()){let t=this.client.getChannelStats(e.channel);t&&(e.msgCount=t.msgCount,e.lastMessage=t.lastMessage,e.rate=t.rate,e.series=t.series)}})}get isConnected(){return this.state===`connected`}get subscriptionCount(){return this.activeSubscriptions.size}get totalMessages(){let e=0;for(let t of this.activeSubscriptions.values())e+=t.msgCount;return e}reconnect(){this.client.connect()}async connect(e){if(this.state===`connected`||this.state===`connecting`)return;let t=performance.now();try{await Promise.race([this.client.connect(),new Promise((e,t)=>setTimeout(()=>t(Error(`Backend WS pas prêt (P13.4 RealtimeService)`)),3e3))]),l(()=>{this.latencyMs=Math.round(performance.now()-t)})}catch(e){l(()=>{this.lastError=e instanceof Error?e.message:String(e),this.latencyMs=null})}}disconnect(){this.client.disconnect(),l(()=>{this.activeSubscriptions.clear()}),this.clientHandlers.clear()}subscribe(e,t,n={}){if(this.clientHandlers.has(e))return console.warn(`[Connection] already subscribed to ${e}`),()=>this.unsubscribe(e);let r={channel:e,msgCount:0,lastMessage:null,subscribedAt:Date.now(),rate:0,series:[],protocol:n.protocol??`json-rpc-2.0`,transport:n.transport??`ws`,kind:n.kind??`channel`,peer:n.peer},i=(...e)=>{t(...e)},a=this.client.on(e,i);return l(()=>{this.activeSubscriptions.set(e,r)}),this.clientHandlers.set(e,{dispose:a,wrapped:i}),this.client.subscribe(e),()=>this.unsubscribe(e)}unsubscribe(e){this.clientHandlers.get(e)?.dispose(),this.clientHandlers.delete(e),l(()=>{this.activeSubscriptions.delete(e)}),this.client.unsubscribe(e)}simulateMessage(e,t){this.clientHandlers.get(e)?.wrapped(t)}},Pe=`nodefony.studio.theme`,Fe=`nodefony.studio.palette`,Ie=`nodefony.studio.sidebar.rail`,Le=`nodefony.studio.sidebar.groups.v3`,H=`nodefony.studio.sidebar.pinned`,Re=`nf.debugbar.visible`,ze=`nf.realtime.adaptive`,Be=`nf.realtime.live`,Ve=`nf.api.socket`,He=class{theme=`dark`;palette=`nodefony`;rail=!1;collapsedGroups={};pinned=[];navQuery=``;debugBar=!0;adaptiveCadence=!1;realtimeLive=!1;apiViaSocket=!0;constructor(){u(this),this.loadPrefs()}setRealtimeLive(e){this.realtimeLive=e;try{localStorage.setItem(Be,e?`1`:`0`)}catch{}}toggleRealtimeLive(){this.setRealtimeLive(!this.realtimeLive)}setDebugBar(e){this.debugBar=e,this.applyDebugBar()}toggleDebugBar(){this.setDebugBar(!this.debugBar)}applyDebugBar(){try{localStorage.setItem(Re,this.debugBar?`1`:`0`)}catch{}window.__NODEFONY_DEBUGBAR__?.setVisible(this.debugBar)}setTheme(e){this.theme=e,this.persist()}toggleTheme(){this.theme=this.theme===`dark`?`light`:`dark`,this.persist()}toggleRail(){this.rail=!this.rail,this.persist()}setPalette(e){this.palette=e,this.persist()}togglePalette(){this.palette=this.palette===`nodefony`?`orange`:`nodefony`,this.persist()}isGroupCollapsed(e,t=!1){let n=this.collapsedGroups[e];return typeof n==`boolean`?n:t}toggleGroup(e,t=!1){this.collapsedGroups[e]=!this.isGroupCollapsed(e,t),this.persist()}isPinned(e){return this.pinned.includes(e)}togglePin(e){this.pinned=this.isPinned(e)?this.pinned.filter(t=>t!==e):[...this.pinned,e],this.persist()}setNavQuery(e){this.navQuery=e}setAdaptiveCadence(e){this.adaptiveCadence=e,this.persist()}toggleAdaptiveCadence(){this.setAdaptiveCadence(!this.adaptiveCadence)}setApiViaSocket(e){this.apiViaSocket=e;try{localStorage.setItem(Ve,e?`1`:`0`)}catch{}}toggleApiViaSocket(){this.setApiViaSocket(!this.apiViaSocket)}loadPrefs(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(Pe);(e===`light`||e===`dark`||e===`auto`)&&(this.theme=e);let t=localStorage.getItem(Fe);(t===`orange`||t===`nodefony`)&&(this.palette=t),this.rail=localStorage.getItem(Ie)===`1`,this.debugBar=localStorage.getItem(Re)!==`0`,this.adaptiveCadence=localStorage.getItem(ze)===`1`,this.realtimeLive=localStorage.getItem(Be)===`1`,this.apiViaSocket=localStorage.getItem(Ve)!==`0`;let n=localStorage.getItem(Le);if(n){let e=JSON.parse(n);e&&typeof e==`object`&&(this.collapsedGroups=e)}let r=localStorage.getItem(H);if(r){let e=JSON.parse(r);Array.isArray(e)&&(this.pinned=e.filter(e=>typeof e==`string`))}}catch{}}persist(){try{if(typeof localStorage>`u`)return;localStorage.setItem(Pe,this.theme),localStorage.setItem(Fe,this.palette),localStorage.setItem(Ie,this.rail?`1`:`0`),localStorage.setItem(ze,this.adaptiveCadence?`1`:`0`),localStorage.setItem(Le,JSON.stringify(this.collapsedGroups)),localStorage.setItem(H,JSON.stringify(this.pinned))}catch{}}},Ue=class{client;messages=[];currentResponse=``;isStreaming=!1;error=null;constructor(e){this.client=e,u(this)}clear(){this.messages=[],this.currentResponse=``,this.error=null}async send(e){if(!e.trim()||this.isStreaming)return;let t={id:`u-${Date.now()}`,role:`user`,content:e,ts:Date.now()};l(()=>{this.messages.push(t),this.isStreaming=!0,this.currentResponse=``,this.error=null});try{await this.mockStream(e),l(()=>{this.messages.push({id:`a-${Date.now()}`,role:`assistant`,content:this.currentResponse,ts:Date.now()}),this.currentResponse=``,this.isStreaming=!1})}catch(e){l(()=>{this.error=e instanceof Error?e.message:String(e),this.isStreaming=!1})}}async mockStream(e){let t=`[mock] Reçu "${e}". Le pipeline @nodefony/agent (P12) répondra ici en streaming via RealtimeClient + JSON-RPC 2.0.`;for(let e of t.split(``))await new Promise(e=>setTimeout(e,15)),l(()=>this.currentResponse+=e)}},We=`/nodefony/framework/api/admin`,Ge=class{api;producers=[];loading=!1;error=null;env=null;invocations=new Map;constructor(e){this.api=e,u(this,{},{autoBind:!0})}get isProd(){return this.env===`production`}async loadInfo(){try{let e=await this.api.get(`/info`);l(()=>{this.env=typeof e.env==`string`?e.env:null})}catch{}}async loadCatalog(){this.loading=!0,this.error=null;try{let e=await this.api.getAbsolute(We);l(()=>{this.producers=e.producers??[],this.loading=!1})}catch(e){l(()=>{this.error=e instanceof Error?e.message:String(e),this.loading=!1})}}async invoke(e){this.invocations.set(e,{loading:!0});try{let t=await this.api.getAbsolute(e);l(()=>{this.invocations.set(e,{loading:!1,data:t,at:Date.now()})})}catch(t){l(()=>{this.invocations.set(e,{loading:!1,error:t instanceof Error?t.message:String(t),at:Date.now()})})}}reset(){this.producers=[],this.invocations.clear(),this.error=null,this.loading=!1}get endpointCount(){return this.producers.reduce((e,t)=>e+t.endpoints.length,0)}pageCapabilities(e,t=`GET`){for(let n of this.producers)for(let r of n.endpoints)if(r.path===e&&r.method===t)return r.page??null;return null}},U=`/nodefony/profiler/api`,Ke=class{api;recent=[];count=0;loading=!1;error=null;unavailable=!1;selectedId=null;detail=null;detailLoading=!1;detailError=null;autoRefresh=!1;timer=null;constructor(e){this.api=e,u(this,{},{autoBind:!0})}async loadRecent(){this.loading=!0,this.error=null,this.unavailable=!1;try{let e=await this.api.getAbsolute(`${U}/recent`);l(()=>{this.recent=e.entries??[],this.count=e.count??this.recent.length,this.loading=!1})}catch(e){l(()=>{e instanceof y&&e.status===404?this.unavailable=!0:this.error=e instanceof Error?e.message:String(e),this.loading=!1})}}async select(e){this.selectedId=e,this.detail=null,this.detailLoading=!0,this.detailError=null;try{let t=await this.api.getAbsolute(`${U}/${encodeURIComponent(e)}`);l(()=>{this.selectedId===e&&(this.detail=t,this.detailLoading=!1)})}catch(t){l(()=>{this.selectedId===e&&(this.detailError=t instanceof Error?t.message:String(t),this.detailLoading=!1)})}}async clear(){try{await this.api.deleteAbsolute(`${U}/recent`)}catch{}l(()=>{this.recent=[],this.count=0,this.selectedId=null,this.detail=null})}setAutoRefresh(e){this.autoRefresh=e,this.timer&&=(clearInterval(this.timer),null),e&&(this.timer=setInterval(()=>void this.loadRecent(),3e3))}dispose(){this.timer&&clearInterval(this.timer),this.timer=null,this.autoRefresh=!1}},qe=50,Je={success:`teal`,info:`blue`,warning:`yellow`,error:`red`},Ye={success:3e3,info:4e3,warning:6e3,error:1e4},Xe=class{recent=[];constructor(e){u(this,{},{autoBind:!0}),e.onNotice(e=>this.push(e))}push(e){this.recent.push(e),this.recent.length>qe&&this.recent.splice(0,this.recent.length-qe),e.source!==`realtime`&&v.show({color:Je[e.level],title:e.title,message:e.message,autoClose:Ye[e.level],withBorder:!0})}notify(e,t,n={}){this.push({level:e,message:t,title:n.title,source:n.source??`api`,code:n.code,ts:Date.now()})}get realtimeIncidents(){return this.recent.filter(e=>e.source===`realtime`||e.source===`server`).slice().reverse()}clear(){this.recent=[]}},Ze=1/48,Qe=1/6,$e=.008,et={runtime:`Runtime & lancement`,system:`Système & santé`,logs:`Logs`,orm:`Données / ORM`,realtime:`Temps réel`,cluster:`Cluster`,security:`Sécurité`,account:`Mon compte`,ai:`IA`},W=[{id:`account`,label:`Mon compte`,items:[{widgetId:`account.profile`,span:6,h:4},{widgetId:`account.apikeys`,span:6,h:3},{widgetId:`account.sessions`,span:6,h:3}]},{id:`dev`,label:`Développeur`,roles:I.dev,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`system.info`,span:6,h:4},{widgetId:`system.git`,span:4,h:3},{widgetId:`system.uptime`,span:4,h:3},{widgetId:`system.cpu`,span:4,h:4},{widgetId:`system.heap`,span:4,h:4},{widgetId:`system.eventloop`,span:4,h:4},{widgetId:`orm.health`,span:6,h:4},{widgetId:`logs.live`,span:6,h:5}]},{id:`admin`,label:`Admin`,roles:I.admin,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`runtime.modes`,span:6,h:4},{widgetId:`system.health`,span:6,h:3},{widgetId:`orm.health`,span:6,h:4},{widgetId:`realtime.hub`,span:6,h:4},{widgetId:`realtime.channels`,span:6,h:4}]},{id:`supervision`,label:`Supervision`,roles:I.ops,items:[],layout:[{widgetId:`supervision.health`,x:0,y:0,w:1,h:216,z:10},{widgetId:`runtime.mode`,x:0,y:228,w:.2917,h:208,z:2},{widgetId:`system.eventloop`,x:.2997,y:228,w:.2083,h:208,z:3},{widgetId:`system.cpu`,x:.516,y:228,w:.2292,h:208,z:4},{widgetId:`system.heap`,x:.7532,y:228,w:.2292,h:208,z:5},{widgetId:`supervision.correlation`,x:0,y:448,w:1,h:312,z:9},{widgetId:`orm.flow`,x:0,y:772,w:1,h:320,z:7},{widgetId:`supervision.gc`,x:0,y:1104,w:1,h:384,z:8}]},{id:`systeme`,label:`Système`,roles:I.devops,items:[{widgetId:`supervision.health`,span:12,h:6},{widgetId:`system.cpu`,span:4,h:4},{widgetId:`system.heap`,span:4,h:4},{widgetId:`system.eventloop`,span:4,h:4},{widgetId:`supervision.correlation`,span:6,h:5},{widgetId:`supervision.gc`,span:6,h:6},{widgetId:`system.info`,span:6,h:4},{widgetId:`runtime.mode`,span:6,h:4}]},{id:`config`,label:`Configuration`,roles:I.dev,items:[{widgetId:`runtime.mode`,span:6,h:4},{widgetId:`runtime.modes`,span:6,h:4},{widgetId:`runtime.vite`,span:4,h:4},{widgetId:`system.info`,span:8,h:4},{widgetId:`system.git`,span:6,h:3},{widgetId:`system.uptime`,span:6,h:3}]},{id:`logs`,label:`Logs`,roles:I.devops,items:[{widgetId:`logs.live`,span:12,h:7},{widgetId:`logs.backplane`,span:12,h:5},{widgetId:`supervision.alerts`,span:6,h:4},{widgetId:`realtime.channels`,span:6,h:4}]},{id:`memoire`,label:`Mémoire`,roles:I.devops,items:[{widgetId:`supervision.memory`,span:8,h:6},{widgetId:`supervision.handles`,span:4,h:6},{widgetId:`supervision.gc`,span:12,h:6},{widgetId:`system.heap`,span:6,h:4},{widgetId:`supervision.correlation`,span:6,h:5}]},{id:`erreurs`,label:`Erreurs`,roles:I.devops,items:[{widgetId:`supervision.errors`,span:6,h:5},{widgetId:`supervision.alerts`,span:6,h:5},{widgetId:`logs.live`,span:12,h:7}]},{id:`blank`,label:`Vierge`,items:[]}];function tt(e){return W.find(t=>t.id===e)?.roles}function nt(e,t){return F(tt(e),t)}var rt=`account`,G=new Map,it={runtime:I.devops,system:I.devops,realtime:I.devops,logs:I.devops,cluster:I.ops,orm:I.dev,ai:I.dev,security:I.admin};function at(e){G.set(e.id,e)}function ot(e){return G.get(e)}function st(e=[]){let t=[];for(let n of G.values())F(n.roles??it[n.category],e)&&t.push(n);return t.sort((e,t)=>e.title.localeCompare(t.title))}function K(e,t){return t<=0?e:Math.round(e/t)*t}function q(e,t,n){return Math.max(t,Math.min(n,e))}function ct(e){let t=[],n=0,r=0,i=0;for(let a of e){let e=q(a.w,.05,1);n>0&&n+e>1+1e-6&&(n=0,r+=i+12,i=0),t.push({id:a.id,x:n,y:r,w:e,h:a.h}),n+=e+$e,i=Math.max(i,a.h)}return t}var J=`nf.workspace.layouts.v3`,Y=`nf.workspace.active.v3`;function X(e){return q(Number.isFinite(e)?e:.33,Qe,1)}function Z(e){return Math.max(96,Number.isFinite(e)?Math.round(e):192)}function Q(e){if(e.layout&&e.layout.length)return{id:e.id,label:e.label,items:e.layout.map(lt)};let t=ct(e.items.map(e=>({id:e.widgetId,w:X((e.span??4)/12),h:Z((e.h??3)*64)})));return{id:e.id,label:e.label,items:t.map((e,t)=>({widgetId:e.id,x:e.x,y:e.y,w:e.w,h:e.h,z:t+1}))}}function lt(e){return{widgetId:e.widgetId,x:q(e.x,0,1),y:Math.max(0,Math.round(e.y)),w:X(e.w),h:Z(e.h),z:e.z}}function ut(e){let t=e;return!!t&&typeof t.widgetId==`string`&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.w==`number`&&typeof t.h==`number`&&typeof t.z==`number`}var dt=class{layouts={};activeId=rt;constructor(){u(this),this.load()}get active(){return this.layouts[this.activeId]??this.layouts.blank??{id:`blank`,label:`Vierge`,items:[]}}get layoutList(){return Object.values(this.layouts)}setActive(e){this.layouts[e]&&(this.activeId=e,this.persist())}hasWidget(e){return this.active.items.some(t=>t.widgetId===e)}topZ(e){return e.reduce((e,t)=>Math.max(e,t.z),0)}addWidget(e){let t=ot(e),n=this.layouts[this.activeId];if(!t||!n||n.items.some(t=>t.widgetId===e))return;let r=X((t.defaultSpan??4)/12),i=Z((t.defaultH??3)*64),a=n.items.reduce((e,t)=>Math.max(e,t.y+t.h),0);n.items.push({widgetId:e,x:0,y:n.items.length?a+8:0,w:r,h:i,z:this.topZ(n.items)+1}),this.persist()}removeWidget(e){let t=this.layouts[this.activeId];t&&(t.items=t.items.filter(t=>t.widgetId!==e),this.persist())}moveTo(e,t,n){let r=this.layouts[this.activeId]?.items.find(t=>t.widgetId===e);r&&(r.x=q(K(t,Ze),0,1-r.w),r.y=Math.max(0,K(n,8)),this.persist())}setSize(e,t,n){let r=this.layouts[this.activeId]?.items.find(t=>t.widgetId===e);r&&(r.w=X(K(t,Ze)),r.h=Z(K(n,8)),r.x=Math.min(r.x,1-r.w),this.persist())}bringToFront(e){let t=this.layouts[this.activeId]?.items,n=t?.find(t=>t.widgetId===e);if(!t||!n)return;let r=this.topZ(t);n.z!==r&&(n.z=r+1,this.persist())}tidy(){let e=this.layouts[this.activeId];if(!e||!e.items.length)return;let t=[...e.items].sort((e,t)=>e.y-t.y||e.x-t.x),n=t.map(e=>({id:e.widgetId,w:e.w,h:e.h})),r=new Map(ct(n).map(e=>[e.id,e]));t.forEach((e,t)=>{let n=r.get(e.widgetId);n&&(e.x=n.x,e.y=n.y,e.z=t+1)}),this.persist()}resetToPreset(){let e=W.find(e=>e.id===this.activeId);e&&(this.layouts[this.activeId]=Q(e),this.persist())}get templates(){return W.map(e=>({id:e.id,label:e.label}))}uniqueId(){let e=`ws_${Date.now().toString(36)}`;for(;this.layouts[e];)e+=`x`;return e}uniqueLabel(e){let t=new Set(Object.values(this.layouts).map(e=>e.label));if(!t.has(e))return e;let n=2;for(;t.has(`${e} ${n}`);)n++;return`${e} ${n}`}createWorkspace(e){let t=e?W.find(t=>t.id===e):null,n=this.uniqueId(),r=this.uniqueLabel(t?.label??`Bureau`),i=t?Q(t).items:[];return this.layouts[n]={id:n,label:r,items:i},this.activeId=n,this.persist(),n}renameWorkspace(e,t){let n=this.layouts[e],r=t.trim();n&&r&&(n.label=r,this.persist())}deleteWorkspace(e){Object.keys(this.layouts).length<=1||!this.layouts[e]||(delete this.layouts[e],this.activeId===e&&(this.activeId=Object.keys(this.layouts)[0]),this.persist())}moveWorkspace(e,t){if(!this.layouts[e]||e===t)return;let n=Object.keys(this.layouts).filter(t=>t!==e),r=t?n.indexOf(t):-1;if(t&&r<0)return;n.splice(r<0?n.length:r,0,e);let i={};for(let e of n)i[e]=this.layouts[e];this.layouts=i,this.persist()}duplicateWorkspace(e){let t=this.layouts[e];if(!t)return;let n=this.uniqueId();this.layouts[n]={id:n,label:this.uniqueLabel(`${t.label} (copie)`),items:t.items.map(e=>({...e}))},this.activeId=n,this.persist()}resetForIdentity(){try{typeof localStorage<`u`&&(localStorage.removeItem(J),localStorage.removeItem(Y))}catch{}this.activeId=rt,this.load()}load(){try{if(typeof localStorage<`u`){let e=localStorage.getItem(J);if(e){let t=JSON.parse(e);if(t&&typeof t==`object`){let e={};for(let[n,r]of Object.entries(t))r&&Array.isArray(r.items)&&(e[n]={id:n,label:r.label??n,items:r.items.filter(ut).map(lt)});if(Object.keys(e).length){this.layouts=e;let t=localStorage.getItem(Y);this.activeId=t&&e[t]?t:Object.keys(e)[0];return}}}}}catch{}let e={};for(let t of W)e[t.id]=Q(t);this.layouts=e,e[this.activeId]||(this.activeId=Object.keys(e)[0]??`account`)}persist(){try{if(typeof localStorage>`u`)return;localStorage.setItem(J,JSON.stringify(this.layouts)),localStorage.setItem(Y,this.activeId)}catch{}}};function ft(){return typeof window>`u`?`ws://127.0.0.1/nodefony/studio/api/realtime`:`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/nodefony/studio/api/realtime`}var pt=class{ui;auth;connection;chat;admin;profiler;notifications;workspace;api;kernel;realtime;browserLog;constructor(){this.ui=new He,this.workspace=new dt,this.kernel=c({name:`STUDIO`,connectOnBoot:!1,realtime:{url:ft(),autoReconnect:!0,reconnectDelay:800,reconnectDelayMax:4e3}});let e=this.kernel.get(`realtime`);if(!e)throw Error(`RootStore : le noyau client n'a pas composé de socket temps réel.`);this.realtime=e,this.browserLog=new t({moduleName:`studio`}),a(),Ee({syslog:this.browserLog}),n({syslog:this.browserLog,publisher:this.realtime}),this.notifications=new Xe(this.realtime),this.api=new fe({socket:this.realtime,socketEnabled:()=>this.ui.apiViaSocket,onUnauthorized:()=>{this.auth?.clearLocalSession()},onError:({method:e,status:t,message:n})=>{t!==401&&e!==`GET`&&this.notifications.notify(`error`,n,{title:`Erreur ${t}`,source:`api`,code:t})}});let r=new Ce(this.api);this.auth=new Me(r),this.connection=new Ne(this.realtime,ft()),this.chat=new Ue(this.realtime),this.admin=new Ge(this.api),this.profiler=new Ke(this.api),o(()=>this.auth.user?.id??null,e=>{this.kernel.setIdentity(e===null?null:{key:String(e)})}),this.kernel.on(`onIdentityChange`,(...e)=>{let[,t]=e;if(this.admin.reset(),t!==null){this.workspace.resetForIdentity();try{if(typeof localStorage<`u`){let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`studio.`)||n.startsWith(`nf.datagrid:`))&&e.push(n)}for(let t of e)localStorage.removeItem(t)}}catch{}}}),this.kernel.boot()}},mt=`__nfStudioStoreContext__`,ht=globalThis,gt=ht[mt]??(ht[mt]=(0,d.createContext)(null)),_t=gt.Provider;function $(){let e=(0,d.useContext)(gt);if(!e)throw Error(`useStore() called outside <StoreProvider>. Wrap your tree with StoreProvider.`);return e}var vt=()=>$().auth,yt=()=>$().ui,bt=()=>$().connection,xt=()=>$().chat,St=()=>$().admin,Ct=()=>$().profiler,wt=()=>$().notifications,Tt=()=>$().workspace;export{k as A,P as C,F as D,I as E,te as F,_ as M,v as N,j as O,h as P,M as S,Ae as T,Qe as _,bt as a,L as b,$ as c,pt as d,q as f,nt as g,at as h,xt as i,y as j,A as k,yt as l,st as m,St as n,wt as o,ot as p,vt as r,Ct as s,_t as t,Tt as u,et as v,N as w,z as x,R as y};