@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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const p = "__header__", N = "__general__", E = "__ungrouped__", w = /* @__PURE__ */ new Set(["content", "metadata"]), a = (l) => Number.isFinite(Number(l)) ? Number(l) : 0;
|
|
2
|
+
function v(l, c, s = {}) {
|
|
3
|
+
const u = c.filter((e) => e.is_visible == null || !!e.is_visible).filter((e) => !e.field.startsWith("__")).sort((e, n) => a(e.sort) - a(n.sort)), d = /* @__PURE__ */ new Map();
|
|
4
|
+
for (const e of l) e.id != null && d.set(Number(e.id), e);
|
|
5
|
+
const t = /* @__PURE__ */ new Map();
|
|
6
|
+
for (const e of l) {
|
|
7
|
+
const n = e.container_id == null ? null : Number(e.container_id);
|
|
8
|
+
if (n != null && !d.has(n)) continue;
|
|
9
|
+
const f = t.get(n) ?? [];
|
|
10
|
+
f.push(e), t.set(n, f);
|
|
11
|
+
}
|
|
12
|
+
for (const e of t.values()) e.sort((n, f) => a(n.sort) - a(f.sort));
|
|
13
|
+
const r = (e) => u.filter((n) => n.group_key === e).map((n) => ({ field: n.field, label: n.label_override || null })), i = [], o = r(p);
|
|
14
|
+
o.length && i.push({ key: p, label: "Header", fields: o });
|
|
15
|
+
const y = {
|
|
16
|
+
key: N,
|
|
17
|
+
label: s.generalLabel ?? "General",
|
|
18
|
+
fields: u.filter((e) => e.group_key == null || e.group_key === E).map((e) => ({ field: e.field, label: e.label_override || null }))
|
|
19
|
+
};
|
|
20
|
+
let b = !1;
|
|
21
|
+
const h = () => {
|
|
22
|
+
b || (b = !0, y.fields.length && i.push(y));
|
|
23
|
+
};
|
|
24
|
+
s.ungroupedSort == null && h();
|
|
25
|
+
const g = /* @__PURE__ */ new Set(), m = (e, n) => {
|
|
26
|
+
var S;
|
|
27
|
+
if (g.has(e.key)) return;
|
|
28
|
+
g.add(e.key);
|
|
29
|
+
const f = ((S = e.label) == null ? void 0 : S.trim()) || "", k = f ? [...n, f] : n;
|
|
30
|
+
if (!w.has(String(e.type ?? ""))) {
|
|
31
|
+
const _ = r(e.key);
|
|
32
|
+
_.length && i.push({ key: e.key, label: k.join(" › ") || O(e.key), fields: _ });
|
|
33
|
+
}
|
|
34
|
+
if (e.id != null) for (const _ of t.get(Number(e.id)) ?? []) m(_, k);
|
|
35
|
+
};
|
|
36
|
+
for (const e of t.get(null) ?? [])
|
|
37
|
+
e.key !== p && (!b && s.ungroupedSort != null && a(e.sort) > s.ungroupedSort && h(), m(e, []));
|
|
38
|
+
return h(), i;
|
|
39
|
+
}
|
|
40
|
+
function O(l) {
|
|
41
|
+
return l.replace(/[_-]+/g, " ").replace(/^\w/, (c) => c.toUpperCase());
|
|
42
|
+
}
|
|
43
|
+
function G(l) {
|
|
44
|
+
const c = [], s = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set();
|
|
45
|
+
for (const d of l)
|
|
46
|
+
for (const t of d) {
|
|
47
|
+
const r = t.fields.filter((o) => !u.has(o.field));
|
|
48
|
+
if (r.length === 0) continue;
|
|
49
|
+
for (const o of r) u.add(o.field);
|
|
50
|
+
const i = s.get(t.label);
|
|
51
|
+
if (i) i.fields.push(...r);
|
|
52
|
+
else {
|
|
53
|
+
const o = { ...t, fields: [...r] };
|
|
54
|
+
s.set(t.label, o), c.push(o);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return c;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
N as GENERAL_SECTION_KEY,
|
|
61
|
+
p as HEADER_SECTION_KEY,
|
|
62
|
+
v as formSections,
|
|
63
|
+
G as mergeFormSections
|
|
64
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const g = "sticky", y = "empty_text", m = "row_groups", k = "fold", b = 200, O = 120;
|
|
2
|
+
function a(n) {
|
|
3
|
+
if (n && typeof n == "object" && !Array.isArray(n)) return n;
|
|
4
|
+
if (typeof n != "string" || !n.trim()) return {};
|
|
5
|
+
try {
|
|
6
|
+
const e = JSON.parse(n);
|
|
7
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
8
|
+
} catch {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function E(n) {
|
|
13
|
+
if (!Array.isArray(n)) return [];
|
|
14
|
+
const e = [], r = /* @__PURE__ */ new Set();
|
|
15
|
+
for (const s of n) {
|
|
16
|
+
if (!s || typeof s != "object") continue;
|
|
17
|
+
const { key: t, label: i, fields: l } = s;
|
|
18
|
+
if (typeof t != "string" || !t || r.has(t) || !Array.isArray(l)) continue;
|
|
19
|
+
const u = l.filter(
|
|
20
|
+
(c) => typeof c == "string" && !!c && !e.some((d) => d.fields.includes(c))
|
|
21
|
+
);
|
|
22
|
+
r.add(t), e.push({ key: t, label: typeof i == "string" ? i : "", fields: [...new Set(u)] });
|
|
23
|
+
}
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
function T(n) {
|
|
27
|
+
const e = a(n), r = typeof e[y] == "string" ? e[y].trim() : "";
|
|
28
|
+
return {
|
|
29
|
+
sticky: e[g] === !0,
|
|
30
|
+
emptyText: r || null,
|
|
31
|
+
rows: E(e[m])
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function S(n, e) {
|
|
35
|
+
const r = { ...a(n) }, s = (t, i) => {
|
|
36
|
+
i === void 0 ? delete r[t] : r[t] = i;
|
|
37
|
+
};
|
|
38
|
+
if ("sticky" in e && s(g, e.sticky ? !0 : void 0), "emptyText" in e) {
|
|
39
|
+
const t = (e.emptyText ?? "").trim().slice(0, 200);
|
|
40
|
+
s(y, t || void 0);
|
|
41
|
+
}
|
|
42
|
+
if ("rows" in e) {
|
|
43
|
+
const t = (e.rows ?? []).map((i) => ({ ...i, label: i.label.slice(0, 120) })).filter((i) => i.fields.length > 0);
|
|
44
|
+
s(m, t.length ? t : void 0);
|
|
45
|
+
}
|
|
46
|
+
return Object.keys(r).length ? JSON.stringify(r) : null;
|
|
47
|
+
}
|
|
48
|
+
function h(n, e) {
|
|
49
|
+
return n.find((r) => r.fields.includes(e)) ?? null;
|
|
50
|
+
}
|
|
51
|
+
function Y(n) {
|
|
52
|
+
return a(n)[k] === !0;
|
|
53
|
+
}
|
|
54
|
+
function M(n) {
|
|
55
|
+
return n == null || n === "" || Array.isArray(n) && n.length === 0;
|
|
56
|
+
}
|
|
57
|
+
function R(n) {
|
|
58
|
+
for (const e of n)
|
|
59
|
+
if ((e.type ?? "section") === "section" && T(e.swap_config).sticky)
|
|
60
|
+
return e.key;
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function X(n, e = {}) {
|
|
64
|
+
var w, _, A;
|
|
65
|
+
const r = e.rows ?? [], s = new Set(n.map((o) => o.field)), t = r.filter((o) => o.fields.filter((f) => s.has(f)).length >= 2), i = (o) => t.find((f) => f.fields.includes(o)) ?? null, l = [], u = [];
|
|
66
|
+
let c = !1;
|
|
67
|
+
const d = /* @__PURE__ */ new Set();
|
|
68
|
+
for (const o of n) {
|
|
69
|
+
const f = i(o.field);
|
|
70
|
+
if (f) {
|
|
71
|
+
if (d.has(f.key)) continue;
|
|
72
|
+
d.add(f.key), l.push({ kind: "row", row: f, members: n.filter((p) => f.fields.includes(p.field)) });
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if ((w = e.folded) != null && w.call(e, o) && !((_ = e.keep) != null && _.call(e, o))) {
|
|
76
|
+
u.push(o), (A = e.filled) != null && A.call(e, o) && (c = !0);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
l.push({ kind: "field", field: o });
|
|
80
|
+
}
|
|
81
|
+
return { units: l, folded: u, forcedOpen: c };
|
|
82
|
+
}
|
|
83
|
+
const x = (n) => `Show ${n} more`;
|
|
84
|
+
export {
|
|
85
|
+
y as EMPTY_TEXT_KEY,
|
|
86
|
+
b as EMPTY_TEXT_MAX,
|
|
87
|
+
k as FOLD_KEY,
|
|
88
|
+
m as ROW_GROUPS_KEY,
|
|
89
|
+
O as ROW_LABEL_MAX,
|
|
90
|
+
g as STICKY_KEY,
|
|
91
|
+
x as foldLabel,
|
|
92
|
+
M as isEmptyValue,
|
|
93
|
+
Y as isFolded,
|
|
94
|
+
X as planFieldGrid,
|
|
95
|
+
T as readGroupStructure,
|
|
96
|
+
h as rowOf,
|
|
97
|
+
R as stickyGroupKey,
|
|
98
|
+
S as withGroupStructure
|
|
99
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var w = (t, e, n) => e in t ? S(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var i = (t, e, n) => w(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
const r = [];
|
|
5
|
+
let h = null, a = null, d = !1;
|
|
6
|
+
const p = 20, v = 15e3;
|
|
7
|
+
function l() {
|
|
8
|
+
if (a && (clearTimeout(a), a = null), !h || r.length === 0) return;
|
|
9
|
+
const { apiBase: t, authHeaders: e, credentials: n } = h;
|
|
10
|
+
for (; r.length; ) {
|
|
11
|
+
const s = JSON.stringify({ events: r.splice(0, p) });
|
|
12
|
+
try {
|
|
13
|
+
const o = `${t}/layout-usage/beacon`;
|
|
14
|
+
!(Object.keys(e).length > 0) && typeof navigator < "u" && typeof navigator.sendBeacon == "function" && navigator.sendBeacon(o, new Blob([s], { type: "application/json" })) || fetch(o, {
|
|
15
|
+
method: "POST",
|
|
16
|
+
credentials: n,
|
|
17
|
+
headers: { "Content-Type": "application/json", ...e },
|
|
18
|
+
body: s,
|
|
19
|
+
keepalive: !0
|
|
20
|
+
}).catch(() => {
|
|
21
|
+
});
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function g() {
|
|
27
|
+
d || typeof window > "u" || (d = !0, window.addEventListener("pagehide", l), document.addEventListener("visibilitychange", () => {
|
|
28
|
+
document.visibilityState === "hidden" && l();
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
function _(t, e) {
|
|
32
|
+
h = e, r.push(t), g(), r.length >= p ? l() : a || (a = setTimeout(l, v));
|
|
33
|
+
}
|
|
34
|
+
class k {
|
|
35
|
+
constructor(e, n, s = !0) {
|
|
36
|
+
i(this, "steps", {});
|
|
37
|
+
i(this, "current");
|
|
38
|
+
i(this, "since");
|
|
39
|
+
this.current = e, this.since = s ? n : null;
|
|
40
|
+
}
|
|
41
|
+
settle(e) {
|
|
42
|
+
if (this.since == null) return;
|
|
43
|
+
const n = Math.max(0, e - this.since);
|
|
44
|
+
n > 0 && (this.steps[this.current] = (this.steps[this.current] ?? 0) + n), this.since = e;
|
|
45
|
+
}
|
|
46
|
+
step(e, n) {
|
|
47
|
+
e !== this.current && (this.settle(n), this.current = e);
|
|
48
|
+
}
|
|
49
|
+
pause(e) {
|
|
50
|
+
this.settle(e), this.since = null;
|
|
51
|
+
}
|
|
52
|
+
resume(e) {
|
|
53
|
+
this.since == null && (this.since = e);
|
|
54
|
+
}
|
|
55
|
+
get currentStep() {
|
|
56
|
+
return this.current;
|
|
57
|
+
}
|
|
58
|
+
/** The time so far in this chunk, without starting afresh. */
|
|
59
|
+
peek(e) {
|
|
60
|
+
const n = this.since == null ? 0 : Math.max(0, e - this.since);
|
|
61
|
+
return Object.values(this.steps).reduce((s, o) => s + o, 0) + n;
|
|
62
|
+
}
|
|
63
|
+
/** The time so far, and start counting afresh (the clock keeps running). */
|
|
64
|
+
take(e) {
|
|
65
|
+
this.settle(e);
|
|
66
|
+
const n = this.steps;
|
|
67
|
+
return this.steps = {}, { steps: n, total: Object.values(n).reduce((s, o) => s + o, 0) };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const m = 400, y = 3e3;
|
|
71
|
+
function B(t) {
|
|
72
|
+
if (!t.saved && !t.openSent && t.elapsed < m || !t.saved && t.openSent && t.total <= 0) return null;
|
|
73
|
+
const e = {
|
|
74
|
+
layout_id: t.layoutId,
|
|
75
|
+
collection: t.collection,
|
|
76
|
+
item: t.item,
|
|
77
|
+
open: !t.openSent,
|
|
78
|
+
saved: t.saved,
|
|
79
|
+
abandoned_step: t.final && t.item == null && !t.saved && t.elapsed >= y ? t.step : null,
|
|
80
|
+
steps: t.steps
|
|
81
|
+
};
|
|
82
|
+
return t.sections && (t.sections.shown.length || t.sections.opened.length) && (e.sections = t.sections), t.saved && t.saveMs != null && t.saveMs > 0 && (e.save_ms = Math.round(t.saveMs)), e;
|
|
83
|
+
}
|
|
84
|
+
const u = /* @__PURE__ */ new Set(), c = [], f = 5e3;
|
|
85
|
+
function N(t) {
|
|
86
|
+
const e = Date.now();
|
|
87
|
+
for (c.push({ ...t, at: e }); c.length > 200 || c[0] && e - c[0].at > f; )
|
|
88
|
+
c.shift();
|
|
89
|
+
for (const n of u)
|
|
90
|
+
try {
|
|
91
|
+
n(t);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function T(t) {
|
|
96
|
+
const e = Date.now();
|
|
97
|
+
for (const n of c) n.kind === "shown" && e - n.at <= f && t(n);
|
|
98
|
+
return u.add(t), () => {
|
|
99
|
+
u.delete(t);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
class j {
|
|
103
|
+
constructor() {
|
|
104
|
+
i(this, "shown", /* @__PURE__ */ new Set());
|
|
105
|
+
i(this, "opened", /* @__PURE__ */ new Set());
|
|
106
|
+
i(this, "sentShown", /* @__PURE__ */ new Set());
|
|
107
|
+
i(this, "sentOpened", /* @__PURE__ */ new Set());
|
|
108
|
+
}
|
|
109
|
+
note(e, n) {
|
|
110
|
+
e === "opened" ? (this.shown.add(n), this.opened.add(n)) : this.shown.add(n);
|
|
111
|
+
}
|
|
112
|
+
pending() {
|
|
113
|
+
return {
|
|
114
|
+
shown: [...this.shown].filter((e) => !this.sentShown.has(e)),
|
|
115
|
+
opened: [...this.opened].filter((e) => !this.sentOpened.has(e))
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
markSent(e) {
|
|
119
|
+
for (const n of e.shown) this.sentShown.add(n);
|
|
120
|
+
for (const n of e.opened) this.sentOpened.add(n);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
y as MIN_ABANDON_MS,
|
|
125
|
+
m as MIN_SESSION_MS,
|
|
126
|
+
j as SectionTally,
|
|
127
|
+
k as StepClock,
|
|
128
|
+
l as flushFormUsage,
|
|
129
|
+
T as onSectionUse,
|
|
130
|
+
_ as queueFormUsage,
|
|
131
|
+
N as reportSectionUse,
|
|
132
|
+
B as sessionEvent
|
|
133
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useSyncExternalStore as k } from "react";
|
|
2
2
|
const u = "nvr:jobs-tray:v1", a = "nvr:jobs-tray:dismissed:v1", m = 20, w = 1440 * 60 * 1e3;
|
|
3
3
|
let s = [], o = /* @__PURE__ */ new Set(), y = !1, S = 0;
|
|
4
|
-
const
|
|
5
|
-
function
|
|
4
|
+
const d = /* @__PURE__ */ new Set();
|
|
5
|
+
function r(t, n) {
|
|
6
6
|
try {
|
|
7
7
|
const e = localStorage.getItem(t);
|
|
8
8
|
return e ? JSON.parse(e) : n;
|
|
@@ -18,24 +18,24 @@ function f() {
|
|
|
18
18
|
}
|
|
19
19
|
function l() {
|
|
20
20
|
S++;
|
|
21
|
-
for (const t of
|
|
21
|
+
for (const t of d) t();
|
|
22
22
|
}
|
|
23
23
|
function g() {
|
|
24
24
|
const t = Date.now() - w;
|
|
25
25
|
s = s.filter((n) => n.status === "queued" || n.status === "running" || n.at >= t).sort((n, e) => e.at - n.at).slice(0, m);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
y || typeof window > "u" || (y = !0, s =
|
|
29
|
-
t.key !== u && t.key !== a || (s =
|
|
27
|
+
function i() {
|
|
28
|
+
y || typeof window > "u" || (y = !0, s = r(u, []), o = new Set(r(a, [])), g(), window.addEventListener("storage", (t) => {
|
|
29
|
+
t.key !== u && t.key !== a || (s = r(u, []), o = new Set(r(a, [])), l());
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function _(t, n) {
|
|
33
33
|
return o.has(t) && (n === "completed" || n === "error" || n === "canceled");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (
|
|
37
|
-
const e = s.find((
|
|
38
|
-
if (e && (e.status === "completed" || e.status === "error" || e.status === "canceled") && t.status === "running" || (t.status === "queued" && o.delete(t.key),
|
|
35
|
+
function b(t, n = Date.now()) {
|
|
36
|
+
if (i(), !(t != null && t.key) || !t.status) return;
|
|
37
|
+
const e = s.find((c) => c.key === t.key);
|
|
38
|
+
if (e && (e.status === "completed" || e.status === "error" || e.status === "canceled") && t.status === "running" || (t.status === "queued" && o.delete(t.key), _(t.key, t.status))) return;
|
|
39
39
|
s = [{
|
|
40
40
|
key: t.key,
|
|
41
41
|
kind: t.kind ?? (e == null ? void 0 : e.kind) ?? "job",
|
|
@@ -46,35 +46,37 @@ function _(t, n = Date.now()) {
|
|
|
46
46
|
error: t.error ?? null,
|
|
47
47
|
href: t.href ?? (e == null ? void 0 : e.href) ?? null,
|
|
48
48
|
file_id: t.file_id ?? (e == null ? void 0 : e.file_id) ?? null,
|
|
49
|
+
// Only a running job can be cancelled; a progress tick without it keeps the earlier one.
|
|
50
|
+
cancel_path: t.status === "running" || t.status === "queued" ? t.cancel_path ?? (e == null ? void 0 : e.cancel_path) ?? null : null,
|
|
49
51
|
position: t.position ?? null,
|
|
50
52
|
eta_seconds: t.eta_seconds ?? null,
|
|
51
53
|
at: n
|
|
52
|
-
}, ...s.filter((
|
|
54
|
+
}, ...s.filter((c) => c.key !== t.key)], g(), f(), l();
|
|
53
55
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
for (const n of t)
|
|
56
|
+
function D(t) {
|
|
57
|
+
i();
|
|
58
|
+
for (const n of t) b(n, n.at ? new Date(n.at).getTime() : Date.now());
|
|
57
59
|
}
|
|
58
60
|
function E(t) {
|
|
59
|
-
|
|
61
|
+
i(), o.add(t), s = s.filter((n) => n.key !== t), f(), l();
|
|
60
62
|
}
|
|
61
63
|
function I() {
|
|
62
|
-
|
|
64
|
+
i();
|
|
63
65
|
for (const t of s)
|
|
64
66
|
t.status !== "queued" && t.status !== "running" && o.add(t.key);
|
|
65
67
|
s = s.filter((t) => t.status === "queued" || t.status === "running"), f(), l();
|
|
66
68
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
69
|
-
(t) => (
|
|
69
|
+
function q() {
|
|
70
|
+
return i(), k(
|
|
71
|
+
(t) => (d.add(t), () => d.delete(t)),
|
|
70
72
|
() => S,
|
|
71
73
|
() => 0
|
|
72
74
|
), s;
|
|
73
75
|
}
|
|
74
76
|
export {
|
|
75
|
-
|
|
77
|
+
b as applyJobUpdate,
|
|
76
78
|
I as dismissFinishedJobs,
|
|
77
79
|
E as dismissJob,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
D as seedJobs,
|
|
81
|
+
q as useTrayJobs
|
|
80
82
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const u = "start";
|
|
2
|
+
function c() {
|
|
3
|
+
return { key: "", cursors: /* @__PURE__ */ new Map(), off: !1 };
|
|
4
|
+
}
|
|
5
|
+
function n(r, t) {
|
|
6
|
+
r.key !== t && (r.key = t, r.cursors.clear(), r.off = !1);
|
|
7
|
+
}
|
|
8
|
+
function o(r, t, e, s) {
|
|
9
|
+
if (n(r, t), /[.$]/.test(s) && (r.off = !0), r.off) return { page: e, sort: s };
|
|
10
|
+
if (e <= 1) return { after: u, sort: s };
|
|
11
|
+
const f = r.cursors.get(e);
|
|
12
|
+
return f ? { after: f, sort: s } : { page: e, sort: i(s) };
|
|
13
|
+
}
|
|
14
|
+
function a(r, t, e, s) {
|
|
15
|
+
n(r, t), !r.off && (typeof s == "string" && s ? r.cursors.set(e + 1, s) : r.cursors.delete(e + 1));
|
|
16
|
+
}
|
|
17
|
+
function l(r, t) {
|
|
18
|
+
n(r, t), r.off = !0, r.cursors.clear();
|
|
19
|
+
}
|
|
20
|
+
function C(r) {
|
|
21
|
+
var e;
|
|
22
|
+
const t = r;
|
|
23
|
+
return (t == null ? void 0 : t.status) === 400 && /^CURSOR_/.test(String(((e = t.response) == null ? void 0 : e.code) ?? ""));
|
|
24
|
+
}
|
|
25
|
+
function i(r) {
|
|
26
|
+
const t = r.split(",").map((e) => e.trim()).filter(Boolean);
|
|
27
|
+
return t.some((e) => e.replace(/^-/, "").toLowerCase() === "id") ? t.join(",") : [...t, "id"].join(",");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
u as CURSOR_START,
|
|
31
|
+
c as createCursorBook,
|
|
32
|
+
C as isCursorRefusal,
|
|
33
|
+
a as noteNextCursor,
|
|
34
|
+
o as pageRequest,
|
|
35
|
+
l as stopCursors,
|
|
36
|
+
i as withIdTieBreak
|
|
37
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function f(t) {
|
|
2
|
+
let e = t;
|
|
3
|
+
if (typeof e == "string")
|
|
4
|
+
try {
|
|
5
|
+
e = JSON.parse(e);
|
|
6
|
+
} catch {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
10
|
+
const n = {};
|
|
11
|
+
for (const [l, r] of Object.entries(e)) {
|
|
12
|
+
if (!r || typeof r != "object" || Array.isArray(r)) continue;
|
|
13
|
+
const o = r, i = {};
|
|
14
|
+
for (const s of ["label", "help"]) {
|
|
15
|
+
const a = o[s];
|
|
16
|
+
typeof a == "string" && a.trim() && (i[s] = a);
|
|
17
|
+
}
|
|
18
|
+
!i.label && !i.help || (o.draft === !0 && (i.draft = !0), n[l] = i);
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function u(t, e, n, l) {
|
|
23
|
+
const r = { ...t[e] ?? {} };
|
|
24
|
+
l.trim() ? r[n] = l : delete r[n];
|
|
25
|
+
const o = { ...t };
|
|
26
|
+
return r.label || r.help ? o[e] = r : delete o[e], Object.keys(o).length ? o : void 0;
|
|
27
|
+
}
|
|
28
|
+
function d(t, e) {
|
|
29
|
+
const { draft: n, ...l } = t[e] ?? {};
|
|
30
|
+
return { ...t, [e]: l };
|
|
31
|
+
}
|
|
32
|
+
function y() {
|
|
33
|
+
var e;
|
|
34
|
+
let t = null;
|
|
35
|
+
try {
|
|
36
|
+
t = ((e = globalThis.localStorage) == null ? void 0 : e.getItem("nivaro_admin_locale")) ?? null;
|
|
37
|
+
} catch {
|
|
38
|
+
t = null;
|
|
39
|
+
}
|
|
40
|
+
return !t && typeof document < "u" && (t = document.documentElement.lang || null), !t && typeof navigator < "u" && (t = navigator.language || null), (t ?? "en").toLowerCase();
|
|
41
|
+
}
|
|
42
|
+
function c(t, e, n) {
|
|
43
|
+
var s;
|
|
44
|
+
const l = Object.keys(t).filter((a) => !t[a].draft), r = l.find((a) => a.toLowerCase() === e), o = e.split(/[-_]/)[0], i = r ?? l.find((a) => a.toLowerCase().split(/[-_]/)[0] === o);
|
|
45
|
+
return i && ((s = t[i]) == null ? void 0 : s[n]) || null;
|
|
46
|
+
}
|
|
47
|
+
function b(t, e) {
|
|
48
|
+
const n = t._overrides, l = n && typeof n == "object" && !Array.isArray(n) ? n.i18n : null;
|
|
49
|
+
if (!l) return t;
|
|
50
|
+
const r = f(l), o = t.label === "" ? null : c(r, e, "label"), i = c(r, e, "help");
|
|
51
|
+
return !o && !i ? t : { ...t, ...o ? { label: o } : {}, ...i ? { note: i } : {} };
|
|
52
|
+
}
|
|
53
|
+
function p(t, e) {
|
|
54
|
+
if (!t.i18n) return t;
|
|
55
|
+
const n = c(f(t.i18n), e, "label");
|
|
56
|
+
return n ? { ...t, label: n } : t;
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
d as approveLayoutText,
|
|
60
|
+
y as formLocale,
|
|
61
|
+
c as layoutText,
|
|
62
|
+
f as readLayoutI18n,
|
|
63
|
+
b as translateFieldRow,
|
|
64
|
+
p as translateGroup,
|
|
65
|
+
u as withLayoutText
|
|
66
|
+
};
|