@protobase/ui 0.119.3 → 0.119.4
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/activity-chart/messages.d.ts +2 -2
- package/dist/app/charts/messages.d.ts +2 -2
- package/dist/app/confirm-sign-in-messages.d.ts +2 -2
- package/dist/app/conversation/thread-state.d.ts +1 -1
- package/dist/app/create/messages.d.ts +2 -2
- package/dist/app/delete/messages.d.ts +2 -2
- package/dist/app/displays/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/workflow/definition.d.ts +1 -1
- package/dist/app/field-types/workflow/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
- package/dist/app/focus/messages.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/import/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/meta-gate-messages.d.ts +2 -2
- 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/runtime/messages.d.ts +2 -2
- package/dist/app/saved/messages.d.ts +2 -2
- package/dist/app/searches/messages.d.ts +2 -2
- package/dist/app-shell/messages.d.ts +2 -2
- package/dist/assistant-dock/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/markdown/markdown-html.js +2 -29
- package/dist/markdown/safe-html.d.ts +11 -0
- package/dist/markdown/safe-html.js +35 -0
- package/dist/mentions/link-text.d.ts +7 -0
- package/dist/mentions/link-text.js +19 -0
- package/dist/mentions/mention-text.d.ts +2 -0
- package/dist/mentions/mention-text.js +3 -1
- package/dist/mentions/mentioned-text.d.ts +7 -7
- package/dist/mentions/mentioned-text.js +14 -4
- package/dist/mentions/message-content.d.ts +10 -0
- package/dist/mentions/message-content.js +17 -0
- package/dist/mentions/message-html.d.ts +11 -0
- package/dist/mentions/message-html.js +55 -0
- package/dist/mentions/message-lines.d.ts +4 -0
- package/dist/mentions/message-lines.js +37 -0
- 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/messages.d.ts +2 -2
- package/dist/primitives/messages.d.ts +2 -2
- package/dist/shell/assets/{account-page-d4bA-Rnh.js → account-page-VNXi8xPA.js} +2 -2
- package/dist/shell/assets/{app-B94YfKGx.js → app-C8DagobC.js} +7 -7
- package/dist/shell/assets/{app-xwgcmboV.css → app-DLkpxjgP.css} +1 -1
- package/dist/shell/assets/{assistant-shell-DTNOfaAZ.js → assistant-shell-D5n0XNfa.js} +2 -2
- package/dist/shell/assets/board-display-CQgqWhwM.js +2 -0
- package/dist/shell/assets/calendar-display-y2jKjZ3t.js +2 -0
- package/dist/shell/assets/{call-rings-D8cGALi4.js → call-rings-CEQMuagL.js} +2 -2
- package/dist/shell/assets/{calls-DLSo4hNS.js → calls-Bjc3rL9w.js} +2 -2
- package/dist/shell/assets/{circle-alert-C8YjGdRx.js → circle-alert-BF0JSDU0.js} +2 -2
- package/dist/shell/assets/composed-page-Cubk1Kxi.js +2 -0
- package/dist/shell/assets/{composer-section-6TvE0L2w.js → composer-section-CL8-3eMa.js} +2 -2
- package/dist/shell/assets/{connect-route-C8Km-e8S.js → connect-route-DuZcKU2Q.js} +2 -2
- package/dist/shell/assets/{copy-field-DXp0fGDR.js → copy-field-VB6bqHXP.js} +2 -2
- package/dist/shell/assets/create-route-6pdThgfU.js +2 -0
- package/dist/shell/assets/{custom-step-container-field-B8ut5WnP.js → custom-step-container-field-dJXo45Ua.js} +4 -4
- package/dist/shell/assets/embedded-list-ZGVUzTqi.js +3 -0
- package/dist/shell/assets/{export-dialog-gSUSlzOy.js → export-dialog-C7Cni_3-.js} +2 -2
- package/dist/shell/assets/{first-organization-page-C7YZ32Kt.js → first-organization-page-ClNXbA0s.js} +2 -2
- package/dist/shell/assets/{graph-view-_7poAZsr.js → graph-view-B2cTru_6.js} +2 -2
- package/dist/shell/assets/{group-donut-XjNEBVUq.js → group-donut-2NlpCtbk.js} +2 -2
- package/dist/shell/assets/{guest-call-page-Cj6F3D3u.js → guest-call-page-CdbZZnV0.js} +3 -3
- package/dist/shell/assets/{html-viewer-CmYTAzWa.js → html-viewer-Cz0M2lKY.js} +2 -2
- package/dist/shell/assets/{import-dialog-bNG6qX6Q.js → import-dialog-BMRDGiwG.js} +2 -2
- package/dist/shell/assets/import-table-dialog-B4he_TFm.js +2 -0
- package/dist/shell/assets/{index-CYraq2Hi.js → index-CeFBvCC7.js} +1 -1
- package/dist/shell/assets/{invitations-page-XV6kL2Mk.js → invitations-page-CZhwWV6M.js} +2 -2
- package/dist/shell/assets/{layout-grid-dpoR6hFU.js → layout-grid-C-WFa9Or.js} +2 -2
- package/dist/shell/assets/{legend-item-WwKh2W6n.js → legend-item-BTHYT8br.js} +2 -2
- package/dist/shell/assets/list-page-DQUxt0LO.js +4 -0
- package/dist/shell/assets/{maplibre-Bm0OQH9k.js → maplibre-BvSTqxne.js} +2 -2
- package/dist/shell/assets/{markdown-content-BZLiLira.js → markdown-content-BBjT7Pxr.js} +2 -2
- package/dist/shell/assets/members-page-MX1KjLNR.js +2 -0
- package/dist/shell/assets/message-content-FBGpTZQI.js +4 -0
- package/dist/shell/assets/messages-CExXpz12.js +2 -0
- package/dist/shell/assets/organization-page-D1hcJCrd.js +2 -0
- package/dist/shell/assets/organizations-page-B0jLZ_UO.js +2 -0
- package/dist/shell/assets/{pending-invitation-row-BZVOux9W.js → pending-invitation-row-CsJF7-Gu.js} +2 -2
- package/dist/shell/assets/{period-chart-GDqLnl9l.js → period-chart-D1WwYBS1.js} +2 -2
- package/dist/shell/assets/{person-row-DgXLW9D8.js → person-row-BV7Z1hNf.js} +2 -2
- package/dist/shell/assets/public-form-page-CIAmgild.js +2 -0
- package/dist/shell/assets/{record-lines-CDTPiIdF.js → record-lines-Dxi3FXH8.js} +2 -2
- package/dist/shell/assets/{record-map-Dcmuv9J8.js → record-map-rpuvoibV.js} +2 -2
- package/dist/shell/assets/{record-opens-D7SV04zf.js → record-opens-CMd-dGRX.js} +2 -2
- package/dist/shell/assets/record-page-CThUCc__.js +3 -0
- package/dist/shell/assets/{record-preview-DsIrTWKZ.js → record-preview-DyOOyKCI.js} +2 -2
- package/dist/shell/assets/{records-map-G0QXqaUR.js → records-map-DKcj8eKK.js} +2 -2
- package/dist/shell/assets/render-node-CAsq_tXP.js +3 -0
- package/dist/shell/assets/reorder-button-CDxSwa9c.js +2 -0
- package/dist/shell/assets/{run-trace-view-DLY3Mt5m.js → run-trace-view-IcuY4WBI.js} +2 -2
- package/dist/shell/assets/{runner-install-field-Iwp4UP6o.js → runner-install-field-CpYdr4D1.js} +2 -2
- package/dist/shell/assets/{runtime-update-DKcAQek2.js → runtime-update-Di07z3fd.js} +2 -2
- package/dist/shell/assets/safe-html-CmkqDcA6.js +2 -0
- package/dist/shell/assets/shared-protobase-ui-52YGsYuh.js +1 -0
- package/dist/shell/assets/sheet-source-BxJ1WzuT.js +3 -0
- package/dist/shell/assets/sign-in-policy-page-CGqj3xpG.js +2 -0
- package/dist/shell/assets/start-block-queries-DycG996P.js +2 -0
- package/dist/shell/assets/step-catalog-kxOqLVIH.js +2 -0
- package/dist/shell/assets/{step-panel-BXHWAw8x.js → step-panel-P0bT6b4o.js} +2 -2
- package/dist/shell/assets/timeline-display-Crfj_0QO.js +2 -0
- package/dist/shell/assets/{trash-MHAT5Hf3.js → trash-BBz7IXo9.js} +2 -2
- package/dist/shell/assets/{update-set-B0D_tNDz.js → update-set-BuU033OJ.js} +2 -2
- package/dist/shell/assets/use-calendar-move-BTlYPun1.js +2 -0
- package/dist/shell/assets/{use-display-rows-vjthlkqo.js → use-display-rows-DM1gg_CJ.js} +2 -2
- package/dist/shell/assets/use-my-invitations-BRnhkt1K.js +2 -0
- package/dist/shell/assets/{use-paged-search-DRj8498k.js → use-paged-search-BUaMlWgI.js} +2 -2
- package/dist/shell/assets/{use-run-trace-CWGAibgF.js → use-run-trace-DYU4WZ6w.js} +2 -2
- package/dist/shell/assets/{use-workflow-page-C9ZEXX5R.js → use-workflow-page-BUd3Xe6x.js} +2 -2
- package/dist/shell/assets/{use-workflow-types-DDh28X2_.js → use-workflow-types-BfCyY_Vr.js} +2 -2
- package/dist/shell/assets/{workflow-canvas-n_YJtaOh.js → workflow-canvas-DgWBX54L.js} +4 -4
- package/dist/shell/assets/{workflow-field-CpkY17Cc.js → workflow-field-BjXm60Uu.js} +3 -3
- package/dist/shell/assets/{workflow-graph-editor-V-ZGHSrC.js → workflow-graph-editor-BehmE3Dg.js} +2 -2
- package/dist/shell/assets/{workflow-run-field-CoUJGVdX.js → workflow-run-field-BujjrQM4.js} +3 -3
- package/dist/shell/assets/workflow-status-field-Cb6cPhdf.js +2 -0
- package/dist/shell/assets/workflow-workbench-Dokupdxe.js +4 -0
- package/dist/shell/index.html +4 -4
- package/dist/shell/protobase.shell.json +2 -2
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/{account-page-d4bA-Rnh.js.map → account-page-VNXi8xPA.js.map} +1 -1
- package/dist/shell-source-maps/assets/app-C8DagobC.js.map +1 -0
- package/dist/shell-source-maps/assets/{assistant-shell-DTNOfaAZ.js.map → assistant-shell-D5n0XNfa.js.map} +1 -1
- package/dist/shell-source-maps/assets/{board-display-ClTe26F0.js.map → board-display-CQgqWhwM.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calendar-display-CwBcu_JO.js.map → calendar-display-y2jKjZ3t.js.map} +1 -1
- package/dist/shell-source-maps/assets/{call-rings-D8cGALi4.js.map → call-rings-CEQMuagL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calls-DLSo4hNS.js.map → calls-Bjc3rL9w.js.map} +1 -1
- package/dist/shell-source-maps/assets/{circle-alert-C8YjGdRx.js.map → circle-alert-BF0JSDU0.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composed-page-DBHl-wl_.js.map → composed-page-Cubk1Kxi.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composer-section-6TvE0L2w.js.map → composer-section-CL8-3eMa.js.map} +1 -1
- package/dist/shell-source-maps/assets/{connect-route-C8Km-e8S.js.map → connect-route-DuZcKU2Q.js.map} +1 -1
- package/dist/shell-source-maps/assets/{copy-field-DXp0fGDR.js.map → copy-field-VB6bqHXP.js.map} +1 -1
- package/dist/shell-source-maps/assets/{create-route-s8RsjtyM.js.map → create-route-6pdThgfU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{custom-step-container-field-B8ut5WnP.js.map → custom-step-container-field-dJXo45Ua.js.map} +1 -1
- package/dist/shell-source-maps/assets/{embedded-list-OJQKeuBN.js.map → embedded-list-ZGVUzTqi.js.map} +1 -1
- package/dist/shell-source-maps/assets/{export-dialog-gSUSlzOy.js.map → export-dialog-C7Cni_3-.js.map} +1 -1
- package/dist/shell-source-maps/assets/{first-organization-page-C7YZ32Kt.js.map → first-organization-page-ClNXbA0s.js.map} +1 -1
- package/dist/shell-source-maps/assets/{graph-view-_7poAZsr.js.map → graph-view-B2cTru_6.js.map} +1 -1
- package/dist/shell-source-maps/assets/{group-donut-XjNEBVUq.js.map → group-donut-2NlpCtbk.js.map} +1 -1
- package/dist/shell-source-maps/assets/{guest-call-page-Cj6F3D3u.js.map → guest-call-page-CdbZZnV0.js.map} +1 -1
- package/dist/shell-source-maps/assets/{html-viewer-CmYTAzWa.js.map → html-viewer-Cz0M2lKY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-dialog-bNG6qX6Q.js.map → import-dialog-BMRDGiwG.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-table-dialog-BbI7GJ8R.js.map → import-table-dialog-B4he_TFm.js.map} +1 -1
- package/dist/shell-source-maps/assets/{invitations-page-XV6kL2Mk.js.map → invitations-page-CZhwWV6M.js.map} +1 -1
- package/dist/shell-source-maps/assets/{layout-grid-dpoR6hFU.js.map → layout-grid-C-WFa9Or.js.map} +1 -1
- package/dist/shell-source-maps/assets/{legend-item-WwKh2W6n.js.map → legend-item-BTHYT8br.js.map} +1 -1
- package/dist/shell-source-maps/assets/{list-page-DImD2FRO.js.map → list-page-DQUxt0LO.js.map} +1 -1
- package/dist/shell-source-maps/assets/{maplibre-Bm0OQH9k.js.map → maplibre-BvSTqxne.js.map} +1 -1
- package/dist/shell-source-maps/assets/markdown-content-BBjT7Pxr.js.map +1 -0
- package/dist/shell-source-maps/assets/{members-page-ZcqzlQu6.js.map → members-page-MX1KjLNR.js.map} +1 -1
- package/dist/shell-source-maps/assets/message-content-FBGpTZQI.js.map +1 -0
- package/dist/shell-source-maps/assets/{messages-vzi5T1Xo.js.map → messages-CExXpz12.js.map} +1 -1
- package/dist/shell-source-maps/assets/{organization-page-CjrQmpot.js.map → organization-page-D1hcJCrd.js.map} +1 -1
- package/dist/shell-source-maps/assets/{organizations-page-C7gJsoCx.js.map → organizations-page-B0jLZ_UO.js.map} +1 -1
- package/dist/shell-source-maps/assets/{pending-invitation-row-BZVOux9W.js.map → pending-invitation-row-CsJF7-Gu.js.map} +1 -1
- package/dist/shell-source-maps/assets/{period-chart-GDqLnl9l.js.map → period-chart-D1WwYBS1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{person-row-DgXLW9D8.js.map → person-row-BV7Z1hNf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{public-form-page-DjLnqHPx.js.map → public-form-page-CIAmgild.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-lines-CDTPiIdF.js.map → record-lines-Dxi3FXH8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-map-Dcmuv9J8.js.map → record-map-rpuvoibV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-opens-D7SV04zf.js.map → record-opens-CMd-dGRX.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-page-DGWHTUdD.js.map → record-page-CThUCc__.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-preview-DsIrTWKZ.js.map → record-preview-DyOOyKCI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-G0QXqaUR.js.map → records-map-DKcj8eKK.js.map} +1 -1
- package/dist/shell-source-maps/assets/{render-node-0_Pb8ixy.js.map → render-node-CAsq_tXP.js.map} +1 -1
- package/dist/shell-source-maps/assets/{reorder-button-BhhzhhTO.js.map → reorder-button-CDxSwa9c.js.map} +1 -1
- package/dist/shell-source-maps/assets/{run-trace-view-DLY3Mt5m.js.map → run-trace-view-IcuY4WBI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runner-install-field-Iwp4UP6o.js.map → runner-install-field-CpYdr4D1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runtime-update-DKcAQek2.js.map → runtime-update-Di07z3fd.js.map} +1 -1
- package/dist/shell-source-maps/assets/safe-html-CmkqDcA6.js.map +1 -0
- package/dist/shell-source-maps/assets/{sheet-source-DxVQhlKF.js.map → sheet-source-BxJ1WzuT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sign-in-policy-page-E1eBhmUM.js.map → sign-in-policy-page-CGqj3xpG.js.map} +1 -1
- package/dist/shell-source-maps/assets/{start-block-queries-Bu7xMabd.js.map → start-block-queries-DycG996P.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-catalog-BPk6WuYH.js.map → step-catalog-kxOqLVIH.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-panel-BXHWAw8x.js.map → step-panel-P0bT6b4o.js.map} +1 -1
- package/dist/shell-source-maps/assets/{timeline-display-CJHQiDm9.js.map → timeline-display-Crfj_0QO.js.map} +1 -1
- package/dist/shell-source-maps/assets/{trash-MHAT5Hf3.js.map → trash-BBz7IXo9.js.map} +1 -1
- package/dist/shell-source-maps/assets/{update-set-B0D_tNDz.js.map → update-set-BuU033OJ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-calendar-move-O_48Gqvs.js.map → use-calendar-move-BTlYPun1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-display-rows-vjthlkqo.js.map → use-display-rows-DM1gg_CJ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-my-invitations-DDPuugTE.js.map → use-my-invitations-BRnhkt1K.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-paged-search-DRj8498k.js.map → use-paged-search-BUaMlWgI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-run-trace-CWGAibgF.js.map → use-run-trace-DYU4WZ6w.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-page-C9ZEXX5R.js.map → use-workflow-page-BUd3Xe6x.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-types-DDh28X2_.js.map → use-workflow-types-BfCyY_Vr.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-canvas-n_YJtaOh.js.map → workflow-canvas-DgWBX54L.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-field-CpkY17Cc.js.map → workflow-field-BjXm60Uu.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-graph-editor-V-ZGHSrC.js.map → workflow-graph-editor-BehmE3Dg.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-run-field-CoUJGVdX.js.map → workflow-run-field-BujjrQM4.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-status-field-nmrhtSls.js.map → workflow-status-field-Cb6cPhdf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-workbench-DvzNEdn3.js.map → workflow-workbench-Dokupdxe.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/board-display-ClTe26F0.js +0 -2
- package/dist/shell/assets/calendar-display-CwBcu_JO.js +0 -2
- package/dist/shell/assets/composed-page-DBHl-wl_.js +0 -2
- package/dist/shell/assets/create-route-s8RsjtyM.js +0 -2
- package/dist/shell/assets/embedded-list-OJQKeuBN.js +0 -3
- package/dist/shell/assets/import-table-dialog-BbI7GJ8R.js +0 -2
- package/dist/shell/assets/list-page-DImD2FRO.js +0 -4
- package/dist/shell/assets/members-page-ZcqzlQu6.js +0 -2
- package/dist/shell/assets/messages-vzi5T1Xo.js +0 -2
- package/dist/shell/assets/organization-page-CjrQmpot.js +0 -2
- package/dist/shell/assets/organizations-page-C7gJsoCx.js +0 -2
- package/dist/shell/assets/public-form-page-DjLnqHPx.js +0 -2
- package/dist/shell/assets/record-page-DGWHTUdD.js +0 -3
- package/dist/shell/assets/render-node-0_Pb8ixy.js +0 -3
- package/dist/shell/assets/reorder-button-BhhzhhTO.js +0 -2
- package/dist/shell/assets/shared-protobase-ui-XTZSVgEm.js +0 -1
- package/dist/shell/assets/sheet-source-DxVQhlKF.js +0 -3
- package/dist/shell/assets/sign-in-policy-page-E1eBhmUM.js +0 -2
- package/dist/shell/assets/start-block-queries-Bu7xMabd.js +0 -2
- package/dist/shell/assets/step-catalog-BPk6WuYH.js +0 -2
- package/dist/shell/assets/timeline-display-CJHQiDm9.js +0 -2
- package/dist/shell/assets/use-calendar-move-O_48Gqvs.js +0 -2
- package/dist/shell/assets/use-my-invitations-DDPuugTE.js +0 -2
- package/dist/shell/assets/workflow-status-field-nmrhtSls.js +0 -2
- package/dist/shell/assets/workflow-workbench-DvzNEdn3.js +0 -4
- package/dist/shell-source-maps/assets/app-B94YfKGx.js.map +0 -1
- package/dist/shell-source-maps/assets/markdown-content-BZLiLira.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Js as r,Ks as i,Qc as a,Ua as o,Uc as s,Yi as c,Ys as l,Zi as u,dc as d,lc as f,sc as p,ua as m}from"./app-C8DagobC.js";var h={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};h.node;var g=s(h),_=e=>typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null&&`code`in e.error&&`message`in e.error,v=async e=>{let t=e.headers.get(`content-type`)?.includes(`json`)??!1?await e.clone().json():void 0;return _(t)?new i({type:`urn:protobase:problem:${t.error.code}`,title:e.statusText||`Request failed`,status:e.status,detail:t.error.message}):l(e)},y=e=>{let t=e.url.replace(/\/+$/,``),n=e.fetch??((e,t)=>fetch(e,t)),r=async(r,i)=>{let a=await e.token(),o=await n(`${t}${r}`,{method:i,headers:{accept:`application/json`,...a&&{authorization:`Bearer ${a}`}}});if(!o.ok)throw await v(o);return await o.json()};return{status:()=>r(``,`GET`),update:()=>r(`/update`,`POST`)}},b=e(t(),1),x=a(`app/runtime`),S=e=>!!(e?.updateAvailable&&e.indicator),C=e=>e?5e3:18e5,w=(e,t)=>{if(!e.updateStage)return x(`updatingNow`);let n=x(e.updateStage);if(!e.updateStartedAt)return n;let r=Math.max(0,Math.floor((t-Date.parse(e.updateStartedAt))/1e3));return x(`started`,{stage:n,ago:c(r)})},T=(e,t=Date.now(),n=m())=>e.updating?w(e,t):e.nextUpdateAt?x(`nextOn`,{policy:x(e.policy),when:u(Date.parse(e.nextUpdateAt),n)}):x(e.policy),E=(e,t=m())=>{let n=u(Date.parse(e.finishedAt),t),r=x(e.outcome,{version:e.toVersion,when:n});return e.message?`${r}: ${e.message}`:`${r}.`},D=e=>r(e)&&e.status<500&&e.problem.detail?e.problem.detail:r(e)&&e.status===409?x(`alreadyLatest`):r(e)&&e.status===403?x(`onlyAdmin`):x(`couldNotStart`),O=e(n(),1),k=({label:e,value:t})=>(0,O.jsxs)(`div`,{className:`flex justify-between gap-4 py-1`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,O.jsx)(`span`,{className:`font-medium tabular-nums`,children:t})]}),A=({status:e,requesting:t,error:n,checkError:r,onUpdate:i,onClose:a})=>{let o=e.updating?void 0:e.lastUpdate;return(0,O.jsxs)(p,{title:x(`runtimeUpdate`),description:e.updating?(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,O.jsx)(d,{className:`size-3.5`}),T(e)]}):T(e),onClose:a,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f,{onClick:a,children:x(`close`)}),(0,O.jsx)(f,{variant:`primary`,loading:t,disabled:e.updating||!e.updateAvailable,onClick:i,children:e.updating?x(`updating`):x(`updateNow`)})]}),children:[(0,O.jsx)(k,{label:x(`currentVersion`),value:e.version}),(0,O.jsx)(k,{label:x(`latestVersion`),value:e.latest}),o&&(0,O.jsx)(`p`,{className:o.outcome===`failed`?`mt-3 text-danger-text`:`mt-3 text-muted-foreground`,children:E(o)}),n!==void 0&&(0,O.jsx)(`p`,{role:`alert`,className:`mt-3 text-danger-text`,children:D(n)}),r!==void 0&&(0,O.jsx)(`p`,{className:`mt-3 text-muted-foreground`,children:x(`checkFailed`)})]})},j=e=>{let t=o(),n=(0,b.useRef)(t);n.current=t;let r=t!==void 0;return(0,b.useMemo)(()=>r?y({url:e,token:()=>n.current}):void 0,[e,r])},M=e=>{let[t,n]=(0,b.useState)(),[r,i]=(0,b.useState)(!1),[a,o]=(0,b.useState)(),[s,c]=(0,b.useState)(),l=t?.updating??!1;return(0,b.useEffect)(()=>{if(!e)return;let t=!0,r=()=>e.status().then(e=>{t&&(n(e),c(void 0))},e=>t&&c(e));r();let i=setInterval(()=>void r(),C(l));return()=>{t=!1,clearInterval(i)}},[e,l]),{status:t,update:(0,b.useCallback)(async()=>{e&&(i(!0),o(void 0),await e.update().then(n,o),i(!1))},[e]),requesting:r,error:a,checkError:s}},N=({client:e})=>{let{status:t,update:n,requesting:r,error:i,checkError:a}=M(e),[o,s]=(0,b.useState)(!1);return!t||!o&&!S(t)?null:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(f,{size:`sm`,variant:`ghost`,"aria-label":x(`updateAvailable`),title:x(`updateAvailable`),onClick:()=>s(!0),className:`max-md:size-9 max-md:p-0`,children:[(0,O.jsx)(g,{className:`size-3.5 text-primary`}),(0,O.jsx)(`span`,{className:`max-md:sr-only`,children:x(`update`)})]}),o&&(0,O.jsx)(A,{status:t,requesting:r,error:i,checkError:a,onUpdate:()=>void n(),onClose:()=>s(!1)})]})},P=({url:e})=>(0,O.jsx)(N,{client:j(e)}),F=({url:e,client:t})=>t?(0,O.jsx)(N,{client:t}):(0,O.jsx)(P,{url:e});export{F as RuntimeUpdateButton};
|
|
2
|
+
//# debugId=e2d3bcf7-7dd9-45b3-9566-2647b1774005
|
|
@@ -0,0 +1,2 @@
|
|
|
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{}})();var e={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},t=t=>t.replace(/[&<>"']/g,t=>e[t]),n=/^([a-z][a-z0-9+.-]*):/i,r=new Set([`http`,`https`,`mailto`,`tel`]),i=new Set([`http`,`https`]),a=/[\u0000- \u007f]/g,o=(e,t)=>{let r=n.exec(e.replace(a,``))?.[1]?.toLowerCase();if(r!==void 0&&!t.has(r))return null;try{return encodeURI(e).replace(/%25/g,`%`)}catch(e){if(e instanceof URIError)return null;throw e}},s=e=>e?` title="${t(e)}"`:``,c=(e,n,r)=>`<a href="${t(e)}"${s(n)} target="_blank" rel="noopener noreferrer nofollow">${r}</a>`;export{o as a,c as i,i as n,s as o,r,t};
|
|
2
|
+
//# debugId=a692a0dc-03a6-415b-b0fb-d7f146830e2e
|
|
@@ -0,0 +1 @@
|
|
|
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{$ as e,$c as t,$t as n,At as r,B as ee,Ba as te,Bn as i,Bo as a,Br as o,Bt as s,Cr as c,Ct as l,Dr as u,Dt as d,Er as f,Et as p,Fa as m,Ft as h,G as g,Gc as _,Gi as v,H as y,Ha as b,Hi as x,Ht as S,Ir as C,It as w,Jc as T,Ji as E,K as D,Kc as O,Ki as k,Lr as A,Lt as j,Ma as M,Mo as N,Mr as P,Mt as F,N as I,No as L,Nr as R,Nt as z,P as B,Po as V,Pt as H,Q as U,R as W,Rr as G,So as K,Sr as q,St as J,Tn as Y,Tt as X,U as Z,Ua as Q,Ui as ne,Ut as re,V as ie,Vi as ae,Vt as oe,W as se,Wi as ce,Wt as le,X as ue,Xc as $,Xt as de,Yc as fe,Yt as pe,Zt as me,_o as he,_r as ge,_t as _e,bo as ve,bt as ye,co as be,cr as xe,dc as Se,ds as Ce,dt as we,en as Te,et as Ee,fs as De,ft as Oe,gt as ke,ho as Ae,ht as je,ic as Me,it as Ne,ja as Pe,jo as Fe,jr as Ie,ko as Le,lc as Re,lo as ze,ls as Be,mo as Ve,mt as He,n as Ue,nt as We,ot as Ge,pa as Ke,pt as qe,qc as Je,qi as Ye,qt as Xe,r as Ze,rt as Qe,sc as $e,t as et,tt,uc as nt,uo as rt,us as it,ut as at,vo as ot,vr as st,vt as ct,wr as lt,wt as ut,xr as dt,xt as ft,yr as pt,yt as mt,z as ht,zr as gt}from"./app-C8DagobC.js";import{h as _t,o as vt}from"./vendor-t7Q7QbPu.js";export{J as ActionCard,lt as ActionInputError,it as ApiProvider,A as App,gt as AppLink,L as AppMark,Oe as AssistantDock,rt as AuthLayout,he as AvailabilityMark,Re as Button,s as CallMark,le as CallView,D as Carousel,H as ChatDivider,z as ChatMessage,F as ChatThread,ht as Choices,be as CodeForm,ye as CompactTable,ut as Composer,$e as Dialog,_e as DiffView,W as Field,me as FieldBadge,ft as FieldList,st as FileReadError,e as FocusActions,Ee as FocusNotice,Ne as FocusPage,tt as FocusPanel,We as FocusSlot,I as Form,q as HtmlFrame,Ue as InPlaceForm,Le as Input,V as LogoMark,Y as Markdown,p as MentionBox,X as MentionedText,ee as MenuSelect,ve as MenuSurface,Ve as OtpInput,He as PartView,S as RecordCall,Xe as RecordLink,et as RecordPicker,ze as ResendCodeButton,v as ResponsiveDialog,Me as RouteLink,ue as SearchPicker,B as Section,K as Segmented,ie as Select,l as SidePanel,j as SignInPrompt,Se as Spinner,ot as StatusMark,je as StepList,i as Textarea,de as ToneEdge,y as allowDelayMs,nt as buttonClass,h as chatDayLabel,a as closeSidebarEvent,Pe as definePlugin,M as defineUi,ct as diffStats,d as emptyDraft,c as fileNamed,f as isConflict,Z as isFramed,N as logoTapEvent,r as mentionedIds,Je as mergeUi,mt as parseDiff,ke as parsePatch,fe as pluginApi,_ as pluginsChangedEvent,$ as protobaseVersion,w as sameChatDay,t as showTextsIn,dt as siblingPage,Ae as signedOutEvent,x as statusRefreshMs,T as uiFromModule,G as uiReadyEvent,Q as useApiToken,o as useAppAddress,se as useArmedAfterFocus,we as useAssistant,at as useAssistantClient,qe as useBackendData,Ce as useClient,n as useComponentReads,Te as useComponentSelect,Ze as useCreateForm,Ie as useFacets,Fe as useFieldControl,pt as useFileText,Ge as useFocusPage,U as useFocusRecord,Qe as useFocusZoneFilled,g as useGuardedPress,P as useHistogram,k as useInbox,xe as useLayoutRecord,C as useList,pe as useListDisplay,Ye as useMarkNotificationsRead,ae as useMembers,Be as useMeta,ne as useOwnStatus,O as usePlugin,m as usePresence,Ke as usePushNotifications,vt as useQuery,_t as useQueryClient,te as useRecord,re as useRecordCallAddress,oe as useRecordCalls,De as useResourceClient,R as useSeries,ge as useSiblingPage,b as useSignedInUser,ce as useStatuses,E as useUnreadNotifications,u as useUpdateRecord};
|
|
@@ -0,0 +1,3 @@
|
|
|
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{Ac as r,Jl as i,Js as a,Kl as o,Uc as s,Wc as c,dc as l,el as u,gr as d,j as f,lc as p,ll as m,oo as h,tl as g,ul as _,vi as ee}from"./app-C8DagobC.js";import{c as v,d as y,l as te,o as b,u as x}from"./list-page-DQUxt0LO.js";var S={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};S.node;var ne=s(S),C=e(t(),1),w=e(n(),1),re=e=>/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e,ie=(e,t)=>{let n=[...t].sort((e,t)=>e.line-t.line).map(t=>[...e.map((e,n)=>b(t.cells[n]??null)),String(t.line),t.problems.join(`; `)]);return`${[[...e,y(`line`),y(`problems`)],...n].map(e=>e.map(re).join(`,`)).join(`\r
|
|
2
|
+
`)}\r\n`},T=({label:e,counts:t})=>(0,w.jsx)(`dl`,{"aria-label":e,className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:t.map(([e,t])=>(0,w.jsxs)(`div`,{className:`rounded-lg border px-3 py-2`,children:[(0,w.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,w.jsx)(`dd`,{className:`text-lg font-semibold tabular-nums`,children:t.toLocaleString(g())})]},e))}),E=(e,t)=>e?.fields[t]?.label??_(t),ae=new Set([`text`,`integer`,`bigint`,`decimal`,`boolean`,`date`,`timestamp`,`uuid`,`enum`,`relation`,`currency`,`country`]),D=(e,t)=>{let n=e.relation?t[e.relation.resource]:void 0;return n?.primaryKey.length===1?n:void 0},oe=(e,t,{json:n=!1}={})=>Object.values(e.fields).filter(r=>r.readOnly||r.name===e.tenant?!1:r.type===`json`?n:ae.has(r.type)?r.type!==`relation`||D(r,t)!==void 0:!1),se=new Set([`text`,`integer`,`bigint`,`uuid`,`date`,`currency`,`country`,`enum`]),ce=e=>{let t=e.primaryKey.length===1?[e.fields[e.primaryKey[0]]]:[],n=Object.values(e.fields).filter(t=>t.filterable&&!t.sensitive&&se.has(t.type)&&!e.primaryKey.includes(t.name));return[...t,...n]},O=(e,t)=>D(e,t),k=e=>!e.nullable&&!e.default,A=e=>e.toLowerCase().replace(/[\s_-]+/g,``),le=(e,t,n)=>{let r=new Set;return e.flatMap((e,i)=>{let a=A(e);if(a===``)return[];let o=t.find(e=>!r.has(e.name)&&(A(E(n,e.name))===a||A(e.name)===a));return o?(r.add(o.name),[{column:i,field:o.name}]):[]})},ue=(e,t,n)=>{if(e===`update`)return[];let r=new Set(n.map(e=>e.field));return t.filter(e=>k(e)&&!r.has(e.name))},j=e=>({ok:!0,value:e}),M=e=>({ok:!1,problem:e}),N=e=>`“${b(e)}”`,P=(e,t)=>{if(typeof e==`number`)return String(e);if(typeof e==`string`)return f(e,t.decimal)},de=(e,t,n)=>{let r=P(t,n);if(r===void 0)return M(y(`notNumber`,{cell:N(t)}));let[i,a=``]=r.split(`.`);if(/[1-9]/.test(a)||/e/i.test(r))return M(y(`notWholeNumber`,{cell:N(t)}));if(e.type===`bigint`)return j(String(BigInt(i)));let o=Number(i);return Number.isSafeInteger(o)?j(o):M(y(`tooLarge`,{cell:N(t)}))},fe=(e,t)=>{let n=P(e,t);return n===void 0?M(y(`notNumber`,{cell:N(e)})):j(n)},pe=new Set([`true`,`yes`,`1`]),me=new Set([`false`,`no`,`0`]),he=e=>{if(typeof e==`boolean`)return j(e);let t=typeof e==`string`||typeof e==`number`?String(e).trim().toLowerCase():``;return pe.has(t)?j(!0):me.has(t)?j(!1):M(y(`notBoolean`,{cell:N(e)}))},F=e=>String(e).padStart(2,`0`),ge=(e,t,n)=>{let r=new Date(Date.UTC(e,t-1,n));if(r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n)return`${e}-${F(t)}-${F(n)}`},I=`(\\d{1,2}):(\\d{2})(?::(\\d{2})(?:\\.\\d+)?)?`,L=(e,t)=>{let n=RegExp(`^(\\d{4})[-/](\\d{1,2})[-/](\\d{1,2})(?:[T ]${I}(Z|[+-]\\d{2}:?\\d{2})?)?$`).exec(e.trim()),r=RegExp(`^(\\d{1,2})[./-](\\d{1,2})[./-](\\d{4})(?: ${I})?$`).exec(e.trim());if(!n&&!r)return;let[i,a,o]=n?[n[1],n[2],n[3]].map(Number):t===`dmy`?[r[3],r[2],r[1]].map(Number):[r[3],r[1],r[2]].map(Number),s=ge(i,a,o);if(!s)return;let[c,l,u=`0`]=n?n.slice(4,7):r.slice(4,7);if(c===void 0)return{date:s};if(!(Number(c)>23||Number(l)>59||Number(u)>59))return{date:s,time:`${F(Number(c))}:${l}:${F(Number(u))}`,zone:n?.[7]}},R=(e,t)=>{if(te(e)){let[t,n]=e.date.split(`T`);return{date:t,time:n}}return typeof e==`string`?L(e,t.dateOrder):void 0},z=(e,t)=>M(y(`notDate`,{cell:N(e),dayFirst:t.dateOrder===`dmy`})),_e=(e,t)=>{let n=R(e,t);return n?n.time&&n.time!==`00:00:00`?M(y(`hasTime`,{cell:N(e)})):j(n.date):z(e,t)},ve=(e,t)=>{let n=R(e,t);if(!n)return z(e,t);if(n.zone)return j(new Date(`${n.date}T${n.time}${n.zone===`Z`?`Z`:n.zone.replace(/^([+-]\d{2})(\d{2})$/,`$1:$2`)}`).toISOString());let[r,i,a]=n.date.split(`-`).map(Number),[o,s,c]=(n.time??`00:00:00`).split(`:`).map(Number);return j(new Date(r,i-1,a,o,s,c).toISOString())},B=e=>e.trim().toLowerCase().replace(/\s+/g,` `),ye=(e,t,n)=>{let r=e.enumValues??[],i=B(b(n)),a=r.filter(e=>B(e)===i||B(m(e,t?.valueLabels))===i);return a.length===1?j(a[0]):a.length>1?M(y(`severalValues`,{cell:N(n),values:a.map(e=>m(e,t?.valueLabels)).join(`, `)})):M(y(`notOneOf`,{cell:N(n),values:r.map(e=>m(e,t?.valueLabels)).join(`, `)}))},be=(e,t)=>typeof e==`boolean`&&!t.booleanText?M(y(`notText`,{cell:N(e)})):j(b(e)),xe=e=>x(e)?j(e.json):j(e),V=(e,t,n,r)=>{if(v(n))return e.nullable?j(null):M(y(`emptyRequired`));if(e.type===`json`)return xe(n);if(x(n))return M(y(`nestedValue`,{cell:N(n)}));switch(e.type){case`integer`:case`bigint`:return de(e,n,r);case`decimal`:return fe(n,r);case`boolean`:return he(n);case`date`:return _e(n,r);case`timestamp`:return ve(n,r);case`enum`:return ye(e,t,n);case`text`:case`uuid`:case`currency`:case`country`:return be(n,r);default:throw Error(`Not implemented: importing ${e.type} fields, which importableFields leaves out`)}},Se=(e,t)=>e[t]?.names?.singular??_(t),Ce=(e,t)=>e[t]?.names?.plural??_(t),we=(e,t,n)=>{let{model:r,resources:i,views:a}=n,o=a[r.name],s={},c={},l=[],u=[];for(let{column:n,field:d,matchBy:f}of t.columns){let p=r.fields[d],m=e.cells[n]??null,h=E(o,d),g=O(p,i);if(g&&!v(m)){let e=f??g.primaryKey[0],n=V(g.fields[e],a[g.name]?.fields[e],m,t.options);n.ok?u.push({field:d,finding:{model:g,field:e,value:n.value}}):l.push(`${h}: ${n.problem}`),s[d]=b(m);continue}let _=V(p,o?.fields[d],m,t.options);_.ok?c[d]=s[d]=_.value:l.push(`${h}: ${_.problem}`)}let d;if(t.match&&t.mode!==`create`){let n=r.fields[t.match.field],i=V({...n,nullable:!1},o?.fields[n.name],e.cells[t.match.column]??null,t.options);i.ok?d={model:r,field:n.name,value:i.value}:l.push(`${E(o,n.name)}: ${i.problem}`)}return{values:s,data:c,problems:l,relations:u,match:d}},H=(e,t)=>{let n=e.lookups.keysOf(t.model.name,t.field,t.value),r=`${E(e.views[t.model.name],t.field).toLowerCase()} “${String(t.value)}”`;return n.length===1?{key:n[0]}:n.length===0?{none:y(`noneHas`,{singular:Se(e.views,t.model.name),named:r})}:{several:y(`severalHave`,{count:n.length,plural:Ce(e.views,t.model.name),named:r})}},Te=e=>e.cells.every(v),U=async(e,t,n)=>{let{model:r,views:i}=n,a=e.filter(e=>!Te(e)).map(e=>({row:e,...we(e,t,n)})),o=new Map;for(let e of a.flatMap(e=>[...e.relations.map(e=>e.finding),...e.match?[e.match]:[]])){let t=`${e.model.name}.${e.field}`;o.has(t)||o.set(t,{model:e.model,field:e.field,values:[]}),o.get(t).values.push(e.value)}for(let{model:e,field:t,values:r}of o.values())await n.lookups.load(e,t,r);return a.map(({row:e,values:a,data:o,problems:s,relations:c,match:l})=>{let u={...o};for(let{field:e,finding:t}of c){let a=H(n,t);`key`in a?u[e]=a.key:s.push(`${E(i[r.name],e)}: ${a.none??a.several}`)}let d=l&&H(n,l);d?.several&&s.push(y(`notOneRecord`,{found:d.several})),d?.none&&t.mode===`update`&&s.push(y(`nothingToUpdate`,{found:d.none}));let f={line:e.line,cells:e.cells,values:a,problems:s};return s.length>0?f:d&&`key`in d?{...f,op:{op:`update`,resource:r.name,key:d.key,etag:`*`,data:u}}:{...f,op:{op:`create`,resource:r.name,data:u}}})},Ee=5,De=5,Oe=async(e,t)=>{let n=e.rows(t),{value:r=[]}=await n.next();await n.return(void 0);let[i,...a]=r;return{headers:(i?.cells??[]).map(b),sample:a.slice(0,Ee)}};async function*W(e,t){let n=!0;for await(let r of e.rows(t))yield n?r.slice(1):r,n=!1}var ke=async(e,t,n,r,i,a)=>{let o={rows:0,creates:0,updates:0,problems:[],preview:[]};for await(let s of W(e,t)){a?.throwIfAborted();for(let e of await U(s,n,r))o.rows++,o.preview.length<De&&o.preview.push(e),e.op?.op===`create`?o.creates++:e.op?.op===`update`?o.updates++:o.problems.push({line:e.line,cells:e.cells,problems:e.problems});i(o.rows)}return o},Ae=(e,t)=>{if(!a(e))return[e.message];let n=e.errors.filter(e=>e.field);return n.length===0?[e.message]:n.map(e=>`${E(t.views[t.model.name],e.field)}: ${e.message}`)},je=async(e,t,n,r,{client:i,onProgress:o,cancelled:s})=>{let c={created:0,updated:0,skipped:0,failed:0,notWritten:[]},l=async e=>{let t=[...e];for(;t.length>0;){let e=t.map(e=>e.op);try{let{results:t}=await i.batchWrite(e);for(let e of t)e.op===`create`?c.created++:e.op===`update`&&c.updated++;return}catch(e){let n=a(e)?e.operation:void 0;if(n===void 0||!t[n])throw e;let[i]=t.splice(n,1);c.failed++,c.notWritten.push({line:i.line,cells:i.cells,problems:Ae(e,r)})}}},u=[],d=async e=>{for(;u.length>=100||e&&u.length>0;){if(s())return!1;await l(u.splice(0,100)),o({...c})}return!0};for await(let i of W(e,t)){for(let e of await U(i,n,r))e.op?u.push(e):(c.skipped++,c.notWritten.push({line:e.line,cells:e.cells,problems:e.problems}));if(!await d(!1))return{...c,cancelled:!0}}return await d(!0)?{...c,cancelled:!1}:{...c,cancelled:!0}},G=50,K=(e,t,n)=>h(ie(t,n),y(`notImportedFile`,{name:(e??`import`).replace(/\.[^.]+$/,``)}),`text/csv`),q=({rows:e})=>(0,w.jsxs)(`ul`,{"aria-label":y(`rowsNotImported`),className:`flex flex-col gap-1 text-body`,children:[e.slice(0,G).map(e=>(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`span`,{className:`font-medium`,children:y(`rowProblems`,{line:e.line})}),` `,e.problems.join(`; `)]},e.line)),e.length>G&&(0,w.jsx)(`li`,{className:`text-muted-foreground`,children:y(`andMore`,{count:(e.length-G).toLocaleString(g())})})]}),Me=({rows:e})=>(0,w.jsxs)(`p`,{className:`flex items-center gap-2 text-muted-foreground`,role:`status`,children:[(0,w.jsx)(l,{className:`size-3.5`}),y(`checkingRows`,{count:e.toLocaleString(g())})]}),Ne=({check:e,model:t,resources:n,views:i,columns:a,headers:o,fileName:s})=>{let c=i[t.name],l=a.map(e=>t.fields[e.field]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(T,{label:y(`check`),counts:[[y(`rows`),e.rows],[y(`toCreate`),e.creates],[y(`toUpdate`),e.updates],[y(`withProblems`),e.problems.length]]}),e.preview.length>0&&(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,w.jsxs)(`table`,{"aria-label":y(`firstRows`),className:`w-full text-left text-body`,children:[(0,w.jsx)(`thead`,{className:`bg-muted text-muted-foreground`,children:(0,w.jsxs)(`tr`,{children:[(0,w.jsx)(`th`,{className:`px-2 py-1.5 font-medium`,children:y(`row`)}),l.map(e=>(0,w.jsx)(`th`,{className:`whitespace-nowrap px-2 py-1.5 font-medium`,children:E(c,e.name)},e.name))]})}),(0,w.jsx)(`tbody`,{className:`divide-y`,children:e.preview.map(e=>(0,w.jsxs)(`tr`,{className:e.problems.length>0?`bg-danger-soft`:void 0,children:[(0,w.jsx)(`td`,{className:`px-2 py-1.5 tabular-nums text-muted-foreground`,children:e.line}),l.map(t=>(0,w.jsx)(`td`,{className:`max-w-48 truncate px-2 py-1.5`,children:O(t,n)?String(e.values[t.name]??`—`):t.name in e.values?ee(t,e.values[t.name],c?.fields[t.name]):``},t.name))]},e.line))})]})}),e.problems.length>0&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:y(`problemRows`)}),(0,w.jsxs)(p,{size:`sm`,onClick:()=>K(s,o,e.problems),children:[(0,w.jsx)(r,{className:`size-3.5`}),y(`download`)]})]}),(0,w.jsx)(q,{rows:e.problems})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`batches`,{size:100})})]})},Pe=[`.xlsx`,`.csv`,`.json`],Fe=[`text/csv`,`application/json`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],Ie=[`text/comma-separated-values`,`application/csv`,`text/x-csv`,`application/vnd.ms-excel`,`text/plain`,`application/octet-stream`],Le=e=>/\bAndroid\b/.test(e),Re=e=>[...Pe,...Fe,...Le(e)?Ie:[]].join(`,`),J=({label:e,name:t,value:n,options:r,onChange:i,help:a,className:o})=>{let s=(0,C.useId)();return(0,w.jsxs)(`div`,{className:c(`flex min-w-0 flex-col gap-1.5`,o),children:[(0,w.jsx)(`label`,{htmlFor:s,className:`font-medium`,children:e}),(0,w.jsx)(`select`,{id:s,"aria-label":t,value:n,onChange:e=>i(e.target.value),className:`h-8 w-full min-w-0 rounded-md border border-border-strong bg-background px-2 shadow-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 max-sm:min-h-11`,children:r.map(e=>(0,w.jsx)(`option`,{value:e.value,children:e.label},e.value))}),a&&(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a})]})},Y=({file:e,sheets:t,sheet:n,reading:r,onChoose:i,onSheet:a})=>{let o=(0,C.useId)();return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`label`,{htmlFor:o,className:`font-medium`,children:y(`file`)}),(0,w.jsx)(`input`,{id:o,type:`file`,accept:Re(globalThis.navigator?.userAgent??``),disabled:r,onChange:e=>{let t=e.target.files?.[0];t&&i(t)},className:`file:mr-3 file:h-8 file:rounded-md file:border file:border-border-strong file:bg-background file:px-3 file:font-medium file:text-foreground max-sm:file:min-h-11`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`fileHint`)})]}),r&&(0,w.jsxs)(`p`,{className:`flex items-center gap-2 text-muted-foreground`,role:`status`,children:[(0,w.jsx)(l,{className:`size-3.5`}),y(`reading`,{name:e?.name??y(`theFile`)})]}),!r&&t.length>1&&(0,w.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,w.jsx)(ne,{className:`mb-2 size-4 shrink-0 text-muted-foreground`}),(0,w.jsx)(J,{className:`flex-1`,label:y(`sheet`),value:n??``,options:t.map(e=>({value:e,label:e})),onChange:a})]})]})},X=e=>e.toLocaleString(g()),ze=({progress:e,total:t,cancelling:n})=>{let r=e.created+e.updated+e.failed;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:y(n?`stopping`:`saving`)}),(0,w.jsxs)(`span`,{className:`tabular-nums`,children:[X(r),` / `,X(t)]})]}),(0,w.jsx)(`div`,{role:`progressbar`,"aria-label":y(`rowsSaved`),"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":t,className:`h-2 overflow-hidden rounded-full bg-muted`,children:(0,w.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${t>0?Math.min(100,r/t*100):0}%`}})})]})},Be=({result:e,stopped:t,headers:n,fileName:i})=>(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t!==void 0&&(0,w.jsx)(d,{title:y(`stopped`),error:t}),e.cancelled&&(0,w.jsx)(`p`,{role:`status`,children:y(`cancelled`)}),(0,w.jsx)(T,{label:y(`summary`),counts:[[y(`created`),e.created],[y(`updated`),e.updated],[y(`skipped`),e.skipped],[y(`failed`),e.failed]]}),e.notWritten.length>0&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:y(`rowsNotImported`)}),(0,w.jsxs)(p,{size:`sm`,onClick:()=>K(i,n,e.notWritten),children:[(0,w.jsx)(r,{className:`size-3.5`}),y(`download`)]})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`notWrittenHint`)}),(0,w.jsx)(q,{rows:[...e.notWritten].sort((e,t)=>e.line-t.line)})]})]}),Ve=o(),Z=100,Q=e=>String(e),He=e=>{let t=new Map,n=(e,n)=>{let r=`${e}.${n}`;return t.has(r)||t.set(r,new Map),t.get(r)};return{load:async(t,r,a)=>{let o=n(t.name,r),s=[...new Map(a.filter(e=>!o.has(Q(e))).map(e=>[Q(e),e])).values()],c=t.primaryKey[0];for(let n=0;n<s.length;n+=Z){let a=s.slice(n,n+Z);for(let e of a)o.set(Q(e),[]);let l=i(Ve.in(r,a)),u;do{let n=await e(t.name).list(t.name,{filter:l,fields:[...new Set([c,r])],pageSize:1e3,pageToken:u});for(let e of n.items)o.get(Q(e[r]))?.push(e[c]);u=n.nextPageToken||void 0}while(u)}},keysOf:(e,t,r)=>n(e,t).get(Q(r))??[]}},Ue=500,$=()=>{let e=new Worker(new URL(`/assets/parse-worker-VaelBbE0.js`,``+import.meta.url),{type:`module`}),t=[],n;return e.onmessage=e=>{if(n){let t=n;n=void 0,t(e.data)}else t.push(e.data)},e.onerror=e=>{e.preventDefault();let r={type:`error`,message:y(`unreadable`)};n?n(r):t.push(r)},{send:t=>e.postMessage(t),receive:()=>t.length>0?Promise.resolve(t.shift()):new Promise(e=>n=e),stop:()=>e.terminate()}},We=e=>({sheets:async()=>{let t=$();try{t.send({type:`sheets`,file:e,locale:u()});let n=await t.receive();if(n.type===`error`)throw Error(n.message);if(n.type!==`sheets`)throw Error(`The parse worker answered ${n.type} to a request for sheets`);return n.sheets}finally{t.stop()}},rows:async function*(t){let n=$();try{for(n.send({type:`read`,file:e,sheet:t,chunk:Ue,locale:u()});;){let e=await n.receive();if(e.type===`error`)throw Error(e.message);if(e.type===`end`)return;if(e.type!==`rows`)throw Error(`The parse worker answered ${e.type} to a read`);yield e.rows,n.send({type:`next`})}}finally{n.stop()}}});export{k as _,Y as a,Me as c,je as d,le as f,O as g,ce as h,Be as i,ke as l,oe as m,He as n,J as o,E as p,ze as r,Ne as s,We as t,Oe as u,ue as v};
|
|
3
|
+
//# debugId=712755b3-b930-4561-a8c3-285b4c04cd9b
|
|
@@ -0,0 +1,2 @@
|
|
|
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{$o as r,Wc as i,Xo as a,Zi as o,Zo as s,bs as c,dc as l,lc as u,tl as d,ts as f,ws as p,xs as m}from"./app-C8DagobC.js";import{t as h}from"./page-header-Ddz2r5ic.js";var g=e(t(),1),_=()=>[{value:`allowed`,label:c(`on`)},{value:`forbidden`,label:c(`off`)}],v=()=>[{value:`allowed`,label:c(`optional`)},{value:`required`,label:c(`required`)},{value:`forbidden`,label:c(`off`)}],y=()=>[{method:`password`,label:c(`password`),description:c(`passwordDescription`),rules:_()},{method:`emailCode`,label:c(`emailedSignInCode`),description:c(`emailedSignInCodeDescription`),rules:_()},{method:`passkey`,label:c(`passkeys`),description:c(`passkeysPolicyDescription`),rules:v()},{method:`twoFactor`,label:c(`twoFactor`),description:c(`twoFactorPolicyDescription`),rules:v()},{method:`staffAccess`,label:c(`staffAccess`),description:c(`staffAccessDescription`),rules:[{value:`allowed`,label:c(`on`)},{value:`notify`,label:c(`emailThePerson`)},{value:`forbidden`,label:c(`off`)}]},{method:`platformSignIn`,label:c(`platformSignIn`),description:c(`platformSignInDescription`),rules:_()}],b=(e,t)=>{let n=y().find(t=>t.method===e)?.rules.find(e=>e.value===t)?.label;if(n===void 0)throw Error(`No label for the ${t} rule of ${e}`);return n},x=e(n(),1),S=({row:e,value:t,onChange:n})=>(0,x.jsx)(`span`,{role:`radiogroup`,"aria-label":e.label,className:`inline-flex h-8 shrink-0 rounded-md bg-muted p-0.5`,children:e.rules.map(e=>(0,x.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.value===t,onClick:()=>n(e.value),className:i(`rounded px-3 text-body font-medium transition-colors`,e.value===t?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:e.label},e.value))}),C=({method:e},t,{mail:n,effective:r,policy:i})=>{if(e===`emailCode`&&!n)return c(`codeNeedsMail`);if(e===`password`&&!n&&t.password===`forbidden`)return c(`passwordStaysOn`);if(e===`staffAccess`&&!n&&t.staffAccess===`notify`)return c(`staffNeedsMail`);if(e===`platformSignIn`&&t.platformSignIn===`allowed`&&t.passkey===`required`)return c(`platformOff`);if(t[e]===i[e]&&r[e]!==i[e])return c(`appliesAs`,{rule:b(e,r[e])})},w=({operator:e,platformProviders:t=[]})=>y().flatMap(n=>n.method===`staffAccess`&&!e?[]:n.method===`platformSignIn`?t.length>0?[{...n,label:c(`platformSignInWith`,{provider:new Intl.ListFormat(d(),{type:`conjunction`}).format(t)})}]:[]:[n]),T=({state:e,onSave:t,busy:n,error:r,notice:i})=>{let[a,s]=(0,g.useState)(e.policy),l=w(e),d=l.some(({method:t})=>a[t]!==e.policy[t]);return(0,x.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),t(a)},children:[(0,x.jsx)(`ul`,{className:`divide-y rounded-lg border bg-background`,children:l.map(t=>{let n=C(t,a,e);return(0,x.jsxs)(`li`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h2`,{className:`font-semibold`,children:t.label}),(0,x.jsx)(`p`,{className:`mt-0.5 text-muted-foreground`,children:t.description}),n&&(0,x.jsx)(`p`,{className:`mt-1.5 text-xs font-medium text-warning-text`,children:n})]}),(0,x.jsx)(S,{row:t,value:a[t.method],onChange:e=>s({...a,[t.method]:e})})]},t.method)})}),r&&(0,x.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger-soft px-3 py-2 text-body font-medium text-danger-text`,children:r}),i&&!d&&(0,x.jsx)(`p`,{role:`status`,className:`rounded-md bg-success-soft px-3 py-2 text-body font-medium text-success-text`,children:i}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.savedAt?e.savedBy?c(`lastSavedBy`,{name:e.savedBy,time:o(Date.parse(e.savedAt))}):c(`lastSaved`,{time:o(Date.parse(e.savedAt))}):c(`neverChanged`)}),(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[d&&(0,x.jsx)(u,{onClick:()=>s(e.policy),children:c(`reset`)}),(0,x.jsx)(u,{variant:`primary`,type:`submit`,loading:n,disabled:!d,children:c(`save`)})]})]})]})},E=(e,t)=>e.endedAt?(0,x.jsx)(r,{tone:`neutral`,children:c(`stopped`,{time:o(Date.parse(e.endedAt))})}):Date.parse(e.expiresAt)<=t?(0,x.jsx)(r,{tone:`neutral`,children:c(`ended`,{time:o(Date.parse(e.expiresAt))})}):(0,x.jsx)(r,{tone:`amber`,children:c(`signedInUntil`,{time:o(Date.parse(e.expiresAt))})}),D=({signIns:e,operator:t,error:n,now:r=Date.now()})=>(0,x.jsxs)(a,{title:c(`staffSignIns`),description:c(`staffSignInsDescription`,{operator:t}),children:[(0,x.jsx)(s,{message:n}),e&&e.length===0&&(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:c(`noStaffSignIns`)}),e&&e.length>0&&(0,x.jsx)(`ul`,{className:`divide-y rounded-md border`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`flex flex-col gap-1.5 p-3`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,x.jsx)(`span`,{className:`font-medium break-all`,children:e.staffName?`${e.staffName} (${e.staff})`:e.staff}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:c(`as`)}),(0,x.jsx)(`span`,{className:`font-medium break-all`,children:e.user})]}),(0,x.jsx)(`p`,{className:`break-words`,children:e.reason}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:o(Date.parse(e.startedAt))}),E(e,r)]})]},e.id))})]}),O=({operator:e})=>{let{session:t}=m(),[n,r]=(0,g.useState)(),[i,a]=(0,g.useState)();return(0,g.useEffect)(()=>{t.staff.log().then(r,e=>a(e instanceof p?f(e):c(`couldNotReadStaffSignIns`)))},[t]),(0,x.jsx)(D,{operator:e,signIns:n,error:i})},k=()=>{let{session:e}=m(),[t,n]=(0,g.useState)(),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(),[s,u]=(0,g.useState)();(0,g.useEffect)(()=>{e.signInPolicy.read().then(n,e=>o(e instanceof p?f(e):c(`couldNotReadPolicy`)))},[e]);let d=async t=>{i(!0),o(void 0),u(void 0);try{n(await e.signInPolicy.save(t)),u(c(`policySaved`))}catch(e){if(!(e instanceof p))throw e;o(f(e))}i(!1)};return(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6`,children:[(0,x.jsx)(h,{title:c(`signInPolicy`),subtitle:c(`policySubtitle`)}),t?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(T,{state:t,busy:r,error:a,notice:s,onSave:e=>void d(e)},t.savedAt??`default`),t.operator&&(0,x.jsx)(O,{operator:t.operator})]}):a?(0,x.jsx)(`p`,{role:`alert`,className:`text-danger-text`,children:a}):(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,x.jsx)(l,{}),` `,c(`loading`)]})]})};export{k as SignInPolicyPage};
|
|
2
|
+
//# debugId=86aa3df1-a468-45c9-8bb6-821828458852
|
|
@@ -0,0 +1,2 @@
|
|
|
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}from"./react-CuiNlnus.js";import{Es as n,Fr as r,Ho as i,Hs as a,Na as o,Or as s,Xn as c,an as l,ds as u,er as d,fn as f,is as p,js as m,ks as h,lr as g,mn as _,nr as v,on as y,pn as b,sn as x,sr as S,ya as C}from"./app-C8DagobC.js";import{h as w}from"./vendor-t7Q7QbPu.js";import{S as T,ht as E,r as D}from"./embedded-list-ZGVUzTqi.js";import{n as O}from"./record-preview-DyOOyKCI.js";var k=e(t(),1),A=e=>({queryKey:e.queryKey,start:t=>t.prefetchQuery(e)}),j=e=>({queryKey:e.queryKey,start:t=>t.prefetchInfiniteQuery(e)}),M={Table:(e,t,n)=>{let{resource:r,filter:i=``,sort:a=``,columns:o,button:s,bulk:c=!1,limit:u=10,select:d}=y(e),f=r===void 0?void 0:n.resources[r];if(!f)return[];if(t.part===`chosen`){let e=d===void 0?void 0:n.given[d];return e?[A(b(n.client,f,{key:e}))]:[]}let p=n.views[f.name],{fields:h,read:g}=x({...n,model:f,view:p,columns:o?.map(m),button:s,bulk:c,phoneColumns:l(o)});return[A(D(n,{model:f,filter:i,orderBy:a||C(f,p),limit:u,fields:h,read:g}))]},Chart:(e,t,{client:n,resources:r,views:i})=>{let{resource:a,groupBy:o,splitBy:c,sum:l,average:u,filter:d,granularity:f,range:p,limit:m}=y(e),h=r[a],g=h&&E({model:h,groupBy:o,splitBy:c,sum:l,average:u,filter:d,granularity:f,range:p,limit:m},r,i);return h&&g?[A(s(n,h.name,g))]:[]},RecordCards:(e,t,{client:n,resources:r,views:i})=>{let{resource:a,filter:o=``,sort:s=``,limit:c=10}=y(e),l=r[a];if(!l)return[];let u=s||C(l,i[l.name]);return[A(_(n,l,{filter:o,sort:u,pageSize:c})),A(f(n,l,o))]},RecordRow:(e,t,{client:n,queryClient:r,resources:i,views:a})=>{let{resource:o,filter:s=``,sort:c=``}=y(e),l=i[o];if(!l)return[];let u=a[l.name];return u?.searchesOf||u?.listOf!==void 0?[]:[A(O({queryClient:r,client:n,resources:i,views:a,model:l,...T(l,u,{filter:s,sort:c})}))]},Thread:(e,t,{client:n,resources:i,views:o})=>{let{resource:s,filter:l,sender:u,time:d,calls:f,limit:p=50}=y(e);if(t.part===`calls`){let e=f&&i[f.resource];return e?[j(r(n,e.name,{filter:f.filter,orderBy:a(f.time),pageSize:p}))]:[]}let m=i[s];if(!m)return[];let h=c(i,o,m,u===void 0?[]:[u]);return[j(r(n,m.name,{filter:l,orderBy:a(d),pageSize:p,labels:h}))]}},N=(e,t,{client:n,resources:r})=>{let i=r[t.resource];return i?[A(f(n,i))]:[]},P=(e,t,r)=>(r?.reads??[]).flatMap(r=>{let i=h(t,r.block);if(!i||i.custom)return[];if(r.part===`condition`)return N(i,r,e);if(r.split)return[];let a=M[i.type];return a?a(n(i,{stack:[],params:e.params,...e.root&&{root:e.root}}),r,e):[]}),F=({tree:e,plan:t})=>{let n=u(),r=w(),{resources:a,views:s}=p(),c=o().fields,l=i(),f=d(),m=v(),h=S(g()),_=(0,k.useMemo)(()=>P({client:n,queryClient:r,resources:a,views:s,fieldTypes:c,xs:l,params:f,given:m,...h&&{root:h}},e,t),[n,r,a,s,c,l,f,m,h,e,t]);return(0,k.useEffect)(()=>{for(let e of _)e.start(r)},[_,r]),null};export{F as t};
|
|
2
|
+
//# debugId=f2706f7d-e8f5-447e-aeab-c019607f69ca
|
|
@@ -0,0 +1,2 @@
|
|
|
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{Bn as r,Cc as i,M as a,Mc as o,Nc as s,Qc as c,R as l,Uc as u,V as d,Vc as f,hc as ee,ko as te,lc as p,ls as ne,sc as m,ul as re,wc as h,xc as g,yc as ie}from"./app-C8DagobC.js";import{t as ae}from"./circle-alert-BF0JSDU0.js";import{a as oe,c as se,d as ce,f as le,g as ue,h as de,i as fe,m as pe,o as me,p as he,r as ge,s as _e,u as ve}from"./workflow-canvas-DgWBX54L.js";import{t as _}from"./trash-BBz7IXo9.js";import{A as ye,D as be,F as xe,M as v,_ as Se,a as Ce,c as y,f as we,g as Te,h as b,i as Ee,k as x,m as De,n as Oe,o as S,s as C,u as ke,x as Ae}from"./workflows-Bey4jszG.js";import{E as w,S as je,T,_ as Me,s as E,x as D}from"./use-run-trace-DYU4WZ6w.js";import{n as O}from"./use-workflow-types-BfCyY_Vr.js";var Ne={type:`object`,title:`File`,properties:{uri:{type:`string`},name:{type:`string`},type:{type:`string`},size:{type:`integer`}}},Pe=(e,t)=>e.relation&&t?.(e.relation.resource)===`integer`?{type:`integer`}:{type:`string`},Fe=(e,t,n)=>{if(e.file)return t===`read`?Ne:{type:`string`};switch(e.type){case`integer`:return{type:`integer`};case`boolean`:return{type:`boolean`};case`json`:return{};case`enum`:return{type:`string`,...e.enumValues&&{enum:e.enumValues}};case`relation`:return t===`read`?Pe(e,n):{type:[`string`,`integer`]};case`bigint`:return t===`read`?{type:`string`}:{type:[`string`,`integer`]};case`decimal`:return t===`read`?{type:`string`}:{type:[`string`,`number`]};default:return{type:`string`}}},Ie=(e,t,n)=>{let r=Fe(e,t,n);if(t===`read`||!e.nullable||r.type===void 0)return r;let i=Array.isArray(r.type)?r.type:[r.type];return{...r,type:[...i,`null`],...Array.isArray(r.enum)&&{enum:[...r.enum,null]}}},Le=(e,t,n=e.name,r)=>({type:`object`,title:n,properties:Object.fromEntries(Object.values(e.fields).filter(e=>t===`read`||!e.readOnly).map(e=>[e.name,Ie(e,t,r)]))}),Re=e=>t=>{let n=e(t);return n?.primaryKey.length===1?n.fields[n.primaryKey[0]]?.type:void 0},ze={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};ze.node;var k=u(ze),Be={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Be.node;var Ve=u(Be),He={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};He.node;var Ue=u(He),We={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};We.node;var Ge=u(We),Ke={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Ke.node;var qe=u(Ke),Je={name:`repeat`,size:24,node:[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]};Je.node;var Ye=u(Je),Xe={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};Xe.node;var Ze=u(Xe),A=(e,t)=>{let n=structuredClone(e);return t(n),n},j=new Set([`Task`,`Pass`,`Wait`,`Map`,`Block`]),M=(e,t)=>{if(!j.has(e.Type))return;let n=e;delete n.End,n.Next=t},N=(e,t)=>{let n=D(e,t);if(!n)throw Error(`No Map or Block at ${t.join(`/`)}`);return n},Qe=(e,t)=>{let n=new Set(Me(e.stateMachine)),r=1;for(;n.has(`${t} ${r}`);)r++;return`${t} ${r}`},$e=e=>`task`in e?{Type:`Task`,Resource:e.task,Arguments:{},End:!0}:e.type===`Choice`?{Type:`Choice`,Choices:[]}:e.type===`Wait`?{Type:`Wait`,Seconds:60,End:!0}:e.type===`Succeed`?{Type:`Succeed`}:e.type===`Fail`?{Type:`Fail`}:e.type===`Pass`?{Type:`Pass`,End:!0}:e.type===`Block`?{Type:`Block`,Processor:{StartAt:``,States:{}},Cache:{Ttl:`1 hour`},End:!0}:{Type:`Map`,Items:`{% [] %}`,ItemProcessor:{StartAt:``,States:{}},End:!0},P=(e,t,n,r,i)=>A(e,e=>{let a=N(e,t),o=b(e)===`data`,s=$e(n);if(o&&delete s.End,a.States[r]=s,!o&&(a.StartAt===void 0||!Object.hasOwn(a.States,a.StartAt))&&(a.StartAt=r),s.Type!==`Map`&&s.Type!==`Block`)return;let c=Qe(e,i),l=o?{States:{[c]:{Type:`Pass`}}}:{StartAt:c,States:{[c]:{Type:`Pass`,End:!0}}};s.Type===`Map`?s.ItemProcessor=l:s.Processor=l}),F=e=>e.Type===`Choice`||j.has(e.Type),et=(e,t,n)=>{let r=e.States[t],i=e.States[n];if(!r||!j.has(r.Type))return;let a=r.Next;(a===void 0||F(i))&&(M(r,n),a!==void 0&&(i.Type===`Choice`?i.Default=a:j.has(i.Type)&&M(i,a)))},tt=(e,t,n)=>{let r=N(e,t);if(n!==void 0&&n!==t.join(`/`)){let{name:e}=T(n);return j.has(r.States[e]?.Type)?e:void 0}return Object.keys(r.States).reverse().find(e=>r.States[e].End===!0)},nt=e=>e.kind===`start`?[]:T(e.source).scope,rt=e=>e.ErrorEquals.length===1&&e.ErrorEquals[0]===`States.ALL`,it=(e,t)=>{if(t.kind===`start`)return e.stateMachine.StartAt||void 0;let{scope:n,name:r}=T(t.source),i=D(e,n)?.States[r];if(i){if(t.kind===`next`)return i.Next;if(t.kind==="default")return i.Type===`Choice`?i.Default:void 0;if(t.kind===`catch`)return`Catch`in i?i.Catch?.find(rt)?.Next:void 0}},at=(e,t,n,r,i)=>{if(i.kind===`start`)return st(e,t,n,r);let{scope:a,name:o}=T(i.source);if(i.kind===`next`)return ot(e,a,t,n,r,o);let s=it(e,i);return A(P(e,a,t,n,r),e=>{let t=N(e,a),r=t.States[o],c=t.States[n];if(r&&(s===void 0||F(c))){if(i.kind===`rule`&&r.Type===`Choice`&&(r.Choices=[...r.Choices??[],{Condition:``,Next:n}]),i.kind==="default"&&r.Type===`Choice`&&(r.Default=n),i.kind===`catch`&&(r.Type===`Task`||r.Type===`Map`||r.Type===`Block`)){let e=r.Catch?.find(rt);e?e.Next=n:r.Catch=[...r.Catch??[],{ErrorEquals:[`States.ALL`],Next:n}]}s!==void 0&&(c.Type===`Choice`?c.Default=s:j.has(c.Type)&&M(c,s))}})},ot=(e,t,n,r,i,a)=>{let o=P(e,t,n,r,i);return a===void 0||b(e)===`data`?o:A(o,e=>et(N(e,t),a,r))},st=(e,t,n,r)=>{let i=e.stateMachine.StartAt??``,a=P(e,[],t,n,r);return b(e)===`data`?a:A(a,e=>{let t=e.stateMachine.States[n];(i===``||F(t))&&(e.stateMachine.StartAt=n,i!==``&&j.has(t.Type)&&M(t,i),i!==``&&t.Type===`Choice`&&(t.Default=i))})},ct=(e,t)=>{`Next`in e&&e.Next===t&&(delete e.Next,e.End=!0),e.Type===`Choice`&&(e.Choices=(e.Choices??[]).filter(e=>e.Next!==t),e.Default===t&&delete e.Default),`Catch`in e&&e.Catch&&(e.Catch=e.Catch.filter(e=>e.Next!==t),e.Catch.length===0&&delete e.Catch)},lt=(e,t)=>A(e,e=>{let{scope:n,name:r}=T(t),i=N(e,n);delete i.States[r];for(let e of Object.values(i.States))ct(e,r);i.StartAt===r&&(i.StartAt=Object.keys(i.States)[0]??``)}),ut=(e,t,n,r)=>A(e,e=>{let{scope:i,name:a}=T(r);if(t===`start`){e.stateMachine.StartAt=a;return}let o=T(n);if(o.scope.join(`/`)!==i.join(`/`))throw Error(`A state leads only to states of its own machine`);let s=N(e,i).States[o.name];s&&(t===`next`&&M(s,a),t===`rule`&&s.Type===`Choice`&&(s.Choices=[...s.Choices??[],{Condition:``,Next:a}]),t==="default"&&s.Type===`Choice`&&(s.Default=a),t===`catch`&&(s.Type===`Task`||s.Type===`Map`||s.Type===`Block`)&&(s.Catch=[...s.Catch??[],{ErrorEquals:[`States.ALL`],Next:a}]))}),dt=(e,t)=>A(e,e=>{if(t.kind===`start`)return;let{scope:n,name:r}=T(t.source),i=N(e,n).States[r];if(!i)return;let a=Number(/\[(\d+)\]/.exec(t.field)?.[1]);t.kind===`next`&&`Next`in i&&(delete i.Next,i.End=!0),t.kind===`rule`&&i.Type===`Choice`&&(i.Choices=i.Choices.filter((e,t)=>t!==a)),t.kind==="default"&&i.Type===`Choice`&&delete i.Default,t.kind===`catch`&&`Catch`in i&&i.Catch&&(i.Catch=i.Catch.filter((e,t)=>t!==a),i.Catch.length===0&&delete i.Catch)}),ft=(e,t,n)=>A(e,e=>{let{scope:r,name:i}=T(t);N(e,r).States[i]=n}),pt=(e,t,n)=>{e.States=Object.fromEntries(Object.entries(e.States).map(([e,r])=>[e===t?n:e,r])),e.StartAt===t&&(e.StartAt=n);for(let r of Object.values(e.States)){if(`Next`in r&&r.Next===t&&(r.Next=n),r.Type===`Choice`){for(let e of r.Choices??[])e.Next===t&&(e.Next=n);r.Default===t&&(r.Default=n)}if(`Catch`in r)for(let e of r.Catch??[])e.Next===t&&(e.Next=n)}},mt=e=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)&&![`true`,`false`,`null`].includes(e)?e:`\`${e}\``,ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),I=(e,t,n)=>{if(typeof e==`string`){if(!e.trimStart().startsWith(`{%`))return e;let r=RegExp(`\\$states\\.context\\.Steps\\.(?:${ht(t)}(?![A-Za-z0-9_])|\`${ht(t)}\`)`,`g`);return e.split(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\/\*[\s\S]*?\*\/)/).map((e,t)=>t%2==1?e:e.replace(r,()=>`$states.context.Steps.${mt(n)}`)).join(``)}return Array.isArray(e)?e.map(e=>I(e,t,n)):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,I(r,t,n)])):e},gt=(e,t,n)=>A(e,e=>{let{scope:r,name:i}=T(t);pt(N(e,r),i,n),e.stateMachine=I(e.stateMachine,i,n)}),_t=(e,t)=>A(e,e=>{let{scope:n,name:r}=T(t);N(e,n).StartAt=r}),vt=(e,t)=>A(e,e=>{e.trigger=t}),L=e=>typeof e==`object`&&!!e&&!Array.isArray(e),yt=e=>Array.isArray(e.enum)&&e.enum.every(e=>typeof e==`string`)?{kind:`choice`,options:e.enum}:e.type===`string`?{kind:`text`}:e.type===`number`||e.type===`integer`||e.type===`boolean`?{kind:`value`}:e.type===`array`&&L(e.items)&&e.items.type===`string`?{kind:`names`}:{kind:`json`},R=e=>{let t=L(e.properties)?e.properties:{},n=Array.isArray(e.required)?e.required:[];return Object.entries(t).map(([e,t])=>{let r=L(t)?t:{},i=typeof r.title==`string`?r.title:void 0;return{name:e,...yt(r),required:n.includes(e),...i&&{title:i}}})},bt=e=>e.message.startsWith(`is missing`),xt=e=>new Map([...e].map(([e,t])=>[e,t.filter(e=>!bt(e))])),St=e=>{let t=new Map,n=[],r=(e,n)=>t.set(e,[...t.get(e)??[],n]);for(let{state:t,field:i,message:a}of e){let e={...i!==void 0&&{field:i},message:a};t===void 0?i?.startsWith(`trigger`)||i===`StartAt`||i===`stateMachine.StartAt`?r(``,e):n.push(e):r(t,e)}return{byNode:t,whole:n}},Ct=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),wt=e=>t=>e.flatMap(e=>{let n=t[e.name];return n===void 0||n===``?e.required?[{field:e.name,message:`is missing`}]:[]:e.kind===`names`&&!Ct(n)?[{field:e.name,message:`is a list of names, separated by commas`}]:[]}),Tt=(e,t,n)=>{let r=t.step_types.filter(e=>e.available),i=t.triggers.filter(e=>e.available&&e.id!==`manual`),a=[...t.step_types,...t.triggers].filter(e=>!e.available);return we(e,{resources:r.map(e=>e.id),required:Object.fromEntries(r.map(e=>[e.id,R(e.input).filter(e=>e.required).map(e=>e.name)])),triggers:Object.fromEntries(i.map(e=>[e.id,wt(R(e.input))])),unavailable:Object.fromEntries(a.map(e=>[e.id,e.reason??``])),versioned:Oe(r.map(e=>e.id)),...n&&{pins:n}})},Et=e=>{let t=new Map;for(let{state:n,field:r,message:i}of Ce(e))n!==void 0&&t.set(n,[...t.get(n)??[],{...r!==void 0&&{field:r},message:i}]);return t},z=e(n(),1),B=({problems:e})=>e.length>0&&(0,z.jsxs)(`div`,{className:`rounded-md border border-danger/30 bg-danger-soft px-3 py-2 text-body text-danger-text`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,z.jsx)(ae,{className:`size-4`,"aria-hidden":`true`}),e.every(bt)?O(`fillInToSave`,{count:e.length}):O(`cannotSave`,{count:e.length})]}),(0,z.jsx)(`ul`,{className:`mt-1 list-disc pl-6`,children:e.map((e,t)=>(0,z.jsx)(`li`,{children:e.field?O(`fieldProblem`,{field:e.field,message:e.message}):e.message},t))})]}),Dt=({warnings:e})=>e.length>0&&(0,z.jsxs)(`div`,{className:`rounded-md border border-warning/30 bg-warning-soft px-3 py-2 text-body text-warning-text`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,z.jsx)(ee,{className:`size-4`,"aria-hidden":`true`}),O(`warningsSaveAnyway`,{count:e.length})]}),(0,z.jsx)(`ul`,{className:`mt-1 list-disc pl-6`,children:e.map((e,t)=>(0,z.jsx)(`li`,{children:e.field?O(`fieldProblem`,{field:e.field,message:e.message}):e.message},t))})]}),V=e(t(),1),Ot=({name:e,taken:t,disabled:n,onRename:r})=>{let[i,a]=(0,V.useState)(e),o=i.trim(),s=o===``?O(`nameNeeded`):o!==e&&t.includes(o)?O(`nameTaken`):void 0,c=()=>{!s&&o!==e&&r(o)};return(0,z.jsx)(l,{label:O(`name`),error:s,children:(0,z.jsx)(te,{value:i,invalid:!!s,disabled:n,onChange:e=>a(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&c()}})})},H=(e,t)=>{let n=e.filter(e=>e.field===t||e.field?.startsWith(`${t}.`)||e.field?.startsWith(`${t}[`));return n.length>0?n.map(e=>e.message).join(`; `):void 0},U=({label:e,value:t,names:n,none:r,error:i,disabled:a,onChange:o})=>(0,z.jsx)(l,{label:e,error:i,children:(0,z.jsxs)(d,{invalid:!!i,value:t??``,disabled:a,onChange:e=>o(e.target.value===``?void 0:e.target.value),children:[(0,z.jsx)(`option`,{value:``,children:r}),t!==void 0&&!n.includes(t)&&(0,z.jsx)(`option`,{value:t,children:t}),n.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]})}),kt=e=>e===void 0?``:typeof e==`string`?e:JSON.stringify(e,null,2),At=e=>{if(e.trim()!==``)try{return JSON.parse(e)}catch(t){if(!(t instanceof SyntaxError))throw t;return e}},jt=e=>{let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0},Mt=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?e.join(`, `):kt(e),Nt=(0,V.createContext)(void 0),Pt=()=>(0,V.useContext)(Nt),Ft=e=>e===``?void 0:e,It={text:Ft,value:At,choice:Ft,json:At,names:jt},W=({label:e,kind:t,options:n=[],required:i,help:a,value:o,error:s,onChange:c,disabled:u,read:f=It[t],write:ee=t===`names`?Mt:kt})=>{let[p,ne]=(0,V.useState)(),m=p!==void 0&&JSON.stringify(f(p))===JSON.stringify(o)?p:ee(o),re=Pt(),h=e=>{ne(e),c(f(e))},g=re!==void 0&&!u&&(o==null||typeof o==`string`)&&(t===`text`||t===`json`||t===`value`);return(0,z.jsxs)(l,{label:e,required:i,help:a,error:s,wide:t===`json`,children:[t===`choice`?(0,z.jsxs)(d,{invalid:!!s,value:m,disabled:u,onChange:e=>c(e.target.value===``?void 0:e.target.value),children:[(0,z.jsx)(`option`,{value:``,children:O(`defaultChoice`)}),n.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}):t===`json`?(0,z.jsx)(r,{invalid:!!s,rows:2,className:`font-mono text-xs`,value:m,disabled:u,onChange:e=>h(e.target.value)}):(0,z.jsx)(te,{invalid:!!s,value:m,disabled:u,onChange:e=>h(e.target.value)}),g&&(0,z.jsx)(`button`,{type:`button`,"aria-label":O(`insertValueInto`,{field:e}),className:`mt-1 text-xs font-medium text-primary-text hover:underline max-md:min-h-11`,onClick:()=>re({label:e,value:o,set:c}),children:O(`insertValue`)})]})},Lt=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Rt=e=>Array.isArray(e)?e.join(`, `):``,G=({state:e,names:t,problems:n,disabled:r,onChange:i})=>{let a=e.Catch??[],o=t=>{let{Catch:n,...r}=e;i(t.length>0?{...r,Catch:t}:r)},s=(e,t)=>o(a.map((n,r)=>r===e?t:n));return(0,z.jsxs)(z.Fragment,{children:[a.map((e,i)=>(0,z.jsxs)(`fieldset`,{className:`flex flex-col gap-3 rounded-md border border-danger/40 p-3`,children:[(0,z.jsx)(`legend`,{className:`px-1 text-xs font-medium text-danger-text`,children:O(`errorPathNumber`,{number:i+1})}),(0,z.jsx)(W,{label:O(`errors`),kind:`text`,help:O(`errorsHelp`),value:e.ErrorEquals??[],read:Lt,write:Rt,error:H(n,`Catch[${i}].ErrorEquals`),disabled:r,onChange:t=>s(i,{...e,ErrorEquals:t})}),(0,z.jsx)(U,{label:O(`thenGoesTo`),value:e.Next||void 0,names:t,none:O(`chooseStep`),error:H(n,`Catch[${i}].Next`),disabled:r,onChange:t=>s(i,{...e,Next:t??``})}),!r&&(0,z.jsxs)(p,{size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>o(a.filter((e,t)=>t!==i)),children:[(0,z.jsx)(_,{className:`size-3.5`}),O(`removeErrorPath`)]})]},i)),!r&&(0,z.jsx)(`div`,{children:(0,z.jsxs)(p,{size:`sm`,onClick:()=>o([...a,{ErrorEquals:[`States.ALL`],Next:``}]),children:[(0,z.jsx)(g,{className:`size-3.5`}),O(`addErrorPath`)]})})]})},zt=({state:e,names:t,problems:n,disabled:r,onChange:i})=>{let a=e.Choices??[],o=(t,n)=>i({...e,Choices:a.map((e,r)=>r===t?n:e)});return(0,z.jsxs)(z.Fragment,{children:[a.map((s,c)=>(0,z.jsxs)(`fieldset`,{className:`flex flex-col gap-3 rounded-md border p-3`,children:[(0,z.jsx)(`legend`,{className:`px-1 text-xs font-medium text-muted-foreground`,children:O(`ruleNumber`,{number:c+1})}),(0,z.jsx)(W,{label:O(`condition`),kind:`text`,help:O(`conditionHelp`),value:s.Condition,error:H(n,`Choices[${c}].Condition`),disabled:r,onChange:e=>o(c,{...s,Condition:typeof e==`string`?e:``})}),(0,z.jsx)(U,{label:O(`thenGoesTo`),value:s.Next||void 0,names:t,none:O(`chooseStep`),error:H(n,`Choices[${c}].Next`),disabled:r,onChange:e=>o(c,{...s,Next:e??``})}),!r&&(0,z.jsxs)(p,{size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>i({...e,Choices:a.filter((e,t)=>t!==c)}),children:[(0,z.jsx)(_,{className:`size-3.5`}),O(`removeRule`)]})]},c)),!r&&(0,z.jsx)(`div`,{children:(0,z.jsxs)(p,{size:`sm`,onClick:()=>i({...e,Choices:[...a,{Condition:``,Next:``}]}),children:[(0,z.jsx)(g,{className:`size-3.5`}),O(`addRule`)]})}),(0,z.jsx)(U,{label:O(`otherwiseGoesTo`),value:e.Default,names:t,none:O(`noDefault`),error:H(n,`Default`),disabled:r,onChange:t=>{let{Default:n,...r}=e;i(t===void 0?r:{...r,Default:t})}})]})},K=(e,t)=>{let{Cache:n,...r}=e;return t===void 0?r:{...r,Cache:t}},Bt=({state:e,types:t,disabled:n,onChange:r})=>{let[i,o]=(0,V.useState)(!1),s=_e(e,t);return s?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(l,{label:O(`cacheResults`),help:O(s.forces?`cacheForceHelp`:`cacheHelp`),children:(0,z.jsx)(a,{checked:s.on,onChange:t=>{if(!n){if(!t)return r(K(e,s.offValue));if(s.disclaimer)return o(!0);r(K(e,!0))}}})}),i&&(0,z.jsx)(m,{title:O(`cacheConfirmTitle`),description:s.disclaimer,onClose:()=>o(!1),actions:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(p,{onClick:()=>o(!1),children:O(`cacheCancel`)}),(0,z.jsx)(p,{variant:`primary`,onClick:()=>(o(!1),r(K(e,!0))),children:O(`cacheConfirm`)})]})})]}):null},Vt=(e,t,n)=>{let{[t]:r,...i}=e;return n==null||n===``?i:{...i,[t]:n}},Ht=(e,t)=>{let{type:n}=x(e.Resource);if(t){let{Cache:t,...r}=e;return{...r,Resource:`${n}${ye}`}}let{HeartbeatSeconds:r,TimeoutSeconds:i,...a}=e;return{...a,Resource:n,...i!==void 0&&i<=xe.taskTimeoutSeconds&&{TimeoutSeconds:i}}},Ut=e=>De(e)===void 0,Wt=(e,t)=>({...e,Resource:`${t}${x(e.Resource).waits&&Ut(t)?ye:``}`}),Gt=(e,t,n)=>{let{[t]:r,...i}=typeof e.Arguments==`object`&&e.Arguments!==null?e.Arguments:{};return{...e,Arguments:n===void 0?i:{...i,[t]:n}}},Kt=({state:e,types:t,problems:n,disabled:r,onChange:i})=>{let o=t.step_types.filter(e=>e.available),{type:s,waits:c}=x(e.Resource),u=Ut(s),f=t.step_types.find(e=>e.id===s),ee=typeof e.Arguments==`string`||!f;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(l,{label:O(`stepType`),error:H(n,`Resource`),children:(0,z.jsxs)(d,{value:s,disabled:r,onChange:t=>i(Wt(e,t.target.value)),children:[!o.some(e=>e.id===s)&&(0,z.jsx)(`option`,{value:s,children:he(s,f?.label)}),o.map(e=>(0,z.jsx)(`option`,{value:e.id,children:he(e.id,e.label)},e.id))]})}),ee?(0,z.jsx)(W,{label:O(`arguments`),kind:`json`,value:e.Arguments,error:H(n,`Arguments`),disabled:r,onChange:t=>i({...e,Arguments:t??{}})}):R(f.input).map(t=>(0,z.jsx)(W,{label:se(t.name,t.title),kind:t.kind,options:t.options,required:t.required,...t.kind===`names`&&{help:O(`namesHelp`)},value:e.Arguments?.[t.name],error:H(n,`Arguments.${t.name}`),disabled:r,onChange:n=>i(Gt(e,t.name,n))},`${s}:${t.name}`)),u&&(0,z.jsx)(l,{label:O(`waitsForResult`),help:O(`waitsForResultHelp`),children:(0,z.jsx)(a,{checked:c,onChange:t=>!r&&i(Ht(e,t))})}),c||!u?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(W,{label:O(`waitTimeout`),help:O(`waitTimeoutHelp`),kind:`json`,value:e.TimeoutSeconds,error:H(n,`TimeoutSeconds`),disabled:r,onChange:t=>i(Vt(e,`TimeoutSeconds`,t))}),(0,z.jsx)(W,{label:O(`heartbeatSeconds`),help:O(`heartbeatHelp`),kind:`json`,value:e.HeartbeatSeconds,error:H(n,`HeartbeatSeconds`),disabled:r,onChange:t=>i(Vt(e,`HeartbeatSeconds`,t))})]}):(0,z.jsx)(Bt,{state:e,types:t,disabled:r,onChange:i})]})},q=(e,t,n)=>{let{[t]:r,...i}=e;return n===void 0?i:{...i,[t]:n}},qt=({state:e,problems:t,disabled:n,onChange:r})=>(0,z.jsx)(W,{label:O(`onlyWhen`),kind:`text`,help:O(`onlyWhenHelp`),value:e.Condition,error:H(t,`Condition`),disabled:n,onChange:t=>r(q(e,`Condition`,t))}),J=e=>{let{state:t,names:n,problems:r,disabled:i,onChange:a}=e;if(e.data)return(0,z.jsx)(qt,{...e});let o=t;return(0,z.jsx)(U,{label:O(`goesOnTo`),value:o.Next,names:n,none:O(`endsHere`),error:H(r,`Next`)??H(r,`End`),disabled:i,onChange:e=>{let{Next:t,End:n,...r}=o;a(e===void 0?{...r,End:!0}:{...r,Next:e})}})},Jt=e=>{let{state:t,types:n,problems:r,disabled:i,onChange:a}=e,o=(e,n,o,s)=>(0,z.jsx)(W,{label:n,kind:o,help:s,value:t[e],error:H(r,e),disabled:i,onChange:n=>a(q(t,e,n))});if(t.Type===`Task`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Kt,{state:t,types:n,problems:r,disabled:i,onChange:a}),(0,z.jsx)(J,{...e}),!e.data&&(0,z.jsx)(G,{...e,state:t})]});if(t.Type===`Choice`)return(0,z.jsx)(zt,{...e,state:t});if(t.Type===`Map`)return(0,z.jsxs)(z.Fragment,{children:[o(`Items`,O(`items`),`json`,O(`itemsHelp`)),o(`MaxConcurrency`,O(`maxConcurrency`),`json`),(0,z.jsx)(J,{...e}),!e.data&&(0,z.jsx)(G,{...e,state:t})]});if(t.Type===`Block`){let n=(e,n,o,s)=>(0,z.jsx)(W,{label:n,kind:o,help:s,value:t.Cache?.[e],error:H(r,`Cache.${e}`)??(e===`Ttl`?H(r,`Cache`):void 0),disabled:i,onChange:n=>a({...t,Cache:q(t.Cache??{Ttl:``},e,n)})});return(0,z.jsxs)(z.Fragment,{children:[o(`Arguments`,O(`blockArguments`),`json`,O(`blockArgumentsHelp`)),n(`Ttl`,O(`blockTtl`),`text`,O(`blockTtlHelp`)),n(`Key`,O(`blockKey`),`json`,O(`blockKeyHelp`)),(0,z.jsx)(J,{...e}),!e.data&&(0,z.jsx)(G,{...e,state:t})]})}return t.Type===`Wait`?(0,z.jsxs)(z.Fragment,{children:[o(`Seconds`,O(`seconds`),`json`),(0,z.jsx)(J,{...e})]}):t.Type===`Pass`?(0,z.jsxs)(z.Fragment,{children:[o(`Output`,O(`output`),`json`,O(`outputHelp`)),(0,z.jsx)(J,{...e})]}):t.Type===`Succeed`?o(`Output`,O(`output`),`json`,O(`outputHelp`)):t.Type===`Fail`?(0,z.jsxs)(z.Fragment,{children:[e.data&&(0,z.jsx)(qt,{...e}),o(`Error`,O(`error`),`text`),o(`Cause`,O(`cause`),`text`)]}):null},Yt=(e,t,n,r)=>{let{[n]:i,...a}=t;return{[e]:r===void 0?a:{...a,[n]:r}}},Xt=({trigger:e,types:t,problems:n,disabled:r,onChange:i})=>{let a=de(e),o=t.triggers.filter(e=>e.available),s=o.find(e=>e.id===a),c=a!==void 0&&!s?a:void 0,u=a===void 0?{}:e[a]??{};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(l,{label:O(`startsWhen`),error:H(n,`trigger`),help:c&&O(`triggerOtherHelp`),children:(0,z.jsxs)(d,{value:a??``,disabled:r,onChange:e=>i({[e.target.value]:{}}),children:[c!==void 0&&(0,z.jsx)(`option`,{value:c,children:ue(c,t.triggers.find(e=>e.id===c)?.label)}),a===void 0&&(0,z.jsx)(`option`,{value:``,children:O(`triggerUnknown`)}),o.map(e=>(0,z.jsx)(`option`,{value:e.id,children:ue(e.id,e.label)},e.id))]})}),s&&R(s.input).map(e=>(0,z.jsx)(W,{label:se(e.name,e.title),kind:e.kind,options:e.options,required:e.required,...e.kind===`names`&&{help:O(`namesHelp`)},value:u[e.name],error:H(n,`trigger.${s.id}.${e.name}`),disabled:r,onChange:t=>i(Yt(s.id,u,e.name,t))},`${s.id}:${e.name}`)),c!==void 0&&(0,z.jsx)(W,{label:O(`triggerInput`),kind:`json`,value:u,error:H(n,`trigger.${c}`),disabled:!0,onChange:()=>void 0})]})},Zt=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&typeof e.Type==`string`,Qt=({kind:e,name:t})=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,z.jsx)(`h3`,{className:`truncate font-semibold text-foreground`,children:t})]}),$t=({definition:e,types:t,selected:n,problems:r,warnings:i=[],onChange:a,onSelect:o})=>{let s=w(e,n);if(!s)return null;let{scope:c,name:l}=T(n),u=D(e,c),d=!a,f=e=>a?.(e);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Qt,{kind:ve(s,t),name:l}),(0,z.jsx)(B,{problems:r}),(0,z.jsx)(Dt,{warnings:i}),(0,z.jsx)(Ot,{name:l,taken:Me(e.stateMachine),disabled:d,onRename:t=>{f(gt(e,n,t)),o(je(c,t))}},n),(0,z.jsx)(Jt,{state:s,types:t,names:Object.keys(u.States),problems:r,disabled:d,data:b(e)===`data`,onChange:t=>f(ft(e,n,t))}),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-body font-medium text-muted-foreground`,children:O(`asJson`)}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(W,{label:O(`stepJson`),kind:`json`,help:O(`stepJsonHelp`),value:s,disabled:d,onChange:t=>{Zt(t)&&f(ft(e,n,t))}},n)})]}),a&&(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[b(e)===`sequence`&&u.StartAt!==l&&(0,z.jsxs)(p,{size:`sm`,onClick:()=>f(_t(e,n)),children:[(0,z.jsx)(Ve,{className:`size-3.5`}),O(`startHere`)]}),(0,z.jsxs)(p,{size:`sm`,variant:`danger`,onClick:()=>{f(lt(e,n)),o(void 0)},children:[(0,z.jsx)(_,{className:`size-3.5`}),O(`removeStep`)]})]})]})},en=e=>{let{definition:t,types:n,selected:r,problems:i,onChange:a}=e;return(0,z.jsx)(`section`,{"aria-label":O(`chosenStep`),className:`flex flex-col gap-4 rounded-lg border bg-background p-4`,children:r===``?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Qt,{kind:O(`trigger`),name:pe(t.trigger,n)}),(0,z.jsx)(B,{problems:i}),(0,z.jsx)(Xt,{trigger:t.trigger,types:n,problems:i,disabled:!a,onChange:e=>a?.(vt(t,e))})]}):(0,z.jsx)($t,{...e,selected:r})})},tn=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Y=(e,t,n,r)=>{let i=structuredClone(e),{scope:a,name:o}=T(t),s=D(i,a)?.States[o];if(s&&n[0]===`#condition`)return r===void 0?delete s.Condition:s.Condition=r,i;if(!s||s.Type!==`Task`)return e;tn(s.Arguments)||(s.Arguments={});let c=s.Arguments;for(let e of n.slice(0,-1))tn(c[e])||(c[e]={}),c=c[e];let l=n.at(-1);return r===void 0?delete c[l]:c[l]=r,i},nn=e=>[`=`,`!=`,`>`,`<`,`matches`,`and`,`or`,`not`,...e?[`expression`]:[]],rn=e=>e.kind===`compare`||e.kind===`matches`?{value:``}:{value:e.kind===`logic`&&e.op===`and`},an=e=>e===`not`?{kind:`not`,sides:[{value:!1}]}:e===`and`||e===`or`?{kind:`logic`,op:e,sides:[{value:e===`and`},{value:e===`and`}]}:e===`matches`?{kind:`matches`,sides:[{value:``},{pattern:`.*`,flags:``}]}:{kind:`compare`,op:e,sides:[{value:``},{value:``}]},on=`{% true %}`,sn=(e,t)=>{if(t.length===0)return e;let n=e.sides[t[0]];return n&&y(n)?sn(n,t.slice(1)):void 0},X=(e,t,n)=>({...e,sides:e.sides.map((e,r)=>r===t?n:e)}),Z=(e,t,n)=>{if(t.length===0)return n(e);let r=e.sides[t[0]],i=r&&y(r)?Z(r,t.slice(1),n):void 0;return i&&X(e,t[0],i)},cn=(e,t,n)=>{if(e.kind===`logic`&&t===e.sides.length)return{...e,sides:[...e.sides,n]};if(!(t>=e.sides.length)){if(e.kind===`matches`&&t===1)return!y(n)&&`value`in n&&typeof n.value==`string`?X(e,1,{pattern:n.value||`.*`,flags:e.sides[1].flags}):void 0;if(e.kind!==`compare`&&e.kind!==`matches`||!y(n))return X(e,t,n)}},ln=(e,t,n,r)=>{let i=S(w(e,t)?.Condition),a=i&&n.length>0&&Z(i,n.slice(0,-1),e=>cn(e,n.at(-1),r));return a&&S(C(a))?Y(e,t,[E],C(a)):e},un=(e,t,n,r)=>{let i=w(e,t)?.Condition;if(n.length===0)return i!==void 0&&i!==``?e:Y(e,t,[E],r===`expression`?on:C(an(r)));let a=S(i),o=a&&sn(a,n.slice(0,-1)),s=n.at(-1),c=o?.sides[s],l=o?.kind===`logic`&&s===o.sides.length;return r===`expression`||!o||o.kind===`compare`||o.kind===`matches`||!l&&(!c||y(c)||!(`value`in c))?e:ln(e,t,n,an(r))},dn=(e,t,n)=>{if(n.length===0)return Y(e,t,[E],void 0);let r=S(w(e,t)?.Condition),i=n.at(-1),a=r&&Z(r,n.slice(0,-1),e=>{if(!(i>=e.sides.length))return e.kind===`logic`&&e.sides.length>2?{...e,sides:e.sides.filter((e,t)=>t!==i)}:cn(e,i,rn(e))});return a?Y(e,t,[E],C(a)):e},fn=e=>{let t=[];if(`Next`in e&&e.Next!==void 0&&t.push(e.Next),e.Type===`Choice`){for(let n of e.Choices??[])t.push(n.Next);e.Default!==void 0&&t.push(e.Default)}if(`Catch`in e)for(let n of e.Catch??[])n.Next!==void 0&&t.push(n.Next);return t},pn=(e,t)=>{let n=new Set,r=[t];for(;r.length>0;){let t=r.shift(),i=e.States[t];!n.has(t)&&i&&(n.add(t),r.push(...fn(i)))}return[...n]},mn=e=>e.StartAt===void 0?Object.keys(e.States):pn(e,e.StartAt),hn=e=>{if(e.Resource!==`app:http`||typeof e.Arguments!=`object`||e.Arguments===null)return!1;let t=e.Arguments.method;return t===void 0||typeof t==`string`&&t.toUpperCase()===`GET`},gn=(e,t,n)=>t.flatMap(t=>{let r=e.States[t];if(!r)return[];let i=v(r),a=i?gn(i,mn(i),n):[];return r.Type===`Task`?(n?.step_types.find(e=>e.id===r.Resource)?.writes??!0)===!1||hn(r)?[]:[{name:t,kind:ve(r,n)}]:a}),_n=(e,t)=>{if(!e||t||!(`Assign`in e)||!e.Assign)return e;let n=Object.fromEntries(Object.entries(e.Assign).filter(([,e])=>e!==Ee)),{Assign:r,...i}=e;return Object.keys(n).length===0?i:{...i,Assign:n}},vn=(e,t,n)=>{let r=e?.stateMachine.States[n],i=r!==void 0&&`Output`in r;return JSON.stringify(_n(r,i))!==JSON.stringify(_n(t.stateMachine.States[n],i))},yn=(e,t)=>{let n=Se(e),r=new Set([t]);for(let e=!0;e;){e=!1;for(let[t,i]of n)!r.has(t)&&[...Te(i)].some(e=>r.has(e))&&(r.add(t),e=!0)}return Object.keys(e.States).filter(e=>r.has(e))},bn=(e,t,n=e.stateMachine.StartAt)=>{let r=e.stateMachine;return gn(r,b(e)===`data`?n===void 0?mn(r):yn(r,n):n===void 0?mn(r):pn(r,n),t)},xn=/^[A-Za-z_][A-Za-z0-9_]*$/,Sn=e=>xn.test(e)?e:`\`${e.replaceAll("`",``)}\``,Cn=e=>{let t=JSON.stringify(e)??``;return t.length>60?`${t.slice(0,59)}…`:t},wn=100,Tn=4,En=e=>{let t=[{path:``,sample:Cn(e)}],n=(e,r,i)=>{if(!(i===Tn||typeof r!=`object`||!r||t.length>=wn)){if(Array.isArray(r)){if(r.length===0)return;let a=`${e}[0]`;t.push({path:a,sample:Cn(r[0])}),n(a,r[0],i+1);return}for(let[a,o]of Object.entries(r)){let r=e===``?Sn(a):`${e}.${Sn(a)}`;t.push({path:r,sample:Cn(o)}),n(r,o,i+1)}}};return n(``,e,0),t.slice(0,wn)},Dn=(e,t)=>t===``?e:`${e}${t.startsWith(`[`)?``:`.`}${t}`,On=(e,t)=>{if(e==null||e===``)return`{% ${t} %}`;if(typeof e!=`string`)throw Error(`A value is inserted only into a field that holds text`);let n=/^\{%([\s\S]*)%\}$/.exec(e.trim());return n?`{% (${n[1].trim()}) & ${t} %}`:`{% ${JSON.stringify(e)} & ${t} %}`},kn=(e,t)=>{let{scope:n,name:r}=T(t),i=(e,t,n)=>Object.keys(e.States).filter(n=>n!==t&&pn(e,n).includes(t)).filter(t=>[`Task`,`Map`,`Block`].includes(e.States[t].Type)).map(e=>[...n,e].join(`/`)),a=i(D(e,n),r,n),o=n.findLastIndex((t,r)=>D(e,n.slice(0,r))?.States[n[r]]?.Type===`Block`);return[...n.flatMap((t,r)=>r<=o?[]:i(D(e,n.slice(0,r)),t,n.slice(0,r))),...a]},An=`{% $states.result %}`,jn=(e,t)=>{let{scope:n,name:r}=T(t),i=D(e,n)?.States[r];return i!==void 0&&`Output`in i},Mn=e=>`Assign`in e&&e.Assign?e.Assign:{},Nn=e=>Object.values(e.States).flatMap(e=>[...Object.keys(Mn(e)),...v(e)?Nn(v(e)):[]]),Pn=(e,t)=>{let n=t.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).replace(/^(\d)/,`step_$1`)||`value`,r=new Set(Nn(e.stateMachine));if(!r.has(n))return n;let i=2;for(;r.has(`${n}_${i}`);)i++;return`${n}_${i}`},Fn=(e,t)=>{let{scope:n,name:r}=T(t),i=D(e,n).States[r],a=Object.entries(Mn(i)).find(([,e])=>e===An);if(a)return{definition:e,variable:a[0],added:!1};let o=Pn(e,r),s=structuredClone(e),c=D(s,n).States[r];return c.Assign={...c.Assign,[o]:An},{definition:s,variable:o,added:!0}},Q=(e,t)=>e.pure.find(e=>e.id===t),In=(e,t)=>{let n=me(t.handle);if(!n)return;let r=Q(e,t.node);return r?r.kind===`break`?{node:r.source,path:[...r.path,...n]}:void 0:{node:t.node,path:n}},Ln=(e,t)=>{let n=oe(t.handle);if(n===void 0)return;let r=Q(e,t.node);if(!r)return e.inputs.has(t.node)?{step:t.node,keys:[n]}:void 0;if(r.kind===`make`)return{step:r.target,keys:[r.key,n]};if(r.kind===`select`)return{step:r.target,keys:[r.key],select:r};if((r.kind!==`condition`||r.part.kind!==`matches`||n!==`1`)&&r.kind===`condition`&&r.part.kind!==`expression`)return{step:r.target,keys:[E],side:{node:r,at:[...r.at,Number(n)]}}},Rn=(e,t)=>e.path.length===1&&e.path[0]===`#status`&&t.keys.length===1&&t.keys[0]===`#condition`&&!t.side,zn=(e,t,n)=>{let r=Q(e,t.node);if(n===`out`){let n=me(t.handle);return(r?.kind===`break`?r.outputs:e.outputs.get(t.node)??[]).find(e=>JSON.stringify(e.path)===JSON.stringify(n))?.type}let i=oe(t.handle);if(!(r?.kind===`condition`&&r.part.kind===`compare`||r?.kind===`select`))return(r?.kind===`make`||r?.kind===`condition`?r.inputs:e.inputs.get(t.node)??[]).find(e=>e.key===i)?.type},Bn=(e,t)=>T(t).scope.some((t,n,r)=>w(e,r.slice(0,n+1).join(`/`))?.Type===`Block`),Vn=(e,t)=>{let{scope:n}=T(t);for(let t=n.length;t>0;t--)if(w(e,n.slice(0,t).join(`/`))?.Type===`Block`)return n.slice(0,t).join(`/`)},Hn=(e,t,n)=>{let{scope:r,name:i}=T(t);if(T(n).scope.join(`/`)!==r.join(`/`))return!1;let a=Se(D(e,r)),o=new Set,s=[i];for(;s.length>0;){let e=s.pop();if(e===T(n).name)return!0;o.has(e)||(o.add(e),s.push(...Te(a.get(e)??{data:new Set,status:new Set,handled:new Set})))}return!1},Un=(e,t,n,r)=>{let i=In(t,n),a=Ln(t,r);if(!i||!a)return{reason:`notPins`};let o=Vn(e,a.step);if(o!==void 0&&i.node!==``&&!i.node.startsWith(`${o}/`))return{reason:`otherScope`,step:T(i.node).name};if(b(e)===`data`&&i.node!==``){let[t,n]=[T(i.node).scope.join(`/`),T(a.step).scope.join(`/`)];if(t!==``&&t!==n&&!n.startsWith(`${t}/`))return{reason:`otherScope`,step:T(i.node).name};if(Hn(e,i.node,a.step))return{reason:`notBefore`,step:T(i.node).name};if(i.path[0]!==`#status`&&jn(e,i.node))return{reason:`shapesOutput`,step:T(i.node).name}}else if(i.node===``){if(Bn(e,a.step))return{reason:`notBefore`,step:T(a.step).name}}else{if(!kn(e,a.step).includes(i.node))return{reason:`notBefore`,step:T(i.node).name};if(jn(e,i.node))return{reason:`shapesOutput`,step:T(i.node).name}}if(Rn(i,a))return;let s=zn(t,n,`out`),c=zn(t,r,`in`);if(s&&c&&!be(s,c))return{reason:`type`,source:s,target:c}},Wn=(e,t,n,r)=>{if(Un(e,t,n,r))return e;let i=In(t,n),a=Ln(t,r),o=e,s;if(i.node===``)s={base:{input:!0},path:i.path};else if(i.path[0]===`#status`)s={base:{step:T(i.node).name},path:i.path.slice(1)};else{let t=Fn(e,i.node);o=t.definition,s={base:{variable:t.variable},path:i.path}}let c=`step`in s.base&&s.path.length===0?{...s,path:[`Status`]}:s;return a.side?ln(o,a.step,a.side.at,{read:c}):a.select?Y(o,a.step,a.keys,ke({...a.select.part,operand:{read:c}})):Rn(i,a)?Y(o,a.step,a.keys,C({kind:`compare`,op:`=`,sides:[{read:c},{value:`SUCCEEDED`}]})):Y(o,a.step,a.keys,Ae(s))},Gn=(e,t,n)=>{let r=Ln(t,{node:n.target,handle:n.targetHandle});if(r?.side)return dn(e,r.step,r.side.at);if(r?.select)return Y(e,r.step,r.keys,ke({...r.select.part,operand:{value:``}}));if(r)return Y(e,r.step,r.keys,void 0);let i=Q(t,n.target)??Q(t,n.source);return i?Kn(e,t,i):e},Kn=(e,t,n)=>{if(n.kind===`make`||n.kind===`select`)return Y(e,n.target,[n.key],void 0);if(n.kind===`condition`)return dn(e,n.target,n.at);let r=e=>t.edges.filter(t=>t.source===e.id&&!t.expression).flatMap(e=>{let n=Q(t,e.target);return n?.kind===`break`?r(n):[e]});return ge(t,r(n),e=>fe(t,e)).reduce((e,n)=>Gn(e,t,n),e)},qn=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`,Jn={connect:ut,disconnect:dt,removeState:lt,setArgument:Y,connectData:Wn,disconnectData:Gn,removePure:Kn,wireRefusal:Un,addCondition:un,conditionChoices:nn,setConditionSide:ln,addSelect:(e,t,n)=>{let r=w(e,t)?.Arguments?.[n];if(r!==void 0&&!qn(r)||typeof r==`string`&&r.startsWith(`{%`))return e;let i=r??``;return Y(e,t,[n],ke({operand:{value:``},cases:[{when:``,then:i}],otherwise:i}))}},Yn=(e,t,n={})=>({inputs:Object.fromEntries(e.step_types.map(e=>[e.id,e.input])),outputs:Object.fromEntries([...e.step_types,...e.triggers].flatMap(e=>e.output?[[e.id,e.output]]:[])),records:(e,r)=>{let i=t[e];return i&&Le(i,r,n[e]?.names?.singular??re(e),Re(e=>t[e]))},emails:t=>{let n=e.templates?.find(e=>e.name===t);return n&&{schema:n.schema,languages:n.languages}}}),Xn=e=>{let{data:t}=ne();return(0,V.useMemo)(()=>Yn(e,t?.resources??{},t?.views),[e,t?.resources,t?.views])},$=c(`app/field-types/workflow-page`),Zn={"app:http":{icon:Ge,keywords:[`api`,`fetch`,`url`,`webhook`,`get`,`post`]},"app:mail.send":{icon:h,keywords:[`email`,`send`,`message`]},"app:records.create":{icon:k,keywords:[`insert`,`add`,`new`,`row`]},"app:records.update":{icon:k,keywords:[`change`,`edit`,`row`]},"app:records.get":{icon:k,keywords:[`read`,`find`,`row`]},"app:records.list":{icon:k,keywords:[`read`,`find`,`query`,`rows`]}},Qn=[{type:`Choice`,icon:Ue,description:()=>$(`flowChoice`),keywords:[`if`,`branch`,`switch`,`condition`]},{type:`Map`,icon:Ye,description:()=>$(`flowMap`),keywords:[`loop`,`each`,`list`,`repeat`]},{type:`Block`,icon:i,description:()=>$(`flowBlock`),keywords:[`cache`,`once`,`group`,`reuse`,`wrap`]},{type:`Wait`,icon:Ze,description:()=>$(`flowWait`),keywords:[`delay`,`sleep`,`pause`,`later`]},{type:`Pass`,icon:qe,description:()=>$(`flowPass`),keywords:[`variable`,`assign`,`transform`]},{type:`Succeed`,icon:s,description:()=>$(`flowSucceed`),keywords:[`end`,`stop`,`done`]},{type:`Fail`,icon:o,description:()=>$(`flowFail`),keywords:[`end`,`stop`,`error`]}],$n=e=>({id:`task:${e.id}`,title:le(e.id,e.label),description:e.description,keywords:[e.id,...Zn[e.id]?.keywords??[]],icon:Zn[e.id]?.icon??(e.id.startsWith(`app:`)?f:ie)}),er=e=>e.slice(0,Math.max(e.indexOf(`:`),0)),tr=e=>e===`custom`?$(`customSteps`):e,nr=e=>{let t=new Set(Object.values(Oe(e.step_types.map(e=>e.id)))),n=e.step_types.filter(e=>e.available&&(!De(e.id)||t.has(e.id))),r=[...new Set(n.map(e=>er(e.id)).filter(e=>e!==`app`))];return[{title:$(`builtIn`),items:n.filter(e=>er(e.id)===`app`).map($n)},...r.map(e=>({title:tr(e),items:n.filter(t=>er(t.id)===e).map($n)})),{title:$(`flow`),items:Qn.map(e=>({id:`type:${e.type}`,title:ce(e.type),description:e.description(),keywords:e.keywords,icon:e.icon}))}].filter(e=>e.items.length>0)},rr=e=>e.startsWith(`task:`)?{task:e.slice(5)}:{type:e.slice(5)};export{mt as A,ot as C,it as D,Qe as E,tt as O,P as S,st as T,Tt as _,Jn as a,Et as b,En as c,On as d,vn as f,B as g,Nt as h,Xn as i,nt as k,jn as l,en as m,nr as n,kn as o,bn as p,$ as r,Dn as s,rr as t,Fn as u,bt as v,at as w,xt as x,St as y};
|
|
2
|
+
//# debugId=24c4ea8b-5481-40c3-b00b-bd3b98f981c3
|
|
@@ -1,2 +1,2 @@
|
|
|
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{$
|
|
2
|
-
//# debugId=
|
|
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{$o as r,Qc as i,Rn as a,Wc as o,Zi as s,is as c,lc as l,tl as u,uc as d,zr as f}from"./app-C8DagobC.js";import{l as p,m,n as h,u as g}from"./workflow-canvas-DgWBX54L.js";import{m as _}from"./workflows-Bey4jszG.js";import{E as v,T as y,n as b}from"./use-run-trace-DYU4WZ6w.js";var x=e(t(),1),S=e=>e===``?[]:e.split(`/`).map(t=>{let n=/^(.*)\.\d+\[(\d+)\]$/.exec(t);if(!n)throw Error(`"${e}" is not a step's scope`);return{map:decodeURIComponent(n[1]),index:Number(n[2])}}),C=(e,t)=>[...S(e).map(e=>e.map),t].join(`/`),w={succeeded:0,caught:1,retrying:2,failed:3,current:4},T=(e,{inProgress:t,startAt:n,within:r=[]})=>{let i=(e,t)=>[...r,C(e,t)].join(`/`),a=new Map,o=new Map,s=new Map;for(let t of e){let e=i(t.scope,t.state);a.set(e,(a.get(e)??0)+1),o.set(`${t.scope}\n${t.state}`,t),s.set(t.scope,t)}let c=new Map,l=(e,t)=>{let n=c.get(e);(n===void 0||w[t]>w[n])&&c.set(e,t)};for(let e of o.values())l(i(e.scope,e.state),e.status);if(t){!s.has(``)&&n&&l([...r,n].join(`/`),`current`);for(let e of s.values())e.status!==`retrying`&&e.next!==null&&l(i(e.scope,e.next),`current`)}return new Map([...c].map(([e,t])=>[e,{status:t,steps:a.get(e)??0}]))},E=i(`app/field-types/workflow-run`),D=e(n(),1),O=({title:e,children:t})=>(0,D.jsxs)(`div`,{className:`grid gap-1`,children:[(0,D.jsx)(`h5`,{className:`text-xs font-medium text-muted-foreground`,children:e}),t]}),k=e=>new Intl.DateTimeFormat(u(),{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).format(Date.parse(e)),A=({logs:e})=>(0,D.jsx)(`ol`,{className:`grid gap-0.5 rounded-md bg-muted/60 px-3 py-2 font-mono text-xs`,children:e.map((e,t)=>(0,D.jsxs)(`li`,{className:`whitespace-pre-wrap break-words`,children:[(0,D.jsx)(`time`,{dateTime:e.at,className:`text-muted-foreground`,children:k(e.at)}),` `,e.message]},t))}),j=({step:e,runId:t,valueActions:n})=>{let i=c(),l=typeof e.type==`string`&&_(e.type)!==void 0&&i.resources.workflow_custom_step_jobs!==void 0&&i.permissions.workflow_custom_step_jobs?.read!==!1,u=e.logs?.some(e=>e.message===`Not sent: replay`)??!1,m=S(e.scope),g=e.output!==void 0&&e.output!==null&&(0,D.jsxs)(O,{title:E(`output`),children:[(0,D.jsx)(a,{value:e.output}),n?.(e.output,`output`)]});return(0,D.jsxs)(`article`,{"aria-label":E(`stepTry`,{attempt:e.attempt}),className:`grid gap-3 rounded-lg border bg-background p-3`,children:[(0,D.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-body`,children:[(0,D.jsx)(`span`,{className:`font-medium text-foreground`,children:E(`stepTry`,{attempt:e.attempt})}),m.map((e,t)=>(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:E(`itemOf`,{index:e.index+1,map:e.map})},t)),(0,D.jsx)(r,{tone:h[e.status],children:p(e.status)}),u&&(0,D.jsx)(r,{tone:`violet`,children:E(`notSent`)}),e.reused===!0&&(0,D.jsx)(r,{tone:`blue`,children:E(`reused`)}),e.joined===!0&&(0,D.jsx)(r,{tone:`blue`,children:E(`joined`)}),(0,D.jsx)(`time`,{dateTime:e.started_at,className:`text-muted-foreground`,children:s(Date.parse(e.started_at))}),(0,D.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:E(`duration`,{ms:Number(e.duration_ms??0)})})]}),e.error!=null&&(0,D.jsx)(O,{title:E(`error`),children:(0,D.jsxs)(`p`,{className:`text-body text-danger-text`,children:[(0,D.jsx)(`span`,{className:`font-mono`,children:String(e.error)}),e.cause!=null&&(0,D.jsxs)(`span`,{children:[`: `,String(e.cause)]})]})}),typeof e.run==`string`&&(0,D.jsxs)(`div`,{className:`grid gap-1`,children:[e.reused===!0&&(0,D.jsx)(`p`,{className:`text-body text-muted-foreground`,children:E(`reusedResult`)}),e.joined===!0&&(0,D.jsx)(`p`,{className:`text-body text-muted-foreground`,children:E(`joinedResult`)}),(0,D.jsx)(f,{to:{kind:`record`,resource:`workflow_runs`,key:e.run},className:o(d({size:`sm`}),`justify-self-start`),children:e.reused===!0?E(`openEarlierBlockRun`):E(`openBlockRun`)})]}),l&&(0,D.jsx)(f,{to:{kind:`list`,resource:`workflow_custom_step_jobs`,filter:`run_id = "${t}"`},className:o(d({size:`sm`}),`justify-self-start`),children:E(`openJobs`)}),e.status!==`failed`&&g,e.input!==void 0&&e.input!==null&&(0,D.jsxs)(O,{title:E(`input`),children:[(0,D.jsx)(a,{value:e.input}),n?.(e.input,`input`)]}),e.status===`failed`&&g,e.assigned!=null&&(0,D.jsx)(O,{title:E(`variables`),children:(0,D.jsx)(a,{value:e.assigned})}),e.logs&&e.logs.length>0&&(0,D.jsx)(O,{title:E(`logs`),children:(0,D.jsx)(A,{logs:e.logs})})]})},M=({kind:e,name:t})=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,D.jsx)(`h4`,{className:`truncate font-semibold text-foreground`,children:t})]}),N=({run:e,name:t,block:n,valueActions:r})=>{let i=b(e.id,!1),[a,o]=(0,x.useState)(20);if(i.isPending)return null;let s=(i.data??[]).filter(e=>e.state===t),c=n===void 0?void 0:(i.data??[]).filter(e=>e.state===n&&typeof e.run==`string`).at(-1)?.run;return s.length===0&&typeof c==`string`?(0,D.jsxs)(`div`,{className:`grid gap-2 text-body text-muted-foreground`,children:[(0,D.jsx)(`p`,{children:E(`ranInBlockRun`,{block:n})}),(0,D.jsx)(f,{to:{kind:`record`,resource:`workflow_runs`,key:c},className:d({size:`sm`})+` justify-self-start`,children:E(`openBlockRun`)})]}):s.length===0?(0,D.jsx)(`p`,{className:`text-body text-muted-foreground`,children:E(`notRun`)}):(0,D.jsxs)(`div`,{className:`grid gap-3`,children:[s.slice(0,a).map(t=>(0,D.jsx)(j,{step:t,runId:e.id,...r&&{valueActions:r}},String(t.id))),s.length>a&&(0,D.jsx)(l,{size:`sm`,className:`justify-self-start`,onClick:()=>o(a+20),children:E(`showMore`)})]})},P=({definition:e,run:t,selected:n,types:r})=>{let i=n===``?void 0:v(e,n);return(0,D.jsx)(`section`,{"aria-label":E(`chosenStep`),className:`grid gap-3 rounded-lg border bg-surface p-4`,children:i?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(M,{kind:g(i,r),name:y(n).name}),(0,D.jsx)(N,{run:t,name:y(n).name})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(M,{kind:E(`trigger`),name:m(e.trigger,r)}),(0,D.jsx)(O,{title:E(`runInput`),children:(0,D.jsx)(a,{value:t.input??null})})]})})};export{T as a,E as i,P as n,C as o,O as r,N as t};
|
|
2
|
+
//# debugId=0fd1b4fa-6f8a-4a66-861d-fbec09146da3
|
|
@@ -0,0 +1,2 @@
|
|
|
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{Ea as r,Oa as i,Qi as a,Wc as o,Xi as s,aa as c,as as l,ea as u,fi as d,gr as ee,na as f,oc as p,sa as m,ta as h,ua as g,ul as _,vi as v}from"./app-C8DagobC.js";import{_ as y,a as te,i as ne,n as re,o as b,t as x,v as ie}from"./lib-dnd-kit-core-xi-7xL_N.js";import{a as ae,g as S,h as C,i as w,l as oe,m as T,n as se,o as E,r as ce,t as le,u as D,v as O}from"./use-calendar-move-BTlYPun1.js";var k=e(t(),1),A=864e5,j=e=>Date.parse(`${e}T00:00:00Z`),M=(e,t=0)=>{let n=new Date(j(e));return new Date(Date.UTC(n.getUTCFullYear(),Math.floor(n.getUTCMonth()/3)*3+3*t,1)).toISOString().slice(0,10)},N=({scale:e,day:t})=>({scale:e,day:e===`week`?C(t):e===`month`?S(t):M(t)}),P=(e,t,n=g())=>N(e??{scale:`month`,day:m(t,n)}),F=(e,t)=>{let{scale:n,day:r}=N(e);return{scale:n,day:n===`week`?D(r,7*t):n===`month`?S(r,t):M(r,t)}},I=e=>{let t=N(e).day,n=(j(F(e,1).day)-j(t))/A;return Array.from({length:n},(e,n)=>D(t,n))},ue=e=>({from:N(e).day,to:F(e,1).day}),de=(e,t,n,r=g())=>{let i=m(n,r),a=I(e);return N({scale:t,day:i>=a[0]&&i<=a.at(-1)?i:a[0]})},L=e=>{let t=I(e);return e.scale===`week`?a(j(t[0]),j(t.at(-1))):e.scale===`month`?u(j(t[0])):f(j(t[0]),j(S(t.at(-1))))},R=e=>{let t=I(e);if(e.scale===`week`)return t.map((e,t)=>({index:t,span:1,label:`${c(j(e))} ${Number(e.slice(8))}`}));if(e.scale===`month`)return t.map((e,t)=>({index:t,span:1,label:String(Number(e.slice(8))),...t%7!=0&&{minor:!0}}));let n=t.flatMap((e,t)=>e.endsWith(`-01`)?[t]:[]);return n.map((e,r)=>({index:e,span:(n[r+1]??t.length)-e,label:h(j(t[e]))}))},z=(e,t,n,r,i=g())=>{let a=O(e,t,n,i),o=r[0],s=r.at(-1);if(!(!a||o===void 0||s===void 0||a.last<o||a.first>s))return{first:a.first<o?0:r.indexOf(a.first),last:a.last>s?r.length-1:r.indexOf(a.last),before:a.first<o,after:a.last>s,start:a.first}},B=`none`,V=(e,t,n,r)=>{let i=r.group,a=i===void 0?void 0:t.fields[i];if(i===void 0||!a)return[{key:``,rows:e}];let o=n?.fields[i],s=new Map;for(let t of e){let e=t.record[i],n=e==null||e===``,r=n?B:`value:${String(e)}`,c=n?d(`noValue`,{label:o?.label??_(i)}):t.labels[i]??v(a,e,o),l=s.get(r)??{value:n?void 0:e,lane:{key:r,label:c,rows:[]}};l.lane.rows.push(t),s.set(r,l)}let c=a.enumValues??[],l=(e,t)=>e.value===void 0||t.value===void 0?Number(e.value===void 0)-Number(t.value===void 0):a.type===`enum`?c.indexOf(String(e.value))-c.indexOf(String(t.value)):a.type===`relation`?e.lane.label.localeCompare(t.lane.label):typeof e.value==`number`&&typeof t.value==`number`?e.value-t.value:String(e.value).localeCompare(String(t.value),void 0,{numeric:!0});return[...s.values()].toSorted(l).map(({lane:e})=>e)},H=e(n(),1),U=`grid grid-cols-1 sm:grid-cols-[12rem_minmax(0,1fr)]`,W=(e,t)=>`${e/t*100}%`,fe=({ticks:e,days:t,today:n,label:r,trackRef:i})=>(0,H.jsxs)(`div`,{className:o(U,`border-b border-border bg-surface`),children:[(0,H.jsx)(`span`,{className:`hidden truncate px-2 py-1 text-xs font-medium text-muted-foreground sm:block`,children:r}),(0,H.jsx)(`div`,{ref:i,"aria-hidden":!0,className:`relative h-6`,children:e.map(e=>(0,H.jsx)(`span`,{className:o(`absolute inset-y-0 items-center truncate px-1 text-xs tabular-nums text-muted-foreground`,e.index>0?`border-l border-border`:`border-border sm:border-l`,e.minor?`hidden sm:flex`:`flex`,e.span===1&&t[e.index]===n&&`font-medium text-primary`),style:{left:W(e.index,t.length),width:W(e.span,t.length)},children:e.label},e.index))})]}),pe=({ticks:e,days:t,today:n})=>{let r=t.indexOf(n);return(0,H.jsxs)(`div`,{"aria-hidden":!0,className:o(U,`pointer-events-none absolute inset-0`),children:[(0,H.jsx)(`span`,{className:`hidden sm:block`}),(0,H.jsxs)(`div`,{className:`relative`,children:[r>=0&&(0,H.jsx)(`span`,{className:`absolute inset-y-0 bg-primary/10`,style:{left:W(r,t.length),width:W(1,t.length)}}),e.map(e=>(0,H.jsx)(`span`,{className:o(`absolute inset-y-0 w-px bg-border`,(e.minor||e.index===0)&&`hidden sm:block`),style:{left:W(e.index,t.length)}},e.index))]})]})},me=({model:e,view:t,display:n,row:r,days:i,movable:a,dragged:s})=>{let c=z(r.record,n,e,i);return(0,H.jsxs)(`div`,{className:o(U,`relative border-b border-border last:border-b-0`),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:`truncate px-2 pt-1 text-body sm:py-1.5`,children:E(e,t,n,r)}),(0,H.jsx)(`div`,{className:`relative h-7`,children:c&&(0,H.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2`,style:{left:W(c.first,i.length),width:W(c.last-c.first+1,i.length)},children:(0,H.jsx)(w,{model:e,view:t,display:n,row:r,day:c.start,movable:a,dragged:s,className:o(c.before&&`rounded-l-none border-l-0`,c.after&&`rounded-r-none border-r-0`)})})})]})},he=()=>[{scale:`week`,label:d(`week`)},{scale:`month`,label:d(`month`)},{scale:`quarter`,label:d(`quarter`)}],G=({model:e,view:t,display:n,fields:a,filter:o,at:c,linkTo:u,now:f=Date.now()})=>{let[h,v]=(0,k.useState)(),S=P(u?c:h,f),C=I(S),w=R(S),A=ce({model:e,display:n,range:ue(S),fields:a,filter:o}),{moves:j,move:M}=se(e,n),N=V(T(le(A.rows,j),n),e,t,n),z=l(e.name),B=r(z,`update`)&&[n.start,n.end].every(t=>t===void 0||!e.fields[t]?.readOnly),[U,W]=(0,k.useState)(),G=(0,k.useRef)(!1),K=(0,k.useRef)(0),q=(0,k.useRef)(null),J=()=>(q.current?.getBoundingClientRect().width??0)/C.length,Y=e=>{let t=J();return t>0?Math.round(e/t):0},ge=({transform:e})=>({...e,x:Y(e.x)*J(),y:0}),_e=ie(y(te,{activationConstraint:{distance:4}}),y(b,{activationConstraint:{delay:250,tolerance:5}}),y(ne,{keyboardCodes:{start:[`Space`],cancel:[`Escape`],end:[`Space`,`Enter`]},coordinateGetter:(e,{currentCoordinates:t})=>{let n=e.code===`ArrowLeft`?-1:+(e.code===`ArrowRight`);if(n!==0)return e.preventDefault(),{x:t.x+n*J(),y:t.y}}})),X=m(f,g()),Z=r=>E(e,t,n,r.row),Q=e=>s(Date.parse(`${D(e.day,K.current)}T00:00:00Z`)),ve={onDragStart:({active:e})=>d(`pickedUp`,{title:Z(e.data.current)}),onDragMove:({active:e})=>d(`startsOn`,{title:Z(e.data.current),day:Q(e.data.current)}),onDragOver:()=>void 0,onDragEnd:({active:e})=>K.current===0?d(`putBack`,{title:Z(e.data.current)}):d(`wasMovedTo`,{title:Z(e.data.current),to:Q(e.data.current)}),onDragCancel:({active:e})=>d(`cancelled`,{title:Z(e.data.current)})},$=()=>{W(void 0),setTimeout(()=>G.current=!1)},ye=({active:e})=>{G.current=!0,K.current=0,W(e.data.current)},be=({delta:e})=>K.current=Y(e.x),xe=({active:t,delta:r})=>{$(),K.current=Y(r.x);let{row:i}=t.data.current,a=O(i.record,n,e);a&&K.current!==0&&M(i,a.first,D(a.first,K.current))},Se=n.group===void 0?t?.names?.plural??_(e.name):t?.fields[n.group]?.label??_(n.group),Ce=!A.loading&&!A.error&&A.rows.length===0;return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,H.jsx)(oe,{heading:L(S),unit:S.scale,previous:F(S,-1),today:P({scale:S.scale,day:X},f),next:F(S,1),scales:he().map(({scale:e,label:t})=>({view:de(S,e,f),label:t,current:S.scale===e})),scalesLabel:d(`timelineScale`),linkTo:u,onView:v}),A.error&&(0,H.jsx)(ee,{title:d(`couldNotLoadRows`),error:A.error}),A.capped&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(`capped`,{limit:500,unit:S.scale})}),(0,H.jsxs)(x,{sensors:_e,modifiers:[ge],onDragStart:ye,onDragMove:be,onDragEnd:xe,onDragCancel:$,accessibility:{announcements:ve,screenReaderInstructions:{draggable:d(`timelineInstructions`)}},children:[(0,H.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border`,children:[(0,H.jsx)(fe,{ticks:w,days:C,today:X,label:Se,trackRef:q}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(pe,{ticks:w,days:C,today:X}),A.loading&&(0,H.jsxs)(`div`,{className:`relative flex flex-col gap-2 p-2`,children:[(0,H.jsx)(p,{className:`h-4`}),(0,H.jsx)(p,{className:`h-4`})]}),Ce&&(0,H.jsx)(`p`,{className:`relative px-2 py-3 text-xs text-muted-foreground`,children:d(`nothingIn`,{unit:S.scale})}),!A.loading&&N.map(r=>(0,H.jsxs)(`section`,{"aria-label":r.label,className:`relative border-b border-border last:border-b-0`,children:[r.label!==void 0&&(0,H.jsxs)(`h3`,{className:`flex items-center gap-1.5 border-b border-border bg-surface px-2 py-1 text-xs font-medium`,children:[r.label,(0,H.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:r.rows.length})]}),r.rows.map(r=>(0,H.jsx)(me,{model:e,view:t,display:n,row:r,days:C,movable:B&&i(r.record,`update`),dragged:()=>G.current},r.key))]},r.key))]})]}),(0,H.jsx)(re,{children:U&&(0,H.jsx)(ae,{model:e,view:t,display:n,row:U.row,day:U.day})})]})]})};export{G as TimelineDisplay};
|
|
2
|
+
//# debugId=ab7e3ff4-40ee-4a1b-bade-08684b3ebbc9
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Uc as e}from"./app-C8DagobC.js";var t={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};t.node;var n=e(t);export{n as t};
|
|
2
|
+
//# debugId=41cfb217-a3d3-491e-aef0-d392d8cec9a8
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{$l as e,Bl as t,Ql as n,Xl as r,Yl as i,Zl as a}from"./app-C8DagobC.js";import{A as o}from"./vendor-t7Q7QbPu.js";var s=e=>()=>{throw Error(`Not implemented: ${e}() needs the database (the resource's search fields, trigram matching), so it cannot be evaluated against a record`)},c=(t,n,r)=>({...e,search:{...e.search,evaluate:r?e=>i(r,n,e):s(`search`)},similar:{...e.similar,evaluate:s(`similar`)},regex:{...e.regex,evaluate:(e,t)=>e.some(e=>typeof e==`string`&&new RegExp(t).test(e))},now:{...e.now,evaluate:t}}),l=(e,t,n={})=>o(a(e,{expand:!0}),t,{functions:c(n.now??(()=>new Date),t,n.search)}),u=(e,t,n,r={})=>({name:e,kind:t,label:n.label,required:t!==`boolean`&&!n.optional,...n.help!==void 0&&{help:n.help},...n.when!==void 0&&{when:n.when},...n.default!==void 0&&{default:n.default},...r}),d={text:(e,t)=>u(e,`text`,t,{...t.multiline&&{multiline:!0},...t.max!==void 0&&{max:t.max}}),integer:(e,t)=>u(e,`integer`,t),decimal:(e,t)=>u(e,`decimal`,t),boolean:(e,t)=>u(e,`boolean`,t),secret:(e,t)=>u(e,`secret`,t),date:(e,t)=>u(e,`date`,t),choice:(e,t)=>u(e,`choice`,t,`options`in t?{options:t.options.map(({value:e,label:t})=>({value:e,label:t}))}:{resource:t.resource}),checklist:(e,t)=>u(e,`checklist`,t,{...`items`in t&&{items:[...t.items]},...`from`in t&&{from:t.from}}),custom:(e,t)=>u(e,`custom`,t,{component:t.component,...t.props!==void 0&&{props:t.props}})},f={text:`text`,integer:`integer`,decimal:`decimal`,boolean:`boolean`,date:`date`,choice:`text`,secret:`text`,checklist:`json`,custom:`json`},p=e=>({name:e.name,column:e.name,type:e.options?`enum`:f[e.kind],nullable:!0,readOnly:!1,filterable:e.kind!==`custom`&&e.kind!==`checklist`&&e.kind!==`secret`,sortable:!1,aliases:[],...e.options&&{enumValues:e.options.map(e=>e.value)}}),m=e=>({name:`inputs`,table:{name:`inputs`},fields:Object.fromEntries(e.map(e=>[e.name,p(e)])),primaryKey:[]}),h=(e,t)=>{let i=e[t].when;if(i===void 0)return;let a=n(i);if(!a.ok)return a.errors.map(e=>e.message).join(`; `);if(!a.ast)return`it is empty`;let o=r(m(e.slice(0,t)),a.ast);return o.ok?o.filter:o.errors.map(e=>e.message).join(`; `)},g=e=>e.kind===`checklist`?e.items===void 0==(e.from===void 0)?[`input "${e.name}": a checklist takes either "items" or "from"`]:e.items&&e.items.length===0?[`input "${e.name}": a checklist needs at least one item`]:[]:[],_=e=>e.flatMap((t,n)=>{let r=[];e.findIndex(e=>e.name===t.name)!==n&&r.push(`input "${t.name}" is declared twice`),t.kind===`secret`&&t.default!==void 0&&r.push(`input "${t.name}": a secret takes no default`),t.kind!==`secret`&&t.options&&t.default!==void 0&&!t.options.some(e=>e.value===t.default)&&r.push(`input "${t.name}": default "${String(t.default)}" is not one of its options`);let i=h(e,n);return typeof i==`string`&&r.push(`input "${t.name}": "when" is not a valid condition over the inputs before it: ${i}`),[...r,...g(t)]}),v=(e,t)=>{let n=new Set,r={};return e.forEach((i,a)=>{let o=h(e,a);if(typeof o==`string`)throw Error(`Input "${i.name}": ${o}`);let s=o===void 0||l(o,r)===!0;s&&n.add(i.name),r[i.name]=s?t[i.name]??null:null}),n},y=(e,n=[])=>Object.entries(e).flatMap(([e,r])=>{let i=typeof r==`string`?t(r):void 0;if(i===void 0)return[];let a=n.find(e=>e.name===i);return a?a.kind===`secret`?[`set "${e}" names secret input "${i}", which an update never writes; take it in an action's handler`]:[]:[`set "${e}" names input "${i}", which it does not ask for`]}),b=(e,n)=>Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{let i=typeof r==`string`?t(r):void 0;return i===void 0?[[e,r]]:Object.hasOwn(n,i)?[[e,n[i]]]:[]}));export{v as a,d as i,b as n,_ as r,y as t};
|
|
2
|
+
//# debugId=6e534df7-389b-461e-85a7-a3dd2be7efb4
|
|
@@ -0,0 +1,2 @@
|
|
|
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{Ca as r,Co as i,Fc as a,Ia as o,Ic as s,Jl as c,Wc as l,Xi as u,bn as d,ca as f,cl as p,da as m,di as ee,ds as te,fi as h,ia as g,is as _,la as ne,ql as v,sa as y,ua as b,uc as x,vi as S,zr as C}from"./app-C8DagobC.js";import{i as w}from"./vendor-t7Q7QbPu.js";import{r as T,t as E}from"./record-preview-DyOOyKCI.js";import{h as D}from"./lib-dnd-kit-core-xi-7xL_N.js";import{t as O}from"./use-display-rows-DM1gg_CJ.js";var k=e(t(),1),A=e(n(),1),j=864e5,M=e=>new Date(e).toISOString().slice(0,10),N=e=>Date.parse(`${e}T00:00:00Z`),P=(e,t)=>M(N(e)+t*j),F=e=>P(e,-((new Date(N(e)).getUTCDay()+6)%7)),I=(e,t=0)=>{let n=new Date(N(e));return M(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+t,1))},L=({scale:e,day:t})=>({scale:e,day:e===`month`?I(t):F(t)}),R=(e,t,n=b())=>L(e??{scale:`month`,day:y(t,n)}),z=(e,t,n=b())=>L({scale:e,day:y(t,n)}),B=(e,t)=>e.scale===`month`?{scale:`month`,day:I(e.day,t)}:{scale:`week`,day:P(F(e.day),7*t)},V=e=>{let t=F(e.scale===`month`?I(e.day):e.day),n=(N(e.scale===`month`?P(F(P(I(e.day,1),-1)),6):P(t,6))-N(t))/j+1;return Array.from({length:n},(e,n)=>P(t,n))},H=e=>{let t=V(e);return{from:t[0],to:P(t.at(-1),1)}},U=(e,t)=>t.fields[e.start]?.type===`timestamp`,W=(e,t,n,r=b())=>{let i=U(e,t),a=e=>new Date(ne(e,r)).toISOString().replace(`.000Z`,`Z`),o=e=>i?{kind:`timestamp`,value:a(e),span:{start:0,end:0}}:{kind:`string`,value:e,span:{start:0,end:0}},s=v.and(v.gte(e.start,o(n.from)),v.lt(e.start,o(n.to)));if(e.end===void 0)return c(s);let l=i?v.gt(e.end,o(n.from)):v.gte(e.end,o(n.from));return c(v.or(s,v.and(v.lt(e.start,o(n.from)),l)))},G=(e,t)=>e===``?t:`(${e}) AND (${t})`,K=e=>{if(typeof e!=`string`)return;let t=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t)?void 0:t},q=(e,t,n,r=b())=>{let i=K(e[t.start]);if(i===void 0)return;let a=U(t,n),o=e=>a?y(e,r):M(e),s=o(i),c=t.end===void 0?void 0:K(e[t.end]),l=c===void 0?s:o(a?c-1:c);return{first:s,last:l<s?s:l}},J=(e,t,n,r,i=b())=>{let a=q(e,t,n,i);return a?r.filter(e=>e>=a.first&&e<=a.last):[]},Y=(e,t)=>e.toSorted((e,n)=>(K(e.record[t.start])??0)-(K(n.record[t.start])??0)),X=(e,t,n,r,i=b())=>{let a=new Map(r.map(e=>[e,[]]));for(let o of Y(e,t))for(let e of J(o.record,t,n,r,i))a.get(e).push(o);return a},re=(e,t,n,r,i,a=b())=>{let o=(N(i)-N(r))/j,s=U(t,n),c=e=>{let t=K(e);if(t!==void 0)return s?new Date(f(t+m(t,a)+o*j,a)).toISOString():P(M(t),o)},l=c(e[t.start]),u=t.end===void 0?void 0:c(e[t.end]);return{...l!==void 0&&{[t.start]:l},...u!==void 0&&{[t.end]:u}}},ie=({heading:e,unit:t,previous:n,today:r,next:o,scales:c,scalesLabel:l,linkTo:u,onView:d})=>{let f=(e,t,n,r,i)=>u?(0,A.jsx)(C,{to:u(e),className:t,"aria-label":n,"aria-current":i?`page`:void 0,children:r}):(0,A.jsx)(`button`,{type:`button`,className:t,"aria-label":n,"aria-pressed":i,onClick:()=>d?.(e),children:r}),p=x({variant:`secondary`,size:`sm`});return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[f(n,p,h(`previousPeriod`,{unit:t}),(0,A.jsx)(s,{className:`size-3.5`})),f(r,p,h(`today`),h(`today`)),f(o,p,h(`nextPeriod`,{unit:t}),(0,A.jsx)(a,{className:`size-3.5`}))]}),(0,A.jsx)(`span`,{role:`group`,"aria-label":l,className:i.group(),children:c.map(e=>(0,A.jsx)(k.Fragment,{children:f(e.view,i.option(e.current),e.label,e.label,e.current)},e.label))})]})]})},ae=`day:`,Z=e=>`${ae}${e}`,oe=(e,t)=>`${e}@${t}`,se=(e,{context:{active:t,collisionRect:n,droppableRects:r,over:i}})=>{let a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.code],o=i?String(i.id).slice(4):t?.data.current?.day;if(a===void 0||!n||o===void 0)return;e.preventDefault();let s=r.get(Z(P(o,a)));if(s)return{x:s.left+(s.width-n.width)/2,y:s.top+4}},Q=(e,t,n,r)=>{let i=n.title??p(e,t),a=e.fields[i],o=r.labels[i]??(a?S(a,r.record[i],t?.fields[i]):``);return o===``?r.key:o},ce=(e,t,n,r)=>{let i=n.record[t.start];if(e.fields[t.start]?.type!==`timestamp`||typeof i!=`string`)return;let a=Date.parse(i);return y(a,b())===r?g(a):void 0},$=({model:e,view:t,display:n,row:r,day:i,className:a})=>{let o=E(e),s=ce(e,n,r,i);return(0,A.jsxs)(C,{to:{kind:`record`,resource:e.name,key:r.key},onClick:()=>o(r.record),className:l(`flex min-w-0 items-baseline gap-1 rounded-md border border-border bg-background px-1.5 py-0.5 text-xs hover:border-border-strong hover:bg-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30`,a),children:[s&&(0,A.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:s}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:Q(e,t,n,r)})]})},le=({movable:e,dragged:t,...n})=>{let{setNodeRef:r,setActivatorNodeRef:i,listeners:a,isDragging:o}=D({id:oe(n.row.key,n.day),data:{row:n.row,day:n.day},disabled:!e});return(0,A.jsx)(`div`,{ref:e=>{r(e),i(e?.querySelector(`a`)??e)},...a,onDragStart:e=>e.preventDefault(),onClickCapture:e=>{t()&&(e.preventDefault(),e.stopPropagation())},className:l(`min-w-0`,e&&`cursor-grab touch-manipulation`,o&&`opacity-40`),children:(0,A.jsx)($,{...n})})},ue=({model:e,display:t,range:n,fields:r,filter:i})=>{let{resources:a,views:o}=_(),s=T({resources:a,views:o,model:e,columns:r,filter:G(i,W(t,e,n)),orderBy:`${t.start} asc`}),c=O(e,s.page,s.key,!0),l=c.more&&!c.loading&&c.rows.length<500;(0,k.useEffect)(()=>{l&&c.loadMore()},[l,c.rows.length]);let u=c.rows.length>500||c.rows.length===500&&c.more;return{rows:c.rows.slice(0,500),capped:u,loading:c.loading,error:c.error}},de=(e,t)=>{let n=new Map(t.map(e=>[e.key,e.patch]));return e.map(e=>n.has(e.key)?{...e,record:{...e.record,...n.get(e.key)}}:e)},fe=(e,t)=>{let n=te(),i=o(),a=d(),[s,c]=(0,k.useState)([]),l=e=>c(t=>t.filter(t=>t.key!==e)),f=w({mutationFn:({row:t,patch:i})=>{let a=typeof t.record.etag==`string`?t.record.etag:`*`;return n.update(e.name,r(e,t.record),i,a)},onMutate:({row:e,patch:t})=>c(n=>[...n.filter(t=>t.key!==e.key),{key:e.key,patch:t}]),onError:(e,{row:t,to:n})=>{l(t.key),i.show({state:`error`,title:h(`couldNotMoveTo`,{to:u(Date.parse(`${n}T00:00:00Z`))}),description:ee(e)})},onSettled:async(t,n,{row:r})=>{await a(e.name),l(r.key)}});return{moves:s,move:(n,r,i)=>f.mutate({row:n,patch:re(n.record,t,e,r,i),to:i})}};export{H as _,$ as a,z as b,Z as c,X as d,R as f,I as g,F as h,le as i,ie as l,Y as m,fe as n,Q as o,V as p,ue as r,se as s,de as t,P as u,q as v,B as y};
|
|
2
|
+
//# debugId=539583ee-9f57-4da3-a969-0de0db6388f3
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Jr as e}from"./app-C8DagobC.js";import{r as t}from"./vendor-t7Q7QbPu.js";var n=(n,r,i,a)=>{let o=t({queryKey:[...i,`display`],enabled:a,initialPageParam:0,queryFn:({pageParam:e})=>r(e),getNextPageParam:(e,t)=>e.rows.length===40&&t.length*40<(t[0]?.total??0)?t.length:void 0}),s=o.data?.pages??[];return{resource:n.name,rows:s.flatMap(t=>t.rows.map(t=>e(n,t))),total:s[0]?.total??0,loading:o.isPending,error:o.error,more:o.hasNextPage,loadMore:()=>void o.fetchNextPage()}};export{n as t};
|
|
2
|
+
//# debugId=ccd6083f-0892-4aaa-b81b-38581b4fc498
|
|
@@ -0,0 +1,2 @@
|
|
|
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{Aa as r,Ja as i,Zc as a,gs as o,hs as s,ko as c,lc as l,ms as u,tl as d,to as f,xs as p}from"./app-C8DagobC.js";import{o as m}from"./vendor-t7Q7QbPu.js";var h=e(n(),1),g=({invitation:e,t,busy:n,joining:r,onJoin:i})=>{let a=p().organizations?.roles??[],o=e.organizationName??t(`anOrganization`),s=e.appRoles.map(e=>f(a,e)).join(`, `),c=t(`expires`,{date:new Date(e.expiresAt).toLocaleDateString(d(),{dateStyle:`long`})});return(0,h.jsxs)(`li`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:`block break-words font-medium`,children:o}),(0,h.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:s?`${s} · ${c}`:c})]}),(0,h.jsx)(l,{variant:`primary`,disabled:n,loading:r,busyLabel:t(`joining`,{name:o}),onClick:i,className:`min-h-10 w-full sm:min-h-0 sm:w-auto`,children:t(`join`,{name:o})})]})},_=e(t(),1),v=({onCreated:e,autoFocus:t=!1})=>{let{session:n}=p(),a=r(),[o,s]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1),{busy:f,error:m,run:g}=i(),v=(0,_.useId)(),y=(0,_.useRef)(null),b=()=>{if(!f){if(o.trim()===``){d(!0),y.current?.focus();return}g(async()=>{await n.organizations.create({name:o.trim()}),e()})}},x=u?a(`nameNeeded`):m;return(0,h.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{e.preventDefault(),b()},children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,h.jsxs)(`label`,{className:`flex flex-col gap-1.5 font-medium`,children:[a(`organizationName`),(0,h.jsx)(c,{ref:y,name:`organization`,autoComplete:`organization`,autoFocus:t,maxLength:200,value:o,invalid:u,"aria-describedby":u?v:void 0,onChange:e=>{s(e.target.value),d(!1)},className:`min-h-6`})]}),x&&(0,h.jsx)(`p`,{id:v,role:`alert`,className:`text-body font-medium text-danger-text`,children:x})]}),(0,h.jsx)(l,{variant:`primary`,type:`submit`,loading:f,busyLabel:a(`creating`),className:`min-h-10`,children:a(`createButton`)})]})},y=e=>{let{session:t}=p(),{busy:n,error:r,run:a}=i(),[o,s]=(0,_.useState)();return{busy:n,error:r,joining:n?o:void 0,join:n=>{s(n),a(async()=>{await t.organizations.acceptMine(n),e()})}}},b=()=>{let{session:e}=p(),t=(0,_.useContext)(u),n=m({queryKey:a.myInvitations,queryFn:()=>e.organizations.myInvitations(),retry:!1});return n.data&&s(n,t)?{state:`ready`,invitations:n.data}:o(n)?{state:`failed`,retry:()=>void n.refetch()}:{state:`loading`}};export{g as i,y as n,v as r,b as t};
|
|
2
|
+
//# debugId=519e192d-d4a8-44eb-a018-86735c511a50
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Qc as r,Xo as i,Zo as a,_c as o,ko as s,lc as c}from"./app-C8DagobC.js";var l=r(`lists`),u=e(n(),1),d=({title:e,description:t,searchLabel:n,placeholder:r,query:d,onQuery:f,list:p,error:m,renderRow:h})=>(0,u.jsxs)(i,{title:e,description:t,children:[(0,u.jsx)(a,{message:m}),(0,u.jsx)(s,{"aria-label":n,placeholder:r,value:d,onChange:e=>f(e.target.value),leading:(0,u.jsx)(o,{className:`size-3.5`}),wrapperClassName:`mb-2`}),(0,u.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[p.found.length,` of `,p.total]}),p.found.length>0&&(0,u.jsx)(`ul`,{className:`divide-y rounded-md border`,children:p.found.map(h)}),p.found.length<p.total&&(0,u.jsx)(c,{className:`mt-3`,loading:p.loading,onClick:()=>void p.more(),children:l(`showMore`)})]}),f=e(t(),1),p=(e,t)=>{let[n,r]=(0,f.useState)([]),[i,a]=(0,f.useState)(0),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(t);return c.current=t,(0,f.useEffect)(()=>{let n=setTimeout(()=>{s(!0),e(t,0).then(e=>{c.current===t&&(r(e.items),a(e.total),s(!1))},()=>{c.current===t&&(r([]),a(0),s(!1))})},200);return()=>clearTimeout(n)},[e,t]),{found:n,total:i,more:async()=>{let i=t;s(!0);let o=await e(i,n.length).catch(()=>void 0);c.current===i&&(o&&(r(e=>[...e,...o.items]),a(o.total)),s(!1))},loading:o}};export{d as n,p as t};
|
|
2
|
+
//# debugId=5468c956-808c-43b2-a2d2-545945f5f942
|
|
@@ -1,2 +1,2 @@
|
|
|
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}from"./react-CuiNlnus.js";import{
|
|
2
|
-
//# debugId=
|
|
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}from"./react-CuiNlnus.js";import{Ba as n,Va as r,Zc as i,_s as a,ds as o}from"./app-C8DagobC.js";import{h as s,o as c}from"./vendor-t7Q7QbPu.js";import{C as l,E as u,M as d,O as f,P as p,S as m,T as h,h as g,t as ee,w as _,y as v}from"./workflows-Bey4jszG.js";var y=()=>({trigger:{manual:{}},stateMachine:{QueryLanguage:`JSONata`,StartAt:``,States:{}}}),b=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return y();let t=e,n=t.stateMachine,r=typeof n?.States==`object`&&n.States!==null&&!Array.isArray(n.States)?n.States:{},i=t.order===`data`?{}:{StartAt:n?.StartAt??``};return{...t,trigger:t.trigger??{manual:{}},stateMachine:{...n,QueryLanguage:`JSONata`,...i,States:r}}},x=e=>b({trigger:e.trigger,order:e.execution_order??`sequence`,stateMachine:e.state_machine,...e.connections?{connections:e.connections}:{},...e.trace?{trace:e.trace}:{}}),S=e=>{let{StartAt:t,...n}=e.stateMachine;return{state_machine:g(e)===`data`?n:e.stateMachine,trigger:e.trigger,execution_order:g(e),connections:e.connections??null,trace:e.trace??null}},C=e=>e.split(`/`),w=(e,t)=>[...e,t].join(`/`),T=e=>{let t=C(e);return{scope:t.slice(0,-1),name:t.at(-1)}},E=(e,t)=>{let n=e.stateMachine;for(let e of t)n=d(n?.States[e]);return n},D=(e,t)=>{let{scope:n,name:r}=T(t);return E(e,n)?.States[r]},O=e=>Object.entries(e.States).flatMap(([e,t])=>{let n=d(t);return[e,...n?.States?O(n):[]]}),k=(e,t,n=[])=>{if(Object.hasOwn(e.States,t))return[...n,t];for(let[r,i]of Object.entries(e.States)){let e=d(i),a=e?.States&&k(e,t,[...n,r]);if(a)return a}},te=e=>e?.Type===`Map`||e?.Type===`Block`,A=e=>typeof e==`object`&&!!e&&!Array.isArray(e),j=e=>{if(!e)return[];let t=[e.anyOf,e.oneOf].find(Array.isArray),n=A(e.properties)?Object.entries(e.properties).filter(e=>A(e[1])):[];if(!t)return n;let r=new Map(n.map(([e,t])=>[e,[t]]));for(let[e,i]of t.filter(A).flatMap(e=>j(e)))n.some(([t])=>t===e)||r.set(e,[...r.get(e)??[],i]);return[...r].map(([e,t])=>[e,t.length===1?t[0]:{anyOf:t}])},M=e=>j(e),N=e=>e===void 0||e===``?`empty`:v(e)?`wired`:p(e)===void 0?A(e)&&Object.values(e).some(e=>p(e)!==void 0)?`made`:`literal`:`expression`,P=e=>`Arguments`in e&&A(e.Arguments)?e.Arguments:{},F=(e,t,n,r)=>{let i=Array.isArray(t.enum)&&t.enum.every(e=>typeof e==`string`)?t.enum:void 0;return{key:e,type:f(t),required:r,value:n,state:N(n),...i&&{options:i}}},ne=(e,t)=>{let n=m(e,t);if(!n)return[];let r=Array.isArray(n.required)?n.required:[],i=P(e);return M(n).map(([e,t])=>F(e,t,i[e],r.includes(e)))},I=e=>{let t=typeof e?.title==`string`?[]:M(e);return t.length===0?[{path:[],type:f(e)}]:t.map(([e,t])=>({path:[e],type:f(t)}))},re=(e,t)=>e.Type===`Task`?I(l(e,t)):e.Type===`Map`?[{path:[],type:f({type:`array`})}]:e.Type===`Block`?[{path:[],type:f(void 0)}]:[],ie=(e,t)=>I(h(e,t)),L=`#status`,R=`#condition`,z={path:[L],type:f(_)},B=e=>({key:R,type:{kinds:[`boolean`]},required:!1,value:e.Condition,state:N(e.Condition)}),V=(e,t,n,r)=>r[0]===`#status`?u(_,r.slice(1)):u(t?l(t,n):h(e,n),r),H=`$trigger`,U=e=>typeof e==`object`&&!!e&&!Array.isArray(e),W=e=>U(e)&&Number.isFinite(e.x)&&Number.isFinite(e.y),G=e=>U(e)?Object.fromEntries(Object.entries(e).flatMap(([e,t])=>W(t)?[[e,{x:t.x,y:t.y}]]:[])):{},K=e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{t=void 0}let n=U(t)?t:{};return{pins:G(n.pins),simple:G(n.simple)}},q=e=>e.replaceAll(`%`,`%25`).replaceAll(`.`,`%2E`).replace(/^#/,`%23`).replace(/^\$/,`%24`),J=e=>e===``?H:q(T(e).name),ae=e=>e.map(e=>e===`#status`?L:q(e)),oe=(e,t)=>t?.kind===`break`?[J(t.source),...t.path.length===0?[`#break`]:ae(t.path)].join(`.`):t?.kind===`make`?[J(t.target),`#make`,q(t.key)].join(`.`):t?.kind===`select`?[J(t.target),`#select`,q(t.key)].join(`.`):t?.kind===`condition`?[J(t.target),`#when`,...t.at.map(String)].join(`.`):J(e),se=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),ce=32,Y={right:24,bottom:24},X=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,le=(e,t,n)=>{if(![...t.keys()].some(t=>e.has(t)))return e;let r=new Map([...e].map(([e,n])=>[e,{...n,...t.get(e)}])),i=new Map;for(let e of r.keys())i.set(n(e),[...i.get(n(e))??[],e]);let a=e=>e===void 0?0:a(n(e))+1,o=new Set;for(let e of[...i.keys()].sort((e,t)=>a(t)-a(e))){let n=i.get(e);if(n.some(e=>t.has(e)||o.has(e))){let e=n.filter(e=>t.has(e)).map(e=>r.get(e)),i=n.filter(e=>!t.has(e)).map(e=>r.get(e)).sort((e,t)=>e.y-t.y||e.x-t.x);for(let t of i){let n=e.find(e=>X(t,e));for(;n;)t.y=n.y+n.height+ce,n=e.find(e=>X(t,e));e.push(t)}}let a=e===void 0?void 0:r.get(e);if(!a)continue;let s=Math.max(a.width,...n.map(e=>r.get(e)).map(e=>e.x+e.width+Y.right)),c=Math.max(a.height,...n.map(e=>r.get(e)).map(e=>e.y+e.height+Y.bottom));(s!==a.width||c!==a.height)&&(Object.assign(a,{width:s,height:c}),o.add(e))}return r},Z=e(t(),1),Q=1e3,ue=e=>({...e,id:`${e.scope}#${e.seq}`,resume_at:e.resumeAt??null,started_at:e.startedAt,finished_at:e.finishedAt,duration_ms:Date.parse(e.finishedAt)-Date.parse(e.startedAt)}),de=(e,{from:t,steps:n,revision:r})=>({rows:[...e.slice(0,t),...n.map(ue)],revision:r}),$=(e,t)=>{let n=o(),r=s(),a=i.workflowRunTrace(e??``),l=c({queryKey:a,queryFn:async()=>{let t=r.getQueryData(a);return de(t?.rows??[],await n.workflowRunTrace(e,t&&{after:t.rows.length,revision:t.revision}))},select:e=>e.rows,enabled:e!==void 0,refetchInterval:t?Q:!1}),u=(0,Z.useRef)(t),{refetch:d}=l;return(0,Z.useEffect)(()=>{let n=u.current&&!t;u.current=t,n&&e!==void 0&&d()},[t,e,d]),l},fe=new Set([`queued`,`running`,`waiting`]),pe=e=>{let t=s();(0,Z.useEffect)(()=>{if(!e)return;let n=r(t,()=>!1),i=setInterval(()=>n.changed([`workflow_runs`]),Q);return()=>{clearInterval(i),n.stop()}},[e,t])},me=e=>{let t=s(),n=(0,Z.useContext)(a),i=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{let a=i.current&&!e;i.current=e,a&&r(t,()=>n?.paused()??!1).changed([`workflows`])},[e,t,n])},he=(e,t)=>{if(!e)return;let n=typeof t==`string`?k(e.stateMachine,t):void 0,r=n&&D(e,n.join(`/`));return n&&r?.Type===`Block`?{within:n,startAt:r.Processor.StartAt}:{within:[],startAt:e.stateMachine.StartAt}},ge=e=>{let t=n(`workflow_runs`,e??``,e!==void 0),r=t.data?.record,i=r?.workflow_id!=null&&r.version!=null,a=n(`workflow_versions`,[String(r?.workflow_id??``),Number(r?.version??0)],i),o=fe.has(String(r?.status)),s=typeof r?.test_step==`string`?ee(r.test_step):a.data?x(a.data.record):void 0,c=$(e,o);return pe(o),me(o),{id:e,run:r,stored:t.data,definition:s,place:he(s,r?.block_state),steps:c.data??[],going:o,error:t.error??a.error??c.error}};export{k as C,D as E,w as S,T,O as _,se as a,te as b,B as c,F as d,ne as f,ie as g,re as h,le as i,M as l,z as m,$ as n,K as o,L as p,oe as r,R as s,ge as t,V as u,b as v,x as w,E as x,S as y};
|
|
2
|
+
//# debugId=d8538599-eb02-4df6-baeb-d92650b54129
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Ba as e,Br as t,Ir as n,Q as r}from"./app-C8DagobC.js";import{o as i,t as a,w as o}from"./use-run-trace-DYU4WZ6w.js";var s=`workflows`,c=({workflow:e,version:t,run:n})=>({kind:`record`,resource:s,key:e,...t!==void 0&&{version:t},...n&&{run:n}}),l=(e,t,n)=>c({workflow:e,...t!==n&&{version:t}}),u=(e,t,n,r)=>c({workflow:e,...n!==r&&{version:n},run:t}),d=({workflow:e,version:t},n)=>t===void 0?c({workflow:e}):l(e,t,n),f=e=>e==null?void 0:Number(e),p=()=>{let{address:e}=t(),n=r();if(n&&e?.kind===`record`)return{workflow:n.key,...e.version!==void 0&&{version:e.version},...e.run&&{run:e.run}}},m=t=>{let r=e(s,t.workflow),c=f(r.data?.record.version),l=f(r.data?.record.enabled_version),u=`workflow_id = ${JSON.stringify(t.workflow)}`,d=n(`workflow_versions`,{filter:u,orderBy:`version desc`,pageSize:100,fields:[`version`,`saved_at`]}),p=n(`workflow_runs`,{filter:`${u} AND isNull(block_of)`,orderBy:`created_at desc`,pageSize:20,fields:[`id`,`status`,`version`,`created_at`,`duration_ms`,`input`,`started_by`,`rerun_of`,`replay`,`error`]}),m=a(t.run),h=t.version,g=e(`workflow_versions`,[t.workflow,h??0],h!==void 0);return{latest:c,enabled:l,versions:d.items.map(e=>({version:Number(e.version),savedAt:String(e.saved_at)})),runs:p.items,trace:m,shown:h,pastDefinition:g.data&&o(g.data.record),pastLayout:g.data&&i(g.data.record.layout),versionsError:d.error,runsError:p.error,pastError:g.error}};export{l as a,u as i,p as n,c as o,d as r,s,m as t};
|
|
2
|
+
//# debugId=547775de-eb15-4cb6-84a6-437742e2a448
|
|
@@ -1,2 +1,2 @@
|
|
|
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{
|
|
2
|
-
//# debugId=
|
|
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{Qc as e,Zc as t,ds as n}from"./app-C8DagobC.js";import{o as r}from"./vendor-t7Q7QbPu.js";var i=e(`app/field-types/workflow`),a=()=>{let e=n();return r({queryKey:t.workflowTypes,queryFn:()=>e.workflowTypes()})};export{i as n,a as t};
|
|
2
|
+
//# debugId=5f0b263f-56ba-4212-80bd-8eb84b9895ec
|