@nivaro/react 0.2.53 → 0.2.55
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +94 -0
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var j = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var x = (t, e,
|
|
4
|
-
const
|
|
2
|
+
var I = (t, e, s) => e in t ? j(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var x = (t, e, s) => I(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
const R = [
|
|
5
5
|
"label_override",
|
|
6
6
|
"is_visible",
|
|
7
7
|
"default_expanded",
|
|
@@ -13,7 +13,7 @@ const P = [
|
|
|
13
13
|
"input_bindings",
|
|
14
14
|
"widget_id",
|
|
15
15
|
"show_approval_chain"
|
|
16
|
-
],
|
|
16
|
+
], W = 4e3, L = [
|
|
17
17
|
"label",
|
|
18
18
|
"type",
|
|
19
19
|
"icon",
|
|
@@ -30,8 +30,10 @@ const P = [
|
|
|
30
30
|
"visible_when",
|
|
31
31
|
"hidden_for_roles",
|
|
32
32
|
"locked_for_roles",
|
|
33
|
-
"read_width"
|
|
34
|
-
|
|
33
|
+
"read_width",
|
|
34
|
+
"editor_note",
|
|
35
|
+
"i18n"
|
|
36
|
+
], Y = [
|
|
35
37
|
"name",
|
|
36
38
|
"slug",
|
|
37
39
|
"create_label",
|
|
@@ -79,18 +81,21 @@ const P = [
|
|
|
79
81
|
"quick_picker",
|
|
80
82
|
"sheet_width",
|
|
81
83
|
"header_fields",
|
|
82
|
-
"hide_empty"
|
|
83
|
-
|
|
84
|
+
"hide_empty",
|
|
85
|
+
"change_note",
|
|
86
|
+
"entry_config",
|
|
87
|
+
"email_summary_group"
|
|
88
|
+
], m = ["section", "tab", "metadata", "container", "content"], d = "__ungrouped__", z = "__header__", C = [
|
|
84
89
|
"__apply_values__",
|
|
85
90
|
"__create_with_defaults__"
|
|
86
|
-
],
|
|
91
|
+
], D = [
|
|
87
92
|
"__pipeline__",
|
|
88
93
|
"__tasks__",
|
|
89
94
|
"__comments__",
|
|
90
95
|
"__addendums__",
|
|
91
96
|
"__referenced_by__",
|
|
92
97
|
"__related_records__"
|
|
93
|
-
],
|
|
98
|
+
], G = /^__ext_[a-z][a-z0-9-]{1,60}__$/, M = ["__ungrouped_pos__"], F = /* @__PURE__ */ new Map([
|
|
94
99
|
[d, 1],
|
|
95
100
|
["__pipeline__", 2],
|
|
96
101
|
["__tasks__", 3],
|
|
@@ -100,18 +105,18 @@ const P = [
|
|
|
100
105
|
["__addendums__", 7],
|
|
101
106
|
["__referenced_by__", 8],
|
|
102
107
|
["__related_records__", 9]
|
|
103
|
-
]),
|
|
104
|
-
class
|
|
105
|
-
constructor(
|
|
106
|
-
super(
|
|
108
|
+
]), P = (t) => F.get(t) ?? (G.test(t) ? 8 : 0);
|
|
109
|
+
class N extends Error {
|
|
110
|
+
constructor(s, o) {
|
|
111
|
+
super(s);
|
|
107
112
|
x(this, "op_index");
|
|
108
|
-
this.name = "LayoutOpError", this.op_index =
|
|
113
|
+
this.name = "LayoutOpError", this.op_index = o;
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
function f(t) {
|
|
112
|
-
return t.group_key !== null ? !1 :
|
|
117
|
+
return t.group_key !== null ? !1 : D.includes(t.field) || t.field === "__owners__" || t.field === "__pdf__" || G.test(t.field);
|
|
113
118
|
}
|
|
114
|
-
function
|
|
119
|
+
function X(t, e) {
|
|
115
120
|
return {
|
|
116
121
|
field: t,
|
|
117
122
|
group_key: e,
|
|
@@ -129,12 +134,12 @@ function H(t, e) {
|
|
|
129
134
|
show_approval_chain: !1
|
|
130
135
|
};
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function H(t, e, s, o) {
|
|
133
138
|
return {
|
|
134
139
|
key: t,
|
|
135
140
|
label: e,
|
|
136
|
-
type:
|
|
137
|
-
parent_key:
|
|
141
|
+
type: s,
|
|
142
|
+
parent_key: o,
|
|
138
143
|
sort: 0,
|
|
139
144
|
icon: null,
|
|
140
145
|
is_collapsed: !1,
|
|
@@ -154,114 +159,114 @@ function K(t, e, o, s) {
|
|
|
154
159
|
};
|
|
155
160
|
}
|
|
156
161
|
const g = (t, e) => t < e ? -1 : t > e ? 1 : 0, h = (t, e) => (t.id ?? Number.MAX_SAFE_INTEGER) - (e.id ?? Number.MAX_SAFE_INTEGER);
|
|
157
|
-
function
|
|
162
|
+
function K(t) {
|
|
158
163
|
return {
|
|
159
164
|
...t,
|
|
160
165
|
groups: [...t.groups].sort(
|
|
161
|
-
(e,
|
|
166
|
+
(e, s) => g(e.parent_key ?? "", s.parent_key ?? "") || e.sort - s.sort || h(e, s) || g(e.key, s.key)
|
|
162
167
|
),
|
|
163
168
|
placements: [...t.placements].sort(
|
|
164
|
-
(e,
|
|
169
|
+
(e, s) => g(e.group_key ?? "", s.group_key ?? "") || e.sort - s.sort || h(e, s) || g(e.field, s.field)
|
|
165
170
|
)
|
|
166
171
|
};
|
|
167
172
|
}
|
|
168
173
|
function p(t, e) {
|
|
169
|
-
return t.placements.map((
|
|
174
|
+
return t.placements.map((s, o) => ({ p: s, i: o })).filter(({ p: s }) => s.group_key === e && !f(s)).sort((s, o) => s.p.sort - o.p.sort || h(s.p, o.p) || s.i - o.i).map(({ p: s }) => s);
|
|
170
175
|
}
|
|
171
176
|
function u(t, e) {
|
|
172
|
-
const
|
|
173
|
-
return t.groups.forEach((
|
|
174
|
-
|
|
175
|
-
}), e === null && t.placements.forEach((
|
|
176
|
-
f(
|
|
177
|
-
}),
|
|
177
|
+
const s = [];
|
|
178
|
+
return t.groups.forEach((o, l) => {
|
|
179
|
+
o.parent_key === e && s.push({ m: o, tie: P(o.key), i: l });
|
|
180
|
+
}), e === null && t.placements.forEach((o, l) => {
|
|
181
|
+
f(o) && s.push({ m: o, tie: P(o.field), i: t.groups.length + l });
|
|
182
|
+
}), s.sort((o, l) => o.m.sort - l.m.sort || o.tie - l.tie || h(o.m, l.m) || o.i - l.i).map((o) => o.m);
|
|
178
183
|
}
|
|
179
184
|
function c(t) {
|
|
180
|
-
t.forEach((e,
|
|
181
|
-
e.sort =
|
|
185
|
+
t.forEach((e, s) => {
|
|
186
|
+
e.sort = s;
|
|
182
187
|
});
|
|
183
188
|
}
|
|
184
|
-
function
|
|
189
|
+
function V(t) {
|
|
185
190
|
const e = /* @__PURE__ */ new Set();
|
|
186
|
-
for (const
|
|
187
|
-
for (const
|
|
188
|
-
const
|
|
189
|
-
for (const
|
|
190
|
-
for (const
|
|
191
|
+
for (const o of t.placements) f(o) || e.add(o.group_key);
|
|
192
|
+
for (const o of e) c(p(t, o));
|
|
193
|
+
const s = /* @__PURE__ */ new Set([null]);
|
|
194
|
+
for (const o of t.groups) s.add(o.parent_key);
|
|
195
|
+
for (const o of s) c(u(t, o));
|
|
191
196
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
197
|
+
function J(t, e) {
|
|
198
|
+
const s = {
|
|
194
199
|
layout: { ...t.layout },
|
|
195
|
-
groups: t.groups.map((
|
|
196
|
-
placements: t.placements.map((
|
|
200
|
+
groups: t.groups.map((o) => ({ ...o })),
|
|
201
|
+
placements: t.placements.map((o) => ({ ...o }))
|
|
197
202
|
};
|
|
198
|
-
if (!Array.isArray(e)) throw new
|
|
199
|
-
return e.forEach((
|
|
200
|
-
B(
|
|
201
|
-
}),
|
|
203
|
+
if (!Array.isArray(e)) throw new N("ops must be an array", 0);
|
|
204
|
+
return e.forEach((o, l) => {
|
|
205
|
+
B(s, o, l), V(s);
|
|
206
|
+
}), K({ ...s, rev: t.rev });
|
|
202
207
|
}
|
|
203
|
-
function B(t, e,
|
|
204
|
-
const
|
|
205
|
-
throw new
|
|
208
|
+
function B(t, e, s) {
|
|
209
|
+
const o = (n) => {
|
|
210
|
+
throw new N(n, s);
|
|
206
211
|
};
|
|
207
|
-
(!e || typeof e != "object") &&
|
|
208
|
-
const
|
|
209
|
-
(typeof i != "number" || !Number.isFinite(i)) &&
|
|
210
|
-
const
|
|
211
|
-
return [...n.slice(0,
|
|
212
|
+
(!e || typeof e != "object") && o("Each op must be an object");
|
|
213
|
+
const l = (n, r, i) => {
|
|
214
|
+
(typeof i != "number" || !Number.isFinite(i)) && o("index must be a number");
|
|
215
|
+
const _ = Math.max(0, Math.min(n.length, Math.floor(i)));
|
|
216
|
+
return [...n.slice(0, _), r, ...n.slice(_)];
|
|
212
217
|
}, y = (n, r) => {
|
|
213
218
|
if (n == null) return {};
|
|
214
|
-
(typeof n != "object" || Array.isArray(n)) &&
|
|
219
|
+
(typeof n != "object" || Array.isArray(n)) && o("patch must be an object");
|
|
215
220
|
for (const i of Object.keys(n))
|
|
216
|
-
r.includes(i) ||
|
|
221
|
+
r.includes(i) || o(`Unknown setting "${i}"`);
|
|
217
222
|
return n;
|
|
218
223
|
}, A = (n) => {
|
|
219
|
-
const r = y(n,
|
|
220
|
-
return r.type !== void 0 && !m.includes(r.type) &&
|
|
224
|
+
const r = y(n, L);
|
|
225
|
+
return r.type !== void 0 && !m.includes(r.type) && o(`Group type must be one of ${m.join(", ")}`), r.read_width != null && !["full", "half", "third"].includes(r.read_width) && o("read_width must be 'full', 'half', 'third' or null"), r.editor_note != null && (typeof r.editor_note != "string" || r.editor_note.length > 4e3) && o("A note must be text of at most 4000 characters"), r;
|
|
221
226
|
}, k = (n) => {
|
|
222
|
-
(!n || typeof n.field != "string") &&
|
|
227
|
+
(!n || typeof n.field != "string") && o("A placement needs a field");
|
|
223
228
|
const r = n;
|
|
224
|
-
|
|
229
|
+
M.includes(r.field) && o(`"${r.field}" is a reserved name`);
|
|
225
230
|
const i = t.placements.find(
|
|
226
|
-
(
|
|
231
|
+
(_) => _.field === r.field && _.group_key === (r.group_key ?? null)
|
|
227
232
|
);
|
|
228
|
-
return i ||
|
|
233
|
+
return i || o(`"${r.field}" is not placed in ${r.group_key ?? "Ungrouped"}`), i;
|
|
229
234
|
}, b = (n) => {
|
|
230
|
-
n === d &&
|
|
235
|
+
n === d && o("The Ungrouped zone can only be moved");
|
|
231
236
|
const r = t.groups.find((i) => i.key === n);
|
|
232
|
-
return r ||
|
|
237
|
+
return r || o(`No group "${String(n)}"`), r;
|
|
233
238
|
}, O = (n) => {
|
|
234
|
-
if (n === null || n ===
|
|
239
|
+
if (n === null || n === z || t.layout.layout_type === "table" && C.includes(n)) return;
|
|
235
240
|
const r = t.groups.find((i) => i.key === n);
|
|
236
|
-
(!r || r.key === d) &&
|
|
237
|
-
},
|
|
241
|
+
(!r || r.key === d) && o(`No group "${n}"`), r.type === "container" && o("Fields go in the tabs of a container"), r.type === "content" && o("A text block holds text, not fields");
|
|
242
|
+
}, T = (n, r) => {
|
|
238
243
|
if (n === null) return;
|
|
239
|
-
const i = t.groups.find((
|
|
240
|
-
(i == null ? void 0 : i.type) !== "container" &&
|
|
241
|
-
},
|
|
242
|
-
const i = f(n) ? u(t, null).filter((
|
|
243
|
-
c(
|
|
244
|
+
const i = t.groups.find((_) => _.key === n);
|
|
245
|
+
(i == null ? void 0 : i.type) !== "container" && o(`"${n}" is not a container`), r !== "tab" && o("Only tabs go inside a container");
|
|
246
|
+
}, S = (n, r) => {
|
|
247
|
+
const i = f(n) ? u(t, null).filter((_) => _ !== n) : p(t, n.group_key).filter((_) => _ !== n);
|
|
248
|
+
c(l(i, n, r));
|
|
244
249
|
};
|
|
245
250
|
switch (e.op) {
|
|
246
251
|
case "place": {
|
|
247
|
-
(typeof e.field != "string" || !e.field) &&
|
|
252
|
+
(typeof e.field != "string" || !e.field) && o("place needs a field"), M.includes(e.field) && o(`"${e.field}" is a reserved name`);
|
|
248
253
|
const n = e.group_key ?? null;
|
|
249
|
-
O(n), t.placements.some((i) => i.field === e.field && i.group_key === n) &&
|
|
254
|
+
O(n), t.placements.some((i) => i.field === e.field && i.group_key === n) && o(`"${e.field}" is already in ${n ?? "Ungrouped"}`);
|
|
250
255
|
const r = {
|
|
251
|
-
...
|
|
252
|
-
...y(e.patch,
|
|
256
|
+
...X(e.field, n),
|
|
257
|
+
...y(e.patch, R)
|
|
253
258
|
};
|
|
254
|
-
t.placements.push(r),
|
|
259
|
+
t.placements.push(r), S(r, e.index);
|
|
255
260
|
return;
|
|
256
261
|
}
|
|
257
262
|
case "move": {
|
|
258
263
|
const n = k(e.from), r = e.to_group_key ?? null;
|
|
259
|
-
r !== n.group_key && (O(r), t.placements.some((i) => i.field === n.field && i.group_key === r) &&
|
|
264
|
+
r !== n.group_key && (O(r), t.placements.some((i) => i.field === n.field && i.group_key === r) && o(`"${n.field}" is already in ${r ?? "Ungrouped"}`), n.group_key = r), S(n, e.index);
|
|
260
265
|
return;
|
|
261
266
|
}
|
|
262
267
|
case "update_placement": {
|
|
263
268
|
const n = k(e.at);
|
|
264
|
-
Object.assign(n, y(e.patch,
|
|
269
|
+
Object.assign(n, y(e.patch, R));
|
|
265
270
|
return;
|
|
266
271
|
}
|
|
267
272
|
case "remove": {
|
|
@@ -270,33 +275,33 @@ function B(t, e, o) {
|
|
|
270
275
|
return;
|
|
271
276
|
}
|
|
272
277
|
case "group_create": {
|
|
273
|
-
(typeof e.key != "string" || !e.key.trim()) &&
|
|
278
|
+
(typeof e.key != "string" || !e.key.trim()) && o("A group needs a key"), e.key.startsWith("__") && o("Group keys starting with __ are reserved"), t.groups.some((v) => v.key === e.key) && o(`A group "${e.key}" already exists`), typeof e.label != "string" && o("A group needs a label");
|
|
274
279
|
const n = A(e.patch), r = n.type ?? e.group_type;
|
|
275
|
-
m.includes(r) ||
|
|
280
|
+
m.includes(r) || o(`Group type must be one of ${m.join(", ")}`);
|
|
276
281
|
const i = e.parent_key ?? null;
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
t.groups.push(
|
|
282
|
+
T(i, r);
|
|
283
|
+
const _ = { ...H(e.key, e.label, r, i), ...n }, w = u(t, i);
|
|
284
|
+
t.groups.push(_), c(l(w, _, e.index));
|
|
280
285
|
return;
|
|
281
286
|
}
|
|
282
287
|
case "group_update": {
|
|
283
288
|
const n = b(e.key), r = A(e.patch);
|
|
284
|
-
r.type !== void 0 && r.type !== n.type && (n.parent_key !== null && r.type !== "tab" &&
|
|
289
|
+
r.type !== void 0 && r.type !== n.type && (n.parent_key !== null && r.type !== "tab" && o("Only tabs go inside a container"), n.type === "container" && t.groups.some((i) => i.parent_key === n.key) && o("Move the tabs out of this container first"), (r.type === "container" || r.type === "content") && p(t, n.key).length && o("Move the fields out of this section first")), Object.assign(n, r);
|
|
285
290
|
return;
|
|
286
291
|
}
|
|
287
292
|
case "group_move": {
|
|
288
293
|
const n = e.parent_key ?? null;
|
|
289
294
|
let r;
|
|
290
295
|
if (e.key === d || f({ field: e.key, group_key: null })) {
|
|
291
|
-
n !== null &&
|
|
292
|
-
const i = e.key === d ? t.groups.find((
|
|
293
|
-
i ||
|
|
296
|
+
n !== null && o("This stays at the top level of the form");
|
|
297
|
+
const i = e.key === d ? t.groups.find((_) => _.key === d) : t.placements.find((_) => _.field === e.key && _.group_key === null);
|
|
298
|
+
i || o(`"${e.key}" is not on this form`), r = i;
|
|
294
299
|
} else {
|
|
295
300
|
const i = b(e.key);
|
|
296
|
-
|
|
301
|
+
T(n, i.type), i.parent_key = n, r = i;
|
|
297
302
|
}
|
|
298
303
|
c(
|
|
299
|
-
|
|
304
|
+
l(
|
|
300
305
|
u(t, n).filter((i) => i !== r),
|
|
301
306
|
r,
|
|
302
307
|
e.index
|
|
@@ -306,43 +311,44 @@ function B(t, e, o) {
|
|
|
306
311
|
}
|
|
307
312
|
case "group_remove": {
|
|
308
313
|
const n = b(e.key);
|
|
309
|
-
e.placements !== "ungroup" && e.placements !== "delete" &&
|
|
314
|
+
e.placements !== "ungroup" && e.placements !== "delete" && o("placements must be 'ungroup' or 'delete'");
|
|
310
315
|
const r = u(t, n.parent_key), i = u(t, n.key);
|
|
311
316
|
for (const a of i) a.parent_key = n.parent_key;
|
|
312
|
-
const
|
|
313
|
-
c([...r.slice(0,
|
|
317
|
+
const _ = r.indexOf(n);
|
|
318
|
+
c([...r.slice(0, _), ...i, ...r.slice(_ + 1)]), t.groups = t.groups.filter((a) => a !== n);
|
|
314
319
|
const w = p(t, n.key);
|
|
315
320
|
if (t.placements = t.placements.filter((a) => a.group_key !== n.key), e.placements === "delete") return;
|
|
316
|
-
const v = p(t, null),
|
|
317
|
-
(a) => !t.placements.some((
|
|
321
|
+
const v = p(t, null), U = u(t, null), E = w.filter(
|
|
322
|
+
(a) => !t.placements.some(($) => $.field === a.field && $.group_key === null)
|
|
318
323
|
);
|
|
319
324
|
for (const a of E)
|
|
320
325
|
a.group_key = null, t.placements.push(a);
|
|
321
|
-
c([...v, ...E.filter((a) => !f(a))]), c([...
|
|
326
|
+
c([...v, ...E.filter((a) => !f(a))]), c([...U, ...E.filter((a) => f(a))]);
|
|
322
327
|
return;
|
|
323
328
|
}
|
|
324
329
|
case "layout_update": {
|
|
325
|
-
Object.assign(t.layout, y(e.patch,
|
|
330
|
+
Object.assign(t.layout, y(e.patch, Y));
|
|
326
331
|
return;
|
|
327
332
|
}
|
|
328
333
|
default:
|
|
329
|
-
|
|
334
|
+
o(`Unknown op "${String(e.op)}"`);
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
337
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
338
|
+
D as CANVAS_SLOT_KEYS,
|
|
339
|
+
W as EDITOR_NOTE_MAX,
|
|
340
|
+
L as GROUP_PATCH_KEYS,
|
|
335
341
|
m as GROUP_TYPES,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
z as HEADER_GROUP_KEY,
|
|
343
|
+
Y as LAYOUT_PATCH_KEYS,
|
|
344
|
+
N as LayoutOpError,
|
|
345
|
+
R as PLACEMENT_PATCH_KEYS,
|
|
346
|
+
M as RESERVED_FIELDS,
|
|
347
|
+
C as TABLE_FORM_GROUP_KEYS,
|
|
342
348
|
d as UNGROUPED_KEY,
|
|
343
|
-
|
|
349
|
+
J as applyLayoutOps,
|
|
344
350
|
f as isCanvasSlot,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
351
|
+
H as newGroup,
|
|
352
|
+
X as newPlacement,
|
|
353
|
+
K as sortBundleRows
|
|
348
354
|
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
const s = /^\d{4}-\d{2}-\d{2}$/, c = (t) => typeof t == "string" && s.test(t);
|
|
2
|
+
function o(t) {
|
|
3
|
+
let n = t;
|
|
4
|
+
if (typeof n == "string")
|
|
5
|
+
try {
|
|
6
|
+
n = JSON.parse(n);
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return n && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
11
|
+
}
|
|
12
|
+
function l(t, n, e) {
|
|
13
|
+
const r = { ...o(t) ?? {} };
|
|
14
|
+
return e == null ? delete r[n] : r[n] = e, Object.keys(r).length > 0 ? r : null;
|
|
15
|
+
}
|
|
16
|
+
function a(t = /* @__PURE__ */ new Date()) {
|
|
17
|
+
const n = (e) => String(e).padStart(2, "0");
|
|
18
|
+
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}`;
|
|
19
|
+
}
|
|
20
|
+
function p(t) {
|
|
21
|
+
var u;
|
|
22
|
+
const n = o((u = o(t)) == null ? void 0 : u.active_window);
|
|
23
|
+
if (!n) return null;
|
|
24
|
+
const e = c(n.from) ? n.from : null, r = c(n.until) ? n.until : null;
|
|
25
|
+
return e || r ? { from: e, until: r } : null;
|
|
26
|
+
}
|
|
27
|
+
function h(t, n) {
|
|
28
|
+
return t ? t.from && n < t.from ? "before" : t.until && n > t.until ? "after" : "open" : null;
|
|
29
|
+
}
|
|
30
|
+
function i(t) {
|
|
31
|
+
return (/* @__PURE__ */ new Date(`${t}T00:00:00Z`)).toLocaleDateString(void 0, {
|
|
32
|
+
day: "numeric",
|
|
33
|
+
month: "short",
|
|
34
|
+
year: "numeric",
|
|
35
|
+
timeZone: "UTC"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function g(t) {
|
|
39
|
+
return t.from && t.until ? `${i(t.from)} – ${i(t.until)}` : t.from ? `from ${i(t.from)}` : `until ${i(t.until)}`;
|
|
40
|
+
}
|
|
41
|
+
function b(t, n) {
|
|
42
|
+
const e = n.from || null, r = n.until || null;
|
|
43
|
+
return {
|
|
44
|
+
conditions: l(
|
|
45
|
+
t,
|
|
46
|
+
"active_window",
|
|
47
|
+
e || r ? { ...e ? { from: e } : {}, ...r ? { until: r } : {} } : null
|
|
48
|
+
)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function _(t) {
|
|
52
|
+
var e;
|
|
53
|
+
const n = Number((e = o(t)) == null ? void 0 : e.phone_of);
|
|
54
|
+
return Number.isInteger(n) && n > 0 ? n : null;
|
|
55
|
+
}
|
|
56
|
+
function w(t, n) {
|
|
57
|
+
return { conditions: l(t, "phone_of", n) };
|
|
58
|
+
}
|
|
59
|
+
function y(t) {
|
|
60
|
+
var e;
|
|
61
|
+
const n = o((e = o(t)) == null ? void 0 : e.freeze);
|
|
62
|
+
return !n || !c(n.until) ? null : {
|
|
63
|
+
until: n.until,
|
|
64
|
+
reason: typeof n.reason == "string" ? n.reason : "",
|
|
65
|
+
by: typeof n.by == "string" ? n.by : null,
|
|
66
|
+
by_name: typeof n.by_name == "string" ? n.by_name : null,
|
|
67
|
+
at: typeof n.at == "string" ? n.at : null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function z(t, n = a()) {
|
|
71
|
+
const e = y(t);
|
|
72
|
+
return e && n < e.until ? e : null;
|
|
73
|
+
}
|
|
74
|
+
function O(t, n) {
|
|
75
|
+
return { conditions: l(t, "freeze", n) };
|
|
76
|
+
}
|
|
77
|
+
function d(t) {
|
|
78
|
+
var e;
|
|
79
|
+
const n = (e = o(t)) == null ? void 0 : e.lazy_sections;
|
|
80
|
+
return Array.isArray(n) ? [...new Set(n.filter((r) => typeof r == "string"))] : [];
|
|
81
|
+
}
|
|
82
|
+
function $(t, n, e) {
|
|
83
|
+
const r = d(t).filter((f) => f !== n), u = e ? [...r, n] : r;
|
|
84
|
+
return { conditions: l(t, "lazy_sections", u.length ? u : null) };
|
|
85
|
+
}
|
|
86
|
+
const m = "(max-width: 639px)";
|
|
87
|
+
function S() {
|
|
88
|
+
var t;
|
|
89
|
+
try {
|
|
90
|
+
return typeof window < "u" && ((t = window.matchMedia) != null && t.call(window, m).matches) ? "phone" : null;
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
m as PHONE_QUERY,
|
|
97
|
+
z as activeFreeze,
|
|
98
|
+
p as activeWindowOf,
|
|
99
|
+
b as activeWindowPatch,
|
|
100
|
+
o as conditionsObject,
|
|
101
|
+
l as conditionsWithKey,
|
|
102
|
+
S as currentViewport,
|
|
103
|
+
i as dayWords,
|
|
104
|
+
y as freezeOf,
|
|
105
|
+
O as freezePatch,
|
|
106
|
+
$ as lazySectionPatch,
|
|
107
|
+
d as lazySectionsOf,
|
|
108
|
+
a as localDay,
|
|
109
|
+
_ as phoneOf,
|
|
110
|
+
w as phoneOfPatch,
|
|
111
|
+
h as windowState,
|
|
112
|
+
g as windowWords
|
|
113
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (typeof t == "string")
|
|
3
|
+
try {
|
|
4
|
+
const e = JSON.parse(t);
|
|
5
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
6
|
+
} catch {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
return t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
10
|
+
}
|
|
11
|
+
const u = (t) => Array.isArray(t) ? t.filter((e) => typeof e == "string" && e !== "") : [], f = (t) => typeof t == "string" && t.trim() !== "" ? t : void 0;
|
|
12
|
+
function y(t) {
|
|
13
|
+
const e = c(t).text_rules;
|
|
14
|
+
if (!Array.isArray(e)) return [];
|
|
15
|
+
const r = [];
|
|
16
|
+
for (const n of e) {
|
|
17
|
+
if (!n || typeof n != "object") continue;
|
|
18
|
+
const i = n, s = i.type === "role" ? "role" : i.type === "pipeline_state" ? "pipeline_state" : null;
|
|
19
|
+
if (!s) continue;
|
|
20
|
+
const o = { type: s };
|
|
21
|
+
typeof i.pipeline_id == "string" && i.pipeline_id && (o.pipeline_id = i.pipeline_id), s === "pipeline_state" ? o.state_keys = u(i.state_keys) : o.role_ids = u(i.role_ids);
|
|
22
|
+
const l = f(i.label), a = f(i.note);
|
|
23
|
+
l !== void 0 && (o.label = l), a !== void 0 && (o.note = a), r.push(o);
|
|
24
|
+
}
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
function p(t, e) {
|
|
28
|
+
if (t.type === "pipeline_state") {
|
|
29
|
+
const n = t.state_keys ?? [];
|
|
30
|
+
return !!e.stateKey && n.includes(e.stateKey);
|
|
31
|
+
}
|
|
32
|
+
const r = (t.role_ids ?? []).map((n) => n.toUpperCase());
|
|
33
|
+
return !!e.roleId && r.includes(e.roleId.toUpperCase());
|
|
34
|
+
}
|
|
35
|
+
function h(t, e) {
|
|
36
|
+
const r = {};
|
|
37
|
+
for (const n of y(t))
|
|
38
|
+
if (p(n, e) && (r.label === void 0 && n.label !== void 0 && (r.label = n.label), r.note === void 0 && n.note !== void 0 && (r.note = n.note), r.label !== void 0 && r.note !== void 0))
|
|
39
|
+
break;
|
|
40
|
+
return r;
|
|
41
|
+
}
|
|
42
|
+
function k(t) {
|
|
43
|
+
const e = c(t);
|
|
44
|
+
return e.recommended === !0 && e.required !== !0;
|
|
45
|
+
}
|
|
46
|
+
function F(t) {
|
|
47
|
+
return t == null || t === "" ? !0 : Array.isArray(t) ? t.length === 0 : typeof t == "string" && t.trim() === "";
|
|
48
|
+
}
|
|
49
|
+
function m(t) {
|
|
50
|
+
const e = c(t).confirm_change;
|
|
51
|
+
return e === !0 ? { state_keys: [] } : !e || typeof e != "object" || Array.isArray(e) ? null : { state_keys: u(e.state_keys) };
|
|
52
|
+
}
|
|
53
|
+
function U(t, e) {
|
|
54
|
+
const r = m(t);
|
|
55
|
+
return r ? r.state_keys.length === 0 ? !0 : !!e && r.state_keys.includes(e) : !1;
|
|
56
|
+
}
|
|
57
|
+
const d = 1e6;
|
|
58
|
+
function g(t) {
|
|
59
|
+
const e = c(t).counter;
|
|
60
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
61
|
+
const r = e, n = Number(r.limit);
|
|
62
|
+
return {
|
|
63
|
+
unit: r.unit === "words" ? "words" : "characters",
|
|
64
|
+
limit: r.limit != null && r.limit !== "" && Number.isFinite(n) && n > 0 ? Math.min(d, Math.floor(n)) : null
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function _(t) {
|
|
68
|
+
if (t == null) return "";
|
|
69
|
+
const e = typeof t == "string" ? t : typeof t == "object" ? JSON.stringify(t) : String(t);
|
|
70
|
+
return /<[a-z!/][^>]*>/i.test(e) ? e.replace(/<(br|\/p|\/div|\/li|\/h[1-6])\b[^>]*>/gi, " ").replace(/<[^>]*>/g, "").replace(/ /g, " ").replace(/&(amp|lt|gt|quot|#39);/g, "x") : e;
|
|
71
|
+
}
|
|
72
|
+
function b(t, e) {
|
|
73
|
+
const r = _(t);
|
|
74
|
+
if (e === "words") {
|
|
75
|
+
const n = r.trim();
|
|
76
|
+
return n ? n.split(/\s+/).length : 0;
|
|
77
|
+
}
|
|
78
|
+
return r.length;
|
|
79
|
+
}
|
|
80
|
+
function L(t, e) {
|
|
81
|
+
return e == null ? "ok" : t > e ? "over" : t >= e * 0.9 ? "near" : "ok";
|
|
82
|
+
}
|
|
83
|
+
function x(t, e, r) {
|
|
84
|
+
const n = g(e);
|
|
85
|
+
if (!n || n.limit == null) return null;
|
|
86
|
+
const i = b(t, n.unit);
|
|
87
|
+
return i <= n.limit ? null : `${r} is over its limit of ${n.limit.toLocaleString("en-US")} ${n.unit} (${i.toLocaleString("en-US")})`;
|
|
88
|
+
}
|
|
89
|
+
const S = /^__calc_[a-z0-9_]{1,40}__$/;
|
|
90
|
+
function D(t) {
|
|
91
|
+
return S.test(t);
|
|
92
|
+
}
|
|
93
|
+
function w(t) {
|
|
94
|
+
const e = new Set(t);
|
|
95
|
+
for (let r = 1; ; r++) {
|
|
96
|
+
const n = `__calc_${r}__`;
|
|
97
|
+
if (!e.has(n)) return n;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const A = ["", "integer", "number", "currency", "percent"];
|
|
101
|
+
function O(t) {
|
|
102
|
+
const e = c(t).display_formula;
|
|
103
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
104
|
+
const r = e, n = A.includes(r.format) ? r.format : "", i = typeof r.currency == "string" && /^[A-Z]{3}$/.test(r.currency) ? r.currency : null;
|
|
105
|
+
return { expr: typeof r.expr == "string" ? r.expr : "", format: n, currency: i };
|
|
106
|
+
}
|
|
107
|
+
function j(t, e) {
|
|
108
|
+
if (t == null || !Number.isFinite(t)) return "—";
|
|
109
|
+
switch (e.format) {
|
|
110
|
+
case "integer":
|
|
111
|
+
return Math.round(t).toLocaleString("en-US");
|
|
112
|
+
case "currency":
|
|
113
|
+
try {
|
|
114
|
+
return t.toLocaleString("en-US", { style: "currency", currency: e.currency || "USD" });
|
|
115
|
+
} catch {
|
|
116
|
+
return t.toLocaleString("en-US", { style: "currency", currency: "USD" });
|
|
117
|
+
}
|
|
118
|
+
case "percent":
|
|
119
|
+
return `${t.toLocaleString("en-US", { maximumFractionDigits: 1 })}%`;
|
|
120
|
+
case "number":
|
|
121
|
+
return t.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
122
|
+
default:
|
|
123
|
+
return t.toLocaleString("en-US", { maximumFractionDigits: 4 });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
d as COUNTER_LIMIT_MAX,
|
|
128
|
+
U as confirmChangeApplies,
|
|
129
|
+
m as confirmChangeOf,
|
|
130
|
+
b as countValue,
|
|
131
|
+
x as counterError,
|
|
132
|
+
g as counterOf,
|
|
133
|
+
L as counterState,
|
|
134
|
+
O as displayFormulaOf,
|
|
135
|
+
j as formatDisplayValue,
|
|
136
|
+
D as isDisplayFormulaField,
|
|
137
|
+
F as isEmptyValue,
|
|
138
|
+
k as isRecommended,
|
|
139
|
+
w as nextDisplayFormulaField,
|
|
140
|
+
c as overridesObject,
|
|
141
|
+
h as resolvePlacementText,
|
|
142
|
+
p as textRuleMatches,
|
|
143
|
+
y as textRulesOf
|
|
144
|
+
};
|