@protobase/ui 0.119.6 → 0.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/messages.d.ts +2 -2
- package/dist/app/charts/messages.d.ts +2 -2
- package/dist/app/comments/messages.d.ts +2 -2
- package/dist/app/confirm-sign-in-messages.d.ts +2 -2
- package/dist/app/create/messages.d.ts +2 -2
- package/dist/app/custom-section.d.ts +1 -1
- package/dist/app/delete/messages.d.ts +2 -2
- package/dist/app/displays/list-cards.d.ts +1 -1
- package/dist/app/displays/messages.d.ts +2 -2
- package/dist/app/embedded-list/messages.d.ts +2 -2
- package/dist/app/export/messages.d.ts +2 -2
- package/dist/app/field-messages.d.ts +2 -2
- package/dist/app/field-types/runner-install/messages.d.ts +2 -2
- package/dist/app/field-types/widget-part.d.ts +1 -1
- package/dist/app/field-types/workflow/cache-field.js +1 -1
- package/dist/app/field-types/workflow/flow-elements.js +2 -2
- package/dist/app/field-types/workflow/flow-nodes.js +2 -2
- package/dist/app/field-types/workflow/messages.d.ts +2 -2
- package/dist/app/field-types/workflow/node-panel.js +2 -2
- package/dist/app/field-types/workflow/pins/data-edits.js +1 -1
- package/dist/app/field-types/workflow/pins/pin-text.js +1 -1
- package/dist/app/field-types/workflow/task-fields.js +2 -2
- package/dist/app/field-types/workflow/trigger-fields.js +1 -1
- package/dist/app/field-types/workflow/workflow-canvas.js +3 -3
- package/dist/app/field-types/workflow/workflow-field.js +1 -1
- package/dist/app/field-types/workflow/workflow-graph-editor.js +3 -3
- package/dist/app/field-types/workflow-page/insert-value-view.js +3 -3
- package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-page/publish-panel.js +2 -2
- package/dist/app/field-types/workflow-page/rerun-panel.js +1 -1
- package/dist/app/field-types/workflow-page/run-notice.js +1 -1
- package/dist/app/field-types/workflow-page/runs-panel.js +1 -1
- package/dist/app/field-types/workflow-page/test-run-panel.js +2 -2
- package/dist/app/field-types/workflow-page/use-workflow-page.js +2 -2
- package/dist/app/field-types/workflow-page/workbench-bar.js +1 -1
- package/dist/app/field-types/workflow-page/workflow-workbench.js +12 -12
- package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-run/run-trace-view.js +4 -4
- package/dist/app/field-types/workflow-run/step-card.js +1 -1
- package/dist/app/field-types/workflow-run/step-panel.js +1 -1
- package/dist/app/focus/messages.d.ts +2 -2
- package/dist/app/gallery/gallery-layout.d.ts +2 -2
- package/dist/app/gallery/messages.d.ts +2 -2
- package/dist/app/hand-order/messages.d.ts +2 -2
- package/dist/app/history/messages.d.ts +2 -2
- package/dist/app/import/messages.d.ts +2 -2
- package/dist/app/list-edit/messages.d.ts +2 -2
- package/dist/app/list-messages.d.ts +2 -2
- package/dist/app/messages.d.ts +2 -2
- package/dist/app/pages/custom-boundary.d.ts +1 -1
- package/dist/app/pages/custom-chosen.d.ts +1 -1
- package/dist/app/pages/messages.d.ts +2 -2
- package/dist/app/record-chart/messages.d.ts +2 -2
- package/dist/app/record-messages.d.ts +2 -2
- package/dist/app/record-row/messages.d.ts +2 -2
- package/dist/app/related-cards/messages.d.ts +2 -2
- package/dist/app/saved/messages.d.ts +2 -2
- package/dist/app/saved/saved-list.d.ts +1 -1
- package/dist/app/searches/messages.d.ts +2 -2
- package/dist/app-shell/messages.d.ts +2 -2
- package/dist/auth/messages.d.ts +2 -2
- package/dist/calls/messages.d.ts +2 -2
- package/dist/filter-panel/messages.d.ts +2 -2
- package/dist/forms/messages.d.ts +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/inline-child-table/messages.d.ts +2 -2
- package/dist/invitations/messages.d.ts +2 -2
- package/dist/locale/en.js +2 -1
- package/dist/locale/en.json.d.ts +2 -1
- package/dist/locale/messages.d.ts +4 -2
- package/dist/locale/nl.js +2 -1
- package/dist/locale/texts-gate.d.ts +1 -1
- package/dist/mailbox/messages.d.ts +2 -2
- package/dist/mocks/customers.d.ts +2 -2
- package/dist/mocks/invoices.d.ts +3 -3
- package/dist/mocks/orders.d.ts +2 -2
- package/dist/mocks/stockMoves.d.ts +1 -1
- package/dist/notifications/bell/messages.d.ts +2 -2
- package/dist/organizations/messages.d.ts +2 -2
- package/dist/package.js +1 -1
- package/dist/plugins/before-sign-in.d.ts +1 -1
- package/dist/plugins/extension-points.d.ts +10 -0
- package/dist/plugins/extension-points.js +26 -0
- package/dist/plugins/host-capabilities.d.ts +8 -0
- package/dist/plugins/host-capabilities.js +21 -0
- package/dist/plugins/load-plugin.js +3 -1
- package/dist/plugins/messages.d.ts +2 -2
- package/dist/plugins/plugin-api.exports.js +133 -0
- package/dist/plugins/plugin-manifest.d.ts +6 -4
- package/dist/plugins/plugin-manifest.js +8 -3
- package/dist/shell/assets/{account-page-BNtfocSb.js → account-page-DIIa49Sf.js} +2 -2
- package/dist/shell/assets/app-B8KcM2Z-.js +34 -0
- package/dist/shell/assets/{assistant-shell-BPyCi5kW.js → assistant-shell-CLGyb2ss.js} +2 -2
- package/dist/shell/assets/{board-display-B41TuoWo.js → board-display-DJJD_jjY.js} +2 -2
- package/dist/shell/assets/{calendar-display-63b_rkuL.js → calendar-display-7R7Vz5Vm.js} +2 -2
- package/dist/shell/assets/call-rings-AviIOqM7.js +2 -0
- package/dist/shell/assets/{calls-DwpgAZRF.js → calls-C2CUgWkn.js} +2 -2
- package/dist/shell/assets/{circle-alert-C9z9GbbN.js → circle-alert-DOaXkZQv.js} +2 -2
- package/dist/shell/assets/{composed-page-UB2y5c99.js → composed-page-DjGZy9C7.js} +2 -2
- package/dist/shell/assets/{composer-section-CMoh0kSd.js → composer-section-BLqTkqi8.js} +2 -2
- package/dist/shell/assets/{connect-route-DRcj6Ruu.js → connect-route-41MPQMtp.js} +2 -2
- package/dist/shell/assets/{copy-field-MTVXamwX.js → copy-field-Ct-6xn8T.js} +2 -2
- package/dist/shell/assets/{create-route-CEfuAg9p.js → create-route-CRZSYoTi.js} +2 -2
- package/dist/shell/assets/{custom-step-container-field-19o4BVGX.js → custom-step-container-field-C0uZrHjV.js} +4 -4
- package/dist/shell/assets/embedded-list-C3nd1V5o.js +3 -0
- package/dist/shell/assets/{en-BLkfn3BD.js → en-BHrKuf4K.js} +2 -2
- package/dist/shell/assets/{export-dialog-DHbFHvEa.js → export-dialog-BerhgfFO.js} +2 -2
- package/dist/shell/assets/export-worker-CNhkzttC.js +15 -0
- package/dist/shell/assets/{first-organization-page-Uc0es2bM.js → first-organization-page-CKYevHep.js} +2 -2
- package/dist/shell/assets/{graph-view-C_kd2p_w.js → graph-view-CoLu3Uhs.js} +2 -2
- package/dist/shell/assets/{group-donut-w_BFP4Nu.js → group-donut-B8v2SWzP.js} +2 -2
- package/dist/shell/assets/{guest-call-page-D3gaOqIw.js → guest-call-page-DqQMPCVU.js} +3 -3
- package/dist/shell/assets/{html-viewer-BrCIs_XH.js → html-viewer-BntGWVRA.js} +2 -2
- package/dist/shell/assets/{import-dialog-DCcZNJgD.js → import-dialog-DThTUXFS.js} +2 -2
- package/dist/shell/assets/{import-table-dialog-CWL7kUhP.js → import-table-dialog-C-XIx1Dd.js} +2 -2
- package/dist/shell/assets/{index-CI4ggWZ9.js → index-CI7L8s0t.js} +1 -1
- package/dist/shell/assets/{invitations-page-CX-S9_g6.js → invitations-page-COFjv2AV.js} +2 -2
- package/dist/shell/assets/{layout-grid-DK79NnII.js → layout-grid-CvCNKDtn.js} +2 -2
- package/dist/shell/assets/{legend-item-IhWkwVRv.js → legend-item-9nkaAII6.js} +2 -2
- package/dist/shell/assets/list-page-D3nIEwGf.js +4 -0
- package/dist/shell/assets/{maplibre-XgWOYlHw.js → maplibre-5GcVztUc.js} +2 -2
- package/dist/shell/assets/{markdown-content-oKb66g72.js → markdown-content-DVmg_kx3.js} +2 -2
- package/dist/shell/assets/{members-page-CB947V03.js → members-page-DoRl-b9K.js} +2 -2
- package/dist/shell/assets/{message-content-Cae9o0KB.js → message-content-BpfTrsWh.js} +2 -2
- package/dist/shell/assets/{messages-KWWs-PYa.js → messages-CZQvPUZQ.js} +2 -2
- package/dist/shell/assets/{nl-Ozd1Th1I.js → nl-D11b5T7-.js} +2 -2
- package/dist/shell/assets/{organization-page-Daa29-ya.js → organization-page-DeaQlPop.js} +2 -2
- package/dist/shell/assets/{organizations-page-DFla8W4s.js → organizations-page-Dlosll2b.js} +2 -2
- package/dist/shell/assets/parse-worker-CAcPVcu7.js +35 -0
- package/dist/shell/assets/{pending-invitation-row-ufQDhiqy.js → pending-invitation-row-t63yAwI8.js} +2 -2
- package/dist/shell/assets/{period-chart-CDAaiRKi.js → period-chart-BVv9kC_E.js} +2 -2
- package/dist/shell/assets/{person-row-DKpGU4lp.js → person-row-CgvcHRmL.js} +2 -2
- package/dist/shell/assets/{public-form-page-CWI8qeDR.js → public-form-page-CruNnqqc.js} +2 -2
- package/dist/shell/assets/{record-lines-Dr5kvt8p.js → record-lines-Dts68Cfq.js} +2 -2
- package/dist/shell/assets/{record-map-JMNMJGUZ.js → record-map-BO9rZaxg.js} +2 -2
- package/dist/shell/assets/{record-opens-iz29YMzQ.js → record-opens-Ds9nDyw1.js} +2 -2
- package/dist/shell/assets/record-page-DJgscks5.js +3 -0
- package/dist/shell/assets/{record-preview-BCYfgSHu.js → record-preview-CwySCCRj.js} +2 -2
- package/dist/shell/assets/{records-map-iNOkFYn9.js → records-map-Bq_dBgiT.js} +2 -2
- package/dist/shell/assets/render-node-zjMYynnA.js +3 -0
- package/dist/shell/assets/{reorder-button-05HCaCaE.js → reorder-button-BGgoLDx3.js} +2 -2
- package/dist/shell/assets/{run-trace-view-BSrF6_Kg.js → run-trace-view-BtyPPUyt.js} +2 -2
- package/dist/shell/assets/{runner-install-field-CgXWqOkx.js → runner-install-field-DvuPCX28.js} +2 -2
- package/dist/shell/assets/{runtime-update-BrM_FHvq.js → runtime-update-e56Spv--.js} +2 -2
- package/dist/shell/assets/shared-protobase-ui-QP42FY24.js +1 -0
- package/dist/shell/assets/{sheet-source-BdUpw5K0.js → sheet-source-Cenf8A74.js} +3 -3
- package/dist/shell/assets/{sign-in-policy-page-CavUG1RD.js → sign-in-policy-page-CUiU8ZIN.js} +2 -2
- package/dist/shell/assets/{start-block-queries-DrZpbWHB.js → start-block-queries-DUvYFyeX.js} +2 -2
- package/dist/shell/assets/step-catalog-CKmRa3SA.js +2 -0
- package/dist/shell/assets/{step-panel-CyZhEKcD.js → step-panel-DD821ue5.js} +2 -2
- package/dist/shell/assets/{timeline-display-Bzg1mU4E.js → timeline-display-ChPHZfO_.js} +2 -2
- package/dist/shell/assets/{trash-CqUcV16Q.js → trash-Ch2JFURM.js} +2 -2
- package/dist/shell/assets/{update-set-Da02tZfu.js → update-set-Zch9kB-u.js} +2 -2
- package/dist/shell/assets/{use-calendar-move-D93tEWOf.js → use-calendar-move-Cl14_xWL.js} +2 -2
- package/dist/shell/assets/{use-display-rows-BPgcYLdT.js → use-display-rows-s-zuk4Lc.js} +2 -2
- package/dist/shell/assets/{use-my-invitations-CPQ3DMUh.js → use-my-invitations-APXH_Xf1.js} +2 -2
- package/dist/shell/assets/{use-paged-search-w0puq1Yl.js → use-paged-search-CxaSlMkh.js} +2 -2
- package/dist/shell/assets/{use-run-trace-BEM0bOMt.js → use-run-trace-CRG2_uVq.js} +2 -2
- package/dist/shell/assets/{use-workflow-page-DpBacPYs.js → use-workflow-page-BPZWN9Iv.js} +2 -2
- package/dist/shell/assets/{use-workflow-types-Bc6SdoP6.js → use-workflow-types-Dk4FOVoz.js} +2 -2
- package/dist/shell/assets/{workflow-canvas-DpONgLJR.js → workflow-canvas-DBlvFI_n.js} +3 -3
- package/dist/shell/assets/{workflow-field-4i7H_hCR.js → workflow-field-DXiYYH5X.js} +3 -3
- package/dist/shell/assets/{workflow-graph-editor-BP_eCoyB.js → workflow-graph-editor-BtNoPI_a.js} +2 -2
- package/dist/shell/assets/{workflow-run-field-e0JGWLQd.js → workflow-run-field-CztPPLbi.js} +3 -3
- package/dist/shell/assets/workflow-status-field-K3DE4tPj.js +2 -0
- package/dist/shell/assets/workflow-workbench-CAz04v9t.js +4 -0
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +2 -2
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/{account-page-BNtfocSb.js.map → account-page-DIIa49Sf.js.map} +1 -1
- package/dist/shell-source-maps/assets/app-B8KcM2Z-.js.map +1 -0
- package/dist/shell-source-maps/assets/{assistant-shell-BPyCi5kW.js.map → assistant-shell-CLGyb2ss.js.map} +1 -1
- package/dist/shell-source-maps/assets/{board-display-B41TuoWo.js.map → board-display-DJJD_jjY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calendar-display-63b_rkuL.js.map → calendar-display-7R7Vz5Vm.js.map} +1 -1
- package/dist/shell-source-maps/assets/{call-rings-DBe0CIEa.js.map → call-rings-AviIOqM7.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calls-DwpgAZRF.js.map → calls-C2CUgWkn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{circle-alert-C9z9GbbN.js.map → circle-alert-DOaXkZQv.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composed-page-UB2y5c99.js.map → composed-page-DjGZy9C7.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composer-section-CMoh0kSd.js.map → composer-section-BLqTkqi8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{connect-route-DRcj6Ruu.js.map → connect-route-41MPQMtp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{copy-field-MTVXamwX.js.map → copy-field-Ct-6xn8T.js.map} +1 -1
- package/dist/shell-source-maps/assets/{create-route-CEfuAg9p.js.map → create-route-CRZSYoTi.js.map} +1 -1
- package/dist/shell-source-maps/assets/{custom-step-container-field-19o4BVGX.js.map → custom-step-container-field-C0uZrHjV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{embedded-list-CWzU8ruS.js.map → embedded-list-C3nd1V5o.js.map} +1 -1
- package/dist/shell-source-maps/assets/en-BHrKuf4K.js.map +1 -0
- package/dist/shell-source-maps/assets/{export-dialog-DHbFHvEa.js.map → export-dialog-BerhgfFO.js.map} +1 -1
- package/dist/shell-source-maps/assets/export-worker-CNhkzttC.js.map +1 -0
- package/dist/shell-source-maps/assets/{first-organization-page-Uc0es2bM.js.map → first-organization-page-CKYevHep.js.map} +1 -1
- package/dist/shell-source-maps/assets/{graph-view-C_kd2p_w.js.map → graph-view-CoLu3Uhs.js.map} +1 -1
- package/dist/shell-source-maps/assets/{group-donut-w_BFP4Nu.js.map → group-donut-B8v2SWzP.js.map} +1 -1
- package/dist/shell-source-maps/assets/{guest-call-page-D3gaOqIw.js.map → guest-call-page-DqQMPCVU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{html-viewer-BrCIs_XH.js.map → html-viewer-BntGWVRA.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-dialog-DCcZNJgD.js.map → import-dialog-DThTUXFS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-table-dialog-CWL7kUhP.js.map → import-table-dialog-C-XIx1Dd.js.map} +1 -1
- package/dist/shell-source-maps/assets/{invitations-page-CX-S9_g6.js.map → invitations-page-COFjv2AV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{layout-grid-DK79NnII.js.map → layout-grid-CvCNKDtn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{legend-item-IhWkwVRv.js.map → legend-item-9nkaAII6.js.map} +1 -1
- package/dist/shell-source-maps/assets/{list-page-BJ7BwcjM.js.map → list-page-D3nIEwGf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{maplibre-XgWOYlHw.js.map → maplibre-5GcVztUc.js.map} +1 -1
- package/dist/shell-source-maps/assets/{markdown-content-oKb66g72.js.map → markdown-content-DVmg_kx3.js.map} +1 -1
- package/dist/shell-source-maps/assets/{members-page-CB947V03.js.map → members-page-DoRl-b9K.js.map} +1 -1
- package/dist/shell-source-maps/assets/{message-content-Cae9o0KB.js.map → message-content-BpfTrsWh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{messages-KWWs-PYa.js.map → messages-CZQvPUZQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/nl-D11b5T7-.js.map +1 -0
- package/dist/shell-source-maps/assets/{organization-page-Daa29-ya.js.map → organization-page-DeaQlPop.js.map} +1 -1
- package/dist/shell-source-maps/assets/{organizations-page-DFla8W4s.js.map → organizations-page-Dlosll2b.js.map} +1 -1
- package/dist/shell-source-maps/assets/parse-worker-CAcPVcu7.js.map +1 -0
- package/dist/shell-source-maps/assets/{pending-invitation-row-ufQDhiqy.js.map → pending-invitation-row-t63yAwI8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{period-chart-CDAaiRKi.js.map → period-chart-BVv9kC_E.js.map} +1 -1
- package/dist/shell-source-maps/assets/{person-row-DKpGU4lp.js.map → person-row-CgvcHRmL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{public-form-page-CWI8qeDR.js.map → public-form-page-CruNnqqc.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-lines-Dr5kvt8p.js.map → record-lines-Dts68Cfq.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-map-JMNMJGUZ.js.map → record-map-BO9rZaxg.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-opens-iz29YMzQ.js.map → record-opens-Ds9nDyw1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-page-Db_9ytem.js.map → record-page-DJgscks5.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-preview-BCYfgSHu.js.map → record-preview-CwySCCRj.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-iNOkFYn9.js.map → records-map-Bq_dBgiT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{render-node-D5xobkr6.js.map → render-node-zjMYynnA.js.map} +1 -1
- package/dist/shell-source-maps/assets/{reorder-button-05HCaCaE.js.map → reorder-button-BGgoLDx3.js.map} +1 -1
- package/dist/shell-source-maps/assets/{run-trace-view-BSrF6_Kg.js.map → run-trace-view-BtyPPUyt.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runner-install-field-CgXWqOkx.js.map → runner-install-field-DvuPCX28.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runtime-update-BrM_FHvq.js.map → runtime-update-e56Spv--.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sheet-source-BdUpw5K0.js.map → sheet-source-Cenf8A74.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sign-in-policy-page-CavUG1RD.js.map → sign-in-policy-page-CUiU8ZIN.js.map} +1 -1
- package/dist/shell-source-maps/assets/{start-block-queries-DrZpbWHB.js.map → start-block-queries-DUvYFyeX.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-catalog-C49x4u-Y.js.map → step-catalog-CKmRa3SA.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-panel-CyZhEKcD.js.map → step-panel-DD821ue5.js.map} +1 -1
- package/dist/shell-source-maps/assets/{timeline-display-Bzg1mU4E.js.map → timeline-display-ChPHZfO_.js.map} +1 -1
- package/dist/shell-source-maps/assets/{trash-CqUcV16Q.js.map → trash-Ch2JFURM.js.map} +1 -1
- package/dist/shell-source-maps/assets/{update-set-Da02tZfu.js.map → update-set-Zch9kB-u.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-calendar-move-D93tEWOf.js.map → use-calendar-move-Cl14_xWL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-display-rows-BPgcYLdT.js.map → use-display-rows-s-zuk4Lc.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-my-invitations-CPQ3DMUh.js.map → use-my-invitations-APXH_Xf1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-paged-search-w0puq1Yl.js.map → use-paged-search-CxaSlMkh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-run-trace-BEM0bOMt.js.map → use-run-trace-CRG2_uVq.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-page-DpBacPYs.js.map → use-workflow-page-BPZWN9Iv.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-types-Bc6SdoP6.js.map → use-workflow-types-Dk4FOVoz.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-canvas-DpONgLJR.js.map → workflow-canvas-DBlvFI_n.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-field-4i7H_hCR.js.map → workflow-field-DXiYYH5X.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-graph-editor-BP_eCoyB.js.map → workflow-graph-editor-BtNoPI_a.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-run-field-e0JGWLQd.js.map → workflow-run-field-CztPPLbi.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-status-field-RevEnRLG.js.map → workflow-status-field-K3DE4tPj.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-workbench-DY0czZaG.js.map → workflow-workbench-CAz04v9t.js.map} +1 -1
- package/dist/status/messages.d.ts +2 -2
- package/dist/users/messages.d.ts +2 -2
- package/package.json +5 -5
- package/dist/shell/assets/app-Cfc4Mr5v.js +0 -34
- package/dist/shell/assets/call-rings-DBe0CIEa.js +0 -2
- package/dist/shell/assets/embedded-list-CWzU8ruS.js +0 -3
- package/dist/shell/assets/export-worker-D0h27FKA.js +0 -15
- package/dist/shell/assets/list-page-BJ7BwcjM.js +0 -4
- package/dist/shell/assets/parse-worker-BzKm_KiA.js +0 -35
- package/dist/shell/assets/record-page-Db_9ytem.js +0 -3
- package/dist/shell/assets/render-node-D5xobkr6.js +0 -3
- package/dist/shell/assets/shared-protobase-ui-CtGq44Ix.js +0 -1
- package/dist/shell/assets/step-catalog-C49x4u-Y.js +0 -2
- package/dist/shell/assets/workflow-status-field-RevEnRLG.js +0 -2
- package/dist/shell/assets/workflow-workbench-DY0czZaG.js +0 -4
- package/dist/shell-source-maps/assets/app-Cfc4Mr5v.js.map +0 -1
- package/dist/shell-source-maps/assets/en-BLkfn3BD.js.map +0 -1
- package/dist/shell-source-maps/assets/export-worker-D0h27FKA.js.map +0 -1
- package/dist/shell-source-maps/assets/nl-Ozd1Th1I.js.map +0 -1
- package/dist/shell-source-maps/assets/parse-worker-BzKm_KiA.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{$c as r,Al as i,Cl as a,Cs as o,Da as s,Dl as c,El as l,Fl as u,Gl as d,Hi as f,Il as p,La as m,Ol as ee,Pl as h,Qi as g,Sl as _,Tl as v,Va as y,Wl as b,_l as x,al as S,bl as C,bn as w,bo as T,fs as te,gl as ne,jl as re,kl as ie,os as ae,uc as oe,vl as se,wl as ce,xl as le,yl as ue,zr as de}from"./app-Cfc4Mr5v.js";import{i as fe,r as pe,t as me}from"./update-set-Da02tZfu.js";import{a as E,c as D,d as he,i as ge,l as _e,n as ve,o as ye,r as be,s as xe,t as Se,u as Ce}from"./lib-zod-B92j-KH2.js";import{t as we}from"./view-chart-ChBtewKd.js";import{n as O,o as k,s as Te}from"./use-workflow-page-DpBacPYs.js";var Ee=/^-?\d+$/,De=-(2n**63n),Oe=2n**63n-1n,ke={type:`bigint`,constraints:[],build:()=>D().refine(e=>Ee.test(e)&&BigInt(e)>=De&&BigInt(e)<=Oe,{message:`Expected a 64-bit integer as a string`})},Ae={type:`boolean`,constraints:[],build:()=>ge()},je={type:`country`,constraints:[],build:()=>D().regex(/^[A-Z]{2}$/,`Expected an ISO 3166-1 alpha-2 country code`)},Me={type:`currency`,constraints:[],build:()=>D().regex(/^[A-Z]{3}$/,`Expected an ISO 4217 currency code`)},Ne={type:`date`,constraints:[],build:()=>Se()},Pe=/^-?(\d*)(?:\.(\d+))?$/,Fe={type:`decimal`,constraints:[],build:e=>{if(e.precision===void 0||e.scale===void 0)throw Error(`f.decimal requires precision and scale`);let t=e.precision-e.scale,n=e.scale;return D().refine(e=>{let r=Pe.exec(e);if(!r)return!1;let i=(r[1]??``).replace(/^0+/,``),a=r[2]??``;return r[1]||a?i.length<=t&&a.length<=n:!1},{message:`Expected a decimal string with at most ${e.precision} digits, ${e.scale} after the point`,params:{precision:e.precision,scale:e.scale}})}},Ie={type:`enum`,constraints:[],build:e=>{if(!e.enumValues?.length)throw Error(`f.enum requires at least one value`);return be(e.enumValues)}},A={type:`file`,constraints:[],build:()=>D().min(1).max(4096)},Le={type:`integer`,constraints:[`min`,`max`],build:e=>{let t=E();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),t}},Re=(e,t=256)=>{let n=[[e,0]];for(;n.length>0;){let[e,r]=n.pop();if(typeof e==`object`&&e){if(r+1>t)return!1;for(let t of Object.values(e))n.push([t,r+1])}}return!0},ze={type:`json`,constraints:[],build:()=>xe((e,t)=>(Re(e)||t.addIssue({code:`custom`,message:`Nested deeper than 256 levels`,params:{max_depth:256}}),e),ye())},j={type:`relation`,constraints:[],build:()=>_e([D(),E()])},Be={type:`text`,constraints:[`min`,`max`,`regex`],build:e=>{let t=D();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),e.regex&&(t=t.regex(e.regex.re,e.regex.message)),t}},Ve={type:`timestamp`,constraints:[],build:()=>ve({offset:!0})},He={type:`uuid`,constraints:[],build:()=>Ce()},Ue=e=>b(e),M=e=>Ue(e).length===0?`its prompt must name at least one {{field}} of the record`:void 0,N=/\s*(?:(\d+(?:\.\d+)?)|([A-Za-z_][A-Za-z0-9_]*)|([-+*/(),]))/y,We=e=>{let t=[];for(N.lastIndex=0;N.lastIndex<e.length;){let n=N.lastIndex,r=N.exec(e);if(!r){let t=e.slice(n);if(t.trim()===``)break;let r=t.length-t.trimStart().length;throw Error(`Formula "${e}": unexpected "${t[r]}" at ${n+r+1}`)}let[i,a,o,s]=r,c=a??o??s;t.push({kind:a===void 0?o===void 0?`symbol`:`name`:`number`,text:c,at:n+i.length-c.length})}return t},Ge=e=>{let t=We(e),n=0,r=r=>{let i=t[n];throw Error(`Formula "${e}": ${r}${i?` at ${i.at+1}, found "${i.text}"`:` at the end`}`)},i=e=>t[n]?.kind===`symbol`&&t[n].text===e,a=e=>{i(e)||r(`expected "${e}"`),n+=1},o=()=>{a(`(`);let e=[u()];for(;i(`,`);)n+=1,e.push(u());return a(`)`),e},s=e=>{if(e===`coalesce`){let e=o();return e.length<2&&r(`coalesce() takes at least two values`),{kind:`coalesce`,args:e}}let t=o(),[n,i]=t;return t.length>2&&r(`round() takes a value and at most a number of digits`),i===void 0?{kind:`round`,value:n}:((i.kind!==`number`||i.value.includes(`.`))&&r(`round()'s digits must be a whole number`),{kind:`round`,value:n,digits:Number(i.value)})},c=()=>{let e=t[n];if(!e)return r(`expected a number, a field or "("`);if(e.kind===`number`)return n+=1,{kind:`number`,value:e.text};if(e.kind===`name`)return n+=1,i(`(`)?e.text!==`coalesce`&&e.text!==`round`?(--n,r(`unknown function "${e.text}", only coalesce() and round()`)):s(e.text):{kind:`field`,name:e.text};if(e.text===`-`)return n+=1,{kind:`negate`,operand:c()};if(e.text===`(`){n+=1;let e=u();return a(`)`),e}return r(`expected a number, a field or "("`)},l=()=>{let e=c();for(;i(`*`)||i(`/`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:c()}}return e},u=()=>{let e=l();for(;i(`+`)||i(`-`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:l()}}return e},d=u();return n<t.length&&r(`expected an operator`),d},Ke=he(),P=class e{def;meta;schema;constructor(e,t){this.def=e,this.meta=t;let n=e.build(t);t.nullable&&(n=n.nullable()),t.hasDefault&&(n=n.default(t.defaultValue)),this.schema=n.register(Ke,t)}column(e){return this.with({column:e})}readOnly(){return this.with({readOnly:!0})}optional(){return this.with({nullable:!0})}default(e){return this.with({hasDefault:!0,defaultValue:e})}access(e){return this.with({access:{...this.meta.access,...e}})}sensitive(){return this.with({sensitive:!0})}encrypted(){if(this.meta.type!==`text`)throw Error(`.encrypted() takes only f.text() fields`);return this.with({encrypted:!0,sensitive:!0})}strongSignIn(e={}){let t=e.minutes??15;if(!Number.isInteger(t)||t<1)throw Error(`.strongSignIn(): minutes must be a whole number of at least 1`);return this.with({strongSignIn:{minutes:t},sensitive:!0})}dbDefault(){return this.with({dbDefault:!0})}alias(...e){return this.with({aliases:[...this.meta.aliases,...e]})}filterable(){return this.with({filterable:!0})}sortable(){return this.with({sortable:!0})}regex(e,t){return this.constrain(`regex`,{regex:{re:e,message:t}})}min(e){return this.constrain(`min`,{min:e})}max(e){return this.constrain(`max`,{max:e})}ai(e){let t=M(e.prompt);if(t)throw Error(`.ai(): ${t}`);return this.with({ai:{prompt:e.prompt}})}rollup(e){return this.with({rollup:{...e},readOnly:!0})}formula(e){return Ge(e),this.with({formula:e,readOnly:!0})}lookup(e){return this.with({lookup:{...e},readOnly:!0,nullable:!0})}with(t){return new e(this.def,{...this.meta,...t})}constrain(e,t){if(!this.def.constraints.includes(e))throw Error(`f.${this.def.type} does not support .${e}()`);return this.with(t)}},qe=class extends P{columns(e){return this.with({relation:{resource:this.meta.relation.resource,columns:e}})}},F=[`webp`,`avif`,`jpeg`,`png`],Je=5e7,Ye={b:1,kb:1e3,mb:1e6,gb:1e9,kib:1024,mib:1024**2,gib:1024**3},I=e=>{if(typeof e==`number`){if(!Number.isSafeInteger(e)||e<=0)throw Error(`A file size must be a positive whole number of bytes, not ${e}`);return e}let t=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)?\s*$/i.exec(e),n=Ye[(t?.[2]??`b`).toLowerCase()];if(!t||!n)throw Error(`"${e}" is not a size; write it like "10 MB" or "512 KiB"`);return I(Math.round(Number(t[1])*n))},Xe=/^(?:\*\/\*|[a-z0-9][a-z0-9!#$&^_.+-]*\/(?:\*|[a-z0-9][a-z0-9!#$&^_.+-]*))$/,Ze=e=>e.map(e=>{let t=e.trim().toLowerCase();if(!Xe.test(t))throw Error(`"${e}" is not a media type or a type/* wildcard`);return t}),Qe=/^[a-z][a-z0-9-]{0,31}$/,$e=new Set([`http`,`https`,`data`,`blob`,`file`,`javascript`,`mailto`]),et=e=>{if(!Qe.test(e))throw Error(`"${e}" is not a file provider name: lowercase letters, digits and dashes, starting with a letter`);if($e.has(e))throw Error(`"${e}" cannot name a file provider: stored values would read as ${e}: links`);return e},tt=/^[a-z][a-z0-9_]{0,31}$/,nt=[`inside`,`cover`],L=(e,t)=>{if(t!==void 0&&(!Number.isSafeInteger(t)||t<1||t>16384))throw Error(`${e} must be a whole number of pixels from 1 to 16384, not ${t}`)},R=(e,t)=>{if(!F.includes(t.format))throw Error(`${e}: "${t.format}" is not an image format; use ${F.join(`, `)}`);if(t.fit!==void 0&&!nt.includes(t.fit))throw Error(`${e}: fit is "inside" or "cover", not "${t.fit}"`);if(t.fit===`cover`&&(t.width===void 0||t.height===void 0))throw Error(`${e}: fit "cover" needs both a width and a height`);if(L(`${e}: width`,t.width),L(`${e}: height`,t.height),t.quality!==void 0&&(!Number.isSafeInteger(t.quality)||t.quality<1||t.quality>100))throw Error(`${e}: quality must be a whole number from 1 to 100, not ${t.quality}`);return{...t}},rt=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>{if(!tt.test(e))throw Error(`"${e}" cannot name an image variant: lowercase letters, digits and underscores, starting with a letter`);return[e,R(`Image variant "${e}"`,t)]})),it=class e extends P{accept(e){return this.withFile({accept:Ze(e)})}maxSize(e){return this.withFile({maxSize:I(e)})}public(){return this.storage(`public`)}storage(e){return this.withFile({provider:et(e)})}derive(e){return this.withFile({derive:{...this.meta.file.derive,...e}})}placeholder(e){return this.withFile({placeholder:e})}typeField(e){return this.withFile({typeField:e})}sizeField(e){return this.withFile({sizeField:e})}variants(e,t={}){return this.withFile({variants:{...this.meta.file.variants,...rt(e)},...t.original&&{original:R(`The original`,t.original)}})}externalUrls(){return this.withFile({external:!0})}optional(){return this.with({nullable:!0})}readOnly(){return this.with({readOnly:!0})}column(e){return this.with({column:e})}access(e){return this.with({access:{...this.meta.access,...e}})}with(t){return new e(this.def,{...this.meta,...t})}withFile(e){return this.with({file:{...this.meta.file,...e}})}},z=e=>({type:e.type,nullable:!1,readOnly:!1,filterable:!1,sortable:!1,aliases:[],hasDefault:!1}),B=(e,t={})=>new P(e,{...z(e),...t}),V={text:()=>B(Be),integer:()=>B(Le),bigint:()=>B(ke),decimal:e=>B(Fe,e),boolean:()=>B(Ae),date:()=>B(Ne),timestamp:()=>B(Ve),uuid:()=>B(He),enum:e=>B(Ie,{enumValues:[...e]}),json:()=>B(ze),relation:e=>new qe(j,{...z(j),relation:{resource:e}}),file:()=>new it(A,{...z(A),file:{accept:[],maxSize:Je,provider:`private`}}),currency:()=>B(Me),country:()=>B(je)},at=e=>/^(https?:\/\/|mailto:)/i.test(e),ot=(e,t)=>[...typeof e.filter==`string`&&e.filter.trim()!==``?C(t,e.filter).map(e=>`filter: ${e.message}`):[`needs a filter that finds the record`],...e.orderBy===void 0?[]:_(t,e.orderBy).map(e=>`orderBy: ${e.message}`)],st=e=>e.when===void 0?e.otherwise!==void 0||e.reason!==void 0?`"otherwise" and "reason" need a "when" condition`:void 0:e.when.trim()===``?`"when" is empty`:e.otherwise===`disable`?e.reason?void 0:`a button disabled by "when" needs a "reason"`:e.reason===void 0?void 0:`"reason" shows only with otherwise: 'disable'`,H=(e,t)=>{let n=st(t);if(n)throw Error(`Action "${e}": ${n}`);return{name:e,label:t.label,bulk:t.bulk??!1,...t.icon!==void 0&&{icon:t.icon},...t.confirm!==void 0&&{confirm:t.confirm},...t.when!==void 0&&{when:t.when},...t.otherwise===`disable`&&{otherwise:t.otherwise,reason:t.reason},...t.variant!==void 0&&{variant:t.variant}}},U=(e,t)=>{if(!t)return{};let n=t(fe),r=pe(n);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{inputs:n}},ct={action:(e,t)=>({...H(e,t),...U(e,t.inputs),...t.mailbox&&{mailbox:!0}}),update:(e,t)=>{let n=U(e,t.inputs),r=me(t.set,n.inputs);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{...H(e,t),...n,run:{kind:`update`,values:t.set}}},remove:(e,t)=>({...H(e,t),run:{kind:`delete`}}),link:(e,t)=>{let n=d(t.label,t);if(n)throw Error(`Action "${e}": ${n}`);return`to`in t?{...H(e,t),run:{kind:`link`,to:structuredClone(t.to)}}:{...H(e,t),run:{kind:`link`,href:t.href}}},ai:(e,t)=>{let n=M(t.prompt)??(t.writes===``?`it writes no field`:void 0);if(n)throw Error(`Action "${e}": ${n}`);return{...H(e,t),run:{kind:`ai`,prompt:t.prompt,writes:t.writes}}}},lt=e=>{let{name:t,title:n,fields:r,thanks:i}=e;if(!v.test(t))throw Error(`A form's name goes in its address, so it takes lowercase letters, digits, - and _, not "${t}"`);if(r.length===0)throw Error(`Form "${t}" has no fields`);let a=r.map(e=>e.name),o=a.find((e,t)=>a.indexOf(e)!==t);if(o!==void 0)throw Error(`Form "${t}" lists the field "${o}" twice`);if(i.trim()===``)throw Error(`Form "${t}" needs a thanks text, shown once a visitor sends it`);if(n!==void 0&&n.trim()===``)throw Error(`Form "${t}" has an empty title; leave it out for the view's name`);let s=e.perMinute??5;if(!Number.isInteger(s)||s<1)throw Error(`Form "${t}" takes perMinute as a positive whole number, not ${s}`);return{name:t,...n!==void 0&&{title:n},fields:a,thanks:i,perMinute:s}},ut=e=>typeof e==`object`&&!!e&&e.kind===`related`,dt={related:(e,t)=>({kind:`related`,name:e,...structuredClone(t)})},ft=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,pt=/^[A-Z]{3}$/,mt=class e{name;props;constructor(e,t={}){this.name=e,this.props=t}label(e){return this.with({label:e})}help(e,t={}){return this.with({help:e,...t.when!==void 0&&{helpWhen:t.when}})}when(e){return this.with({when:e})}notOnCreate(){return this.with({notOnCreate:!0})}confirm(e){if(e.trim()===``)throw Error(`Field "${this.name}": .confirm() needs the question to ask`);return this.with({confirm:e})}format(t,n={}){if(n.text===void 0&&t===`url`)return this.with({format:t});if(n.text===void 0){let{linkText:n,...r}=this.props;return new e(this.name,{...r,format:t})}if(t!==`url`)throw Error(`Field "${this.name}": only format('url') takes a link text`);if(n.text.trim()===``)throw Error(`Field "${this.name}": format('url') needs a link text that is not empty`);return this.with({format:t,linkText:n.text})}multiline(){return this.with({multiline:!0})}markdown(){return this.with({markdown:!0})}prefix(e){return this.with({prefix:e})}currency(e){if(!pt.test(e))throw Error(`Field "${this.name}": currency "${e}" is not an ISO 4217 code such as EUR`);return this.with({currency:e})}suffix(e){return this.with({suffix:e})}decimals(e){return this.with({decimals:e})}valueLabels(e){return this.with({valueLabels:{...this.props.valueLabels,...e}})}valueColors(e){let t=Object.entries(e),n=t.find(([,e])=>!x(e)&&!ft.test(e));if(n)throw Error(`Field "${this.name}": value colour "${n[1]}" of "${n[0]}" is not a tone (${ne.join(`, `)}) or a hex colour such as #00a651`);return this.with({valueColors:{...this.props.valueColors,...Object.fromEntries(t)}})}waitingValues(e){return this.with({waitingValues:[...e]})}badgeShape(e){return this.with({badgeShape:e})}icon(e){return this.with({icon:e})}widget(e,t){return this.with({widget:{name:e,...t&&{props:t}}})}with(t){return new e(this.name,{...this.props,...t})}},ht={range:(e,t={})=>({kind:`range`,field:e.name,histogram:t.histogram??!1,...t.secondary&&{secondary:!0}}),facets:(e,t={})=>({kind:`facets`,field:e.name,search:t.search??!1,...t.secondary&&{secondary:!0}}),dateRange:(e,t={})=>({kind:`dateRange`,field:e.name,presets:t.presets??[],...t.secondary&&{secondary:!0}}),toggle:(e,t={})=>({kind:`toggle`,field:e.name,...t.secondary&&{secondary:!0}}),flags:(e,t)=>({kind:`flags`,fields:e.map(e=>e.name),label:t.label,...t.secondary&&{secondary:!0}})},gt=new Set([`resource`,`names`,`nav`,`help`,`list`,`filters`,`chart`]),_t=(e,t)=>{let n=(e,n,r)=>n===void 0||t.fields[n]?.type===r?[]:[`${e} "${n}" is not a ${r} field of the resource`];return[...n(`filter`,e.filter,`text`),...n(`name`,e.name,`text`),...n(`unseen.seenAt`,e.unseen?.seenAt,`timestamp`),...(e.controls??[]).flatMap(e=>[`enum`,`boolean`].includes(t.fields[e]?.type??``)?[]:[`control "${e}" is not an enum or boolean field of the resource`]),...e.limit===void 0||Number.isInteger(e.limit)&&e.limit>0?[]:[`limit must be a positive whole number`]]},vt=class e{state;constructor(e){this.state=e}names(e){return this.next({names:e})}icon(e){return this.next({icon:e})}forRoles(e){return this.next({roles:e})}title(e){return this.next({title:e(this.refs()).name})}titleFrom(e,t){let n=t(this.refs()).map(e=>e.name);if(e===``)throw Error(`View "${this.state.resource}": titleFrom needs the name of a rule`);if(n.length===0)throw Error(`View "${this.state.resource}": titleFrom "${e}" reads no fields`);return this.next({titleFrom:{rule:e,fields:n}})}searchResult(e){let{title:t,subtitle:n}=e(this.refs()),r=t===void 0?[]:Array.isArray(t)?t:[t];return this.next({searchResult:{...r.length>0&&{title:r.map(e=>e.name)},...n&&{subtitle:n.name}}})}nav(e){return this.next({nav:e})}help(e){return this.next({help:e})}fields(e){let t=e(h(e=>new mt(e))),n=Object.fromEntries(Object.values(t).map(e=>[e.name,e.props]));return this.next({fields:{...this.state.fields,...n}})}list(e){let{columns:t,sort:n,search:r,filter:i,editable:a,displays:o=[],default:s,drag:c}=e(this.refs(),re,dt),l=t.filter(ut).map(({kind:e,...t})=>t),u=t.map(e=>e.name),d=u.find((e,t)=>u.indexOf(e)!==t);if(d!==void 0)throw Error(`View "${this.state.resource}": the list has two columns named "${d}"`);let f=a?.find(e=>!u.includes(e.name));if(f)throw Error(`View "${this.state.resource}": editable field "${f.name}" is not among the list's columns`);let p={columns:u,...l.length>0&&{relatedColumns:l},...n&&{sort:n.map(([e,t])=>[e.name,t])},...r&&{search:r.map(e=>e.name)},...i!==void 0&&i!==``&&{filter:i},...a&&a.length>0&&{editable:a.map(e=>e.name)},...o.length>0&&{displays:o},...s!==void 0&&{default:s},...c&&{drag:{...c}}},m=ie(p);if(m.length>0)throw Error(`View "${this.state.resource}": ${m.join(`; `)}`);return this.next({list:p})}filters(e){return this.next({filters:e(this.refs(),ht)})}namedList(e,t){let n=`View "${this.state.resource}": named list "${e}"`;if(!v.test(e))throw Error(`${n}: its name goes in its address, so it takes lowercase letters, digits, - and _`);if(this.state.lists?.some(t=>t.name===e))throw Error(`${n} is declared twice`);let r=W(this.state.resource),{state:i}=t(r),a=Object.keys(i).filter(e=>!gt.has(e)&&i[e]!==r.state[e]);if(a.length>0)throw Error(`${n} sets ${a.join(`, `)}; a named list takes names, nav, help, list, filters and chart`);if(!i.names)throw Error(`${n} needs .names(...), its sidebar entry`);if(i.nav?.recent)throw Error(`${n}: recent records are the view's own, not a named list's`);let o={name:e,names:i.names,filters:i.filters,...i.nav&&{nav:i.nav},...i.help!==void 0&&{help:i.help},...i.list&&{list:i.list},...i.chart&&{chart:i.chart}};return this.next({lists:[...this.state.lists??[],o]})}layout(e){return this.next({layout:e(this.refs())})}chart(e){return this.next({chart:we(e(this.refs()))})}form(e){return this.next({forms:[...this.state.forms??[],lt(e(this.refs()))]})}recordMode(e){return this.next({recordMode:e})}helpWhen(e){return this.next({helpWhen:e})}saveFeedback(e){return this.next({saveFeedback:e})}recordWidth(e){return this.next({recordWidth:e})}titleBadge(e){return this.next({titleBadge:e(this.refs()).name})}import(e){return this.next({import:e})}actions(e){return this.next({actions:e(ct)})}listOf(e){return this.next({listOf:e(this.refs()).name})}signIn(e){if(e.signUp&&!at(e.signUp.href))throw Error(`View "${this.state.resource}": signIn signUp.href must start with https://, http:// or mailto:`);return this.next({signIn:structuredClone(e)})}saveSearch(e){return this.next({saveSearch:{...e}})}export(e){if(e&&e.maxRows!==void 0&&!(Number.isInteger(e.maxRows)&&e.maxRows>0))throw Error(`View "${this.state.resource}": export maxRows must be a positive whole number`);return this.next({export:e&&{...e}})}create(e){return this.next({create:{...e}})}record(e){return typeof e==`function`?this.next({record:{surface:e(this.refs()).surface.name}}):`conversation`in e?this.next({record:{conversation:structuredClone(e.conversation)}}):this.next({record:{component:c(e.component,`record component`),...e.focus&&{focus:!0}}})}recordOpens(e){let t=Array.isArray(e)?[...e]:[e];if(t.length===0)throw Error(`View "${this.state.resource}": recordOpens needs at least one address`);return this.next({recordOpens:structuredClone(t)})}createOpens(e){return this.next({createOpens:structuredClone(e)})}searchesOf(e){let{resource:t,filter:n,name:r,controls:i,unseen:a,limit:o}=e(this.refs()),s={resource:t,filter:n.name,...r&&{name:r.name},...i&&{controls:i.map(e=>e.name)},...a&&{unseen:{seenAt:a.seenAt.name,field:a.field}},...o!==void 0&&{limit:o}};return this.next({searchesOf:s})}toModel(t){let{title:n,titleFrom:r,titleBadge:o,nav:s,searchResult:c,list:u,listOf:d}=this.state;if(t&&n!==void 0&&!Object.hasOwn(t.fields,n))throw Error(`View "${this.state.resource}": title field "${n}" does not exist on the resource`);if(t&&o!==void 0&&!Object.hasOwn(t.fields,o))throw Error(`View "${this.state.resource}": title badge field "${o}" does not exist on the resource`);if(t&&o!==void 0&&t.fields[o].type!==`enum`&&this.state.fields[o]?.format!==`badge`)throw Error(`View "${this.state.resource}": title badge field "${o}" is no enum and has no .format('badge'), so it would not fit a badge`);let f=t?r?.fields.find(e=>!Object.hasOwn(t.fields,e)):void 0;if(f!==void 0)throw Error(`View "${this.state.resource}": titleFrom field "${f}" does not exist on the resource`);let m=t?[...c?.title??[],...c?.subtitle?[c.subtitle]:[]].filter(e=>!Object.hasOwn(t.fields,e)):[];if(m.length>0)throw Error(`View "${this.state.resource}": search result field "${m[0]}" does not exist on the resource`);for(let e of t?u?.displays??[]:[]){let n=i(e).find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" names field "${n}", which the resource does not have`);if(e.kind===`cards`&&e.image!==void 0&&t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${e.image}" as its image, which is not a file field`);let r=e.kind===`cards`?e.flags?.find(e=>t.fields[e].type!==`boolean`):void 0;if(r!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${r}" as a flag, which is not a boolean field`);let a=e.kind===`board`?l(e,t):[];if(a.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${a.join(`; `)}`);let o=e.kind===`calendar`||e.kind===`timeline`?ee(e,t):[];if(o.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${o.join(`; `)}`)}let h=t?u?.relatedColumns?.find(e=>Object.hasOwn(t.fields,e.name)):void 0;if(h)throw Error(`View "${this.state.resource}": related column "${h.name}" has the name of a field of the resource`);let g=new Set,_=this.state.layout.flatMap((e,t)=>e.kind===`tab`?[{item:e,index:t}]:[]),v=_.find((e,t)=>t>0&&e.index!==_[t-1].index+1);if(v)throw Error(`View "${this.state.resource}": tabs stand together, and "${v.item.title}" is apart from the others`);let y=new Set;for(let{item:e}of _){if(y.has(e.title))throw Error(`View "${this.state.resource}": two tabs are titled "${e.title}"`);y.add(e.title)}for(let e of this.state.layout.flatMap(e=>e.kind===`tab`?e.items:[e]))if(e.kind===`group`){if(g.has(e.title))throw Error(`View "${this.state.resource}": two groups are titled "${e.title}"`);g.add(e.title)}for(let e of t?ce(this.state.layout):[])if(e.kind===`gallery`&&e.image!==void 0){if(!Object.hasOwn(t.fields,e.image))throw Error(`View "${this.state.resource}": gallery "${e.title}" names field "${e.image}", which the resource does not have`);if(t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": gallery "${e.title}" shows "${e.image}" as its image, which is not a file field`)}if(t&&d!==void 0&&(!Object.hasOwn(t.fields,d)||t.fields[d].type!==`relation`))throw Error(`View "${this.state.resource}": listOf names "${d}", which is not a relation field of the resource`);let b=t&&this.state.searchesOf?_t(this.state.searchesOf,t):[];if(b.length>0)throw Error(`View "${this.state.resource}": searchesOf ${b.join(`; `)}`);for(let e of t?this.state.forms??[]:[]){let n=e.fields.find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": form "${e.name}" names field "${n}", which the resource does not have`)}if(s?.tenant===`current`&&!u)throw Error(`View "${this.state.resource}": nav.tenant narrows the opening filter of the list, so the view needs .list(...)`);let x=t?.tenant===void 0?void 0:t.fields[t.tenant];if(t&&s?.tenant===`current`&&!x?.filterable)throw Error(`View "${this.state.resource}": nav.tenant opens the list on the current tenant, so the resource needs .tenant() on a .filterable() field`);if(typeof s?.create==`object`&&s.create.label.trim()===``)throw Error(`View "${this.state.resource}": nav.create needs a label, or true for "New <singular>"`);let S=t&&s?.recent?le(s.recent,t):[];if(S.length>0)throw Error(`View "${this.state.resource}": nav.recent ${S.join(`; `)}`);let C=t&&s?.start?ot(s.start,t):[];if(C.length>0)throw Error(`View "${this.state.resource}": nav.start ${C.join(`; `)}`);let w=t?(this.state.recordOpens??[]).flatMap(p).find(e=>!Object.hasOwn(t.fields,e)):void 0;if(w!==void 0)throw Error(`View "${this.state.resource}": recordOpens names field "${w}", which the resource does not have`);if(this.state.lists?.length&&(d!==void 0||this.state.searchesOf))throw Error(`View "${this.state.resource}": named lists cannot go with listOf or searchesOf, which replace the list page`);let T=t?ue(this.state.record,t):[];if(T.length>0)throw Error(`View "${this.state.resource}": record ${T.join(`; `)}`);for(let n of this.state.lists??[])new e(a(this.state,n.name)).toModel(t);return structuredClone({...this.state,...!r&&se(this.state.record)})}refs(){return h(u)}next(t){return new e({...this.state,...t})}},W=e=>new vt({resource:e,fields:{},filters:[],layout:[],actions:[]}),G=[`failing`,`unresolved`,`healthy`,`no_runs`,`resolved`,`new_version`],yt={failing:`danger`,unresolved:`warning`,healthy:`success`},bt=[`failing`,`unresolved`],K={read:e=>e.holds?.(`workflow_runs.read`)??!1};V.enum(G).readOnly().dbDefault().access(K),V.relation(`workflow_runs`).optional().readOnly().access(K),V.timestamp().optional().readOnly().access(K),V.integer().readOnly().dbDefault().access(K),V.timestamp().optional().readOnly(),V.text().optional().readOnly(),W(`workflow_resolutions`).names({singular:`Workflow resolution`,plural:`Workflow resolutions`}).icon(`check`).nav({hidden:!0}).title(e=>e.resolved_at).fields(e=>({workflow_id:e.workflow_id.label(`Workflow`),resolved_by:e.resolved_by.label(`Resolved by`),resolved_at:e.resolved_at.label(`Resolved`)})).list(e=>({columns:[e.workflow_id,e.resolved_by,e.resolved_at],sort:[[e.resolved_at,`desc`]]}));var q=r(`app/field-types/workflow-status`),J=e(n(),1),xt=({id:e})=>(0,J.jsx)(J.Fragment,{children:f().member(e)?.name??e}),St=({by:e,at:t})=>{let n=o(),r=n?.state.kind===`signed-in`&&e!==null&&String(n.state.user.id)===e?q(`you`):e===null?`?`:n?.organizations?(0,J.jsx)(xt,{id:e}):e;return(0,J.jsx)(`p`,{className:`text-body text-muted-foreground`,children:q.rich(`resolvedBy`,{who:r,when:g(Date.parse(t))})})},Y=e=>G.includes(e),X=e=>yt[e]??`neutral`,Ct=e=>{if(Y(e))return{tone:X(e),words:q(`label`,{status:e})}},Z=e=>g(Date.parse(String(e))),wt=e=>{let t=e.run_status;if(!Y(t))return;let n={status:t,tone:X(t),resolvable:bt.includes(t)},r=e.status_run_id==null?void 0:String(e.status_run_id);return t===`failing`||t===`healthy`?{...n,words:q(t,{when:Z(e.status_run_at),runs:10}),...r&&{run:r}}:t===`unresolved`?{...n,words:q(t,{count:Number(e.unresolved_failures),runs:10,when:Z(e.status_run_at)}),...r&&{run:r}}:{...n,words:q(t)}},Tt=e(t(),1),Q=`workflow_resolutions`,$=(e,t)=>{let n=te(),r=w(),i=m(),a=s(ae(`workflow_resolutions`),`create`)&&t,[o,c]=(0,Tt.useState)(!1);return{permitted:a,busy:o,resolve:async()=>{c(!0),await n.create(Q,{workflow_id:e}).then(async()=>{await Promise.all([r(`workflows`),r(Q)]),i.show({state:`success`,title:q(`resolveDone`)})},()=>i.show({state:`error`,title:q(`resolveFailed`)})),c(!1)}}},Et=({workflow:e,value:t})=>{let n=y(Te,e).data,r=n?.record,i=$(e,n?.permissions?.update!==!1),a=r&&wt({...r,run_status:t});return!r||!a?null:(0,J.jsxs)(`div`,{className:`grid gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,"data-status":a.status,children:[(0,J.jsx)(T,{tone:a.tone}),a.run?(0,J.jsx)(de,{to:k({workflow:e,run:a.run}),className:`font-medium text-primary-text hover:underline`,children:a.words}):(0,J.jsx)(`span`,{children:a.words})]}),a.resolvable&&i.permitted&&(0,J.jsx)(oe,{size:`sm`,loading:i.busy,onClick:()=>void i.resolve(),children:q(`resolve`)})]}),r.resolved_at!=null&&(0,J.jsx)(St,{by:r.resolved_by==null?null:String(r.resolved_by),at:String(r.resolved_at)})]})},Dt=({value:e})=>{let t=O();return e===null||!t?null:(0,J.jsx)(Et,{workflow:t.workflow,value:e})},Ot=({value:e})=>{let t=Ct(e);return t?(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,J.jsx)(T,{tone:t.tone}),t.words]}):null},kt={of:[...S.workflow_status],display:Dt,cell:Ot};export{kt as workflowStatusField};
|
|
2
|
-
//# debugId=117af127-44b1-443d-bd5a-f78b63e35d50
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{$ as r,Bn as i,Br as a,Cc as o,Co as s,Da as c,En as l,Ho as u,Oc as d,Q as f,Qc as p,Qi as m,R as h,Rn as g,Sc as _,Uc as v,V as y,Va as b,Wc as x,X as S,Ys as C,as as w,dc as T,es as ee,et as E,fs as D,gr as O,hc as te,n as k,nt as A,os as ne,ot as j,r as M,sc as re,tt as N,uc as P,ul as F,xc as ie,yc as I,zr as L}from"./app-Cfc4Mr5v.js";import{h as ae}from"./vendor-t7Q7QbPu.js";import{A as R,C as oe,D as se,E as ce,O as le,T as ue,_ as de,a as fe,b as pe,c as me,d as he,f as ge,g as _e,h as ve,i as ye,k as be,l as z,m as xe,n as Se,o as Ce,p as we,r as B,s as V,t as H,u as Te,v as Ee,w as De,x as Oe,y as ke}from"./step-catalog-C49x4u-Y.js";import{t as Ae}from"./circle-alert-C9z9GbbN.js";import{h as U,m as W,t as je}from"./workflow-canvas-DpONgLJR.js";import{t as G}from"./record-sidebar-HqyBXBwn.js";import{a as Me,o as K,r as Ne,t as Pe}from"./step-panel-CyZhEKcD.js";import{M as q,N as J,_ as Fe,g as Ie,h as Le,j as Re}from"./workflows-Bey4jszG.js";import{E as Y,S as ze,T as X,_ as Be,b as Ve,n as He,v as Ue,w as We,y as Ge}from"./use-run-trace-BEM0bOMt.js";import{n as Z}from"./use-workflow-types-Bc6SdoP6.js";import{a as Ke,i as qe,o as Je,r as Ye,s as Xe,t as Ze}from"./use-workflow-page-DpBacPYs.js";var Qe={name:`shuffle`,size:24,node:[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]};Qe.node;var $e=x(Qe),Q=e(t(),1),$=e(n(),1),et=({types:e,placement:t,onAdd:n,onClose:r})=>{let i=(0,Q.useMemo)(()=>Se(e),[e]);return(0,$.jsx)(N,{title:B(`addStepTitle`),onClose:r,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,$.jsx)(S,{autoFocus:!0,groups:i,onPick:e=>n(H(e.id))})]})})},tt=`$states.context.Execution.Input`,nt=e=>(e.description??``).split(` · `)[0],rt=({definition:e,path:t,target:n,run:r,onAssign:i,onBack:a,onTestRun:o})=>{let s=He(r===void 0?void 0:String(r.id),!1),c=(0,Q.useMemo)(()=>s.data??[],[s.data]),l=(0,Q.useMemo)(()=>Ce(e,t),[e,t]),u=(0,Q.useMemo)(()=>l.filter(t=>!z(e,t)),[l,e]),d=l.filter(t=>z(e,t)),f=e=>c.filter(t=>K(t.scope,t.state)===e).at(-1)?.output,p=(0,Q.useMemo)(()=>r?[{title:B(`runInputGroup`),items:me(r.input??{}).map(({path:e,sample:t})=>({id:`input:${e}`,title:e===``?B(`wholeValue`):e,description:t}))},...u.flatMap(t=>{let n=f(t);if(n==null)return[];let r=X(t).name;return[{title:r,items:me(n).map(({path:n,sample:i})=>({id:`step:${t}\n${n}`,title:n===``?B(`wholeValue`):n,description:Te(e,t).added?`${i} · ${B(`addsVariable`,{step:r})}`:i}))}]})]:[],[r,c,u,e]),h=(t,r)=>{if(t.startsWith(`input:`)){n.set(he(n.value,V(tt,t.slice(6)))),a();return}let[o,s]=t.slice(5).split(`
|
|
2
|
-
`),{variable:c,added:l}=Te(e,o);l&&i(o,c,r),n.set(he(n.value,V(`$${c}`,s))),a()},g=u.filter(t=>Y(e,t)&&f(t)==null);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(P,{size:`sm`,variant:`ghost`,className:`self-start`,onClick:a,children:[(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),B(`back`)]}),(0,$.jsx)(`h3`,{className:`font-semibold`,children:B(`insertInto`,{field:n.label})}),r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`valuesFrom`,{when:m(Date.parse(String(r.created_at)))})}),(0,$.jsx)(S,{autoFocus:!0,groups:p,onPick:e=>h(e.id,nt(e))}),g.length>0&&(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[g.map(e=>X(e).name).join(`, `),`: `,B(`noSample`)]}),d.length>0&&(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[d.map(e=>X(e).name).join(`, `),`: `,B(`outputShaped`)]})]}):(0,$.jsxs)(`div`,{className:`grid justify-items-start gap-2 text-body`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:B(`noRunYet`)}),(0,$.jsx)(P,{onClick:o,children:B(`testRun`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`typeByHand`)})]})]})},it=(e,t)=>{let n=f(),r=D(),{go:i}=a(),[o,s]=(0,Q.useState)(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(!1);return{start:async a=>{d(!0),s(void 0),l(!1);try{if(n.dirty&&!await n.save()){l(!0);return}let{record:o}=await r.create(`workflow_runs`,{workflow_id:e.workflow,rerun_of:e.run,...a}),{record:s}=await r.get(Xe,e.workflow);t(),i(qe(e.workflow,String(o.id),Number(o.version),Number(s.version)))}catch(e){if(!C(e))throw e;s(e)}finally{d(!1)}},failure:o,refused:c,busy:u}},at=e=>e.map(e=>B(`stepActs`,e)).join(`, `),ot=({failure:e,refused:t})=>(0,$.jsxs)($.Fragment,{children:[e!==void 0&&(0,$.jsx)(O,{title:B(`notRerun`),error:e}),t&&(0,$.jsx)(`p`,{role:`alert`,className:`text-danger-text`,children:B(`rerunRefused`)})]}),st=({view:e,page:t,definition:n,types:r,step:i,onStep:a,onClose:o})=>{let s=f(),c=it(e,o),l=t.trace.steps.filter(e=>e.scope===``),u=Math.max(l.findIndex(e=>e.state===i),0),d=we(n,r,i),p=new Set(l.map(e=>e.state)),m=d.filter(e=>p.has(e.name)),h=d.filter(e=>!p.has(e.name)),g=(t.latest??0)+ +!!s.dirty,_=l.slice(0,u).find(e=>ge(t.trace.definition,n,e.state))?.state;return(0,$.jsx)(N,{title:B(`rerunTitle`,{step:i}),onClose:o,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[(0,$.jsx)(ot,{failure:c.failure,refused:c.refused}),(0,$.jsx)(`p`,{children:u===0?B(`rerunFromStart`,{version:g}):B(`rerunKeeps`,{count:u,version:g})}),m.length>0&&(0,$.jsx)(`p`,{children:B(`rerunActsAgain`,{steps:at(m)})}),h.length>0&&(0,$.jsx)(`p`,{children:B(`stepsAct`,{steps:at(h)})}),_&&(0,$.jsx)(`p`,{children:B(`rerunChanged`,{changed:_,step:i})}),_&&(0,$.jsx)(P,{variant:`primary`,className:`max-md:min-h-11`,onClick:()=>a(_),children:B(`rerunFromInstead`,{step:_})}),(0,$.jsx)(P,{variant:_?`secondary`:`primary`,className:`max-md:min-h-11`,loading:c.busy,onClick:()=>void c.start({rerun_from:i}),children:_?B(`rerunWithOldResult`,{step:i}):s.dirty?B(`saveAndRerunShort`):B(`rerunStart`)})]})})},ct=({view:e,page:t,onClose:n})=>{let r=it(e,n);return(0,$.jsx)(N,{title:B(`replayTitle`),onClose:n,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[(0,$.jsx)(ot,{failure:r.failure,refused:r.refused}),(0,$.jsx)(`p`,{children:B(`replayLine`,{version:t.latest??0})}),(0,$.jsx)(P,{variant:`primary`,className:`max-md:min-h-11`,loading:r.busy,onClick:()=>void r.start({replay:!0}),children:B(`replayStart`)})]})})},lt=()=>{let e=w().views.workflow_runs?.fields.status;return{hints:e,label:t=>F(String(t),e?.valueLabels)}},ut=e=>e==null?void 0:m(Date.parse(String(e))),dt=({trace:e,valueActions:t,onReplay:n,onClose:r})=>{let i=lt(),{run:a,id:o}=e;if(!a||!o)return null;let s=[{label:B(`status`),value:(0,$.jsx)(l,{value:a.status,hints:i.hints,children:i.label(a.status)})},{label:B(`started`),value:ut(a.created_at)},{label:B(`startedBy`),value:a.started_by==null?void 0:String(a.started_by)},{label:B(`goesOnAt`),value:ut(a.resume_at)},{label:B(`finished`),value:ut(a.finished_at)},{label:B(`duration`),value:a.duration_ms==null?void 0:B(`durationMs`,{ms:Number(a.duration_ms)})}].flatMap(e=>e.value===void 0?[]:[e]);return(0,$.jsx)(N,{title:B(`runDetails`),onClose:r,...n&&{footer:(0,$.jsx)(P,{className:`w-full max-md:min-h-11`,onClick:n,children:B(`replay`)})},children:(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[(0,$.jsx)(G,{title:B(`runDetails`),rows:s}),!e.going&&e.steps.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`runNoTrace`)}),a.error!=null&&(0,$.jsx)(Ne,{title:B(`error`),children:(0,$.jsxs)(`p`,{className:`text-body text-danger-text`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:String(a.error)}),a.cause!=null&&(0,$.jsxs)(`span`,{children:[`: `,String(a.cause)]})]})}),a.input!=null&&(0,$.jsxs)(Ne,{title:B(`input`),children:[(0,$.jsx)(g,{value:a.input}),t(a.input,`input`)]}),a.output!=null&&(0,$.jsxs)(Ne,{title:B(`output`),children:[(0,$.jsx)(g,{value:a.output}),t(a.output,`output`)]}),(0,$.jsx)(L,{to:{kind:`record`,resource:`workflow_runs`,key:o,standard:!0},className:`text-body font-medium text-primary-text hover:underline`,children:B(`runPage`)})]})})},ft=({value:e,onUse:t})=>{let[n,r]=(0,Q.useState)(!1),i=async()=>{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),r(!0)};return(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[t&&(0,$.jsx)(P,{size:`sm`,onClick:t,children:B(`useAsTestInput`)}),(0,$.jsx)(P,{size:`sm`,onClick:()=>void i(),children:B(`copyJson`)}),(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:n&&B(`copied`)})]})},pt=e=>e.Type===`Map`?{...e,ItemProcessor:{...e.ItemProcessor,States:Object.keys(e.ItemProcessor.States)}}:e.Type===`Block`?{...e,Processor:{...e.Processor,States:Object.keys(e.Processor.States)}}:e,mt=e=>Object.entries(e.States).flatMap(([e,t])=>[[e,pt(t)],...q(t)?mt(q(t)):[]]),ht=(e,t)=>{let n=new Map(mt(e.stateMachine).map(([e,t])=>[e,JSON.stringify(t)])),r=mt(t.stateMachine),i=r.filter(([e])=>!n.has(e)).length;return{changed:r.filter(([e,t])=>n.has(e)&&n.get(e)!==JSON.stringify(t)).length,added:i,removed:n.size-(r.length-i)}},gt=e=>{let t=D(),n=ae();return async r=>{await t.update(Xe,e,{enabled_version:r},`*`),await n.invalidateQueries({queryKey:p.record(Xe,e)})}},_t=({view:e,page:t,definition:n,types:r,newVersion:i,onClose:a})=>{let o=f(),s=D(),c=gt(e.workflow),[l,u]=(0,Q.useState)(),[d,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),g=e.version===void 0&&o.dirty,_=e.version??(t.latest??0)+(g&&i?1:0),{enabled:v,latest:y}=t,x=b(`workflow_versions`,[e.workflow,v??0],v!==void 0),S=!g&&y!==void 0&&_<y,C=t.runs.some(e=>Number(e.version)===_),w=x.data?ht(We(x.data.record),n):void 0,T=U(n.trigger),ee=async()=>{if(p(!0),h(!1),u(void 0),g&&!await o.save()){p(!1),h(!0);return}let t=e.version??Number((await s.get(`workflows`,e.workflow)).record.version);await c(t).then(a,u),p(!1)},E=g?B(`saveAndPublish`):v===void 0&&T!==`manual`?B(`publishAndTurnOn`):B(`publishVersion`,{version:_});return(0,$.jsx)(N,{title:B(S?`goBackTo`:`publishVersion`,{version:_}),onClose:a,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[l!==void 0&&(0,$.jsx)(O,{title:B(`notPublished`),error:l}),m&&(0,$.jsx)(`p`,{role:`alert`,className:`text-danger-text`,children:B(`notPublishedSave`)}),g&&(0,$.jsx)(`p`,{children:B(`savesThenPublishes`,{version:_})}),S&&(0,$.jsx)(`p`,{children:B(`rollback`,{latest:y,version:_})}),!S&&v!==void 0&&(0,$.jsx)(`p`,{children:B(`publishChange`,{live:v,version:_})}),v===void 0&&(T===`manual`?(0,$.jsx)(`p`,{children:B(`publishManual`,{version:_})}):(0,$.jsx)(`p`,{children:B(`startsTrigger`,{trigger:W(n.trigger,r)})})),w&&(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:B(`publishDiff`,{...w,version:v??0})}),!C&&(0,$.jsx)(`p`,{className:`text-warning-text`,children:B(`untested`,{version:_})}),(0,$.jsx)(P,{variant:`primary`,className:`max-md:min-h-11`,loading:d,onClick:()=>void ee(),children:E})]})})},vt=({view:e,onClose:t})=>{let n=gt(e.workflow),[r,i]=(0,Q.useState)(),[a,o]=(0,Q.useState)(!1),s=async()=>{o(!0),await n(null).then(t,i),o(!1)};return(0,$.jsx)(N,{title:B(`turnOffTitle`),onClose:t,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[r!==void 0&&(0,$.jsx)(O,{title:B(`notTurnedOff`),error:r}),(0,$.jsx)(`p`,{children:B(`turnOffLine`)}),(0,$.jsx)(P,{variant:`danger`,className:`max-md:min-h-11`,loading:a,onClick:()=>void s(),children:B(`turnOff`)})]})})},yt=({view:e,page:t,failed:n,changed:r,gone:i,onOpenFailed:a})=>{let{latest:o,trace:s}=t,c=s.run,l=e.version!==void 0&&e.version!==o,u=Je({workflow:e.workflow,...e.run&&{run:e.run}}),d=(0,$.jsx)(L,{to:u,className:T({size:`sm`}),children:B(`editLatest`)}),f=(0,$.jsx)(L,{to:Ye(e,o),className:T({size:`sm`}),children:B(`hideRun`)});if(e.run===void 0)return l?(0,$.jsxs)(E,{level:`info`,actions:d,children:[B(`olderVersion`,{version:e.version??0,latest:o??0}),t.enabled!==void 0&&` ${B(`versionIsLive`,{version:t.enabled})}`]}):null;if(!c)return null;let p=m(Date.parse(String(c.created_at))),h=Number(c.version),g=!l&&h!==o&&(0,$.jsx)(L,{to:qe(e.workflow,e.run,h,o),className:T({size:`sm`}),children:B(`showRunVersion`,{version:h})}),_=typeof c.block_state==`string`?c.block_state:void 0,v=typeof c.block_of==`string`&&(0,$.jsx)(L,{to:qe(e.workflow,c.block_of,h,o),className:T({size:`sm`}),children:B(`openReachingRun`)});return(0,$.jsxs)(E,{level:`info`,actions:(0,$.jsxs)($.Fragment,{children:[n&&a&&(0,$.jsx)(P,{size:`sm`,onClick:a,children:B(`openFailed`)}),v,l&&d,g,f]}),children:[_===void 0?l?B(`runOlder`,{when:p,version:e.version??0,latest:o??0}):r?B(`runChanged`,{when:p,version:h}):h===o?n?B(`runFailedAt`,{when:p,step:n,version:h}):B(`runSame`,{when:p,version:h}):B(`runUsed`,{when:p,version:h,latest:o??0}):B(`blockRun`,{when:p,block:_,version:h}),i>0&&(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,B(`stepsGone`,{count:i})]})]})},bt=e=>e<1e3?B(`durationMs`,{ms:e}):B(`durationSeconds`,{seconds:Math.round(e/100)/10}),xt=e=>e==null?void 0:JSON.stringify(e),St=({view:e,page:t,onTestRun:n,onClose:r})=>{let[i,a]=(0,Q.useState)(`all`),o=lt(),c=t.runs.filter(e=>i===`all`||e.status===`failed`);return(0,$.jsx)(N,{title:B(`runs`),onClose:r,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(s,{value:i,label:B(`runs`),options:[{value:`all`,label:B(`filterAll`)},{value:`failed`,label:B(`filterFailed`)}],onChange:a}),t.runs.length===0&&(0,$.jsxs)(`div`,{className:`grid gap-2 justify-items-start`,children:[(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noRuns`)}),n&&(0,$.jsx)(P,{onClick:n,children:B(`testRun`)})]}),(0,$.jsx)(`ul`,{className:`grid gap-1`,children:c.map(n=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(L,{to:qe(e.workflow,String(n.id),Number(n.version),t.latest),"aria-current":e.run===n.id?`true`:void 0,onClick:r,className:`grid gap-0.5 rounded-md px-2 py-2 hover:bg-muted aria-[current]:bg-muted max-md:min-h-11`,children:[(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(l,{value:n.status,hints:o.hints,children:o.label(n.status)}),(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:m(Date.parse(String(n.created_at)))}),(0,$.jsx)(`span`,{children:B(`versionShort`,{version:Number(n.version)})}),n.duration_ms!=null&&(0,$.jsx)(`span`,{className:`tabular-nums`,children:bt(Number(n.duration_ms))}),(0,$.jsx)(`span`,{children:n.started_by==null?B(`startedByTrigger`):B(`startedByTest`)})]}),xt(n.input)&&(0,$.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:xt(n.input)})]})},String(n.id)))})]})})},Ct=({title:e,settings:t,run:n,state:r,block:i,tab:a,onTab:o,valueActions:c,footer:l,onClose:u})=>(0,$.jsx)(N,{title:e,onClose:u,footer:l,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n&&(0,$.jsx)(s,{value:a,label:e,options:[{value:`data`,label:B(`tabData`)},{value:`settings`,label:B(`tabSettings`)}],onChange:o}),n&&a===`data`?r===void 0?(0,$.jsxs)(Ne,{title:B(`input`),children:[(0,$.jsx)(g,{value:n.input??null}),c?.(n.input,`input`)]}):(0,$.jsx)(Pe,{run:n,name:r,...i!==void 0&&{block:i},...c&&{valueActions:c}}):t]})}),wt=(e,t)=>e.slice(0,t).split(`
|
|
3
|
-
`).length,Tt=e=>{try{JSON.parse(e);return}catch(t){if(!(t instanceof SyntaxError))throw t;let n=/position (\d+)/.exec(t.message)?.[1],r=/line (\d+)/.exec(t.message)?.[1]??(n===void 0?void 0:wt(e,Number(n)));return r===void 0?B(`notJson`):B(`notJsonLine`,{line:Number(r)})}},Et=e=>JSON.stringify(e??{},null,2),Dt=({view:e,page:t,definition:n,types:r,seed:o,onClose:s})=>{let c=f(),l=D(),{go:u}=a(),d=lt(),p=t.runs.filter(e=>e.input!=null).slice(0,5),[g,_]=(0,Q.useState)(()=>Et(o?o.value:p[0]?.input)),[v,y]=(0,Q.useState)(!1),b=M({resource:`workflow_runs`,feedback:`button`,onCreated:n=>{n&&(s(),u(qe(e.workflow,String(n.id),Number(n.version),e.version===void 0?Number(n.version):t.latest)))}}),x=Tt(g),S=e.version===void 0&&c.dirty,C=e.version??t.latest??0,w=async()=>{if(y(!1),S&&!await c.save())return y(!0);let t=e.version??Number((await l.get(`workflows`,e.workflow)).record.version);await b.submit({workflow_id:e.workflow,input:JSON.parse(g),version:t})},T=we(n,r);return(0,$.jsx)(N,{title:B(`testRun`),onClose:s,takesFocus:!0,children:(0,$.jsxs)(k,{form:b,fields:[],submit:B(S?`saveAndStart`:`startRun`),disabled:x!==void 0,onSubmit:()=>void w(),children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o?o.from:p[0]?B(`inputOfRun`,{when:m(Date.parse(String(p[0].created_at)))}):B(`noRunInput`)}),(0,$.jsx)(h,{label:B(`inputJson`),error:x,children:(0,$.jsx)(i,{rows:8,className:`font-mono text-xs`,value:g,invalid:x!==void 0,onChange:e=>_(e.target.value)})}),p.length>0&&(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:B(`startFromEarlier`)}),p.map(e=>(0,$.jsx)(`button`,{type:`button`,className:`truncate rounded-md px-2 py-1 text-left text-xs hover:bg-muted max-md:min-h-11`,onClick:()=>_(Et(e.input)),children:B(`earlierRun`,{when:m(Date.parse(String(e.created_at))),status:d.label(e.status)})},String(e.id)))]}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:S?B(`savesThenRuns`,{version:C+1}):e.version===void 0?B(`runsLatest`,{version:C}):B(`runsVersion`,{version:C})}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T.length>0?B(`stepsAct`,{steps:T.map(e=>B(`stepActs`,{name:e.name,kind:e.kind})).join(`, `)}):B(`nothingActs`)}),v&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger-text`,children:B(`notStarted`)})]})})},Ot=(e,{latest:t,enabled:n})=>B(e===t?e===n?`versionLatestLive`:`versionLatestDraft`:e===n?`versionLive`:`versionNumber`,{version:e}),kt=({page:e,draftOnly:t})=>{let n=f(),r=j()?.size,[i,a]=(0,Q.useState)(),o=(0,Q.useRef)(e.latest);(0,Q.useEffect)(()=>{if(e.latest===o.current)return;let t=o.current===void 0;if(o.current=e.latest,t)return;a(e.latest);let n=setTimeout(()=>a(void 0),At);return()=>clearTimeout(n)},[e.latest]);let s=n.saving?B(`saving`):n.refused?B(`saveRefused`):n.dirty&&t?B(`draftHere`):n.dirty?B(r===`wide`?`unsaved`:`unsavedShort`):i===void 0?void 0:B(`savedAs`,{version:i});return s?(0,$.jsx)(A,{zone:`state`,children:(0,$.jsx)(`span`,{role:`status`,className:`truncate`,children:s})}):null},At=4e3,jt=({view:e,page:t,editable:n,newVersion:i,empty:s,problems:l,missing:d,onAddStep:p,onProblems:m,onRuns:h,onTestRun:g,onPublish:v,onTurnOff:b,runActions:x,orderSwitch:S})=>{let C=f(),{go:w}=a(),T=j()?.size,E=u(),D=c(ne(`workflow_runs`),`create`),{latest:O,enabled:k}=t,M=e.version??O,re=k!==void 0&&k===M,N=(0,Q.useMemo)(()=>M===void 0||t.versions.some(e=>e.version===M)?t.versions:[...t.versions,{version:M,savedAt:``}],[t.versions,M]),F=s?B(`noStepsToRun`):re&&!i?B(`alreadyLive`,{version:M??0}):void 0,L=T===`compact`,ae=D?{name:B(`testRun`),icon:o,onRun:g,inBar:!0,...s&&{blocked:B(`noStepsToRun`)}}:void 0,R={name:B(`publish`),icon:te,onRun:v,...F&&{blocked:F}},oe=[...ae&&!L?[ae]:[],...L&&C.mayUpdate?[R]:[],...x??[],...k!==void 0&&C.mayUpdate?[{name:B(`turnOff`),icon:ie,onRun:b}]:[],...n&&S?[{name:Z(`orderSwitchTitle`,{order:S.to}),icon:$e,onRun:S.onRun,...S.refused!==void 0&&{blocked:Z(`orderSwitchRefused`,{reason:S.refused})}}]:[]];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(A,{zone:`mode`,children:[(0,$.jsx)(ee,{tone:k===void 0?`neutral`:`green`,children:k===void 0?B(`off`):B(`live`,{version:k})}),T!==`compact`&&(0,$.jsx)(y,{"aria-label":B(`version`),className:`w-auto`,value:M??``,onChange:t=>w(Ke(e.workflow,Number(t.target.value),O)),children:N.map(({version:e})=>(0,$.jsx)(`option`,{value:e,children:Ot(e,{latest:O,enabled:k})},e))})]}),(0,$.jsxs)(A,{zone:`controls`,children:[n&&E&&(0,$.jsxs)(P,{onClick:p,"aria-label":B(`addStep`),children:[(0,$.jsx)(_,{className:`size-3.5`,"aria-hidden":!0}),T!==`narrow`&&B(`addStep`)]}),(0,$.jsxs)(P,{onClick:h,className:`max-md:min-h-11`,children:[(0,$.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),B(`runs`)]}),l>0&&(0,$.jsxs)(P,{onClick:m,className:`text-danger-text`,children:[(0,$.jsx)(Ae,{className:`size-3.5`,"aria-hidden":!0}),B(`problems`,{count:l})]}),d>0&&l===0&&(0,$.jsx)(P,{onClick:m,children:B(`fieldsToFill`,{count:d})})]}),(0,$.jsx)(kt,{page:t,draftOnly:d>0}),(0,$.jsx)(r,{actions:oe}),C.mayUpdate&&!L&&(0,$.jsx)(A,{zone:`primary`,children:(0,$.jsx)(P,{variant:C.dirty?`secondary`:`primary`,"aria-disabled":F!==void 0,title:F,onClick:()=>F===void 0&&v(),children:B(`publish`)})}),L&&ae&&!C.dirty&&!s&&(0,$.jsx)(A,{zone:`primary`,children:(0,$.jsx)(P,{variant:`primary`,className:`min-h-11`,onClick:g,children:B(`testRun`)})})]})},Mt=e=>[`Task`,`Pass`,`Wait`,`Map`,`Block`].includes(e.Type),Nt=e=>{let t=new Set;for(let[,n]of Re(e))for(let e of J(n)){if(t.has(e))return e;t.add(e)}},Pt=e=>(e.Type===`Pass`||e.Type===`Succeed`)&&e.Output===void 0,Ft=(e,t,n)=>{let r=new Set(Object.values(e.States).flatMap(e=>e.Next===void 0?[]:[e.Next]));for(let[i,a]of Object.entries(e.States)){if(Pt(a)&&(t?r.has(i):i!==n))return i;let e=q(a),o=e&&Ft(e,t,t?void 0:Bt(e).StartAt);if(o)return o}},It=e=>{for(let t of Object.keys(e.States)){let n=new Set;for(let r=t;r!==void 0&&e.States[r];r=e.States[r].Next){if(n.has(r))return r;n.add(r)}}for(let t of Object.values(e.States)){let e=q(t),n=e&&It(e);if(n)return n}},Lt=e=>{let t=new Set;for(let n=e.StartAt;n!==void 0&&e.States[n]&&!t.has(n);n=e.States[n].Next)t.add(n);let n=Object.keys(e.States).find(e=>!t.has(e));if(n!==void 0)return n;for(let t of Object.values(e.States)){let e=q(t),n=e&&Lt(e);if(n)return n}},Rt=e=>`{% ${e.map(e=>`$states.context.Steps.${R(e)}.Status = 'SUCCEEDED'`).join(` and `)} %}`,zt=e=>{let t=Fe(e),n=new Map;for(let[r,i]of Object.entries(e.States)){let e=i.Next;e!==void 0&&!t.get(e)?.data.has(r)&&n.set(e,[...n.get(e)??[],r])}let{StartAt:r,...i}=e,a=Object.fromEntries(Object.entries(e.States).map(([e,t])=>{let{Next:r,End:i,...a}=t,o=t.Type===`Succeed`?{...a,Type:`Pass`}:a,s=q(o),c=s?{...o,...o.Type===`Map`?{ItemProcessor:zt(s)}:{Processor:zt(s)}}:o,l=n.get(e);return[e,l?{...c,Condition:Rt(l)}:c]}));return{...i,States:a}},Bt=e=>{let t=Fe(e),n=[],r=new Set(Object.keys(e.States));for(;r.size>0;){let e=[...r].filter(e=>[...Ie(t.get(e))].every(e=>n.includes(e))).sort()[0]??[...r].sort()[0];n.push(e),r.delete(e)}let i=Object.fromEntries(n.map((t,r)=>{let i=e.States[t],a=q(i),o=a?{...i,...i.Type===`Map`?{ItemProcessor:Bt(a)}:{Processor:Bt(a)}}:i;if(!Mt(i))return[t,o];let s=n[r+1];return[t,s===void 0?{...o,End:!0}:{...o,Next:s}]}));return{...e,StartAt:n[0]??``,States:i}},Vt=e=>{let t=Re(e.stateMachine),n=t.find(([,e])=>e.Type===`Choice`);if(n)return{refused:Z(`switchChoice`,{state:n[0]})};let r=t.find(([,e])=>`Catch`in e&&(e.Catch??[]).some(e=>e.Next!==void 0));if(r)return{refused:Z(`switchCatchNext`,{state:r[0]})};let i=Nt(e.stateMachine);if(i!==void 0)return{refused:Z(`switchAssignedTwice`,{variable:i})};let a=Lt(e.stateMachine);if(a!==void 0)return{refused:Z(`switchUnreached`,{state:a})};let o=It(e.stateMachine);if(o!==void 0)return{refused:Z(`switchLoop`,{state:o})};let s=Ft(e.stateMachine,!0);return s===void 0?{definition:{...e,order:`data`,stateMachine:{...zt(e.stateMachine),QueryLanguage:`JSONata`}}}:{refused:Z(`switchPassThroughData`,{state:s})}},Ht=e=>{let t=Re(e.stateMachine),n=t.find(([,e])=>e.Condition!==void 0);if(n)return{refused:Z(`switchCondition`,{state:n[0]})};let r=t.find(([,e])=>`Catch`in e&&(e.Catch??[]).some(e=>e.Next===void 0));if(r)return{refused:Z(`switchCatchNoNext`,{state:r[0]})};let i=Bt(e.stateMachine),a=Ft(e.stateMachine,!1,i.StartAt);return a===void 0?{definition:{...e,order:`sequence`,stateMachine:{...i,QueryLanguage:`JSONata`}}}:{refused:Z(`switchPassThroughSequence`,{state:a})}},Ut=e=>Le(e)===`data`?Ht(e):Vt(e),Wt=new Map,Gt=(e,t)=>{let n=Ut(e),r=Le(e)===`data`?`sequence`:`data`;return`refused`in n?{to:r,refused:n.refused,onRun:()=>{}}:{to:r,onRun:()=>t(n.definition)}},Kt=(e,t)=>{if(t===void 0||t===``)return[];let n=t.split(`/`);return Ve(Y(e,t))?n:n.slice(0,-1)},qt=({view:e,value:t,types:n,onChange:r,layout:i,onLayoutChange:o})=>{let s=f(),l=Ze(e),p=u(),h=(0,Q.useRef)(void 0),g=JSON.stringify(t??null),_=(0,Q.useMemo)(()=>Ue(JSON.parse(g)),[g]),v=(0,Q.useMemo)(()=>l.pastDefinition===void 0?void 0:Ue(l.pastDefinition),[l.pastDefinition]),y=e.version!==void 0&&e.version!==l.latest,b=y?v:_,x=(0,Q.useMemo)(()=>JSON.stringify(Ge(We(s.record))),[s.record]),S=s.dirty&&JSON.stringify(Ge(_))!==x,C=y?l.pastLayout:i,w=y||!r||s.readOnly?void 0:o,T=y||!r?void 0:e=>{let t=h.current;h.current=void 0,t||Ce(void 0),r(t?t(e):e)},ee=ye(n),E=(0,Q.useMemo)(()=>ke(b?de(b,n,ee):[]),[b,n,ee]),D=(0,Q.useMemo)(()=>b?pe(b):Wt,[b]),{address:te}=a(),k=te?.kind===`record`?te.panel:void 0,A=Be(_.stateMachine).length===0,[j,M]=(0,Q.useState)(k===`test_run`?{kind:`test`}:k===`replay`?{kind:`replay`}:A&&p&&r?{kind:`add`}:void 0),[F,ie]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(),[ae,R]=(0,Q.useState)(`data`),[me,he]=(0,Q.useState)(!1),[ge,z]=(0,Q.useState)(),[Se,Ce]=(0,Q.useState)(),we=c(ne(`workflow_runs`),`create`);(0,Q.useEffect)(()=>{L(void 0),R(`data`),he(!1)},[e.run]),(0,Q.useEffect)(()=>{s.refused&&ie(!0)},[s.refused]);let{trace:V}=l,H=e.run===void 0||!V.run||!V.id?void 0:{...V.run,id:V.id,created_at:String(V.run.created_at)},Ae=(0,Q.useMemo)(()=>{if(!V.definition||!V.place)return;let e=Me(V.steps,{inProgress:V.going,...V.place});return b?new Map([...e].map(([e,t])=>[e,{...t,changed:JSON.stringify(Y(V.definition,e))!==JSON.stringify(Y(b,e))}])):e},[V.definition,V.place,V.steps,V.going,b]),U=Ae&&[...Ae].filter(([,e])=>e.status===`failed`).map(([e])=>e).sort((e,t)=>t.split(`/`).length-e.split(`/`).length)[0],W=b&&(I===``||typeof I==`string`&&Y(b,I))?I:I===void 0&&U!==void 0&&b&&Y(b,U)?U:void 0;if((0,Q.useEffect)(()=>z(void 0),[W]),l.pastError)return(0,$.jsx)(O,{title:B(`versionFailed`),error:l.pastError});if(l.versionsError)return(0,$.jsx)(O,{title:B(`versionsFailed`),error:l.versionsError});if(l.runsError)return(0,$.jsx)(O,{title:B(`runsFailed`),error:l.runsError});if(!b)return(0,$.jsx)(re,{className:`h-full w-full`});let G=()=>M(void 0),K=Kt(b,W),Ne=e=>{let t=se(b,e);if(e.kind===`start`)return t===void 0?B(`addsFirst`):B(`addsBetween`,{step:Z(`trigger`),next:t});let n=X(e.source).name;return t===void 0?e.kind===`rule`?B(`addsRule`,{step:n}):e.kind==="default"?B(`addsOtherwise`,{step:n}):e.kind===`catch`?B(`addsOnError`,{step:n}):B(`addsAfter`,{step:n}):B(`addsBetween`,{step:n,next:t})},Pe=()=>{if(W===``||Be(b.stateMachine).length===0)return B(`addsFirst`);if(K.length>0&&W===K.join(`/`))return B(`addsInside`,{map:X(W).name});let e=le(b,K,W);return e===void 0?B(`addsUnconnected`):B(`addsAfter`,{step:e})},q=(e,t)=>{if(!T)return;let n=ce(b,Z(`newStep`)),r=Z(`newStep`),i=t?De(b,e,n,r,t):W===``?ue(b,e,n,r):oe(b,K,e,n,r,le(b,K,W));T(i),L(ze(t?be(t):K,n)),R(`settings`),G()},J=Be(b.stateMachine).length===0,Fe=[...E.whole,...[...E.byNode.values()].flat()],Ie=J?0:Fe.filter(Ee).length,Le=J?0:Fe.length-Ie,Re=F?E.byNode:Oe(E.byNode),Ve=()=>{if(Ie===0)return!1;ie(!0);let e=[...E.byNode].find(([,e])=>e.some(Ee))?.[0];return e!==void 0&&L(e),R(`settings`),M(void 0),!0},He=V.definition?Be(V.definition.stateMachine).filter(e=>!Be(b.stateMachine).includes(e)).length:0,Ke=H&&m(Date.parse(H.created_at)),qe=(e,t)=>t===`output`||e===void 0||e===V.definition?.stateMachine.StartAt,Je=e=>(t,n)=>(0,$.jsx)(ft,{value:t,...we&&qe(e,n)&&{onUse:()=>M({kind:`test`,seed:{value:t,from:B(n===`output`?`seedOutput`:`seedInput`,{step:e??Z(`trigger`),when:Ke??``})}})}}),Ye=H!==void 0&&!V.going,Xe=(e,t)=>{if(!Ye)return B(`runNotEnded`);if(e===void 0)return;if(V.place&&V.place.within.length>0)return B(`rerunInBlock`);let n=X(t).scope[0];return n===void 0?Y(_,t)?void 0:B(`stepNotInVersion`,{version:l.latest??0}):Y(_,n)?.Type===`Block`?B(`rerunInBlockStep`,{block:n}):B(`rerunInMap`,{map:n})},Qe=e=>{let t=X(e).scope,n=V.place?.within.length??0,r=V.definition??b,i=t.findIndex((e,i)=>i>=n&&Y(r,t.slice(0,i+1).join(`/`))?.Type===`Block`);return i===-1?void 0:t[i]},$e=(e,t)=>{if(!H||!we||e===void 0)return;let n=Xe(e,t);return(0,$.jsx)(P,{variant:`primary`,className:`w-full max-md:min-h-11`,"aria-disabled":n!==void 0,title:n,onClick:()=>n===void 0&&M({kind:`rerun`,step:e}),children:s.dirty?B(`saveAndRerun`):B(`rerunFromStep`)})},tt=()=>{if(W===void 0)return null;let e=W===``?void 0:X(W).name,t=(0,$.jsx)(xe,{definition:b,types:n,selected:W,problems:Re.get(W)??[],warnings:D.get(W)??[],...T&&!s.readOnly&&{onChange:T},onSelect:e=>L(e??null)}),r=H??l.runs.find(e=>e.status===`succeeded`||e.status===`failed`),i=ge?(0,$.jsx)(rt,{definition:b,path:W,target:ge,run:r,onAssign:(e,t,n)=>{Ce({message:`${B(`addedVariable`,{variable:t,step:X(e).name})} ${B(`inThisRun`,{value:n})}`,undo:b}),h.current=t=>Te(t,e).definition},onBack:()=>z(void 0),onTestRun:()=>{z(void 0),M({kind:`test`})}}):(0,$.jsxs)($.Fragment,{children:[Se&&(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md bg-muted px-3 py-2 text-xs`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:Se.message}),(0,$.jsx)(P,{size:`sm`,onClick:()=>{T?.(Se.undo),Ce(void 0)},children:B(`undo`)})]}),t]});return(0,$.jsx)(Ct,{title:e??Z(`trigger`),tab:H?ae:`settings`,onTab:R,run:H,state:e,block:Qe(W),valueActions:Je(e),footer:$e(e,W),onClose:()=>L(null),settings:i})};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(jt,{view:e,page:l,editable:!!T&&!s.readOnly,newVersion:S,empty:J,problems:Le,missing:Ie,onAddStep:()=>M({kind:`add`}),onProblems:()=>{Ve()||M({kind:`problems`})},onRuns:()=>M({kind:`runs`}),onTestRun:()=>{Ve()||M({kind:`test`})},onPublish:()=>{Ve()||M({kind:`publish`})},onTurnOff:()=>M({kind:`off`}),...T&&!s.readOnly&&{orderSwitch:Gt(b,T)},runActions:H&&[...W!==void 0||me?[{name:B(`runDetails`),icon:d,onRun:()=>{L(null),he(!1)}}]:[]]}),(0,$.jsx)(yt,{view:e,page:l,failed:U&&X(U).name,changed:s.dirty,gone:He,...U!==void 0&&U!==W&&{onOpenFailed:()=>L(U)}}),(0,$.jsx)(`div`,{className:`h-full`,children:(0,$.jsx)(je,{fills:!0,definition:b,problems:H||J?Wt:Re,warnings:H||J?Wt:D,selected:W,onSelect:e=>L(e??null),...T&&!s.readOnly&&{onChange:T,edits:fe,onAddAt:e=>M({kind:`add`,at:e})},...Ae&&H&&{traces:Ae},types:n,schemas:ee,layout:C,onLayoutChange:w})}),J&&j===void 0&&(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-[60%] flex justify-center`,children:(0,$.jsx)(`div`,{className:`pointer-events-auto grid justify-items-center gap-2 rounded-lg border bg-background p-6 text-center shadow-sm`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`font-semibold`,children:B(`noSteps`)}),(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noStepsLine`)}),T&&!s.readOnly&&(0,$.jsx)(P,{variant:`primary`,onClick:()=>M({kind:`add`}),children:B(`addStep`)})]}):(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noStepsMobile`)})})}),j?.kind===`add`&&(0,$.jsx)(et,{types:n,placement:j.at?Ne(j.at):Pe(),onAdd:e=>q(e,j.at),onClose:G}),j?.kind===`test`&&(0,$.jsx)(Dt,{view:e,page:l,definition:b,types:n,seed:j.seed,onClose:G}),j?.kind===`runs`&&(0,$.jsx)(St,{view:e,page:l,onTestRun:()=>M({kind:`test`}),onClose:G}),j?.kind===`publish`&&(0,$.jsx)(_t,{view:e,page:l,definition:b,types:n,newVersion:S,onClose:G}),j?.kind===`off`&&(0,$.jsx)(vt,{view:e,onClose:G}),j?.kind===`problems`&&(0,$.jsx)(N,{title:B(`problemsTitle`),onClose:G,takesFocus:!0,children:(0,$.jsx)(_e,{problems:[...E.whole,...[...E.byNode.values()].flat()]})}),j?.kind===`rerun`&&(0,$.jsx)(st,{view:e,page:l,definition:_,types:n,step:j.step,onStep:e=>M({kind:`rerun`,step:e}),onClose:G}),j?.kind===`replay`&&(0,$.jsx)(ct,{view:e,page:l,onClose:G}),j===void 0&&(0,$.jsx)(ve.Provider,{value:T&&!s.readOnly?z:void 0,children:W===void 0&&H&&!me?(0,$.jsx)(dt,{trace:V,valueActions:Je(void 0),onReplay:Ye&&we?()=>M({kind:`replay`}):void 0,onClose:()=>he(!0)}):tt()})]})};export{qt as WorkflowWorkbench};
|
|
4
|
-
//# debugId=d8d1ccd9-6868-4541-9874-65d5f5a5067d
|