@declarion/react 0.60.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/ActionDialog-uiuse5W8.js +374 -0
- package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
- package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
- package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
- package/dist-lib/{AgentChatPanel.impl-BY-Ir7Sh.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
- package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
- package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
- package/dist-lib/AuthShell-DdiughRT.js +361 -0
- package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
- package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
- package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
- package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
- package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
- package/dist-lib/{DraggableChildrenTable-CtL7rdT6.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
- package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
- package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
- package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
- package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
- package/dist-lib/{Grid-CYERLdXO.js → Grid-Cg29k0jv.js} +98 -99
- package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
- package/dist-lib/Icons-lt-7lhYR.js +151 -0
- package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
- package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
- package/dist-lib/Kbd-CNttVu0z.js +23 -0
- package/dist-lib/{LayoutRenderer-B08IJKsZ.js → LayoutRenderer-DEHtYtzV.js} +965 -942
- package/dist-lib/{ListCardsBody-Dje_rays.js → ListCardsBody-BAwFR3yO.js} +46 -52
- package/dist-lib/{MarkdownRenderer-N0IWjTH5.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
- package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
- package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
- package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
- package/dist-lib/PageShell-tI-mm0C5.js +47 -0
- package/dist-lib/Pill-D-wsfRhx.js +42 -0
- package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
- package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
- package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
- package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
- package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
- package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
- package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
- package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
- package/dist-lib/SectionCard-VonaiLrx.js +150 -0
- package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
- package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
- package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
- package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
- package/dist-lib/{SortHeaderMenu-DKKeCGTH.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
- package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
- package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
- package/dist-lib/{cardProjection-nveYLvHR.js → cardProjection-Cr7fG6wJ.js} +134 -133
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/format-count-CSEFw2ht.js +943 -0
- package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
- package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
- package/dist-lib/icons.d.ts +20 -4
- package/dist-lib/icons.js +3 -2
- package/dist-lib/index.d.ts +2516 -150
- package/dist-lib/index.js +1532 -5053
- package/dist-lib/page-inset-D_kkVwwN.js +9 -0
- package/dist-lib/page-state-eA6J_KIR.js +124 -0
- package/dist-lib/param-editors-9yJr7xmN.js +201 -0
- package/dist-lib/payload-B2wODLAX.js +86 -0
- package/dist-lib/{peekDraftStore-DSExeoAh.js → peekDraftStore-D4GRsRKW.js} +44 -43
- package/dist-lib/registry-BpzE8-h8.js +119 -0
- package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
- package/dist-lib/testing.d.ts +53 -56
- package/dist-lib/testing.js +54 -55
- package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
- package/dist-lib/{useAgentConversation-BavrHfrU.js → useAgentConversation-D210VDCQ.js} +158 -169
- package/dist-lib/useAuth-CR2YKKXb.js +49 -0
- package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
- package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
- package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
- package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
- package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
- package/dist-lib/useObject-1OCeV34A.js +26 -0
- package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
- package/dist-lib/useParams-ei6w4I7w.js +133 -0
- package/dist-lib/useProperties-CbdhlhZd.js +81 -0
- package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
- package/dist-lib/useScreenBack-J861tbwn.js +71 -0
- package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
- package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
- package/dist-lib/utils-D_QDpB8_.js +11 -0
- package/dist-lib/{value-By1-WJ8J.js → value-CDCeHgOv.js} +8 -22
- package/dist-lib/{action-dispatch-DbiOpvd6.js → variants-CbAwl3Mn.js} +734 -740
- package/dist-lib/vite/index.d.ts +42 -16
- package/dist-lib/window-election-CHIvIZwx.js +45 -0
- package/package.json +17 -24
- package/dist-lib/DetailAuditStrip-B9p1XhjC.js +0 -288
- package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
- package/dist-lib/RefreshControl-BEWSHtAC.js +0 -399
- package/dist-lib/SmartDetailPage.impl-CYiM-ITJ.js +0 -1565
- package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +0 -3051
- package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +0 -780
- package/dist-lib/api/agents.d.ts +0 -140
- package/dist-lib/api/auth-redirect.d.ts +0 -3
- package/dist-lib/api/auth.d.ts +0 -26
- package/dist-lib/api/batch.d.ts +0 -25
- package/dist-lib/api/client.d.ts +0 -51
- package/dist-lib/api/data.d.ts +0 -153
- package/dist-lib/api/entities.d.ts +0 -149
- package/dist-lib/api/events.d.ts +0 -91
- package/dist-lib/api/params.d.ts +0 -28
- package/dist-lib/api/properties.d.ts +0 -3
- package/dist-lib/api/schema.d.ts +0 -2
- package/dist-lib/api/status.d.ts +0 -2
- package/dist-lib/app.d.ts +0 -1
- package/dist-lib/components/actions/ActionButton.d.ts +0 -18
- package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
- package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
- package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
- package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
- package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
- package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
- package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
- package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
- package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
- package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
- package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
- package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
- package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
- package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
- package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
- package/dist-lib/components/chrome/PageShell.d.ts +0 -7
- package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
- package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
- package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
- package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
- package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
- package/dist-lib/components/detail-layout/index.d.ts +0 -21
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
- package/dist-lib/components/fields/BoolField.d.ts +0 -2
- package/dist-lib/components/fields/EmailField.d.ts +0 -2
- package/dist-lib/components/fields/EnumField.d.ts +0 -2
- package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
- package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
- package/dist-lib/components/fields/JsonField.d.ts +0 -3
- package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
- package/dist-lib/components/fields/NumberField.d.ts +0 -2
- package/dist-lib/components/fields/PasswordField.d.ts +0 -2
- package/dist-lib/components/fields/PhoneField.d.ts +0 -2
- package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
- package/dist-lib/components/fields/RefField.d.ts +0 -2
- package/dist-lib/components/fields/RichTextField.d.ts +0 -2
- package/dist-lib/components/fields/SecretField.d.ts +0 -2
- package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
- package/dist-lib/components/fields/StringField.d.ts +0 -2
- package/dist-lib/components/fields/StructureField.d.ts +0 -2
- package/dist-lib/components/fields/TextField.d.ts +0 -2
- package/dist-lib/components/fields/TimestampField.d.ts +0 -2
- package/dist-lib/components/fields/UrlField.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
- package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
- package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
- package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
- package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
- package/dist-lib/components/fields/cells/registry.d.ts +0 -21
- package/dist-lib/components/fields/index.d.ts +0 -28
- package/dist-lib/components/fields/langMap.d.ts +0 -2
- package/dist-lib/components/fields/secretValue.d.ts +0 -2
- package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
- package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
- package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
- package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
- package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
- package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
- package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
- package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
- package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
- package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
- package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
- package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
- package/dist-lib/components/file-widgets/host.d.ts +0 -28
- package/dist-lib/components/file-widgets/index.d.ts +0 -16
- package/dist-lib/components/file-widgets/payload.d.ts +0 -21
- package/dist-lib/components/file-widgets/registry.d.ts +0 -5
- package/dist-lib/components/file-widgets/types.d.ts +0 -17
- package/dist-lib/components/file-widgets/upload.d.ts +0 -45
- package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
- package/dist-lib/components/file-widgets/value.d.ts +0 -4
- package/dist-lib/components/filters/FilterChips.d.ts +0 -14
- package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
- package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
- package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
- package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
- package/dist-lib/components/layout/Layout.d.ts +0 -6
- package/dist-lib/components/layout/Rail.d.ts +0 -22
- package/dist-lib/components/layout/Sidebar.d.ts +0 -12
- package/dist-lib/components/layout/TabStrip.d.ts +0 -6
- package/dist-lib/components/layout/TenantChip.d.ts +0 -26
- package/dist-lib/components/layout/TopBar.d.ts +0 -22
- package/dist-lib/components/layout/tab-close.d.ts +0 -13
- package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
- package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
- package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
- package/dist-lib/components/list/QuickPeek.d.ts +0 -59
- package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
- package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
- package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
- package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
- package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
- package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
- package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
- package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
- package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
- package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
- package/dist-lib/components/pages/auth/icons.d.ts +0 -6
- package/dist-lib/components/pages/exportRequest.d.ts +0 -69
- package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
- package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
- package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
- package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
- package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
- package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
- package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
- package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
- package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
- package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
- package/dist-lib/components/pages/list/columns.d.ts +0 -46
- package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
- package/dist-lib/components/pages/list/page-size.d.ts +0 -3
- package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
- package/dist-lib/components/pages/list/table-features.d.ts +0 -14
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
- package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
- package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
- package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
- package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
- package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
- package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
- package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
- package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
- package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
- package/dist-lib/components/params/param-editors.d.ts +0 -20
- package/dist-lib/components/primitives/Avatar.d.ts +0 -6
- package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
- package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
- package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
- package/dist-lib/components/primitives/Btn.d.ts +0 -19
- package/dist-lib/components/primitives/Check.d.ts +0 -7
- package/dist-lib/components/primitives/Chip.d.ts +0 -9
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
- package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
- package/dist-lib/components/primitives/Fields.d.ts +0 -109
- package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
- package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
- package/dist-lib/components/primitives/Icons.d.ts +0 -136
- package/dist-lib/components/primitives/Kbd.d.ts +0 -4
- package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
- package/dist-lib/components/primitives/Pill.d.ts +0 -11
- package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
- package/dist-lib/components/primitives/RowField.d.ts +0 -10
- package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
- package/dist-lib/components/primitives/Spinner.d.ts +0 -3
- package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
- package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
- package/dist-lib/components/primitives/index.d.ts +0 -37
- package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
- package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
- package/dist-lib/components/shared/CopyButton.d.ts +0 -8
- package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
- package/dist-lib/components/shared/EmptyState.d.ts +0 -9
- package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
- package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
- package/dist-lib/components/shared/Markdown.d.ts +0 -3
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
- package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
- package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
- package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
- package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
- package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
- package/dist-lib/embed/EmbedContext.d.ts +0 -50
- package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
- package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
- package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
- package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
- package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
- package/dist-lib/embed/embed-dirty.d.ts +0 -24
- package/dist-lib/embed/embed-history.d.ts +0 -19
- package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
- package/dist-lib/embed/file-src.d.ts +0 -63
- package/dist-lib/embed/handshake.d.ts +0 -57
- package/dist-lib/embed/index.d.ts +0 -19
- package/dist-lib/embed/params.d.ts +0 -75
- package/dist-lib/embed/protocol.d.ts +0 -165
- package/dist-lib/embed/screen-location.d.ts +0 -50
- package/dist-lib/embed/theme.d.ts +0 -34
- package/dist-lib/embed/token.d.ts +0 -57
- package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
- package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
- package/dist-lib/failure-BT54OLHy.js +0 -158
- package/dist-lib/format-count-DLFCdtME.js +0 -1771
- package/dist-lib/hooks/useActionData.d.ts +0 -61
- package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
- package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
- package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
- package/dist-lib/hooks/useAuth.d.ts +0 -22
- package/dist-lib/hooks/useBranding.d.ts +0 -8
- package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
- package/dist-lib/hooks/useChildrenData.d.ts +0 -3
- package/dist-lib/hooks/useColumns.d.ts +0 -13
- package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
- package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
- package/dist-lib/hooks/useDebounce.d.ts +0 -1
- package/dist-lib/hooks/useEntity.d.ts +0 -2
- package/dist-lib/hooks/useEntityData.d.ts +0 -41
- package/dist-lib/hooks/useFilters.d.ts +0 -14
- package/dist-lib/hooks/useImpersonation.d.ts +0 -23
- package/dist-lib/hooks/useLanguage.d.ts +0 -4
- package/dist-lib/hooks/useLiveObject.d.ts +0 -9
- package/dist-lib/hooks/useLongPress.d.ts +0 -29
- package/dist-lib/hooks/useMutations.d.ts +0 -13
- package/dist-lib/hooks/useObject.d.ts +0 -11
- package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
- package/dist-lib/hooks/usePageState.d.ts +0 -32
- package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
- package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
- package/dist-lib/hooks/useParams.d.ts +0 -49
- package/dist-lib/hooks/useProperties.d.ts +0 -5
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
- package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
- package/dist-lib/hooks/useSSE.d.ts +0 -31
- package/dist-lib/hooks/useSchema.d.ts +0 -1
- package/dist-lib/hooks/useScreen.d.ts +0 -2
- package/dist-lib/hooks/useScreenBack.d.ts +0 -21
- package/dist-lib/hooks/useScreenTab.d.ts +0 -10
- package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
- package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
- package/dist-lib/hooks/useTabTitle.d.ts +0 -2
- package/dist-lib/hooks/useText.d.ts +0 -3
- package/dist-lib/hooks/useTimelineData.d.ts +0 -10
- package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
- package/dist-lib/hooks/useViews.d.ts +0 -26
- package/dist-lib/lib/action-dispatch.d.ts +0 -8
- package/dist-lib/lib/actions.d.ts +0 -254
- package/dist-lib/lib/anchor.d.ts +0 -36
- package/dist-lib/lib/brand-tokens.d.ts +0 -43
- package/dist-lib/lib/branding.d.ts +0 -20
- package/dist-lib/lib/canonical-url.d.ts +0 -27
- package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
- package/dist-lib/lib/child-config.d.ts +0 -24
- package/dist-lib/lib/children-validation.d.ts +0 -5
- package/dist-lib/lib/decimal-text.d.ts +0 -1
- package/dist-lib/lib/display-value.d.ts +0 -1
- package/dist-lib/lib/document-templates.d.ts +0 -11
- package/dist-lib/lib/download.d.ts +0 -21
- package/dist-lib/lib/evidence-verdict.d.ts +0 -11
- package/dist-lib/lib/failure.d.ts +0 -2
- package/dist-lib/lib/field-classification.d.ts +0 -61
- package/dist-lib/lib/field-regions.d.ts +0 -8
- package/dist-lib/lib/filter-evaluator.d.ts +0 -16
- package/dist-lib/lib/filters.d.ts +0 -93
- package/dist-lib/lib/format-count.d.ts +0 -41
- package/dist-lib/lib/html-state.d.ts +0 -11
- package/dist-lib/lib/language.d.ts +0 -19
- package/dist-lib/lib/longPressGesture.d.ts +0 -55
- package/dist-lib/lib/mass-edit.d.ts +0 -32
- package/dist-lib/lib/page-inset.d.ts +0 -3
- package/dist-lib/lib/quick-add.d.ts +0 -2
- package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
- package/dist-lib/lib/realtime-resync.d.ts +0 -23
- package/dist-lib/lib/record-documents-key.d.ts +0 -1
- package/dist-lib/lib/rich-text.d.ts +0 -14
- package/dist-lib/lib/rowClickGesture.d.ts +0 -26
- package/dist-lib/lib/safe-url.d.ts +0 -15
- package/dist-lib/lib/schema-routing.d.ts +0 -3
- package/dist-lib/lib/screen-back.d.ts +0 -70
- package/dist-lib/lib/scroll-restoration.d.ts +0 -90
- package/dist-lib/lib/size-value.d.ts +0 -16
- package/dist-lib/lib/sort.d.ts +0 -72
- package/dist-lib/lib/timestamp.d.ts +0 -53
- package/dist-lib/lib/toast.d.ts +0 -49
- package/dist-lib/lib/ui-actions.d.ts +0 -12
- package/dist-lib/lib/utils.d.ts +0 -9
- package/dist-lib/lib/variants.d.ts +0 -7
- package/dist-lib/lib/versionTracker.d.ts +0 -72
- package/dist-lib/lib/viewport-category.d.ts +0 -44
- package/dist-lib/main.d.ts +0 -1
- package/dist-lib/registry-CRPxNbkk.js +0 -1956
- package/dist-lib/safe-url-oSJw5pzO.js +0 -34
- package/dist-lib/stores/auth.d.ts +0 -16
- package/dist-lib/stores/list-layout.d.ts +0 -85
- package/dist-lib/stores/page-state.d.ts +0 -61
- package/dist-lib/stores/preferences.d.ts +0 -37
- package/dist-lib/stores/realtime.d.ts +0 -96
- package/dist-lib/stores/screen-registry.d.ts +0 -17
- package/dist-lib/stores/tabs.d.ts +0 -73
- package/dist-lib/types/api.d.ts +0 -580
- package/dist-lib/types/fieldType.d.ts +0 -2
- package/dist-lib/types/files.d.ts +0 -79
- package/dist-lib/types/ordmap.d.ts +0 -39
- package/dist-lib/types/schema.d.ts +0 -1089
- package/dist-lib/useCurrentScreen-BPq7HMF1.js +0 -7840
- package/dist-lib/useListQuery-CG1WM4cv.js +0 -103
- package/dist-lib/useOwnRefresh-C18iWRgr.js +0 -1167
- package/dist-lib/useProperties-C35JrjwQ.js +0 -83
- package/dist-lib/useTabSearchMirror-DKktWWLB.js +0 -175
- package/dist-lib/useText-BFDCTUSo.js +0 -952
- package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
|
@@ -0,0 +1,1440 @@
|
|
|
1
|
+
import { $ as e, An as t, Bn as n, D as r, Dn as i, En as a, Ft as o, In as s, It as c, Ln as l, Nt as u, Q as d, Qn as f, Rn as p, S as m, U as h, W as g, Xn as _, an as v, fn as y, g as b, it as x, jn as S, kn as C, lt as w, pt as T, qn as E, r as D, rt as O, s as k, ut as A, wt as j, y as ee } from "./useCurrentScreen--UovgvRj.js";
|
|
2
|
+
import { o as M } from "./useParams-ei6w4I7w.js";
|
|
3
|
+
import { Suspense as N, createContext as te, lazy as P, useCallback as F, useContext as ne, useEffect as I, useMemo as L, useReducer as re, useRef as R, useState as z } from "react";
|
|
4
|
+
import { hashKey as ie, useInfiniteQuery as ae, useQuery as oe, useQueryClient as B } from "@tanstack/react-query";
|
|
5
|
+
import { jsx as V, jsxs as se } from "react/jsx-runtime";
|
|
6
|
+
import { create as ce } from "zustand";
|
|
7
|
+
//#region src/components/actions/ActionResultDialog.tsx
|
|
8
|
+
var le = P(() => import("./ActionResultDialog.impl-BUBm9Ck3.js").then((e) => ({ default: e.ActionResultDialog })));
|
|
9
|
+
function ue(e) {
|
|
10
|
+
return /* @__PURE__ */ V(N, {
|
|
11
|
+
fallback: null,
|
|
12
|
+
children: /* @__PURE__ */ V(le, { ...e })
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/hooks/useChildrenData.ts
|
|
17
|
+
var de = "entity-children";
|
|
18
|
+
function fe(e, t, n, r, a, o) {
|
|
19
|
+
let s = k(n), c = b(s, a), l = Array.isArray(r) ? r : [r], u = Array.isArray(r) ? y(t, l.length) : [t];
|
|
20
|
+
return oe({
|
|
21
|
+
queryKey: [
|
|
22
|
+
de,
|
|
23
|
+
e,
|
|
24
|
+
t,
|
|
25
|
+
n,
|
|
26
|
+
c,
|
|
27
|
+
o
|
|
28
|
+
],
|
|
29
|
+
queryFn: () => {
|
|
30
|
+
let e = new URLSearchParams();
|
|
31
|
+
if (!u) throw Error("invalid composite parent id");
|
|
32
|
+
let t = l.map((e, t) => ({
|
|
33
|
+
field: e,
|
|
34
|
+
op: "eq",
|
|
35
|
+
value: u[t]
|
|
36
|
+
}));
|
|
37
|
+
return e.set("filters", JSON.stringify(t)), c && e.set("sort", c), o && e.set("limit", String(o)), i(`/api/data/${n}?${e.toString()}`);
|
|
38
|
+
},
|
|
39
|
+
enabled: !!e && !!t && !!n && !!r && u !== null
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/hooks/useActionData.ts
|
|
44
|
+
var pe = "action-data", me = "action-data-cursor";
|
|
45
|
+
function he(e, t) {
|
|
46
|
+
return [
|
|
47
|
+
pe,
|
|
48
|
+
e,
|
|
49
|
+
t
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
function ge(e, t, n = !0) {
|
|
53
|
+
return oe({
|
|
54
|
+
queryKey: he(e, t),
|
|
55
|
+
queryFn: async () => (await A(e, t)).result,
|
|
56
|
+
enabled: !!e && n
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function _e(e, t) {
|
|
60
|
+
return [
|
|
61
|
+
me,
|
|
62
|
+
e,
|
|
63
|
+
t
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
function ve(e, t, n = !0) {
|
|
67
|
+
let r = _e(e, t), i = ae({
|
|
68
|
+
queryKey: r,
|
|
69
|
+
queryFn: async ({ pageParam: n }) => {
|
|
70
|
+
let r = n ? {
|
|
71
|
+
...t,
|
|
72
|
+
cursor: n
|
|
73
|
+
} : t;
|
|
74
|
+
return (await A(e, r)).result;
|
|
75
|
+
},
|
|
76
|
+
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
77
|
+
initialPageParam: void 0,
|
|
78
|
+
enabled: !!e && n
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
rows: L(() => i.data?.pages.flatMap((e) => e?.data ?? []) ?? [], [i.data]),
|
|
82
|
+
hasMore: !!i.hasNextPage,
|
|
83
|
+
fetchNextPage: () => {
|
|
84
|
+
i.fetchNextPage();
|
|
85
|
+
},
|
|
86
|
+
isFetchingNextPage: i.isFetchingNextPage,
|
|
87
|
+
isLoading: i.isLoading,
|
|
88
|
+
isError: i.isError,
|
|
89
|
+
error: i.error,
|
|
90
|
+
refetch: () => {
|
|
91
|
+
i.refetch();
|
|
92
|
+
},
|
|
93
|
+
queryKey: r
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/stores/realtime.ts
|
|
98
|
+
var H = ce((e, t) => {
|
|
99
|
+
let n = 0, r = 0;
|
|
100
|
+
return {
|
|
101
|
+
degradedEntities: /* @__PURE__ */ new Map(),
|
|
102
|
+
markDegraded: (r) => {
|
|
103
|
+
if (!r) return;
|
|
104
|
+
let i = new Map(t().degradedEntities);
|
|
105
|
+
i.set(r, {
|
|
106
|
+
mark: ++n,
|
|
107
|
+
since: i.get(r)?.since ?? Date.now()
|
|
108
|
+
}), e({ degradedEntities: i });
|
|
109
|
+
},
|
|
110
|
+
unmarkDegraded: (n) => {
|
|
111
|
+
let r = new Map(t().degradedEntities);
|
|
112
|
+
for (let [e, t] of n) r.get(e)?.mark === t && r.delete(e);
|
|
113
|
+
r.size !== t().degradedEntities.size && e({ degradedEntities: r });
|
|
114
|
+
},
|
|
115
|
+
connectionInterruptedSince: null,
|
|
116
|
+
holdConnectionInterruption: () => {
|
|
117
|
+
t().connectionInterruptedSince === null && e({ connectionInterruptedSince: Date.now() });
|
|
118
|
+
},
|
|
119
|
+
clearConnectionInterruption: () => {
|
|
120
|
+
t().connectionInterruptedSince !== null && e({ connectionInterruptedSince: null });
|
|
121
|
+
},
|
|
122
|
+
relayInterruptedSince: null,
|
|
123
|
+
holdRelayInterruption: () => {
|
|
124
|
+
t().relayInterruptedSince === null && e({ relayInterruptedSince: Date.now() });
|
|
125
|
+
},
|
|
126
|
+
clearRelayInterruption: () => {
|
|
127
|
+
t().relayInterruptedSince !== null && e({ relayInterruptedSince: null });
|
|
128
|
+
},
|
|
129
|
+
replayStartedAt: null,
|
|
130
|
+
startReplay: () => {
|
|
131
|
+
t().replayStartedAt === null && e({ replayStartedAt: Date.now() });
|
|
132
|
+
},
|
|
133
|
+
endReplay: () => {
|
|
134
|
+
t().replayStartedAt !== null && e({ replayStartedAt: null });
|
|
135
|
+
},
|
|
136
|
+
thresholds: null,
|
|
137
|
+
setThresholds: (n) => {
|
|
138
|
+
let r = t().thresholds;
|
|
139
|
+
r === n || typeof r == "object" && r && typeof n == "object" && n && r.pauseGraceMs === n.pauseGraceMs && r.silenceMs === n.silenceMs || e({ thresholds: n });
|
|
140
|
+
},
|
|
141
|
+
resyncs: [],
|
|
142
|
+
addResync: (n) => {
|
|
143
|
+
let i = ++r;
|
|
144
|
+
return e({ resyncs: [...t().resyncs, {
|
|
145
|
+
...n,
|
|
146
|
+
id: i
|
|
147
|
+
}] }), i;
|
|
148
|
+
},
|
|
149
|
+
updateResync: (n, r) => {
|
|
150
|
+
e({ resyncs: t().resyncs.map((e) => e.id === n ? {
|
|
151
|
+
...e,
|
|
152
|
+
...r
|
|
153
|
+
} : e) });
|
|
154
|
+
},
|
|
155
|
+
removeResync: (n) => {
|
|
156
|
+
t().resyncs.some((e) => e.id === n) && e({ resyncs: t().resyncs.filter((e) => e.id !== n) });
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
function ye(e, t, n) {
|
|
161
|
+
return e === !0 && !t.has(n);
|
|
162
|
+
}
|
|
163
|
+
function be(e, t, n, r) {
|
|
164
|
+
let i = {
|
|
165
|
+
live: !1,
|
|
166
|
+
recheckAt: null
|
|
167
|
+
};
|
|
168
|
+
if (t !== !0 || e.degradedEntities.has(n) || e.thresholds === "unreadable") return i;
|
|
169
|
+
let a = [];
|
|
170
|
+
for (let t of [
|
|
171
|
+
e.connectionInterruptedSince,
|
|
172
|
+
e.relayInterruptedSince,
|
|
173
|
+
e.replayStartedAt
|
|
174
|
+
]) t !== null && a.push(t);
|
|
175
|
+
for (let t of e.resyncs) if (t.blocking.has(n)) {
|
|
176
|
+
if (t.standing) return i;
|
|
177
|
+
a.push(t.openedAt);
|
|
178
|
+
}
|
|
179
|
+
if (a.length === 0 || e.thresholds === null) return {
|
|
180
|
+
live: !0,
|
|
181
|
+
recheckAt: null
|
|
182
|
+
};
|
|
183
|
+
let o = e.thresholds.pauseGraceMs, s = null;
|
|
184
|
+
for (let e of a) {
|
|
185
|
+
if (r - e >= o) return i;
|
|
186
|
+
s = s === null ? e + o : Math.min(s, e + o);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
live: !0,
|
|
190
|
+
recheckAt: s
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function xe(e, t) {
|
|
194
|
+
let n = H((e) => e.degradedEntities), r = H((e) => e.connectionInterruptedSince), i = H((e) => e.relayInterruptedSince), a = H((e) => e.replayStartedAt), o = H((e) => e.thresholds), s = H((e) => e.resyncs), [, c] = re((e) => e + 1, 0), { live: l, recheckAt: u } = be({
|
|
195
|
+
degradedEntities: n,
|
|
196
|
+
connectionInterruptedSince: r,
|
|
197
|
+
relayInterruptedSince: i,
|
|
198
|
+
replayStartedAt: a,
|
|
199
|
+
thresholds: o,
|
|
200
|
+
resyncs: s
|
|
201
|
+
}, e, t, Date.now());
|
|
202
|
+
return I(() => {
|
|
203
|
+
if (u === null) return;
|
|
204
|
+
let e = setTimeout(c, Math.max(0, u - Date.now()));
|
|
205
|
+
return () => clearTimeout(e);
|
|
206
|
+
}, [u]), l;
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/hooks/useRealtimeThresholds.ts
|
|
210
|
+
var Se = "realtime_pause_grace_seconds", Ce = "realtime_silence_seconds";
|
|
211
|
+
function we(e, t) {
|
|
212
|
+
if (t.error) return `${e} could not be read: ${t.error.message}`;
|
|
213
|
+
if (!t.data?.found) return `${e} is not declared`;
|
|
214
|
+
let n = t.data.value;
|
|
215
|
+
return typeof n != "number" || !Number.isFinite(n) || n < 0 ? `${e} is not a non-negative number: ${JSON.stringify(n)}` : n * 1e3;
|
|
216
|
+
}
|
|
217
|
+
function Te() {
|
|
218
|
+
let e = c((e) => e.isAuthenticated), t = M(Se, { enabled: e }), n = M(Ce, { enabled: e }), r = !t.isPending && !n.isPending, i = r ? we(Se, t) : null, a = r ? we(Ce, n) : null;
|
|
219
|
+
I(() => {
|
|
220
|
+
if (i === null || a === null) return;
|
|
221
|
+
let e = H.getState();
|
|
222
|
+
if (typeof i == "number" && typeof a == "number") {
|
|
223
|
+
let t = {
|
|
224
|
+
pauseGraceMs: i,
|
|
225
|
+
silenceMs: a
|
|
226
|
+
};
|
|
227
|
+
e.setThresholds(t);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
let t = [i, a].filter((e) => typeof e == "string");
|
|
231
|
+
console.error(`realtime: showing "Updates paused" - ${t.join("; ")}`), e.setThresholds("unreadable");
|
|
232
|
+
}, [i, a]);
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/lib/record-documents-key.ts
|
|
236
|
+
var Ee = "record-documents", De = {
|
|
237
|
+
nulls_first: "first",
|
|
238
|
+
nulls_last: "last"
|
|
239
|
+
};
|
|
240
|
+
function Oe(e) {
|
|
241
|
+
if (!e) return [];
|
|
242
|
+
let t = [];
|
|
243
|
+
for (let n of e.split(",")) {
|
|
244
|
+
let e = n.trim();
|
|
245
|
+
if (!e) continue;
|
|
246
|
+
let r = e.split(":"), i = r[0]?.trim();
|
|
247
|
+
if (!i || i.startsWith("$property.")) continue;
|
|
248
|
+
let a = {
|
|
249
|
+
field: i,
|
|
250
|
+
dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
|
|
251
|
+
}, o = r[2]?.trim().toLowerCase();
|
|
252
|
+
if (o) {
|
|
253
|
+
let e = De[o];
|
|
254
|
+
e && (a.nulls = e);
|
|
255
|
+
}
|
|
256
|
+
t.push(a);
|
|
257
|
+
}
|
|
258
|
+
return t;
|
|
259
|
+
}
|
|
260
|
+
function ke(e) {
|
|
261
|
+
if (!e) return;
|
|
262
|
+
let t = [];
|
|
263
|
+
for (let n of e.split(",")) {
|
|
264
|
+
let e = n.trim();
|
|
265
|
+
if (!e) continue;
|
|
266
|
+
let r = e.split(":")[0]?.trim();
|
|
267
|
+
r && r.startsWith("$property.") || t.push(e);
|
|
268
|
+
}
|
|
269
|
+
return t.length > 0 ? t.join(",") : void 0;
|
|
270
|
+
}
|
|
271
|
+
function Ae(e) {
|
|
272
|
+
return e.map((e) => {
|
|
273
|
+
let t = `${e.field}:${e.dir}`;
|
|
274
|
+
return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
|
|
275
|
+
}).join(",");
|
|
276
|
+
}
|
|
277
|
+
function je(e, t) {
|
|
278
|
+
let n = e.findIndex((e) => e.field === t);
|
|
279
|
+
return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
|
|
280
|
+
field: t,
|
|
281
|
+
dir: "asc"
|
|
282
|
+
}];
|
|
283
|
+
}
|
|
284
|
+
function Me(e, t) {
|
|
285
|
+
let n = e.filter((e) => e.field !== t.field);
|
|
286
|
+
return n.length >= 5 ? e : [...n, t];
|
|
287
|
+
}
|
|
288
|
+
function Ne(e, t) {
|
|
289
|
+
let n = e.findIndex((e) => e.field === t);
|
|
290
|
+
return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/api/entities.ts
|
|
294
|
+
function Pe(e, t) {
|
|
295
|
+
return e.$statuses?.find((e) => e.group_code === t);
|
|
296
|
+
}
|
|
297
|
+
function Fe(e, t) {
|
|
298
|
+
return e.$properties?.find((e) => e.property_code === t);
|
|
299
|
+
}
|
|
300
|
+
function U(e) {
|
|
301
|
+
let t = { ...e };
|
|
302
|
+
return t.$status = (e) => Pe(t, e), t.$property = (e) => Fe(t, e), t;
|
|
303
|
+
}
|
|
304
|
+
var Ie = class {
|
|
305
|
+
cache = {};
|
|
306
|
+
merge(e) {
|
|
307
|
+
if (e) for (let t of Object.keys(e)) {
|
|
308
|
+
this.cache[t] || (this.cache[t] = {});
|
|
309
|
+
let n = e[t];
|
|
310
|
+
for (let e of Object.keys(n)) this.cache[t][e] = {
|
|
311
|
+
...this.cache[t][e],
|
|
312
|
+
...n[e]
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
all() {
|
|
317
|
+
return this.cache;
|
|
318
|
+
}
|
|
319
|
+
get(e, t) {
|
|
320
|
+
return this.cache[e]?.[t];
|
|
321
|
+
}
|
|
322
|
+
clear() {
|
|
323
|
+
this.cache = {};
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
function Le(e, t) {
|
|
327
|
+
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
328
|
+
return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.expand && t.expand.length > 0 && n.searchParams.set("expand", t.expand.join(",")), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.limit && n.searchParams.set("limit", String(t.limit)), t.after && n.searchParams.set("after", t.after), t.count && n.searchParams.set("count", "with"), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), n.pathname + n.search;
|
|
329
|
+
}
|
|
330
|
+
var W = class {
|
|
331
|
+
entity;
|
|
332
|
+
refs;
|
|
333
|
+
constructor(e, t) {
|
|
334
|
+
this.entity = e, this.refs = t ?? new Ie();
|
|
335
|
+
}
|
|
336
|
+
async get(e) {
|
|
337
|
+
let t = new URLSearchParams(typeof e == "string" ? { id: e } : e);
|
|
338
|
+
return U((await i(`/api/data/${this.entity}?${t.toString()}`)).data);
|
|
339
|
+
}
|
|
340
|
+
async list(e = {}) {
|
|
341
|
+
let t, n = !1;
|
|
342
|
+
try {
|
|
343
|
+
t = await i(Le(this.entity, e));
|
|
344
|
+
} catch (r) {
|
|
345
|
+
if (e.after && f(r)) {
|
|
346
|
+
let { after: r, ...a } = e;
|
|
347
|
+
t = await i(Le(this.entity, a)), n = !0;
|
|
348
|
+
} else throw r;
|
|
349
|
+
}
|
|
350
|
+
return this.refs.merge(t.$refs), {
|
|
351
|
+
data: t.data.map((e) => U(e)),
|
|
352
|
+
meta: t.meta,
|
|
353
|
+
$refs: this.refs.all(),
|
|
354
|
+
reset: n
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
async create(e) {
|
|
358
|
+
return (await this.createMany([e]))[0];
|
|
359
|
+
}
|
|
360
|
+
async createMany(e) {
|
|
361
|
+
if (e.length === 0) return [];
|
|
362
|
+
let t = e.map((e) => ({
|
|
363
|
+
action: `${this.entity}.__create`,
|
|
364
|
+
params: {
|
|
365
|
+
entity: this.entity,
|
|
366
|
+
fields: e
|
|
367
|
+
}
|
|
368
|
+
})), n = await C("system.batch", {
|
|
369
|
+
actions: t,
|
|
370
|
+
atomic: !0
|
|
371
|
+
});
|
|
372
|
+
return G(n, `${this.entity}.__create`), n.results.map((e) => U(Re(e)));
|
|
373
|
+
}
|
|
374
|
+
async update(e, t) {
|
|
375
|
+
return (await this.updateMany([{
|
|
376
|
+
id: e,
|
|
377
|
+
...t
|
|
378
|
+
}]))[0];
|
|
379
|
+
}
|
|
380
|
+
async updateMany(e) {
|
|
381
|
+
if (e.length === 0) return [];
|
|
382
|
+
let t = e.map(({ id: e, ...t }) => ({
|
|
383
|
+
action: `${this.entity}.__update`,
|
|
384
|
+
params: {
|
|
385
|
+
object_ids: [e],
|
|
386
|
+
entity: this.entity,
|
|
387
|
+
fields: t
|
|
388
|
+
}
|
|
389
|
+
})), n = await C("system.batch", {
|
|
390
|
+
actions: t,
|
|
391
|
+
atomic: !0
|
|
392
|
+
});
|
|
393
|
+
return G(n, `${this.entity}.__update`), n.results.map((e) => U(Re(e)));
|
|
394
|
+
}
|
|
395
|
+
async delete(e) {
|
|
396
|
+
await this.deleteMany([e]);
|
|
397
|
+
}
|
|
398
|
+
async deleteMany(e) {
|
|
399
|
+
return e.length === 0 ? { count: 0 } : { count: (await A(`${this.entity}.__delete`, {
|
|
400
|
+
object_ids: e,
|
|
401
|
+
entity: this.entity
|
|
402
|
+
})).object_count ?? e.length };
|
|
403
|
+
}
|
|
404
|
+
async restore(e) {
|
|
405
|
+
await this.restoreMany([e]);
|
|
406
|
+
}
|
|
407
|
+
async restoreMany(e) {
|
|
408
|
+
return e.length === 0 ? { count: 0 } : { count: (await A(`${this.entity}.__restore`, {
|
|
409
|
+
object_ids: e,
|
|
410
|
+
entity: this.entity
|
|
411
|
+
})).object_count ?? e.length };
|
|
412
|
+
}
|
|
413
|
+
async upsert(e, t) {
|
|
414
|
+
return (await this.upsertMany([e], t))[0];
|
|
415
|
+
}
|
|
416
|
+
async upsertMany(e, t) {
|
|
417
|
+
if (e.length === 0) return [];
|
|
418
|
+
let n = e.map((e) => ({
|
|
419
|
+
action: `${this.entity}.__upsert`,
|
|
420
|
+
params: {
|
|
421
|
+
entity: this.entity,
|
|
422
|
+
fields: e,
|
|
423
|
+
unique_by: t
|
|
424
|
+
}
|
|
425
|
+
})), r = await C("system.batch", {
|
|
426
|
+
actions: n,
|
|
427
|
+
atomic: !0
|
|
428
|
+
});
|
|
429
|
+
return G(r, `${this.entity}.__upsert`), r.results.map((e) => U(ze(e)));
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
function G(e, t) {
|
|
433
|
+
if (e.committed) return;
|
|
434
|
+
let n = e.results.find((e) => !e.ok), r = n?.error ? `${_(n.error.type)}: ${n.error.title}` : "batch did not commit";
|
|
435
|
+
throw Error(`${t} batch failed: ${r}`);
|
|
436
|
+
}
|
|
437
|
+
function Re(e) {
|
|
438
|
+
let t = e.result ?? {};
|
|
439
|
+
return (Array.isArray(t.rows) ? t.rows[0] : void 0) ?? {};
|
|
440
|
+
}
|
|
441
|
+
function ze(e) {
|
|
442
|
+
let t = e.result ?? {};
|
|
443
|
+
return (Array.isArray(t.rows) ? t.rows[0] : void 0)?.row ?? {};
|
|
444
|
+
}
|
|
445
|
+
function Be(e, t) {
|
|
446
|
+
return new W(e, t);
|
|
447
|
+
}
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/hooks/useCursorEntityData.ts
|
|
450
|
+
var K = "entity-data-cursor";
|
|
451
|
+
function Ve(e) {
|
|
452
|
+
return JSON.stringify({
|
|
453
|
+
sort: e.sort,
|
|
454
|
+
filters: e.filters,
|
|
455
|
+
search: e.search,
|
|
456
|
+
select: e.select,
|
|
457
|
+
expand: e.expand,
|
|
458
|
+
includeDeleted: e.includeDeleted,
|
|
459
|
+
screen: e.screen,
|
|
460
|
+
preview: e.preview,
|
|
461
|
+
limit: e.limit
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
function He(e, t) {
|
|
465
|
+
return [
|
|
466
|
+
K,
|
|
467
|
+
e,
|
|
468
|
+
Ve(t)
|
|
469
|
+
];
|
|
470
|
+
}
|
|
471
|
+
function Ue(e, t, n) {
|
|
472
|
+
let r = B(), i = L(() => new W(e ?? ""), [e]), a = L(() => Ve(t), [t]), o = L(() => [
|
|
473
|
+
K,
|
|
474
|
+
e,
|
|
475
|
+
a
|
|
476
|
+
], [e, a]), s = ae({
|
|
477
|
+
queryKey: o,
|
|
478
|
+
queryFn: ({ pageParam: e }) => i.list({
|
|
479
|
+
sort: t.sort,
|
|
480
|
+
filters: t.filters,
|
|
481
|
+
search: t.search,
|
|
482
|
+
select: t.select,
|
|
483
|
+
expand: t.expand,
|
|
484
|
+
include_deleted: t.includeDeleted || void 0,
|
|
485
|
+
screen: t.screen,
|
|
486
|
+
preview: t.preview,
|
|
487
|
+
limit: t.limit,
|
|
488
|
+
after: e ?? void 0,
|
|
489
|
+
count: !e || void 0
|
|
490
|
+
}),
|
|
491
|
+
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
492
|
+
initialPageParam: void 0,
|
|
493
|
+
enabled: !!e && n,
|
|
494
|
+
placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
|
|
495
|
+
}), c = s.data?.pages, l = c && c.length > 1 ? c[c.length - 1]?.reset : !1;
|
|
496
|
+
I(() => {
|
|
497
|
+
l && r.resetQueries({ queryKey: o });
|
|
498
|
+
}, [
|
|
499
|
+
l,
|
|
500
|
+
r,
|
|
501
|
+
o
|
|
502
|
+
]);
|
|
503
|
+
let u = L(() => (s.data?.pages ?? []).flatMap((e) => e.data), [s.data?.pages]), d = s.data?.pages?.[0]?.meta;
|
|
504
|
+
return {
|
|
505
|
+
rows: u,
|
|
506
|
+
refs: s.data?.pages?.[s.data.pages.length - 1]?.$refs,
|
|
507
|
+
total: d && !d.count_unknown ? d.total : void 0,
|
|
508
|
+
countMode: d?.count_mode,
|
|
509
|
+
countUnknown: d?.count_unknown ?? !1,
|
|
510
|
+
hasMore: s.hasNextPage,
|
|
511
|
+
fetchNextPage: s.fetchNextPage,
|
|
512
|
+
isFetchingNextPage: s.isFetchingNextPage,
|
|
513
|
+
isLoading: s.isLoading,
|
|
514
|
+
isFetching: s.isFetching,
|
|
515
|
+
isPlaceholderData: s.isPlaceholderData,
|
|
516
|
+
isError: s.isError,
|
|
517
|
+
error: s.error,
|
|
518
|
+
refetch: s.refetch
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
//#endregion
|
|
522
|
+
//#region src/lib/realtime-query-keys.ts
|
|
523
|
+
var We = ["entity-data", "entity-data-all"], Ge = [K], Ke = [...We, ...Ge], qe = "generated_document";
|
|
524
|
+
function Je(e) {
|
|
525
|
+
return typeof e[0] == "string" && Ke.includes(e[0]);
|
|
526
|
+
}
|
|
527
|
+
function Ye(e) {
|
|
528
|
+
return Ge.includes(e[0]);
|
|
529
|
+
}
|
|
530
|
+
function Xe(e) {
|
|
531
|
+
return Je(e) || e[0] === "entity-count" || e[0] === "entity-item";
|
|
532
|
+
}
|
|
533
|
+
function q(e) {
|
|
534
|
+
let t = null;
|
|
535
|
+
return Xe(e) ? t = e[1] : e[0] === "entity-children" ? t = e[3] : e[0] === "record-documents" && (t = qe), typeof t == "string" ? t : null;
|
|
536
|
+
}
|
|
537
|
+
function Ze(e) {
|
|
538
|
+
return q(e) !== null;
|
|
539
|
+
}
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/lib/realtime-resync.ts
|
|
542
|
+
var Qe = 3e3, $e = /* @__PURE__ */ new WeakMap();
|
|
543
|
+
function et(e) {
|
|
544
|
+
let t = $e.get(e);
|
|
545
|
+
return t || (t = {
|
|
546
|
+
counter: 0,
|
|
547
|
+
inFlight: /* @__PURE__ */ new WeakMap(),
|
|
548
|
+
lastSettled: /* @__PURE__ */ new WeakMap(),
|
|
549
|
+
lastSuccess: /* @__PURE__ */ new WeakMap()
|
|
550
|
+
}, $e.set(e, t)), t;
|
|
551
|
+
}
|
|
552
|
+
function tt(e, t) {
|
|
553
|
+
if (t.type !== "updated") return;
|
|
554
|
+
let { query: n, action: r } = t;
|
|
555
|
+
switch (r.type) {
|
|
556
|
+
case "fetch":
|
|
557
|
+
e.inFlight.set(n, ++e.counter);
|
|
558
|
+
return;
|
|
559
|
+
case "success": {
|
|
560
|
+
if (r.manual) return;
|
|
561
|
+
let t = e.inFlight.get(n);
|
|
562
|
+
e.inFlight.delete(n), e.lastSettled.set(n, t), t !== void 0 && e.lastSuccess.set(n, t);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
case "error":
|
|
566
|
+
e.lastSettled.set(n, e.inFlight.get(n)), e.inFlight.delete(n);
|
|
567
|
+
return;
|
|
568
|
+
case "setState":
|
|
569
|
+
n.state.fetchStatus === "idle" && e.inFlight.delete(n);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
function J(e) {
|
|
574
|
+
return e.getObserversCount() > 0 && !e.isDisabled() && !e.isStatic();
|
|
575
|
+
}
|
|
576
|
+
function nt(e, t) {
|
|
577
|
+
if (e.kind === "keys") return !1;
|
|
578
|
+
let n = q(t);
|
|
579
|
+
return n === null ? !1 : e.kind === "all" || e.entities.has(n);
|
|
580
|
+
}
|
|
581
|
+
function Y(e, t) {
|
|
582
|
+
let n = H.getState(), r = et(e).counter, i = t.carriedMarks ?? /* @__PURE__ */ new Map();
|
|
583
|
+
if (t.scope.kind === "all" && !t.standing) {
|
|
584
|
+
let e = n.resyncs.find((e) => e.scope.kind === "all" && !e.issued && !e.standing);
|
|
585
|
+
if (e) {
|
|
586
|
+
n.updateResync(e.id, {
|
|
587
|
+
generation: r,
|
|
588
|
+
jitter: e.jitter || t.jitter === !0,
|
|
589
|
+
carriedMarks: new Map([...e.carriedMarks, ...i])
|
|
590
|
+
});
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
let a = /* @__PURE__ */ new Map();
|
|
595
|
+
if (t.scope.kind === "keys") for (let e of t.keys ?? []) a.set(ie(e), e);
|
|
596
|
+
else for (let n of e.getQueryCache().getAll()) nt(t.scope, n.queryKey) && a.set(n.queryHash, n.queryKey);
|
|
597
|
+
n.addResync({
|
|
598
|
+
generation: r,
|
|
599
|
+
openedAt: Date.now(),
|
|
600
|
+
standing: t.standing === !0,
|
|
601
|
+
issued: !1,
|
|
602
|
+
jitter: t.jitter === !0,
|
|
603
|
+
scope: t.scope,
|
|
604
|
+
keys: a,
|
|
605
|
+
observed: /* @__PURE__ */ new Map(),
|
|
606
|
+
carriedMarks: i,
|
|
607
|
+
blocking: /* @__PURE__ */ new Set()
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
var rt = class {
|
|
611
|
+
queryClient;
|
|
612
|
+
record;
|
|
613
|
+
timers = /* @__PURE__ */ new Map();
|
|
614
|
+
unsubscribers = [];
|
|
615
|
+
relayHeld;
|
|
616
|
+
running = !1;
|
|
617
|
+
dirty = !1;
|
|
618
|
+
constructor(e) {
|
|
619
|
+
this.queryClient = e, this.record = et(e), this.relayHeld = H.getState().relayInterruptedSince !== null;
|
|
620
|
+
}
|
|
621
|
+
start() {
|
|
622
|
+
this.unsubscribers.push(this.queryClient.getQueryCache().subscribe((e) => this.onCacheEvent(e)), H.subscribe((e, t) => {
|
|
623
|
+
(e.resyncs !== t.resyncs || e.relayInterruptedSince !== t.relayInterruptedSince) && this.reconcile();
|
|
624
|
+
})), this.reconcile();
|
|
625
|
+
}
|
|
626
|
+
stop() {
|
|
627
|
+
for (let e of this.unsubscribers.splice(0)) e();
|
|
628
|
+
for (let e of this.timers.values()) clearTimeout(e);
|
|
629
|
+
this.timers.clear();
|
|
630
|
+
}
|
|
631
|
+
onCacheEvent(e) {
|
|
632
|
+
tt(this.record, e);
|
|
633
|
+
let t = H.getState().resyncs;
|
|
634
|
+
t.length !== 0 && ((e.type === "added" || e.type === "observerAdded") && this.takeInKey(t, e.query), e.type === "updated" && (e.action.type === "error" || e.action.type === "success" && !e.action.manual) && this.fetchAgainIfJoinedEarlier(t, e.query), this.reconcile());
|
|
635
|
+
}
|
|
636
|
+
takeInKey(e, t) {
|
|
637
|
+
let n = H.getState(), r = t.queryKey;
|
|
638
|
+
for (let i of e) !i.keys.has(t.queryHash) && nt(i.scope, r) && n.updateResync(i.id, { keys: new Map([...i.keys, [t.queryHash, r]]) });
|
|
639
|
+
}
|
|
640
|
+
fetchAgainIfJoinedEarlier(e, t) {
|
|
641
|
+
let n = this.record.lastSettled.get(t);
|
|
642
|
+
e.some((e) => e.issued && !e.standing && e.keys.has(t.queryHash) && (n === void 0 || n <= e.generation)) && J(t) && this.queryClient.invalidateQueries({
|
|
643
|
+
queryKey: t.queryKey,
|
|
644
|
+
exact: !0
|
|
645
|
+
}, { cancelRefetch: !1 });
|
|
646
|
+
}
|
|
647
|
+
reconcile() {
|
|
648
|
+
if (this.running) this.dirty = !0;
|
|
649
|
+
else {
|
|
650
|
+
this.running = !0;
|
|
651
|
+
try {
|
|
652
|
+
do
|
|
653
|
+
this.dirty = !1, this.pass();
|
|
654
|
+
while (this.dirty);
|
|
655
|
+
} finally {
|
|
656
|
+
this.running = !1;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
pass() {
|
|
661
|
+
let e = H.getState(), t = e.relayInterruptedSince !== null;
|
|
662
|
+
if (this.relayHeld && !t) for (let t of e.resyncs) !t.issued && !t.standing && e.updateResync(t.id, { generation: this.record.counter });
|
|
663
|
+
this.relayHeld = t;
|
|
664
|
+
for (let e of H.getState().resyncs) this.schedule(e, t);
|
|
665
|
+
for (let e of H.getState().resyncs) this.evaluate(e);
|
|
666
|
+
for (let e of this.timers.keys()) H.getState().resyncs.some((t) => t.id === e) || this.clearTimer(e);
|
|
667
|
+
}
|
|
668
|
+
schedule(e, t) {
|
|
669
|
+
e.standing || e.issued || t ? this.clearTimer(e.id) : this.timers.has(e.id) || (e.jitter ? this.timers.set(e.id, setTimeout(() => {
|
|
670
|
+
this.timers.delete(e.id), H.getState().relayInterruptedSince === null && (this.issue(e.id), this.reconcile());
|
|
671
|
+
}, Math.random() * Qe)) : this.issue(e.id));
|
|
672
|
+
}
|
|
673
|
+
clearTimer(e) {
|
|
674
|
+
let t = this.timers.get(e);
|
|
675
|
+
t !== void 0 && (clearTimeout(t), this.timers.delete(e));
|
|
676
|
+
}
|
|
677
|
+
issue(e) {
|
|
678
|
+
let t = H.getState(), n = t.resyncs.find((t) => t.id === e);
|
|
679
|
+
if (!n || n.issued) return;
|
|
680
|
+
t.updateResync(e, { issued: !0 });
|
|
681
|
+
let r = this.queryClient.getQueryCache(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
682
|
+
for (let e of n.keys.keys()) {
|
|
683
|
+
let t = r.get(e);
|
|
684
|
+
t && ((this.record.lastSuccess.get(t) ?? 0) > n.generation || (this.record.inFlight.get(t) ?? 0) > n.generation || (J(t) ? i.add(t) : a.add(t)));
|
|
685
|
+
}
|
|
686
|
+
a.size > 0 && this.queryClient.invalidateQueries({
|
|
687
|
+
predicate: (e) => a.has(e),
|
|
688
|
+
refetchType: "none"
|
|
689
|
+
}), i.size > 0 && this.queryClient.invalidateQueries({ predicate: (e) => i.has(e) }, { cancelRefetch: !1 });
|
|
690
|
+
}
|
|
691
|
+
evaluate(e) {
|
|
692
|
+
let t = this.queryClient.getQueryCache(), n = /* @__PURE__ */ new Set(), r = new Map(e.observed);
|
|
693
|
+
for (let [i, a] of e.keys) {
|
|
694
|
+
let o = q(a);
|
|
695
|
+
if (o === null) continue;
|
|
696
|
+
let s = t.get(i);
|
|
697
|
+
if (s && J(s)) {
|
|
698
|
+
r.set(i, s), (this.record.lastSuccess.get(s) ?? 0) <= e.generation && n.add(o);
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
let c = r.get(i);
|
|
702
|
+
c && c !== s && J(c) ? n.add(o) : r.delete(i);
|
|
703
|
+
}
|
|
704
|
+
let i = H.getState();
|
|
705
|
+
n.size === 0 && (e.issued || e.standing) ? (i.removeResync(e.id), i.unmarkDegraded(e.carriedMarks)) : (!it(n, e.blocking) || !at(r, e.observed)) && i.updateResync(e.id, {
|
|
706
|
+
blocking: n,
|
|
707
|
+
observed: r
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
function it(e, t) {
|
|
712
|
+
if (e.size !== t.size) return !1;
|
|
713
|
+
for (let n of e) if (!t.has(n)) return !1;
|
|
714
|
+
return !0;
|
|
715
|
+
}
|
|
716
|
+
function at(e, t) {
|
|
717
|
+
if (e.size !== t.size) return !1;
|
|
718
|
+
for (let [n, r] of e) if (t.get(n) !== r) return !1;
|
|
719
|
+
return !0;
|
|
720
|
+
}
|
|
721
|
+
function ot(e) {
|
|
722
|
+
I(() => {
|
|
723
|
+
let t = new rt(e);
|
|
724
|
+
return t.start(), () => t.stop();
|
|
725
|
+
}, [e]);
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/lib/refetch-when-idle.ts
|
|
729
|
+
var st = /* @__PURE__ */ new WeakMap();
|
|
730
|
+
function X(e, t) {
|
|
731
|
+
if (t.state.fetchStatus !== "fetching") {
|
|
732
|
+
e.invalidateQueries({
|
|
733
|
+
queryKey: t.queryKey,
|
|
734
|
+
exact: !0
|
|
735
|
+
});
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
let n = st.get(e);
|
|
739
|
+
if (!n) {
|
|
740
|
+
let t = /* @__PURE__ */ new Set();
|
|
741
|
+
n = t, st.set(e, t), e.getQueryCache().subscribe((n) => {
|
|
742
|
+
let r = n.query;
|
|
743
|
+
n.type === "updated" && r.state.fetchStatus !== "fetching" && t.delete(r.queryHash) && e.invalidateQueries({
|
|
744
|
+
queryKey: r.queryKey,
|
|
745
|
+
exact: !0
|
|
746
|
+
});
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
n.add(t.queryHash);
|
|
750
|
+
}
|
|
751
|
+
//#endregion
|
|
752
|
+
//#region src/lib/realtime-reconcile.ts
|
|
753
|
+
async function ct(e, t, n, r) {
|
|
754
|
+
let i = e.getQueryCache().findAll({ predicate: (e) => Je(e.queryKey) && e.queryKey[1] === t }), a = !1, o = [];
|
|
755
|
+
for (let s of i) s.state.data !== void 0 && (s.getObserversCount() === 0 ? e.invalidateQueries({
|
|
756
|
+
queryKey: s.queryKey,
|
|
757
|
+
refetchType: "none"
|
|
758
|
+
}) : Ye(s.queryKey) ? X(e, s) : o.push(lt(e, s, t, n, r).then((e) => {
|
|
759
|
+
e.refetchCount && (a = !0);
|
|
760
|
+
})));
|
|
761
|
+
return await Promise.all(o), a;
|
|
762
|
+
}
|
|
763
|
+
async function lt(e, t, n, r, i) {
|
|
764
|
+
let a = t.state.data;
|
|
765
|
+
if (!a || !Array.isArray(a.data)) return X(e, t), {
|
|
766
|
+
refetchWindow: !0,
|
|
767
|
+
refetchCount: !0
|
|
768
|
+
};
|
|
769
|
+
let o = vt(t), s = o.per_page ?? a.data.length;
|
|
770
|
+
if (r.length > s) return pt(e, t);
|
|
771
|
+
let c, l = xt(t), u = t.state.dataUpdateCount;
|
|
772
|
+
try {
|
|
773
|
+
c = await T(n, mt(o, r), { signal: i });
|
|
774
|
+
} catch (r) {
|
|
775
|
+
return yt(r) ? (Y(e, {
|
|
776
|
+
scope: { kind: "keys" },
|
|
777
|
+
keys: [t.queryKey, D(n, o)],
|
|
778
|
+
standing: !0
|
|
779
|
+
}), e.invalidateQueries({
|
|
780
|
+
queryKey: t.queryKey,
|
|
781
|
+
refetchType: "none"
|
|
782
|
+
}), {
|
|
783
|
+
refetchWindow: !1,
|
|
784
|
+
refetchCount: !1
|
|
785
|
+
}) : pt(e, t);
|
|
786
|
+
}
|
|
787
|
+
return c.meta?.has_more || t.state.dataUpdateCount !== u ? pt(e, t) : ut(e, t, a, o, r, c, l);
|
|
788
|
+
}
|
|
789
|
+
function ut(e, t, n, r, i, a, o) {
|
|
790
|
+
let s = Oe(r.sort).map((e) => e.field), c = _t(t, r), l = {
|
|
791
|
+
refetchWindow: !1,
|
|
792
|
+
refetchCount: !1
|
|
793
|
+
}, u = [], d = [];
|
|
794
|
+
for (let e of i) {
|
|
795
|
+
let t = a.data.find((t) => Z(t, e.pk)), r = n.data.findIndex((t) => Z(t, e.pk));
|
|
796
|
+
t && r >= 0 ? gt(s, n.data[r], t) ? l.refetchWindow = !0 : u.push({
|
|
797
|
+
pk: e.pk,
|
|
798
|
+
row: t
|
|
799
|
+
}) : t ? (l.refetchWindow = !0, l.refetchCount = !0) : r >= 0 ? (d.push(e.pk), l.refetchWindow = !0, l.refetchCount = !0) : e.createdOnly || (l.refetchCount = !0, c || (l.refetchWindow = !0));
|
|
800
|
+
}
|
|
801
|
+
return (d.length > 0 || u.length > 0 && !l.refetchWindow) && dt(e, t, u, d, a, o), l.refetchWindow && X(e, t), l;
|
|
802
|
+
}
|
|
803
|
+
function dt(e, t, n, r, i, a) {
|
|
804
|
+
St(t, a) && e.setQueryData(t.queryKey, (e) => {
|
|
805
|
+
if (!e || !Array.isArray(e.data)) return e;
|
|
806
|
+
let t = e.data.map((e) => {
|
|
807
|
+
let t = n.find((t) => Z(e, t.pk));
|
|
808
|
+
return t ? t.row : e;
|
|
809
|
+
});
|
|
810
|
+
return r.length > 0 && (t = t.filter((e) => !r.some((t) => Z(e, t)))), {
|
|
811
|
+
...e,
|
|
812
|
+
data: t,
|
|
813
|
+
$refs: ft(e.$refs, i.$refs)
|
|
814
|
+
};
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
function ft(e, t) {
|
|
818
|
+
if (!t) return e;
|
|
819
|
+
if (!e) return t;
|
|
820
|
+
let n = { ...e };
|
|
821
|
+
for (let [e, r] of Object.entries(t)) n[e] = {
|
|
822
|
+
...n[e] ?? {},
|
|
823
|
+
...r
|
|
824
|
+
};
|
|
825
|
+
return n;
|
|
826
|
+
}
|
|
827
|
+
function pt(e, t) {
|
|
828
|
+
return X(e, t), {
|
|
829
|
+
refetchWindow: !0,
|
|
830
|
+
refetchCount: !0
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
function mt(e, t) {
|
|
834
|
+
let n = [...e.filters ?? [], ht(t)];
|
|
835
|
+
return {
|
|
836
|
+
...e,
|
|
837
|
+
filters: n,
|
|
838
|
+
page: 1,
|
|
839
|
+
per_page: t.length,
|
|
840
|
+
count: "window"
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function ht(e) {
|
|
844
|
+
let t = Object.keys(e[0]?.pk ?? {}).sort();
|
|
845
|
+
if (t.length === 1) {
|
|
846
|
+
let n = t[0];
|
|
847
|
+
return {
|
|
848
|
+
field: n,
|
|
849
|
+
op: "in",
|
|
850
|
+
value: e.map((e) => e.pk[n])
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
return { or: e.map((e) => ({ and: t.map((t) => ({
|
|
854
|
+
field: t,
|
|
855
|
+
op: "eq",
|
|
856
|
+
value: e.pk[t]
|
|
857
|
+
})) })) };
|
|
858
|
+
}
|
|
859
|
+
function gt(e, t, n) {
|
|
860
|
+
for (let r of e) {
|
|
861
|
+
let e = t[r], i = n[r];
|
|
862
|
+
if (e === void 0 || i === void 0 || !Object.is(e, i) && JSON.stringify(e) !== JSON.stringify(i)) return !0;
|
|
863
|
+
}
|
|
864
|
+
return !1;
|
|
865
|
+
}
|
|
866
|
+
function Z(e, t) {
|
|
867
|
+
for (let [n, r] of Object.entries(t)) {
|
|
868
|
+
let t = e[n];
|
|
869
|
+
if (typeof t != "string" && typeof t != "number" || String(t) !== r) return !1;
|
|
870
|
+
}
|
|
871
|
+
return !0;
|
|
872
|
+
}
|
|
873
|
+
function _t(e, t) {
|
|
874
|
+
return e.queryKey[0] === "entity-data-all" || (t.page ?? 1) === 1;
|
|
875
|
+
}
|
|
876
|
+
function vt(e) {
|
|
877
|
+
let t = e.queryKey[2];
|
|
878
|
+
return t && typeof t == "object" ? { ...t } : {};
|
|
879
|
+
}
|
|
880
|
+
function yt(e) {
|
|
881
|
+
return e instanceof E && e.status === 429;
|
|
882
|
+
}
|
|
883
|
+
var bt = /* @__PURE__ */ new WeakMap();
|
|
884
|
+
function xt(e) {
|
|
885
|
+
let t = (bt.get(e) ?? 0) + 1;
|
|
886
|
+
return bt.set(e, t), t;
|
|
887
|
+
}
|
|
888
|
+
function St(e, t) {
|
|
889
|
+
return (bt.get(e) ?? 0) === t;
|
|
890
|
+
}
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region src/hooks/useSSE.ts
|
|
893
|
+
var Ct = 3e4, wt = 1e3, Tt = 50, Et = "replay_gap";
|
|
894
|
+
function Dt() {
|
|
895
|
+
return typeof document > "u" || document.visibilityState !== "hidden";
|
|
896
|
+
}
|
|
897
|
+
function Ot() {
|
|
898
|
+
let [e, t] = z(Dt);
|
|
899
|
+
return I(() => {
|
|
900
|
+
if (typeof document > "u") return;
|
|
901
|
+
let e = () => t(Dt());
|
|
902
|
+
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
903
|
+
}, []), e;
|
|
904
|
+
}
|
|
905
|
+
async function Q(e, t, n) {
|
|
906
|
+
if (t.length === 0) return;
|
|
907
|
+
let r = /* @__PURE__ */ new Map();
|
|
908
|
+
for (let e of t) {
|
|
909
|
+
let t = r.get(e.entity) ?? {
|
|
910
|
+
keylessReason: null,
|
|
911
|
+
keyless: !1,
|
|
912
|
+
rows: /* @__PURE__ */ new Map()
|
|
913
|
+
}, n = Ft(e);
|
|
914
|
+
if (n === null) t.keyless = !0, t.keylessReason = Mt(t.keylessReason, e.reason ?? "");
|
|
915
|
+
else for (let r of n) {
|
|
916
|
+
let n = Pt(r), i = t.rows.get(n);
|
|
917
|
+
t.rows.set(n, {
|
|
918
|
+
pk: r,
|
|
919
|
+
createdOnly: (i?.createdOnly ?? !0) && e.action === "created"
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
r.set(e.entity, t);
|
|
923
|
+
}
|
|
924
|
+
let i = [];
|
|
925
|
+
for (let [t, a] of r) e.invalidateQueries({ predicate: (e) => {
|
|
926
|
+
let n = e.queryKey;
|
|
927
|
+
return n[0] === "entity-children" && n[3] === t;
|
|
928
|
+
} }), t === "generated_document" && e.invalidateQueries({ predicate: (e) => e.queryKey[0] === Ee }), a.keyless ? At(e, t, a.keylessReason) : (Lt(e, t, [...a.rows.values()].map((e) => e.pk)), i.push(ct(e, t, [...a.rows.values()], n).then((n) => {
|
|
929
|
+
if (n) for (let n of e.getQueryCache().findAll({ queryKey: ["entity-count", t] })) X(e, n);
|
|
930
|
+
})));
|
|
931
|
+
await Promise.all(i);
|
|
932
|
+
}
|
|
933
|
+
function kt(e, t, n, r, i) {
|
|
934
|
+
let a = r.filter((e) => Object.keys(e).length > 0);
|
|
935
|
+
if (a.length === 0 || a.length !== r.length) {
|
|
936
|
+
i();
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
let o = a.map((e) => ({ pk: e })), s = Bt(e, t, [{
|
|
940
|
+
entity: n,
|
|
941
|
+
action: "updated",
|
|
942
|
+
ids: a.map(Pt),
|
|
943
|
+
objects: o
|
|
944
|
+
}]);
|
|
945
|
+
s.length === 0 ? i() : Q(e, s);
|
|
946
|
+
}
|
|
947
|
+
function At(e, t, n) {
|
|
948
|
+
let r = (e) => Nt(e, t);
|
|
949
|
+
n === $ ? jt(e, r) : e.invalidateQueries({ predicate: (e) => r(e.queryKey) });
|
|
950
|
+
}
|
|
951
|
+
function jt(e, t) {
|
|
952
|
+
e.removeQueries({ predicate: (e) => t(e.queryKey) && e.getObserversCount() > 0 }), e.invalidateQueries({
|
|
953
|
+
predicate: (e) => t(e.queryKey),
|
|
954
|
+
refetchType: "none"
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
var $ = "access_not_projectable";
|
|
958
|
+
function Mt(e, t) {
|
|
959
|
+
return e === $ || t === $ ? $ : e ?? t;
|
|
960
|
+
}
|
|
961
|
+
function Nt(e, t) {
|
|
962
|
+
return e[1] === t && Xe(e);
|
|
963
|
+
}
|
|
964
|
+
function Pt(e) {
|
|
965
|
+
return JSON.stringify(Object.keys(e).sort().map((t) => [t, e[t]]));
|
|
966
|
+
}
|
|
967
|
+
function Ft(e) {
|
|
968
|
+
if (e.ids.length === 0 || !e.objects || e.objects.length === 0) return null;
|
|
969
|
+
let t = [];
|
|
970
|
+
for (let n of e.objects) {
|
|
971
|
+
if (!n.pk || Object.keys(n.pk).length === 0) return null;
|
|
972
|
+
t.push(n.pk);
|
|
973
|
+
}
|
|
974
|
+
return t;
|
|
975
|
+
}
|
|
976
|
+
function It(e) {
|
|
977
|
+
let t = Object.keys(e).sort(), n = [JSON.stringify(t.map((t) => [t, e[t]]))];
|
|
978
|
+
return t.length === 1 && n.push(JSON.stringify(e[t[0]])), n;
|
|
979
|
+
}
|
|
980
|
+
function Lt(e, t, n) {
|
|
981
|
+
if (n.length === 0) return;
|
|
982
|
+
let r = /* @__PURE__ */ new Set();
|
|
983
|
+
for (let e of n) for (let t of It(e)) r.add(t);
|
|
984
|
+
e.invalidateQueries({ predicate: (e) => {
|
|
985
|
+
let n = e.queryKey;
|
|
986
|
+
return n[0] === "entity-item" && n[1] === t && r.has(JSON.stringify(n[2] ?? null));
|
|
987
|
+
} });
|
|
988
|
+
}
|
|
989
|
+
function Rt(e) {
|
|
990
|
+
return Ze(e) || e[0] === "action-data" || e[0] === "action-data-cursor";
|
|
991
|
+
}
|
|
992
|
+
function zt(e) {
|
|
993
|
+
jt(e, Rt);
|
|
994
|
+
}
|
|
995
|
+
function Bt(e, t, n) {
|
|
996
|
+
let r = e.getQueryData(["schema", t]), i = H.getState().degradedEntities;
|
|
997
|
+
return n.filter((e) => ye(r?.entities?.[e.entity]?.realtime, i, e.entity));
|
|
998
|
+
}
|
|
999
|
+
function Vt(e, t) {
|
|
1000
|
+
let n = e.getQueryData(["schema", t]), r = H.getState().degradedEntities;
|
|
1001
|
+
e.invalidateQueries({
|
|
1002
|
+
predicate: (e) => {
|
|
1003
|
+
let t = q(e.queryKey);
|
|
1004
|
+
return t !== null && !ye(n?.entities?.[t]?.realtime, r, t);
|
|
1005
|
+
},
|
|
1006
|
+
refetchType: "active"
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
function Ht(e, t) {
|
|
1010
|
+
return e.snapshotPoint !== null && t !== void 0 && Number(t) > e.snapshotPoint;
|
|
1011
|
+
}
|
|
1012
|
+
function Ut() {
|
|
1013
|
+
let e = c((e) => e.isAuthenticated), r = c((e) => e.activeTenant?.id ?? ""), i = B(), o = R(null), u = R(""), d = R(""), f = R(Promise.resolve()), h = R(0), g = Ot(), _ = R(!g);
|
|
1014
|
+
ot(i), Te(), I(() => {
|
|
1015
|
+
let v = H.getState();
|
|
1016
|
+
if (!e) {
|
|
1017
|
+
u.current = "", d.current = "", _.current = !g, v.clearConnectionInterruption();
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
if (!g) {
|
|
1021
|
+
_.current = !0, o.current?.abort(), o.current = null, v.clearConnectionInterruption();
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
v.holdConnectionInterruption(), _.current && (_.current = !1, u.current && Vt(i, e)), d.current !== r && (u.current = "", d.current = r);
|
|
1025
|
+
let y = !0, b = 0, x = null, C = [], w = null, T = null, E = (e) => {
|
|
1026
|
+
f.current = f.current.then(e).catch((e) => {
|
|
1027
|
+
console.error("realtime: applying a change batch failed", e);
|
|
1028
|
+
});
|
|
1029
|
+
}, D = (e, t) => {
|
|
1030
|
+
d.current === t && (u.current = e);
|
|
1031
|
+
}, O = (e) => {
|
|
1032
|
+
if (!e) return;
|
|
1033
|
+
k();
|
|
1034
|
+
let t = d.current;
|
|
1035
|
+
E(() => D(e, t));
|
|
1036
|
+
}, k = () => {
|
|
1037
|
+
if (w !== null && (clearTimeout(w), w = null), C.length === 0) return;
|
|
1038
|
+
let t = C.splice(0, C.length), n = o.current?.signal, r = d.current;
|
|
1039
|
+
E(() => Q(i, Bt(i, e, t), n).finally(() => {
|
|
1040
|
+
for (let e of t) e.eventID && D(e.eventID, r);
|
|
1041
|
+
}));
|
|
1042
|
+
}, A = () => {
|
|
1043
|
+
w === null && (w = setTimeout(k, Tt));
|
|
1044
|
+
}, j = () => {
|
|
1045
|
+
T !== null && (clearTimeout(T), T = null);
|
|
1046
|
+
}, M = (e) => {
|
|
1047
|
+
j();
|
|
1048
|
+
let t = H.getState().thresholds;
|
|
1049
|
+
t !== null && t !== "unreadable" && (T = setTimeout(() => {
|
|
1050
|
+
T = null, y && x === e && (e.silent = !0, H.getState().holdConnectionInterruption());
|
|
1051
|
+
}, t.silenceMs));
|
|
1052
|
+
}, N = (e) => {
|
|
1053
|
+
y && x === e && e.stated && (e.silent && (e.silent = !1, H.getState().clearConnectionInterruption()), M(e));
|
|
1054
|
+
}, te = H.subscribe((e, t) => {
|
|
1055
|
+
e.thresholds !== t.thresholds && x?.stated && !x.silent && M(x);
|
|
1056
|
+
}), P = (e) => {
|
|
1057
|
+
let t = H.getState(), n = new Set(e), r = /* @__PURE__ */ new Map();
|
|
1058
|
+
for (let [e, { mark: i }] of t.degradedEntities) n.has(e) || r.set(e, i);
|
|
1059
|
+
let a = [...n].filter((e) => !t.degradedEntities.has(e));
|
|
1060
|
+
for (let e of n) t.markDegraded(e);
|
|
1061
|
+
r.size > 0 && Y(i, {
|
|
1062
|
+
scope: {
|
|
1063
|
+
kind: "entities",
|
|
1064
|
+
entities: new Set(r.keys())
|
|
1065
|
+
},
|
|
1066
|
+
jitter: !0,
|
|
1067
|
+
carriedMarks: r
|
|
1068
|
+
}), a.length > 0 && Q(i, a.map((e) => ({
|
|
1069
|
+
entity: e,
|
|
1070
|
+
action: "updated",
|
|
1071
|
+
ids: []
|
|
1072
|
+
})));
|
|
1073
|
+
};
|
|
1074
|
+
async function F() {
|
|
1075
|
+
for (; y;) {
|
|
1076
|
+
let e = new AbortController();
|
|
1077
|
+
o.current = e;
|
|
1078
|
+
let r = n(), d = r ? p() : null, f = {
|
|
1079
|
+
seq: ++h.current,
|
|
1080
|
+
presented: u.current !== "",
|
|
1081
|
+
stated: !1,
|
|
1082
|
+
silent: !1,
|
|
1083
|
+
snapshotPoint: null
|
|
1084
|
+
};
|
|
1085
|
+
x = f;
|
|
1086
|
+
let g = H.getState();
|
|
1087
|
+
g.holdConnectionInterruption(), f.presented ? g.startReplay() : g.endReplay();
|
|
1088
|
+
let _ = /* @__PURE__ */ new Set();
|
|
1089
|
+
try {
|
|
1090
|
+
for await (let n of m({
|
|
1091
|
+
signal: e.signal,
|
|
1092
|
+
lastEventID: u.current,
|
|
1093
|
+
bearerToken: d ?? void 0,
|
|
1094
|
+
credentials: r ? "omit" : void 0,
|
|
1095
|
+
onActivity: () => N(f)
|
|
1096
|
+
})) {
|
|
1097
|
+
if (!y) break;
|
|
1098
|
+
let e = H.getState();
|
|
1099
|
+
if (n.type === "session_refresh") {
|
|
1100
|
+
zt(i);
|
|
1101
|
+
try {
|
|
1102
|
+
r ? (l(), await s()) : await t(), i.invalidateQueries({ queryKey: ["schema"] }), c.getState().refreshMe();
|
|
1103
|
+
} catch {}
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
if (n.type === "snapshot_complete") {
|
|
1107
|
+
b = 0, f.stated = !0, f.snapshotPoint = n.asOf ?? null, e.clearConnectionInterruption(), M(f);
|
|
1108
|
+
let t = n.known && n.asOf !== void 0;
|
|
1109
|
+
t ? e.clearRelayInterruption() : e.holdRelayInterruption(), f.presented || (n.asOf && O(String(n.asOf)), Y(i, { scope: { kind: "all" } })), t && P(_ ?? []), _ = null;
|
|
1110
|
+
} else if (n.type === "replay_complete") {
|
|
1111
|
+
k();
|
|
1112
|
+
let e = f.seq;
|
|
1113
|
+
E(() => {
|
|
1114
|
+
h.current === e && H.getState().endReplay();
|
|
1115
|
+
});
|
|
1116
|
+
} else if (n.type === "checkpoint") O(n.eventID);
|
|
1117
|
+
else if (n.type === "cache_reset") O(n.eventID), n.reason !== Et && Ht(f, n.eventID) && e.holdRelayInterruption(), Y(i, {
|
|
1118
|
+
scope: { kind: "all" },
|
|
1119
|
+
jitter: !0
|
|
1120
|
+
});
|
|
1121
|
+
else if (n.type === "realtime_streaming") {
|
|
1122
|
+
if (O(n.eventID), !Ht(f, n.eventID)) continue;
|
|
1123
|
+
e.clearRelayInterruption(), P(n.degraded);
|
|
1124
|
+
} else if (n.type === "realtime_degraded") {
|
|
1125
|
+
if (_ !== null) {
|
|
1126
|
+
_.add(n.entity);
|
|
1127
|
+
continue;
|
|
1128
|
+
}
|
|
1129
|
+
if (O(n.eventID), !Ht(f, n.eventID)) continue;
|
|
1130
|
+
e.markDegraded(n.entity), Q(i, [{
|
|
1131
|
+
entity: n.entity,
|
|
1132
|
+
action: "updated",
|
|
1133
|
+
ids: []
|
|
1134
|
+
}]);
|
|
1135
|
+
} else n.type === "entity_changed" && (C.push({
|
|
1136
|
+
entity: n.entity,
|
|
1137
|
+
action: n.action,
|
|
1138
|
+
eventID: n.eventID,
|
|
1139
|
+
ids: n.ids,
|
|
1140
|
+
objects: n.objects,
|
|
1141
|
+
reason: n.reason
|
|
1142
|
+
}), A());
|
|
1143
|
+
}
|
|
1144
|
+
} catch (e) {
|
|
1145
|
+
if (!y || e instanceof DOMException && e.name === "AbortError") break;
|
|
1146
|
+
if (e instanceof ee) {
|
|
1147
|
+
if (H.getState().holdConnectionInterruption(), j(), r) try {
|
|
1148
|
+
l(), await s(), b = 0;
|
|
1149
|
+
continue;
|
|
1150
|
+
} catch {
|
|
1151
|
+
S()();
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
try {
|
|
1155
|
+
await t(), b = 0;
|
|
1156
|
+
continue;
|
|
1157
|
+
} catch (e) {
|
|
1158
|
+
if (e instanceof a) {
|
|
1159
|
+
S()();
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if (j(), !y) break;
|
|
1166
|
+
H.getState().holdConnectionInterruption();
|
|
1167
|
+
let v = Math.min(wt * 2 ** b, Ct), w = v * .5 * Math.random();
|
|
1168
|
+
await new Promise((e) => setTimeout(e, v + w)), b++;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
return F(), () => {
|
|
1172
|
+
y = !1, x = null, o.current?.abort(), o.current = null, j(), te(), k();
|
|
1173
|
+
};
|
|
1174
|
+
}, [
|
|
1175
|
+
e,
|
|
1176
|
+
r,
|
|
1177
|
+
i,
|
|
1178
|
+
g
|
|
1179
|
+
]);
|
|
1180
|
+
}
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region src/components/actions/ActionRunner.tsx
|
|
1183
|
+
var Wt = P(() => import("./ActionDialog-uiuse5W8.js").then((e) => ({ default: e.ActionDialog })));
|
|
1184
|
+
function Gt(e, t) {
|
|
1185
|
+
if (!t || typeof t != "object") return { kind: "success" };
|
|
1186
|
+
let n = t, r = n.status, i = n.success?.length ?? 0, a = n.errors?.length ?? 0, o = n.skipped?.length ?? 0, s = n.errors?.[0]?.error?.title;
|
|
1187
|
+
if (r === "partial") {
|
|
1188
|
+
let t = e("action.outcome.succeeded_of", "{count} of {total} succeeded", {
|
|
1189
|
+
count: i,
|
|
1190
|
+
total: i + a + o
|
|
1191
|
+
});
|
|
1192
|
+
return {
|
|
1193
|
+
kind: "partial",
|
|
1194
|
+
detail: s ? `${t} · ${s}` : t
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
if (r === "skipped") return {
|
|
1198
|
+
kind: "skipped",
|
|
1199
|
+
detail: e("action.outcome.none_matched", "No items matched")
|
|
1200
|
+
};
|
|
1201
|
+
if (r === "accepted") return { kind: "accepted" };
|
|
1202
|
+
if (w(n.events)) {
|
|
1203
|
+
let t = n.events?.failed_count ?? 0, r = n.events?.timed_out_count ?? 0, i = n.events?.failures_omitted ?? 0, a = [t ? u(e, "action.outcome.follow_up_steps_count", t, {
|
|
1204
|
+
one: "{count} follow-up step failed",
|
|
1205
|
+
other: "{count} follow-up steps failed"
|
|
1206
|
+
}) : "", r ? e("action.outcome.timed_out_count", "{count} did not finish in time", { count: r }) : ""].filter(Boolean), o = n.events?.failures?.[0], s = o ? `${a.join(" · ")} · ${o.handler}` : a.join(" · ");
|
|
1207
|
+
return {
|
|
1208
|
+
kind: "partial",
|
|
1209
|
+
detail: i ? e("action.outcome.with_more", "{summary} (+{count} more)", {
|
|
1210
|
+
summary: s,
|
|
1211
|
+
count: i
|
|
1212
|
+
}) : s
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
return { kind: "success" };
|
|
1216
|
+
}
|
|
1217
|
+
function Kt(e) {
|
|
1218
|
+
if (!e || typeof e != "object") return null;
|
|
1219
|
+
let t = e.result;
|
|
1220
|
+
if (!t || typeof t != "object") return null;
|
|
1221
|
+
let n = t.$display;
|
|
1222
|
+
return !n || typeof n != "object" ? null : n;
|
|
1223
|
+
}
|
|
1224
|
+
function qt(e) {
|
|
1225
|
+
let t = Kt(e)?.fields;
|
|
1226
|
+
if (!Array.isArray(t)) return null;
|
|
1227
|
+
for (let e of t) {
|
|
1228
|
+
if (e?.type !== "download") continue;
|
|
1229
|
+
let t = e.href ?? e.download_url ?? e.value;
|
|
1230
|
+
if (typeof t == "string" && t !== "" && O(t)) return {
|
|
1231
|
+
url: t,
|
|
1232
|
+
filename: typeof e.filename == "string" ? e.filename : void 0
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
return null;
|
|
1236
|
+
}
|
|
1237
|
+
function Jt(e) {
|
|
1238
|
+
if (!e || typeof e != "object") return;
|
|
1239
|
+
let t = e.result;
|
|
1240
|
+
t && typeof t == "object" && "impersonation_session_id" in t && window.location.assign("/");
|
|
1241
|
+
}
|
|
1242
|
+
function Yt(e, t, n) {
|
|
1243
|
+
if (n instanceof x) {
|
|
1244
|
+
let r = n.response.errors ?? [], i = r[0]?.error?.title;
|
|
1245
|
+
if (r.length === 1) return {
|
|
1246
|
+
kind: "error",
|
|
1247
|
+
detail: d(t, n),
|
|
1248
|
+
retryable: r[0]?.error?.retryable
|
|
1249
|
+
};
|
|
1250
|
+
let a = e("action.outcome.failed_count", "{count} failed", { count: r.length });
|
|
1251
|
+
return {
|
|
1252
|
+
kind: "error",
|
|
1253
|
+
detail: i ? `${a} · ${i}` : a,
|
|
1254
|
+
retryable: r.every((e) => e.error?.retryable)
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
return {
|
|
1258
|
+
kind: "error",
|
|
1259
|
+
detail: d(t, n),
|
|
1260
|
+
retryable: n instanceof E ? n.retryable : void 0
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
var Xt = te(null);
|
|
1264
|
+
function Zt() {
|
|
1265
|
+
let e = ne(Xt);
|
|
1266
|
+
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
1267
|
+
return e;
|
|
1268
|
+
}
|
|
1269
|
+
function Qt(e) {
|
|
1270
|
+
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
1271
|
+
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
1272
|
+
return t;
|
|
1273
|
+
}
|
|
1274
|
+
function $t({ children: t }) {
|
|
1275
|
+
let n = j(), i = j("errors"), a = g(), { data: s } = o(), [l, u] = z(null), [f, p] = z(0), [m, _] = z(null), y = F((e) => {
|
|
1276
|
+
if (e?.progress_screen) return s?.screens[e.progress_screen]?.route;
|
|
1277
|
+
}, [s?.screens]), b = F((t, r, o, s, c, l) => {
|
|
1278
|
+
let u = () => {
|
|
1279
|
+
let e = en(c), r = y(o), i = e ? n("action.toast.job_queued", "Job {id} queued", { id: e }) : n("action.toast.running_in_background", "Running in background");
|
|
1280
|
+
h.success(n("action.toast.started", "{title} started", { title: t }), i, r ? { action: {
|
|
1281
|
+
label: n("action.toast.view", "View"),
|
|
1282
|
+
onClick: () => a(r)
|
|
1283
|
+
} } : void 0);
|
|
1284
|
+
};
|
|
1285
|
+
switch (s.kind) {
|
|
1286
|
+
case "success": {
|
|
1287
|
+
let a = qt(c), o = a ? { action: {
|
|
1288
|
+
label: n("action.result.download", "Download"),
|
|
1289
|
+
onClick: () => {
|
|
1290
|
+
e(i, a.url, a.filename).catch((e) => {
|
|
1291
|
+
h.error(i("file.download_failed", "The file could not be downloaded."), d(i, e));
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
} } : void 0;
|
|
1295
|
+
r ? u() : h.success(n("action.toast.complete", "{title} complete", { title: t }), void 0, o);
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
case "accepted":
|
|
1299
|
+
u();
|
|
1300
|
+
return;
|
|
1301
|
+
case "skipped":
|
|
1302
|
+
h.info(t, s.detail);
|
|
1303
|
+
return;
|
|
1304
|
+
case "partial":
|
|
1305
|
+
h.warning(n("action.toast.partially_completed", "{title} partially completed", { title: t }), s.detail);
|
|
1306
|
+
return;
|
|
1307
|
+
case "error":
|
|
1308
|
+
h.error(t, s.detail || i("action.failed", "This action did not complete."), s.retryable && l ? { action: {
|
|
1309
|
+
label: n("action.toast.retry", "Retry"),
|
|
1310
|
+
onClick: l
|
|
1311
|
+
} } : void 0);
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
}, [
|
|
1315
|
+
n,
|
|
1316
|
+
i,
|
|
1317
|
+
a,
|
|
1318
|
+
y
|
|
1319
|
+
]), x = B(), S = c((e) => e.isAuthenticated), C = F((e, t, n) => {
|
|
1320
|
+
let r = () => {
|
|
1321
|
+
for (let e of [
|
|
1322
|
+
"entity-data",
|
|
1323
|
+
"entity-count",
|
|
1324
|
+
"entity-item"
|
|
1325
|
+
]) x.invalidateQueries({ queryKey: [e, t] });
|
|
1326
|
+
};
|
|
1327
|
+
if (n === "partial") return r();
|
|
1328
|
+
let i = s?.entities?.[t], a = e.row ? [e.row] : e.bulkSelection ?? [];
|
|
1329
|
+
if (!i || a.length === 0) return r();
|
|
1330
|
+
kt(x, S, t, a.map((e) => v(i, e)), r);
|
|
1331
|
+
}, [
|
|
1332
|
+
x,
|
|
1333
|
+
s,
|
|
1334
|
+
S
|
|
1335
|
+
]), w = F((e, t, n) => {
|
|
1336
|
+
if (t.kind === "success" || t.kind === "accepted" || t.kind === "partial") {
|
|
1337
|
+
let n = e.entity ?? e.action?.entity;
|
|
1338
|
+
n && C(e, n, t.kind);
|
|
1339
|
+
}
|
|
1340
|
+
if (t.kind !== "success" && t.kind !== "accepted") return;
|
|
1341
|
+
e.onSuccess?.(n);
|
|
1342
|
+
let r = Kt(n);
|
|
1343
|
+
r && _(r), Jt(n);
|
|
1344
|
+
}, [C]), T = F((e) => {
|
|
1345
|
+
let t = e.action, a = e.longRunning ?? t?.long_running ?? !1, o = e.title || n(t?.display?.name) || n("action.default_title", "Action"), s = async (r) => {
|
|
1346
|
+
p((e) => e + 1);
|
|
1347
|
+
try {
|
|
1348
|
+
let i = await e.execute(r), s = Gt(n, i);
|
|
1349
|
+
b(o, a, t, s, i), w(e, s, i);
|
|
1350
|
+
} catch (e) {
|
|
1351
|
+
b(o, a, t, Yt(n, i, e), void 0, () => {
|
|
1352
|
+
s(r);
|
|
1353
|
+
});
|
|
1354
|
+
} finally {
|
|
1355
|
+
p((e) => Math.max(0, e - 1));
|
|
1356
|
+
}
|
|
1357
|
+
}, c = t ?? (e.destructive ? {
|
|
1358
|
+
display: {
|
|
1359
|
+
name: { en: o },
|
|
1360
|
+
icon: ""
|
|
1361
|
+
},
|
|
1362
|
+
destructive: !0
|
|
1363
|
+
} : void 0), l = !!(t?.resolved_params && t.resolved_params.length > 0), d = r(c);
|
|
1364
|
+
return c && (l || d) ? (u({
|
|
1365
|
+
id: Symbol(),
|
|
1366
|
+
opts: e,
|
|
1367
|
+
title: o,
|
|
1368
|
+
action: c,
|
|
1369
|
+
pending: !1
|
|
1370
|
+
}), Promise.resolve()) : s(Qt(e));
|
|
1371
|
+
}, [
|
|
1372
|
+
n,
|
|
1373
|
+
i,
|
|
1374
|
+
b,
|
|
1375
|
+
w
|
|
1376
|
+
]), E = f > 0 || !!l?.pending, D = L(() => ({
|
|
1377
|
+
run: T,
|
|
1378
|
+
isRunning: E
|
|
1379
|
+
}), [T, E]), O = l?.action, k = F(async (e) => {
|
|
1380
|
+
if (!l) return;
|
|
1381
|
+
let t = l.id, r = l, a = r.opts.action, o = r.opts.longRunning ?? a?.long_running ?? !1;
|
|
1382
|
+
u((e) => e?.id === t ? {
|
|
1383
|
+
...e,
|
|
1384
|
+
pending: !0
|
|
1385
|
+
} : e), p((e) => e + 1);
|
|
1386
|
+
try {
|
|
1387
|
+
let i = await r.opts.execute(e), s = Gt(n, i);
|
|
1388
|
+
b(r.title, o, a, s, i), w(r.opts, s, i), s.kind !== "partial" && u((e) => e?.id === t ? null : e);
|
|
1389
|
+
} catch (e) {
|
|
1390
|
+
b(r.title, o, a, Yt(n, i, e));
|
|
1391
|
+
} finally {
|
|
1392
|
+
p((e) => Math.max(0, e - 1)), u((e) => e?.id === t ? {
|
|
1393
|
+
...e,
|
|
1394
|
+
pending: !1
|
|
1395
|
+
} : e);
|
|
1396
|
+
}
|
|
1397
|
+
}, [
|
|
1398
|
+
n,
|
|
1399
|
+
i,
|
|
1400
|
+
l,
|
|
1401
|
+
b,
|
|
1402
|
+
w
|
|
1403
|
+
]);
|
|
1404
|
+
return /* @__PURE__ */ se(Xt.Provider, {
|
|
1405
|
+
value: D,
|
|
1406
|
+
children: [
|
|
1407
|
+
t,
|
|
1408
|
+
m && /* @__PURE__ */ V(ue, {
|
|
1409
|
+
open: !0,
|
|
1410
|
+
onClose: () => _(null),
|
|
1411
|
+
display: m
|
|
1412
|
+
}),
|
|
1413
|
+
l && O && /* @__PURE__ */ V(N, {
|
|
1414
|
+
fallback: null,
|
|
1415
|
+
children: /* @__PURE__ */ V(Wt, {
|
|
1416
|
+
open: !0,
|
|
1417
|
+
onOpenChange: (e) => {
|
|
1418
|
+
e || u(null);
|
|
1419
|
+
},
|
|
1420
|
+
action: O,
|
|
1421
|
+
actionName: l.title,
|
|
1422
|
+
onSubmit: k,
|
|
1423
|
+
isPending: l.pending,
|
|
1424
|
+
bulkSelection: l.opts.bulkSelection,
|
|
1425
|
+
row: l.opts.row
|
|
1426
|
+
})
|
|
1427
|
+
})
|
|
1428
|
+
]
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
function en(e) {
|
|
1432
|
+
return tn(e) ?? tn(e?.result);
|
|
1433
|
+
}
|
|
1434
|
+
function tn(e) {
|
|
1435
|
+
if (!e || typeof e != "object") return;
|
|
1436
|
+
let t = e, n = t.job_id ?? t.id;
|
|
1437
|
+
return typeof n == "string" ? n : void 0;
|
|
1438
|
+
}
|
|
1439
|
+
//#endregion
|
|
1440
|
+
export { ge as C, fe as E, _e as S, de as T, Ee as _, He as a, pe as b, W as c, Me as d, je as f, ke as g, Ae as h, Ut as i, Ie as l, Ne as m, Zt as n, Ve as o, Oe as p, kt as r, Ue as s, $t as t, Be as u, xe as v, ve as w, he as x, me as y };
|