@nivaro/react 0.2.56 → 0.3.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/components/slots/TasksSlot.js +31 -29
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.js +515 -505
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/ProfileView.js +163 -144
- package/dist/shared/components/ai/AiPlanCard.js +427 -0
- package/dist/shared/components/ai/AiPlanChanges.js +117 -0
- package/dist/shared/components/ai/TaskDo.js +1022 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
- package/dist/shared/components/chat/ChatPanel.js +1356 -1317
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
- package/dist/shared/components/chat/chat-core.js +273 -264
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
- package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
- package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
- package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
- package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
- package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
- package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
- package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
- package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
- package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
- package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
- package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
- package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
- package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
- package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
- package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
- package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
- package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
- package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
- package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
- package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
- package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
- package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
- package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
- package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
- package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
- package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
- package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
- package/dist/shared/components/item-edit/GroupSection.js +1 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
- package/dist/shared/components/item-edit/UserChip.js +145 -142
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/notification-sound.js +25 -16
- package/package.json +2 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as s, jsxs as y, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as Zu, useQuery as
|
|
3
|
-
import { Loader2 as Jn, ArrowLeft as Xu, Check as Sn, Copy as
|
|
2
|
+
import { useQueryClient as Zu, useQuery as st, useQueries as Hr, useMutation as id } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as Jn, ArrowLeft as Xu, Check as Sn, Copy as Ur, Wand2 as ef, BookOpen as tf, PencilLine as nf, Clipboard as rf, Waypoints as sf, PictureInPicture2 as of, FileDown as sd, LifeBuoy as af, MessageSquarePlus as lf, Wrench as df, Eye as cf, Trash2 as uf, Save as od, ChevronDown as Yr, AlertTriangle as ff, ChevronLeft as ad, ChevronRight as ld, AlertCircle as qd, X as mf } from "lucide-react";
|
|
4
4
|
import { useContext as pf, useState as T, useEffect as Z, useMemo as R, useCallback as ce, useRef as J, Fragment as po } from "react";
|
|
5
5
|
import { createPortal as Ad } from "react-dom";
|
|
6
|
-
import { toast as
|
|
6
|
+
import { toast as je } from "sonner";
|
|
7
7
|
import { useNivaroClient as gf, useApiFetchConfig as hf, ItemEditAuthContext as yf, useItemNavigation as _f, ReimportHandlerContext as bf, RelationPathDataContext as vf, ParentDraftContext as wf, GridFlushContext as kf, StaleFieldReportContext as xf } from "../context.js";
|
|
8
8
|
import { formatApiPayload as Sf } from "../lib/api-payload.js";
|
|
9
9
|
import { get as re, post as Pt, del as Vn, put as Nf, patch as ts } from "../lib/commands.js";
|
|
10
10
|
import { stickyGroupKey as $f, planFieldGrid as Cf, isEmptyValue as Rf, isFolded as Of, readGroupStructure as Ff } from "../lib/form-structure.js";
|
|
11
|
-
import { loadDraft as jf, draftHasContent as go, deleteDraft as
|
|
11
|
+
import { loadDraft as jf, draftHasContent as go, deleteDraft as Zr, saveDraft as qf, draftKey as Af } from "../lib/draft-store.js";
|
|
12
12
|
import { entryConfigOf as Tf } from "../lib/entry-config.js";
|
|
13
13
|
import { setFormulaConstants as If } from "../lib/expression.js";
|
|
14
14
|
import { setFiscalStartMonth as Ef } from "../lib/fiscal.js";
|
|
@@ -28,90 +28,91 @@ import { titleCase as ke, choiceLabel as Co, cn as Ce } from "../lib/utils.js";
|
|
|
28
28
|
import { applyValidationRule as hm } from "../lib/validation-rules.js";
|
|
29
29
|
import { matchesVisibleWhen as ym } from "../lib/visible-when.js";
|
|
30
30
|
import { CopyAsButton as _m } from "./CopyAsButton.js";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
31
|
+
import { useHuddleFollowSurface as bm } from "./chat/huddle/huddle-follow-bus.js";
|
|
32
|
+
import { FormWhatsNew as vm } from "./FormWhatsNew.js";
|
|
33
|
+
import { showFormVideosButton as wm } from "./help-videos/viewer/format.js";
|
|
34
|
+
import { HelpVideoButton as km } from "./help-videos/viewer/HelpVideoButton.js";
|
|
35
|
+
import { DocumentAutofillButton as xm } from "./import/DocumentAutofillButton.js";
|
|
36
|
+
import { evaluateImportLineRules as yo, RULE_SET_KEY as Sm } from "./import/evaluateLineRules.js";
|
|
37
|
+
import { ImportColumnChips as Nm } from "./import/ImportColumnChips.js";
|
|
37
38
|
import { ImportFromFileButton as md } from "./import/ImportFromFileButton.js";
|
|
38
39
|
import { ImportIssuesPanel as pd } from "./import/ImportIssuesPanel.js";
|
|
39
|
-
import { diffReimportLines as
|
|
40
|
-
import { AddendumO2MContext as
|
|
41
|
-
import { useAutoIdPreview as
|
|
42
|
-
import { changeReasonChallenge as _o, ChangeReasonDialog as
|
|
43
|
-
import { ChangesTray as
|
|
44
|
-
import { CloneDialog as
|
|
45
|
-
import { configUpdateReaction as
|
|
46
|
-
import { DraftRecoveryBanner as
|
|
47
|
-
import { ExtLayoutSlot as
|
|
48
|
-
import { FieldAffordancesContext as
|
|
40
|
+
import { diffReimportLines as $m } from "./import/reimportDiff.js";
|
|
41
|
+
import { AddendumO2MContext as Cm, AddendumViewContext as Rm, AddendumFieldContext as Om } from "./item-edit/AddendumFieldContext.js";
|
|
42
|
+
import { useAutoIdPreview as Fm } from "./item-edit/AutoIdPreviewField.js";
|
|
43
|
+
import { changeReasonChallenge as _o, ChangeReasonDialog as jm } from "./item-edit/ChangeReasonDialog.js";
|
|
44
|
+
import { ChangesTray as qm } from "./item-edit/ChangesTray.js";
|
|
45
|
+
import { CloneDialog as Am } from "./item-edit/CloneDialog.js";
|
|
46
|
+
import { configUpdateReaction as Tm } from "./item-edit/config-update.js";
|
|
47
|
+
import { DraftRecoveryBanner as Im } from "./item-edit/DraftRecoveryBanner.js";
|
|
48
|
+
import { ExtLayoutSlot as Em } from "./item-edit/ExtLayoutSlot.js";
|
|
49
|
+
import { FieldAffordancesContext as Mm } from "./item-edit/FieldAffordances.js";
|
|
49
50
|
import { FieldRow as br } from "./item-edit/FieldRow.js";
|
|
50
|
-
import { FoldArea as
|
|
51
|
-
import { StripFieldValue as
|
|
52
|
-
import { useHeaderBand as
|
|
53
|
-
import { HeaderFreshness as
|
|
54
|
-
import { HeaderRollupExplainer as
|
|
55
|
-
import { HeaderSummaryChip as
|
|
56
|
-
import { HeaderTools as
|
|
57
|
-
import { HighlightedCode as
|
|
58
|
-
import { parseJson as xn, SYSTEM_FIELDS as At, isSentinelKey as vr, applyDisplayTemplate as vo, useContainerWidth as
|
|
59
|
-
import { evalClientFormula as
|
|
60
|
-
import { LayoutContentBlock as
|
|
61
|
-
import { deferredSections as
|
|
62
|
-
import { parseRollupSources as gd, parseRollupParentFilter as
|
|
63
|
-
import { useLockWhy as
|
|
64
|
-
import { m2aWriteMeta as
|
|
65
|
-
import { M2MStagingContext as
|
|
66
|
-
import { useM2MStaging as
|
|
67
|
-
import { O2MStagingContext as
|
|
68
|
-
import { placementBehaviourNeeds as
|
|
69
|
-
import { QueueReturnChip as
|
|
70
|
-
import { QuickPicker as
|
|
71
|
-
import { RawEditSheet as
|
|
72
|
-
import { RecordChatActions as
|
|
73
|
-
import { PickerExclusionToggle as
|
|
74
|
-
import { invalidateRecordInsights as
|
|
75
|
-
import { RecordAccessLostPanel as
|
|
76
|
-
import { useRecordOutboxEntry as
|
|
77
|
-
import { RecordRecapStrip as
|
|
78
|
-
import { RecordSubscribeButton as
|
|
79
|
-
import { useFormUsageBeacon as
|
|
80
|
-
import { ValidationSummary as
|
|
81
|
-
import { useViewAsRole as
|
|
82
|
-
import { RecordIntegrityBanner as
|
|
83
|
-
import { SlaBreachBanner as
|
|
84
|
-
import { RecordGraphSheet as
|
|
85
|
-
import { RecordReadView as
|
|
86
|
-
import { SuggestFormChange as
|
|
87
|
-
import { SupportRequestDialog as
|
|
88
|
-
import { EntryStrip as
|
|
89
|
-
import { useEntryKeyboard as
|
|
90
|
-
import { useEntryMode as
|
|
51
|
+
import { FoldArea as Pm, RowGroupCell as Lm, rowMemberField as Km } from "./item-edit/form-structure-ui.js";
|
|
52
|
+
import { StripFieldValue as Bm, GroupSection as Dm, InlineDisplay as bo } from "./item-edit/GroupSection.js";
|
|
53
|
+
import { useHeaderBand as Wm, HeaderTiles as zm } from "./item-edit/HeaderBand.js";
|
|
54
|
+
import { HeaderFreshness as Vm } from "./item-edit/HeaderFreshness.js";
|
|
55
|
+
import { HeaderRollupExplainer as Jm } from "./item-edit/HeaderRollupExplainer.js";
|
|
56
|
+
import { HeaderSummaryChip as Qm } from "./item-edit/HeaderSummaryChip.js";
|
|
57
|
+
import { HeaderTools as Gm, HeaderToolGroup as Hm, HeaderMenu as Um } from "./item-edit/HeaderTools.js";
|
|
58
|
+
import { HighlightedCode as Ym } from "./item-edit/HighlightedCode.js";
|
|
59
|
+
import { parseJson as xn, SYSTEM_FIELDS as At, isSentinelKey as vr, applyDisplayTemplate as vo, useContainerWidth as Zm, resolveColSpan as wo } from "./item-edit/helpers.js";
|
|
60
|
+
import { evalClientFormula as Xm } from "./item-edit/InlineTableField.js";
|
|
61
|
+
import { LayoutContentBlock as ep, SectionIntro as tp } from "./item-edit/LayoutContentBlock.js";
|
|
62
|
+
import { deferredSections as np } from "./item-edit/lazy-sections.js";
|
|
63
|
+
import { parseRollupSources as gd, parseRollupParentFilter as rp, matchesRollupFilter as ip, computeLiveRollup as sp, isDerivedForRecord as ko } from "./item-edit/live-rollups.js";
|
|
64
|
+
import { useLockWhy as op, refineLockReasons as ap, HiddenByRulesNote as lp } from "./item-edit/lock-why.js";
|
|
65
|
+
import { m2aWriteMeta as dp, resolveM2MRelatedCollection as cp } from "./item-edit/M2MCombobox.js";
|
|
66
|
+
import { M2MStagingContext as up } from "./item-edit/M2MStagingContext.js";
|
|
67
|
+
import { useM2MStaging as n_ } from "./item-edit/M2MStagingContext.js";
|
|
68
|
+
import { O2MStagingContext as fp, LiveRowsContext as mp, StagedRelationsContext as pp } from "./item-edit/O2MStagingContext.js";
|
|
69
|
+
import { placementBehaviourNeeds as gp, usePlacementTextContext as hp, fieldIsRecommended as yp, placementFieldText as hd, fieldCounterError as _p, confirmChangeFields as bp, missingRecommended as vp, isDisplayFormulaRow as wp } from "./item-edit/placement-behaviour.js";
|
|
70
|
+
import { QueueReturnChip as kp } from "./item-edit/QueueReturnChip.js";
|
|
71
|
+
import { QuickPicker as xp } from "./item-edit/QuickPicker.js";
|
|
72
|
+
import { RawEditSheet as Sp } from "./item-edit/RawEditSheet.js";
|
|
73
|
+
import { RecordChatActions as Np } from "./item-edit/RecordChatActions.js";
|
|
74
|
+
import { PickerExclusionToggle as $p, ScheduleChangeButton as Cp } from "./item-edit/RecordGrantTools.js";
|
|
75
|
+
import { invalidateRecordInsights as Rp, invalidateRecordNotes as Op, RecordInsightsButton as Fp } from "./item-edit/RecordInsights.js";
|
|
76
|
+
import { RecordAccessLostPanel as jp, RecordLiveSync as qp } from "./item-edit/RecordLiveSync.js";
|
|
77
|
+
import { useRecordOutboxEntry as Ap, RecordOutboxBanner as Tp } from "./item-edit/RecordOutbox.js";
|
|
78
|
+
import { RecordRecapStrip as Ip } from "./item-edit/RecordRecapStrip.js";
|
|
79
|
+
import { RecordSubscribeButton as Ep } from "./item-edit/RecordSubscribeButton.js";
|
|
80
|
+
import { useFormUsageBeacon as Mp } from "./item-edit/useFormUsageBeacon.js";
|
|
81
|
+
import { ValidationSummary as Pp } from "./item-edit/ValidationSummary.js";
|
|
82
|
+
import { useViewAsRole as Lp, ViewAsRoleBar as Kp } from "./item-edit/ViewAsRole.js";
|
|
83
|
+
import { RecordIntegrityBanner as Bp } from "./panels/RecordIntegrityBanner.js";
|
|
84
|
+
import { SlaBreachBanner as Dp } from "./panels/SlaBreachBanner.js";
|
|
85
|
+
import { RecordGraphSheet as Wp } from "./RecordGraph.js";
|
|
86
|
+
import { RecordReadView as zp } from "./RecordReadView.js";
|
|
87
|
+
import { SuggestFormChange as Vp } from "./support/SuggestFormChange.js";
|
|
88
|
+
import { SupportRequestDialog as Jp } from "./support/SupportRequestDialog.js";
|
|
89
|
+
import { EntryStrip as Qp } from "./item-edit/entry/EntryStrip.js";
|
|
90
|
+
import { useEntryKeyboard as Gp } from "./item-edit/entry/useEntryKeyboard.js";
|
|
91
|
+
import { useEntryMode as Hp } from "./item-edit/entry/useEntryMode.js";
|
|
91
92
|
import { FindInRecordButton as yd } from "./item-edit/FindInRecord.js";
|
|
92
|
-
import { RecordViewersChip as
|
|
93
|
+
import { RecordViewersChip as Up } from "./item-edit/RecordViewersChip.js";
|
|
93
94
|
import { StepsBar as _d } from "./item-edit/StepsBar.js";
|
|
94
|
-
import { SummaryPanel as
|
|
95
|
-
import { designWrap as
|
|
96
|
-
import { GridGuides as
|
|
97
|
-
import { DesignCanvas as
|
|
98
|
-
import { revealGroupKey as
|
|
99
|
-
import { readDesignSummaryCollapsed as wd, DESIGN_SUMMARY_MIN_CANVAS as
|
|
100
|
-
import { RecordEventPathSheet as
|
|
101
|
-
import { TipLayer as
|
|
95
|
+
import { SummaryPanel as Yp, M2OSummaryValue as Id } from "./item-edit/SummaryPanel.js";
|
|
96
|
+
import { designWrap as Zp, DesignDropBody as bd, DesignDropZone as vd } from "./layout-editor/DesignNode.js";
|
|
97
|
+
import { GridGuides as Xp } from "./layout-editor/grid-guides.js";
|
|
98
|
+
import { DesignCanvas as eg } from "./layout-editor/design-canvas.js";
|
|
99
|
+
import { revealGroupKey as tg, useLayoutDesign as ng } from "./layout-editor/design-context.js";
|
|
100
|
+
import { readDesignSummaryCollapsed as wd, DESIGN_SUMMARY_MIN_CANVAS as rg, writeDesignSummaryCollapsed as ig } from "./layout-editor/summary-pref.js";
|
|
101
|
+
import { RecordEventPathSheet as sg } from "./panels/IntegrationActivitySection.js";
|
|
102
|
+
import { TipLayer as og } from "./TipLayer.js";
|
|
102
103
|
import { Button as dn } from "./ui/button.js";
|
|
103
104
|
import { Dialog as Ed, DialogContent as Md, DialogHeader as Pd, DialogTitle as Ld, DialogBody as Kd, DialogFooter as Bd } from "./ui/dialog.js";
|
|
104
105
|
import { Popover as Dd, PopoverTrigger as Wd, PopoverContent as zd } from "./ui/popover.js";
|
|
105
|
-
import { Skeleton as
|
|
106
|
+
import { Skeleton as Xr } from "./ui/skeleton.js";
|
|
106
107
|
import { WidgetSlot as ns } from "./WidgetSlot.js";
|
|
107
|
-
import { useItemLock as
|
|
108
|
-
import { isAccessRefusal as kd, deniedToastAction as
|
|
109
|
-
import { AccessDeniedPanel as
|
|
110
|
-
import { RevisionsPanel as
|
|
111
|
-
import { ItemActionButtons as
|
|
112
|
-
import { CustomActionButtons as
|
|
108
|
+
import { useItemLock as ag, LockHolderButton as lg, ItemLockBanner as dg } from "./panels/ItemLockBanner.js";
|
|
109
|
+
import { isAccessRefusal as kd, deniedToastAction as cg, WhyDeniedButton as ug } from "./panels/AccessInsights.js";
|
|
110
|
+
import { AccessDeniedPanel as fg } from "./panels/AccessDeniedPanel.js";
|
|
111
|
+
import { RevisionsPanel as mg } from "./panels/RevisionsPanel.js";
|
|
112
|
+
import { ItemActionButtons as pg } from "./panels/ItemActionButtons.js";
|
|
113
|
+
import { CustomActionButtons as gg } from "./panels/CustomActionButtons.js";
|
|
113
114
|
import { PipelineTransitionButtons as xd, PipelinePanel as rs } from "./panels/PipelinePanel.js";
|
|
114
|
-
import { OwnersInlineCompact as
|
|
115
|
+
import { OwnersInlineCompact as hg, OwnersInline as yg } from "./item-edit/UserChip.js";
|
|
115
116
|
import { ExternalRequestsChip as Sd } from "./panels/ExternalRequestsChip.js";
|
|
116
117
|
import { CommentPanel as is } from "./panels/CommentPanel.js";
|
|
117
118
|
import { TaskPanel as ss } from "./panels/TaskPanel.js";
|
|
@@ -119,9 +120,9 @@ import { AddendumPanel as os } from "./panels/AddendumPanel.js";
|
|
|
119
120
|
import { ReferencedByPanel as xo } from "./panels/ReferencedByPanel.js";
|
|
120
121
|
import { RelatedRecordsPanel as So } from "./panels/RelatedRecordsPanel.js";
|
|
121
122
|
import { WorkflowPanel as No } from "./panels/WorkflowPanel.js";
|
|
122
|
-
import { OwnersSlot as
|
|
123
|
+
import { OwnersSlot as _g } from "./panels/OwnersSlot.js";
|
|
123
124
|
let $o = !1;
|
|
124
|
-
const
|
|
125
|
+
const bg = "border-r flex w-6 shrink-0 items-start justify-center pt-3 bg-slate-100 text-slate-500 hover:bg-slate-200/70 hover:text-slate-700 transition-colors dark:bg-white/[0.04] dark:hover:bg-white/[0.08] dark:hover:text-slate-300";
|
|
125
126
|
function Nd(a) {
|
|
126
127
|
if (a) {
|
|
127
128
|
if (Array.isArray(a)) return a;
|
|
@@ -151,27 +152,27 @@ function Cd(a) {
|
|
|
151
152
|
} : {}
|
|
152
153
|
}));
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function vg(a) {
|
|
155
156
|
const O = a.attach_file_field;
|
|
156
157
|
return typeof O == "string" && O ? O : null;
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
-
const O = J(null), z =
|
|
159
|
+
function ei({ children: a }) {
|
|
160
|
+
const O = J(null), z = Zm(O), U = ng();
|
|
160
161
|
return /* @__PURE__ */ y("div", { ref: O, className: Ce(U && "relative", "grid grid-cols-12 gap-4 items-start"), children: [
|
|
161
|
-
/* @__PURE__ */ s(
|
|
162
|
+
/* @__PURE__ */ s(Xp, {}),
|
|
162
163
|
a(z)
|
|
163
164
|
] });
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
+
function wg({ status: a }) {
|
|
166
167
|
return a === "running" ? /* @__PURE__ */ s(Jn, { className: "h-4 w-4 animate-spin text-nvr-cyan shrink-0" }) : a === "done" ? /* @__PURE__ */ s(Sn, { className: "h-4 w-4 text-green-500 shrink-0" }) : a === "error" ? /* @__PURE__ */ s(qd, { className: "h-4 w-4 text-red-500 shrink-0" }) : /* @__PURE__ */ s("div", { className: "h-4 w-4 rounded-full border-2 border-slate-200 dark:border-slate-600 shrink-0" });
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function kg({
|
|
169
170
|
open: a,
|
|
170
171
|
steps: O,
|
|
171
172
|
onClose: z,
|
|
172
173
|
record: U
|
|
173
174
|
}) {
|
|
174
|
-
const H = O.length > 0 && O.every((B) => B.status === "done" || B.status === "error"), Q = O.some((B) => B.status === "error"), ie = H || Q, se = O.filter((B) => B.status === "done").length,
|
|
175
|
+
const H = O.length > 0 && O.every((B) => B.status === "done" || B.status === "error"), Q = O.some((B) => B.status === "error"), ie = H || Q, se = O.filter((B) => B.status === "done").length, qe = O.length, Pe = qe > 0 ? Math.round(se / qe * 100) : 0;
|
|
175
176
|
return /* @__PURE__ */ s(
|
|
176
177
|
Ed,
|
|
177
178
|
{
|
|
@@ -205,7 +206,7 @@ function wg({
|
|
|
205
206
|
/* @__PURE__ */ y("span", { className: "text-[11px] text-slate-400 tabular-nums shrink-0", children: [
|
|
206
207
|
se,
|
|
207
208
|
"/",
|
|
208
|
-
|
|
209
|
+
qe
|
|
209
210
|
] })
|
|
210
211
|
] })
|
|
211
212
|
] }),
|
|
@@ -222,7 +223,7 @@ function wg({
|
|
|
222
223
|
B.status === "pending" && "border-slate-100 bg-slate-50/60 dark:border-border dark:bg-muted/30"
|
|
223
224
|
),
|
|
224
225
|
children: /* @__PURE__ */ y("div", { className: "flex items-start gap-2.5", children: [
|
|
225
|
-
/* @__PURE__ */ s("div", { className: "mt-0.5 shrink-0", children: /* @__PURE__ */ s(
|
|
226
|
+
/* @__PURE__ */ s("div", { className: "mt-0.5 shrink-0", children: /* @__PURE__ */ s(wg, { status: B.status }) }),
|
|
226
227
|
/* @__PURE__ */ y("div", { className: "flex-1 min-w-0", children: [
|
|
227
228
|
/* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-2", children: [
|
|
228
229
|
/* @__PURE__ */ s(
|
|
@@ -251,7 +252,7 @@ function wg({
|
|
|
251
252
|
B.denied && U && /* @__PURE__ */ y(pt, { children: [
|
|
252
253
|
" ",
|
|
253
254
|
/* @__PURE__ */ s(
|
|
254
|
-
|
|
255
|
+
ug,
|
|
255
256
|
{
|
|
256
257
|
collection: U.collection,
|
|
257
258
|
itemId: U.itemId,
|
|
@@ -288,7 +289,7 @@ function wg({
|
|
|
288
289
|
}
|
|
289
290
|
);
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function xg(a, O) {
|
|
292
293
|
if (a == null || a === "") return "—";
|
|
293
294
|
if (typeof a == "boolean") return a ? "Yes" : "No";
|
|
294
295
|
const z = Number(a);
|
|
@@ -334,16 +335,16 @@ function Rd({
|
|
|
334
335
|
O == null ? void 0 : O.options
|
|
335
336
|
)) == null ? void 0 : Q.choices;
|
|
336
337
|
if (Array.isArray(U) && U.length > 0) {
|
|
337
|
-
const se = (Array.isArray(a) ? a : [a]).map((
|
|
338
|
-
const Pe = U.find((B) => String(B.value) === String(
|
|
339
|
-
return Pe != null && Pe.text ? Co(Pe.text) : String(
|
|
338
|
+
const se = (Array.isArray(a) ? a : [a]).map((qe) => {
|
|
339
|
+
const Pe = U.find((B) => String(B.value) === String(qe));
|
|
340
|
+
return Pe != null && Pe.text ? Co(Pe.text) : String(qe);
|
|
340
341
|
});
|
|
341
342
|
return /* @__PURE__ */ s(pt, { children: se.join(", ") });
|
|
342
343
|
}
|
|
343
344
|
const H = typeof a == "object" ? JSON.stringify(a) : String(a);
|
|
344
345
|
return /* @__PURE__ */ s(pt, { children: H.length > 60 ? `${H.slice(0, 60)}…` : H });
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
+
function Sg({
|
|
347
348
|
open: a,
|
|
348
349
|
onClose: O,
|
|
349
350
|
collection: z,
|
|
@@ -352,7 +353,7 @@ function xg({
|
|
|
352
353
|
draft: Q,
|
|
353
354
|
initial: ie,
|
|
354
355
|
m2mLinks: se,
|
|
355
|
-
m2mUnlinks:
|
|
356
|
+
m2mUnlinks: qe,
|
|
356
357
|
pendingRowCount: Pe,
|
|
357
358
|
pendingDeleteCount: B
|
|
358
359
|
}) {
|
|
@@ -372,7 +373,7 @@ function xg({
|
|
|
372
373
|
});
|
|
373
374
|
for (const E of Object.keys(Q))
|
|
374
375
|
Gn.has(E) || E.startsWith("__") || Lt(Q[E], ie[E]) || un.push({ key: E, label: E, from: ie[E], to: Q[E] });
|
|
375
|
-
const
|
|
376
|
+
const wr = (E) => {
|
|
376
377
|
var gt;
|
|
377
378
|
const ye = U.find((fn) => fn.one_collection === z && fn.one_field === E);
|
|
378
379
|
return ye ? ((gt = U.find((fn) => fn.many_collection === ye.many_collection && fn.id !== ye.id)) == null ? void 0 : gt.one_collection) ?? null : null;
|
|
@@ -380,8 +381,8 @@ function xg({
|
|
|
380
381
|
key: E,
|
|
381
382
|
label: Qn(E, Gn.get(E)),
|
|
382
383
|
ids: ye,
|
|
383
|
-
target:
|
|
384
|
-
})),
|
|
384
|
+
target: wr(E)
|
|
385
|
+
})), kr = [...qe.entries()].filter(([, E]) => E.size > 0).map(([E, ye]) => ({ key: E, label: Qn(E, Gn.get(E)), count: ye.size })), ti = Nn.reduce((E, ye) => E + ye.ids.length, 0), ni = kr.reduce((E, ye) => E + ye.count, 0), Je = 5;
|
|
385
386
|
return /* @__PURE__ */ y(
|
|
386
387
|
"div",
|
|
387
388
|
{
|
|
@@ -430,7 +431,7 @@ function xg({
|
|
|
430
431
|
] })
|
|
431
432
|
] }) : `${E.ids.length} to add` })
|
|
432
433
|
] }, `link:${E.key}`)),
|
|
433
|
-
|
|
434
|
+
kr.map((E) => /* @__PURE__ */ y("div", { className: "text-[11.5px]", children: [
|
|
434
435
|
/* @__PURE__ */ s("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: E.label }),
|
|
435
436
|
/* @__PURE__ */ y("p", { className: "text-rose-500", children: [
|
|
436
437
|
E.count,
|
|
@@ -453,7 +454,7 @@ function xg({
|
|
|
453
454
|
function Lt(a, O) {
|
|
454
455
|
return a === O || a == null && O == null ? !0 : a == null || O == null ? !1 : typeof a == "string" && typeof O == "number" || typeof a == "number" && typeof O == "string" ? String(a) === String(O) : JSON.stringify(a) === JSON.stringify(O);
|
|
455
456
|
}
|
|
456
|
-
function
|
|
457
|
+
function Ng(a, O) {
|
|
457
458
|
if (!O) return a;
|
|
458
459
|
const z = { ...a };
|
|
459
460
|
for (const [U, H] of Object.entries(O))
|
|
@@ -465,7 +466,7 @@ function Od(a, O) {
|
|
|
465
466
|
(z) => z.trigger_field === O && (z.is_active === !0 || z.is_active === 1)
|
|
466
467
|
) : [];
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
+
function $g(a, O) {
|
|
469
470
|
return !O || Object.keys(O).length === 0 ? a : { ...a, ...O };
|
|
470
471
|
}
|
|
471
472
|
function Fd(a, O, z) {
|
|
@@ -483,31 +484,31 @@ function Fd(a, O, z) {
|
|
|
483
484
|
stagingKey: H.one_field ?? `${H.many_collection}.${Q}`
|
|
484
485
|
} : null;
|
|
485
486
|
}
|
|
486
|
-
function
|
|
487
|
+
function Cg(a, O, z, U) {
|
|
487
488
|
const H = U ?? /* @__PURE__ */ new Set(), Q = (a ?? []).filter((se) => !H.has(se.id)).map((se) => String(se[O])), ie = (z ?? []).map(String);
|
|
488
489
|
return [.../* @__PURE__ */ new Set([...Q, ...ie])];
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
+
function Rg(a, O) {
|
|
491
492
|
return a.some((z) => String(z) === String(O)) ? a : [...a, O];
|
|
492
493
|
}
|
|
493
|
-
function
|
|
494
|
+
function Og(a, O) {
|
|
494
495
|
const z = new Set((O ?? []).map(String));
|
|
495
496
|
return a.filter((U) => !z.has(String(U)));
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function Fg(a, O, z, U, H, Q) {
|
|
498
499
|
return a && !O ? { known: !1, ids: [] } : {
|
|
499
500
|
known: !0,
|
|
500
|
-
ids:
|
|
501
|
+
ids: Cg(z, U, H, Q)
|
|
501
502
|
};
|
|
502
503
|
}
|
|
503
|
-
function
|
|
504
|
+
function jg(a, O) {
|
|
504
505
|
var U;
|
|
505
506
|
const z = {};
|
|
506
507
|
for (const [H, Q] of Object.entries(a))
|
|
507
508
|
(U = O[H]) != null && U.known && (z[H] = Q);
|
|
508
509
|
return z;
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
+
function qg(a, O) {
|
|
511
512
|
const z = {}, U = {};
|
|
512
513
|
if (!a) return { scalar: z, alias: U };
|
|
513
514
|
const H = O ?? /* @__PURE__ */ new Set();
|
|
@@ -515,7 +516,7 @@ function jg(a, O) {
|
|
|
515
516
|
H.has(Q) ? U[Q] = Array.isArray(ie) ? ie : ie != null ? [ie] : [] : z[Q] = ie;
|
|
516
517
|
return { scalar: z, alias: U };
|
|
517
518
|
}
|
|
518
|
-
function
|
|
519
|
+
function Ag({
|
|
519
520
|
collection: a,
|
|
520
521
|
itemId: O,
|
|
521
522
|
origin: z,
|
|
@@ -523,7 +524,7 @@ function qg({
|
|
|
523
524
|
timestamp: H,
|
|
524
525
|
api: Q
|
|
525
526
|
}) {
|
|
526
|
-
const [ie, se] = T(!1),
|
|
527
|
+
const [ie, se] = T(!1), qe = R(() => Sf(Q.body), [Q.body]), Pe = Q.api_key_name ? `API key "${Q.api_key_name}"` : U ? `${U}'s token` : "a token";
|
|
527
528
|
return /* @__PURE__ */ y(pt, { children: [
|
|
528
529
|
/* @__PURE__ */ y(Dd, { children: [
|
|
529
530
|
/* @__PURE__ */ s(Wd, { asChild: !0, children: /* @__PURE__ */ s(
|
|
@@ -552,15 +553,15 @@ function qg({
|
|
|
552
553
|
/* @__PURE__ */ s("dd", { className: "text-slate-700 dark:text-slate-200", children: new Date(Q.at).toLocaleString() })
|
|
553
554
|
] }),
|
|
554
555
|
/* @__PURE__ */ s("p", { className: "mt-2 text-[11px] font-semibold uppercase tracking-wide text-slate-500", children: "Original payload" }),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
556
|
+
qe ? /* @__PURE__ */ y("div", { className: "mt-1 space-y-1.5", children: [
|
|
557
|
+
qe.sections.map((B) => /* @__PURE__ */ y("div", { children: [
|
|
558
|
+
qe.sections.length > 1 && /* @__PURE__ */ s("p", { className: "mb-0.5 text-[10px] font-medium text-slate-400", children: B.title }),
|
|
558
559
|
/* @__PURE__ */ s(
|
|
559
560
|
"pre",
|
|
560
561
|
{
|
|
561
562
|
"data-provenance-payload": B.kind,
|
|
562
563
|
className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border border-slate-200 bg-slate-50 p-2 font-mono text-[10.5px] leading-snug text-slate-700 dark:border-border dark:bg-[#0f172a] dark:text-slate-200",
|
|
563
|
-
children: /* @__PURE__ */ s(
|
|
564
|
+
children: /* @__PURE__ */ s(Ym, { kind: B.kind, text: B.text })
|
|
564
565
|
}
|
|
565
566
|
)
|
|
566
567
|
] }, B.title)),
|
|
@@ -570,9 +571,9 @@ function qg({
|
|
|
570
571
|
type: "button",
|
|
571
572
|
onClick: () => {
|
|
572
573
|
var B;
|
|
573
|
-
(B = navigator.clipboard) == null || B.writeText(
|
|
574
|
+
(B = navigator.clipboard) == null || B.writeText(qe.sections.map((cn) => cn.text).join(`
|
|
574
575
|
|
|
575
|
-
`)).then(() =>
|
|
576
|
+
`)).then(() => je.success("Payload copied"));
|
|
576
577
|
},
|
|
577
578
|
className: "text-[11px] text-slate-500 hover:underline",
|
|
578
579
|
children: "Copy payload"
|
|
@@ -592,7 +593,7 @@ function qg({
|
|
|
592
593
|
] })
|
|
593
594
|
] }),
|
|
594
595
|
ie && /* @__PURE__ */ s(
|
|
595
|
-
|
|
596
|
+
sg,
|
|
596
597
|
{
|
|
597
598
|
target: {
|
|
598
599
|
source: "core:inbound",
|
|
@@ -605,12 +606,12 @@ function qg({
|
|
|
605
606
|
)
|
|
606
607
|
] });
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function Tg(a) {
|
|
609
610
|
const O = Td();
|
|
610
611
|
return a.map((z) => Qf(z, O));
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
-
return a.design ? /* @__PURE__ */ s(
|
|
613
|
+
function Xy(a) {
|
|
614
|
+
return a.design ? /* @__PURE__ */ s(eg, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ s(jd, { ...a }) }) : /* @__PURE__ */ s(jd, { ...a });
|
|
614
615
|
}
|
|
615
616
|
function jd({
|
|
616
617
|
collection: a,
|
|
@@ -621,16 +622,16 @@ function jd({
|
|
|
621
622
|
onBack: Q,
|
|
622
623
|
onSaved: ie,
|
|
623
624
|
onDeleted: se,
|
|
624
|
-
showHeader:
|
|
625
|
+
showHeader: qe = !0,
|
|
625
626
|
headerExtra: Pe,
|
|
626
627
|
focusField: B,
|
|
627
628
|
showItemActions: cn = !1,
|
|
628
629
|
showGrantedTools: Qn = !1,
|
|
629
630
|
moreMenuItems: Gn,
|
|
630
631
|
onDirtyChange: un,
|
|
631
|
-
documentTitle:
|
|
632
|
+
documentTitle: wr = !0,
|
|
632
633
|
registerSaveHandler: Nn,
|
|
633
|
-
onDuplicate:
|
|
634
|
+
onDuplicate: kr,
|
|
634
635
|
showRevisions: ti = !0,
|
|
635
636
|
showClone: ni = !0,
|
|
636
637
|
showPipeline: Je = !0,
|
|
@@ -655,7 +656,7 @@ function jd({
|
|
|
655
656
|
layoutEditing: Ro = !1
|
|
656
657
|
}) {
|
|
657
658
|
var Ml, Pl, Ll, Kl, Bl, Dl, Wl, zl, Vl, Jl, Ql, Gl, Hl, Ul, Yl, Zl, Xl, ed, td, nd, rd;
|
|
658
|
-
const K = ht != null, Qe = (ht == null ? void 0 : ht.context) ?? null, ls = Qe != null, mn = !!(Qe != null && Qe.showHidden), F = gf(), oi = Uf(), Yt = hf(), { isAdmin:
|
|
659
|
+
const K = ht != null, Qe = (ht == null ? void 0 : ht.context) ?? null, ls = Qe != null, mn = !!(Qe != null && Qe.showHidden), F = gf(), oi = Uf(), Yt = hf(), { isAdmin: $t, userId: Re } = pf(yf), Ae = Lp(a, $t), Oo = _f(), [Yd, Fo] = T(!1), Zt = ((Pl = (Ml = Ae.preview) == null ? void 0 : Ml.layout) == null ? void 0 : Pl.slug) ?? z, de = Zu(), Zd = ((Ll = ht == null ? void 0 : ht.record) == null ? void 0 : Ll.id) != null ? String(ht.record.id) : void 0, ds = O ?? (K ? Zd : void 0), m = ds ?? "new", g = !ds || ds === "new", [ai] = T(Gf), { data: Xd } = st({
|
|
659
660
|
// Desktop keeps the key the host's own /active read shares (admin ItemEdit).
|
|
660
661
|
queryKey: [
|
|
661
662
|
"active-layout",
|
|
@@ -675,12 +676,12 @@ function jd({
|
|
|
675
676
|
enabled: !K
|
|
676
677
|
}), w = K ? ht.layout : Xd, yt = ((Kl = w == null ? void 0 : w.layout) == null ? void 0 : Kl.id) ?? null, [jo, qo] = T(() => /* @__PURE__ */ new Set());
|
|
677
678
|
Z(() => qo(/* @__PURE__ */ new Set()), [a, m, yt]);
|
|
678
|
-
const
|
|
679
|
-
() =>
|
|
679
|
+
const xr = R(
|
|
680
|
+
() => np(w, jo, { design: K }),
|
|
680
681
|
[w, jo, K]
|
|
681
682
|
), ec = ce((e) => {
|
|
682
683
|
qo((t) => t.has(e) ? t : /* @__PURE__ */ new Set([...t, e]));
|
|
683
|
-
}, []), { data: tc } =
|
|
684
|
+
}, []), { data: tc } = st({
|
|
684
685
|
queryKey: ["summary-layout", a],
|
|
685
686
|
queryFn: () => F.request(
|
|
686
687
|
re(`/collection-layouts/summary/${a}`)
|
|
@@ -689,9 +690,9 @@ function jd({
|
|
|
689
690
|
enabled: !g && !K
|
|
690
691
|
}), Yn = K ? ht.layout.assignments : null, {
|
|
691
692
|
data: li,
|
|
692
|
-
isLoading:
|
|
693
|
+
isLoading: Eg,
|
|
693
694
|
isFetched: cs
|
|
694
|
-
} =
|
|
695
|
+
} = st({
|
|
695
696
|
queryKey: Yn ? ["layout-editor", "field-config", a, Yn] : ["field-config", a, yt],
|
|
696
697
|
queryFn: () => Yn ? F.request(
|
|
697
698
|
Pt(`/field-config/${a}/project`, { assignments: Yn })
|
|
@@ -705,7 +706,7 @@ function jd({
|
|
|
705
706
|
// A draft edit re-asks; the canvas keeps the last answer meanwhile.
|
|
706
707
|
placeholderData: Yn ? (e) => e : void 0,
|
|
707
708
|
// Layout text in the reader's language (#2665); the canvas edits the text as written.
|
|
708
|
-
select: Yn ? void 0 :
|
|
709
|
+
select: Yn ? void 0 : Tg,
|
|
709
710
|
// Wait for the layout either way, not just when a slug pins one. Without
|
|
710
711
|
// this the field config fetched immediately with layoutId = null — the
|
|
711
712
|
// LAYOUT-LESS default field set — painted that, then refetched under a new
|
|
@@ -717,20 +718,20 @@ function jd({
|
|
|
717
718
|
}), us = Qe == null ? void 0 : Qe.ghost, A = R(() => !us || !g || !li ? li : li.map((e) => {
|
|
718
719
|
const t = us(e.field);
|
|
719
720
|
return t ? { ...e, placeholder: t } : e;
|
|
720
|
-
}), [us, g, li]), Ao = R(() =>
|
|
721
|
+
}), [us, g, li]), Ao = R(() => gp(A ?? []), [A]), Zn = hp(), { data: P = [], isFetched: di } = st({
|
|
721
722
|
queryKey: ["relations", a],
|
|
722
723
|
queryFn: () => F.request(re(`/data-model/relations/for/${a}`)).then((e) => e.data ?? []),
|
|
723
724
|
staleTime: 6e4
|
|
724
|
-
}), { data: Xn = [] } =
|
|
725
|
+
}), { data: Xn = [] } = st({
|
|
725
726
|
queryKey: ["field-rules", a],
|
|
726
727
|
queryFn: () => F.request(re("/field-rules", { collection: a })).then((e) => e.data ?? []),
|
|
727
728
|
enabled: !!a,
|
|
728
729
|
staleTime: 6e4
|
|
729
|
-
}), { data: N } =
|
|
730
|
+
}), { data: N } = st({
|
|
730
731
|
queryKey: ["col-meta", a],
|
|
731
732
|
queryFn: () => F.request(re(`/collections/${a}`)).then((e) => e.data),
|
|
732
733
|
staleTime: 6e4
|
|
733
|
-
}), { data: nc = [] } =
|
|
734
|
+
}), { data: nc = [] } = st({
|
|
734
735
|
queryKey: ["file-layouts", a],
|
|
735
736
|
queryFn: () => F.request(re("/collection-layouts", { collection: a, type: "file" })).then((e) => (e.data ?? []).filter((t) => t.layout_type === "file" && !!t.is_active)),
|
|
736
737
|
enabled: !!a && !g,
|
|
@@ -762,7 +763,7 @@ function jd({
|
|
|
762
763
|
const i = await n.blob(), r = URL.createObjectURL(i), o = document.createElement("a");
|
|
763
764
|
o.href = r, o.download = `${a}-${m}.pdf`, o.click(), URL.revokeObjectURL(r);
|
|
764
765
|
} catch {
|
|
765
|
-
|
|
766
|
+
je.error("Failed to generate PDF");
|
|
766
767
|
} finally {
|
|
767
768
|
Io(null);
|
|
768
769
|
}
|
|
@@ -785,7 +786,7 @@ function jd({
|
|
|
785
786
|
data: ac,
|
|
786
787
|
isLoading: ps,
|
|
787
788
|
error: Xt
|
|
788
|
-
} =
|
|
789
|
+
} = st({
|
|
789
790
|
queryKey: ["item", a, m],
|
|
790
791
|
queryFn: () => F.request(re(`/items/${a}/${m}`)).then((e) => e.data),
|
|
791
792
|
enabled: !g && !Rn && !K,
|
|
@@ -802,7 +803,7 @@ function jd({
|
|
|
802
803
|
if (g || !Xt) return !1;
|
|
803
804
|
const e = (Xt == null ? void 0 : Xt.status) ?? ((t = Xt == null ? void 0 : Xt.response) == null ? void 0 : t.status);
|
|
804
805
|
return e === 403 || e === 404;
|
|
805
|
-
})(), [I,
|
|
806
|
+
})(), [I, ot] = T({}), ee = J({}), Ze = J(/* @__PURE__ */ new Set()), mi = J(0), Sr = J(/* @__PURE__ */ new Map()), gs = J(/* @__PURE__ */ new Map()), lc = R(
|
|
806
807
|
() => ({
|
|
807
808
|
register: (e, t) => {
|
|
808
809
|
gs.current.set(e, t);
|
|
@@ -812,17 +813,17 @@ function jd({
|
|
|
812
813
|
}
|
|
813
814
|
}),
|
|
814
815
|
[]
|
|
815
|
-
), [
|
|
816
|
+
), [at, er] = T({}), [dc, Bo] = T(!1), [Do, tr] = T(null), [cc, Wo] = T(!1), [uc, zo] = T(!1), _t = J(null), [On, Nr] = T(null), nr = J(null), Kt = Ap(a, g ? null : m), Jt = J(null), pi = J(/* @__PURE__ */ new Set()), Vo = J({}), gi = ce(() => {
|
|
816
817
|
var e;
|
|
817
818
|
(e = Jt.current) == null || e.call(Jt), Jt.current = null, pi.current = /* @__PURE__ */ new Set();
|
|
818
819
|
}, []);
|
|
819
820
|
Z(() => {
|
|
820
821
|
Re && Yf(F, Re, de);
|
|
821
822
|
}, [F, Re, de]), Z(() => gi, [a, m]);
|
|
822
|
-
const [Xe, en] = T(!1), [fc, Jo] = T(!1), [Qo, hi] = T({}), hs = J(0), Go = J(null), [
|
|
823
|
+
const [Xe, en] = T(!1), [fc, Jo] = T(!1), [Qo, hi] = T({}), hs = J(0), Go = J(null), [Ct, Ho] = T(!1), ys = (e) => Ho(e), Fn = R(
|
|
823
824
|
() => N != null && N.read_mode_toggle ? um(N.summary_mode_rules) : null,
|
|
824
825
|
[N == null ? void 0 : N.read_mode_toggle, N == null ? void 0 : N.summary_mode_rules]
|
|
825
|
-
), [mc, pc] = T(null), _s = `${a}|${String(m)}`, yi = K || g || N !== void 0 && (!Fn || mc === _s),
|
|
826
|
+
), [mc, pc] = T(null), _s = `${a}|${String(m)}`, yi = K || g || N !== void 0 && (!Fn || mc === _s), Rt = Af(a, m, Re), [pn, $r] = T({ state: K ? "none" : "checking" }), Uo = J(pn);
|
|
826
827
|
Uo.current = pn;
|
|
827
828
|
const [_i, gc] = T(null), rr = J(!1), [bs, Yo] = T(!1);
|
|
828
829
|
Z(() => {
|
|
@@ -836,7 +837,7 @@ function jd({
|
|
|
836
837
|
Z(() => {
|
|
837
838
|
const e = (t) => {
|
|
838
839
|
var r;
|
|
839
|
-
const n = (r = t.detail) == null ? void 0 : r.collection, i =
|
|
840
|
+
const n = (r = t.detail) == null ? void 0 : r.collection, i = Tm(n, a, ls, Ro);
|
|
840
841
|
i !== "ignore" && (de.invalidateQueries({ queryKey: ["field-config"] }), de.invalidateQueries({ queryKey: ["active-layout"] }), de.invalidateQueries({ queryKey: ["collection-meta"] }), i === "banner" && yc(!0));
|
|
841
842
|
};
|
|
842
843
|
return window.addEventListener("nvr:config-update", e), () => window.removeEventListener("nvr:config-update", e);
|
|
@@ -850,13 +851,13 @@ function jd({
|
|
|
850
851
|
const e = window.setTimeout(() => Zo(!0), 3 * 6e4);
|
|
851
852
|
return () => window.clearTimeout(e);
|
|
852
853
|
}, [Xe]);
|
|
853
|
-
const [
|
|
854
|
+
const [Cr, vc] = T({}), Xo = ce((e) => {
|
|
854
855
|
e.length !== 0 && vc((t) => {
|
|
855
856
|
const n = { ...t };
|
|
856
857
|
for (const i of e) n[i] = (n[i] ?? 0) + 1;
|
|
857
858
|
return n;
|
|
858
859
|
});
|
|
859
|
-
}, []), ea = J(null), { headerDense: ta, headerFolded: wc, headerTilesRef: kc } =
|
|
860
|
+
}, []), ea = J(null), { headerDense: ta, headerFolded: wc, headerTilesRef: kc } = Wm(), na = ce((e) => {
|
|
860
861
|
const t = e.target, n = t.scrollTop;
|
|
861
862
|
_c((i) => {
|
|
862
863
|
var l;
|
|
@@ -865,7 +866,7 @@ function jd({
|
|
|
865
866
|
const r = (((l = ea.current) == null ? void 0 : l.offsetHeight) ?? 0) + 16;
|
|
866
867
|
return t.scrollHeight - (t.clientHeight + r) > 64;
|
|
867
868
|
});
|
|
868
|
-
}, []), { data: vs } =
|
|
869
|
+
}, []), { data: vs } = st({
|
|
869
870
|
queryKey: ["collision-base", a, m],
|
|
870
871
|
queryFn: () => F.request(
|
|
871
872
|
re("/revisions", { collection: a, item: m, latest_only: "1" })
|
|
@@ -884,17 +885,17 @@ function jd({
|
|
|
884
885
|
})
|
|
885
886
|
);
|
|
886
887
|
}
|
|
887
|
-
const Oe = J({}), wi = J(/* @__PURE__ */ new Set()), [
|
|
888
|
+
const Oe = J({}), wi = J(/* @__PURE__ */ new Set()), [Rr, gn] = T(null), [ir, ia] = T([]), ki = ce((e) => {
|
|
888
889
|
ia((t) => [...t, e]);
|
|
889
890
|
}, []), [Bt, ws] = T([]), xi = ce((e) => {
|
|
890
891
|
ws((t) => t.filter((n, i) => i !== e));
|
|
891
892
|
}, []), Si = ce((e) => {
|
|
892
893
|
ws((t) => [...t, e]);
|
|
893
|
-
}, []), [
|
|
894
|
+
}, []), [Te, jn] = T(
|
|
894
895
|
/* @__PURE__ */ new Map()
|
|
895
896
|
), Ni = J(/* @__PURE__ */ new Map()), [Ge, sr] = T(/* @__PURE__ */ new Map()), [Le, $i] = T(/* @__PURE__ */ new Map()), Dt = R(
|
|
896
897
|
() => ({
|
|
897
|
-
getPendingRows: (e, t) =>
|
|
898
|
+
getPendingRows: (e, t) => Te.get(`${e}.${t}`) ?? [],
|
|
898
899
|
queueRow: (e, t, n) => jn((i) => {
|
|
899
900
|
const r = new Map(i), o = `${e}.${t}`;
|
|
900
901
|
return r.set(o, [...r.get(o) ?? [], n]), r;
|
|
@@ -935,31 +936,31 @@ function jd({
|
|
|
935
936
|
return l.delete(n), r.set(o, l), r;
|
|
936
937
|
})
|
|
937
938
|
}),
|
|
938
|
-
[
|
|
939
|
-
), [sa, or] = T([]), oa = J(!1), ks = J(!1), [et,
|
|
939
|
+
[Te, Ge, Le]
|
|
940
|
+
), [sa, or] = T([]), oa = J(!1), ks = J(!1), [et, Or] = T(/* @__PURE__ */ new Map()), [tt, Ci] = T(/* @__PURE__ */ new Map()), qn = J(
|
|
940
941
|
null
|
|
941
|
-
), xs = J(/* @__PURE__ */ new Map()), An = J(0), Ri = J(/* @__PURE__ */ new Map()),
|
|
942
|
+
), xs = J(/* @__PURE__ */ new Map()), An = J(0), Ri = J(/* @__PURE__ */ new Map()), Fr = J(/* @__PURE__ */ new Map()), ge = R(
|
|
942
943
|
() => ({
|
|
943
944
|
getStagedLinks: (e) => et.get(e) ?? [],
|
|
944
945
|
getStagedUnlinks: (e) => tt.get(e) ?? /* @__PURE__ */ new Set(),
|
|
945
|
-
getDerivedOrigin: (e) =>
|
|
946
|
+
getDerivedOrigin: (e) => Fr.current.get(e) ?? null,
|
|
946
947
|
stageLink: (e, t) => {
|
|
947
948
|
var n, i;
|
|
948
|
-
if (
|
|
949
|
-
const o = r.get(e) ?? [], l =
|
|
949
|
+
if (Or((r) => {
|
|
950
|
+
const o = r.get(e) ?? [], l = Rg(o, t);
|
|
950
951
|
if (l === o) return r;
|
|
951
952
|
const d = new Map(r);
|
|
952
953
|
return d.set(e, l), d;
|
|
953
954
|
}), An.current === 0) {
|
|
954
955
|
const r = xs.current.get(e);
|
|
955
|
-
r && ((n = qn.current) == null || n.call(qn, r, t), (i =
|
|
956
|
+
r && ((n = qn.current) == null || n.call(qn, r, t), (i = dt.current) == null || i.call(dt, r, t));
|
|
956
957
|
}
|
|
957
958
|
},
|
|
958
959
|
stageUnlink: (e, t) => Ci((n) => {
|
|
959
960
|
const i = new Map(n), r = new Set(i.get(e));
|
|
960
961
|
return r.add(t), i.set(e, r), i;
|
|
961
962
|
}),
|
|
962
|
-
unstageLink: (e, t) =>
|
|
963
|
+
unstageLink: (e, t) => Or((n) => {
|
|
963
964
|
const i = new Map(n);
|
|
964
965
|
return i.set(
|
|
965
966
|
e,
|
|
@@ -974,7 +975,7 @@ function jd({
|
|
|
974
975
|
[et, tt]
|
|
975
976
|
), ar = ce(
|
|
976
977
|
async (e) => {
|
|
977
|
-
ee.current = { ...ee.current, ...e.values },
|
|
978
|
+
ee.current = { ...ee.current, ...e.values }, ot((i) => ({ ...i, ...e.values }));
|
|
978
979
|
const t = [...e.issues];
|
|
979
980
|
if (e.lines.length > 0) {
|
|
980
981
|
const i = e.line_target_field ? P.find(
|
|
@@ -1083,10 +1084,10 @@ function jd({
|
|
|
1083
1084
|
for (const i of Object.keys(t)) Ze.current.add(i);
|
|
1084
1085
|
},
|
|
1085
1086
|
[ar, A]
|
|
1086
|
-
), [
|
|
1087
|
+
), [lt, Fi] = T(null), [ji, aa] = T(!1), la = ce(
|
|
1087
1088
|
async (e, t) => {
|
|
1088
1089
|
const n = t.reimport;
|
|
1089
|
-
if (!n || (Xe || [...
|
|
1090
|
+
if (!n || (Xe || [...Te.values()].some((c) => c.length > 0) || [...Ge.values()].some((c) => c.size > 0) || [...Le.values()].some((c) => c.size > 0)) && !window.confirm(
|
|
1090
1091
|
"Unsaved changes will be combined with the re-import staging. Continue?"
|
|
1091
1092
|
))
|
|
1092
1093
|
return;
|
|
@@ -1120,7 +1121,7 @@ function jd({
|
|
|
1120
1121
|
}
|
|
1121
1122
|
let d;
|
|
1122
1123
|
try {
|
|
1123
|
-
d = e.lines.length > 0 && (r != null && r.many_collection) && r.many_field ?
|
|
1124
|
+
d = e.lines.length > 0 && (r != null && r.many_collection) && r.many_field ? $m(o, l, {
|
|
1124
1125
|
lines: n.lines,
|
|
1125
1126
|
match_by: n.match_by
|
|
1126
1127
|
}) : { creates: [], updates: [], deletes: [], matchedUnchanged: 0 };
|
|
@@ -1171,7 +1172,7 @@ function jd({
|
|
|
1171
1172
|
},
|
|
1172
1173
|
[
|
|
1173
1174
|
Xe,
|
|
1174
|
-
|
|
1175
|
+
Te,
|
|
1175
1176
|
Ge,
|
|
1176
1177
|
Le,
|
|
1177
1178
|
P,
|
|
@@ -1184,7 +1185,7 @@ function jd({
|
|
|
1184
1185
|
async (e, t, n, i) => {
|
|
1185
1186
|
const r = n.reimport;
|
|
1186
1187
|
if (!r) return;
|
|
1187
|
-
const o =
|
|
1188
|
+
const o = vg(n), l = [...t.issues];
|
|
1188
1189
|
if (r.header_fields !== "skip") {
|
|
1189
1190
|
const u = {};
|
|
1190
1191
|
for (const [f, h] of Object.entries(t.values))
|
|
@@ -1195,7 +1196,7 @@ function jd({
|
|
|
1195
1196
|
const _ = ee.current[f];
|
|
1196
1197
|
(_ == null || _ === "") && (u[f] = h);
|
|
1197
1198
|
}
|
|
1198
|
-
Object.keys(u).length > 0 && (ee.current = { ...ee.current, ...u },
|
|
1199
|
+
Object.keys(u).length > 0 && (ee.current = { ...ee.current, ...u }, ot((f) => ({ ...f, ...u })));
|
|
1199
1200
|
}
|
|
1200
1201
|
const d = t.line_target_field ? P.find(
|
|
1201
1202
|
(u) => u.one_collection === a && u.one_field === t.line_target_field
|
|
@@ -1203,7 +1204,7 @@ function jd({
|
|
|
1203
1204
|
if (d != null && d.many_collection && d.many_field) {
|
|
1204
1205
|
const u = d.many_collection, f = d.many_field;
|
|
1205
1206
|
let h = e.creates;
|
|
1206
|
-
const _ = h.some((x) =>
|
|
1207
|
+
const _ = h.some((x) => Sm in x) || e.rulesEvaluated;
|
|
1207
1208
|
if (h.length > 0 && !_) {
|
|
1208
1209
|
const x = (A ?? []).find((G) => G.field === t.line_target_field), v = x == null ? void 0 : x.options, D = typeof v == "string" ? (() => {
|
|
1209
1210
|
try {
|
|
@@ -1338,7 +1339,7 @@ function jd({
|
|
|
1338
1339
|
}
|
|
1339
1340
|
ge.stageLink(f, t.file_id);
|
|
1340
1341
|
} else
|
|
1341
|
-
ee.current = { ...ee.current, [o]: t.file_id },
|
|
1342
|
+
ee.current = { ...ee.current, [o]: t.file_id }, ot((f) => ({ ...f, [o]: t.file_id }));
|
|
1342
1343
|
}
|
|
1343
1344
|
for (const [u, f] of Object.entries(t.m2m ?? {})) {
|
|
1344
1345
|
if (o && u === o) continue;
|
|
@@ -1381,9 +1382,9 @@ function jd({
|
|
|
1381
1382
|
return;
|
|
1382
1383
|
Ss.current = !0;
|
|
1383
1384
|
const { __links: e, ...t } = Un ?? {};
|
|
1384
|
-
Un && (
|
|
1385
|
+
Un && (ot((i) => ({ ...t, ...i })), ee.current = { ...t, ...ee.current });
|
|
1385
1386
|
const n = ii || e && typeof e == "object" ? { ...e ?? {}, ...ii ?? {} } : void 0;
|
|
1386
|
-
n &&
|
|
1387
|
+
n && Or((i) => {
|
|
1387
1388
|
const r = new Map(i);
|
|
1388
1389
|
for (const [o, l] of Object.entries(n))
|
|
1389
1390
|
!r.has(o) && l.length && r.set(o, [...l]);
|
|
@@ -1416,22 +1417,22 @@ function jd({
|
|
|
1416
1417
|
Oe.current = ue;
|
|
1417
1418
|
const d = { ...ee.current };
|
|
1418
1419
|
for (const c of i) Ze.current.has(c) || (d[c] = ue[c]);
|
|
1419
|
-
ee.current = d,
|
|
1420
|
+
ee.current = d, ot(d);
|
|
1420
1421
|
return;
|
|
1421
1422
|
}
|
|
1422
1423
|
}
|
|
1423
1424
|
}
|
|
1424
|
-
Oe.current = ue, ee.current = ue,
|
|
1425
|
+
Oe.current = ue, ee.current = ue, ot(ue), en(!1);
|
|
1425
1426
|
}, [ue]);
|
|
1426
1427
|
const tn = R(() => {
|
|
1427
1428
|
const e = Oe.current, t = [];
|
|
1428
1429
|
for (const h of Object.keys(I))
|
|
1429
1430
|
h.startsWith("__") || Ze.current.has(h) && (Lt(I[h], e[h]) || t.push(h));
|
|
1430
|
-
const n = (h, _) => [...h.values()].reduce((S, x) => S + _(x), 0), i = n(
|
|
1431
|
+
const n = (h, _) => [...h.values()].reduce((S, x) => S + _(x), 0), i = n(Te, (h) => h.length), r = n(Ge, (h) => h.size), o = n(Le, (h) => h.size), l = n(et, (h) => h.length), d = n(tt, (h) => h.size), c = t.length + i + r + o + l + d, u = [];
|
|
1431
1432
|
t.length && u.push(`${t.length} field${t.length === 1 ? "" : "s"}`);
|
|
1432
1433
|
const f = i + r + o;
|
|
1433
1434
|
return f && u.push(`${f} line${f === 1 ? "" : "s"}`), l + d && u.push(`${l + d} link${l + d === 1 ? "" : "s"}`), { fields: t, rows: i, edits: r, deletes: o, links: l, unlinks: d, total: c, text: u.join(", ") };
|
|
1434
|
-
}, [I,
|
|
1435
|
+
}, [I, Te, Ge, Le, et, tt]), qi = Xe || tn.total > 0;
|
|
1435
1436
|
Z(() => {
|
|
1436
1437
|
un == null || un(qi, tn), window.dispatchEvent(
|
|
1437
1438
|
new CustomEvent("nvr:form-unsaved", {
|
|
@@ -1447,7 +1448,7 @@ function jd({
|
|
|
1447
1448
|
}, [qi, tn.text]);
|
|
1448
1449
|
const da = g || !!ue;
|
|
1449
1450
|
Z(() => {
|
|
1450
|
-
if (!da || K || _i ===
|
|
1451
|
+
if (!da || K || _i === Rt) return;
|
|
1451
1452
|
let e = !1;
|
|
1452
1453
|
const t = g ? "new" : String(m), n = Re ? F.request(
|
|
1453
1454
|
re(`/drafts/${a}/${t}`)
|
|
@@ -1457,12 +1458,12 @@ function jd({
|
|
|
1457
1458
|
return (r = i == null ? void 0 : i.data) != null && r.payload && typeof i.data.payload == "object" ? i.data.payload : null;
|
|
1458
1459
|
}
|
|
1459
1460
|
).catch(() => null) : Promise.resolve(null);
|
|
1460
|
-
return Promise.all([jf(
|
|
1461
|
+
return Promise.all([jf(Rt), n]).then(([i, r]) => {
|
|
1461
1462
|
if (r && (rr.current = !0), e) return;
|
|
1462
|
-
gc(
|
|
1463
|
+
gc(Rt);
|
|
1463
1464
|
const o = i && r ? String(r.saved_at) > String(i.saved_at) ? r : i : i ?? r;
|
|
1464
1465
|
if (!o || !go(o)) {
|
|
1465
|
-
|
|
1466
|
+
$r({ state: "none" });
|
|
1466
1467
|
return;
|
|
1467
1468
|
}
|
|
1468
1469
|
const l = Oe.current, d = {};
|
|
@@ -1470,18 +1471,18 @@ function jd({
|
|
|
1470
1471
|
Lt(f, l[u]) || (d[u] = f);
|
|
1471
1472
|
const c = { ...o, fields: d };
|
|
1472
1473
|
if (!go(c)) {
|
|
1473
|
-
|
|
1474
|
+
Zr(Rt), $r({ state: "none" });
|
|
1474
1475
|
return;
|
|
1475
1476
|
}
|
|
1476
|
-
|
|
1477
|
+
$r({ state: "offer", draft: c });
|
|
1477
1478
|
}), () => {
|
|
1478
1479
|
e = !0;
|
|
1479
1480
|
};
|
|
1480
|
-
}, [g, da,
|
|
1481
|
-
if (pn.state !== "none" || _i !==
|
|
1481
|
+
}, [g, da, Rt, _i]), Z(() => {
|
|
1482
|
+
if (pn.state !== "none" || _i !== Rt) return;
|
|
1482
1483
|
const e = setTimeout(() => {
|
|
1483
1484
|
if (!Xe) {
|
|
1484
|
-
|
|
1485
|
+
Zr(Rt), Re && rr.current && (rr.current = !1, F.request(Vn(`/drafts/${a}/${g ? "new" : String(m)}`)).catch(() => {
|
|
1485
1486
|
}));
|
|
1486
1487
|
return;
|
|
1487
1488
|
}
|
|
@@ -1489,7 +1490,7 @@ function jd({
|
|
|
1489
1490
|
for (const [l, d] of Object.entries(ee.current))
|
|
1490
1491
|
l.startsWith("__") || Lt(d, t[l]) || g && !Ze.current.has(l) || (n[l] = d, i[l] = t[l]);
|
|
1491
1492
|
const r = (l, d) => Object.fromEntries([...l.entries()].map(([c, u]) => [c, d(u)])), o = {
|
|
1492
|
-
key:
|
|
1493
|
+
key: Rt,
|
|
1493
1494
|
collection: a,
|
|
1494
1495
|
item_id: g ? "new" : String(m),
|
|
1495
1496
|
user_id: Re || "anon",
|
|
@@ -1497,7 +1498,7 @@ function jd({
|
|
|
1497
1498
|
fields: n,
|
|
1498
1499
|
base: i,
|
|
1499
1500
|
base_updated_at: t.date_updated ?? t.updated_at ?? null,
|
|
1500
|
-
pending_rows: r(
|
|
1501
|
+
pending_rows: r(Te, (l) => l),
|
|
1501
1502
|
pending_edits: r(
|
|
1502
1503
|
Ge,
|
|
1503
1504
|
(l) => Object.fromEntries(l)
|
|
@@ -1507,7 +1508,7 @@ function jd({
|
|
|
1507
1508
|
m2m_unlinks: r(tt, (l) => [...l])
|
|
1508
1509
|
};
|
|
1509
1510
|
if (!go(o)) {
|
|
1510
|
-
|
|
1511
|
+
Zr(Rt), Re && rr.current && (rr.current = !1, F.request(Vn(`/drafts/${a}/${g ? "new" : String(m)}`)).catch(() => {
|
|
1511
1512
|
}));
|
|
1512
1513
|
return;
|
|
1513
1514
|
}
|
|
@@ -1523,10 +1524,10 @@ function jd({
|
|
|
1523
1524
|
}, [
|
|
1524
1525
|
pn.state,
|
|
1525
1526
|
_i,
|
|
1526
|
-
|
|
1527
|
+
Rt,
|
|
1527
1528
|
Xe,
|
|
1528
1529
|
I,
|
|
1529
|
-
|
|
1530
|
+
Te,
|
|
1530
1531
|
Ge,
|
|
1531
1532
|
Le,
|
|
1532
1533
|
et,
|
|
@@ -1540,18 +1541,18 @@ function jd({
|
|
|
1540
1541
|
const e = Uo.current;
|
|
1541
1542
|
if (e.state !== "offer") return;
|
|
1542
1543
|
const t = e.draft, n = { ...ee.current, ...t.fields };
|
|
1543
|
-
ee.current = n,
|
|
1544
|
+
ee.current = n, ot(n);
|
|
1544
1545
|
for (const i of Object.keys(t.fields))
|
|
1545
|
-
Ze.current.add(i),
|
|
1546
|
+
Ze.current.add(i), Sr.current.set(i, ++mi.current);
|
|
1546
1547
|
Object.keys(t.pending_rows ?? {}).length && jn(new Map(Object.entries(t.pending_rows))), Object.keys(t.pending_edits ?? {}).length && sr(
|
|
1547
1548
|
new Map(Object.entries(t.pending_edits).map(([i, r]) => [i, new Map(Object.entries(r))]))
|
|
1548
1549
|
), Object.keys(t.pending_deletes ?? {}).length && $i(
|
|
1549
1550
|
new Map(Object.entries(t.pending_deletes).map(([i, r]) => [i, new Set(r)]))
|
|
1550
|
-
), Object.keys(t.m2m_links ?? {}).length &&
|
|
1551
|
+
), Object.keys(t.m2m_links ?? {}).length && Or(new Map(Object.entries(t.m2m_links))), Object.keys(t.m2m_unlinks ?? {}).length && Ci(new Map(Object.entries(t.m2m_unlinks).map(([i, r]) => [i, new Set(r)]))), en(!0), $r({ state: "none" });
|
|
1551
1552
|
}, []), Fc = ce(() => {
|
|
1552
|
-
|
|
1553
|
-
}),
|
|
1554
|
-
}, [
|
|
1553
|
+
Zr(Rt), Re && F.request(Vn(`/drafts/${a}/${g ? "new" : String(m)}`)).catch(() => {
|
|
1554
|
+
}), $r({ state: "none" });
|
|
1555
|
+
}, [Rt, Re, F, a, g, m]);
|
|
1555
1556
|
Z(() => {
|
|
1556
1557
|
var i;
|
|
1557
1558
|
if (!g || w === void 0 || ks.current) return;
|
|
@@ -1578,15 +1579,15 @@ function jd({
|
|
|
1578
1579
|
}
|
|
1579
1580
|
t[r] = o;
|
|
1580
1581
|
}
|
|
1581
|
-
const n =
|
|
1582
|
-
ee.current = n,
|
|
1582
|
+
const n = Ng(ee.current, t);
|
|
1583
|
+
ee.current = n, ot(n);
|
|
1583
1584
|
}, [g, w, P, di, a, ge]);
|
|
1584
1585
|
const Ns = R(
|
|
1585
1586
|
() => (A ?? []).filter(
|
|
1586
|
-
(e) => e.interface === "relation-path" && e.field.includes(".") && !
|
|
1587
|
+
(e) => e.interface === "relation-path" && e.field.includes(".") && !xr.fields.has(e.field)
|
|
1587
1588
|
).map((e) => e.field),
|
|
1588
|
-
[A,
|
|
1589
|
-
), { data: lr } =
|
|
1589
|
+
[A, xr]
|
|
1590
|
+
), { data: lr } = st({
|
|
1590
1591
|
queryKey: ["resolve-paths", a, m, Ns.join(",")],
|
|
1591
1592
|
queryFn: () => F.request(
|
|
1592
1593
|
re(`/items/${a}/${m}/resolve-paths`, {
|
|
@@ -1606,7 +1607,7 @@ function jd({
|
|
|
1606
1607
|
if (!lr) return;
|
|
1607
1608
|
const e = {};
|
|
1608
1609
|
for (const [t, n] of Object.entries(lr)) e[t] = n.value;
|
|
1609
|
-
Object.keys(e).length !== 0 && (Oe.current = { ...Oe.current, ...e }, ee.current = { ...ee.current, ...e },
|
|
1610
|
+
Object.keys(e).length !== 0 && (Oe.current = { ...Oe.current, ...e }, ee.current = { ...ee.current, ...e }, ot((t) => ({ ...t, ...e })));
|
|
1610
1611
|
}, [lr]);
|
|
1611
1612
|
const fe = R(() => {
|
|
1612
1613
|
const e = Xn.filter((i) => i.is_active === !0 || i.is_active === 1), t = /* @__PURE__ */ new Set();
|
|
@@ -1620,7 +1621,7 @@ function jd({
|
|
|
1620
1621
|
r && n.set(i, r);
|
|
1621
1622
|
}
|
|
1622
1623
|
return n;
|
|
1623
|
-
}, [Xn, P, a]), qc = [...fe.values()], ca =
|
|
1624
|
+
}, [Xn, P, a]), qc = [...fe.values()], ca = Hr({
|
|
1624
1625
|
queries: qc.map((e) => ({
|
|
1625
1626
|
queryKey: ["m2m-items", e.manyCollection, e.manyField, m],
|
|
1626
1627
|
queryFn: () => F.request(
|
|
@@ -1637,7 +1638,7 @@ function jd({
|
|
|
1637
1638
|
const e = {};
|
|
1638
1639
|
return [...fe.entries()].forEach(([t, n], i) => {
|
|
1639
1640
|
const r = ca[i];
|
|
1640
|
-
e[t] =
|
|
1641
|
+
e[t] = Fg(
|
|
1641
1642
|
!!m && !g,
|
|
1642
1643
|
(r == null ? void 0 : r.isSuccess) ?? !1,
|
|
1643
1644
|
r == null ? void 0 : r.data,
|
|
@@ -1646,11 +1647,11 @@ function jd({
|
|
|
1646
1647
|
tt.get(n.stagingKey)
|
|
1647
1648
|
);
|
|
1648
1649
|
}), e;
|
|
1649
|
-
}, [fe, ca, et, tt, m, g]),
|
|
1650
|
-
|
|
1650
|
+
}, [fe, ca, et, tt, m, g]), jr = J(Ne);
|
|
1651
|
+
jr.current = Ne, xs.current = new Map(
|
|
1651
1652
|
[...fe.entries()].map(([e, t]) => [t.stagingKey, e])
|
|
1652
1653
|
);
|
|
1653
|
-
const
|
|
1654
|
+
const qr = ce(
|
|
1654
1655
|
(e) => {
|
|
1655
1656
|
var t;
|
|
1656
1657
|
return (t = Ne[e]) == null ? void 0 : t.ids;
|
|
@@ -1716,7 +1717,7 @@ function jd({
|
|
|
1716
1717
|
try {
|
|
1717
1718
|
for (const n of t) {
|
|
1718
1719
|
for (const i of n.ids) ge.unstageLink(n.stagingKey, i);
|
|
1719
|
-
|
|
1720
|
+
Fr.current.get(n.parent) === e && Fr.current.delete(n.parent);
|
|
1720
1721
|
}
|
|
1721
1722
|
} finally {
|
|
1722
1723
|
An.current -= 1;
|
|
@@ -1729,7 +1730,7 @@ function jd({
|
|
|
1729
1730
|
(e, t, n, i) => {
|
|
1730
1731
|
if (i.length === 0) return;
|
|
1731
1732
|
const r = Ri.current.get(e) ?? [];
|
|
1732
|
-
r.push({ parent: t, stagingKey: n, ids: i }), Ri.current.set(e, r),
|
|
1733
|
+
r.push({ parent: t, stagingKey: n, ids: i }), Ri.current.set(e, r), Fr.current.set(t, e);
|
|
1733
1734
|
},
|
|
1734
1735
|
[]
|
|
1735
1736
|
), ya = ce(
|
|
@@ -1769,7 +1770,7 @@ function jd({
|
|
|
1769
1770
|
try {
|
|
1770
1771
|
const k = te.parent_field;
|
|
1771
1772
|
if (fe.has(k)) {
|
|
1772
|
-
if ((((S =
|
|
1773
|
+
if ((((S = jr.current[k]) == null ? void 0 : S.ids) ?? []).length > 0) continue;
|
|
1773
1774
|
} else {
|
|
1774
1775
|
const p = ee.current[k];
|
|
1775
1776
|
if (p != null && p !== "")
|
|
@@ -1832,7 +1833,7 @@ function jd({
|
|
|
1832
1833
|
const L = te.parent_field;
|
|
1833
1834
|
if (fe.has(L)) {
|
|
1834
1835
|
const p = fe.get(L), b = new Set(
|
|
1835
|
-
(((x =
|
|
1836
|
+
(((x = jr.current[L]) == null ? void 0 : x.ids) ?? []).map((V) => String(V))
|
|
1836
1837
|
);
|
|
1837
1838
|
if (b.size > 0) continue;
|
|
1838
1839
|
const $ = (A ?? []).find((V) => V.field === L), W = (v = xn(
|
|
@@ -1849,12 +1850,12 @@ function jd({
|
|
|
1849
1850
|
}
|
|
1850
1851
|
Ti(o, L, p.stagingKey, M);
|
|
1851
1852
|
for (const V of q)
|
|
1852
|
-
(D =
|
|
1853
|
+
(D = dt.current) == null || D.call(dt, L, V, n + 1, l, o);
|
|
1853
1854
|
} else if (q.length === 1) {
|
|
1854
1855
|
const p = ee.current[L];
|
|
1855
1856
|
if (p != null && p !== "") continue;
|
|
1856
1857
|
const b = q[0];
|
|
1857
|
-
ee.current = { ...ee.current, [L]: b },
|
|
1858
|
+
ee.current = { ...ee.current, [L]: b }, ot(($) => ({ ...$, [L]: b })), en(!0), (C = qn.current) == null || C.call(qn, L, b, 1), Fr.current.set(L, o), (G = dt.current) == null || G.call(dt, L, b, n + 1, l, o);
|
|
1858
1859
|
}
|
|
1859
1860
|
} catch {
|
|
1860
1861
|
}
|
|
@@ -1870,8 +1871,8 @@ function jd({
|
|
|
1870
1871
|
Ai,
|
|
1871
1872
|
Ti
|
|
1872
1873
|
]
|
|
1873
|
-
),
|
|
1874
|
-
|
|
1874
|
+
), dt = J(ya);
|
|
1875
|
+
dt.current = ya;
|
|
1875
1876
|
const hn = ce(
|
|
1876
1877
|
(e, t, n = 0) => {
|
|
1877
1878
|
if (!(t == null || t === "") && !(n > 2))
|
|
@@ -1922,7 +1923,7 @@ function jd({
|
|
|
1922
1923
|
const q = fe.get(k);
|
|
1923
1924
|
if (!q) return;
|
|
1924
1925
|
const L = new Set(
|
|
1925
|
-
(((W =
|
|
1926
|
+
(((W = jr.current[k]) == null ? void 0 : W.ids) ?? []).map((V) => String(V))
|
|
1926
1927
|
);
|
|
1927
1928
|
if (L.size > 0) return;
|
|
1928
1929
|
const p = (A ?? []).find((V) => V.field === k), b = (M = xn(
|
|
@@ -1963,9 +1964,9 @@ function jd({
|
|
|
1963
1964
|
if (L = h[p], L != null && L !== "") break;
|
|
1964
1965
|
_[k] = L ?? null;
|
|
1965
1966
|
}
|
|
1966
|
-
ee.current = { ...ee.current, ..._ },
|
|
1967
|
+
ee.current = { ...ee.current, ..._ }, ot((k) => ({ ...k, ..._ })), Xo(Object.keys(_)), en(!0);
|
|
1967
1968
|
for (const [k, j] of Object.entries(_))
|
|
1968
|
-
k !== e && j != null && j !== "" && (hn(k, j, n + 1), (te =
|
|
1969
|
+
k !== e && j != null && j !== "" && (hn(k, j, n + 1), (te = dt.current) == null || te.call(dt, k, j, n + 1));
|
|
1969
1970
|
}).catch(() => {
|
|
1970
1971
|
});
|
|
1971
1972
|
}
|
|
@@ -1984,27 +1985,27 @@ function jd({
|
|
|
1984
1985
|
_a.current = !0;
|
|
1985
1986
|
const { __links: e, ...t } = Un ?? {};
|
|
1986
1987
|
for (const [n, i] of Object.entries(t))
|
|
1987
|
-
i == null || i === "" || (hn(n, i),
|
|
1988
|
+
i == null || i === "" || (hn(n, i), dt.current(n, i));
|
|
1988
1989
|
}, [g, A, P, Un, hn]), qn.current = hn;
|
|
1989
1990
|
const ba = ce(
|
|
1990
1991
|
(e, t) => {
|
|
1991
1992
|
var l;
|
|
1992
|
-
const { scalar: n, alias: i } =
|
|
1993
|
+
const { scalar: n, alias: i } = qg(
|
|
1993
1994
|
e,
|
|
1994
1995
|
new Set(fe.keys())
|
|
1995
1996
|
), r = {};
|
|
1996
1997
|
for (const [d, c] of Object.entries(n))
|
|
1997
|
-
t !== void 0 && (
|
|
1998
|
-
const o =
|
|
1998
|
+
t !== void 0 && (Sr.current.get(d) ?? 0) > t || (r[d] = c, t !== void 0 && Sr.current.set(d, t));
|
|
1999
|
+
const o = jg(i, Ne);
|
|
1999
2000
|
for (const [d, c] of Object.entries(o)) {
|
|
2000
2001
|
const u = fe.get(d);
|
|
2001
2002
|
if (!u) continue;
|
|
2002
|
-
const f =
|
|
2003
|
+
const f = Og(c, (l = jr.current[d]) == null ? void 0 : l.ids);
|
|
2003
2004
|
for (const h of f) ge.stageLink(u.stagingKey, h);
|
|
2004
2005
|
}
|
|
2005
2006
|
if (Object.keys(r).length > 0) {
|
|
2006
|
-
const d =
|
|
2007
|
-
ee.current = d,
|
|
2007
|
+
const d = $g(ee.current, r);
|
|
2008
|
+
ee.current = d, ot(d), Xo(Object.keys(r));
|
|
2008
2009
|
for (const [c, u] of Object.entries(r)) hn(c, u);
|
|
2009
2010
|
}
|
|
2010
2011
|
},
|
|
@@ -2026,7 +2027,7 @@ function jd({
|
|
|
2026
2027
|
delete Ii.current[e];
|
|
2027
2028
|
const r = mi.current, o = t !== void 0 ? t : ee.current[e], l = {};
|
|
2028
2029
|
for (const d of n) {
|
|
2029
|
-
const c =
|
|
2030
|
+
const c = qr(d.target_field);
|
|
2030
2031
|
l[d.target_field] = c !== void 0 ? c : ee.current[d.target_field];
|
|
2031
2032
|
}
|
|
2032
2033
|
F.request(
|
|
@@ -2040,7 +2041,7 @@ function jd({
|
|
|
2040
2041
|
});
|
|
2041
2042
|
}, 300);
|
|
2042
2043
|
},
|
|
2043
|
-
[K, Xn, a, F,
|
|
2044
|
+
[K, Xn, a, F, qr, ba]
|
|
2044
2045
|
), $s = J({}), va = J(!1), Cs = R(
|
|
2045
2046
|
() => [...fe.entries()].filter(
|
|
2046
2047
|
([e]) => Od(Xn, e).length > 0
|
|
@@ -2059,13 +2060,13 @@ function jd({
|
|
|
2059
2060
|
}
|
|
2060
2061
|
for (const [e, t] of Cs) {
|
|
2061
2062
|
const n = et.get(t.stagingKey), i = tt.get(t.stagingKey), r = $s.current[e];
|
|
2062
|
-
r && r.links === n && r.unlinks === i || ($s.current[e] = { links: n, unlinks: i }, ua(e) && Ei(e,
|
|
2063
|
+
r && r.links === n && r.unlinks === i || ($s.current[e] = { links: n, unlinks: i }, ua(e) && Ei(e, qr(e) ?? []));
|
|
2063
2064
|
}
|
|
2064
2065
|
}, [
|
|
2065
2066
|
et,
|
|
2066
2067
|
tt,
|
|
2067
2068
|
Cs,
|
|
2068
|
-
|
|
2069
|
+
qr,
|
|
2069
2070
|
ua,
|
|
2070
2071
|
Ei
|
|
2071
2072
|
]);
|
|
@@ -2073,7 +2074,7 @@ function jd({
|
|
|
2073
2074
|
(e, t) => {
|
|
2074
2075
|
var r;
|
|
2075
2076
|
if (K || Lt(ee.current[e], t)) return;
|
|
2076
|
-
Ze.current.add(e), (r = Mi.current) == null || r.call(Mi),
|
|
2077
|
+
Ze.current.add(e), (r = Mi.current) == null || r.call(Mi), Sr.current.set(e, ++mi.current);
|
|
2077
2078
|
const n = { ...ee.current, [e]: t };
|
|
2078
2079
|
for (const o of A ?? [])
|
|
2079
2080
|
if (o.dependency_config)
|
|
@@ -2083,21 +2084,21 @@ function jd({
|
|
|
2083
2084
|
d.parent_field === e && d.clear_on_parent_change && (n[o.field] = null);
|
|
2084
2085
|
} catch {
|
|
2085
2086
|
}
|
|
2086
|
-
ee.current = n,
|
|
2087
|
+
ee.current = n, ot(n), en(!0);
|
|
2087
2088
|
const i = t == null || t === "";
|
|
2088
2089
|
i || wi.current.add(e), er((o) => {
|
|
2089
2090
|
const l = { ...o }, d = (A ?? []).find((c) => c.field === e);
|
|
2090
2091
|
return d != null && d.required && i && wi.current.has(e) ? l[e] = "This field is required" : delete l[e], l;
|
|
2091
|
-
}), Ei(e), i || hn(e, t), i ||
|
|
2092
|
+
}), Ei(e), i || hn(e, t), i || dt.current(e, t);
|
|
2092
2093
|
},
|
|
2093
2094
|
[K, A, Ei, hn]
|
|
2094
|
-
), [Rs, Ic] = T({}),
|
|
2095
|
+
), [Rs, Ic] = T({}), Ot = R(
|
|
2095
2096
|
() => P.filter(
|
|
2096
2097
|
(e) => !e.junction_field && e.one_collection === a && e.one_field && e.many_field && e.many_collection
|
|
2097
2098
|
),
|
|
2098
2099
|
[P, a]
|
|
2099
|
-
), Pi =
|
|
2100
|
-
queries:
|
|
2100
|
+
), Pi = Hr({
|
|
2101
|
+
queries: Ot.map((e) => ({
|
|
2101
2102
|
queryKey: ["o2m-rows", e.many_collection, e.many_field, m, ""],
|
|
2102
2103
|
queryFn: () => F.request(
|
|
2103
2104
|
re(`/items/${e.many_collection}`, {
|
|
@@ -2107,24 +2108,24 @@ function jd({
|
|
|
2107
2108
|
).then((t) => t.data ?? []),
|
|
2108
2109
|
select: (t) => t.length,
|
|
2109
2110
|
// A grid only in a section that loads when opened waits for it (#2713).
|
|
2110
|
-
enabled: !!m && !g && !
|
|
2111
|
+
enabled: !!m && !g && !xr.fields.has(e.one_field),
|
|
2111
2112
|
staleTime: 3e4
|
|
2112
2113
|
}))
|
|
2113
2114
|
}), Os = R(() => {
|
|
2114
2115
|
const e = {};
|
|
2115
|
-
return
|
|
2116
|
+
return Ot.forEach((t, n) => {
|
|
2116
2117
|
var r;
|
|
2117
2118
|
const i = (r = Pi[n]) == null ? void 0 : r.data;
|
|
2118
2119
|
t.one_field && i !== void 0 && (e[t.one_field] = i);
|
|
2119
2120
|
}), e;
|
|
2120
|
-
}, [
|
|
2121
|
-
() => new Set(
|
|
2122
|
-
[
|
|
2123
|
-
),
|
|
2121
|
+
}, [Ot, Pi]), nn = R(
|
|
2122
|
+
() => new Set(Ot.map((e) => e.one_field)),
|
|
2123
|
+
[Ot]
|
|
2124
|
+
), Ft = R(() => {
|
|
2124
2125
|
var t, n;
|
|
2125
2126
|
const e = {};
|
|
2126
|
-
for (const i of
|
|
2127
|
-
const r = i.one_field, o = `${i.many_collection}.${i.many_field}`, l = ((t =
|
|
2127
|
+
for (const i of Ot) {
|
|
2128
|
+
const r = i.one_field, o = `${i.many_collection}.${i.many_field}`, l = ((t = Te.get(o)) == null ? void 0 : t.length) ?? 0;
|
|
2128
2129
|
if (g) {
|
|
2129
2130
|
e[r] = l;
|
|
2130
2131
|
continue;
|
|
@@ -2135,16 +2136,16 @@ function jd({
|
|
|
2135
2136
|
e[r] = Math.max(0, d - c) + l;
|
|
2136
2137
|
}
|
|
2137
2138
|
return e;
|
|
2138
|
-
}, [
|
|
2139
|
+
}, [Ot, Os, Te, Le, g]);
|
|
2139
2140
|
Z(() => {
|
|
2140
2141
|
er((e) => {
|
|
2141
2142
|
let t = !1;
|
|
2142
2143
|
const n = { ...e };
|
|
2143
2144
|
for (const i of Object.keys(e))
|
|
2144
|
-
nn.has(i) && (
|
|
2145
|
+
nn.has(i) && (Ft[i] ?? 0) > 0 && (delete n[i], t = !0);
|
|
2145
2146
|
return t ? n : e;
|
|
2146
2147
|
});
|
|
2147
|
-
}, [
|
|
2148
|
+
}, [Ft, nn]);
|
|
2148
2149
|
const Tn = ce(
|
|
2149
2150
|
(e, t) => {
|
|
2150
2151
|
Ic((n) => n[e] === t ? n : { ...n, [e]: t }), t > 0 && wi.current.add(e), er((n) => {
|
|
@@ -2155,7 +2156,7 @@ function jd({
|
|
|
2155
2156
|
});
|
|
2156
2157
|
},
|
|
2157
2158
|
[A]
|
|
2158
|
-
), Fs = !K && fn && !g && !!(N != null && N.item_locking_enabled) && yi &&
|
|
2159
|
+
), Fs = !K && fn && !g && !!(N != null && N.item_locking_enabled) && yi && !Ct, {
|
|
2159
2160
|
lockHolder: In,
|
|
2160
2161
|
acquired: wa,
|
|
2161
2162
|
isReadOnly: Ec,
|
|
@@ -2174,17 +2175,17 @@ function jd({
|
|
|
2174
2175
|
releasing: Gc,
|
|
2175
2176
|
released: js,
|
|
2176
2177
|
relock: xa
|
|
2177
|
-
} =
|
|
2178
|
+
} = ag(a, g ? void 0 : m, Fs), rn = Ec || !!Rn;
|
|
2178
2179
|
Mi.current = js && !In ? () => void xa() : null;
|
|
2179
|
-
const Ke = (w == null ? void 0 : w.assignments) ?? [], qs = Ke.some((e) => e.lock_conditions), dr = !!(N != null && N.addendums_enabled) && !g, As = !g && fm(Fn), Ts = !g && mm(Fn), { data: he, isError: Sa } =
|
|
2180
|
+
const Ke = (w == null ? void 0 : w.assignments) ?? [], qs = Ke.some((e) => e.lock_conditions), dr = !!(N != null && N.addendums_enabled) && !g, As = !g && fm(Fn), Ts = !g && mm(Fn), { data: he, isError: Sa } = st({
|
|
2180
2181
|
queryKey: ["current-user-me"],
|
|
2181
2182
|
queryFn: () => F.request(re("/users/me")).then((e) => e.data ?? null),
|
|
2182
2183
|
staleTime: 5 * 6e4,
|
|
2183
2184
|
enabled: qs || dr || As || Ao.role
|
|
2184
|
-
}), Li =
|
|
2185
|
+
}), Li = op(a, g ? null : m, {
|
|
2185
2186
|
enabled: !Qe,
|
|
2186
|
-
eager:
|
|
2187
|
-
}), Ki = (ht == null ? void 0 : ht.stateKey) ?? null, { data: Na, isError: $a } =
|
|
2187
|
+
eager: $t
|
|
2188
|
+
}), Ki = (ht == null ? void 0 : ht.stateKey) ?? null, { data: Na, isError: $a } = st({
|
|
2188
2189
|
queryKey: ["pipeline-instance-lock", a, m],
|
|
2189
2190
|
queryFn: () => F.request(re(`/pipelines/instance/${a}/${m}`)).then(
|
|
2190
2191
|
(e) => e.data
|
|
@@ -2204,9 +2205,9 @@ function jd({
|
|
|
2204
2205
|
}, [ae]), Es = R(
|
|
2205
2206
|
() => ({
|
|
2206
2207
|
stateKey: Is,
|
|
2207
|
-
roleId: K ? (Zn == null ? void 0 : Zn.roleId) ?? null :
|
|
2208
|
+
roleId: K ? (Zn == null ? void 0 : Zn.roleId) ?? null : Ae.roleId ?? (he == null ? void 0 : he.role) ?? null
|
|
2208
2209
|
}),
|
|
2209
|
-
[Is, K, Zn == null ? void 0 : Zn.roleId,
|
|
2210
|
+
[Is, K, Zn == null ? void 0 : Zn.roleId, Ae.roleId, he == null ? void 0 : he.role]
|
|
2210
2211
|
), Bi = R(() => {
|
|
2211
2212
|
var e, t, n;
|
|
2212
2213
|
if (!dr) return !1;
|
|
@@ -2237,7 +2238,7 @@ function jd({
|
|
|
2237
2238
|
N == null ? void 0 : N.addendum_allowed_states,
|
|
2238
2239
|
he == null ? void 0 : he.role,
|
|
2239
2240
|
ae
|
|
2240
|
-
]), { data: bt = [] } =
|
|
2241
|
+
]), { data: bt = [] } = st({
|
|
2241
2242
|
queryKey: ["addendums", a, m],
|
|
2242
2243
|
queryFn: () => F.request(re(`/addendums/${a}/${m}`)).then((e) => e.data ?? []),
|
|
2243
2244
|
enabled: dr,
|
|
@@ -2261,7 +2262,7 @@ function jd({
|
|
|
2261
2262
|
if (Se === "original") return null;
|
|
2262
2263
|
const e = bt.find((t) => t.id === Se);
|
|
2263
2264
|
return e != null && e.data ? Object.fromEntries(Object.entries(e.data).filter(([, t]) => !Array.isArray(t))) : null;
|
|
2264
|
-
}, [Se, bt]), [ur, Ra] = T(/* @__PURE__ */ new Map()),
|
|
2265
|
+
}, [Se, bt]), [ur, Ra] = T(/* @__PURE__ */ new Map()), Ar = R(() => {
|
|
2265
2266
|
const e = /* @__PURE__ */ new Map();
|
|
2266
2267
|
for (const t of A ?? [])
|
|
2267
2268
|
if (!(t.computed_type !== "rollup" || !t.computed_formula))
|
|
@@ -2274,8 +2275,8 @@ function jd({
|
|
|
2274
2275
|
e.set(i, [...r]);
|
|
2275
2276
|
}
|
|
2276
2277
|
return e;
|
|
2277
|
-
}, [A]), Oa = J(
|
|
2278
|
-
Oa.current =
|
|
2278
|
+
}, [A]), Oa = J(Ar);
|
|
2279
|
+
Oa.current = Ar;
|
|
2279
2280
|
const Di = J(/* @__PURE__ */ new Map()), Fa = ce((e, t, n) => {
|
|
2280
2281
|
const i = `${e}.${t}`;
|
|
2281
2282
|
if (n === null) {
|
|
@@ -2294,10 +2295,10 @@ function jd({
|
|
|
2294
2295
|
}, []), Uc = R(
|
|
2295
2296
|
() => ({ rows: ur, report: Fa }),
|
|
2296
2297
|
[ur, Fa]
|
|
2297
|
-
), [ja, Ps] = T(/* @__PURE__ */ new Map()),
|
|
2298
|
+
), [ja, Ps] = T(/* @__PURE__ */ new Map()), Tr = J(/* @__PURE__ */ new Map()), qa = ce((e, t) => {
|
|
2298
2299
|
if (t === null) {
|
|
2299
|
-
if (!
|
|
2300
|
-
|
|
2300
|
+
if (!Tr.current.has(e)) return;
|
|
2301
|
+
Tr.current.delete(e), Ps((i) => {
|
|
2301
2302
|
if (!i.has(e)) return i;
|
|
2302
2303
|
const r = new Map(i);
|
|
2303
2304
|
return r.delete(e), r;
|
|
@@ -2305,7 +2306,7 @@ function jd({
|
|
|
2305
2306
|
return;
|
|
2306
2307
|
}
|
|
2307
2308
|
const n = JSON.stringify(t);
|
|
2308
|
-
|
|
2309
|
+
Tr.current.get(e) !== n && (Tr.current.set(e, n), Ps((i) => new Map(i).set(e, t)));
|
|
2309
2310
|
}, []), Yc = R(
|
|
2310
2311
|
() => ({ report: qa, byGrid: ja }),
|
|
2311
2312
|
[qa, ja]
|
|
@@ -2320,7 +2321,7 @@ function jd({
|
|
|
2320
2321
|
);
|
|
2321
2322
|
if (!(r != null && r.many_collection) || !r.many_field) continue;
|
|
2322
2323
|
const o = `${r.many_collection}.${r.many_field}`;
|
|
2323
|
-
|
|
2324
|
+
Ar.has(o) && e.push({
|
|
2324
2325
|
key: o,
|
|
2325
2326
|
collection: r.many_collection,
|
|
2326
2327
|
rows: i,
|
|
@@ -2329,17 +2330,17 @@ function jd({
|
|
|
2329
2330
|
}
|
|
2330
2331
|
}
|
|
2331
2332
|
if (!g) return e;
|
|
2332
|
-
for (const t of
|
|
2333
|
+
for (const t of Ar.keys()) {
|
|
2333
2334
|
if (ur.has(t)) continue;
|
|
2334
|
-
const n =
|
|
2335
|
+
const n = Te.get(t) ?? [];
|
|
2335
2336
|
n.length !== 0 && e.push({ key: t, collection: t.split(".")[0], rows: n });
|
|
2336
2337
|
}
|
|
2337
2338
|
return e;
|
|
2338
2339
|
}, [
|
|
2339
2340
|
g,
|
|
2340
|
-
|
|
2341
|
+
Ar,
|
|
2341
2342
|
ur,
|
|
2342
|
-
|
|
2343
|
+
Te,
|
|
2343
2344
|
Se,
|
|
2344
2345
|
bt,
|
|
2345
2346
|
P,
|
|
@@ -2347,7 +2348,7 @@ function jd({
|
|
|
2347
2348
|
]), Aa = R(
|
|
2348
2349
|
() => new Set(fr.filter((e) => e.addendum).map((e) => e.key)),
|
|
2349
2350
|
[fr]
|
|
2350
|
-
), Ls =
|
|
2351
|
+
), Ls = Hr({
|
|
2351
2352
|
queries: fr.map((e) => ({
|
|
2352
2353
|
queryKey: ["field-config", e.collection, null],
|
|
2353
2354
|
queryFn: () => F.request(re(`/field-config/${e.collection}`)).then((t) => t.data ?? []),
|
|
@@ -2370,7 +2371,7 @@ function jd({
|
|
|
2370
2371
|
t.rows.map((l) => {
|
|
2371
2372
|
const d = { ...l };
|
|
2372
2373
|
for (const c of r) {
|
|
2373
|
-
const u =
|
|
2374
|
+
const u = Xm(String(c.computed_formula), d);
|
|
2374
2375
|
u !== null && (d[c.field] = u);
|
|
2375
2376
|
}
|
|
2376
2377
|
return d;
|
|
@@ -2387,19 +2388,19 @@ function jd({
|
|
|
2387
2388
|
const e = /* @__PURE__ */ new Map();
|
|
2388
2389
|
for (const t of A ?? []) {
|
|
2389
2390
|
if (t.computed_type !== "rollup" || !t.computed_formula) continue;
|
|
2390
|
-
const n =
|
|
2391
|
-
if (n && !
|
|
2391
|
+
const n = rp(t.computed_formula);
|
|
2392
|
+
if (n && !ip(I, n)) continue;
|
|
2392
2393
|
const i = new Map(ur);
|
|
2393
2394
|
for (const [o, l] of Ta)
|
|
2394
2395
|
(!i.has(o) || Aa.has(o)) && i.set(o, l);
|
|
2395
|
-
const r =
|
|
2396
|
+
const r = sp(gd(t.computed_formula), i);
|
|
2396
2397
|
r !== null && e.set(t.field, r);
|
|
2397
2398
|
}
|
|
2398
2399
|
return e;
|
|
2399
2400
|
}, [A, ur, Ta, Aa, I]), sn = R(
|
|
2400
2401
|
() => cr ? { ...I, ...cr } : I,
|
|
2401
2402
|
[I, cr]
|
|
2402
|
-
), He = Se !== "original", Tt = He ? "nivaro_addendums" : a, It = He ? Se : m, En = bt.find((e) => e.id === Se), Ks = !!En && ["approved", "reverted"].includes(En.status), { data: Bs } =
|
|
2403
|
+
), He = Se !== "original", Tt = He ? "nivaro_addendums" : a, It = He ? Se : m, En = bt.find((e) => e.id === Se), Ks = !!En && ["approved", "reverted"].includes(En.status), { data: Bs } = st({
|
|
2403
2404
|
queryKey: ["addendum-lines", Se],
|
|
2404
2405
|
queryFn: () => F.request(re(`/addendums/${Se}/lines`)).then((e) => e.data ?? {}),
|
|
2405
2406
|
enabled: Ks,
|
|
@@ -2435,11 +2436,11 @@ function jd({
|
|
|
2435
2436
|
), _e = R(() => {
|
|
2436
2437
|
if (!A) return [];
|
|
2437
2438
|
if (Zt && w === void 0) return [];
|
|
2438
|
-
const e = [...A].sort((r, o) => (r.sort ?? 0) - (o.sort ?? 0)), t = /* @__PURE__ */ new Set(), n = e.filter((r) => t.has(r.field) ? !1 : (t.add(r.field), !0)), i =
|
|
2439
|
+
const e = [...A].sort((r, o) => (r.sort ?? 0) - (o.sort ?? 0)), t = /* @__PURE__ */ new Set(), n = e.filter((r) => t.has(r.field) ? !1 : (t.add(r.field), !0)), i = Ae.active ? n.filter((r) => !Ae.hidden.has(r.field)) : n;
|
|
2439
2440
|
return Ds ? i.filter(
|
|
2440
2441
|
(r) => Ds.has(r.field) || At.has(r.field) || vr(r.field)
|
|
2441
2442
|
) : i;
|
|
2442
|
-
}, [A, Ds, Zt, w,
|
|
2443
|
+
}, [A, Ds, Zt, w, Ae.active, Ae.hidden]), be = R(() => {
|
|
2443
2444
|
const e = (w == null ? void 0 : w.groups) ?? [];
|
|
2444
2445
|
return (K ? e : e.map((n) => Jf(n, Td()))).sort((n, i) => n.sort - i.sort);
|
|
2445
2446
|
}, [w, K]), Mn = R(() => {
|
|
@@ -2452,9 +2453,9 @@ function jd({
|
|
|
2452
2453
|
}
|
|
2453
2454
|
return e;
|
|
2454
2455
|
}, [be]), yn = R(
|
|
2455
|
-
() =>
|
|
2456
|
-
[
|
|
2457
|
-
), Ea =
|
|
2456
|
+
() => Ot.filter((e) => e.one_field && e.one_field in Mn),
|
|
2457
|
+
[Ot, Mn]
|
|
2458
|
+
), Ea = Hr({
|
|
2458
2459
|
queries: yn.map((e) => ({
|
|
2459
2460
|
queryKey: ["field-config", e.many_collection],
|
|
2460
2461
|
queryFn: () => F.request(
|
|
@@ -2475,7 +2476,7 @@ function jd({
|
|
|
2475
2476
|
const l = o.options ? typeof o.options == "string" ? o.options : JSON.stringify(o.options) : null;
|
|
2476
2477
|
l && (e[t.one_field] = { ...i, field_options: l });
|
|
2477
2478
|
}), e;
|
|
2478
|
-
}, [Mn, yn, Ea]), Wi =
|
|
2479
|
+
}, [Mn, yn, Ea]), Wi = Hr({
|
|
2479
2480
|
queries: yn.map((e) => (Mn[e.one_field], {
|
|
2480
2481
|
queryKey: ["o2m-rows", e.many_collection, e.many_field, m],
|
|
2481
2482
|
queryFn: () => F.request(
|
|
@@ -2494,7 +2495,7 @@ function jd({
|
|
|
2494
2495
|
if (!t.one_field || !t.many_collection || !t.many_field) return;
|
|
2495
2496
|
const i = ((h = Wi[n]) == null ? void 0 : h.data) ?? [], r = Ma[t.one_field];
|
|
2496
2497
|
if (!r) return;
|
|
2497
|
-
const o = `${t.many_collection}.${t.many_field}`, l = Ge.get(o) ?? /* @__PURE__ */ new Map(), d = Le.get(o) ?? /* @__PURE__ */ new Set(), c =
|
|
2498
|
+
const o = `${t.many_collection}.${t.many_field}`, l = Ge.get(o) ?? /* @__PURE__ */ new Map(), d = Le.get(o) ?? /* @__PURE__ */ new Set(), c = Te.get(o) ?? [], u = [
|
|
2498
2499
|
...i.filter((_) => !d.has(String(_.id))).map(
|
|
2499
2500
|
(_) => l.has(String(_.id)) ? { ..._, ...l.get(String(_.id)) } : _
|
|
2500
2501
|
),
|
|
@@ -2515,19 +2516,19 @@ function jd({
|
|
|
2515
2516
|
yn,
|
|
2516
2517
|
Wi,
|
|
2517
2518
|
Mn,
|
|
2518
|
-
|
|
2519
|
+
Te,
|
|
2519
2520
|
Ge,
|
|
2520
2521
|
Le
|
|
2521
2522
|
]), su = R(() => {
|
|
2522
2523
|
const e = /* @__PURE__ */ new Set();
|
|
2523
|
-
return
|
|
2524
|
+
return Ot.forEach((t, n) => {
|
|
2524
2525
|
var i;
|
|
2525
2526
|
(i = Pi[n]) != null && i.isLoading && t.one_field && e.add(t.one_field);
|
|
2526
2527
|
}), yn.forEach((t, n) => {
|
|
2527
2528
|
var i;
|
|
2528
2529
|
(i = Wi[n]) != null && i.isLoading && t.one_field && e.add(t.one_field);
|
|
2529
2530
|
}), e;
|
|
2530
|
-
}, [
|
|
2531
|
+
}, [Ot, Pi, yn, Wi]), ou = R(() => {
|
|
2531
2532
|
const e = /* @__PURE__ */ new Map();
|
|
2532
2533
|
for (const t of A ?? []) {
|
|
2533
2534
|
if (t.interface !== "inline-table") continue;
|
|
@@ -2545,7 +2546,7 @@ function jd({
|
|
|
2545
2546
|
!(r != null && r.many_collection) || !(r != null && r.many_field) || e.set(`${r.many_collection}.${r.many_field}`, i);
|
|
2546
2547
|
}
|
|
2547
2548
|
return e;
|
|
2548
|
-
}, [A, P, a]),
|
|
2549
|
+
}, [A, P, a]), Ie = R(() => {
|
|
2549
2550
|
const e = A ? [...A].sort((n, i) => (n.sort ?? 0) - (i.sort ?? 0)) : [], t = {};
|
|
2550
2551
|
for (const n of e)
|
|
2551
2552
|
!n.group_key || vr(n.field) || (t[n.group_key] || (t[n.group_key] = []), t[n.group_key].find((i) => i.field === n.field) || t[n.group_key].push(n));
|
|
@@ -2560,39 +2561,39 @@ function jd({
|
|
|
2560
2561
|
() => _e.filter((e) => At.has(e.field) || e.readonly),
|
|
2561
2562
|
[_e]
|
|
2562
2563
|
);
|
|
2563
|
-
const zi = R(() => be.filter((e) => e.type === "container"), [be]),
|
|
2564
|
+
const zi = R(() => be.filter((e) => e.type === "container"), [be]), Ir = ce(
|
|
2564
2565
|
(e) => ym(e.visible_when, I),
|
|
2565
2566
|
[I]
|
|
2566
2567
|
), wt = R(
|
|
2567
2568
|
() => be.filter(
|
|
2568
|
-
(e) => e.type === "tab" && !e.container_id && (mn ||
|
|
2569
|
+
(e) => e.type === "tab" && !e.container_id && (mn || Ir(e))
|
|
2569
2570
|
),
|
|
2570
|
-
[be,
|
|
2571
|
+
[be, Ir, mn]
|
|
2571
2572
|
), Pn = R(
|
|
2572
2573
|
() => mn ? new Set(
|
|
2573
|
-
wt.filter((e) => !
|
|
2574
|
+
wt.filter((e) => !Ir(e)).map((e) => e.key)
|
|
2574
2575
|
) : void 0,
|
|
2575
|
-
[mn, wt,
|
|
2576
|
+
[mn, wt, Ir]
|
|
2576
2577
|
), Pa = R(
|
|
2577
2578
|
() => be.filter((e) => e.type === "tab").sort((e, t) => e.sort - t.sort),
|
|
2578
2579
|
[be]
|
|
2579
2580
|
), kt = R(
|
|
2580
2581
|
() => be.filter((e) => e.type === "section" || e.type === "metadata"),
|
|
2581
2582
|
[be]
|
|
2582
|
-
), La = zi.length > 0,
|
|
2583
|
+
), La = zi.length > 0, it = wt.length > 0, Y = w == null ? void 0 : w.layout, Ln = Y ? !!Y.ai_enabled : !0, Er = R(() => Tf(Y), [Y]), on = Hp({
|
|
2583
2584
|
collection: a,
|
|
2584
2585
|
layoutId: (Y == null ? void 0 : Y.id) ?? null,
|
|
2585
2586
|
userId: Re,
|
|
2586
|
-
config:
|
|
2587
|
-
hasTabs:
|
|
2587
|
+
config: Er,
|
|
2588
|
+
hasTabs: it || La,
|
|
2588
2589
|
enabled: !K
|
|
2589
|
-
}), Ws = (e) => on.mode && (e.tab_mode === "steps" || e.tab_mode === "tabs") ? on.mode === "beginner" : e.tab_mode === "steps", Et =
|
|
2590
|
+
}), Ws = (e) => on.mode && (e.tab_mode === "steps" || e.tab_mode === "tabs") ? on.mode === "beginner" : e.tab_mode === "steps", Et = it && (on.mode ? on.mode === "beginner" : (Y == null ? void 0 : Y.tab_mode) === "steps"), au = !!(Y != null && Y.validate_before_next), Kn = !!(Y != null && Y.summary_enabled), lu = !!(Y != null && Y.summary_hide_empty), du = Y ? !Y.disable_revisions && ti : ti, Bn = Y ? !Y.disable_comments && ye : ye, Dn = Y ? !Y.disable_tasks && gt : gt, cu = Y ? !Y.disable_clone && ni : ni, uu = Y ? !Y.disable_delete : !0, Vi = !!(Y != null && Y.accordion_mode), [_n, Ji] = T(
|
|
2590
2591
|
() => K ? wd(Re) ?? !1 : !1
|
|
2591
2592
|
), [zs, fu] = T(null), Ka = J(!1);
|
|
2592
2593
|
Z(() => {
|
|
2593
2594
|
if (!K || !Kn || !zs || Ka.current) return;
|
|
2594
2595
|
const e = zs.clientWidth;
|
|
2595
|
-
e && (Ka.current = !0, wd(Re) === null && e - 256 <
|
|
2596
|
+
e && (Ka.current = !0, wd(Re) === null && e - 256 < rg && Ji(!0));
|
|
2596
2597
|
}, [K, Kn, zs, Re]);
|
|
2597
2598
|
const [mu, Ba] = T(null), [Da, Wa] = T(/* @__PURE__ */ new Set()), [pu, gu] = T(() => /* @__PURE__ */ new Set()), Vs = J(!1);
|
|
2598
2599
|
Z(() => {
|
|
@@ -2614,9 +2615,9 @@ function jd({
|
|
|
2614
2615
|
}, 300);
|
|
2615
2616
|
}, 1200));
|
|
2616
2617
|
}, Va = R(() => {
|
|
2617
|
-
const e = Vf(w == null ? void 0 : w.layout,
|
|
2618
|
+
const e = Vf(w == null ? void 0 : w.layout, $t);
|
|
2618
2619
|
return Qn && !K ? e : { schedule: !1, disablePickers: !1 };
|
|
2619
|
-
}, [w == null ? void 0 : w.layout,
|
|
2620
|
+
}, [w == null ? void 0 : w.layout, $t, Qn, K]), hu = R(
|
|
2620
2621
|
() => _e.filter((e) => !e.hidden && e.type !== "alias").map((e) => ({ field: e.field, label: e.label })),
|
|
2621
2622
|
[_e]
|
|
2622
2623
|
), Ja = R(() => {
|
|
@@ -2704,7 +2705,7 @@ function jd({
|
|
|
2704
2705
|
var l;
|
|
2705
2706
|
if (document.querySelector(`[data-field="${e}"]`))
|
|
2706
2707
|
return Qi(e), !0;
|
|
2707
|
-
const n = (l = Object.entries(
|
|
2708
|
+
const n = (l = Object.entries(Ie).find(
|
|
2708
2709
|
([, d]) => d.some((c) => c.field === e)
|
|
2709
2710
|
)) == null ? void 0 : l[0];
|
|
2710
2711
|
if (!n) return !1;
|
|
@@ -2714,7 +2715,7 @@ function jd({
|
|
|
2714
2715
|
if (i.type === "tab" && i.container_id != null) {
|
|
2715
2716
|
const d = be.find((c) => c.id === i.container_id);
|
|
2716
2717
|
d && (Wn(d, n), r = !0);
|
|
2717
|
-
} else i.type === "tab" && le.some((d) => d.key === n) ? (
|
|
2718
|
+
} else i.type === "tab" && le.some((d) => d.key === n) ? (xt(n), r = !0) : (i.type === "section" || i.type === "metadata") && it && le.some((d) => d.key === "__general__") && (xt("__general__"), r = !0);
|
|
2718
2719
|
if (!r) return !1;
|
|
2719
2720
|
const o = (d) => {
|
|
2720
2721
|
if (document.querySelector(`[data-field="${e}"]`)) {
|
|
@@ -2808,8 +2809,8 @@ ${window.location.href}
|
|
|
2808
2809
|
${i.join(`
|
|
2809
2810
|
`)}`;
|
|
2810
2811
|
await navigator.clipboard.writeText(o).then(
|
|
2811
|
-
() =>
|
|
2812
|
-
() =>
|
|
2812
|
+
() => je.success("Summary copied"),
|
|
2813
|
+
() => je.error("Could not copy")
|
|
2813
2814
|
);
|
|
2814
2815
|
}, Ha = J(!1);
|
|
2815
2816
|
Z(() => {
|
|
@@ -2819,7 +2820,7 @@ ${i.join(`
|
|
|
2819
2820
|
Gi.current = bn;
|
|
2820
2821
|
const Qs = J(() => !1);
|
|
2821
2822
|
Qs.current = (e, t, n = !1) => {
|
|
2822
|
-
const i =
|
|
2823
|
+
const i = Ot.find((h) => h.many_collection === e);
|
|
2823
2824
|
if (!(i != null && i.one_field) || !i.many_field) return !1;
|
|
2824
2825
|
const r = { collection: e, field: i.many_field, rowId: t };
|
|
2825
2826
|
let o = 0, l = !1;
|
|
@@ -2862,7 +2863,7 @@ ${i.join(`
|
|
|
2862
2863
|
if (!e) return;
|
|
2863
2864
|
const t = e.indexOf(":");
|
|
2864
2865
|
t < 1 || Qs.current(e.slice(0, t), e.slice(t + 1)) && (Ua.current = !0);
|
|
2865
|
-
}, [
|
|
2866
|
+
}, [Ot, g]), Z(() => {
|
|
2866
2867
|
if (g || typeof window > "u") return;
|
|
2867
2868
|
const e = (t) => {
|
|
2868
2869
|
const n = t.detail;
|
|
@@ -2893,7 +2894,7 @@ ${i.join(`
|
|
|
2893
2894
|
const i = n.get(e.id) ?? /* @__PURE__ */ new Set();
|
|
2894
2895
|
return i.has(t) ? n : new Map(n).set(e.id, /* @__PURE__ */ new Set([...i, t]));
|
|
2895
2896
|
});
|
|
2896
|
-
}, [
|
|
2897
|
+
}, [Fe, Za] = T(() => {
|
|
2897
2898
|
var e;
|
|
2898
2899
|
try {
|
|
2899
2900
|
return localStorage.getItem(`nvr_tab_${a}`) ?? ((e = wt[0]) == null ? void 0 : e.key) ?? "__general__";
|
|
@@ -2915,15 +2916,15 @@ ${i.join(`
|
|
|
2915
2916
|
const e = tl.current;
|
|
2916
2917
|
if (!e) return;
|
|
2917
2918
|
const t = () => {
|
|
2918
|
-
const i = e.querySelector(`[data-tab-key="${CSS.escape(
|
|
2919
|
+
const i = e.querySelector(`[data-tab-key="${CSS.escape(Fe)}"]`);
|
|
2919
2920
|
if (!i) return nl(null);
|
|
2920
2921
|
nl({ left: i.offsetLeft, width: i.offsetWidth });
|
|
2921
2922
|
};
|
|
2922
2923
|
t();
|
|
2923
2924
|
const n = typeof ResizeObserver < "u" ? new ResizeObserver(t) : null;
|
|
2924
2925
|
return n == null || n.observe(e), () => n == null ? void 0 : n.disconnect();
|
|
2925
|
-
}, [
|
|
2926
|
-
const
|
|
2926
|
+
}, [Fe]);
|
|
2927
|
+
const xt = (e) => {
|
|
2927
2928
|
if (Za(e), el((t) => {
|
|
2928
2929
|
if (t.has(e)) return t;
|
|
2929
2930
|
const n = new Set(t);
|
|
@@ -2942,26 +2943,33 @@ ${i.join(`
|
|
|
2942
2943
|
} catch {
|
|
2943
2944
|
}
|
|
2944
2945
|
Us();
|
|
2945
|
-
}
|
|
2946
|
+
};
|
|
2947
|
+
bm({
|
|
2948
|
+
collection: a,
|
|
2949
|
+
itemId: g || K || !wr ? null : String(m),
|
|
2950
|
+
step: it ? Fe : null,
|
|
2951
|
+
setStep: xt
|
|
2952
|
+
});
|
|
2953
|
+
const xu = Mp({
|
|
2946
2954
|
enabled: !K,
|
|
2947
2955
|
layoutId: yt != null ? Number(yt) : null,
|
|
2948
2956
|
collection: a,
|
|
2949
2957
|
itemId: g ? null : String(m),
|
|
2950
|
-
step:
|
|
2958
|
+
step: it ? Fe : "__form__"
|
|
2951
2959
|
});
|
|
2952
2960
|
function Us() {
|
|
2953
2961
|
const e = za.current;
|
|
2954
2962
|
typeof (e == null ? void 0 : e.scrollTo) == "function" && e.scrollTo({ top: 0 });
|
|
2955
2963
|
}
|
|
2956
2964
|
const le = R(() => {
|
|
2957
|
-
if (!
|
|
2965
|
+
if (!it) return [];
|
|
2958
2966
|
const e = [];
|
|
2959
2967
|
(Et ? vt.length > 0 : kt.length > 0) && e.push({ key: "__general__", label: "General" });
|
|
2960
2968
|
for (const t of wt) e.push({ key: t.key, label: t.label });
|
|
2961
2969
|
return e;
|
|
2962
|
-
}, [
|
|
2970
|
+
}, [it, kt, wt, Et, vt]), rl = (e) => {
|
|
2963
2971
|
if (e === null || e === "__ungrouped__") {
|
|
2964
|
-
Et && le.some((n) => n.key === "__general__") &&
|
|
2972
|
+
Et && le.some((n) => n.key === "__general__") && xt("__general__");
|
|
2965
2973
|
return;
|
|
2966
2974
|
}
|
|
2967
2975
|
const t = be.find((n) => n.key === e);
|
|
@@ -2969,35 +2977,35 @@ ${i.join(`
|
|
|
2969
2977
|
if (t.type === "tab" && t.container_id != null) {
|
|
2970
2978
|
const n = be.find((i) => i.id === t.container_id);
|
|
2971
2979
|
n && Wn(n, e);
|
|
2972
|
-
} else t.type === "tab" && le.some((n) => n.key === e) ?
|
|
2980
|
+
} else t.type === "tab" && le.some((n) => n.key === e) ? Fe !== e && xt(e) : (t.type === "section" || t.type === "metadata") && !Et && le.some((n) => n.key === "__general__") && Fe !== "__general__" && xt("__general__");
|
|
2973
2981
|
}, il = J(rl);
|
|
2974
2982
|
il.current = rl;
|
|
2975
|
-
const
|
|
2983
|
+
const Mr = (Qe == null ? void 0 : Qe.reveal) ?? null;
|
|
2976
2984
|
Z(() => {
|
|
2977
|
-
|
|
2978
|
-
}, [
|
|
2985
|
+
Mr && il.current(tg(Mr.target));
|
|
2986
|
+
}, [Mr == null ? void 0 : Mr.seq]);
|
|
2979
2987
|
const Ys = K && !!((Bl = Qe == null ? void 0 : Qe.fold) != null && Bl.open), sl = R(() => {
|
|
2980
|
-
const e = Object.keys(
|
|
2988
|
+
const e = Object.keys(at);
|
|
2981
2989
|
if (e.length === 0) return [];
|
|
2982
2990
|
const t = (l) => {
|
|
2983
2991
|
var u;
|
|
2984
|
-
const d = (u = Object.entries(
|
|
2992
|
+
const d = (u = Object.entries(Ie).find(
|
|
2985
2993
|
([, f]) => f.some((h) => h.field === l)
|
|
2986
2994
|
)) == null ? void 0 : u[0];
|
|
2987
|
-
if (!d) return
|
|
2995
|
+
if (!d) return it ? "General" : null;
|
|
2988
2996
|
const c = be.find((f) => f.key === d);
|
|
2989
|
-
return c ? c.type === "tab" ? c.label ?? null :
|
|
2997
|
+
return c ? c.type === "tab" ? c.label ?? null : it && le.some((f) => f.key === "__general__") ? "General" : c.label ?? null : null;
|
|
2990
2998
|
}, n = /* @__PURE__ */ new Map();
|
|
2991
2999
|
let i = 0;
|
|
2992
|
-
const r =
|
|
3000
|
+
const r = it ? le.map((l) => l.key) : [], o = [
|
|
2993
3001
|
...r.filter((l) => l !== "__general__"),
|
|
2994
|
-
...Object.keys(
|
|
3002
|
+
...Object.keys(Ie).filter((l) => !r.includes(l))
|
|
2995
3003
|
];
|
|
2996
3004
|
for (const l of o)
|
|
2997
|
-
for (const d of
|
|
3005
|
+
for (const d of Ie[l] ?? []) n.has(d.field) || n.set(d.field, i++);
|
|
2998
3006
|
for (const l of _e) n.has(l.field) || n.set(l.field, i++);
|
|
2999
3007
|
return e.sort((l, d) => (n.get(l) ?? 1e9) - (n.get(d) ?? 1e9)).map((l) => {
|
|
3000
|
-
const d = _e.find((u) => u.field === l), c =
|
|
3008
|
+
const d = _e.find((u) => u.field === l), c = at[l];
|
|
3001
3009
|
return {
|
|
3002
3010
|
field: l,
|
|
3003
3011
|
label: (d == null ? void 0 : d.label) || ke(l),
|
|
@@ -3005,17 +3013,17 @@ ${i.join(`
|
|
|
3005
3013
|
location: t(l)
|
|
3006
3014
|
};
|
|
3007
3015
|
});
|
|
3008
|
-
}, [
|
|
3016
|
+
}, [at, _e, Ie, be, it, le]), ol = J(!1);
|
|
3009
3017
|
Z(() => {
|
|
3010
|
-
if (!(ol.current || !
|
|
3018
|
+
if (!(ol.current || !it))
|
|
3011
3019
|
try {
|
|
3012
3020
|
const e = new URL(window.location.href).searchParams.get("step");
|
|
3013
3021
|
e && le.some((t) => t.key === e) && (ol.current = !0, Za(e), el((t) => /* @__PURE__ */ new Set([...t, e])));
|
|
3014
3022
|
} catch {
|
|
3015
3023
|
}
|
|
3016
|
-
}, [
|
|
3017
|
-
!
|
|
3018
|
-
}, [
|
|
3024
|
+
}, [it, le]), Z(() => {
|
|
3025
|
+
!it || le.length === 0 || le.some((e) => e.key === Fe) || xt(le[0].key);
|
|
3026
|
+
}, [it, le, Fe]);
|
|
3019
3027
|
const al = J(!1);
|
|
3020
3028
|
Z(() => {
|
|
3021
3029
|
var n;
|
|
@@ -3037,9 +3045,9 @@ ${i.join(`
|
|
|
3037
3045
|
return l != null && l !== "" && l !== !1;
|
|
3038
3046
|
});
|
|
3039
3047
|
};
|
|
3040
|
-
if (al.current = !0, Et && le.length > 0 && t(wt.find((i) => i.key ===
|
|
3048
|
+
if (al.current = !0, Et && le.length > 0 && t(wt.find((i) => i.key === Fe))) {
|
|
3041
3049
|
const i = le.find((r) => !t(wt.find((o) => o.key === r.key)));
|
|
3042
|
-
i && i.key !==
|
|
3050
|
+
i && i.key !== Fe && xt(i.key);
|
|
3043
3051
|
}
|
|
3044
3052
|
for (const i of be.filter((r) => r.type === "container" && Ws(r))) {
|
|
3045
3053
|
const r = be.filter((c) => c.type === "tab" && c.container_id === i.id).sort((c, u) => c.sort - u.sort);
|
|
@@ -3049,24 +3057,24 @@ ${i.join(`
|
|
|
3049
3057
|
const d = r.find((c) => !t(c));
|
|
3050
3058
|
d && d.key !== o && Ya((c) => new Map(c).set(i.id, d.key));
|
|
3051
3059
|
}
|
|
3052
|
-
}, [g, Et, ue, le, wt,
|
|
3060
|
+
}, [g, Et, ue, le, wt, Fe, be, Gs]);
|
|
3053
3061
|
const Su = R(() => {
|
|
3054
3062
|
const e = /* @__PURE__ */ new Set();
|
|
3055
3063
|
if (!Xe) return e;
|
|
3056
3064
|
for (const t of le)
|
|
3057
|
-
(
|
|
3065
|
+
(Ie[t.key] ?? []).some((i) => Ze.current.has(i.field)) && e.add(t.key);
|
|
3058
3066
|
return e;
|
|
3059
|
-
}, [Xe, le,
|
|
3067
|
+
}, [Xe, le, Ie, I]), Nu = R(() => {
|
|
3060
3068
|
const e = /* @__PURE__ */ new Set();
|
|
3061
3069
|
for (const t of le) {
|
|
3062
3070
|
if (g && !Xa.has(t.key)) continue;
|
|
3063
|
-
(t.key === "__general__" ? Et ? vt : [...vt, ...kt.flatMap((r) =>
|
|
3071
|
+
(t.key === "__general__" ? Et ? vt : [...vt, ...kt.flatMap((r) => Ie[r.key] ?? [])] : Ie[t.key] ?? []).filter((r) => r.required && !r.hidden).every((r) => {
|
|
3064
3072
|
if (fe.has(r.field)) {
|
|
3065
3073
|
const l = Ne[r.field];
|
|
3066
3074
|
return !l || l.ids.length > 0;
|
|
3067
3075
|
}
|
|
3068
3076
|
if (nn.has(r.field)) {
|
|
3069
|
-
const l =
|
|
3077
|
+
const l = Ft[r.field];
|
|
3070
3078
|
return l === void 0 || l > 0;
|
|
3071
3079
|
}
|
|
3072
3080
|
const o = I[r.field];
|
|
@@ -3078,7 +3086,7 @@ ${i.join(`
|
|
|
3078
3086
|
le,
|
|
3079
3087
|
vt,
|
|
3080
3088
|
kt,
|
|
3081
|
-
|
|
3089
|
+
Ie,
|
|
3082
3090
|
I,
|
|
3083
3091
|
g,
|
|
3084
3092
|
Xa,
|
|
@@ -3086,11 +3094,11 @@ ${i.join(`
|
|
|
3086
3094
|
fe,
|
|
3087
3095
|
Ne,
|
|
3088
3096
|
nn,
|
|
3089
|
-
|
|
3097
|
+
Ft
|
|
3090
3098
|
]);
|
|
3091
3099
|
function $u() {
|
|
3092
3100
|
if (au) {
|
|
3093
|
-
const t =
|
|
3101
|
+
const t = Fe === "__general__" ? Et ? vt : [...vt, ...kt.flatMap((i) => Ie[i.key] ?? [])] : Ie[Fe] ?? [], n = {};
|
|
3094
3102
|
for (const i of t)
|
|
3095
3103
|
if (i.required && !i.hidden) {
|
|
3096
3104
|
const r = I[i.field];
|
|
@@ -3101,8 +3109,8 @@ ${i.join(`
|
|
|
3101
3109
|
return;
|
|
3102
3110
|
}
|
|
3103
3111
|
}
|
|
3104
|
-
const e = le.findIndex((t) => t.key ===
|
|
3105
|
-
e < le.length - 1 &&
|
|
3112
|
+
const e = le.findIndex((t) => t.key === Fe);
|
|
3113
|
+
e < le.length - 1 && xt(le[e + 1].key);
|
|
3106
3114
|
}
|
|
3107
3115
|
const ve = Ke.find((e) => e.field === "__pipeline__"), ll = R(() => {
|
|
3108
3116
|
try {
|
|
@@ -3111,7 +3119,7 @@ ${i.join(`
|
|
|
3111
3119
|
} catch {
|
|
3112
3120
|
return {};
|
|
3113
3121
|
}
|
|
3114
|
-
}, [ve]), Be = Ke.find((e) => e.field === "__comments__"), De = Ke.find((e) => e.field === "__tasks__"), jt = Ke.find((e) => e.field === "__addendums__"), zt = Ke.find((e) => e.field === "__referenced_by__"), Vt = Ke.find((e) => e.field === "__related_records__"),
|
|
3122
|
+
}, [ve]), Be = Ke.find((e) => e.field === "__comments__"), De = Ke.find((e) => e.field === "__tasks__"), jt = Ke.find((e) => e.field === "__addendums__"), zt = Ke.find((e) => e.field === "__referenced_by__"), Vt = Ke.find((e) => e.field === "__related_records__"), Pr = Ke.filter(
|
|
3115
3123
|
(e) => e.field.startsWith("__widget_") && e.field.endsWith("__") && e.widget_id != null
|
|
3116
3124
|
), We = Ke.find((e) => e.field === "__owners__"), xe = Ke.find((e) => e.field === "__pdf__"), ct = xe ? (() => {
|
|
3117
3125
|
try {
|
|
@@ -3119,7 +3127,7 @@ ${i.join(`
|
|
|
3119
3127
|
} catch {
|
|
3120
3128
|
return {};
|
|
3121
3129
|
}
|
|
3122
|
-
})() : null, Qt = (ct == null ? void 0 : ct.attach_to_field) ?? null, dl = (ct == null ? void 0 : ct.filename_template) ?? null, mr = (xe == null ? void 0 : xe.group_key) ?? null,
|
|
3130
|
+
})() : null, Qt = (ct == null ? void 0 : ct.attach_to_field) ?? null, dl = (ct == null ? void 0 : ct.filename_template) ?? null, mr = (xe == null ? void 0 : xe.group_key) ?? null, Lr = !!(mr && be.some((e) => e.key === mr)), Cu = (ct == null ? void 0 : ct.source_layout_id) ?? null, Hi = !!(ct != null && ct.auto_generate_on_save), Ru = (ct == null ? void 0 : ct.overwrite_generated) !== !1, vn = async (e) => {
|
|
3123
3131
|
const t = (e == null ? void 0 : e.itemId) ?? m, n = (e == null ? void 0 : e.attachField) ?? Qt, i = (e == null ? void 0 : e.sourceLayoutId) ?? Cu ?? yt;
|
|
3124
3132
|
if (!(Cn || !n || !i || !t)) {
|
|
3125
3133
|
Po(!0);
|
|
@@ -3145,9 +3153,9 @@ ${i.join(`
|
|
|
3145
3153
|
}
|
|
3146
3154
|
);
|
|
3147
3155
|
if (!o.ok) throw new Error(await o.text());
|
|
3148
|
-
e != null && e.silent ||
|
|
3156
|
+
e != null && e.silent || je.success("PDF generated and attached"), de.invalidateQueries({ queryKey: ["m2m-items"] }), de.invalidateQueries({ queryKey: ["items", a, m] }), e != null && e.addendumId && de.invalidateQueries({ queryKey: ["addendums", a, m] });
|
|
3149
3157
|
} catch {
|
|
3150
|
-
e != null && e.silent ? console.warn("[pdf] automatic regeneration failed") :
|
|
3158
|
+
e != null && e.silent ? console.warn("[pdf] automatic regeneration failed") : je.error("Failed to generate and attach PDF");
|
|
3151
3159
|
} finally {
|
|
3152
3160
|
Po(!1);
|
|
3153
3161
|
}
|
|
@@ -3166,8 +3174,8 @@ ${i.join(`
|
|
|
3166
3174
|
replaceGenerated: t.overwrite_generated !== !1,
|
|
3167
3175
|
filenameTemplate: t.filename_template ?? null
|
|
3168
3176
|
});
|
|
3169
|
-
}, pr = (We == null ? void 0 : We.group_key) ?? null,
|
|
3170
|
-
|
|
3177
|
+
}, pr = (We == null ? void 0 : We.group_key) ?? null, Kr = !!(pr && be.some((e) => e.key === pr)), Ou = () => /* @__PURE__ */ s(
|
|
3178
|
+
_g,
|
|
3171
3179
|
{
|
|
3172
3180
|
collection: Tt,
|
|
3173
3181
|
item: It,
|
|
@@ -3215,7 +3223,7 @@ ${i.join(`
|
|
|
3215
3223
|
}, [w]), Zs = R(
|
|
3216
3224
|
() => new Set(((nt == null ? void 0 : nt.fields) ?? []).map((e) => e.field)),
|
|
3217
3225
|
[nt]
|
|
3218
|
-
),
|
|
3226
|
+
), Br = R(() => {
|
|
3219
3227
|
var e, t;
|
|
3220
3228
|
if (!nt) return null;
|
|
3221
3229
|
for (const n of nt.fields) {
|
|
@@ -3224,9 +3232,9 @@ ${i.join(`
|
|
|
3224
3232
|
return i;
|
|
3225
3233
|
}
|
|
3226
3234
|
return null;
|
|
3227
|
-
}, [nt, A]), Xs =
|
|
3235
|
+
}, [nt, A]), Xs = Fm({
|
|
3228
3236
|
collection: a,
|
|
3229
|
-
field:
|
|
3237
|
+
field: Br,
|
|
3230
3238
|
draft: I,
|
|
3231
3239
|
itemId: m,
|
|
3232
3240
|
staging: ge
|
|
@@ -3234,12 +3242,12 @@ ${i.join(`
|
|
|
3234
3242
|
if (!nt) return [];
|
|
3235
3243
|
const e = ue ?? I;
|
|
3236
3244
|
return nt.fields.map((t) => {
|
|
3237
|
-
const n = t.field === (
|
|
3245
|
+
const n = t.field === (Br == null ? void 0 : Br.field);
|
|
3238
3246
|
if (g && !n) return null;
|
|
3239
3247
|
let i = e[t.field];
|
|
3240
3248
|
return n && Xs && (i = Xs), i == null || i === "" ? null : { value: String(i), color: t.color, weight: t.weight, display_as: t.display_as };
|
|
3241
3249
|
}).filter(Boolean);
|
|
3242
|
-
}, [nt, g, ue, I,
|
|
3250
|
+
}, [nt, g, ue, I, Br, Xs]), Fu = Hf(6e4, { enabled: !g }), { data: Ee } = st({
|
|
3243
3251
|
queryKey: ["last-touch", a, String(m)],
|
|
3244
3252
|
queryFn: () => F.request(re(`/last-touch/${a}/${encodeURIComponent(String(m))}`)).then((e) => e.data ?? null).catch(() => null),
|
|
3245
3253
|
enabled: !g && !!m,
|
|
@@ -3247,7 +3255,7 @@ ${i.join(`
|
|
|
3247
3255
|
// The stale-record banner rides this read — one indexed row a minute without a live
|
|
3248
3256
|
// socket, paused while the tab is hidden (react-query default).
|
|
3249
3257
|
refetchInterval: Fu
|
|
3250
|
-
}), [ju,
|
|
3258
|
+
}), [ju, Dr] = T(!1), [qu, cl] = T(!1), [Au, ul] = T(!1), [Tu, Iu] = T(null), [Wr, fl] = T(""), [ml, pl] = T(!1), [gl, hl] = T(!1), me = R(() => {
|
|
3251
3259
|
var c;
|
|
3252
3260
|
const e = (((c = w == null ? void 0 : w.assignments) == null ? void 0 : c.length) ?? 0) > 0 ? new Set(
|
|
3253
3261
|
((w == null ? void 0 : w.assignments) ?? []).filter((u) => !(u.is_visible === 0 || u.is_visible === !1)).map((u) => u.field)
|
|
@@ -3255,12 +3263,12 @@ ${i.join(`
|
|
|
3255
3263
|
if (u.hidden || u.readonly || ko(u, I) || u.layout_assigned === !1 || e && !e.has(u.field) || u.field.startsWith("__") || u.field.includes(".")) return !1;
|
|
3256
3264
|
const f = u.options;
|
|
3257
3265
|
return !(f && typeof f == "object" && f.auto_id);
|
|
3258
|
-
}), n = t.filter((u) => u.required), i = t.filter((u) =>
|
|
3266
|
+
}), n = t.filter((u) => u.required), i = t.filter((u) => yp(u));
|
|
3259
3267
|
if (n.length === 0 && i.length === 0) return null;
|
|
3260
3268
|
const r = (u) => {
|
|
3261
3269
|
var _;
|
|
3262
3270
|
if (fe.get(u.field)) return (((_ = Ne[u.field]) == null ? void 0 : _.ids) ?? []).length > 0;
|
|
3263
|
-
if (nn.has(u.field)) return (
|
|
3271
|
+
if (nn.has(u.field)) return (Ft[u.field] ?? 1) > 0;
|
|
3264
3272
|
const h = I[u.field];
|
|
3265
3273
|
return h != null && h !== "" && h !== !1;
|
|
3266
3274
|
}, o = n.filter(r), l = n.filter((u) => !r(u)), d = i.filter((u) => !r(u));
|
|
@@ -3281,22 +3289,22 @@ ${i.join(`
|
|
|
3281
3289
|
Ne,
|
|
3282
3290
|
w,
|
|
3283
3291
|
nn,
|
|
3284
|
-
|
|
3285
|
-
]), { data:
|
|
3292
|
+
Ft
|
|
3293
|
+
]), { data: St } = st({
|
|
3286
3294
|
queryKey: ["provenance", a, String(m)],
|
|
3287
3295
|
queryFn: () => F.request(re(`/provenance/${a}/${encodeURIComponent(String(m))}`)).then((e) => e.data).catch(() => null),
|
|
3288
3296
|
enabled: !g && !!m,
|
|
3289
3297
|
staleTime: 5 * 6e4
|
|
3290
|
-
}),
|
|
3298
|
+
}), zr = J(null), [yl, eo] = T(null);
|
|
3291
3299
|
Go.current = Ee ?? null, Z(() => {
|
|
3292
3300
|
if (!(g || !Ee)) {
|
|
3293
|
-
if (
|
|
3294
|
-
|
|
3301
|
+
if (zr.current === null) {
|
|
3302
|
+
zr.current = Ee.timestamp;
|
|
3295
3303
|
return;
|
|
3296
3304
|
}
|
|
3297
|
-
if (!(Ee.timestamp <=
|
|
3305
|
+
if (!(Ee.timestamp <= zr.current)) {
|
|
3298
3306
|
if (!Ee.user_id || Ee.user_id === Re) {
|
|
3299
|
-
|
|
3307
|
+
zr.current = Ee.timestamp, eo(null);
|
|
3300
3308
|
return;
|
|
3301
3309
|
}
|
|
3302
3310
|
eo(Ee.user_name ?? "Someone else");
|
|
@@ -3304,7 +3312,7 @@ ${i.join(`
|
|
|
3304
3312
|
}
|
|
3305
3313
|
}, [Ee, g, Re]);
|
|
3306
3314
|
const Eu = ce(() => {
|
|
3307
|
-
Ee && (
|
|
3315
|
+
Ee && (zr.current = Ee.timestamp), eo(null), de.invalidateQueries({ queryKey: ["item", a, m] }), de.invalidateQueries({ queryKey: ["o2m-rows"] }), de.invalidateQueries({ queryKey: ["pipeline", a, String(m)] });
|
|
3308
3316
|
}, [Ee, de, a, m]), _l = R(() => {
|
|
3309
3317
|
if (!Ee) return null;
|
|
3310
3318
|
const e = Date.now() - new Date(Ee.timestamp).getTime(), t = Math.floor(e / 6e4), n = t < 1 ? "just now" : t < 60 ? `${t}m ago` : t < 2880 ? `${Math.floor(t / 60)}h ago` : `${Math.floor(t / 1440)}d ago`;
|
|
@@ -3368,7 +3376,7 @@ ${i.join(`
|
|
|
3368
3376
|
Z(() => {
|
|
3369
3377
|
as && as(Yi);
|
|
3370
3378
|
}, [Yi, as]);
|
|
3371
|
-
const
|
|
3379
|
+
const Vr = R(() => {
|
|
3372
3380
|
const e = (n) => !(n && (n.is_visible === 0 || n.is_visible === !1)), t = [
|
|
3373
3381
|
...kt.map((n) => ({ item: n, sort: n.sort, tie: 0 })),
|
|
3374
3382
|
// Container groups sit alongside section groups in the order
|
|
@@ -3382,8 +3390,8 @@ ${i.join(`
|
|
|
3382
3390
|
Je && ve ? ve.sort : null,
|
|
3383
3391
|
Dn && De ? De.sort : null,
|
|
3384
3392
|
Bn && Be ? Be.sort : null,
|
|
3385
|
-
Je && We && !
|
|
3386
|
-
xe && !g && !
|
|
3393
|
+
Je && We && !Kr ? We.sort : null,
|
|
3394
|
+
xe && !g && !Lr ? xe.sort : null
|
|
3387
3395
|
].filter((o) => o !== null), r = i.length > 0 ? Math.min(...i) : 1 / 0;
|
|
3388
3396
|
if (isFinite(r) && n >= r) return r - 0.5;
|
|
3389
3397
|
}
|
|
@@ -3392,7 +3400,7 @@ ${i.join(`
|
|
|
3392
3400
|
tie: 1
|
|
3393
3401
|
}
|
|
3394
3402
|
];
|
|
3395
|
-
Je && ve && e(ve) && t.push({ item: "__pipeline__", sort: ve.sort, tie: 2 }), Dn && De && e(De) && t.push({ item: "__tasks__", sort: De.sort, tie: 3 }), Bn && Be && e(Be) && t.push({ item: "__comments__", sort: Be.sort, tie: 4 }), N != null && N.addendums_enabled && !g && jt && e(jt) && t.push({ item: "__addendums__", sort: jt.sort, tie: 7 }), !g && zt && e(zt) && t.push({ item: "__referenced_by__", sort: zt.sort, tie: 8 }), !g && Vt && e(Vt) && t.push({ item: "__related_records__", sort: Vt.sort, tie: 9 }), Je && We && e(We) && !
|
|
3403
|
+
Je && ve && e(ve) && t.push({ item: "__pipeline__", sort: ve.sort, tie: 2 }), Dn && De && e(De) && t.push({ item: "__tasks__", sort: De.sort, tie: 3 }), Bn && Be && e(Be) && t.push({ item: "__comments__", sort: Be.sort, tie: 4 }), N != null && N.addendums_enabled && !g && jt && e(jt) && t.push({ item: "__addendums__", sort: jt.sort, tie: 7 }), !g && zt && e(zt) && t.push({ item: "__referenced_by__", sort: zt.sort, tie: 8 }), !g && Vt && e(Vt) && t.push({ item: "__related_records__", sort: Vt.sort, tie: 9 }), Je && We && e(We) && !Kr && pr !== "__header__" && t.push({ item: "__owners__", sort: We.sort, tie: 5 }), xe && e(xe) && !g && !Lr && t.push({ item: "__pdf__", sort: xe.sort, tie: 6 });
|
|
3396
3404
|
for (const n of Ke)
|
|
3397
3405
|
ud(n.field) && e(n) && t.push({ item: n.field, sort: n.sort, tie: 8 });
|
|
3398
3406
|
return t.sort((n, i) => n.sort - i.sort || n.tie - i.tie).map((n) => n.item);
|
|
@@ -3405,12 +3413,12 @@ ${i.join(`
|
|
|
3405
3413
|
De,
|
|
3406
3414
|
jt,
|
|
3407
3415
|
We,
|
|
3408
|
-
|
|
3416
|
+
Kr,
|
|
3409
3417
|
Je,
|
|
3410
3418
|
Bn,
|
|
3411
3419
|
Dn,
|
|
3412
3420
|
xe,
|
|
3413
|
-
|
|
3421
|
+
Lr,
|
|
3414
3422
|
g,
|
|
3415
3423
|
Zs,
|
|
3416
3424
|
N == null ? void 0 : N.addendums_enabled,
|
|
@@ -3429,7 +3437,7 @@ ${i.join(`
|
|
|
3429
3437
|
const n = Ne[t.field];
|
|
3430
3438
|
n.known && n.ids.length === 0 && (e[t.field] = "This field is required");
|
|
3431
3439
|
} else if (nn.has(t.field)) {
|
|
3432
|
-
const n =
|
|
3440
|
+
const n = Ft[t.field];
|
|
3433
3441
|
n !== void 0 && n === 0 && (e[t.field] = `At least one ${t.label || ke(t.field)} item is required`);
|
|
3434
3442
|
} else if (!P.some((n) => n.one_collection === a && n.one_field === t.field)) {
|
|
3435
3443
|
const n = I[t.field];
|
|
@@ -3460,7 +3468,7 @@ ${i.join(`
|
|
|
3460
3468
|
}
|
|
3461
3469
|
}
|
|
3462
3470
|
if (!e[t.field]) {
|
|
3463
|
-
const n =
|
|
3471
|
+
const n = _p(t, I[t.field], t.label ?? ke(t.field));
|
|
3464
3472
|
n && (e[t.field] = n);
|
|
3465
3473
|
}
|
|
3466
3474
|
}
|
|
@@ -3469,11 +3477,11 @@ ${i.join(`
|
|
|
3469
3477
|
const t = Object.keys(e), n = t.length;
|
|
3470
3478
|
if (n === 1) {
|
|
3471
3479
|
const r = _e.find((l) => l.field === t[0]), o = (r == null ? void 0 : r.label) || ke(t[0]);
|
|
3472
|
-
|
|
3480
|
+
je.error(
|
|
3473
3481
|
e[t[0]] === "This field is required" ? `${o} is required` : e[t[0]]
|
|
3474
3482
|
);
|
|
3475
3483
|
} else
|
|
3476
|
-
|
|
3484
|
+
je.error(`Can’t save yet — ${n} fields need attention`);
|
|
3477
3485
|
const i = t[0];
|
|
3478
3486
|
return i && setTimeout(() => Qa(i), 150), !1;
|
|
3479
3487
|
}
|
|
@@ -3561,10 +3569,10 @@ ${i.join(`
|
|
|
3561
3569
|
),
|
|
3562
3570
|
[_e]
|
|
3563
3571
|
);
|
|
3564
|
-
|
|
3572
|
+
Gp({
|
|
3565
3573
|
collection: a,
|
|
3566
|
-
config:
|
|
3567
|
-
enabled: !K &&
|
|
3574
|
+
config: Er,
|
|
3575
|
+
enabled: !K && !Ct && !Rn,
|
|
3568
3576
|
ready: g || !!ue,
|
|
3569
3577
|
recordKey: `${a}:${m ?? "new"}`,
|
|
3570
3578
|
required: Ku,
|
|
@@ -3582,17 +3590,17 @@ ${i.join(`
|
|
|
3582
3590
|
).map((n) => n.field)
|
|
3583
3591
|
);
|
|
3584
3592
|
if (!e.size) return null;
|
|
3585
|
-
const t =
|
|
3593
|
+
const t = bp(_e, e, Is);
|
|
3586
3594
|
return t.length ? { fields_changed: t, reasons: [], allow_free_text: !0, confirm: !0 } : null;
|
|
3587
3595
|
}
|
|
3588
3596
|
function no() {
|
|
3589
|
-
const e =
|
|
3597
|
+
const e = vp(
|
|
3590
3598
|
_e,
|
|
3591
3599
|
I,
|
|
3592
3600
|
(t) => rt.size === 0 || rt.has(t.field),
|
|
3593
3601
|
(t) => hd(t, Es).label || ke(t.field)
|
|
3594
3602
|
);
|
|
3595
|
-
e.length &&
|
|
3603
|
+
e.length && je.warning(
|
|
3596
3604
|
e.length === 1 ? `${e[0]} is recommended and still empty` : `${e.length} recommended fields are still empty`,
|
|
3597
3605
|
{
|
|
3598
3606
|
description: `${e.slice(0, 6).join(", ")}${e.length > 6 ? "…" : ""} — saved anyway; fill ${e.length === 1 ? "it" : "them"} in when you can.`
|
|
@@ -3626,7 +3634,7 @@ ${i.join(`
|
|
|
3626
3634
|
return (($ = b == null ? void 0 : b.data) == null ? void 0 : $.error) ?? (p instanceof Error ? p.message : "Failed");
|
|
3627
3635
|
}
|
|
3628
3636
|
let t = null;
|
|
3629
|
-
const n = [...et.entries()].some(([, p]) => p.length > 0) || [...tt.entries()].some(([, p]) => p.size > 0), i = [...
|
|
3637
|
+
const n = [...et.entries()].some(([, p]) => p.length > 0) || [...tt.entries()].some(([, p]) => p.size > 0), i = [...Te.entries()].filter(([, p]) => p.length > 0).map(([p]) => p), r = [...Ge.entries()].filter(([, p]) => p.size > 0).map(([p]) => p), o = [...Le.entries()].filter(([, p]) => p.size > 0).map(([p]) => p), l = g ? _e.filter((p) => !At.has(p.field) && !p.readonly && p.field in I).length : _e.filter((p) => At.has(p.field) || p.readonly || !(p.field in I) ? !1 : !Lt(I[p.field], Oe.current[p.field])).length, d = g ? `${l} field${l !== 1 ? "s" : ""} set` : l === 0 ? "No field changes" : `${l} field${l !== 1 ? "s" : ""} changed`;
|
|
3630
3638
|
let c = 0, u = 0;
|
|
3631
3639
|
for (const [, p] of et.entries()) c += p.length;
|
|
3632
3640
|
for (const [, p] of tt.entries()) u += p.size;
|
|
@@ -3658,7 +3666,7 @@ ${i.join(`
|
|
|
3658
3666
|
] : [],
|
|
3659
3667
|
...i.map((p) => {
|
|
3660
3668
|
var $;
|
|
3661
|
-
const b = (($ =
|
|
3669
|
+
const b = (($ = Te.get(p)) == null ? void 0 : $.length) ?? 0;
|
|
3662
3670
|
return {
|
|
3663
3671
|
id: `o2m:new:${p}`,
|
|
3664
3672
|
label: `Add ${ke(p.split(".")[0])}`,
|
|
@@ -3746,7 +3754,7 @@ ${i.join(`
|
|
|
3746
3754
|
oe("main", { status: "error", error: "Someone else changed this record" });
|
|
3747
3755
|
const V = {};
|
|
3748
3756
|
for (const ne of $.conflicts) V[ne.field] = S[ne.field];
|
|
3749
|
-
throw
|
|
3757
|
+
throw Nr({ conflicts: $.conflicts, latest: $.latest, mine: V }), p;
|
|
3750
3758
|
}
|
|
3751
3759
|
if (!g && em(p) && Object.keys(S).some((V) => !V.startsWith("_"))) {
|
|
3752
3760
|
const V = {};
|
|
@@ -3766,7 +3774,7 @@ ${i.join(`
|
|
|
3766
3774
|
throw oe("main", {
|
|
3767
3775
|
status: "error",
|
|
3768
3776
|
error: "No connection — will save when you are back online"
|
|
3769
|
-
}), vi(!1), X &&
|
|
3777
|
+
}), vi(!1), X && je.info("Will save when you are back online"), p;
|
|
3770
3778
|
}
|
|
3771
3779
|
}
|
|
3772
3780
|
const W = e(p);
|
|
@@ -3815,7 +3823,7 @@ ${i.join(`
|
|
|
3815
3823
|
if (!ne) continue;
|
|
3816
3824
|
const X = P.find(
|
|
3817
3825
|
(Me) => Me.many_collection === ne.many_collection && Me.many_field === ne.junction_field && Me.id !== ne.id
|
|
3818
|
-
), pe =
|
|
3826
|
+
), pe = dp(X), ze = pe ? { [pe.field]: pe.value } : {};
|
|
3819
3827
|
for (const Me of V)
|
|
3820
3828
|
W.push(
|
|
3821
3829
|
F.request(
|
|
@@ -3851,7 +3859,7 @@ ${i.join(`
|
|
|
3851
3859
|
}
|
|
3852
3860
|
}
|
|
3853
3861
|
for (const p of i) {
|
|
3854
|
-
const b = `o2m:new:${p}`, [$, W] = p.split("."), M =
|
|
3862
|
+
const b = `o2m:new:${p}`, [$, W] = p.split("."), M = Te.get(p) ?? [], V = ou.get(p);
|
|
3855
3863
|
if (V != null && V.length) {
|
|
3856
3864
|
const ze = ($e) => V.map((we) => String($e[we] ?? "")).join("\0"), Me = /* @__PURE__ */ new Set();
|
|
3857
3865
|
if (M.some(($e) => {
|
|
@@ -3908,8 +3916,8 @@ ${i.join(`
|
|
|
3908
3916
|
};
|
|
3909
3917
|
});
|
|
3910
3918
|
for (const [mt, Mt] of we) {
|
|
3911
|
-
const
|
|
3912
|
-
(Ye) => Ye.one_collection === $ && Ye.one_field ===
|
|
3919
|
+
const Gr = mt.slice(6), Ut = P.find(
|
|
3920
|
+
(Ye) => Ye.one_collection === $ && Ye.one_field === Gr
|
|
3913
3921
|
), _r = Array.isArray(Mt) ? Mt : [];
|
|
3914
3922
|
if (ln == null || !(Ut != null && Ut.many_collection) || !Ut.many_field) {
|
|
3915
3923
|
ze += _r.length;
|
|
@@ -3986,7 +3994,7 @@ ${i.join(`
|
|
|
3986
3994
|
V += ft.created.length + ft.updated.length + ft.deleted.length, $e[we] = ft;
|
|
3987
3995
|
continue;
|
|
3988
3996
|
}
|
|
3989
|
-
const
|
|
3997
|
+
const Gr = [], Ut = [], _r = [];
|
|
3990
3998
|
await Promise.all(
|
|
3991
3999
|
ft.created.map(
|
|
3992
4000
|
(Ye) => F.request(
|
|
@@ -3995,7 +4003,7 @@ ${i.join(`
|
|
|
3995
4003
|
Mt ? { ...Ye, [Mt]: X } : Ye
|
|
3996
4004
|
)
|
|
3997
4005
|
).catch(() => {
|
|
3998
|
-
V++,
|
|
4006
|
+
V++, Gr.push(Ye);
|
|
3999
4007
|
})
|
|
4000
4008
|
)
|
|
4001
4009
|
), await Promise.all(
|
|
@@ -4010,8 +4018,8 @@ ${i.join(`
|
|
|
4010
4018
|
V++, _r.push(Ye);
|
|
4011
4019
|
})
|
|
4012
4020
|
)
|
|
4013
|
-
), (
|
|
4014
|
-
created:
|
|
4021
|
+
), (Gr.length || Ut.length || _r.length) && ($e[we] = {
|
|
4022
|
+
created: Gr,
|
|
4015
4023
|
updated: Ut,
|
|
4016
4024
|
deleted: _r,
|
|
4017
4025
|
...ft.collection ? { collection: ft.collection } : {}
|
|
@@ -4073,7 +4081,7 @@ ${i.join(`
|
|
|
4073
4081
|
});
|
|
4074
4082
|
if (p.length) {
|
|
4075
4083
|
const b = `${p.length} task${p.length !== 1 ? "s" : ""} not created — ${p.join("; ")}`;
|
|
4076
|
-
oe("tasks", { status: "error", error: b }),
|
|
4084
|
+
oe("tasks", { status: "error", error: b }), je.error(b);
|
|
4077
4085
|
} else oe("tasks", { status: "done" });
|
|
4078
4086
|
cm(de, a, D);
|
|
4079
4087
|
}
|
|
@@ -4125,9 +4133,9 @@ ${i.join(`
|
|
|
4125
4133
|
i.startsWith("_") || n.add(i);
|
|
4126
4134
|
Zf(a, e, n), gi(), dm(Re, "saved", a, e);
|
|
4127
4135
|
}
|
|
4128
|
-
de.invalidateQueries({ queryKey: ["collision-base", a] }), en(!1),
|
|
4136
|
+
de.invalidateQueries({ queryKey: ["collision-base", a] }), en(!1), Zr(Rt), Or(/* @__PURE__ */ new Map()), Ci(/* @__PURE__ */ new Map()), ia([]), ws([]);
|
|
4129
4137
|
const t = /* @__PURE__ */ new Set([
|
|
4130
|
-
...
|
|
4138
|
+
...Te.keys(),
|
|
4131
4139
|
...Ge.keys(),
|
|
4132
4140
|
...Le.keys()
|
|
4133
4141
|
]);
|
|
@@ -4135,7 +4143,7 @@ ${i.join(`
|
|
|
4135
4143
|
const i = n.indexOf("."), r = n.slice(0, i), o = n.slice(i + 1);
|
|
4136
4144
|
de.invalidateQueries({ queryKey: ["o2m-rows", r, o, e] });
|
|
4137
4145
|
}
|
|
4138
|
-
if (jn(new Map(Ni.current)),
|
|
4146
|
+
if (jn(new Map(Ni.current)), Tr.current.clear(), Ps(/* @__PURE__ */ new Map()), de.invalidateQueries({ queryKey: ["item", a] }), de.invalidateQueries({ queryKey: ["m2m-items"] }), Rp(de, a, String(e)), Op(de, a, String(e)), Hi && Qt && vn({ itemId: String(e), silent: !0 }).then(() => {
|
|
4139
4147
|
de.invalidateQueries({ queryKey: ["m2m-items"] });
|
|
4140
4148
|
}), g && Oi.current) {
|
|
4141
4149
|
const n = Oi.current;
|
|
@@ -4148,7 +4156,7 @@ ${i.join(`
|
|
|
4148
4156
|
});
|
|
4149
4157
|
}
|
|
4150
4158
|
setTimeout(() => {
|
|
4151
|
-
vi(!1),
|
|
4159
|
+
vi(!1), je.success(g ? "Record created" : "Changes saved"), ie == null || ie(e);
|
|
4152
4160
|
}, 1200);
|
|
4153
4161
|
},
|
|
4154
4162
|
onError: () => {
|
|
@@ -4167,7 +4175,7 @@ ${i.join(`
|
|
|
4167
4175
|
if (t.conflicts.length > 0) {
|
|
4168
4176
|
const n = {};
|
|
4169
4177
|
for (const i of t.conflicts) n[i.field] = ee.current[i.field];
|
|
4170
|
-
|
|
4178
|
+
Nr({ conflicts: t.conflicts, latest: t.latest ?? 0, mine: n });
|
|
4171
4179
|
return;
|
|
4172
4180
|
}
|
|
4173
4181
|
t.latest != null && (nr.current = t.latest), qt.mutate();
|
|
@@ -4186,13 +4194,13 @@ ${i.join(`
|
|
|
4186
4194
|
Jt.current || (Jt.current = fd(a, m));
|
|
4187
4195
|
for (const i of Object.keys(e.payload)) pi.current.add(i);
|
|
4188
4196
|
const t = { ...ee.current, ...e.payload };
|
|
4189
|
-
ee.current = t,
|
|
4197
|
+
ee.current = t, ot(t);
|
|
4190
4198
|
for (const i of Object.keys(e.payload))
|
|
4191
|
-
Ze.current.add(i),
|
|
4199
|
+
Ze.current.add(i), Sr.current.set(i, ++mi.current);
|
|
4192
4200
|
if (en(!0), e.change_reason && (_t.current = e.change_reason), e.status === "conflict" && ((n = e.conflicts) != null && n.length)) {
|
|
4193
4201
|
const i = {};
|
|
4194
4202
|
for (const r of e.conflicts) i[r.field] = e.payload[r.field];
|
|
4195
|
-
|
|
4203
|
+
Nr({ conflicts: e.conflicts, latest: e.latest_revision ?? 0, mine: i });
|
|
4196
4204
|
} else e.base_revision != null && (nr.current = e.base_revision);
|
|
4197
4205
|
}, [Kt, a, m]), Sl = J(null);
|
|
4198
4206
|
Z(() => {
|
|
@@ -4202,7 +4210,7 @@ ${i.join(`
|
|
|
4202
4210
|
}, [Kt, ue, On, io]);
|
|
4203
4211
|
const Bu = R(() => am(), []), Du = () => {
|
|
4204
4212
|
const e = Oo.urlFor({ collection: a, itemId: String(m), layoutSlug: z });
|
|
4205
|
-
lm(e, a, String(m)) ||
|
|
4213
|
+
lm(e, a, String(m)) || je.error("Your browser blocked the window — allow pop-ups for this site and try again");
|
|
4206
4214
|
}, Wu = ce(() => {
|
|
4207
4215
|
sm(a, m), gi();
|
|
4208
4216
|
}, [a, m, gi]), gr = async () => {
|
|
@@ -4220,12 +4228,12 @@ ${i.join(`
|
|
|
4220
4228
|
}, so = id({
|
|
4221
4229
|
mutationFn: () => F.request(Vn(`/items/${a}/${m}`)),
|
|
4222
4230
|
onSuccess: () => {
|
|
4223
|
-
|
|
4231
|
+
je.success("Record deleted"), de.invalidateQueries({ queryKey: ["item", a] }), se == null || se();
|
|
4224
4232
|
},
|
|
4225
|
-
onError: (e) =>
|
|
4233
|
+
onError: (e) => je.error(
|
|
4226
4234
|
"Failed to delete",
|
|
4227
4235
|
kd(e) && m ? {
|
|
4228
|
-
action:
|
|
4236
|
+
action: cg(F, {
|
|
4229
4237
|
collection: a,
|
|
4230
4238
|
itemId: String(m),
|
|
4231
4239
|
action: "delete"
|
|
@@ -4251,7 +4259,7 @@ ${i.join(`
|
|
|
4251
4259
|
}) && an.add(i.field);
|
|
4252
4260
|
}
|
|
4253
4261
|
}
|
|
4254
|
-
if (
|
|
4262
|
+
if (Ae.active) for (const e of Ae.readonly) an.add(e);
|
|
4255
4263
|
const $l = /* @__PURE__ */ new Map();
|
|
4256
4264
|
{
|
|
4257
4265
|
const e = he != null && he.role ? String(he.role).toUpperCase() : null, t = !!(he != null && he.role_admin_access);
|
|
@@ -4271,9 +4279,9 @@ ${i.join(`
|
|
|
4271
4279
|
}
|
|
4272
4280
|
}
|
|
4273
4281
|
}
|
|
4274
|
-
const
|
|
4282
|
+
const Nt = {};
|
|
4275
4283
|
for (const [e, t] of $l)
|
|
4276
|
-
|
|
4284
|
+
Nt[e] = `The "${t}" section is locked for your role`;
|
|
4277
4285
|
{
|
|
4278
4286
|
const e = ((zl = ae == null ? void 0 : ae.instance) == null ? void 0 : zl.current_state) ?? null, t = e ? ((Vl = ((ae == null ? void 0 : ae.states) ?? []).find((i) => i.id === e)) == null ? void 0 : Vl.key) ?? null : null, n = t ? ke(t.replace(/_/g, " ")) : null;
|
|
4279
4287
|
for (const i of Ke)
|
|
@@ -4283,37 +4291,37 @@ ${i.join(`
|
|
|
4283
4291
|
r.some((o) => {
|
|
4284
4292
|
var l;
|
|
4285
4293
|
return o.type === "pipeline_state" && ((l = o.state_keys) == null ? void 0 : l.length);
|
|
4286
|
-
}) ?
|
|
4294
|
+
}) ? Nt[i.field] = n ? `Locked while the record is in ${n}` : "Locked by the record’s current state" : r.some((o) => o.type === "role") && (Nt[i.field] = "Locked for your role");
|
|
4287
4295
|
} catch {
|
|
4288
4296
|
}
|
|
4289
4297
|
for (const i of A ?? []) {
|
|
4290
4298
|
const r = i.field;
|
|
4291
|
-
if (
|
|
4292
|
-
if (
|
|
4293
|
-
|
|
4299
|
+
if (Nt[r]) continue;
|
|
4300
|
+
if (Ae.active && Ae.readonly.has(r)) {
|
|
4301
|
+
Nt[r] = `${((Jl = Ae.preview) == null ? void 0 : Jl.role.name) ?? "This role"} cannot edit this field`;
|
|
4294
4302
|
continue;
|
|
4295
4303
|
}
|
|
4296
4304
|
if (rn) {
|
|
4297
|
-
|
|
4305
|
+
Nt[r] = `${(In == null ? void 0 : In.locked_by_name) ?? "Someone else"} is editing this record — read-only until the lock is released`;
|
|
4298
4306
|
continue;
|
|
4299
4307
|
}
|
|
4300
4308
|
if (He) {
|
|
4301
|
-
|
|
4309
|
+
Nt[r] = "Viewing an addendum — switch to the current record to edit";
|
|
4302
4310
|
continue;
|
|
4303
4311
|
}
|
|
4304
4312
|
if (!i.readonly) continue;
|
|
4305
4313
|
const o = i._overrides ?? null;
|
|
4306
|
-
i.computed_type === "rollup" ?
|
|
4314
|
+
i.computed_type === "rollup" ? Nt[r] = "Calculated from related rows — change the rows, not this total" : i.computed_type === "write" ? Nt[r] = i.computed_formula ? `Calculated: ${i.computed_formula}` : "Calculated on save from other fields" : i.interface === "relation-path" ? Nt[r] = "Value from a related record — edit it there" : (o == null ? void 0 : o.readonly) === !0 ? Nt[r] = "Read-only on this layout" : At.has(r) ? Nt[r] = "Set by the system" : Nt[r] = "Read-only field";
|
|
4307
4315
|
}
|
|
4308
4316
|
}
|
|
4309
|
-
const Vu =
|
|
4317
|
+
const Vu = ap(Nt, Li.data), Cl = {};
|
|
4310
4318
|
for (const e of Ke) {
|
|
4311
4319
|
const t = typeof e.overrides == "string" ? xn(e.overrides) : e.overrides, n = t == null ? void 0 : t.apply_to_lines;
|
|
4312
4320
|
if (!(n != null && n.grid) || !(n != null && n.target)) continue;
|
|
4313
4321
|
const i = n.grid, r = n.target;
|
|
4314
4322
|
Cl[e.field] = {
|
|
4315
4323
|
label: n.label,
|
|
4316
|
-
count: i in
|
|
4324
|
+
count: i in Ft ? Ft[i] : null,
|
|
4317
4325
|
onApply: (o) => {
|
|
4318
4326
|
const l = () => {
|
|
4319
4327
|
const u = { collection: a, grid: i, target: r, value: o, handled: !1 };
|
|
@@ -4340,15 +4348,15 @@ ${i.join(`
|
|
|
4340
4348
|
const i = P.find(
|
|
4341
4349
|
(r) => r.many_collection === n.many_collection && r.many_field === n.junction_field && r.one_collection !== a
|
|
4342
4350
|
);
|
|
4343
|
-
return
|
|
4344
|
-
},
|
|
4345
|
-
for (const e of tn.fields)
|
|
4351
|
+
return cp(i);
|
|
4352
|
+
}, Jr = {};
|
|
4353
|
+
for (const e of tn.fields) Jr[e] = { from: Oe.current[e] };
|
|
4346
4354
|
for (const [e, t] of et)
|
|
4347
|
-
t.length && (
|
|
4355
|
+
t.length && (Jr[e] = { from: null, detail: `${t.length} linked` });
|
|
4348
4356
|
for (const [e, t] of tt)
|
|
4349
4357
|
if (t.size) {
|
|
4350
|
-
const n = (Ql =
|
|
4351
|
-
|
|
4358
|
+
const n = (Ql = Jr[e]) == null ? void 0 : Ql.detail;
|
|
4359
|
+
Jr[e] = {
|
|
4352
4360
|
from: null,
|
|
4353
4361
|
detail: n ? `${n}, ${t.size} unlinked` : `${t.size} unlinked`
|
|
4354
4362
|
};
|
|
@@ -4367,7 +4375,7 @@ ${i.join(`
|
|
|
4367
4375
|
onJump: () => bn(e)
|
|
4368
4376
|
});
|
|
4369
4377
|
const ao = (e) => ke(e.replace(/_/g, " "));
|
|
4370
|
-
for (const [e, t] of
|
|
4378
|
+
for (const [e, t] of Te) {
|
|
4371
4379
|
const [n, i] = e.split(".");
|
|
4372
4380
|
t.forEach(
|
|
4373
4381
|
(r, o) => Ht.push({
|
|
@@ -4462,10 +4470,10 @@ ${i.join(`
|
|
|
4462
4470
|
ue,
|
|
4463
4471
|
Xt
|
|
4464
4472
|
]);
|
|
4465
|
-
const
|
|
4473
|
+
const Qr = J(null);
|
|
4466
4474
|
Z(() => {
|
|
4467
|
-
|
|
4468
|
-
}, [
|
|
4475
|
+
Ct ? (Qr.current === null && (Qr.current = _n), Ji(!0)) : Qr.current !== null && (Ji(Qr.current), Qr.current = null);
|
|
4476
|
+
}, [Ct]);
|
|
4469
4477
|
const hr = {};
|
|
4470
4478
|
for (const e of Ht)
|
|
4471
4479
|
if (e.kind === "field") hr[e.key.slice(2)] = e.onRevert;
|
|
@@ -4497,9 +4505,9 @@ ${i.join(`
|
|
|
4497
4505
|
// #2726: designers trying pickers on the canvas are not people searching.
|
|
4498
4506
|
pickerMisses: !K,
|
|
4499
4507
|
fromAutofill: Nc,
|
|
4500
|
-
glossaryHelp:
|
|
4508
|
+
glossaryHelp: Er.glossary !== !1,
|
|
4501
4509
|
placementText: Es
|
|
4502
|
-
}, ut = (e, t, n) =>
|
|
4510
|
+
}, ut = (e, t, n) => Zp(Qe, e, t, n), lo = (e, t, n) => ut(e, t, n), zn = (e, t) => {
|
|
4503
4511
|
var n;
|
|
4504
4512
|
return {
|
|
4505
4513
|
kind: "slot",
|
|
@@ -4508,7 +4516,7 @@ ${i.join(`
|
|
|
4508
4516
|
};
|
|
4509
4517
|
}, wn = (e, t = !0) => mn && (e.hidden || !t), Xi = (e, t) => e ? /* @__PURE__ */ s("div", { "data-design-hidden": "", className: "opacity-40", children: t }) : t, co = (e) => ({
|
|
4510
4518
|
// A display formula is a `__calc_<n>__` placement — the editor's slot kind (#2712).
|
|
4511
|
-
kind:
|
|
4519
|
+
kind: wp(e) ? "slot" : "field",
|
|
4512
4520
|
field: e.field,
|
|
4513
4521
|
group_key: e.group_key ?? null
|
|
4514
4522
|
}), uo = (e, t, n) => {
|
|
@@ -4541,7 +4549,7 @@ ${i.join(`
|
|
|
4541
4549
|
hideActionsCollapsed: !!ll.hide_actions_collapsed,
|
|
4542
4550
|
hideActionsExpanded: !!ll.hide_actions_expanded,
|
|
4543
4551
|
onBeforeTransition: gr,
|
|
4544
|
-
asRole:
|
|
4552
|
+
asRole: Ae.roleId,
|
|
4545
4553
|
addendumPending: !He && ci > 0 && !!(N != null && N.addendums_enabled),
|
|
4546
4554
|
addendumView: He
|
|
4547
4555
|
},
|
|
@@ -4613,7 +4621,7 @@ ${i.join(`
|
|
|
4613
4621
|
if (e === "__owners__" && Je)
|
|
4614
4622
|
return /* @__PURE__ */ s("div", { children: Ou() }, "__owners__");
|
|
4615
4623
|
if (e.startsWith("__widget_") && e.endsWith("__")) {
|
|
4616
|
-
const r =
|
|
4624
|
+
const r = Pr.find((l) => l.field === e);
|
|
4617
4625
|
if (!r || !r.widget_id) return null;
|
|
4618
4626
|
let o = [];
|
|
4619
4627
|
try {
|
|
@@ -4638,7 +4646,7 @@ ${i.join(`
|
|
|
4638
4646
|
const r = ud(e);
|
|
4639
4647
|
if (r)
|
|
4640
4648
|
return /* @__PURE__ */ s(
|
|
4641
|
-
|
|
4649
|
+
Em,
|
|
4642
4650
|
{
|
|
4643
4651
|
slotKey: r,
|
|
4644
4652
|
collection: a,
|
|
@@ -4696,7 +4704,7 @@ ${i.join(`
|
|
|
4696
4704
|
"div",
|
|
4697
4705
|
{
|
|
4698
4706
|
className: "nvr-section-enter rounded-xl border border-slate-200 bg-white px-5 py-5",
|
|
4699
|
-
children: /* @__PURE__ */ s(
|
|
4707
|
+
children: /* @__PURE__ */ s(ei, { children: (t) => e.map((n) => {
|
|
4700
4708
|
var u;
|
|
4701
4709
|
const i = Gt == null ? void 0 : Gt[n.field], r = i == null ? void 0 : i.entries, o = (i == null ? void 0 : i.separator) ?? null, l = I[n.field], d = l != null && l !== "", c = r != null && r.length && d ? ((u = P.find(
|
|
4702
4710
|
(f) => f.many_collection === a && f.many_field === n.field && !f.junction_field
|
|
@@ -4715,8 +4723,8 @@ ${i.join(`
|
|
|
4715
4723
|
relations: P,
|
|
4716
4724
|
collection: a,
|
|
4717
4725
|
itemId: m,
|
|
4718
|
-
error:
|
|
4719
|
-
autoFillTick:
|
|
4726
|
+
error: at[n.field],
|
|
4727
|
+
autoFillTick: Cr[n.field],
|
|
4720
4728
|
visible: !0,
|
|
4721
4729
|
forceVisible: wn(n) || void 0,
|
|
4722
4730
|
locked: rn || Se !== "original",
|
|
@@ -4774,13 +4782,13 @@ ${i.join(`
|
|
|
4774
4782
|
}
|
|
4775
4783
|
})(), d = ((l == null ? void 0 : l.alternate_fields) ?? []).map(
|
|
4776
4784
|
(v) => typeof v == "string" ? { field: v, width: 2 } : v
|
|
4777
|
-
), c = l != null && l.enabled ? Da.has((o == null ? void 0 : o.id) ?? -1) : !1, u = (
|
|
4785
|
+
), c = l != null && l.enabled ? Da.has((o == null ? void 0 : o.id) ?? -1) : !1, u = (Ie[(o == null ? void 0 : o.key) ?? ""] ?? []).filter(
|
|
4778
4786
|
(v) => mn || !v.hidden
|
|
4779
4787
|
), f = !g && !!yt && !!xe && (mr === (o == null ? void 0 : o.key) || mr === e.key), h = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set();
|
|
4780
4788
|
for (const v of n) {
|
|
4781
4789
|
if (g && !ku(e, v.key)) continue;
|
|
4782
|
-
const D =
|
|
4783
|
-
D.some((k) =>
|
|
4790
|
+
const D = Ie[v.key] ?? [];
|
|
4791
|
+
D.some((k) => at[k.field]) && _.add(v.key);
|
|
4784
4792
|
const G = D.filter((k) => k.required && !k.hidden);
|
|
4785
4793
|
(G.length === 0 || G.every((k) => {
|
|
4786
4794
|
if (fe.has(k.field)) {
|
|
@@ -4788,7 +4796,7 @@ ${i.join(`
|
|
|
4788
4796
|
return !q || q.ids.length > 0;
|
|
4789
4797
|
}
|
|
4790
4798
|
if (nn.has(k.field)) {
|
|
4791
|
-
const q =
|
|
4799
|
+
const q = Ft[k.field];
|
|
4792
4800
|
return q === void 0 || q > 0;
|
|
4793
4801
|
}
|
|
4794
4802
|
const j = I[k.field];
|
|
@@ -4805,7 +4813,7 @@ ${i.join(`
|
|
|
4805
4813
|
errorSteps: _,
|
|
4806
4814
|
dirtySteps: new Set(
|
|
4807
4815
|
n.filter(
|
|
4808
|
-
(v) => (
|
|
4816
|
+
(v) => (Ie[v.key] ?? []).some((D) => Ze.current.has(D.field))
|
|
4809
4817
|
).map((v) => v.key)
|
|
4810
4818
|
),
|
|
4811
4819
|
onStepClick: (v) => Wn(e, v),
|
|
@@ -4831,7 +4839,7 @@ ${i.join(`
|
|
|
4831
4839
|
)
|
|
4832
4840
|
) }),
|
|
4833
4841
|
/* @__PURE__ */ y("div", { className: "px-5 py-5", children: [
|
|
4834
|
-
o && /* @__PURE__ */ s(
|
|
4842
|
+
o && /* @__PURE__ */ s(tp, { group: o, className: "mb-4" }),
|
|
4835
4843
|
K && o && /* @__PURE__ */ s(bd, { groupKey: o.key }),
|
|
4836
4844
|
(() => {
|
|
4837
4845
|
const v = (C, G) => {
|
|
@@ -4910,8 +4918,8 @@ ${i.join(`
|
|
|
4910
4918
|
relations: P,
|
|
4911
4919
|
collection: a,
|
|
4912
4920
|
itemId: m,
|
|
4913
|
-
error:
|
|
4914
|
-
autoFillTick:
|
|
4921
|
+
error: at[pe.field],
|
|
4922
|
+
autoFillTick: Cr[pe.field],
|
|
4915
4923
|
visible: !0,
|
|
4916
4924
|
forceVisible: !0,
|
|
4917
4925
|
locked: an.has(pe.field) || Se !== "original",
|
|
@@ -4935,8 +4943,8 @@ ${i.join(`
|
|
|
4935
4943
|
relations: P,
|
|
4936
4944
|
collection: a,
|
|
4937
4945
|
itemId: m,
|
|
4938
|
-
error:
|
|
4939
|
-
autoFillTick:
|
|
4946
|
+
error: at[C.field],
|
|
4947
|
+
autoFillTick: Cr[C.field],
|
|
4940
4948
|
visible: rt.has(C.field) || !rt.size,
|
|
4941
4949
|
forceVisible: wn(C, rt.has(C.field) || !rt.size) || void 0,
|
|
4942
4950
|
locked: an.has(C.field) || Se !== "original",
|
|
@@ -4962,14 +4970,14 @@ ${i.join(`
|
|
|
4962
4970
|
);
|
|
4963
4971
|
}, D = jl(o, u);
|
|
4964
4972
|
return /* @__PURE__ */ y(pt, { children: [
|
|
4965
|
-
/* @__PURE__ */ s(
|
|
4973
|
+
/* @__PURE__ */ s(ei, { children: (C) => D.units.map(
|
|
4966
4974
|
(G) => G.kind === "row" ? ql(G.row, G.members, C, (o == null ? void 0 : o.key) ?? null) : v(G.field, C)
|
|
4967
4975
|
) }),
|
|
4968
|
-
Al((o == null ? void 0 : o.key) ?? e.key, D, () => /* @__PURE__ */ s(
|
|
4976
|
+
Al((o == null ? void 0 : o.key) ?? e.key, D, () => /* @__PURE__ */ s(ei, { children: (C) => D.folded.map((G) => v(G, C)) }))
|
|
4969
4977
|
] });
|
|
4970
4978
|
})(),
|
|
4971
|
-
K && u.length === 0 && !f && !
|
|
4972
|
-
|
|
4979
|
+
K && u.length === 0 && !f && !Pr.some((v) => (v.group_key ?? null) === o.key) && /* @__PURE__ */ s(vd, {}),
|
|
4980
|
+
Pr.filter((v) => (v.group_key ?? null) === o.key).map((v) => {
|
|
4973
4981
|
let D = [];
|
|
4974
4982
|
try {
|
|
4975
4983
|
D = typeof v.input_bindings == "string" ? JSON.parse(v.input_bindings) : v.input_bindings ?? [];
|
|
@@ -5039,7 +5047,7 @@ ${i.join(`
|
|
|
5039
5047
|
onClick: () => Wn(e, n[v - 1].key),
|
|
5040
5048
|
className: "inline-flex items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 transition-colors hover:bg-slate-50 disabled:pointer-events-none disabled:opacity-40",
|
|
5041
5049
|
children: [
|
|
5042
|
-
/* @__PURE__ */ s(
|
|
5050
|
+
/* @__PURE__ */ s(Yr, { className: "h-3.5 w-3.5 rotate-90" }),
|
|
5043
5051
|
"Previous"
|
|
5044
5052
|
]
|
|
5045
5053
|
}
|
|
@@ -5058,7 +5066,7 @@ ${i.join(`
|
|
|
5058
5066
|
className: "inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan-dark",
|
|
5059
5067
|
children: [
|
|
5060
5068
|
"Next",
|
|
5061
|
-
/* @__PURE__ */ s(
|
|
5069
|
+
/* @__PURE__ */ s(Yr, { className: "h-3.5 w-3.5 -rotate-90" })
|
|
5062
5070
|
]
|
|
5063
5071
|
}
|
|
5064
5072
|
)
|
|
@@ -5073,7 +5081,7 @@ ${i.join(`
|
|
|
5073
5081
|
if (typeof e == "string" && e !== "__ungrouped__") return fo(e);
|
|
5074
5082
|
const t = e;
|
|
5075
5083
|
if (t.type === "container") return Fl(t);
|
|
5076
|
-
if (t.type === "content") return /* @__PURE__ */ s(
|
|
5084
|
+
if (t.type === "content") return /* @__PURE__ */ s(ep, { group: t }, t.key);
|
|
5077
5085
|
if (t.type === "metadata" && g) return null;
|
|
5078
5086
|
const n = (() => {
|
|
5079
5087
|
try {
|
|
@@ -5083,7 +5091,7 @@ ${i.join(`
|
|
|
5083
5091
|
}
|
|
5084
5092
|
})(), i = ((n == null ? void 0 : n.alternate_fields) ?? []).map(
|
|
5085
5093
|
(_) => typeof _ == "string" ? { field: _, width: 2 } : _
|
|
5086
|
-
), r = n != null && n.enabled ? Da.has(t.id) : !1, l = (
|
|
5094
|
+
), r = n != null && n.enabled ? Da.has(t.id) : !1, l = (Ie[t.key] ?? []).map((_) => {
|
|
5087
5095
|
const S = Ia.get(_.field);
|
|
5088
5096
|
if (S === void 0) return _;
|
|
5089
5097
|
const x = I[_.field];
|
|
@@ -5094,12 +5102,12 @@ ${i.join(`
|
|
|
5094
5102
|
__live_delta: { original: x, live: S }
|
|
5095
5103
|
}
|
|
5096
5104
|
};
|
|
5097
|
-
}), d =
|
|
5105
|
+
}), d = Kr && pr === t.key && Je, c = Lr && mr === t.key && !g, u = Pr.filter((_) => (_.group_key ?? null) === t.key);
|
|
5098
5106
|
if (l.length === 0 && !d && !c && u.length === 0 && !K)
|
|
5099
5107
|
return null;
|
|
5100
5108
|
const f = Vi && t.type !== "tab";
|
|
5101
5109
|
return /* @__PURE__ */ s(
|
|
5102
|
-
|
|
5110
|
+
Dm,
|
|
5103
5111
|
{
|
|
5104
5112
|
group: t,
|
|
5105
5113
|
fields: l,
|
|
@@ -5116,7 +5124,7 @@ ${i.join(`
|
|
|
5116
5124
|
relations: P,
|
|
5117
5125
|
collection: a,
|
|
5118
5126
|
itemId: m,
|
|
5119
|
-
errors:
|
|
5127
|
+
errors: at,
|
|
5120
5128
|
visibleFields: rt,
|
|
5121
5129
|
lockedFields: an,
|
|
5122
5130
|
layoutAiEnabled: Ln,
|
|
@@ -5128,8 +5136,8 @@ ${i.join(`
|
|
|
5128
5136
|
isOpen: f ? mu === t.id : void 0,
|
|
5129
5137
|
onToggle: f ? () => Ba((_) => _ === t.id ? null : t.id) : void 0,
|
|
5130
5138
|
summaryFields: Nd(t.summary_fields),
|
|
5131
|
-
deferred:
|
|
5132
|
-
onFirstOpen:
|
|
5139
|
+
deferred: xr.groups.has(t.key),
|
|
5140
|
+
onFirstOpen: xr.groups.has(t.key) ? ec : void 0,
|
|
5133
5141
|
m2mCounts: Rs,
|
|
5134
5142
|
o2mCounts: Os,
|
|
5135
5143
|
o2mAggValues: iu,
|
|
@@ -5152,10 +5160,10 @@ ${i.join(`
|
|
|
5152
5160
|
function Hu() {
|
|
5153
5161
|
var t;
|
|
5154
5162
|
const e = $f(
|
|
5155
|
-
|
|
5163
|
+
Vr.filter((n) => typeof n != "string" && !n.container_id)
|
|
5156
5164
|
);
|
|
5157
5165
|
return /* @__PURE__ */ y("div", { className: "nvr-stagger space-y-4", children: [
|
|
5158
|
-
|
|
5166
|
+
Vr.map((n, i) => {
|
|
5159
5167
|
const r = typeof n == "string" ? n : n.key;
|
|
5160
5168
|
return uo(n, r ?? i, e);
|
|
5161
5169
|
}),
|
|
@@ -5216,17 +5224,17 @@ ${i.join(`
|
|
|
5216
5224
|
rows: e ? Ff(e.swap_config).rows : [],
|
|
5217
5225
|
folded: (n) => !!e && Of(n._overrides),
|
|
5218
5226
|
keep: (n) => !!n.required,
|
|
5219
|
-
filled: (n) => !Rf(sn[n.field]) || !!
|
|
5227
|
+
filled: (n) => !Rf(sn[n.field]) || !!at[n.field]
|
|
5220
5228
|
});
|
|
5221
5229
|
}
|
|
5222
5230
|
function ql(e, t, n, i) {
|
|
5223
5231
|
return /* @__PURE__ */ s(
|
|
5224
|
-
|
|
5232
|
+
Lm,
|
|
5225
5233
|
{
|
|
5226
5234
|
row: e,
|
|
5227
5235
|
members: t,
|
|
5228
5236
|
containerWidth: n,
|
|
5229
|
-
errors:
|
|
5237
|
+
errors: at,
|
|
5230
5238
|
renderMember: (r) => ut(
|
|
5231
5239
|
{ kind: "field", field: r.field, group_key: i },
|
|
5232
5240
|
/* @__PURE__ */ s("div", { children: Xi(
|
|
@@ -5234,14 +5242,14 @@ ${i.join(`
|
|
|
5234
5242
|
/* @__PURE__ */ s(
|
|
5235
5243
|
br,
|
|
5236
5244
|
{
|
|
5237
|
-
field:
|
|
5245
|
+
field: Km(r),
|
|
5238
5246
|
draft: sn,
|
|
5239
5247
|
onChange: Wt,
|
|
5240
5248
|
relations: P,
|
|
5241
5249
|
collection: a,
|
|
5242
5250
|
itemId: m,
|
|
5243
|
-
error:
|
|
5244
|
-
autoFillTick:
|
|
5251
|
+
error: at[r.field],
|
|
5252
|
+
autoFillTick: Cr[r.field],
|
|
5245
5253
|
visible: rt.has(r.field) || !rt.size,
|
|
5246
5254
|
forceVisible: wn(r, rt.has(r.field) || !rt.size) || void 0,
|
|
5247
5255
|
locked: an.has(r.field) || rn || Se !== "original",
|
|
@@ -5259,7 +5267,7 @@ ${i.join(`
|
|
|
5259
5267
|
}
|
|
5260
5268
|
function Al(e, t, n) {
|
|
5261
5269
|
return t.folded.length === 0 ? null : /* @__PURE__ */ s(
|
|
5262
|
-
|
|
5270
|
+
Pm,
|
|
5263
5271
|
{
|
|
5264
5272
|
count: t.folded.length,
|
|
5265
5273
|
open: pu.has(e),
|
|
@@ -5274,7 +5282,7 @@ ${i.join(`
|
|
|
5274
5282
|
);
|
|
5275
5283
|
}
|
|
5276
5284
|
function es(e, t = !1) {
|
|
5277
|
-
const n = (e === "__general__" ? t ? vt : [...vt, ...kt.flatMap((c) =>
|
|
5285
|
+
const n = (e === "__general__" ? t ? vt : [...vt, ...kt.flatMap((c) => Ie[c.key] ?? [])] : Ie[e] ?? []).filter((c) => mn || !c.hidden), i = Kr && pr === e && Je, r = Lr && mr === e && !g, o = Pr.filter((c) => (c.group_key ?? null) === e), l = jl(
|
|
5278
5286
|
e === "__general__" ? void 0 : be.find((c) => c.key === e),
|
|
5279
5287
|
n
|
|
5280
5288
|
), d = l.units.map(
|
|
@@ -5315,7 +5323,7 @@ ${i.join(`
|
|
|
5315
5323
|
return ut(
|
|
5316
5324
|
zn("__owners__", u.slot.group_key ?? null),
|
|
5317
5325
|
/* @__PURE__ */ s("div", { style: { gridColumn: `span ${k}` }, children: /* @__PURE__ */ s(
|
|
5318
|
-
|
|
5326
|
+
yg,
|
|
5319
5327
|
{
|
|
5320
5328
|
collection: a,
|
|
5321
5329
|
itemId: m,
|
|
@@ -5398,8 +5406,8 @@ ${i.join(`
|
|
|
5398
5406
|
relations: P,
|
|
5399
5407
|
collection: a,
|
|
5400
5408
|
itemId: m,
|
|
5401
|
-
error:
|
|
5402
|
-
autoFillTick:
|
|
5409
|
+
error: at[h.field],
|
|
5410
|
+
autoFillTick: Cr[h.field],
|
|
5403
5411
|
visible: !0,
|
|
5404
5412
|
forceVisible: wn(h) || void 0,
|
|
5405
5413
|
locked: rn || Se !== "original",
|
|
@@ -5423,8 +5431,8 @@ ${i.join(`
|
|
|
5423
5431
|
);
|
|
5424
5432
|
};
|
|
5425
5433
|
return /* @__PURE__ */ y(pt, { children: [
|
|
5426
|
-
/* @__PURE__ */ s(
|
|
5427
|
-
Al(e, l, () => /* @__PURE__ */ s(
|
|
5434
|
+
/* @__PURE__ */ s(ei, { children: (u) => d.map((f) => c(f, u)) }),
|
|
5435
|
+
Al(e, l, () => /* @__PURE__ */ s(ei, { children: (u) => l.folded.map(
|
|
5428
5436
|
(f) => c({ _k: f.field, sort: f.sort ?? 0, _t: "field", f }, u)
|
|
5429
5437
|
) }))
|
|
5430
5438
|
] });
|
|
@@ -5432,7 +5440,7 @@ ${i.join(`
|
|
|
5432
5440
|
K && d.length === 0 && (e !== "__general__" || t) && /* @__PURE__ */ s(vd, {})
|
|
5433
5441
|
]
|
|
5434
5442
|
},
|
|
5435
|
-
|
|
5443
|
+
Fe
|
|
5436
5444
|
);
|
|
5437
5445
|
}
|
|
5438
5446
|
function Uu() {
|
|
@@ -5450,7 +5458,7 @@ ${i.join(`
|
|
|
5450
5458
|
className: "relative flex border-b border-slate-200 overflow-x-auto gap-1 px-1",
|
|
5451
5459
|
children: [
|
|
5452
5460
|
e.map((n) => {
|
|
5453
|
-
const i = Object.keys(
|
|
5461
|
+
const i = Object.keys(at).some((o) => {
|
|
5454
5462
|
const l = _e.find((d) => d.field === o);
|
|
5455
5463
|
return (l == null ? void 0 : l.group_key) === n.key || !(l != null && l.group_key) && n.key === "__general__";
|
|
5456
5464
|
}), r = /* @__PURE__ */ y(
|
|
@@ -5460,10 +5468,10 @@ ${i.join(`
|
|
|
5460
5468
|
"data-tab-key": n.key,
|
|
5461
5469
|
"data-design-tab": K ? "" : void 0,
|
|
5462
5470
|
"data-design-hidden": Pn != null && Pn.has(n.key) ? "" : void 0,
|
|
5463
|
-
onClick: () =>
|
|
5471
|
+
onClick: () => xt(n.key),
|
|
5464
5472
|
className: Ce(
|
|
5465
5473
|
"whitespace-nowrap px-4 py-2.5 text-sm font-medium border-b-2 border-transparent transition-colors flex items-center gap-1.5",
|
|
5466
|
-
|
|
5474
|
+
Fe === n.key ? "text-primary" : "text-muted-foreground hover:text-foreground",
|
|
5467
5475
|
(Pn == null ? void 0 : Pn.has(n.key)) && "opacity-40"
|
|
5468
5476
|
),
|
|
5469
5477
|
children: [
|
|
@@ -5489,8 +5497,8 @@ ${i.join(`
|
|
|
5489
5497
|
Ys ? e.map((n) => /* @__PURE__ */ y(po, { children: [
|
|
5490
5498
|
mo(n.key, n.label),
|
|
5491
5499
|
es(n.key)
|
|
5492
|
-
] }, n.key)) : es(
|
|
5493
|
-
|
|
5500
|
+
] }, n.key)) : es(Fe),
|
|
5501
|
+
Vr.filter((n) => typeof n == "string" && n !== "__ungrouped__").map((n) => ut(zn(n), fo(n))),
|
|
5494
5502
|
!ve && Je && /* @__PURE__ */ s(
|
|
5495
5503
|
rs,
|
|
5496
5504
|
{
|
|
@@ -5545,19 +5553,19 @@ ${i.join(`
|
|
|
5545
5553
|
}
|
|
5546
5554
|
function Yu() {
|
|
5547
5555
|
var d;
|
|
5548
|
-
const e = le.findIndex((c) => c.key ===
|
|
5556
|
+
const e = le.findIndex((c) => c.key === Fe), t = e === le.length - 1, i = /* @__PURE__ */ s("div", { className: "mt-6 border-t border-slate-200 pt-4", children: /* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5549
5557
|
/* @__PURE__ */ y(
|
|
5550
5558
|
"button",
|
|
5551
5559
|
{
|
|
5552
5560
|
type: "button",
|
|
5553
5561
|
onClick: () => {
|
|
5554
|
-
const c = le.findIndex((u) => u.key ===
|
|
5555
|
-
c > 0 &&
|
|
5562
|
+
const c = le.findIndex((u) => u.key === Fe);
|
|
5563
|
+
c > 0 && xt(le[c - 1].key);
|
|
5556
5564
|
},
|
|
5557
5565
|
disabled: e === 0,
|
|
5558
5566
|
className: "inline-flex items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 transition-colors hover:bg-slate-50 disabled:pointer-events-none disabled:opacity-40",
|
|
5559
5567
|
children: [
|
|
5560
|
-
/* @__PURE__ */ s(
|
|
5568
|
+
/* @__PURE__ */ s(Yr, { className: "h-3.5 w-3.5 rotate-90" }),
|
|
5561
5569
|
"Previous"
|
|
5562
5570
|
]
|
|
5563
5571
|
}
|
|
@@ -5574,7 +5582,7 @@ ${i.join(`
|
|
|
5574
5582
|
{
|
|
5575
5583
|
type: "button",
|
|
5576
5584
|
onClick: () => ro(),
|
|
5577
|
-
disabled: qt.isPending || rn ||
|
|
5585
|
+
disabled: qt.isPending || rn || Ae.active,
|
|
5578
5586
|
className: "inline-flex h-9 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan-dark disabled:opacity-50",
|
|
5579
5587
|
children: [
|
|
5580
5588
|
/* @__PURE__ */ s(od, { className: "h-3.5 w-3.5" }),
|
|
@@ -5589,7 +5597,7 @@ ${i.join(`
|
|
|
5589
5597
|
className: "inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan-dark",
|
|
5590
5598
|
children: [
|
|
5591
5599
|
"Next",
|
|
5592
|
-
/* @__PURE__ */ s(
|
|
5600
|
+
/* @__PURE__ */ s(Yr, { className: "h-3.5 w-3.5 -rotate-90" })
|
|
5593
5601
|
]
|
|
5594
5602
|
}
|
|
5595
5603
|
),
|
|
@@ -5604,7 +5612,7 @@ ${i.join(`
|
|
|
5604
5612
|
`${Tt}:${It}`
|
|
5605
5613
|
)
|
|
5606
5614
|
] })
|
|
5607
|
-
] }) }), r = wt.length > 0 ? Math.min(...wt.map((c) => c.sort)) : 1 / 0, o =
|
|
5615
|
+
] }) }), r = wt.length > 0 ? Math.min(...wt.map((c) => c.sort)) : 1 / 0, o = Vr.filter((c) => typeof c != "string" ? c.sort < r : c === "__pipeline__" ? !!(ve && ve.sort < r) : c === "__comments__" ? !!(Be && Be.sort < r) : c === "__tasks__" ? !!(De && De.sort < r) : c === "__addendums__" ? !!(jt && jt.sort < r) : !1), l = Vr.filter((c) => c === "__ungrouped__" ? !1 : typeof c != "string" ? c.sort >= r : c === "__pipeline__" ? !(ve && ve.sort < r) : c === "__comments__" ? !(Be && Be.sort < r) : c === "__tasks__" ? !(De && De.sort < r) : c === "__addendums__" ? !(jt && jt.sort < r) : !1);
|
|
5608
5616
|
return /* @__PURE__ */ y("div", { className: "nvr-stagger space-y-4 min-w-0 flex-1", children: [
|
|
5609
5617
|
o.map((c, u) => {
|
|
5610
5618
|
const f = typeof c == "string" ? c : c.key;
|
|
@@ -5615,19 +5623,19 @@ ${i.join(`
|
|
|
5615
5623
|
{
|
|
5616
5624
|
steps: le,
|
|
5617
5625
|
hiddenSteps: Pn,
|
|
5618
|
-
active:
|
|
5626
|
+
active: Fe,
|
|
5619
5627
|
completed: Nu,
|
|
5620
5628
|
dirtySteps: Su,
|
|
5621
5629
|
errorSteps: new Set(
|
|
5622
|
-
le.filter((c) => (
|
|
5630
|
+
le.filter((c) => (Ie[c.key] ?? []).some((u) => at[u.field])).map((c) => c.key)
|
|
5623
5631
|
),
|
|
5624
|
-
onStepClick:
|
|
5632
|
+
onStepClick: xt
|
|
5625
5633
|
}
|
|
5626
5634
|
),
|
|
5627
5635
|
Ys ? le.map((c) => /* @__PURE__ */ y(po, { children: [
|
|
5628
5636
|
mo(c.key, c.label),
|
|
5629
5637
|
es(c.key, !0)
|
|
5630
|
-
] }, c.key)) : es(
|
|
5638
|
+
] }, c.key)) : es(Fe, !0),
|
|
5631
5639
|
l.map((c, u) => {
|
|
5632
5640
|
const f = typeof c == "string" ? c : c.key;
|
|
5633
5641
|
return uo(c, f ?? u);
|
|
@@ -5702,18 +5710,18 @@ ${i.join(`
|
|
|
5702
5710
|
$o = !1;
|
|
5703
5711
|
}));
|
|
5704
5712
|
}, [F]), Z(() => {
|
|
5705
|
-
if (g || !
|
|
5713
|
+
if (g || !wr || K) return;
|
|
5706
5714
|
const e = ue && (N != null && N.display_template) ? vo(N.display_template, ue) : (N == null ? void 0 : N.display_name) ?? ke(a ?? "");
|
|
5707
5715
|
if (!e) return;
|
|
5708
5716
|
const t = document.title;
|
|
5709
5717
|
return document.title = `${e} · ${document.title.split(" · ").pop() ?? "Nivaro"}`, () => {
|
|
5710
5718
|
document.title = t;
|
|
5711
5719
|
};
|
|
5712
|
-
}, [ue, N, a, g,
|
|
5713
|
-
return /* @__PURE__ */ s("div", { className: Ce("nvr-fade-in flex flex-1 min-h-0 flex-col overflow-y-auto", ri), children: /* @__PURE__ */ s(
|
|
5720
|
+
}, [ue, N, a, g, wr, K]), (Rn == null ? void 0 : Rn.kind) === "access")
|
|
5721
|
+
return /* @__PURE__ */ s("div", { className: Ce("nvr-fade-in flex flex-1 min-h-0 flex-col overflow-y-auto", ri), children: /* @__PURE__ */ s(jp, { onBack: Q ?? (() => window.history.back()) }) });
|
|
5714
5722
|
if (Ko && !ue)
|
|
5715
5723
|
return /* @__PURE__ */ s("div", { className: Ce("nvr-fade-in flex flex-1 min-h-0 flex-col overflow-y-auto", ri), children: /* @__PURE__ */ s(
|
|
5716
|
-
|
|
5724
|
+
fg,
|
|
5717
5725
|
{
|
|
5718
5726
|
collection: a,
|
|
5719
5727
|
itemId: String(m),
|
|
@@ -5722,18 +5730,18 @@ ${i.join(`
|
|
|
5722
5730
|
) });
|
|
5723
5731
|
if (!(K ? A !== void 0 : cs) || !g && ps)
|
|
5724
5732
|
return /* @__PURE__ */ y("div", { className: Ce("flex flex-1 min-h-0 flex-col", ri), children: [
|
|
5725
|
-
|
|
5733
|
+
qe && /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-slate-200 px-6 py-4 flex items-center gap-3 dark:border-border", children: /* @__PURE__ */ s(Xr, { className: "h-6 w-40" }) }),
|
|
5726
5734
|
/* @__PURE__ */ y("div", { className: "flex flex-1 flex-col items-center justify-center gap-3 p-6", children: [
|
|
5727
5735
|
/* @__PURE__ */ s("span", { className: "relative flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ s("span", { className: "absolute inset-0 animate-spin rounded-full border-2 border-slate-200 border-t-nvr-cyan dark:border-border dark:border-t-nvr-cyan" }) }),
|
|
5728
5736
|
/* @__PURE__ */ s("p", { className: "text-[13px] font-medium text-slate-500 dark:text-muted-foreground", children: "Loading record…" })
|
|
5729
5737
|
] })
|
|
5730
5738
|
] });
|
|
5731
|
-
const Tl = (N == null ? void 0 : N.display_name) ?? ke(a ?? ""), Il = (N == null ? void 0 : N.singular) || Tl, kn = !g && ue && (N != null && N.display_template) ? vo(N.display_template, ue) : Tl, El = !g &&
|
|
5739
|
+
const Tl = (N == null ? void 0 : N.display_name) ?? ke(a ?? ""), Il = (N == null ? void 0 : N.singular) || Tl, kn = !g && ue && (N != null && N.display_template) ? vo(N.display_template, ue) : Tl, El = !g && $t && uu;
|
|
5732
5740
|
return /* @__PURE__ */ s(
|
|
5733
5741
|
bf.Provider,
|
|
5734
5742
|
{
|
|
5735
5743
|
value: g ? null : la,
|
|
5736
|
-
children: /* @__PURE__ */ s(vf.Provider, { value: jc, children: /* @__PURE__ */ s(
|
|
5744
|
+
children: /* @__PURE__ */ s(vf.Provider, { value: jc, children: /* @__PURE__ */ s(Cm.Provider, { value: nu, children: /* @__PURE__ */ s(Rm.Provider, { value: Se, children: /* @__PURE__ */ s(Om.Provider, { value: Hc, children: /* @__PURE__ */ s(
|
|
5737
5745
|
wf.Provider,
|
|
5738
5746
|
{
|
|
5739
5747
|
value: {
|
|
@@ -5743,10 +5751,10 @@ ${i.join(`
|
|
|
5743
5751
|
fieldLabels: fa,
|
|
5744
5752
|
fieldOptionFilters: ma
|
|
5745
5753
|
},
|
|
5746
|
-
children: /* @__PURE__ */ s(kf.Provider, { value: g ? null : lc, children: /* @__PURE__ */ s(xf.Provider, { value: tu, children: /* @__PURE__ */ s(
|
|
5747
|
-
/* @__PURE__ */ s(
|
|
5754
|
+
children: /* @__PURE__ */ s(kf.Provider, { value: g ? null : lc, children: /* @__PURE__ */ s(xf.Provider, { value: tu, children: /* @__PURE__ */ s(fp.Provider, { value: Dt, children: /* @__PURE__ */ s(mp.Provider, { value: Uc, children: /* @__PURE__ */ s(pp.Provider, { value: Yc, children: /* @__PURE__ */ s(up.Provider, { value: ge, children: /* @__PURE__ */ y(Mm.Provider, { value: Qu, children: [
|
|
5755
|
+
/* @__PURE__ */ s(og, {}),
|
|
5748
5756
|
/* @__PURE__ */ s(
|
|
5749
|
-
|
|
5757
|
+
kg,
|
|
5750
5758
|
{
|
|
5751
5759
|
open: xc,
|
|
5752
5760
|
steps: Sc,
|
|
@@ -5757,34 +5765,34 @@ ${i.join(`
|
|
|
5757
5765
|
/* @__PURE__ */ s(
|
|
5758
5766
|
Ed,
|
|
5759
5767
|
{
|
|
5760
|
-
open: !!
|
|
5768
|
+
open: !!lt,
|
|
5761
5769
|
onOpenChange: (e) => {
|
|
5762
5770
|
!e && !ji && Fi(null);
|
|
5763
5771
|
},
|
|
5764
5772
|
children: /* @__PURE__ */ y(Md, { children: [
|
|
5765
5773
|
/* @__PURE__ */ s(Pd, { children: /* @__PURE__ */ s(Ld, { children: "Update this record from file" }) }),
|
|
5766
5774
|
/* @__PURE__ */ y(Kd, { className: "space-y-3", children: [
|
|
5767
|
-
|
|
5768
|
-
|
|
5775
|
+
lt && /* @__PURE__ */ y("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
5776
|
+
lt.diff.updates.length,
|
|
5769
5777
|
" will update ·",
|
|
5770
5778
|
" ",
|
|
5771
|
-
|
|
5779
|
+
lt.diff.creates.length,
|
|
5772
5780
|
" new ·",
|
|
5773
5781
|
" ",
|
|
5774
|
-
|
|
5782
|
+
lt.diff.deletes.length,
|
|
5775
5783
|
" will delete ·",
|
|
5776
5784
|
" ",
|
|
5777
|
-
|
|
5785
|
+
lt.diff.matchedUnchanged,
|
|
5778
5786
|
" unchanged"
|
|
5779
5787
|
] }),
|
|
5780
|
-
|
|
5781
|
-
|
|
5788
|
+
lt && /* @__PURE__ */ s(
|
|
5789
|
+
Nm,
|
|
5782
5790
|
{
|
|
5783
|
-
diff:
|
|
5791
|
+
diff: lt.diff,
|
|
5784
5792
|
fields: A ?? []
|
|
5785
5793
|
}
|
|
5786
5794
|
),
|
|
5787
|
-
|
|
5795
|
+
lt && /* @__PURE__ */ s(pd, { issues: lt.result.issues })
|
|
5788
5796
|
] }),
|
|
5789
5797
|
/* @__PURE__ */ y(Bd, { children: [
|
|
5790
5798
|
/* @__PURE__ */ s(
|
|
@@ -5800,11 +5808,11 @@ ${i.join(`
|
|
|
5800
5808
|
dn,
|
|
5801
5809
|
{
|
|
5802
5810
|
onClick: async () => {
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5811
|
+
lt && (aa(!0), await Rc(
|
|
5812
|
+
lt.diff,
|
|
5813
|
+
lt.result,
|
|
5814
|
+
lt.template,
|
|
5815
|
+
lt.existingRows
|
|
5808
5816
|
), aa(!1), Fi(null));
|
|
5809
5817
|
},
|
|
5810
5818
|
disabled: ji,
|
|
@@ -5816,7 +5824,7 @@ ${i.join(`
|
|
|
5816
5824
|
}
|
|
5817
5825
|
),
|
|
5818
5826
|
/* @__PURE__ */ y("div", { className: Ce("flex flex-1 min-h-0 flex-col", ri), children: [
|
|
5819
|
-
|
|
5827
|
+
qe && /* @__PURE__ */ y(
|
|
5820
5828
|
"header",
|
|
5821
5829
|
{
|
|
5822
5830
|
className: Ce(
|
|
@@ -5850,7 +5858,7 @@ ${i.join(`
|
|
|
5850
5858
|
children: [
|
|
5851
5859
|
/* @__PURE__ */ y("div", { className: "group/title flex items-center gap-1.5", children: [
|
|
5852
5860
|
/* @__PURE__ */ s("h1", { className: "truncate text-[17px] font-bold leading-tight text-slate-900 dark:text-slate-50", children: g ? `New ${Il}` : kn }),
|
|
5853
|
-
!g && kn && (
|
|
5861
|
+
!g && kn && (Rr === "__title__" ? /* @__PURE__ */ s(Sn, { className: "h-3 w-3 shrink-0 text-emerald-500" }) : /* @__PURE__ */ s(
|
|
5854
5862
|
"button",
|
|
5855
5863
|
{
|
|
5856
5864
|
type: "button",
|
|
@@ -5864,7 +5872,7 @@ ${i.join(`
|
|
|
5864
5872
|
1500
|
|
5865
5873
|
);
|
|
5866
5874
|
},
|
|
5867
|
-
children: /* @__PURE__ */ s(
|
|
5875
|
+
children: /* @__PURE__ */ s(Ur, { className: "h-3 w-3 text-slate-300 hover:text-slate-500 dark:text-slate-600 dark:hover:text-slate-400" })
|
|
5868
5876
|
}
|
|
5869
5877
|
))
|
|
5870
5878
|
] }),
|
|
@@ -5900,28 +5908,28 @@ ${i.join(`
|
|
|
5900
5908
|
]
|
|
5901
5909
|
}
|
|
5902
5910
|
),
|
|
5903
|
-
|
|
5911
|
+
St && !St.api && /* @__PURE__ */ s(
|
|
5904
5912
|
"span",
|
|
5905
5913
|
{
|
|
5906
5914
|
"data-provenance-chip": !0,
|
|
5907
5915
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-slate-50 px-1.5 py-px text-[9.5px] font-medium text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground",
|
|
5908
|
-
"data-tip": `${
|
|
5909
|
-
children:
|
|
5916
|
+
"data-tip": `${St.origin}${St.user_name ? ` · ${St.user_name}` : ""} · ${new Date(St.timestamp).toLocaleString()}`,
|
|
5917
|
+
children: St.origin
|
|
5910
5918
|
}
|
|
5911
5919
|
),
|
|
5912
|
-
(
|
|
5913
|
-
|
|
5920
|
+
(St == null ? void 0 : St.api) && /* @__PURE__ */ s(
|
|
5921
|
+
Ag,
|
|
5914
5922
|
{
|
|
5915
5923
|
collection: a,
|
|
5916
5924
|
itemId: String(m),
|
|
5917
|
-
origin:
|
|
5918
|
-
userName:
|
|
5919
|
-
timestamp:
|
|
5920
|
-
api:
|
|
5925
|
+
origin: St.origin,
|
|
5926
|
+
userName: St.user_name,
|
|
5927
|
+
timestamp: St.timestamp,
|
|
5928
|
+
api: St.api
|
|
5921
5929
|
}
|
|
5922
5930
|
),
|
|
5923
|
-
|
|
5924
|
-
|
|
5931
|
+
$t && !g && m && !K && /* @__PURE__ */ s(
|
|
5932
|
+
Up,
|
|
5925
5933
|
{
|
|
5926
5934
|
collection: a,
|
|
5927
5935
|
itemId: String(m)
|
|
@@ -5964,7 +5972,7 @@ ${i.join(`
|
|
|
5964
5972
|
})
|
|
5965
5973
|
}
|
|
5966
5974
|
),
|
|
5967
|
-
|
|
5975
|
+
Rr === "__subtitle__" ? /* @__PURE__ */ s(Sn, { className: "h-3 w-3 shrink-0 text-emerald-500" }) : /* @__PURE__ */ s(
|
|
5968
5976
|
"button",
|
|
5969
5977
|
{
|
|
5970
5978
|
type: "button",
|
|
@@ -5978,7 +5986,7 @@ ${i.join(`
|
|
|
5978
5986
|
1500
|
|
5979
5987
|
);
|
|
5980
5988
|
},
|
|
5981
|
-
children: /* @__PURE__ */ s(
|
|
5989
|
+
children: /* @__PURE__ */ s(Ur, { className: "h-3 w-3 text-slate-300 hover:text-slate-500 dark:text-slate-600 dark:hover:text-slate-400" })
|
|
5982
5990
|
}
|
|
5983
5991
|
)
|
|
5984
5992
|
] })
|
|
@@ -5987,7 +5995,7 @@ ${i.join(`
|
|
|
5987
5995
|
),
|
|
5988
5996
|
/* @__PURE__ */ y("div", { className: "ml-auto flex items-center gap-1.5 [&_button]:whitespace-nowrap", children: [
|
|
5989
5997
|
Pe,
|
|
5990
|
-
/* @__PURE__ */ y(
|
|
5998
|
+
/* @__PURE__ */ y(Gm, { children: [
|
|
5991
5999
|
g && /* @__PURE__ */ s(
|
|
5992
6000
|
md,
|
|
5993
6001
|
{
|
|
@@ -5996,7 +6004,7 @@ ${i.join(`
|
|
|
5996
6004
|
}
|
|
5997
6005
|
),
|
|
5998
6006
|
g && !rn && /* @__PURE__ */ s(
|
|
5999
|
-
|
|
6007
|
+
xm,
|
|
6000
6008
|
{
|
|
6001
6009
|
collection: a,
|
|
6002
6010
|
onApply: Cc,
|
|
@@ -6034,7 +6042,7 @@ ${i.join(`
|
|
|
6034
6042
|
className: "w-[440px] max-w-[calc(100vw-24px)] p-3",
|
|
6035
6043
|
"data-quick-picker-modal": !0,
|
|
6036
6044
|
children: /* @__PURE__ */ s(
|
|
6037
|
-
|
|
6045
|
+
xp,
|
|
6038
6046
|
{
|
|
6039
6047
|
collection: a,
|
|
6040
6048
|
itemId: m,
|
|
@@ -6042,7 +6050,7 @@ ${i.join(`
|
|
|
6042
6050
|
fieldConfig: A ?? [],
|
|
6043
6051
|
relations: P,
|
|
6044
6052
|
draft: I,
|
|
6045
|
-
getM2M:
|
|
6053
|
+
getM2M: qr,
|
|
6046
6054
|
onChange: Wt,
|
|
6047
6055
|
onM2MChange: Ac,
|
|
6048
6056
|
fieldLabels: fa,
|
|
@@ -6063,7 +6071,7 @@ ${i.join(`
|
|
|
6063
6071
|
role: "radiogroup",
|
|
6064
6072
|
"aria-label": "Form mode",
|
|
6065
6073
|
"data-summary-mode-toggle": !0,
|
|
6066
|
-
"data-mode":
|
|
6074
|
+
"data-mode": Ct ? "summary" : "edit",
|
|
6067
6075
|
className: "inline-flex h-9 shrink-0 items-center overflow-hidden rounded-md border border-input bg-background p-0.5 text-[11.5px] font-medium shadow-sm",
|
|
6068
6076
|
children: [
|
|
6069
6077
|
/* @__PURE__ */ y(
|
|
@@ -6071,13 +6079,13 @@ ${i.join(`
|
|
|
6071
6079
|
{
|
|
6072
6080
|
type: "button",
|
|
6073
6081
|
role: "radio",
|
|
6074
|
-
"aria-checked":
|
|
6082
|
+
"aria-checked": Ct,
|
|
6075
6083
|
"data-summary-mode-option": "summary",
|
|
6076
6084
|
title: "Summary mode — a read-only view of this record",
|
|
6077
6085
|
onClick: () => ys(!0),
|
|
6078
6086
|
className: Ce(
|
|
6079
6087
|
"inline-flex h-full items-center gap-1.5 rounded px-2.5 transition-colors",
|
|
6080
|
-
|
|
6088
|
+
Ct ? "bg-nvr-cyan text-white shadow-sm" : "text-slate-600 hover:bg-muted dark:text-slate-300"
|
|
6081
6089
|
),
|
|
6082
6090
|
children: [
|
|
6083
6091
|
/* @__PURE__ */ s(tf, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
@@ -6090,13 +6098,13 @@ ${i.join(`
|
|
|
6090
6098
|
{
|
|
6091
6099
|
type: "button",
|
|
6092
6100
|
role: "radio",
|
|
6093
|
-
"aria-checked":
|
|
6101
|
+
"aria-checked": !Ct,
|
|
6094
6102
|
"data-summary-mode-option": "edit",
|
|
6095
6103
|
title: "Edit mode — change this record",
|
|
6096
6104
|
onClick: () => ys(!1),
|
|
6097
6105
|
className: Ce(
|
|
6098
6106
|
"inline-flex h-full items-center gap-1.5 rounded px-2.5 transition-colors",
|
|
6099
|
-
|
|
6107
|
+
Ct ? "text-slate-600 hover:bg-muted dark:text-slate-300" : "bg-nvr-cyan text-white shadow-sm"
|
|
6100
6108
|
),
|
|
6101
6109
|
children: [
|
|
6102
6110
|
/* @__PURE__ */ s(nf, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
@@ -6107,9 +6115,9 @@ ${i.join(`
|
|
|
6107
6115
|
]
|
|
6108
6116
|
}
|
|
6109
6117
|
) : null,
|
|
6110
|
-
!g && m ? /* @__PURE__ */ y(
|
|
6118
|
+
!g && m ? /* @__PURE__ */ y(Hm, { children: [
|
|
6111
6119
|
Fs && !In && (wa || js) && /* @__PURE__ */ s(
|
|
6112
|
-
|
|
6120
|
+
lg,
|
|
6113
6121
|
{
|
|
6114
6122
|
note: Vc,
|
|
6115
6123
|
onSave: Jc,
|
|
@@ -6128,8 +6136,8 @@ ${i.join(`
|
|
|
6128
6136
|
onJump: bn
|
|
6129
6137
|
}
|
|
6130
6138
|
),
|
|
6131
|
-
|
|
6132
|
-
|
|
6139
|
+
wm(m, Qd) && /* @__PURE__ */ s(
|
|
6140
|
+
km,
|
|
6133
6141
|
{
|
|
6134
6142
|
compact: !0,
|
|
6135
6143
|
collection: a,
|
|
@@ -6172,7 +6180,7 @@ ${i.join(`
|
|
|
6172
6180
|
children: /* @__PURE__ */ s(of, { className: "h-4 w-4" })
|
|
6173
6181
|
}
|
|
6174
6182
|
),
|
|
6175
|
-
|
|
6183
|
+
$t && ((Gl = N == null ? void 0 : N.browser_config) == null ? void 0 : Gl.copy_as) !== !1 && /* @__PURE__ */ s(
|
|
6176
6184
|
_m,
|
|
6177
6185
|
{
|
|
6178
6186
|
compact: !0,
|
|
@@ -6182,7 +6190,7 @@ ${i.join(`
|
|
|
6182
6190
|
}
|
|
6183
6191
|
),
|
|
6184
6192
|
/* @__PURE__ */ s(
|
|
6185
|
-
|
|
6193
|
+
Ep,
|
|
6186
6194
|
{
|
|
6187
6195
|
compact: !0,
|
|
6188
6196
|
collection: a,
|
|
@@ -6190,7 +6198,7 @@ ${i.join(`
|
|
|
6190
6198
|
}
|
|
6191
6199
|
),
|
|
6192
6200
|
/* @__PURE__ */ s(
|
|
6193
|
-
|
|
6201
|
+
Fp,
|
|
6194
6202
|
{
|
|
6195
6203
|
compact: !0,
|
|
6196
6204
|
collection: a,
|
|
@@ -6198,7 +6206,7 @@ ${i.join(`
|
|
|
6198
6206
|
}
|
|
6199
6207
|
),
|
|
6200
6208
|
/* @__PURE__ */ s(
|
|
6201
|
-
|
|
6209
|
+
Np,
|
|
6202
6210
|
{
|
|
6203
6211
|
compact: !0,
|
|
6204
6212
|
collection: a,
|
|
@@ -6206,7 +6214,7 @@ ${i.join(`
|
|
|
6206
6214
|
}
|
|
6207
6215
|
),
|
|
6208
6216
|
du && /* @__PURE__ */ s(
|
|
6209
|
-
|
|
6217
|
+
mg,
|
|
6210
6218
|
{
|
|
6211
6219
|
compact: !0,
|
|
6212
6220
|
collection: a,
|
|
@@ -6223,7 +6231,7 @@ ${i.join(`
|
|
|
6223
6231
|
onJump: bn
|
|
6224
6232
|
}
|
|
6225
6233
|
),
|
|
6226
|
-
!g && m && /* @__PURE__ */ y(
|
|
6234
|
+
!g && m && /* @__PURE__ */ y(Um, { children: [
|
|
6227
6235
|
/* @__PURE__ */ s(
|
|
6228
6236
|
md,
|
|
6229
6237
|
{
|
|
@@ -6276,7 +6284,7 @@ ${i.join(`
|
|
|
6276
6284
|
3e4
|
|
6277
6285
|
);
|
|
6278
6286
|
} catch {
|
|
6279
|
-
|
|
6287
|
+
je.error("Dossier export failed");
|
|
6280
6288
|
}
|
|
6281
6289
|
},
|
|
6282
6290
|
className: "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
@@ -6287,7 +6295,7 @@ ${i.join(`
|
|
|
6287
6295
|
}
|
|
6288
6296
|
),
|
|
6289
6297
|
Va.disablePickers && /* @__PURE__ */ s(
|
|
6290
|
-
|
|
6298
|
+
$p,
|
|
6291
6299
|
{
|
|
6292
6300
|
collection: a,
|
|
6293
6301
|
itemId: String(m),
|
|
@@ -6295,7 +6303,7 @@ ${i.join(`
|
|
|
6295
6303
|
}
|
|
6296
6304
|
),
|
|
6297
6305
|
Va.schedule && /* @__PURE__ */ s(
|
|
6298
|
-
|
|
6306
|
+
Cp,
|
|
6299
6307
|
{
|
|
6300
6308
|
collection: a,
|
|
6301
6309
|
itemId: String(m),
|
|
@@ -6304,7 +6312,7 @@ ${i.join(`
|
|
|
6304
6312
|
}
|
|
6305
6313
|
),
|
|
6306
6314
|
/* @__PURE__ */ s("div", { "data-nvr-menu-divider": !0 }),
|
|
6307
|
-
|
|
6315
|
+
kr && /* @__PURE__ */ y(
|
|
6308
6316
|
"button",
|
|
6309
6317
|
{
|
|
6310
6318
|
type: "button",
|
|
@@ -6389,7 +6397,7 @@ ${i.join(`
|
|
|
6389
6397
|
} catch {
|
|
6390
6398
|
}
|
|
6391
6399
|
}
|
|
6392
|
-
|
|
6400
|
+
kr({ values: i, links: r, rows: o });
|
|
6393
6401
|
},
|
|
6394
6402
|
className: "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
6395
6403
|
"data-duplicate-record": !0,
|
|
@@ -6423,7 +6431,7 @@ ${i.join(`
|
|
|
6423
6431
|
title: "Save this record as a reusable pre-fill template — plain field values only (same exclusions as Duplicate)",
|
|
6424
6432
|
"data-save-as-template": !0,
|
|
6425
6433
|
onClick: () => {
|
|
6426
|
-
fl(""), pl(!1),
|
|
6434
|
+
fl(""), pl(!1), Dr(!0);
|
|
6427
6435
|
},
|
|
6428
6436
|
className: "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
6429
6437
|
children: [
|
|
@@ -6465,7 +6473,7 @@ ${i.join(`
|
|
|
6465
6473
|
]
|
|
6466
6474
|
}
|
|
6467
6475
|
),
|
|
6468
|
-
|
|
6476
|
+
!$t && !g && m && /* @__PURE__ */ y(
|
|
6469
6477
|
"button",
|
|
6470
6478
|
{
|
|
6471
6479
|
type: "button",
|
|
@@ -6488,7 +6496,7 @@ ${i.join(`
|
|
|
6488
6496
|
]
|
|
6489
6497
|
}
|
|
6490
6498
|
),
|
|
6491
|
-
|
|
6499
|
+
$t && /* @__PURE__ */ y(pt, { children: [
|
|
6492
6500
|
/* @__PURE__ */ s("div", { "data-nvr-menu-divider": !0 }),
|
|
6493
6501
|
/* @__PURE__ */ y(
|
|
6494
6502
|
dn,
|
|
@@ -6524,7 +6532,7 @@ ${i.join(`
|
|
|
6524
6532
|
),
|
|
6525
6533
|
cu && // lint-traps-ok: self-triggered; HeaderTools ignores clicks inside dialogs it opened
|
|
6526
6534
|
/* @__PURE__ */ s(
|
|
6527
|
-
|
|
6535
|
+
Am,
|
|
6528
6536
|
{
|
|
6529
6537
|
collection: a,
|
|
6530
6538
|
itemId: m,
|
|
@@ -6584,7 +6592,7 @@ ${i.join(`
|
|
|
6584
6592
|
"div",
|
|
6585
6593
|
{
|
|
6586
6594
|
className: "absolute inset-0 bg-black/30",
|
|
6587
|
-
onClick: () =>
|
|
6595
|
+
onClick: () => Dr(!1)
|
|
6588
6596
|
}
|
|
6589
6597
|
),
|
|
6590
6598
|
/* @__PURE__ */ y(
|
|
@@ -6594,7 +6602,7 @@ ${i.join(`
|
|
|
6594
6602
|
"aria-label": "Save as template",
|
|
6595
6603
|
className: "relative w-[380px] rounded-xl border border-slate-200 bg-white p-5 shadow-2xl dark:border-border dark:bg-card",
|
|
6596
6604
|
onKeyDown: (e) => {
|
|
6597
|
-
e.key === "Escape" &&
|
|
6605
|
+
e.key === "Escape" && Dr(!1);
|
|
6598
6606
|
},
|
|
6599
6607
|
children: [
|
|
6600
6608
|
/* @__PURE__ */ s("p", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Save as template" }),
|
|
@@ -6603,11 +6611,11 @@ ${i.join(`
|
|
|
6603
6611
|
"input",
|
|
6604
6612
|
{
|
|
6605
6613
|
autoFocus: !0,
|
|
6606
|
-
value:
|
|
6614
|
+
value: Wr,
|
|
6607
6615
|
onChange: (e) => fl(e.target.value),
|
|
6608
6616
|
onKeyDown: (e) => {
|
|
6609
6617
|
var t;
|
|
6610
|
-
e.key === "Enter" &&
|
|
6618
|
+
e.key === "Enter" && Wr.trim() && ((t = document.querySelector(
|
|
6611
6619
|
"[data-template-save-btn]"
|
|
6612
6620
|
)) == null || t.click());
|
|
6613
6621
|
},
|
|
@@ -6632,7 +6640,7 @@ ${i.join(`
|
|
|
6632
6640
|
"button",
|
|
6633
6641
|
{
|
|
6634
6642
|
type: "button",
|
|
6635
|
-
onClick: () =>
|
|
6643
|
+
onClick: () => Dr(!1),
|
|
6636
6644
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted",
|
|
6637
6645
|
children: "Cancel"
|
|
6638
6646
|
}
|
|
@@ -6642,7 +6650,7 @@ ${i.join(`
|
|
|
6642
6650
|
{
|
|
6643
6651
|
type: "button",
|
|
6644
6652
|
"data-template-save-btn": !0,
|
|
6645
|
-
disabled: !
|
|
6653
|
+
disabled: !Wr.trim() || gl,
|
|
6646
6654
|
onClick: async () => {
|
|
6647
6655
|
const e = /* @__PURE__ */ new Set([
|
|
6648
6656
|
"id",
|
|
@@ -6668,7 +6676,7 @@ ${i.join(`
|
|
|
6668
6676
|
r == null || r === "" || typeof r != "object" && (t[n.field] = r);
|
|
6669
6677
|
}
|
|
6670
6678
|
if (Object.keys(t).length === 0) {
|
|
6671
|
-
|
|
6679
|
+
je.error(
|
|
6672
6680
|
"Nothing to save — no plain field values on this record"
|
|
6673
6681
|
);
|
|
6674
6682
|
return;
|
|
@@ -6678,15 +6686,15 @@ ${i.join(`
|
|
|
6678
6686
|
await F.request(
|
|
6679
6687
|
Pt("/record-templates", {
|
|
6680
6688
|
collection: a,
|
|
6681
|
-
name:
|
|
6689
|
+
name: Wr.trim(),
|
|
6682
6690
|
data: t,
|
|
6683
6691
|
is_shared: ml
|
|
6684
6692
|
})
|
|
6685
|
-
),
|
|
6686
|
-
`Template "${
|
|
6687
|
-
),
|
|
6693
|
+
), je.success(
|
|
6694
|
+
`Template "${Wr.trim()}" saved`
|
|
6695
|
+
), Dr(!1);
|
|
6688
6696
|
} catch {
|
|
6689
|
-
|
|
6697
|
+
je.error("Failed to save template");
|
|
6690
6698
|
} finally {
|
|
6691
6699
|
hl(!1);
|
|
6692
6700
|
}
|
|
@@ -6704,22 +6712,22 @@ ${i.join(`
|
|
|
6704
6712
|
)
|
|
6705
6713
|
] }),
|
|
6706
6714
|
cn && !g && /* @__PURE__ */ s(
|
|
6707
|
-
|
|
6715
|
+
pg,
|
|
6708
6716
|
{
|
|
6709
6717
|
collection: a,
|
|
6710
6718
|
itemId: String(m)
|
|
6711
6719
|
}
|
|
6712
6720
|
),
|
|
6713
6721
|
!g && m && /* @__PURE__ */ s(
|
|
6714
|
-
|
|
6722
|
+
gg,
|
|
6715
6723
|
{
|
|
6716
6724
|
collection: a,
|
|
6717
6725
|
itemId: String(m),
|
|
6718
6726
|
draft: I
|
|
6719
6727
|
}
|
|
6720
6728
|
),
|
|
6721
|
-
!!((Yl = w == null ? void 0 : w.layout) != null && Yl.changes_tray) &&
|
|
6722
|
-
|
|
6729
|
+
!!((Yl = w == null ? void 0 : w.layout) != null && Yl.changes_tray) && !Ct && /* @__PURE__ */ s(
|
|
6730
|
+
qm,
|
|
6723
6731
|
{
|
|
6724
6732
|
items: Ht,
|
|
6725
6733
|
saving: qt.isPending,
|
|
@@ -6749,7 +6757,7 @@ ${i.join(`
|
|
|
6749
6757
|
}
|
|
6750
6758
|
),
|
|
6751
6759
|
/* @__PURE__ */ s(
|
|
6752
|
-
|
|
6760
|
+
Sg,
|
|
6753
6761
|
{
|
|
6754
6762
|
open: fc && Xe,
|
|
6755
6763
|
onClose: () => Jo(!1),
|
|
@@ -6760,7 +6768,7 @@ ${i.join(`
|
|
|
6760
6768
|
initial: Oe.current,
|
|
6761
6769
|
m2mLinks: et,
|
|
6762
6770
|
m2mUnlinks: tt,
|
|
6763
|
-
pendingRowCount: [...
|
|
6771
|
+
pendingRowCount: [...Te.values()].reduce(
|
|
6764
6772
|
(e, t) => e + t.length,
|
|
6765
6773
|
0
|
|
6766
6774
|
),
|
|
@@ -6775,12 +6783,12 @@ ${i.join(`
|
|
|
6775
6783
|
type: "button",
|
|
6776
6784
|
size: "sm",
|
|
6777
6785
|
onClick: () => ro(),
|
|
6778
|
-
disabled: qt.isPending || rn ||
|
|
6786
|
+
disabled: qt.isPending || rn || Ae.active,
|
|
6779
6787
|
className: Ce(
|
|
6780
6788
|
"gap-1.5 transition-colors duration-300",
|
|
6781
6789
|
// Summary mode has nothing to save — the button would
|
|
6782
6790
|
// only contradict the "read-only" strip.
|
|
6783
|
-
|
|
6791
|
+
Ct && !g && "hidden",
|
|
6784
6792
|
bs && "bg-emerald-500 hover:bg-emerald-500 text-white"
|
|
6785
6793
|
),
|
|
6786
6794
|
children: [
|
|
@@ -6812,7 +6820,7 @@ ${i.join(`
|
|
|
6812
6820
|
}
|
|
6813
6821
|
),
|
|
6814
6822
|
/* @__PURE__ */ s("span", { className: "max-w-[160px] truncate", children: He ? ((Zl = bt.find((e) => e.id === Se)) == null ? void 0 : Zl.title) ?? "Addendum" : "Viewing: Current record" }),
|
|
6815
|
-
/* @__PURE__ */ s(
|
|
6823
|
+
/* @__PURE__ */ s(Yr, { className: "h-3 w-3 opacity-60" })
|
|
6816
6824
|
]
|
|
6817
6825
|
}
|
|
6818
6826
|
),
|
|
@@ -6893,26 +6901,26 @@ ${i.join(`
|
|
|
6893
6901
|
}
|
|
6894
6902
|
),
|
|
6895
6903
|
On && /* @__PURE__ */ s(
|
|
6896
|
-
|
|
6904
|
+
Ig,
|
|
6897
6905
|
{
|
|
6898
6906
|
collision: On,
|
|
6899
6907
|
fieldLabel: (e) => {
|
|
6900
6908
|
const t = _e.find((n) => n.field === e);
|
|
6901
6909
|
return (t == null ? void 0 : t.label) || ke(e);
|
|
6902
6910
|
},
|
|
6903
|
-
onCancel: () =>
|
|
6911
|
+
onCancel: () => Nr(null),
|
|
6904
6912
|
onResolve: (e) => {
|
|
6905
6913
|
for (const t of On.conflicts)
|
|
6906
|
-
e.has(t.field) &&
|
|
6914
|
+
e.has(t.field) && ot((n) => ({
|
|
6907
6915
|
...n,
|
|
6908
6916
|
[t.field]: t.current_value
|
|
6909
6917
|
}));
|
|
6910
|
-
nr.current = On.latest,
|
|
6918
|
+
nr.current = On.latest, Nr(null), setTimeout(() => qt.mutate(), 0);
|
|
6911
6919
|
}
|
|
6912
6920
|
}
|
|
6913
6921
|
),
|
|
6914
6922
|
/* @__PURE__ */ s(
|
|
6915
|
-
|
|
6923
|
+
jm,
|
|
6916
6924
|
{
|
|
6917
6925
|
challenge: Do,
|
|
6918
6926
|
fieldLabel: (e) => {
|
|
@@ -6926,18 +6934,18 @@ ${i.join(`
|
|
|
6926
6934
|
}
|
|
6927
6935
|
),
|
|
6928
6936
|
!g && m && /* @__PURE__ */ s(
|
|
6929
|
-
|
|
6937
|
+
Jp,
|
|
6930
6938
|
{
|
|
6931
6939
|
open: qu,
|
|
6932
6940
|
onOpenChange: cl,
|
|
6933
6941
|
collection: a,
|
|
6934
6942
|
item: String(m),
|
|
6935
6943
|
recordLabel: kn ? String(kn) : null,
|
|
6936
|
-
onCreated: (e) =>
|
|
6944
|
+
onCreated: (e) => je.success(`Request #${e.id} sent to the administrators`)
|
|
6937
6945
|
}
|
|
6938
6946
|
),
|
|
6939
|
-
|
|
6940
|
-
|
|
6947
|
+
!$t && !g && m && /* @__PURE__ */ s(
|
|
6948
|
+
Vp,
|
|
6941
6949
|
{
|
|
6942
6950
|
open: Au,
|
|
6943
6951
|
onOpenChange: ul,
|
|
@@ -6952,13 +6960,13 @@ ${i.join(`
|
|
|
6952
6960
|
field: e.field,
|
|
6953
6961
|
label: e.label || ke(e.field.replace(/_/g, " "))
|
|
6954
6962
|
})),
|
|
6955
|
-
onSent: (e) =>
|
|
6963
|
+
onSent: (e) => je.success(
|
|
6956
6964
|
`Suggestion #${e.id} sent — follow it under My requests`
|
|
6957
6965
|
)
|
|
6958
6966
|
}
|
|
6959
6967
|
),
|
|
6960
6968
|
!g && m && /* @__PURE__ */ s(
|
|
6961
|
-
|
|
6969
|
+
Wp,
|
|
6962
6970
|
{
|
|
6963
6971
|
collection: a,
|
|
6964
6972
|
itemId: String(m),
|
|
@@ -6966,8 +6974,8 @@ ${i.join(`
|
|
|
6966
6974
|
onOpenChange: zo
|
|
6967
6975
|
}
|
|
6968
6976
|
),
|
|
6969
|
-
|
|
6970
|
-
|
|
6977
|
+
$t && !g && m && /* @__PURE__ */ s(
|
|
6978
|
+
Sp,
|
|
6971
6979
|
{
|
|
6972
6980
|
collection: a,
|
|
6973
6981
|
itemId: String(m),
|
|
@@ -6980,16 +6988,16 @@ ${i.join(`
|
|
|
6980
6988
|
}
|
|
6981
6989
|
}
|
|
6982
6990
|
),
|
|
6983
|
-
(
|
|
6984
|
-
|
|
6991
|
+
(Er.badge || !K && on.switchable) && /* @__PURE__ */ s(
|
|
6992
|
+
Qp,
|
|
6985
6993
|
{
|
|
6986
|
-
badge:
|
|
6994
|
+
badge: Er.badge,
|
|
6987
6995
|
mode: !K && on.switchable ? on.mode : null,
|
|
6988
6996
|
auto: on.auto,
|
|
6989
6997
|
onMode: on.set
|
|
6990
6998
|
}
|
|
6991
6999
|
),
|
|
6992
|
-
|
|
7000
|
+
qe && (Yi.length > 0 || vl.length > 0) && // Condensing HIDES rather than unmounts: a
|
|
6993
7001
|
// remount refires every header widget/chip
|
|
6994
7002
|
// fetch, which read as the sub-header
|
|
6995
7003
|
// "reloading" on scroll-up.
|
|
@@ -7039,7 +7047,7 @@ ${i.join(`
|
|
|
7039
7047
|
if (n.type === "summary") {
|
|
7040
7048
|
const k = n.data;
|
|
7041
7049
|
return /* @__PURE__ */ s(
|
|
7042
|
-
|
|
7050
|
+
Qm,
|
|
7043
7051
|
{
|
|
7044
7052
|
collection: a,
|
|
7045
7053
|
itemId: m,
|
|
@@ -7095,7 +7103,7 @@ ${i.join(`
|
|
|
7095
7103
|
}))
|
|
7096
7104
|
}
|
|
7097
7105
|
),
|
|
7098
|
-
!j && (
|
|
7106
|
+
!j && (Rr === k.field ? /* @__PURE__ */ s(Sn, { className: "absolute top-2 right-2 h-3 w-3 text-green-500" }) : /* @__PURE__ */ s(
|
|
7099
7107
|
"button",
|
|
7100
7108
|
{
|
|
7101
7109
|
type: "button",
|
|
@@ -7106,7 +7114,7 @@ ${i.join(`
|
|
|
7106
7114
|
),
|
|
7107
7115
|
k.field
|
|
7108
7116
|
),
|
|
7109
|
-
children: /* @__PURE__ */ s(
|
|
7117
|
+
children: /* @__PURE__ */ s(Ur, { className: "h-3 w-3 text-slate-300 dark:text-slate-600 hover:text-slate-500 dark:hover:text-slate-400" })
|
|
7110
7118
|
}
|
|
7111
7119
|
))
|
|
7112
7120
|
]
|
|
@@ -7139,7 +7147,7 @@ ${i.join(`
|
|
|
7139
7147
|
className: cd,
|
|
7140
7148
|
"data-header-value": !0,
|
|
7141
7149
|
children: /* @__PURE__ */ s(
|
|
7142
|
-
|
|
7150
|
+
hg,
|
|
7143
7151
|
{
|
|
7144
7152
|
collection: Tt,
|
|
7145
7153
|
itemId: It
|
|
@@ -7147,7 +7155,7 @@ ${i.join(`
|
|
|
7147
7155
|
)
|
|
7148
7156
|
}
|
|
7149
7157
|
),
|
|
7150
|
-
|
|
7158
|
+
Rr === "__owners__" ? /* @__PURE__ */ s(Sn, { className: "absolute top-2 right-2 h-3 w-3 text-green-500" }) : /* @__PURE__ */ s(
|
|
7151
7159
|
"button",
|
|
7152
7160
|
{
|
|
7153
7161
|
type: "button",
|
|
@@ -7158,7 +7166,7 @@ ${i.join(`
|
|
|
7158
7166
|
),
|
|
7159
7167
|
"__owners__"
|
|
7160
7168
|
),
|
|
7161
|
-
children: /* @__PURE__ */ s(
|
|
7169
|
+
children: /* @__PURE__ */ s(Ur, { className: "h-3 w-3 text-slate-300 dark:text-slate-600 hover:text-slate-500 dark:hover:text-slate-400" })
|
|
7162
7170
|
}
|
|
7163
7171
|
)
|
|
7164
7172
|
]
|
|
@@ -7225,7 +7233,7 @@ ${i.join(`
|
|
|
7225
7233
|
);
|
|
7226
7234
|
const k = r.cmsField ? /* @__PURE__ */ y(pt, { children: [
|
|
7227
7235
|
/* @__PURE__ */ s(
|
|
7228
|
-
|
|
7236
|
+
Bm,
|
|
7229
7237
|
{
|
|
7230
7238
|
field: r.cmsField,
|
|
7231
7239
|
val: d,
|
|
@@ -7236,7 +7244,7 @@ ${i.join(`
|
|
|
7236
7244
|
}
|
|
7237
7245
|
),
|
|
7238
7246
|
(r.cmsField.computed_type === "rollup" || (r.cmsField.computed_type === "read" || r.cmsField.computed_type === "write") && x) && !g && !He && /* @__PURE__ */ s(
|
|
7239
|
-
|
|
7247
|
+
Jm,
|
|
7240
7248
|
{
|
|
7241
7249
|
collection: a,
|
|
7242
7250
|
itemId: m,
|
|
@@ -7244,7 +7252,7 @@ ${i.join(`
|
|
|
7244
7252
|
}
|
|
7245
7253
|
),
|
|
7246
7254
|
!r.cmsField.computed_type && !g && !He && /* @__PURE__ */ s(
|
|
7247
|
-
|
|
7255
|
+
Vm,
|
|
7248
7256
|
{
|
|
7249
7257
|
collection: a,
|
|
7250
7258
|
itemId: m,
|
|
@@ -7256,7 +7264,7 @@ ${i.join(`
|
|
|
7256
7264
|
"span",
|
|
7257
7265
|
{
|
|
7258
7266
|
className: `${x ? Kf : Bf} ${v}`,
|
|
7259
|
-
children:
|
|
7267
|
+
children: xg(
|
|
7260
7268
|
d,
|
|
7261
7269
|
r.displayFormat
|
|
7262
7270
|
)
|
|
@@ -7287,7 +7295,7 @@ ${i.join(`
|
|
|
7287
7295
|
})()
|
|
7288
7296
|
}
|
|
7289
7297
|
),
|
|
7290
|
-
|
|
7298
|
+
Rr === r.field ? /* @__PURE__ */ s(Sn, { className: "absolute top-2 right-2 h-3 w-3 text-green-500" }) : /* @__PURE__ */ s(
|
|
7291
7299
|
"button",
|
|
7292
7300
|
{
|
|
7293
7301
|
type: "button",
|
|
@@ -7314,7 +7322,7 @@ ${i.join(`
|
|
|
7314
7322
|
1500
|
|
7315
7323
|
));
|
|
7316
7324
|
},
|
|
7317
|
-
children: /* @__PURE__ */ s(
|
|
7325
|
+
children: /* @__PURE__ */ s(Ur, { className: "h-3 w-3 text-slate-300 dark:text-slate-600 hover:text-slate-500 dark:hover:text-slate-400" })
|
|
7318
7326
|
}
|
|
7319
7327
|
)
|
|
7320
7328
|
]
|
|
@@ -7325,7 +7333,7 @@ ${i.join(`
|
|
|
7325
7333
|
);
|
|
7326
7334
|
});
|
|
7327
7335
|
return /* @__PURE__ */ y(pt, { children: [
|
|
7328
|
-
/* @__PURE__ */ s(
|
|
7336
|
+
/* @__PURE__ */ s(zm, { tiles: e, folded: ta ? wc : [] }),
|
|
7329
7337
|
!g && m && // Below lg the Integrations chip ends the last row
|
|
7330
7338
|
// (the column dock is lg-only) — never a third shelf.
|
|
7331
7339
|
/* @__PURE__ */ s(
|
|
@@ -7374,10 +7382,10 @@ ${i.join(`
|
|
|
7374
7382
|
),
|
|
7375
7383
|
onScroll: Kn ? na : void 0,
|
|
7376
7384
|
children: [
|
|
7377
|
-
!g && /* @__PURE__ */ s(
|
|
7385
|
+
!g && /* @__PURE__ */ s(kp, {}),
|
|
7378
7386
|
Jd,
|
|
7379
7387
|
dc && sl.length > 0 && /* @__PURE__ */ s(
|
|
7380
|
-
|
|
7388
|
+
Pp,
|
|
7381
7389
|
{
|
|
7382
7390
|
items: sl,
|
|
7383
7391
|
onJump: Qa,
|
|
@@ -7411,21 +7419,21 @@ ${i.join(`
|
|
|
7411
7419
|
]
|
|
7412
7420
|
}
|
|
7413
7421
|
),
|
|
7414
|
-
!K && yt != null && /* @__PURE__ */ s(
|
|
7422
|
+
!K && yt != null && /* @__PURE__ */ s(vm, { layoutId: yt }),
|
|
7415
7423
|
Yd && /* @__PURE__ */ s(
|
|
7416
|
-
|
|
7424
|
+
Kp,
|
|
7417
7425
|
{
|
|
7418
|
-
roles:
|
|
7419
|
-
roleId:
|
|
7426
|
+
roles: Ae.roles,
|
|
7427
|
+
roleId: Ae.roleId,
|
|
7420
7428
|
onChange: (e) => {
|
|
7421
|
-
|
|
7429
|
+
Ae.setRoleId(e), e || Fo(!1);
|
|
7422
7430
|
},
|
|
7423
|
-
preview:
|
|
7424
|
-
loading:
|
|
7431
|
+
preview: Ae.preview,
|
|
7432
|
+
loading: Ae.loading
|
|
7425
7433
|
}
|
|
7426
7434
|
),
|
|
7427
7435
|
!g && Kt && /* @__PURE__ */ s("div", { className: "nvr-expand-in", children: /* @__PURE__ */ s(
|
|
7428
|
-
|
|
7436
|
+
Tp,
|
|
7429
7437
|
{
|
|
7430
7438
|
entry: Kt,
|
|
7431
7439
|
labelFor: (e) => {
|
|
@@ -7438,7 +7446,7 @@ ${i.join(`
|
|
|
7438
7446
|
}
|
|
7439
7447
|
) }),
|
|
7440
7448
|
pn.state === "offer" && /* @__PURE__ */ s("div", { className: "nvr-expand-in", children: /* @__PURE__ */ s(
|
|
7441
|
-
|
|
7449
|
+
Im,
|
|
7442
7450
|
{
|
|
7443
7451
|
draft: pn.draft,
|
|
7444
7452
|
labelFor: (e) => {
|
|
@@ -7454,7 +7462,7 @@ ${i.join(`
|
|
|
7454
7462
|
}
|
|
7455
7463
|
) }),
|
|
7456
7464
|
!g && m && !K && /* @__PURE__ */ s(
|
|
7457
|
-
|
|
7465
|
+
Ip,
|
|
7458
7466
|
{
|
|
7459
7467
|
collection: a,
|
|
7460
7468
|
itemId: String(m)
|
|
@@ -7463,26 +7471,26 @@ ${i.join(`
|
|
|
7463
7471
|
!g && m && // Design mode: the live check stores its result.
|
|
7464
7472
|
!K && !((Xl = w == null ? void 0 : w.layout) != null && Xl.hide_integrity_banner) && // Summary mode marks the affected fields instead —
|
|
7465
7473
|
// the banner would only push the record down.
|
|
7466
|
-
!(
|
|
7467
|
-
|
|
7474
|
+
!(Ct && yi) && /* @__PURE__ */ s(
|
|
7475
|
+
Bp,
|
|
7468
7476
|
{
|
|
7469
7477
|
collection: a,
|
|
7470
7478
|
itemId: String(m),
|
|
7471
7479
|
onJumpToField: Qi
|
|
7472
7480
|
}
|
|
7473
7481
|
),
|
|
7474
|
-
|
|
7475
|
-
|
|
7482
|
+
$t && !K && !!((td = (ed = Li.data) == null ? void 0 : ed.hidden) != null && td.length) && /* @__PURE__ */ s(
|
|
7483
|
+
lp,
|
|
7476
7484
|
{
|
|
7477
7485
|
why: Li.data,
|
|
7478
7486
|
fields: A ?? [],
|
|
7479
|
-
stepVisible:
|
|
7487
|
+
stepVisible: Ir
|
|
7480
7488
|
}
|
|
7481
7489
|
),
|
|
7482
7490
|
!g && m && !((nd = w == null ? void 0 : w.layout) != null && nd.hide_sla_banner) && // No wrapper div — an EMPTY sibling in this space-y stack
|
|
7483
7491
|
// still costs a 16px gap (the banner is null unless breached).
|
|
7484
7492
|
/* @__PURE__ */ s(
|
|
7485
|
-
|
|
7493
|
+
Dp,
|
|
7486
7494
|
{
|
|
7487
7495
|
collection: Tt,
|
|
7488
7496
|
itemId: String(It)
|
|
@@ -7496,12 +7504,12 @@ ${i.join(`
|
|
|
7496
7504
|
}
|
|
7497
7505
|
),
|
|
7498
7506
|
fn && Fs && In && /* @__PURE__ */ s("div", { className: "nvr-expand-in", children: /* @__PURE__ */ s(
|
|
7499
|
-
|
|
7507
|
+
dg,
|
|
7500
7508
|
{
|
|
7501
7509
|
lockHolder: In,
|
|
7502
7510
|
onTakeOver: Mc,
|
|
7503
7511
|
takingOver: Pc,
|
|
7504
|
-
isAdmin:
|
|
7512
|
+
isAdmin: $t,
|
|
7505
7513
|
onRequestLock: Lc,
|
|
7506
7514
|
requesting: Kc,
|
|
7507
7515
|
queue: ka,
|
|
@@ -7512,7 +7520,7 @@ ${i.join(`
|
|
|
7512
7520
|
}
|
|
7513
7521
|
) }),
|
|
7514
7522
|
!g && !K && /* @__PURE__ */ s(
|
|
7515
|
-
|
|
7523
|
+
qp,
|
|
7516
7524
|
{
|
|
7517
7525
|
collection: a,
|
|
7518
7526
|
itemId: String(m),
|
|
@@ -7545,8 +7553,8 @@ ${i.join(`
|
|
|
7545
7553
|
]
|
|
7546
7554
|
}
|
|
7547
7555
|
),
|
|
7548
|
-
yi ?
|
|
7549
|
-
|
|
7556
|
+
yi ? Ct && !g && (w != null && w.layout) ? /* @__PURE__ */ s(
|
|
7557
|
+
zp,
|
|
7550
7558
|
{
|
|
7551
7559
|
collection: a,
|
|
7552
7560
|
itemId: String(m),
|
|
@@ -7579,21 +7587,21 @@ ${i.join(`
|
|
|
7579
7587
|
`summary-grid-${e.field}`
|
|
7580
7588
|
) : null;
|
|
7581
7589
|
},
|
|
7582
|
-
gridCounts:
|
|
7590
|
+
gridCounts: Ft
|
|
7583
7591
|
}
|
|
7584
|
-
) :
|
|
7592
|
+
) : it ? Et ? Yu() : Uu() : Hu() : /* @__PURE__ */ y(
|
|
7585
7593
|
"div",
|
|
7586
7594
|
{
|
|
7587
7595
|
"data-summary-mode-pending": !0,
|
|
7588
7596
|
"aria-busy": "true",
|
|
7589
7597
|
className: "space-y-4",
|
|
7590
7598
|
children: [
|
|
7591
|
-
/* @__PURE__ */ s(
|
|
7599
|
+
/* @__PURE__ */ s(Xr, { className: "h-10 w-full" }),
|
|
7592
7600
|
/* @__PURE__ */ y("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
7593
|
-
/* @__PURE__ */ s(
|
|
7594
|
-
/* @__PURE__ */ s(
|
|
7601
|
+
/* @__PURE__ */ s(Xr, { className: "h-40 w-full" }),
|
|
7602
|
+
/* @__PURE__ */ s(Xr, { className: "h-40 w-full" })
|
|
7595
7603
|
] }),
|
|
7596
|
-
/* @__PURE__ */ s(
|
|
7604
|
+
/* @__PURE__ */ s(Xr, { className: "h-56 w-full" })
|
|
7597
7605
|
]
|
|
7598
7606
|
}
|
|
7599
7607
|
),
|
|
@@ -7608,13 +7616,13 @@ ${i.join(`
|
|
|
7608
7616
|
type: "button",
|
|
7609
7617
|
onClick: () => {
|
|
7610
7618
|
const e = !_n;
|
|
7611
|
-
Ji(e), K &&
|
|
7619
|
+
Ji(e), K && ig(Re, e);
|
|
7612
7620
|
},
|
|
7613
7621
|
"data-design-pass": K ? "" : void 0,
|
|
7614
7622
|
"data-summary-toggle": K ? "" : void 0,
|
|
7615
7623
|
"aria-expanded": K ? !_n : void 0,
|
|
7616
7624
|
title: _n ? "Expand summary" : "Collapse summary",
|
|
7617
|
-
className: K ?
|
|
7625
|
+
className: K ? bg : "border-r flex w-6 shrink-0 items-start justify-center pt-3 bg-slate-100 text-slate-400 hover:bg-slate-200/70 hover:text-slate-600 transition-colors dark:bg-white/[0.04] dark:hover:bg-white/[0.08] dark:text-slate-500 dark:hover:text-slate-300",
|
|
7618
7626
|
children: K ? (
|
|
7619
7627
|
// Rides with the canvas scroll; folded, it says what comes back.
|
|
7620
7628
|
/* @__PURE__ */ y("span", { className: "sticky top-3 flex flex-col items-center gap-2", children: [
|
|
@@ -7630,7 +7638,7 @@ ${i.join(`
|
|
|
7630
7638
|
className: "overflow-hidden transition-all duration-200",
|
|
7631
7639
|
style: { width: _n ? 0 : 232 },
|
|
7632
7640
|
children: /* @__PURE__ */ s("div", { className: "w-[232px] overflow-y-auto h-full", children: /* @__PURE__ */ s(
|
|
7633
|
-
|
|
7641
|
+
Yp,
|
|
7634
7642
|
{
|
|
7635
7643
|
onRevertChange: (e) => {
|
|
7636
7644
|
var t;
|
|
@@ -7645,7 +7653,7 @@ ${i.join(`
|
|
|
7645
7653
|
key: e.key,
|
|
7646
7654
|
label: e.label
|
|
7647
7655
|
})) : le,
|
|
7648
|
-
groupedMap:
|
|
7656
|
+
groupedMap: Ie,
|
|
7649
7657
|
ungroupedFields: vt,
|
|
7650
7658
|
sectionGroups: kt.filter(
|
|
7651
7659
|
(e) => e.type !== "metadata"
|
|
@@ -7655,9 +7663,9 @@ ${i.join(`
|
|
|
7655
7663
|
collection: a,
|
|
7656
7664
|
itemId: m,
|
|
7657
7665
|
staging: ge,
|
|
7658
|
-
errors:
|
|
7666
|
+
errors: at,
|
|
7659
7667
|
staleFields: Xc,
|
|
7660
|
-
changedFields:
|
|
7668
|
+
changedFields: Jr,
|
|
7661
7669
|
aliasEmptiness: {
|
|
7662
7670
|
// O2M aliases: effective row count (saved − staged
|
|
7663
7671
|
// deletes + pending) — without this a populated grid
|
|
@@ -7665,7 +7673,7 @@ ${i.join(`
|
|
|
7665
7673
|
...Object.fromEntries(
|
|
7666
7674
|
[...nn].map((e) => [
|
|
7667
7675
|
e,
|
|
7668
|
-
e in
|
|
7676
|
+
e in Ft ? Ft[e] === 0 : null
|
|
7669
7677
|
])
|
|
7670
7678
|
),
|
|
7671
7679
|
...Object.fromEntries(
|
|
@@ -7685,9 +7693,9 @@ ${i.join(`
|
|
|
7685
7693
|
(l) => l.type === "tab" && l.container_id === o.id && l.key === e
|
|
7686
7694
|
)
|
|
7687
7695
|
);
|
|
7688
|
-
r ? (Wn(r, e), Us()) :
|
|
7696
|
+
r ? (Wn(r, e), Us()) : xt(e);
|
|
7689
7697
|
} else
|
|
7690
|
-
|
|
7698
|
+
xt(e);
|
|
7691
7699
|
let n = 0;
|
|
7692
7700
|
const i = () => {
|
|
7693
7701
|
const r = document.querySelector(
|
|
@@ -7738,7 +7746,7 @@ ${i.join(`
|
|
|
7738
7746
|
}
|
|
7739
7747
|
);
|
|
7740
7748
|
}
|
|
7741
|
-
function
|
|
7749
|
+
function Ig({
|
|
7742
7750
|
collision: a,
|
|
7743
7751
|
fieldLabel: O,
|
|
7744
7752
|
onCancel: z,
|
|
@@ -7754,7 +7762,7 @@ function Tg({
|
|
|
7754
7762
|
/* @__PURE__ */ s("p", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Someone else changed this record" }),
|
|
7755
7763
|
/* @__PURE__ */ s("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally." }),
|
|
7756
7764
|
/* @__PURE__ */ s("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: a.conflicts.map((se) => {
|
|
7757
|
-
const
|
|
7765
|
+
const qe = H.has(se.field);
|
|
7758
7766
|
return /* @__PURE__ */ y(
|
|
7759
7767
|
"div",
|
|
7760
7768
|
{
|
|
@@ -7767,7 +7775,7 @@ function Tg({
|
|
|
7767
7775
|
{
|
|
7768
7776
|
type: "button",
|
|
7769
7777
|
onClick: () => Q((Pe) => /* @__PURE__ */ new Set([...Pe, se.field])),
|
|
7770
|
-
className:
|
|
7778
|
+
className: qe ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
|
|
7771
7779
|
children: [
|
|
7772
7780
|
/* @__PURE__ */ s("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
|
|
7773
7781
|
/* @__PURE__ */ s("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: ie(se.current_value) })
|
|
@@ -7782,7 +7790,7 @@ function Tg({
|
|
|
7782
7790
|
const B = new Set(Pe);
|
|
7783
7791
|
return B.delete(se.field), B;
|
|
7784
7792
|
}),
|
|
7785
|
-
className:
|
|
7793
|
+
className: qe ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
|
|
7786
7794
|
children: [
|
|
7787
7795
|
/* @__PURE__ */ s("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
|
|
7788
7796
|
/* @__PURE__ */ s("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: ie(a.mine[se.field]) })
|
|
@@ -7821,19 +7829,19 @@ function Tg({
|
|
|
7821
7829
|
);
|
|
7822
7830
|
}
|
|
7823
7831
|
export {
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7832
|
+
Xy as ItemEditForm,
|
|
7833
|
+
up as M2MStagingContext,
|
|
7834
|
+
Sg as UnsavedInspector,
|
|
7835
|
+
Rg as appendUniqueM2MId,
|
|
7836
|
+
Ng as applyLayoutDefaults,
|
|
7837
|
+
Cg as computeM2MEffectiveIds,
|
|
7838
|
+
jg as dropUnsettledAliasResults,
|
|
7831
7839
|
Sf as formatApiPayload,
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7840
|
+
Og as idsNeedingStaging,
|
|
7841
|
+
$g as mergeRuleResults,
|
|
7842
|
+
qg as partitionRuleResults,
|
|
7835
7843
|
Fd as resolveM2MAlias,
|
|
7836
|
-
|
|
7844
|
+
Fg as resolveM2MFieldState,
|
|
7837
7845
|
Od as rulesForTriggerField,
|
|
7838
|
-
|
|
7846
|
+
n_ as useM2MStaging
|
|
7839
7847
|
};
|