@nivaro/react 0.3.139 → 0.3.140
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/InlineGridField.js +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { sortableKeyboardCoordinates as
|
|
4
|
-
import { CSS as
|
|
2
|
+
import { useSensors as sa, useSensor as st, PointerSensor as ra, KeyboardSensor as la, DndContext as Ze, closestCenter as et } from "@dnd-kit/core";
|
|
3
|
+
import { sortableKeyboardCoordinates as ia, SortableContext as tt, verticalListSortingStrategy as at, arrayMove as nt, useSortable as wt } from "@dnd-kit/sortable";
|
|
4
|
+
import { CSS as kt } from "@dnd-kit/utilities";
|
|
5
5
|
import { useMutation as z, useQueryClient as Ce, useQuery as I } from "@tanstack/react-query";
|
|
6
|
-
import { X as Ne, ArrowLeft as
|
|
7
|
-
import { useState as A, useEffect as he, useMemo as
|
|
8
|
-
import { createPortal as
|
|
6
|
+
import { X as Ne, ArrowLeft as Ba, Check as we, Pencil as je, Download as Wa, Plus as ye, Trash2 as ke, ArrowRight as oa, Zap as Ua, PlugZap as Qa, Filter as _t, Link2 as Ht, LayoutGrid as Ha, Link2Off as Va, ListChecks as ca, Loader2 as _e, GripVertical as Ct, Settings as Ia, GitFork as Ya, ChevronDown as Le, Search as St, History as Ga, ChevronRight as qt, ExternalLink as Ja } from "lucide-react";
|
|
7
|
+
import { useState as A, useEffect as he, useMemo as gt, useContext as da, useRef as Be, createContext as Xa } from "react";
|
|
8
|
+
import { createPortal as Za } from "react-dom";
|
|
9
9
|
import { toast as D } from "sonner";
|
|
10
|
-
import { useNivaroClient as Z, ItemEditAuthContext as
|
|
10
|
+
import { useNivaroClient as Z, ItemEditAuthContext as en, useNavigation as ma } from "../../context.js";
|
|
11
11
|
import { post as J, get as Y, patch as ve, del as Fe } from "../../lib/commands.js";
|
|
12
|
-
import { describeTransition as
|
|
13
|
-
import { useConfigWatch as
|
|
14
|
-
import { toastError as
|
|
15
|
-
import { useLiveFade as
|
|
16
|
-
import { queryKeys as
|
|
17
|
-
import { useStateCensus as
|
|
18
|
-
import { cn as H, formatRelative as
|
|
19
|
-
import { ExplainCard as
|
|
20
|
-
import { ConfigChangeStrip as
|
|
21
|
-
import { ConfigHistoryButton as
|
|
22
|
-
import { ConfigReachNote as
|
|
23
|
-
import { ConfigReadBack as
|
|
24
|
-
import { PipelineCumulativeFlowCard as
|
|
25
|
-
import { useCollectionBody as
|
|
26
|
-
import { ConfirmButton as
|
|
27
|
-
import { QueryErrorState as
|
|
28
|
-
import { Term as
|
|
12
|
+
import { describeTransition as tn, sentenceLabelsFromFields as an } from "../../lib/config-sentences.js";
|
|
13
|
+
import { useConfigWatch as nn } from "../../lib/config-watch.js";
|
|
14
|
+
import { toastError as Vt } from "../../lib/error-toast.js";
|
|
15
|
+
import { useLiveFade as sn } from "../../lib/live-screen.js";
|
|
16
|
+
import { queryKeys as We } from "../../lib/query-keys.js";
|
|
17
|
+
import { useStateCensus as pa, censusByState as rn, oldestHint as ln, stateListPath as on } from "../../lib/state-census.js";
|
|
18
|
+
import { formatNumber as Re, cn as H, formatRelative as cn, titleCase as Se } from "../../lib/utils.js";
|
|
19
|
+
import { ExplainCard as dn } from "../ai/ExplainButton.js";
|
|
20
|
+
import { ConfigChangeStrip as mn } from "../ConfigChangeStrip.js";
|
|
21
|
+
import { ConfigHistoryButton as pn } from "../ConfigHistory.js";
|
|
22
|
+
import { ConfigReachNote as ua } from "../ConfigReachNote.js";
|
|
23
|
+
import { ConfigReadBack as un } from "../ConfigReadBack.js";
|
|
24
|
+
import { PipelineCumulativeFlowCard as hn } from "../charts/CumulativeFlowChart.js";
|
|
25
|
+
import { useCollectionBody as xn } from "../layout-editor/collection-meta.js";
|
|
26
|
+
import { ConfirmButton as Me } from "../profile/primitives.js";
|
|
27
|
+
import { QueryErrorState as fn } from "../QueryErrorState.js";
|
|
28
|
+
import { Term as It } from "../Term.js";
|
|
29
29
|
import { Badge as qe } from "../ui/badge.js";
|
|
30
30
|
import { Button as P } from "../ui/button.js";
|
|
31
31
|
import { Input as Q } from "../ui/input.js";
|
|
32
32
|
import { Label as V } from "../ui/label.js";
|
|
33
|
-
import { Popover as
|
|
34
|
-
import { Select as
|
|
35
|
-
import { Skeleton as
|
|
33
|
+
import { Popover as Ue, PopoverTrigger as Qe, PopoverContent as He } from "../ui/popover.js";
|
|
34
|
+
import { Select as gn, SelectTrigger as bn, SelectValue as vn, SelectContent as yn, SelectItem as Nn } from "../ui/select.js";
|
|
35
|
+
import { Skeleton as ze } from "../ui/skeleton.js";
|
|
36
36
|
import { Switch as Ae } from "../ui/switch.js";
|
|
37
|
-
import { Textarea as
|
|
38
|
-
import { BindingStartStateSettings as
|
|
39
|
-
import { FieldPicker as
|
|
40
|
-
import { OwnerMatrix as
|
|
41
|
-
import { OwnerMatrixSheetActions as
|
|
42
|
-
import { OwnerMatrixVersionsCard as
|
|
43
|
-
import { openWhenFromDraft as
|
|
44
|
-
import { TemplateLintCard as
|
|
45
|
-
import { PipelineSkipCriteria as
|
|
46
|
-
import { PipelineStateOwners as
|
|
47
|
-
import { findM2ORelation as
|
|
48
|
-
import { TeamsView as
|
|
49
|
-
import { useScopeDimensions as
|
|
50
|
-
const
|
|
37
|
+
import { Textarea as ha } from "../ui/textarea.js";
|
|
38
|
+
import { BindingStartStateSettings as wn } from "./BindingStartStateSettings.js";
|
|
39
|
+
import { FieldPicker as bt } from "./FieldPicker.js";
|
|
40
|
+
import { OwnerMatrix as kn } from "./OwnerMatrix.js";
|
|
41
|
+
import { OwnerMatrixSheetActions as _n } from "./OwnerMatrixSheet.js";
|
|
42
|
+
import { OwnerMatrixVersionsCard as Cn } from "./OwnerMatrixVersionsCard.js";
|
|
43
|
+
import { openWhenFromDraft as vt, draftFromOpenWhen as xa, incompleteOpenWhen as Sn, ALL_COLLECTIONS as yt } from "./open-when-draft.js";
|
|
44
|
+
import { TemplateLintCard as qn, SkipReportCard as $n } from "./PipelineHealthCards.js";
|
|
45
|
+
import { PipelineSkipCriteria as Fn } from "./PipelineSkipCriteria.js";
|
|
46
|
+
import { PipelineStateOwners as En } from "./PipelineStateOwners.js";
|
|
47
|
+
import { findM2ORelation as On, extractTemplateFields as An, renderDisplayTemplate as ut } from "./relations.js";
|
|
48
|
+
import { TeamsView as Rn } from "./TeamsView.js";
|
|
49
|
+
import { useScopeDimensions as Ln, rankTeamForFilters as Tn, tierOrder as Yt } from "./teamScopes.js";
|
|
50
|
+
const fa = "rgb(var(--nvr-cyan-rgb, 0 206 255))", Ke = "rounded bg-red-50 px-1.5 text-[11px] font-semibold text-red-700 hover:text-red-700 dark:bg-red-500/10 dark:text-red-400";
|
|
51
51
|
function ee({
|
|
52
52
|
value: t,
|
|
53
53
|
onChange: s,
|
|
@@ -57,7 +57,7 @@ function ee({
|
|
|
57
57
|
className: c
|
|
58
58
|
}) {
|
|
59
59
|
var h;
|
|
60
|
-
const [o, m] = A(!1), [p, g] = A(""), f =
|
|
60
|
+
const [o, m] = A(!1), [p, g] = A(""), f = Be(null);
|
|
61
61
|
he(() => {
|
|
62
62
|
o ? setTimeout(() => {
|
|
63
63
|
var d;
|
|
@@ -65,16 +65,16 @@ function ee({
|
|
|
65
65
|
}, 50) : g("");
|
|
66
66
|
}, [o]);
|
|
67
67
|
const i = p.trim() ? l.filter((d) => d.label.toLowerCase().includes(p.toLowerCase())) : l, v = t ? ((h = l.find((d) => d.value === t)) == null ? void 0 : h.label) ?? t : null;
|
|
68
|
-
return /* @__PURE__ */ a(
|
|
68
|
+
return /* @__PURE__ */ a(Ue, { open: o, onOpenChange: m, children: [
|
|
69
69
|
/* @__PURE__ */ a("div", { className: H("relative flex h-8 w-full", c), children: [
|
|
70
|
-
/* @__PURE__ */ e(
|
|
70
|
+
/* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
71
71
|
"button",
|
|
72
72
|
{
|
|
73
73
|
type: "button",
|
|
74
74
|
className: "flex h-full w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[13px] text-slate-700 hover:border-slate-300",
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ e("span", { className: v ? "" : "text-slate-400", children: v ?? x }),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
77
|
+
/* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
) }),
|
|
@@ -90,9 +90,9 @@ function ee({
|
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
] }),
|
|
93
|
-
/* @__PURE__ */ a(
|
|
93
|
+
/* @__PURE__ */ a(He, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
|
|
94
94
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
95
|
-
/* @__PURE__ */ e(
|
|
95
|
+
/* @__PURE__ */ e(St, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
96
96
|
/* @__PURE__ */ e(
|
|
97
97
|
"input",
|
|
98
98
|
{
|
|
@@ -144,14 +144,14 @@ function ee({
|
|
|
144
144
|
] })
|
|
145
145
|
] });
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function ga({
|
|
148
148
|
values: t,
|
|
149
149
|
onChange: s,
|
|
150
150
|
options: l,
|
|
151
151
|
placeholder: x = "Select states…"
|
|
152
152
|
}) {
|
|
153
153
|
var v;
|
|
154
|
-
const [r, c] = A(!1), [o, m] = A(""), p =
|
|
154
|
+
const [r, c] = A(!1), [o, m] = A(""), p = Be(null);
|
|
155
155
|
he(() => {
|
|
156
156
|
r ? setTimeout(() => {
|
|
157
157
|
var h;
|
|
@@ -163,16 +163,16 @@ function fa({
|
|
|
163
163
|
s(t.includes(h) ? t.filter((d) => d !== h) : [...t, h]);
|
|
164
164
|
}
|
|
165
165
|
const i = t.length === 0 ? null : t.length === 1 ? ((v = l.find((h) => h.value === t[0])) == null ? void 0 : v.label) ?? t[0] : `${t.length} states`;
|
|
166
|
-
return /* @__PURE__ */ a(
|
|
166
|
+
return /* @__PURE__ */ a(Ue, { open: r, onOpenChange: c, children: [
|
|
167
167
|
/* @__PURE__ */ a("div", { className: "relative flex h-8 w-full", children: [
|
|
168
|
-
/* @__PURE__ */ e(
|
|
168
|
+
/* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
169
169
|
"button",
|
|
170
170
|
{
|
|
171
171
|
type: "button",
|
|
172
172
|
className: "flex h-full w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[13px] text-slate-700 hover:border-slate-300",
|
|
173
173
|
children: [
|
|
174
174
|
/* @__PURE__ */ e("span", { className: i ? "" : "text-slate-400", children: i ?? x }),
|
|
175
|
-
/* @__PURE__ */ e(
|
|
175
|
+
/* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
) }),
|
|
@@ -188,9 +188,9 @@ function fa({
|
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
] }),
|
|
191
|
-
/* @__PURE__ */ a(
|
|
191
|
+
/* @__PURE__ */ a(He, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
|
|
192
192
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
193
|
-
/* @__PURE__ */ e(
|
|
193
|
+
/* @__PURE__ */ e(St, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
194
194
|
/* @__PURE__ */ e(
|
|
195
195
|
"input",
|
|
196
196
|
{
|
|
@@ -229,7 +229,7 @@ function fa({
|
|
|
229
229
|
] })
|
|
230
230
|
] });
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const Pn = [
|
|
233
233
|
"#6b7280",
|
|
234
234
|
"#ef4444",
|
|
235
235
|
"#f97316",
|
|
@@ -240,7 +240,7 @@ const Tn = [
|
|
|
240
240
|
"#8b5cf6",
|
|
241
241
|
"#ec4899"
|
|
242
242
|
];
|
|
243
|
-
function
|
|
243
|
+
function rt({
|
|
244
244
|
value: t,
|
|
245
245
|
onChange: s
|
|
246
246
|
}) {
|
|
@@ -257,7 +257,7 @@ function st({
|
|
|
257
257
|
title: "No color"
|
|
258
258
|
}
|
|
259
259
|
),
|
|
260
|
-
|
|
260
|
+
Pn.map((l) => /* @__PURE__ */ e(
|
|
261
261
|
"button",
|
|
262
262
|
{
|
|
263
263
|
type: "button",
|
|
@@ -273,7 +273,7 @@ function st({
|
|
|
273
273
|
))
|
|
274
274
|
] });
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Gt({ state: t, small: s }) {
|
|
277
277
|
return /* @__PURE__ */ a(
|
|
278
278
|
"span",
|
|
279
279
|
{
|
|
@@ -291,7 +291,7 @@ function Yt({ state: t, small: s }) {
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Jt({
|
|
295
295
|
initial: t,
|
|
296
296
|
onSave: s,
|
|
297
297
|
onCancel: l,
|
|
@@ -360,7 +360,7 @@ function Gt({
|
|
|
360
360
|
] }),
|
|
361
361
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
362
362
|
/* @__PURE__ */ e(V, { className: "text-[12px]", children: "Color" }),
|
|
363
|
-
/* @__PURE__ */ e(
|
|
363
|
+
/* @__PURE__ */ e(rt, { value: c.color, onChange: (p) => m("color", p) })
|
|
364
364
|
] }),
|
|
365
365
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
366
366
|
/* @__PURE__ */ e(V, { className: "text-[12px]", children: "Help text" }),
|
|
@@ -466,7 +466,7 @@ function Gt({
|
|
|
466
466
|
] }, p.value)) })
|
|
467
467
|
] }),
|
|
468
468
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
|
|
469
|
-
r && r.length > 0 && /* @__PURE__ */ e(
|
|
469
|
+
r && r.length > 0 && /* @__PURE__ */ e(ua, { className: "mr-auto min-w-0", collections: r }),
|
|
470
470
|
/* @__PURE__ */ e(P, { type: "button", variant: "outline", size: "sm", onClick: l, children: "Cancel" }),
|
|
471
471
|
/* @__PURE__ */ e(
|
|
472
472
|
P,
|
|
@@ -481,19 +481,19 @@ function Gt({
|
|
|
481
481
|
] })
|
|
482
482
|
] });
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Xt(t) {
|
|
485
485
|
return !t || t.length === 0 ? "" : [...t].sort(
|
|
486
486
|
(s, l) => `${s.field}${s.op}${String(s.value)}`.localeCompare(`${l.field}${l.op}${String(l.value)}`)
|
|
487
487
|
).map((s) => `${s.field}:${s.op}:${String(s.value ?? "")}`).join("|");
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Zt(t) {
|
|
490
490
|
const s = /* @__PURE__ */ new Map();
|
|
491
491
|
for (const x of t) {
|
|
492
492
|
s.has(x.label) || s.set(x.label, { label: x.label, color: x.color, routes: [], minSort: x.sort });
|
|
493
493
|
const r = s.get(x.label);
|
|
494
494
|
r.minSort = Math.min(r.minSort, x.sort);
|
|
495
|
-
const c =
|
|
496
|
-
(m) => m.from_state === x.from_state &&
|
|
495
|
+
const c = Xt(x.condition_rules), o = r.routes.find(
|
|
496
|
+
(m) => m.from_state === x.from_state && Xt(m.condition_rules) === c
|
|
497
497
|
);
|
|
498
498
|
o ? (o.ids.push(x.id), o.to_states.push(x.to_state), o.minSort = Math.min(o.minSort, x.sort)) : r.routes.push({
|
|
499
499
|
ids: [x.id],
|
|
@@ -519,17 +519,17 @@ function Xt(t) {
|
|
|
519
519
|
for (const x of l) x.routes.sort((r, c) => r.minSort - c.minSort);
|
|
520
520
|
return l;
|
|
521
521
|
}
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
const { attributes: l, listeners: x, setNodeRef: r, transform: c, transition: o, isDragging: m } =
|
|
522
|
+
const ba = Xa(null);
|
|
523
|
+
function ea({ id: t, children: s }) {
|
|
524
|
+
const { attributes: l, listeners: x, setNodeRef: r, transform: c, transition: o, isDragging: m } = wt({
|
|
525
525
|
id: t
|
|
526
526
|
});
|
|
527
|
-
return /* @__PURE__ */ e(
|
|
527
|
+
return /* @__PURE__ */ e(ba.Provider, { value: { listeners: x, attributes: l }, children: /* @__PURE__ */ e(
|
|
528
528
|
"div",
|
|
529
529
|
{
|
|
530
530
|
ref: r,
|
|
531
531
|
style: {
|
|
532
|
-
transform:
|
|
532
|
+
transform: kt.Transform.toString(c),
|
|
533
533
|
transition: o,
|
|
534
534
|
opacity: m ? 0.4 : 1
|
|
535
535
|
},
|
|
@@ -537,8 +537,8 @@ function Zt({ id: t, children: s }) {
|
|
|
537
537
|
}
|
|
538
538
|
) });
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
const t =
|
|
540
|
+
function ta() {
|
|
541
|
+
const t = da(ba);
|
|
542
542
|
return /* @__PURE__ */ e(
|
|
543
543
|
"button",
|
|
544
544
|
{
|
|
@@ -547,19 +547,19 @@ function ea() {
|
|
|
547
547
|
...t == null ? void 0 : t.attributes,
|
|
548
548
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 shrink-0",
|
|
549
549
|
tabIndex: -1,
|
|
550
|
-
children: /* @__PURE__ */ e(
|
|
550
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Dn(t) {
|
|
555
555
|
return t ? Array.isArray(t) ? t.map(String).filter(Boolean) : typeof t == "string" && t.trim() ? [t] : [] : [];
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function jn({
|
|
558
558
|
relatedCollection: t,
|
|
559
559
|
value: s,
|
|
560
560
|
onChange: l
|
|
561
561
|
}) {
|
|
562
|
-
const x = Z(), [r, c] = A(!1), [o, m] = A(""), p =
|
|
562
|
+
const x = Z(), [r, c] = A(!1), [o, m] = A(""), p = Be(null);
|
|
563
563
|
he(() => {
|
|
564
564
|
r ? setTimeout(() => {
|
|
565
565
|
var C;
|
|
@@ -567,12 +567,12 @@ function Dn({
|
|
|
567
567
|
}, 50) : m("");
|
|
568
568
|
}, [r]);
|
|
569
569
|
const { data: g } = I({
|
|
570
|
-
queryKey:
|
|
570
|
+
queryKey: We.collectionMeta(t),
|
|
571
571
|
queryFn: () => x.request(Y(`/collections/${t}`)).then((C) => C.data),
|
|
572
572
|
staleTime: 6e4,
|
|
573
573
|
enabled: !!t
|
|
574
574
|
}), f = ((g == null ? void 0 : g.fields) ?? []).map((C) => C.field), i = (g == null ? void 0 : g.display_template) ?? null, v = ["name", "title", "label", "display_name", "subject", "email", "slug"], h = [
|
|
575
|
-
.../* @__PURE__ */ new Set(["id", ...
|
|
575
|
+
.../* @__PURE__ */ new Set(["id", ...An(i), ...v])
|
|
576
576
|
], d = f.length ? h.filter((C) => C === "id" || f.includes(C)).join(",") : "id", { data: S, isLoading: N, isError: $ } = I({
|
|
577
577
|
queryKey: ["relation-picker-items", t, d],
|
|
578
578
|
queryFn: () => x.request(
|
|
@@ -600,16 +600,16 @@ function Dn({
|
|
|
600
600
|
const q = S ?? [];
|
|
601
601
|
function O(C) {
|
|
602
602
|
const b = q.find((u) => String(u.id) === C);
|
|
603
|
-
return b ?
|
|
603
|
+
return b ? ut(i, b) : C;
|
|
604
604
|
}
|
|
605
605
|
function y(C) {
|
|
606
606
|
l(s.includes(C) ? s.filter((b) => b !== C) : [...s, C]);
|
|
607
607
|
}
|
|
608
608
|
const w = o ? q.filter(
|
|
609
|
-
(C) =>
|
|
609
|
+
(C) => ut(i, C).toLowerCase().includes(o.toLowerCase())
|
|
610
610
|
) : q;
|
|
611
|
-
return /* @__PURE__ */ a(
|
|
612
|
-
/* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(
|
|
611
|
+
return /* @__PURE__ */ a(Ue, { open: r, onOpenChange: c, children: [
|
|
612
|
+
/* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
613
613
|
"button",
|
|
614
614
|
{
|
|
615
615
|
type: "button",
|
|
@@ -643,13 +643,13 @@ function Dn({
|
|
|
643
643
|
},
|
|
644
644
|
C
|
|
645
645
|
)),
|
|
646
|
-
/* @__PURE__ */ e(
|
|
646
|
+
/* @__PURE__ */ e(Le, { className: "ml-auto h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
647
647
|
]
|
|
648
648
|
}
|
|
649
649
|
) }) }),
|
|
650
|
-
/* @__PURE__ */ a(
|
|
650
|
+
/* @__PURE__ */ a(He, { align: "start", className: "w-64 p-0", sideOffset: 4, children: [
|
|
651
651
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
652
|
-
/* @__PURE__ */ e(
|
|
652
|
+
/* @__PURE__ */ e(St, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
653
653
|
/* @__PURE__ */ e(
|
|
654
654
|
"input",
|
|
655
655
|
{
|
|
@@ -665,7 +665,7 @@ function Dn({
|
|
|
665
665
|
/* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
666
666
|
"Loading…"
|
|
667
667
|
] }) : w.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : w.map((C) => {
|
|
668
|
-
const b =
|
|
668
|
+
const b = ut(i, C), u = String(C.id), k = s.includes(u);
|
|
669
669
|
return /* @__PURE__ */ a(
|
|
670
670
|
"button",
|
|
671
671
|
{
|
|
@@ -688,7 +688,7 @@ function Dn({
|
|
|
688
688
|
] })
|
|
689
689
|
] });
|
|
690
690
|
}
|
|
691
|
-
const
|
|
691
|
+
const Mn = [
|
|
692
692
|
{ value: "eq", label: "equals" },
|
|
693
693
|
{ value: "neq", label: "not equals" },
|
|
694
694
|
{ value: "gt", label: "greater than" },
|
|
@@ -698,15 +698,15 @@ const jn = [
|
|
|
698
698
|
{ value: "contains", label: "contains" },
|
|
699
699
|
{ value: "null", label: "is empty" },
|
|
700
700
|
{ value: "nnull", label: "is not empty" }
|
|
701
|
-
],
|
|
701
|
+
], zn = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), Kn = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), Bn = /* @__PURE__ */ new Set(["boolean"]), ht = "__field", Wn = [
|
|
702
702
|
{ value: "neq", label: "is not" },
|
|
703
703
|
{ value: "eq", label: "is" },
|
|
704
704
|
{ value: "in", label: "is one of" }
|
|
705
|
-
],
|
|
705
|
+
], Un = [
|
|
706
706
|
{ value: "related_none", label: "has none" },
|
|
707
707
|
{ value: "related_some", label: "has at least one" }
|
|
708
708
|
];
|
|
709
|
-
function
|
|
709
|
+
function va({
|
|
710
710
|
rules: t,
|
|
711
711
|
onChange: s,
|
|
712
712
|
collection: l,
|
|
@@ -715,7 +715,7 @@ function ba({
|
|
|
715
715
|
}) {
|
|
716
716
|
var y;
|
|
717
717
|
const c = Z(), [o, m] = A(t.length > 0 || !!r), [p, g] = A({}), { data: f } = I({
|
|
718
|
-
queryKey:
|
|
718
|
+
queryKey: We.collectionMeta(l),
|
|
719
719
|
queryFn: () => c.request(Y(`/collections/${l}`)).then((w) => w.data),
|
|
720
720
|
enabled: !!l
|
|
721
721
|
}), i = [...((y = f == null ? void 0 : f.fields) == null ? void 0 : y.filter((w) => !w.hidden)) ?? []].sort(
|
|
@@ -726,7 +726,7 @@ function ba({
|
|
|
726
726
|
if (!w.includes(".")) {
|
|
727
727
|
const C = i.find((b) => b.field === w);
|
|
728
728
|
if (C) {
|
|
729
|
-
const b =
|
|
729
|
+
const b = On(v, l ?? "", w);
|
|
730
730
|
return { type: C.type, relatedCollection: (b == null ? void 0 : b.one_collection) ?? void 0 };
|
|
731
731
|
}
|
|
732
732
|
}
|
|
@@ -760,8 +760,8 @@ function ba({
|
|
|
760
760
|
onClick: () => m((w) => !w),
|
|
761
761
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
762
762
|
children: [
|
|
763
|
-
o ? /* @__PURE__ */ e(
|
|
764
|
-
/* @__PURE__ */ e(
|
|
763
|
+
o ? /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" }),
|
|
764
|
+
/* @__PURE__ */ e(_t, { className: "h-3 w-3" }),
|
|
765
765
|
"Conditions ",
|
|
766
766
|
/* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
|
|
767
767
|
t.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: t.length })
|
|
@@ -785,7 +785,7 @@ function ba({
|
|
|
785
785
|
value: b.key,
|
|
786
786
|
onChange: (E) => O(C, E),
|
|
787
787
|
options: [
|
|
788
|
-
{ value:
|
|
788
|
+
{ value: ht, label: "A field on the record" },
|
|
789
789
|
...$.map((E) => ({ value: E.key, label: E.label }))
|
|
790
790
|
]
|
|
791
791
|
}
|
|
@@ -800,11 +800,11 @@ function ba({
|
|
|
800
800
|
// One step for is / is not; a list for is one of.
|
|
801
801
|
value: E === "in" ? String(w.value ?? "") : String(w.value ?? "").split(",")[0] ?? ""
|
|
802
802
|
}),
|
|
803
|
-
options:
|
|
803
|
+
options: Wn
|
|
804
804
|
}
|
|
805
805
|
) }),
|
|
806
806
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-[140px]", children: w.op === "in" ? /* @__PURE__ */ e(
|
|
807
|
-
|
|
807
|
+
ga,
|
|
808
808
|
{
|
|
809
809
|
values: String(w.value ?? "").split(",").map((E) => E.trim()).filter(Boolean),
|
|
810
810
|
onChange: (E) => d(C, { value: E.join(",") }),
|
|
@@ -837,7 +837,7 @@ function ba({
|
|
|
837
837
|
{
|
|
838
838
|
value: w.op,
|
|
839
839
|
onChange: (E) => d(C, { op: E || "related_none", value: null }),
|
|
840
|
-
options:
|
|
840
|
+
options: Un
|
|
841
841
|
}
|
|
842
842
|
) }),
|
|
843
843
|
/* @__PURE__ */ e(
|
|
@@ -854,7 +854,7 @@ function ba({
|
|
|
854
854
|
},
|
|
855
855
|
C
|
|
856
856
|
);
|
|
857
|
-
const u = w.op === "null" || w.op === "nnull", k = h(w.field), L =
|
|
857
|
+
const u = w.op === "null" || w.op === "nnull", k = h(w.field), L = zn.has(k.type), R = Kn.has(k.type), B = Bn.has(k.type), M = !!k.relatedCollection;
|
|
858
858
|
return /* @__PURE__ */ a(
|
|
859
859
|
"div",
|
|
860
860
|
{
|
|
@@ -863,16 +863,16 @@ function ba({
|
|
|
863
863
|
x && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[160px]", children: /* @__PURE__ */ e(
|
|
864
864
|
ee,
|
|
865
865
|
{
|
|
866
|
-
value:
|
|
866
|
+
value: ht,
|
|
867
867
|
onChange: (E) => O(C, E),
|
|
868
868
|
options: [
|
|
869
|
-
{ value:
|
|
869
|
+
{ value: ht, label: "A field on the record" },
|
|
870
870
|
...$.map((E) => ({ value: E.key, label: E.label }))
|
|
871
871
|
]
|
|
872
872
|
}
|
|
873
873
|
) }),
|
|
874
874
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-[160px]", children: /* @__PURE__ */ e(
|
|
875
|
-
|
|
875
|
+
bt,
|
|
876
876
|
{
|
|
877
877
|
collection: l ?? "",
|
|
878
878
|
fields: i,
|
|
@@ -898,15 +898,15 @@ function ba({
|
|
|
898
898
|
{
|
|
899
899
|
value: w.op,
|
|
900
900
|
onChange: (E) => d(C, { op: E || "eq" }),
|
|
901
|
-
options:
|
|
901
|
+
options: Mn.map((E) => ({ value: E.value, label: E.label })),
|
|
902
902
|
placeholder: "Operator…"
|
|
903
903
|
}
|
|
904
904
|
) }),
|
|
905
905
|
!u && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[120px]", children: M ? /* @__PURE__ */ e(
|
|
906
|
-
|
|
906
|
+
jn,
|
|
907
907
|
{
|
|
908
908
|
relatedCollection: k.relatedCollection,
|
|
909
|
-
value:
|
|
909
|
+
value: Dn(w.value),
|
|
910
910
|
onChange: (E) => d(C, { value: E.length === 1 ? E[0] : E })
|
|
911
911
|
}
|
|
912
912
|
) : B ? /* @__PURE__ */ e(
|
|
@@ -969,15 +969,15 @@ function ba({
|
|
|
969
969
|
] })
|
|
970
970
|
] });
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function Nt(t) {
|
|
973
973
|
return t === "nivaro_addendums" ? "Addendums" : Se(t);
|
|
974
974
|
}
|
|
975
|
-
const
|
|
975
|
+
const aa = [
|
|
976
976
|
{ value: "owner", label: "Owner only" },
|
|
977
977
|
{ value: "anyone", label: "Anyone, always" },
|
|
978
978
|
{ value: "when", label: "Anyone, when…" }
|
|
979
979
|
];
|
|
980
|
-
function
|
|
980
|
+
function Qn({
|
|
981
981
|
draft: t,
|
|
982
982
|
onChange: s,
|
|
983
983
|
states: l,
|
|
@@ -1007,7 +1007,7 @@ function Un({
|
|
|
1007
1007
|
" can. Administrators always can."
|
|
1008
1008
|
] }),
|
|
1009
1009
|
/* @__PURE__ */ e("div", { className: "space-y-3", children: c.map((i) => {
|
|
1010
|
-
const v = t[i], h = i ===
|
|
1010
|
+
const v = t[i], h = i === yt ? null : Nt(i), d = i === yt ? aa.filter((S) => S.value !== "anyone") : aa;
|
|
1011
1011
|
return /* @__PURE__ */ a(
|
|
1012
1012
|
"div",
|
|
1013
1013
|
{
|
|
@@ -1037,7 +1037,7 @@ function Un({
|
|
|
1037
1037
|
)) }),
|
|
1038
1038
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: v.mode === "owner" ? `Only ${g} can make this move${h ? ` on ${h.toLowerCase()}` : ""}.` : v.mode === "anyone" ? `Anyone who may otherwise make this move can, on every ${h ? h.toLowerCase().replace(/s$/, "") : ""} record — no conditions.` : i === "nivaro_addendums" ? "All of these must be true. Record fields and linked rows are read from the record the addendum changes; Current step is the addendum’s own step." : "All of these must be true." }),
|
|
1039
1039
|
v.mode === "when" && /* @__PURE__ */ e(
|
|
1040
|
-
|
|
1040
|
+
va,
|
|
1041
1041
|
{
|
|
1042
1042
|
rules: v.rules,
|
|
1043
1043
|
onChange: (S) => f(i, { rules: S }),
|
|
@@ -1055,7 +1055,7 @@ function Un({
|
|
|
1055
1055
|
}
|
|
1056
1056
|
);
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Hn({
|
|
1059
1059
|
requirement: t,
|
|
1060
1060
|
childRelations: s,
|
|
1061
1061
|
onChange: l,
|
|
@@ -1063,7 +1063,7 @@ function Qn({
|
|
|
1063
1063
|
}) {
|
|
1064
1064
|
var v;
|
|
1065
1065
|
const r = Z(), { data: c } = I({
|
|
1066
|
-
queryKey:
|
|
1066
|
+
queryKey: We.collectionMeta(t.collection),
|
|
1067
1067
|
queryFn: () => r.request(Y(`/collections/${t.collection}`)).then((h) => h.data),
|
|
1068
1068
|
enabled: !!t.collection
|
|
1069
1069
|
}), o = [
|
|
@@ -1178,13 +1178,13 @@ function Qn({
|
|
|
1178
1178
|
] })
|
|
1179
1179
|
] });
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function Vn({
|
|
1182
1182
|
requirements: t,
|
|
1183
1183
|
onChange: s,
|
|
1184
1184
|
collection: l
|
|
1185
1185
|
}) {
|
|
1186
1186
|
const x = Z(), [r, c] = A(t.length > 0), { data: o } = I({
|
|
1187
|
-
queryKey:
|
|
1187
|
+
queryKey: We.collectionMeta(l),
|
|
1188
1188
|
queryFn: () => x.request(Y(`/collections/${l}`)).then((i) => i.data),
|
|
1189
1189
|
enabled: !!l
|
|
1190
1190
|
}), p = ((o == null ? void 0 : o.relations) ?? []).filter(
|
|
@@ -1198,8 +1198,8 @@ function Hn({
|
|
|
1198
1198
|
onClick: () => c((i) => !i),
|
|
1199
1199
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
1200
1200
|
children: [
|
|
1201
|
-
r ? /* @__PURE__ */ e(
|
|
1202
|
-
/* @__PURE__ */ e(
|
|
1201
|
+
r ? /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" }),
|
|
1202
|
+
/* @__PURE__ */ e(ca, { className: "h-3 w-3" }),
|
|
1203
1203
|
"Requirements ",
|
|
1204
1204
|
/* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
|
|
1205
1205
|
t.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: t.length })
|
|
@@ -1209,7 +1209,7 @@ function Hn({
|
|
|
1209
1209
|
r && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
1210
1210
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Block this transition until every row of a child relation has the listed fields filled in. Prompts the user with a fill-in dialog when rows are incomplete." }),
|
|
1211
1211
|
t.map((i, v) => /* @__PURE__ */ e(
|
|
1212
|
-
|
|
1212
|
+
Hn,
|
|
1213
1213
|
{
|
|
1214
1214
|
requirement: i,
|
|
1215
1215
|
childRelations: p,
|
|
@@ -1251,7 +1251,7 @@ function Oe({
|
|
|
1251
1251
|
return /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
1252
1252
|
/* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: t }),
|
|
1253
1253
|
/* @__PURE__ */ e(
|
|
1254
|
-
|
|
1254
|
+
ha,
|
|
1255
1255
|
{
|
|
1256
1256
|
value: c,
|
|
1257
1257
|
onChange: (g) => {
|
|
@@ -1278,16 +1278,16 @@ function Oe({
|
|
|
1278
1278
|
m && /* @__PURE__ */ e("p", { className: "text-[10.5px] text-red-500", children: "Invalid JSON — not saved yet." })
|
|
1279
1279
|
] });
|
|
1280
1280
|
}
|
|
1281
|
-
const
|
|
1282
|
-
function
|
|
1281
|
+
const xt = "__custom__";
|
|
1282
|
+
function In(t) {
|
|
1283
1283
|
return t.status === "live" ? `Live v${t.published_version ?? "?"}` : t.status === "draft" ? "Draft changes" : "Not published";
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function Yn({
|
|
1286
1286
|
externalApi: t,
|
|
1287
1287
|
value: s,
|
|
1288
1288
|
onChange: l
|
|
1289
1289
|
}) {
|
|
1290
|
-
const x = Z(), r =
|
|
1290
|
+
const x = Z(), r = ma(), c = t.trim(), { data: o } = I({
|
|
1291
1291
|
queryKey: ["payload-templates", "list", c],
|
|
1292
1292
|
queryFn: () => x.request(
|
|
1293
1293
|
Y(`/payload-templates?external_api=${encodeURIComponent(c)}`)
|
|
@@ -1298,10 +1298,10 @@ function In({
|
|
|
1298
1298
|
queryFn: () => x.request(Y("/external-apis")).then((h) => h.data ?? []),
|
|
1299
1299
|
enabled: !!s
|
|
1300
1300
|
}), p = [
|
|
1301
|
-
{ value:
|
|
1301
|
+
{ value: xt, label: "Custom (inline Liquid)" },
|
|
1302
1302
|
...(o ?? []).map((h) => ({
|
|
1303
1303
|
value: h.key,
|
|
1304
|
-
label: `${h.label} · ${
|
|
1304
|
+
label: `${h.label} · ${In(h)}`
|
|
1305
1305
|
}))
|
|
1306
1306
|
], g = (m ?? []).find((h) => h.name === c || String(h.id) === c), f = g ? String(g.id) : c, i = s ? `/external-apis/${encodeURIComponent(f)}/payloads/${encodeURIComponent(s)}` : null, v = i ? r.consoleUrl ? r.consoleUrl(i) : i : null;
|
|
1307
1307
|
return /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
@@ -1310,8 +1310,8 @@ function In({
|
|
|
1310
1310
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
1311
1311
|
ee,
|
|
1312
1312
|
{
|
|
1313
|
-
value: s ??
|
|
1314
|
-
onChange: (h) => l(h ===
|
|
1313
|
+
value: s ?? xt,
|
|
1314
|
+
onChange: (h) => l(h === xt ? void 0 : h),
|
|
1315
1315
|
options: p,
|
|
1316
1316
|
placeholder: c ? "Custom (inline Liquid)" : "Enter an external API first"
|
|
1317
1317
|
}
|
|
@@ -1323,7 +1323,7 @@ function In({
|
|
|
1323
1323
|
onClick: () => r.navigate(v),
|
|
1324
1324
|
className: "flex shrink-0 items-center gap-1 text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
|
|
1325
1325
|
children: [
|
|
1326
|
-
/* @__PURE__ */ e(
|
|
1326
|
+
/* @__PURE__ */ e(Ja, { className: "h-3 w-3" }),
|
|
1327
1327
|
"Open template"
|
|
1328
1328
|
]
|
|
1329
1329
|
}
|
|
@@ -1331,7 +1331,7 @@ function In({
|
|
|
1331
1331
|
] })
|
|
1332
1332
|
] });
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function Gn({
|
|
1335
1335
|
actions: t,
|
|
1336
1336
|
onChange: s
|
|
1337
1337
|
}) {
|
|
@@ -1344,7 +1344,7 @@ function Yn({
|
|
|
1344
1344
|
onClick: () => x((o) => !o),
|
|
1345
1345
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
1346
1346
|
children: [
|
|
1347
|
-
l ? /* @__PURE__ */ e(
|
|
1347
|
+
l ? /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" }),
|
|
1348
1348
|
"Actions",
|
|
1349
1349
|
t.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-medium text-teal-700", children: t.length })
|
|
1350
1350
|
]
|
|
@@ -1469,7 +1469,7 @@ function Yn({
|
|
|
1469
1469
|
] })
|
|
1470
1470
|
] }),
|
|
1471
1471
|
o.type === "erp_submit" && /* @__PURE__ */ e(
|
|
1472
|
-
|
|
1472
|
+
Yn,
|
|
1473
1473
|
{
|
|
1474
1474
|
externalApi: String(o.external_api ?? ""),
|
|
1475
1475
|
value: o.payload_template_key,
|
|
@@ -1479,7 +1479,7 @@ function Yn({
|
|
|
1479
1479
|
!(o.type === "erp_submit" && o.payload_template_key) && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
1480
1480
|
/* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: "Payload template (Liquid — must render to valid JSON)" }),
|
|
1481
1481
|
/* @__PURE__ */ e(
|
|
1482
|
-
|
|
1482
|
+
ha,
|
|
1483
1483
|
{
|
|
1484
1484
|
value: o.payload_template ?? "",
|
|
1485
1485
|
onChange: (p) => r(m, { payload_template: p.target.value }),
|
|
@@ -1569,7 +1569,7 @@ function Yn({
|
|
|
1569
1569
|
] })
|
|
1570
1570
|
] });
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1572
|
+
function ft({
|
|
1573
1573
|
initial: t,
|
|
1574
1574
|
states: s,
|
|
1575
1575
|
collection: l,
|
|
@@ -1598,17 +1598,17 @@ function xt({
|
|
|
1598
1598
|
comment_mode: t.comment_mode ?? "none",
|
|
1599
1599
|
actions: t.actions ?? null
|
|
1600
1600
|
}), [i, v] = A(
|
|
1601
|
-
() =>
|
|
1602
|
-
), h = g.require_owner ?
|
|
1601
|
+
() => xa(t.open_when ?? null, p ?? [])
|
|
1602
|
+
), h = g.require_owner ? Sn(i) : [], d = (y, w) => f((C) => ({ ...C, [y]: w })), S = (y) => y.collection.trim() !== "" && y.fk_field.trim() !== "" && y.fields.length > 0, N = (g.requirements ?? []).every(S), $ = g.to_states.length > 0 && g.label.trim() && N && h.length === 0, { data: q } = xn(l, {
|
|
1603
1603
|
select: (y) => Array.isArray(y == null ? void 0 : y.fields) ? y.fields : []
|
|
1604
|
-
}), O =
|
|
1604
|
+
}), O = tn(
|
|
1605
1605
|
{
|
|
1606
1606
|
...g,
|
|
1607
1607
|
condition_rules: (g.condition_rules ?? []).filter((y) => y.field.trim()),
|
|
1608
1608
|
requirements: (g.requirements ?? []).filter(S),
|
|
1609
|
-
open_when: g.require_owner ?
|
|
1609
|
+
open_when: g.require_owner ? vt(i) : null
|
|
1610
1610
|
},
|
|
1611
|
-
|
|
1611
|
+
an(q ?? [], [], l, {
|
|
1612
1612
|
// By id (from/to) and by key ($state rules).
|
|
1613
1613
|
states: Object.fromEntries(
|
|
1614
1614
|
s.flatMap((y) => [
|
|
@@ -1617,7 +1617,7 @@ function xt({
|
|
|
1617
1617
|
])
|
|
1618
1618
|
),
|
|
1619
1619
|
collections: Object.fromEntries(
|
|
1620
|
-
(p ?? []).map((y) => [y,
|
|
1620
|
+
(p ?? []).map((y) => [y, Nt(y)])
|
|
1621
1621
|
)
|
|
1622
1622
|
})
|
|
1623
1623
|
);
|
|
@@ -1655,7 +1655,7 @@ function xt({
|
|
|
1655
1655
|
/* @__PURE__ */ e(V, { className: "text-[12px]", children: g.to_previous ? "Fallback state" : `To State${g.to_states.length !== 1 ? "s" : ""}` }),
|
|
1656
1656
|
g.to_previous && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "The real target is the record's previous state — this only applies when history can't answer (the record started in this state, or the prior state was removed)." }),
|
|
1657
1657
|
/* @__PURE__ */ e(
|
|
1658
|
-
|
|
1658
|
+
ga,
|
|
1659
1659
|
{
|
|
1660
1660
|
values: g.to_states,
|
|
1661
1661
|
onChange: (y) => d("to_states", y),
|
|
@@ -1693,10 +1693,10 @@ function xt({
|
|
|
1693
1693
|
] }),
|
|
1694
1694
|
!x && /* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
1695
1695
|
/* @__PURE__ */ e(V, { className: "text-[12px]", children: "Color" }),
|
|
1696
|
-
/* @__PURE__ */ e(
|
|
1696
|
+
/* @__PURE__ */ e(rt, { value: g.color, onChange: (y) => d("color", y) })
|
|
1697
1697
|
] }),
|
|
1698
1698
|
/* @__PURE__ */ e(
|
|
1699
|
-
|
|
1699
|
+
va,
|
|
1700
1700
|
{
|
|
1701
1701
|
rules: g.condition_rules ?? [],
|
|
1702
1702
|
onChange: (y) => d("condition_rules", y),
|
|
@@ -1704,7 +1704,7 @@ function xt({
|
|
|
1704
1704
|
}
|
|
1705
1705
|
),
|
|
1706
1706
|
/* @__PURE__ */ e(
|
|
1707
|
-
|
|
1707
|
+
Vn,
|
|
1708
1708
|
{
|
|
1709
1709
|
requirements: g.requirements ?? [],
|
|
1710
1710
|
onChange: (y) => d("requirements", y.length > 0 ? y : null),
|
|
@@ -1712,7 +1712,7 @@ function xt({
|
|
|
1712
1712
|
}
|
|
1713
1713
|
),
|
|
1714
1714
|
/* @__PURE__ */ e(
|
|
1715
|
-
|
|
1715
|
+
Gn,
|
|
1716
1716
|
{
|
|
1717
1717
|
actions: g.actions ?? [],
|
|
1718
1718
|
onChange: (y) => d("actions", y.length > 0 ? y : null)
|
|
@@ -1789,7 +1789,7 @@ function xt({
|
|
|
1789
1789
|
)
|
|
1790
1790
|
] }),
|
|
1791
1791
|
g.require_owner && /* @__PURE__ */ e(
|
|
1792
|
-
|
|
1792
|
+
Qn,
|
|
1793
1793
|
{
|
|
1794
1794
|
draft: i,
|
|
1795
1795
|
onChange: v,
|
|
@@ -1801,7 +1801,7 @@ function xt({
|
|
|
1801
1801
|
g.require_owner && h.length > 0 && /* @__PURE__ */ a("p", { className: "text-[11px] text-amber-600 dark:text-amber-400", "data-open-when-incomplete": !0, children: [
|
|
1802
1802
|
"Finish a condition",
|
|
1803
1803
|
" ",
|
|
1804
|
-
h[0] ===
|
|
1804
|
+
h[0] === yt ? "" : `for ${h.map(Nt).join(" and ")} `,
|
|
1805
1805
|
"under “Anyone can make this move when…”, or pick Owner only — it saves when every condition has a value."
|
|
1806
1806
|
] }),
|
|
1807
1807
|
/* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white px-3 py-2", children: [
|
|
@@ -1835,9 +1835,9 @@ function xt({
|
|
|
1835
1835
|
] }),
|
|
1836
1836
|
/* @__PURE__ */ e(Ae, { checked: g.to_previous, onCheckedChange: (y) => d("to_previous", y) })
|
|
1837
1837
|
] }),
|
|
1838
|
-
/* @__PURE__ */ e(
|
|
1838
|
+
/* @__PURE__ */ e(un, { kind: "transition", sentences: O }),
|
|
1839
1839
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
|
|
1840
|
-
m && m.length > 0 && /* @__PURE__ */ e(
|
|
1840
|
+
m && m.length > 0 && /* @__PURE__ */ e(ua, { className: "mr-auto min-w-0", collections: m }),
|
|
1841
1841
|
/* @__PURE__ */ e(P, { type: "button", variant: "outline", size: "sm", onClick: c, children: "Cancel" }),
|
|
1842
1842
|
/* @__PURE__ */ e(
|
|
1843
1843
|
P,
|
|
@@ -1851,7 +1851,7 @@ function xt({
|
|
|
1851
1851
|
...g,
|
|
1852
1852
|
condition_rules: y.length > 0 ? y : null,
|
|
1853
1853
|
requirements: w.length > 0 ? w : null,
|
|
1854
|
-
open_when: g.require_owner ?
|
|
1854
|
+
open_when: g.require_owner ? vt(i) : null
|
|
1855
1855
|
});
|
|
1856
1856
|
},
|
|
1857
1857
|
children: o ? /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 animate-spin" }) : "Save Transition"
|
|
@@ -1860,19 +1860,19 @@ function xt({
|
|
|
1860
1860
|
] })
|
|
1861
1861
|
] });
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function Jn(t) {
|
|
1864
1864
|
var x, r;
|
|
1865
1865
|
const s = ((x = t.first_name) == null ? void 0 : x[0]) ?? "", l = ((r = t.last_name) == null ? void 0 : r[0]) ?? "";
|
|
1866
1866
|
return (s + l).toUpperCase() || t.email[0].toUpperCase();
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1868
|
+
function Xn(t) {
|
|
1869
1869
|
const s = t.filter((r) => !r.filters || r.filters.length === 0), l = /* @__PURE__ */ new Set(), x = [];
|
|
1870
1870
|
for (const r of s)
|
|
1871
1871
|
for (const c of r.users)
|
|
1872
1872
|
l.has(c.user) || (l.add(c.user), x.push(c));
|
|
1873
1873
|
return x;
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function Zn(t) {
|
|
1876
1876
|
var r, c, o;
|
|
1877
1877
|
const s = (t.filters ?? []).map((m) => {
|
|
1878
1878
|
const p = Se(m.field.split(".").pop() ?? m.field), g = Array.isArray(m.value) ? m.value.join(", ") : String(m.value ?? ""), f = m.op === "_eq" || m.op === "eq" ? "=" : m.op === "_in" || m.op === "in" ? "is" : m.op;
|
|
@@ -1880,11 +1880,11 @@ function Xn(t) {
|
|
|
1880
1880
|
}).join(" and "), l = t.users.length + (((r = t.teams) == null ? void 0 : r.length) ?? 0), x = l === 0 ? "nobody yet" : `${l} ${l === 1 ? "owner" : "owners"}`;
|
|
1881
1881
|
return `${((c = t.name) == null ? void 0 : c.trim()) || s || "Owner group"}${(o = t.name) != null && o.trim() && s ? ` (${s})` : ""} · ${x}`;
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function es(t, s, l) {
|
|
1884
1884
|
const x = t.toLocaleString("en-US"), r = t === 1 ? "group" : "groups";
|
|
1885
1885
|
return l ? s ? `+${x} by ${s}` : `+${x} more ${r}` : s ? `${x} owner ${r} by ${s}` : `${x} owner ${r}`;
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1887
|
+
function ts({
|
|
1888
1888
|
users: t,
|
|
1889
1889
|
valueGroups: s
|
|
1890
1890
|
}) {
|
|
@@ -1892,7 +1892,7 @@ function es({
|
|
|
1892
1892
|
if (!t.length && !l) return null;
|
|
1893
1893
|
const x = new Set(
|
|
1894
1894
|
s.flatMap((m) => (m.filters ?? []).map((p) => p.field.split(".").pop() ?? p.field))
|
|
1895
|
-
), r =
|
|
1895
|
+
), r = es(
|
|
1896
1896
|
l,
|
|
1897
1897
|
x.size === 1 ? Se([...x][0]) : null,
|
|
1898
1898
|
t.length > 0
|
|
@@ -1904,7 +1904,7 @@ function es({
|
|
|
1904
1904
|
{
|
|
1905
1905
|
title: `${m.first_name ?? ""} ${m.last_name ?? ""}`.trim() || m.email,
|
|
1906
1906
|
className: "flex h-5 w-5 items-center justify-center rounded-full border border-white bg-nvr-cyan/20 text-[9px] font-semibold text-[#007a99] dark:border-card dark:bg-nvr-cyan/25 dark:text-nvr-cyan",
|
|
1907
|
-
children:
|
|
1907
|
+
children: Jn(m)
|
|
1908
1908
|
},
|
|
1909
1909
|
m.user
|
|
1910
1910
|
)),
|
|
@@ -1918,7 +1918,7 @@ function es({
|
|
|
1918
1918
|
{
|
|
1919
1919
|
"data-owner-value-groups": l,
|
|
1920
1920
|
"data-tip": `Owners for particular records:
|
|
1921
|
-
${s.map(
|
|
1921
|
+
${s.map(Zn).join(`
|
|
1922
1922
|
`)}`,
|
|
1923
1923
|
className: "relative whitespace-nowrap rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
1924
1924
|
children: [
|
|
@@ -1929,7 +1929,7 @@ ${s.map(Xn).join(`
|
|
|
1929
1929
|
)
|
|
1930
1930
|
] });
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function as({
|
|
1933
1933
|
s: t,
|
|
1934
1934
|
census: s,
|
|
1935
1935
|
onOpen: l
|
|
@@ -1943,7 +1943,7 @@ function ts({
|
|
|
1943
1943
|
"rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11.5px] tabular-nums text-[#475569] dark:text-slate-300"
|
|
1944
1944
|
);
|
|
1945
1945
|
return /* @__PURE__ */ e("div", { "data-state-census": s.count, className: "flex flex-wrap items-center gap-1", children: x.map((c) => {
|
|
1946
|
-
const o =
|
|
1946
|
+
const o = ln(c.oldestAt), m = /^nivaro_/.test(c.collection), p = c.collection === "nivaro_addendums" ? "Addendums" : Se(c.collection), g = /* @__PURE__ */ a(fe, { children: [
|
|
1947
1947
|
/* @__PURE__ */ e("b", { className: "font-semibold text-slate-800 dark:text-slate-100", children: c.count.toLocaleString("en-US") }),
|
|
1948
1948
|
` ${p}`,
|
|
1949
1949
|
o ? /* @__PURE__ */ a("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
@@ -1955,7 +1955,7 @@ function ts({
|
|
|
1955
1955
|
"button",
|
|
1956
1956
|
{
|
|
1957
1957
|
type: "button",
|
|
1958
|
-
onClick: () => l(
|
|
1958
|
+
onClick: () => l(on(c.collection, t.key)),
|
|
1959
1959
|
"data-tip": `Open the ${p} sitting in ${t.label}`,
|
|
1960
1960
|
"data-tip-side": "right",
|
|
1961
1961
|
className: `${r} transition-colors hover:border-nvr-cyan/50 hover:bg-nvr-cyan/5 hover:text-slate-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:hover:!border-nvr-cyan/50 dark:hover:!bg-nvr-cyan/10 dark:hover:!text-slate-100`,
|
|
@@ -1965,7 +1965,7 @@ function ts({
|
|
|
1965
1965
|
);
|
|
1966
1966
|
}) });
|
|
1967
1967
|
}
|
|
1968
|
-
function
|
|
1968
|
+
function ns({
|
|
1969
1969
|
s: t,
|
|
1970
1970
|
groups: s,
|
|
1971
1971
|
expandedStateId: l,
|
|
@@ -1974,15 +1974,15 @@ function as({
|
|
|
1974
1974
|
onDelete: c,
|
|
1975
1975
|
census: o
|
|
1976
1976
|
}) {
|
|
1977
|
-
const { attributes: m, listeners: p, setNodeRef: g, transform: f, transition: i, isDragging: v } =
|
|
1977
|
+
const { attributes: m, listeners: p, setNodeRef: g, transform: f, transition: i, isDragging: v } = wt({
|
|
1978
1978
|
id: t.id
|
|
1979
|
-
}), h =
|
|
1979
|
+
}), h = ma();
|
|
1980
1980
|
return /* @__PURE__ */ e(
|
|
1981
1981
|
"div",
|
|
1982
1982
|
{
|
|
1983
1983
|
ref: g,
|
|
1984
1984
|
style: {
|
|
1985
|
-
transform:
|
|
1985
|
+
transform: kt.Transform.toString(f),
|
|
1986
1986
|
transition: i,
|
|
1987
1987
|
opacity: v ? 0.4 : 1
|
|
1988
1988
|
},
|
|
@@ -1995,7 +1995,7 @@ function as({
|
|
|
1995
1995
|
...p,
|
|
1996
1996
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors shrink-0",
|
|
1997
1997
|
tabIndex: -1,
|
|
1998
|
-
children: /* @__PURE__ */ e(
|
|
1998
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
1999
1999
|
}
|
|
2000
2000
|
),
|
|
2001
2001
|
/* @__PURE__ */ e(
|
|
@@ -2014,11 +2014,11 @@ function as({
|
|
|
2014
2014
|
t.lock_record && /* @__PURE__ */ e(qe, { variant: "outline", className: "text-[10px] h-4 px-1", children: "locked" })
|
|
2015
2015
|
] }),
|
|
2016
2016
|
(o || s.length > 0) && /* @__PURE__ */ a("div", { className: "mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 empty:hidden", children: [
|
|
2017
|
-
o && /* @__PURE__ */ e(
|
|
2017
|
+
o && /* @__PURE__ */ e(as, { s: t, census: o, onOpen: (d) => h.navigate(d) }),
|
|
2018
2018
|
/* @__PURE__ */ e(
|
|
2019
|
-
|
|
2019
|
+
ts,
|
|
2020
2020
|
{
|
|
2021
|
-
users:
|
|
2021
|
+
users: Xn(s),
|
|
2022
2022
|
valueGroups: s.filter((d) => d.filters && d.filters.length > 0)
|
|
2023
2023
|
}
|
|
2024
2024
|
)
|
|
@@ -2032,7 +2032,7 @@ function as({
|
|
|
2032
2032
|
onClick: x,
|
|
2033
2033
|
className: "rounded p-1 text-slate-400 hover:text-slate-700",
|
|
2034
2034
|
title: "Configure owners & skip",
|
|
2035
|
-
children: /* @__PURE__ */ e(
|
|
2035
|
+
children: /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" })
|
|
2036
2036
|
}
|
|
2037
2037
|
),
|
|
2038
2038
|
/* @__PURE__ */ e(
|
|
@@ -2041,18 +2041,18 @@ function as({
|
|
|
2041
2041
|
type: "button",
|
|
2042
2042
|
onClick: r,
|
|
2043
2043
|
className: "rounded p-1 text-slate-400 hover:text-slate-700",
|
|
2044
|
-
children: /* @__PURE__ */ e(
|
|
2044
|
+
children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
|
|
2045
2045
|
}
|
|
2046
2046
|
),
|
|
2047
2047
|
/* @__PURE__ */ e(
|
|
2048
|
-
|
|
2048
|
+
Me,
|
|
2049
2049
|
{
|
|
2050
2050
|
onConfirm: c,
|
|
2051
2051
|
title: "Delete state",
|
|
2052
2052
|
confirmLabel: "Delete?",
|
|
2053
2053
|
confirmTitle: `Delete state "${t.label}"?`,
|
|
2054
2054
|
className: "rounded p-1 text-slate-400 hover:text-red-500",
|
|
2055
|
-
armedClassName:
|
|
2055
|
+
armedClassName: Ke,
|
|
2056
2056
|
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
2057
2057
|
}
|
|
2058
2058
|
)
|
|
@@ -2061,7 +2061,7 @@ function as({
|
|
|
2061
2061
|
}
|
|
2062
2062
|
);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function ss({
|
|
2065
2065
|
d: t,
|
|
2066
2066
|
siblings: s,
|
|
2067
2067
|
onSave: l,
|
|
@@ -2072,8 +2072,8 @@ function ns({
|
|
|
2072
2072
|
r && m(t.cascade ?? []);
|
|
2073
2073
|
}, [r, t.cascade]);
|
|
2074
2074
|
const p = s.filter((g) => g.id !== t.id && !g.is_row_axis);
|
|
2075
|
-
return /* @__PURE__ */ a(
|
|
2076
|
-
/* @__PURE__ */ e(
|
|
2075
|
+
return /* @__PURE__ */ a(Ue, { open: r, onOpenChange: c, children: [
|
|
2076
|
+
/* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2077
2077
|
"button",
|
|
2078
2078
|
{
|
|
2079
2079
|
type: "button",
|
|
@@ -2082,10 +2082,10 @@ function ns({
|
|
|
2082
2082
|
"rounded p-1 transition-colors",
|
|
2083
2083
|
(t.cascade ?? []).length > 0 ? "text-nvr-cyan hover:text-nvr-cyan-dark" : "text-slate-400 hover:text-slate-700"
|
|
2084
2084
|
),
|
|
2085
|
-
children: /* @__PURE__ */ e(
|
|
2085
|
+
children: /* @__PURE__ */ e(_t, { className: "h-3.5 w-3.5" })
|
|
2086
2086
|
}
|
|
2087
2087
|
) }),
|
|
2088
|
-
/* @__PURE__ */ a(
|
|
2088
|
+
/* @__PURE__ */ a(He, { align: "end", className: "w-[380px] p-3", sideOffset: 4, children: [
|
|
2089
2089
|
/* @__PURE__ */ a("p", { className: "text-[12px] font-semibold text-slate-800 dark:text-foreground", children: [
|
|
2090
2090
|
"Cascade ",
|
|
2091
2091
|
t.label
|
|
@@ -2190,7 +2190,7 @@ function ns({
|
|
|
2190
2190
|
] })
|
|
2191
2191
|
] });
|
|
2192
2192
|
}
|
|
2193
|
-
function
|
|
2193
|
+
function rs({
|
|
2194
2194
|
d: t,
|
|
2195
2195
|
siblings: s,
|
|
2196
2196
|
onEdit: l,
|
|
@@ -2198,7 +2198,7 @@ function ss({
|
|
|
2198
2198
|
onSaveCascade: r,
|
|
2199
2199
|
cascadeSaving: c
|
|
2200
2200
|
}) {
|
|
2201
|
-
const { attributes: o, listeners: m, setNodeRef: p, transform: g, transition: f, isDragging: i } =
|
|
2201
|
+
const { attributes: o, listeners: m, setNodeRef: p, transform: g, transition: f, isDragging: i } = wt({
|
|
2202
2202
|
id: t.id
|
|
2203
2203
|
});
|
|
2204
2204
|
return /* @__PURE__ */ a(
|
|
@@ -2206,7 +2206,7 @@ function ss({
|
|
|
2206
2206
|
{
|
|
2207
2207
|
ref: p,
|
|
2208
2208
|
style: {
|
|
2209
|
-
transform:
|
|
2209
|
+
transform: kt.Transform.toString(g),
|
|
2210
2210
|
transition: f,
|
|
2211
2211
|
opacity: i ? 0.4 : 1
|
|
2212
2212
|
},
|
|
@@ -2220,7 +2220,7 @@ function ss({
|
|
|
2220
2220
|
...m,
|
|
2221
2221
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors",
|
|
2222
2222
|
tabIndex: -1,
|
|
2223
|
-
children: /* @__PURE__ */ e(
|
|
2223
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
2224
2224
|
}
|
|
2225
2225
|
),
|
|
2226
2226
|
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0 flex items-center gap-3 flex-wrap", children: [
|
|
@@ -2243,7 +2243,7 @@ function ss({
|
|
|
2243
2243
|
] }),
|
|
2244
2244
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
2245
2245
|
/* @__PURE__ */ e(
|
|
2246
|
-
|
|
2246
|
+
ss,
|
|
2247
2247
|
{
|
|
2248
2248
|
d: t,
|
|
2249
2249
|
siblings: s,
|
|
@@ -2257,18 +2257,18 @@ function ss({
|
|
|
2257
2257
|
type: "button",
|
|
2258
2258
|
onClick: l,
|
|
2259
2259
|
className: "rounded p-1 text-slate-400 hover:text-slate-700 transition-colors",
|
|
2260
|
-
children: /* @__PURE__ */ e(
|
|
2260
|
+
children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
|
|
2261
2261
|
}
|
|
2262
2262
|
),
|
|
2263
2263
|
/* @__PURE__ */ e(
|
|
2264
|
-
|
|
2264
|
+
Me,
|
|
2265
2265
|
{
|
|
2266
2266
|
onConfirm: x,
|
|
2267
2267
|
title: "Delete dimension",
|
|
2268
2268
|
confirmLabel: "Delete?",
|
|
2269
2269
|
confirmTitle: `Delete dimension "${t.label}"?`,
|
|
2270
2270
|
className: "rounded p-1 text-slate-400 hover:text-red-500 transition-colors",
|
|
2271
|
-
armedClassName:
|
|
2271
|
+
armedClassName: Ke,
|
|
2272
2272
|
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
2273
2273
|
}
|
|
2274
2274
|
)
|
|
@@ -2277,7 +2277,7 @@ function ss({
|
|
|
2277
2277
|
}
|
|
2278
2278
|
);
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function ls({
|
|
2281
2281
|
binding: t,
|
|
2282
2282
|
templateId: s
|
|
2283
2283
|
}) {
|
|
@@ -2286,9 +2286,9 @@ function rs({
|
|
|
2286
2286
|
he(() => {
|
|
2287
2287
|
o(r.map((u) => u.id));
|
|
2288
2288
|
}, [r]);
|
|
2289
|
-
const m = c.map((u) => r.find((k) => k.id === u)).filter(Boolean), p =
|
|
2290
|
-
|
|
2291
|
-
|
|
2289
|
+
const m = c.map((u) => r.find((k) => k.id === u)).filter(Boolean), p = sa(
|
|
2290
|
+
st(ra),
|
|
2291
|
+
st(la, { coordinateGetter: ia })
|
|
2292
2292
|
), [g, f] = A(null), [i, v] = A({
|
|
2293
2293
|
field: "",
|
|
2294
2294
|
label: "",
|
|
@@ -2302,7 +2302,7 @@ function rs({
|
|
|
2302
2302
|
is_row_axis: !1,
|
|
2303
2303
|
required: !1
|
|
2304
2304
|
}), { data: S } = I({
|
|
2305
|
-
queryKey:
|
|
2305
|
+
queryKey: We.collectionMeta(t.collection),
|
|
2306
2306
|
queryFn: () => l.request(Y(`/collections/${t.collection}`)).then((u) => u.data),
|
|
2307
2307
|
enabled: !!t.collection
|
|
2308
2308
|
}), N = ((b = S == null ? void 0 : S.fields) == null ? void 0 : b.filter((u) => !u.hidden)) ?? [], $ = () => x.invalidateQueries({ queryKey: ["pipeline-template", s] }), q = z({
|
|
@@ -2334,7 +2334,7 @@ function rs({
|
|
|
2334
2334
|
}, C = (u) => {
|
|
2335
2335
|
const { active: k, over: L } = u;
|
|
2336
2336
|
if (!L || k.id === L.id) return;
|
|
2337
|
-
const R = c.indexOf(k.id), B = c.indexOf(L.id), M =
|
|
2337
|
+
const R = c.indexOf(k.id), B = c.indexOf(L.id), M = nt(c, R, B);
|
|
2338
2338
|
o(M), M.forEach((E, W) => {
|
|
2339
2339
|
var te;
|
|
2340
2340
|
((te = r.find((ne) => ne.id === E)) == null ? void 0 : te.sort) !== W && O.mutate({ dimId: E, body: { sort: W } });
|
|
@@ -2342,7 +2342,7 @@ function rs({
|
|
|
2342
2342
|
};
|
|
2343
2343
|
return /* @__PURE__ */ a("div", { className: "border-t border-slate-100 bg-slate-50/50 px-4 pt-3 pb-4 space-y-3 rounded-b-lg", children: [
|
|
2344
2344
|
r.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 py-0.5", children: "No dimensions — add one below." }),
|
|
2345
|
-
r.length > 0 && /* @__PURE__ */ e(
|
|
2345
|
+
r.length > 0 && /* @__PURE__ */ e(Ze, { sensors: p, collisionDetection: et, onDragEnd: C, children: /* @__PURE__ */ e(tt, { items: c, strategy: at, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: m.map(
|
|
2346
2346
|
(u) => g === u.id ? /* @__PURE__ */ a(
|
|
2347
2347
|
"div",
|
|
2348
2348
|
{
|
|
@@ -2352,7 +2352,7 @@ function rs({
|
|
|
2352
2352
|
/* @__PURE__ */ a("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
|
|
2353
2353
|
/* @__PURE__ */ e(V, { className: "text-[11px] text-slate-500", children: "Field" }),
|
|
2354
2354
|
/* @__PURE__ */ e(
|
|
2355
|
-
|
|
2355
|
+
bt,
|
|
2356
2356
|
{
|
|
2357
2357
|
collection: t.collection,
|
|
2358
2358
|
fields: N,
|
|
@@ -2435,7 +2435,7 @@ function rs({
|
|
|
2435
2435
|
},
|
|
2436
2436
|
u.id
|
|
2437
2437
|
) : /* @__PURE__ */ e(
|
|
2438
|
-
|
|
2438
|
+
rs,
|
|
2439
2439
|
{
|
|
2440
2440
|
d: u,
|
|
2441
2441
|
siblings: m,
|
|
@@ -2454,7 +2454,7 @@ function rs({
|
|
|
2454
2454
|
/* @__PURE__ */ a("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
|
|
2455
2455
|
/* @__PURE__ */ e(V, { className: "text-[11px] text-slate-500", children: "Field" }),
|
|
2456
2456
|
/* @__PURE__ */ e(
|
|
2457
|
-
|
|
2457
|
+
bt,
|
|
2458
2458
|
{
|
|
2459
2459
|
collection: t.collection,
|
|
2460
2460
|
fields: N,
|
|
@@ -2526,18 +2526,18 @@ function rs({
|
|
|
2526
2526
|
] })
|
|
2527
2527
|
] });
|
|
2528
2528
|
}
|
|
2529
|
-
function
|
|
2529
|
+
function yr({
|
|
2530
2530
|
templateId: t,
|
|
2531
2531
|
onBack: s,
|
|
2532
2532
|
onExport: l,
|
|
2533
2533
|
hidden: x
|
|
2534
2534
|
}) {
|
|
2535
|
-
var
|
|
2535
|
+
var Ut;
|
|
2536
2536
|
const r = Z(), c = Ce(), o = new Set(x ?? []), [m, p] = A(!1), [g, f] = A(""), [i, v] = A(!1), [h, d] = A(null), [S, N] = A(!1), [$, q] = A(null), [O, y] = A(null), [w, C] = A(
|
|
2537
2537
|
null
|
|
2538
|
-
), [b, u] = A(""), [k, L] = A(""), [R, B] = A(null), [M, E] = A(!1), [W, te] = A([]), ne =
|
|
2539
|
-
|
|
2540
|
-
|
|
2538
|
+
), [b, u] = A(""), [k, L] = A(""), [R, B] = A(null), [M, E] = A(!1), [W, te] = A([]), ne = sa(
|
|
2539
|
+
st(ra),
|
|
2540
|
+
st(la, { coordinateGetter: ia })
|
|
2541
2541
|
), { data: de } = I({
|
|
2542
2542
|
queryKey: ["collection-fields", b],
|
|
2543
2543
|
queryFn: () => r.request(Y(`/collections/${b}`)).then((n) => {
|
|
@@ -2545,9 +2545,9 @@ function vr({
|
|
|
2545
2545
|
return (((_ = n.data) == null ? void 0 : _.fields) ?? []).filter((T) => !T.hidden);
|
|
2546
2546
|
}),
|
|
2547
2547
|
enabled: !!b
|
|
2548
|
-
}), [me,
|
|
2548
|
+
}), [me, it] = A(null), {
|
|
2549
2549
|
data: j,
|
|
2550
|
-
isLoading:
|
|
2550
|
+
isLoading: Ve,
|
|
2551
2551
|
isError: U,
|
|
2552
2552
|
error: X,
|
|
2553
2553
|
refetch: pe
|
|
@@ -2555,58 +2555,58 @@ function vr({
|
|
|
2555
2555
|
queryKey: ["pipeline-template", t],
|
|
2556
2556
|
queryFn: () => r.request(Y(`/pipelines/${t}`)).then((n) => n.data),
|
|
2557
2557
|
enabled: !!t
|
|
2558
|
-
}), [ue,
|
|
2558
|
+
}), [ue, $t] = A([]), [Ie, Ft] = A({});
|
|
2559
2559
|
he(() => {
|
|
2560
2560
|
const n = (j == null ? void 0 : j.states) ?? [];
|
|
2561
2561
|
te(n.map((_) => _.id));
|
|
2562
2562
|
}, [j == null ? void 0 : j.states]), he(() => {
|
|
2563
|
-
const n =
|
|
2564
|
-
|
|
2563
|
+
const n = Zt((j == null ? void 0 : j.transitions) ?? []);
|
|
2564
|
+
$t(n.map((_) => _.label)), Ft(
|
|
2565
2565
|
Object.fromEntries(n.map((_) => [_.label, _.routes.map((T) => T.ids[0])]))
|
|
2566
2566
|
);
|
|
2567
2567
|
}, [j == null ? void 0 : j.transitions]);
|
|
2568
|
-
const { data:
|
|
2568
|
+
const { data: _a } = I({
|
|
2569
2569
|
queryKey: ["collections", "tables_only"],
|
|
2570
2570
|
queryFn: () => r.request(Y("/collections?tables_only=true")).then((n) => n.data)
|
|
2571
|
-
}), { data:
|
|
2571
|
+
}), { data: ot } = I({
|
|
2572
2572
|
queryKey: ["pipeline-all-owner-groups", t],
|
|
2573
2573
|
queryFn: () => r.request(Y(`/pipelines/${t}/owner-groups`)).then((n) => n.data),
|
|
2574
2574
|
enabled: !!t
|
|
2575
|
-
}),
|
|
2575
|
+
}), Ca = gt(
|
|
2576
2576
|
() => ((j == null ? void 0 : j.bindings) ?? []).map((n) => n.collection),
|
|
2577
2577
|
[j == null ? void 0 : j.bindings]
|
|
2578
|
-
), { data:
|
|
2578
|
+
), { data: Te, dataUpdatedAt: Sa } = pa(
|
|
2579
2579
|
t,
|
|
2580
|
-
|
|
2581
|
-
),
|
|
2582
|
-
() =>
|
|
2583
|
-
(
|
|
2580
|
+
Ca
|
|
2581
|
+
), qa = gt(
|
|
2582
|
+
() => rn(
|
|
2583
|
+
(Te == null ? void 0 : Te.data) ?? [],
|
|
2584
2584
|
((j == null ? void 0 : j.states) ?? []).map((n) => n.id)
|
|
2585
2585
|
),
|
|
2586
|
-
[
|
|
2587
|
-
),
|
|
2586
|
+
[Te, j == null ? void 0 : j.states]
|
|
2587
|
+
), $a = sn(Sa), se = () => {
|
|
2588
2588
|
c.invalidateQueries({ queryKey: ["pipeline-template", t] }), c.invalidateQueries({ queryKey: ["pipeline-templates"] }), c.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", t] });
|
|
2589
|
-
},
|
|
2590
|
-
meId:
|
|
2591
|
-
}),
|
|
2589
|
+
}, Fa = da(en), { change: Et, clear: Ot } = nn("pipeline", t, {
|
|
2590
|
+
meId: Fa.userId || null
|
|
2591
|
+
}), Ea = m || i || !!h || S || !!$ || !!w, ct = z({
|
|
2592
2592
|
mutationFn: (n) => r.request(ve(`/pipelines/${t}`, n)),
|
|
2593
2593
|
onSuccess: () => {
|
|
2594
2594
|
se(), p(!1);
|
|
2595
2595
|
},
|
|
2596
2596
|
onError: () => D.error("Failed to update pipeline")
|
|
2597
|
-
}),
|
|
2597
|
+
}), At = z({
|
|
2598
2598
|
mutationFn: (n) => r.request(J(`/pipelines/${t}/states`, n)),
|
|
2599
2599
|
onSuccess: () => {
|
|
2600
2600
|
se(), v(!1);
|
|
2601
2601
|
},
|
|
2602
2602
|
onError: () => D.error("Failed to add state")
|
|
2603
|
-
}),
|
|
2603
|
+
}), dt = z({
|
|
2604
2604
|
mutationFn: ({ stateId: n, body: _ }) => r.request(ve(`/pipelines/states/${n}`, _)),
|
|
2605
2605
|
onSuccess: () => {
|
|
2606
2606
|
se(), d(null);
|
|
2607
2607
|
},
|
|
2608
2608
|
onError: () => D.error("Failed to update state")
|
|
2609
|
-
}),
|
|
2609
|
+
}), Oa = z({
|
|
2610
2610
|
mutationFn: (n) => r.request(Fe(`/pipelines/states/${n}`)),
|
|
2611
2611
|
onSuccess: () => {
|
|
2612
2612
|
se(), D.success("State deleted");
|
|
@@ -2616,7 +2616,7 @@ function vr({
|
|
|
2616
2616
|
const _ = ((T = n == null ? void 0 : n.response) == null ? void 0 : T.error) ?? (n == null ? void 0 : n.message);
|
|
2617
2617
|
D.error(_ || "Failed to delete state", { duration: 9e3 });
|
|
2618
2618
|
}
|
|
2619
|
-
}),
|
|
2619
|
+
}), Rt = z({
|
|
2620
2620
|
mutationFn: async (n) => {
|
|
2621
2621
|
const _ = {
|
|
2622
2622
|
from_state: n.from_state,
|
|
@@ -2644,7 +2644,7 @@ function vr({
|
|
|
2644
2644
|
se(), N(!1);
|
|
2645
2645
|
},
|
|
2646
2646
|
onError: () => D.error("Failed to add transition")
|
|
2647
|
-
}),
|
|
2647
|
+
}), Lt = z({
|
|
2648
2648
|
mutationFn: async ({
|
|
2649
2649
|
labelGroup: n,
|
|
2650
2650
|
data: _
|
|
@@ -2676,7 +2676,7 @@ function vr({
|
|
|
2676
2676
|
se(), q(null);
|
|
2677
2677
|
},
|
|
2678
2678
|
onError: () => D.error("Failed to add route")
|
|
2679
|
-
}),
|
|
2679
|
+
}), Tt = z({
|
|
2680
2680
|
mutationFn: async ({ route: n, data: _ }) => {
|
|
2681
2681
|
const T = /* @__PURE__ */ new Map();
|
|
2682
2682
|
n.to_states.forEach((F, K) => {
|
|
@@ -2717,9 +2717,9 @@ function vr({
|
|
|
2717
2717
|
se(), C(null);
|
|
2718
2718
|
},
|
|
2719
2719
|
onError: (n) => {
|
|
2720
|
-
|
|
2720
|
+
Vt(n, "Failed to update route");
|
|
2721
2721
|
}
|
|
2722
|
-
}),
|
|
2722
|
+
}), Pt = z({
|
|
2723
2723
|
mutationFn: async (n) => {
|
|
2724
2724
|
for (const _ of n) await r.request(Fe(`/pipelines/transitions/${_}`));
|
|
2725
2725
|
},
|
|
@@ -2727,21 +2727,21 @@ function vr({
|
|
|
2727
2727
|
se(), D.success("Deleted");
|
|
2728
2728
|
},
|
|
2729
2729
|
onError: () => D.error("Failed to delete")
|
|
2730
|
-
}),
|
|
2730
|
+
}), Aa = z({
|
|
2731
2731
|
mutationFn: async (n) => {
|
|
2732
2732
|
for (const { id: _, sort: T } of n)
|
|
2733
2733
|
await r.request(ve(`/pipelines/transitions/${_}`, { sort: T }));
|
|
2734
2734
|
},
|
|
2735
2735
|
onSuccess: () => se(),
|
|
2736
2736
|
onError: () => D.error("Failed to reorder")
|
|
2737
|
-
}),
|
|
2737
|
+
}), Ra = z({
|
|
2738
2738
|
mutationFn: async ({ ids: n, color: _ }) => {
|
|
2739
2739
|
for (const T of n)
|
|
2740
2740
|
await r.request(ve(`/pipelines/transitions/${T}`, { color: _ }));
|
|
2741
2741
|
},
|
|
2742
2742
|
onSuccess: () => se(),
|
|
2743
2743
|
onError: () => D.error("Failed to update color")
|
|
2744
|
-
}), [$e,
|
|
2744
|
+
}), [$e, Ye] = A(null), Pe = z({
|
|
2745
2745
|
mutationFn: async ({
|
|
2746
2746
|
from: n,
|
|
2747
2747
|
label: _,
|
|
@@ -2758,62 +2758,62 @@ function vr({
|
|
|
2758
2758
|
},
|
|
2759
2759
|
onSuccess: (n, { label: _ }) => {
|
|
2760
2760
|
if ("pending" in n && n.pending) {
|
|
2761
|
-
|
|
2761
|
+
Ye(n.pending);
|
|
2762
2762
|
return;
|
|
2763
2763
|
}
|
|
2764
2764
|
const T = "done" in n ? n.done.filter((G) => G.rewritten).length : 0;
|
|
2765
|
-
se(), y(null),
|
|
2765
|
+
se(), y(null), Ye(null), D.success(
|
|
2766
2766
|
T ? `Renamed to "${_}" · ${T} reference${T === 1 ? "" : "s"} updated` : `Renamed to "${_}"`
|
|
2767
2767
|
);
|
|
2768
2768
|
},
|
|
2769
2769
|
onError: (n) => {
|
|
2770
|
-
|
|
2770
|
+
Vt(n, "Failed to rename");
|
|
2771
2771
|
}
|
|
2772
|
-
}),
|
|
2772
|
+
}), Dt = z({
|
|
2773
2773
|
mutationFn: (n) => r.request(J(`/pipelines/${t}/bind`, n)),
|
|
2774
2774
|
onSuccess: () => {
|
|
2775
2775
|
se(), u(""), L(""), D.success("Collection bound");
|
|
2776
2776
|
},
|
|
2777
2777
|
onError: () => D.error("Failed to bind collection")
|
|
2778
|
-
}),
|
|
2778
|
+
}), La = z({
|
|
2779
2779
|
mutationFn: (n) => r.request(Fe(`/pipelines/bindings/${n}`)),
|
|
2780
2780
|
onSuccess: () => {
|
|
2781
2781
|
se(), D.success("Collection unbound");
|
|
2782
2782
|
},
|
|
2783
2783
|
onError: () => D.error("Failed to unbind")
|
|
2784
|
-
}),
|
|
2784
|
+
}), Ge = z({
|
|
2785
2785
|
mutationFn: ({
|
|
2786
2786
|
bindingId: n,
|
|
2787
2787
|
body: _
|
|
2788
2788
|
}) => r.request(ve(`/pipelines/bindings/${n}`, _)),
|
|
2789
2789
|
onSuccess: () => se(),
|
|
2790
2790
|
onError: () => D.error("Failed to update binding")
|
|
2791
|
-
}),
|
|
2791
|
+
}), jt = Be(!1), Mt = !!j;
|
|
2792
2792
|
if (he(() => {
|
|
2793
|
-
if (!
|
|
2794
|
-
|
|
2793
|
+
if (!Mt || jt.current || typeof window > "u" || window.location.hash !== "#owner-matrix") return;
|
|
2794
|
+
jt.current = !0;
|
|
2795
2795
|
const n = window.setTimeout(() => {
|
|
2796
2796
|
var _;
|
|
2797
2797
|
(_ = document.getElementById("owner-matrix")) == null || _.scrollIntoView({ block: "start" });
|
|
2798
2798
|
}, 50);
|
|
2799
2799
|
return () => window.clearTimeout(n);
|
|
2800
|
-
}, [
|
|
2800
|
+
}, [Mt]), U && !j)
|
|
2801
2801
|
return /* @__PURE__ */ e(
|
|
2802
|
-
|
|
2802
|
+
fn,
|
|
2803
2803
|
{
|
|
2804
2804
|
error: X,
|
|
2805
2805
|
what: "this pipeline",
|
|
2806
2806
|
onRetry: () => void pe()
|
|
2807
2807
|
}
|
|
2808
2808
|
);
|
|
2809
|
-
if (
|
|
2809
|
+
if (Ve || !j)
|
|
2810
2810
|
return /* @__PURE__ */ a("div", { className: "p-8 space-y-4", children: [
|
|
2811
|
-
/* @__PURE__ */ e(
|
|
2812
|
-
/* @__PURE__ */ e(
|
|
2813
|
-
/* @__PURE__ */ e(
|
|
2811
|
+
/* @__PURE__ */ e(ze, { className: "h-8 w-64" }),
|
|
2812
|
+
/* @__PURE__ */ e(ze, { className: "h-48 rounded-xl" }),
|
|
2813
|
+
/* @__PURE__ */ e(ze, { className: "h-48 rounded-xl" })
|
|
2814
2814
|
] });
|
|
2815
|
-
const ie = j.states ?? [],
|
|
2816
|
-
function
|
|
2815
|
+
const ie = j.states ?? [], zt = j.transitions ?? [], oe = j.bindings ?? [], Ee = [...new Set(oe.map((n) => n.collection))], Je = j.record_collections ?? Ee, Ta = _a ?? [], mt = W.length > 0 ? W.map((n) => ie.find((_) => _.id === n)).filter(Boolean) : ie, Kt = new Map(ie.map((n) => [n.id, n])), pt = new Map(Zt(zt).map((n) => [n.label, n])), Bt = ue.map((n) => pt.get(n)).filter((n) => !!n);
|
|
2816
|
+
function Wt(n, _, T) {
|
|
2817
2817
|
const G = [];
|
|
2818
2818
|
let ae = 0;
|
|
2819
2819
|
for (const F of n) {
|
|
@@ -2827,31 +2827,31 @@ function vr({
|
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
2830
|
-
|
|
2830
|
+
Aa.mutate(G);
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function Pa(n) {
|
|
2833
2833
|
const { active: _, over: T } = n;
|
|
2834
2834
|
if (!T || _.id === T.id) return;
|
|
2835
|
-
const G =
|
|
2835
|
+
const G = nt(
|
|
2836
2836
|
ue,
|
|
2837
2837
|
ue.indexOf(_.id),
|
|
2838
2838
|
ue.indexOf(T.id)
|
|
2839
2839
|
);
|
|
2840
|
-
|
|
2840
|
+
$t(G), Wt(G, Ie, pt);
|
|
2841
2841
|
}
|
|
2842
|
-
function
|
|
2842
|
+
function Da(n, _) {
|
|
2843
2843
|
const { active: T, over: G } = _;
|
|
2844
2844
|
if (!G || T.id === G.id) return;
|
|
2845
|
-
const ae =
|
|
2846
|
-
|
|
2845
|
+
const ae = Ie[n] ?? [], F = nt(ae, ae.indexOf(T.id), ae.indexOf(G.id)), K = { ...Ie, [n]: F };
|
|
2846
|
+
Ft(K), Wt(ue, K, pt);
|
|
2847
2847
|
}
|
|
2848
|
-
const
|
|
2848
|
+
const ja = oe.some((n) => (n.dimensions ?? []).length > 0), Ma = new Set(oe.map((n) => n.collection)), za = Ta.filter((n) => !Ma.has(n.collection)), Ka = (n) => {
|
|
2849
2849
|
const { active: _, over: T } = n;
|
|
2850
2850
|
if (!T || _.id === T.id) return;
|
|
2851
|
-
const G = W.indexOf(_.id), ae = W.indexOf(T.id), F =
|
|
2851
|
+
const G = W.indexOf(_.id), ae = W.indexOf(T.id), F = nt(W, G, ae);
|
|
2852
2852
|
te(F), F.forEach((K, re) => {
|
|
2853
2853
|
var ge;
|
|
2854
|
-
((ge = ie.find((xe) => xe.id === K)) == null ? void 0 : ge.sort) !== re &&
|
|
2854
|
+
((ge = ie.find((xe) => xe.id === K)) == null ? void 0 : ge.sort) !== re && dt.mutate({ stateId: K, body: { sort: re } });
|
|
2855
2855
|
});
|
|
2856
2856
|
};
|
|
2857
2857
|
return /* @__PURE__ */ a(fe, { children: [
|
|
@@ -2866,7 +2866,7 @@ function vr({
|
|
|
2866
2866
|
onClick: s,
|
|
2867
2867
|
className: "flex items-center gap-1 text-slate-400 transition-colors hover:text-slate-700",
|
|
2868
2868
|
children: [
|
|
2869
|
-
/* @__PURE__ */ e(
|
|
2869
|
+
/* @__PURE__ */ e(Ba, { className: "h-3.5 w-3.5" }),
|
|
2870
2870
|
"Pipelines"
|
|
2871
2871
|
]
|
|
2872
2872
|
}
|
|
@@ -2878,7 +2878,7 @@ function vr({
|
|
|
2878
2878
|
{
|
|
2879
2879
|
className: "flex items-center gap-1.5",
|
|
2880
2880
|
onSubmit: (n) => {
|
|
2881
|
-
n.preventDefault(), g.trim() &&
|
|
2881
|
+
n.preventDefault(), g.trim() && ct.mutate({ name: g.trim() });
|
|
2882
2882
|
},
|
|
2883
2883
|
children: [
|
|
2884
2884
|
/* @__PURE__ */ e(
|
|
@@ -2914,14 +2914,14 @@ function vr({
|
|
|
2914
2914
|
},
|
|
2915
2915
|
children: [
|
|
2916
2916
|
j.name,
|
|
2917
|
-
/* @__PURE__ */ e(
|
|
2917
|
+
/* @__PURE__ */ e(je, { className: "h-3 w-3 text-slate-400" })
|
|
2918
2918
|
]
|
|
2919
2919
|
}
|
|
2920
2920
|
)
|
|
2921
2921
|
] }),
|
|
2922
2922
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2923
2923
|
!o.has("history") && /* @__PURE__ */ e(
|
|
2924
|
-
|
|
2924
|
+
pn,
|
|
2925
2925
|
{
|
|
2926
2926
|
collection: "nivaro_workflow_templates",
|
|
2927
2927
|
item: t,
|
|
@@ -2941,23 +2941,23 @@ function vr({
|
|
|
2941
2941
|
}
|
|
2942
2942
|
},
|
|
2943
2943
|
children: [
|
|
2944
|
-
/* @__PURE__ */ e(
|
|
2944
|
+
/* @__PURE__ */ e(Wa, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
2945
2945
|
" Export"
|
|
2946
2946
|
]
|
|
2947
2947
|
}
|
|
2948
2948
|
)
|
|
2949
2949
|
] })
|
|
2950
2950
|
] }),
|
|
2951
|
-
|
|
2952
|
-
|
|
2951
|
+
Et && /* @__PURE__ */ e(
|
|
2952
|
+
mn,
|
|
2953
2953
|
{
|
|
2954
2954
|
className: "-mx-8 -mb-5 mt-4 border-b-0 border-t",
|
|
2955
|
-
change:
|
|
2956
|
-
dirty:
|
|
2955
|
+
change: Et,
|
|
2956
|
+
dirty: Ea,
|
|
2957
2957
|
onShow: () => {
|
|
2958
|
-
|
|
2958
|
+
Ot(), se(), c.invalidateQueries({ queryKey: ["pipeline-versions", t] });
|
|
2959
2959
|
},
|
|
2960
|
-
onDismiss:
|
|
2960
|
+
onDismiss: Ot
|
|
2961
2961
|
}
|
|
2962
2962
|
)
|
|
2963
2963
|
] }),
|
|
@@ -2973,7 +2973,7 @@ function vr({
|
|
|
2973
2973
|
className: "text-[13px]",
|
|
2974
2974
|
onBlur: (n) => {
|
|
2975
2975
|
const _ = n.target.value.trim() || null;
|
|
2976
|
-
_ !== j.description &&
|
|
2976
|
+
_ !== j.description && ct.mutate({ description: _ });
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
2979
|
)
|
|
@@ -2981,16 +2981,16 @@ function vr({
|
|
|
2981
2981
|
/* @__PURE__ */ a("div", { className: "shrink-0 space-y-1.5", children: [
|
|
2982
2982
|
/* @__PURE__ */ e(V, { className: "text-[12px]", children: "Accent color" }),
|
|
2983
2983
|
/* @__PURE__ */ e(
|
|
2984
|
-
|
|
2984
|
+
rt,
|
|
2985
2985
|
{
|
|
2986
2986
|
value: j.color,
|
|
2987
|
-
onChange: (n) =>
|
|
2987
|
+
onChange: (n) => ct.mutate({ color: n })
|
|
2988
2988
|
}
|
|
2989
2989
|
)
|
|
2990
2990
|
] })
|
|
2991
2991
|
] }),
|
|
2992
2992
|
/* @__PURE__ */ e(
|
|
2993
|
-
|
|
2993
|
+
dn,
|
|
2994
2994
|
{
|
|
2995
2995
|
kind: "config",
|
|
2996
2996
|
params: { type: "pipeline", id: t },
|
|
@@ -3021,39 +3021,39 @@ function vr({
|
|
|
3021
3021
|
] }),
|
|
3022
3022
|
ie.length === 0 && !i && /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-400", children: "No states yet. States define the stages a record can be in." }),
|
|
3023
3023
|
/* @__PURE__ */ e(
|
|
3024
|
-
|
|
3024
|
+
Ze,
|
|
3025
3025
|
{
|
|
3026
3026
|
sensors: ne,
|
|
3027
|
-
collisionDetection:
|
|
3028
|
-
onDragEnd:
|
|
3029
|
-
children: /* @__PURE__ */ e(
|
|
3030
|
-
|
|
3027
|
+
collisionDetection: et,
|
|
3028
|
+
onDragEnd: Ka,
|
|
3029
|
+
children: /* @__PURE__ */ e(tt, { items: W, strategy: at, children: /* @__PURE__ */ a("div", { className: "space-y-2", ref: $a, children: [
|
|
3030
|
+
mt.map((n) => {
|
|
3031
3031
|
var _, T;
|
|
3032
3032
|
return /* @__PURE__ */ a("div", { children: [
|
|
3033
3033
|
(h == null ? void 0 : h.id) === n.id ? /* @__PURE__ */ e(
|
|
3034
|
-
|
|
3034
|
+
Jt,
|
|
3035
3035
|
{
|
|
3036
3036
|
reach: Ee,
|
|
3037
3037
|
initial: n,
|
|
3038
|
-
saving:
|
|
3039
|
-
onSave: (G) =>
|
|
3038
|
+
saving: dt.isPending,
|
|
3039
|
+
onSave: (G) => dt.mutate({ stateId: n.id, body: G }),
|
|
3040
3040
|
onCancel: () => d(null)
|
|
3041
3041
|
}
|
|
3042
3042
|
) : /* @__PURE__ */ e(
|
|
3043
|
-
|
|
3043
|
+
ns,
|
|
3044
3044
|
{
|
|
3045
3045
|
s: n,
|
|
3046
|
-
groups: (
|
|
3046
|
+
groups: (ot == null ? void 0 : ot[n.id]) ?? [],
|
|
3047
3047
|
expandedStateId: R,
|
|
3048
3048
|
onToggleExpand: () => B(R === n.id ? null : n.id),
|
|
3049
3049
|
onEdit: () => d(n),
|
|
3050
|
-
onDelete: () =>
|
|
3051
|
-
census:
|
|
3050
|
+
onDelete: () => Oa.mutate(n.id),
|
|
3051
|
+
census: Te ? qa.get(n.id) : void 0
|
|
3052
3052
|
}
|
|
3053
3053
|
),
|
|
3054
3054
|
R === n.id && (h == null ? void 0 : h.id) !== n.id && /* @__PURE__ */ a("div", { className: "ml-4 mb-2 mt-2 rounded-xl border border-slate-200 bg-slate-50 p-4 space-y-4", children: [
|
|
3055
3055
|
/* @__PURE__ */ e(
|
|
3056
|
-
|
|
3056
|
+
En,
|
|
3057
3057
|
{
|
|
3058
3058
|
stateId: n.id,
|
|
3059
3059
|
stateName: n.label,
|
|
@@ -3062,7 +3062,7 @@ function vr({
|
|
|
3062
3062
|
}
|
|
3063
3063
|
),
|
|
3064
3064
|
/* @__PURE__ */ e("div", { className: "border-t border-slate-200 pt-4", children: /* @__PURE__ */ e(
|
|
3065
|
-
|
|
3065
|
+
Fn,
|
|
3066
3066
|
{
|
|
3067
3067
|
stateId: n.id,
|
|
3068
3068
|
stateName: n.label,
|
|
@@ -3075,12 +3075,12 @@ function vr({
|
|
|
3075
3075
|
] }, n.id);
|
|
3076
3076
|
}),
|
|
3077
3077
|
i && /* @__PURE__ */ e(
|
|
3078
|
-
|
|
3078
|
+
Jt,
|
|
3079
3079
|
{
|
|
3080
3080
|
reach: Ee,
|
|
3081
3081
|
initial: {},
|
|
3082
|
-
saving:
|
|
3083
|
-
onSave: (n) =>
|
|
3082
|
+
saving: At.isPending,
|
|
3083
|
+
onSave: (n) => At.mutate({ ...n, sort: ie.length }),
|
|
3084
3084
|
onCancel: () => v(!1)
|
|
3085
3085
|
}
|
|
3086
3086
|
)
|
|
@@ -3092,7 +3092,7 @@ function vr({
|
|
|
3092
3092
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
3093
3093
|
/* @__PURE__ */ a("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
3094
3094
|
"Transitions",
|
|
3095
|
-
/* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children:
|
|
3095
|
+
/* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: zt.length }),
|
|
3096
3096
|
/* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "The allowed moves between states — who may take them, the conditions that gate them, and the actions they fire." })
|
|
3097
3097
|
] }),
|
|
3098
3098
|
!S && /* @__PURE__ */ a(
|
|
@@ -3113,19 +3113,19 @@ function vr({
|
|
|
3113
3113
|
ie.length < 2 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Add at least 2 states before defining transitions." }),
|
|
3114
3114
|
/* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
3115
3115
|
/* @__PURE__ */ e(
|
|
3116
|
-
|
|
3116
|
+
Ze,
|
|
3117
3117
|
{
|
|
3118
3118
|
sensors: ne,
|
|
3119
|
-
collisionDetection:
|
|
3120
|
-
onDragEnd:
|
|
3121
|
-
children: /* @__PURE__ */ e(
|
|
3119
|
+
collisionDetection: et,
|
|
3120
|
+
onDragEnd: Pa,
|
|
3121
|
+
children: /* @__PURE__ */ e(tt, { items: ue, strategy: at, children: Bt.map((n) => {
|
|
3122
3122
|
var ae;
|
|
3123
|
-
const _ = new Map(n.routes.map((F) => [F.ids[0], F])), T =
|
|
3124
|
-
return /* @__PURE__ */ e(
|
|
3123
|
+
const _ = new Map(n.routes.map((F) => [F.ids[0], F])), T = Ie[n.label] ?? n.routes.map((F) => F.ids[0]), G = T.map((F) => _.get(F)).filter((F) => !!F);
|
|
3124
|
+
return /* @__PURE__ */ e(ea, { id: n.label, children: /* @__PURE__ */ a("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
3125
3125
|
/* @__PURE__ */ a("div", { className: "group/hdr flex items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border dark:bg-muted/50", children: [
|
|
3126
|
-
/* @__PURE__ */ e(
|
|
3127
|
-
/* @__PURE__ */ a(
|
|
3128
|
-
/* @__PURE__ */ e(
|
|
3126
|
+
/* @__PURE__ */ e(ta, {}),
|
|
3127
|
+
/* @__PURE__ */ a(Ue, { children: [
|
|
3128
|
+
/* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3129
3129
|
"button",
|
|
3130
3130
|
{
|
|
3131
3131
|
type: "button",
|
|
@@ -3135,7 +3135,7 @@ function vr({
|
|
|
3135
3135
|
}
|
|
3136
3136
|
) }),
|
|
3137
3137
|
/* @__PURE__ */ a(
|
|
3138
|
-
|
|
3138
|
+
He,
|
|
3139
3139
|
{
|
|
3140
3140
|
align: "start",
|
|
3141
3141
|
className: "w-auto p-3",
|
|
@@ -3143,12 +3143,12 @@ function vr({
|
|
|
3143
3143
|
children: [
|
|
3144
3144
|
/* @__PURE__ */ e("p", { className: "mb-2 text-[11px] font-medium text-slate-500", children: "Group color" }),
|
|
3145
3145
|
/* @__PURE__ */ e(
|
|
3146
|
-
|
|
3146
|
+
rt,
|
|
3147
3147
|
{
|
|
3148
3148
|
value: n.color,
|
|
3149
3149
|
onChange: (F) => {
|
|
3150
3150
|
const K = n.routes.flatMap((re) => re.ids);
|
|
3151
|
-
|
|
3151
|
+
Ra.mutate({ ids: K, color: F });
|
|
3152
3152
|
}
|
|
3153
3153
|
}
|
|
3154
3154
|
)
|
|
@@ -3157,8 +3157,8 @@ function vr({
|
|
|
3157
3157
|
)
|
|
3158
3158
|
] }),
|
|
3159
3159
|
(O == null ? void 0 : O.from) === n.label ? (() => {
|
|
3160
|
-
const F = O.value, K = F.trim(), re = K !== n.label &&
|
|
3161
|
-
!ge ||
|
|
3160
|
+
const F = O.value, K = F.trim(), re = K !== n.label && Bt.some((ce) => ce.label === K), ge = K.length > 0 && K !== n.label && !re, xe = () => {
|
|
3161
|
+
!ge || Pe.isPending || ($e && $e.to !== K && Ye(null), Pe.mutate({ from: n.label, label: K }));
|
|
3162
3162
|
}, le = ($e == null ? void 0 : $e.from) === n.label && $e.to === K ? $e.references : null;
|
|
3163
3163
|
return /* @__PURE__ */ a(
|
|
3164
3164
|
"div",
|
|
@@ -3188,7 +3188,7 @@ function vr({
|
|
|
3188
3188
|
{
|
|
3189
3189
|
type: "button",
|
|
3190
3190
|
onClick: xe,
|
|
3191
|
-
disabled: !ge ||
|
|
3191
|
+
disabled: !ge || Pe.isPending,
|
|
3192
3192
|
title: "Save (Enter)",
|
|
3193
3193
|
className: "rounded p-1 text-emerald-600 hover:bg-emerald-50 disabled:opacity-40",
|
|
3194
3194
|
children: /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" })
|
|
@@ -3199,7 +3199,7 @@ function vr({
|
|
|
3199
3199
|
{
|
|
3200
3200
|
type: "button",
|
|
3201
3201
|
onClick: () => {
|
|
3202
|
-
y(null),
|
|
3202
|
+
y(null), Ye(null);
|
|
3203
3203
|
},
|
|
3204
3204
|
title: "Cancel (Esc)",
|
|
3205
3205
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100",
|
|
@@ -3229,12 +3229,12 @@ function vr({
|
|
|
3229
3229
|
"button",
|
|
3230
3230
|
{
|
|
3231
3231
|
type: "button",
|
|
3232
|
-
onClick: () =>
|
|
3232
|
+
onClick: () => Pe.mutate({
|
|
3233
3233
|
from: n.label,
|
|
3234
3234
|
label: K,
|
|
3235
3235
|
confirmed: !0
|
|
3236
3236
|
}),
|
|
3237
|
-
disabled:
|
|
3237
|
+
disabled: Pe.isPending,
|
|
3238
3238
|
"data-transition-rename-confirm": !0,
|
|
3239
3239
|
className: "mt-1.5 rounded bg-amber-600 px-2 py-0.5 text-[11px] font-medium text-white hover:bg-amber-700 disabled:opacity-50",
|
|
3240
3240
|
children: [
|
|
@@ -3259,7 +3259,7 @@ function vr({
|
|
|
3259
3259
|
title: "Rename this button",
|
|
3260
3260
|
"aria-label": `Rename ${n.label}`,
|
|
3261
3261
|
className: "rounded p-1 text-slate-300 opacity-0 hover:text-slate-600 group-hover/hdr:opacity-100 transition-opacity",
|
|
3262
|
-
children: /* @__PURE__ */ e(
|
|
3262
|
+
children: /* @__PURE__ */ e(je, { className: "h-3 w-3" })
|
|
3263
3263
|
}
|
|
3264
3264
|
),
|
|
3265
3265
|
/* @__PURE__ */ e("span", { className: "flex-1" })
|
|
@@ -3282,41 +3282,41 @@ function vr({
|
|
|
3282
3282
|
}
|
|
3283
3283
|
),
|
|
3284
3284
|
/* @__PURE__ */ e(
|
|
3285
|
-
|
|
3285
|
+
Me,
|
|
3286
3286
|
{
|
|
3287
|
-
onConfirm: () =>
|
|
3287
|
+
onConfirm: () => Pt.mutate(n.routes.flatMap((F) => F.ids)),
|
|
3288
3288
|
title: "Delete all routes",
|
|
3289
3289
|
confirmLabel: "Delete all?",
|
|
3290
3290
|
confirmTitle: `Delete all routes for "${n.label}"?`,
|
|
3291
3291
|
className: "rounded p-1 text-slate-300 opacity-0 hover:text-red-500 group-hover/hdr:opacity-100 transition-opacity",
|
|
3292
|
-
armedClassName: H(
|
|
3292
|
+
armedClassName: H(Ke, "opacity-100"),
|
|
3293
3293
|
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
3294
3294
|
}
|
|
3295
3295
|
)
|
|
3296
3296
|
] }),
|
|
3297
3297
|
/* @__PURE__ */ e(
|
|
3298
|
-
|
|
3298
|
+
Ze,
|
|
3299
3299
|
{
|
|
3300
3300
|
sensors: ne,
|
|
3301
|
-
collisionDetection:
|
|
3302
|
-
onDragEnd: (F) =>
|
|
3301
|
+
collisionDetection: et,
|
|
3302
|
+
onDragEnd: (F) => Da(n.label, F),
|
|
3303
3303
|
children: /* @__PURE__ */ e(
|
|
3304
|
-
|
|
3304
|
+
tt,
|
|
3305
3305
|
{
|
|
3306
3306
|
items: T,
|
|
3307
|
-
strategy:
|
|
3307
|
+
strategy: at,
|
|
3308
3308
|
children: G.map((F) => {
|
|
3309
3309
|
var xe;
|
|
3310
|
-
const K = `${n.label}|${F.from_state ?? "_any_"}|${F.ids[0]}`, re = F.from_state ?
|
|
3310
|
+
const K = `${n.label}|${F.from_state ?? "_any_"}|${F.ids[0]}`, re = F.from_state ? Kt.get(F.from_state) : null;
|
|
3311
3311
|
return (w == null ? void 0 : w.label) === n.label && w.route.ids[0] === F.ids[0] ? /* @__PURE__ */ e(
|
|
3312
3312
|
"div",
|
|
3313
3313
|
{
|
|
3314
3314
|
className: "border-b border-slate-100 last:border-0 p-3",
|
|
3315
3315
|
children: /* @__PURE__ */ e(
|
|
3316
|
-
|
|
3316
|
+
ft,
|
|
3317
3317
|
{
|
|
3318
3318
|
reach: Ee,
|
|
3319
|
-
recordCollections:
|
|
3319
|
+
recordCollections: Je,
|
|
3320
3320
|
initial: {
|
|
3321
3321
|
from_state: F.from_state,
|
|
3322
3322
|
to_states: F.to_states,
|
|
@@ -3341,23 +3341,23 @@ function vr({
|
|
|
3341
3341
|
fixedLabel: n.label,
|
|
3342
3342
|
states: ie,
|
|
3343
3343
|
collection: (xe = oe[0]) == null ? void 0 : xe.collection,
|
|
3344
|
-
saving:
|
|
3345
|
-
onSave: (le) =>
|
|
3344
|
+
saving: Tt.isPending,
|
|
3345
|
+
onSave: (le) => Tt.mutate({ route: F, data: le }),
|
|
3346
3346
|
onCancel: () => C(null)
|
|
3347
3347
|
}
|
|
3348
3348
|
)
|
|
3349
3349
|
},
|
|
3350
3350
|
K
|
|
3351
|
-
) : /* @__PURE__ */ e(
|
|
3352
|
-
/* @__PURE__ */ e(
|
|
3351
|
+
) : /* @__PURE__ */ e(ea, { id: F.ids[0], children: /* @__PURE__ */ a("div", { className: "group/row flex items-center gap-2 border-b border-slate-100 px-3 py-2 last:border-0 hover:bg-slate-50", children: [
|
|
3352
|
+
/* @__PURE__ */ e(ta, {}),
|
|
3353
3353
|
/* @__PURE__ */ a("div", { className: "flex flex-1 min-w-0 flex-wrap items-center gap-1.5 text-[12px]", children: [
|
|
3354
|
-
re ? /* @__PURE__ */ e(
|
|
3355
|
-
/* @__PURE__ */ e(
|
|
3354
|
+
re ? /* @__PURE__ */ e(Gt, { state: re }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
|
|
3355
|
+
/* @__PURE__ */ e(oa, { className: "h-3 w-3 text-slate-300 shrink-0" }),
|
|
3356
3356
|
F.to_states.map((le, ce) => {
|
|
3357
|
-
const
|
|
3358
|
-
return
|
|
3357
|
+
const Qt = Kt.get(le);
|
|
3358
|
+
return Qt ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
|
|
3359
3359
|
ce > 0 && /* @__PURE__ */ e("span", { className: "text-slate-300", children: "·" }),
|
|
3360
|
-
/* @__PURE__ */ e(
|
|
3360
|
+
/* @__PURE__ */ e(Gt, { state: Qt, small: !0 })
|
|
3361
3361
|
] }, le) : null;
|
|
3362
3362
|
}),
|
|
3363
3363
|
F.auto_trigger && /* @__PURE__ */ a(
|
|
@@ -3366,7 +3366,7 @@ function vr({
|
|
|
3366
3366
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",
|
|
3367
3367
|
title: "Automatic — fired by the engine when conditions match; hidden from users",
|
|
3368
3368
|
children: [
|
|
3369
|
-
/* @__PURE__ */ e(
|
|
3369
|
+
/* @__PURE__ */ e(Ua, { className: "h-2.5 w-2.5" }),
|
|
3370
3370
|
"Auto"
|
|
3371
3371
|
]
|
|
3372
3372
|
}
|
|
@@ -3389,10 +3389,10 @@ function vr({
|
|
|
3389
3389
|
children: F.allow_creator ? "Owner or creator" : "Owner only"
|
|
3390
3390
|
}
|
|
3391
3391
|
),
|
|
3392
|
-
!F.auto_trigger && F.require_owner &&
|
|
3393
|
-
|
|
3392
|
+
!F.auto_trigger && F.require_owner && vt(
|
|
3393
|
+
xa(
|
|
3394
3394
|
F.open_when,
|
|
3395
|
-
|
|
3395
|
+
Je
|
|
3396
3396
|
)
|
|
3397
3397
|
) !== null && /* @__PURE__ */ e(
|
|
3398
3398
|
"span",
|
|
@@ -3417,7 +3417,7 @@ function vr({
|
|
|
3417
3417
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-semibold text-teal-700 dark:bg-teal-900/30 dark:text-teal-400",
|
|
3418
3418
|
title: "Transition actions run after this transition lands",
|
|
3419
3419
|
children: [
|
|
3420
|
-
/* @__PURE__ */ e(
|
|
3420
|
+
/* @__PURE__ */ e(Qa, { className: "h-2.5 w-2.5" }),
|
|
3421
3421
|
(F.actions ?? []).length
|
|
3422
3422
|
]
|
|
3423
3423
|
}
|
|
@@ -3430,7 +3430,7 @@ function vr({
|
|
|
3430
3430
|
(le) => `${le.field} ${le.op} ${String(le.value ?? "")}`
|
|
3431
3431
|
).join(" AND "),
|
|
3432
3432
|
children: [
|
|
3433
|
-
/* @__PURE__ */ e(
|
|
3433
|
+
/* @__PURE__ */ e(_t, { className: "h-2.5 w-2.5" }),
|
|
3434
3434
|
(F.condition_rules ?? []).length
|
|
3435
3435
|
]
|
|
3436
3436
|
}
|
|
@@ -3443,18 +3443,18 @@ function vr({
|
|
|
3443
3443
|
type: "button",
|
|
3444
3444
|
onClick: () => C({ label: n.label, route: F }),
|
|
3445
3445
|
className: "rounded p-1 text-slate-400 hover:text-slate-700",
|
|
3446
|
-
children: /* @__PURE__ */ e(
|
|
3446
|
+
children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
|
|
3447
3447
|
}
|
|
3448
3448
|
),
|
|
3449
3449
|
/* @__PURE__ */ e(
|
|
3450
|
-
|
|
3450
|
+
Me,
|
|
3451
3451
|
{
|
|
3452
|
-
onConfirm: () =>
|
|
3452
|
+
onConfirm: () => Pt.mutate(F.ids),
|
|
3453
3453
|
title: "Delete route",
|
|
3454
3454
|
confirmLabel: "Delete?",
|
|
3455
3455
|
confirmTitle: "Delete this route?",
|
|
3456
3456
|
className: "rounded p-1 text-slate-400 hover:text-red-500",
|
|
3457
|
-
armedClassName:
|
|
3457
|
+
armedClassName: Ke,
|
|
3458
3458
|
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
3459
3459
|
}
|
|
3460
3460
|
)
|
|
@@ -3466,16 +3466,16 @@ function vr({
|
|
|
3466
3466
|
}
|
|
3467
3467
|
),
|
|
3468
3468
|
$ === n.label && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 p-3", children: /* @__PURE__ */ e(
|
|
3469
|
-
|
|
3469
|
+
ft,
|
|
3470
3470
|
{
|
|
3471
3471
|
reach: Ee,
|
|
3472
|
-
recordCollections:
|
|
3472
|
+
recordCollections: Je,
|
|
3473
3473
|
initial: { color: n.color },
|
|
3474
3474
|
fixedLabel: n.label,
|
|
3475
3475
|
states: ie,
|
|
3476
3476
|
collection: (ae = oe[0]) == null ? void 0 : ae.collection,
|
|
3477
|
-
saving:
|
|
3478
|
-
onSave: (F) =>
|
|
3477
|
+
saving: Lt.isPending,
|
|
3478
|
+
onSave: (F) => Lt.mutate({ labelGroup: n, data: F }),
|
|
3479
3479
|
onCancel: () => q(null)
|
|
3480
3480
|
}
|
|
3481
3481
|
) })
|
|
@@ -3484,22 +3484,22 @@ function vr({
|
|
|
3484
3484
|
}
|
|
3485
3485
|
),
|
|
3486
3486
|
S && /* @__PURE__ */ e(
|
|
3487
|
-
|
|
3487
|
+
ft,
|
|
3488
3488
|
{
|
|
3489
3489
|
reach: Ee,
|
|
3490
|
-
recordCollections:
|
|
3490
|
+
recordCollections: Je,
|
|
3491
3491
|
initial: {},
|
|
3492
3492
|
states: ie,
|
|
3493
|
-
collection: (
|
|
3494
|
-
saving:
|
|
3495
|
-
onSave: (n) =>
|
|
3493
|
+
collection: (Ut = oe[0]) == null ? void 0 : Ut.collection,
|
|
3494
|
+
saving: Rt.isPending,
|
|
3495
|
+
onSave: (n) => Rt.mutate(n),
|
|
3496
3496
|
onCancel: () => N(!1)
|
|
3497
3497
|
}
|
|
3498
3498
|
)
|
|
3499
3499
|
] })
|
|
3500
3500
|
] })
|
|
3501
3501
|
] }),
|
|
3502
|
-
!o.has("branches") && /* @__PURE__ */ e(
|
|
3502
|
+
!o.has("branches") && /* @__PURE__ */ e(hs, { templateId: t, states: mt }),
|
|
3503
3503
|
!o.has("bindings") && /* @__PURE__ */ a("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
|
|
3504
3504
|
/* @__PURE__ */ a("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
3505
3505
|
"Applied to Collections",
|
|
@@ -3509,7 +3509,7 @@ function vr({
|
|
|
3509
3509
|
var _;
|
|
3510
3510
|
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white", children: [
|
|
3511
3511
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-3 px-4 py-3", children: [
|
|
3512
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e(
|
|
3512
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e(Ht, { className: "h-3.5 w-3.5 text-slate-500" }) }),
|
|
3513
3513
|
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
3514
3514
|
/* @__PURE__ */ e("span", { className: "font-mono text-[13px] font-medium text-slate-800", children: n.collection }),
|
|
3515
3515
|
n.state_field && /* @__PURE__ */ a("div", { className: "mt-0.5 text-[11px] text-slate-400", children: [
|
|
@@ -3524,7 +3524,7 @@ function vr({
|
|
|
3524
3524
|
{
|
|
3525
3525
|
type: "checkbox",
|
|
3526
3526
|
checked: !!n.auto_start,
|
|
3527
|
-
onChange: (T) =>
|
|
3527
|
+
onChange: (T) => Ge.mutate({
|
|
3528
3528
|
bindingId: n.id,
|
|
3529
3529
|
body: {
|
|
3530
3530
|
auto_start: T.target.checked,
|
|
@@ -3539,10 +3539,10 @@ function vr({
|
|
|
3539
3539
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
3540
3540
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Owner fallback:" }),
|
|
3541
3541
|
/* @__PURE__ */ e(
|
|
3542
|
-
|
|
3542
|
+
ms,
|
|
3543
3543
|
{
|
|
3544
3544
|
value: n.owner_fallback_field ?? "",
|
|
3545
|
-
onCommit: (T) =>
|
|
3545
|
+
onCommit: (T) => Ge.mutate({
|
|
3546
3546
|
bindingId: n.id,
|
|
3547
3547
|
body: { owner_fallback_field: T || null }
|
|
3548
3548
|
})
|
|
@@ -3555,7 +3555,7 @@ function vr({
|
|
|
3555
3555
|
ee,
|
|
3556
3556
|
{
|
|
3557
3557
|
value: n.auto_start_state ?? "",
|
|
3558
|
-
onChange: (T) =>
|
|
3558
|
+
onChange: (T) => Ge.mutate({
|
|
3559
3559
|
bindingId: n.id,
|
|
3560
3560
|
body: { auto_start: !0, auto_start_state: T || null }
|
|
3561
3561
|
}),
|
|
@@ -3571,7 +3571,7 @@ function vr({
|
|
|
3571
3571
|
] })
|
|
3572
3572
|
] }),
|
|
3573
3573
|
/* @__PURE__ */ e(
|
|
3574
|
-
|
|
3574
|
+
wn,
|
|
3575
3575
|
{
|
|
3576
3576
|
collection: n.collection,
|
|
3577
3577
|
roles: n.start_state_roles,
|
|
@@ -3582,7 +3582,7 @@ function vr({
|
|
|
3582
3582
|
label: T.label,
|
|
3583
3583
|
is_initial: !!T.is_initial
|
|
3584
3584
|
})),
|
|
3585
|
-
onSave: (T) =>
|
|
3585
|
+
onSave: (T) => Ge.mutate({ bindingId: n.id, body: T })
|
|
3586
3586
|
}
|
|
3587
3587
|
)
|
|
3588
3588
|
] }),
|
|
@@ -3591,15 +3591,15 @@ function vr({
|
|
|
3591
3591
|
"button",
|
|
3592
3592
|
{
|
|
3593
3593
|
type: "button",
|
|
3594
|
-
onClick: () =>
|
|
3594
|
+
onClick: () => it(me === n.id ? null : n.id),
|
|
3595
3595
|
className: H(
|
|
3596
3596
|
"flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
3597
3597
|
me === n.id ? "bg-nvr-cyan/10 text-nvr-cyan" : "text-slate-500 hover:bg-slate-100 hover:text-slate-700"
|
|
3598
3598
|
),
|
|
3599
3599
|
"aria-label": "Configure matrix dimensions",
|
|
3600
3600
|
children: [
|
|
3601
|
-
/* @__PURE__ */ e(
|
|
3602
|
-
/* @__PURE__ */ e(
|
|
3601
|
+
/* @__PURE__ */ e(Ha, { className: "h-3.5 w-3.5" }),
|
|
3602
|
+
/* @__PURE__ */ e(It, { id: "dimension", children: "Dimensions" }),
|
|
3603
3603
|
(n.dimensions ?? []).length > 0 && /* @__PURE__ */ a("span", { className: "font-mono text-[10px] opacity-70", children: [
|
|
3604
3604
|
"(",
|
|
3605
3605
|
(_ = n.dimensions) == null ? void 0 : _.length,
|
|
@@ -3609,20 +3609,20 @@ function vr({
|
|
|
3609
3609
|
}
|
|
3610
3610
|
),
|
|
3611
3611
|
/* @__PURE__ */ e(
|
|
3612
|
-
|
|
3612
|
+
Me,
|
|
3613
3613
|
{
|
|
3614
|
-
onConfirm: () =>
|
|
3614
|
+
onConfirm: () => La.mutate(n.id),
|
|
3615
3615
|
title: "Unbind collection",
|
|
3616
3616
|
confirmLabel: "Unbind?",
|
|
3617
3617
|
confirmTitle: `Unbind "${n.collection}"?`,
|
|
3618
3618
|
className: "rounded p-1.5 text-slate-400 hover:text-red-500 transition-colors",
|
|
3619
|
-
armedClassName:
|
|
3620
|
-
children: /* @__PURE__ */ e(
|
|
3619
|
+
armedClassName: Ke,
|
|
3620
|
+
children: /* @__PURE__ */ e(Va, { className: "h-3.5 w-3.5" })
|
|
3621
3621
|
}
|
|
3622
3622
|
)
|
|
3623
3623
|
] })
|
|
3624
3624
|
] }),
|
|
3625
|
-
me === n.id && /* @__PURE__ */ e(
|
|
3625
|
+
me === n.id && /* @__PURE__ */ e(ls, { binding: n, templateId: t })
|
|
3626
3626
|
] }, n.id);
|
|
3627
3627
|
}) }),
|
|
3628
3628
|
/* @__PURE__ */ a("div", { className: "space-y-2 pt-2", children: [
|
|
@@ -3632,7 +3632,7 @@ function vr({
|
|
|
3632
3632
|
{
|
|
3633
3633
|
value: b,
|
|
3634
3634
|
onChange: u,
|
|
3635
|
-
options:
|
|
3635
|
+
options: za.map((n) => ({
|
|
3636
3636
|
value: n.collection,
|
|
3637
3637
|
label: n.display_name ?? n.collection
|
|
3638
3638
|
})),
|
|
@@ -3661,13 +3661,13 @@ function vr({
|
|
|
3661
3661
|
size: "sm",
|
|
3662
3662
|
variant: "outline",
|
|
3663
3663
|
className: "shrink-0 gap-1.5",
|
|
3664
|
-
disabled: !b ||
|
|
3665
|
-
onClick: () =>
|
|
3664
|
+
disabled: !b || Dt.isPending,
|
|
3665
|
+
onClick: () => Dt.mutate({
|
|
3666
3666
|
collection: b,
|
|
3667
3667
|
state_field: k.trim() || void 0
|
|
3668
3668
|
}),
|
|
3669
3669
|
children: [
|
|
3670
|
-
/* @__PURE__ */ e(
|
|
3670
|
+
/* @__PURE__ */ e(Ht, { className: "h-3.5 w-3.5" }),
|
|
3671
3671
|
"Bind"
|
|
3672
3672
|
]
|
|
3673
3673
|
}
|
|
@@ -3679,7 +3679,7 @@ function vr({
|
|
|
3679
3679
|
] })
|
|
3680
3680
|
] })
|
|
3681
3681
|
] }),
|
|
3682
|
-
!o.has("matrix") &&
|
|
3682
|
+
!o.has("matrix") && ja && /* @__PURE__ */ a(
|
|
3683
3683
|
"div",
|
|
3684
3684
|
{
|
|
3685
3685
|
id: "owner-matrix",
|
|
@@ -3687,12 +3687,12 @@ function vr({
|
|
|
3687
3687
|
children: [
|
|
3688
3688
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-2", children: [
|
|
3689
3689
|
/* @__PURE__ */ a("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
3690
|
-
/* @__PURE__ */ e(
|
|
3690
|
+
/* @__PURE__ */ e(It, { id: "owner-matrix", children: "Owner Matrix" }),
|
|
3691
3691
|
/* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "Who is responsible in each state, per dimension value. Records resolve their owners from this grid automatically — notifications, queues, and SLAs follow it." })
|
|
3692
3692
|
] }),
|
|
3693
3693
|
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap gap-1.5 sm:justify-end", children: [
|
|
3694
3694
|
/* @__PURE__ */ e(
|
|
3695
|
-
|
|
3695
|
+
_n,
|
|
3696
3696
|
{
|
|
3697
3697
|
templateId: t,
|
|
3698
3698
|
collections: oe.map((n) => n.collection)
|
|
@@ -3706,34 +3706,34 @@ function vr({
|
|
|
3706
3706
|
className: "h-7 shrink-0 gap-1.5 text-[12px]",
|
|
3707
3707
|
onClick: () => E(!0),
|
|
3708
3708
|
children: [
|
|
3709
|
-
/* @__PURE__ */ e(
|
|
3709
|
+
/* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
|
|
3710
3710
|
" Manage teams"
|
|
3711
3711
|
]
|
|
3712
3712
|
}
|
|
3713
3713
|
)
|
|
3714
3714
|
] })
|
|
3715
3715
|
] }),
|
|
3716
|
-
/* @__PURE__ */ e(
|
|
3716
|
+
/* @__PURE__ */ e(kn, { templateId: t, states: mt, bindings: oe })
|
|
3717
3717
|
]
|
|
3718
3718
|
}
|
|
3719
3719
|
),
|
|
3720
|
-
M && /* @__PURE__ */ e(
|
|
3721
|
-
!o.has("simulator") && /* @__PURE__ */ e(
|
|
3722
|
-
!o.has("canvas") && /* @__PURE__ */ e(
|
|
3723
|
-
!o.has("flow-map") && /* @__PURE__ */ e(
|
|
3724
|
-
!o.has("cumulative-flow") && /* @__PURE__ */ e(
|
|
3725
|
-
!o.has("replay") && /* @__PURE__ */ e(
|
|
3726
|
-
!o.has("migration") && /* @__PURE__ */ e(
|
|
3727
|
-
!o.has("lint") && /* @__PURE__ */ e(
|
|
3728
|
-
!o.has("coverage") && /* @__PURE__ */ e(
|
|
3729
|
-
!o.has("skip-report") && /* @__PURE__ */ e(
|
|
3730
|
-
!o.has("ai-review") && /* @__PURE__ */ e(
|
|
3731
|
-
!o.has("versions") && /* @__PURE__ */ e(
|
|
3732
|
-
!o.has("matrix-versions") && /* @__PURE__ */ e(
|
|
3720
|
+
M && /* @__PURE__ */ e(_s, { onClose: () => E(!1) }),
|
|
3721
|
+
!o.has("simulator") && /* @__PURE__ */ e(xs, { bindings: oe }),
|
|
3722
|
+
!o.has("canvas") && /* @__PURE__ */ e(Ns, { templateId: t }),
|
|
3723
|
+
!o.has("flow-map") && /* @__PURE__ */ e(ws, { templateId: t }),
|
|
3724
|
+
!o.has("cumulative-flow") && /* @__PURE__ */ e(hn, { templateId: t }),
|
|
3725
|
+
!o.has("replay") && /* @__PURE__ */ e(ks, { templateId: t }),
|
|
3726
|
+
!o.has("migration") && /* @__PURE__ */ e(ys, { templateId: t }),
|
|
3727
|
+
!o.has("lint") && /* @__PURE__ */ e(qn, { templateId: t }),
|
|
3728
|
+
!o.has("coverage") && /* @__PURE__ */ e(bs, { templateId: t, states: ie }),
|
|
3729
|
+
!o.has("skip-report") && /* @__PURE__ */ e($n, { templateId: t }),
|
|
3730
|
+
!o.has("ai-review") && /* @__PURE__ */ e(is, { templateId: t }),
|
|
3731
|
+
!o.has("versions") && /* @__PURE__ */ e(os, { templateId: t }),
|
|
3732
|
+
!o.has("matrix-versions") && /* @__PURE__ */ e(Cn, { templateId: t })
|
|
3733
3733
|
] })
|
|
3734
3734
|
] });
|
|
3735
3735
|
}
|
|
3736
|
-
function
|
|
3736
|
+
function is({ templateId: t }) {
|
|
3737
3737
|
const s = Z(), [l, x] = A(
|
|
3738
3738
|
null
|
|
3739
3739
|
), r = z({
|
|
@@ -3776,7 +3776,7 @@ function ls({ templateId: t }) {
|
|
|
3776
3776
|
] })
|
|
3777
3777
|
] });
|
|
3778
3778
|
}
|
|
3779
|
-
function
|
|
3779
|
+
function os({ templateId: t }) {
|
|
3780
3780
|
const s = Z(), l = Ce(), [x, r] = A(null), [c, o] = A(null), { data: m, isFetching: p } = I({
|
|
3781
3781
|
queryKey: ["pipeline-version-diff", t, c],
|
|
3782
3782
|
queryFn: () => s.request(Y(`/pipelines/${t}/versions/${c}/diff`)).then((v) => v.data),
|
|
@@ -3798,13 +3798,13 @@ function is({ templateId: t }) {
|
|
|
3798
3798
|
});
|
|
3799
3799
|
return /* @__PURE__ */ a("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-3", children: [
|
|
3800
3800
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
3801
|
-
/* @__PURE__ */ e(
|
|
3801
|
+
/* @__PURE__ */ e(Ga, { className: "h-4 w-4 text-slate-400" }),
|
|
3802
3802
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-semibold text-slate-800", children: "Config versions" }),
|
|
3803
3803
|
g && g.length > 0 && /* @__PURE__ */ e("span", { className: "ml-auto rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-semibold text-slate-500 dark:bg-muted dark:text-muted-foreground", children: g.length })
|
|
3804
3804
|
] }),
|
|
3805
3805
|
f ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
3806
|
-
/* @__PURE__ */ e(
|
|
3807
|
-
/* @__PURE__ */ e(
|
|
3806
|
+
/* @__PURE__ */ e(ze, { className: "h-8 rounded" }),
|
|
3807
|
+
/* @__PURE__ */ e(ze, { className: "h-8 rounded" })
|
|
3808
3808
|
] }) : !g || g.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No versions yet. A snapshot of the states, transitions and bindings is captured automatically before every config change." }) : /* @__PURE__ */ e("div", { className: "max-h-72 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: g.map((v) => {
|
|
3809
3809
|
var h;
|
|
3810
3810
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 py-1.5", children: [
|
|
@@ -3816,7 +3816,7 @@ function is({ templateId: t }) {
|
|
|
3816
3816
|
v.note ?? "—",
|
|
3817
3817
|
(h = v.created_by_name) != null && h.trim() ? ` · ${v.created_by_name}` : ""
|
|
3818
3818
|
] }),
|
|
3819
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children:
|
|
3819
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: cn(v.created_at) }),
|
|
3820
3820
|
x === v.id ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
3821
3821
|
/* @__PURE__ */ e(
|
|
3822
3822
|
P,
|
|
@@ -3861,16 +3861,16 @@ function is({ templateId: t }) {
|
|
|
3861
3861
|
] })
|
|
3862
3862
|
] }, v.id);
|
|
3863
3863
|
}) }),
|
|
3864
|
-
c != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: p ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : m ? /* @__PURE__ */ e(
|
|
3864
|
+
c != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: p ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : m ? /* @__PURE__ */ e(cs, { fromVersion: m.from_version, to: m.to, diff: m.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
|
|
3865
3865
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] text-slate-400", children: "Restore snapshots the current config first, then upserts states/transitions/bindings by id — states are never deleted, and transitions with execution history are kept." })
|
|
3866
3866
|
] });
|
|
3867
3867
|
}
|
|
3868
|
-
function
|
|
3868
|
+
function Xe(t) {
|
|
3869
3869
|
if (t == null || t === "") return "(empty)";
|
|
3870
3870
|
const s = typeof t == "string" ? t : JSON.stringify(t);
|
|
3871
3871
|
return s.length > 80 ? `${s.slice(0, 80)}…` : s;
|
|
3872
3872
|
}
|
|
3873
|
-
function
|
|
3873
|
+
function cs({
|
|
3874
3874
|
fromVersion: t,
|
|
3875
3875
|
to: s,
|
|
3876
3876
|
diff: l
|
|
@@ -3898,10 +3898,10 @@ function os({
|
|
|
3898
3898
|
/* @__PURE__ */ e("span", { className: "font-mono", children: c.field }),
|
|
3899
3899
|
":",
|
|
3900
3900
|
" ",
|
|
3901
|
-
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children:
|
|
3901
|
+
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Xe(c.from) }),
|
|
3902
3902
|
" ",
|
|
3903
3903
|
"→ ",
|
|
3904
|
-
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children:
|
|
3904
|
+
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Xe(c.to) })
|
|
3905
3905
|
]
|
|
3906
3906
|
},
|
|
3907
3907
|
c.field
|
|
@@ -3941,11 +3941,11 @@ function os({
|
|
|
3941
3941
|
/* @__PURE__ */ e("span", { className: "font-mono", children: p.field }),
|
|
3942
3942
|
":",
|
|
3943
3943
|
" ",
|
|
3944
|
-
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children:
|
|
3944
|
+
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Xe(p.from) }),
|
|
3945
3945
|
" ",
|
|
3946
3946
|
"→",
|
|
3947
3947
|
" ",
|
|
3948
|
-
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children:
|
|
3948
|
+
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Xe(p.to) })
|
|
3949
3949
|
]
|
|
3950
3950
|
},
|
|
3951
3951
|
p.field
|
|
@@ -3955,13 +3955,13 @@ function os({
|
|
|
3955
3955
|
)
|
|
3956
3956
|
] });
|
|
3957
3957
|
}
|
|
3958
|
-
function
|
|
3958
|
+
function ya(t, s) {
|
|
3959
3959
|
return t.filter((l) => !l.is_terminal && !s.includes(l.key)).map((l) => ({ value: l.key, label: l.label }));
|
|
3960
3960
|
}
|
|
3961
|
-
function
|
|
3961
|
+
function ds(t) {
|
|
3962
3962
|
return t ? `Runs only while the record is in ${t}, by that step's owners or an administrator.` : "No starting step: only an administrator can run this split.";
|
|
3963
3963
|
}
|
|
3964
|
-
function
|
|
3964
|
+
function lt({
|
|
3965
3965
|
state: t,
|
|
3966
3966
|
selected: s,
|
|
3967
3967
|
onClick: l
|
|
@@ -3977,7 +3977,7 @@ function rt({
|
|
|
3977
3977
|
t.label
|
|
3978
3978
|
] }) : /* @__PURE__ */ e("span", { className: x, style: r, children: t.label });
|
|
3979
3979
|
}
|
|
3980
|
-
function
|
|
3980
|
+
function ms({ value: t, onCommit: s }) {
|
|
3981
3981
|
const [l, x] = A(t);
|
|
3982
3982
|
return he(() => x(t), [t]), /* @__PURE__ */ e(
|
|
3983
3983
|
"input",
|
|
@@ -3996,7 +3996,7 @@ function ds({ value: t, onCommit: s }) {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
);
|
|
3998
3998
|
}
|
|
3999
|
-
function
|
|
3999
|
+
function ps({
|
|
4000
4000
|
states: t,
|
|
4001
4001
|
saving: s,
|
|
4002
4002
|
onSave: l,
|
|
@@ -4029,7 +4029,7 @@ function ms({
|
|
|
4029
4029
|
{
|
|
4030
4030
|
value: f,
|
|
4031
4031
|
onChange: i,
|
|
4032
|
-
options:
|
|
4032
|
+
options: ya(t, o),
|
|
4033
4033
|
noneLabel: "No starting step",
|
|
4034
4034
|
placeholder: "No starting step",
|
|
4035
4035
|
className: "max-w-xs"
|
|
@@ -4042,7 +4042,7 @@ function ms({
|
|
|
4042
4042
|
"text-[11px]",
|
|
4043
4043
|
f ? "text-slate-500" : "text-amber-700 dark:text-amber-400"
|
|
4044
4044
|
),
|
|
4045
|
-
children:
|
|
4045
|
+
children: ds(h)
|
|
4046
4046
|
}
|
|
4047
4047
|
)
|
|
4048
4048
|
] }),
|
|
@@ -4052,7 +4052,7 @@ function ms({
|
|
|
4052
4052
|
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(pick 2 or more — the record enters ALL of them at once)" })
|
|
4053
4053
|
] }),
|
|
4054
4054
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: t.map((N) => /* @__PURE__ */ e(
|
|
4055
|
-
|
|
4055
|
+
lt,
|
|
4056
4056
|
{
|
|
4057
4057
|
state: N,
|
|
4058
4058
|
selected: o.includes(N.key),
|
|
@@ -4067,7 +4067,7 @@ function ms({
|
|
|
4067
4067
|
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(auto-entered when every branch reaches a terminal state)" })
|
|
4068
4068
|
] }),
|
|
4069
4069
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: t.filter((N) => !o.includes(N.key)).map((N) => /* @__PURE__ */ e(
|
|
4070
|
-
|
|
4070
|
+
lt,
|
|
4071
4071
|
{
|
|
4072
4072
|
state: N,
|
|
4073
4073
|
selected: p === N.key,
|
|
@@ -4097,7 +4097,7 @@ function ms({
|
|
|
4097
4097
|
] })
|
|
4098
4098
|
] });
|
|
4099
4099
|
}
|
|
4100
|
-
function
|
|
4100
|
+
function us({
|
|
4101
4101
|
split: t,
|
|
4102
4102
|
states: s,
|
|
4103
4103
|
saving: l,
|
|
@@ -4113,7 +4113,7 @@ function ps({
|
|
|
4113
4113
|
onChange: (o) => {
|
|
4114
4114
|
o !== r && x(o || null);
|
|
4115
4115
|
},
|
|
4116
|
-
options:
|
|
4116
|
+
options: ya(s, t.branch_states),
|
|
4117
4117
|
noneLabel: "No starting step",
|
|
4118
4118
|
placeholder: "No starting step",
|
|
4119
4119
|
className: "h-7 w-56"
|
|
@@ -4136,7 +4136,7 @@ function ps({
|
|
|
4136
4136
|
)
|
|
4137
4137
|
] });
|
|
4138
4138
|
}
|
|
4139
|
-
function
|
|
4139
|
+
function hs({
|
|
4140
4140
|
templateId: t,
|
|
4141
4141
|
states: s
|
|
4142
4142
|
}) {
|
|
@@ -4176,7 +4176,7 @@ function us({
|
|
|
4176
4176
|
/* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-4", children: [
|
|
4177
4177
|
/* @__PURE__ */ a("h2", { className: "flex-1 text-[13px] font-semibold text-slate-800", children: [
|
|
4178
4178
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
|
|
4179
|
-
/* @__PURE__ */ e(
|
|
4179
|
+
/* @__PURE__ */ e(Ya, { className: "h-4 w-4 text-slate-400" }),
|
|
4180
4180
|
"Parallel Branches",
|
|
4181
4181
|
/* @__PURE__ */ e("span", { className: "font-mono text-[11px] font-normal text-slate-400", children: (g == null ? void 0 : g.length) ?? 0 })
|
|
4182
4182
|
] }),
|
|
@@ -4209,7 +4209,7 @@ function us({
|
|
|
4209
4209
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
|
|
4210
4210
|
/* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-700", children: d.label }),
|
|
4211
4211
|
/* @__PURE__ */ e(
|
|
4212
|
-
|
|
4212
|
+
us,
|
|
4213
4213
|
{
|
|
4214
4214
|
split: d,
|
|
4215
4215
|
states: s,
|
|
@@ -4218,9 +4218,9 @@ function us({
|
|
|
4218
4218
|
}
|
|
4219
4219
|
),
|
|
4220
4220
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
4221
|
-
d.branch_state_objs.map((N) => /* @__PURE__ */ e(
|
|
4222
|
-
/* @__PURE__ */ e(
|
|
4223
|
-
d.join_state_obj ? /* @__PURE__ */ e(
|
|
4221
|
+
d.branch_state_objs.map((N) => /* @__PURE__ */ e(lt, { state: N }, N.id)),
|
|
4222
|
+
/* @__PURE__ */ e(oa, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
4223
|
+
d.join_state_obj ? /* @__PURE__ */ e(lt, { state: d.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
|
|
4224
4224
|
] })
|
|
4225
4225
|
] }),
|
|
4226
4226
|
o === d.id ? /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
@@ -4261,7 +4261,7 @@ function us({
|
|
|
4261
4261
|
);
|
|
4262
4262
|
}),
|
|
4263
4263
|
r && /* @__PURE__ */ e(
|
|
4264
|
-
|
|
4264
|
+
ps,
|
|
4265
4265
|
{
|
|
4266
4266
|
states: s,
|
|
4267
4267
|
saving: i.isPending,
|
|
@@ -4271,7 +4271,7 @@ function us({
|
|
|
4271
4271
|
)
|
|
4272
4272
|
] });
|
|
4273
4273
|
}
|
|
4274
|
-
function
|
|
4274
|
+
function xs({ bindings: t }) {
|
|
4275
4275
|
var g;
|
|
4276
4276
|
const s = Z(), [l, x] = A(""), [r, c] = A(""), o = r || ((g = t[0]) == null ? void 0 : g.collection) || "", m = z({
|
|
4277
4277
|
mutationFn: () => s.request(J("/pipelines/simulate", { collection: o, item_id: l.trim() })).then((f) => f.data),
|
|
@@ -4386,8 +4386,8 @@ function hs({ bindings: t }) {
|
|
|
4386
4386
|
] })
|
|
4387
4387
|
] });
|
|
4388
4388
|
}
|
|
4389
|
-
const
|
|
4390
|
-
function
|
|
4389
|
+
const De = 900, be = 230;
|
|
4390
|
+
function Na({
|
|
4391
4391
|
selected: t,
|
|
4392
4392
|
onChange: s
|
|
4393
4393
|
}) {
|
|
@@ -4466,21 +4466,21 @@ function ya({
|
|
|
4466
4466
|
] })
|
|
4467
4467
|
] });
|
|
4468
4468
|
}
|
|
4469
|
-
function
|
|
4469
|
+
function fs({
|
|
4470
4470
|
templateId: t,
|
|
4471
4471
|
cluster: s,
|
|
4472
4472
|
onDone: l
|
|
4473
4473
|
}) {
|
|
4474
4474
|
var $, q;
|
|
4475
|
-
const x = Z(), r = Ce(), c = !!(($ = s.suggestion) != null && $.group_id) && s.suggestion.mismatched_filters.length === 0, o = Object.values(s.dims).filter(Boolean).join(" · ") || "New group", [m, p] = A(o), [g, f] = A([]), [i, v] = A([]), h =
|
|
4475
|
+
const x = Z(), r = Ce(), c = !!(($ = s.suggestion) != null && $.group_id) && s.suggestion.mismatched_filters.length === 0, o = Object.values(s.dims).filter(Boolean).join(" · ") || "New group", [m, p] = A(o), [g, f] = A([]), [i, v] = A([]), h = Ln(), { data: d } = I({
|
|
4476
4476
|
queryKey: ["user-groups-teams"],
|
|
4477
4477
|
queryFn: () => x.request(Y("/user-groups")).then((O) => O.data),
|
|
4478
4478
|
staleTime: 6e4
|
|
4479
4479
|
}), S = (d ?? []).map((O) => ({
|
|
4480
4480
|
...O,
|
|
4481
|
-
rank:
|
|
4481
|
+
rank: Tn(O.scopes, s.filters, h, s.collection)
|
|
4482
4482
|
})).sort(
|
|
4483
|
-
(O, y) =>
|
|
4483
|
+
(O, y) => Yt(O.rank.tier) - Yt(y.rank.tier) || O.name.localeCompare(y.name, void 0, { sensitivity: "base" })
|
|
4484
4484
|
), N = z({
|
|
4485
4485
|
mutationFn: async () => {
|
|
4486
4486
|
var y;
|
|
@@ -4558,7 +4558,7 @@ function xs({
|
|
|
4558
4558
|
);
|
|
4559
4559
|
})
|
|
4560
4560
|
] }),
|
|
4561
|
-
/* @__PURE__ */ e(
|
|
4561
|
+
/* @__PURE__ */ e(Na, { selected: g, onChange: f }),
|
|
4562
4562
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
4563
4563
|
/* @__PURE__ */ e(P, { size: "sm", variant: "ghost", className: "h-6 px-2 text-[11px]", onClick: l, children: "Cancel" }),
|
|
4564
4564
|
/* @__PURE__ */ e(
|
|
@@ -4574,7 +4574,7 @@ function xs({
|
|
|
4574
4574
|
] })
|
|
4575
4575
|
] });
|
|
4576
4576
|
}
|
|
4577
|
-
function
|
|
4577
|
+
function gs({ templateId: t, finding: s }) {
|
|
4578
4578
|
const l = Z(), x = Ce(), [r, c] = A(
|
|
4579
4579
|
"idle"
|
|
4580
4580
|
), [o, m] = A([]), p = (N) => {
|
|
@@ -4742,7 +4742,7 @@ function fs({ templateId: t, finding: s }) {
|
|
|
4742
4742
|
)
|
|
4743
4743
|
] }),
|
|
4744
4744
|
r === "add-member" && /* @__PURE__ */ a("div", { className: "mt-2 ml-2 space-y-2 rounded-md border border-slate-200 bg-slate-50/60 p-2.5 dark:border-border dark:bg-muted/20", children: [
|
|
4745
|
-
/* @__PURE__ */ e(
|
|
4745
|
+
/* @__PURE__ */ e(Na, { selected: o, onChange: m }),
|
|
4746
4746
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
4747
4747
|
/* @__PURE__ */ e(
|
|
4748
4748
|
P,
|
|
@@ -4770,7 +4770,7 @@ function fs({ templateId: t, finding: s }) {
|
|
|
4770
4770
|
] })
|
|
4771
4771
|
] });
|
|
4772
4772
|
}
|
|
4773
|
-
function
|
|
4773
|
+
function bs({
|
|
4774
4774
|
templateId: t,
|
|
4775
4775
|
states: s
|
|
4776
4776
|
}) {
|
|
@@ -4809,7 +4809,7 @@ function gs({
|
|
|
4809
4809
|
{
|
|
4810
4810
|
className: "inline-flex items-baseline gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] dark:border-border dark:bg-muted/40",
|
|
4811
4811
|
children: [
|
|
4812
|
-
/* @__PURE__ */ e("span", { className: "text-slate-400", children:
|
|
4812
|
+
/* @__PURE__ */ e("span", { className: "text-slate-400", children: ka(b) }),
|
|
4813
4813
|
/* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: u })
|
|
4814
4814
|
]
|
|
4815
4815
|
},
|
|
@@ -4842,8 +4842,9 @@ function gs({
|
|
|
4842
4842
|
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-1 text-[12.5px]", children: [
|
|
4843
4843
|
q > 0 && /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-slate-700 dark:text-foreground", children: [
|
|
4844
4844
|
/* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-500" }),
|
|
4845
|
-
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums", children: q }),
|
|
4846
|
-
"
|
|
4845
|
+
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums", children: Re(q) }),
|
|
4846
|
+
" ",
|
|
4847
|
+
"record",
|
|
4847
4848
|
q === 1 ? "" : "s",
|
|
4848
4849
|
" with no owner group across",
|
|
4849
4850
|
" ",
|
|
@@ -4972,15 +4973,15 @@ function gs({
|
|
|
4972
4973
|
style: { backgroundColor: (k == null ? void 0 : k.color) ?? "#94a3b8" }
|
|
4973
4974
|
}
|
|
4974
4975
|
),
|
|
4975
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (k == null ? void 0 : k.label) ??
|
|
4976
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (k == null ? void 0 : k.label) ?? wa(b) }),
|
|
4976
4977
|
/* @__PURE__ */ a("span", { className: "ml-auto text-[11px] tabular-nums text-slate-400", children: [
|
|
4977
|
-
L,
|
|
4978
|
+
Re(L),
|
|
4978
4979
|
" record",
|
|
4979
4980
|
L === 1 ? "" : "s",
|
|
4980
|
-
" ·
|
|
4981
|
-
u.length,
|
|
4981
|
+
" ·",
|
|
4982
4982
|
" ",
|
|
4983
|
-
|
|
4983
|
+
u.length,
|
|
4984
|
+
" combination",
|
|
4984
4985
|
u.length === 1 ? "" : "s"
|
|
4985
4986
|
] })
|
|
4986
4987
|
] }),
|
|
@@ -4990,7 +4991,7 @@ function gs({
|
|
|
4990
4991
|
// biome-ignore lint/suspicious/noArrayIndexKey: server-ordered clusters
|
|
4991
4992
|
/* @__PURE__ */ a("div", { className: "px-3 py-2", children: [
|
|
4992
4993
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
4993
|
-
/* @__PURE__ */ e("span", { className: "w-8 shrink-0 text-[13px] font-semibold tabular-nums text-slate-800 dark:text-foreground", children: R.count }),
|
|
4994
|
+
/* @__PURE__ */ e("span", { className: "w-8 shrink-0 text-[13px] font-semibold tabular-nums text-slate-800 dark:text-foreground", children: Re(R.count) }),
|
|
4994
4995
|
Object.entries(R.dims).filter(([, E]) => E).length > 0 ? Object.entries(R.dims).filter(([, E]) => E).map(([E, W]) => C(E, W)) : /* @__PURE__ */ e("span", { className: "text-[11px] italic text-slate-400", children: "no dimension values resolved" }),
|
|
4995
4996
|
/* @__PURE__ */ a(
|
|
4996
4997
|
"span",
|
|
@@ -5027,7 +5028,7 @@ function gs({
|
|
|
5027
5028
|
" ",
|
|
5028
5029
|
"already matches",
|
|
5029
5030
|
" ",
|
|
5030
|
-
|
|
5031
|
+
na(
|
|
5031
5032
|
R.suggestion.matched_labels,
|
|
5032
5033
|
R.suggestion.matched_filters
|
|
5033
5034
|
) || "nothing"
|
|
@@ -5036,7 +5037,7 @@ function gs({
|
|
|
5036
5037
|
" ",
|
|
5037
5038
|
"— it misses",
|
|
5038
5039
|
" ",
|
|
5039
|
-
|
|
5040
|
+
na(
|
|
5040
5041
|
R.suggestion.missing_labels,
|
|
5041
5042
|
R.suggestion.mismatched_filters
|
|
5042
5043
|
),
|
|
@@ -5047,7 +5048,7 @@ function gs({
|
|
|
5047
5048
|
"No group comes close — assigning creates one for this combination."
|
|
5048
5049
|
] }) }),
|
|
5049
5050
|
p === M && /* @__PURE__ */ e(
|
|
5050
|
-
|
|
5051
|
+
fs,
|
|
5051
5052
|
{
|
|
5052
5053
|
templateId: t,
|
|
5053
5054
|
cluster: R,
|
|
@@ -5077,35 +5078,35 @@ function gs({
|
|
|
5077
5078
|
] }),
|
|
5078
5079
|
/* @__PURE__ */ e("div", { className: "max-h-96 divide-y divide-slate-100 overflow-y-auto px-3 dark:divide-border/60", children: $.map((b, u) => (
|
|
5079
5080
|
// biome-ignore lint/suspicious/noArrayIndexKey: findings are positional
|
|
5080
|
-
/* @__PURE__ */ e(
|
|
5081
|
+
/* @__PURE__ */ e(gs, { templateId: t, finding: b }, u)
|
|
5081
5082
|
)) })
|
|
5082
5083
|
] })
|
|
5083
5084
|
] })
|
|
5084
5085
|
] });
|
|
5085
5086
|
}
|
|
5086
|
-
function
|
|
5087
|
+
function wa(t) {
|
|
5087
5088
|
return t.replace(/[_-]+/g, " ").replace(/\b\w/g, (s) => s.toUpperCase());
|
|
5088
5089
|
}
|
|
5089
|
-
function
|
|
5090
|
+
function ka(t) {
|
|
5090
5091
|
const s = t.split(".");
|
|
5091
5092
|
for (; s.length > 1 && /^((short_)?name|label|key|id|.*_id)$/i.test(s[s.length - 1]); )
|
|
5092
5093
|
s.pop();
|
|
5093
5094
|
const l = s[s.length - 1].replace(/s$/i, "");
|
|
5094
|
-
return
|
|
5095
|
+
return wa(l);
|
|
5095
5096
|
}
|
|
5096
|
-
function
|
|
5097
|
-
return t.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (s) =>
|
|
5097
|
+
function vs(t) {
|
|
5098
|
+
return t.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (s) => ka(s));
|
|
5098
5099
|
}
|
|
5099
|
-
function
|
|
5100
|
-
return Array.isArray(t) && t.length > 0 ? t.join(", ") :
|
|
5100
|
+
function na(t, s) {
|
|
5101
|
+
return Array.isArray(t) && t.length > 0 ? t.join(", ") : vs(s.map((l) => l.replace(/ \(wants \d+\)$/, "")).join(", "));
|
|
5101
5102
|
}
|
|
5102
|
-
function
|
|
5103
|
+
function ys({ templateId: t }) {
|
|
5103
5104
|
const s = Z(), l = Ce(), [x, r] = A(""), [c, o] = A(""), [m, p] = A(!1), { data: g } = I({
|
|
5104
5105
|
queryKey: ["pipeline-bindings-start", t],
|
|
5105
5106
|
queryFn: () => s.request(
|
|
5106
5107
|
Y(`/pipelines/${t}/bindings`)
|
|
5107
5108
|
)
|
|
5108
|
-
}), f = ((g == null ? void 0 : g.data) ?? []).map((q) => q.collection), { data: i } =
|
|
5109
|
+
}), f = ((g == null ? void 0 : g.data) ?? []).map((q) => q.collection), { data: i } = pa(t, f), v = (i == null ? void 0 : i.data) ?? [], h = (i == null ? void 0 : i.states) ?? [], d = v.filter((q) => q.orphaned), S = v.filter((q) => String(q.state_id) === x).reduce((q, O) => q + O.count, 0), N = z({
|
|
5109
5110
|
mutationFn: (q) => s.request(
|
|
5110
5111
|
J(`/pipelines/${t}/start-missing`, { collection: q })
|
|
5111
5112
|
),
|
|
@@ -5165,7 +5166,7 @@ function vs({ templateId: t }) {
|
|
|
5165
5166
|
),
|
|
5166
5167
|
children: [
|
|
5167
5168
|
q.label ?? `orphan ${String(q.state_id).slice(0, 8)}…`,
|
|
5168
|
-
/* @__PURE__ */ e("span", { className: "ml-1 font-medium", children: q.count }),
|
|
5169
|
+
/* @__PURE__ */ e("span", { className: "ml-1 font-medium", children: Re(q.count) }),
|
|
5169
5170
|
/* @__PURE__ */ e("span", { className: "ml-1 text-[10px] text-slate-400", children: q.collection })
|
|
5170
5171
|
]
|
|
5171
5172
|
},
|
|
@@ -5176,17 +5177,17 @@ function vs({ templateId: t }) {
|
|
|
5176
5177
|
x && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
|
|
5177
5178
|
/* @__PURE__ */ a("span", { className: "text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
5178
5179
|
"Move ",
|
|
5179
|
-
S,
|
|
5180
|
+
Re(S),
|
|
5180
5181
|
" instance(s) to"
|
|
5181
5182
|
] }),
|
|
5182
|
-
/* @__PURE__ */ a(
|
|
5183
|
-
/* @__PURE__ */ e(
|
|
5184
|
-
/* @__PURE__ */ e(
|
|
5183
|
+
/* @__PURE__ */ a(gn, { value: c || void 0, onValueChange: o, children: [
|
|
5184
|
+
/* @__PURE__ */ e(bn, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(vn, { placeholder: "Pick a state…" }) }),
|
|
5185
|
+
/* @__PURE__ */ e(yn, { children: h.filter((q) => String(q.id) !== x).map((q) => /* @__PURE__ */ e(Nn, { value: q.id, children: q.label }, q.id)) })
|
|
5185
5186
|
] }),
|
|
5186
5187
|
c && !m && /* @__PURE__ */ e(P, { size: "sm", className: "h-8 text-[12.5px]", onClick: () => p(!0), children: "Migrate…" }),
|
|
5187
5188
|
c && m && /* @__PURE__ */ a("span", { className: "flex items-center gap-2 rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1 dark:border-amber-500/40 dark:bg-amber-400/10", children: [
|
|
5188
5189
|
/* @__PURE__ */ a("span", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
|
|
5189
|
-
S,
|
|
5190
|
+
Re(S),
|
|
5190
5191
|
" record(s) will move, each with a history entry. Sure?"
|
|
5191
5192
|
] }),
|
|
5192
5193
|
/* @__PURE__ */ e(
|
|
@@ -5212,7 +5213,7 @@ function vs({ templateId: t }) {
|
|
|
5212
5213
|
] })
|
|
5213
5214
|
] });
|
|
5214
5215
|
}
|
|
5215
|
-
function
|
|
5216
|
+
function Ns({ templateId: t }) {
|
|
5216
5217
|
const s = Z(), [l, x] = A(
|
|
5217
5218
|
null
|
|
5218
5219
|
), [r, c] = A(() => {
|
|
@@ -5221,12 +5222,12 @@ function ys({ templateId: t }) {
|
|
|
5221
5222
|
} catch {
|
|
5222
5223
|
return {};
|
|
5223
5224
|
}
|
|
5224
|
-
}), o =
|
|
5225
|
+
}), o = Be(null), { data: m } = I({
|
|
5225
5226
|
queryKey: ["pipeline-canvas", t],
|
|
5226
5227
|
queryFn: () => s.request(Y(`/pipelines/${t}`)).then((u) => u.data),
|
|
5227
5228
|
staleTime: 3e4
|
|
5228
|
-
}), p = (m == null ? void 0 : m.states) ?? [], g = (m == null ? void 0 : m.transitions) ?? [], f =
|
|
5229
|
-
var
|
|
5229
|
+
}), p = (m == null ? void 0 : m.states) ?? [], g = (m == null ? void 0 : m.transitions) ?? [], f = gt(() => {
|
|
5230
|
+
var Ve;
|
|
5230
5231
|
const u = new Map(p.map((U) => [String(U.id).toUpperCase(), U])), k = /* @__PURE__ */ new Map(), L = p.filter((U) => U.is_initial).map((U) => ({ id: String(U.id).toUpperCase(), r: 0 })), R = /* @__PURE__ */ new Map();
|
|
5231
5232
|
for (const U of g) {
|
|
5232
5233
|
if (!U.from_state) continue;
|
|
@@ -5239,7 +5240,7 @@ function ys({ templateId: t }) {
|
|
|
5239
5240
|
k.has(U) || k.set(U, X);
|
|
5240
5241
|
for (const pe of R.get(U) ?? []) {
|
|
5241
5242
|
const ue = u.get(pe);
|
|
5242
|
-
!k.has(pe) && (((
|
|
5243
|
+
!k.has(pe) && (((Ve = u.get(U)) == null ? void 0 : Ve.sort) ?? 0) <= ((ue == null ? void 0 : ue.sort) ?? 0) && L.push({ id: pe, r: X + 1 });
|
|
5243
5244
|
}
|
|
5244
5245
|
}
|
|
5245
5246
|
}
|
|
@@ -5259,8 +5260,8 @@ function ys({ templateId: t }) {
|
|
|
5259
5260
|
me = Math.max(me, X.length), X.forEach((pe, ue) => {
|
|
5260
5261
|
de.set(pe, { x: 20 + U * (E + te), y: 20 + ue * (W + ne) });
|
|
5261
5262
|
});
|
|
5262
|
-
const
|
|
5263
|
-
return { pos: de, width:
|
|
5263
|
+
const it = 60 + (Math.max(0, ...M.keys()) + 1) * (E + te), j = 60 + me * (W + ne);
|
|
5264
|
+
return { pos: de, width: it, height: j, NODE_W: E, NODE_H: W };
|
|
5264
5265
|
}, [p, g]), i = (u) => r[u] ?? f.pos.get(u) ?? { x: 20, y: 20 }, [v, h] = A(null), [d, S] = A(null), N = Ce(), $ = z({
|
|
5265
5266
|
mutationFn: (u) => s.request(
|
|
5266
5267
|
J(`/pipelines/${t}/transitions`, {
|
|
@@ -5391,7 +5392,7 @@ function ys({ templateId: t }) {
|
|
|
5391
5392
|
y1: i(v).y + f.NODE_H / 2,
|
|
5392
5393
|
x2: d.x,
|
|
5393
5394
|
y2: d.y,
|
|
5394
|
-
stroke:
|
|
5395
|
+
stroke: fa,
|
|
5395
5396
|
strokeWidth: 2,
|
|
5396
5397
|
strokeDasharray: "5 4"
|
|
5397
5398
|
}
|
|
@@ -5509,7 +5510,7 @@ function ys({ templateId: t }) {
|
|
|
5509
5510
|
] })
|
|
5510
5511
|
] });
|
|
5511
5512
|
}
|
|
5512
|
-
function
|
|
5513
|
+
function ws({ templateId: t }) {
|
|
5513
5514
|
var w, C;
|
|
5514
5515
|
const s = Z(), [l, x] = A(90), [r, c] = A(null), { data: o } = I({
|
|
5515
5516
|
queryKey: ["flow-map", t, l],
|
|
@@ -5534,7 +5535,7 @@ function Ns({ templateId: t }) {
|
|
|
5534
5535
|
if (!u || !k) return null;
|
|
5535
5536
|
const L = b.count / Math.max(1, f.get(b.from) ?? 1), R = b.count / Math.max(1, i.get(b.to) ?? 1), B = Math.max(1.5, u.h * L), M = Math.max(1.5, k.h * R), E = u.y + ($.get(b.from) ?? 0), W = k.y + (q.get(b.to) ?? 0);
|
|
5536
5537
|
$.set(b.from, ($.get(b.from) ?? 0) + B), q.set(b.to, (q.get(b.to) ?? 0) + M);
|
|
5537
|
-
const te = be + 8, ne =
|
|
5538
|
+
const te = be + 8, ne = De - be - 8, de = (te + ne) / 2, me = `M ${te} ${E} C ${de} ${E}, ${de} ${W}, ${ne} ${W} L ${ne} ${W + M} C ${de} ${W + M}, ${de} ${E + B}, ${te} ${E + B} Z`;
|
|
5538
5539
|
return { f: b, path: me };
|
|
5539
5540
|
}), y = new Map(m.map((b) => [b.id, b]));
|
|
5540
5541
|
return m.length === 0 ? null : /* @__PURE__ */ a("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4 dark:border-border dark:bg-card", children: [
|
|
@@ -5565,14 +5566,14 @@ function Ns({ templateId: t }) {
|
|
|
5565
5566
|
b
|
|
5566
5567
|
)) })
|
|
5567
5568
|
] }),
|
|
5568
|
-
/* @__PURE__ */ a("svg", { viewBox: `0 0 ${
|
|
5569
|
+
/* @__PURE__ */ a("svg", { viewBox: `0 0 ${De} ${N}`, className: "w-full select-none", children: [
|
|
5569
5570
|
/* @__PURE__ */ e("title", { children: "Transition flow map" }),
|
|
5570
5571
|
O.map(
|
|
5571
5572
|
(b, u) => b ? /* @__PURE__ */ e(
|
|
5572
5573
|
"path",
|
|
5573
5574
|
{
|
|
5574
5575
|
d: b.path,
|
|
5575
|
-
fill: b.f.back ? "#ef4444" :
|
|
5576
|
+
fill: b.f.back ? "#ef4444" : fa,
|
|
5576
5577
|
opacity: r === null ? b.f.back ? 0.45 : 0.3 : r === b.f ? 0.75 : 0.08,
|
|
5577
5578
|
onMouseEnter: () => c(b.f),
|
|
5578
5579
|
onMouseLeave: () => c(null)
|
|
@@ -5624,7 +5625,7 @@ function Ns({ templateId: t }) {
|
|
|
5624
5625
|
/* @__PURE__ */ e(
|
|
5625
5626
|
"rect",
|
|
5626
5627
|
{
|
|
5627
|
-
x:
|
|
5628
|
+
x: De - be,
|
|
5628
5629
|
y: u.y,
|
|
5629
5630
|
width: be,
|
|
5630
5631
|
height: u.h,
|
|
@@ -5636,7 +5637,7 @@ function Ns({ templateId: t }) {
|
|
|
5636
5637
|
/* @__PURE__ */ e(
|
|
5637
5638
|
"rect",
|
|
5638
5639
|
{
|
|
5639
|
-
x:
|
|
5640
|
+
x: De - be - 6,
|
|
5640
5641
|
y: u.y,
|
|
5641
5642
|
width: 6,
|
|
5642
5643
|
height: u.h,
|
|
@@ -5647,7 +5648,7 @@ function Ns({ templateId: t }) {
|
|
|
5647
5648
|
/* @__PURE__ */ e(
|
|
5648
5649
|
"text",
|
|
5649
5650
|
{
|
|
5650
|
-
x:
|
|
5651
|
+
x: De - be + 8,
|
|
5651
5652
|
y: u.y + u.h / 2 + 3,
|
|
5652
5653
|
className: "fill-slate-700 text-[10.5px] font-medium dark:fill-slate-200",
|
|
5653
5654
|
children: (((R = y.get(b)) == null ? void 0 : R.label) ?? "").slice(0, 32)
|
|
@@ -5670,7 +5671,7 @@ function Ns({ templateId: t }) {
|
|
|
5670
5671
|
] })
|
|
5671
5672
|
] });
|
|
5672
5673
|
}
|
|
5673
|
-
function
|
|
5674
|
+
function ks({ templateId: t }) {
|
|
5674
5675
|
const s = Z(), [l, x] = A(90), [r, c] = A(0), [o, m] = A(!1), [p, g] = A(!0), { data: f } = I({
|
|
5675
5676
|
queryKey: ["pipeline-replay", t, l],
|
|
5676
5677
|
queryFn: () => s.request(Y(`/pipelines/${t}/replay`, { days: l })).then(($) => $.data),
|
|
@@ -5800,13 +5801,13 @@ function ws({ templateId: t }) {
|
|
|
5800
5801
|
] })
|
|
5801
5802
|
] });
|
|
5802
5803
|
}
|
|
5803
|
-
function
|
|
5804
|
+
function _s({ onClose: t }) {
|
|
5804
5805
|
return he(() => {
|
|
5805
5806
|
const s = (l) => {
|
|
5806
5807
|
l.key === "Escape" && t();
|
|
5807
5808
|
};
|
|
5808
5809
|
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
5809
|
-
}, [t]),
|
|
5810
|
+
}, [t]), Za(
|
|
5810
5811
|
/* @__PURE__ */ a("div", { className: "fixed inset-0 z-[120]", children: [
|
|
5811
5812
|
/* @__PURE__ */ e(
|
|
5812
5813
|
"button",
|
|
@@ -5832,20 +5833,20 @@ function ks({ onClose: t }) {
|
|
|
5832
5833
|
}
|
|
5833
5834
|
)
|
|
5834
5835
|
] }),
|
|
5835
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(
|
|
5836
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(Rn, { compact: !0 }) })
|
|
5836
5837
|
] })
|
|
5837
5838
|
] }),
|
|
5838
5839
|
document.body
|
|
5839
5840
|
);
|
|
5840
5841
|
}
|
|
5841
5842
|
export {
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5843
|
+
is as AiReviewCard,
|
|
5844
|
+
Qn as OpenWhenSection,
|
|
5845
|
+
bs as OwnerGapsCard,
|
|
5846
|
+
yr as PipelineEditorView,
|
|
5847
|
+
xs as PipelineSimulatorCard,
|
|
5848
|
+
es as ownerGroupsLabel,
|
|
5849
|
+
ds as splitStartNote,
|
|
5850
|
+
ya as splitStartOptions,
|
|
5851
|
+
na as suggestionList
|
|
5851
5852
|
};
|