@objectstack/console 16.1.0 → 17.0.0-rc.1

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 (220) hide show
  1. package/CHANGELOG.md +1096 -0
  2. package/README.md +8 -3
  3. package/dist/.objectui-sha +1 -1
  4. package/dist/assets/AdapterProvider-DCL4oNgv.js +2 -0
  5. package/dist/assets/{AiPendingActionsPage-C-QNNI9k.js → AiPendingActionsPage-BvvDIWEC.js} +1 -1
  6. package/dist/assets/ApiConsolePage-Dvr5-g2X.js +1 -0
  7. package/dist/assets/{AppDocsIndex-B4Vi3Lmx.js → AppDocsIndex-Ohwtpos8.js} +1 -1
  8. package/dist/assets/{AppManagementPage-l7bxl-aE.js → AppManagementPage-DhsvWTeZ.js} +1 -1
  9. package/dist/assets/ApprovalsInboxPage-BfaGtcxV.js +1 -0
  10. package/dist/assets/AuditLogPage-D_09WrLX.js +1 -0
  11. package/dist/assets/ComponentNavView-C6J3w2IE.js +1 -0
  12. package/dist/assets/CreateViewDialog-R7kwDoaF.js +1 -0
  13. package/dist/assets/DashboardView-B-5HkqOl.js +1 -0
  14. package/dist/assets/{DeveloperHubPage-CnVzl2hV.js → DeveloperHubPage-p9oQnZuU.js} +1 -1
  15. package/dist/assets/{DocShell-D83T8iWF.js → DocShell-B8d7-ARz.js} +1 -1
  16. package/dist/assets/ExpressionProvider-BLhGrCBw.js +1 -0
  17. package/dist/assets/FlowRunsPage-DzZmtrDe.js +1 -0
  18. package/dist/assets/{IntegrationsPage-DI3vZb2A.js → IntegrationsPage-DzBKAEgn.js} +2 -2
  19. package/dist/assets/InterfaceListPage-C_M0U8ns.js +1 -0
  20. package/dist/assets/{ManagedByBadge-D8aPzQJc.js → ManagedByBadge-DWtOXcFq.js} +1 -1
  21. package/dist/assets/MarketplaceAccessDenied-C4Yrv4Q7.js +1 -0
  22. package/dist/assets/{MarketplaceInstalledPage-BdLyXA35.js → MarketplaceInstalledPage-B6cbDzf8.js} +1 -1
  23. package/dist/assets/MarketplacePackagePage-D0dT7D3x.js +4 -0
  24. package/dist/assets/MarketplacePage-CtvxvBmw.js +1 -0
  25. package/dist/assets/{MetadataInspector-CcRGESLn.js → MetadataInspector-9pMeoWpd.js} +1 -1
  26. package/dist/assets/{MetadataProvider-CjWp0ChY.js → MetadataProvider-Y0oNNDXh.js} +1 -1
  27. package/dist/assets/{MonacoImpl-_--K1JSa.js → MonacoImpl-DkEpEa5A.js} +1 -1
  28. package/dist/assets/ObjectDataPage-B8pGSNRJ.js +1 -0
  29. package/dist/assets/PageView-BBJl1RzL.js +1 -0
  30. package/dist/assets/ProfilePage-BL4aVTUO.js +1 -0
  31. package/dist/assets/{PublicFormsPage-BVEV96-N.js → PublicFormsPage-C-BWDI8O.js} +1 -1
  32. package/dist/assets/RecordDetailView-BYYpDJSj.js +9 -0
  33. package/dist/assets/RecordFormPage-SLtEal-m.js +1 -0
  34. package/dist/assets/ReportDefaultInspector-B3KEMC9M.js +3 -0
  35. package/dist/assets/ReportView-B3kMHgHe.js +2 -0
  36. package/dist/assets/{SearchResultsPage-CjSZ416m.js → SearchResultsPage-0eeyyaj-.js} +1 -1
  37. package/dist/assets/SettingsHub-BVhaidAC.js +1 -0
  38. package/dist/assets/SettingsView-D2klvVKS.js +1 -0
  39. package/dist/assets/{SystemHubPage-C5Widsf0.js → SystemHubPage-CHcrvd-n.js} +1 -1
  40. package/dist/assets/{abnfDiagram-VRR7QNED-BM2gIA2H.js → abnfDiagram-VRR7QNED-D2Rn6aHa.js} +1 -1
  41. package/dist/assets/{architectureDiagram-ZJ3FMSHR-wyeItulr.js → architectureDiagram-ZJ3FMSHR-DX6q2vGN.js} +1 -1
  42. package/dist/assets/{assistantBus-CbDb2Mju.js → assistantBus-BqJT7SGk.js} +1 -1
  43. package/dist/assets/blockDiagram-677ZJIJ3-T2IDNrvJ.js +132 -0
  44. package/dist/assets/{c4Diagram-LMCZKHZV-CZhtNS_4.js → c4Diagram-LMCZKHZV-B98pIIbx.js} +1 -1
  45. package/dist/assets/channel-BovwC1_7.js +1 -0
  46. package/dist/assets/{chunk-32BRIVSS-CjQ2uFsO.js → chunk-32BRIVSS-CYNomNWc.js} +1 -1
  47. package/dist/assets/{chunk-52WLFC77-BBx3j8yk.js → chunk-52WLFC77-DtGIB0uV.js} +2 -2
  48. package/dist/assets/{chunk-C7G6YPKG-CrZlt4pv.js → chunk-C7G6YPKG-yJXKQ2Sz.js} +1 -1
  49. package/dist/assets/{chunk-EX3LRPZG-x9nXH4xc.js → chunk-EX3LRPZG-BtAjfq6C.js} +1 -1
  50. package/dist/assets/{chunk-FWX5IMBZ-cqzp-iMz.js → chunk-FWX5IMBZ-C4k19ShS.js} +1 -1
  51. package/dist/assets/{chunk-HOUHSVGY-Bfkm0El3.js → chunk-HOUHSVGY-BuKclK6G.js} +1 -1
  52. package/dist/assets/chunk-ICXQ74PX-OP102czk.js +2 -0
  53. package/dist/assets/{chunk-MOJQB5TN-K_QM_tTs.js → chunk-MOJQB5TN-CToOzrGu.js} +1 -1
  54. package/dist/assets/{chunk-OGEWGWER-CSkoB3Mi.js → chunk-OGEWGWER-9rMC3Zdz.js} +1 -1
  55. package/dist/assets/{chunk-PUDLZKDR-BUt9iFAU.js → chunk-PUDLZKDR-Bte-Y5BM.js} +1 -1
  56. package/dist/assets/{chunk-Q4XR5HBZ-B99LraLe.js → chunk-Q4XR5HBZ-B1-bRF4T.js} +1 -1
  57. package/dist/assets/{chunk-RYQCIY6F-CdJb5y8u.js → chunk-RYQCIY6F-DX0uHAt-.js} +1 -1
  58. package/dist/assets/{chunk-V7JOEXUC-CzVnJgzj.js → chunk-V7JOEXUC-3Qai_qvf.js} +1 -1
  59. package/dist/assets/chunk-VAUOI2AC-B2LdZG5j.js +1 -0
  60. package/dist/assets/{chunk-VR4S4FIN-B2IyRlJ4.js → chunk-VR4S4FIN-C8tYB3zk.js} +1 -1
  61. package/dist/assets/{chunk-WYO6CB5R-C0_XZtpj.js → chunk-WYO6CB5R-chyhiVml.js} +1 -1
  62. package/dist/assets/chunk-XXDRQBXY-mZd7tFTQ.js +1 -0
  63. package/dist/assets/{chunk-ZGVPDNZ5-Bq7O6ELQ.js → chunk-ZGVPDNZ5-BHJQa9Yh.js} +1 -1
  64. package/dist/assets/classDiagram-OUVF2IWQ-opUQX7yT.js +1 -0
  65. package/dist/assets/classDiagram-v2-EOCWNBFH-opUQX7yT.js +1 -0
  66. package/dist/assets/{cose-bilkent-JH36ORCC-DqKYLwMN.js → cose-bilkent-JH36ORCC-wNn6_7gi.js} +1 -1
  67. package/dist/assets/{createDerive-DGOUbVlZ.js → createDerive-DDuw-xzg.js} +1 -1
  68. package/dist/assets/{cynefinDiagram-TSTJHNR4-CFApUIdk.js → cynefinDiagram-TSTJHNR4-BpiN-sI9.js} +1 -1
  69. package/dist/assets/{dagre-VKFMJZFB-D4HlgjaA.js → dagre-VKFMJZFB-D4jpVOw8.js} +1 -1
  70. package/dist/assets/data-adapter-DJl5PvjF.js +17 -0
  71. package/dist/assets/{diagram-FQU43EPY-BcnxfyH-.js → diagram-FQU43EPY-DnGyLgYE.js} +1 -1
  72. package/dist/assets/{diagram-G47NLZAW-CJxJUVu9.js → diagram-G47NLZAW-BSDChPeN.js} +1 -1
  73. package/dist/assets/{diagram-NH7WQ7WH-DmBVlyYR.js → diagram-NH7WQ7WH-Jir-M8yF.js} +1 -1
  74. package/dist/assets/{diagram-OA4YK3LP-CkaF9SQg.js → diagram-OA4YK3LP-DG1np1W1.js} +1 -1
  75. package/dist/assets/{diagram-WEI45ONY-8cpfjoG3.js → diagram-WEI45ONY-DRm_SlrH.js} +1 -1
  76. package/dist/assets/{dist-B4b49_J4.js → dist-Bq1W1ETM.js} +1 -1
  77. package/dist/assets/{ebnfDiagram-CCIWWBDH-kX04JbNj.js → ebnfDiagram-CCIWWBDH-twfLoKY3.js} +1 -1
  78. package/dist/assets/{erDiagram-Q63AITRT-GjnOtXoL.js → erDiagram-Q63AITRT-CABXVpgy.js} +1 -1
  79. package/dist/assets/flowDiagram-23GEKE2U-DxGbSmxA.js +1 -0
  80. package/dist/assets/framework-xOBpLspS.js +8 -0
  81. package/dist/assets/{ganttDiagram-NO4QXBWP-7HpPOGwX.js → ganttDiagram-NO4QXBWP-DRXGi_1T.js} +2 -2
  82. package/dist/assets/getIcon-yTDDbwhX.js +1 -0
  83. package/dist/assets/{gitGraphDiagram-IHSO6WYX-BgBKFUwZ.js → gitGraphDiagram-IHSO6WYX-BtlNUS9M.js} +1 -1
  84. package/dist/assets/{highlighted-body-OFNGDK62-CDb4f2Sa.js → highlighted-body-OFNGDK62-BNY8_Ou8.js} +1 -1
  85. package/dist/assets/i18n-CWXRbuYk.js +9 -0
  86. package/dist/assets/index-ByFHLPS0.js +2 -0
  87. package/dist/assets/index-QgmPkr95.css +2 -0
  88. package/dist/assets/{infoDiagram-FWYZ7A6U-CTsG_9Mj.js → infoDiagram-FWYZ7A6U-CrCNJ5GX.js} +1 -1
  89. package/dist/assets/infrastructure-EMqAhl6J.js +3 -0
  90. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DgMu6-jd.js → ishikawaDiagram-FXEZZL3T-aBCt2dnS.js} +1 -1
  91. package/dist/assets/{journeyDiagram-5HDEW3XC-CKI4PBJp.js → journeyDiagram-5HDEW3XC-CQrIuFhF.js} +1 -1
  92. package/dist/assets/{kanban-definition-HUTT4EX6-ChvGKWDx.js → kanban-definition-HUTT4EX6-Bm4snCw1.js} +1 -1
  93. package/dist/assets/maplibre-gl-Bee-HVIi.js +801 -0
  94. package/dist/assets/mermaid-GHXKKRXX-BN2PjcSK.js +1 -0
  95. package/dist/assets/{mermaid-parser.core-B2-C9kB8.js → mermaid-parser.core-BPoagdtX.js} +1 -1
  96. package/dist/assets/mermaid.core-C5ZaZqXX.js +10 -0
  97. package/dist/assets/metadata-admin-lW4yChcf.js +25 -0
  98. package/dist/assets/{mindmap-definition-LN4V7U3C-BSAiSefe.js → mindmap-definition-LN4V7U3C-CzSOJVqY.js} +1 -1
  99. package/dist/assets/{pegDiagram-2B236MQR-BUG9TR1Z.js → pegDiagram-2B236MQR-DPkw74l3.js} +1 -1
  100. package/dist/assets/{pieDiagram-ENE6RG2P-CqKv9PBi.js → pieDiagram-ENE6RG2P-Bnny8SeQ.js} +3 -3
  101. package/dist/assets/plugin-calendar-Dikj_A8Y.js +1 -0
  102. package/dist/assets/plugin-charts-_11K-vFF.js +7 -0
  103. package/dist/assets/plugin-chatbot-D5bVXJ_O.js +120 -0
  104. package/dist/assets/plugin-dashboard-QnlQx94Y.js +6 -0
  105. package/dist/assets/plugin-form-C8ibDrVW.js +1 -0
  106. package/dist/assets/plugin-gantt-ION4WU11.js +63 -0
  107. package/dist/assets/plugin-grid-BbCjdxhg.js +8 -0
  108. package/dist/assets/plugin-kanban-DMXe4mrr.js +1 -0
  109. package/dist/assets/{plugin-map-CsMXqW6n.css → plugin-map-CZaqx61F.css} +1 -1
  110. package/dist/assets/plugin-map-ZzwBPooc.js +1 -0
  111. package/dist/assets/{plugin-markdown-By5yxTCK.js → plugin-markdown-DWlAZYfS.js} +1 -1
  112. package/dist/assets/plugin-report-4ufmhN37.js +59 -0
  113. package/dist/assets/plugin-timeline-CxuwO6Sj.js +1 -0
  114. package/dist/assets/plugin-tree-CqFsNYBt.js +1 -0
  115. package/dist/assets/plugin-view-BtrrVg8d.js +1 -0
  116. package/dist/assets/plugins-views-DuVwtJw-.js +4 -0
  117. package/dist/assets/{quadrantDiagram-ABIIQ3AL-DyfgU6pe.js → quadrantDiagram-ABIIQ3AL-DUB4EjfP.js} +1 -1
  118. package/dist/assets/{railroadDiagram-RFXS5EU6-DOOVaoMM.js → railroadDiagram-RFXS5EU6-DSfLwOL9.js} +1 -1
  119. package/dist/assets/{requirementDiagram-TGXJPOKE-B0370dfa.js → requirementDiagram-TGXJPOKE-BUoxthLY.js} +1 -1
  120. package/dist/assets/{runtime-metadata-persistence-CEZY_PIp.js → runtime-metadata-persistence-D0qPKjRP.js} +1 -1
  121. package/dist/assets/{sankeyDiagram-HTMAVEWB-BAioZail.js → sankeyDiagram-HTMAVEWB-CkjIusFl.js} +2 -2
  122. package/dist/assets/{sequenceDiagram-DBY2YBRQ-B20vuf87.js → sequenceDiagram-DBY2YBRQ-DlUPbsBe.js} +1 -1
  123. package/dist/assets/{skeletons-D0Z3uPzj.js → skeletons-DBVC-R2R.js} +1 -1
  124. package/dist/assets/{src-YtGn_UVR.js → src-CEjEbVE_.js} +1 -1
  125. package/dist/assets/src-CLs1ObAx.js +19 -0
  126. package/dist/assets/{src-Cglm_8jd.js → src-CQ-hf48v.js} +2 -2
  127. package/dist/assets/src-Cz3xMnYk.js +1 -0
  128. package/dist/assets/{src-CKPhOIOh.js → src-DMTCYJgx.js} +1 -1
  129. package/dist/assets/{stateDiagram-2N3HPSRC-BScu2B9X.js → stateDiagram-2N3HPSRC-vPDzyRlO.js} +1 -1
  130. package/dist/assets/stateDiagram-v2-6OUMAXLB-USH3Z7UN.js +1 -0
  131. package/dist/assets/{swimlanes-5IMT3BWC-VepjEXMA.js → swimlanes-5IMT3BWC-mtpJqEnb.js} +1 -1
  132. package/dist/assets/swimlanesDiagram-G3AALYLV-CJNfyMoX.js +8 -0
  133. package/dist/assets/{timeline-definition-FHXFAJF6-CvpwpY5P.js → timeline-definition-FHXFAJF6-vFc3MiyA.js} +1 -1
  134. package/dist/assets/ui-components-C5rSjsFE.js +72 -0
  135. package/dist/assets/ui-layout-D13CmhwI.js +1 -0
  136. package/dist/assets/{use-book-data-CV2dCLgr.js → use-book-data-BJgo-RvZ.js} +1 -1
  137. package/dist/assets/{useOpenRecordList-BfKYZKMn.js → useOpenRecordList-DJ-uAshJ.js} +1 -1
  138. package/dist/assets/{usePackageL10n-DfeTyD2w.js → usePackageL10n-DM6mlODA.js} +1 -1
  139. package/dist/assets/useSettingsLabel-BJ1_MAmi.js +1 -0
  140. package/dist/assets/vendor-charts-BbCFozUm.js +67 -0
  141. package/dist/assets/{vendor-dndkit-DoG7p74h.js → vendor-dndkit-CJ2SkGrK.js} +1 -1
  142. package/dist/assets/{vendor-i18n-D2ce6sLS.js → vendor-i18n-ign3ofvT.js} +1 -1
  143. package/dist/assets/{vendor-icons-core-CO5pY7RP.js → vendor-icons-core-BuLgNLyS.js} +1 -1
  144. package/dist/assets/{vendor-markdown-DlkSIxwM.js → vendor-markdown-BgvCNR3X.js} +3 -3
  145. package/dist/assets/vendor-objectstack-ChpQDQzo.js +160 -0
  146. package/dist/assets/vendor-radix-DdNkQmkB.js +46 -0
  147. package/dist/assets/{vendor-react-BKSb6vFP.js → vendor-react-20ydC9aZ.js} +2 -2
  148. package/dist/assets/vendor-sentry-BwxF-feC.js +501 -0
  149. package/dist/assets/{vendor-ui-utils-D-WJ115h.js → vendor-ui-utils-CDPjN0GN.js} +1 -1
  150. package/dist/assets/{vennDiagram-L72KCM5P-DlCQcm_6.js → vennDiagram-L72KCM5P-NYy-CpuJ.js} +1 -1
  151. package/dist/assets/{wardleyDiagram-EHGQE667-mesER_Po.js → wardleyDiagram-EHGQE667-CB-LOOnu.js} +1 -1
  152. package/dist/assets/{xychartDiagram-FW5EYKEG-cODEcpNB.js → xychartDiagram-FW5EYKEG-C04Hz7Q2.js} +2 -2
  153. package/dist/index.html +6 -6
  154. package/package.json +3 -2
  155. package/dist/assets/AdapterProvider-CqW7TSvk.js +0 -1
  156. package/dist/assets/ApiConsolePage-DSvjQt5N.js +0 -1
  157. package/dist/assets/ApprovalsInboxPage-BV4PlaEv.js +0 -1
  158. package/dist/assets/AuditLogPage-ChJYd7GY.js +0 -1
  159. package/dist/assets/ComponentNavView-C4OkKu2y.js +0 -1
  160. package/dist/assets/CreateViewDialog-DwpQ8KvO.js +0 -1
  161. package/dist/assets/DashboardView-CuDS84Jp.js +0 -1
  162. package/dist/assets/ExpressionProvider-CyltvbX0.js +0 -1
  163. package/dist/assets/FlowRunsPage-BE8HeEGL.js +0 -1
  164. package/dist/assets/InterfaceListPage-BL7sW-SC.js +0 -1
  165. package/dist/assets/MarketplaceAccessDenied-B00hPOtj.js +0 -1
  166. package/dist/assets/MarketplacePackagePage-By15SZoJ.js +0 -4
  167. package/dist/assets/MarketplacePage-BKxIWeT_.js +0 -1
  168. package/dist/assets/ObjectDataPage-DiQJROyN.js +0 -1
  169. package/dist/assets/PageView-CJY74CxE.js +0 -1
  170. package/dist/assets/ProfilePage-CjxWQMQA.js +0 -1
  171. package/dist/assets/RecordDetailView-DpRJpP6t.js +0 -9
  172. package/dist/assets/RecordFormPage-BMs8Sa4p.js +0 -1
  173. package/dist/assets/ReportDefaultInspector-BpXXGsGu.js +0 -3
  174. package/dist/assets/ReportView-C0fP1MLd.js +0 -2
  175. package/dist/assets/SettingsHub-DhWm94wF.js +0 -1
  176. package/dist/assets/SettingsView-Dd0B_UlN.js +0 -1
  177. package/dist/assets/blockDiagram-677ZJIJ3-BybRqe6u.js +0 -132
  178. package/dist/assets/channel-BAx__6e1.js +0 -1
  179. package/dist/assets/chunk-ICXQ74PX-WsDRuBhL.js +0 -2
  180. package/dist/assets/chunk-VAUOI2AC-HYDQgaka.js +0 -1
  181. package/dist/assets/chunk-XXDRQBXY-CtU5D9C8.js +0 -1
  182. package/dist/assets/classDiagram-OUVF2IWQ-DiVkGMIZ.js +0 -1
  183. package/dist/assets/classDiagram-v2-EOCWNBFH-DiVkGMIZ.js +0 -1
  184. package/dist/assets/data-adapter-Dz0aiaG6.js +0 -9
  185. package/dist/assets/flowDiagram-23GEKE2U-CpcHvuan.js +0 -1
  186. package/dist/assets/framework-BqSgd3ir.js +0 -8
  187. package/dist/assets/getIcon-BZn0biL3.js +0 -1
  188. package/dist/assets/i18n-SjY5NweX.js +0 -9
  189. package/dist/assets/index-CgfL2xiq.js +0 -2
  190. package/dist/assets/index-De6xiiED.css +0 -2
  191. package/dist/assets/infrastructure-C6pQBkbt.js +0 -3
  192. package/dist/assets/maplibre-gl-R0DO2NBr.js +0 -748
  193. package/dist/assets/mermaid-GHXKKRXX-CWn_Hnds.js +0 -1
  194. package/dist/assets/mermaid.core-CskcjgHM.js +0 -10
  195. package/dist/assets/metadata-admin-BRw86sJ-.js +0 -25
  196. package/dist/assets/plugin-calendar-C4ZXapZt.js +0 -1
  197. package/dist/assets/plugin-charts-D5Lb0q0u.js +0 -7
  198. package/dist/assets/plugin-chatbot-dJq9DS4J.js +0 -120
  199. package/dist/assets/plugin-dashboard-Cr7jkjy7.js +0 -6
  200. package/dist/assets/plugin-form-D4kHsl47.js +0 -1
  201. package/dist/assets/plugin-gantt-8LuVErg3.js +0 -63
  202. package/dist/assets/plugin-grid-CDpGckvD.js +0 -8
  203. package/dist/assets/plugin-kanban-Xwny03DA.js +0 -1
  204. package/dist/assets/plugin-map-CVC4XDJz.js +0 -1
  205. package/dist/assets/plugin-report-DwvPiTGE.js +0 -59
  206. package/dist/assets/plugin-timeline-D2Sep4-I.js +0 -1
  207. package/dist/assets/plugin-tree-Doah8whm.js +0 -1
  208. package/dist/assets/plugin-view-DZXBuUS9.js +0 -1
  209. package/dist/assets/plugins-views-BGSw-KmQ.js +0 -4
  210. package/dist/assets/src-DPHY2JFl.js +0 -1
  211. package/dist/assets/src-RHOMTPFk.js +0 -19
  212. package/dist/assets/stateDiagram-v2-6OUMAXLB-9fyTUlZR.js +0 -1
  213. package/dist/assets/swimlanesDiagram-G3AALYLV-i6IYZT2a.js +0 -8
  214. package/dist/assets/types-BR_9hYa5.js +0 -1
  215. package/dist/assets/ui-components-Ci5ufF7g.js +0 -72
  216. package/dist/assets/ui-layout-D_8Fal4s.js +0 -1
  217. package/dist/assets/vendor-charts-HLBqza5P.js +0 -67
  218. package/dist/assets/vendor-objectstack-CjHQG7Oa.js +0 -114
  219. package/dist/assets/vendor-radix-B1fu-dZi.js +0 -46
  220. package/dist/assets/vendor-sentry-BFtl-K03.js +0 -501
@@ -1,7 +1,7 @@
1
- import{dn as e,ot as t,rt as n}from"./vendor-charts-HLBqza5P.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-CKPhOIOh.js";import{D as a,H as o,K as s,U as c,a as l,b as u,c as d,f,v as p,w as m,y as h,z as g}from"./chunk-WYO6CB5R-C0_XZtpj.js";import{t as _}from"./chunk-VAUOI2AC-HYDQgaka.js";import"./chunk-HOUHSVGY-Bfkm0El3.js";import{i as v}from"./chunk-ICXQ74PX-WsDRuBhL.js";import{t as y}from"./chunk-Q4XR5HBZ-B99LraLe.js";var b=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(t,n,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[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;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.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)+`:
1
+ import{Nt as e,it as t,st as n}from"./vendor-charts-BbCFozUm.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-DMTCYJgx.js";import{D as a,H as o,K as s,U as c,a as l,b as u,c as d,f,v as p,w as m,y as h,z as g}from"./chunk-WYO6CB5R-chyhiVml.js";import{t as _}from"./chunk-VAUOI2AC-B2LdZG5j.js";import"./chunk-HOUHSVGY-BuKclK6G.js";import{i as v}from"./chunk-ICXQ74PX-OP102czk.js";import{t as y}from"./chunk-Q4XR5HBZ-B1-bRF4T.js";var b=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(t,n,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[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;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.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
2
  `+h.showPosition()+`
3
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:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.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&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(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:r(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:r(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:r(function(){return this._more=!0,this},`more`),reject:r(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
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(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:r(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:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
5
  `+t+`^`},`showPosition`),test_match:r(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:r(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}else return!1}else 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:r(function(){return this.next()||this.lex()},`lex`),begin:r(function(e){this.conditionStack.push(e)},`begin`),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:r(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:r(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:r(function(e){this.begin(e)},`pushState`),stateStackSize:r(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:r(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return r(j,`Parser`),j.prototype=A,A.Parser=j,new j})();b.parser=b;var x=b;function S(e){return e.type===`bar`}r(S,`isBarPlot`);function C(e){return e.type===`band`}r(C,`isBandAxisData`);function w(e){return e.type===`linear`}r(w,`isLinearAxisData`);var T=class{constructor(e){this.parentGroup=e}static{r(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},E=.7,D=.2,O=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{r(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){E*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(E*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},k=class extends O{static{r(this,`BandAxis`)}constructor(e,n,r,i,a){super(e,i,a,n),this.categories=r,this.scale=t().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=t().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),i.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},A=class extends O{static{r(this,`LinearAxis`)}constructor(e,t,r,i,a){super(e,i,a,t),this.domain=r,this.scale=n().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=n().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function j(e,t,n,r){let i=new T(r);return C(e)?new k(t,n,e.categories,e.title,i):new A(t,n,[e.min,e.max],e.title,i)}r(j,`getAxis`);var M=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{r(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function N(e,t,n,r){return new M(new T(r),e,t,n)}r(N,`getChartTitleComponent`);var ee=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{r(this,`LinePlot`)}getDrawableElement(){let t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),n;if(n=this.orientation===`horizontal`?e().y(e=>e[0]).x(e=>e[1])(t):e().x(e=>e[0]).y(e=>e[1])(t),!n)return[];let r=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:n,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let e=[];for(let[n,[r,i]]of t.entries()){let t=this.plotData.pointLabels[n];t&&(this.orientation===`horizontal`?e.push({x:i+10,y:r,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):e.push({x:r,y:i-10,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}e.length>0&&r.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:e})}return r}},te=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{r(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ne=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{r(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new ee(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new te(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function re(e,t,n){return new ne(e,t,n)}r(re,`getPlotComponent`);var ie=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:N(e,t,n,r),plot:re(e,t,n),xAxis:j(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:j(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{r(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},ae=class{static{r(this,`XYChartBuilder`)}static build(e,t,n,r){return new ie(e,t,n,r).getDrawableElement()}},P=0,F,I=U(),L=H(),R=W(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1;function H(){let e=a(),t=u();return v(e.xyChart,t.themeVariables.xyChart)}r(H,`getChartDefaultThemeConfig`);function U(){let e=u();return v(f.xyChart,e.xyChart)}r(U,`getChartDefaultConfig`);function W(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}r(W,`getChartDefaultData`);function G(e){let t=u();return g(e.trim(),t)}r(G,`textSanitizer`);function K(e){F=e}r(K,`setTmpSVGG`);function q(e){e===`horizontal`?I.chartOrientation=`horizontal`:I.chartOrientation=`vertical`}r(q,`setOrientation`);function J(e){R.xAxis.title=G(e.text)}r(J,`setXAxisTitle`);function Y(e,t){R.xAxis={type:`linear`,title:R.xAxis.title,min:e,max:t},B=!0}r(Y,`setXAxisRangeData`);function X(e){R.xAxis={type:`band`,title:R.xAxis.title,categories:e.map(e=>G(e.text))},B=!0}r(X,`setXAxisBand`);function oe(e){R.yAxis.title=G(e.text)}r(oe,`setYAxisTitle`);function se(e,t){R.yAxis={type:`linear`,title:R.yAxis.title,min:e,max:t},V=!0}r(se,`setYAxisRangeData`);function ce(e){let t=Math.min(...e),n=Math.max(...e),r=w(R.yAxis)?R.yAxis.min:1/0,i=w(R.yAxis)?R.yAxis.max:-1/0;R.yAxis={type:`linear`,title:R.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}r(ce,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!B){let t=w(R.xAxis)?R.xAxis.min:1/0,n=w(R.xAxis)?R.xAxis.max:-1/0;Y(Math.min(t,1),Math.max(n,e.length))}if(C(R.xAxis)&&e.length>R.xAxis.categories.length&&(e=e.slice(0,R.xAxis.categories.length)),V||ce(e),C(R.xAxis)&&(t=R.xAxis.categories.map((t,n)=>[t,e[n]])),w(R.xAxis)){let n=R.xAxis.min,r=R.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}r(Z,`transformDataWithoutCategory`);function Q(e){return z[e===0?0:e%z.length]}r(Q,`getPlotColorFromPalette`);function le(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?G(e.label):``),i=Z(n),a=r.some(e=>e!==``);R.plots.push({type:`line`,strokeFill:Q(P),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),P++}r(le,`setLineData`);function $(e,t){let n=Z(t.map(e=>e.value));R.plots.push({type:`bar`,fill:Q(P),data:n}),P++}r($,`setBarData`);function ue(){if(R.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return R.title=m(),ae.build(I,R,L,F)}r(ue,`getDrawableElem`);function de(){return L}r(de,`getChartThemeConfig`);function fe(){return I}r(fe,`getChartConfig`);function pe(){return R}r(pe,`getXYChartData`);var me={parser:x,db:{getDrawableElem:ue,clear:r(function(){l(),P=0,I=U(),R=W(),L=H(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1},`clear`),setAccTitle:c,getAccTitle:h,setDiagramTitle:s,getDiagramTitle:m,getAccDescription:p,setAccDescription:o,setOrientation:q,setXAxisTitle:J,setXAxisRangeData:Y,setXAxisBand:X,setYAxisTitle:oe,setYAxisRangeData:se,setLineData:le,setBarData:$,setTmpSVGG:K,getChartThemeConfig:de,getChartConfig:fe,getXYChartData:pe},renderer:{draw:r((e,t,n,a)=>{let o=a.db,s=o.getChartThemeConfig(),c=o.getChartConfig(),l=o.getXYChartData().plots[0].data.map(e=>e[1]);function u(e){return e===`top`?`text-before-edge`:`middle`}r(u,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}r(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}r(p,`getTextTransformation`),i.debug(`Rendering xychart chart
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:r(function(){return this.next()||this.lex()},`lex`),begin:r(function(e){this.conditionStack.push(e)},`begin`),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:r(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:r(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:r(function(e){this.begin(e)},`pushState`),stateStackSize:r(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:r(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return r(j,`Parser`),j.prototype=A,A.Parser=j,new j})();b.parser=b;var x=b;function S(e){return e.type===`bar`}r(S,`isBarPlot`);function C(e){return e.type===`band`}r(C,`isBandAxisData`);function w(e){return e.type===`linear`}r(w,`isLinearAxisData`);var T=class{constructor(e){this.parentGroup=e}static{r(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},E=.7,D=.2,O=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{r(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){E*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(E*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},k=class extends O{static{r(this,`BandAxis`)}constructor(e,t,r,i,a){super(e,i,a,t),this.categories=r,this.scale=n().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=n().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),i.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},A=class extends O{static{r(this,`LinearAxis`)}constructor(e,n,r,i,a){super(e,i,a,n),this.domain=r,this.scale=t().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=t().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function j(e,t,n,r){let i=new T(r);return C(e)?new k(t,n,e.categories,e.title,i):new A(t,n,[e.min,e.max],e.title,i)}r(j,`getAxis`);var M=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{r(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function N(e,t,n,r){return new M(new T(r),e,t,n)}r(N,`getChartTitleComponent`);var ee=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{r(this,`LinePlot`)}getDrawableElement(){let t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),n;if(n=this.orientation===`horizontal`?e().y(e=>e[0]).x(e=>e[1])(t):e().x(e=>e[0]).y(e=>e[1])(t),!n)return[];let r=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:n,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let e=[];for(let[n,[r,i]]of t.entries()){let t=this.plotData.pointLabels[n];t&&(this.orientation===`horizontal`?e.push({x:i+10,y:r,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):e.push({x:r,y:i-10,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}e.length>0&&r.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:e})}return r}},te=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{r(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ne=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{r(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new ee(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new te(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function re(e,t,n){return new ne(e,t,n)}r(re,`getPlotComponent`);var ie=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:N(e,t,n,r),plot:re(e,t,n),xAxis:j(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:j(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{r(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},ae=class{static{r(this,`XYChartBuilder`)}static build(e,t,n,r){return new ie(e,t,n,r).getDrawableElement()}},P=0,F,I=U(),L=H(),R=W(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1;function H(){let e=a(),t=u();return v(e.xyChart,t.themeVariables.xyChart)}r(H,`getChartDefaultThemeConfig`);function U(){let e=u();return v(f.xyChart,e.xyChart)}r(U,`getChartDefaultConfig`);function W(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}r(W,`getChartDefaultData`);function G(e){let t=u();return g(e.trim(),t)}r(G,`textSanitizer`);function K(e){F=e}r(K,`setTmpSVGG`);function q(e){e===`horizontal`?I.chartOrientation=`horizontal`:I.chartOrientation=`vertical`}r(q,`setOrientation`);function J(e){R.xAxis.title=G(e.text)}r(J,`setXAxisTitle`);function Y(e,t){R.xAxis={type:`linear`,title:R.xAxis.title,min:e,max:t},B=!0}r(Y,`setXAxisRangeData`);function X(e){R.xAxis={type:`band`,title:R.xAxis.title,categories:e.map(e=>G(e.text))},B=!0}r(X,`setXAxisBand`);function oe(e){R.yAxis.title=G(e.text)}r(oe,`setYAxisTitle`);function se(e,t){R.yAxis={type:`linear`,title:R.yAxis.title,min:e,max:t},V=!0}r(se,`setYAxisRangeData`);function ce(e){let t=Math.min(...e),n=Math.max(...e),r=w(R.yAxis)?R.yAxis.min:1/0,i=w(R.yAxis)?R.yAxis.max:-1/0;R.yAxis={type:`linear`,title:R.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}r(ce,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!B){let t=w(R.xAxis)?R.xAxis.min:1/0,n=w(R.xAxis)?R.xAxis.max:-1/0;Y(Math.min(t,1),Math.max(n,e.length))}if(C(R.xAxis)&&e.length>R.xAxis.categories.length&&(e=e.slice(0,R.xAxis.categories.length)),V||ce(e),C(R.xAxis)&&(t=R.xAxis.categories.map((t,n)=>[t,e[n]])),w(R.xAxis)){let n=R.xAxis.min,r=R.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}r(Z,`transformDataWithoutCategory`);function Q(e){return z[e===0?0:e%z.length]}r(Q,`getPlotColorFromPalette`);function le(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?G(e.label):``),i=Z(n),a=r.some(e=>e!==``);R.plots.push({type:`line`,strokeFill:Q(P),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),P++}r(le,`setLineData`);function $(e,t){let n=Z(t.map(e=>e.value));R.plots.push({type:`bar`,fill:Q(P),data:n}),P++}r($,`setBarData`);function ue(){if(R.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return R.title=m(),ae.build(I,R,L,F)}r(ue,`getDrawableElem`);function de(){return L}r(de,`getChartThemeConfig`);function fe(){return I}r(fe,`getChartConfig`);function pe(){return R}r(pe,`getXYChartData`);var me={parser:x,db:{getDrawableElem:ue,clear:r(function(){l(),P=0,I=U(),R=W(),L=H(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1},`clear`),setAccTitle:c,getAccTitle:h,setDiagramTitle:s,getDiagramTitle:m,getAccDescription:p,setAccDescription:o,setOrientation:q,setXAxisTitle:J,setXAxisRangeData:Y,setXAxisBand:X,setYAxisTitle:oe,setYAxisRangeData:se,setLineData:le,setBarData:$,setTmpSVGG:K,getChartThemeConfig:de,getChartConfig:fe,getXYChartData:pe},renderer:{draw:r((e,t,n,a)=>{let o=a.db,s=o.getChartThemeConfig(),c=o.getChartConfig(),l=o.getXYChartData().plots[0].data.map(e=>e[1]);function u(e){return e===`top`?`text-before-edge`:`middle`}r(u,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}r(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}r(p,`getTextTransformation`),i.debug(`Rendering xychart chart
7
7
  `+e);let m=_(t),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,c.width).attr(`height`,c.height).attr(`class`,`background`);d(m,c.height,c.width,!0),m.attr(`viewBox`,`0 0 ${c.width} ${c.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let v=o.getDrawableElem(),y={};function b(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&y[n]&&(i=y[n]),n+=e[r],t=y[n],t||=y[n]=i.append(`g`).attr(`class`,e[r])}return t}r(b,`getGroup`);for(let e of v){if(e.data.length===0)continue;let t=b(e.groupTexts);switch(e.type){case`rect`:if(t.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),c.showDataLabel){let n=c.showDataLabelOutsideBar;if(c.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};r(i,`fitsHorizontally`);let a=.7,o=10,c=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),u=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...u)),f=r(e=>n?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);t.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,n?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};r(i,`fitsInBar`);let a=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),u=r(e=>n?e.data.y-10:e.data.y+10,`determineLabelYPosition`);t.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,u).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,n?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:t.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>u(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:t.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth);break}}},`draw`)}};export{me as diagram};
package/dist/index.html CHANGED
@@ -46,14 +46,14 @@
46
46
  <script>
47
47
  window.process = window.process || { env: { NODE_ENV: 'development' }, version: '', platform: 'browser' };
48
48
  </script>
49
- <script type="module" crossorigin src="./assets/index-CgfL2xiq.js"></script>
49
+ <script type="module" crossorigin src="./assets/index-ByFHLPS0.js"></script>
50
50
  <link rel="stylesheet" crossorigin href="./assets/ui-components-BL3SEdAz.css">
51
51
  <link rel="stylesheet" crossorigin href="./assets/plugin-dashboard-DnNKJB60.css">
52
- <link rel="stylesheet" crossorigin href="./assets/index-De6xiiED.css">
53
- <link rel="modulepreload" href="./assets/framework-BqSgd3ir.js" />
54
- <link rel="modulepreload" href="./assets/ui-components-Ci5ufF7g.js" />
55
- <link rel="modulepreload" href="./assets/vendor-radix-B1fu-dZi.js" />
56
- <link rel="modulepreload" href="./assets/vendor-react-BKSb6vFP.js" />
52
+ <link rel="stylesheet" crossorigin href="./assets/index-QgmPkr95.css">
53
+ <link rel="modulepreload" href="./assets/framework-xOBpLspS.js" />
54
+ <link rel="modulepreload" href="./assets/ui-components-C5rSjsFE.js" />
55
+ <link rel="modulepreload" href="./assets/vendor-radix-DdNkQmkB.js" />
56
+ <link rel="modulepreload" href="./assets/vendor-react-20ydC9aZ.js" />
57
57
  </head>
58
58
  <body>
59
59
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/console",
3
- "version": "16.1.0",
3
+ "version": "17.0.0-rc.1",
4
4
  "description": "Prebuilt Console SPA pinned to this @objectstack/framework release. Source of truth: @object-ui/console (https://github.com/objectstack-ai/objectui).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/objectstack-ai/objectstack/tree/main/packages/console",
@@ -17,7 +17,8 @@
17
17
  },
18
18
  "files": [
19
19
  "dist",
20
- "README.md"
20
+ "README.md",
21
+ "CHANGELOG.md"
21
22
  ],
22
23
  "exports": {
23
24
  "./package.json": "./package.json"
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{h as r}from"./infrastructure-C6pQBkbt.js";import{k as i}from"./framework-BqSgd3ir.js";import{t as a}from"./data-adapter-Dz0aiaG6.js";var o=e(n(),1),s=0,c=new Set,l=[];function u(){for(let e of c)try{e(s)}catch{}if(s===0&&l.length>0){let e=l;l=[];for(let t of e)try{t()}catch{}}}function d(){s+=1,u()}function f(){s=Math.max(0,s-1),u()}function p(){return s}function m(){return s===0}function h(e){return c.add(e),()=>{c.delete(e)}}function g(e=1e4){return s===0?Promise.resolve():new Promise(t=>{let n=!1,r=()=>{n||(n=!0,t())};l.push(r),e>0&&typeof setTimeout<`u`&&setTimeout(r,e)})}function _(e){return(async(...t)=>{d();try{return await e(...t)}finally{f()}})}function v(){if(typeof window>`u`)return;let e=window,t=e.__objectui??={};Object.defineProperty(t,"pendingRequests",{get:p,configurable:!0}),Object.defineProperty(t,"idle",{get:m,configurable:!0}),t.whenIdle=g,t.subscribe=h}var y=t();function b({children:e,adapter:t}){let[n,s]=(0,o.useState)(t??null);return(0,o.useEffect)(()=>{if(t){s(t);return}let e=!1;v();async function n(){try{let t=new a({baseUrl:``,fetch:_(r()),autoReconnect:!0,maxReconnectAttempts:5,reconnectDelay:1e3,cache:{maxSize:50,ttl:3e5}});await t.connect(),e||s(t)}catch(t){e||console.error(`[Console] Failed to initialize:`,t)}}return n(),()=>{e=!0}},[t]),(0,y.jsx)(i.Provider,{value:n,children:e})}export{_ as n,b as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{j as r,m as i}from"./framework-BqSgd3ir.js";import{Fr as a,Ii as o,Ks as s,To as c,Ws as l,Yi as u,aa as d,bs as f,ei as p,fr as m,fs as h,ir as g,nr as _,qa as v,qs as y,ra as b,rr as ee}from"./ui-components-Ci5ufF7g.js";import"./src-RHOMTPFk.js";var x=e(n(),1),S=[`plugin`,`plugins`,`kind`,`package`];function C(e){return[{method:`POST`,path:`${e}/sign-in/email`,desc:`Sign in (email)`,group:`Auth`,bodyTemplate:{email:`user@example.com`,password:``}},{method:`POST`,path:`${e}/sign-up/email`,desc:`Sign up (email)`,group:`Auth`,bodyTemplate:{email:``,password:``,name:``}},{method:`POST`,path:`${e}/sign-out`,desc:`Sign out`,group:`Auth`},{method:`GET`,path:`${e}/get-session`,desc:`Get session`,group:`Auth`}]}var w={ai:{group:`AI`,defaultRoute:`/api/v1/ai`,endpoints:[{method:`POST`,path:`/chat`,desc:`Chat completion`,bodyTemplate:{messages:[{role:`user`,content:``}]}},{method:`POST`,path:`/chat/stream`,desc:`Streaming chat (SSE)`,bodyTemplate:{messages:[{role:`user`,content:``}]}},{method:`POST`,path:`/complete`,desc:`Text completion`,bodyTemplate:{prompt:``}},{method:`GET`,path:`/models`,desc:`List available models`},{method:`POST`,path:`/nlq`,desc:`Natural language query`,bodyTemplate:{query:``}},{method:`POST`,path:`/suggest`,desc:`AI-powered suggestions`,bodyTemplate:{object:``,field:``,context:{}}},{method:`POST`,path:`/insights`,desc:`AI-generated insights`,bodyTemplate:{object:``,recordIds:[]}},{method:`POST`,path:`/conversations`,desc:`Create conversation`,bodyTemplate:{}},{method:`GET`,path:`/conversations`,desc:`List conversations`},{method:`POST`,path:`/conversations/:id/messages`,desc:`Add message to conversation`,bodyTemplate:{role:`user`,content:``}},{method:`DELETE`,path:`/conversations/:id`,desc:`Delete conversation`}]},workflow:{group:`Workflow`,defaultRoute:`/api/v1/workflow`,endpoints:[{method:`GET`,path:`/:object/config`,desc:`Get workflow configuration`},{method:`GET`,path:`/:object/:recordId/state`,desc:`Get workflow state`},{method:`POST`,path:`/:object/:recordId/transition`,desc:`Execute workflow transition`,bodyTemplate:{targetState:``}},{method:`POST`,path:`/:object/:recordId/approve`,desc:`Approve workflow step`,bodyTemplate:{comment:``}},{method:`POST`,path:`/:object/:recordId/reject`,desc:`Reject workflow step`,bodyTemplate:{comment:``}}]},realtime:{group:`Realtime`,defaultRoute:`/api/v1/realtime`,endpoints:[{method:`POST`,path:`/connect`,desc:`Establish realtime connection`,bodyTemplate:{transport:`websocket`}},{method:`POST`,path:`/disconnect`,desc:`Close realtime connection`,bodyTemplate:{connectionId:``}},{method:`POST`,path:`/subscribe`,desc:`Subscribe to channel`,bodyTemplate:{channel:``}},{method:`POST`,path:`/unsubscribe`,desc:`Unsubscribe from channel`,bodyTemplate:{channel:``}},{method:`PUT`,path:`/presence/:channel`,desc:`Set presence state`,bodyTemplate:{status:`online`}},{method:`GET`,path:`/presence/:channel`,desc:`Get channel presence`}]},notification:{group:`Notifications`,defaultRoute:`/api/v1/notifications`,endpoints:[{method:`GET`,path:``,desc:`List notifications`},{method:`POST`,path:`/devices`,desc:`Register device for push`,bodyTemplate:{token:``,platform:`web`}},{method:`DELETE`,path:`/devices/:deviceId`,desc:`Unregister device`},{method:`GET`,path:`/preferences`,desc:`Get notification preferences`},{method:`PATCH`,path:`/preferences`,desc:`Update notification preferences`,bodyTemplate:{email:!0,push:!0}},{method:`POST`,path:`/read`,desc:`Mark notifications as read`,bodyTemplate:{ids:[]}},{method:`POST`,path:`/read/all`,desc:`Mark all as read`}]},analytics:{group:`Analytics`,defaultRoute:`/api/v1/analytics`,endpoints:[{method:`POST`,path:`/query`,desc:`Execute analytics query`,bodyTemplate:{measures:[],dimensions:[]}},{method:`GET`,path:`/meta`,desc:`Get analytics metadata`}]},automation:{group:`Automation`,defaultRoute:`/api/v1/automation`,endpoints:[{method:`POST`,path:`/trigger`,desc:`Trigger automation`,bodyTemplate:{name:``,params:{}}}]},i18n:{group:`i18n`,defaultRoute:`/api/v1/i18n`,endpoints:[{method:`GET`,path:`/locales`,desc:`Get available locales`},{method:`GET`,path:`/translations/:locale`,desc:`Get translations for locale`},{method:`GET`,path:`/labels/:object/:locale`,desc:`Get translated field labels`}]},ui:{group:`UI`,defaultRoute:`/api/v1/ui`,endpoints:[{method:`GET`,path:`/views`,desc:`List views`},{method:`GET`,path:`/views/:id`,desc:`Get view by ID`},{method:`POST`,path:`/views`,desc:`Create view`,bodyTemplate:{name:``,object:``,type:`list`}},{method:`PATCH`,path:`/views/:id`,desc:`Update view`,bodyTemplate:{name:``}},{method:`DELETE`,path:`/views/:id`,desc:`Delete view`}]},feed:{group:`Feed`,defaultRoute:`/api/v1/feed`,endpoints:[{method:`GET`,path:`/:object/:recordId`,desc:`Get feed items`},{method:`POST`,path:`/:object/:recordId`,desc:`Post feed item`,bodyTemplate:{body:``}}]},storage:{group:`Storage`,defaultRoute:`/api/v1/storage`,endpoints:[{method:`POST`,path:`/upload`,desc:`Upload file (multipart/form-data)`},{method:`GET`,path:`/:fileId`,desc:`Download file`},{method:`DELETE`,path:`/:fileId`,desc:`Delete file`}]}};function T(e,t){let n=w[e];return n?n.endpoints.map(e=>({method:e.method,path:`${t}${e.path}`,desc:e.desc,group:n.group,...e.bodyTemplate?{bodyTemplate:e.bodyTemplate}:{}})):[]}function te(){let e=r(),[t,n]=(0,x.useState)([]),[a,o]=(0,x.useState)([]),[s,c]=(0,x.useState)(!0),[l,u]=(0,x.useState)(null),d=(0,x.useCallback)(async()=>{c(!0),u(null);let t=`/api/v1`,r=`${t}/discovery`,a=[{method:`GET`,path:r,desc:`API Discovery`,group:`System`},{method:`GET`,path:`${t}/meta/types`,desc:`List metadata types`,group:`Metadata`},{method:`GET`,path:`${t}/packages`,desc:`List packages`,group:`System`},{method:`GET`,path:`/api/v1/health`,desc:`Health check`,group:`System`}];try{let s=`/api/v1/auth`,c={},l={};try{let e=await fetch(r);if(e.ok){let t=await e.json(),n=t?.data??t;l=n?.routes??{},c=n?.services??{},l.auth&&(s=l.auth)}}catch{}let u=[];for(let[e,t]of Object.entries(w)){let n=c[e],r=n?i(n):!1,a=n?.route??l[e]??t.defaultRoute;r&&u.push(...T(e,a))}let d=e?.getClient?.(),f=[];try{let e=await d?.meta?.getTypes?.();e&&Array.isArray(e.types)?f=e.types:Array.isArray(e)&&(f=e)}catch{}let p=[];try{let e=f.includes(`object`)?`object`:null;if(e&&d?.meta?.getItems){let t=await d.meta.getItems(e),n=[];Array.isArray(t)?n=t:t&&Array.isArray(t.items)?n=t.items:t&&Array.isArray(t.value)&&(n=t.value),p=n.map(e=>e.name||e.id).filter(Boolean)}}catch{}let m=p.flatMap(e=>{let n=e.startsWith(`sys_`)?`Data: system tables`:`Data: ${e}`;return[{method:`GET`,path:`${t}/data/${e}`,desc:`List ${e}`,group:n},{method:`POST`,path:`${t}/data/${e}`,desc:`Create ${e}`,group:n,bodyTemplate:{name:`example`}},{method:`GET`,path:`${t}/data/${e}/:id`,desc:`Get ${e} by ID`,group:n},{method:`PATCH`,path:`${t}/data/${e}/:id`,desc:`Update ${e}`,group:n,bodyTemplate:{name:`updated`}},{method:`DELETE`,path:`${t}/data/${e}/:id`,desc:`Delete ${e}`,group:n}]}),h=f.filter(e=>!S.includes(e)).map(e=>({method:`GET`,path:`${t}/meta/${e}`,desc:`List ${e} metadata`,group:`Metadata`})),g=p.map(e=>({method:`GET`,path:`${t}/meta/object/${e}`,desc:`${e} schema`,group:`Metadata`})),_=[...a,...C(s),...u,...h,...g,...m],v=new Map;for(let e of _){let t=v.get(e.group)||[];t.push(e),v.set(e.group,t)}let y=[`System`,`Auth`,`AI`,`Workflow`,`Realtime`,`Notifications`,`Analytics`,`Automation`,`i18n`,`UI`,`Feed`,`Storage`,`Metadata`],b=Array.from(v.entries()).sort(([e],[t])=>{let n=y.indexOf(e),r=y.indexOf(t);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.localeCompare(t):1:-1}).map(([e,t])=>({key:e,label:e,endpoints:t}));n(b),o(_)}catch(e){u(e.message||`Failed to discover APIs`)}finally{c(!1)}},[e]);return(0,x.useEffect)(()=>{d()},[d]),{groups:t,allEndpoints:a,loading:s,error:l,refresh:d}}var E=t(),D={GET:`text-emerald-600 bg-emerald-50 border-emerald-200 dark:text-emerald-400 dark:bg-emerald-950/50`,POST:`text-blue-600 bg-blue-50 border-blue-200 dark:text-blue-400 dark:bg-blue-950/50`,PATCH:`text-amber-600 bg-amber-50 border-amber-200 dark:text-amber-400 dark:bg-amber-950/50`,PUT:`text-amber-600 bg-amber-50 border-amber-200 dark:text-amber-400 dark:bg-amber-950/50`,DELETE:`text-red-600 bg-red-50 border-red-200 dark:text-red-400 dark:bg-red-950/50`},ne={2:`text-emerald-600 dark:text-emerald-400`,3:`text-blue-600 dark:text-blue-400`,4:`text-amber-600 dark:text-amber-400`,5:`text-red-600 dark:text-red-400`},re=[{key:`$top`,placeholder:`10`,hint:`limit`},{key:`$skip`,placeholder:`0`,hint:`offset`},{key:`$sort`,placeholder:`name`,hint:`sort field`},{key:`$select`,placeholder:`name,email`,hint:`fields`},{key:`$count`,placeholder:`true`,hint:`total count`},{key:`$filter`,placeholder:`status eq 'active'`,hint:`OData filter`}],O=1;function k(){let e=r()?.getClient?.(),{groups:t,loading:n,refresh:i}=te(),[S,C]=(0,x.useState)(``),[w,T]=(0,x.useState)(new Set),[k,A]=(0,x.useState)(null),[ie,j]=(0,x.useState)(``),[ae,M]=(0,x.useState)(``),[N,P]=(0,x.useState)(``),[F,I]=(0,x.useState)([]),[L,R]=(0,x.useState)(!1),[z,B]=(0,x.useState)(null),[V,H]=(0,x.useState)([]),[U,oe]=(0,x.useState)(null),[W,G]=(0,x.useState)(!1),K=(0,x.useMemo)(()=>{if(!S)return t;let e=S.toLowerCase();return t.map(t=>({...t,endpoints:t.endpoints.filter(t=>t.desc.toLowerCase().includes(e)||t.path.toLowerCase().includes(e)||t.method.toLowerCase().includes(e))})).filter(e=>e.endpoints.length>0)},[t,S]),se=(0,x.useCallback)(e=>{T(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ce=(0,x.useCallback)(e=>{A(e),j(e.method),M(e.path),P(e.bodyTemplate?JSON.stringify(e.bodyTemplate,null,2):``),I([]),B(null)},[]),q=ie||k?.method||`GET`,J=ae||k?.path||``,Y=(0,x.useMemo)(()=>{let e=F.filter(e=>e.enabled&&e.key.trim());if(e.length===0)return J;let t=e.map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join(`&`);return`${J}?${t}`},[J,F]),X=(0,x.useCallback)((e=``,t=``)=>{I(n=>[...n,{id:O++,key:e,value:t,enabled:!0}])},[]),le=(0,x.useCallback)(e=>{I(t=>t.filter(t=>t.id!==e))},[]),Z=(0,x.useCallback)((e,t,n)=>{I(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))},[]),ue=(0,x.useCallback)(e=>{I(t=>t.map(t=>t.id===e?{...t,enabled:!t.enabled}:t))},[]),Q=(0,x.useCallback)(async()=>{if(L||!Y)return;let t=`${e?.baseUrl??``}${Y}`;R(!0);let n=performance.now();try{let e={method:q,headers:{"Content-Type":`application/json`}};[`POST`,`PATCH`,`PUT`].includes(q)&&N.trim()&&(e.body=N);let r=await fetch(t,e),i=Math.round(performance.now()-n),a;if((r.headers.get(`content-type`)??``).includes(`json`)){let e=await r.json();a=JSON.stringify(e,null,2)}else a=await r.text();let o={status:r.status,body:a,duration:i};B(o),H(e=>[{id:Date.now(),method:q,url:Y,body:N||void 0,status:r.status,duration:i,response:a,timestamp:new Date},...e].slice(0,50))}catch(e){let t=Math.round(performance.now()-n);B({status:0,body:`Network Error: ${e.message}`,duration:t})}finally{R(!1)}},[e,Y,q,N,L]),de=(0,x.useCallback)(e=>{j(e.method);let[t,n]=e.url.split(`?`);if(M(t),P(e.body||``),n){let e=new URLSearchParams(n),t=[];e.forEach((e,n)=>{t.push({id:O++,key:n,value:e,enabled:!0})}),I(t)}else I([]);B(null),A(null)},[]),fe=(0,x.useCallback)(()=>{z?.body&&(navigator.clipboard.writeText(z.body),G(!0),setTimeout(()=>G(!1),1500))},[z]),$=e=>ne[String(e)[0]]??`text-muted-foreground`;return(0,E.jsxs)(`div`,{className:`flex flex-1 min-h-0 overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`w-72 shrink-0 border-r flex flex-col overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`p-3 border-b space-y-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`h3`,{className:`text-sm font-semibold text-foreground flex-1`,children:`API Endpoints`}),(0,E.jsx)(`button`,{onClick:i,disabled:n,className:`p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground`,title:`Refresh endpoints`,children:(0,E.jsx)(u,{className:`h-3.5 w-3.5 ${n?`animate-spin`:``}`})})]}),(0,E.jsxs)(`div`,{className:`relative`,children:[(0,E.jsx)(o,{className:`absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,E.jsx)(`input`,{type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:`Search endpoints...`,className:`w-full rounded-md border bg-background pl-8 pr-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring`})]})]}),(0,E.jsx)(`div`,{className:`flex-1 overflow-auto p-2 space-y-1`,children:n?(0,E.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,E.jsx)(v,{className:`h-4 w-4 animate-spin mr-2`}),`Discovering APIs...`]}):K.length===0?(0,E.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,E.jsx)(c,{className:`h-6 w-6 opacity-30 mb-2`}),(0,E.jsx)(`span`,{children:S?`No matching endpoints`:`No endpoints found`})]}):K.map(e=>{let t=w.has(e.key)||!!S;return(0,E.jsxs)(_,{open:t,onOpenChange:()=>se(e.key),children:[(0,E.jsx)(g,{asChild:!0,children:(0,E.jsxs)(`button`,{className:`w-full flex items-center gap-1.5 px-2 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground transition-colors`,children:[(0,E.jsx)(l,{className:`h-3 w-3 shrink-0 transition-transform duration-200 ${t?`rotate-90`:``}`}),(0,E.jsx)(`span`,{className:`flex-1 text-left truncate`,children:e.label}),(0,E.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums opacity-60`,children:e.endpoints.length})]})}),(0,E.jsx)(ee,{children:(0,E.jsx)(`div`,{className:`ml-3 space-y-0.5 mt-0.5`,children:e.endpoints.map((e,t)=>(0,E.jsxs)(`button`,{onClick:()=>ce(e),className:`w-full text-left flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors ${k===e?`bg-accent text-accent-foreground`:`hover:bg-muted/50 text-muted-foreground hover:text-foreground`}`,children:[(0,E.jsx)(m,{variant:`outline`,className:`font-mono text-[9px] shrink-0 px-1 py-0 ${D[e.method]||``}`,children:e.method}),(0,E.jsx)(`span`,{className:`truncate`,children:e.desc})]},`${e.method}-${e.path}-${t}`))})})]},e.key)})}),(0,E.jsxs)(`div`,{className:`p-3 border-t space-y-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,E.jsx)(`h4`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:`Query Parameters`}),(0,E.jsxs)(`button`,{onClick:()=>X(),className:`inline-flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,E.jsx)(b,{className:`h-3 w-3`}),`Add`]})]}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:re.map(e=>(0,E.jsx)(`button`,{onClick:()=>X(e.key,``),className:`text-[10px] px-1.5 py-0.5 rounded border bg-muted/30 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors font-mono`,title:e.hint,children:e.key},e.key))}),F.length>0&&(0,E.jsx)(`div`,{className:`space-y-1`,children:F.map(e=>(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:()=>ue(e.id),className:`h-3 w-3 shrink-0 rounded border accent-primary`}),(0,E.jsx)(`input`,{type:`text`,value:e.key,onChange:t=>Z(e.id,`key`,t.target.value),placeholder:`key`,className:`flex-1 min-w-0 rounded border bg-background px-1.5 py-0.5 text-[10px] font-mono focus:outline-none focus:ring-1 focus:ring-ring`}),(0,E.jsx)(`input`,{type:`text`,value:e.value,onChange:t=>Z(e.id,`value`,t.target.value),placeholder:`value`,className:`flex-1 min-w-0 rounded border bg-background px-1.5 py-0.5 text-[10px] font-mono focus:outline-none focus:ring-1 focus:ring-ring`}),(0,E.jsx)(`button`,{onClick:()=>le(e.id),className:`shrink-0 p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors`,children:(0,E.jsx)(a,{className:`h-3 w-3`})})]},e.id))})]})]}),(0,E.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`p-3 border-b space-y-1`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`select`,{value:q,onChange:e=>j(e.target.value),className:`rounded-md border bg-background px-2 py-1.5 font-mono text-xs font-semibold focus:outline-none focus:ring-1 focus:ring-ring ${D[q]||``}`,children:[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`].map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))}),(0,E.jsx)(`input`,{type:`text`,value:J,onChange:e=>M(e.target.value),className:`flex-1 rounded-md border bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring`,placeholder:`/api/v1/...`,onKeyDown:e=>{e.key===`Enter`&&Q()}}),(0,E.jsxs)(`button`,{onClick:Q,disabled:L||!Y,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors`,children:[L?(0,E.jsx)(v,{className:`h-3.5 w-3.5 animate-spin`}):(0,E.jsx)(d,{className:`h-3.5 w-3.5`}),`Send`]})]}),F.some(e=>e.enabled&&e.key.trim())&&(0,E.jsxs)(`div`,{className:`text-[10px] font-mono text-muted-foreground truncate pl-1`,children:[`→ `,Y]})]}),(0,E.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 overflow-auto`,children:[[`POST`,`PATCH`,`PUT`].includes(q)&&(0,E.jsxs)(`div`,{className:`p-3 border-b space-y-1`,children:[(0,E.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:`Request Body (JSON)`}),(0,E.jsx)(`textarea`,{value:N,onChange:e=>P(e.target.value),rows:5,className:`w-full rounded-md border bg-background px-3 py-2 font-mono text-xs focus:outline-none focus:ring-1 focus:ring-ring resize-y`,placeholder:`{ "key": "value" }`})]}),L&&(0,E.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,E.jsx)(v,{className:`h-4 w-4 animate-spin mr-2`}),`Sending request...`]}),z&&!L&&(0,E.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,E.jsx)(`span`,{className:`font-mono font-semibold ${$(z.status)}`,children:z.status||`ERR`}),(0,E.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1`,children:[(0,E.jsx)(f,{className:`h-3 w-3`}),z.duration,`ms`]})]}),(0,E.jsxs)(`button`,{onClick:fe,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[W?(0,E.jsx)(y,{className:`h-3 w-3`}):(0,E.jsx)(h,{className:`h-3 w-3`}),W?`Copied`:`Copy`]})]}),(0,E.jsx)(`pre`,{className:`flex-1 overflow-auto p-3 text-xs font-mono bg-muted/10 whitespace-pre-wrap break-all`,children:z.body})]}),!z&&!L&&(0,E.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:(0,E.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,E.jsx)(c,{className:`h-10 w-10 mx-auto opacity-20`}),(0,E.jsxs)(`p`,{children:[`Select an endpoint or type a URL and click `,(0,E.jsx)(`strong`,{children:`Send`})]}),(0,E.jsx)(`p`,{className:`text-xs opacity-60`,children:`All registered APIs are auto-discovered from the platform`})]})}),V.length>0&&(0,E.jsxs)(`div`,{className:`border-t`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,E.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:[`History (`,V.length,`)`]}),(0,E.jsxs)(`button`,{onClick:()=>H([]),className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,E.jsx)(p,{className:`h-3 w-3`}),`Clear`]})]}),(0,E.jsx)(`div`,{className:`space-y-0.5 px-2 pb-2 max-h-60 overflow-auto`,children:V.map(e=>(0,E.jsxs)(`div`,{className:`rounded border`,children:[(0,E.jsxs)(`button`,{onClick:()=>oe(U===e.id?null:e.id),className:`w-full flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors`,children:[U===e.id?(0,E.jsx)(s,{className:`h-3 w-3 shrink-0`}):(0,E.jsx)(l,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(m,{variant:`outline`,className:`font-mono text-[9px] shrink-0 ${D[e.method]||``}`,children:e.method}),(0,E.jsx)(`span`,{className:`font-mono truncate text-left flex-1`,children:e.url}),(0,E.jsx)(`span`,{className:`ml-auto shrink-0 font-mono ${$(e.status)}`,children:e.status}),(0,E.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.duration,`ms`]}),(0,E.jsx)(`button`,{onClick:t=>{t.stopPropagation(),de(e)},className:`shrink-0 p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors`,title:`Replay request`,children:(0,E.jsx)(d,{className:`h-2.5 w-2.5`})})]}),U===e.id&&(0,E.jsx)(`pre`,{className:`px-3 py-2 text-xs font-mono bg-muted/10 border-t overflow-auto max-h-40 whitespace-pre-wrap break-all`,children:e.response})]},e.id))})]})]})]})]})}export{k as ApiConsolePage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t,h as n,m as r,r as i,y as a}from"./vendor-react-BKSb6vFP.js";import{g as o,h as ee,p as te}from"./infrastructure-C6pQBkbt.js";import{$t as ne,Cr as re,Ct as ie,Dr as ae,Er as oe,Es as se,Fi as ce,Fr as le,Fs as ue,Gs as de,Gt as s,Ii as fe,Jt as pe,Mc as c,Or as l,Q as me,Qt as he,Rs as ge,Sr as _e,St as u,Tr as ve,Uc as ye,Wr as be,Ws as xe,Xt as Se,Yi as Ce,Yt as we,Z as Te,Zt as Ee,_r as De,_t as Oe,ar as ke,bi as Ae,br as je,bs as Me,bt as Ne,en as Pe,fa as Fe,fr as d,fs as Ie,gr as Le,gt as Re,ht as ze,mn as Be,nn as Ve,or as He,qs as Ue,qt as We,rn as Ge,sr as Ke,tn as f,ts as qe,tt as Je,vt as Ye,wr as Xe,wt as Ze,xr as Qe,xt as p,yr as $e,yt as et}from"./ui-components-Ci5ufF7g.js";import{r as m}from"./vendor-ui-utils-D-WJ115h.js";import{p as tt}from"./src-RHOMTPFk.js";var h=e(a(),1),nt=`${``.replace(/\/$/,``)}/api/v1`;async function g(e,t){let n=o.get(),r=await fetch(`${nt}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`,...n?{Authorization:`Bearer ${n}`}:{},...t?.headers||{}},...t}),i=null;try{i=await r.json()}catch{}if(!r.ok){let e=i?.code??`HTTP_${r.status}`,t=i?.message??i?.error??r.statusText,n=Error(`${e}: ${t}`);throw n.code=e,n.status=r.status,n.details=i,n}return i}var _={listProcesses(e={}){let t=new URLSearchParams;e.object&&t.set(`object`,e.object),e.activeOnly&&t.set(`activeOnly`,`true`);let n=t.toString();return g(`/approvals/processes${n?`?${n}`:``}`)},listRequests(e={}){let t=new URLSearchParams;e.status&&t.set(`status`,e.status),e.object&&t.set(`object`,e.object),e.recordId&&t.set(`recordId`,e.recordId);let n=Array.isArray(e.approverId)?e.approverId.filter(Boolean).join(`,`):e.approverId;n&&t.set(`approverId`,n),e.submitterId&&t.set(`submitterId`,e.submitterId),e.q?.trim()&&t.set(`q`,e.q.trim()),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let r=t.toString();return g(`/approvals/requests${r?`?${r}`:``}`)},async getRequest(e){return{data:await g(`/approvals/requests/${encodeURIComponent(e)}`)}},listActions(e){return g(`/approvals/requests/${encodeURIComponent(e)}/actions`)},async approve(e,t){let n=await g(`/approvals/requests/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async reject(e,t){let n=await g(`/approvals/requests/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async recall(e,t){return{data:(await g(`/approvals/requests/${encodeURIComponent(e)}/recall`,{method:`POST`,body:JSON.stringify(t)})).request,finalized:!0}},async reassign(e,t){return{data:(await g(`/approvals/requests/${encodeURIComponent(e)}/reassign`,{method:`POST`,body:JSON.stringify(t)})).request}},async remind(e,t={}){let n=await g(`/approvals/requests/${encodeURIComponent(e)}/remind`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,notified:n.notified}},async requestInfo(e,t){return{data:(await g(`/approvals/requests/${encodeURIComponent(e)}/request-info`,{method:`POST`,body:JSON.stringify(t)})).request}},async sendBack(e,t){let n=await g(`/approvals/requests/${encodeURIComponent(e)}/revise`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,autoRejected:n.autoRejected===!0}},async resubmit(e,t={}){let n=await g(`/approvals/requests/${encodeURIComponent(e)}/resubmit`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,resumed:n.resumed===!0}},async comment(e,t){return{data:(await g(`/approvals/requests/${encodeURIComponent(e)}/comment`,{method:`POST`,body:JSON.stringify(t)})).request}},async submit(e){return g(`/approvals/requests`,{method:`POST`,body:JSON.stringify(e)})}};function rt(e){if(!e)return[];let t=new Set;e.id&&t.add(e.id),e.email&&t.add(e.email);let n=[...e.roles||[],...typeof e.role==`string`?e.role.split(`,`):[]];for(let e of n){let n=String(e).trim();n&&t.add(`role:${n}`)}return Array.from(t)}var v=i(),it=50,at={pending:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400`,approved:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400`,rejected:`border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-400`,recalled:`border-border bg-muted text-muted-foreground`,returned:`border-violet-200 bg-violet-50 text-violet-700 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-400`};function ot(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function y(e){return e?e.includes(`@`)?e:e.startsWith(`role:`)?`Role: ${e.slice(5)}`:e.length>14?`${e.slice(0,6)}…${e.slice(-4)}`:e:`—`}function b(e){return e&&String(e).replace(/^flow:/,``).trim().split(/[_\-\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||`—`}function x(e){return e.process_label||b(e.process_name)}function st(e){return e.step_label?e.step_label:e.current_step?b(e.current_step):null}function ct(e){return e.submitter_name||y(e.submitter_id)}function lt(e,t){return t.pending_approver_names?.[e]||y(e)}function ut(e){return e.object_label||e.object_name}function S(e){return e.submitted_at||e.created_at||void 0}function C(e){let t=S(e);if(!t)return null;let n=Date.parse(t);return Number.isNaN(n)?null:(Date.now()-n)/36e5}function dt(e){if(e.status!==`pending`)return`text-muted-foreground`;let t=C(e);return t==null?`text-muted-foreground`:t>72?`text-red-600 dark:text-red-400 font-medium`:t>24?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`}function ft(e){let t=Math.max(1,Math.round(Math.abs(e)/36e5));return t<48?`${t}h`:`${Math.round(t/24)}d`}var w=new Set([`id`,`created_at`,`updated_at`,`created_by`,`updated_by`,`organization_id`]);function T(e){return e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function E(e,t){if(typeof t==`boolean`)return t?`✓`:`—`;if(typeof t==`number`){if(t>0xe8d4a51000&&/(_at$|_date$|^date_|_time$)/.test(e))try{return new Date(t).toLocaleDateString()}catch{}return t.toLocaleString()}let n=String(t);if(/^\d{4}-\d{2}-\d{2}T\d{2}/.test(n))try{return new Date(n).toLocaleString()}catch{}return n}var pt=/^[A-Za-z0-9_-]{15,}$/;function mt(e,t,n=6){if(!e||typeof e!=`object`||Array.isArray(e))return[];let r=[];for(let[i,a]of Object.entries(e)){if(w.has(i)||a==null||typeof a==`object`||String(a).trim()===``)continue;let e=t?.[i];if(!(!e&&typeof a==`string`&&pt.test(a.trim())&&!/^\d+$/.test(a.trim()))&&(r.push([T(i),e??E(i,a)]),r.length>=n))break}return r}function ht(){let{t:e,language:i}=ye(),{user:a}=te(),{appName:o}=r(),[nt,g]=n(),b=(0,h.useMemo)(()=>rt(a),[a]),C=(0,h.useCallback)((t,n,r)=>String(e(`approvalsInbox.${t}`,{defaultValue:n,...r})),[e]),w=(0,h.useCallback)(e=>{if(!e)return`—`;let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.round((Date.now()-t)/1e3);if(n<45)return C(`justNow`,`just now`);let r=Math.round(n/60);if(r<60)return C(`minutesAgo`,`{{count}}m ago`,{count:r});let a=Math.round(r/60);if(a<24)return C(`hoursAgo`,`{{count}}h ago`,{count:a});let o=Math.round(a/24);if(o<30)return C(`daysAgo`,`{{count}}d ago`,{count:o});try{return new Date(e).toLocaleDateString(i)}catch{return e}},[C,i]),T=(0,h.useCallback)(e=>{switch(e){case`pending`:return C(`statusPending`,`Pending`);case`approved`:return C(`statusApproved`,`Approved`);case`rejected`:return C(`statusRejected`,`Rejected`);case`recalled`:return C(`statusRecalled`,`Recalled`);case`returned`:return C(`statusReturned`,`Returned for revision`);default:return e}},[C]),E=(0,h.useCallback)((e,t)=>{let n=e?.code??``,r=e?.status??0;return n===`NOT_IMPLEMENTED`||r===501?C(`recallUnavailable`,`Recall is not available on this deployment.`):n===`THROTTLED`||r===429?C(`remindThrottled`,`A reminder was sent recently — try again later.`):r===404?C(`requestGone`,`This request no longer exists. Refresh the list.`):n===`FORBIDDEN`||r===403?C(`notAllowed`,`You are not allowed to perform this action.`):n===`INVALID_STATE`||r===409?C(`alreadyDecided`,`This request was already decided. Refresh the list.`):e?.message||t},[C]);function pt({status:e}){return(0,v.jsx)(d,{variant:`outline`,className:c(`font-medium`,at[e]??``),children:T(e)})}let ht=(0,h.useCallback)(e=>`/apps/${o||`setup`}/${encodeURIComponent(e.object_name)}/record/${encodeURIComponent(e.record_id)}`,[o]),[D,gt]=(0,h.useState)(`pending`),[O,_t]=(0,h.useState)([]),[vt,yt]=(0,h.useState)(!1),[bt,xt]=(0,h.useState)(!1),[St,k]=(0,h.useState)(null),[Ct,wt]=(0,h.useState)(null),[Tt,Et]=(0,h.useState)(0),[A,Dt]=(0,h.useState)(null),[j,M]=(0,h.useState)(null),[Ot,kt]=(0,h.useState)([]),[At,jt]=(0,h.useState)(!1),Mt=(0,h.useMemo)(()=>ee(),[]),[Nt,Pt]=(0,h.useState)({});(0,h.useEffect)(()=>{let e=new Set;for(let t of Ot)for(let n of t.attachments??[])n&&Nt[n]===void 0&&e.add(n);if(!e.size)return;let t=``.replace(/\/$/,``),n=!1;return(async()=>{let r={};await Promise.all(Array.from(e).map(async e=>{try{let n=await Mt(`${t}/api/v1/data/sys_file/${encodeURIComponent(e)}`);if(!n.ok){r[e]=``;return}let i=await n.json().catch(()=>null);r[e]=String(i?.record?.name??i?.data?.name??i?.name??``)}catch{r[e]=``}})),n||Pt(e=>({...e,...r}))})(),()=>{n=!0}},[Ot,Mt]);let Ft=(0,h.useCallback)(async e=>{try{let t=``.replace(/\/$/,``),n=await Mt(`${t}/api/v1/storage/files/${encodeURIComponent(e)}/url`);if(!n.ok)throw Error(`HTTP_${n.status}`);let r=await n.json().catch(()=>null),i=r?.data?.url??r?.url;i&&window.open(i,`_blank`,`noopener`)}catch{}},[Mt]),[N,It]=(0,h.useState)(``),[P,Lt]=(0,h.useState)(``),[F,Rt]=(0,h.useState)(`all`),[I,zt]=(0,h.useState)(`all`),[L,Bt]=(0,h.useState)(`all`),[R,z]=(0,h.useState)(new Set),[Vt,Ht]=(0,h.useState)(!1),[B,V]=(0,h.useState)(null),[H,Ut]=(0,h.useState)(null),[U,Wt]=(0,h.useState)(``),[Gt,Kt]=(0,h.useState)(!1),[W,G]=(0,h.useState)(-1);(0,h.useEffect)(()=>{if(D===`pending`)return;let e=window.setTimeout(()=>Lt(N),350);return()=>window.clearTimeout(e)},[N,D]);let K=(0,h.useCallback)(async()=>{yt(!0),wt(null);try{let e=[];if(D===`pending`)e=b.length?(await _.listRequests({status:`pending`,approverId:b})).data:[],Et(e.length),k(null);else{let t={q:P||void 0,status:L===`all`?void 0:L,limit:it,offset:0};if(D===`submitted`){let n=a?.id;if(n){let r=await _.listRequests({submitterId:n,...t});e=r.data,k(r.total??r.data.length)}else e=[],k(0)}else{let n=await _.listRequests(t);e=n.data,k(n.total??n.data.length)}b.length&&_.listRequests({status:`pending`,approverId:b}).then(e=>Et(e.data.length)).catch(()=>{})}e.sort((e,t)=>(S(t)||``).localeCompare(S(e)||``)),_t(e)}catch(e){wt(e?.message||String(e)),_t([])}finally{yt(!1)}},[D,b,a?.id,P,L]);(0,h.useEffect)(()=>{K()},[K]);let qt=(0,h.useCallback)(async()=>{if(!(D===`pending`||bt)){xt(!0);try{let e=await _.listRequests({submitterId:D===`submitted`?a?.id??void 0:void 0,q:P||void 0,status:L===`all`?void 0:L,limit:it,offset:O.length});_t(t=>{let n=new Set(t.map(e=>e.id));return[...t,...e.data.filter(e=>!n.has(e.id))]}),e.total!=null&&k(e.total)}catch(e){m.error(E(e,C(`loadFailed`,`Failed to load request`)))}finally{xt(!1)}}},[D,bt,a?.id,P,L,O.length,E,C]),q=(0,h.useCallback)(async e=>{Dt(e),jt(!0);try{let[t,n]=await Promise.all([_.getRequest(e),_.listActions(e)]);M(t.data),kt(n.data)}catch(e){m.error(E(e,C(`loadFailed`,`Failed to load request`))),M(null),kt([])}finally{jt(!1)}},[E,C]),Jt=()=>{Dt(null),M(null),kt([])};(0,h.useEffect)(()=>{let e=nt.get(`request`);e&&(g(e=>{let t=new URLSearchParams(e);return t.delete(`request`),t},{replace:!0}),q(e))},[nt]);let J=(0,h.useCallback)(()=>{b.length&&_.listRequests({status:`pending`,approverId:b}).then(e=>Et(e.data.length)).catch(()=>{})},[b]),Y=(0,h.useCallback)(async e=>{let[t,n]=await Promise.all([_.getRequest(e),_.listActions(e)]);M(t.data),kt(n.data),K()},[K]),Yt=(0,h.useCallback)(async()=>{if(!j)return;let e=j.id;try{let[t,n]=await Promise.all([_.getRequest(e),_.listActions(e)]);M(t.data),kt(n.data),K();let r=new Set(t.data.pending_approvers||[]),i=t.data.status===`pending`&&b.some(e=>r.has(e));if(D===`pending`&&!i){let t=un.current,n=t.findIndex(t=>t.id===e),r=t[n+1]??t[n-1];if(r&&r.id!==e){q(r.id);return}Jt()}}catch{Y(e)}},[j,b,D,K,q,Jt,Y]),Xt=(0,h.useCallback)(async()=>{if(!(!j||!U.trim())){Kt(!0);try{await _.comment(j.id,{actor_id:a?.id,comment:U.trim()}),Wt(``),await Y(j.id)}catch(e){m.error(E(e,C(`actionFailed`,`Action failed`)))}finally{Kt(!1)}}},[j,U,a?.id,Y,E,C]),Zt=(0,h.useMemo)(()=>{if(!j||j.status!==`pending`)return!1;if(j.viewer)return j.viewer.can_act;let e=new Set(j.pending_approvers||[]);return b.some(t=>e.has(t))},[j,b]),Qt=(0,h.useMemo)(()=>!j||j.status!==`pending`?!1:j.viewer?j.viewer.is_submitter:j.submitter_id===a?.id,[j,a?.id]),$t=(0,h.useMemo)(()=>!j||j.status!==`returned`?!1:j.viewer?j.viewer.is_submitter:j.submitter_id===a?.id,[j,a?.id]),en=(0,h.useMemo)(()=>{let e=new Set;for(let t of O)e.add(x(t));return Array.from(e).sort()},[O]),tn=(0,h.useMemo)(()=>{let e=new Set;for(let t of O)t.object_name&&e.add(t.object_name);return Array.from(e).sort()},[O]),X=(0,h.useMemo)(()=>{let e=N.trim().toLowerCase();return O.filter(t=>F!==`all`&&x(t)!==F||I!==`all`&&t.object_name!==I||L!==`all`&&t.status!==L?!1:D!==`pending`||!e||[t.process_name,t.process_label,t.step_label,t.object_name,t.record_id,t.record_title,t.submitter_id,t.submitter_name,...t.pending_approvers||[]].filter(Boolean).join(` `).toLowerCase().includes(e))},[O,N,F,I,L,D]),Z=(0,h.useMemo)(()=>A?X.findIndex(e=>e.id===A):-1,[X,A]);(0,h.useEffect)(()=>{if(R.size===0)return;let e=new Set(X.map(e=>e.id)),t=!1,n=new Set;for(let r of R)e.has(r)?n.add(r):t=!0;t&&z(n)},[X,R]),(0,h.useEffect)(()=>{W>=X.length&&G(X.length-1)},[X.length,W]);let Q=(0,h.useCallback)(e=>{if(e.status!==`pending`)return!1;let t=new Set(b);return(e.pending_approvers||[]).some(e=>t.has(e))},[b]),$=(0,h.useMemo)(()=>X.filter(e=>R.has(e.id)&&Q(e)),[X,R,Q]),nn=X.filter(e=>e.status===`pending`),rn=nn.length>0&&nn.every(e=>R.has(e.id)),an=(0,h.useCallback)(()=>{z(e=>{if(rn)return new Set;let t=new Set(e);for(let e of nn)t.add(e.id);return t})},[rn,nn]),on=(0,h.useCallback)(e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),sn=(0,h.useCallback)(async e=>{let t=$;if(t.length===0)return;Ht(!0);let n=0,r=[];for(let i of t){let t=new Set(i.pending_approvers||[]),o=b.find(e=>t.has(e))||a?.id||``;try{await(e===`approve`?_.approve:_.reject)(i.id,{actor_id:o}),n++}catch{r.push(i.record_title||y(i.record_id))}}if(Ht(!1),z(new Set),r.length===0)m.success(e===`approve`?C(`bulkApproved`,`Approved {{count}} requests`,{count:n}):C(`bulkRejected`,`Rejected {{count}} requests`,{count:n}));else{let e=r.slice(0,3).join(`, `);m.error(C(`bulkPartial`,`{{ok}} succeeded, {{fail}} failed: {{which}}`,{ok:n,fail:r.length,which:e+(r.length>3?`…`:``)}))}K(),J()},[$,b,a?.id,K,J,C]),cn=(0,h.useCallback)(async e=>{if(!Q(e)||H)return;let t=new Set(e.pending_approvers||[]),n=b.find(e=>t.has(e))||a?.id||``;Ut(e.id);try{let t=await _.approve(e.id,{actor_id:n});m.success(t.finalized?C(`inlineApproved`,`Approved "{{title}}"`,{title:e.record_title||y(e.record_id)}):C(`approvedWaiting`,`Approved — waiting on the remaining approvers`)),K(),J()}catch(e){m.error(E(e,C(`actionFailed`,`Action failed`)))}finally{Ut(null)}},[Q,H,b,a?.id,K,J,E,C]),ln=(0,h.useCallback)(async()=>{let e=B;if(!e)return;let t=new Set(e.pending_approvers||[]),n=b.find(e=>t.has(e))||a?.id||``;Ut(e.id),V(null);try{await _.reject(e.id,{actor_id:n}),m.success(C(`inlineRejected`,`Rejected "{{title}}"`,{title:e.record_title||y(e.record_id)})),K(),J()}catch(e){m.error(E(e,C(`actionFailed`,`Action failed`)))}finally{Ut(null)}},[B,b,a?.id,K,J,E,C]),un=(0,h.useRef)(X);un.current=X;let dn=(0,h.useRef)(W);dn.current=W,(0,h.useEffect)(()=>{let e=e=>{if(A||B)return;let t=e.target,n=t?.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||document.querySelector(`[role="alertdialog"]`))return;let r=un.current;if(!r.length)return;let i=dn.current;e.key===`j`||e.key===`ArrowDown`?(e.preventDefault(),G(Math.min(i+1,r.length-1))):e.key===`k`||e.key===`ArrowUp`?(e.preventDefault(),G(Math.max(i-1,0))):e.key===`Enter`&&i>=0&&r[i]?(e.preventDefault(),q(r[i].id)):(e.key===`x`||e.key===` `)&&i>=0&&r[i]&&D===`pending`?(e.preventDefault(),on(r[i].id)):e.key===`a`&&i>=0&&r[i]?(e.preventDefault(),cn(r[i])):e.key===`r`&&i>=0&&r[i]&&Q(r[i])&&(e.preventDefault(),V(r[i]))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[A,B,D,q,on,cn,Q]),(0,h.useEffect)(()=>{if(!A)return;let e=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=e.target,n=t?.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||document.querySelector(`[role="alertdialog"]`))return;let r=un.current,i=r.findIndex(e=>e.id===A);if(i<0)return;let a=e.key===`ArrowLeft`?r[i-1]:r[i+1];a&&(e.preventDefault(),q(a.id))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[A,q]);let fn=!!N||F!==`all`||I!==`all`||L!==`all`,pn=e=>{gt(e),Bt(`all`),Rt(`all`),zt(`all`),It(``),G(-1)};function mn({r:e}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`div`,{className:`font-medium truncate`,children:x(e)}),(0,v.jsxs)(`div`,{className:`text-xs text-muted-foreground truncate`,children:[st(e)||`—`,(e.round??1)>1&&(0,v.jsx)(`span`,{className:`ml-1.5 text-violet-600 dark:text-violet-400`,children:C(`roundChip`,`Round {{n}}`,{n:e.round})})]})]})}function hn({r:e}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsxs)(t,{to:ht(e),onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 text-sm hover:underline truncate max-w-full`,title:e.record_id,children:[(0,v.jsx)(`span`,{className:`truncate`,children:e.record_title||y(e.record_id)}),(0,v.jsx)(qe,{className:`h-3 w-3 shrink-0 text-muted-foreground`})]}),(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:ut(e)})]})}function gn({r:e}){if(!Q(e))return null;let t=H===e.id;return(0,v.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(l,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-emerald-700 hover:text-emerald-800 hover:bg-emerald-50 dark:text-emerald-400`,disabled:t,onClick:()=>void cn(e),"aria-label":C(`approve`,`Approve`),children:(0,v.jsx)(ue,{className:`h-4 w-4`})}),(0,v.jsx)(l,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400`,disabled:t,onClick:()=>V(e),"aria-label":C(`reject`,`Reject`),children:(0,v.jsx)(se,{className:`h-4 w-4`})})]})}return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-6xl`,children:[(0,v.jsxs)(`header`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`h1`,{className:`text-2xl font-semibold flex items-center gap-2`,children:[(0,v.jsx)(Ae,{className:`h-6 w-6`}),C(`title`,`Approvals Inbox`)]}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C(`subtitle`,`Review and act on approval requests.`)})]}),(0,v.jsxs)(l,{variant:`outline`,size:`sm`,onClick:K,disabled:vt,className:`self-start sm:self-auto`,children:[(0,v.jsx)(Ce,{className:`h-4 w-4 mr-2 ${vt?`animate-spin`:``}`}),C(`refresh`,`Refresh`)]})]}),Ct&&(0,v.jsxs)(Le,{variant:`destructive`,children:[(0,v.jsx)(ge,{className:`h-4 w-4`}),(0,v.jsx)(De,{children:Ct})]}),(0,v.jsxs)(ze,{value:D,onValueChange:pn,children:[(0,v.jsxs)(Oe,{children:[(0,v.jsxs)(Ye,{value:`pending`,children:[C(`tabMyPending`,`My Pending`),Tt>0&&(0,v.jsx)(d,{variant:`secondary`,className:`ml-2`,children:Tt})]}),(0,v.jsx)(Ye,{value:`submitted`,children:C(`tabSubmitted`,`Submitted by me`)}),(0,v.jsx)(Ye,{value:`all`,children:C(`tabAll`,`All`)})]}),(0,v.jsxs)(Re,{value:D,className:`mt-4 space-y-3`,children:[!vt&&(O.length>0||D!==`pending`&&(P||L!==`all`))&&(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsxs)(`div`,{className:`relative flex-1 min-w-[200px] max-w-sm`,children:[(0,v.jsx)(fe,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,v.jsx)(Be,{value:N,onChange:e=>It(e.target.value),placeholder:C(`searchPlaceholder`,`Search record, process, requester…`),className:`pl-8 h-8 text-sm`}),N&&(0,v.jsx)(`button`,{type:`button`,onClick:()=>It(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":C(`clearSearch`,`Clear search`),children:(0,v.jsx)(le,{className:`h-3.5 w-3.5`})})]}),D!==`pending`&&(0,v.jsxs)(ne,{value:L,onValueChange:Bt,children:[(0,v.jsx)(Ve,{className:`h-8 w-auto min-w-[130px] text-sm`,children:(0,v.jsx)(Ge,{placeholder:C(`statusFilter`,`Status`)})}),(0,v.jsxs)(Pe,{children:[(0,v.jsx)(f,{value:`all`,children:C(`allStatuses`,`All statuses`)}),(0,v.jsx)(f,{value:`pending`,children:T(`pending`)}),(0,v.jsx)(f,{value:`approved`,children:T(`approved`)}),(0,v.jsx)(f,{value:`rejected`,children:T(`rejected`)}),(0,v.jsx)(f,{value:`recalled`,children:T(`recalled`)}),(0,v.jsx)(f,{value:`returned`,children:T(`returned`)})]})]}),en.length>1&&(0,v.jsxs)(ne,{value:F,onValueChange:Rt,children:[(0,v.jsx)(Ve,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,v.jsx)(Ge,{placeholder:C(`processFilter`,`Process`)})}),(0,v.jsxs)(Pe,{children:[(0,v.jsx)(f,{value:`all`,children:C(`allProcesses`,`All processes`)}),en.map(e=>(0,v.jsx)(f,{value:e,children:e},e))]})]}),tn.length>1&&(0,v.jsxs)(ne,{value:I,onValueChange:zt,children:[(0,v.jsx)(Ve,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,v.jsx)(Ge,{placeholder:C(`objectFilter`,`Object`)})}),(0,v.jsxs)(Pe,{children:[(0,v.jsx)(f,{value:`all`,children:C(`allObjects`,`All objects`)}),tn.map(e=>(0,v.jsx)(f,{value:e,children:e},e))]})]}),fn&&(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:C(`filterCount`,`{{shown}} of {{total}}`,{shown:X.length,total:O.length})})]}),D===`pending`&&R.size>0&&(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 rounded-md border bg-accent/30 text-sm`,children:[(0,v.jsxs)(`span`,{children:[(0,v.jsx)(`strong`,{children:R.size}),` `,C(`selected`,`selected`),$.length!==R.size&&(0,v.jsx)(`span`,{className:`text-muted-foreground ml-1`,children:C(`actionableCount`,`({{count}} actionable)`,{count:$.length})})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsxs)($e,{children:[(0,v.jsx)(ae,{asChild:!0,children:(0,v.jsxs)(l,{size:`sm`,disabled:Vt||$.length===0,children:[(0,v.jsx)(ue,{className:`h-3.5 w-3.5 mr-1`}),C(`approveN`,`Approve {{count}}`,{count:$.length||``})]})}),(0,v.jsxs)(_e,{children:[(0,v.jsxs)(ve,{children:[(0,v.jsx)(oe,{children:C(`bulkApproveTitle`,`Approve {{count}} requests?`,{count:$.length})}),(0,v.jsx)(re,{children:C(`bulkApproveBody`,`Each request is approved with your identity and its flow continues down the approve branch.`)})]}),(0,v.jsxs)(Xe,{children:[(0,v.jsx)(Qe,{children:C(`cancel`,`Cancel`)}),(0,v.jsx)(je,{onClick:()=>sn(`approve`),children:C(`approveN`,`Approve {{count}}`,{count:$.length})})]})]})]}),(0,v.jsxs)($e,{children:[(0,v.jsx)(ae,{asChild:!0,children:(0,v.jsxs)(l,{size:`sm`,variant:`outline`,disabled:Vt||$.length===0,className:`border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground`,children:[(0,v.jsx)(se,{className:`h-3.5 w-3.5 mr-1`}),C(`rejectN`,`Reject {{count}}`,{count:$.length||``})]})}),(0,v.jsxs)(_e,{children:[(0,v.jsxs)(ve,{children:[(0,v.jsx)(oe,{children:C(`bulkRejectTitle`,`Reject {{count}} requests?`,{count:$.length})}),(0,v.jsx)(re,{children:C(`bulkRejectBody`,`This rejects the selected requests and notifies their submitters.`)})]}),(0,v.jsxs)(Xe,{children:[(0,v.jsx)(Qe,{children:C(`cancel`,`Cancel`)}),(0,v.jsx)(je,{onClick:()=>sn(`reject`),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:C(`rejectN`,`Reject {{count}}`,{count:$.length})})]})]})]}),(0,v.jsx)(l,{size:`sm`,variant:`ghost`,onClick:()=>z(new Set),disabled:Vt,children:C(`clear`,`Clear`)})]})]}),vt?(0,v.jsxs)(`div`,{className:`space-y-2`,children:[(0,v.jsx)(s,{className:`h-10 w-full`}),(0,v.jsx)(s,{className:`h-10 w-full`}),(0,v.jsx)(s,{className:`h-10 w-full`})]}):O.length===0?(0,v.jsx)(`div`,{className:`flex items-center justify-center min-h-[240px] rounded-md border border-dashed`,children:(0,v.jsxs)(Te,{children:[(0,v.jsx)(Je,{children:C(`emptyTitle`,`No requests`)}),(0,v.jsx)(me,{children:D===`pending`?C(`emptyPending`,`You're all caught up — nothing is waiting on you.`):C(`emptyOther`,`Nothing here yet.`)}),D===`pending`&&(0,v.jsx)(l,{variant:`link`,size:`sm`,className:`mt-1`,onClick:()=>pn(`all`),children:C(`emptyViewAll`,`Browse all requests`)})]})}):X.length===0?(0,v.jsx)(`div`,{className:`flex items-center justify-center min-h-[160px] rounded-md border border-dashed text-sm text-muted-foreground`,children:C(`noMatches`,`No matches for current filters.`)}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(He,{className:`hidden md:block`,children:(0,v.jsx)(Ke,{className:`p-0`,children:(0,v.jsxs)(et,{children:[(0,v.jsx)(ie,{children:(0,v.jsxs)(Ze,{children:[D===`pending`&&(0,v.jsx)(u,{className:`w-10`,children:(0,v.jsx)(ke,{checked:rn,onCheckedChange:an,"aria-label":C(`selectAll`,`Select all`),disabled:nn.length===0})}),(0,v.jsx)(u,{children:C(`colRequest`,`Request`)}),(0,v.jsx)(u,{children:C(`colRecord`,`Record`)}),(0,v.jsx)(u,{children:C(`colRequester`,`Requester`)}),(0,v.jsx)(u,{children:C(`colStatus`,`Status`)}),(0,v.jsx)(u,{children:C(`colWaiting`,`Submitted`)}),(0,v.jsx)(u,{className:`w-20`,"aria-label":C(`colActions`,`Actions`)})]})}),(0,v.jsx)(Ne,{children:X.map((e,t)=>(0,v.jsxs)(Ze,{className:c(`group cursor-pointer hover:bg-accent/50`,W===t&&`ring-2 ring-inset ring-ring bg-accent/30`),onClick:()=>{G(t),q(e.id)},children:[D===`pending`&&(0,v.jsx)(p,{className:`w-10`,onClick:e=>e.stopPropagation(),children:(0,v.jsx)(ke,{checked:R.has(e.id),onCheckedChange:()=>on(e.id),disabled:e.status!==`pending`,"aria-label":C(`selectRow`,`Select request`)})}),(0,v.jsx)(p,{children:(0,v.jsx)(mn,{r:e})}),(0,v.jsx)(p,{children:(0,v.jsx)(hn,{r:e})}),(0,v.jsx)(p,{children:(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,v.jsx)(be,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,v.jsx)(`span`,{className:`truncate`,title:e.submitter_id||``,children:ct(e)})]})}),(0,v.jsx)(p,{children:(0,v.jsx)(pt,{status:e.status})}),(0,v.jsxs)(p,{className:c(`text-xs whitespace-nowrap`,dt(e)),title:ot(S(e)),children:[(0,v.jsx)(Me,{className:`h-3 w-3 inline mr-1`}),w(S(e)),e.status===`pending`&&e.sla_due_at&&(0,v.jsx)(`div`,{className:c(`mt-0.5 text-[10px] font-medium`,Date.parse(e.sla_due_at)<Date.now()?`text-red-600 dark:text-red-400`:`text-muted-foreground`),children:Date.parse(e.sla_due_at)<Date.now()?C(`slaOverdue`,`SLA overdue {{dur}}`,{dur:ft(Date.now()-Date.parse(e.sla_due_at))}):C(`slaRemaining`,`SLA {{dur}} left`,{dur:ft(Date.parse(e.sla_due_at)-Date.now())})})]}),(0,v.jsx)(p,{className:`w-20`,children:(0,v.jsx)(gn,{r:e})})]},e.id))})]})})}),(0,v.jsx)(`div`,{className:`md:hidden space-y-2`,children:X.map(e=>(0,v.jsx)(He,{className:`cursor-pointer active:bg-accent/50`,onClick:()=>void q(e.id),children:(0,v.jsxs)(Ke,{className:`p-3 space-y-1.5`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,v.jsx)(`div`,{className:`font-medium text-sm truncate`,children:x(e)}),(0,v.jsx)(pt,{status:e.status})]}),(0,v.jsxs)(`div`,{className:`text-sm truncate`,children:[e.record_title||y(e.record_id),(0,v.jsx)(`span`,{className:`text-muted-foreground text-xs ml-1.5`,children:ut(e)})]}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,v.jsxs)(`span`,{className:`inline-flex items-center gap-1 truncate`,children:[(0,v.jsx)(be,{className:`h-3 w-3`}),ct(e)]}),(0,v.jsxs)(`span`,{className:c(`inline-flex items-center gap-1 whitespace-nowrap`,dt(e)),children:[(0,v.jsx)(Me,{className:`h-3 w-3`}),w(S(e))]})]}),Q(e)&&(0,v.jsxs)(`div`,{className:`flex gap-2 pt-1`,onClick:e=>e.stopPropagation(),children:[(0,v.jsxs)(l,{size:`sm`,className:`h-7 flex-1`,disabled:H===e.id,onClick:()=>void cn(e),children:[(0,v.jsx)(ue,{className:`h-3.5 w-3.5 mr-1`}),C(`approve`,`Approve`)]}),(0,v.jsxs)(l,{size:`sm`,variant:`outline`,className:`h-7 flex-1 border-destructive text-destructive`,disabled:H===e.id,onClick:()=>V(e),children:[(0,v.jsx)(se,{className:`h-3.5 w-3.5 mr-1`}),C(`reject`,`Reject`)]})]})]})},e.id))}),D!==`pending`&&St!=null&&(0,v.jsxs)(`div`,{className:`flex items-center justify-center gap-3 py-1`,children:[(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:C(`loadedOf`,`Loaded {{loaded}} of {{total}}`,{loaded:O.length,total:St})}),O.length<St&&(0,v.jsx)(l,{size:`sm`,variant:`outline`,disabled:bt,onClick:()=>void qt(),children:bt?C(`loadingMore`,`Loading…`):C(`loadMore`,`Load more`)})]}),(0,v.jsx)(`div`,{className:`hidden md:block text-[11px] text-muted-foreground`,children:C(`keyboardHint`,`Keyboard: j/k move · Enter open · x select · a approve · r reject`)})]})]})]}),(0,v.jsx)($e,{open:!!B,onOpenChange:e=>!e&&V(null),children:(0,v.jsxs)(_e,{children:[(0,v.jsxs)(ve,{children:[(0,v.jsx)(oe,{children:C(`rejectOneTitle`,`Reject "{{title}}"?`,{title:B?B.record_title||y(B.record_id):``})}),(0,v.jsx)(re,{children:C(`rejectOneBody`,`This rejects the request and notifies the submitter.`)})]}),(0,v.jsxs)(Xe,{children:[(0,v.jsx)(Qe,{children:C(`cancel`,`Cancel`)}),(0,v.jsx)(je,{onClick:()=>void ln(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:C(`reject`,`Reject`)})]})]})}),(0,v.jsx)(We,{open:!!A,onOpenChange:e=>!e&&Jt(),children:(0,v.jsxs)(pe,{className:`w-full sm:max-w-xl overflow-y-auto`,children:[(0,v.jsxs)(Se,{children:[(0,v.jsx)(Ee,{children:j?x(j):C(`drawerTitle`,`Approval Request`)}),(0,v.jsx)(we,{children:j?st(j)||ut(j):``})]}),j&&Z>=0&&X.length>1&&(0,v.jsxs)(`div`,{className:`flex items-center justify-between mt-2 text-xs text-muted-foreground`,children:[(0,v.jsxs)(l,{variant:`ghost`,size:`sm`,className:`h-7 px-2`,disabled:Z<=0,onClick:()=>{let e=X[Z-1];e&&q(e.id)},children:[(0,v.jsx)(de,{className:`h-4 w-4 mr-0.5`}),C(`prevRequest`,`Previous`)]}),(0,v.jsx)(`span`,{children:C(`positionOf`,`{{index}} of {{total}}`,{index:Z+1,total:X.length})}),(0,v.jsxs)(l,{variant:`ghost`,size:`sm`,className:`h-7 px-2`,disabled:Z>=X.length-1,onClick:()=>{let e=X[Z+1];e&&q(e.id)},children:[C(`nextRequest`,`Next`),(0,v.jsx)(xe,{className:`h-4 w-4 ml-0.5`})]})]}),At?(0,v.jsxs)(`div`,{className:`space-y-2 mt-6`,children:[(0,v.jsx)(s,{className:`h-6 w-3/4`}),(0,v.jsx)(s,{className:`h-6 w-1/2`}),(0,v.jsx)(s,{className:`h-20 w-full`})]}):j?(0,v.jsxs)(`div`,{className:`space-y-4 mt-6`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,v.jsx)(pt,{status:j.status}),(j.round??1)>1&&(0,v.jsx)(d,{variant:`outline`,className:`text-[10px] border-violet-200 text-violet-700 dark:border-violet-500/30 dark:text-violet-400`,children:C(`roundChip`,`Round {{n}}`,{n:j.round})}),(0,v.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:ot(S(j)),children:[(0,v.jsx)(Me,{className:`h-3 w-3`}),C(`submittedAgo`,`Submitted {{when}}`,{when:w(S(j))})]}),j.completed_at&&(0,v.jsxs)(`span`,{children:[`· `,C(`completedAt`,`Completed {{when}}`,{when:w(j.completed_at)})]}),j.status===`pending`&&j.sla_due_at&&(0,v.jsx)(d,{variant:`outline`,className:c(`text-[10px]`,Date.parse(j.sla_due_at)<Date.now()?`border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-400`:`border-border text-muted-foreground`),children:Date.parse(j.sla_due_at)<Date.now()?C(`slaOverdue`,`SLA overdue {{dur}}`,{dur:ft(Date.now()-Date.parse(j.sla_due_at))}):C(`slaRemaining`,`SLA {{dur}} left`,{dur:ft(Date.parse(j.sla_due_at)-Date.now())})})]}),(0,v.jsx)(He,{children:(0,v.jsxs)(Ke,{className:`p-4 space-y-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsxs)(t,{to:ht(j),className:`text-base font-semibold hover:underline inline-flex items-center gap-1.5`,children:[(0,v.jsx)(`span`,{className:`truncate`,children:j.record_title||y(j.record_id)}),(0,v.jsx)(qe,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:ut(j)})]}),(0,v.jsx)(`div`,{className:`text-right text-xs text-muted-foreground shrink-0`,children:(0,v.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,v.jsx)(be,{className:`h-3 w-3`}),(0,v.jsx)(`span`,{title:j.submitter_id||``,children:ct(j)})]})})]}),mt(j.payload,j.payload_display).length>0&&(0,v.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-2 text-sm border-t pt-3`,children:mt(j.payload,j.payload_display).map(([e,t])=>(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e}),(0,v.jsx)(`div`,{className:`truncate`,title:t,children:t})]},e))}),j.decision_progress&&(0,v.jsxs)(`div`,{className:`border-t pt-3`,children:[(0,v.jsx)(`div`,{className:`text-[11px] text-muted-foreground mb-1`,children:j.decision_progress.behavior===`per_group`?C(`progressGroups`,`Sign-off progress — {{got}} of {{need}} groups`,{got:j.decision_progress.got,need:j.decision_progress.need}):C(`progressApprovals`,`Approvals — {{got}} of {{need}}`,{got:j.decision_progress.got,need:j.decision_progress.need})}),j.decision_progress.groups&&(0,v.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:j.decision_progress.groups.map(e=>(0,v.jsxs)(d,{variant:`outline`,className:c(`text-[11px] gap-1`,e.satisfied?`border-emerald-300 text-emerald-700 dark:border-emerald-700 dark:text-emerald-400`:`text-muted-foreground`),title:`${e.got}/${e.need}`,children:[e.satisfied?(0,v.jsx)(Ue,{className:`h-3 w-3`}):null,e.group,` `,e.got,`/`,e.need]},e.group))})]}),j.status===`pending`&&(j.pending_approvers||[]).length>0&&(0,v.jsxs)(`div`,{className:`border-t pt-3`,children:[(0,v.jsx)(`div`,{className:`text-[11px] text-muted-foreground mb-1`,children:C(`waitingOn`,`Waiting on`)}),(0,v.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(j.pending_approvers||[]).map((e,t)=>(0,v.jsx)(d,{variant:`outline`,className:`text-[11px]`,title:e,children:lt(e,j)},t))})]})]})}),(j.flow_steps?.length??0)>1&&(0,v.jsx)(`div`,{className:`flex items-center px-1`,"aria-label":C(`stepProgress`,`Approval steps`),children:j.flow_steps.map((e,t)=>(0,v.jsxs)(h.Fragment,{children:[t>0&&(0,v.jsx)(`div`,{className:c(`h-px flex-1 mx-2`,e.state===`done`||e.state===`current`?`bg-emerald-300 dark:bg-emerald-700`:`bg-border`)}),(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,v.jsx)(`span`,{className:c(`flex items-center justify-center h-5 w-5 rounded-full text-[10px] font-semibold`,e.state===`done`&&`bg-emerald-500 text-white`,e.state===`current`&&`bg-amber-500 text-white ring-2 ring-amber-200 dark:ring-amber-500/30`,e.state===`upcoming`&&`bg-muted text-muted-foreground border`),children:e.state===`done`?(0,v.jsx)(Ue,{className:`h-3 w-3`}):t+1}),(0,v.jsx)(`span`,{className:c(`text-xs`,e.state===`current`?`font-medium`:`text-muted-foreground`),children:e.label})]})]},e.id))}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h3`,{className:`text-sm font-semibold mb-3`,children:C(`history`,`Activity`)}),Ot.length===0?(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:C(`noActions`,`No actions yet.`)}):(0,v.jsx)(`ol`,{className:`relative space-y-3 pl-5 before:absolute before:left-[7px] before:top-1 before:bottom-1 before:w-px before:bg-border`,children:Ot.map(e=>{let t=e.action===`approve`?`bg-emerald-500`:e.action===`reject`?`bg-destructive`:e.action===`submit`?`bg-blue-500`:e.action===`reassign`?`bg-indigo-500`:e.action===`remind`||e.action===`request_info`?`bg-amber-500`:e.action===`comment`?`bg-slate-400`:e.action===`escalate`?`bg-red-500`:e.action===`revise`?`bg-violet-500`:e.action===`resubmit`?`bg-blue-500`:`bg-muted-foreground`,n=e.actor_id===`system:sla`?C(`systemSlaActor`,`System (SLA)`):e.actor_name??(e.actor_id&&e.actor_id===j.submitter_id?ct(j):y(e.actor_id)),r=e.action===`submit`?C(`actSubmit`,`Submitted`):e.action===`approve`?C(`actApprove`,`Approved`):e.action===`reject`?C(`actReject`,`Rejected`):e.action===`recall`?C(`actRecall`,`Recalled`):e.action===`reassign`?C(`actReassign`,`Reassigned`):e.action===`remind`?C(`actRemind`,`Reminder sent`):e.action===`request_info`?C(`actRequestInfo`,`Requested more info`):e.action===`comment`?C(`actComment`,`Commented`):e.action===`escalate`?C(`actEscalate`,`SLA escalated`):e.action===`revise`?C(`actRevise`,`Sent back for revision`):e.action===`resubmit`?C(`actResubmit`,`Resubmitted`):e.action;return(0,v.jsxs)(`li`,{className:`relative text-xs`,children:[(0,v.jsx)(`span`,{className:`absolute -left-[18px] top-1 h-3 w-3 rounded-full ring-2 ring-background ${t}`,"aria-hidden":!0}),(0,v.jsxs)(`div`,{className:`flex items-baseline gap-1.5 flex-wrap`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:r}),(0,v.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,v.jsx)(`span`,{title:e.actor_id||``,children:n}),(0,v.jsx)(`span`,{className:`ml-auto text-muted-foreground text-[10px]`,title:ot(e.created_at),children:w(e.created_at)})]}),e.comment&&(0,v.jsxs)(`div`,{className:`text-muted-foreground italic mt-0.5`,children:[`"`,e.comment,`"`]}),Array.isArray(e.attachments)&&e.attachments.length>0&&(0,v.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1`,children:e.attachments.map((t,n)=>(0,v.jsxs)(`button`,{type:`button`,onClick:()=>void Ft(t),className:`inline-flex items-center gap-1 text-[11px] px-2 py-0.5 rounded-full border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors`,title:t,children:[(0,v.jsx)(Fe,{className:`h-3 w-3`}),Nt[t]||`${C(`attachmentChip`,`Attachment`)}${e.attachments.length>1?` ${n+1}`:``}`]},t))})]},e.id)})}),j.status===`pending`&&(Zt||Qt)&&(0,v.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,v.jsx)(Be,{value:U,onChange:e=>Wt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&U.trim()&&(e.preventDefault(),Xt())},placeholder:C(`replyPlaceholder`,`Reply on this request…`),className:`h-8 text-sm`}),(0,v.jsx)(l,{size:`sm`,variant:`outline`,className:`h-8 px-2 shrink-0`,disabled:!U.trim()||Gt,onClick:()=>void Xt(),children:(0,v.jsx)(ce,{className:`h-3.5 w-3.5`})})]})]}),j.payload!=null&&(0,v.jsxs)(`details`,{className:`group`,children:[(0,v.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground hover:text-foreground select-none`,children:C(`rawData`,`Raw data (JSON)`)}),(0,v.jsxs)(`div`,{className:`mt-2`,children:[(0,v.jsx)(`div`,{className:`flex justify-end`,children:(0,v.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(j.payload,null,2)),m.success(C(`copied`,`Copied`))}catch{m.error(C(`copyFailed`,`Copy failed`))}},className:`text-[10px] text-muted-foreground hover:text-foreground inline-flex items-center gap-1`,children:[(0,v.jsx)(Ie,{className:`h-3 w-3`}),C(`copy`,`Copy`)]})}),(0,v.jsx)(`pre`,{className:`text-[11px] bg-muted/50 rounded p-2 overflow-auto max-h-48 mt-1`,children:JSON.stringify(j.payload,null,2)})]})]}),j.status===`pending`&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(he,{}),(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsx)(tt,{objectName:`sys_approval_request`,record:j,location:`record_section`,label:C(`declaredActions`,`Actions`),onDone:()=>{Yt()}}),!Zt&&(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:Qt?C(`whyDisabledSubmitter`,`You submitted this request, so you can recall it — but only the assigned approvers can approve or reject.`):C(`whyDisabled`,`Only the assigned approvers can act on this request. It is waiting on: {{who}}.`,{who:(j.pending_approvers||[]).map(e=>lt(e,j)).join(`, `)||`—`})})]})]}),$t&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(he,{}),(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:C(`returnedHint`,`An approver sent this back to you. The record is unlocked — fix the data, then resubmit to start a new approval round.`)}),(0,v.jsxs)(`div`,{className:`flex gap-2 flex-wrap items-center`,children:[(0,v.jsx)(l,{asChild:!0,size:`sm`,variant:`outline`,children:(0,v.jsxs)(t,{to:ht(j),children:[(0,v.jsx)(qe,{className:`h-4 w-4 mr-1`}),C(`editRecordBtn`,`Edit record`)]})}),(0,v.jsx)(tt,{objectName:`sys_approval_request`,record:j,location:`record_section`,onDone:()=>{Y(j.id),K()}})]})]})]})]}):null]})})]})}export{ht as ApprovalsInboxPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{$t as r,Ct as i,Fr as a,Gt as ee,Ii as te,Jt as o,Li as ne,Or as s,Q as re,Qt as c,Rs as l,St as u,Xt as d,Yi as f,Yt as p,Z as m,Zt as ie,_r as ae,bt as oe,en as h,fr as g,gr as se,mn as _,nn as ce,or as v,qt as y,rn as le,sr as b,tn as x,tt as ue,vn as S,wt as C,xt as w,yt as T}from"./ui-components-Ci5ufF7g.js";var E=e(n(),1),D=t(),de=`${``.replace(/\/$/,``)}/api/v1`,fe=[`create`,`update`,`delete`,`restore`,`login`,`logout`,`permission_change`,`config_change`,`export`,`import`],O={create:`default`,update:`secondary`,delete:`destructive`,restore:`outline`,login:`outline`,logout:`outline`,permission_change:`secondary`,config_change:`secondary`,export:`outline`,import:`outline`},k=50;function A(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function j(e,t=24){return e?e.length>t?`${e.slice(0,t-1)}…`:e:`—`}function M(e){if(!e)return``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function N(){let[e,t]=(0,E.useState)([]),[n,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(null),[I,L]=(0,E.useState)(`all`),[R,z]=(0,E.useState)(``),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(``),[K,q]=(0,E.useState)(0),[J,Y]=(0,E.useState)(!1),[X,Z]=(0,E.useState)(null),Q=(0,E.useCallback)(async()=>{N(!0),F(null);try{let e={};I&&I!==`all`&&(e.action=I),R.trim()&&(e.object_name=R.trim()),B.trim()&&(e.user_id=B.trim()),H&&(e.created_at={...e.created_at||{},$gte:H}),W&&(e.created_at={...e.created_at||{},$lte:`${W}T23:59:59`});let n=new URLSearchParams;Object.keys(e).length>0&&n.set(`$filter`,JSON.stringify(e)),n.set(`$orderby`,`created_at desc`),n.set(`$top`,`51`),n.set(`$skip`,String(K*k));let r=await fetch(`${de}/data/sys_audit_log?${n.toString()}`,{credentials:`include`});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`HTTP ${r.status}: ${e.slice(0,200)||r.statusText}`)}let i=await r.json(),a=Array.isArray(i)?i:Array.isArray(i?.records)?i.records:Array.isArray(i?.data)?i.data:[];Y(a.length>k),t(a.slice(0,k))}catch(e){console.warn(`[AuditLogPage] load failed:`,e),F(e?.message||`Failed to load audit log`),t([]),Y(!1)}finally{N(!1)}},[I,R,B,H,W,K]);(0,E.useEffect)(()=>{Q()},[Q]);let pe=(0,E.useCallback)(()=>{L(`all`),z(``),V(``),U(``),G(``),q(0)},[]),$=(0,E.useMemo)(()=>{let e=0;return I!==`all`&&(e+=1),R.trim()&&(e+=1),B.trim()&&(e+=1),H&&(e+=1),W&&(e+=1),e},[I,R,B,H,W]);return(0,D.jsxs)(`div`,{className:`p-6 space-y-4 max-w-screen-2xl mx-auto`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(ne,{className:`h-6 w-6 text-muted-foreground`}),(0,D.jsxs)(`div`,{className:`flex-1`,children:[(0,D.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Audit Log`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Read-only system activity and record changes. Newest first.`})]}),(0,D.jsxs)(s,{variant:`outline`,size:`sm`,onClick:Q,disabled:n,children:[(0,D.jsx)(f,{className:`h-4 w-4 mr-1 ${n?`animate-spin`:``}`}),`Refresh`]})]}),(0,D.jsx)(v,{children:(0,D.jsxs)(b,{className:`p-4 grid grid-cols-1 md:grid-cols-5 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(S,{className:`text-xs`,children:`Action`}),(0,D.jsxs)(r,{value:I,onValueChange:e=>{L(e),q(0)},children:[(0,D.jsx)(ce,{className:`h-9`,children:(0,D.jsx)(le,{})}),(0,D.jsxs)(h,{children:[(0,D.jsx)(x,{value:`all`,children:`All actions`}),fe.map(e=>(0,D.jsx)(x,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(S,{className:`text-xs`,children:`Object`}),(0,D.jsx)(_,{placeholder:`e.g. account`,value:R,onChange:e=>{z(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(S,{className:`text-xs`,children:`Actor (user id)`}),(0,D.jsx)(_,{placeholder:`user id`,value:B,onChange:e=>{V(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(S,{className:`text-xs`,children:`From`}),(0,D.jsx)(_,{type:`date`,value:H,onChange:e=>{U(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(S,{className:`text-xs`,children:`To`}),(0,D.jsx)(_,{type:`date`,value:W,onChange:e=>{G(e.target.value),q(0)},className:`h-9`})]}),$>0&&(0,D.jsx)(`div`,{className:`md:col-span-5 flex justify-end`,children:(0,D.jsxs)(s,{variant:`ghost`,size:`sm`,onClick:pe,children:[(0,D.jsx)(a,{className:`h-4 w-4 mr-1`}),`Clear filters (`,$,`)`]})})]})}),P&&(0,D.jsxs)(se,{variant:`destructive`,children:[(0,D.jsx)(l,{className:`h-4 w-4`}),(0,D.jsx)(ae,{children:P})]}),(0,D.jsx)(v,{children:(0,D.jsx)(b,{className:`p-0`,children:n&&e.length===0?(0,D.jsx)(`div`,{className:`p-6 space-y-2`,children:Array.from({length:6}).map((e,t)=>(0,D.jsx)(ee,{className:`h-9 w-full`},t))}):e.length===0?(0,D.jsx)(`div`,{className:`p-12`,children:(0,D.jsxs)(m,{children:[(0,D.jsx)(te,{className:`h-8 w-8 text-muted-foreground mb-3`}),(0,D.jsx)(ue,{children:`No audit entries`}),(0,D.jsx)(re,{children:$>0?`Try clearing filters or widening the date range.`:`Events will appear here once tracked objects are modified.`})]})}):(0,D.jsxs)(T,{children:[(0,D.jsx)(i,{children:(0,D.jsxs)(C,{children:[(0,D.jsx)(u,{className:`w-[180px]`,children:`Timestamp`}),(0,D.jsx)(u,{className:`w-[130px]`,children:`Action`}),(0,D.jsx)(u,{children:`Object`}),(0,D.jsx)(u,{children:`Record`}),(0,D.jsx)(u,{children:`Actor`}),(0,D.jsx)(u,{className:`w-[130px]`,children:`IP`})]})}),(0,D.jsx)(oe,{children:e.map(e=>{let t=O[e.action||``]||`outline`;return(0,D.jsxs)(C,{className:`cursor-pointer`,onClick:()=>Z(e),children:[(0,D.jsx)(w,{className:`font-mono text-xs`,children:A(e.created_at)}),(0,D.jsx)(w,{children:(0,D.jsx)(g,{variant:t,children:e.action||`—`})}),(0,D.jsx)(w,{children:e.object_name||`—`}),(0,D.jsx)(w,{className:`font-mono text-xs`,children:j(e.record_id,18)}),(0,D.jsx)(w,{className:`font-mono text-xs`,children:j(e.user_id,18)}),(0,D.jsx)(w,{className:`font-mono text-xs`,children:e.ip_address||`—`})]},e.id)})})]})})}),(e.length>0||K>0)&&(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-sm text-muted-foreground`,children:[(0,D.jsxs)(`span`,{children:[`Page `,K+1,J?``:` · end`]}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[(0,D.jsx)(s,{variant:`outline`,size:`sm`,disabled:K===0||n,onClick:()=>q(e=>Math.max(0,e-1)),children:`Previous`}),(0,D.jsx)(s,{variant:`outline`,size:`sm`,disabled:!J||n,onClick:()=>q(e=>e+1),children:`Next`})]})]}),(0,D.jsx)(y,{open:!!X,onOpenChange:e=>!e&&Z(null),children:(0,D.jsxs)(o,{side:`right`,className:`sm:max-w-2xl w-full overflow-y-auto`,children:[(0,D.jsxs)(d,{children:[(0,D.jsxs)(ie,{className:`flex items-center gap-2`,children:[(0,D.jsx)(g,{variant:X&&O[X.action||``]||`outline`,children:X?.action||`—`}),X?.object_name||`Audit Event`]}),(0,D.jsx)(p,{children:X?.id?(0,D.jsx)(`span`,{className:`font-mono text-xs`,children:X.id}):null})]}),X&&(0,D.jsxs)(`div`,{className:`mt-6 space-y-5`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-sm`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Timestamp`}),(0,D.jsx)(`div`,{className:`font-mono`,children:A(X.created_at)})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`IP Address`}),(0,D.jsx)(`div`,{className:`font-mono`,children:X.ip_address||`—`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Actor (user_id)`}),(0,D.jsx)(`div`,{className:`font-mono break-all`,children:X.user_id||`—`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tenant`}),(0,D.jsx)(`div`,{className:`font-mono break-all`,children:X.tenant_id||`—`})]}),(0,D.jsxs)(`div`,{className:`col-span-2`,children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Target record`}),(0,D.jsxs)(`div`,{className:`font-mono text-sm break-all`,children:[X.object_name||`—`,` / `,X.record_id||`—`]})]}),X.user_agent&&(0,D.jsxs)(`div`,{className:`col-span-2`,children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`User Agent`}),(0,D.jsx)(`div`,{className:`font-mono text-xs break-all`,children:X.user_agent})]})]}),(X.old_value||X.new_value)&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`div`,{className:`text-sm font-medium`,children:`Change payload`}),X.old_value&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Before`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-64 overflow-auto`,children:M(X.old_value)})]}),X.new_value&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`After`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-64 overflow-auto`,children:M(X.new_value)})]})]})]}),X.metadata&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-sm font-medium mb-2`,children:`Metadata`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-48 overflow-auto`,children:M(X.metadata)})]})]})]})]})})]})}export{N as AuditLogPage};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-DAXXjFlN.js";import{h as e,m as t,r as n,y as r}from"./vendor-react-BKSb6vFP.js";import{Q as i,Z as a,tt as o}from"./ui-components-Ci5ufF7g.js";import{t as s}from"./componentRegistry-ByxoJqMW.js";r();var c=n();function l({extraProps:n}={}){let r=t(),[l]=e(),u=r.ns,d=r.name,f=u&&d?`${u}:${d}`:u??``,p=s(f);if(!p)return(0,c.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,c.jsxs)(a,{children:[(0,c.jsx)(o,{children:`Component not registered`}),(0,c.jsxs)(i,{children:[`No component is registered for `,(0,c.jsx)(`code`,{className:`font-mono`,children:f||`(empty)`}),`. Ensure the plugin that provides this surface is installed and has called`,(0,c.jsx)(`code`,{className:`font-mono`,children:` registerAppComponent()`}),`.`]})]})});let m={};for(let[e,t]of l.entries())m[e]=t;let h=p.component;return(0,c.jsx)(h,{...m,...n??{}})}export{l as ComponentNavView,l as default};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{$n as r,Mc as i,Or as a,Qn as o,Rs as s,Uc as c,Va as l,Xn as ee,Ya as u,Zn as d,bs as f,er as p,ho as m,mn as h,rc as g,ro as _,tc as v,tr as y,xi as b,yi as x}from"./ui-components-Ci5ufF7g.js";import{n as S}from"./createDerive-DGOUbVlZ.js";import{a as C,i as w,n as T,o as E,r as D,s as O,t as k}from"./plugin-view-DZXBuUS9.js";var A=e(n(),1),j=t();function M({title:e,description:t,icon:n,actions:r,accentColor:a,sticky:o=!1,className:s,"data-testid":c}){return(0,j.jsxs)(`div`,{style:{"--page-header-accent":a||`hsl(var(--primary))`},className:i(`relative shrink-0 border-b bg-background z-10`,o&&`sticky top-0 bg-background/85 backdrop-blur supports-[backdrop-filter]:bg-background/75`,s),"data-testid":c??`page-header`,children:[(0,j.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 top-0 h-[2px] opacity-80`,style:{background:`linear-gradient(90deg, transparent, var(--page-header-accent), transparent)`}}),(0,j.jsxs)(`div`,{className:`flex justify-between items-center gap-3 py-2.5 sm:py-3 px-4 sm:px-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[n&&(0,j.jsx)(`div`,{className:i(`shrink-0 inline-flex items-center justify-center rounded-lg`,`h-9 w-9 sm:h-10 sm:w-10`,`[&_svg]:h-[18px] [&_svg]:w-[18px] sm:[&_svg]:h-5 sm:[&_svg]:w-5`),style:{color:`var(--page-header-accent)`,background:`linear-gradient(135deg, color-mix(in srgb, var(--page-header-accent) 18%, transparent), color-mix(in srgb, var(--page-header-accent) 6%, transparent))`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, var(--page-header-accent) 22%, transparent)`},children:n}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`h1`,{className:`text-base sm:text-lg lg:text-xl font-semibold tracking-tight text-foreground truncate leading-tight`,children:e}),t&&(0,j.jsx)(`p`,{className:`text-xs sm:text-sm text-muted-foreground truncate hidden sm:block max-w-xl mt-0.5`,children:t})]})]}),r&&(0,j.jsx)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:r})]})]})}function te(e){return[{type:`grid`,icon:_,label:e(`console.objectView.viewTypeGrid`),description:e(`console.objectView.viewTypeGridDesc`)},{type:`kanban`,icon:x,label:e(`console.objectView.viewTypeKanban`),description:e(`console.objectView.viewTypeKanbanDesc`)},{type:`calendar`,icon:g,label:e(`console.objectView.viewTypeCalendar`),description:e(`console.objectView.viewTypeCalendarDesc`)},{type:`gallery`,icon:m,label:e(`console.objectView.viewTypeGallery`),description:e(`console.objectView.viewTypeGalleryDesc`)},{type:`timeline`,icon:f,label:e(`console.objectView.viewTypeTimeline`),description:e(`console.objectView.viewTypeTimelineDesc`)},{type:`gantt`,icon:b,label:e(`console.objectView.viewTypeGantt`),description:e(`console.objectView.viewTypeGanttDesc`)},{type:`map`,icon:l,label:e(`console.objectView.viewTypeMap`),description:e(`console.objectView.viewTypeMapDesc`)},{type:`chart`,icon:v,label:e(`console.objectView.viewTypeChart`),description:e(`console.objectView.viewTypeChartDesc`)},{type:`tree`,icon:u,label:e(`console.objectView.viewTypeTree`),description:e(`console.objectView.viewTypeTreeDesc`)}]}function N(e,t){for(let n=1;n<1e3;n++){let r=`${e} ${n}`;if(!t.has(r))return r}return e}var P={kanban:[{key:`groupByField`,i18nKey:`console.objectView.groupByField`,helpI18nKey:`console.objectView.groupByFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`,preferred:T}],calendar:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.startDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],timeline:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.timelineDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gantt:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.ganttStartDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`endDateField`,i18nKey:`console.objectView.endDateField`,helpI18nKey:`console.objectView.ganttEndDateFieldHelp`,filter:e=>e.type===`date`,preferred:k},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gallery:[{key:`coverField`,i18nKey:`console.objectView.imageField`,helpI18nKey:`console.objectView.imageFieldHelp`,filter:e=>E(e)}],map:[{key:`latitudeField`,i18nKey:`console.objectView.latitudeField`,helpI18nKey:`console.objectView.latitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`latitude`)},{key:`longitudeField`,i18nKey:`console.objectView.longitudeField`,helpI18nKey:`console.objectView.longitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`longitude`)}],chart:[{key:`chartType`,i18nKey:`console.objectView.chartType`,helpI18nKey:`console.objectView.chartTypeHelp`,kind:`enum`,enumOptions:[{value:`bar`,i18nKey:`console.objectView.chartTypeBar`},{value:`line`,i18nKey:`console.objectView.chartTypeLine`},{value:`pie`,i18nKey:`console.objectView.chartTypePie`},{value:`area`,i18nKey:`console.objectView.chartTypeArea`},{value:`scatter`,i18nKey:`console.objectView.chartTypeScatter`}],defaultValue:`bar`},{key:`xAxisField`,i18nKey:`console.objectView.xAxisField`,helpI18nKey:`console.objectView.xAxisFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`||e.type===`date`||e.type===`text`,preferred:T},{key:`yAxisFields`,i18nKey:`console.objectView.yAxisField`,helpI18nKey:`console.objectView.yAxisFieldHelp`,filter:e=>e.type===`number`}],tree:[{key:`parentField`,i18nKey:`console.objectView.parentField`,helpI18nKey:`console.objectView.parentFieldHelp`,filter:e=>e.rawType===`tree`||e.rawType===`lookup`||e.rawType===`master_detail`}]};function F({open:e,onOpenChange:t,onCreate:n,existingLabels:l,availableTypes:u,objectDef:f}){let{t:m}=c(),g=(0,A.useMemo)(()=>te(m),[m]),_=(0,A.useMemo)(()=>u&&u.length>0?g.filter(e=>u.includes(e.type)):g,[g,u]),v=(0,A.useMemo)(()=>new Set(l??[]),[(l??[]).join(`\0`)]),b=(0,A.useMemo)(()=>f?w(f):[],[f]),[x,C]=(0,A.useState)(_[0]?.type??`grid`),[T,E]=(0,A.useState)(``),[D,k]=(0,A.useState)(!1),[M,F]=(0,A.useState)(``),[I,L]=(0,A.useState)(!1),[R,z]=(0,A.useState)({});(0,A.useEffect)(()=>{e&&(C(_[0]?.type??`grid`),k(!1),L(!1),z({}))},[e,_]),(0,A.useEffect)(()=>{if(!D){let e=_.find(e=>e.type===x);E(N(e?.label??`View`,v))}},[x,D,_,v]),(0,A.useEffect)(()=>{I||F(S(T))},[T,I]);let B=P[x]??[],V=e=>e.kind===`enum`?(e.enumOptions?.length??0)>0:!f||(e.filter?b.filter(e.filter):b).length>0,H=(0,A.useMemo)(()=>{let e={};return _.forEach(t=>{let n=(P[t.type]??[]).find(e=>!V(e));e[t.type]=n??null}),e},[_,b,f]),U=e=>R[`${x}.${e}`]??``,W=(e,t)=>z(n=>({...n,[`${x}.${e}`]:t})),G=T.trim(),K=G.length>0&&v.has(G),q=B.every(e=>U(e.key).length>0),J=/^[a-z_][a-z0-9_]*$/,Y=M.trim(),X=Y.length===0,Z=Y.length>0&&!J.test(Y),Q=G.length>0&&!K&&q&&!X&&!Z;(0,A.useEffect)(()=>{B.length!==0&&B.forEach(e=>{if(U(e.key).length>0)return;if(e.kind===`enum`){e.defaultValue&&W(e.key,e.defaultValue);return}let t=e.filter?b.filter(e.filter):b;if(t.length===0)return;if(t.length===1){W(e.key,t[0].value);return}let n=O(t,e.preferred??[]);n&&W(e.key,n)})},[x,b]);let $=()=>{if(!Q)return;let e={};B.forEach(t=>{let n=U(t.key);n&&(e[t.key]=t.key===`yAxisFields`?[n]:n)});let r={type:x,label:G,name:Y};Object.keys(e).length>0&&(r[x]=e),n(r),t(!1)};return(0,j.jsx)(ee,{open:e,onOpenChange:t,children:(0,j.jsxs)(d,{className:`sm:max-w-[560px]`,"data-testid":`create-view-dialog`,children:[(0,j.jsxs)(p,{children:[(0,j.jsx)(y,{children:m(`console.objectView.createView`)}),(0,j.jsx)(o,{children:m(`console.objectView.createViewDesc`)})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-4 gap-2 py-2`,"data-testid":`create-view-type-grid`,children:_.map(({type:e,label:t,description:n,icon:r})=>{let a=e===x,o=H[e],s=!!o,c=s?m(`console.objectView.viewTypeUnavailable`,{field:m(o.i18nKey)}):void 0;return(0,j.jsxs)(`button`,{type:`button`,"data-testid":`create-view-type-${e}`,"aria-pressed":a,"aria-disabled":s,disabled:s,title:c,onClick:()=>{s||C(e)},className:i(`group flex flex-col items-start gap-1 rounded-lg border bg-background p-3 text-left transition-colors`,!s&&`hover:border-primary/60 hover:bg-accent/40`,a&&!s?`border-primary ring-2 ring-primary/30 bg-accent/40`:`border-border`,s&&`opacity-50 cursor-not-allowed`),children:[(0,j.jsx)(r,{className:i(`h-5 w-5`,a&&!s?`text-primary`:`text-muted-foreground group-hover:text-foreground`)}),(0,j.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:t}),(0,j.jsx)(`div`,{className:`text-[10px] leading-tight text-muted-foreground line-clamp-2`,children:s?m(`console.objectView.viewTypeUnavailableShort`):n})]},e)})}),B.length>0&&(0,j.jsx)(`div`,{className:`space-y-3 rounded-md border border-dashed bg-muted/30 p-3`,"data-testid":`create-view-required-fields`,children:B.map(e=>{let t=U(e.key),n=e.kind===`enum`,r=n?[]:e.filter?b.filter(e.filter):b,a=!n&&b.length>0&&r.length===0;return(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-required-${e.key}`,className:`text-xs font-medium`,children:[m(e.i18nKey),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),(0,j.jsxs)(`select`,{id:`create-view-required-${e.key}`,"data-testid":`create-view-required-${e.key}`,value:t,onChange:t=>W(e.key,t.target.value),disabled:a,className:i(`h-9 w-full rounded-md border bg-background px-2 text-xs`,`border-input`),children:[(0,j.jsx)(`option`,{value:``,children:m(n?`console.objectView.selectOption`:`console.objectView.selectField`)}),n?e.enumOptions.map(e=>(0,j.jsx)(`option`,{value:e.value,children:m(e.i18nKey)},e.value)):r.map(e=>(0,j.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),e.helpI18nKey&&!a&&(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:m(e.helpI18nKey)}),a&&(0,j.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] text-destructive`,"data-testid":`create-view-error-no-field-${e.key}`,children:[(0,j.jsx)(s,{className:`h-3 w-3`}),m(`console.objectView.noEligibleFieldForType`)]})]},e.key)})}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-name-input`,className:`text-xs font-medium`,children:[m(`console.objectView.title`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),(0,j.jsx)(h,{id:`create-view-name-input`,"data-testid":`create-view-name-input`,autoFocus:!0,value:T,onChange:e=>{E(e.target.value),k(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:m(`console.objectView.newView`),className:`h-9`}),K&&(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-duplicate`,children:m(`console.objectView.duplicateViewName`)})]}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-machine-name-input`,className:`text-xs font-medium`,children:[m(`console.objectView.viewName`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),(0,j.jsx)(h,{id:`create-view-machine-name-input`,"data-testid":`create-view-machine-name-input`,value:M,onChange:e=>{F(e.target.value),L(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:`grid_1`,className:`h-9 font-mono`}),X?(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:m(`console.objectView.viewNameRequired`)}):Z?(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-machine-name`,children:m(`console.objectView.viewNameInvalid`)}):(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:m(`console.objectView.viewNameHelp`)})]}),(0,j.jsxs)(r,{className:`mt-2`,children:[(0,j.jsx)(a,{type:`button`,variant:`outline`,onClick:()=>t(!1),"data-testid":`create-view-cancel`,children:m(`console.objectView.cancel`)}),(0,j.jsx)(a,{type:`button`,disabled:!Q,onClick:$,"data-testid":`create-view-submit`,children:m(`console.objectView.create`)})]})]})})}export{M as n,F as t};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{m as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{M as a,j as o,v as s}from"./framework-BqSgd3ir.js";import{$n as c,Or as l,Q as u,Qn as d,Rc as f,Uc as p,Xn as m,Z as h,Zn as g,er as _,io as v,tr as y,tt as b}from"./ui-components-Ci5ufF7g.js";import{r as x}from"./vendor-ui-utils-D-WJ115h.js";import"./AdapterProvider-CqW7TSvk.js";import{n as S}from"./plugin-form-D4kHsl47.js";import"./MetadataProvider-CjWp0ChY.js";import{r as C}from"./ExpressionProvider-CyltvbX0.js";import{t as w}from"./preferLocal-CKqyhTP9.js";import{t as T}from"./utils-CFdPTF34.js";import{n as E,t as D}from"./MetadataInspector-CcRGESLn.js";import{n as O}from"./skeletons-D0Z3uPzj.js";import{n as k}from"./plugin-dashboard-Cr7jkjy7.js";import{t as A}from"./useOpenRecordList-BfKYZKMn.js";var j=t({DashboardView:()=>P}),M=e(i(),1),N=r();function P({dataSource:e}){let t=A(),{dashboardName:r}=n(),{showDebug:i}=E(),j=o(),{t:P}=p(),{dashboardLabel:F,dashboardDescription:I}=f(),[L,R]=(0,M.useState)(!0),[z,B]=(0,M.useState)(null),V=(0,M.useCallback)(e=>{B(t=>(t&&t.resolve(e),null))},[]),H=(0,M.useCallback)(e=>new Promise(t=>{let n;if(typeof e==`string`){let t=e.match(/^(create|new|add|edit|update)_(.+)$/);if(t){let e=t[1];n={objectName:t[2],mode:e===`edit`||e===`update`?`edit`:`create`}}else n={objectName:e,mode:`create`}}else n=e;B({schema:n,resolve:t})}),[]),U=(0,M.useMemo)(()=>({export_dashboard_pdf:async()=>{x.info(P(`dashboardActions.pdfPreparing`));try{return window.print(),{success:!0}}catch(e){return x.error(P(`dashboardActions.exportFailed`,{message:e?.message||String(e)})),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(x.info(P(`dashboardActions.forecastSoon`)),{success:!0})}),[P]);(0,M.useEffect)(()=>{R(!0),queueMicrotask(()=>R(!1))},[r]);let{dashboards:W,objects:G}=a(),{app:K}=C(),q=w(W,r,K?._packageId),J=(0,M.useMemo)(()=>new Set((G||[]).map(e=>e?.name).filter(Boolean)),[G]),Y=(0,M.useMemo)(()=>{if(!q||J.size===0)return q;let e=q.widgets;if(!Array.isArray(e)||e.length===0)return q;let t=e.filter(e=>{let t=e?.requiresObject??e?.object;return!t||J.has(t)});return t.length===e.length?q:{...q,widgets:t}},[q,J]);return L?(0,N.jsx)(O,{}):q?(0,N.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,N.jsx)(`div`,{className:`flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0`,children:(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(()=>{let e=T((Y||q).title,P),t=T(q.label,P),n=F({name:q.name,label:t});return(0,N.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:e||n||q.name})})(),(()=>{let e=(Y||q).description??q.description,t=I({name:q.name,description:T(e,P)});return t?(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:t}):null})()]})}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,N.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,N.jsx)(s,{value:{openRecordList:t},children:(0,N.jsx)(k,{schema:Y,dataSource:e,modalHandler:H,scriptHandlers:U,hideHeaderText:!0})})}),(0,N.jsx)(D,{open:i,sections:[{title:`Dashboard Configuration`,data:Y}]})]}),z&&z.schema?.objectName?(0,N.jsx)(S,{schema:{type:`object-form`,formType:`modal`,objectName:z.schema.objectName,mode:z.schema.mode||`create`,recordId:z.schema.recordId,title:z.schema.title,description:z.schema.description,fields:z.schema.fields,open:!0,onOpenChange:e=>{e||V({success:!1})},onSuccess:e=>{V({success:!0,reload:!0,data:e})},onCancel:()=>{V({success:!1})},showSubmit:!0,showCancel:!0},dataSource:j}):z?(0,N.jsx)(m,{open:!0,onOpenChange:e=>{e||V({success:!1})},children:(0,N.jsxs)(g,{children:[(0,N.jsxs)(_,{children:[(0,N.jsx)(y,{children:z.schema?.title||P(`actionDialog.defaultActionTitle`)}),z.schema?.description&&(0,N.jsx)(d,{children:z.schema.description})]}),(0,N.jsxs)(c,{children:[(0,N.jsx)(l,{variant:`outline`,onClick:()=>V({success:!1}),children:P(`actionDialog.cancel`)}),(0,N.jsx)(l,{onClick:()=>V({success:!0}),children:P(`actionDialog.ok`)})]})]})}):null]}):(0,N.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,N.jsxs)(h,{children:[(0,N.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,N.jsx)(v,{className:`h-6 w-6 text-muted-foreground`})}),(0,N.jsx)(b,{children:P(`empty.dashboardNotFound`)}),(0,N.jsx)(u,{children:P(`empty.dashboardNotFoundDescription`,{name:r})})]})})}export{j as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{Y as r,Yt as i}from"./framework-BqSgd3ir.js";var a=e(n(),1),o=t(),s=(0,a.createContext)(null);function c({children:e,user:t={},app:n={},data:c={},features:l={}}){let u=(0,a.useMemo)(()=>({user:t,app:n,data:c,features:l,evaluator:new i({current_user:t,user:t,ctx:{user:t},os:{user:t},app:n,data:c,features:l})}),[t,n,c,l]),d=(0,a.useMemo)(()=>({current_user:t,user:t,ctx:{user:t},os:{user:t},app:n,data:c,features:l}),[t,n,c,l]);return(0,o.jsx)(s.Provider,{value:u,children:(0,o.jsx)(r,{scope:d,children:e})})}function l(){let e=(0,a.useContext)(s);if(!e){let e={user:{},app:{},data:{},features:{}},t={current_user:{},ctx:{user:{}},os:{user:{}},...e};return{...e,evaluator:new i(t)}}return e}function u(e,t){if(e==null||e===!0||e===`true`)return!0;if(e===!1||e===`false`)return!1;if(typeof e==`string`&&e.includes("${"))try{return t.evaluateCondition(e)}catch{return!0}return!0}export{u as n,l as r,c as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BKSb6vFP.js";import{j as r}from"./framework-BqSgd3ir.js";import{Ct as i,Es as a,Fs as o,Gt as s,Jt as c,Lr as l,Or as u,Rs as d,St as f,Tt as p,Xt as m,Yi as h,Yt as g,Zt as _,aa as v,bs as y,bt as b,cr as x,fr as S,in as C,lr as w,mn as T,mt as E,or as D,qa as O,qt as k,sr as A,ur as j,vn as M,wt as N,xt as P,yt as F}from"./ui-components-Ci5ufF7g.js";import"./src-RHOMTPFk.js";var I=e(n(),1),L=t();function R({status:e}){let t={success:{icon:o,cls:`text-emerald-600 border-emerald-300`},completed:{icon:o,cls:`text-emerald-600 border-emerald-300`},failed:{icon:a,cls:`text-red-600 border-red-300`},error:{icon:a,cls:`text-red-600 border-red-300`},running:{icon:O,cls:`text-blue-600 border-blue-300 animate-pulse`},pending:{icon:y,cls:`text-amber-600 border-amber-300`},skipped:{icon:d,cls:`text-muted-foreground`}}[e]??{icon:d,cls:`text-muted-foreground`},n=t.icon;return(0,L.jsxs)(S,{variant:`outline`,className:`text-[10px] font-mono inline-flex items-center gap-1 ${t.cls}`,children:[(0,L.jsx)(n,{className:`h-3 w-3`}),e]})}function z(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function B(e,t){switch(t){case`number`:{if(e===``)return;let t=Number(e);return Number.isNaN(t)?e:t}case`boolean`:return e===`true`;case`object`:case`list`:case`array`:if(e.trim()===``)return;try{return JSON.parse(e)}catch{return e}default:return e}}function V({data:e}){return(0,L.jsx)(`pre`,{className:`rounded border bg-muted/30 p-2 text-xs font-mono overflow-auto whitespace-pre-wrap break-all max-h-96`,children:JSON.stringify(e,null,2)})}function H(){let e=r()?.getClient?.(),[t,n]=(0,I.useState)([]),[i,a]=(0,I.useState)(!0),[o,c]=(0,I.useState)(null),[d,f]=(0,I.useState)(``),[p,m]=(0,I.useState)(0),g=(0,I.useCallback)(async()=>{if(!e?.meta?.getItems){c(`meta.getItems is not available on this client`),a(!1);return}a(!0),c(null);try{let t=await e.meta.getItems(`flow`),r=(Array.isArray(t)?t:Array.isArray(t?.items)?t.items:Array.isArray(t?.value)?t.value:[]).map(e=>({name:e?.spec?.name??e?.name,label:e?.spec?.label,spec:e?.spec??e,updatedAt:e?.updatedAt??e?.updated_at})).filter(e=>e.name);n(r),!d&&r.length>0&&f(r[0].name)}catch(e){c(e?.message??String(e))}finally{a(!1)}},[e,d]);(0,I.useEffect)(()=>{g()},[g]);let _=(0,I.useMemo)(()=>t.find(e=>e.name===d)??null,[t,d]);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(l,{className:`h-5 w-5`}),`Flow Runs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Pick a flow, trigger a test run with sample inputs, and inspect recent run history`})]}),(0,L.jsxs)(D,{children:[(0,L.jsx)(w,{className:`pb-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(j,{className:`text-base`,children:`Flow`}),(0,L.jsx)(x,{children:`Select a flow definition to test`})]}),(0,L.jsxs)(u,{variant:`outline`,size:`sm`,onClick:g,disabled:i,children:[(0,L.jsx)(h,{className:`h-3.5 w-3.5 mr-2 ${i?`animate-spin`:``}`}),`Refresh`]})]})}),(0,L.jsxs)(A,{children:[i&&(0,L.jsx)(s,{className:`h-9 w-72`}),o&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:o}),!i&&!o&&t.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No flow definitions found.`}),!i&&!o&&t.length>0&&(0,L.jsx)(`select`,{value:d,onChange:e=>f(e.target.value),className:`flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring`,children:t.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.label?`${e.label} (${e.name})`:e.name},e.name))})]})]}),_&&(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsx)(U,{client:e,flow:_.spec,onExecuted:()=>m(e=>e+1)}),(0,L.jsx)(W,{client:e,flowName:_.name,refreshKey:p})]})]})}function U({client:e,flow:t,onExecuted:n}){let r=(0,I.useMemo)(()=>(t?.variables??[]).filter(e=>e?.isInput),[t]),[i,s]=(0,I.useState)({}),[c,l]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),[m,h]=(0,I.useState)(null);(0,I.useEffect)(()=>{s({}),f(null),h(null)},[t?.name]);let g=(e,t)=>s(n=>({...n,[e]:t}));return(0,L.jsxs)(D,{children:[(0,L.jsxs)(w,{className:`pb-3`,children:[(0,L.jsx)(j,{className:`text-base`,children:`Test Run`}),(0,L.jsx)(x,{children:`Provide input values and invoke the flow`})]}),(0,L.jsxs)(A,{className:`space-y-3`,children:[r.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This flow declares no input variables. Click Run to invoke with no parameters.`}),r.map(e=>(0,L.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,L.jsxs)(M,{htmlFor:`var-${e.name}`,className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),(0,L.jsx)(S,{variant:`outline`,className:`text-[10px] font-mono`,children:e.type})]}),e.type===`boolean`?(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(p,{id:`var-${e.name}`,checked:i[e.name]===`true`,onCheckedChange:t=>g(e.name,t?`true`:`false`)}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i[e.name]===`true`?`true`:`false`})]}):e.type===`object`||e.type===`list`||e.type===`array`?(0,L.jsx)(E,{id:`var-${e.name}`,placeholder:`JSON ${e.type}`,value:i[e.name]??``,onChange:t=>g(e.name,t.target.value),className:`font-mono text-xs min-h-[80px]`}):(0,L.jsx)(T,{id:`var-${e.name}`,type:e.type===`number`?`number`:`text`,value:i[e.name]??``,onChange:t=>g(e.name,t.target.value)})]},e.name)),(0,L.jsx)(`div`,{className:`pt-1`,children:(0,L.jsxs)(u,{onClick:async()=>{if(!e?.automation?.execute){h(`automation.execute is not available on this client`);return}l(!0),h(null),f(null);try{let a={};for(let e of r){let t=i[e.name];t!==void 0&&(a[e.name]=B(t,e.type))}let o=await e.automation.execute(t.name,{params:a});f(o),n?.()}catch(e){h(e?.message??String(e))}finally{l(!1)}},disabled:c,size:`sm`,children:[c?(0,L.jsx)(O,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,L.jsx)(v,{className:`h-3.5 w-3.5 mr-2`}),c?`Running…`:`Run Flow`]})}),(d||m)&&(0,L.jsxs)(`div`,{className:`pt-2 border-t mt-2 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[m||d?.success===!1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(a,{className:`h-4 w-4 text-red-500`}),` Failed`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{className:`h-4 w-4 text-emerald-500`}),` Result`]}),typeof d?.durationMs==`number`&&(0,L.jsxs)(S,{variant:`secondary`,className:`text-[10px] font-mono`,children:[d.durationMs,` ms`]})]}),m&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:m}),d&&(0,L.jsx)(V,{data:d})]})]})]})}function W({client:e,flowName:t,refreshKey:n}){let[r,a]=(0,I.useState)([]),[o,l]=(0,I.useState)(!0),[d,p]=(0,I.useState)(null),[v,y]=(0,I.useState)(null),[T,E]=(0,I.useState)(null),[M,B]=(0,I.useState)(!1),[H,U]=(0,I.useState)(null),W=(0,I.useCallback)(async()=>{if(!e?.automation?.listRuns){p(`automation.listRuns is not available on this client`),l(!1);return}l(!0),p(null);try{let n=await e.automation.listRuns(t,{limit:20}),r=Array.isArray(n)?n:n?.items??n?.runs??[];a(r)}catch(e){p(e?.message??String(e))}finally{l(!1)}},[e,t]);(0,I.useEffect)(()=>{W()},[W,n]);let G=async n=>{y(n),E(null),U(null),B(!0);try{let r=await e.automation.getRun(t,n);E(r?.run??r)}catch(e){U(e?.message??String(e))}finally{B(!1)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(D,{children:[(0,L.jsx)(w,{className:`pb-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(j,{className:`text-base`,children:`Recent Runs`}),(0,L.jsx)(x,{className:`font-mono text-xs`,children:t})]}),(0,L.jsxs)(u,{variant:`outline`,size:`sm`,onClick:W,disabled:o,children:[o?(0,L.jsx)(O,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,L.jsx)(h,{className:`h-3.5 w-3.5 mr-2`}),`Refresh`]})]})}),(0,L.jsxs)(A,{children:[o&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(s,{className:`h-8 w-full`}),(0,L.jsx)(s,{className:`h-8 w-full`}),(0,L.jsx)(s,{className:`h-8 w-full`})]}),!o&&d&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:d}),!o&&!d&&r.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground py-6 text-center`,children:`No runs yet. Use the Test Run panel to invoke this flow.`}),!o&&!d&&r.length>0&&(0,L.jsxs)(F,{children:[(0,L.jsx)(i,{children:(0,L.jsxs)(N,{children:[(0,L.jsx)(f,{children:`Run`}),(0,L.jsx)(f,{children:`Status`}),(0,L.jsx)(f,{children:`Started`}),(0,L.jsx)(f,{className:`text-right`,children:`Duration`})]})}),(0,L.jsx)(b,{children:r.map(e=>(0,L.jsxs)(N,{className:`cursor-pointer`,onClick:()=>G(e.id),children:[(0,L.jsxs)(P,{className:`font-mono text-xs`,children:[e.id.slice(0,12),`…`]}),(0,L.jsx)(P,{children:(0,L.jsx)(R,{status:e.status})}),(0,L.jsx)(P,{className:`text-xs text-muted-foreground`,children:z(e.startedAt)}),(0,L.jsx)(P,{className:`text-right font-mono text-xs`,children:typeof e.durationMs==`number`?`${e.durationMs} ms`:`—`})]},e.id))})]})]})]}),(0,L.jsx)(k,{open:!!v,onOpenChange:e=>{e||(y(null),E(null))},children:(0,L.jsxs)(c,{side:`right`,className:`w-full sm:max-w-2xl p-0 flex flex-col`,children:[(0,L.jsxs)(m,{className:`p-4 border-b`,children:[(0,L.jsxs)(_,{className:`font-mono text-sm break-all`,children:[`Run `,v]}),(0,L.jsx)(g,{children:T&&(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,L.jsx)(R,{status:T.status}),typeof T.durationMs==`number`&&(0,L.jsxs)(S,{variant:`secondary`,className:`text-[10px] font-mono`,children:[T.durationMs,` ms`]}),(0,L.jsx)(`span`,{className:`text-xs`,children:z(T.startedAt)})]})})]}),(0,L.jsxs)(C,{className:`flex-1 p-4`,children:[M&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(s,{className:`h-16 w-full`}),(0,L.jsx)(s,{className:`h-16 w-full`}),(0,L.jsx)(s,{className:`h-16 w-full`})]}),H&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:H}),!M&&T&&(0,L.jsx)(`div`,{className:`space-y-3`,children:Array.isArray(T.steps)&&T.steps.length>0?T.steps.map((e,t)=>(0,L.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:[`#`,t+1]}),(0,L.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.nodeLabel||e.nodeId}),e.nodeType&&(0,L.jsx)(S,{variant:`outline`,className:`text-[10px] font-mono`,children:e.nodeType}),(0,L.jsx)(R,{status:e.status}),typeof e.durationMs==`number`&&(0,L.jsxs)(S,{variant:`secondary`,className:`text-[10px] font-mono ml-auto`,children:[e.durationMs,` ms`]})]}),e.input!==void 0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Input`}),(0,L.jsx)(V,{data:e.input})]}),e.output!==void 0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Output`}),(0,L.jsx)(V,{data:e.output})]}),e.error&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-red-500 mb-1`,children:`Error`}),(0,L.jsx)(V,{data:e.error})]})]},`${e.nodeId}-${t}`)):(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Run`}),(0,L.jsx)(V,{data:T})]})})]})]})})]})}export{H as FlowRunsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{f as t,h as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{H as a,Ht as o,M as s,W as c,j as l}from"./framework-BqSgd3ir.js";import{J as u,Q as d,Uc as f,Z as p,ls as m,tt as h}from"./ui-components-Ci5ufF7g.js";import"./MetadataProvider-CjWp0ChY.js";import{t as ee}from"./RecordDetailView-DpRJpP6t.js";import{u as g}from"./plugins-views-BGSw-KmQ.js";var _=e(i(),1),v=`uf_`;function y(e){let t={};return e.forEach((e,n)=>{if(n.startsWith(v)&&e!==``){let r=n.slice(3);t[r]=e.split(`,`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}}),Object.keys(t).length>0?t:void 0}function b(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=v+e;r&&r.length>0?n.set(t,r.map(e=>encodeURIComponent(String(e))).join(`,`)):n.delete(t)}return n}var x=r();function S(e){return Array.isArray(e?.columns)&&e.columns.length>0}function C(e,t){let n=e?.listViews||e?.list_views||{},r=(t?[n[`${e?.name}.${t}`],n[t],...t==="default"||t===`list`?[e?.list]:[]]:[e?.list,...Object.values(n)]).filter(Boolean);return r.find(S)??r[0]}function w(e){let t=e?.highlightFields;if(Array.isArray(t)&&t.length>0)return t.filter(t=>e.fields?.[t]);let n=e?.fields;return n&&typeof n==`object`?Object.entries(n).filter(([e,t])=>t&&!t.hidden&&!o(e,t)).map(([e])=>e).slice(0,6):[]}function T(e,t){let n=e?.fields;if(!(!n||typeof n!=`object`))return Object.entries(n).find(([e,n])=>n&&!n.hidden&&!o(e,n)&&t(e,n))?.[0]}var E=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),D=new Set([`date`,`datetime`,`time`]),O=new Set([`image`,`file`,`attachment`,`avatar`,`photo`]);function k(e){let t=T(e,(e,t)=>E.has(t.type))??T(e,e=>/status|stage|state|priority|category|kind/i.test(e));return t?{groupField:t,groupByField:t}:void 0}function A(e){return T(e,(e,t)=>D.has(t.type))??T(e,e=>/date|due|start|end|deadline|schedule/i.test(e))}function j(e){let t=A(e);return t?{startDateField:t}:void 0}function M(e){let t=T(e,(e,t)=>O.has(t.type));return t?{coverField:t}:void 0}var N=new Set([`location`,`geo`,`geolocation`,`geopoint`,`point`]);function P(e){let t=T(e,(e,t)=>D.has(t.type)&&/start|begin|kickoff/i.test(e))??T(e,(e,t)=>D.has(t.type));if(!t)return;let n=T(e,(e,n)=>D.has(n.type)&&e!==t&&/end|due|finish|deadline|close/i.test(e))??T(e,(e,n)=>D.has(n.type)&&e!==t);if(!n)return;let r=T(e,(e,t)=>(t.type===`number`||t.type===`percent`)&&/progress|percent|complete/i.test(e));return{startDateField:t,endDateField:n,...r?{progressField:r}:{}}}function F(e){let t=T(e,(e,t)=>N.has(t.type))??T(e,e=>/location|address|geo|coords?|place|venue/i.test(e));return t?{locationField:t}:void 0}function I({page:e,className:r,onConfigChange:i,reserveEditAffordance:o}){let{t:v}=f(),{objects:T}=s(),E=l(),D=t(),[O,A]=n(),[N]=_.useState(()=>y(new URLSearchParams(window.location.search))),I=_.useCallback(e=>{A(t=>b(t,e),{replace:!0})},[A]),L=e?.interfaceConfig||{},R=_.useMemo(()=>(T||[]).find(e=>e.name===L.source),[T,L.source]),z=_.useMemo(()=>C(R,L.sourceView),[R,L.sourceView]),B=L.recordAction===`page`||L.recordAction===`modal`||L.recordAction===`none`?L.recordAction:`drawer`,V=_.useCallback(e=>`/apps/${window.location.pathname.split(`/`)[2]||``}/${L.source}/record/${encodeURIComponent(String(e))}`,[L.source]),H=a({navigation:{mode:B===`none`?`none`:B},objectName:L.source,onNavigate:e=>D(V(e))}),U=O.get(`recordId`),W=_.useCallback((e,t)=>{if(B===`none`)return;let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(V(n),`_blank`);return}if((B===`drawer`||B===`modal`)&&n!=null){A(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t});return}H.handleClick(e,t)},[B,V,H,A]),G=_.useCallback(()=>{A(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[A]);_.useEffect(()=>{U&&!H.isOpen?H.open({id:U}):!U&&H.isOpen&&H.close()},[U]);let K=R?.name,q=!!z&&!S(z),J=z?.name??(L.sourceView?`${L.source}.${L.sourceView}`:void 0),[Y,X]=_.useState(null);_.useEffect(()=>{let e=!1;if(X(null),!(!K||!L.source||!q||!J))return(async()=>{try{let t=E,n=null;typeof t?.listViewOverrides==`function`&&(n=(await t.listViewOverrides(L.source))?.[J]??null),!S(n)&&typeof t?.getView==`function`&&(n=await t.getView(L.source,J)),!e&&n&&typeof n==`object`&&X(n)}catch{}})(),()=>{e=!0}},[K,L.source,L.sourceView,q,J,E]);let Z=_.useMemo(()=>Y?{...z,...Y}:z,[z,Y]),te=JSON.stringify(Z??null),Q=_.useMemo(()=>{if(!R)return;let e=Z||{},t=L.appearance??e.appearance,n=t?.allowedVisualizations||[],r=new Set(n),i=L.userActions||{},a=e.kanban??(r.has(`kanban`)?k(R):void 0),o=e.calendar??(r.has(`calendar`)?j(R):void 0),s=e.timeline??(r.has(`timeline`)?j(R):void 0),c=e.gallery??(r.has(`gallery`)?M(R):void 0),l=e.gantt??(r.has(`gantt`)?P(R):void 0),u=e.options?.map??(r.has(`map`)?F(R):void 0),d=[...Array.isArray(e.filter)?e.filter:[],...Array.isArray(L.filterBy)?L.filterBy:[]],f=S(L)?L.columns:S(e)?e.columns:w(R),p=Array.isArray(L.sort)&&L.sort.length?L.sort:e.sort;return{type:`list-view`,objectName:R.name,viewType:n[0]??e.type??`grid`,fields:f,...d.length?{filters:d}:{},...p?.length?{sort:p}:{},grouping:e.grouping,rowColor:e.rowColor,pagination:e.pagination,searchableFields:e.searchableFields,emptyState:e.emptyState,kanban:a,calendar:o,gallery:c,timeline:s,gantt:l,...u||e.options?{options:{...e.options??{},...u?{map:u}:{}}}:{},userFilters:L.userFilters??e.userFilters,appearance:t,showViewSwitcher:n.length>1,showRecordCount:L.showRecordCount,addRecord:L.addRecord,showSearch:i.search!==!1,showSort:i.sort!==!1,showFilters:i.filter===!0,showDensity:i.rowHeight===!0,showHideFields:!1,showGroup:!1,showColor:!1,allowExport:!1,inlineEdit:i.editInline===!0}},[K,te,L]);if(!R||!Q)return(0,x.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,x.jsx)(m,{className:`h-6 w-6 text-muted-foreground`})}),(0,x.jsx)(h,{children:v(`empty.objectNotFound`,{defaultValue:`Source object not found`})}),(0,x.jsx)(d,{children:v(`empty.interfacePageSourceMissing`,{defaultValue:`This interface page references "{{name}}", which is not available.`,name:L.source||`?`})})]})});let $=Array.isArray(L.buttons)&&L.buttons.length?L.buttons.map(e=>(R.actions||[]).find(t=>t?.name===e)).filter(Boolean).map(e=>({...e,locations:[`list_toolbar`]})):[];return(0,x.jsxs)(`div`,{className:r??`h-full flex flex-col`,"data-testid":`interface-list-page`,children:[(0,x.jsxs)(`div`,{className:`pl-4 pt-4 pb-2 shrink-0 flex items-start justify-between gap-3 ${o?`pr-12`:`pr-4`}`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-lg font-semibold leading-tight`,children:typeof e.label==`string`?e.label:e.name}),typeof e.description==`string`&&e.description&&(0,x.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:e.description})]}),$.length>0&&(0,x.jsx)(`div`,{className:`shrink-0`,"data-testid":`interface-page-buttons`,children:(0,x.jsx)(c,{schema:{type:`action:bar`,location:`list_toolbar`,actions:$,size:`sm`,variant:`outline`}})})]}),(0,x.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:(0,x.jsx)(g,{schema:Q,dataSource:E,userFilterSelections:N,onUserFilterSelectionsChange:I,onSortChange:i?e=>i({sort:e}):void 0,onColumnStateChange:i?e=>{e?.order?.length&&i({columns:e.order})}:void 0,onRowClick:B===`none`?void 0:W})}),H.isOverlay&&(0,x.jsx)(u,{...H,setIsOpen:e=>{e||G()},title:typeof e.label==`string`?e.label:L.source||`Record`,children:e=>(0,x.jsx)(ee,{objectNameOverride:L.source,recordIdOverride:String(e?.id??e?._id??U??``),embedded:!0,dataSource:E,objects:T,onEdit:()=>{}})})]})}export{k as a,M as i,j as n,b as o,w as r,y as s,I as t};
@@ -1 +0,0 @@
1
- import{f as e,m as t,r as n}from"./vendor-react-BKSb6vFP.js";import{g as r}from"./infrastructure-C6pQBkbt.js";import{Ka as i,Or as a,Uc as o,or as s,sr as c}from"./ui-components-Ci5ufF7g.js";var l={cloudUrl:``,singleEnvironment:!1,defaultOrgId:null,defaultEnvironmentId:null,features:{installLocal:!1,marketplace:!0,aiStudio:!0,autoPublishAiBuilds:!0,customDomain:!1,sso:!1},branding:{productName:`ObjectOS`,productShortName:`ObjectOS`,stage:`preview`,brandColor:`#4F46E5`,pwaThemeColor:`#4f46e5`}},u=[`preview`,`beta`,`ga`];function d(e){return typeof e==`string`&&u.includes(e)}var f={...l};function p(e){f={...f,...e,features:{...f.features,...e.features??{}},branding:{...f.branding,...e.branding??{}}}}async function m(e=``){let t=(e||``).replace(/\/+$/,``);try{let e=await fetch(`${t}/api/v1/runtime/config`,{credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return;let n=await e.json();if(!n||typeof n!=`object`)return;p({cloudUrl:typeof n.cloudUrl==`string`?n.cloudUrl.replace(/\/+$/,``):f.cloudUrl,singleEnvironment:!!n.singleEnvironment,defaultOrgId:n.defaultOrgId??f.defaultOrgId??null,defaultEnvironmentId:n.defaultEnvironmentId??f.defaultEnvironmentId??null,features:n.features?{installLocal:!!n.features.installLocal,marketplace:n.features.marketplace!==!1,aiStudio:n.features.aiStudio!==!1,autoPublishAiBuilds:n.features.autoPublishAiBuilds!==!1,customDomain:n.features.customDomain===!0,sso:n.features.sso===!0}:f.features,branding:n.branding?{productName:typeof n.branding.productName==`string`&&n.branding.productName.trim()?n.branding.productName.trim():f.branding.productName,productShortName:typeof n.branding.productShortName==`string`&&n.branding.productShortName.trim()?n.branding.productShortName.trim():f.branding.productShortName,stage:d(n.branding.stage)?n.branding.stage:f.branding.stage,logoUrl:typeof n.branding.logoUrl==`string`&&n.branding.logoUrl.trim()?n.branding.logoUrl.trim():f.branding.logoUrl,faviconUrl:typeof n.branding.faviconUrl==`string`&&n.branding.faviconUrl.trim()?n.branding.faviconUrl.trim():f.branding.faviconUrl,brandColor:typeof n.branding.brandColor==`string`&&n.branding.brandColor.trim()?n.branding.brandColor.trim():f.branding.brandColor,pwaDescription:typeof n.branding.pwaDescription==`string`&&n.branding.pwaDescription.trim()?n.branding.pwaDescription.trim():f.branding.pwaDescription,pwaThemeColor:typeof n.branding.pwaThemeColor==`string`&&n.branding.pwaThemeColor.trim()?n.branding.pwaThemeColor.trim():f.branding.pwaThemeColor}:f.branding})}catch{}}function h(){return f}function g(){return f.branding?.productName||`ObjectOS`}function _(){return f.branding?.productShortName||g()}function v(){return f.branding?.stage??`preview`}function y(){return f.branding?.brandColor||`#4F46E5`}function b(){return f.branding?.logoUrl}function x(){return f.branding?.faviconUrl}function S(){return f.branding?.pwaDescription||`${g()} — runtime console`}function C(){return f.branding?.pwaThemeColor||y()}function w(){return f.cloudUrl??``}var T=``.replace(/\/$/,``),E=`${T}/api/v1/marketplace`;function D(e){let t=r.get();return t?{...e,Authorization:`Bearer ${t}`}:e}async function O(e,t){let n=await fetch(`${E}${e}`,{credentials:`omit`,headers:{Accept:`application/json`,...t?.headers||{}},...t}),r=null;try{r=await n.json()}catch{}if(!n.ok){let e=r?.error?.code??r?.code??`HTTP_${n.status}`,t=r?.error?.message??r?.error??n.statusText,i=Error(typeof t==`string`?t:`${e}`);throw i.code=e,i.status=n.status,i}return r?.data??r}async function k(e={}){let t=new URLSearchParams;e.q&&t.set(`q`,e.q),e.category&&t.set(`category`,e.category),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return O(`/packages${n?`?${n}`:``}`)}async function A(e){return O(`/packages/${encodeURIComponent(e)}`)}async function j(e){if(w()){let t=await fetch(`/api/v1/cloud-connection/install`,{method:`POST`,credentials:`include`,headers:D({Accept:`application/json`,"Content-Type":`application/json`}),body:JSON.stringify({package_id:e.packageId,seed_sample_data:!!e.seedSampleData})}),n=null;try{n=await t.json()}catch{}if(!t.ok||n?.success===!1){let e=n?.error?.code??n?.code??`HTTP_${t.status}`,r=n?.error?.message??n?.error??n?.message??t.statusText,i=Error(typeof r==`string`?r:`${e}`);throw i.code=e,i.status=t.status,i}return n?.data??n}let t=await fetch(`${T}/api/v1/actions/sys_package/install_package`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({recordId:e.packageId,params:{environment_id:e.environmentId,seed_sample_data:!!e.seedSampleData}})}),n=null;try{n=await t.json()}catch{}if(!t.ok){let e=n?.code??n?.error?.code??`HTTP_${t.status}`,r=n?.error??n?.message??t.statusText,i=Error(typeof r==`string`?r:`${e}`);throw i.code=e,i.status=t.status,i}return n?.data??n}async function M(){let e=w()||T,t=await fetch(`${e}/api/v1/data/sys_environment?limit=200`,{credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok){let e=Error(`HTTP_${t.status}`);throw e.status=t.status,e}let n=await t.json().catch(()=>({})),r=n?.records??n?.data??n?.items??n??[];return Array.isArray(r)?r:[]}async function N(){let e=w()||T,t=null;try{let n=await fetch(`${e}/api/v1/auth/get-session`,{credentials:`include`,headers:{Accept:`application/json`}});n.ok&&(t=(await n.json().catch(()=>({})))?.user?.id??null)}catch{}if(!t)return new Set;let n=`${e}/api/v1/data/sys_member?limit=200`,r;try{let e=await fetch(n,{credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return new Set;r=await e.json().catch(()=>({}))}catch{return new Set}let i=r?.records??r?.data??r?.items??r??[];if(!Array.isArray(i))return new Set;let a=new Set;for(let e of i){if(String(e?.user_id??e?.userId??``)!==t)continue;let n=String(e?.role??``).toLowerCase(),r=e?.organization_id??e?.organizationId;r&&(n===`owner`||n===`admin`)&&a.add(String(r))}return a}function P(e){return`${w()||`https://cloud.objectos.app`}/apps/cloud-control/sys_package/${encodeURIComponent(e)}`}function F(){return`${w()||`https://cloud.objectos.app`}/apps/cloud-control/sys_environment`}async function I(e,t){if(!e)return null;if(w())try{let t=await fetch(`/api/v1/cloud-connection/installation?package_id=${encodeURIComponent(e)}`,{credentials:`include`,headers:D({Accept:`application/json`})});if(!t.ok)return null;let n=await t.json().catch(()=>({})),r=n?.data??n??{};return r.installed?{installationId:String(r.installationId??``),version:String(r.version??`installed`),withSampleData:r.withSampleData===!0}:null}catch{return null}if(!t)return null;let n=T;try{let r=await fetch(`${n}/api/v1/cloud/environments/${encodeURIComponent(t)}/installations/${encodeURIComponent(e)}`,{credentials:`include`,headers:{Accept:`application/json`}});if(!r.ok)return null;let i=await r.json().catch(()=>({})),a=i?.data??i??{};return a.installed?{installationId:String(a.installationId??``),version:String(a.version??`installed`),withSampleData:a.withSampleData===!0}:null}catch{return null}}async function L(e){if(!e)return{ok:!1,error:`installation id required`};let t=w()||T;try{let n=await fetch(`${t}/api/v1/cloud/installations/${encodeURIComponent(e)}/reseed-sample-data`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:`{}`}),r=await n.json().catch(()=>({}));return!n.ok||r?.success===!1?{ok:!1,error:r?.error||`HTTP ${n.status}`}:{ok:!0}}catch(e){return{ok:!1,error:e?.message||`Network error`}}}async function R(e){if(!e)return{ok:!1,error:`installation id required`};let t=w()||T;try{let n=await fetch(`${t}/api/v1/cloud/installations/${encodeURIComponent(e)}/purge-sample-data`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:`{}`}),r=await n.json().catch(()=>({}));return!n.ok||r?.success===!1?{ok:!1,error:r?.error||`HTTP ${n.status}`}:{ok:!0,deleted:Number(r?.data?.deleted??0)}}catch(e){return{ok:!1,error:e?.message||`Network error`}}}async function z(){try{let e=await fetch(`${T}/api/v1/cloud-connection/org-packages`,{credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return{connected:!1,items:[]};let t=(await e.json().catch(()=>({})))?.data??{},n=Array.isArray(t.items)?t.items:[];return{connected:t.connected===!0,items:n}}catch{return{connected:!1,items:[]}}}async function B(e){let t=await fetch(`${E}/install-local`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({packageId:e.packageId,...e.versionId?{versionId:e.versionId}:{}})}),n=null;try{n=await t.json()}catch{}if(!t.ok){let e=n?.error?.code??`HTTP_${t.status}`,r=n?.error?.message??t.statusText,i=Error(typeof r==`string`?r:`${e}`);throw i.code=e,i.status=t.status,i}return n?.data??n}async function V(){try{let e=await fetch(`${E}/install-local`,{credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return[];let t=await e.json().catch(()=>({})),n=t?.data?.items??t?.items??[];return Array.isArray(n)?n:[]}catch{return[]}}async function H(){try{let e=await fetch(`${T}/api/v1/cloud-connection/installed`,{credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return{connected:!1,items:[]};let t=(await e.json().catch(()=>({})))?.data??{},n=(Array.isArray(t.packages)?t.packages:[]).map(e=>{let t=String(e.packageId??e.package_id??``);return{packageId:t,versionId:String(e.package_version_id??``),manifestId:t,version:String(e.version??`installed`),installedAt:String(e.installed_at??e.installedAt??``),installedBy:e.installed_by??e.installedBy??null,withSampleData:e.with_sample_data===!0||e.withSampleData===!0}});return{connected:t.connected===!0,items:n}}catch{return{connected:!1,items:[]}}}async function U(e){let t=await fetch(`${E}/install-local/${encodeURIComponent(e)}`,{method:`DELETE`,credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok){let e=(await t.json().catch(()=>({})))?.error?.message??t.statusText;throw Error(typeof e==`string`?e:`HTTP_${t.status}`)}}async function W(e,t){let n=await fetch(`${E}/install-local/${encodeURIComponent(e)}/${t===`reseed`?`reseed-sample-data`:`purge-sample-data`}`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`}}),r=await n.json().catch(()=>({}));if(!n.ok){let e=r?.error?.message??n.statusText,t=Error(typeof e==`string`?e:`HTTP_${n.status}`);throw t.code=r?.error?.code??`HTTP_${n.status}`,t}return r?.data??r}function G(e){return W(e,`reseed`)}function K(e){return W(e,`purge`)}var q=n();function J(){let n=e(),{appName:r}=t(),{t:l}=o(),u=r?`/apps/${r}`:`/`;return(0,q.jsx)(`div`,{className:`container mx-auto max-w-2xl px-6 py-16`,children:(0,q.jsx)(s,{children:(0,q.jsxs)(c,{className:`flex flex-col items-center gap-4 py-12 text-center`,children:[(0,q.jsx)(`div`,{className:`rounded-full bg-muted p-3`,children:(0,q.jsx)(i,{className:`h-6 w-6 text-muted-foreground`})}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`text-lg font-semibold`,children:l(`marketplace.accessDenied.title`)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:l(`marketplace.accessDenied.description`)})]}),(0,q.jsx)(a,{variant:`outline`,onClick:()=>n(u),children:l(`marketplace.action.backHome`)})]})})})}export{g as C,h as D,C as E,m as O,v as S,S as T,L as _,A as a,x as b,M as c,V as d,k as f,G as g,R as h,I as i,N as l,K as m,P as n,B as o,z as p,F as r,j as s,J as t,H as u,U as v,_ as w,b as x,w as y};