@declarion/react 0.47.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-B6KjWkwD.js → DraggableChildrenTable-p2ZSdwzj.js} +1 -1
- package/dist-lib/{Grid-OdquWJNX.js → Grid-CjLFAKMZ.js} +2 -2
- package/dist-lib/{LayoutRenderer-CzAdhjNT.js → LayoutRenderer-DCscqXsv.js} +124 -118
- package/dist-lib/{MarkdownRenderer-C6bhrAIe.js → MarkdownRenderer-Sb7zcvj0.js} +1 -1
- package/dist-lib/{RefreshControl-F9Ib9asP.js → RefreshControl-Cnl9nE0x.js} +255 -225
- package/dist-lib/{SmartDetailPage.impl-DdSu3kmW.js → SmartDetailPage.impl-BAW-Tx_H.js} +465 -463
- package/dist-lib/{SmartRecordListPage.impl-SkIp0_Rd.js → SmartRecordListPage.impl-DtSSlGrI.js} +141 -139
- package/dist-lib/api/agents.d.ts +8 -11
- package/dist-lib/components/agents/AgentChatPanel.d.ts +1 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
- package/dist-lib/components/primitives/Tooltip.d.ts +4 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +24 -5
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +5 -7
- package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
- package/dist-lib/hooks/useLongPress.d.ts +29 -0
- package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
- package/dist-lib/index.d.ts +2 -2
- package/dist-lib/index.js +2351 -2144
- package/dist-lib/lib/actions.d.ts +12 -4
- package/dist-lib/lib/longPressGesture.d.ts +55 -0
- package/dist-lib/lib/page-inset.d.ts +3 -0
- package/dist-lib/lib/viewport-category.d.ts +44 -0
- package/dist-lib/{registry-C2VD-5MD.js → registry-CCxnZW2b.js} +1021 -955
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +15 -2
- package/dist-lib/{useCurrentScreen-ow4r-nWa.js → useCurrentScreen-BshVTPVq.js} +979 -971
- package/dist-lib/{useProperties-lEKfzm2X.js → useProperties-DrHFr0A1.js} +2 -2
- package/dist-lib/{value-CXohNH6a.js → value-B1O6QikE.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
|
@@ -103,7 +103,10 @@ var D = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
|
|
|
103
103
|
});
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/components/primitives/Pill.tsx
|
|
106
|
-
function k(
|
|
106
|
+
function k(e) {
|
|
107
|
+
return e == null || e === !1 || e === "" ? !1 : !Array.isArray(e) || e.some((e) => k(e));
|
|
108
|
+
}
|
|
109
|
+
function A({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style: i }) {
|
|
107
110
|
let a = `var(--pill-${e}-bg)`, o = `var(--pill-${e})`;
|
|
108
111
|
return /* @__PURE__ */ x("span", {
|
|
109
112
|
className: "num",
|
|
@@ -127,7 +130,7 @@ function k({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
|
|
|
127
130
|
height: 6,
|
|
128
131
|
borderRadius: 999,
|
|
129
132
|
background: o
|
|
130
|
-
} }), /* @__PURE__ */ b("span", {
|
|
133
|
+
} }), k(t) && /* @__PURE__ */ b("span", {
|
|
131
134
|
style: {
|
|
132
135
|
minWidth: 0,
|
|
133
136
|
overflow: "hidden",
|
|
@@ -140,7 +143,7 @@ function k({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
|
|
|
140
143
|
}
|
|
141
144
|
//#endregion
|
|
142
145
|
//#region src/components/primitives/Kbd.tsx
|
|
143
|
-
function
|
|
146
|
+
function j({ children: e }) {
|
|
144
147
|
return /* @__PURE__ */ b("span", {
|
|
145
148
|
className: "mono",
|
|
146
149
|
style: {
|
|
@@ -161,7 +164,7 @@ function A({ children: e }) {
|
|
|
161
164
|
}
|
|
162
165
|
//#endregion
|
|
163
166
|
//#region src/components/primitives/Dropdown.tsx
|
|
164
|
-
function
|
|
167
|
+
function M({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align: a = "start", width: o, style: s }) {
|
|
165
168
|
let c = f(null), [d, m] = p(null), h = r?.x, g = r?.y;
|
|
166
169
|
if (u(() => {
|
|
167
170
|
if (!e || !n && h === void 0) return;
|
|
@@ -170,7 +173,7 @@ function j({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align:
|
|
|
170
173
|
bottom: g,
|
|
171
174
|
left: h,
|
|
172
175
|
right: h
|
|
173
|
-
}, r =
|
|
176
|
+
}, r = ee(), i = c.current?.offsetHeight || 260, s = r - t.bottom < i + 12 && t.top > i + 12 ? "above" : "below", l = s === "below" ? t.bottom + 4 : t.top - 4 - i, u = typeof window < "u" ? window.innerWidth : 0, d = a === "end" ? t.right - (o || 200) : t.left;
|
|
174
177
|
u && (d = Math.max(8, Math.min(d, u - (o || 200) - 8))), m((e) => e && e.top === l && e.left === d && e.placement === s ? e : {
|
|
175
178
|
top: l,
|
|
176
179
|
left: d,
|
|
@@ -199,7 +202,7 @@ function j({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align:
|
|
|
199
202
|
n,
|
|
200
203
|
t
|
|
201
204
|
]), !e || !d) return null;
|
|
202
|
-
let _ = d.placement === "below" ? `calc(var(--app-height) - ${d.top}px - 8px)` : `${Math.max(120, d.top - 8)}px`, v =
|
|
205
|
+
let _ = d.placement === "below" ? `calc(var(--app-height) - ${d.top}px - 8px)` : `${Math.max(120, d.top - 8)}px`, v = N(s?.maxHeight), y = v ? `min(${_}, ${v})` : _;
|
|
203
206
|
return S(/* @__PURE__ */ b("div", {
|
|
204
207
|
ref: c,
|
|
205
208
|
style: {
|
|
@@ -222,7 +225,7 @@ function j({ open: e, onClose: t, anchor: n, anchorPoint: r, children: i, align:
|
|
|
222
225
|
children: i
|
|
223
226
|
}), document.body);
|
|
224
227
|
}
|
|
225
|
-
function
|
|
228
|
+
function ee() {
|
|
226
229
|
if (typeof window > "u" || typeof document > "u") return 0;
|
|
227
230
|
let e = getComputedStyle(document.documentElement).getPropertyValue("--app-height").trim();
|
|
228
231
|
if (e.endsWith("px")) {
|
|
@@ -232,19 +235,19 @@ function M() {
|
|
|
232
235
|
let t = window.visualViewport?.height;
|
|
233
236
|
return Number.isFinite(t) && t && t > 0 ? t : window.innerHeight;
|
|
234
237
|
}
|
|
235
|
-
function
|
|
238
|
+
function N(e) {
|
|
236
239
|
if (e != null) return typeof e == "number" ? `${e}px` : String(e);
|
|
237
240
|
}
|
|
238
241
|
//#endregion
|
|
239
242
|
//#region src/components/primitives/HoverCard.tsx
|
|
240
|
-
var
|
|
241
|
-
function
|
|
243
|
+
var te = 400, ne = 150, re = 320, ie = 240, ae = 4, oe = 4;
|
|
244
|
+
function se({ content: e, children: t, width: n = re, align: r = "center", style: i }) {
|
|
242
245
|
let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_, v] = p(!1), C = s(() => {
|
|
243
246
|
let e = a.current;
|
|
244
247
|
if (!e) return;
|
|
245
|
-
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s - 8)), f = o.current?.offsetHeight ??
|
|
248
|
+
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s - 8)), f = o.current?.offsetHeight ?? ie, p = u + c - t.bottom < f + 8 && t.top > f + 8 ? "above" : "below", m = p === "below" ? t.bottom + oe : t.top - oe - f, h;
|
|
246
249
|
h = r === "start" ? t.left : r === "end" ? t.right - d : t.left + t.width / 2 - d / 2;
|
|
247
|
-
let _ = l +
|
|
250
|
+
let _ = l + ae, v = l + s - ae;
|
|
248
251
|
h + d > v && (h = Math.max(_, t.right - d)), h < _ && (h = _), g((e) => e && e.top === m && e.left === h && e.width === d && e.placement === p ? e : {
|
|
249
252
|
top: m,
|
|
250
253
|
left: h,
|
|
@@ -265,7 +268,7 @@ function oe({ content: e, children: t, width: n = ne, align: r = "center", style
|
|
|
265
268
|
}, []), D = () => {
|
|
266
269
|
u.current !== null && (window.clearTimeout(u.current), u.current = null), !(d || c.current !== null) && (c.current = window.setTimeout(() => {
|
|
267
270
|
c.current = null, m(!0);
|
|
268
|
-
},
|
|
271
|
+
}, te));
|
|
269
272
|
}, O = s(() => {
|
|
270
273
|
E(), m(!0);
|
|
271
274
|
}, [E]), k = s(() => {
|
|
@@ -273,7 +276,7 @@ function oe({ content: e, children: t, width: n = ne, align: r = "center", style
|
|
|
273
276
|
}, [E]), A = () => {
|
|
274
277
|
c.current !== null && (window.clearTimeout(c.current), c.current = null), u.current === null && (u.current = window.setTimeout(() => {
|
|
275
278
|
u.current = null, m(!1);
|
|
276
|
-
},
|
|
279
|
+
}, ne));
|
|
277
280
|
};
|
|
278
281
|
l(() => () => {
|
|
279
282
|
E(), w.current &&= (w.current.disconnect(), null);
|
|
@@ -305,7 +308,7 @@ function oe({ content: e, children: t, width: n = ne, align: r = "center", style
|
|
|
305
308
|
top: h.top,
|
|
306
309
|
left: h.left,
|
|
307
310
|
width: h.width,
|
|
308
|
-
maxHeight:
|
|
311
|
+
maxHeight: ie,
|
|
309
312
|
overflowY: "auto",
|
|
310
313
|
zIndex: 250,
|
|
311
314
|
background: "var(--surface)",
|
|
@@ -391,76 +394,81 @@ function P({ icon: e, children: n, onRemove: r, onClick: i }) {
|
|
|
391
394
|
}
|
|
392
395
|
//#endregion
|
|
393
396
|
//#region src/lib/html-state.ts
|
|
394
|
-
function
|
|
397
|
+
function ce(e) {
|
|
395
398
|
typeof document > "u" || (document.documentElement.dataset.viewport = e);
|
|
396
399
|
}
|
|
397
|
-
function
|
|
400
|
+
function le(e) {
|
|
398
401
|
typeof document > "u" || (document.documentElement.dataset.embed = e ? "true" : "false");
|
|
399
402
|
}
|
|
400
403
|
//#endregion
|
|
401
|
-
//#region src/
|
|
402
|
-
var
|
|
404
|
+
//#region src/lib/viewport-category.ts
|
|
405
|
+
var ue = {
|
|
403
406
|
phoneMax: 639,
|
|
404
|
-
tabletMax: 1023
|
|
405
|
-
|
|
407
|
+
tabletMax: 1023,
|
|
408
|
+
landscapePhoneMaxHeight: 520
|
|
409
|
+
};
|
|
410
|
+
function de(e, t = ue) {
|
|
411
|
+
let { width: n, height: r, touch: i = !1 } = e;
|
|
412
|
+
return !Number.isFinite(n) || n <= 0 ? "desktop" : n <= t.phoneMax ? "phone" : n <= t.tabletMax ? i && Number.isFinite(r) && r > 0 && r <= t.landscapePhoneMaxHeight ? "phone" : "tablet" : "desktop";
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/hooks/useResponsiveMode.tsx
|
|
416
|
+
var fe = {
|
|
406
417
|
width: 1280,
|
|
407
418
|
height: 720
|
|
408
|
-
},
|
|
409
|
-
...
|
|
419
|
+
}, pe = i({
|
|
420
|
+
...fe,
|
|
410
421
|
category: "desktop",
|
|
411
422
|
isPhone: !1,
|
|
412
423
|
isTablet: !1,
|
|
413
424
|
isDesktop: !0,
|
|
414
425
|
touch: !1
|
|
415
426
|
});
|
|
416
|
-
function
|
|
417
|
-
return !Number.isFinite(e) || e <= 0 ? "desktop" : e <= t.phoneMax ? "phone" : e <= t.tabletMax ? "tablet" : "desktop";
|
|
418
|
-
}
|
|
419
|
-
function pe(e) {
|
|
427
|
+
function me(e) {
|
|
420
428
|
return {
|
|
421
|
-
width: Number.isFinite(e.width) && e.width > 0 ? e.width :
|
|
422
|
-
height: Number.isFinite(e.height) && e.height > 0 ? e.height :
|
|
429
|
+
width: Number.isFinite(e.width) && e.width > 0 ? e.width : fe.width,
|
|
430
|
+
height: Number.isFinite(e.height) && e.height > 0 ? e.height : fe.height,
|
|
423
431
|
touch: e.touch ?? !1
|
|
424
432
|
};
|
|
425
433
|
}
|
|
426
|
-
function
|
|
434
|
+
function he() {
|
|
427
435
|
if (typeof window > "u") return !1;
|
|
428
436
|
let e = window.matchMedia?.("(pointer: coarse)")?.matches ?? !1, t = window.navigator?.maxTouchPoints ?? 0;
|
|
429
437
|
return e || t > 0;
|
|
430
438
|
}
|
|
431
|
-
function
|
|
432
|
-
if (typeof window > "u") return
|
|
439
|
+
function ge() {
|
|
440
|
+
if (typeof window > "u") return fe;
|
|
433
441
|
let e = window.visualViewport;
|
|
434
|
-
return
|
|
442
|
+
return me({
|
|
435
443
|
width: e?.width ?? window.innerWidth,
|
|
436
444
|
height: e?.height ?? window.innerHeight,
|
|
437
|
-
touch:
|
|
445
|
+
touch: he()
|
|
438
446
|
});
|
|
439
447
|
}
|
|
440
|
-
function
|
|
448
|
+
function _e(e, t) {
|
|
441
449
|
if (typeof document > "u") return;
|
|
442
450
|
let n = document.documentElement;
|
|
443
451
|
n.style.setProperty("--app-viewport-width", `${Math.round(e.width)}px`), n.style.setProperty("--app-viewport-height", `${Math.round(e.height)}px`), n.style.setProperty("--app-height", `${Math.round(e.height)}px`);
|
|
444
452
|
let r = t === "phone" || e.height <= 520;
|
|
445
453
|
n.style.setProperty("--control-height", r ? "38px" : "30px"), n.style.setProperty("--control-line-height", r ? "36px" : "28px"), n.style.setProperty("--control-font-size", r ? "16px" : "12.5px");
|
|
446
454
|
}
|
|
447
|
-
function
|
|
448
|
-
let [i, a] = p(() =>
|
|
455
|
+
function ve({ children: e, breakpoints: t = ue, viewportOverride: n, viewport: r = "auto" }) {
|
|
456
|
+
let [i, a] = p(() => me(n ?? ge())), o = r === "auto" ? de(i, t) : r;
|
|
449
457
|
l(() => {
|
|
450
458
|
if (n) {
|
|
451
|
-
let e =
|
|
452
|
-
a(e),
|
|
459
|
+
let e = me(n);
|
|
460
|
+
a(e), _e(e, o);
|
|
453
461
|
return;
|
|
454
462
|
}
|
|
455
463
|
let e = () => {
|
|
456
|
-
let e =
|
|
457
|
-
a(e),
|
|
464
|
+
let e = ge();
|
|
465
|
+
a(e), _e(e, o);
|
|
458
466
|
};
|
|
459
467
|
return e(), window.addEventListener("resize", e), window.addEventListener("orientationchange", e), window.visualViewport?.addEventListener("resize", e), window.visualViewport?.addEventListener("scroll", e), () => {
|
|
460
468
|
window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e), window.visualViewport?.removeEventListener("resize", e), window.visualViewport?.removeEventListener("scroll", e);
|
|
461
469
|
};
|
|
462
470
|
}, [n, o]), l(() => {
|
|
463
|
-
|
|
471
|
+
ce(o);
|
|
464
472
|
}, [o]);
|
|
465
473
|
let s = d(() => ({
|
|
466
474
|
...i,
|
|
@@ -470,17 +478,17 @@ function _e({ children: e, breakpoints: t = le, viewportOverride: n, viewport: r
|
|
|
470
478
|
isDesktop: o === "desktop",
|
|
471
479
|
touch: i.touch ?? !1
|
|
472
480
|
}), [o, i]);
|
|
473
|
-
return /* @__PURE__ */ b(
|
|
481
|
+
return /* @__PURE__ */ b(pe.Provider, {
|
|
474
482
|
value: s,
|
|
475
483
|
children: e
|
|
476
484
|
});
|
|
477
485
|
}
|
|
478
|
-
function
|
|
479
|
-
return c(
|
|
486
|
+
function ye() {
|
|
487
|
+
return c(pe);
|
|
480
488
|
}
|
|
481
489
|
//#endregion
|
|
482
490
|
//#region src/components/primitives/BoolToggle.tsx
|
|
483
|
-
function
|
|
491
|
+
function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
484
492
|
return /* @__PURE__ */ b("button", {
|
|
485
493
|
type: "button",
|
|
486
494
|
id: n,
|
|
@@ -513,7 +521,7 @@ function ye({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
|
513
521
|
}
|
|
514
522
|
//#endregion
|
|
515
523
|
//#region src/components/primitives/MenuItem.tsx
|
|
516
|
-
function
|
|
524
|
+
function xe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, disabled: s, title: c, "data-testid": l }) {
|
|
517
525
|
return o ? /* @__PURE__ */ b("div", {
|
|
518
526
|
role: "separator",
|
|
519
527
|
style: {
|
|
@@ -561,13 +569,13 @@ function be({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, di
|
|
|
561
569
|
style: { flex: 1 },
|
|
562
570
|
children: t
|
|
563
571
|
}),
|
|
564
|
-
i && /* @__PURE__ */ b(
|
|
572
|
+
i && /* @__PURE__ */ b(j, { children: i })
|
|
565
573
|
]
|
|
566
574
|
});
|
|
567
575
|
}
|
|
568
576
|
//#endregion
|
|
569
577
|
//#region src/components/primitives/Spinner.tsx
|
|
570
|
-
function
|
|
578
|
+
function Se({ size: e = 14 }) {
|
|
571
579
|
return /* @__PURE__ */ x("svg", {
|
|
572
580
|
width: e,
|
|
573
581
|
height: e,
|
|
@@ -595,7 +603,7 @@ function xe({ size: e = 14 }) {
|
|
|
595
603
|
}
|
|
596
604
|
//#endregion
|
|
597
605
|
//#region src/components/primitives/Fields.tsx
|
|
598
|
-
var
|
|
606
|
+
var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ x("div", {
|
|
599
607
|
style: {
|
|
600
608
|
display: "flex",
|
|
601
609
|
alignItems: "center",
|
|
@@ -623,7 +631,7 @@ var Se = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ x("div", {
|
|
|
623
631
|
children: /* @__PURE__ */ b(t.info, { size: 11 })
|
|
624
632
|
})
|
|
625
633
|
]
|
|
626
|
-
}),
|
|
634
|
+
}), we = {
|
|
627
635
|
width: "100%",
|
|
628
636
|
height: "var(--control-height)",
|
|
629
637
|
padding: "0 10px",
|
|
@@ -643,7 +651,7 @@ function F({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
643
651
|
display: "flex",
|
|
644
652
|
alignItems: "center",
|
|
645
653
|
gap: 6,
|
|
646
|
-
...
|
|
654
|
+
...we,
|
|
647
655
|
padding: r || i ? "0 8px" : "0 10px",
|
|
648
656
|
borderColor: s ? "var(--accent)" : "var(--border)",
|
|
649
657
|
boxShadow: s ? "0 0 0 3px var(--accent-ring)" : "none",
|
|
@@ -685,7 +693,7 @@ function F({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
685
693
|
]
|
|
686
694
|
});
|
|
687
695
|
}
|
|
688
|
-
function
|
|
696
|
+
function Te({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a, name: o, ariaRequired: s }) {
|
|
689
697
|
let [c, l] = p(!1), u = i ? {
|
|
690
698
|
flex: 1,
|
|
691
699
|
height: "100%",
|
|
@@ -706,7 +714,7 @@ function we({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
|
|
|
706
714
|
onFocus: () => l(!0),
|
|
707
715
|
onBlur: () => l(!1),
|
|
708
716
|
style: {
|
|
709
|
-
...
|
|
717
|
+
...we,
|
|
710
718
|
padding: "8px 10px",
|
|
711
719
|
lineHeight: 1.5,
|
|
712
720
|
...u,
|
|
@@ -716,17 +724,17 @@ function we({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
|
|
|
716
724
|
}
|
|
717
725
|
});
|
|
718
726
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
727
|
+
var Ee = 20, De = 100;
|
|
728
|
+
function Oe(e) {
|
|
721
729
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
|
|
722
730
|
}
|
|
723
731
|
function I({ value: e, options: n, onChange: r, placeholder: i = "Select...", onSearchChange: a, ...o }) {
|
|
724
|
-
let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a, v = _ || g >
|
|
732
|
+
let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a, v = _ || g > Ee, S = (e) => {
|
|
725
733
|
u(e), a?.(e);
|
|
726
734
|
}, C = d(() => {
|
|
727
|
-
if (_) return n.slice(0,
|
|
735
|
+
if (_) return n.slice(0, De);
|
|
728
736
|
let e = l.trim().toLowerCase();
|
|
729
|
-
return e ? n.filter((t) => !t.heading && !t.divider &&
|
|
737
|
+
return e ? n.filter((t) => !t.heading && !t.divider && Oe(t).toLowerCase().includes(e)).slice(0, De) : n.slice(0, De);
|
|
730
738
|
}, [
|
|
731
739
|
n,
|
|
732
740
|
l,
|
|
@@ -745,7 +753,7 @@ function I({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
745
753
|
});
|
|
746
754
|
},
|
|
747
755
|
style: {
|
|
748
|
-
...
|
|
756
|
+
...we,
|
|
749
757
|
display: "flex",
|
|
750
758
|
alignItems: "center",
|
|
751
759
|
justifyContent: "space-between",
|
|
@@ -772,7 +780,7 @@ function I({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
772
780
|
flexShrink: 0
|
|
773
781
|
}
|
|
774
782
|
})]
|
|
775
|
-
}), /* @__PURE__ */ x(
|
|
783
|
+
}), /* @__PURE__ */ x(M, {
|
|
776
784
|
open: s,
|
|
777
785
|
anchor: m.current,
|
|
778
786
|
onClose: () => c(!1),
|
|
@@ -811,7 +819,7 @@ function I({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
811
819
|
letterSpacing: "0.06em"
|
|
812
820
|
},
|
|
813
821
|
children: t.label
|
|
814
|
-
}, `heading-${n}`) : /* @__PURE__ */ b(
|
|
822
|
+
}, `heading-${n}`) : /* @__PURE__ */ b(xe, {
|
|
815
823
|
onClick: () => {
|
|
816
824
|
r(t.value), c(!1);
|
|
817
825
|
},
|
|
@@ -829,13 +837,13 @@ function I({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
829
837
|
]
|
|
830
838
|
})] });
|
|
831
839
|
}
|
|
832
|
-
function
|
|
833
|
-
let [o, s] = p(!1), [c, l] = p(""), u = f(null), m = n.filter((e) => !e.heading && !e.divider), h = m.length >
|
|
840
|
+
function ke({ value: e = [], options: n, onChange: r, placeholder: i = "Select…", ...a }) {
|
|
841
|
+
let [o, s] = p(!1), [c, l] = p(""), u = f(null), m = n.filter((e) => !e.heading && !e.divider), h = m.length > Ee, g = e.map((e) => m.find((t) => t.value === e) ?? {
|
|
834
842
|
value: e,
|
|
835
843
|
label: e
|
|
836
844
|
}), _ = d(() => {
|
|
837
845
|
let e = c.trim().toLowerCase();
|
|
838
|
-
return e ? n.filter((t) => !t.heading && !t.divider &&
|
|
846
|
+
return e ? n.filter((t) => !t.heading && !t.divider && Oe(t).toLowerCase().includes(e)).slice(0, De) : n.slice(0, De);
|
|
839
847
|
}, [n, c]), v = (t) => r(e.includes(t) ? e.filter((e) => e !== t) : [...e, t]);
|
|
840
848
|
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
|
|
841
849
|
...a,
|
|
@@ -850,7 +858,7 @@ function Oe({ value: e = [], options: n, onChange: r, placeholder: i = "Select
|
|
|
850
858
|
});
|
|
851
859
|
},
|
|
852
860
|
style: {
|
|
853
|
-
...
|
|
861
|
+
...we,
|
|
854
862
|
height: "auto",
|
|
855
863
|
minHeight: "var(--control-height)",
|
|
856
864
|
display: "flex",
|
|
@@ -891,7 +899,7 @@ function Oe({ value: e = [], options: n, onChange: r, placeholder: i = "Select
|
|
|
891
899
|
children: e.label
|
|
892
900
|
}), /* @__PURE__ */ b("span", {
|
|
893
901
|
role: "button",
|
|
894
|
-
"aria-label": `Remove ${
|
|
902
|
+
"aria-label": `Remove ${Oe(e)}`,
|
|
895
903
|
onClick: (t) => {
|
|
896
904
|
t.stopPropagation(), v(e.value);
|
|
897
905
|
},
|
|
@@ -912,7 +920,7 @@ function Oe({ value: e = [], options: n, onChange: r, placeholder: i = "Select
|
|
|
912
920
|
flexShrink: 0
|
|
913
921
|
}
|
|
914
922
|
})]
|
|
915
|
-
}), /* @__PURE__ */ x(
|
|
923
|
+
}), /* @__PURE__ */ x(M, {
|
|
916
924
|
open: o,
|
|
917
925
|
anchor: u.current,
|
|
918
926
|
onClose: () => s(!1),
|
|
@@ -955,7 +963,7 @@ function Oe({ value: e = [], options: n, onChange: r, placeholder: i = "Select
|
|
|
955
963
|
children: n.label
|
|
956
964
|
}, `heading-${r}`);
|
|
957
965
|
let i = e.includes(n.value);
|
|
958
|
-
return /* @__PURE__ */ b(
|
|
966
|
+
return /* @__PURE__ */ b(xe, {
|
|
959
967
|
active: i,
|
|
960
968
|
icon: i ? /* @__PURE__ */ b(t.check, { size: 13 }) : /* @__PURE__ */ b("span", { style: {
|
|
961
969
|
display: "inline-block",
|
|
@@ -976,7 +984,7 @@ function Oe({ value: e = [], options: n, onChange: r, placeholder: i = "Select
|
|
|
976
984
|
]
|
|
977
985
|
})] });
|
|
978
986
|
}
|
|
979
|
-
function
|
|
987
|
+
function Ae({ value: e, onChange: n }) {
|
|
980
988
|
return /* @__PURE__ */ b(F, {
|
|
981
989
|
value: e || "",
|
|
982
990
|
onChange: n,
|
|
@@ -984,26 +992,26 @@ function ke({ value: e, onChange: n }) {
|
|
|
984
992
|
prefix: /* @__PURE__ */ b(t.calendar, { size: 13 })
|
|
985
993
|
});
|
|
986
994
|
}
|
|
987
|
-
function
|
|
995
|
+
function je(e) {
|
|
988
996
|
if (!e) return 0;
|
|
989
997
|
let t = 0;
|
|
990
998
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.min(4, t);
|
|
991
999
|
}
|
|
992
|
-
var
|
|
1000
|
+
var Me = [
|
|
993
1001
|
"Too short",
|
|
994
1002
|
"Weak",
|
|
995
1003
|
"Fair",
|
|
996
1004
|
"Good",
|
|
997
1005
|
"Strong"
|
|
998
|
-
],
|
|
1006
|
+
], Ne = [
|
|
999
1007
|
"var(--danger)",
|
|
1000
1008
|
"var(--danger)",
|
|
1001
1009
|
"var(--warning, #B45309)",
|
|
1002
1010
|
"var(--accent)",
|
|
1003
1011
|
"var(--success, #3FBF8F)"
|
|
1004
1012
|
];
|
|
1005
|
-
function
|
|
1006
|
-
let [c, l] = p(!1), u = e || "", d =
|
|
1013
|
+
function Pe({ value: e, onChange: n, placeholder: r = "Enter password", showStrength: i, id: a, name: o, ariaRequired: s }) {
|
|
1014
|
+
let [c, l] = p(!1), u = e || "", d = je(u);
|
|
1007
1015
|
return /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(F, {
|
|
1008
1016
|
id: a,
|
|
1009
1017
|
name: o,
|
|
@@ -1048,7 +1056,7 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
1048
1056
|
flex: 1,
|
|
1049
1057
|
height: 3,
|
|
1050
1058
|
borderRadius: 999,
|
|
1051
|
-
background: e < d ?
|
|
1059
|
+
background: e < d ? Ne[d] : "var(--surface-3)",
|
|
1052
1060
|
transition: "background .15s"
|
|
1053
1061
|
} }, e))
|
|
1054
1062
|
}), /* @__PURE__ */ b("span", {
|
|
@@ -1058,15 +1066,15 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
1058
1066
|
minWidth: 54,
|
|
1059
1067
|
textAlign: "right"
|
|
1060
1068
|
},
|
|
1061
|
-
children: u ?
|
|
1069
|
+
children: u ? Me[d] : ""
|
|
1062
1070
|
})]
|
|
1063
1071
|
})] });
|
|
1064
1072
|
}
|
|
1065
|
-
function
|
|
1073
|
+
function Fe({ value: e = [], onChange: t }) {
|
|
1066
1074
|
let [n, r] = p("");
|
|
1067
1075
|
return /* @__PURE__ */ x("div", {
|
|
1068
1076
|
style: {
|
|
1069
|
-
...
|
|
1077
|
+
...we,
|
|
1070
1078
|
height: "auto",
|
|
1071
1079
|
minHeight: "var(--control-height)",
|
|
1072
1080
|
display: "flex",
|
|
@@ -1098,7 +1106,7 @@ function Pe({ value: e = [], onChange: t }) {
|
|
|
1098
1106
|
})]
|
|
1099
1107
|
});
|
|
1100
1108
|
}
|
|
1101
|
-
function
|
|
1109
|
+
function Ie({ value: e, onChange: t }) {
|
|
1102
1110
|
return /* @__PURE__ */ x("div", {
|
|
1103
1111
|
style: {
|
|
1104
1112
|
border: "1px solid var(--border)",
|
|
@@ -1157,7 +1165,7 @@ function Fe({ value: e, onChange: t }) {
|
|
|
1157
1165
|
})]
|
|
1158
1166
|
});
|
|
1159
1167
|
}
|
|
1160
|
-
function
|
|
1168
|
+
function Le({ value: e, entity: n = "company", onChange: r, items: i = [], id: a, ariaLabelledby: o, ariaRequired: s }) {
|
|
1161
1169
|
let [c, l] = p(!1), u = f(null);
|
|
1162
1170
|
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
|
|
1163
1171
|
type: "button",
|
|
@@ -1167,7 +1175,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1167
1175
|
ref: u,
|
|
1168
1176
|
onClick: () => l(!0),
|
|
1169
1177
|
style: {
|
|
1170
|
-
...
|
|
1178
|
+
...we,
|
|
1171
1179
|
display: "flex",
|
|
1172
1180
|
alignItems: "center",
|
|
1173
1181
|
justifyContent: "space-between",
|
|
@@ -1202,7 +1210,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1202
1210
|
cls: "",
|
|
1203
1211
|
style: { color: "var(--text-3)" }
|
|
1204
1212
|
})]
|
|
1205
|
-
}), /* @__PURE__ */ x(
|
|
1213
|
+
}), /* @__PURE__ */ x(M, {
|
|
1206
1214
|
open: c,
|
|
1207
1215
|
anchor: u.current,
|
|
1208
1216
|
onClose: () => l(!1),
|
|
@@ -1214,7 +1222,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1214
1222
|
prefix: /* @__PURE__ */ b(t.search, { size: 12 }),
|
|
1215
1223
|
style: { marginBottom: 4 }
|
|
1216
1224
|
})
|
|
1217
|
-
}), i.slice(0, 6).map((e) => /* @__PURE__ */ b(
|
|
1225
|
+
}), i.slice(0, 6).map((e) => /* @__PURE__ */ b(xe, {
|
|
1218
1226
|
icon: /* @__PURE__ */ b(t.building, { size: 13 }),
|
|
1219
1227
|
onClick: () => {
|
|
1220
1228
|
r?.(e.name), l(!1);
|
|
@@ -1223,7 +1231,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
1223
1231
|
}, e.id))]
|
|
1224
1232
|
})] });
|
|
1225
1233
|
}
|
|
1226
|
-
function
|
|
1234
|
+
function Re({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
1227
1235
|
return /* @__PURE__ */ x("div", {
|
|
1228
1236
|
style: {
|
|
1229
1237
|
display: "flex",
|
|
@@ -1256,7 +1264,7 @@ function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
1256
1264
|
})]
|
|
1257
1265
|
});
|
|
1258
1266
|
}
|
|
1259
|
-
function
|
|
1267
|
+
function ze({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
1260
1268
|
let [a, o] = p(!1), [s, c] = p(e), l = () => {
|
|
1261
1269
|
s !== void 0 && n?.(s), o(!1);
|
|
1262
1270
|
}, u = () => {
|
|
@@ -1277,7 +1285,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
|
|
|
1277
1285
|
onChange: (e) => {
|
|
1278
1286
|
c(e), n?.(e), o(!1);
|
|
1279
1287
|
}
|
|
1280
|
-
}) : r === "bool" ? /* @__PURE__ */ b(
|
|
1288
|
+
}) : r === "bool" ? /* @__PURE__ */ b(be, {
|
|
1281
1289
|
value: s === "true",
|
|
1282
1290
|
onChange: (e) => {
|
|
1283
1291
|
let t = String(e);
|
|
@@ -1386,10 +1394,10 @@ function R(e) {
|
|
|
1386
1394
|
}
|
|
1387
1395
|
//#endregion
|
|
1388
1396
|
//#region src/lib/timestamp.ts
|
|
1389
|
-
function
|
|
1397
|
+
function Be(e = /* @__PURE__ */ new Date()) {
|
|
1390
1398
|
return T(e);
|
|
1391
1399
|
}
|
|
1392
|
-
function
|
|
1400
|
+
function Ve(e, t) {
|
|
1393
1401
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
1394
1402
|
if (isNaN(i.getTime())) return e;
|
|
1395
1403
|
if (n || r) {
|
|
@@ -1415,13 +1423,13 @@ function Be(e, t) {
|
|
|
1415
1423
|
}
|
|
1416
1424
|
return new Intl.DateTimeFormat(void 0, t).format(i);
|
|
1417
1425
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return
|
|
1426
|
+
function He(e) {
|
|
1427
|
+
return Ve(e, {
|
|
1420
1428
|
dateStyle: "medium",
|
|
1421
1429
|
timeStyle: "short"
|
|
1422
1430
|
});
|
|
1423
1431
|
}
|
|
1424
|
-
function
|
|
1432
|
+
function Ue(e, t = /* @__PURE__ */ new Date()) {
|
|
1425
1433
|
if (e == null || e === "") return {
|
|
1426
1434
|
text: "—",
|
|
1427
1435
|
absolute: ""
|
|
@@ -1434,7 +1442,7 @@ function He(e, t = /* @__PURE__ */ new Date()) {
|
|
|
1434
1442
|
absolute: t
|
|
1435
1443
|
};
|
|
1436
1444
|
}
|
|
1437
|
-
let r =
|
|
1445
|
+
let r = He(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
|
|
1438
1446
|
return Math.abs(i) > 2592e6 ? {
|
|
1439
1447
|
text: T(n, { representation: "date" }),
|
|
1440
1448
|
absolute: r
|
|
@@ -1446,17 +1454,17 @@ function He(e, t = /* @__PURE__ */ new Date()) {
|
|
|
1446
1454
|
function z(e, t = "en") {
|
|
1447
1455
|
return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
|
|
1448
1456
|
}
|
|
1449
|
-
var
|
|
1450
|
-
function
|
|
1457
|
+
var We = "$display";
|
|
1458
|
+
function Ge(e, t) {
|
|
1451
1459
|
if (!e) return;
|
|
1452
|
-
let n = e[
|
|
1460
|
+
let n = e[We];
|
|
1453
1461
|
if (typeof n == "string" && n !== "") return n;
|
|
1454
1462
|
let r = t?.display?.display_field;
|
|
1455
1463
|
if (!r) return;
|
|
1456
1464
|
let i = e[r];
|
|
1457
1465
|
if (i == null) return;
|
|
1458
1466
|
let a = t?.fields?.get(r);
|
|
1459
|
-
if (a?.type === "timestamp" && typeof i == "string" && i !== "") return
|
|
1467
|
+
if (a?.type === "timestamp" && typeof i == "string" && i !== "") return He(i);
|
|
1460
1468
|
let o = a?.values;
|
|
1461
1469
|
if (o && (typeof i == "string" || typeof i == "number")) {
|
|
1462
1470
|
let e = o.find((e) => e.code === String(i));
|
|
@@ -1467,7 +1475,7 @@ function We(e, t) {
|
|
|
1467
1475
|
}
|
|
1468
1476
|
return typeof i == "object" && !Array.isArray(i) ? z(i) || void 0 : R(i);
|
|
1469
1477
|
}
|
|
1470
|
-
function
|
|
1478
|
+
function B(e, t, n) {
|
|
1471
1479
|
if (!t) return n;
|
|
1472
1480
|
let r = e[t];
|
|
1473
1481
|
return r == null ? n : typeof r == "object" && !Array.isArray(r) ? z(r) || n : R(r);
|
|
@@ -1552,13 +1560,13 @@ function $e(e, t) {
|
|
|
1552
1560
|
function et(e) {
|
|
1553
1561
|
return !e?.disable_defaults?.includes("__new");
|
|
1554
1562
|
}
|
|
1555
|
-
function
|
|
1563
|
+
function V(e) {
|
|
1556
1564
|
if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
|
|
1557
1565
|
for (let [t, n] of e.fields) if (n.primary) return [t];
|
|
1558
1566
|
return ["id"];
|
|
1559
1567
|
}
|
|
1560
1568
|
function tt(e, t) {
|
|
1561
|
-
let n =
|
|
1569
|
+
let n = V(e), r = {};
|
|
1562
1570
|
for (let e of n) r[e] = R(t[e]);
|
|
1563
1571
|
return r;
|
|
1564
1572
|
}
|
|
@@ -1569,10 +1577,10 @@ function rt(e) {
|
|
|
1569
1577
|
return nt(Object.values(e));
|
|
1570
1578
|
}
|
|
1571
1579
|
function it(e, t) {
|
|
1572
|
-
return nt(
|
|
1580
|
+
return nt(V(e).map((e) => t[e] ?? ""));
|
|
1573
1581
|
}
|
|
1574
1582
|
function at(e, t) {
|
|
1575
|
-
let n =
|
|
1583
|
+
let n = V(e);
|
|
1576
1584
|
if (n.length === 1) return { [n[0]]: t };
|
|
1577
1585
|
}
|
|
1578
1586
|
function ot(e, t) {
|
|
@@ -1596,17 +1604,17 @@ function ct(e, t, n, r) {
|
|
|
1596
1604
|
return i ? i.replace(":id", encodeURIComponent(t)) : null;
|
|
1597
1605
|
}
|
|
1598
1606
|
function lt(e, t, n, r) {
|
|
1599
|
-
return !t ||
|
|
1607
|
+
return !t || V(t).some((e) => !r[e]) ? null : ct(e, it(t, r), t, n);
|
|
1600
1608
|
}
|
|
1601
1609
|
function ut(e, t, n, r) {
|
|
1602
1610
|
return t ? lt(e, t, n, tt(t, r)) : null;
|
|
1603
1611
|
}
|
|
1604
1612
|
function dt(e) {
|
|
1605
|
-
return
|
|
1613
|
+
return V(e).length > 1;
|
|
1606
1614
|
}
|
|
1607
1615
|
//#endregion
|
|
1608
1616
|
//#region src/types/api.ts
|
|
1609
|
-
var
|
|
1617
|
+
var H = class extends Error {
|
|
1610
1618
|
status;
|
|
1611
1619
|
code;
|
|
1612
1620
|
index;
|
|
@@ -1616,31 +1624,31 @@ var V = class extends Error {
|
|
|
1616
1624
|
}
|
|
1617
1625
|
}, ft = "cursor_semantics_mismatch", pt = "cursor_locale_changed";
|
|
1618
1626
|
function mt(e) {
|
|
1619
|
-
return e instanceof
|
|
1627
|
+
return e instanceof H && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
|
|
1620
1628
|
}
|
|
1621
1629
|
//#endregion
|
|
1622
1630
|
//#region src/api/auth-redirect.ts
|
|
1623
|
-
var
|
|
1631
|
+
var U = "/", ht = "/login", gt = "/signup", _t = "https://declarion.local";
|
|
1624
1632
|
function vt(e) {
|
|
1625
1633
|
let t = e.split(/[?#]/, 1)[0];
|
|
1626
1634
|
return t === ht || t.startsWith(`${ht}/`) || t === gt || t.startsWith(`${gt}/`);
|
|
1627
1635
|
}
|
|
1628
1636
|
function yt(e) {
|
|
1629
|
-
if (!e) return
|
|
1637
|
+
if (!e) return U;
|
|
1630
1638
|
let t = e.toLowerCase();
|
|
1631
|
-
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return
|
|
1639
|
+
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return U;
|
|
1632
1640
|
try {
|
|
1633
1641
|
let t = new URL(e, _t);
|
|
1634
|
-
if (t.origin !== _t) return
|
|
1642
|
+
if (t.origin !== _t) return U;
|
|
1635
1643
|
let n = `${t.pathname}${t.search}${t.hash}`;
|
|
1636
|
-
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ?
|
|
1644
|
+
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? U : n || U;
|
|
1637
1645
|
} catch {
|
|
1638
|
-
return
|
|
1646
|
+
return U;
|
|
1639
1647
|
}
|
|
1640
1648
|
}
|
|
1641
1649
|
function bt(e) {
|
|
1642
1650
|
let t = yt(e);
|
|
1643
|
-
return t ===
|
|
1651
|
+
return t === U || vt(t) ? ht : `${ht}?next=${encodeURIComponent(t)}`;
|
|
1644
1652
|
}
|
|
1645
1653
|
function xt() {
|
|
1646
1654
|
if (typeof window > "u") return ht;
|
|
@@ -1674,55 +1682,55 @@ function wt(e, t, n) {
|
|
|
1674
1682
|
}
|
|
1675
1683
|
//#endregion
|
|
1676
1684
|
//#region src/embed/token.ts
|
|
1677
|
-
var Tt = 15e3, Et = 5e3,
|
|
1685
|
+
var Tt = 15e3, Et = 5e3, W = {
|
|
1678
1686
|
active: !1,
|
|
1679
1687
|
parentOrigin: null,
|
|
1680
1688
|
current: null,
|
|
1681
1689
|
pending: null
|
|
1682
1690
|
};
|
|
1683
1691
|
function Dt(e) {
|
|
1684
|
-
|
|
1692
|
+
W.active = !0, W.parentOrigin = e;
|
|
1685
1693
|
}
|
|
1686
1694
|
function Ot() {
|
|
1687
|
-
return
|
|
1695
|
+
return W.active;
|
|
1688
1696
|
}
|
|
1689
1697
|
function kt() {
|
|
1690
|
-
return
|
|
1698
|
+
return W.current?.token ?? null;
|
|
1691
1699
|
}
|
|
1692
1700
|
function At() {
|
|
1693
|
-
return
|
|
1701
|
+
return W.parentOrigin;
|
|
1694
1702
|
}
|
|
1695
1703
|
function jt() {
|
|
1696
|
-
return !
|
|
1704
|
+
return !W.current || Date.now() >= W.current.expiresAt - Et;
|
|
1697
1705
|
}
|
|
1698
1706
|
function Mt(e) {
|
|
1699
1707
|
if (!e.token || typeof e.token != "string") return;
|
|
1700
1708
|
let t = Date.parse(e.expires_at);
|
|
1701
|
-
if (!Number.isNaN(t) && (
|
|
1709
|
+
if (!Number.isNaN(t) && (W.current = {
|
|
1702
1710
|
token: e.token,
|
|
1703
1711
|
expiresAt: t
|
|
1704
|
-
},
|
|
1705
|
-
let t =
|
|
1706
|
-
|
|
1712
|
+
}, W.pending)) {
|
|
1713
|
+
let t = W.pending;
|
|
1714
|
+
W.pending = null, clearTimeout(t.timer), t.resolve(e.token);
|
|
1707
1715
|
}
|
|
1708
1716
|
}
|
|
1709
1717
|
function Nt() {
|
|
1710
|
-
|
|
1718
|
+
W.current = null;
|
|
1711
1719
|
}
|
|
1712
1720
|
function Pt() {
|
|
1713
|
-
if (!jt() &&
|
|
1714
|
-
if (
|
|
1721
|
+
if (!jt() && W.current) return Promise.resolve(W.current.token);
|
|
1722
|
+
if (W.pending) return W.pending.promise;
|
|
1715
1723
|
let e, t, n = new Promise((n, r) => {
|
|
1716
1724
|
e = n, t = r;
|
|
1717
1725
|
}), r = setTimeout(() => {
|
|
1718
|
-
|
|
1726
|
+
W.pending && W.pending.promise === n && (W.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${Tt}ms`));
|
|
1719
1727
|
}, Tt);
|
|
1720
|
-
return
|
|
1728
|
+
return W.pending = {
|
|
1721
1729
|
promise: n,
|
|
1722
1730
|
resolve: e,
|
|
1723
1731
|
reject: t,
|
|
1724
1732
|
timer: r
|
|
1725
|
-
}, wt(
|
|
1733
|
+
}, wt(W.parentOrigin, Ct.tokenExpired, {}), n;
|
|
1726
1734
|
}
|
|
1727
1735
|
//#endregion
|
|
1728
1736
|
//#region src/lib/versionTracker.ts
|
|
@@ -1735,7 +1743,7 @@ function Lt() {
|
|
|
1735
1743
|
return null;
|
|
1736
1744
|
}
|
|
1737
1745
|
}
|
|
1738
|
-
var
|
|
1746
|
+
var G = {
|
|
1739
1747
|
firstSeen: null,
|
|
1740
1748
|
firstComponents: null,
|
|
1741
1749
|
hasReportedDrift: !1,
|
|
@@ -1744,11 +1752,11 @@ var W = {
|
|
|
1744
1752
|
channel: null
|
|
1745
1753
|
};
|
|
1746
1754
|
function Rt() {
|
|
1747
|
-
|
|
1755
|
+
G.channel || typeof BroadcastChannel > "u" || (G.channel = Lt(), G.channel && G.channel.addEventListener("message", (e) => {
|
|
1748
1756
|
let t = e.data;
|
|
1749
|
-
if (!(!t || t.type !== "drift" || !t.delta) && !
|
|
1750
|
-
|
|
1751
|
-
for (let e of
|
|
1757
|
+
if (!(!t || t.type !== "drift" || !t.delta) && !G.hasReportedDrift) {
|
|
1758
|
+
G.hasReportedDrift = !0;
|
|
1759
|
+
for (let e of G.listeners) e(t.delta);
|
|
1752
1760
|
}
|
|
1753
1761
|
}));
|
|
1754
1762
|
}
|
|
@@ -1756,11 +1764,11 @@ function zt(e) {
|
|
|
1756
1764
|
if (Rt(), !e) return;
|
|
1757
1765
|
let t = e.get(Ft);
|
|
1758
1766
|
if (t) {
|
|
1759
|
-
if (!
|
|
1760
|
-
|
|
1767
|
+
if (!G.firstSeen) {
|
|
1768
|
+
G.firstSeen = t;
|
|
1761
1769
|
return;
|
|
1762
1770
|
}
|
|
1763
|
-
t !==
|
|
1771
|
+
t !== G.firstSeen && (G.hasReportedDrift || Bt().catch(() => {
|
|
1764
1772
|
Ht({
|
|
1765
1773
|
kind: "unknown",
|
|
1766
1774
|
observed: t
|
|
@@ -1773,7 +1781,7 @@ async function Bt() {
|
|
|
1773
1781
|
let e;
|
|
1774
1782
|
try {
|
|
1775
1783
|
let t = {};
|
|
1776
|
-
|
|
1784
|
+
G.firstSeen && (t["If-None-Match"] = `"${G.firstSeen}"`), e = await fetch("/api/version", {
|
|
1777
1785
|
method: "GET",
|
|
1778
1786
|
credentials: Ot() ? "omit" : "include",
|
|
1779
1787
|
headers: t
|
|
@@ -1796,8 +1804,8 @@ async function Bt() {
|
|
|
1796
1804
|
asset: t.asset_fingerprint,
|
|
1797
1805
|
binary: t.binary_fingerprint
|
|
1798
1806
|
} : void 0;
|
|
1799
|
-
|
|
1800
|
-
kind: Vt(
|
|
1807
|
+
G.firstSeen ||= n, !G.firstComponents && r && n === G.firstSeen && (G.firstComponents = r), n !== G.firstSeen && Ht({
|
|
1808
|
+
kind: Vt(G.firstComponents, r),
|
|
1801
1809
|
observed: n,
|
|
1802
1810
|
components: r
|
|
1803
1811
|
});
|
|
@@ -1808,11 +1816,11 @@ function Vt(e, t) {
|
|
|
1808
1816
|
return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
|
|
1809
1817
|
}
|
|
1810
1818
|
function Ht(e) {
|
|
1811
|
-
if (!
|
|
1812
|
-
|
|
1813
|
-
for (let t of
|
|
1814
|
-
if (
|
|
1815
|
-
|
|
1819
|
+
if (!G.hasReportedDrift) {
|
|
1820
|
+
G.hasReportedDrift = !0, e.kind !== "schema-only" && (G.pendingReload = e);
|
|
1821
|
+
for (let t of G.listeners) t(e);
|
|
1822
|
+
if (G.channel) try {
|
|
1823
|
+
G.channel.postMessage({
|
|
1816
1824
|
type: "drift",
|
|
1817
1825
|
delta: e
|
|
1818
1826
|
});
|
|
@@ -1821,20 +1829,20 @@ function Ht(e) {
|
|
|
1821
1829
|
}
|
|
1822
1830
|
}
|
|
1823
1831
|
function Ut() {
|
|
1824
|
-
return
|
|
1832
|
+
return G.pendingReload;
|
|
1825
1833
|
}
|
|
1826
1834
|
function Wt(e) {
|
|
1827
|
-
return
|
|
1828
|
-
|
|
1835
|
+
return G.listeners.add(e), () => {
|
|
1836
|
+
G.listeners.delete(e);
|
|
1829
1837
|
};
|
|
1830
1838
|
}
|
|
1831
1839
|
//#endregion
|
|
1832
1840
|
//#region src/api/client.ts
|
|
1833
|
-
var Gt = (e) => JSON.stringify(e ?? {}), Kt = null,
|
|
1841
|
+
var Gt = (e) => JSON.stringify(e ?? {}), Kt = null, K = "declarion.auth.refresh.lock", qt = "declarion.auth.refresh.result", Jt = "declarion.auth.refresh", Yt = 3e4, Xt = 100, Zt = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1834
1842
|
function Qt() {
|
|
1835
1843
|
if (typeof window > "u") return !1;
|
|
1836
1844
|
try {
|
|
1837
|
-
let e = window.localStorage, t = `${
|
|
1845
|
+
let e = window.localStorage, t = `${K}.probe`;
|
|
1838
1846
|
return e.setItem(t, "1"), e.removeItem(t), !0;
|
|
1839
1847
|
} catch {
|
|
1840
1848
|
return !1;
|
|
@@ -1875,19 +1883,19 @@ function nn(e) {
|
|
|
1875
1883
|
return !t || t.updated_at < e ? null : t;
|
|
1876
1884
|
}
|
|
1877
1885
|
function rn(e) {
|
|
1878
|
-
if (!e.ok) throw new
|
|
1886
|
+
if (!e.ok) throw new q(e.status ?? 401);
|
|
1879
1887
|
}
|
|
1880
1888
|
function an(e = Date.now()) {
|
|
1881
|
-
let t = en(window.localStorage.getItem(
|
|
1889
|
+
let t = en(window.localStorage.getItem(K));
|
|
1882
1890
|
if (t && t.expires_at > e && t.owner !== Zt) return !1;
|
|
1883
1891
|
let n = {
|
|
1884
1892
|
owner: Zt,
|
|
1885
1893
|
expires_at: e + Yt
|
|
1886
1894
|
};
|
|
1887
|
-
return window.localStorage.setItem(
|
|
1895
|
+
return window.localStorage.setItem(K, JSON.stringify(n)), en(window.localStorage.getItem(K))?.owner === Zt;
|
|
1888
1896
|
}
|
|
1889
1897
|
function on() {
|
|
1890
|
-
en(window.localStorage.getItem(
|
|
1898
|
+
en(window.localStorage.getItem(K))?.owner === Zt && window.localStorage.removeItem(K);
|
|
1891
1899
|
}
|
|
1892
1900
|
function sn(e) {
|
|
1893
1901
|
let t = {
|
|
@@ -1902,14 +1910,14 @@ async function cn(e) {
|
|
|
1902
1910
|
let r = !1, i = null, a = (e) => {
|
|
1903
1911
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
|
|
1904
1912
|
}, o = (e) => {
|
|
1905
|
-
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new
|
|
1913
|
+
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new q(e)));
|
|
1906
1914
|
}, s = () => {
|
|
1907
1915
|
let t = tn(window.localStorage.getItem(qt));
|
|
1908
1916
|
if (t && t.updated_at >= e) {
|
|
1909
1917
|
t.ok ? a("complete") : o(t.status ?? 401);
|
|
1910
1918
|
return;
|
|
1911
1919
|
}
|
|
1912
|
-
let n = en(window.localStorage.getItem(
|
|
1920
|
+
let n = en(window.localStorage.getItem(K));
|
|
1913
1921
|
if (!n) {
|
|
1914
1922
|
a("complete");
|
|
1915
1923
|
return;
|
|
@@ -1920,7 +1928,7 @@ async function cn(e) {
|
|
|
1920
1928
|
}
|
|
1921
1929
|
i = setTimeout(s, Xt);
|
|
1922
1930
|
}, c = (e) => {
|
|
1923
|
-
(e.key ===
|
|
1931
|
+
(e.key === K || e.key === qt) && (i && clearTimeout(i), s());
|
|
1924
1932
|
};
|
|
1925
1933
|
window.addEventListener("storage", c), s();
|
|
1926
1934
|
});
|
|
@@ -1936,7 +1944,7 @@ async function ln(e) {
|
|
|
1936
1944
|
try {
|
|
1937
1945
|
await yn(), Qt() && sn({ ok: !0 });
|
|
1938
1946
|
} catch (e) {
|
|
1939
|
-
throw e instanceof
|
|
1947
|
+
throw e instanceof q && Qt() && sn({
|
|
1940
1948
|
ok: !1,
|
|
1941
1949
|
status: e.status
|
|
1942
1950
|
}), e;
|
|
@@ -1954,7 +1962,7 @@ async function un() {
|
|
|
1954
1962
|
await yn(), sn({ ok: !0 });
|
|
1955
1963
|
return;
|
|
1956
1964
|
} catch (e) {
|
|
1957
|
-
throw e instanceof
|
|
1965
|
+
throw e instanceof q && sn({
|
|
1958
1966
|
ok: !1,
|
|
1959
1967
|
status: e.status
|
|
1960
1968
|
}), e;
|
|
@@ -1964,7 +1972,7 @@ async function un() {
|
|
|
1964
1972
|
await cn(e) === "expired" && await un();
|
|
1965
1973
|
}
|
|
1966
1974
|
}
|
|
1967
|
-
var
|
|
1975
|
+
var q = class extends Error {
|
|
1968
1976
|
status;
|
|
1969
1977
|
constructor(e) {
|
|
1970
1978
|
super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
|
|
@@ -1972,7 +1980,7 @@ var K = class extends Error {
|
|
|
1972
1980
|
}, dn = null, fn = null, pn = 3e4, mn = 5e3;
|
|
1973
1981
|
function hn() {
|
|
1974
1982
|
bn().catch((e) => {
|
|
1975
|
-
e instanceof
|
|
1983
|
+
e instanceof q && xn();
|
|
1976
1984
|
});
|
|
1977
1985
|
}
|
|
1978
1986
|
function gn(e) {
|
|
@@ -2008,11 +2016,11 @@ async function yn() {
|
|
|
2008
2016
|
let n = parseInt(t.headers.get("Retry-After") || "1", 10);
|
|
2009
2017
|
await new Promise((e) => setTimeout(e, n * 1e3));
|
|
2010
2018
|
let r = await fetch("/api/actions/auth.refresh", e);
|
|
2011
|
-
if (!r.ok) throw new
|
|
2019
|
+
if (!r.ok) throw new q(r.status);
|
|
2012
2020
|
await vn(r);
|
|
2013
2021
|
return;
|
|
2014
2022
|
}
|
|
2015
|
-
if (!t.ok) throw new
|
|
2023
|
+
if (!t.ok) throw new q(t.status);
|
|
2016
2024
|
await vn(t);
|
|
2017
2025
|
}
|
|
2018
2026
|
async function bn() {
|
|
@@ -2020,27 +2028,27 @@ async function bn() {
|
|
|
2020
2028
|
Kt = null;
|
|
2021
2029
|
}), Kt);
|
|
2022
2030
|
}
|
|
2023
|
-
var
|
|
2031
|
+
var xn = () => {
|
|
2024
2032
|
if (typeof window > "u") return;
|
|
2025
2033
|
let { pathname: e } = window.location;
|
|
2026
2034
|
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = xt());
|
|
2027
2035
|
};
|
|
2028
|
-
function
|
|
2029
|
-
let t =
|
|
2030
|
-
return
|
|
2036
|
+
function Sn(e) {
|
|
2037
|
+
let t = xn;
|
|
2038
|
+
return xn = e, t;
|
|
2031
2039
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return
|
|
2040
|
+
function Cn() {
|
|
2041
|
+
return xn;
|
|
2034
2042
|
}
|
|
2035
|
-
var
|
|
2043
|
+
var wn = ({ status: e, code: t, message: n }) => {
|
|
2036
2044
|
console.error(`[API ${e}] ${t}: ${n}`);
|
|
2037
2045
|
};
|
|
2038
|
-
function
|
|
2046
|
+
function Tn(e, t, n, r) {
|
|
2039
2047
|
let i = new Headers(e);
|
|
2040
2048
|
return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
|
|
2041
2049
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
let i = Ot(), a = i ? "omit" : "include", o =
|
|
2050
|
+
async function En(e, t, n, r) {
|
|
2051
|
+
let i = Ot(), a = i ? "omit" : "include", o = Tn(t.headers, !!t.body, n, i ? kt() : null), s = await fetch(e, {
|
|
2044
2052
|
...t,
|
|
2045
2053
|
headers: o,
|
|
2046
2054
|
credentials: a
|
|
@@ -2055,48 +2063,48 @@ async function Tn(e, t, n, r) {
|
|
|
2055
2063
|
if (s.status === 401 && (c === "TOKEN_REFRESH_NEEDED" || c === "UNAUTHORIZED")) try {
|
|
2056
2064
|
let o = null;
|
|
2057
2065
|
i ? (Nt(), o = await Pt()) : await bn();
|
|
2058
|
-
let s =
|
|
2066
|
+
let s = Tn(t.headers, !!t.body, n, o), c = await fetch(e, {
|
|
2059
2067
|
...t,
|
|
2060
2068
|
headers: s,
|
|
2061
2069
|
credentials: a
|
|
2062
2070
|
});
|
|
2063
2071
|
if (!c.ok) {
|
|
2064
|
-
|
|
2072
|
+
xn();
|
|
2065
2073
|
let e = await c.json().catch(() => ({ error: {
|
|
2066
2074
|
message: "Request failed",
|
|
2067
2075
|
code: "UNKNOWN"
|
|
2068
2076
|
} }));
|
|
2069
|
-
throw new
|
|
2077
|
+
throw new H(c.status, e.error.message, e.error.code, e.index);
|
|
2070
2078
|
}
|
|
2071
2079
|
return r(c);
|
|
2072
2080
|
} catch (e) {
|
|
2073
|
-
throw e instanceof
|
|
2081
|
+
throw e instanceof H ? e : (xn(), new H(401, o, c, l));
|
|
2074
2082
|
}
|
|
2075
|
-
throw s.status === 401 &&
|
|
2083
|
+
throw s.status === 401 && xn(), wn({
|
|
2076
2084
|
status: s.status,
|
|
2077
2085
|
code: c,
|
|
2078
2086
|
message: o
|
|
2079
|
-
}), new
|
|
2087
|
+
}), new H(s.status, o, c, l, u);
|
|
2080
2088
|
}
|
|
2081
2089
|
return r(s);
|
|
2082
2090
|
}
|
|
2083
|
-
function
|
|
2091
|
+
function Dn(e) {
|
|
2084
2092
|
return e.status === 204 ? Promise.resolve(void 0) : e.json();
|
|
2085
2093
|
}
|
|
2086
2094
|
async function J(e, t = {}) {
|
|
2087
|
-
return
|
|
2095
|
+
return En(e, t, { setAccept: !1 }, Dn);
|
|
2088
2096
|
}
|
|
2089
|
-
async function
|
|
2097
|
+
async function On(e) {
|
|
2090
2098
|
return {
|
|
2091
2099
|
blob: await e.blob(),
|
|
2092
|
-
filename:
|
|
2100
|
+
filename: An(e.headers),
|
|
2093
2101
|
headers: e.headers
|
|
2094
2102
|
};
|
|
2095
2103
|
}
|
|
2096
|
-
async function
|
|
2097
|
-
return
|
|
2104
|
+
async function kn(e, t = {}) {
|
|
2105
|
+
return En(e, t, { setAccept: !0 }, On);
|
|
2098
2106
|
}
|
|
2099
|
-
function
|
|
2107
|
+
function An(e) {
|
|
2100
2108
|
let t = e.get("Content-Disposition");
|
|
2101
2109
|
if (!t) return "";
|
|
2102
2110
|
let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
|
|
@@ -2114,23 +2122,23 @@ async function Y(e, t = {}) {
|
|
|
2114
2122
|
}
|
|
2115
2123
|
//#endregion
|
|
2116
2124
|
//#region src/api/schema.ts
|
|
2117
|
-
function
|
|
2125
|
+
function jn(e) {
|
|
2118
2126
|
return {
|
|
2119
2127
|
...e,
|
|
2120
2128
|
params: e.params ? L.fromObject(e.params) : void 0
|
|
2121
2129
|
};
|
|
2122
2130
|
}
|
|
2123
|
-
function
|
|
2131
|
+
function Mn(e) {
|
|
2124
2132
|
return {
|
|
2125
2133
|
...e,
|
|
2126
2134
|
resolved_params: e.resolved_params ? L.fromObject(e.resolved_params) : void 0
|
|
2127
2135
|
};
|
|
2128
2136
|
}
|
|
2129
|
-
function
|
|
2137
|
+
function Nn(e) {
|
|
2130
2138
|
let t = {};
|
|
2131
|
-
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] =
|
|
2139
|
+
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = jn(r);
|
|
2132
2140
|
let n = {};
|
|
2133
|
-
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] =
|
|
2141
|
+
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = Mn(r);
|
|
2134
2142
|
return {
|
|
2135
2143
|
...e,
|
|
2136
2144
|
fields: L.fromObject(e.fields),
|
|
@@ -2140,18 +2148,18 @@ function Mn(e) {
|
|
|
2140
2148
|
actions: e.actions ? n : void 0
|
|
2141
2149
|
};
|
|
2142
2150
|
}
|
|
2143
|
-
function
|
|
2151
|
+
function Pn(e) {
|
|
2144
2152
|
let t = {};
|
|
2145
|
-
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] =
|
|
2153
|
+
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = Nn(r);
|
|
2146
2154
|
let n = {};
|
|
2147
2155
|
if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
|
|
2148
2156
|
...r,
|
|
2149
2157
|
fields: L.fromObject(r.fields)
|
|
2150
2158
|
};
|
|
2151
2159
|
let r = {};
|
|
2152
|
-
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] =
|
|
2160
|
+
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = jn(n);
|
|
2153
2161
|
let i = {};
|
|
2154
|
-
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] =
|
|
2162
|
+
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = Mn(n);
|
|
2155
2163
|
let a = { ...e.screens };
|
|
2156
2164
|
for (let [e, t] of Object.entries(a)) {
|
|
2157
2165
|
let n = t;
|
|
@@ -2169,15 +2177,15 @@ function Nn(e) {
|
|
|
2169
2177
|
screens: a
|
|
2170
2178
|
};
|
|
2171
2179
|
}
|
|
2172
|
-
async function
|
|
2173
|
-
return
|
|
2180
|
+
async function Fn() {
|
|
2181
|
+
return Pn(await J("/api/schema"));
|
|
2174
2182
|
}
|
|
2175
2183
|
//#endregion
|
|
2176
2184
|
//#region src/api/auth.ts
|
|
2177
|
-
async function
|
|
2185
|
+
async function In() {
|
|
2178
2186
|
return Y("auth.check_setup");
|
|
2179
2187
|
}
|
|
2180
|
-
async function
|
|
2188
|
+
async function Ln(e, t, n = !0) {
|
|
2181
2189
|
let r = await Y("auth.login", {
|
|
2182
2190
|
email: e,
|
|
2183
2191
|
password: t,
|
|
@@ -2185,7 +2193,7 @@ async function In(e, t, n = !0) {
|
|
|
2185
2193
|
});
|
|
2186
2194
|
return gn(r.expires_at), r;
|
|
2187
2195
|
}
|
|
2188
|
-
async function
|
|
2196
|
+
async function Rn(e, t, n) {
|
|
2189
2197
|
let r = await Y("auth.signup", {
|
|
2190
2198
|
email: e,
|
|
2191
2199
|
password: t,
|
|
@@ -2193,42 +2201,42 @@ async function Ln(e, t, n) {
|
|
|
2193
2201
|
});
|
|
2194
2202
|
return gn(r.expires_at), r;
|
|
2195
2203
|
}
|
|
2196
|
-
async function
|
|
2204
|
+
async function zn() {
|
|
2197
2205
|
return Y("auth.me");
|
|
2198
2206
|
}
|
|
2199
|
-
async function
|
|
2207
|
+
async function Bn() {
|
|
2200
2208
|
return (await Y("auth.list_tenants")).tenants;
|
|
2201
2209
|
}
|
|
2202
|
-
async function
|
|
2210
|
+
async function Vn(e) {
|
|
2203
2211
|
let t = await Y("auth.switch_tenant", { tenant_id: e });
|
|
2204
2212
|
return gn(t.expires_at), t;
|
|
2205
2213
|
}
|
|
2206
|
-
async function
|
|
2214
|
+
async function Hn() {
|
|
2207
2215
|
await Y("auth.logout");
|
|
2208
2216
|
}
|
|
2209
|
-
async function
|
|
2217
|
+
async function Un(e) {
|
|
2210
2218
|
return (await Y("sso_provider.list", e ? { tenant_code: e } : {})).providers;
|
|
2211
2219
|
}
|
|
2212
|
-
function
|
|
2220
|
+
function Wn(e, t, n) {
|
|
2213
2221
|
let r = new URLSearchParams();
|
|
2214
2222
|
t && r.set("tenant", t), n && r.set("redirect", n);
|
|
2215
2223
|
let i = r.toString();
|
|
2216
2224
|
return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2217
2225
|
}
|
|
2218
|
-
async function
|
|
2226
|
+
async function Gn(e, t, n) {
|
|
2219
2227
|
let r = {
|
|
2220
2228
|
target_user_id: e,
|
|
2221
2229
|
reason: t
|
|
2222
2230
|
};
|
|
2223
2231
|
return n != null && (r.duration_minutes = n), Y("impersonation.start", r);
|
|
2224
2232
|
}
|
|
2225
|
-
async function
|
|
2233
|
+
async function Kn() {
|
|
2226
2234
|
return Y("impersonation.stop");
|
|
2227
2235
|
}
|
|
2228
|
-
async function
|
|
2236
|
+
async function qn(e) {
|
|
2229
2237
|
await Y("impersonation.revoke", { session_id: e });
|
|
2230
2238
|
}
|
|
2231
|
-
async function
|
|
2239
|
+
async function Jn(e, t) {
|
|
2232
2240
|
await Y("auth.change_password", {
|
|
2233
2241
|
current_password: e,
|
|
2234
2242
|
new_password: t
|
|
@@ -2236,7 +2244,7 @@ async function qn(e, t) {
|
|
|
2236
2244
|
}
|
|
2237
2245
|
//#endregion
|
|
2238
2246
|
//#region src/stores/auth.ts
|
|
2239
|
-
var
|
|
2247
|
+
var Yn = E((e) => ({
|
|
2240
2248
|
user: null,
|
|
2241
2249
|
isAuthenticated: !1,
|
|
2242
2250
|
isLoading: !0,
|
|
@@ -2244,9 +2252,9 @@ var Jn = E((e) => ({
|
|
|
2244
2252
|
tenants: [],
|
|
2245
2253
|
initialize: async () => {
|
|
2246
2254
|
try {
|
|
2247
|
-
let t = await
|
|
2255
|
+
let t = await zn(), n = t.tenant ?? null, r = [];
|
|
2248
2256
|
try {
|
|
2249
|
-
r = await
|
|
2257
|
+
r = await Bn();
|
|
2250
2258
|
} catch {}
|
|
2251
2259
|
e({
|
|
2252
2260
|
user: t,
|
|
@@ -2265,7 +2273,7 @@ var Jn = E((e) => ({
|
|
|
2265
2273
|
},
|
|
2266
2274
|
refreshMe: async () => {
|
|
2267
2275
|
try {
|
|
2268
|
-
let t = await
|
|
2276
|
+
let t = await zn();
|
|
2269
2277
|
e({
|
|
2270
2278
|
user: t,
|
|
2271
2279
|
activeTenant: t.tenant ?? null
|
|
@@ -2289,7 +2297,7 @@ var Jn = E((e) => ({
|
|
|
2289
2297
|
logout: async () => {
|
|
2290
2298
|
_n();
|
|
2291
2299
|
try {
|
|
2292
|
-
await
|
|
2300
|
+
await Hn();
|
|
2293
2301
|
} catch {}
|
|
2294
2302
|
e({
|
|
2295
2303
|
user: null,
|
|
@@ -2302,31 +2310,31 @@ var Jn = E((e) => ({
|
|
|
2302
2310
|
//#endregion
|
|
2303
2311
|
//#region src/hooks/useSchema.ts
|
|
2304
2312
|
function X() {
|
|
2305
|
-
let e =
|
|
2313
|
+
let e = Yn((e) => e.isAuthenticated);
|
|
2306
2314
|
return g({
|
|
2307
2315
|
queryKey: ["schema", e],
|
|
2308
|
-
queryFn:
|
|
2316
|
+
queryFn: Fn,
|
|
2309
2317
|
staleTime: Infinity,
|
|
2310
2318
|
enabled: e
|
|
2311
2319
|
});
|
|
2312
2320
|
}
|
|
2313
2321
|
//#endregion
|
|
2314
2322
|
//#region src/api/data.ts
|
|
2315
|
-
function
|
|
2323
|
+
function Xn(e, t) {
|
|
2316
2324
|
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
2317
2325
|
if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
|
|
2318
2326
|
return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
|
|
2319
2327
|
}
|
|
2320
|
-
async function
|
|
2321
|
-
if (
|
|
2322
|
-
let n =
|
|
2328
|
+
async function Zn(e, t = {}, n = {}) {
|
|
2329
|
+
if (ur) {
|
|
2330
|
+
let n = ur(e, t);
|
|
2323
2331
|
if (n !== void 0) return n;
|
|
2324
2332
|
}
|
|
2325
|
-
return J(
|
|
2333
|
+
return J(Xn(e, t), { signal: n.signal });
|
|
2326
2334
|
}
|
|
2327
|
-
async function
|
|
2328
|
-
if (
|
|
2329
|
-
let n =
|
|
2335
|
+
async function Qn(e, t) {
|
|
2336
|
+
if (dr) {
|
|
2337
|
+
let n = dr(e, t);
|
|
2330
2338
|
if (n !== void 0) return n;
|
|
2331
2339
|
}
|
|
2332
2340
|
let n = new URLSearchParams();
|
|
@@ -2334,40 +2342,40 @@ async function Zn(e, t) {
|
|
|
2334
2342
|
else for (let [e, r] of Object.entries(t)) n.set(e, r);
|
|
2335
2343
|
return J(`/api/data/${e}?${n.toString()}`);
|
|
2336
2344
|
}
|
|
2337
|
-
async function
|
|
2338
|
-
return { data: ((await
|
|
2345
|
+
async function $n(e, t) {
|
|
2346
|
+
return { data: ((await mr(`${e}.__create`, {
|
|
2339
2347
|
entity: e,
|
|
2340
2348
|
fields: t
|
|
2341
2349
|
})).result?.rows ?? [])[0] };
|
|
2342
2350
|
}
|
|
2343
|
-
async function
|
|
2344
|
-
let r = typeof t == "string" ? t :
|
|
2345
|
-
return { data: ((await
|
|
2351
|
+
async function er(e, t, n) {
|
|
2352
|
+
let r = typeof t == "string" ? t : nr(t);
|
|
2353
|
+
return { data: ((await mr(`${e}.__update`, {
|
|
2346
2354
|
object_ids: [r],
|
|
2347
2355
|
entity: e,
|
|
2348
2356
|
fields: n
|
|
2349
2357
|
})).result?.rows ?? [])[0] };
|
|
2350
2358
|
}
|
|
2351
|
-
async function
|
|
2352
|
-
let n = typeof t == "string" ? t :
|
|
2353
|
-
await
|
|
2359
|
+
async function tr(e, t) {
|
|
2360
|
+
let n = typeof t == "string" ? t : nr(t);
|
|
2361
|
+
await mr(`${e}.__delete`, {
|
|
2354
2362
|
object_ids: [n],
|
|
2355
2363
|
entity: e
|
|
2356
2364
|
});
|
|
2357
2365
|
}
|
|
2358
|
-
function
|
|
2366
|
+
function nr(e) {
|
|
2359
2367
|
let t = Object.values(e);
|
|
2360
2368
|
return t.length === 1 ? t[0] : t.join("");
|
|
2361
2369
|
}
|
|
2362
|
-
async function
|
|
2363
|
-
let n = typeof t == "string" ? t :
|
|
2364
|
-
await
|
|
2370
|
+
async function rr(e, t) {
|
|
2371
|
+
let n = typeof t == "string" ? t : nr(t);
|
|
2372
|
+
await mr(`${e}.__restore`, {
|
|
2365
2373
|
object_ids: [n],
|
|
2366
2374
|
entity: e
|
|
2367
2375
|
});
|
|
2368
2376
|
}
|
|
2369
|
-
async function
|
|
2370
|
-
let n = await
|
|
2377
|
+
async function ir(e, t) {
|
|
2378
|
+
let n = await kn(`/api/data/${e}/export`, {
|
|
2371
2379
|
method: "POST",
|
|
2372
2380
|
body: JSON.stringify(t)
|
|
2373
2381
|
});
|
|
@@ -2376,7 +2384,7 @@ async function rr(e, t) {
|
|
|
2376
2384
|
filename: n.filename
|
|
2377
2385
|
};
|
|
2378
2386
|
}
|
|
2379
|
-
var
|
|
2387
|
+
var ar = class extends Error {
|
|
2380
2388
|
status;
|
|
2381
2389
|
response;
|
|
2382
2390
|
constructor(e, t) {
|
|
@@ -2384,55 +2392,55 @@ var ir = class extends Error {
|
|
|
2384
2392
|
super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
|
|
2385
2393
|
}
|
|
2386
2394
|
};
|
|
2387
|
-
function
|
|
2395
|
+
function or(e) {
|
|
2388
2396
|
if (!e || typeof e != "object") return !1;
|
|
2389
2397
|
let t = e;
|
|
2390
2398
|
return typeof t.status == "string" && Array.isArray(t.errors);
|
|
2391
2399
|
}
|
|
2392
|
-
function
|
|
2400
|
+
function sr(e, t) {
|
|
2393
2401
|
let n = { ...e ?? {} };
|
|
2394
2402
|
if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
|
|
2395
2403
|
if ("_ids" in n) throw Error("handler param \"_ids\" is a removed legacy key; use object_ids");
|
|
2396
2404
|
return t !== void 0 && (n.object_ids = t), n;
|
|
2397
2405
|
}
|
|
2398
|
-
var
|
|
2399
|
-
function
|
|
2400
|
-
let t =
|
|
2401
|
-
return
|
|
2402
|
-
}
|
|
2403
|
-
var lr = null, ur = null;
|
|
2404
|
-
function dr(e) {
|
|
2405
|
-
let t = lr;
|
|
2406
|
-
return lr = e, t;
|
|
2406
|
+
var cr = null;
|
|
2407
|
+
function lr(e) {
|
|
2408
|
+
let t = cr;
|
|
2409
|
+
return cr = e, t;
|
|
2407
2410
|
}
|
|
2411
|
+
var ur = null, dr = null;
|
|
2408
2412
|
function fr(e) {
|
|
2409
2413
|
let t = ur;
|
|
2410
2414
|
return ur = e, t;
|
|
2411
2415
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2416
|
+
function pr(e) {
|
|
2417
|
+
let t = dr;
|
|
2418
|
+
return dr = e, t;
|
|
2419
|
+
}
|
|
2420
|
+
async function mr(e, t) {
|
|
2421
|
+
if (cr) return cr(e, t);
|
|
2414
2422
|
try {
|
|
2415
2423
|
return await J(`/api/actions/${e}`, {
|
|
2416
2424
|
method: "POST",
|
|
2417
2425
|
body: JSON.stringify(t)
|
|
2418
2426
|
});
|
|
2419
2427
|
} catch (e) {
|
|
2420
|
-
throw e instanceof
|
|
2428
|
+
throw e instanceof H && or(e.raw) ? new ar(e.status, e.raw) : e;
|
|
2421
2429
|
}
|
|
2422
2430
|
}
|
|
2423
|
-
async function
|
|
2431
|
+
async function hr(e, t) {
|
|
2424
2432
|
let n = new URLSearchParams();
|
|
2425
2433
|
return n.set("ids", t.join(",")), J(`/api/associations/${e}?${n.toString()}`);
|
|
2426
2434
|
}
|
|
2427
2435
|
//#endregion
|
|
2428
2436
|
//#region src/embed/params.ts
|
|
2429
|
-
var
|
|
2430
|
-
gr,
|
|
2437
|
+
var gr = "self", _r = "embed", vr = "parent_origin", yr = "theme", br = [
|
|
2431
2438
|
_r,
|
|
2432
2439
|
vr,
|
|
2440
|
+
yr,
|
|
2433
2441
|
"nav"
|
|
2434
2442
|
];
|
|
2435
|
-
function
|
|
2443
|
+
function xr(e) {
|
|
2436
2444
|
if (!e) return null;
|
|
2437
2445
|
let t;
|
|
2438
2446
|
try {
|
|
@@ -2442,22 +2450,22 @@ function br(e) {
|
|
|
2442
2450
|
}
|
|
2443
2451
|
return t.origin === "null" ? null : e === t.origin ? t.origin : null;
|
|
2444
2452
|
}
|
|
2445
|
-
function xr(e) {
|
|
2446
|
-
return e === "light" || e === "dark" ? e : null;
|
|
2447
|
-
}
|
|
2448
2453
|
function Sr(e) {
|
|
2449
|
-
return e === "
|
|
2454
|
+
return e === "light" || e === "dark" ? e : null;
|
|
2450
2455
|
}
|
|
2451
2456
|
function Cr(e) {
|
|
2457
|
+
return e === "delegated" ? "delegated" : gr;
|
|
2458
|
+
}
|
|
2459
|
+
function wr(e) {
|
|
2452
2460
|
let t = typeof e == "string" ? new URLSearchParams(e) : e;
|
|
2453
2461
|
return {
|
|
2454
|
-
enabled: t.get(
|
|
2455
|
-
parentOrigin:
|
|
2456
|
-
theme:
|
|
2457
|
-
navigationMode:
|
|
2462
|
+
enabled: t.get(_r) === "1",
|
|
2463
|
+
parentOrigin: xr(t.get(vr)),
|
|
2464
|
+
theme: Sr(t.get(yr)),
|
|
2465
|
+
navigationMode: Cr(t.get("nav"))
|
|
2458
2466
|
};
|
|
2459
2467
|
}
|
|
2460
|
-
function
|
|
2468
|
+
function Tr(e, t) {
|
|
2461
2469
|
if (!t.enabled) return e;
|
|
2462
2470
|
let n = /^[a-z][a-z0-9+.-]*:/i.test(e), r;
|
|
2463
2471
|
try {
|
|
@@ -2466,46 +2474,46 @@ function wr(e, t) {
|
|
|
2466
2474
|
return e;
|
|
2467
2475
|
}
|
|
2468
2476
|
let i = r.searchParams;
|
|
2469
|
-
return t.enabled && i.set(
|
|
2477
|
+
return t.enabled && i.set(_r, "1"), t.parentOrigin && i.set(vr, t.parentOrigin), t.theme && i.set(yr, t.theme), i.set("nav", t.navigationMode), n ? r.toString() : `${r.pathname}${r.search}${r.hash}`;
|
|
2470
2478
|
}
|
|
2471
2479
|
//#endregion
|
|
2472
2480
|
//#region src/embed/EmbedContext.tsx
|
|
2473
|
-
var
|
|
2481
|
+
var Er = i({
|
|
2474
2482
|
enabled: !1,
|
|
2475
2483
|
parentOrigin: null,
|
|
2476
2484
|
theme: null,
|
|
2477
2485
|
navigationMode: "self",
|
|
2478
2486
|
appendEmbedParams: (e) => e
|
|
2479
2487
|
});
|
|
2480
|
-
function
|
|
2488
|
+
function Dr(e) {
|
|
2481
2489
|
return {
|
|
2482
2490
|
enabled: e.enabled,
|
|
2483
2491
|
parentOrigin: e.parentOrigin,
|
|
2484
2492
|
theme: e.theme,
|
|
2485
2493
|
navigationMode: e.navigationMode,
|
|
2486
|
-
appendEmbedParams: (t) =>
|
|
2494
|
+
appendEmbedParams: (t) => Tr(t, e)
|
|
2487
2495
|
};
|
|
2488
2496
|
}
|
|
2489
|
-
function
|
|
2490
|
-
let n = d(() =>
|
|
2497
|
+
function Or({ children: e, query: t }) {
|
|
2498
|
+
let n = d(() => Dr(wr(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
|
|
2491
2499
|
return l(() => {
|
|
2492
|
-
|
|
2493
|
-
}, [n.enabled]), /* @__PURE__ */ b(
|
|
2500
|
+
le(n.enabled);
|
|
2501
|
+
}, [n.enabled]), /* @__PURE__ */ b(Er.Provider, {
|
|
2494
2502
|
value: n,
|
|
2495
2503
|
children: e
|
|
2496
2504
|
});
|
|
2497
2505
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return c(
|
|
2506
|
+
function kr() {
|
|
2507
|
+
return c(Er);
|
|
2500
2508
|
}
|
|
2501
2509
|
//#endregion
|
|
2502
2510
|
//#region src/embed/embed-dirty.ts
|
|
2503
|
-
var
|
|
2511
|
+
var Ar = E((e) => ({
|
|
2504
2512
|
isDirty: !1,
|
|
2505
2513
|
setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
|
|
2506
2514
|
}));
|
|
2507
|
-
function
|
|
2508
|
-
let n =
|
|
2515
|
+
function jr(e, t) {
|
|
2516
|
+
let n = Ar((e) => e.setDirty);
|
|
2509
2517
|
l(() => {
|
|
2510
2518
|
t && n(e);
|
|
2511
2519
|
}, [
|
|
@@ -2518,7 +2526,7 @@ function Ar(e, t) {
|
|
|
2518
2526
|
}
|
|
2519
2527
|
//#endregion
|
|
2520
2528
|
//#region src/embed/embed-nav-guard.ts
|
|
2521
|
-
var
|
|
2529
|
+
var Mr = E((e, t) => ({
|
|
2522
2530
|
pendingNavigation: null,
|
|
2523
2531
|
requestNavigation: (t) => e({ pendingNavigation: t }),
|
|
2524
2532
|
confirmNavigation: () => {
|
|
@@ -2529,18 +2537,18 @@ var jr = E((e, t) => ({
|
|
|
2529
2537
|
}));
|
|
2530
2538
|
//#endregion
|
|
2531
2539
|
//#region src/embed/screen-location.ts
|
|
2532
|
-
function
|
|
2540
|
+
function Nr(e) {
|
|
2533
2541
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2534
2542
|
return RegExp("^" + t.join("/") + "$");
|
|
2535
2543
|
}
|
|
2536
|
-
function
|
|
2544
|
+
function Pr(e, t) {
|
|
2537
2545
|
let n = e.replace(/\/+$/, "") || "/";
|
|
2538
2546
|
if (!t) return {
|
|
2539
2547
|
matched: !1,
|
|
2540
2548
|
payload: { route: e }
|
|
2541
2549
|
};
|
|
2542
2550
|
let r, i, a, o;
|
|
2543
|
-
for (let [e, s] of Object.entries(t)) if (s.route &&
|
|
2551
|
+
for (let [e, s] of Object.entries(t)) if (s.route && Nr(s.route).test(n)) {
|
|
2544
2552
|
if (s.route.includes("/:")) a || (a = s, o = e);
|
|
2545
2553
|
else {
|
|
2546
2554
|
r = s, i = e;
|
|
@@ -2567,34 +2575,34 @@ function Nr(e, t) {
|
|
|
2567
2575
|
payload: l
|
|
2568
2576
|
};
|
|
2569
2577
|
}
|
|
2570
|
-
function
|
|
2571
|
-
return
|
|
2578
|
+
function Fr(e, t) {
|
|
2579
|
+
return Pr(e, t).payload;
|
|
2572
2580
|
}
|
|
2573
2581
|
//#endregion
|
|
2574
2582
|
//#region src/embed/useEmbedNavigate.ts
|
|
2575
|
-
function
|
|
2583
|
+
function Ir(e) {
|
|
2576
2584
|
let t = e.search(/[?#]/);
|
|
2577
2585
|
return t === -1 ? e : e.slice(0, t);
|
|
2578
2586
|
}
|
|
2579
|
-
function
|
|
2580
|
-
let e = h(), t = m(), n =
|
|
2587
|
+
function Lr() {
|
|
2588
|
+
let e = h(), t = m(), n = kr(), { data: r } = X();
|
|
2581
2589
|
return s((i, a) => {
|
|
2582
2590
|
if (!n.enabled) return e(i, a), !0;
|
|
2583
|
-
let o = r?.screens, s =
|
|
2591
|
+
let o = r?.screens, s = Pr(Ir(i), o), c = Ar.getState().isDirty && Ir(i) !== t.pathname;
|
|
2584
2592
|
if (o && !s.matched) return wt(n.parentOrigin, Ct.navigationFailed, {
|
|
2585
|
-
route:
|
|
2593
|
+
route: Ir(i),
|
|
2586
2594
|
reason: "unresolved"
|
|
2587
2595
|
}), !1;
|
|
2588
2596
|
if (n.navigationMode === "delegated") {
|
|
2589
2597
|
let e = () => {
|
|
2590
2598
|
wt(n.parentOrigin, Ct.navigationRequested, s.payload);
|
|
2591
2599
|
};
|
|
2592
|
-
return c ? (
|
|
2600
|
+
return c ? (Mr.getState().requestNavigation(e), !1) : (e(), !1);
|
|
2593
2601
|
}
|
|
2594
2602
|
let l = () => {
|
|
2595
2603
|
e(n.appendEmbedParams(i), a);
|
|
2596
2604
|
};
|
|
2597
|
-
return c ? (
|
|
2605
|
+
return c ? (Mr.getState().requestNavigation(l), !1) : (l(), !0);
|
|
2598
2606
|
}, [
|
|
2599
2607
|
e,
|
|
2600
2608
|
t.pathname,
|
|
@@ -2602,27 +2610,27 @@ function Ir() {
|
|
|
2602
2610
|
r?.screens
|
|
2603
2611
|
]);
|
|
2604
2612
|
}
|
|
2605
|
-
function
|
|
2606
|
-
let e =
|
|
2613
|
+
function Rr() {
|
|
2614
|
+
let e = Lr();
|
|
2607
2615
|
return s((t, n) => {
|
|
2608
2616
|
e(t, n);
|
|
2609
2617
|
}, [e]);
|
|
2610
2618
|
}
|
|
2611
|
-
function
|
|
2619
|
+
function zr() {
|
|
2612
2620
|
let e = h();
|
|
2613
2621
|
return s(() => {
|
|
2614
2622
|
let t = () => {
|
|
2615
2623
|
e(-1);
|
|
2616
2624
|
};
|
|
2617
|
-
if (
|
|
2618
|
-
|
|
2625
|
+
if (Ar.getState().isDirty) {
|
|
2626
|
+
Mr.getState().requestNavigation(t);
|
|
2619
2627
|
return;
|
|
2620
2628
|
}
|
|
2621
2629
|
t();
|
|
2622
2630
|
}, [e]);
|
|
2623
2631
|
}
|
|
2624
|
-
function
|
|
2625
|
-
let e =
|
|
2632
|
+
function Br() {
|
|
2633
|
+
let e = kr();
|
|
2626
2634
|
return s((t, n) => {
|
|
2627
2635
|
e.enabled && wt(e.parentOrigin, Ct.navigationFailed, {
|
|
2628
2636
|
route: t,
|
|
@@ -2632,7 +2640,7 @@ function zr() {
|
|
|
2632
2640
|
}
|
|
2633
2641
|
//#endregion
|
|
2634
2642
|
//#region src/components/shared/toast/DeclarionToast.tsx
|
|
2635
|
-
var
|
|
2643
|
+
var Vr = {
|
|
2636
2644
|
success: {
|
|
2637
2645
|
tone: "success",
|
|
2638
2646
|
defaultTitle: "Success"
|
|
@@ -2653,8 +2661,8 @@ var Br = {
|
|
|
2653
2661
|
tone: "info",
|
|
2654
2662
|
defaultTitle: "Working…"
|
|
2655
2663
|
}
|
|
2656
|
-
},
|
|
2657
|
-
function
|
|
2664
|
+
}, Hr = 200;
|
|
2665
|
+
function Ur({ type: e }) {
|
|
2658
2666
|
let n = { display: "flex" };
|
|
2659
2667
|
if (e === "loading") return /* @__PURE__ */ b("span", {
|
|
2660
2668
|
style: {
|
|
@@ -2669,9 +2677,9 @@ function Hr({ type: e }) {
|
|
|
2669
2677
|
children: /* @__PURE__ */ b(r, { size: 11 })
|
|
2670
2678
|
});
|
|
2671
2679
|
}
|
|
2672
|
-
function
|
|
2673
|
-
let r =
|
|
2674
|
-
S.current || (S.current = !0, g(!0), window.setTimeout(n,
|
|
2680
|
+
function Wr({ model: e, onClose: n }) {
|
|
2681
|
+
let r = Vr[e.type] ?? Vr.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1), y = f(e.duration), S = f(!1), C = !e.sticky && e.duration > 0, w = s(() => {
|
|
2682
|
+
S.current || (S.current = !0, g(!0), window.setTimeout(n, Hr));
|
|
2675
2683
|
}, [n]);
|
|
2676
2684
|
l(() => {
|
|
2677
2685
|
y.current = e.duration, v(1);
|
|
@@ -2720,7 +2728,7 @@ function Ur({ model: e, onClose: n }) {
|
|
|
2720
2728
|
boxShadow: "var(--shadow-toast)",
|
|
2721
2729
|
overflow: "hidden",
|
|
2722
2730
|
position: "relative",
|
|
2723
|
-
animation: h ? `dz-toast-out ${
|
|
2731
|
+
animation: h ? `dz-toast-out ${Hr}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2724
2732
|
},
|
|
2725
2733
|
children: [/* @__PURE__ */ x("div", {
|
|
2726
2734
|
style: {
|
|
@@ -2742,7 +2750,7 @@ function Ur({ model: e, onClose: n }) {
|
|
|
2742
2750
|
justifyContent: "center",
|
|
2743
2751
|
color: E("")
|
|
2744
2752
|
},
|
|
2745
|
-
children: /* @__PURE__ */ b(
|
|
2753
|
+
children: /* @__PURE__ */ b(Ur, { type: e.type })
|
|
2746
2754
|
}),
|
|
2747
2755
|
/* @__PURE__ */ x("div", {
|
|
2748
2756
|
style: {
|
|
@@ -2935,40 +2943,40 @@ function Ur({ model: e, onClose: n }) {
|
|
|
2935
2943
|
}
|
|
2936
2944
|
//#endregion
|
|
2937
2945
|
//#region src/lib/toast.tsx
|
|
2938
|
-
var
|
|
2946
|
+
var Gr = {
|
|
2939
2947
|
success: 4e3,
|
|
2940
2948
|
info: 6e3,
|
|
2941
2949
|
warning: 8e3,
|
|
2942
2950
|
error: 0,
|
|
2943
2951
|
loading: 0
|
|
2944
|
-
},
|
|
2945
|
-
function
|
|
2946
|
-
v.custom(() => /* @__PURE__ */ b(
|
|
2952
|
+
}, Kr = /* @__PURE__ */ new Map(), qr = /* @__PURE__ */ new Map(), Jr = 0, Yr = () => `dz-${++Jr}`;
|
|
2953
|
+
function Xr(e) {
|
|
2954
|
+
v.custom(() => /* @__PURE__ */ b(Wr, {
|
|
2947
2955
|
model: e,
|
|
2948
2956
|
onClose: () => v.dismiss(e.id)
|
|
2949
2957
|
}), {
|
|
2950
2958
|
id: e.id,
|
|
2951
2959
|
duration: Infinity,
|
|
2952
2960
|
onDismiss: () => {
|
|
2953
|
-
|
|
2961
|
+
Kr.delete(String(e.id)), e.group && qr.get(e.group) === e.id && qr.delete(e.group);
|
|
2954
2962
|
}
|
|
2955
2963
|
});
|
|
2956
2964
|
}
|
|
2957
|
-
function
|
|
2965
|
+
function Zr(e, t, n, r = {}) {
|
|
2958
2966
|
if (r.group) {
|
|
2959
|
-
let e =
|
|
2960
|
-
if (e &&
|
|
2961
|
-
let r =
|
|
2967
|
+
let e = qr.get(r.group);
|
|
2968
|
+
if (e && Kr.has(e)) {
|
|
2969
|
+
let r = Kr.get(e), i = {
|
|
2962
2970
|
...r,
|
|
2963
2971
|
title: t,
|
|
2964
2972
|
message: n,
|
|
2965
2973
|
count: (r.count ?? 1) + 1,
|
|
2966
2974
|
createdAt: Date.now()
|
|
2967
2975
|
};
|
|
2968
|
-
return
|
|
2976
|
+
return Kr.set(e, i), Xr(i), e;
|
|
2969
2977
|
}
|
|
2970
2978
|
}
|
|
2971
|
-
let i = r.id ??
|
|
2979
|
+
let i = r.id ?? Yr(), a = r.duration ?? Gr[e], o = {
|
|
2972
2980
|
id: i,
|
|
2973
2981
|
type: e,
|
|
2974
2982
|
title: t,
|
|
@@ -2982,12 +2990,12 @@ function Xr(e, t, n, r = {}) {
|
|
|
2982
2990
|
createdAt: Date.now(),
|
|
2983
2991
|
group: r.group
|
|
2984
2992
|
};
|
|
2985
|
-
return
|
|
2993
|
+
return Kr.set(i, o), r.group && qr.set(r.group, i), Xr(o), i;
|
|
2986
2994
|
}
|
|
2987
|
-
function
|
|
2988
|
-
let n =
|
|
2995
|
+
function Qr(e, t) {
|
|
2996
|
+
let n = Kr.get(e);
|
|
2989
2997
|
if (!n) return;
|
|
2990
|
-
let r = t.type ?? n.type, i = t.duration ?? (t.type ?
|
|
2998
|
+
let r = t.type ?? n.type, i = t.duration ?? (t.type ? Gr[r] : n.duration), a = {
|
|
2991
2999
|
...n,
|
|
2992
3000
|
...t,
|
|
2993
3001
|
type: r,
|
|
@@ -2995,48 +3003,48 @@ function Zr(e, t) {
|
|
|
2995
3003
|
sticky: t.sticky ?? i === 0,
|
|
2996
3004
|
createdAt: Date.now()
|
|
2997
3005
|
};
|
|
2998
|
-
|
|
3006
|
+
Kr.set(e, a), Xr(a);
|
|
2999
3007
|
}
|
|
3000
3008
|
var Z = {
|
|
3001
|
-
success: (e, t, n) =>
|
|
3002
|
-
info: (e, t, n) =>
|
|
3003
|
-
warning: (e, t, n) =>
|
|
3004
|
-
error: (e, t, n) =>
|
|
3005
|
-
loading: (e, t, n) =>
|
|
3006
|
-
update:
|
|
3009
|
+
success: (e, t, n) => Zr("success", e, t, n),
|
|
3010
|
+
info: (e, t, n) => Zr("info", e, t, n),
|
|
3011
|
+
warning: (e, t, n) => Zr("warning", e, t, n),
|
|
3012
|
+
error: (e, t, n) => Zr("error", e, t, n),
|
|
3013
|
+
loading: (e, t, n) => Zr("loading", e, t, n),
|
|
3014
|
+
update: Qr,
|
|
3007
3015
|
dismiss: (e) => v.dismiss(e),
|
|
3008
3016
|
dismissAll: () => v.dismiss()
|
|
3009
|
-
},
|
|
3010
|
-
function
|
|
3017
|
+
}, $r = o(() => import("./MarkdownRenderer-Sb7zcvj0.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
3018
|
+
function ei() {
|
|
3011
3019
|
return /* @__PURE__ */ b("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
3012
3020
|
}
|
|
3013
|
-
function
|
|
3021
|
+
function ti(e) {
|
|
3014
3022
|
return /* @__PURE__ */ b(r, {
|
|
3015
|
-
fallback: /* @__PURE__ */ b(
|
|
3016
|
-
children: /* @__PURE__ */ b(
|
|
3023
|
+
fallback: /* @__PURE__ */ b(ei, {}),
|
|
3024
|
+
children: /* @__PURE__ */ b($r, { ...e })
|
|
3017
3025
|
});
|
|
3018
3026
|
}
|
|
3019
3027
|
//#endregion
|
|
3020
3028
|
//#region src/lib/safe-url.ts
|
|
3021
|
-
var
|
|
3029
|
+
var ni = [
|
|
3022
3030
|
"http:",
|
|
3023
3031
|
"https:",
|
|
3024
3032
|
"mailto:"
|
|
3025
|
-
],
|
|
3026
|
-
function
|
|
3033
|
+
], ri = /[\u0000-\u001f\u007f]/g;
|
|
3034
|
+
function ii(e) {
|
|
3027
3035
|
if (!e) return;
|
|
3028
3036
|
let t = e.trim();
|
|
3029
3037
|
if (!t) return;
|
|
3030
|
-
let n = t.replace(
|
|
3038
|
+
let n = t.replace(ri, "");
|
|
3031
3039
|
if (!n || n.startsWith("//")) return;
|
|
3032
3040
|
let r = n.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
3033
3041
|
if (r) {
|
|
3034
3042
|
let e = r[1].toLowerCase() + ":";
|
|
3035
|
-
if (!
|
|
3043
|
+
if (!ni.includes(e)) return;
|
|
3036
3044
|
}
|
|
3037
3045
|
return n;
|
|
3038
3046
|
}
|
|
3039
|
-
function
|
|
3047
|
+
function ai(e) {
|
|
3040
3048
|
if (!e) return !1;
|
|
3041
3049
|
if (e.startsWith("//")) return !0;
|
|
3042
3050
|
let t = typeof window < "u" ? window.location.href : "http://localhost/", n;
|
|
@@ -3051,27 +3059,27 @@ function ii(e) {
|
|
|
3051
3059
|
}
|
|
3052
3060
|
//#endregion
|
|
3053
3061
|
//#region src/lib/download.ts
|
|
3054
|
-
var
|
|
3062
|
+
var oi = class extends Error {
|
|
3055
3063
|
code;
|
|
3056
3064
|
constructor(e, t) {
|
|
3057
3065
|
super(e), this.code = t, this.name = "DownloadError";
|
|
3058
3066
|
}
|
|
3059
3067
|
};
|
|
3060
|
-
function
|
|
3061
|
-
return e instanceof
|
|
3068
|
+
function si(e) {
|
|
3069
|
+
return e instanceof oi && e.code === "FILE_NOT_FOUND";
|
|
3062
3070
|
}
|
|
3063
|
-
async function
|
|
3064
|
-
let n =
|
|
3065
|
-
if (!n) throw new
|
|
3071
|
+
async function ci(e, t) {
|
|
3072
|
+
let n = ii(e);
|
|
3073
|
+
if (!n) throw new oi(`Refused to download from an unsafe URL: ${e}`);
|
|
3066
3074
|
let r = await fetch(n, { credentials: "same-origin" });
|
|
3067
3075
|
if (!r.ok) {
|
|
3068
|
-
let e = await
|
|
3069
|
-
throw new
|
|
3076
|
+
let e = await li(r);
|
|
3077
|
+
throw new oi(e.message || `Download failed (${r.status})`, e.code);
|
|
3070
3078
|
}
|
|
3071
3079
|
let i = await r.blob(), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
3072
3080
|
o.href = a, t && (o.download = t), document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(a);
|
|
3073
3081
|
}
|
|
3074
|
-
async function
|
|
3082
|
+
async function li(e) {
|
|
3075
3083
|
let t = await e.text();
|
|
3076
3084
|
if (!t) return {};
|
|
3077
3085
|
try {
|
|
@@ -3089,10 +3097,10 @@ async function ci(e) {
|
|
|
3089
3097
|
}
|
|
3090
3098
|
//#endregion
|
|
3091
3099
|
//#region src/types/fieldType.ts
|
|
3092
|
-
var
|
|
3100
|
+
var ui = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
3093
3101
|
//#endregion
|
|
3094
3102
|
//#region src/components/shared/CopyButton.tsx
|
|
3095
|
-
function
|
|
3103
|
+
function di({ value: e, title: n, size: r = "icon" }) {
|
|
3096
3104
|
let [i, a] = p(!1), o = s(async (t) => {
|
|
3097
3105
|
t.stopPropagation(), t.preventDefault();
|
|
3098
3106
|
try {
|
|
@@ -3111,7 +3119,7 @@ function ui({ value: e, title: n, size: r = "icon" }) {
|
|
|
3111
3119
|
}
|
|
3112
3120
|
//#endregion
|
|
3113
3121
|
//#region src/components/fields/StringField.tsx
|
|
3114
|
-
function
|
|
3122
|
+
function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3115
3123
|
if (r === "display") {
|
|
3116
3124
|
let t = R(n);
|
|
3117
3125
|
return e.copyable && t ? /* @__PURE__ */ x("span", {
|
|
@@ -3123,7 +3131,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3123
3131
|
children: [/* @__PURE__ */ b("span", {
|
|
3124
3132
|
style: { fontSize: 12.5 },
|
|
3125
3133
|
children: t
|
|
3126
|
-
}), /* @__PURE__ */ b(
|
|
3134
|
+
}), /* @__PURE__ */ b(di, {
|
|
3127
3135
|
value: t,
|
|
3128
3136
|
size: "sm"
|
|
3129
3137
|
})]
|
|
@@ -3145,7 +3153,7 @@ function di({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3145
3153
|
}
|
|
3146
3154
|
//#endregion
|
|
3147
3155
|
//#region src/components/fields/TextField.tsx
|
|
3148
|
-
function
|
|
3156
|
+
function pi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
|
|
3149
3157
|
let c = e.display?.widget;
|
|
3150
3158
|
if (r === "display") {
|
|
3151
3159
|
let t = R(n);
|
|
@@ -3156,7 +3164,7 @@ function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3156
3164
|
},
|
|
3157
3165
|
children: "—"
|
|
3158
3166
|
});
|
|
3159
|
-
let r = c === "markdown" ? /* @__PURE__ */ b(
|
|
3167
|
+
let r = c === "markdown" ? /* @__PURE__ */ b(ti, { content: t }) : c === "code" ? /* @__PURE__ */ b("pre", {
|
|
3160
3168
|
className: "mono",
|
|
3161
3169
|
style: {
|
|
3162
3170
|
fontSize: 12,
|
|
@@ -3188,7 +3196,7 @@ function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3188
3196
|
top: 0,
|
|
3189
3197
|
right: 0
|
|
3190
3198
|
},
|
|
3191
|
-
children: /* @__PURE__ */ b(
|
|
3199
|
+
children: /* @__PURE__ */ b(di, {
|
|
3192
3200
|
value: t,
|
|
3193
3201
|
size: "sm"
|
|
3194
3202
|
})
|
|
@@ -3203,7 +3211,7 @@ function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3203
3211
|
onChange: (e) => i?.(e)
|
|
3204
3212
|
});
|
|
3205
3213
|
let l = c === "markdown" || c === "code" ? 10 : 4;
|
|
3206
|
-
return /* @__PURE__ */ b(
|
|
3214
|
+
return /* @__PURE__ */ b(Te, {
|
|
3207
3215
|
id: s,
|
|
3208
3216
|
name: t,
|
|
3209
3217
|
ariaRequired: e.required,
|
|
@@ -3215,10 +3223,10 @@ function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
3215
3223
|
}
|
|
3216
3224
|
//#endregion
|
|
3217
3225
|
//#region src/components/fields/EnumField.tsx
|
|
3218
|
-
var
|
|
3219
|
-
function
|
|
3226
|
+
var mi = "__declarion_enum_null__";
|
|
3227
|
+
function hi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
|
|
3220
3228
|
let o = e.values ?? [], s = o.find((e) => e.code === t);
|
|
3221
|
-
if (n === "display") return s ? /* @__PURE__ */ b(
|
|
3229
|
+
if (n === "display") return s ? /* @__PURE__ */ b(A, {
|
|
3222
3230
|
tone: s.color ?? "slate",
|
|
3223
3231
|
size: "xs",
|
|
3224
3232
|
children: z(s.name)
|
|
@@ -3229,8 +3237,8 @@ function mi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
3229
3237
|
},
|
|
3230
3238
|
children: "—"
|
|
3231
3239
|
});
|
|
3232
|
-
let c = !e.required, l = t != null && t !== "" ? R(t) :
|
|
3233
|
-
value:
|
|
3240
|
+
let c = !e.required, l = t != null && t !== "" ? R(t) : mi, u = [...c ? [{
|
|
3241
|
+
value: mi,
|
|
3234
3242
|
label: "— None —"
|
|
3235
3243
|
}] : [], ...o.map((e) => ({
|
|
3236
3244
|
value: e.code,
|
|
@@ -3242,13 +3250,13 @@ function mi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
3242
3250
|
"aria-required": e.required || void 0,
|
|
3243
3251
|
value: l,
|
|
3244
3252
|
options: u,
|
|
3245
|
-
onChange: (e) => r?.(e ===
|
|
3253
|
+
onChange: (e) => r?.(e === mi ? null : e),
|
|
3246
3254
|
placeholder: "Select…"
|
|
3247
3255
|
});
|
|
3248
3256
|
}
|
|
3249
3257
|
//#endregion
|
|
3250
3258
|
//#region src/components/fields/EmailField.tsx
|
|
3251
|
-
function
|
|
3259
|
+
function gi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3252
3260
|
return /* @__PURE__ */ b(F, {
|
|
3253
3261
|
id: i,
|
|
3254
3262
|
name: t,
|
|
@@ -3260,7 +3268,7 @@ function hi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
3260
3268
|
}
|
|
3261
3269
|
//#endregion
|
|
3262
3270
|
//#region src/components/fields/UrlField.tsx
|
|
3263
|
-
function
|
|
3271
|
+
function _i({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3264
3272
|
return /* @__PURE__ */ b(F, {
|
|
3265
3273
|
id: i,
|
|
3266
3274
|
name: t,
|
|
@@ -3273,7 +3281,7 @@ function gi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
3273
3281
|
}
|
|
3274
3282
|
//#endregion
|
|
3275
3283
|
//#region src/components/fields/PhoneField.tsx
|
|
3276
|
-
function
|
|
3284
|
+
function vi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
3277
3285
|
return /* @__PURE__ */ b(F, {
|
|
3278
3286
|
id: i,
|
|
3279
3287
|
name: t,
|
|
@@ -3286,23 +3294,23 @@ function _i({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
3286
3294
|
}
|
|
3287
3295
|
//#endregion
|
|
3288
3296
|
//#region src/components/fields/TimestampField.tsx
|
|
3289
|
-
var
|
|
3297
|
+
var yi = {
|
|
3290
3298
|
year: "numeric",
|
|
3291
3299
|
month: "short",
|
|
3292
3300
|
day: "numeric"
|
|
3293
|
-
},
|
|
3294
|
-
...
|
|
3301
|
+
}, bi = {
|
|
3302
|
+
...yi,
|
|
3295
3303
|
hour: "2-digit",
|
|
3296
3304
|
minute: "2-digit"
|
|
3297
3305
|
};
|
|
3298
|
-
function
|
|
3306
|
+
function xi(e, t) {
|
|
3299
3307
|
if (t) {
|
|
3300
3308
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3301
|
-
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0,
|
|
3309
|
+
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, yi).format(t);
|
|
3302
3310
|
}
|
|
3303
|
-
return
|
|
3311
|
+
return Ve(e, bi);
|
|
3304
3312
|
}
|
|
3305
|
-
function
|
|
3313
|
+
function Si(e, t) {
|
|
3306
3314
|
if (t) {
|
|
3307
3315
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3308
3316
|
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
|
|
@@ -3320,14 +3328,14 @@ function xi(e, t) {
|
|
|
3320
3328
|
minute: "2-digit"
|
|
3321
3329
|
}).format(n);
|
|
3322
3330
|
}
|
|
3323
|
-
function
|
|
3331
|
+
function Ci(e) {
|
|
3324
3332
|
if (e.endsWith("Z")) return "UTC";
|
|
3325
3333
|
let t = e.match(/([+-]\d{2}:\d{2})$/);
|
|
3326
3334
|
if (!t) return null;
|
|
3327
3335
|
let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
3328
3336
|
return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
|
|
3329
3337
|
}
|
|
3330
|
-
function
|
|
3338
|
+
function wi(e, t) {
|
|
3331
3339
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
3332
3340
|
if (isNaN(i.getTime())) return "";
|
|
3333
3341
|
if (r) {
|
|
@@ -3340,13 +3348,13 @@ function Ci(e, t) {
|
|
|
3340
3348
|
}
|
|
3341
3349
|
return t ? e.slice(0, 10) : e.slice(0, 16);
|
|
3342
3350
|
}
|
|
3343
|
-
function
|
|
3351
|
+
function Ti(e, t) {
|
|
3344
3352
|
let n = new Date(e);
|
|
3345
3353
|
if (isNaN(n.getTime())) return "";
|
|
3346
3354
|
let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
|
|
3347
3355
|
return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
|
|
3348
3356
|
}
|
|
3349
|
-
function
|
|
3357
|
+
function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3350
3358
|
let o = e.type === "date", s = !!e.timezone;
|
|
3351
3359
|
if (r === "display") {
|
|
3352
3360
|
if (!n) return /* @__PURE__ */ b("span", {
|
|
@@ -3356,7 +3364,7 @@ function Ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3356
3364
|
},
|
|
3357
3365
|
children: "—"
|
|
3358
3366
|
});
|
|
3359
|
-
let e = R(n), t = s ?
|
|
3367
|
+
let e = R(n), t = s ? xi(e, o) : Si(e, o), r = s && !o ? Ci(e) : null;
|
|
3360
3368
|
return /* @__PURE__ */ x("span", {
|
|
3361
3369
|
style: { fontSize: 12.5 },
|
|
3362
3370
|
children: [t, r && /* @__PURE__ */ b("span", {
|
|
@@ -3368,7 +3376,7 @@ function Ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3368
3376
|
})]
|
|
3369
3377
|
});
|
|
3370
3378
|
}
|
|
3371
|
-
let c = n ? s ?
|
|
3379
|
+
let c = n ? s ? wi(R(n), o) : Ti(R(n), o) : "";
|
|
3372
3380
|
return /* @__PURE__ */ b(F, {
|
|
3373
3381
|
id: a,
|
|
3374
3382
|
name: t,
|
|
@@ -3389,13 +3397,13 @@ function Ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3389
3397
|
i?.(e);
|
|
3390
3398
|
return;
|
|
3391
3399
|
}
|
|
3392
|
-
i?.(
|
|
3400
|
+
i?.(Be(t));
|
|
3393
3401
|
}
|
|
3394
3402
|
});
|
|
3395
3403
|
}
|
|
3396
3404
|
//#endregion
|
|
3397
3405
|
//#region src/components/fields/BoolField.tsx
|
|
3398
|
-
function
|
|
3406
|
+
function Di({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
3399
3407
|
let a = !!e;
|
|
3400
3408
|
return t === "display" ? /* @__PURE__ */ x("span", {
|
|
3401
3409
|
style: {
|
|
@@ -3411,7 +3419,7 @@ function Ei({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3411
3419
|
borderRadius: 999,
|
|
3412
3420
|
background: a ? "var(--success)" : "var(--text-4)"
|
|
3413
3421
|
} }), a ? "Yes" : "No"]
|
|
3414
|
-
}) : /* @__PURE__ */ b(
|
|
3422
|
+
}) : /* @__PURE__ */ b(be, {
|
|
3415
3423
|
id: r,
|
|
3416
3424
|
ariaLabelledby: i,
|
|
3417
3425
|
value: a,
|
|
@@ -3420,7 +3428,7 @@ function Ei({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3420
3428
|
}
|
|
3421
3429
|
//#endregion
|
|
3422
3430
|
//#region src/components/fields/NumberField.tsx
|
|
3423
|
-
function
|
|
3431
|
+
function Oi(e) {
|
|
3424
3432
|
let t = e.trim();
|
|
3425
3433
|
if (t === "" || t === "-") return t;
|
|
3426
3434
|
let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
|
|
@@ -3432,8 +3440,8 @@ function Di(e) {
|
|
|
3432
3440
|
let o = n ? `-${a}` : a;
|
|
3433
3441
|
return i !== void 0 && (o += `.${i}`), o;
|
|
3434
3442
|
}
|
|
3435
|
-
var
|
|
3436
|
-
function
|
|
3443
|
+
var ki = new Intl.NumberFormat();
|
|
3444
|
+
function Ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3437
3445
|
let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
|
|
3438
3446
|
if (r === "display") {
|
|
3439
3447
|
if (n == null) return /* @__PURE__ */ b("span", {
|
|
@@ -3444,10 +3452,10 @@ function ki({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3444
3452
|
children: "—"
|
|
3445
3453
|
});
|
|
3446
3454
|
let e;
|
|
3447
|
-
if (c && typeof n == "string") e =
|
|
3455
|
+
if (c && typeof n == "string") e = Oi(n);
|
|
3448
3456
|
else {
|
|
3449
3457
|
let t = Number(n);
|
|
3450
|
-
e = isNaN(t) ? null :
|
|
3458
|
+
e = isNaN(t) ? null : ki.format(t);
|
|
3451
3459
|
}
|
|
3452
3460
|
return e == null ? /* @__PURE__ */ b("span", {
|
|
3453
3461
|
style: { fontSize: 12.5 },
|
|
@@ -3492,7 +3500,7 @@ function ki({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3492
3500
|
}
|
|
3493
3501
|
//#endregion
|
|
3494
3502
|
//#region src/hooks/useEntityData.ts
|
|
3495
|
-
function
|
|
3503
|
+
function ji(e, t) {
|
|
3496
3504
|
return [
|
|
3497
3505
|
"entity-data",
|
|
3498
3506
|
e,
|
|
@@ -3502,16 +3510,16 @@ function Ai(e, t) {
|
|
|
3502
3510
|
}
|
|
3503
3511
|
];
|
|
3504
3512
|
}
|
|
3505
|
-
function
|
|
3506
|
-
let r =
|
|
3513
|
+
function Mi(e, t, n = !0) {
|
|
3514
|
+
let r = ji(e, t), i = r[2];
|
|
3507
3515
|
return g({
|
|
3508
3516
|
queryKey: r,
|
|
3509
|
-
queryFn: ({ signal: t }) =>
|
|
3517
|
+
queryFn: ({ signal: t }) => Zn(e, i, { signal: t }),
|
|
3510
3518
|
enabled: !!e && n,
|
|
3511
3519
|
placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
|
|
3512
3520
|
});
|
|
3513
3521
|
}
|
|
3514
|
-
function
|
|
3522
|
+
function Ni(e, t, n = !0) {
|
|
3515
3523
|
let r = {
|
|
3516
3524
|
...t,
|
|
3517
3525
|
count: "only",
|
|
@@ -3527,7 +3535,7 @@ function Mi(e, t, n = !0) {
|
|
|
3527
3535
|
e,
|
|
3528
3536
|
r
|
|
3529
3537
|
],
|
|
3530
|
-
queryFn: ({ signal: t }) =>
|
|
3538
|
+
queryFn: ({ signal: t }) => Zn(e, r, { signal: t }),
|
|
3531
3539
|
enabled: !!e && n,
|
|
3532
3540
|
retry: 1,
|
|
3533
3541
|
staleTime: 3e4,
|
|
@@ -3536,7 +3544,7 @@ function Mi(e, t, n = !0) {
|
|
|
3536
3544
|
}
|
|
3537
3545
|
//#endregion
|
|
3538
3546
|
//#region src/hooks/useDebounce.ts
|
|
3539
|
-
function
|
|
3547
|
+
function Pi(e, t) {
|
|
3540
3548
|
let [n, r] = p(e);
|
|
3541
3549
|
return l(() => {
|
|
3542
3550
|
let n = setTimeout(() => r(e), t);
|
|
@@ -3545,16 +3553,16 @@ function Ni(e, t) {
|
|
|
3545
3553
|
}
|
|
3546
3554
|
//#endregion
|
|
3547
3555
|
//#region src/hooks/useEntity.ts
|
|
3548
|
-
function
|
|
3556
|
+
function Fi(e) {
|
|
3549
3557
|
let { data: t } = X();
|
|
3550
3558
|
if (!(!t || !e)) return t.entities[e];
|
|
3551
3559
|
}
|
|
3552
3560
|
//#endregion
|
|
3553
3561
|
//#region src/components/fields/RefCombobox.tsx
|
|
3554
|
-
var
|
|
3555
|
-
function
|
|
3556
|
-
let m = e?.entity, h =
|
|
3557
|
-
per_page:
|
|
3562
|
+
var Ii = 200;
|
|
3563
|
+
function Li({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: u }) {
|
|
3564
|
+
let m = e?.entity, h = Fi(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ? V(h)[0] ?? "id" : "id", [h]), v = e?.field || _, [y, x] = p(""), S = Pi(y, 300), { data: C, isLoading: w } = Mi(m, {
|
|
3565
|
+
per_page: Ii,
|
|
3558
3566
|
sort: g ? `${g}:asc` : void 0,
|
|
3559
3567
|
search: S || void 0,
|
|
3560
3568
|
filters: e?.options_filter
|
|
@@ -3562,7 +3570,7 @@ function Ii({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3562
3570
|
T,
|
|
3563
3571
|
v,
|
|
3564
3572
|
E
|
|
3565
|
-
]), O = r && m ? r[m]?.[E] : void 0, k = !!u?.some((e) => e.code === E), { data: A } =
|
|
3573
|
+
]), O = r && m ? r[m]?.[E] : void 0, k = !!u?.some((e) => e.code === E), { data: A } = Mi(E && !D && !k && !O && !w ? m : void 0, {
|
|
3566
3574
|
per_page: 1,
|
|
3567
3575
|
filters: [{
|
|
3568
3576
|
field: v,
|
|
@@ -3572,13 +3580,13 @@ function Ii({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3572
3580
|
}), j = f(null), M = d(() => {
|
|
3573
3581
|
if (!E) return "";
|
|
3574
3582
|
let e;
|
|
3575
|
-
if (O) e =
|
|
3583
|
+
if (O) e = B(O, g, E);
|
|
3576
3584
|
else {
|
|
3577
3585
|
let t = T.find((e) => String(e[v]) === E);
|
|
3578
|
-
if (t) e =
|
|
3586
|
+
if (t) e = B(t, g, E);
|
|
3579
3587
|
else {
|
|
3580
3588
|
let t = A?.data?.find((e) => String(e[v]) === E);
|
|
3581
|
-
t && (e =
|
|
3589
|
+
t && (e = B(t, g, E));
|
|
3582
3590
|
}
|
|
3583
3591
|
}
|
|
3584
3592
|
return e === void 0 ? j.current?.value === E ? j.current.label : E : (j.current = {
|
|
@@ -3600,7 +3608,7 @@ function Ii({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3600
3608
|
let t = R(e[v]);
|
|
3601
3609
|
return {
|
|
3602
3610
|
value: t,
|
|
3603
|
-
label:
|
|
3611
|
+
label: B(e, g, t)
|
|
3604
3612
|
};
|
|
3605
3613
|
}), n = E && !D && !k ? [{
|
|
3606
3614
|
value: E,
|
|
@@ -3649,13 +3657,13 @@ function Ii({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3649
3657
|
}
|
|
3650
3658
|
//#endregion
|
|
3651
3659
|
//#region src/components/fields/RefField.tsx
|
|
3652
|
-
function
|
|
3660
|
+
function Ri({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
|
|
3653
3661
|
let s = e.ref?.entity, c = e.display?.ref_display_field || "$display", l = d(() => {
|
|
3654
3662
|
if (t == null) return "—";
|
|
3655
3663
|
let e = R(t);
|
|
3656
3664
|
if (i && s) {
|
|
3657
3665
|
let t = i[s]?.[e];
|
|
3658
|
-
if (t) return
|
|
3666
|
+
if (t) return B(t, c, e);
|
|
3659
3667
|
}
|
|
3660
3668
|
return e;
|
|
3661
3669
|
}, [
|
|
@@ -3667,7 +3675,7 @@ function Li({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3667
3675
|
return n === "display" ? /* @__PURE__ */ b("span", {
|
|
3668
3676
|
style: { fontSize: 12.5 },
|
|
3669
3677
|
children: l
|
|
3670
|
-
}) : /* @__PURE__ */ b(
|
|
3678
|
+
}) : /* @__PURE__ */ b(Li, {
|
|
3671
3679
|
ref: e.ref,
|
|
3672
3680
|
value: t,
|
|
3673
3681
|
onChange: (e) => r?.(e),
|
|
@@ -3680,29 +3688,29 @@ function Li({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3680
3688
|
}
|
|
3681
3689
|
//#endregion
|
|
3682
3690
|
//#region src/components/fields/JsonField.tsx
|
|
3683
|
-
var
|
|
3684
|
-
function
|
|
3691
|
+
var zi = o(() => import("./JsonEditor-DoNmyrYd.js").then((e) => ({ default: e.JsonEditor })));
|
|
3692
|
+
function Bi() {
|
|
3685
3693
|
return /* @__PURE__ */ b("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3686
3694
|
}
|
|
3687
|
-
function
|
|
3695
|
+
function Vi(e) {
|
|
3688
3696
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
3689
3697
|
}
|
|
3690
|
-
function
|
|
3691
|
-
return t === "display" ?
|
|
3698
|
+
function Hi({ value: e, mode: t, onChange: n, fieldId: i }) {
|
|
3699
|
+
return t === "display" ? Vi(e) ? /* @__PURE__ */ b("span", {
|
|
3692
3700
|
style: {
|
|
3693
3701
|
fontSize: 12.5,
|
|
3694
3702
|
color: "var(--text-4)"
|
|
3695
3703
|
},
|
|
3696
3704
|
children: "—"
|
|
3697
3705
|
}) : /* @__PURE__ */ b(r, {
|
|
3698
|
-
fallback: /* @__PURE__ */ b(
|
|
3699
|
-
children: /* @__PURE__ */ b(
|
|
3706
|
+
fallback: /* @__PURE__ */ b(Bi, {}),
|
|
3707
|
+
children: /* @__PURE__ */ b(zi, {
|
|
3700
3708
|
value: e,
|
|
3701
3709
|
readOnly: !0
|
|
3702
3710
|
})
|
|
3703
3711
|
}) : /* @__PURE__ */ b(r, {
|
|
3704
|
-
fallback: /* @__PURE__ */ b(
|
|
3705
|
-
children: /* @__PURE__ */ b(
|
|
3712
|
+
fallback: /* @__PURE__ */ b(Bi, {}),
|
|
3713
|
+
children: /* @__PURE__ */ b(zi, {
|
|
3706
3714
|
value: e,
|
|
3707
3715
|
onChange: n,
|
|
3708
3716
|
id: i
|
|
@@ -3711,14 +3719,14 @@ function Vi({ value: e, mode: t, onChange: n, fieldId: i }) {
|
|
|
3711
3719
|
}
|
|
3712
3720
|
//#endregion
|
|
3713
3721
|
//#region src/components/fields/MultilangField.tsx
|
|
3714
|
-
function
|
|
3722
|
+
function Ui(e) {
|
|
3715
3723
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3716
3724
|
}
|
|
3717
|
-
function
|
|
3725
|
+
function Wi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3718
3726
|
let { data: o } = X(), s = o?.languages?.length ? o.languages : [{
|
|
3719
3727
|
code: "en",
|
|
3720
3728
|
name: { en: "English" }
|
|
3721
|
-
}], c =
|
|
3729
|
+
}], c = Ui(n);
|
|
3722
3730
|
if (r === "display") {
|
|
3723
3731
|
let e = Object.values(c)[0] ?? "—";
|
|
3724
3732
|
return /* @__PURE__ */ b("span", {
|
|
@@ -3777,14 +3785,14 @@ function Ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3777
3785
|
}
|
|
3778
3786
|
//#endregion
|
|
3779
3787
|
//#region src/components/fields/MultilangTextField.tsx
|
|
3780
|
-
function
|
|
3788
|
+
function Gi(e) {
|
|
3781
3789
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3782
3790
|
}
|
|
3783
|
-
function
|
|
3791
|
+
function Ki({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3784
3792
|
let { data: o } = X(), s = o?.languages?.length ? o.languages : [{
|
|
3785
3793
|
code: "en",
|
|
3786
3794
|
name: { en: "English" }
|
|
3787
|
-
}], c =
|
|
3795
|
+
}], c = Gi(n);
|
|
3788
3796
|
if (r === "display") {
|
|
3789
3797
|
let e = Object.values(c)[0] ?? "—";
|
|
3790
3798
|
return /* @__PURE__ */ b("p", {
|
|
@@ -3828,7 +3836,7 @@ function Gi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3828
3836
|
fontWeight: 500
|
|
3829
3837
|
},
|
|
3830
3838
|
children: n.code
|
|
3831
|
-
}), /* @__PURE__ */ b(
|
|
3839
|
+
}), /* @__PURE__ */ b(Te, {
|
|
3832
3840
|
id: i,
|
|
3833
3841
|
name: t ? `${t}.${n.code}` : void 0,
|
|
3834
3842
|
ariaRequired: e.required && r === 0,
|
|
@@ -3843,25 +3851,25 @@ function Gi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3843
3851
|
}
|
|
3844
3852
|
//#endregion
|
|
3845
3853
|
//#region src/components/fields/StructureField.tsx
|
|
3846
|
-
function
|
|
3854
|
+
function qi(e) {
|
|
3847
3855
|
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = X(), c = t.structure ? s?.structures?.[t.structure] : void 0;
|
|
3848
|
-
return c ? t.array ? /* @__PURE__ */ b(
|
|
3856
|
+
return c ? t.array ? /* @__PURE__ */ b(Yi, {
|
|
3849
3857
|
structDef: c,
|
|
3850
3858
|
value: n,
|
|
3851
3859
|
mode: r,
|
|
3852
3860
|
onChange: i,
|
|
3853
3861
|
locale: a,
|
|
3854
3862
|
fieldId: o
|
|
3855
|
-
}) : /* @__PURE__ */ b(
|
|
3863
|
+
}) : /* @__PURE__ */ b(Ji, {
|
|
3856
3864
|
structDef: c,
|
|
3857
3865
|
value: n,
|
|
3858
3866
|
mode: r,
|
|
3859
3867
|
onChange: i,
|
|
3860
3868
|
locale: a,
|
|
3861
3869
|
fieldId: o
|
|
3862
|
-
}) : /* @__PURE__ */ b(
|
|
3870
|
+
}) : /* @__PURE__ */ b(Hi, { ...e });
|
|
3863
3871
|
}
|
|
3864
|
-
function
|
|
3872
|
+
function Ji({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
|
|
3865
3873
|
let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
|
|
3866
3874
|
display: "flex",
|
|
3867
3875
|
flexDirection: "column",
|
|
@@ -3897,13 +3905,13 @@ function qi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3897
3905
|
minWidth: 0,
|
|
3898
3906
|
flex: 1
|
|
3899
3907
|
},
|
|
3900
|
-
children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(
|
|
3908
|
+
children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(qi, {
|
|
3901
3909
|
field: n,
|
|
3902
3910
|
fieldName: t,
|
|
3903
3911
|
value: r,
|
|
3904
3912
|
mode: "display",
|
|
3905
3913
|
locale: i
|
|
3906
|
-
}) :
|
|
3914
|
+
}) : _s({
|
|
3907
3915
|
field: n,
|
|
3908
3916
|
fieldName: t,
|
|
3909
3917
|
value: r,
|
|
@@ -3938,17 +3946,17 @@ function qi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3938
3946
|
flexDirection: "column",
|
|
3939
3947
|
gap: 2
|
|
3940
3948
|
},
|
|
3941
|
-
children: [/* @__PURE__ */ b(
|
|
3949
|
+
children: [/* @__PURE__ */ b(Ce, {
|
|
3942
3950
|
required: n.required,
|
|
3943
3951
|
children: n.display ? z(n.display.name) : t
|
|
3944
|
-
}), n.type === "structure" && n.structure ? /* @__PURE__ */ b(
|
|
3952
|
+
}), n.type === "structure" && n.structure ? /* @__PURE__ */ b(qi, {
|
|
3945
3953
|
field: n,
|
|
3946
3954
|
fieldName: t,
|
|
3947
3955
|
value: o[t],
|
|
3948
3956
|
mode: "edit",
|
|
3949
3957
|
onChange: l(t),
|
|
3950
3958
|
locale: i
|
|
3951
|
-
}) :
|
|
3959
|
+
}) : _s({
|
|
3952
3960
|
field: n,
|
|
3953
3961
|
fieldName: t,
|
|
3954
3962
|
value: o[t],
|
|
@@ -3960,7 +3968,7 @@ function qi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3960
3968
|
})
|
|
3961
3969
|
});
|
|
3962
3970
|
}
|
|
3963
|
-
function
|
|
3971
|
+
function Yi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
|
|
3964
3972
|
let s = Array.isArray(n) ? n : [];
|
|
3965
3973
|
if (r === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
3966
3974
|
style: {
|
|
@@ -3974,7 +3982,7 @@ function Ji({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3974
3982
|
flexDirection: "column",
|
|
3975
3983
|
gap: 8
|
|
3976
3984
|
},
|
|
3977
|
-
children: s.map((t, n) => /* @__PURE__ */ b(
|
|
3985
|
+
children: s.map((t, n) => /* @__PURE__ */ b(Ji, {
|
|
3978
3986
|
structDef: e,
|
|
3979
3987
|
value: t,
|
|
3980
3988
|
mode: "display",
|
|
@@ -4000,7 +4008,7 @@ function Ji({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
4000
4008
|
role: "group",
|
|
4001
4009
|
children: [s.map((n, r) => /* @__PURE__ */ x("div", {
|
|
4002
4010
|
style: { position: "relative" },
|
|
4003
|
-
children: [/* @__PURE__ */ b(
|
|
4011
|
+
children: [/* @__PURE__ */ b(Ji, {
|
|
4004
4012
|
structDef: e,
|
|
4005
4013
|
value: n,
|
|
4006
4014
|
mode: "edit",
|
|
@@ -4028,16 +4036,16 @@ function Ji({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
4028
4036
|
}
|
|
4029
4037
|
//#endregion
|
|
4030
4038
|
//#region src/components/fields/SecretField.tsx
|
|
4031
|
-
var
|
|
4032
|
-
function
|
|
4033
|
-
let [s, c] = p(""), l = a !== void 0, u = n ===
|
|
4039
|
+
var Xi = "[SET]";
|
|
4040
|
+
function Zi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
4041
|
+
let [s, c] = p(""), l = a !== void 0, u = n === Xi || typeof n == "string" && n !== "";
|
|
4034
4042
|
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
4035
4043
|
className: "mono",
|
|
4036
4044
|
style: {
|
|
4037
4045
|
fontSize: 12.5,
|
|
4038
4046
|
color: "var(--text-3)"
|
|
4039
4047
|
},
|
|
4040
|
-
children:
|
|
4048
|
+
children: Xi
|
|
4041
4049
|
}) : /* @__PURE__ */ b("span", {
|
|
4042
4050
|
style: {
|
|
4043
4051
|
fontSize: 12.5,
|
|
@@ -4045,29 +4053,29 @@ function Xi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
4045
4053
|
fontStyle: "italic"
|
|
4046
4054
|
},
|
|
4047
4055
|
children: "Not set"
|
|
4048
|
-
}) : /* @__PURE__ */ b(
|
|
4056
|
+
}) : /* @__PURE__ */ b(Pe, {
|
|
4049
4057
|
id: o,
|
|
4050
4058
|
name: t,
|
|
4051
4059
|
ariaRequired: e.required,
|
|
4052
4060
|
value: s,
|
|
4053
4061
|
onChange: (e) => {
|
|
4054
|
-
c(e), l && e === "" ? i?.(u ?
|
|
4062
|
+
c(e), l && e === "" ? i?.(u ? Xi : "") : i?.(e);
|
|
4055
4063
|
},
|
|
4056
4064
|
placeholder: l ? "Leave blank to keep existing value" : "Enter value"
|
|
4057
4065
|
});
|
|
4058
4066
|
}
|
|
4059
4067
|
//#endregion
|
|
4060
4068
|
//#region src/components/fields/PasswordField.tsx
|
|
4061
|
-
var
|
|
4062
|
-
function
|
|
4063
|
-
let [s, c] = p(""), l = a !== void 0, u = n ===
|
|
4069
|
+
var Qi = "[SET]";
|
|
4070
|
+
function $i({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
4071
|
+
let [s, c] = p(""), l = a !== void 0, u = n === Qi || typeof n == "string" && n !== "";
|
|
4064
4072
|
return r === "display" ? u ? /* @__PURE__ */ b("span", {
|
|
4065
4073
|
className: "mono",
|
|
4066
4074
|
style: {
|
|
4067
4075
|
fontSize: 12.5,
|
|
4068
4076
|
color: "var(--text-3)"
|
|
4069
4077
|
},
|
|
4070
|
-
children:
|
|
4078
|
+
children: Qi
|
|
4071
4079
|
}) : /* @__PURE__ */ b("span", {
|
|
4072
4080
|
style: {
|
|
4073
4081
|
fontSize: 12.5,
|
|
@@ -4075,31 +4083,31 @@ function Qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
4075
4083
|
fontStyle: "italic"
|
|
4076
4084
|
},
|
|
4077
4085
|
children: "Not set"
|
|
4078
|
-
}) : /* @__PURE__ */ b(
|
|
4086
|
+
}) : /* @__PURE__ */ b(Pe, {
|
|
4079
4087
|
id: o,
|
|
4080
4088
|
name: t,
|
|
4081
4089
|
ariaRequired: e.required,
|
|
4082
4090
|
value: s,
|
|
4083
4091
|
onChange: (e) => {
|
|
4084
|
-
c(e), l && e === "" ? i?.(u ?
|
|
4092
|
+
c(e), l && e === "" ? i?.(u ? Qi : "") : i?.(e);
|
|
4085
4093
|
},
|
|
4086
4094
|
placeholder: l ? "Leave blank to keep existing value" : "Enter password"
|
|
4087
4095
|
});
|
|
4088
4096
|
}
|
|
4089
4097
|
//#endregion
|
|
4090
4098
|
//#region src/components/fields/StringArrayField.tsx
|
|
4091
|
-
function
|
|
4099
|
+
function ea(e) {
|
|
4092
4100
|
return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
|
|
4093
4101
|
}
|
|
4094
|
-
function
|
|
4095
|
-
let o =
|
|
4096
|
-
return s.length > 0 ? /* @__PURE__ */ b(
|
|
4102
|
+
function ta({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
4103
|
+
let o = ea(n), s = e.values ?? [];
|
|
4104
|
+
return s.length > 0 ? /* @__PURE__ */ b(na, {
|
|
4097
4105
|
values: s,
|
|
4098
4106
|
selected: o,
|
|
4099
4107
|
mode: r,
|
|
4100
4108
|
required: e.required,
|
|
4101
4109
|
onChange: i
|
|
4102
|
-
}) : /* @__PURE__ */ b(
|
|
4110
|
+
}) : /* @__PURE__ */ b(ra, {
|
|
4103
4111
|
items: o,
|
|
4104
4112
|
fieldName: t,
|
|
4105
4113
|
required: e.required,
|
|
@@ -4108,7 +4116,7 @@ function ea({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
4108
4116
|
fieldId: a
|
|
4109
4117
|
});
|
|
4110
4118
|
}
|
|
4111
|
-
function
|
|
4119
|
+
function na({ values: e, selected: n, mode: r, required: i, onChange: a }) {
|
|
4112
4120
|
let o = new Set(n), s = (t) => {
|
|
4113
4121
|
let n = e.find((e) => e.code === t);
|
|
4114
4122
|
return n && z(n.name) || t;
|
|
@@ -4174,7 +4182,7 @@ function ta({ values: e, selected: n, mode: r, required: i, onChange: a }) {
|
|
|
4174
4182
|
}, e))]
|
|
4175
4183
|
});
|
|
4176
4184
|
}
|
|
4177
|
-
function
|
|
4185
|
+
function ra({ items: e, fieldName: n, required: r, mode: i, onChange: a, fieldId: o }) {
|
|
4178
4186
|
let [s, c] = p("");
|
|
4179
4187
|
if (i === "display") return e.length === 0 ? /* @__PURE__ */ b("span", {
|
|
4180
4188
|
style: {
|
|
@@ -4244,11 +4252,11 @@ function na({ items: e, fieldName: n, required: r, mode: i, onChange: a, fieldId
|
|
|
4244
4252
|
}
|
|
4245
4253
|
//#endregion
|
|
4246
4254
|
//#region src/components/fields/IntArrayField.tsx
|
|
4247
|
-
function
|
|
4255
|
+
function ia(e) {
|
|
4248
4256
|
return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
|
|
4249
4257
|
}
|
|
4250
|
-
function
|
|
4251
|
-
let s =
|
|
4258
|
+
function aa({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
4259
|
+
let s = ia(r), [c, l] = p("");
|
|
4252
4260
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
|
|
4253
4261
|
style: {
|
|
4254
4262
|
fontSize: 12.5,
|
|
@@ -4320,47 +4328,47 @@ function ia({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
4320
4328
|
}
|
|
4321
4329
|
//#endregion
|
|
4322
4330
|
//#region src/lib/rich-text.ts
|
|
4323
|
-
var
|
|
4324
|
-
function
|
|
4325
|
-
return typeof e == "string" ? e :
|
|
4331
|
+
var oa = /declarion:\/\/file\/([0-9a-fA-F-]{36})/g;
|
|
4332
|
+
function sa(e) {
|
|
4333
|
+
return typeof e == "string" ? e : ha(e) && typeof e.markdown == "string" ? e.markdown : "";
|
|
4326
4334
|
}
|
|
4327
|
-
function
|
|
4335
|
+
function ca(e, t) {
|
|
4328
4336
|
return {
|
|
4329
|
-
markdown:
|
|
4330
|
-
files:
|
|
4337
|
+
markdown: sa(e),
|
|
4338
|
+
files: da(t)
|
|
4331
4339
|
};
|
|
4332
4340
|
}
|
|
4333
|
-
function
|
|
4334
|
-
let n =
|
|
4341
|
+
function la(e, t) {
|
|
4342
|
+
let n = ca(e, null);
|
|
4335
4343
|
return n.files[t.id] = t, n;
|
|
4336
4344
|
}
|
|
4337
|
-
function
|
|
4338
|
-
let n =
|
|
4345
|
+
function ua(e, t) {
|
|
4346
|
+
let n = ca(e, null);
|
|
4339
4347
|
for (let e of t) delete n.files[e];
|
|
4340
4348
|
return n;
|
|
4341
4349
|
}
|
|
4342
|
-
function
|
|
4350
|
+
function da(e) {
|
|
4343
4351
|
if (!Array.isArray(e)) return {};
|
|
4344
4352
|
let t = {};
|
|
4345
|
-
for (let n of e)
|
|
4353
|
+
for (let n of e) ha(n) && typeof n.id == "string" && (t[n.id] = n);
|
|
4346
4354
|
return t;
|
|
4347
4355
|
}
|
|
4348
|
-
function
|
|
4356
|
+
function fa(e) {
|
|
4349
4357
|
let t = /* @__PURE__ */ new Set(), n = [], r;
|
|
4350
|
-
for (
|
|
4358
|
+
for (oa.lastIndex = 0; (r = oa.exec(e)) !== null;) {
|
|
4351
4359
|
let e = r[1];
|
|
4352
4360
|
t.has(e) || (t.add(e), n.push(e));
|
|
4353
4361
|
}
|
|
4354
4362
|
return n;
|
|
4355
4363
|
}
|
|
4356
|
-
function
|
|
4364
|
+
function pa(e) {
|
|
4357
4365
|
return e ? /^declarion:\/\/file\/([0-9a-fA-F-]{36})$/.exec(e)?.[1] ?? null : null;
|
|
4358
4366
|
}
|
|
4359
|
-
function
|
|
4367
|
+
function ma(e) {
|
|
4360
4368
|
let t = `declarion://file/${e.id}`;
|
|
4361
4369
|
return e.content_type.startsWith("image/") ? `` : `[${e.filename || e.id}](${t})`;
|
|
4362
4370
|
}
|
|
4363
|
-
function
|
|
4371
|
+
function ha(e) {
|
|
4364
4372
|
return typeof e == "object" && !!e;
|
|
4365
4373
|
}
|
|
4366
4374
|
//#endregion
|
|
@@ -4372,30 +4380,30 @@ var Q = class extends Error {
|
|
|
4372
4380
|
super(n), this.code = t, this.status = e;
|
|
4373
4381
|
}
|
|
4374
4382
|
};
|
|
4375
|
-
async function
|
|
4383
|
+
async function ga(e) {
|
|
4376
4384
|
let t = Ot();
|
|
4377
4385
|
try {
|
|
4378
|
-
return await
|
|
4386
|
+
return await _a(e, t ? await Pt() : null);
|
|
4379
4387
|
} catch (n) {
|
|
4380
4388
|
if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
|
|
4381
4389
|
let r = null;
|
|
4382
4390
|
try {
|
|
4383
4391
|
t ? (Nt(), r = await Pt()) : await bn();
|
|
4384
4392
|
} catch {
|
|
4385
|
-
throw
|
|
4393
|
+
throw Cn()(), n;
|
|
4386
4394
|
}
|
|
4387
4395
|
try {
|
|
4388
|
-
return await
|
|
4396
|
+
return await _a(e, r);
|
|
4389
4397
|
} catch (e) {
|
|
4390
|
-
throw e instanceof Q && e.status === 401 &&
|
|
4398
|
+
throw e instanceof Q && e.status === 401 && Cn()(), e;
|
|
4391
4399
|
}
|
|
4392
4400
|
}
|
|
4393
4401
|
}
|
|
4394
|
-
function
|
|
4402
|
+
function _a(e, t) {
|
|
4395
4403
|
let { file: n, entityCode: r, fieldCode: i, slotCode: a, onProgress: o, signal: s } = e;
|
|
4396
4404
|
return new Promise((e, c) => {
|
|
4397
4405
|
let l = new XMLHttpRequest();
|
|
4398
|
-
if (l.open("POST",
|
|
4406
|
+
if (l.open("POST", va(r, i, a)), l.withCredentials = t === null, t && l.setRequestHeader("Authorization", `Bearer ${t}`), l.upload.onprogress = (e) => {
|
|
4399
4407
|
if (!o) return;
|
|
4400
4408
|
let t = e.lengthComputable ? e.total : n.size, r = t > 0 ? Math.min(100, Math.round(e.loaded / t * 100)) : 0;
|
|
4401
4409
|
o({
|
|
@@ -4409,7 +4417,7 @@ function ga(e, t) {
|
|
|
4409
4417
|
n = t ? JSON.parse(t) : null;
|
|
4410
4418
|
} catch {}
|
|
4411
4419
|
if (l.status >= 200 && l.status < 300) {
|
|
4412
|
-
let t =
|
|
4420
|
+
let t = ya(n);
|
|
4413
4421
|
if (!t || !t.id) {
|
|
4414
4422
|
c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
|
|
4415
4423
|
return;
|
|
@@ -4434,56 +4442,56 @@ function ga(e, t) {
|
|
|
4434
4442
|
u.append("file", n, n.name), l.send(u);
|
|
4435
4443
|
});
|
|
4436
4444
|
}
|
|
4437
|
-
function
|
|
4445
|
+
function va(e, t, n) {
|
|
4438
4446
|
let r = new URLSearchParams();
|
|
4439
4447
|
e && t && (r.set("entity_code", e), r.set("field_code", t), n && r.set("slot_code", n));
|
|
4440
4448
|
let i = r.toString();
|
|
4441
4449
|
return i ? `/api/files/upload?${i}` : "/api/files/upload";
|
|
4442
4450
|
}
|
|
4443
|
-
function va(e) {
|
|
4444
|
-
return ba(e) ? ba(e.result) ? va(e.result) : ba(e.file) ? ya(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4445
|
-
}
|
|
4446
4451
|
function ya(e) {
|
|
4447
|
-
|
|
4452
|
+
return xa(e) ? xa(e.result) ? ya(e.result) : xa(e.file) ? ba(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4453
|
+
}
|
|
4454
|
+
function ba(e) {
|
|
4455
|
+
let t = Sa(e.file_id);
|
|
4448
4456
|
return t ? {
|
|
4449
4457
|
id: t,
|
|
4450
|
-
filename:
|
|
4451
|
-
content_type:
|
|
4452
|
-
size_bytes:
|
|
4453
|
-
sha256:
|
|
4454
|
-
dedup:
|
|
4458
|
+
filename: Sa(e.filename_original) ?? Sa(e.filename_normalized) ?? t,
|
|
4459
|
+
content_type: Sa(e.content_type) ?? "application/octet-stream",
|
|
4460
|
+
size_bytes: Ca(e.size_bytes) ?? 0,
|
|
4461
|
+
sha256: Sa(e.sha256) ?? "",
|
|
4462
|
+
dedup: wa(e.dedup)
|
|
4455
4463
|
} : null;
|
|
4456
4464
|
}
|
|
4457
|
-
function
|
|
4465
|
+
function xa(e) {
|
|
4458
4466
|
return typeof e == "object" && !!e;
|
|
4459
4467
|
}
|
|
4460
|
-
function
|
|
4468
|
+
function Sa(e) {
|
|
4461
4469
|
return typeof e == "string" ? e : void 0;
|
|
4462
4470
|
}
|
|
4463
|
-
function
|
|
4471
|
+
function Ca(e) {
|
|
4464
4472
|
return typeof e == "number" ? e : void 0;
|
|
4465
4473
|
}
|
|
4466
|
-
function
|
|
4474
|
+
function wa(e) {
|
|
4467
4475
|
return typeof e == "boolean" ? e : void 0;
|
|
4468
4476
|
}
|
|
4469
|
-
async function
|
|
4477
|
+
async function Ta(e) {
|
|
4470
4478
|
await Y("files.discard", { file_id: e });
|
|
4471
4479
|
}
|
|
4472
|
-
function
|
|
4480
|
+
function Ea(e, t, n) {
|
|
4473
4481
|
if (n && e.size > n) return {
|
|
4474
4482
|
code: "FILE_TOO_LARGE",
|
|
4475
|
-
message: `File is ${
|
|
4483
|
+
message: `File is ${Oa(e.size)}, max ${Oa(n)}`
|
|
4476
4484
|
};
|
|
4477
4485
|
if (t && t.length > 0) {
|
|
4478
4486
|
let n = e.type || "application/octet-stream";
|
|
4479
|
-
if (!t.some((e) =>
|
|
4487
|
+
if (!t.some((e) => Da(e, n))) return {
|
|
4480
4488
|
code: "MIME_NOT_ACCEPTED",
|
|
4481
4489
|
message: `File type ${n} is not accepted`
|
|
4482
4490
|
};
|
|
4483
4491
|
}
|
|
4484
4492
|
return null;
|
|
4485
4493
|
}
|
|
4486
|
-
function
|
|
4494
|
+
function Da(e, t) {
|
|
4487
4495
|
if (e === "*/*" || e === "*") return !0;
|
|
4488
4496
|
if (e.endsWith("/*")) {
|
|
4489
4497
|
let n = e.slice(0, e.length - 1);
|
|
@@ -4491,7 +4499,7 @@ function Ea(e, t) {
|
|
|
4491
4499
|
}
|
|
4492
4500
|
return e === t;
|
|
4493
4501
|
}
|
|
4494
|
-
function
|
|
4502
|
+
function Oa(e) {
|
|
4495
4503
|
if (e < 1024) return `${e} B`;
|
|
4496
4504
|
let t = [
|
|
4497
4505
|
"KB",
|
|
@@ -4503,7 +4511,7 @@ function Da(e) {
|
|
|
4503
4511
|
}
|
|
4504
4512
|
//#endregion
|
|
4505
4513
|
//#region src/components/file-widgets/draft-scope.tsx
|
|
4506
|
-
var
|
|
4514
|
+
var ka = i({
|
|
4507
4515
|
registerDraft() {},
|
|
4508
4516
|
unregisterDraft() {},
|
|
4509
4517
|
hasDraft() {
|
|
@@ -4512,7 +4520,7 @@ var Oa = i({
|
|
|
4512
4520
|
flushAllDrafts: async () => {},
|
|
4513
4521
|
markCommitted() {}
|
|
4514
4522
|
});
|
|
4515
|
-
function
|
|
4523
|
+
function Aa({ children: e }) {
|
|
4516
4524
|
let t = f(/* @__PURE__ */ new Map()), n = d(() => ({
|
|
4517
4525
|
registerDraft(e) {
|
|
4518
4526
|
t.current.set(e.fileId, e);
|
|
@@ -4531,16 +4539,16 @@ function ka({ children: e }) {
|
|
|
4531
4539
|
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
4532
4540
|
}
|
|
4533
4541
|
}), []);
|
|
4534
|
-
return /* @__PURE__ */ b(
|
|
4542
|
+
return /* @__PURE__ */ b(ka.Provider, {
|
|
4535
4543
|
value: n,
|
|
4536
4544
|
children: e
|
|
4537
4545
|
});
|
|
4538
4546
|
}
|
|
4539
|
-
function Aa() {
|
|
4540
|
-
return c(Oa);
|
|
4541
|
-
}
|
|
4542
4547
|
function ja() {
|
|
4543
|
-
|
|
4548
|
+
return c(ka);
|
|
4549
|
+
}
|
|
4550
|
+
function Ma() {
|
|
4551
|
+
let e = ja();
|
|
4544
4552
|
return {
|
|
4545
4553
|
register: s((t, n) => {
|
|
4546
4554
|
e.registerDraft({
|
|
@@ -4559,17 +4567,17 @@ function ja() {
|
|
|
4559
4567
|
}
|
|
4560
4568
|
//#endregion
|
|
4561
4569
|
//#region src/components/fields/RichTextField.tsx
|
|
4562
|
-
function
|
|
4563
|
-
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } =
|
|
4564
|
-
let n = new Set(
|
|
4570
|
+
function Na(e) {
|
|
4571
|
+
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } = Ma(), E = c?.$files?.[i], O = d(() => ca(a, E), [E, a]), k = O.markdown, A = n.files?.accepts, j = n.files?.max_size_bytes, M = (e, t = O.files) => {
|
|
4572
|
+
let n = new Set(fa(e)), r = [];
|
|
4565
4573
|
for (let e of _.current) n.has(e) || r.push(e);
|
|
4566
4574
|
if (r.length > 0) {
|
|
4567
4575
|
for (let e of r) {
|
|
4568
|
-
_.current.delete(e), T(e),
|
|
4576
|
+
_.current.delete(e), T(e), Ta(e).catch(() => {});
|
|
4569
4577
|
let t = g.current.get(e);
|
|
4570
4578
|
t && (URL.revokeObjectURL(t), g.current.delete(e));
|
|
4571
4579
|
}
|
|
4572
|
-
s?.(
|
|
4580
|
+
s?.(ua({
|
|
4573
4581
|
markdown: e,
|
|
4574
4582
|
files: t
|
|
4575
4583
|
}, r));
|
|
@@ -4580,7 +4588,7 @@ function Ma(e) {
|
|
|
4580
4588
|
files: t
|
|
4581
4589
|
});
|
|
4582
4590
|
}, ee = (e, t, n) => {
|
|
4583
|
-
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ?
|
|
4591
|
+
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ? la(e, n).files : e.files;
|
|
4584
4592
|
M(o, s), requestAnimationFrame(() => {
|
|
4585
4593
|
if (!r) return;
|
|
4586
4594
|
let e = i + t.length;
|
|
@@ -4596,28 +4604,28 @@ function Ma(e) {
|
|
|
4596
4604
|
files: O.files
|
|
4597
4605
|
};
|
|
4598
4606
|
for (let e of t) {
|
|
4599
|
-
let n =
|
|
4607
|
+
let n = Ea(e, A, j);
|
|
4600
4608
|
if (n) {
|
|
4601
4609
|
C(n.message), y((e) => e - 1);
|
|
4602
4610
|
continue;
|
|
4603
4611
|
}
|
|
4604
4612
|
try {
|
|
4605
|
-
let n = await
|
|
4613
|
+
let n = await ga({
|
|
4606
4614
|
file: e,
|
|
4607
4615
|
entityCode: r,
|
|
4608
4616
|
fieldCode: i
|
|
4609
4617
|
}), o = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
|
|
4610
4618
|
o && g.current.set(n.id, o);
|
|
4611
|
-
let s =
|
|
4612
|
-
if (w(n.id, () =>
|
|
4613
|
-
let e =
|
|
4614
|
-
ee(a, e, s), a =
|
|
4619
|
+
let s = Fa(n, o);
|
|
4620
|
+
if (w(n.id, () => Ta(n.id)), _.current.add(n.id), t.length === 1) {
|
|
4621
|
+
let e = Pa(a.markdown, ma(s));
|
|
4622
|
+
ee(a, e, s), a = la({
|
|
4615
4623
|
markdown: `${a.markdown}${e}`,
|
|
4616
4624
|
files: a.files
|
|
4617
4625
|
}, s);
|
|
4618
4626
|
} else {
|
|
4619
|
-
let e =
|
|
4620
|
-
a =
|
|
4627
|
+
let e = Pa(a.markdown, ma(s));
|
|
4628
|
+
a = la({
|
|
4621
4629
|
markdown: `${a.markdown}${e}`,
|
|
4622
4630
|
files: a.files
|
|
4623
4631
|
}, s), M(a.markdown, a.files);
|
|
@@ -4629,7 +4637,7 @@ function Ma(e) {
|
|
|
4629
4637
|
}
|
|
4630
4638
|
}
|
|
4631
4639
|
};
|
|
4632
|
-
return o === "display" ? k ? /* @__PURE__ */ b(
|
|
4640
|
+
return o === "display" ? k ? /* @__PURE__ */ b(ti, {
|
|
4633
4641
|
content: k,
|
|
4634
4642
|
files: O.files
|
|
4635
4643
|
}) : /* @__PURE__ */ b("span", {
|
|
@@ -4662,7 +4670,7 @@ function Ma(e) {
|
|
|
4662
4670
|
/* @__PURE__ */ b(D, {
|
|
4663
4671
|
kind: "ghost",
|
|
4664
4672
|
size: "xs",
|
|
4665
|
-
icon: b(v > 0 ?
|
|
4673
|
+
icon: b(v > 0 ? Se : t.plus, { size: 12 }),
|
|
4666
4674
|
onClick: () => h.current?.click(),
|
|
4667
4675
|
disabled: !r || !n.files || v > 0,
|
|
4668
4676
|
children: v > 0 ? "Uploading…" : "Insert file"
|
|
@@ -4745,7 +4753,7 @@ function Ma(e) {
|
|
|
4745
4753
|
marginBottom: 8
|
|
4746
4754
|
},
|
|
4747
4755
|
children: "Preview"
|
|
4748
|
-
}), k ? /* @__PURE__ */ b(
|
|
4756
|
+
}), k ? /* @__PURE__ */ b(ti, {
|
|
4749
4757
|
content: k,
|
|
4750
4758
|
files: O.files
|
|
4751
4759
|
}) : /* @__PURE__ */ b("span", {
|
|
@@ -4759,10 +4767,10 @@ function Ma(e) {
|
|
|
4759
4767
|
]
|
|
4760
4768
|
});
|
|
4761
4769
|
}
|
|
4762
|
-
function
|
|
4770
|
+
function Pa(e, t) {
|
|
4763
4771
|
return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
|
|
4764
4772
|
}
|
|
4765
|
-
function
|
|
4773
|
+
function Fa(e, t) {
|
|
4766
4774
|
return {
|
|
4767
4775
|
id: e.id,
|
|
4768
4776
|
filename: e.filename,
|
|
@@ -4777,19 +4785,19 @@ function Pa(e, t) {
|
|
|
4777
4785
|
}
|
|
4778
4786
|
//#endregion
|
|
4779
4787
|
//#region src/components/fields/cells/factories/text.ts
|
|
4780
|
-
var
|
|
4781
|
-
let { field: t, fieldName: n, locale: r = "en" } = e, i =
|
|
4788
|
+
var Ia = () => (e) => e == null || e === "" ? "—" : R(e), La = (e) => {
|
|
4789
|
+
let { field: t, fieldName: n, locale: r = "en" } = e, i = Ra(t, n, r);
|
|
4782
4790
|
return (e) => {
|
|
4783
4791
|
if (e == null) return "—";
|
|
4784
4792
|
let t = !!e;
|
|
4785
|
-
return /* @__PURE__ */ b(
|
|
4793
|
+
return /* @__PURE__ */ b(A, {
|
|
4786
4794
|
tone: t ? "emerald" : "slate",
|
|
4787
4795
|
size: "xs",
|
|
4788
4796
|
children: t ? i.trueLabel : i.falseLabel
|
|
4789
4797
|
});
|
|
4790
4798
|
};
|
|
4791
4799
|
};
|
|
4792
|
-
function
|
|
4800
|
+
function Ra(e, t, n) {
|
|
4793
4801
|
if (e.display?.bool_labels) return {
|
|
4794
4802
|
trueLabel: z(e.display.bool_labels.true, n) || "Yes",
|
|
4795
4803
|
falseLabel: z(e.display.bool_labels.false, n) || "No"
|
|
@@ -4810,14 +4818,14 @@ function La(e, t, n) {
|
|
|
4810
4818
|
};
|
|
4811
4819
|
}
|
|
4812
4820
|
if (t.startsWith("is_")) {
|
|
4813
|
-
let e =
|
|
4821
|
+
let e = za(t.slice(3));
|
|
4814
4822
|
return {
|
|
4815
4823
|
trueLabel: e,
|
|
4816
4824
|
falseLabel: `Not ${e}`
|
|
4817
4825
|
};
|
|
4818
4826
|
}
|
|
4819
4827
|
if (t.startsWith("has_")) {
|
|
4820
|
-
let e =
|
|
4828
|
+
let e = za(t.slice(4));
|
|
4821
4829
|
return {
|
|
4822
4830
|
trueLabel: e,
|
|
4823
4831
|
falseLabel: `No ${e}`
|
|
@@ -4828,12 +4836,12 @@ function La(e, t, n) {
|
|
|
4828
4836
|
falseLabel: "No"
|
|
4829
4837
|
};
|
|
4830
4838
|
}
|
|
4831
|
-
function
|
|
4839
|
+
function za(e) {
|
|
4832
4840
|
return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
|
|
4833
4841
|
}
|
|
4834
4842
|
//#endregion
|
|
4835
4843
|
//#region src/components/fields/cells/factories/badge.tsx
|
|
4836
|
-
var
|
|
4844
|
+
var Ba = /* @__PURE__ */ new Set([
|
|
4837
4845
|
"indigo",
|
|
4838
4846
|
"emerald",
|
|
4839
4847
|
"amber",
|
|
@@ -4843,17 +4851,17 @@ var za = /* @__PURE__ */ new Set([
|
|
|
4843
4851
|
"slate",
|
|
4844
4852
|
"teal"
|
|
4845
4853
|
]);
|
|
4846
|
-
function
|
|
4847
|
-
return e &&
|
|
4854
|
+
function Va(e) {
|
|
4855
|
+
return e && Ba.has(e) ? e : "slate";
|
|
4848
4856
|
}
|
|
4849
|
-
var
|
|
4857
|
+
var Ha = (e) => {
|
|
4850
4858
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4851
4859
|
if (t.values) for (let e of t.values) r.set(e.code, {
|
|
4852
|
-
tone:
|
|
4860
|
+
tone: Va(e.color),
|
|
4853
4861
|
label: z(e.name, n) || e.code
|
|
4854
4862
|
});
|
|
4855
4863
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
|
|
4856
|
-
let t = r.get(e), a = i.color ?
|
|
4864
|
+
let t = r.get(e), a = i.color ? Va(i.color) : t?.tone ?? "slate", o = (i.label ? z(i.label, n) : "") || t?.label || e;
|
|
4857
4865
|
r.set(e, {
|
|
4858
4866
|
tone: a,
|
|
4859
4867
|
label: o
|
|
@@ -4862,13 +4870,13 @@ var Va = (e) => {
|
|
|
4862
4870
|
return (e) => {
|
|
4863
4871
|
if (e == null || e === "") return "—";
|
|
4864
4872
|
let t = R(e), n = r.get(t);
|
|
4865
|
-
return /* @__PURE__ */ b(
|
|
4873
|
+
return /* @__PURE__ */ b(A, {
|
|
4866
4874
|
tone: n?.tone ?? "slate",
|
|
4867
4875
|
size: "xs",
|
|
4868
4876
|
children: n?.label ?? t
|
|
4869
4877
|
});
|
|
4870
4878
|
};
|
|
4871
|
-
},
|
|
4879
|
+
}, Ua = /* @__PURE__ */ new Set([
|
|
4872
4880
|
"indigo",
|
|
4873
4881
|
"emerald",
|
|
4874
4882
|
"amber",
|
|
@@ -4878,25 +4886,25 @@ var Va = (e) => {
|
|
|
4878
4886
|
"slate",
|
|
4879
4887
|
"teal"
|
|
4880
4888
|
]);
|
|
4881
|
-
function
|
|
4882
|
-
return e &&
|
|
4889
|
+
function Wa(e) {
|
|
4890
|
+
return e && Ua.has(e) ? e : "slate";
|
|
4883
4891
|
}
|
|
4884
|
-
var
|
|
4892
|
+
var Ga = (e) => {
|
|
4885
4893
|
let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4886
4894
|
if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
|
|
4887
|
-
tone:
|
|
4895
|
+
tone: Wa(t.color),
|
|
4888
4896
|
label: z(t.name, n) || t.code
|
|
4889
4897
|
});
|
|
4890
4898
|
return (e) => {
|
|
4891
4899
|
if (e == null || e === "") return "—";
|
|
4892
4900
|
let t = R(e), n = r.get(t);
|
|
4893
|
-
return /* @__PURE__ */ b(
|
|
4901
|
+
return /* @__PURE__ */ b(A, {
|
|
4894
4902
|
tone: n?.tone ?? "slate",
|
|
4895
4903
|
size: "xs",
|
|
4896
4904
|
children: n?.label ?? t
|
|
4897
4905
|
});
|
|
4898
4906
|
};
|
|
4899
|
-
},
|
|
4907
|
+
}, Ka = /* @__PURE__ */ new Set([
|
|
4900
4908
|
"indigo",
|
|
4901
4909
|
"emerald",
|
|
4902
4910
|
"amber",
|
|
@@ -4906,14 +4914,14 @@ var Wa = (e) => {
|
|
|
4906
4914
|
"slate",
|
|
4907
4915
|
"teal"
|
|
4908
4916
|
]);
|
|
4909
|
-
function
|
|
4910
|
-
return e &&
|
|
4917
|
+
function qa(e) {
|
|
4918
|
+
return e && Ka.has(e) ? e : null;
|
|
4911
4919
|
}
|
|
4912
|
-
var
|
|
4920
|
+
var Ja = (e) => {
|
|
4913
4921
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4914
4922
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
|
|
4915
4923
|
label: i.label && z(i.label, n) || e,
|
|
4916
|
-
tone:
|
|
4924
|
+
tone: qa(i.color)
|
|
4917
4925
|
});
|
|
4918
4926
|
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ b("span", {
|
|
4919
4927
|
style: {
|
|
@@ -4923,25 +4931,25 @@ var qa = (e) => {
|
|
|
4923
4931
|
},
|
|
4924
4932
|
children: e.map((e, t) => {
|
|
4925
4933
|
let n = String(e), i = r.get(n);
|
|
4926
|
-
return i?.tone ? /* @__PURE__ */ b(
|
|
4934
|
+
return i?.tone ? /* @__PURE__ */ b(A, {
|
|
4927
4935
|
tone: i.tone,
|
|
4928
4936
|
size: "xs",
|
|
4929
4937
|
children: i.label
|
|
4930
4938
|
}, `${n}-${t}`) : /* @__PURE__ */ b(P, { children: i?.label ?? n }, `${n}-${t}`);
|
|
4931
4939
|
})
|
|
4932
4940
|
});
|
|
4933
|
-
},
|
|
4941
|
+
}, Ya = () => (e) => {
|
|
4934
4942
|
if (e == null || e === "") return "—";
|
|
4935
|
-
let { text: t, absolute: n } =
|
|
4943
|
+
let { text: t, absolute: n } = Ue(typeof e == "string" ? e : R(e));
|
|
4936
4944
|
return /* @__PURE__ */ b("span", {
|
|
4937
4945
|
title: n,
|
|
4938
4946
|
children: t
|
|
4939
4947
|
});
|
|
4940
|
-
},
|
|
4948
|
+
}, Xa = () => (e) => e == null || e === "" ? "—" : He(typeof e == "string" ? e : R(e)), Za = 6e4, Qa = 3e5, $a = () => (e) => {
|
|
4941
4949
|
if (e == null || e === "") return "—";
|
|
4942
4950
|
let t = typeof e == "string" ? e : R(e), n = new Date(t);
|
|
4943
4951
|
if (isNaN(n.getTime())) return t;
|
|
4944
|
-
let r =
|
|
4952
|
+
let r = He(t), i = Date.now() - n.getTime();
|
|
4945
4953
|
if (i <= 0) {
|
|
4946
4954
|
let e = C(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
|
|
4947
4955
|
return /* @__PURE__ */ x("span", {
|
|
@@ -4949,9 +4957,9 @@ var qa = (e) => {
|
|
|
4949
4957
|
children: ["in ", e]
|
|
4950
4958
|
});
|
|
4951
4959
|
}
|
|
4952
|
-
if (i <=
|
|
4960
|
+
if (i <= Za) return /* @__PURE__ */ b("span", {
|
|
4953
4961
|
title: r,
|
|
4954
|
-
children: /* @__PURE__ */ b(
|
|
4962
|
+
children: /* @__PURE__ */ b(A, {
|
|
4955
4963
|
tone: "slate",
|
|
4956
4964
|
size: "xs",
|
|
4957
4965
|
children: "due"
|
|
@@ -4960,14 +4968,14 @@ var qa = (e) => {
|
|
|
4960
4968
|
let a = C(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
|
|
4961
4969
|
return /* @__PURE__ */ b("span", {
|
|
4962
4970
|
title: r,
|
|
4963
|
-
children: /* @__PURE__ */ x(
|
|
4964
|
-
tone: i <=
|
|
4971
|
+
children: /* @__PURE__ */ x(A, {
|
|
4972
|
+
tone: i <= Qa ? "amber" : "rose",
|
|
4965
4973
|
size: "xs",
|
|
4966
4974
|
children: ["overdue ", a]
|
|
4967
4975
|
})
|
|
4968
4976
|
});
|
|
4969
|
-
},
|
|
4970
|
-
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a =
|
|
4977
|
+
}, eo = (e) => {
|
|
4978
|
+
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = to(t.display?.currency_display), o = no(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
|
|
4971
4979
|
return (e, t = {}) => {
|
|
4972
4980
|
if (e == null || e === "") return "—";
|
|
4973
4981
|
let c = typeof e == "number" ? e : Number(e);
|
|
@@ -4982,7 +4990,7 @@ var qa = (e) => {
|
|
|
4982
4990
|
}), s.set(d, f)), f.format(c);
|
|
4983
4991
|
};
|
|
4984
4992
|
};
|
|
4985
|
-
function
|
|
4993
|
+
function to(e) {
|
|
4986
4994
|
switch (e) {
|
|
4987
4995
|
case "narrow_symbol": return "narrowSymbol";
|
|
4988
4996
|
case "code":
|
|
@@ -4991,16 +4999,16 @@ function eo(e) {
|
|
|
4991
4999
|
default: return "symbol";
|
|
4992
5000
|
}
|
|
4993
5001
|
}
|
|
4994
|
-
function
|
|
5002
|
+
function no(e, t, n) {
|
|
4995
5003
|
return e < t ? t : e > n ? n : e;
|
|
4996
5004
|
}
|
|
4997
5005
|
//#endregion
|
|
4998
5006
|
//#region src/components/fields/cells/factories/refLink.tsx
|
|
4999
|
-
var
|
|
5007
|
+
var ro = (e) => {
|
|
5000
5008
|
let { field: t, entities: r, screens: i, refs: a, surface: o } = e, s = t.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field || "$display", p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
|
|
5001
5009
|
return (e, t) => {
|
|
5002
5010
|
if (e == null || e === "") return "—";
|
|
5003
|
-
let r = R(e), i =
|
|
5011
|
+
let r = R(e), i = io(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
|
|
5004
5012
|
if (u) {
|
|
5005
5013
|
let e = /* @__PURE__ */ x(y, { children: [d && /* @__PURE__ */ b("span", {
|
|
5006
5014
|
style: {
|
|
@@ -5042,29 +5050,29 @@ var no = (e) => {
|
|
|
5042
5050
|
}) : i;
|
|
5043
5051
|
};
|
|
5044
5052
|
};
|
|
5045
|
-
function
|
|
5053
|
+
function io(e, t, n, r) {
|
|
5046
5054
|
let i = t && n ? n[t]?.[e] : void 0;
|
|
5047
|
-
return i ?
|
|
5055
|
+
return i ? B(i, r, e) : e;
|
|
5048
5056
|
}
|
|
5049
5057
|
//#endregion
|
|
5050
5058
|
//#region src/components/fields/cells/factories/url-helpers.ts
|
|
5051
|
-
var
|
|
5052
|
-
function oo(e) {
|
|
5053
|
-
return /^[a-z]{2,3}$/i.test(e) || ao.test(e);
|
|
5054
|
-
}
|
|
5059
|
+
var ao = /^(https?|ftps?|ssh|mailto|tel):/i, oo = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
|
|
5055
5060
|
function so(e) {
|
|
5061
|
+
return /^[a-z]{2,3}$/i.test(e) || oo.test(e);
|
|
5062
|
+
}
|
|
5063
|
+
function co(e) {
|
|
5056
5064
|
if (!e.includes(".")) return !1;
|
|
5057
5065
|
let t = e.split(".");
|
|
5058
5066
|
if (t.length < 3) return !0;
|
|
5059
5067
|
let n = t[0].toLowerCase();
|
|
5060
|
-
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : !/^(io|app|dev)$/.test(n) ||
|
|
5068
|
+
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : !/^(io|app|dev)$/.test(n) || so(t[t.length - 1]);
|
|
5061
5069
|
}
|
|
5062
|
-
function
|
|
5063
|
-
if (
|
|
5070
|
+
function lo(e) {
|
|
5071
|
+
if (ao.test(e)) return e;
|
|
5064
5072
|
let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
|
|
5065
5073
|
if (t) {
|
|
5066
5074
|
let n = t[1], r = e.slice(t[0].length);
|
|
5067
|
-
if (/^\d+([/?#]|$)/.test(r) &&
|
|
5075
|
+
if (/^\d+([/?#]|$)/.test(r) && co(n)) {
|
|
5068
5076
|
let t = parseInt(r, 10);
|
|
5069
5077
|
if (t >= 1 && t <= 65535) return `https://${e}`;
|
|
5070
5078
|
}
|
|
@@ -5072,14 +5080,14 @@ function co(e) {
|
|
|
5072
5080
|
}
|
|
5073
5081
|
return `https://${e}`;
|
|
5074
5082
|
}
|
|
5075
|
-
function
|
|
5083
|
+
function uo(e) {
|
|
5076
5084
|
try {
|
|
5077
5085
|
return new URL(e).hostname.replace(/^www\./i, "") || null;
|
|
5078
5086
|
} catch {
|
|
5079
5087
|
return null;
|
|
5080
5088
|
}
|
|
5081
5089
|
}
|
|
5082
|
-
function
|
|
5090
|
+
function fo(e, t) {
|
|
5083
5091
|
if (t !== "linkedin.com") return null;
|
|
5084
5092
|
try {
|
|
5085
5093
|
let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
|
|
@@ -5087,7 +5095,7 @@ function uo(e, t) {
|
|
|
5087
5095
|
} catch {}
|
|
5088
5096
|
return null;
|
|
5089
5097
|
}
|
|
5090
|
-
function
|
|
5098
|
+
function po(e) {
|
|
5091
5099
|
try {
|
|
5092
5100
|
return new URL(e), !0;
|
|
5093
5101
|
} catch {
|
|
@@ -5096,7 +5104,7 @@ function fo(e) {
|
|
|
5096
5104
|
}
|
|
5097
5105
|
//#endregion
|
|
5098
5106
|
//#region src/components/fields/cells/factories/host-icons.tsx
|
|
5099
|
-
function
|
|
5107
|
+
function mo(e, t = "0 0 24 24") {
|
|
5100
5108
|
return (n) => /* @__PURE__ */ b("svg", {
|
|
5101
5109
|
width: 16,
|
|
5102
5110
|
height: 16,
|
|
@@ -5112,17 +5120,17 @@ function po(e, t = "0 0 24 24") {
|
|
|
5112
5120
|
children: e
|
|
5113
5121
|
});
|
|
5114
5122
|
}
|
|
5115
|
-
var
|
|
5123
|
+
var ho = mo(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
5116
5124
|
cx: "12",
|
|
5117
5125
|
cy: "12",
|
|
5118
5126
|
r: "9"
|
|
5119
|
-
}), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })),
|
|
5127
|
+
}), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), go = () => /* @__PURE__ */ b(e, {
|
|
5120
5128
|
size: 16,
|
|
5121
5129
|
style: {
|
|
5122
5130
|
flexShrink: 0,
|
|
5123
5131
|
color: "#0A66C2"
|
|
5124
5132
|
}
|
|
5125
|
-
}),
|
|
5133
|
+
}), _o = (e) => /* @__PURE__ */ b("svg", {
|
|
5126
5134
|
width: 16,
|
|
5127
5135
|
height: 16,
|
|
5128
5136
|
viewBox: "0 0 24 24",
|
|
@@ -5131,7 +5139,7 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5131
5139
|
style: { flexShrink: 0 },
|
|
5132
5140
|
...e,
|
|
5133
5141
|
children: /* @__PURE__ */ b("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
|
|
5134
|
-
}),
|
|
5142
|
+
}), vo = (e) => /* @__PURE__ */ b("svg", {
|
|
5135
5143
|
width: 16,
|
|
5136
5144
|
height: 16,
|
|
5137
5145
|
viewBox: "0 0 24 24",
|
|
@@ -5140,7 +5148,7 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5140
5148
|
style: { flexShrink: 0 },
|
|
5141
5149
|
...e,
|
|
5142
5150
|
children: /* @__PURE__ */ b("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
|
|
5143
|
-
}),
|
|
5151
|
+
}), yo = (e) => /* @__PURE__ */ b("svg", {
|
|
5144
5152
|
width: 16,
|
|
5145
5153
|
height: 16,
|
|
5146
5154
|
viewBox: "0 0 24 24",
|
|
@@ -5149,7 +5157,7 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5149
5157
|
style: { flexShrink: 0 },
|
|
5150
5158
|
...e,
|
|
5151
5159
|
children: /* @__PURE__ */ b("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
|
|
5152
|
-
}),
|
|
5160
|
+
}), bo = (e) => /* @__PURE__ */ b("svg", {
|
|
5153
5161
|
width: 16,
|
|
5154
5162
|
height: 16,
|
|
5155
5163
|
viewBox: "0 0 24 24",
|
|
@@ -5158,7 +5166,7 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5158
5166
|
style: { flexShrink: 0 },
|
|
5159
5167
|
...e,
|
|
5160
5168
|
children: /* @__PURE__ */ b("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
|
|
5161
|
-
}),
|
|
5169
|
+
}), xo = (e) => /* @__PURE__ */ x("svg", {
|
|
5162
5170
|
width: 16,
|
|
5163
5171
|
height: 16,
|
|
5164
5172
|
viewBox: "0 0 24 24",
|
|
@@ -5183,7 +5191,7 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5183
5191
|
d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
|
|
5184
5192
|
})
|
|
5185
5193
|
]
|
|
5186
|
-
}),
|
|
5194
|
+
}), So = (e) => /* @__PURE__ */ b("svg", {
|
|
5187
5195
|
width: 16,
|
|
5188
5196
|
height: 16,
|
|
5189
5197
|
viewBox: "0 0 24 24",
|
|
@@ -5192,39 +5200,39 @@ var mo = po(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
|
|
|
5192
5200
|
style: { flexShrink: 0 },
|
|
5193
5201
|
...e,
|
|
5194
5202
|
children: /* @__PURE__ */ b("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
|
|
5195
|
-
}),
|
|
5196
|
-
"linkedin.com":
|
|
5197
|
-
"github.com":
|
|
5198
|
-
"x.com":
|
|
5199
|
-
"twitter.com":
|
|
5200
|
-
"youtube.com":
|
|
5201
|
-
"youtu.be":
|
|
5202
|
-
"gmail.com":
|
|
5203
|
-
"mail.google.com":
|
|
5204
|
-
"slack.com":
|
|
5205
|
-
"notion.so":
|
|
5206
|
-
"notion.com":
|
|
5203
|
+
}), Co = {
|
|
5204
|
+
"linkedin.com": go,
|
|
5205
|
+
"github.com": _o,
|
|
5206
|
+
"x.com": vo,
|
|
5207
|
+
"twitter.com": vo,
|
|
5208
|
+
"youtube.com": yo,
|
|
5209
|
+
"youtu.be": yo,
|
|
5210
|
+
"gmail.com": bo,
|
|
5211
|
+
"mail.google.com": bo,
|
|
5212
|
+
"slack.com": xo,
|
|
5213
|
+
"notion.so": So,
|
|
5214
|
+
"notion.com": So
|
|
5207
5215
|
};
|
|
5208
|
-
function
|
|
5216
|
+
function wo(e, t) {
|
|
5209
5217
|
return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
|
|
5210
5218
|
}
|
|
5211
|
-
var
|
|
5219
|
+
var To = {
|
|
5212
5220
|
width: 16,
|
|
5213
5221
|
height: 16,
|
|
5214
5222
|
flexShrink: 0,
|
|
5215
5223
|
objectFit: "contain"
|
|
5216
5224
|
};
|
|
5217
|
-
function
|
|
5218
|
-
let n = e ? e.toLowerCase() : "", r = n ?
|
|
5225
|
+
function Eo({ domain: e, source: t }) {
|
|
5226
|
+
let n = e ? e.toLowerCase() : "", r = n ? Co[n] : void 0;
|
|
5219
5227
|
if (r) return /* @__PURE__ */ b(r, {});
|
|
5220
|
-
let i =
|
|
5221
|
-
return i ? /* @__PURE__ */ b(
|
|
5228
|
+
let i = wo(n, t);
|
|
5229
|
+
return i ? /* @__PURE__ */ b(Do, { src: i }) : /* @__PURE__ */ b(ho, {});
|
|
5222
5230
|
}
|
|
5223
|
-
function
|
|
5231
|
+
function Do({ src: e }) {
|
|
5224
5232
|
let [t, n] = p(!1);
|
|
5225
5233
|
return l(() => {
|
|
5226
5234
|
n(!1);
|
|
5227
|
-
}, [e]), t ? /* @__PURE__ */ b(
|
|
5235
|
+
}, [e]), t ? /* @__PURE__ */ b(ho, {}) : /* @__PURE__ */ b("img", {
|
|
5228
5236
|
src: e,
|
|
5229
5237
|
alt: "",
|
|
5230
5238
|
width: 16,
|
|
@@ -5232,7 +5240,7 @@ function Eo({ src: e }) {
|
|
|
5232
5240
|
loading: "lazy",
|
|
5233
5241
|
decoding: "async",
|
|
5234
5242
|
referrerPolicy: "no-referrer",
|
|
5235
|
-
style:
|
|
5243
|
+
style: To,
|
|
5236
5244
|
onError: () => n(!0)
|
|
5237
5245
|
});
|
|
5238
5246
|
}
|
|
@@ -5242,33 +5250,33 @@ var $ = /* @__PURE__ */ b("span", {
|
|
|
5242
5250
|
color: "var(--text-4)"
|
|
5243
5251
|
},
|
|
5244
5252
|
children: "—"
|
|
5245
|
-
}),
|
|
5253
|
+
}), Oo = {
|
|
5246
5254
|
display: "inline-flex",
|
|
5247
5255
|
alignItems: "center",
|
|
5248
5256
|
gap: 4,
|
|
5249
5257
|
fontSize: 12.5,
|
|
5250
5258
|
color: "var(--accent)",
|
|
5251
5259
|
textDecoration: "none"
|
|
5252
|
-
},
|
|
5260
|
+
}, ko = { fontSize: 12.5 }, Ao = (e) => {
|
|
5253
5261
|
let n = e.field.display?.favicon_source ?? "google";
|
|
5254
5262
|
return (e) => {
|
|
5255
5263
|
let r = e == null ? "" : R(e);
|
|
5256
5264
|
if (!r) return $;
|
|
5257
|
-
let i =
|
|
5258
|
-
if (i == null || !
|
|
5259
|
-
style:
|
|
5265
|
+
let i = lo(r);
|
|
5266
|
+
if (i == null || !po(i)) return /* @__PURE__ */ b("span", {
|
|
5267
|
+
style: ko,
|
|
5260
5268
|
children: r
|
|
5261
5269
|
});
|
|
5262
|
-
let a =
|
|
5270
|
+
let a = uo(i), o = fo(i, a ?? "") ?? a ?? r;
|
|
5263
5271
|
return /* @__PURE__ */ x("a", {
|
|
5264
5272
|
href: i,
|
|
5265
5273
|
target: "_blank",
|
|
5266
5274
|
rel: "noopener noreferrer",
|
|
5267
5275
|
title: r,
|
|
5268
5276
|
className: "mono",
|
|
5269
|
-
style:
|
|
5277
|
+
style: Oo,
|
|
5270
5278
|
children: [
|
|
5271
|
-
/* @__PURE__ */ b(
|
|
5279
|
+
/* @__PURE__ */ b(Eo, {
|
|
5272
5280
|
domain: a,
|
|
5273
5281
|
source: n
|
|
5274
5282
|
}),
|
|
@@ -5277,45 +5285,45 @@ var $ = /* @__PURE__ */ b("span", {
|
|
|
5277
5285
|
]
|
|
5278
5286
|
});
|
|
5279
5287
|
};
|
|
5280
|
-
},
|
|
5288
|
+
}, jo = {
|
|
5281
5289
|
fontSize: 12.5,
|
|
5282
5290
|
color: "var(--accent)",
|
|
5283
5291
|
textDecoration: "none"
|
|
5284
|
-
},
|
|
5292
|
+
}, Mo = () => (e) => {
|
|
5285
5293
|
let t = e == null ? "" : R(e);
|
|
5286
5294
|
return t ? /* @__PURE__ */ b("a", {
|
|
5287
5295
|
href: `mailto:${t}`,
|
|
5288
5296
|
className: "mono",
|
|
5289
|
-
style:
|
|
5297
|
+
style: jo,
|
|
5290
5298
|
children: t
|
|
5291
5299
|
}) : $;
|
|
5292
|
-
},
|
|
5300
|
+
}, No = {
|
|
5293
5301
|
fontSize: 12.5,
|
|
5294
5302
|
color: "var(--accent)",
|
|
5295
5303
|
textDecoration: "none"
|
|
5296
|
-
},
|
|
5304
|
+
}, Po = { fontSize: 12.5 }, Fo = /^[+()\-.\s\d]+$/, Io = () => (e) => {
|
|
5297
5305
|
let t = e == null ? "" : R(e);
|
|
5298
5306
|
if (!t) return $;
|
|
5299
5307
|
let n = t.trim();
|
|
5300
|
-
if (!
|
|
5301
|
-
style:
|
|
5308
|
+
if (!Fo.test(n)) return /* @__PURE__ */ b("span", {
|
|
5309
|
+
style: Po,
|
|
5302
5310
|
children: t
|
|
5303
5311
|
});
|
|
5304
5312
|
let r = n.replace(/\s+/g, "");
|
|
5305
5313
|
return /* @__PURE__ */ b("a", {
|
|
5306
5314
|
href: `tel:${r}`,
|
|
5307
5315
|
className: "mono",
|
|
5308
|
-
style:
|
|
5316
|
+
style: No,
|
|
5309
5317
|
children: t
|
|
5310
5318
|
});
|
|
5311
|
-
},
|
|
5319
|
+
}, Lo = {
|
|
5312
5320
|
fontSize: 12.5,
|
|
5313
5321
|
fontVariantNumeric: "tabular-nums"
|
|
5314
|
-
},
|
|
5322
|
+
}, Ro = {
|
|
5315
5323
|
color: "var(--text-3)",
|
|
5316
5324
|
marginLeft: 4
|
|
5317
|
-
},
|
|
5318
|
-
function
|
|
5325
|
+
}, zo = { fontSize: 12.5 };
|
|
5326
|
+
function Bo(e, t) {
|
|
5319
5327
|
let n = e.trim();
|
|
5320
5328
|
if (n === "" || n === "-") return n;
|
|
5321
5329
|
let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
|
|
@@ -5327,45 +5335,45 @@ function zo(e, t) {
|
|
|
5327
5335
|
let s = r ? `-${o}` : o;
|
|
5328
5336
|
return a !== void 0 && (s += `.${a}`), s;
|
|
5329
5337
|
}
|
|
5330
|
-
var
|
|
5338
|
+
var Vo = (e) => {
|
|
5331
5339
|
let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
|
|
5332
5340
|
return (e, t) => {
|
|
5333
5341
|
if (e == null) return $;
|
|
5334
5342
|
let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
|
|
5335
|
-
if (a && typeof e == "string") s =
|
|
5343
|
+
if (a && typeof e == "string") s = Bo(e, i);
|
|
5336
5344
|
else {
|
|
5337
5345
|
let t = typeof e == "number" ? e : Number(e);
|
|
5338
5346
|
s = Number.isFinite(t) ? i.format(t) : null;
|
|
5339
5347
|
}
|
|
5340
5348
|
return s == null ? /* @__PURE__ */ b("span", {
|
|
5341
|
-
style:
|
|
5349
|
+
style: zo,
|
|
5342
5350
|
children: "—"
|
|
5343
5351
|
}) : /* @__PURE__ */ x("span", {
|
|
5344
5352
|
className: "num",
|
|
5345
|
-
style:
|
|
5353
|
+
style: Lo,
|
|
5346
5354
|
children: [s, r && /* @__PURE__ */ b("span", {
|
|
5347
|
-
style:
|
|
5355
|
+
style: Ro,
|
|
5348
5356
|
children: r
|
|
5349
5357
|
})]
|
|
5350
5358
|
});
|
|
5351
5359
|
};
|
|
5352
|
-
},
|
|
5360
|
+
}, Ho = { fontSize: 12.5 }, Uo = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ b("code", {
|
|
5353
5361
|
className: "mono",
|
|
5354
|
-
style:
|
|
5362
|
+
style: Ho,
|
|
5355
5363
|
children: R(e)
|
|
5356
|
-
}),
|
|
5364
|
+
}), Wo = {
|
|
5357
5365
|
display: "inline-flex",
|
|
5358
5366
|
alignItems: "center",
|
|
5359
5367
|
gap: 4,
|
|
5360
5368
|
fontSize: 12.5,
|
|
5361
5369
|
color: "var(--accent)",
|
|
5362
5370
|
textDecoration: "none"
|
|
5363
|
-
},
|
|
5371
|
+
}, Go = { fontSize: 12.5 }, Ko = () => (e) => {
|
|
5364
5372
|
let n = e == null ? "" : R(e);
|
|
5365
5373
|
if (!n) return $;
|
|
5366
|
-
let r =
|
|
5367
|
-
return r == null || !
|
|
5368
|
-
style:
|
|
5374
|
+
let r = lo(n);
|
|
5375
|
+
return r == null || !po(r) ? /* @__PURE__ */ b("span", {
|
|
5376
|
+
style: Go,
|
|
5369
5377
|
children: n
|
|
5370
5378
|
}) : /* @__PURE__ */ x("a", {
|
|
5371
5379
|
href: r,
|
|
@@ -5373,21 +5381,21 @@ var Bo = (e) => {
|
|
|
5373
5381
|
rel: "noopener noreferrer",
|
|
5374
5382
|
title: n,
|
|
5375
5383
|
className: "mono",
|
|
5376
|
-
style:
|
|
5384
|
+
style: Wo,
|
|
5377
5385
|
children: [n, /* @__PURE__ */ b(t.external, { size: 11 })]
|
|
5378
5386
|
});
|
|
5379
|
-
},
|
|
5380
|
-
function
|
|
5381
|
-
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) :
|
|
5387
|
+
}, qo = 400, Jo = 2e3;
|
|
5388
|
+
function Yo(e) {
|
|
5389
|
+
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : qo, Jo));
|
|
5382
5390
|
}
|
|
5383
|
-
function
|
|
5391
|
+
function Xo(e, t) {
|
|
5384
5392
|
return e.length <= t ? e : `${e.slice(0, t)}...`;
|
|
5385
5393
|
}
|
|
5386
|
-
function
|
|
5394
|
+
function Zo(e, t, n, r = 0) {
|
|
5387
5395
|
if (e == null || e === "") return "";
|
|
5388
|
-
if (typeof e == "string") return
|
|
5396
|
+
if (typeof e == "string") return Xo(e, t);
|
|
5389
5397
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
5390
|
-
if (typeof e != "object") return
|
|
5398
|
+
if (typeof e != "object") return Xo(R(e), t);
|
|
5391
5399
|
if (n.has(e)) return "[Circular]";
|
|
5392
5400
|
if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
|
|
5393
5401
|
n.add(e);
|
|
@@ -5398,30 +5406,30 @@ function Xo(e, t, n, r = 0) {
|
|
|
5398
5406
|
a.push(a.length > 1 ? ",..." : "...");
|
|
5399
5407
|
break;
|
|
5400
5408
|
}
|
|
5401
|
-
let f =
|
|
5409
|
+
let f = Zo(c, d, n, r + 1);
|
|
5402
5410
|
if (a.push(u, f), a.join("").length >= t) {
|
|
5403
5411
|
a.push(",...");
|
|
5404
5412
|
break;
|
|
5405
5413
|
}
|
|
5406
5414
|
}
|
|
5407
|
-
return a.push(i), n.delete(e),
|
|
5415
|
+
return a.push(i), n.delete(e), Xo(a.join(""), t);
|
|
5408
5416
|
}
|
|
5409
|
-
function
|
|
5410
|
-
return
|
|
5417
|
+
function Qo(e, t) {
|
|
5418
|
+
return Zo(e, t, /* @__PURE__ */ new WeakSet());
|
|
5411
5419
|
}
|
|
5412
|
-
var
|
|
5413
|
-
let t = e.surface ?? "detail", n =
|
|
5420
|
+
var $o = (e) => {
|
|
5421
|
+
let t = e.surface ?? "detail", n = Yo(e.field.display?.list_preview?.max_chars);
|
|
5414
5422
|
return (r) => {
|
|
5415
|
-
if (
|
|
5423
|
+
if (Vi(r)) return $;
|
|
5416
5424
|
if (t === "list") {
|
|
5417
|
-
let e =
|
|
5425
|
+
let e = Qo(r, n);
|
|
5418
5426
|
return /* @__PURE__ */ b("span", {
|
|
5419
5427
|
className: "font-mono text-xs text-muted-foreground",
|
|
5420
5428
|
title: e,
|
|
5421
5429
|
children: e
|
|
5422
5430
|
});
|
|
5423
5431
|
}
|
|
5424
|
-
return /* @__PURE__ */ b(
|
|
5432
|
+
return /* @__PURE__ */ b(Hi, {
|
|
5425
5433
|
field: e.field,
|
|
5426
5434
|
fieldName: e.fieldName,
|
|
5427
5435
|
value: r,
|
|
@@ -5429,7 +5437,7 @@ var Qo = (e) => {
|
|
|
5429
5437
|
locale: e.locale
|
|
5430
5438
|
});
|
|
5431
5439
|
};
|
|
5432
|
-
},
|
|
5440
|
+
}, es = [
|
|
5433
5441
|
{
|
|
5434
5442
|
pattern: /```[^\n]*\n?([\s\S]*?)```/g,
|
|
5435
5443
|
replacement: "$1"
|
|
@@ -5492,13 +5500,13 @@ var Qo = (e) => {
|
|
|
5492
5500
|
replacement: ""
|
|
5493
5501
|
}
|
|
5494
5502
|
];
|
|
5495
|
-
function
|
|
5503
|
+
function ts(e) {
|
|
5496
5504
|
if (!e) return {
|
|
5497
5505
|
text: "",
|
|
5498
5506
|
isPlain: !0
|
|
5499
5507
|
};
|
|
5500
5508
|
let t = e, n = !1;
|
|
5501
|
-
for (let e of
|
|
5509
|
+
for (let e of es) {
|
|
5502
5510
|
let r = t.replace(e.pattern, e.replacement);
|
|
5503
5511
|
r !== t && e.structural !== !1 && (n = !0), t = r;
|
|
5504
5512
|
}
|
|
@@ -5509,123 +5517,123 @@ function es(e) {
|
|
|
5509
5517
|
}
|
|
5510
5518
|
//#endregion
|
|
5511
5519
|
//#region src/components/fields/cells/factories/markdown.tsx
|
|
5512
|
-
function
|
|
5513
|
-
return /* @__PURE__ */ b(
|
|
5520
|
+
function ns(e) {
|
|
5521
|
+
return /* @__PURE__ */ b(ti, { content: e });
|
|
5514
5522
|
}
|
|
5515
|
-
var
|
|
5523
|
+
var rs = (e) => {
|
|
5516
5524
|
let t = e.surface === "list";
|
|
5517
5525
|
return (e) => {
|
|
5518
5526
|
let n = e == null ? "" : R(e);
|
|
5519
5527
|
if (!n) return $;
|
|
5520
|
-
if (!t) return
|
|
5521
|
-
let { text: r, isPlain: i } =
|
|
5528
|
+
if (!t) return ns(n);
|
|
5529
|
+
let { text: r, isPlain: i } = ts(n);
|
|
5522
5530
|
return i ? /* @__PURE__ */ b("span", {
|
|
5523
5531
|
title: r,
|
|
5524
5532
|
children: r
|
|
5525
|
-
}) : /* @__PURE__ */ b(
|
|
5526
|
-
content:
|
|
5533
|
+
}) : /* @__PURE__ */ b(se, {
|
|
5534
|
+
content: ns(n),
|
|
5527
5535
|
children: /* @__PURE__ */ b("span", {
|
|
5528
5536
|
title: r,
|
|
5529
5537
|
children: r
|
|
5530
5538
|
})
|
|
5531
5539
|
});
|
|
5532
5540
|
};
|
|
5533
|
-
},
|
|
5541
|
+
}, is = "[SET]", as = {
|
|
5534
5542
|
fontSize: 12.5,
|
|
5535
5543
|
color: "var(--text-3)"
|
|
5536
|
-
},
|
|
5544
|
+
}, os = {
|
|
5537
5545
|
fontSize: 12.5,
|
|
5538
5546
|
color: "var(--text-4)",
|
|
5539
5547
|
fontStyle: "italic"
|
|
5540
|
-
},
|
|
5548
|
+
}, ss = () => (e) => e === is || typeof e == "string" && e !== "" ? /* @__PURE__ */ b("span", {
|
|
5541
5549
|
className: "mono",
|
|
5542
|
-
style: is,
|
|
5543
|
-
children: rs
|
|
5544
|
-
}) : /* @__PURE__ */ b("span", {
|
|
5545
5550
|
style: as,
|
|
5551
|
+
children: is
|
|
5552
|
+
}) : /* @__PURE__ */ b("span", {
|
|
5553
|
+
style: os,
|
|
5546
5554
|
children: "Not set"
|
|
5547
5555
|
});
|
|
5548
5556
|
//#endregion
|
|
5549
5557
|
//#region src/components/fields/cells/factories/richTextPreview.tsx
|
|
5550
|
-
function
|
|
5551
|
-
return /* @__PURE__ */ b(
|
|
5558
|
+
function cs(e, t) {
|
|
5559
|
+
return /* @__PURE__ */ b(ti, {
|
|
5552
5560
|
content: e,
|
|
5553
5561
|
files: t
|
|
5554
5562
|
});
|
|
5555
5563
|
}
|
|
5556
|
-
var
|
|
5564
|
+
var ls = (e) => {
|
|
5557
5565
|
let { fieldName: t } = e, n = e.surface === "list";
|
|
5558
5566
|
return (e, r) => {
|
|
5559
|
-
let i = r?.$files?.[t], a =
|
|
5567
|
+
let i = r?.$files?.[t], a = ca(e, i);
|
|
5560
5568
|
if (!a.markdown) return $;
|
|
5561
|
-
if (!n) return
|
|
5562
|
-
let { text: o, isPlain: s } =
|
|
5569
|
+
if (!n) return cs(a.markdown, a.files);
|
|
5570
|
+
let { text: o, isPlain: s } = ts(a.markdown);
|
|
5563
5571
|
return s ? /* @__PURE__ */ b("span", {
|
|
5564
5572
|
title: o,
|
|
5565
5573
|
children: o
|
|
5566
|
-
}) : /* @__PURE__ */ b(
|
|
5567
|
-
content:
|
|
5574
|
+
}) : /* @__PURE__ */ b(se, {
|
|
5575
|
+
content: cs(a.markdown, a.files),
|
|
5568
5576
|
children: /* @__PURE__ */ b("span", {
|
|
5569
5577
|
title: o,
|
|
5570
5578
|
children: o
|
|
5571
5579
|
})
|
|
5572
5580
|
});
|
|
5573
5581
|
};
|
|
5574
|
-
},
|
|
5582
|
+
}, us = { fontSize: 12.5 }, ds = {
|
|
5575
5583
|
fontSize: 12.5,
|
|
5576
5584
|
whiteSpace: "pre-wrap",
|
|
5577
5585
|
margin: 0
|
|
5578
5586
|
};
|
|
5579
|
-
function
|
|
5587
|
+
function fs(e) {
|
|
5580
5588
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
5581
5589
|
}
|
|
5582
|
-
function
|
|
5590
|
+
function ps(e, t) {
|
|
5583
5591
|
if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
|
|
5584
5592
|
for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
|
|
5585
5593
|
return null;
|
|
5586
5594
|
}
|
|
5587
5595
|
//#endregion
|
|
5588
5596
|
//#region src/components/fields/cells/registry.ts
|
|
5589
|
-
var
|
|
5590
|
-
text:
|
|
5591
|
-
bool_pill:
|
|
5592
|
-
badge:
|
|
5593
|
-
status_pill:
|
|
5594
|
-
tag_list:
|
|
5595
|
-
time_ago:
|
|
5596
|
-
timestamp_full:
|
|
5597
|
-
next_run:
|
|
5598
|
-
money:
|
|
5599
|
-
ref_link:
|
|
5600
|
-
url:
|
|
5601
|
-
email:
|
|
5602
|
-
phone:
|
|
5603
|
-
number:
|
|
5604
|
-
code:
|
|
5605
|
-
link:
|
|
5606
|
-
json:
|
|
5607
|
-
markdown:
|
|
5608
|
-
password_mask:
|
|
5609
|
-
rich_text_preview:
|
|
5597
|
+
var ms = {
|
|
5598
|
+
text: Ia,
|
|
5599
|
+
bool_pill: La,
|
|
5600
|
+
badge: Ha,
|
|
5601
|
+
status_pill: Ga,
|
|
5602
|
+
tag_list: Ja,
|
|
5603
|
+
time_ago: Ya,
|
|
5604
|
+
timestamp_full: Xa,
|
|
5605
|
+
next_run: $a,
|
|
5606
|
+
money: eo,
|
|
5607
|
+
ref_link: ro,
|
|
5608
|
+
url: Ao,
|
|
5609
|
+
email: Mo,
|
|
5610
|
+
phone: Io,
|
|
5611
|
+
number: Vo,
|
|
5612
|
+
code: Uo,
|
|
5613
|
+
link: Ko,
|
|
5614
|
+
json: $o,
|
|
5615
|
+
markdown: rs,
|
|
5616
|
+
password_mask: ss,
|
|
5617
|
+
rich_text_preview: ls,
|
|
5610
5618
|
multilang_inline: (e) => {
|
|
5611
5619
|
let { field: t, locale: n } = e, r = t.type === "multilang_text";
|
|
5612
5620
|
return (e) => {
|
|
5613
|
-
let t = fs(
|
|
5621
|
+
let t = ps(fs(e), n);
|
|
5614
5622
|
if (!t) return r ? /* @__PURE__ */ b("p", {
|
|
5615
|
-
style:
|
|
5623
|
+
style: ds,
|
|
5616
5624
|
children: "—"
|
|
5617
5625
|
}) : /* @__PURE__ */ b("span", {
|
|
5618
|
-
style:
|
|
5626
|
+
style: us,
|
|
5619
5627
|
children: "—"
|
|
5620
5628
|
});
|
|
5621
5629
|
let [i, a] = t;
|
|
5622
5630
|
return r ? /* @__PURE__ */ b("p", {
|
|
5623
|
-
style:
|
|
5631
|
+
style: ds,
|
|
5624
5632
|
lang: i,
|
|
5625
5633
|
dir: "auto",
|
|
5626
5634
|
children: a
|
|
5627
5635
|
}) : /* @__PURE__ */ b("span", {
|
|
5628
|
-
style:
|
|
5636
|
+
style: us,
|
|
5629
5637
|
lang: i,
|
|
5630
5638
|
dir: "auto",
|
|
5631
5639
|
children: a
|
|
@@ -5633,53 +5641,53 @@ var ps = {
|
|
|
5633
5641
|
};
|
|
5634
5642
|
}
|
|
5635
5643
|
};
|
|
5636
|
-
Object.keys(
|
|
5637
|
-
function
|
|
5638
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
5644
|
+
Object.keys(ms).sort();
|
|
5645
|
+
function hs(e) {
|
|
5646
|
+
let t = e.field.display?.widget ?? "text", n = ms[t];
|
|
5639
5647
|
if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
|
|
5640
5648
|
return n(e);
|
|
5641
5649
|
}
|
|
5642
5650
|
//#endregion
|
|
5643
5651
|
//#region src/components/fields/index.tsx
|
|
5644
|
-
var
|
|
5645
|
-
string:
|
|
5646
|
-
text:
|
|
5647
|
-
rich_text:
|
|
5648
|
-
int:
|
|
5649
|
-
float:
|
|
5650
|
-
decimal:
|
|
5651
|
-
bool:
|
|
5652
|
-
timestamp:
|
|
5653
|
-
date:
|
|
5654
|
-
time:
|
|
5655
|
-
enum:
|
|
5656
|
-
email:
|
|
5657
|
-
url:
|
|
5658
|
-
phone:
|
|
5659
|
-
uuid:
|
|
5660
|
-
bytes:
|
|
5661
|
-
ref:
|
|
5662
|
-
json:
|
|
5663
|
-
tags:
|
|
5664
|
-
string_array:
|
|
5665
|
-
int_array:
|
|
5666
|
-
uuid_array:
|
|
5667
|
-
multilang:
|
|
5668
|
-
multilang_text:
|
|
5669
|
-
structure:
|
|
5670
|
-
secret:
|
|
5671
|
-
password:
|
|
5652
|
+
var gs = {
|
|
5653
|
+
string: fi,
|
|
5654
|
+
text: pi,
|
|
5655
|
+
rich_text: Na,
|
|
5656
|
+
int: Ai,
|
|
5657
|
+
float: Ai,
|
|
5658
|
+
decimal: Ai,
|
|
5659
|
+
bool: Di,
|
|
5660
|
+
timestamp: Ei,
|
|
5661
|
+
date: Ei,
|
|
5662
|
+
time: Ei,
|
|
5663
|
+
enum: hi,
|
|
5664
|
+
email: gi,
|
|
5665
|
+
url: _i,
|
|
5666
|
+
phone: vi,
|
|
5667
|
+
uuid: fi,
|
|
5668
|
+
bytes: fi,
|
|
5669
|
+
ref: Ri,
|
|
5670
|
+
json: Hi,
|
|
5671
|
+
tags: fi,
|
|
5672
|
+
string_array: ta,
|
|
5673
|
+
int_array: aa,
|
|
5674
|
+
uuid_array: ta,
|
|
5675
|
+
multilang: Wi,
|
|
5676
|
+
multilang_text: Ki,
|
|
5677
|
+
structure: qi,
|
|
5678
|
+
secret: Zi,
|
|
5679
|
+
password: $i
|
|
5672
5680
|
};
|
|
5673
|
-
for (let e of
|
|
5674
|
-
function
|
|
5675
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(
|
|
5681
|
+
for (let e of ui) if (!gs[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
|
|
5682
|
+
function _s(e) {
|
|
5683
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(qi, { ...e });
|
|
5676
5684
|
if (e.mode === "edit") {
|
|
5677
|
-
let t =
|
|
5685
|
+
let t = gs[e.field.type];
|
|
5678
5686
|
if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
|
|
5679
5687
|
return /* @__PURE__ */ b(t, { ...e });
|
|
5680
5688
|
}
|
|
5681
5689
|
if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
|
|
5682
|
-
return
|
|
5690
|
+
return hs({
|
|
5683
5691
|
field: e.field,
|
|
5684
5692
|
fieldName: e.fieldName,
|
|
5685
5693
|
surface: e.surface ?? "detail",
|
|
@@ -5692,30 +5700,30 @@ function gs(e) {
|
|
|
5692
5700
|
}
|
|
5693
5701
|
//#endregion
|
|
5694
5702
|
//#region src/hooks/useUserLocale.ts
|
|
5695
|
-
var
|
|
5696
|
-
function
|
|
5703
|
+
var vs = "en";
|
|
5704
|
+
function ys() {
|
|
5697
5705
|
if (typeof navigator > "u") return;
|
|
5698
5706
|
let e = navigator.language;
|
|
5699
5707
|
if (e) return e.split("-")[0] || void 0;
|
|
5700
5708
|
}
|
|
5701
|
-
function
|
|
5702
|
-
let e =
|
|
5709
|
+
function bs() {
|
|
5710
|
+
let e = Yn((e) => e.user), { data: t } = X(), n = e?.language;
|
|
5703
5711
|
if (n && n.trim()) return n;
|
|
5704
5712
|
let r = t?.languages?.[0]?.code;
|
|
5705
|
-
return r && r.trim() ? r :
|
|
5713
|
+
return r && r.trim() ? r : ys() || vs;
|
|
5706
5714
|
}
|
|
5707
5715
|
//#endregion
|
|
5708
5716
|
//#region src/lib/actions.ts
|
|
5709
|
-
var
|
|
5717
|
+
var xs = {
|
|
5710
5718
|
__create: "create",
|
|
5711
5719
|
__edit: "update",
|
|
5712
5720
|
__delete: "delete",
|
|
5713
5721
|
__restore: "restore"
|
|
5714
|
-
},
|
|
5715
|
-
function
|
|
5722
|
+
}, Ss = "__peek", Cs = "__open";
|
|
5723
|
+
function ws(e) {
|
|
5716
5724
|
return e === "__peek" || e === "__open";
|
|
5717
5725
|
}
|
|
5718
|
-
function
|
|
5726
|
+
function Ts(e, t) {
|
|
5719
5727
|
if (!e) return "";
|
|
5720
5728
|
if (t) try {
|
|
5721
5729
|
return it(t, tt(t, e));
|
|
@@ -5723,26 +5731,26 @@ function ws(e, t) {
|
|
|
5723
5731
|
let n = e.id;
|
|
5724
5732
|
return typeof n == "string" ? n : n == null ? "" : R(n);
|
|
5725
5733
|
}
|
|
5726
|
-
function
|
|
5734
|
+
function Es(e, t) {
|
|
5727
5735
|
if (!e || e.length === 0) return !0;
|
|
5728
5736
|
for (let n of e) {
|
|
5729
5737
|
if (n.status && n.status.length > 0) {
|
|
5730
5738
|
let e = t.status;
|
|
5731
5739
|
if (typeof e != "string" || !n.status.includes(e)) return !1;
|
|
5732
5740
|
}
|
|
5733
|
-
if (n.field && !
|
|
5741
|
+
if (n.field && !Ds(n, t)) return !1;
|
|
5734
5742
|
}
|
|
5735
5743
|
return !0;
|
|
5736
5744
|
}
|
|
5737
|
-
function
|
|
5738
|
-
let n =
|
|
5745
|
+
function Ds(e, t) {
|
|
5746
|
+
let n = Os(t, e.field), r = e.op || "eq";
|
|
5739
5747
|
if (r === "in" || r === "not_in") {
|
|
5740
5748
|
let t = Array.isArray(e.value) ? e.value : [e.value], i = R(n), a = t.some((e) => R(e) === i);
|
|
5741
5749
|
return r === "in" ? a : !a;
|
|
5742
5750
|
}
|
|
5743
|
-
return typeof e.value == "boolean" && r === "eq" ?
|
|
5751
|
+
return typeof e.value == "boolean" && r === "eq" ? As(n) === e.value : typeof n == "number" && typeof e.value == "number" ? js(n, e.value, r) : js(R(n), R(e.value), r);
|
|
5744
5752
|
}
|
|
5745
|
-
function
|
|
5753
|
+
function Os(e, t) {
|
|
5746
5754
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5747
5755
|
if (t.startsWith("$status.")) {
|
|
5748
5756
|
let n = t.slice(8), r = e.$statuses;
|
|
@@ -5753,27 +5761,27 @@ function Ds(e, t) {
|
|
|
5753
5761
|
return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.property_code === n)?.value : void 0;
|
|
5754
5762
|
}
|
|
5755
5763
|
}
|
|
5756
|
-
function
|
|
5764
|
+
function ks(e) {
|
|
5757
5765
|
let t = null, n = (n, r) => {
|
|
5758
5766
|
Object.prototype.hasOwnProperty.call(e, n) || (t === null && (t = { ...e }), t[n] = r);
|
|
5759
5767
|
}, r = e.$statuses;
|
|
5760
5768
|
if (Array.isArray(r)) for (let t of r) {
|
|
5761
5769
|
if (!t || typeof t != "object") continue;
|
|
5762
5770
|
let r = t.group_code;
|
|
5763
|
-
typeof r == "string" && n(`$status.${r}`,
|
|
5771
|
+
typeof r == "string" && n(`$status.${r}`, Os(e, `$status.${r}`));
|
|
5764
5772
|
}
|
|
5765
5773
|
let i = e.$properties;
|
|
5766
5774
|
if (Array.isArray(i)) for (let t of i) {
|
|
5767
5775
|
if (!t || typeof t != "object") continue;
|
|
5768
5776
|
let r = t.property_code;
|
|
5769
|
-
typeof r == "string" && n(`$property.${r}`,
|
|
5777
|
+
typeof r == "string" && n(`$property.${r}`, Os(e, `$property.${r}`));
|
|
5770
5778
|
}
|
|
5771
5779
|
return t ?? e;
|
|
5772
5780
|
}
|
|
5773
|
-
function
|
|
5781
|
+
function As(e) {
|
|
5774
5782
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
|
|
5775
5783
|
}
|
|
5776
|
-
function
|
|
5784
|
+
function js(e, t, n) {
|
|
5777
5785
|
switch (n) {
|
|
5778
5786
|
case "eq": return e === t;
|
|
5779
5787
|
case "ne": return e !== t;
|
|
@@ -5786,14 +5794,14 @@ function As(e, t, n) {
|
|
|
5786
5794
|
default: return !1;
|
|
5787
5795
|
}
|
|
5788
5796
|
}
|
|
5789
|
-
function
|
|
5797
|
+
function Ms(e, t) {
|
|
5790
5798
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).map(([e, t]) => ({
|
|
5791
5799
|
code: e,
|
|
5792
5800
|
action: t
|
|
5793
5801
|
})) : [];
|
|
5794
5802
|
}
|
|
5795
|
-
function
|
|
5796
|
-
return !e && !r ? [] : t === void 0 ?
|
|
5803
|
+
function Ns(e, t, n, r) {
|
|
5804
|
+
return !e && !r ? [] : t === void 0 ? Ms(e, n) : t.map((t) => {
|
|
5797
5805
|
let n = e?.[t] ?? r?.[t];
|
|
5798
5806
|
return n ? {
|
|
5799
5807
|
code: t,
|
|
@@ -5801,34 +5809,34 @@ function Ms(e, t, n, r) {
|
|
|
5801
5809
|
} : null;
|
|
5802
5810
|
}).filter((e) => e !== null);
|
|
5803
5811
|
}
|
|
5804
|
-
function
|
|
5812
|
+
function Ps(e, t) {
|
|
5805
5813
|
return e.filter(({ code: e }) => {
|
|
5806
|
-
let n =
|
|
5814
|
+
let n = xs[e];
|
|
5807
5815
|
return !n || $e(t, n);
|
|
5808
5816
|
});
|
|
5809
5817
|
}
|
|
5810
|
-
var
|
|
5818
|
+
var Fs = {
|
|
5811
5819
|
en: "This action cannot be undone.",
|
|
5812
5820
|
ru: "Это действие нельзя отменить."
|
|
5813
5821
|
};
|
|
5814
|
-
function
|
|
5822
|
+
function Is(e) {
|
|
5815
5823
|
return !!e?.confirmation && Object.keys(e.confirmation).length > 0;
|
|
5816
5824
|
}
|
|
5817
|
-
function
|
|
5818
|
-
return
|
|
5825
|
+
function Ls(e, t) {
|
|
5826
|
+
return Is(e) ? z(e.confirmation, t) : e?.destructive ? z(Fs, t) : null;
|
|
5819
5827
|
}
|
|
5820
|
-
function
|
|
5821
|
-
return
|
|
5828
|
+
function Rs(e) {
|
|
5829
|
+
return Is(e) || !!e?.destructive;
|
|
5822
5830
|
}
|
|
5823
|
-
function
|
|
5831
|
+
function zs(e, t, n, r, i = !1) {
|
|
5824
5832
|
if (n && r) return r;
|
|
5825
|
-
let
|
|
5826
|
-
return
|
|
5833
|
+
let a = z(e?.display?.description);
|
|
5834
|
+
return a ? i || e?.display?.icon_only === !0 ? `${t}\n${a}` : a : t;
|
|
5827
5835
|
}
|
|
5828
|
-
function
|
|
5836
|
+
function Bs(e) {
|
|
5829
5837
|
return !!e.association;
|
|
5830
5838
|
}
|
|
5831
|
-
function
|
|
5839
|
+
function Vs(e, t) {
|
|
5832
5840
|
if (e) {
|
|
5833
5841
|
for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
|
|
5834
5842
|
let r = e.entities[t];
|
|
@@ -5839,21 +5847,21 @@ function Bs(e, t) {
|
|
|
5839
5847
|
}
|
|
5840
5848
|
}
|
|
5841
5849
|
}
|
|
5842
|
-
function
|
|
5850
|
+
function Hs(e, t, n, r, i, a) {
|
|
5843
5851
|
let o = [];
|
|
5844
5852
|
for (let s of e) {
|
|
5845
|
-
let e =
|
|
5853
|
+
let e = Us(s, t, n, r, i, a);
|
|
5846
5854
|
e !== null && o.push(e);
|
|
5847
5855
|
}
|
|
5848
5856
|
return o;
|
|
5849
5857
|
}
|
|
5850
|
-
function Hs(e, t, n, r, i, a) {
|
|
5851
|
-
return e.kind === "group" ? Us(e, t, n, r, i, a) : Ws(e, t, n, r, i, a);
|
|
5852
|
-
}
|
|
5853
5858
|
function Us(e, t, n, r, i, a) {
|
|
5859
|
+
return e.kind === "group" ? Ws(e, t, n, r, i, a) : Gs(e, t, n, r, i, a);
|
|
5860
|
+
}
|
|
5861
|
+
function Ws(e, t, n, r, i, a) {
|
|
5854
5862
|
let o = [];
|
|
5855
5863
|
for (let s of e.items) {
|
|
5856
|
-
let e =
|
|
5864
|
+
let e = Us(s, t, n, r, i, a);
|
|
5857
5865
|
e !== null && o.push(e);
|
|
5858
5866
|
}
|
|
5859
5867
|
return o.length === 0 ? null : {
|
|
@@ -5861,32 +5869,32 @@ function Us(e, t, n, r, i, a) {
|
|
|
5861
5869
|
items: o
|
|
5862
5870
|
};
|
|
5863
5871
|
}
|
|
5864
|
-
function
|
|
5872
|
+
function Gs(e, t, n, r, i, a) {
|
|
5865
5873
|
if (a && !e.code.startsWith("__") && !a.has(e.code)) return null;
|
|
5866
|
-
let o =
|
|
5874
|
+
let o = Js(e.code, t, n);
|
|
5867
5875
|
if (!o) return null;
|
|
5868
5876
|
if (i.length > 0) {
|
|
5869
|
-
let t =
|
|
5877
|
+
let t = Ks(o, i);
|
|
5870
5878
|
return t.visible ? {
|
|
5871
5879
|
...e,
|
|
5872
5880
|
enabled: t.enabled,
|
|
5873
5881
|
reason: t.reason
|
|
5874
5882
|
} : null;
|
|
5875
5883
|
}
|
|
5876
|
-
if (!
|
|
5877
|
-
let { enabled: s, reason: c } =
|
|
5884
|
+
if (!Es(o.conditions, r) || !Es(Ys(o.visible_if), r)) return null;
|
|
5885
|
+
let { enabled: s, reason: c } = qs(o, r);
|
|
5878
5886
|
return {
|
|
5879
5887
|
...e,
|
|
5880
5888
|
enabled: s,
|
|
5881
5889
|
reason: c
|
|
5882
5890
|
};
|
|
5883
5891
|
}
|
|
5884
|
-
function
|
|
5885
|
-
let n =
|
|
5892
|
+
function Ks(e, t) {
|
|
5893
|
+
let n = Ys(e.visible_if), r = Ys(e.enabled_if), i = e.conditions, a = Xs(e.enabled_if_reason), o = 0, s = 0;
|
|
5886
5894
|
for (let e of t) {
|
|
5887
|
-
let t =
|
|
5895
|
+
let t = Es(n, e) && Es(i, e);
|
|
5888
5896
|
t && o++;
|
|
5889
|
-
let a =
|
|
5897
|
+
let a = Es(r, e);
|
|
5890
5898
|
(!t || !a) && s++;
|
|
5891
5899
|
}
|
|
5892
5900
|
if (o === 0) return {
|
|
@@ -5906,14 +5914,14 @@ function Gs(e, t) {
|
|
|
5906
5914
|
reason: a ? `${a} ${c}` : c
|
|
5907
5915
|
};
|
|
5908
5916
|
}
|
|
5909
|
-
function
|
|
5910
|
-
let n =
|
|
5917
|
+
function qs(e, t) {
|
|
5918
|
+
let n = Ys(e.enabled_if);
|
|
5911
5919
|
if (!n || n.length === 0) return {
|
|
5912
5920
|
enabled: !0,
|
|
5913
5921
|
reason: null
|
|
5914
5922
|
};
|
|
5915
|
-
let r =
|
|
5916
|
-
return
|
|
5923
|
+
let r = Xs(e.enabled_if_reason);
|
|
5924
|
+
return Es(n, t) ? {
|
|
5917
5925
|
enabled: !0,
|
|
5918
5926
|
reason: null
|
|
5919
5927
|
} : {
|
|
@@ -5921,52 +5929,52 @@ function Ks(e, t) {
|
|
|
5921
5929
|
reason: r
|
|
5922
5930
|
};
|
|
5923
5931
|
}
|
|
5924
|
-
function
|
|
5932
|
+
function Js(e, t, n) {
|
|
5925
5933
|
if (t && e in t) return t[e];
|
|
5926
5934
|
if (n && e in n) return n[e];
|
|
5927
5935
|
}
|
|
5928
|
-
function
|
|
5936
|
+
function Ys(e) {
|
|
5929
5937
|
return e;
|
|
5930
5938
|
}
|
|
5931
|
-
function
|
|
5939
|
+
function Xs(e) {
|
|
5932
5940
|
if (!e) return null;
|
|
5933
5941
|
if (e.en) return e.en;
|
|
5934
5942
|
let t = Object.values(e);
|
|
5935
5943
|
return t.length > 0 ? t[0] : null;
|
|
5936
5944
|
}
|
|
5937
|
-
function
|
|
5945
|
+
function Zs(e, t, n, r, i) {
|
|
5938
5946
|
let a = [];
|
|
5939
5947
|
for (let o of e) {
|
|
5940
5948
|
if (o.kind === "group") {
|
|
5941
|
-
let e =
|
|
5949
|
+
let e = Zs(o.items, t, n, r, i);
|
|
5942
5950
|
e.length > 0 && a.push({
|
|
5943
5951
|
...o,
|
|
5944
5952
|
items: e
|
|
5945
5953
|
});
|
|
5946
5954
|
continue;
|
|
5947
5955
|
}
|
|
5948
|
-
let e =
|
|
5956
|
+
let e = Js(o.code, t, n);
|
|
5949
5957
|
e && e.visibility?.includes(r) && (i?.bulkRequired === void 0 || (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) === i.bulkRequired) && (i?.excludeIf && i.excludeIf(e) || a.push(o));
|
|
5950
5958
|
}
|
|
5951
5959
|
return a;
|
|
5952
5960
|
}
|
|
5953
|
-
function
|
|
5961
|
+
function Qs(e, t, n, r, i, a) {
|
|
5954
5962
|
let o = e ?? t;
|
|
5955
|
-
return o ?
|
|
5956
|
-
}
|
|
5957
|
-
function Qs(e) {
|
|
5958
|
-
return e.requires_selection === void 0 ? $s(e) : e.requires_selection;
|
|
5963
|
+
return o ? Zs(o, n, r, i, a) : nc(n, i);
|
|
5959
5964
|
}
|
|
5960
5965
|
function $s(e) {
|
|
5966
|
+
return e.requires_selection === void 0 ? ec(e) : e.requires_selection;
|
|
5967
|
+
}
|
|
5968
|
+
function ec(e) {
|
|
5961
5969
|
return e.visibility?.includes("list_floatbar") ?? !1;
|
|
5962
5970
|
}
|
|
5963
|
-
function
|
|
5971
|
+
function tc(e, t, n, r, i) {
|
|
5964
5972
|
return e.map((e) => {
|
|
5965
5973
|
if (e.kind === "group") return {
|
|
5966
5974
|
...e,
|
|
5967
|
-
items:
|
|
5975
|
+
items: tc(e.items, t, n, r, i)
|
|
5968
5976
|
};
|
|
5969
|
-
let a =
|
|
5977
|
+
let a = Js(e.code, t, n);
|
|
5970
5978
|
return a && r(a) ? {
|
|
5971
5979
|
...e,
|
|
5972
5980
|
enabled: !1,
|
|
@@ -5974,7 +5982,7 @@ function ec(e, t, n, r, i) {
|
|
|
5974
5982
|
} : e;
|
|
5975
5983
|
});
|
|
5976
5984
|
}
|
|
5977
|
-
function
|
|
5985
|
+
function nc(e, t) {
|
|
5978
5986
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
|
|
5979
5987
|
let i = t.position ?? 0, a = r.position ?? 0;
|
|
5980
5988
|
return i === a ? e < n ? -1 : +(e > n) : i - a;
|
|
@@ -5987,43 +5995,43 @@ function tc(e, t) {
|
|
|
5987
5995
|
}
|
|
5988
5996
|
//#endregion
|
|
5989
5997
|
//#region src/lib/field-regions.ts
|
|
5990
|
-
var
|
|
5991
|
-
function
|
|
5992
|
-
return
|
|
5993
|
-
|
|
5998
|
+
var rc = /* @__PURE__ */ new Map();
|
|
5999
|
+
function ic(e, t) {
|
|
6000
|
+
return rc.set(e, t), () => {
|
|
6001
|
+
rc.get(e) === t && rc.delete(e);
|
|
5994
6002
|
};
|
|
5995
6003
|
}
|
|
5996
|
-
function
|
|
5997
|
-
return
|
|
6004
|
+
function ac(e) {
|
|
6005
|
+
return rc.get(e);
|
|
5998
6006
|
}
|
|
5999
6007
|
//#endregion
|
|
6000
6008
|
//#region src/lib/anchor.ts
|
|
6001
|
-
var
|
|
6002
|
-
36500 *
|
|
6003
|
-
var
|
|
6009
|
+
var oc = 1, sc = 1e3 * oc, cc = 60 * sc, lc = 60 * cc, uc = 24 * lc, dc = 7 * uc;
|
|
6010
|
+
36500 * uc;
|
|
6011
|
+
var fc = {
|
|
6004
6012
|
ns: 1e-6,
|
|
6005
6013
|
us: .001,
|
|
6006
6014
|
µs: .001,
|
|
6007
|
-
ms:
|
|
6008
|
-
s:
|
|
6009
|
-
m:
|
|
6010
|
-
h:
|
|
6011
|
-
d:
|
|
6012
|
-
w:
|
|
6013
|
-
},
|
|
6014
|
-
function
|
|
6015
|
-
if (!e || e.trim() !== e || e[0] === "+" || e[0] === "-" ||
|
|
6015
|
+
ms: oc,
|
|
6016
|
+
s: sc,
|
|
6017
|
+
m: cc,
|
|
6018
|
+
h: lc,
|
|
6019
|
+
d: uc,
|
|
6020
|
+
w: dc
|
|
6021
|
+
}, pc = /^(\d+(?:\.\d+)?|\.\d+)(ns|us|µs|ms|s|m|h|d|w)/i, mc = /\d(?:mo|y)(?:[^a-zA-Z]|$)/i;
|
|
6022
|
+
function hc(e) {
|
|
6023
|
+
if (!e || e.trim() !== e || e[0] === "+" || e[0] === "-" || mc.test(e)) return null;
|
|
6016
6024
|
let t = 0, n = e;
|
|
6017
6025
|
for (; n.length > 0;) {
|
|
6018
|
-
let e =
|
|
6026
|
+
let e = pc.exec(n);
|
|
6019
6027
|
if (!e) return null;
|
|
6020
|
-
let r = Number(e[1]), i =
|
|
6028
|
+
let r = Number(e[1]), i = fc[e[2].toLowerCase()];
|
|
6021
6029
|
if (!Number.isFinite(r) || i === void 0 || (t += r * i, t > 31536e8)) return null;
|
|
6022
6030
|
n = n.slice(e[0].length);
|
|
6023
6031
|
}
|
|
6024
6032
|
return t;
|
|
6025
6033
|
}
|
|
6026
|
-
function
|
|
6034
|
+
function gc(e) {
|
|
6027
6035
|
if (!e.startsWith("now")) return null;
|
|
6028
6036
|
let t = e.slice(3), n = 0;
|
|
6029
6037
|
for (let e = 0; t.length > 0; e++) {
|
|
@@ -6033,83 +6041,83 @@ function hc(e) {
|
|
|
6033
6041
|
t = t.slice(1);
|
|
6034
6042
|
let i = t, a = t.search(/[+-]/);
|
|
6035
6043
|
a >= 0 ? (i = t.slice(0, a), t = t.slice(a)) : t = "";
|
|
6036
|
-
let o =
|
|
6044
|
+
let o = hc(i);
|
|
6037
6045
|
if (o === null || (n += r * o, Math.abs(n) > 31536e8)) return null;
|
|
6038
6046
|
}
|
|
6039
6047
|
return n;
|
|
6040
6048
|
}
|
|
6041
6049
|
//#endregion
|
|
6042
6050
|
//#region src/lib/ui-actions.ts
|
|
6043
|
-
var
|
|
6044
|
-
function
|
|
6045
|
-
let n = e.match(
|
|
6051
|
+
var _c = /\$\{\s*([^}]+?)\s*\}/g, vc = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, yc = Symbol("unresolved");
|
|
6052
|
+
function bc(e, t) {
|
|
6053
|
+
let n = e.match(vc);
|
|
6046
6054
|
if (n) {
|
|
6047
|
-
let r =
|
|
6048
|
-
return r ===
|
|
6055
|
+
let r = xc(n[1], t);
|
|
6056
|
+
return r === yc ? e : r;
|
|
6049
6057
|
}
|
|
6050
|
-
return e.replace(
|
|
6051
|
-
let r =
|
|
6052
|
-
return r ===
|
|
6058
|
+
return e.replace(_c, (e, n) => {
|
|
6059
|
+
let r = xc(n, t);
|
|
6060
|
+
return r === yc ? e : R(r);
|
|
6053
6061
|
});
|
|
6054
6062
|
}
|
|
6055
|
-
function
|
|
6063
|
+
function xc(e, t) {
|
|
6056
6064
|
if (e.startsWith("now")) {
|
|
6057
|
-
let t =
|
|
6058
|
-
return t === null ?
|
|
6065
|
+
let t = gc(e);
|
|
6066
|
+
return t === null ? yc : Be(new Date(Date.now() + t));
|
|
6059
6067
|
}
|
|
6060
6068
|
let [n, ...r] = e.split(".");
|
|
6061
|
-
if (n === "row") return !t.row || r.length === 0 ?
|
|
6069
|
+
if (n === "row") return !t.row || r.length === 0 ? yc : Sc(t.row, r);
|
|
6062
6070
|
if (n === "field" && r.length >= 2) {
|
|
6063
|
-
let [e, t] = r, n =
|
|
6064
|
-
return n ? n.getField(t) :
|
|
6071
|
+
let [e, t] = r, n = ac(e);
|
|
6072
|
+
return n ? n.getField(t) : yc;
|
|
6065
6073
|
}
|
|
6066
|
-
return n === "params" ? !t.params || r.length === 0 ?
|
|
6074
|
+
return n === "params" ? !t.params || r.length === 0 ? yc : Sc(t.params, r) : yc;
|
|
6067
6075
|
}
|
|
6068
|
-
function
|
|
6076
|
+
function Sc(e, t) {
|
|
6069
6077
|
return t.reduce((e, t) => {
|
|
6070
6078
|
if (e && typeof e == "object") return e[t];
|
|
6071
6079
|
}, e);
|
|
6072
6080
|
}
|
|
6073
|
-
async function
|
|
6081
|
+
async function Cc(e, t) {
|
|
6074
6082
|
for (let n of e) try {
|
|
6075
|
-
await
|
|
6083
|
+
await wc(n, t);
|
|
6076
6084
|
} catch (e) {
|
|
6077
6085
|
let t = e instanceof Error ? e.message : String(e);
|
|
6078
6086
|
Z.error(`ui_step failed: ${t}`);
|
|
6079
6087
|
return;
|
|
6080
6088
|
}
|
|
6081
6089
|
}
|
|
6082
|
-
async function
|
|
6090
|
+
async function wc(e, t) {
|
|
6083
6091
|
if (e.copy_to_clipboard != null) {
|
|
6084
|
-
let n =
|
|
6092
|
+
let n = Ec(e.copy_to_clipboard, t);
|
|
6085
6093
|
await navigator.clipboard.writeText(n);
|
|
6086
6094
|
return;
|
|
6087
6095
|
}
|
|
6088
6096
|
if (e.set_field) {
|
|
6089
|
-
let { target: n, value: r } = e.set_field, { region: i, field: a } =
|
|
6097
|
+
let { target: n, value: r } = e.set_field, { region: i, field: a } = Dc(n), o = ac(i);
|
|
6090
6098
|
if (!o) throw Error(`region "${i}" not registered`);
|
|
6091
|
-
o.setField(a,
|
|
6099
|
+
o.setField(a, Tc(r, t));
|
|
6092
6100
|
return;
|
|
6093
6101
|
}
|
|
6094
6102
|
if (e.focus_field) {
|
|
6095
|
-
let { region: t, field: n } =
|
|
6103
|
+
let { region: t, field: n } = Dc(e.focus_field), r = ac(t);
|
|
6096
6104
|
if (!r) throw Error(`region "${t}" not registered`);
|
|
6097
6105
|
r.focusField(n);
|
|
6098
6106
|
return;
|
|
6099
6107
|
}
|
|
6100
6108
|
if (e.show_toast) {
|
|
6101
|
-
let n =
|
|
6109
|
+
let n = Ec(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
|
|
6102
6110
|
r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
|
|
6103
6111
|
return;
|
|
6104
6112
|
}
|
|
6105
6113
|
}
|
|
6106
|
-
function wc(e, t) {
|
|
6107
|
-
return typeof e == "string" ? yc(e, t) : e;
|
|
6108
|
-
}
|
|
6109
6114
|
function Tc(e, t) {
|
|
6110
|
-
return
|
|
6115
|
+
return typeof e == "string" ? bc(e, t) : e;
|
|
6111
6116
|
}
|
|
6112
|
-
function Ec(e) {
|
|
6117
|
+
function Ec(e, t) {
|
|
6118
|
+
return R(bc(e, t));
|
|
6119
|
+
}
|
|
6120
|
+
function Dc(e) {
|
|
6113
6121
|
let t = e.indexOf(".");
|
|
6114
6122
|
if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
|
|
6115
6123
|
return {
|
|
@@ -6117,12 +6125,12 @@ function Ec(e) {
|
|
|
6117
6125
|
field: e.slice(t + 1)
|
|
6118
6126
|
};
|
|
6119
6127
|
}
|
|
6120
|
-
function
|
|
6128
|
+
function Oc(e) {
|
|
6121
6129
|
return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
|
|
6122
6130
|
}
|
|
6123
6131
|
//#endregion
|
|
6124
6132
|
//#region src/lib/mass-edit.ts
|
|
6125
|
-
function
|
|
6133
|
+
function kc(e) {
|
|
6126
6134
|
if (!e) return [];
|
|
6127
6135
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
6128
6136
|
for (let r of e.split(",")) {
|
|
@@ -6131,17 +6139,17 @@ function Oc(e) {
|
|
|
6131
6139
|
}
|
|
6132
6140
|
return n;
|
|
6133
6141
|
}
|
|
6134
|
-
function
|
|
6142
|
+
function Ac(e, t) {
|
|
6135
6143
|
if (!e || !$e(e, "update")) return [];
|
|
6136
|
-
let n = Array.isArray(t) ? t :
|
|
6144
|
+
let n = Array.isArray(t) ? t : kc(t), r = n.length > 0 ? new Set(n) : null, i = dt(e), a = new Set(V(e)), o = r ? n : jc(e, i, a), s = [];
|
|
6137
6145
|
for (let t of o) {
|
|
6138
6146
|
if (r && !r.has(t)) continue;
|
|
6139
|
-
let n =
|
|
6147
|
+
let n = Mc(e, t, i, a);
|
|
6140
6148
|
n && s.push(n);
|
|
6141
6149
|
}
|
|
6142
6150
|
return s;
|
|
6143
6151
|
}
|
|
6144
|
-
function
|
|
6152
|
+
function jc(e, t, n) {
|
|
6145
6153
|
let r = [];
|
|
6146
6154
|
for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
|
|
6147
6155
|
if (!t) {
|
|
@@ -6150,7 +6158,7 @@ function Ac(e, t, n) {
|
|
|
6150
6158
|
}
|
|
6151
6159
|
return r;
|
|
6152
6160
|
}
|
|
6153
|
-
function
|
|
6161
|
+
function Mc(e, t, n, r) {
|
|
6154
6162
|
if (t.startsWith("$status.")) {
|
|
6155
6163
|
if (n) return null;
|
|
6156
6164
|
let r = t.slice(8), i = e.status_groups?.[r];
|
|
@@ -6158,7 +6166,7 @@ function jc(e, t, n, r) {
|
|
|
6158
6166
|
code: t,
|
|
6159
6167
|
bare: r,
|
|
6160
6168
|
kind: "status",
|
|
6161
|
-
label:
|
|
6169
|
+
label: Nc(i.name, r),
|
|
6162
6170
|
statusGroup: i
|
|
6163
6171
|
} : null;
|
|
6164
6172
|
}
|
|
@@ -6169,7 +6177,7 @@ function jc(e, t, n, r) {
|
|
|
6169
6177
|
code: t,
|
|
6170
6178
|
bare: r,
|
|
6171
6179
|
kind: "property",
|
|
6172
|
-
label:
|
|
6180
|
+
label: Nc(i.name, r),
|
|
6173
6181
|
property: i
|
|
6174
6182
|
} : null;
|
|
6175
6183
|
}
|
|
@@ -6179,18 +6187,18 @@ function jc(e, t, n, r) {
|
|
|
6179
6187
|
code: t,
|
|
6180
6188
|
bare: t,
|
|
6181
6189
|
kind: "field",
|
|
6182
|
-
label:
|
|
6190
|
+
label: Nc(i.display?.name, t),
|
|
6183
6191
|
field: i
|
|
6184
6192
|
};
|
|
6185
6193
|
}
|
|
6186
|
-
function
|
|
6194
|
+
function Nc(e, t) {
|
|
6187
6195
|
return e && z(e) || t;
|
|
6188
6196
|
}
|
|
6189
6197
|
//#endregion
|
|
6190
6198
|
//#region src/components/mass-edit/PropertyGridEditor.tsx
|
|
6191
|
-
var
|
|
6192
|
-
function
|
|
6193
|
-
let a = d(() =>
|
|
6199
|
+
var Pc = Symbol.for("declarion.mass-edit.multiple");
|
|
6200
|
+
function Fc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
|
|
6201
|
+
let a = d(() => Ac(e, t), [e, t]), o = d(() => Object.keys(r).map((e) => {
|
|
6194
6202
|
let t = a.find((t) => t.code === e);
|
|
6195
6203
|
return t ? {
|
|
6196
6204
|
target: t,
|
|
@@ -6200,8 +6208,8 @@ function Pc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6200
6208
|
let e = new Set(o.map((e) => e.target.code));
|
|
6201
6209
|
return a.filter((t) => !e.has(t.code));
|
|
6202
6210
|
}, [o, a]), l = s((e) => {
|
|
6203
|
-
let t =
|
|
6204
|
-
a[e.code] = t ===
|
|
6211
|
+
let t = Bc(e, n), a = { ...r };
|
|
6212
|
+
a[e.code] = t === Pc ? void 0 : t, i(a);
|
|
6205
6213
|
}, [
|
|
6206
6214
|
r,
|
|
6207
6215
|
n,
|
|
@@ -6229,12 +6237,12 @@ function Pc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6229
6237
|
},
|
|
6230
6238
|
children: "No targets selected. Add a field, status, or property to edit across all selected rows."
|
|
6231
6239
|
}),
|
|
6232
|
-
o.map((e) => /* @__PURE__ */ b(
|
|
6240
|
+
o.map((e) => /* @__PURE__ */ b(Ic, {
|
|
6233
6241
|
row: e,
|
|
6234
6242
|
onChange: (t) => u(e.target.code, t),
|
|
6235
6243
|
onRemove: () => f(e.target.code)
|
|
6236
6244
|
}, e.target.code)),
|
|
6237
|
-
/* @__PURE__ */ b(
|
|
6245
|
+
/* @__PURE__ */ b(zc, {
|
|
6238
6246
|
targets: c,
|
|
6239
6247
|
onPick: l
|
|
6240
6248
|
})
|
|
@@ -6247,7 +6255,7 @@ function Pc({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
6247
6255
|
children: "Entity schema unavailable. Mass edit requires an entity-bound action."
|
|
6248
6256
|
});
|
|
6249
6257
|
}
|
|
6250
|
-
function
|
|
6258
|
+
function Ic({ row: e, onChange: n, onRemove: r }) {
|
|
6251
6259
|
let { target: i } = e;
|
|
6252
6260
|
return /* @__PURE__ */ x("div", {
|
|
6253
6261
|
"data-testid": "mass-edit-row",
|
|
@@ -6266,7 +6274,7 @@ function Fc({ row: e, onChange: n, onRemove: r }) {
|
|
|
6266
6274
|
title: i.code,
|
|
6267
6275
|
children: i.label
|
|
6268
6276
|
}),
|
|
6269
|
-
/* @__PURE__ */ b(
|
|
6277
|
+
/* @__PURE__ */ b(Lc, {
|
|
6270
6278
|
row: e,
|
|
6271
6279
|
onChange: n
|
|
6272
6280
|
}),
|
|
@@ -6278,8 +6286,8 @@ function Fc({ row: e, onChange: n, onRemove: r }) {
|
|
|
6278
6286
|
]
|
|
6279
6287
|
});
|
|
6280
6288
|
}
|
|
6281
|
-
function
|
|
6282
|
-
let { target: n } = e, r =
|
|
6289
|
+
function Lc({ row: e, onChange: t }) {
|
|
6290
|
+
let { target: n } = e, r = bs(), i = e.value === Pc, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
|
|
6283
6291
|
if (n.kind === "status" && n.statusGroup) {
|
|
6284
6292
|
let e = n.statusGroup.statuses.map((e) => ({
|
|
6285
6293
|
value: e.code,
|
|
@@ -6295,11 +6303,11 @@ function Ic({ row: e, onChange: t }) {
|
|
|
6295
6303
|
})
|
|
6296
6304
|
});
|
|
6297
6305
|
}
|
|
6298
|
-
let s =
|
|
6306
|
+
let s = Rc(n);
|
|
6299
6307
|
return /* @__PURE__ */ x("div", {
|
|
6300
6308
|
"data-testid": `value-${n.code}`,
|
|
6301
6309
|
style: { position: "relative" },
|
|
6302
|
-
children: [
|
|
6310
|
+
children: [_s({
|
|
6303
6311
|
field: s,
|
|
6304
6312
|
fieldName: n.bare,
|
|
6305
6313
|
value: o ?? "",
|
|
@@ -6318,7 +6326,7 @@ function Ic({ row: e, onChange: t }) {
|
|
|
6318
6326
|
})]
|
|
6319
6327
|
});
|
|
6320
6328
|
}
|
|
6321
|
-
function
|
|
6329
|
+
function Rc(e) {
|
|
6322
6330
|
if (e.kind === "field" && e.field) return e.field;
|
|
6323
6331
|
if (e.kind === "property" && e.property) {
|
|
6324
6332
|
let t = e.property;
|
|
@@ -6333,7 +6341,7 @@ function Lc(e) {
|
|
|
6333
6341
|
}
|
|
6334
6342
|
return { type: "string" };
|
|
6335
6343
|
}
|
|
6336
|
-
function
|
|
6344
|
+
function zc({ targets: e, onPick: n }) {
|
|
6337
6345
|
let [r, i] = p(!1);
|
|
6338
6346
|
return e.length === 0 ? null : r ? /* @__PURE__ */ b("div", {
|
|
6339
6347
|
"data-testid": "mass-edit-target-picker",
|
|
@@ -6360,7 +6368,7 @@ function Rc({ targets: e, onPick: n }) {
|
|
|
6360
6368
|
children: [/* @__PURE__ */ b(t.plus, { size: 12 }), " Add target"]
|
|
6361
6369
|
});
|
|
6362
6370
|
}
|
|
6363
|
-
function
|
|
6371
|
+
function Bc(e, t) {
|
|
6364
6372
|
if (!t || t.length === 0 || e.kind !== "field") return;
|
|
6365
6373
|
let n, r = !1;
|
|
6366
6374
|
for (let i of t) {
|
|
@@ -6369,16 +6377,16 @@ function zc(e, t) {
|
|
|
6369
6377
|
n = t, r = !0;
|
|
6370
6378
|
continue;
|
|
6371
6379
|
}
|
|
6372
|
-
if (n !== t) return
|
|
6380
|
+
if (n !== t) return Pc;
|
|
6373
6381
|
}
|
|
6374
6382
|
return n;
|
|
6375
6383
|
}
|
|
6376
6384
|
//#endregion
|
|
6377
6385
|
//#region src/components/shared/ActionDialog.tsx
|
|
6378
|
-
var
|
|
6379
|
-
function
|
|
6386
|
+
var Vc = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
|
|
6387
|
+
function Hc(e, t) {
|
|
6380
6388
|
if (typeof e != "string") return e ?? "";
|
|
6381
|
-
let n = e.match(
|
|
6389
|
+
let n = e.match(Vc);
|
|
6382
6390
|
if (n) {
|
|
6383
6391
|
let r = n[1].split("."), i = t;
|
|
6384
6392
|
for (let e of r) {
|
|
@@ -6390,9 +6398,9 @@ function Vc(e, t) {
|
|
|
6390
6398
|
}
|
|
6391
6399
|
return i === void 0 ? ((t == null || !(r[0] in t)) && typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing field '${r[0]}'`), "") : i ?? "";
|
|
6392
6400
|
}
|
|
6393
|
-
return
|
|
6401
|
+
return bc(e, { row: t });
|
|
6394
6402
|
}
|
|
6395
|
-
function
|
|
6403
|
+
function Uc(e) {
|
|
6396
6404
|
return {
|
|
6397
6405
|
type: e.type ?? "string",
|
|
6398
6406
|
required: e.required,
|
|
@@ -6406,18 +6414,18 @@ function Hc(e) {
|
|
|
6406
6414
|
ref: Xe(e.ref)
|
|
6407
6415
|
};
|
|
6408
6416
|
}
|
|
6409
|
-
function
|
|
6417
|
+
function Wc(e, t) {
|
|
6410
6418
|
if (!e.includes("${")) return e;
|
|
6411
|
-
let n =
|
|
6419
|
+
let n = bc(e, { params: t });
|
|
6412
6420
|
return n == null ? "" : R(n);
|
|
6413
6421
|
}
|
|
6414
|
-
var
|
|
6415
|
-
function
|
|
6422
|
+
var Gc = /\$\{\s*([^}]+?)\s*\}/g;
|
|
6423
|
+
function Kc(e, t) {
|
|
6416
6424
|
let n = `params.${t}`;
|
|
6417
|
-
for (let t of e.matchAll(
|
|
6425
|
+
for (let t of e.matchAll(Gc)) if (t[1] === n) return !0;
|
|
6418
6426
|
return !1;
|
|
6419
6427
|
}
|
|
6420
|
-
function
|
|
6428
|
+
function qc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
6421
6429
|
let i = d(() => {
|
|
6422
6430
|
let t = r ? Object.entries(r) : [];
|
|
6423
6431
|
return [{
|
|
@@ -6435,12 +6443,12 @@ function Kc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
6435
6443
|
placeholder: "Select status group…"
|
|
6436
6444
|
});
|
|
6437
6445
|
}
|
|
6438
|
-
function
|
|
6446
|
+
function Jc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
6439
6447
|
let a = d(() => {
|
|
6440
6448
|
if (!r) return [];
|
|
6441
6449
|
let t = e.filter?.status_group;
|
|
6442
6450
|
if (t) {
|
|
6443
|
-
let e =
|
|
6451
|
+
let e = Wc(t, i);
|
|
6444
6452
|
return e && r[e] ? r[e].statuses : [];
|
|
6445
6453
|
}
|
|
6446
6454
|
return Object.values(r).flatMap((e) => e.statuses);
|
|
@@ -6462,8 +6470,8 @@ function qc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
6462
6470
|
placeholder: "Select status…"
|
|
6463
6471
|
});
|
|
6464
6472
|
}
|
|
6465
|
-
function
|
|
6466
|
-
let { data: m } = X(), h =
|
|
6473
|
+
function Yc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: o, row: c, bulkSelection: u }) {
|
|
6474
|
+
let { data: m } = X(), h = bs(), g = r.resolved_params, _ = r.resolved_hidden_defaults ?? {}, v = !!r.destructive, S = Ls(r, h), C = s(() => {
|
|
6467
6475
|
o || n(!1);
|
|
6468
6476
|
}, [o, n]), w = f(null);
|
|
6469
6477
|
l(() => {
|
|
@@ -6490,11 +6498,11 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6490
6498
|
continue;
|
|
6491
6499
|
}
|
|
6492
6500
|
if (n.type === "bool") {
|
|
6493
|
-
let r =
|
|
6501
|
+
let r = Hc(n.default, c);
|
|
6494
6502
|
e[t] = r === !0 || r === "true";
|
|
6495
6503
|
continue;
|
|
6496
6504
|
}
|
|
6497
|
-
e[t] =
|
|
6505
|
+
e[t] = Hc(n.default, c);
|
|
6498
6506
|
}
|
|
6499
6507
|
return e;
|
|
6500
6508
|
}, [
|
|
@@ -6512,7 +6520,7 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6512
6520
|
for (let [t, n] of g) {
|
|
6513
6521
|
if (n.type !== "status") continue;
|
|
6514
6522
|
let i = n.filter?.status_group;
|
|
6515
|
-
i &&
|
|
6523
|
+
i && Kc(i, e) && (r[t] = "");
|
|
6516
6524
|
}
|
|
6517
6525
|
return r;
|
|
6518
6526
|
});
|
|
@@ -6658,27 +6666,27 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6658
6666
|
let r;
|
|
6659
6667
|
if (t.type === "entity_patch") {
|
|
6660
6668
|
let n = typeof t.filter?.targets == "string" ? t.filter.targets : void 0;
|
|
6661
|
-
r = /* @__PURE__ */ b(
|
|
6669
|
+
r = /* @__PURE__ */ b(Fc, {
|
|
6662
6670
|
entity: k,
|
|
6663
6671
|
filterTargets: n,
|
|
6664
6672
|
selectedRows: u,
|
|
6665
6673
|
value: M[e] ?? {},
|
|
6666
6674
|
onChange: (t) => N(e, t)
|
|
6667
6675
|
});
|
|
6668
|
-
} else r = t.type === "status_group" ? /* @__PURE__ */ b(
|
|
6676
|
+
} else r = t.type === "status_group" ? /* @__PURE__ */ b(qc, {
|
|
6669
6677
|
param: t,
|
|
6670
6678
|
value: M[e],
|
|
6671
6679
|
onChange: (t) => N(e, t),
|
|
6672
6680
|
statusGroups: E,
|
|
6673
6681
|
formData: M
|
|
6674
|
-
}) : t.type === "status" ? /* @__PURE__ */ b(
|
|
6682
|
+
}) : t.type === "status" ? /* @__PURE__ */ b(Jc, {
|
|
6675
6683
|
param: t,
|
|
6676
6684
|
value: M[e],
|
|
6677
6685
|
onChange: (t) => N(e, t),
|
|
6678
6686
|
statusGroups: E,
|
|
6679
6687
|
formData: M
|
|
6680
|
-
}) :
|
|
6681
|
-
field:
|
|
6688
|
+
}) : _s({
|
|
6689
|
+
field: Uc(t),
|
|
6682
6690
|
fieldName: e,
|
|
6683
6691
|
value: M[e],
|
|
6684
6692
|
mode: "edit",
|
|
@@ -6688,7 +6696,7 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6688
6696
|
return /* @__PURE__ */ x("div", {
|
|
6689
6697
|
style: { minWidth: 0 },
|
|
6690
6698
|
children: [
|
|
6691
|
-
/* @__PURE__ */ b(
|
|
6699
|
+
/* @__PURE__ */ b(Ce, {
|
|
6692
6700
|
required: t.required,
|
|
6693
6701
|
children: n
|
|
6694
6702
|
}),
|
|
@@ -6729,7 +6737,7 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6729
6737
|
/* @__PURE__ */ b(D, {
|
|
6730
6738
|
kind: "primary",
|
|
6731
6739
|
danger: v,
|
|
6732
|
-
icon: b(o ?
|
|
6740
|
+
icon: b(o ? Se : v ? t.trash : t.bolt, { size: 13 }),
|
|
6733
6741
|
onClick: te,
|
|
6734
6742
|
disabled: o,
|
|
6735
6743
|
children: o ? "Executing…" : T.length > 0 ? "Execute" : "Confirm"
|
|
@@ -6741,7 +6749,7 @@ function Jc({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
6741
6749
|
}
|
|
6742
6750
|
//#endregion
|
|
6743
6751
|
//#region src/components/shared/ActionResultDialog.tsx
|
|
6744
|
-
function
|
|
6752
|
+
function Xc({ open: e, onClose: n, display: r }) {
|
|
6745
6753
|
let i = f(null);
|
|
6746
6754
|
return l(() => {
|
|
6747
6755
|
e && i.current?.focus();
|
|
@@ -6836,7 +6844,7 @@ function Yc({ open: e, onClose: n, display: r }) {
|
|
|
6836
6844
|
gap: 12,
|
|
6837
6845
|
overflowY: "auto"
|
|
6838
6846
|
},
|
|
6839
|
-
children: r.fields.map((e, t) => /* @__PURE__ */ b(
|
|
6847
|
+
children: r.fields.map((e, t) => /* @__PURE__ */ b(Zc, {
|
|
6840
6848
|
field: e,
|
|
6841
6849
|
onNavigate: n
|
|
6842
6850
|
}, t))
|
|
@@ -6862,13 +6870,13 @@ function Yc({ open: e, onClose: n, display: r }) {
|
|
|
6862
6870
|
]
|
|
6863
6871
|
})] }) : null;
|
|
6864
6872
|
}
|
|
6865
|
-
function
|
|
6866
|
-
let r = e.href ?? e.download_url ?? e.value, i = e.type === "download", a = i || e.type === "link", o = r ?
|
|
6873
|
+
function Zc({ field: e, onNavigate: n }) {
|
|
6874
|
+
let r = e.href ?? e.download_url ?? e.value, i = e.type === "download", a = i || e.type === "link", o = r ? ii(r) : void 0, [s, c] = p(!1), [l, u] = p(null);
|
|
6867
6875
|
async function d() {
|
|
6868
6876
|
if (o) {
|
|
6869
6877
|
c(!0), u(null);
|
|
6870
6878
|
try {
|
|
6871
|
-
await
|
|
6879
|
+
await ci(o, e.filename);
|
|
6872
6880
|
} catch (e) {
|
|
6873
6881
|
u(e instanceof Error ? e.message : String(e));
|
|
6874
6882
|
} finally {
|
|
@@ -6893,7 +6901,7 @@ function Xc({ field: e, onNavigate: n }) {
|
|
|
6893
6901
|
fontWeight: 500,
|
|
6894
6902
|
textDecoration: "none",
|
|
6895
6903
|
whiteSpace: "nowrap"
|
|
6896
|
-
}, m = a && !i, h =
|
|
6904
|
+
}, m = a && !i, h = ai(o), g = {
|
|
6897
6905
|
flex: 1,
|
|
6898
6906
|
minWidth: 0,
|
|
6899
6907
|
display: "inline-flex",
|
|
@@ -6976,7 +6984,7 @@ function Xc({ field: e, onNavigate: n }) {
|
|
|
6976
6984
|
},
|
|
6977
6985
|
children: e.value
|
|
6978
6986
|
})]
|
|
6979
|
-
}), e.copyable && /* @__PURE__ */ b(
|
|
6987
|
+
}), e.copyable && /* @__PURE__ */ b(di, { value: e.value })]
|
|
6980
6988
|
}) : /* @__PURE__ */ x("div", {
|
|
6981
6989
|
style: {
|
|
6982
6990
|
position: "relative",
|
|
@@ -7000,7 +7008,7 @@ function Xc({ field: e, onNavigate: n }) {
|
|
|
7000
7008
|
top: 4,
|
|
7001
7009
|
right: 4
|
|
7002
7010
|
},
|
|
7003
|
-
children: /* @__PURE__ */ b(
|
|
7011
|
+
children: /* @__PURE__ */ b(di, { value: e.value })
|
|
7004
7012
|
})]
|
|
7005
7013
|
})
|
|
7006
7014
|
]
|
|
@@ -7008,7 +7016,7 @@ function Xc({ field: e, onNavigate: n }) {
|
|
|
7008
7016
|
}
|
|
7009
7017
|
//#endregion
|
|
7010
7018
|
//#region src/components/shared/ActionRunner.tsx
|
|
7011
|
-
function
|
|
7019
|
+
function Qc(e) {
|
|
7012
7020
|
if (!e || typeof e != "object") return { kind: "success" };
|
|
7013
7021
|
let t = e, n = t.status, r = t.success?.length ?? 0, i = t.errors?.length ?? 0, a = t.skipped?.length ?? 0, o = t.errors?.[0]?.error;
|
|
7014
7022
|
if (n === "partial") {
|
|
@@ -7023,33 +7031,33 @@ function Zc(e) {
|
|
|
7023
7031
|
detail: "No items matched"
|
|
7024
7032
|
} : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
|
|
7025
7033
|
}
|
|
7026
|
-
function
|
|
7034
|
+
function $c(e) {
|
|
7027
7035
|
if (!e || typeof e != "object") return null;
|
|
7028
7036
|
let t = e.result;
|
|
7029
7037
|
if (!t || typeof t != "object") return null;
|
|
7030
7038
|
let n = t.$display;
|
|
7031
7039
|
return !n || typeof n != "object" ? null : n;
|
|
7032
7040
|
}
|
|
7033
|
-
function
|
|
7034
|
-
let t =
|
|
7041
|
+
function el(e) {
|
|
7042
|
+
let t = $c(e)?.fields;
|
|
7035
7043
|
if (!Array.isArray(t)) return null;
|
|
7036
7044
|
for (let e of t) {
|
|
7037
7045
|
if (e?.type !== "download") continue;
|
|
7038
7046
|
let t = e.href ?? e.download_url ?? e.value;
|
|
7039
|
-
if (typeof t == "string" && t !== "" &&
|
|
7047
|
+
if (typeof t == "string" && t !== "" && ii(t)) return {
|
|
7040
7048
|
url: t,
|
|
7041
7049
|
filename: typeof e.filename == "string" ? e.filename : void 0
|
|
7042
7050
|
};
|
|
7043
7051
|
}
|
|
7044
7052
|
return null;
|
|
7045
7053
|
}
|
|
7046
|
-
function
|
|
7054
|
+
function tl(e) {
|
|
7047
7055
|
if (!e || typeof e != "object") return;
|
|
7048
7056
|
let t = e.result;
|
|
7049
7057
|
!t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
|
|
7050
7058
|
}
|
|
7051
|
-
function
|
|
7052
|
-
if (e instanceof
|
|
7059
|
+
function nl(e) {
|
|
7060
|
+
if (e instanceof ar) {
|
|
7053
7061
|
let t = e.response.errors ?? [];
|
|
7054
7062
|
if (t.length === 1) return {
|
|
7055
7063
|
kind: "error",
|
|
@@ -7061,7 +7069,7 @@ function tl(e) {
|
|
|
7061
7069
|
detail: n ? `${t.length} failed · ${n}` : `${t.length} failed`
|
|
7062
7070
|
};
|
|
7063
7071
|
}
|
|
7064
|
-
return e instanceof
|
|
7072
|
+
return e instanceof H ? {
|
|
7065
7073
|
kind: "error",
|
|
7066
7074
|
detail: e.message
|
|
7067
7075
|
} : {
|
|
@@ -7069,23 +7077,23 @@ function tl(e) {
|
|
|
7069
7077
|
detail: e instanceof Error ? e.message : String(e)
|
|
7070
7078
|
};
|
|
7071
7079
|
}
|
|
7072
|
-
var
|
|
7073
|
-
function
|
|
7074
|
-
let e = c(
|
|
7080
|
+
var rl = i(null);
|
|
7081
|
+
function il() {
|
|
7082
|
+
let e = c(rl);
|
|
7075
7083
|
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
7076
7084
|
return e;
|
|
7077
7085
|
}
|
|
7078
|
-
function
|
|
7086
|
+
function al(e) {
|
|
7079
7087
|
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
7080
7088
|
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
7081
7089
|
return t;
|
|
7082
7090
|
}
|
|
7083
|
-
function
|
|
7084
|
-
let t =
|
|
7091
|
+
function ol({ children: e }) {
|
|
7092
|
+
let t = Rr(), { data: n } = X(), [r, i] = p(null), [a, o] = p(0), [c, l] = p(null), u = s((e) => {
|
|
7085
7093
|
if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
|
|
7086
7094
|
}, [n?.screens]), f = s((e, n, r, i, a) => {
|
|
7087
7095
|
let o = () => {
|
|
7088
|
-
let n =
|
|
7096
|
+
let n = sl(a), i = u(r), o = n ? `Job ${n} queued` : "Running in background";
|
|
7089
7097
|
Z.success(`${e} started`, o, i ? { action: {
|
|
7090
7098
|
label: "View",
|
|
7091
7099
|
onClick: () => t(i)
|
|
@@ -7093,10 +7101,10 @@ function al({ children: e }) {
|
|
|
7093
7101
|
};
|
|
7094
7102
|
switch (i.kind) {
|
|
7095
7103
|
case "success": {
|
|
7096
|
-
let t =
|
|
7104
|
+
let t = el(a), r = t ? { action: {
|
|
7097
7105
|
label: "Download",
|
|
7098
7106
|
onClick: () => {
|
|
7099
|
-
|
|
7107
|
+
ci(t.url, t.filename).catch((e) => {
|
|
7100
7108
|
Z.error("Download failed", e instanceof Error ? e.message : String(e));
|
|
7101
7109
|
});
|
|
7102
7110
|
}
|
|
@@ -7128,16 +7136,16 @@ function al({ children: e }) {
|
|
|
7128
7136
|
}
|
|
7129
7137
|
if (t.kind !== "success" && t.kind !== "accepted") return;
|
|
7130
7138
|
e.onSuccess?.(n);
|
|
7131
|
-
let r =
|
|
7132
|
-
r && l(r),
|
|
7139
|
+
let r = $c(n);
|
|
7140
|
+
r && l(r), tl(n);
|
|
7133
7141
|
}, [m]), g = s((e) => {
|
|
7134
7142
|
let t = e.action, n = e.longRunning ?? t?.long_running ?? !1, r = e.title || z(t?.display?.name) || "Action", a = async (i) => {
|
|
7135
7143
|
o((e) => e + 1);
|
|
7136
7144
|
try {
|
|
7137
|
-
let a = await e.execute(i), o =
|
|
7145
|
+
let a = await e.execute(i), o = Qc(a);
|
|
7138
7146
|
f(r, n, t, o, a), h(e, o, a);
|
|
7139
7147
|
} catch (e) {
|
|
7140
|
-
f(r, n, t,
|
|
7148
|
+
f(r, n, t, nl(e));
|
|
7141
7149
|
} finally {
|
|
7142
7150
|
o((e) => Math.max(0, e - 1));
|
|
7143
7151
|
}
|
|
@@ -7147,14 +7155,14 @@ function al({ children: e }) {
|
|
|
7147
7155
|
icon: ""
|
|
7148
7156
|
},
|
|
7149
7157
|
destructive: !0
|
|
7150
|
-
} : void 0), c = !!(t?.resolved_params && t.resolved_params.length > 0), l =
|
|
7158
|
+
} : void 0), c = !!(t?.resolved_params && t.resolved_params.length > 0), l = Rs(s);
|
|
7151
7159
|
return s && (c || l) ? (i({
|
|
7152
7160
|
id: Symbol(),
|
|
7153
7161
|
opts: e,
|
|
7154
7162
|
title: r,
|
|
7155
7163
|
action: s,
|
|
7156
7164
|
pending: !1
|
|
7157
|
-
}), Promise.resolve()) : a(
|
|
7165
|
+
}), Promise.resolve()) : a(al(e));
|
|
7158
7166
|
}, [f, h]), v = a > 0 || !!r?.pending, y = d(() => ({
|
|
7159
7167
|
run: g,
|
|
7160
7168
|
isRunning: v
|
|
@@ -7166,10 +7174,10 @@ function al({ children: e }) {
|
|
|
7166
7174
|
pending: !0
|
|
7167
7175
|
} : e), o((e) => e + 1);
|
|
7168
7176
|
try {
|
|
7169
|
-
let r = await n.opts.execute(e), o =
|
|
7177
|
+
let r = await n.opts.execute(e), o = Qc(r);
|
|
7170
7178
|
f(n.title, s, a, o, r), h(n.opts, o, r), o.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
7171
7179
|
} catch (e) {
|
|
7172
|
-
f(n.title, s, a,
|
|
7180
|
+
f(n.title, s, a, nl(e));
|
|
7173
7181
|
} finally {
|
|
7174
7182
|
o((e) => Math.max(0, e - 1)), i((e) => e?.id === t ? {
|
|
7175
7183
|
...e,
|
|
@@ -7181,16 +7189,16 @@ function al({ children: e }) {
|
|
|
7181
7189
|
f,
|
|
7182
7190
|
h
|
|
7183
7191
|
]);
|
|
7184
|
-
return /* @__PURE__ */ x(
|
|
7192
|
+
return /* @__PURE__ */ x(rl.Provider, {
|
|
7185
7193
|
value: y,
|
|
7186
7194
|
children: [
|
|
7187
7195
|
e,
|
|
7188
|
-
c && /* @__PURE__ */ b(
|
|
7196
|
+
c && /* @__PURE__ */ b(Xc, {
|
|
7189
7197
|
open: !0,
|
|
7190
7198
|
onClose: () => l(null),
|
|
7191
7199
|
display: c
|
|
7192
7200
|
}),
|
|
7193
|
-
r && S && /* @__PURE__ */ b(
|
|
7201
|
+
r && S && /* @__PURE__ */ b(Yc, {
|
|
7194
7202
|
open: !0,
|
|
7195
7203
|
onOpenChange: (e) => {
|
|
7196
7204
|
e || i(null);
|
|
@@ -7205,29 +7213,29 @@ function al({ children: e }) {
|
|
|
7205
7213
|
]
|
|
7206
7214
|
});
|
|
7207
7215
|
}
|
|
7208
|
-
function ol(e) {
|
|
7209
|
-
return sl(e) ?? sl(e?.result);
|
|
7210
|
-
}
|
|
7211
7216
|
function sl(e) {
|
|
7217
|
+
return cl(e) ?? cl(e?.result);
|
|
7218
|
+
}
|
|
7219
|
+
function cl(e) {
|
|
7212
7220
|
if (!e || typeof e != "object") return;
|
|
7213
7221
|
let t = e, n = t.job_id ?? t.id;
|
|
7214
7222
|
return typeof n == "string" ? n : void 0;
|
|
7215
7223
|
}
|
|
7216
7224
|
//#endregion
|
|
7217
7225
|
//#region src/hooks/useCurrentScreen.tsx
|
|
7218
|
-
var
|
|
7219
|
-
function
|
|
7226
|
+
var ll = i(void 0);
|
|
7227
|
+
function ul({ code: e, children: t }) {
|
|
7220
7228
|
let { data: n } = X(), r = d(() => ({
|
|
7221
7229
|
code: e,
|
|
7222
7230
|
screen: n?.screens[e]
|
|
7223
7231
|
}), [e, n]);
|
|
7224
|
-
return /* @__PURE__ */ b(
|
|
7232
|
+
return /* @__PURE__ */ b(ll.Provider, {
|
|
7225
7233
|
value: r,
|
|
7226
7234
|
children: t
|
|
7227
7235
|
});
|
|
7228
7236
|
}
|
|
7229
|
-
function
|
|
7230
|
-
return c(
|
|
7237
|
+
function dl() {
|
|
7238
|
+
return c(ll);
|
|
7231
7239
|
}
|
|
7232
7240
|
//#endregion
|
|
7233
|
-
export {
|
|
7241
|
+
export { si as $, be as $n, Pt as $t, bs as A, Qe as An, X as At, Ea as B, Ce as Bn, Ln as Bt, Vs as C, Ge as Cn, Zn as Ct, Qs as D, ot as Dn, pr as Dt, ws as E, nt as En, lr as Et, ja as F, He as Fn, qn as Ft, Li as G, Le as Gn, J as Gt, pa as H, ke as Hn, Wn as Ht, Q as I, Be as In, Gn as It, ji as J, Te as Jn, Cn as Jt, Fi as K, I as Kn, Y as Kt, Ta as L, R as Ln, Kn as Lt, hs as M, B as Mn, Jn as Mt, Aa as N, Je as Nn, In as Nt, Ts as O, it as On, fr as Ot, Ma as P, at as Pn, zn as Pt, ci as Q, xe as Qn, Wt as Qt, Oa as R, L as Rn, Un as Rt, Ps as S, Ye as Sn, Qn as St, Bs as T, z as Tn, rr as Tt, fa as U, Pe as Un, Vn as Ut, ca as V, Ie as Vn, Rn as Vt, sa as W, ze as Wn, q as Wt, Mi as X, Re as Xn, Bt as Xt, Ni as Y, F as Yn, Sn as Yt, di as Z, Se as Zn, Ut as Zt, Hs as _, ut as _n, $n as _t, Pc as a, St as an, se as ar, Br as at, Es as b, $e as bn, mr as bt, Ac as c, bt as cn, A as cr, Fr as ct, Oc as d, pt as dn, jr as dt, Nt as en, ve as er, ai as et, ic as f, ft as fn, Or as ft, zs as g, lt as gn, sr as gt, $s as h, ct as hn, ar as ht, il as i, Mt as in, P as ir, Rr as it, _s as j, st as jn, Yn as jt, ks as k, rt as kn, er as kt, kc as l, yt as ln, O as lr, Mr as lt, Ss as m, We as mn, br as mt, dl as n, Dt as nn, ue as nr, ti as nt, Fc as o, Ct as on, M as or, zr as ot, Cs as p, mt as pn, kr as pt, Pi as q, Fe as qn, bn as qt, ol as r, Ot as rn, de as rr, Z as rt, Bc as s, wt as sn, j as sr, Lr as st, ul as t, kt as tn, ye as tr, ii as tt, Cc as u, H as un, D as ur, Ar as ut, nc as v, Ze as vn, tr as vt, Ns as w, V as wn, hr as wt, Zs as x, tt as xn, ir as xt, tc as y, et as yn, nr as yt, ga as z, Ae as zn, Bn as zt };
|