@declarion/react 0.30.0 → 0.31.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/{ActionRunner-HrBGEIPi.js → ActionRunner-BzaZQtiI.js} +1149 -992
- package/dist-lib/{DraggableChildrenTable-DawgL01j.js → DraggableChildrenTable-DILqStHQ.js} +29 -29
- package/dist-lib/{Grid-CywIwAds.js → Grid-BIsiUwPh.js} +2 -2
- package/dist-lib/LayoutRenderer-3RvIsC9M.js +2885 -0
- package/dist-lib/{MarkdownRenderer-DoKB-5LZ.js → MarkdownRenderer-CaHhWrfm.js} +1 -1
- package/dist-lib/SmartDetailPage.impl--EO-9fos.js +1494 -0
- package/dist-lib/SmartRecordListPage.impl-B1iws8yf.js +763 -0
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -0
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +2 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +2 -0
- package/dist-lib/components/layout/TenantChip.d.ts +2 -1
- package/dist-lib/components/layout/TopBar.d.ts +9 -1
- package/dist-lib/components/pages/SmartDetailPage.d.ts +2 -5
- package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +2 -5
- package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/list/cardProjection.d.ts +66 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useResponsiveMode.d.ts +30 -0
- package/dist-lib/index.d.ts +2 -0
- package/dist-lib/index.js +6773 -15562
- package/dist-lib/peekDraftStore-yyzMbaiI.js +468 -0
- package/dist-lib/registry-2KliNTHB.js +5177 -0
- package/dist-lib/testing.d.ts +3 -0
- package/dist-lib/testing.js +55 -52
- package/dist-lib/types/schema.d.ts +38 -0
- package/dist-lib/useProperties-Co3RdtuT.js +453 -0
- package/dist-lib/{value-D9BaSRFG.js → value-BooGwUik.js} +1 -1
- package/package.json +1 -1
|
@@ -169,7 +169,7 @@ function k({ open: e, onClose: t, anchor: n, children: r, align: i = "start", wi
|
|
|
169
169
|
let s = d(null), [u, p] = f(null);
|
|
170
170
|
if (l(() => {
|
|
171
171
|
if (!e || !n) return;
|
|
172
|
-
let t = n.getBoundingClientRect(), r =
|
|
172
|
+
let t = n.getBoundingClientRect(), r = A(), o = s.current?.offsetHeight || 260, c = r - t.bottom < o + 12 && t.top > o + 12 ? "above" : "below", l = c === "below" ? t.bottom + 4 : t.top - 4 - o, u = typeof window < "u" ? window.innerWidth : 0, d = i === "end" ? t.right - (a || 200) : t.left;
|
|
173
173
|
u && (d = Math.max(8, Math.min(d, u - (a || 200) - 8))), p((e) => e && e.top === l && e.left === d && e.placement === c ? e : {
|
|
174
174
|
top: l,
|
|
175
175
|
left: d,
|
|
@@ -192,7 +192,7 @@ function k({ open: e, onClose: t, anchor: n, children: r, align: i = "start", wi
|
|
|
192
192
|
n,
|
|
193
193
|
t
|
|
194
194
|
]), !e || !u) return null;
|
|
195
|
-
let m = u.placement === "below" ? `calc(
|
|
195
|
+
let m = u.placement === "below" ? `calc(var(--app-height) - ${u.top}px - 8px)` : `${Math.max(120, u.top - 8)}px`, h = ee(o?.maxHeight), g = h ? `min(${m}, ${h})` : m;
|
|
196
196
|
return b(/* @__PURE__ */ v("div", {
|
|
197
197
|
ref: s,
|
|
198
198
|
style: {
|
|
@@ -207,26 +207,42 @@ function k({ open: e, onClose: t, anchor: n, children: r, align: i = "start", wi
|
|
|
207
207
|
borderRadius: 8,
|
|
208
208
|
boxShadow: "var(--shadow-lg)",
|
|
209
209
|
padding: 4,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
...o,
|
|
211
|
+
maxHeight: g,
|
|
212
|
+
overflowY: o?.overflowY ?? "auto",
|
|
213
|
+
overscrollBehavior: "contain"
|
|
214
214
|
},
|
|
215
215
|
children: r
|
|
216
216
|
}), document.body);
|
|
217
217
|
}
|
|
218
|
+
function A() {
|
|
219
|
+
if (typeof window > "u" || typeof document > "u") return 0;
|
|
220
|
+
let e = getComputedStyle(document.documentElement).getPropertyValue("--app-height").trim();
|
|
221
|
+
if (e.endsWith("px")) {
|
|
222
|
+
let t = Number.parseFloat(e);
|
|
223
|
+
if (Number.isFinite(t) && t > 0) return t;
|
|
224
|
+
}
|
|
225
|
+
let t = window.visualViewport?.height;
|
|
226
|
+
return Number.isFinite(t) && t && t > 0 ? t : window.innerHeight;
|
|
227
|
+
}
|
|
228
|
+
function ee(e) {
|
|
229
|
+
if (e != null) return typeof e == "number" ? `${e}px` : String(e);
|
|
230
|
+
}
|
|
218
231
|
//#endregion
|
|
219
232
|
//#region src/components/primitives/HoverCard.tsx
|
|
220
|
-
var
|
|
221
|
-
function
|
|
233
|
+
var j = 400, te = 150, ne = 320, re = 240, ie = 4, ae = 4;
|
|
234
|
+
function oe({ content: e, children: t, width: n = ne, align: r = "center", style: i }) {
|
|
222
235
|
let a = d(null), s = d(null), l = d(null), u = d(null), [p, m] = f(!1), [h, g] = f(null), [x, S] = f(!1), C = o(() => {
|
|
223
236
|
let e = a.current;
|
|
224
237
|
if (!e) return;
|
|
225
|
-
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
238
|
+
let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, o = 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, o - ie * 2)), f = s.current?.offsetHeight ?? re, p = u + c - t.bottom < f + ae * 2 && t.top > f + ae * 2 ? "above" : "below", m = p === "below" ? t.bottom + ae : t.top - ae - f, h;
|
|
239
|
+
h = r === "start" ? t.left : r === "end" ? t.right - d : t.left + t.width / 2 - d / 2;
|
|
240
|
+
let _ = l + ie, v = l + o - ie;
|
|
241
|
+
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 : {
|
|
242
|
+
top: m,
|
|
243
|
+
left: h,
|
|
244
|
+
width: d,
|
|
245
|
+
placement: p
|
|
230
246
|
});
|
|
231
247
|
}, [r, n]), w = d(null), T = o((e) => {
|
|
232
248
|
if (s.current = e, w.current &&= (w.current.disconnect(), null), e) if (typeof ResizeObserver < "u") {
|
|
@@ -235,20 +251,24 @@ function ie({ content: e, children: t, width: n = A, align: r = "center", style:
|
|
|
235
251
|
});
|
|
236
252
|
t.observe(e), w.current = t;
|
|
237
253
|
} else S(!0);
|
|
238
|
-
}, [C]), E = () => {
|
|
254
|
+
}, [C]), E = o(() => {
|
|
239
255
|
l.current !== null && (window.clearTimeout(l.current), l.current = null), u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
240
|
-
}, D = () => {
|
|
256
|
+
}, []), D = () => {
|
|
241
257
|
u.current !== null && (window.clearTimeout(u.current), u.current = null), !(p || l.current !== null) && (l.current = window.setTimeout(() => {
|
|
242
258
|
l.current = null, m(!0);
|
|
243
|
-
},
|
|
244
|
-
}, O = () => {
|
|
259
|
+
}, j));
|
|
260
|
+
}, O = o(() => {
|
|
261
|
+
E(), m(!0);
|
|
262
|
+
}, [E]), k = o(() => {
|
|
263
|
+
E(), m(!1);
|
|
264
|
+
}, [E]), A = () => {
|
|
245
265
|
l.current !== null && (window.clearTimeout(l.current), l.current = null), u.current === null && (u.current = window.setTimeout(() => {
|
|
246
266
|
u.current = null, m(!1);
|
|
247
267
|
}, te));
|
|
248
268
|
};
|
|
249
269
|
c(() => () => {
|
|
250
270
|
E(), w.current &&= (w.current.disconnect(), null);
|
|
251
|
-
}, []), c(() => {
|
|
271
|
+
}, [E]), c(() => {
|
|
252
272
|
if (!p) {
|
|
253
273
|
S(!1);
|
|
254
274
|
return;
|
|
@@ -256,20 +276,27 @@ function ie({ content: e, children: t, width: n = A, align: r = "center", style:
|
|
|
256
276
|
return C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), () => {
|
|
257
277
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C);
|
|
258
278
|
};
|
|
259
|
-
}, [p, C])
|
|
260
|
-
|
|
279
|
+
}, [p, C]), c(() => {
|
|
280
|
+
if (!p) return;
|
|
281
|
+
let e = (e) => {
|
|
282
|
+
let t = e.target;
|
|
283
|
+
t && (a.current?.contains(t) || s.current?.contains(t) || k());
|
|
284
|
+
};
|
|
285
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
286
|
+
}, [k, p]);
|
|
287
|
+
let ee = p && h ? b(/* @__PURE__ */ v("div", {
|
|
261
288
|
ref: T,
|
|
262
289
|
role: "tooltip",
|
|
263
290
|
onMouseEnter: () => {
|
|
264
291
|
u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
265
292
|
},
|
|
266
|
-
onMouseLeave:
|
|
293
|
+
onMouseLeave: A,
|
|
267
294
|
style: {
|
|
268
295
|
position: "fixed",
|
|
269
296
|
top: h.top,
|
|
270
297
|
left: h.left,
|
|
271
|
-
width:
|
|
272
|
-
maxHeight:
|
|
298
|
+
width: h.width,
|
|
299
|
+
maxHeight: re,
|
|
273
300
|
overflowY: "auto",
|
|
274
301
|
zIndex: 250,
|
|
275
302
|
background: "var(--surface)",
|
|
@@ -287,14 +314,31 @@ function ie({ content: e, children: t, width: n = A, align: r = "center", style:
|
|
|
287
314
|
}), document.body) : null;
|
|
288
315
|
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
|
|
289
316
|
ref: a,
|
|
317
|
+
tabIndex: 0,
|
|
318
|
+
"aria-haspopup": "dialog",
|
|
319
|
+
"aria-expanded": p,
|
|
290
320
|
onMouseEnter: D,
|
|
291
|
-
onMouseLeave:
|
|
321
|
+
onMouseLeave: A,
|
|
322
|
+
onFocus: O,
|
|
323
|
+
onBlur: () => {
|
|
324
|
+
window.setTimeout(() => {
|
|
325
|
+
let e = document.activeElement;
|
|
326
|
+
e && (a.current?.contains(e) || s.current?.contains(e)) || m(!1);
|
|
327
|
+
}, 0);
|
|
328
|
+
},
|
|
329
|
+
onPointerDown: (e) => {
|
|
330
|
+
e.pointerType !== "touch" && e.pointerType !== "pen" || (e.preventDefault(), p ? k() : O());
|
|
331
|
+
},
|
|
332
|
+
onKeyDown: (e) => {
|
|
333
|
+
e.key === "Escape" && (e.stopPropagation(), k());
|
|
334
|
+
},
|
|
292
335
|
style: {
|
|
293
336
|
display: "inline",
|
|
294
|
-
maxWidth: "100%"
|
|
337
|
+
maxWidth: "100%",
|
|
338
|
+
outline: "none"
|
|
295
339
|
},
|
|
296
340
|
children: t
|
|
297
|
-
}),
|
|
341
|
+
}), ee] });
|
|
298
342
|
}
|
|
299
343
|
//#endregion
|
|
300
344
|
//#region src/components/primitives/Chip.tsx
|
|
@@ -337,8 +381,90 @@ function M({ icon: t, children: n, onRemove: r, onClick: i }) {
|
|
|
337
381
|
});
|
|
338
382
|
}
|
|
339
383
|
//#endregion
|
|
384
|
+
//#region src/hooks/useResponsiveMode.tsx
|
|
385
|
+
var se = {
|
|
386
|
+
phoneMax: 639,
|
|
387
|
+
tabletMax: 1023
|
|
388
|
+
}, ce = {
|
|
389
|
+
width: 1280,
|
|
390
|
+
height: 720
|
|
391
|
+
}, le = r({
|
|
392
|
+
...ce,
|
|
393
|
+
category: "desktop",
|
|
394
|
+
isPhone: !1,
|
|
395
|
+
isTablet: !1,
|
|
396
|
+
isDesktop: !0,
|
|
397
|
+
touch: !1
|
|
398
|
+
});
|
|
399
|
+
function ue(e, t = se) {
|
|
400
|
+
return !Number.isFinite(e) || e <= 0 ? "desktop" : e <= t.phoneMax ? "phone" : e <= t.tabletMax ? "tablet" : "desktop";
|
|
401
|
+
}
|
|
402
|
+
function de(e) {
|
|
403
|
+
return {
|
|
404
|
+
width: Number.isFinite(e.width) && e.width > 0 ? e.width : ce.width,
|
|
405
|
+
height: Number.isFinite(e.height) && e.height > 0 ? e.height : ce.height,
|
|
406
|
+
touch: e.touch ?? !1
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function fe() {
|
|
410
|
+
if (typeof window > "u") return !1;
|
|
411
|
+
let e = window.matchMedia?.("(pointer: coarse)")?.matches ?? !1, t = window.navigator?.maxTouchPoints ?? 0;
|
|
412
|
+
return e || t > 0;
|
|
413
|
+
}
|
|
414
|
+
function pe() {
|
|
415
|
+
if (typeof window > "u") return ce;
|
|
416
|
+
let e = window.visualViewport;
|
|
417
|
+
return de({
|
|
418
|
+
width: e?.width ?? window.innerWidth,
|
|
419
|
+
height: e?.height ?? window.innerHeight,
|
|
420
|
+
touch: fe()
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
function me(e) {
|
|
424
|
+
if (typeof document > "u") return;
|
|
425
|
+
let t = document.documentElement;
|
|
426
|
+
t.style.setProperty("--app-viewport-width", `${Math.round(e.width)}px`), t.style.setProperty("--app-viewport-height", `${Math.round(e.height)}px`), t.style.setProperty("--app-height", `${Math.round(e.height)}px`);
|
|
427
|
+
let n = e.touch || e.width <= se.phoneMax || e.height <= 520;
|
|
428
|
+
t.style.setProperty("--control-height", n ? "38px" : "30px"), t.style.setProperty("--control-line-height", n ? "36px" : "28px"), t.style.setProperty("--control-font-size", n ? "16px" : "12.5px");
|
|
429
|
+
}
|
|
430
|
+
function he({ children: e, breakpoints: t = se, viewportOverride: n }) {
|
|
431
|
+
let [r, i] = f(() => de(n ?? pe()));
|
|
432
|
+
c(() => {
|
|
433
|
+
if (n) {
|
|
434
|
+
let e = de(n);
|
|
435
|
+
i(e), me(e);
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
let e = () => {
|
|
439
|
+
let e = pe();
|
|
440
|
+
i(e), me(e);
|
|
441
|
+
};
|
|
442
|
+
return e(), window.addEventListener("resize", e), window.addEventListener("orientationchange", e), window.visualViewport?.addEventListener("resize", e), window.visualViewport?.addEventListener("scroll", e), () => {
|
|
443
|
+
window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e), window.visualViewport?.removeEventListener("resize", e), window.visualViewport?.removeEventListener("scroll", e);
|
|
444
|
+
};
|
|
445
|
+
}, [n]);
|
|
446
|
+
let a = u(() => {
|
|
447
|
+
let e = ue(r.width, t);
|
|
448
|
+
return {
|
|
449
|
+
...r,
|
|
450
|
+
category: e,
|
|
451
|
+
isPhone: e === "phone",
|
|
452
|
+
isTablet: e === "tablet",
|
|
453
|
+
isDesktop: e === "desktop",
|
|
454
|
+
touch: r.touch ?? !1
|
|
455
|
+
};
|
|
456
|
+
}, [t, r]);
|
|
457
|
+
return /* @__PURE__ */ v(le.Provider, {
|
|
458
|
+
value: a,
|
|
459
|
+
children: e
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
function ge() {
|
|
463
|
+
return s(le);
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
340
466
|
//#region src/components/primitives/BoolToggle.tsx
|
|
341
|
-
function
|
|
467
|
+
function _e({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
342
468
|
return /* @__PURE__ */ v("button", {
|
|
343
469
|
type: "button",
|
|
344
470
|
id: n,
|
|
@@ -371,7 +497,7 @@ function ae({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
|
|
|
371
497
|
}
|
|
372
498
|
//#endregion
|
|
373
499
|
//#region src/components/primitives/MenuItem.tsx
|
|
374
|
-
function
|
|
500
|
+
function ve({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, disabled: s, title: c, "data-testid": l }) {
|
|
375
501
|
return o ? /* @__PURE__ */ v("div", {
|
|
376
502
|
role: "separator",
|
|
377
503
|
style: {
|
|
@@ -425,7 +551,7 @@ function oe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, di
|
|
|
425
551
|
}
|
|
426
552
|
//#endregion
|
|
427
553
|
//#region src/components/primitives/Spinner.tsx
|
|
428
|
-
function
|
|
554
|
+
function ye({ size: e = 14 }) {
|
|
429
555
|
return /* @__PURE__ */ y("svg", {
|
|
430
556
|
width: e,
|
|
431
557
|
height: e,
|
|
@@ -453,7 +579,7 @@ function se({ size: e = 14 }) {
|
|
|
453
579
|
}
|
|
454
580
|
//#endregion
|
|
455
581
|
//#region src/components/primitives/Fields.tsx
|
|
456
|
-
var
|
|
582
|
+
var be = ({ children: t, required: n, hint: r }) => /* @__PURE__ */ y("div", {
|
|
457
583
|
style: {
|
|
458
584
|
display: "flex",
|
|
459
585
|
alignItems: "center",
|
|
@@ -481,12 +607,12 @@ var ce = ({ children: t, required: n, hint: r }) => /* @__PURE__ */ y("div", {
|
|
|
481
607
|
children: /* @__PURE__ */ v(e.info, { size: 11 })
|
|
482
608
|
})
|
|
483
609
|
]
|
|
484
|
-
}),
|
|
610
|
+
}), xe = {
|
|
485
611
|
width: "100%",
|
|
486
|
-
height:
|
|
612
|
+
height: "var(--control-height)",
|
|
487
613
|
padding: "0 10px",
|
|
488
|
-
fontSize:
|
|
489
|
-
lineHeight: "
|
|
614
|
+
fontSize: "var(--control-font-size)",
|
|
615
|
+
lineHeight: "var(--control-line-height)",
|
|
490
616
|
background: "var(--surface)",
|
|
491
617
|
color: "var(--text)",
|
|
492
618
|
border: "1px solid var(--border)",
|
|
@@ -501,7 +627,7 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
501
627
|
display: "flex",
|
|
502
628
|
alignItems: "center",
|
|
503
629
|
gap: 6,
|
|
504
|
-
...
|
|
630
|
+
...xe,
|
|
505
631
|
padding: r || i ? "0 8px" : "0 10px",
|
|
506
632
|
borderColor: s ? "var(--accent)" : "var(--border)",
|
|
507
633
|
boxShadow: s ? "0 0 0 3px var(--accent-ring)" : "none",
|
|
@@ -526,7 +652,7 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
526
652
|
outline: 0,
|
|
527
653
|
background: "transparent",
|
|
528
654
|
flex: 1,
|
|
529
|
-
fontSize:
|
|
655
|
+
fontSize: "var(--control-font-size)",
|
|
530
656
|
color: "var(--text)",
|
|
531
657
|
padding: 0,
|
|
532
658
|
minWidth: 0
|
|
@@ -543,7 +669,7 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
543
669
|
]
|
|
544
670
|
});
|
|
545
671
|
}
|
|
546
|
-
function
|
|
672
|
+
function Se({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a, name: o, ariaRequired: s }) {
|
|
547
673
|
let [c, l] = f(!1), u = i ? {
|
|
548
674
|
flex: 1,
|
|
549
675
|
height: "100%",
|
|
@@ -564,7 +690,7 @@ function ue({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
|
|
|
564
690
|
onFocus: () => l(!0),
|
|
565
691
|
onBlur: () => l(!1),
|
|
566
692
|
style: {
|
|
567
|
-
...
|
|
693
|
+
...xe,
|
|
568
694
|
padding: "8px 10px",
|
|
569
695
|
lineHeight: 1.5,
|
|
570
696
|
...u,
|
|
@@ -574,17 +700,17 @@ function ue({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
|
|
|
574
700
|
}
|
|
575
701
|
});
|
|
576
702
|
}
|
|
577
|
-
var
|
|
578
|
-
function
|
|
703
|
+
var Ce = 20, we = 100;
|
|
704
|
+
function Te(e) {
|
|
579
705
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
|
|
580
706
|
}
|
|
581
707
|
function P({ value: t, options: n, onChange: r, placeholder: i = "Select...", onSearchChange: a, ...o }) {
|
|
582
|
-
let [s, c] = f(!1), [l, p] = f(""), m = d(null), h = n.find((e) => !e.heading && !e.divider && e.value === t), g = n.filter((e) => !e.heading && !e.divider).length, b = !!a, x = b || g >
|
|
708
|
+
let [s, c] = f(!1), [l, p] = f(""), m = d(null), h = n.find((e) => !e.heading && !e.divider && e.value === t), g = n.filter((e) => !e.heading && !e.divider).length, b = !!a, x = b || g > Ce, S = (e) => {
|
|
583
709
|
p(e), a?.(e);
|
|
584
710
|
}, C = u(() => {
|
|
585
|
-
if (b) return n.slice(0,
|
|
711
|
+
if (b) return n.slice(0, we);
|
|
586
712
|
let e = l.trim().toLowerCase();
|
|
587
|
-
return e ? n.filter((t) => !t.heading && !t.divider &&
|
|
713
|
+
return e ? n.filter((t) => !t.heading && !t.divider && Te(t).toLowerCase().includes(e)).slice(0, we) : n.slice(0, we);
|
|
588
714
|
}, [
|
|
589
715
|
n,
|
|
590
716
|
l,
|
|
@@ -603,7 +729,7 @@ function P({ value: t, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
603
729
|
});
|
|
604
730
|
},
|
|
605
731
|
style: {
|
|
606
|
-
...
|
|
732
|
+
...xe,
|
|
607
733
|
display: "flex",
|
|
608
734
|
alignItems: "center",
|
|
609
735
|
justifyContent: "space-between",
|
|
@@ -632,7 +758,7 @@ function P({ value: t, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
632
758
|
onClose: () => c(!1),
|
|
633
759
|
width: m.current?.offsetWidth,
|
|
634
760
|
style: {
|
|
635
|
-
maxHeight: "min(360px, calc(
|
|
761
|
+
maxHeight: "min(360px, calc(var(--app-height) - 24px))",
|
|
636
762
|
overflowY: "auto"
|
|
637
763
|
},
|
|
638
764
|
children: [
|
|
@@ -665,7 +791,7 @@ function P({ value: t, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
665
791
|
letterSpacing: "0.06em"
|
|
666
792
|
},
|
|
667
793
|
children: e.label
|
|
668
|
-
}, `heading-${n}`) : /* @__PURE__ */ v(
|
|
794
|
+
}, `heading-${n}`) : /* @__PURE__ */ v(ve, {
|
|
669
795
|
onClick: () => {
|
|
670
796
|
r(e.value), c(!1);
|
|
671
797
|
},
|
|
@@ -683,7 +809,7 @@ function P({ value: t, options: n, onChange: r, placeholder: i = "Select...", on
|
|
|
683
809
|
]
|
|
684
810
|
})] });
|
|
685
811
|
}
|
|
686
|
-
function
|
|
812
|
+
function Ee({ value: t, onChange: n }) {
|
|
687
813
|
return /* @__PURE__ */ v(N, {
|
|
688
814
|
value: t || "",
|
|
689
815
|
onChange: n,
|
|
@@ -691,26 +817,26 @@ function me({ value: t, onChange: n }) {
|
|
|
691
817
|
prefix: /* @__PURE__ */ v(e.calendar, { size: 13 })
|
|
692
818
|
});
|
|
693
819
|
}
|
|
694
|
-
function
|
|
820
|
+
function De(e) {
|
|
695
821
|
if (!e) return 0;
|
|
696
822
|
let t = 0;
|
|
697
823
|
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);
|
|
698
824
|
}
|
|
699
|
-
var
|
|
825
|
+
var Oe = [
|
|
700
826
|
"Too short",
|
|
701
827
|
"Weak",
|
|
702
828
|
"Fair",
|
|
703
829
|
"Good",
|
|
704
830
|
"Strong"
|
|
705
|
-
],
|
|
831
|
+
], ke = [
|
|
706
832
|
"var(--danger)",
|
|
707
833
|
"var(--danger)",
|
|
708
834
|
"var(--warning, #B45309)",
|
|
709
835
|
"var(--accent)",
|
|
710
836
|
"var(--success, #3FBF8F)"
|
|
711
837
|
];
|
|
712
|
-
function
|
|
713
|
-
let [c, l] = f(!1), u = t || "", d =
|
|
838
|
+
function Ae({ value: t, onChange: n, placeholder: r = "Enter password", showStrength: i, id: a, name: o, ariaRequired: s }) {
|
|
839
|
+
let [c, l] = f(!1), u = t || "", d = De(u);
|
|
714
840
|
return /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v(N, {
|
|
715
841
|
id: a,
|
|
716
842
|
name: o,
|
|
@@ -755,7 +881,7 @@ function ve({ value: t, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
755
881
|
flex: 1,
|
|
756
882
|
height: 3,
|
|
757
883
|
borderRadius: 999,
|
|
758
|
-
background: e < d ?
|
|
884
|
+
background: e < d ? ke[d] : "var(--surface-3)",
|
|
759
885
|
transition: "background .15s"
|
|
760
886
|
} }, e))
|
|
761
887
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -765,17 +891,17 @@ function ve({ value: t, onChange: n, placeholder: r = "Enter password", showStre
|
|
|
765
891
|
minWidth: 54,
|
|
766
892
|
textAlign: "right"
|
|
767
893
|
},
|
|
768
|
-
children: u ?
|
|
894
|
+
children: u ? Oe[d] : ""
|
|
769
895
|
})]
|
|
770
896
|
})] });
|
|
771
897
|
}
|
|
772
|
-
function
|
|
898
|
+
function je({ value: e = [], onChange: t }) {
|
|
773
899
|
let [n, r] = f("");
|
|
774
900
|
return /* @__PURE__ */ y("div", {
|
|
775
901
|
style: {
|
|
776
|
-
...
|
|
902
|
+
...xe,
|
|
777
903
|
height: "auto",
|
|
778
|
-
minHeight:
|
|
904
|
+
minHeight: "var(--control-height)",
|
|
779
905
|
display: "flex",
|
|
780
906
|
flexWrap: "wrap",
|
|
781
907
|
gap: 4,
|
|
@@ -799,13 +925,13 @@ function ye({ value: e = [], onChange: t }) {
|
|
|
799
925
|
flex: 1,
|
|
800
926
|
minWidth: 80,
|
|
801
927
|
background: "transparent",
|
|
802
|
-
fontSize:
|
|
928
|
+
fontSize: "var(--control-font-size)",
|
|
803
929
|
padding: "4px 2px"
|
|
804
930
|
}
|
|
805
931
|
})]
|
|
806
932
|
});
|
|
807
933
|
}
|
|
808
|
-
function
|
|
934
|
+
function Me({ value: e, onChange: t }) {
|
|
809
935
|
return /* @__PURE__ */ y("div", {
|
|
810
936
|
style: {
|
|
811
937
|
border: "1px solid var(--border)",
|
|
@@ -853,7 +979,7 @@ function be({ value: e, onChange: t }) {
|
|
|
853
979
|
width: "100%",
|
|
854
980
|
minHeight: 140,
|
|
855
981
|
padding: "10px 12px",
|
|
856
|
-
fontSize:
|
|
982
|
+
fontSize: "var(--control-font-size)",
|
|
857
983
|
lineHeight: 1.6,
|
|
858
984
|
background: "transparent",
|
|
859
985
|
border: 0,
|
|
@@ -864,7 +990,7 @@ function be({ value: e, onChange: t }) {
|
|
|
864
990
|
})]
|
|
865
991
|
});
|
|
866
992
|
}
|
|
867
|
-
function
|
|
993
|
+
function Ne({ value: t, entity: n = "company", onChange: r, items: i = [], id: a, ariaLabelledby: o, ariaRequired: s }) {
|
|
868
994
|
let [c, l] = f(!1), u = d(null);
|
|
869
995
|
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("button", {
|
|
870
996
|
type: "button",
|
|
@@ -874,7 +1000,7 @@ function xe({ value: t, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
874
1000
|
ref: u,
|
|
875
1001
|
onClick: () => l(!0),
|
|
876
1002
|
style: {
|
|
877
|
-
...
|
|
1003
|
+
...xe,
|
|
878
1004
|
display: "flex",
|
|
879
1005
|
alignItems: "center",
|
|
880
1006
|
justifyContent: "space-between",
|
|
@@ -921,7 +1047,7 @@ function xe({ value: t, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
921
1047
|
prefix: /* @__PURE__ */ v(e.search, { size: 12 }),
|
|
922
1048
|
style: { marginBottom: 4 }
|
|
923
1049
|
})
|
|
924
|
-
}), i.slice(0, 6).map((t) => /* @__PURE__ */ v(
|
|
1050
|
+
}), i.slice(0, 6).map((t) => /* @__PURE__ */ v(ve, {
|
|
925
1051
|
icon: /* @__PURE__ */ v(e.building, { size: 13 }),
|
|
926
1052
|
onClick: () => {
|
|
927
1053
|
r?.(t.name), l(!1);
|
|
@@ -930,7 +1056,7 @@ function xe({ value: t, entity: n = "company", onChange: r, items: i = [], id: a
|
|
|
930
1056
|
}, t.id))]
|
|
931
1057
|
})] });
|
|
932
1058
|
}
|
|
933
|
-
function
|
|
1059
|
+
function Pe({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
934
1060
|
return /* @__PURE__ */ y("div", {
|
|
935
1061
|
style: {
|
|
936
1062
|
display: "flex",
|
|
@@ -963,7 +1089,7 @@ function Se({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
963
1089
|
})]
|
|
964
1090
|
});
|
|
965
1091
|
}
|
|
966
|
-
function
|
|
1092
|
+
function Fe({ value: t, onChange: n, type: r = "text", options: i }) {
|
|
967
1093
|
let [a, o] = f(!1), [s, c] = f(t), l = () => {
|
|
968
1094
|
s !== void 0 && n?.(s), o(!1);
|
|
969
1095
|
}, u = () => {
|
|
@@ -984,7 +1110,7 @@ function Ce({ value: t, onChange: n, type: r = "text", options: i }) {
|
|
|
984
1110
|
onChange: (e) => {
|
|
985
1111
|
c(e), n?.(e), o(!1);
|
|
986
1112
|
}
|
|
987
|
-
}) : r === "bool" ? /* @__PURE__ */ v(
|
|
1113
|
+
}) : r === "bool" ? /* @__PURE__ */ v(_e, {
|
|
988
1114
|
value: s === "true",
|
|
989
1115
|
onChange: (e) => {
|
|
990
1116
|
let t = String(e);
|
|
@@ -1032,7 +1158,7 @@ function Ce({ value: t, onChange: n, type: r = "text", options: i }) {
|
|
|
1032
1158
|
}
|
|
1033
1159
|
//#endregion
|
|
1034
1160
|
//#region src/types/ordmap.ts
|
|
1035
|
-
var
|
|
1161
|
+
var Ie = class e {
|
|
1036
1162
|
#e;
|
|
1037
1163
|
#t;
|
|
1038
1164
|
constructor(e) {
|
|
@@ -1094,10 +1220,10 @@ function F(e) {
|
|
|
1094
1220
|
function I(e, t = "en") {
|
|
1095
1221
|
return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
|
|
1096
1222
|
}
|
|
1097
|
-
var
|
|
1098
|
-
function
|
|
1223
|
+
var Le = "$display";
|
|
1224
|
+
function Re(e, t) {
|
|
1099
1225
|
if (!e) return;
|
|
1100
|
-
let n = e[
|
|
1226
|
+
let n = e[Le];
|
|
1101
1227
|
if (typeof n == "string" && n !== "") return n;
|
|
1102
1228
|
let r = t?.display?.display_field;
|
|
1103
1229
|
if (!r) return;
|
|
@@ -1105,7 +1231,7 @@ function Ee(e, t) {
|
|
|
1105
1231
|
if (i != null) return typeof i == "object" && !Array.isArray(i) ? I(i) || void 0 : F(i);
|
|
1106
1232
|
}
|
|
1107
1233
|
function L(e, t, n) {
|
|
1108
|
-
let r = e[
|
|
1234
|
+
let r = e[Le];
|
|
1109
1235
|
if (typeof r == "string" && r !== "") return r;
|
|
1110
1236
|
if (t) {
|
|
1111
1237
|
let r = e[t];
|
|
@@ -1113,11 +1239,11 @@ function L(e, t, n) {
|
|
|
1113
1239
|
}
|
|
1114
1240
|
return n;
|
|
1115
1241
|
}
|
|
1116
|
-
function
|
|
1242
|
+
function ze(e) {
|
|
1117
1243
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
1118
1244
|
return RegExp("^" + t.join("/") + "$");
|
|
1119
1245
|
}
|
|
1120
|
-
function
|
|
1246
|
+
function Be(e) {
|
|
1121
1247
|
let t = (() => {
|
|
1122
1248
|
try {
|
|
1123
1249
|
return decodeURIComponent(e);
|
|
@@ -1127,17 +1253,17 @@ function Oe(e) {
|
|
|
1127
1253
|
})().split("-")[0];
|
|
1128
1254
|
return t.length > 8 ? t.slice(0, 8) : t;
|
|
1129
1255
|
}
|
|
1130
|
-
function
|
|
1256
|
+
function Ve(e, t, n) {
|
|
1131
1257
|
if (!t) return;
|
|
1132
1258
|
let r = e.replace(/\/+$/, "") || "/", i;
|
|
1133
1259
|
for (let e of Object.values(t)) {
|
|
1134
|
-
if (!e.route || !
|
|
1260
|
+
if (!e.route || !ze(e.route).test(r)) continue;
|
|
1135
1261
|
let t = e.route.includes("/:"), a = I(e.display?.name);
|
|
1136
1262
|
if (!a && t && n && e.entity) {
|
|
1137
1263
|
let t = I(n[e.entity]?.display?.name);
|
|
1138
1264
|
if (t) {
|
|
1139
1265
|
let e = r.slice(r.lastIndexOf("/") + 1);
|
|
1140
|
-
a = e ? `${t} ${
|
|
1266
|
+
a = e ? `${t} ${Be(e)}` : t;
|
|
1141
1267
|
}
|
|
1142
1268
|
}
|
|
1143
1269
|
if (!a) continue;
|
|
@@ -1150,7 +1276,7 @@ function ke(e, t, n) {
|
|
|
1150
1276
|
}
|
|
1151
1277
|
return i;
|
|
1152
1278
|
}
|
|
1153
|
-
function
|
|
1279
|
+
function He(e, t, n) {
|
|
1154
1280
|
let r = I(e.display?.name);
|
|
1155
1281
|
if (r) return r;
|
|
1156
1282
|
if (e.type === "ref" && e.ref?.entity && n) {
|
|
@@ -1162,10 +1288,10 @@ function Ae(e, t, n) {
|
|
|
1162
1288
|
}
|
|
1163
1289
|
return t;
|
|
1164
1290
|
}
|
|
1165
|
-
function
|
|
1291
|
+
function Ue(e) {
|
|
1166
1292
|
if (e != null) return typeof e == "string" ? { entity: e } : e;
|
|
1167
1293
|
}
|
|
1168
|
-
function
|
|
1294
|
+
function We(e, t) {
|
|
1169
1295
|
let n = e ?? [];
|
|
1170
1296
|
if (!t) return n;
|
|
1171
1297
|
switch (t.mode ?? "append") {
|
|
@@ -1174,7 +1300,7 @@ function Me(e, t) {
|
|
|
1174
1300
|
default: return [...n, ...t.values ?? []];
|
|
1175
1301
|
}
|
|
1176
1302
|
}
|
|
1177
|
-
function
|
|
1303
|
+
function Ge(e) {
|
|
1178
1304
|
let t = e.name, n = e.display ? {
|
|
1179
1305
|
...e.display,
|
|
1180
1306
|
name: e.display.name ?? t
|
|
@@ -1187,7 +1313,7 @@ function Ne(e) {
|
|
|
1187
1313
|
structure: e.structure
|
|
1188
1314
|
};
|
|
1189
1315
|
}
|
|
1190
|
-
function
|
|
1316
|
+
function Ke(e, t) {
|
|
1191
1317
|
return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
|
|
1192
1318
|
}
|
|
1193
1319
|
function R(e) {
|
|
@@ -1195,25 +1321,25 @@ function R(e) {
|
|
|
1195
1321
|
for (let [t, n] of e.fields) if (n.primary) return [t];
|
|
1196
1322
|
return ["id"];
|
|
1197
1323
|
}
|
|
1198
|
-
function
|
|
1324
|
+
function qe(e, t) {
|
|
1199
1325
|
let n = R(e), r = {};
|
|
1200
1326
|
for (let e of n) r[e] = F(t[e]);
|
|
1201
1327
|
return r;
|
|
1202
1328
|
}
|
|
1203
|
-
function
|
|
1329
|
+
function Je(e) {
|
|
1204
1330
|
return e.length === 1 ? e[0] : JSON.stringify(e);
|
|
1205
1331
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return
|
|
1332
|
+
function Ye(e) {
|
|
1333
|
+
return Je(Object.values(e));
|
|
1208
1334
|
}
|
|
1209
|
-
function
|
|
1210
|
-
return
|
|
1335
|
+
function Xe(e, t) {
|
|
1336
|
+
return Je(R(e).map((e) => t[e] ?? ""));
|
|
1211
1337
|
}
|
|
1212
|
-
function
|
|
1338
|
+
function Ze(e, t) {
|
|
1213
1339
|
let n = R(e);
|
|
1214
1340
|
if (n.length === 1) return { [n[0]]: t };
|
|
1215
1341
|
}
|
|
1216
|
-
function
|
|
1342
|
+
function Qe(e, t) {
|
|
1217
1343
|
if (t <= 1) return [e];
|
|
1218
1344
|
try {
|
|
1219
1345
|
let n = JSON.parse(e);
|
|
@@ -1223,23 +1349,23 @@ function Be(e, t) {
|
|
|
1223
1349
|
}
|
|
1224
1350
|
return null;
|
|
1225
1351
|
}
|
|
1226
|
-
function
|
|
1352
|
+
function $e(e, t, n) {
|
|
1227
1353
|
if (e?.detail_screen === "none") return null;
|
|
1228
1354
|
let r = e?.detail_screen ?? t?.detail_screen;
|
|
1229
1355
|
return r ? n?.[r]?.route ?? null : null;
|
|
1230
1356
|
}
|
|
1231
|
-
function
|
|
1357
|
+
function et(e, t, n, r) {
|
|
1232
1358
|
if (!t) return null;
|
|
1233
|
-
let i =
|
|
1359
|
+
let i = $e(e, n, r);
|
|
1234
1360
|
return i ? i.replace(":id", encodeURIComponent(t)) : null;
|
|
1235
1361
|
}
|
|
1236
|
-
function
|
|
1237
|
-
return !t || R(t).some((e) => !r[e]) ? null :
|
|
1362
|
+
function tt(e, t, n, r) {
|
|
1363
|
+
return !t || R(t).some((e) => !r[e]) ? null : et(e, Xe(t, r), t, n);
|
|
1238
1364
|
}
|
|
1239
|
-
function
|
|
1240
|
-
return t ?
|
|
1365
|
+
function nt(e, t, n, r) {
|
|
1366
|
+
return t ? tt(e, t, n, qe(t, r)) : null;
|
|
1241
1367
|
}
|
|
1242
|
-
function
|
|
1368
|
+
function rt(e) {
|
|
1243
1369
|
return R(e).length > 1;
|
|
1244
1370
|
}
|
|
1245
1371
|
//#endregion
|
|
@@ -1252,42 +1378,42 @@ var z = class extends Error {
|
|
|
1252
1378
|
constructor(e, t, n, r, i) {
|
|
1253
1379
|
super(t), this.name = "ApiError", this.status = e, this.code = n, this.index = r, this.raw = i;
|
|
1254
1380
|
}
|
|
1255
|
-
},
|
|
1256
|
-
function
|
|
1381
|
+
}, it = "cursor_semantics_mismatch", at = "cursor_locale_changed";
|
|
1382
|
+
function ot(e) {
|
|
1257
1383
|
return e instanceof z && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
|
|
1258
1384
|
}
|
|
1259
1385
|
//#endregion
|
|
1260
1386
|
//#region src/api/auth-redirect.ts
|
|
1261
|
-
var B = "/",
|
|
1262
|
-
function
|
|
1387
|
+
var B = "/", st = "/login", ct = "/signup", lt = "https://declarion.local";
|
|
1388
|
+
function ut(e) {
|
|
1263
1389
|
let t = e.split(/[?#]/, 1)[0];
|
|
1264
|
-
return t ===
|
|
1390
|
+
return t === st || t.startsWith(`${st}/`) || t === ct || t.startsWith(`${ct}/`);
|
|
1265
1391
|
}
|
|
1266
|
-
function
|
|
1392
|
+
function dt(e) {
|
|
1267
1393
|
if (!e) return B;
|
|
1268
1394
|
let t = e.toLowerCase();
|
|
1269
1395
|
if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return B;
|
|
1270
1396
|
try {
|
|
1271
|
-
let t = new URL(e,
|
|
1272
|
-
if (t.origin !==
|
|
1397
|
+
let t = new URL(e, lt);
|
|
1398
|
+
if (t.origin !== lt) return B;
|
|
1273
1399
|
let n = `${t.pathname}${t.search}${t.hash}`;
|
|
1274
1400
|
return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? B : n || B;
|
|
1275
1401
|
} catch {
|
|
1276
1402
|
return B;
|
|
1277
1403
|
}
|
|
1278
1404
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let t =
|
|
1281
|
-
return t === B ||
|
|
1405
|
+
function ft(e) {
|
|
1406
|
+
let t = dt(e);
|
|
1407
|
+
return t === B || ut(t) ? st : `${st}?next=${encodeURIComponent(t)}`;
|
|
1282
1408
|
}
|
|
1283
|
-
function
|
|
1284
|
-
if (typeof window > "u") return
|
|
1409
|
+
function pt() {
|
|
1410
|
+
if (typeof window > "u") return st;
|
|
1285
1411
|
let { pathname: e, search: t, hash: n } = window.location;
|
|
1286
|
-
return
|
|
1412
|
+
return ft(`${e}${t}${n}`);
|
|
1287
1413
|
}
|
|
1288
1414
|
//#endregion
|
|
1289
1415
|
//#region src/embed/protocol.ts
|
|
1290
|
-
var
|
|
1416
|
+
var mt = "declarion-embed", ht = {
|
|
1291
1417
|
ready: "ready",
|
|
1292
1418
|
setToken: "set-token",
|
|
1293
1419
|
tokenExpired: "token-expired",
|
|
@@ -1300,10 +1426,10 @@ var nt = "declarion-embed", rt = {
|
|
|
1300
1426
|
navigate: "navigate",
|
|
1301
1427
|
setTheme: "set-theme"
|
|
1302
1428
|
};
|
|
1303
|
-
function
|
|
1429
|
+
function gt(e, t, n) {
|
|
1304
1430
|
if (!e || typeof window > "u" || window.parent === window) return !1;
|
|
1305
1431
|
let r = {
|
|
1306
|
-
source:
|
|
1432
|
+
source: mt,
|
|
1307
1433
|
protocol: 1,
|
|
1308
1434
|
type: t,
|
|
1309
1435
|
payload: n
|
|
@@ -1312,28 +1438,28 @@ function it(e, t, n) {
|
|
|
1312
1438
|
}
|
|
1313
1439
|
//#endregion
|
|
1314
1440
|
//#region src/embed/token.ts
|
|
1315
|
-
var
|
|
1441
|
+
var _t = 15e3, vt = 5e3, V = {
|
|
1316
1442
|
active: !1,
|
|
1317
1443
|
parentOrigin: null,
|
|
1318
1444
|
current: null,
|
|
1319
1445
|
pending: null
|
|
1320
1446
|
};
|
|
1321
|
-
function
|
|
1447
|
+
function yt(e) {
|
|
1322
1448
|
V.active = !0, V.parentOrigin = e;
|
|
1323
1449
|
}
|
|
1324
|
-
function
|
|
1450
|
+
function bt() {
|
|
1325
1451
|
return V.active;
|
|
1326
1452
|
}
|
|
1327
|
-
function
|
|
1453
|
+
function xt() {
|
|
1328
1454
|
return V.current?.token ?? null;
|
|
1329
1455
|
}
|
|
1330
|
-
function
|
|
1456
|
+
function St() {
|
|
1331
1457
|
return V.parentOrigin;
|
|
1332
1458
|
}
|
|
1333
|
-
function
|
|
1334
|
-
return V.current ? Date.now() >= V.current.expiresAt -
|
|
1459
|
+
function Ct() {
|
|
1460
|
+
return V.current ? Date.now() >= V.current.expiresAt - vt : !0;
|
|
1335
1461
|
}
|
|
1336
|
-
function
|
|
1462
|
+
function wt(e) {
|
|
1337
1463
|
if (!e.token || typeof e.token != "string") return;
|
|
1338
1464
|
let t = Date.parse(e.expires_at);
|
|
1339
1465
|
if (!Number.isNaN(t) && (V.current = {
|
|
@@ -1344,31 +1470,31 @@ function ft(e) {
|
|
|
1344
1470
|
V.pending = null, clearTimeout(t.timer), t.resolve(e.token);
|
|
1345
1471
|
}
|
|
1346
1472
|
}
|
|
1347
|
-
function
|
|
1473
|
+
function Tt() {
|
|
1348
1474
|
V.current = null;
|
|
1349
1475
|
}
|
|
1350
|
-
function
|
|
1351
|
-
if (!
|
|
1476
|
+
function Et() {
|
|
1477
|
+
if (!Ct() && V.current) return Promise.resolve(V.current.token);
|
|
1352
1478
|
if (V.pending) return V.pending.promise;
|
|
1353
1479
|
let e, t, n = new Promise((n, r) => {
|
|
1354
1480
|
e = n, t = r;
|
|
1355
1481
|
}), r = setTimeout(() => {
|
|
1356
|
-
V.pending && V.pending.promise === n && (V.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${
|
|
1357
|
-
},
|
|
1482
|
+
V.pending && V.pending.promise === n && (V.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${_t}ms`));
|
|
1483
|
+
}, _t);
|
|
1358
1484
|
return V.pending = {
|
|
1359
1485
|
promise: n,
|
|
1360
1486
|
resolve: e,
|
|
1361
1487
|
reject: t,
|
|
1362
1488
|
timer: r
|
|
1363
|
-
},
|
|
1489
|
+
}, gt(V.parentOrigin, ht.tokenExpired, {}), n;
|
|
1364
1490
|
}
|
|
1365
1491
|
//#endregion
|
|
1366
1492
|
//#region src/lib/versionTracker.ts
|
|
1367
|
-
var
|
|
1368
|
-
function
|
|
1493
|
+
var Dt = "X-Declarion-Version", Ot = "declarion-version";
|
|
1494
|
+
function kt() {
|
|
1369
1495
|
if (typeof BroadcastChannel > "u") return null;
|
|
1370
1496
|
try {
|
|
1371
|
-
return new BroadcastChannel(
|
|
1497
|
+
return new BroadcastChannel(Ot);
|
|
1372
1498
|
} catch {
|
|
1373
1499
|
return null;
|
|
1374
1500
|
}
|
|
@@ -1380,8 +1506,8 @@ var H = {
|
|
|
1380
1506
|
listeners: /* @__PURE__ */ new Set(),
|
|
1381
1507
|
channel: null
|
|
1382
1508
|
};
|
|
1383
|
-
function
|
|
1384
|
-
H.channel || typeof BroadcastChannel > "u" || (H.channel =
|
|
1509
|
+
function At() {
|
|
1510
|
+
H.channel || typeof BroadcastChannel > "u" || (H.channel = kt(), H.channel && H.channel.addEventListener("message", (e) => {
|
|
1385
1511
|
let t = e.data;
|
|
1386
1512
|
if (!(!t || t.type !== "drift" || !t.delta) && !H.hasReportedDrift) {
|
|
1387
1513
|
H.hasReportedDrift = !0;
|
|
@@ -1389,30 +1515,30 @@ function vt() {
|
|
|
1389
1515
|
}
|
|
1390
1516
|
}));
|
|
1391
1517
|
}
|
|
1392
|
-
function
|
|
1393
|
-
if (
|
|
1394
|
-
let t = e.get(
|
|
1518
|
+
function jt(e) {
|
|
1519
|
+
if (At(), !e) return;
|
|
1520
|
+
let t = e.get(Dt);
|
|
1395
1521
|
if (t) {
|
|
1396
1522
|
if (!H.firstSeen) {
|
|
1397
1523
|
H.firstSeen = t;
|
|
1398
1524
|
return;
|
|
1399
1525
|
}
|
|
1400
|
-
t !== H.firstSeen && (H.hasReportedDrift ||
|
|
1401
|
-
|
|
1526
|
+
t !== H.firstSeen && (H.hasReportedDrift || Mt().catch(() => {
|
|
1527
|
+
Pt({
|
|
1402
1528
|
kind: "unknown",
|
|
1403
1529
|
observed: t
|
|
1404
1530
|
});
|
|
1405
1531
|
}));
|
|
1406
1532
|
}
|
|
1407
1533
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
|
|
1534
|
+
async function Mt() {
|
|
1535
|
+
At();
|
|
1410
1536
|
let e;
|
|
1411
1537
|
try {
|
|
1412
1538
|
let t = {};
|
|
1413
1539
|
H.firstSeen && (t["If-None-Match"] = `"${H.firstSeen}"`), e = await fetch("/api/version", {
|
|
1414
1540
|
method: "GET",
|
|
1415
|
-
credentials:
|
|
1541
|
+
credentials: bt() ? "omit" : "include",
|
|
1416
1542
|
headers: t
|
|
1417
1543
|
});
|
|
1418
1544
|
} catch {
|
|
@@ -1433,18 +1559,18 @@ async function bt() {
|
|
|
1433
1559
|
asset: t.asset_fingerprint,
|
|
1434
1560
|
binary: t.binary_fingerprint
|
|
1435
1561
|
} : void 0;
|
|
1436
|
-
H.firstSeen ||= n, !H.firstComponents && r && n === H.firstSeen && (H.firstComponents = r), n !== H.firstSeen &&
|
|
1437
|
-
kind:
|
|
1562
|
+
H.firstSeen ||= n, !H.firstComponents && r && n === H.firstSeen && (H.firstComponents = r), n !== H.firstSeen && Pt({
|
|
1563
|
+
kind: Nt(H.firstComponents, r),
|
|
1438
1564
|
observed: n,
|
|
1439
1565
|
components: r
|
|
1440
1566
|
});
|
|
1441
1567
|
}
|
|
1442
|
-
function
|
|
1568
|
+
function Nt(e, t) {
|
|
1443
1569
|
if (!e || !t) return "unknown";
|
|
1444
1570
|
let n = e.schema !== t.schema, r = e.asset !== t.asset, i = e.binary !== t.binary;
|
|
1445
1571
|
return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
|
|
1446
1572
|
}
|
|
1447
|
-
function
|
|
1573
|
+
function Pt(e) {
|
|
1448
1574
|
if (!H.hasReportedDrift) {
|
|
1449
1575
|
H.hasReportedDrift = !0;
|
|
1450
1576
|
for (let t of H.listeners) t(e);
|
|
@@ -1454,18 +1580,18 @@ function St(e) {
|
|
|
1454
1580
|
delta: e
|
|
1455
1581
|
});
|
|
1456
1582
|
} catch {}
|
|
1457
|
-
|
|
1583
|
+
bt() && e.kind !== "schema-only" && gt(St(), ht.reloadRequired, { reason: `version drift: ${e.kind}` });
|
|
1458
1584
|
}
|
|
1459
1585
|
}
|
|
1460
|
-
function
|
|
1586
|
+
function Ft(e) {
|
|
1461
1587
|
return H.listeners.add(e), () => {
|
|
1462
1588
|
H.listeners.delete(e);
|
|
1463
1589
|
};
|
|
1464
1590
|
}
|
|
1465
1591
|
//#endregion
|
|
1466
1592
|
//#region src/api/client.ts
|
|
1467
|
-
var
|
|
1468
|
-
function
|
|
1593
|
+
var It = (e) => JSON.stringify(e ?? {}), Lt = null, U = "declarion.auth.refresh.lock", Rt = "declarion.auth.refresh.result", zt = "declarion.auth.refresh", Bt = 3e4, Vt = 100, Ht = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1594
|
+
function Ut() {
|
|
1469
1595
|
if (typeof window > "u") return !1;
|
|
1470
1596
|
try {
|
|
1471
1597
|
let e = window.localStorage, t = `${U}.probe`;
|
|
@@ -1474,10 +1600,10 @@ function jt() {
|
|
|
1474
1600
|
return !1;
|
|
1475
1601
|
}
|
|
1476
1602
|
}
|
|
1477
|
-
function
|
|
1603
|
+
function Wt() {
|
|
1478
1604
|
return typeof navigator > "u" ? null : navigator.locks ?? null;
|
|
1479
1605
|
}
|
|
1480
|
-
function
|
|
1606
|
+
function Gt(e) {
|
|
1481
1607
|
if (!e) return null;
|
|
1482
1608
|
try {
|
|
1483
1609
|
let t = JSON.parse(e);
|
|
@@ -1489,7 +1615,7 @@ function Nt(e) {
|
|
|
1489
1615
|
return null;
|
|
1490
1616
|
}
|
|
1491
1617
|
}
|
|
1492
|
-
function
|
|
1618
|
+
function Kt(e) {
|
|
1493
1619
|
if (!e) return null;
|
|
1494
1620
|
try {
|
|
1495
1621
|
let t = JSON.parse(e);
|
|
@@ -1503,47 +1629,47 @@ function Pt(e) {
|
|
|
1503
1629
|
return null;
|
|
1504
1630
|
}
|
|
1505
1631
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (!
|
|
1508
|
-
let t =
|
|
1632
|
+
function qt(e) {
|
|
1633
|
+
if (!Ut()) return null;
|
|
1634
|
+
let t = Kt(window.localStorage.getItem(Rt));
|
|
1509
1635
|
return !t || t.updated_at < e ? null : t;
|
|
1510
1636
|
}
|
|
1511
|
-
function
|
|
1637
|
+
function Jt(e) {
|
|
1512
1638
|
if (!e.ok) throw new W(e.status ?? 401);
|
|
1513
1639
|
}
|
|
1514
|
-
function
|
|
1515
|
-
let t =
|
|
1516
|
-
if (t && t.expires_at > e && t.owner !==
|
|
1640
|
+
function Yt(e = Date.now()) {
|
|
1641
|
+
let t = Gt(window.localStorage.getItem(U));
|
|
1642
|
+
if (t && t.expires_at > e && t.owner !== Ht) return !1;
|
|
1517
1643
|
let n = {
|
|
1518
|
-
owner:
|
|
1519
|
-
expires_at: e +
|
|
1644
|
+
owner: Ht,
|
|
1645
|
+
expires_at: e + Bt
|
|
1520
1646
|
};
|
|
1521
|
-
return window.localStorage.setItem(U, JSON.stringify(n)),
|
|
1647
|
+
return window.localStorage.setItem(U, JSON.stringify(n)), Gt(window.localStorage.getItem(U))?.owner === Ht;
|
|
1522
1648
|
}
|
|
1523
|
-
function
|
|
1524
|
-
|
|
1649
|
+
function Xt() {
|
|
1650
|
+
Gt(window.localStorage.getItem(U))?.owner === Ht && window.localStorage.removeItem(U);
|
|
1525
1651
|
}
|
|
1526
|
-
function
|
|
1652
|
+
function Zt(e) {
|
|
1527
1653
|
let t = {
|
|
1528
|
-
owner:
|
|
1654
|
+
owner: Ht,
|
|
1529
1655
|
updated_at: Date.now(),
|
|
1530
1656
|
...e
|
|
1531
1657
|
};
|
|
1532
|
-
window.localStorage.setItem(
|
|
1658
|
+
window.localStorage.setItem(Rt, JSON.stringify(t));
|
|
1533
1659
|
}
|
|
1534
|
-
async function
|
|
1660
|
+
async function Qt(e) {
|
|
1535
1661
|
return new Promise((t, n) => {
|
|
1536
1662
|
let r = !1, i = null, a = (e) => {
|
|
1537
1663
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
|
|
1538
1664
|
}, o = (e) => {
|
|
1539
1665
|
r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new W(e)));
|
|
1540
1666
|
}, s = () => {
|
|
1541
|
-
let t =
|
|
1667
|
+
let t = Kt(window.localStorage.getItem(Rt));
|
|
1542
1668
|
if (t && t.updated_at >= e) {
|
|
1543
1669
|
t.ok ? a("complete") : o(t.status ?? 401);
|
|
1544
1670
|
return;
|
|
1545
1671
|
}
|
|
1546
|
-
let n =
|
|
1672
|
+
let n = Gt(window.localStorage.getItem(U));
|
|
1547
1673
|
if (!n) {
|
|
1548
1674
|
a("complete");
|
|
1549
1675
|
return;
|
|
@@ -1552,50 +1678,50 @@ async function Bt(e) {
|
|
|
1552
1678
|
a("expired");
|
|
1553
1679
|
return;
|
|
1554
1680
|
}
|
|
1555
|
-
i = setTimeout(s,
|
|
1681
|
+
i = setTimeout(s, Vt);
|
|
1556
1682
|
}, c = (e) => {
|
|
1557
|
-
(e.key === U || e.key ===
|
|
1683
|
+
(e.key === U || e.key === Rt) && (i && clearTimeout(i), s());
|
|
1558
1684
|
};
|
|
1559
1685
|
window.addEventListener("storage", c), s();
|
|
1560
1686
|
});
|
|
1561
1687
|
}
|
|
1562
|
-
async function
|
|
1563
|
-
let t =
|
|
1564
|
-
return t ? (await t.request(
|
|
1565
|
-
let t =
|
|
1688
|
+
async function $t(e) {
|
|
1689
|
+
let t = Wt();
|
|
1690
|
+
return t ? (await t.request(zt, { mode: "exclusive" }, async () => {
|
|
1691
|
+
let t = qt(e);
|
|
1566
1692
|
if (t) {
|
|
1567
|
-
|
|
1693
|
+
Jt(t);
|
|
1568
1694
|
return;
|
|
1569
1695
|
}
|
|
1570
1696
|
try {
|
|
1571
|
-
await
|
|
1697
|
+
await un(), Ut() && Zt({ ok: !0 });
|
|
1572
1698
|
} catch (e) {
|
|
1573
|
-
throw e instanceof W &&
|
|
1699
|
+
throw e instanceof W && Ut() && Zt({
|
|
1574
1700
|
ok: !1,
|
|
1575
1701
|
status: e.status
|
|
1576
1702
|
}), e;
|
|
1577
1703
|
}
|
|
1578
1704
|
}), !0) : !1;
|
|
1579
1705
|
}
|
|
1580
|
-
async function
|
|
1706
|
+
async function en() {
|
|
1581
1707
|
let e = Date.now();
|
|
1582
|
-
if (!await
|
|
1583
|
-
if (!
|
|
1584
|
-
await
|
|
1708
|
+
if (!await $t(e)) {
|
|
1709
|
+
if (!Ut()) {
|
|
1710
|
+
await un();
|
|
1585
1711
|
return;
|
|
1586
1712
|
}
|
|
1587
|
-
if (
|
|
1588
|
-
await
|
|
1713
|
+
if (Yt(e)) try {
|
|
1714
|
+
await un(), Zt({ ok: !0 });
|
|
1589
1715
|
return;
|
|
1590
1716
|
} catch (e) {
|
|
1591
|
-
throw e instanceof W &&
|
|
1717
|
+
throw e instanceof W && Zt({
|
|
1592
1718
|
ok: !1,
|
|
1593
1719
|
status: e.status
|
|
1594
1720
|
}), e;
|
|
1595
1721
|
} finally {
|
|
1596
|
-
|
|
1722
|
+
Xt();
|
|
1597
1723
|
}
|
|
1598
|
-
await
|
|
1724
|
+
await Qt(e) === "expired" && await en();
|
|
1599
1725
|
}
|
|
1600
1726
|
}
|
|
1601
1727
|
var W = class extends Error {
|
|
@@ -1603,83 +1729,83 @@ var W = class extends Error {
|
|
|
1603
1729
|
constructor(e) {
|
|
1604
1730
|
super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
|
|
1605
1731
|
}
|
|
1606
|
-
},
|
|
1607
|
-
function
|
|
1608
|
-
|
|
1732
|
+
}, tn = null, nn = null, rn = 3e4, an = 5e3;
|
|
1733
|
+
function on() {
|
|
1734
|
+
dn().catch((e) => {
|
|
1609
1735
|
e instanceof W && G();
|
|
1610
1736
|
});
|
|
1611
1737
|
}
|
|
1612
|
-
function
|
|
1613
|
-
if (
|
|
1738
|
+
function sn(e) {
|
|
1739
|
+
if (tn &&= (clearTimeout(tn), null), nn = null, !e || typeof window > "u") return;
|
|
1614
1740
|
let t = Date.parse(e);
|
|
1615
1741
|
if (Number.isNaN(t)) return;
|
|
1616
|
-
|
|
1617
|
-
let n = Math.max(t - Date.now() -
|
|
1618
|
-
|
|
1619
|
-
|
|
1742
|
+
nn = t;
|
|
1743
|
+
let n = Math.max(t - Date.now() - rn, an);
|
|
1744
|
+
tn = setTimeout(() => {
|
|
1745
|
+
tn = null, on();
|
|
1620
1746
|
}, n);
|
|
1621
1747
|
}
|
|
1622
|
-
function
|
|
1623
|
-
|
|
1748
|
+
function cn() {
|
|
1749
|
+
tn &&= (clearTimeout(tn), null), nn = null;
|
|
1624
1750
|
}
|
|
1625
1751
|
typeof document < "u" && document.addEventListener("visibilitychange", () => {
|
|
1626
|
-
document.visibilityState === "visible" &&
|
|
1752
|
+
document.visibilityState === "visible" && nn !== null && Date.now() >= nn - rn && on();
|
|
1627
1753
|
});
|
|
1628
|
-
async function
|
|
1754
|
+
async function ln(e) {
|
|
1629
1755
|
try {
|
|
1630
1756
|
let t = await e.json();
|
|
1631
|
-
|
|
1757
|
+
sn(t?.result?.expires_at ?? t?.expires_at);
|
|
1632
1758
|
} catch {}
|
|
1633
1759
|
}
|
|
1634
|
-
async function
|
|
1760
|
+
async function un() {
|
|
1635
1761
|
let e = {
|
|
1636
1762
|
method: "POST",
|
|
1637
1763
|
credentials: "include",
|
|
1638
1764
|
headers: { "Content-Type": "application/json" },
|
|
1639
|
-
body:
|
|
1765
|
+
body: It({})
|
|
1640
1766
|
}, t = await fetch("/api/actions/auth.refresh", e);
|
|
1641
1767
|
if (t.status === 429) {
|
|
1642
1768
|
let n = parseInt(t.headers.get("Retry-After") || "1", 10);
|
|
1643
1769
|
await new Promise((e) => setTimeout(e, n * 1e3));
|
|
1644
1770
|
let r = await fetch("/api/actions/auth.refresh", e);
|
|
1645
1771
|
if (!r.ok) throw new W(r.status);
|
|
1646
|
-
await
|
|
1772
|
+
await ln(r);
|
|
1647
1773
|
return;
|
|
1648
1774
|
}
|
|
1649
1775
|
if (!t.ok) throw new W(t.status);
|
|
1650
|
-
await
|
|
1776
|
+
await ln(t);
|
|
1651
1777
|
}
|
|
1652
|
-
async function
|
|
1653
|
-
return
|
|
1654
|
-
|
|
1655
|
-
}),
|
|
1778
|
+
async function dn() {
|
|
1779
|
+
return Lt || (Lt = en().finally(() => {
|
|
1780
|
+
Lt = null;
|
|
1781
|
+
}), Lt);
|
|
1656
1782
|
}
|
|
1657
1783
|
var G = () => {
|
|
1658
1784
|
if (typeof window > "u") return;
|
|
1659
1785
|
let { pathname: e } = window.location;
|
|
1660
|
-
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || (window.location.href =
|
|
1786
|
+
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = pt());
|
|
1661
1787
|
};
|
|
1662
|
-
function
|
|
1788
|
+
function fn(e) {
|
|
1663
1789
|
let t = G;
|
|
1664
1790
|
return G = e, t;
|
|
1665
1791
|
}
|
|
1666
|
-
function
|
|
1792
|
+
function pn() {
|
|
1667
1793
|
return G;
|
|
1668
1794
|
}
|
|
1669
|
-
var
|
|
1795
|
+
var mn = ({ status: e, code: t, message: n }) => {
|
|
1670
1796
|
console.error(`[API ${e}] ${t}: ${n}`);
|
|
1671
1797
|
};
|
|
1672
|
-
function
|
|
1798
|
+
function hn(e, t, n, r) {
|
|
1673
1799
|
let i = new Headers(e);
|
|
1674
1800
|
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;
|
|
1675
1801
|
}
|
|
1676
|
-
async function
|
|
1677
|
-
let i =
|
|
1802
|
+
async function gn(e, t, n, r) {
|
|
1803
|
+
let i = bt(), a = i ? "omit" : "include", o = hn(t.headers, !!t.body, n, i ? xt() : null), s = await fetch(e, {
|
|
1678
1804
|
...t,
|
|
1679
1805
|
headers: o,
|
|
1680
1806
|
credentials: a
|
|
1681
1807
|
});
|
|
1682
|
-
if (
|
|
1808
|
+
if (jt(s.headers), !s.ok) {
|
|
1683
1809
|
let o = "Request failed", c = "UNKNOWN", l, u;
|
|
1684
1810
|
try {
|
|
1685
1811
|
u = await s.json();
|
|
@@ -1688,8 +1814,8 @@ async function rn(e, t, n, r) {
|
|
|
1688
1814
|
} catch {}
|
|
1689
1815
|
if (s.status === 401 && (c === "TOKEN_REFRESH_NEEDED" || c === "UNAUTHORIZED")) try {
|
|
1690
1816
|
let o = null;
|
|
1691
|
-
i ? (
|
|
1692
|
-
let s =
|
|
1817
|
+
i ? (Tt(), o = await Et()) : await dn();
|
|
1818
|
+
let s = hn(t.headers, !!t.body, n, o), c = await fetch(e, {
|
|
1693
1819
|
...t,
|
|
1694
1820
|
headers: s,
|
|
1695
1821
|
credentials: a
|
|
@@ -1706,7 +1832,7 @@ async function rn(e, t, n, r) {
|
|
|
1706
1832
|
} catch (e) {
|
|
1707
1833
|
throw e instanceof z ? e : (G(), new z(401, o, c, l));
|
|
1708
1834
|
}
|
|
1709
|
-
throw s.status === 401 && G(),
|
|
1835
|
+
throw s.status === 401 && G(), mn({
|
|
1710
1836
|
status: s.status,
|
|
1711
1837
|
code: c,
|
|
1712
1838
|
message: o
|
|
@@ -1714,23 +1840,23 @@ async function rn(e, t, n, r) {
|
|
|
1714
1840
|
}
|
|
1715
1841
|
return r(s);
|
|
1716
1842
|
}
|
|
1717
|
-
function
|
|
1843
|
+
function _n(e) {
|
|
1718
1844
|
return e.status === 204 ? Promise.resolve(void 0) : e.json();
|
|
1719
1845
|
}
|
|
1720
1846
|
async function K(e, t = {}) {
|
|
1721
|
-
return
|
|
1847
|
+
return gn(e, t, { setAccept: !1 }, _n);
|
|
1722
1848
|
}
|
|
1723
|
-
async function
|
|
1849
|
+
async function vn(e) {
|
|
1724
1850
|
return {
|
|
1725
1851
|
blob: await e.blob(),
|
|
1726
|
-
filename:
|
|
1852
|
+
filename: bn(e.headers),
|
|
1727
1853
|
headers: e.headers
|
|
1728
1854
|
};
|
|
1729
1855
|
}
|
|
1730
|
-
async function
|
|
1731
|
-
return
|
|
1856
|
+
async function yn(e, t = {}) {
|
|
1857
|
+
return gn(e, t, { setAccept: !0 }, vn);
|
|
1732
1858
|
}
|
|
1733
|
-
function
|
|
1859
|
+
function bn(e) {
|
|
1734
1860
|
let t = e.get("Content-Disposition");
|
|
1735
1861
|
if (!t) return "";
|
|
1736
1862
|
let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
|
|
@@ -1743,48 +1869,48 @@ function cn(e) {
|
|
|
1743
1869
|
async function q(e, t = {}) {
|
|
1744
1870
|
return (await K(`/api/actions/${encodeURIComponent(e)}`, {
|
|
1745
1871
|
method: "POST",
|
|
1746
|
-
body:
|
|
1872
|
+
body: It(t)
|
|
1747
1873
|
})).result;
|
|
1748
1874
|
}
|
|
1749
1875
|
//#endregion
|
|
1750
1876
|
//#region src/api/schema.ts
|
|
1751
|
-
function
|
|
1877
|
+
function xn(e) {
|
|
1752
1878
|
return {
|
|
1753
1879
|
...e,
|
|
1754
|
-
params: e.params ?
|
|
1880
|
+
params: e.params ? Ie.fromObject(e.params) : void 0
|
|
1755
1881
|
};
|
|
1756
1882
|
}
|
|
1757
|
-
function
|
|
1883
|
+
function Sn(e) {
|
|
1758
1884
|
return {
|
|
1759
1885
|
...e,
|
|
1760
|
-
resolved_params: e.resolved_params ?
|
|
1886
|
+
resolved_params: e.resolved_params ? Ie.fromObject(e.resolved_params) : void 0
|
|
1761
1887
|
};
|
|
1762
1888
|
}
|
|
1763
|
-
function
|
|
1889
|
+
function Cn(e) {
|
|
1764
1890
|
let t = {};
|
|
1765
|
-
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] =
|
|
1891
|
+
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = xn(r);
|
|
1766
1892
|
let n = {};
|
|
1767
|
-
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] =
|
|
1893
|
+
if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = Sn(r);
|
|
1768
1894
|
return {
|
|
1769
1895
|
...e,
|
|
1770
|
-
fields:
|
|
1771
|
-
files: e.files ?
|
|
1896
|
+
fields: Ie.fromObject(e.fields),
|
|
1897
|
+
files: e.files ? Ie.fromObject(e.files) : void 0,
|
|
1772
1898
|
handlers: e.handlers ? t : void 0,
|
|
1773
1899
|
actions: e.actions ? n : void 0
|
|
1774
1900
|
};
|
|
1775
1901
|
}
|
|
1776
|
-
function
|
|
1902
|
+
function wn(e) {
|
|
1777
1903
|
let t = {};
|
|
1778
|
-
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] =
|
|
1904
|
+
if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = Cn(r);
|
|
1779
1905
|
let n = {};
|
|
1780
1906
|
if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
|
|
1781
1907
|
...r,
|
|
1782
|
-
fields:
|
|
1908
|
+
fields: Ie.fromObject(r.fields)
|
|
1783
1909
|
};
|
|
1784
1910
|
let r = {};
|
|
1785
|
-
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] =
|
|
1911
|
+
if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = xn(n);
|
|
1786
1912
|
let i = {};
|
|
1787
|
-
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] =
|
|
1913
|
+
if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = Sn(n);
|
|
1788
1914
|
return {
|
|
1789
1915
|
...e,
|
|
1790
1916
|
entities: t,
|
|
@@ -1793,66 +1919,66 @@ function fn(e) {
|
|
|
1793
1919
|
actions: i
|
|
1794
1920
|
};
|
|
1795
1921
|
}
|
|
1796
|
-
async function
|
|
1797
|
-
return
|
|
1922
|
+
async function Tn() {
|
|
1923
|
+
return wn(await K("/api/schema"));
|
|
1798
1924
|
}
|
|
1799
1925
|
//#endregion
|
|
1800
1926
|
//#region src/api/auth.ts
|
|
1801
|
-
async function
|
|
1927
|
+
async function En() {
|
|
1802
1928
|
return q("auth.check_setup");
|
|
1803
1929
|
}
|
|
1804
|
-
async function
|
|
1930
|
+
async function Dn(e, t, n = !0) {
|
|
1805
1931
|
let r = await q("auth.login", {
|
|
1806
1932
|
email: e,
|
|
1807
1933
|
password: t,
|
|
1808
1934
|
remember: n
|
|
1809
1935
|
});
|
|
1810
|
-
return
|
|
1936
|
+
return sn(r.expires_at), r;
|
|
1811
1937
|
}
|
|
1812
|
-
async function
|
|
1938
|
+
async function On(e, t, n) {
|
|
1813
1939
|
let r = await q("auth.signup", {
|
|
1814
1940
|
email: e,
|
|
1815
1941
|
password: t,
|
|
1816
1942
|
display_name: n
|
|
1817
1943
|
});
|
|
1818
|
-
return
|
|
1944
|
+
return sn(r.expires_at), r;
|
|
1819
1945
|
}
|
|
1820
|
-
async function
|
|
1946
|
+
async function kn() {
|
|
1821
1947
|
return q("auth.me");
|
|
1822
1948
|
}
|
|
1823
|
-
async function
|
|
1949
|
+
async function An() {
|
|
1824
1950
|
return (await q("auth.list_tenants")).tenants;
|
|
1825
1951
|
}
|
|
1826
|
-
async function
|
|
1952
|
+
async function jn(e) {
|
|
1827
1953
|
let t = await q("auth.switch_tenant", { tenant_id: e });
|
|
1828
|
-
return
|
|
1954
|
+
return sn(t.expires_at), t;
|
|
1829
1955
|
}
|
|
1830
|
-
async function
|
|
1956
|
+
async function Mn() {
|
|
1831
1957
|
await q("auth.logout");
|
|
1832
1958
|
}
|
|
1833
|
-
async function
|
|
1959
|
+
async function Nn(e) {
|
|
1834
1960
|
return (await q("sso_provider.list", e ? { tenant_code: e } : {})).providers;
|
|
1835
1961
|
}
|
|
1836
|
-
function
|
|
1962
|
+
function Pn(e, t, n) {
|
|
1837
1963
|
let r = new URLSearchParams();
|
|
1838
1964
|
t && r.set("tenant", t), n && r.set("redirect", n);
|
|
1839
1965
|
let i = r.toString();
|
|
1840
1966
|
return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
1841
1967
|
}
|
|
1842
|
-
async function
|
|
1968
|
+
async function Fn(e, t, n) {
|
|
1843
1969
|
let r = {
|
|
1844
1970
|
target_user_id: e,
|
|
1845
1971
|
reason: t
|
|
1846
1972
|
};
|
|
1847
1973
|
return n != null && (r.duration_minutes = n), q("impersonation.start", r);
|
|
1848
1974
|
}
|
|
1849
|
-
async function
|
|
1975
|
+
async function In() {
|
|
1850
1976
|
return q("impersonation.stop");
|
|
1851
1977
|
}
|
|
1852
|
-
async function
|
|
1978
|
+
async function Ln(e) {
|
|
1853
1979
|
await q("impersonation.revoke", { session_id: e });
|
|
1854
1980
|
}
|
|
1855
|
-
async function
|
|
1981
|
+
async function Rn(e, t) {
|
|
1856
1982
|
await q("auth.change_password", {
|
|
1857
1983
|
current_password: e,
|
|
1858
1984
|
new_password: t
|
|
@@ -1860,7 +1986,7 @@ async function En(e, t) {
|
|
|
1860
1986
|
}
|
|
1861
1987
|
//#endregion
|
|
1862
1988
|
//#region src/stores/auth.ts
|
|
1863
|
-
var
|
|
1989
|
+
var zn = x((e) => ({
|
|
1864
1990
|
user: null,
|
|
1865
1991
|
isAuthenticated: !1,
|
|
1866
1992
|
isLoading: !0,
|
|
@@ -1868,9 +1994,9 @@ var Dn = x((e) => ({
|
|
|
1868
1994
|
tenants: [],
|
|
1869
1995
|
initialize: async () => {
|
|
1870
1996
|
try {
|
|
1871
|
-
let t = await
|
|
1997
|
+
let t = await kn(), n = t.tenant ?? null, r = [];
|
|
1872
1998
|
try {
|
|
1873
|
-
r = await
|
|
1999
|
+
r = await An();
|
|
1874
2000
|
} catch {}
|
|
1875
2001
|
e({
|
|
1876
2002
|
user: t,
|
|
@@ -1889,7 +2015,7 @@ var Dn = x((e) => ({
|
|
|
1889
2015
|
},
|
|
1890
2016
|
refreshMe: async () => {
|
|
1891
2017
|
try {
|
|
1892
|
-
let t = await
|
|
2018
|
+
let t = await kn();
|
|
1893
2019
|
e({
|
|
1894
2020
|
user: t,
|
|
1895
2021
|
activeTenant: t.tenant ?? null
|
|
@@ -1911,9 +2037,9 @@ var Dn = x((e) => ({
|
|
|
1911
2037
|
e({ activeTenant: t });
|
|
1912
2038
|
},
|
|
1913
2039
|
logout: async () => {
|
|
1914
|
-
|
|
2040
|
+
cn();
|
|
1915
2041
|
try {
|
|
1916
|
-
await
|
|
2042
|
+
await Mn();
|
|
1917
2043
|
} catch {}
|
|
1918
2044
|
e({
|
|
1919
2045
|
user: null,
|
|
@@ -1926,17 +2052,17 @@ var Dn = x((e) => ({
|
|
|
1926
2052
|
//#endregion
|
|
1927
2053
|
//#region src/hooks/useSchema.ts
|
|
1928
2054
|
function J() {
|
|
1929
|
-
let e =
|
|
2055
|
+
let e = zn((e) => e.isAuthenticated);
|
|
1930
2056
|
return h({
|
|
1931
2057
|
queryKey: ["schema", e],
|
|
1932
|
-
queryFn:
|
|
2058
|
+
queryFn: Tn,
|
|
1933
2059
|
staleTime: Infinity,
|
|
1934
2060
|
enabled: e
|
|
1935
2061
|
});
|
|
1936
2062
|
}
|
|
1937
2063
|
//#endregion
|
|
1938
2064
|
//#region src/stores/appearance.ts
|
|
1939
|
-
var
|
|
2065
|
+
var Bn = {
|
|
1940
2066
|
theme: "light",
|
|
1941
2067
|
accent: "violet",
|
|
1942
2068
|
density: "compact",
|
|
@@ -1949,26 +2075,26 @@ var On = {
|
|
|
1949
2075
|
aiSurface: "both",
|
|
1950
2076
|
faviconSource: "google",
|
|
1951
2077
|
toastPosition: "bottom-right"
|
|
1952
|
-
},
|
|
2078
|
+
}, Vn = ["light", "dark"], Hn = [
|
|
1953
2079
|
"violet",
|
|
1954
2080
|
"blue",
|
|
1955
2081
|
"teal",
|
|
1956
2082
|
"amber",
|
|
1957
2083
|
"rose"
|
|
1958
|
-
],
|
|
2084
|
+
], Un = [
|
|
1959
2085
|
"compact",
|
|
1960
2086
|
"comfortable",
|
|
1961
2087
|
"cozy"
|
|
1962
|
-
],
|
|
2088
|
+
], Wn = ["wide", "collapsed"], Gn = ["top", "bottom"], Kn = [
|
|
1963
2089
|
"command",
|
|
1964
2090
|
"panel",
|
|
1965
2091
|
"both",
|
|
1966
2092
|
"off"
|
|
1967
|
-
],
|
|
2093
|
+
], qn = [
|
|
1968
2094
|
"google",
|
|
1969
2095
|
"direct",
|
|
1970
2096
|
"none"
|
|
1971
|
-
],
|
|
2097
|
+
], Jn = [
|
|
1972
2098
|
"top-left",
|
|
1973
2099
|
"top-center",
|
|
1974
2100
|
"top-right",
|
|
@@ -1979,45 +2105,45 @@ var On = {
|
|
|
1979
2105
|
function Y(e, t) {
|
|
1980
2106
|
return typeof t == "string" && e.includes(t) ? t : void 0;
|
|
1981
2107
|
}
|
|
1982
|
-
function
|
|
1983
|
-
let t = {}, n = Y(
|
|
2108
|
+
function Yn(e) {
|
|
2109
|
+
let t = {}, n = Y(Vn, e.theme);
|
|
1984
2110
|
n && (t.theme = n);
|
|
1985
|
-
let r = Y(
|
|
2111
|
+
let r = Y(Hn, e.accent);
|
|
1986
2112
|
r && (t.accent = r);
|
|
1987
|
-
let i = Y(
|
|
2113
|
+
let i = Y(Un, e.density);
|
|
1988
2114
|
i && (t.density = i);
|
|
1989
|
-
let a = Y(
|
|
2115
|
+
let a = Y(Wn, e.sidebar);
|
|
1990
2116
|
a && (t.sidebar = a);
|
|
1991
|
-
let o = Y(
|
|
2117
|
+
let o = Y(Gn, e.tabsPosition);
|
|
1992
2118
|
o && (t.tabsPosition = o);
|
|
1993
|
-
let s = Y(
|
|
2119
|
+
let s = Y(Kn, e.aiSurface);
|
|
1994
2120
|
s && (t.aiSurface = s);
|
|
1995
|
-
let c = Y(
|
|
2121
|
+
let c = Y(qn, e.faviconSource);
|
|
1996
2122
|
c && (t.faviconSource = c);
|
|
1997
|
-
let l = Y(
|
|
2123
|
+
let l = Y(Jn, e.toastPosition);
|
|
1998
2124
|
return l && (t.toastPosition = l), typeof e.tabsMaxOpen == "number" && e.tabsMaxOpen > 0 && (t.tabsMaxOpen = e.tabsMaxOpen), typeof e.radius == "number" && e.radius >= 0 && e.radius <= 32 && (t.radius = e.radius), typeof e.zebra == "boolean" && (t.zebra = e.zebra), typeof e.tabsPersist == "boolean" && (t.tabsPersist = e.tabsPersist), t;
|
|
1999
2125
|
}
|
|
2000
|
-
var
|
|
2001
|
-
function
|
|
2126
|
+
var Xn = "declarion-appearance";
|
|
2127
|
+
function Zn() {
|
|
2002
2128
|
if (typeof window > "u") return null;
|
|
2003
2129
|
try {
|
|
2004
|
-
let e = localStorage.getItem(
|
|
2130
|
+
let e = localStorage.getItem(Xn);
|
|
2005
2131
|
return e ? JSON.parse(e) : null;
|
|
2006
2132
|
} catch {
|
|
2007
2133
|
return null;
|
|
2008
2134
|
}
|
|
2009
2135
|
}
|
|
2010
|
-
function
|
|
2136
|
+
function Qn(e) {
|
|
2011
2137
|
if (!(typeof window > "u")) try {
|
|
2012
|
-
localStorage.setItem(
|
|
2138
|
+
localStorage.setItem(Xn, JSON.stringify(e));
|
|
2013
2139
|
} catch {}
|
|
2014
2140
|
}
|
|
2015
|
-
function
|
|
2141
|
+
function $n(e) {
|
|
2016
2142
|
if (typeof document > "u") return;
|
|
2017
2143
|
let t = document.documentElement;
|
|
2018
2144
|
t.dataset.theme = e.theme, t.dataset.accent = e.accent, t.dataset.density = e.density, t.dataset.sidebar = e.sidebar, t.dataset.tabbar = e.tabsPosition, t.dataset.zebra = e.zebra ? "on" : "off", t.dataset.ai = e.aiSurface, t.style.setProperty("--radius-md", `${e.radius}px`), t.style.setProperty("--radius-lg", `${e.radius + 3}px`);
|
|
2019
2145
|
}
|
|
2020
|
-
var
|
|
2146
|
+
var er = {
|
|
2021
2147
|
ui_theme: "theme",
|
|
2022
2148
|
ui_accent: "accent",
|
|
2023
2149
|
ui_density: "density",
|
|
@@ -2030,49 +2156,49 @@ var Hn = {
|
|
|
2030
2156
|
ui_ai_surface: "aiSurface",
|
|
2031
2157
|
ui_favicon_source: "faviconSource",
|
|
2032
2158
|
ui_toast_position: "toastPosition"
|
|
2033
|
-
},
|
|
2034
|
-
...
|
|
2035
|
-
...
|
|
2159
|
+
}, tr = Zn(), nr = tr ? new Set(Object.keys(tr)) : /* @__PURE__ */ new Set(), rr = {
|
|
2160
|
+
...Bn,
|
|
2161
|
+
...tr ? Yn(tr) : {}
|
|
2036
2162
|
};
|
|
2037
|
-
typeof window < "u" &&
|
|
2038
|
-
var
|
|
2039
|
-
...
|
|
2163
|
+
typeof window < "u" && $n(rr);
|
|
2164
|
+
var ir = x((e, t) => ({
|
|
2165
|
+
...rr,
|
|
2040
2166
|
set: (n, r) => {
|
|
2041
|
-
let i =
|
|
2167
|
+
let i = Yn({ [n]: r });
|
|
2042
2168
|
if (i[n] === void 0) return;
|
|
2043
2169
|
let a = {
|
|
2044
2170
|
...t(),
|
|
2045
2171
|
...i
|
|
2046
2172
|
};
|
|
2047
|
-
|
|
2173
|
+
$n(a), Qn(a), nr.add(n), e(i);
|
|
2048
2174
|
},
|
|
2049
2175
|
setMany: (n) => {
|
|
2050
|
-
let r =
|
|
2176
|
+
let r = Yn(n);
|
|
2051
2177
|
if (!Object.keys(r).length) return;
|
|
2052
2178
|
let i = {
|
|
2053
2179
|
...t(),
|
|
2054
2180
|
...r
|
|
2055
2181
|
};
|
|
2056
|
-
|
|
2057
|
-
for (let e of Object.keys(r))
|
|
2182
|
+
$n(i), Qn(i);
|
|
2183
|
+
for (let e of Object.keys(r)) nr.add(e);
|
|
2058
2184
|
e(r);
|
|
2059
2185
|
},
|
|
2060
2186
|
hydrateFromParams: (t) => {
|
|
2061
2187
|
let n = {};
|
|
2062
|
-
for (let [e, r] of Object.entries(
|
|
2063
|
-
let r =
|
|
2064
|
-
Object.keys(r).length && (
|
|
2065
|
-
...
|
|
2188
|
+
for (let [e, r] of Object.entries(er)) nr.has(r) || t[e] !== void 0 && (n[r] = t[e]);
|
|
2189
|
+
let r = Yn(n);
|
|
2190
|
+
Object.keys(r).length && ($n({
|
|
2191
|
+
...ir.getState(),
|
|
2066
2192
|
...r
|
|
2067
2193
|
}), e(r));
|
|
2068
2194
|
}
|
|
2069
|
-
})),
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2195
|
+
})), ar = "self", or = "embed", sr = "parent_origin", cr = "theme", lr = [
|
|
2196
|
+
or,
|
|
2197
|
+
sr,
|
|
2198
|
+
cr,
|
|
2073
2199
|
"nav"
|
|
2074
2200
|
];
|
|
2075
|
-
function
|
|
2201
|
+
function ur(e) {
|
|
2076
2202
|
if (!e) return null;
|
|
2077
2203
|
let t;
|
|
2078
2204
|
try {
|
|
@@ -2082,22 +2208,22 @@ function Qn(e) {
|
|
|
2082
2208
|
}
|
|
2083
2209
|
return t.origin === "null" ? null : e === t.origin ? t.origin : null;
|
|
2084
2210
|
}
|
|
2085
|
-
function
|
|
2211
|
+
function dr(e) {
|
|
2086
2212
|
return e === "light" || e === "dark" ? e : null;
|
|
2087
2213
|
}
|
|
2088
|
-
function
|
|
2089
|
-
return e === "delegated" ? "delegated" :
|
|
2214
|
+
function fr(e) {
|
|
2215
|
+
return e === "delegated" ? "delegated" : ar;
|
|
2090
2216
|
}
|
|
2091
|
-
function
|
|
2217
|
+
function pr(e) {
|
|
2092
2218
|
let t = typeof e == "string" ? new URLSearchParams(e) : e;
|
|
2093
2219
|
return {
|
|
2094
|
-
enabled: t.get(
|
|
2095
|
-
parentOrigin:
|
|
2096
|
-
theme:
|
|
2097
|
-
navigationMode:
|
|
2220
|
+
enabled: t.get(or) === "1",
|
|
2221
|
+
parentOrigin: ur(t.get(sr)),
|
|
2222
|
+
theme: dr(t.get(cr)),
|
|
2223
|
+
navigationMode: fr(t.get("nav"))
|
|
2098
2224
|
};
|
|
2099
2225
|
}
|
|
2100
|
-
function
|
|
2226
|
+
function mr(e, t) {
|
|
2101
2227
|
if (!t.enabled) return e;
|
|
2102
2228
|
let n = /^[a-z][a-z0-9+.-]*:/i.test(e), r;
|
|
2103
2229
|
try {
|
|
@@ -2106,44 +2232,44 @@ function nr(e, t) {
|
|
|
2106
2232
|
return e;
|
|
2107
2233
|
}
|
|
2108
2234
|
let i = r.searchParams;
|
|
2109
|
-
return t.enabled && i.set(
|
|
2235
|
+
return t.enabled && i.set(or, "1"), t.parentOrigin && i.set(sr, t.parentOrigin), t.theme && i.set(cr, t.theme), i.set("nav", t.navigationMode), n ? r.toString() : `${r.pathname}${r.search}${r.hash}`;
|
|
2110
2236
|
}
|
|
2111
2237
|
//#endregion
|
|
2112
2238
|
//#region src/embed/EmbedContext.tsx
|
|
2113
|
-
var
|
|
2239
|
+
var hr = r({
|
|
2114
2240
|
enabled: !1,
|
|
2115
2241
|
parentOrigin: null,
|
|
2116
2242
|
theme: null,
|
|
2117
2243
|
navigationMode: "self",
|
|
2118
2244
|
appendEmbedParams: (e) => e
|
|
2119
2245
|
});
|
|
2120
|
-
function
|
|
2246
|
+
function gr(e) {
|
|
2121
2247
|
return {
|
|
2122
2248
|
enabled: e.enabled,
|
|
2123
2249
|
parentOrigin: e.parentOrigin,
|
|
2124
2250
|
theme: e.theme,
|
|
2125
2251
|
navigationMode: e.navigationMode,
|
|
2126
|
-
appendEmbedParams: (t) =>
|
|
2252
|
+
appendEmbedParams: (t) => mr(t, e)
|
|
2127
2253
|
};
|
|
2128
2254
|
}
|
|
2129
|
-
function
|
|
2130
|
-
let n = u(() =>
|
|
2131
|
-
return /* @__PURE__ */ v(
|
|
2255
|
+
function _r({ children: e, query: t }) {
|
|
2256
|
+
let n = u(() => gr(pr(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
|
|
2257
|
+
return /* @__PURE__ */ v(hr.Provider, {
|
|
2132
2258
|
value: n,
|
|
2133
2259
|
children: e
|
|
2134
2260
|
});
|
|
2135
2261
|
}
|
|
2136
|
-
function
|
|
2137
|
-
return s(
|
|
2262
|
+
function vr() {
|
|
2263
|
+
return s(hr);
|
|
2138
2264
|
}
|
|
2139
2265
|
//#endregion
|
|
2140
2266
|
//#region src/embed/embed-dirty.ts
|
|
2141
|
-
var
|
|
2267
|
+
var yr = x((e) => ({
|
|
2142
2268
|
isDirty: !1,
|
|
2143
2269
|
setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
|
|
2144
2270
|
}));
|
|
2145
|
-
function
|
|
2146
|
-
let n =
|
|
2271
|
+
function br(e, t) {
|
|
2272
|
+
let n = yr((e) => e.setDirty);
|
|
2147
2273
|
c(() => {
|
|
2148
2274
|
t && n(e);
|
|
2149
2275
|
}, [
|
|
@@ -2156,7 +2282,7 @@ function cr(e, t) {
|
|
|
2156
2282
|
}
|
|
2157
2283
|
//#endregion
|
|
2158
2284
|
//#region src/embed/embed-nav-guard.ts
|
|
2159
|
-
var
|
|
2285
|
+
var xr = x((e, t) => ({
|
|
2160
2286
|
pendingNavigation: null,
|
|
2161
2287
|
requestNavigation: (t) => e({ pendingNavigation: t }),
|
|
2162
2288
|
confirmNavigation: () => {
|
|
@@ -2167,18 +2293,18 @@ var lr = x((e, t) => ({
|
|
|
2167
2293
|
}));
|
|
2168
2294
|
//#endregion
|
|
2169
2295
|
//#region src/embed/screen-location.ts
|
|
2170
|
-
function
|
|
2296
|
+
function Sr(e) {
|
|
2171
2297
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2172
2298
|
return RegExp("^" + t.join("/") + "$");
|
|
2173
2299
|
}
|
|
2174
|
-
function
|
|
2300
|
+
function Cr(e, t) {
|
|
2175
2301
|
let n = e.replace(/\/+$/, "") || "/";
|
|
2176
2302
|
if (!t) return {
|
|
2177
2303
|
matched: !1,
|
|
2178
2304
|
payload: { route: e }
|
|
2179
2305
|
};
|
|
2180
2306
|
let r, i, a, o;
|
|
2181
|
-
for (let [e, s] of Object.entries(t)) if (s.route &&
|
|
2307
|
+
for (let [e, s] of Object.entries(t)) if (s.route && Sr(s.route).test(n)) if (s.route.includes("/:")) a || (a = s, o = e);
|
|
2182
2308
|
else {
|
|
2183
2309
|
r = s, i = e;
|
|
2184
2310
|
break;
|
|
@@ -2203,34 +2329,34 @@ function dr(e, t) {
|
|
|
2203
2329
|
payload: l
|
|
2204
2330
|
};
|
|
2205
2331
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return
|
|
2332
|
+
function wr(e, t) {
|
|
2333
|
+
return Cr(e, t).payload;
|
|
2208
2334
|
}
|
|
2209
2335
|
//#endregion
|
|
2210
2336
|
//#region src/embed/useEmbedNavigate.ts
|
|
2211
|
-
function
|
|
2337
|
+
function Tr(e) {
|
|
2212
2338
|
let t = e.search(/[?#]/);
|
|
2213
2339
|
return t === -1 ? e : e.slice(0, t);
|
|
2214
2340
|
}
|
|
2215
|
-
function
|
|
2216
|
-
let e = m(), t = p(), n =
|
|
2341
|
+
function Er() {
|
|
2342
|
+
let e = m(), t = p(), n = vr(), { data: r } = J();
|
|
2217
2343
|
return o((i, a) => {
|
|
2218
2344
|
if (!n.enabled) return e(i, a), !0;
|
|
2219
|
-
let o = r?.screens, s =
|
|
2220
|
-
if (o && !s.matched) return
|
|
2221
|
-
route:
|
|
2345
|
+
let o = r?.screens, s = Cr(Tr(i), o), c = yr.getState().isDirty && Tr(i) !== t.pathname;
|
|
2346
|
+
if (o && !s.matched) return gt(n.parentOrigin, ht.navigationFailed, {
|
|
2347
|
+
route: Tr(i),
|
|
2222
2348
|
reason: "unresolved"
|
|
2223
2349
|
}), !1;
|
|
2224
2350
|
if (n.navigationMode === "delegated") {
|
|
2225
2351
|
let e = () => {
|
|
2226
|
-
|
|
2352
|
+
gt(n.parentOrigin, ht.navigationRequested, s.payload);
|
|
2227
2353
|
};
|
|
2228
|
-
return c ? (
|
|
2354
|
+
return c ? (xr.getState().requestNavigation(e), !1) : (e(), !1);
|
|
2229
2355
|
}
|
|
2230
2356
|
let l = () => {
|
|
2231
2357
|
e(n.appendEmbedParams(i), a);
|
|
2232
2358
|
};
|
|
2233
|
-
return c ? (
|
|
2359
|
+
return c ? (xr.getState().requestNavigation(l), !1) : (l(), !0);
|
|
2234
2360
|
}, [
|
|
2235
2361
|
e,
|
|
2236
2362
|
t.pathname,
|
|
@@ -2238,29 +2364,29 @@ function mr() {
|
|
|
2238
2364
|
r?.screens
|
|
2239
2365
|
]);
|
|
2240
2366
|
}
|
|
2241
|
-
function
|
|
2242
|
-
let e =
|
|
2367
|
+
function Dr() {
|
|
2368
|
+
let e = Er();
|
|
2243
2369
|
return o((t, n) => {
|
|
2244
2370
|
e(t, n);
|
|
2245
2371
|
}, [e]);
|
|
2246
2372
|
}
|
|
2247
|
-
function
|
|
2373
|
+
function Or() {
|
|
2248
2374
|
let e = m();
|
|
2249
2375
|
return o(() => {
|
|
2250
2376
|
let t = () => {
|
|
2251
2377
|
e(-1);
|
|
2252
2378
|
};
|
|
2253
|
-
if (
|
|
2254
|
-
|
|
2379
|
+
if (yr.getState().isDirty) {
|
|
2380
|
+
xr.getState().requestNavigation(t);
|
|
2255
2381
|
return;
|
|
2256
2382
|
}
|
|
2257
2383
|
t();
|
|
2258
2384
|
}, [e]);
|
|
2259
2385
|
}
|
|
2260
|
-
function
|
|
2261
|
-
let e =
|
|
2386
|
+
function kr() {
|
|
2387
|
+
let e = vr();
|
|
2262
2388
|
return o((t, n) => {
|
|
2263
|
-
e.enabled &&
|
|
2389
|
+
e.enabled && gt(e.parentOrigin, ht.navigationFailed, {
|
|
2264
2390
|
route: t,
|
|
2265
2391
|
reason: n
|
|
2266
2392
|
});
|
|
@@ -2268,7 +2394,7 @@ function _r() {
|
|
|
2268
2394
|
}
|
|
2269
2395
|
//#endregion
|
|
2270
2396
|
//#region src/components/shared/toast/DeclarionToast.tsx
|
|
2271
|
-
var
|
|
2397
|
+
var Ar = {
|
|
2272
2398
|
success: {
|
|
2273
2399
|
tone: "success",
|
|
2274
2400
|
defaultTitle: "Success"
|
|
@@ -2289,8 +2415,8 @@ var vr = {
|
|
|
2289
2415
|
tone: "info",
|
|
2290
2416
|
defaultTitle: "Working…"
|
|
2291
2417
|
}
|
|
2292
|
-
},
|
|
2293
|
-
function
|
|
2418
|
+
}, jr = 200;
|
|
2419
|
+
function Mr({ type: t }) {
|
|
2294
2420
|
let n = { display: "flex" };
|
|
2295
2421
|
return t === "loading" ? /* @__PURE__ */ v("span", {
|
|
2296
2422
|
style: {
|
|
@@ -2303,9 +2429,9 @@ function br({ type: t }) {
|
|
|
2303
2429
|
children: /* @__PURE__ */ v(t === "success" ? e.check : t === "error" ? e.x : t === "warning" ? e.warning : e.info, { size: 11 })
|
|
2304
2430
|
});
|
|
2305
2431
|
}
|
|
2306
|
-
function
|
|
2307
|
-
let r =
|
|
2308
|
-
S.current || (S.current = !0, g(!0), window.setTimeout(n,
|
|
2432
|
+
function Nr({ model: t, onClose: n }) {
|
|
2433
|
+
let r = Ar[t.type] ?? Ar.info, i = r.tone, [a, s] = f(!1), [l, u] = f(!1), [p, m] = f(!1), [h, g] = f(!1), [_, b] = f(1), x = d(t.duration), S = d(!1), C = !t.sticky && t.duration > 0, w = o(() => {
|
|
2434
|
+
S.current || (S.current = !0, g(!0), window.setTimeout(n, jr));
|
|
2309
2435
|
}, [n]);
|
|
2310
2436
|
c(() => {
|
|
2311
2437
|
x.current = t.duration, b(1);
|
|
@@ -2354,7 +2480,7 @@ function xr({ model: t, onClose: n }) {
|
|
|
2354
2480
|
boxShadow: "var(--shadow-toast)",
|
|
2355
2481
|
overflow: "hidden",
|
|
2356
2482
|
position: "relative",
|
|
2357
|
-
animation: h ? `dz-toast-out ${
|
|
2483
|
+
animation: h ? `dz-toast-out ${jr}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2358
2484
|
},
|
|
2359
2485
|
children: [/* @__PURE__ */ y("div", {
|
|
2360
2486
|
style: {
|
|
@@ -2376,7 +2502,7 @@ function xr({ model: t, onClose: n }) {
|
|
|
2376
2502
|
justifyContent: "center",
|
|
2377
2503
|
color: E("")
|
|
2378
2504
|
},
|
|
2379
|
-
children: /* @__PURE__ */ v(
|
|
2505
|
+
children: /* @__PURE__ */ v(Mr, { type: t.type })
|
|
2380
2506
|
}),
|
|
2381
2507
|
/* @__PURE__ */ y("div", {
|
|
2382
2508
|
style: {
|
|
@@ -2569,28 +2695,28 @@ function xr({ model: t, onClose: n }) {
|
|
|
2569
2695
|
}
|
|
2570
2696
|
//#endregion
|
|
2571
2697
|
//#region src/lib/toast.tsx
|
|
2572
|
-
var
|
|
2698
|
+
var Pr = {
|
|
2573
2699
|
success: 4e3,
|
|
2574
2700
|
info: 6e3,
|
|
2575
2701
|
warning: 8e3,
|
|
2576
2702
|
error: 0,
|
|
2577
2703
|
loading: 0
|
|
2578
|
-
}, X = /* @__PURE__ */ new Map(),
|
|
2579
|
-
function
|
|
2580
|
-
g.custom(() => /* @__PURE__ */ v(
|
|
2704
|
+
}, X = /* @__PURE__ */ new Map(), Fr = /* @__PURE__ */ new Map(), Ir = 0, Lr = () => `dz-${++Ir}`;
|
|
2705
|
+
function Rr(e) {
|
|
2706
|
+
g.custom(() => /* @__PURE__ */ v(Nr, {
|
|
2581
2707
|
model: e,
|
|
2582
2708
|
onClose: () => g.dismiss(e.id)
|
|
2583
2709
|
}), {
|
|
2584
2710
|
id: e.id,
|
|
2585
2711
|
duration: Infinity,
|
|
2586
2712
|
onDismiss: () => {
|
|
2587
|
-
X.delete(String(e.id)), e.group &&
|
|
2713
|
+
X.delete(String(e.id)), e.group && Fr.get(e.group) === e.id && Fr.delete(e.group);
|
|
2588
2714
|
}
|
|
2589
2715
|
});
|
|
2590
2716
|
}
|
|
2591
|
-
function
|
|
2717
|
+
function zr(e, t, n, r = {}) {
|
|
2592
2718
|
if (r.group) {
|
|
2593
|
-
let e =
|
|
2719
|
+
let e = Fr.get(r.group);
|
|
2594
2720
|
if (e && X.has(e)) {
|
|
2595
2721
|
let r = X.get(e), i = {
|
|
2596
2722
|
...r,
|
|
@@ -2599,10 +2725,10 @@ function Dr(e, t, n, r = {}) {
|
|
|
2599
2725
|
count: (r.count ?? 1) + 1,
|
|
2600
2726
|
createdAt: Date.now()
|
|
2601
2727
|
};
|
|
2602
|
-
return X.set(e, i),
|
|
2728
|
+
return X.set(e, i), Rr(i), e;
|
|
2603
2729
|
}
|
|
2604
2730
|
}
|
|
2605
|
-
let i = r.id ??
|
|
2731
|
+
let i = r.id ?? Lr(), a = r.duration ?? Pr[e], o = {
|
|
2606
2732
|
id: i,
|
|
2607
2733
|
type: e,
|
|
2608
2734
|
title: t,
|
|
@@ -2616,12 +2742,12 @@ function Dr(e, t, n, r = {}) {
|
|
|
2616
2742
|
createdAt: Date.now(),
|
|
2617
2743
|
group: r.group
|
|
2618
2744
|
};
|
|
2619
|
-
return X.set(i, o), r.group &&
|
|
2745
|
+
return X.set(i, o), r.group && Fr.set(r.group, i), Rr(o), i;
|
|
2620
2746
|
}
|
|
2621
|
-
function
|
|
2747
|
+
function Br(e, t) {
|
|
2622
2748
|
let n = X.get(e);
|
|
2623
2749
|
if (!n) return;
|
|
2624
|
-
let r = t.type ?? n.type, i = t.duration ?? (t.type ?
|
|
2750
|
+
let r = t.type ?? n.type, i = t.duration ?? (t.type ? Pr[r] : n.duration), a = {
|
|
2625
2751
|
...n,
|
|
2626
2752
|
...t,
|
|
2627
2753
|
type: r,
|
|
@@ -2629,35 +2755,35 @@ function Or(e, t) {
|
|
|
2629
2755
|
sticky: t.sticky ?? i === 0,
|
|
2630
2756
|
createdAt: Date.now()
|
|
2631
2757
|
};
|
|
2632
|
-
X.set(e, a),
|
|
2758
|
+
X.set(e, a), Rr(a);
|
|
2633
2759
|
}
|
|
2634
2760
|
var Z = {
|
|
2635
|
-
success: (e, t, n) =>
|
|
2636
|
-
info: (e, t, n) =>
|
|
2637
|
-
warning: (e, t, n) =>
|
|
2638
|
-
error: (e, t, n) =>
|
|
2639
|
-
loading: (e, t, n) =>
|
|
2640
|
-
update:
|
|
2761
|
+
success: (e, t, n) => zr("success", e, t, n),
|
|
2762
|
+
info: (e, t, n) => zr("info", e, t, n),
|
|
2763
|
+
warning: (e, t, n) => zr("warning", e, t, n),
|
|
2764
|
+
error: (e, t, n) => zr("error", e, t, n),
|
|
2765
|
+
loading: (e, t, n) => zr("loading", e, t, n),
|
|
2766
|
+
update: Br,
|
|
2641
2767
|
dismiss: (e) => g.dismiss(e),
|
|
2642
2768
|
dismissAll: () => g.dismiss()
|
|
2643
2769
|
};
|
|
2644
2770
|
//#endregion
|
|
2645
2771
|
//#region src/api/data.ts
|
|
2646
|
-
function
|
|
2772
|
+
function Vr(e, t) {
|
|
2647
2773
|
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
2648
2774
|
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);
|
|
2649
2775
|
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;
|
|
2650
2776
|
}
|
|
2651
|
-
async function
|
|
2652
|
-
if (
|
|
2653
|
-
let n =
|
|
2777
|
+
async function Hr(e, t = {}, n = {}) {
|
|
2778
|
+
if (ti) {
|
|
2779
|
+
let n = ti(e, t);
|
|
2654
2780
|
if (n !== void 0) return n;
|
|
2655
2781
|
}
|
|
2656
|
-
return K(
|
|
2782
|
+
return K(Vr(e, t), { signal: n.signal });
|
|
2657
2783
|
}
|
|
2658
|
-
async function
|
|
2659
|
-
if (
|
|
2660
|
-
let n =
|
|
2784
|
+
async function Ur(e, t) {
|
|
2785
|
+
if (ni) {
|
|
2786
|
+
let n = ni(e, t);
|
|
2661
2787
|
if (n !== void 0) return n;
|
|
2662
2788
|
}
|
|
2663
2789
|
let n = new URLSearchParams();
|
|
@@ -2665,40 +2791,40 @@ async function jr(e, t) {
|
|
|
2665
2791
|
else for (let [e, r] of Object.entries(t)) n.set(e, r);
|
|
2666
2792
|
return K(`/api/data/${e}?${n.toString()}`);
|
|
2667
2793
|
}
|
|
2668
|
-
async function
|
|
2669
|
-
return { data: ((await
|
|
2794
|
+
async function Wr(e, t) {
|
|
2795
|
+
return { data: ((await ai(`${e}.__create`, {
|
|
2670
2796
|
entity: e,
|
|
2671
2797
|
fields: t
|
|
2672
2798
|
})).result?.rows ?? [])[0] };
|
|
2673
2799
|
}
|
|
2674
|
-
async function
|
|
2675
|
-
let r = typeof t == "string" ? t :
|
|
2676
|
-
return { data: ((await
|
|
2800
|
+
async function Gr(e, t, n) {
|
|
2801
|
+
let r = typeof t == "string" ? t : qr(t);
|
|
2802
|
+
return { data: ((await ai(`${e}.__update`, {
|
|
2677
2803
|
object_ids: [r],
|
|
2678
2804
|
entity: e,
|
|
2679
2805
|
fields: n
|
|
2680
2806
|
})).result?.rows ?? [])[0] };
|
|
2681
2807
|
}
|
|
2682
|
-
async function
|
|
2683
|
-
let n = typeof t == "string" ? t :
|
|
2684
|
-
await
|
|
2808
|
+
async function Kr(e, t) {
|
|
2809
|
+
let n = typeof t == "string" ? t : qr(t);
|
|
2810
|
+
await ai(`${e}.__delete`, {
|
|
2685
2811
|
object_ids: [n],
|
|
2686
2812
|
entity: e
|
|
2687
2813
|
});
|
|
2688
2814
|
}
|
|
2689
|
-
function
|
|
2815
|
+
function qr(e) {
|
|
2690
2816
|
let t = Object.values(e);
|
|
2691
2817
|
return t.length === 1 ? t[0] : t.join("");
|
|
2692
2818
|
}
|
|
2693
|
-
async function
|
|
2694
|
-
let n = typeof t == "string" ? t :
|
|
2695
|
-
await
|
|
2819
|
+
async function Jr(e, t) {
|
|
2820
|
+
let n = typeof t == "string" ? t : qr(t);
|
|
2821
|
+
await ai(`${e}.__restore`, {
|
|
2696
2822
|
object_ids: [n],
|
|
2697
2823
|
entity: e
|
|
2698
2824
|
});
|
|
2699
2825
|
}
|
|
2700
|
-
async function
|
|
2701
|
-
let n = await
|
|
2826
|
+
async function Yr(e, t) {
|
|
2827
|
+
let n = await yn(`/api/data/${e}/export`, {
|
|
2702
2828
|
method: "POST",
|
|
2703
2829
|
body: JSON.stringify(t)
|
|
2704
2830
|
});
|
|
@@ -2707,7 +2833,7 @@ async function Lr(e, t) {
|
|
|
2707
2833
|
filename: n.filename
|
|
2708
2834
|
};
|
|
2709
2835
|
}
|
|
2710
|
-
var
|
|
2836
|
+
var Xr = class extends Error {
|
|
2711
2837
|
status;
|
|
2712
2838
|
response;
|
|
2713
2839
|
constructor(e, t) {
|
|
@@ -2715,64 +2841,64 @@ var Rr = class extends Error {
|
|
|
2715
2841
|
super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
|
|
2716
2842
|
}
|
|
2717
2843
|
};
|
|
2718
|
-
function
|
|
2844
|
+
function Zr(e) {
|
|
2719
2845
|
if (!e || typeof e != "object") return !1;
|
|
2720
2846
|
let t = e;
|
|
2721
2847
|
return typeof t.status == "string" && Array.isArray(t.errors);
|
|
2722
2848
|
}
|
|
2723
|
-
function
|
|
2849
|
+
function Qr(e, t) {
|
|
2724
2850
|
let n = { ...e ?? {} };
|
|
2725
2851
|
if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
|
|
2726
2852
|
if ("_ids" in n) throw Error("handler param \"_ids\" is a removed legacy key; use object_ids");
|
|
2727
2853
|
return t !== void 0 && (n.object_ids = t), n;
|
|
2728
2854
|
}
|
|
2729
|
-
var
|
|
2730
|
-
function
|
|
2731
|
-
let t =
|
|
2732
|
-
return
|
|
2855
|
+
var $r = null;
|
|
2856
|
+
function ei(e) {
|
|
2857
|
+
let t = $r;
|
|
2858
|
+
return $r = e, t;
|
|
2733
2859
|
}
|
|
2734
|
-
var
|
|
2735
|
-
function
|
|
2736
|
-
let t =
|
|
2737
|
-
return
|
|
2860
|
+
var ti = null, ni = null;
|
|
2861
|
+
function ri(e) {
|
|
2862
|
+
let t = ti;
|
|
2863
|
+
return ti = e, t;
|
|
2738
2864
|
}
|
|
2739
|
-
function
|
|
2740
|
-
let t =
|
|
2741
|
-
return
|
|
2865
|
+
function ii(e) {
|
|
2866
|
+
let t = ni;
|
|
2867
|
+
return ni = e, t;
|
|
2742
2868
|
}
|
|
2743
|
-
async function
|
|
2744
|
-
if (
|
|
2869
|
+
async function ai(e, t) {
|
|
2870
|
+
if ($r) return $r(e, t);
|
|
2745
2871
|
try {
|
|
2746
2872
|
return await K(`/api/actions/${e}`, {
|
|
2747
2873
|
method: "POST",
|
|
2748
2874
|
body: JSON.stringify(t)
|
|
2749
2875
|
});
|
|
2750
2876
|
} catch (e) {
|
|
2751
|
-
throw e instanceof z &&
|
|
2877
|
+
throw e instanceof z && Zr(e.raw) ? new Xr(e.status, e.raw) : e;
|
|
2752
2878
|
}
|
|
2753
2879
|
}
|
|
2754
|
-
async function
|
|
2880
|
+
async function oi(e, t) {
|
|
2755
2881
|
let n = new URLSearchParams();
|
|
2756
2882
|
return n.set("ids", t.join(",")), K(`/api/associations/${e}?${n.toString()}`);
|
|
2757
2883
|
}
|
|
2758
2884
|
//#endregion
|
|
2759
2885
|
//#region src/components/shared/Markdown.tsx
|
|
2760
|
-
var
|
|
2761
|
-
function
|
|
2886
|
+
var si = a(() => import("./MarkdownRenderer-CaHhWrfm.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
2887
|
+
function ci() {
|
|
2762
2888
|
return /* @__PURE__ */ v("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
2763
2889
|
}
|
|
2764
|
-
function
|
|
2890
|
+
function li(e) {
|
|
2765
2891
|
return /* @__PURE__ */ v(n, {
|
|
2766
|
-
fallback: /* @__PURE__ */ v(
|
|
2767
|
-
children: /* @__PURE__ */ v(
|
|
2892
|
+
fallback: /* @__PURE__ */ v(ci, {}),
|
|
2893
|
+
children: /* @__PURE__ */ v(si, { ...e })
|
|
2768
2894
|
});
|
|
2769
2895
|
}
|
|
2770
2896
|
//#endregion
|
|
2771
2897
|
//#region src/types/fieldType.ts
|
|
2772
|
-
var
|
|
2898
|
+
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(".");
|
|
2773
2899
|
//#endregion
|
|
2774
2900
|
//#region src/components/shared/CopyButton.tsx
|
|
2775
|
-
function
|
|
2901
|
+
function di({ value: t, title: n, size: r = "icon" }) {
|
|
2776
2902
|
let [i, a] = f(!1), s = o(async (e) => {
|
|
2777
2903
|
e.stopPropagation(), e.preventDefault();
|
|
2778
2904
|
try {
|
|
@@ -2791,7 +2917,7 @@ function $r({ value: t, title: n, size: r = "icon" }) {
|
|
|
2791
2917
|
}
|
|
2792
2918
|
//#endregion
|
|
2793
2919
|
//#region src/components/fields/StringField.tsx
|
|
2794
|
-
function
|
|
2920
|
+
function fi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
2795
2921
|
if (r === "display") {
|
|
2796
2922
|
let t = F(n);
|
|
2797
2923
|
return e.copyable && t ? /* @__PURE__ */ y("span", {
|
|
@@ -2803,7 +2929,7 @@ function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
2803
2929
|
children: [/* @__PURE__ */ v("span", {
|
|
2804
2930
|
style: { fontSize: 12.5 },
|
|
2805
2931
|
children: t
|
|
2806
|
-
}), /* @__PURE__ */ v(
|
|
2932
|
+
}), /* @__PURE__ */ v(di, {
|
|
2807
2933
|
value: t,
|
|
2808
2934
|
size: "sm"
|
|
2809
2935
|
})]
|
|
@@ -2825,7 +2951,7 @@ function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
2825
2951
|
}
|
|
2826
2952
|
//#endregion
|
|
2827
2953
|
//#region src/components/fields/TextField.tsx
|
|
2828
|
-
function
|
|
2954
|
+
function pi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
|
|
2829
2955
|
let c = e.display?.widget;
|
|
2830
2956
|
if (r === "display") {
|
|
2831
2957
|
let t = F(n);
|
|
@@ -2836,7 +2962,7 @@ function ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2836
2962
|
},
|
|
2837
2963
|
children: "—"
|
|
2838
2964
|
});
|
|
2839
|
-
let r = c === "markdown" ? /* @__PURE__ */ v(
|
|
2965
|
+
let r = c === "markdown" ? /* @__PURE__ */ v(li, { content: t }) : c === "code" ? /* @__PURE__ */ v("pre", {
|
|
2840
2966
|
className: "mono",
|
|
2841
2967
|
style: {
|
|
2842
2968
|
fontSize: 12,
|
|
@@ -2868,7 +2994,7 @@ function ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2868
2994
|
top: 0,
|
|
2869
2995
|
right: 0
|
|
2870
2996
|
},
|
|
2871
|
-
children: /* @__PURE__ */ v(
|
|
2997
|
+
children: /* @__PURE__ */ v(di, {
|
|
2872
2998
|
value: t,
|
|
2873
2999
|
size: "sm"
|
|
2874
3000
|
})
|
|
@@ -2883,7 +3009,7 @@ function ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2883
3009
|
onChange: (e) => i?.(e)
|
|
2884
3010
|
});
|
|
2885
3011
|
let l = c === "markdown" || c === "code" ? 10 : 4;
|
|
2886
|
-
return /* @__PURE__ */ v(
|
|
3012
|
+
return /* @__PURE__ */ v(Se, {
|
|
2887
3013
|
id: s,
|
|
2888
3014
|
name: t,
|
|
2889
3015
|
ariaRequired: e.required,
|
|
@@ -2895,8 +3021,8 @@ function ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2895
3021
|
}
|
|
2896
3022
|
//#endregion
|
|
2897
3023
|
//#region src/components/fields/EnumField.tsx
|
|
2898
|
-
var
|
|
2899
|
-
function
|
|
3024
|
+
var mi = "__declarion_enum_null__";
|
|
3025
|
+
function hi({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
|
|
2900
3026
|
let o = e.values ?? [], s = o.find((e) => e.code === t);
|
|
2901
3027
|
if (n === "display") return s ? /* @__PURE__ */ v(D, {
|
|
2902
3028
|
tone: s.color ?? "slate",
|
|
@@ -2909,8 +3035,8 @@ function ri({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
2909
3035
|
},
|
|
2910
3036
|
children: "—"
|
|
2911
3037
|
});
|
|
2912
|
-
let c = !e.required, l = t != null && t !== "" ? F(t) :
|
|
2913
|
-
value:
|
|
3038
|
+
let c = !e.required, l = t != null && t !== "" ? F(t) : mi, u = [...c ? [{
|
|
3039
|
+
value: mi,
|
|
2914
3040
|
label: "— None —"
|
|
2915
3041
|
}] : [], ...o.map((e) => ({
|
|
2916
3042
|
value: e.code,
|
|
@@ -2922,13 +3048,13 @@ function ri({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
2922
3048
|
"aria-required": e.required || void 0,
|
|
2923
3049
|
value: l,
|
|
2924
3050
|
options: u,
|
|
2925
|
-
onChange: (e) => r?.(e ===
|
|
3051
|
+
onChange: (e) => r?.(e === mi ? null : e),
|
|
2926
3052
|
placeholder: "Select…"
|
|
2927
3053
|
});
|
|
2928
3054
|
}
|
|
2929
3055
|
//#endregion
|
|
2930
3056
|
//#region src/components/fields/EmailField.tsx
|
|
2931
|
-
function
|
|
3057
|
+
function gi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2932
3058
|
return /* @__PURE__ */ v(N, {
|
|
2933
3059
|
id: i,
|
|
2934
3060
|
name: t,
|
|
@@ -2940,7 +3066,7 @@ function ii({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2940
3066
|
}
|
|
2941
3067
|
//#endregion
|
|
2942
3068
|
//#region src/components/fields/UrlField.tsx
|
|
2943
|
-
function
|
|
3069
|
+
function _i({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2944
3070
|
return /* @__PURE__ */ v(N, {
|
|
2945
3071
|
id: i,
|
|
2946
3072
|
name: t,
|
|
@@ -2953,7 +3079,7 @@ function ai({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2953
3079
|
}
|
|
2954
3080
|
//#endregion
|
|
2955
3081
|
//#region src/components/fields/PhoneField.tsx
|
|
2956
|
-
function
|
|
3082
|
+
function vi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2957
3083
|
return /* @__PURE__ */ v(N, {
|
|
2958
3084
|
id: i,
|
|
2959
3085
|
name: t,
|
|
@@ -2966,10 +3092,10 @@ function oi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2966
3092
|
}
|
|
2967
3093
|
//#endregion
|
|
2968
3094
|
//#region src/lib/timestamp.ts
|
|
2969
|
-
function
|
|
3095
|
+
function yi(e = /* @__PURE__ */ new Date()) {
|
|
2970
3096
|
return w(e);
|
|
2971
3097
|
}
|
|
2972
|
-
function
|
|
3098
|
+
function bi(e, t) {
|
|
2973
3099
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
2974
3100
|
if (isNaN(i.getTime())) return e;
|
|
2975
3101
|
if (n || r) {
|
|
@@ -2995,13 +3121,13 @@ function ci(e, t) {
|
|
|
2995
3121
|
}
|
|
2996
3122
|
return new Intl.DateTimeFormat(void 0, t).format(i);
|
|
2997
3123
|
}
|
|
2998
|
-
function
|
|
2999
|
-
return
|
|
3124
|
+
function xi(e) {
|
|
3125
|
+
return bi(e, {
|
|
3000
3126
|
dateStyle: "medium",
|
|
3001
3127
|
timeStyle: "short"
|
|
3002
3128
|
});
|
|
3003
3129
|
}
|
|
3004
|
-
function
|
|
3130
|
+
function Si(e, t = /* @__PURE__ */ new Date()) {
|
|
3005
3131
|
if (e == null || e === "") return {
|
|
3006
3132
|
text: "—",
|
|
3007
3133
|
absolute: ""
|
|
@@ -3014,7 +3140,7 @@ function ui(e, t = /* @__PURE__ */ new Date()) {
|
|
|
3014
3140
|
absolute: t
|
|
3015
3141
|
};
|
|
3016
3142
|
}
|
|
3017
|
-
let r =
|
|
3143
|
+
let r = xi(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
|
|
3018
3144
|
return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
|
|
3019
3145
|
text: w(n, { representation: "date" }),
|
|
3020
3146
|
absolute: r
|
|
@@ -3025,23 +3151,23 @@ function ui(e, t = /* @__PURE__ */ new Date()) {
|
|
|
3025
3151
|
}
|
|
3026
3152
|
//#endregion
|
|
3027
3153
|
//#region src/components/fields/TimestampField.tsx
|
|
3028
|
-
var
|
|
3154
|
+
var Ci = {
|
|
3029
3155
|
year: "numeric",
|
|
3030
3156
|
month: "short",
|
|
3031
3157
|
day: "numeric"
|
|
3032
|
-
},
|
|
3033
|
-
...
|
|
3158
|
+
}, wi = {
|
|
3159
|
+
...Ci,
|
|
3034
3160
|
hour: "2-digit",
|
|
3035
3161
|
minute: "2-digit"
|
|
3036
3162
|
};
|
|
3037
|
-
function
|
|
3163
|
+
function Ti(e, t) {
|
|
3038
3164
|
if (t) {
|
|
3039
3165
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3040
|
-
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0,
|
|
3166
|
+
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, Ci).format(t);
|
|
3041
3167
|
}
|
|
3042
|
-
return
|
|
3168
|
+
return bi(e, wi);
|
|
3043
3169
|
}
|
|
3044
|
-
function
|
|
3170
|
+
function Ei(e, t) {
|
|
3045
3171
|
if (t) {
|
|
3046
3172
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3047
3173
|
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
|
|
@@ -3059,14 +3185,14 @@ function mi(e, t) {
|
|
|
3059
3185
|
minute: "2-digit"
|
|
3060
3186
|
}).format(n);
|
|
3061
3187
|
}
|
|
3062
|
-
function
|
|
3188
|
+
function Di(e) {
|
|
3063
3189
|
if (e.endsWith("Z")) return "UTC";
|
|
3064
3190
|
let t = e.match(/([+-]\d{2}:\d{2})$/);
|
|
3065
3191
|
if (!t) return null;
|
|
3066
3192
|
let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
3067
3193
|
return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
|
|
3068
3194
|
}
|
|
3069
|
-
function
|
|
3195
|
+
function Oi(e, t) {
|
|
3070
3196
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
3071
3197
|
if (isNaN(i.getTime())) return "";
|
|
3072
3198
|
if (r) {
|
|
@@ -3079,13 +3205,13 @@ function gi(e, t) {
|
|
|
3079
3205
|
}
|
|
3080
3206
|
return t ? e.slice(0, 10) : e.slice(0, 16);
|
|
3081
3207
|
}
|
|
3082
|
-
function
|
|
3208
|
+
function ki(e, t) {
|
|
3083
3209
|
let n = new Date(e);
|
|
3084
3210
|
if (isNaN(n.getTime())) return "";
|
|
3085
3211
|
let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
|
|
3086
3212
|
return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
|
|
3087
3213
|
}
|
|
3088
|
-
function
|
|
3214
|
+
function Ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3089
3215
|
let o = e.type === "date", s = !!e.timezone;
|
|
3090
3216
|
if (r === "display") {
|
|
3091
3217
|
if (!n) return /* @__PURE__ */ v("span", {
|
|
@@ -3095,7 +3221,7 @@ function vi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3095
3221
|
},
|
|
3096
3222
|
children: "—"
|
|
3097
3223
|
});
|
|
3098
|
-
let e = F(n), t = s ?
|
|
3224
|
+
let e = F(n), t = s ? Ti(e, o) : Ei(e, o), r = s && !o ? Di(e) : null;
|
|
3099
3225
|
return /* @__PURE__ */ y("span", {
|
|
3100
3226
|
style: { fontSize: 12.5 },
|
|
3101
3227
|
children: [t, r && /* @__PURE__ */ v("span", {
|
|
@@ -3107,7 +3233,7 @@ function vi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3107
3233
|
})]
|
|
3108
3234
|
});
|
|
3109
3235
|
}
|
|
3110
|
-
let c = n ? s ?
|
|
3236
|
+
let c = n ? s ? Oi(F(n), o) : ki(F(n), o) : "";
|
|
3111
3237
|
return /* @__PURE__ */ v(N, {
|
|
3112
3238
|
id: a,
|
|
3113
3239
|
name: t,
|
|
@@ -3128,13 +3254,13 @@ function vi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3128
3254
|
i?.(e);
|
|
3129
3255
|
return;
|
|
3130
3256
|
}
|
|
3131
|
-
i?.(
|
|
3257
|
+
i?.(yi(t));
|
|
3132
3258
|
}
|
|
3133
3259
|
});
|
|
3134
3260
|
}
|
|
3135
3261
|
//#endregion
|
|
3136
3262
|
//#region src/components/fields/BoolField.tsx
|
|
3137
|
-
function
|
|
3263
|
+
function ji({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
3138
3264
|
let a = !!e;
|
|
3139
3265
|
return t === "display" ? /* @__PURE__ */ y("span", {
|
|
3140
3266
|
style: {
|
|
@@ -3150,7 +3276,7 @@ function yi({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3150
3276
|
borderRadius: 999,
|
|
3151
3277
|
background: a ? "var(--success)" : "var(--text-4)"
|
|
3152
3278
|
} }), a ? "Yes" : "No"]
|
|
3153
|
-
}) : /* @__PURE__ */ v(
|
|
3279
|
+
}) : /* @__PURE__ */ v(_e, {
|
|
3154
3280
|
id: r,
|
|
3155
3281
|
ariaLabelledby: i,
|
|
3156
3282
|
value: a,
|
|
@@ -3159,7 +3285,7 @@ function yi({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3159
3285
|
}
|
|
3160
3286
|
//#endregion
|
|
3161
3287
|
//#region src/components/fields/NumberField.tsx
|
|
3162
|
-
function
|
|
3288
|
+
function Mi(e) {
|
|
3163
3289
|
let t = e.trim();
|
|
3164
3290
|
if (t === "" || t === "-") return t;
|
|
3165
3291
|
let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
|
|
@@ -3171,8 +3297,8 @@ function bi(e) {
|
|
|
3171
3297
|
let o = n ? `-${a}` : a;
|
|
3172
3298
|
return i !== void 0 && (o += `.${i}`), o;
|
|
3173
3299
|
}
|
|
3174
|
-
var
|
|
3175
|
-
function
|
|
3300
|
+
var Ni = new Intl.NumberFormat();
|
|
3301
|
+
function Pi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3176
3302
|
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);
|
|
3177
3303
|
if (r === "display") {
|
|
3178
3304
|
if (n == null) return /* @__PURE__ */ v("span", {
|
|
@@ -3183,10 +3309,10 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3183
3309
|
children: "—"
|
|
3184
3310
|
});
|
|
3185
3311
|
let e;
|
|
3186
|
-
if (c && typeof n == "string") e =
|
|
3312
|
+
if (c && typeof n == "string") e = Mi(n);
|
|
3187
3313
|
else {
|
|
3188
3314
|
let t = Number(n);
|
|
3189
|
-
e = isNaN(t) ? null :
|
|
3315
|
+
e = isNaN(t) ? null : Ni.format(t);
|
|
3190
3316
|
}
|
|
3191
3317
|
return e == null ? /* @__PURE__ */ v("span", {
|
|
3192
3318
|
style: { fontSize: 12.5 },
|
|
@@ -3231,13 +3357,13 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3231
3357
|
}
|
|
3232
3358
|
//#endregion
|
|
3233
3359
|
//#region src/hooks/useEntity.ts
|
|
3234
|
-
function
|
|
3360
|
+
function Fi(e) {
|
|
3235
3361
|
let { data: t } = J();
|
|
3236
3362
|
if (!(!t || !e)) return t.entities[e];
|
|
3237
3363
|
}
|
|
3238
3364
|
//#endregion
|
|
3239
3365
|
//#region src/hooks/useEntityData.ts
|
|
3240
|
-
function
|
|
3366
|
+
function Ii(e, t) {
|
|
3241
3367
|
return [
|
|
3242
3368
|
"entity-data",
|
|
3243
3369
|
e,
|
|
@@ -3247,16 +3373,16 @@ function wi(e, t) {
|
|
|
3247
3373
|
}
|
|
3248
3374
|
];
|
|
3249
3375
|
}
|
|
3250
|
-
function
|
|
3251
|
-
let r =
|
|
3376
|
+
function Li(e, t, n = !0) {
|
|
3377
|
+
let r = Ii(e, t), i = r[2];
|
|
3252
3378
|
return h({
|
|
3253
3379
|
queryKey: r,
|
|
3254
|
-
queryFn: ({ signal: t }) =>
|
|
3380
|
+
queryFn: ({ signal: t }) => Hr(e, i, { signal: t }),
|
|
3255
3381
|
enabled: !!e && n,
|
|
3256
3382
|
placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
|
|
3257
3383
|
});
|
|
3258
3384
|
}
|
|
3259
|
-
function
|
|
3385
|
+
function Ri(e, t, n = !0) {
|
|
3260
3386
|
let r = {
|
|
3261
3387
|
...t,
|
|
3262
3388
|
count: "only",
|
|
@@ -3272,7 +3398,7 @@ function Ei(e, t, n = !0) {
|
|
|
3272
3398
|
e,
|
|
3273
3399
|
r
|
|
3274
3400
|
],
|
|
3275
|
-
queryFn: ({ signal: t }) =>
|
|
3401
|
+
queryFn: ({ signal: t }) => Hr(e, r, { signal: t }),
|
|
3276
3402
|
enabled: !!e && n,
|
|
3277
3403
|
retry: 1,
|
|
3278
3404
|
staleTime: 3e4,
|
|
@@ -3281,7 +3407,7 @@ function Ei(e, t, n = !0) {
|
|
|
3281
3407
|
}
|
|
3282
3408
|
//#endregion
|
|
3283
3409
|
//#region src/hooks/useDebounce.ts
|
|
3284
|
-
function
|
|
3410
|
+
function zi(e, t) {
|
|
3285
3411
|
let [n, r] = f(e);
|
|
3286
3412
|
return c(() => {
|
|
3287
3413
|
let n = setTimeout(() => r(e), t);
|
|
@@ -3290,24 +3416,24 @@ function Di(e, t) {
|
|
|
3290
3416
|
}
|
|
3291
3417
|
//#endregion
|
|
3292
3418
|
//#region src/components/fields/RefCombobox.tsx
|
|
3293
|
-
var
|
|
3294
|
-
function
|
|
3295
|
-
let m = e?.entity, h =
|
|
3296
|
-
per_page:
|
|
3419
|
+
var Bi = 200;
|
|
3420
|
+
function Vi({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: p }) {
|
|
3421
|
+
let m = e?.entity, h = Fi(m), g = i ?? e?.display?.field ?? h?.display?.display_field, _ = u(() => h ? R(h)[0] ?? "id" : "id", [h]), y = e?.field || _, [b, x] = f(""), S = zi(b, 300), { data: C, isLoading: w } = Li(m, {
|
|
3422
|
+
per_page: Bi,
|
|
3297
3423
|
sort: g ? `${g}:asc` : void 0,
|
|
3298
3424
|
search: S || void 0
|
|
3299
3425
|
}), T = u(() => C?.data ?? [], [C?.data]), E = t == null ? "" : F(t), D = u(() => T.some((e) => String(e[y]) === E), [
|
|
3300
3426
|
T,
|
|
3301
3427
|
y,
|
|
3302
3428
|
E
|
|
3303
|
-
]), O = r && m ? r[m]?.[E] : void 0, k = !!p?.some((e) => e.code === E), { data:
|
|
3429
|
+
]), O = r && m ? r[m]?.[E] : void 0, k = !!p?.some((e) => e.code === E), { data: A } = Li(E && !D && !k && !O && !w ? m : void 0, {
|
|
3304
3430
|
per_page: 1,
|
|
3305
3431
|
filters: [{
|
|
3306
3432
|
field: y,
|
|
3307
3433
|
op: "eq",
|
|
3308
3434
|
value: E
|
|
3309
3435
|
}]
|
|
3310
|
-
}),
|
|
3436
|
+
}), ee = d(null), j = u(() => {
|
|
3311
3437
|
if (!E) return "";
|
|
3312
3438
|
let e;
|
|
3313
3439
|
if (O) e = L(O, g, E);
|
|
@@ -3315,11 +3441,11 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3315
3441
|
let t = T.find((e) => String(e[y]) === E);
|
|
3316
3442
|
if (t) e = L(t, g, E);
|
|
3317
3443
|
else {
|
|
3318
|
-
let t =
|
|
3444
|
+
let t = A?.data?.find((e) => String(e[y]) === E);
|
|
3319
3445
|
t && (e = L(t, g, E));
|
|
3320
3446
|
}
|
|
3321
3447
|
}
|
|
3322
|
-
return e === void 0 ?
|
|
3448
|
+
return e === void 0 ? ee.current?.value === E ? ee.current.label : E : (ee.current = {
|
|
3323
3449
|
value: E,
|
|
3324
3450
|
label: e
|
|
3325
3451
|
}, e);
|
|
@@ -3329,8 +3455,8 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3329
3455
|
T,
|
|
3330
3456
|
y,
|
|
3331
3457
|
g,
|
|
3332
|
-
|
|
3333
|
-
]),
|
|
3458
|
+
A
|
|
3459
|
+
]), te = u(() => {
|
|
3334
3460
|
let e = (p ?? []).map((e) => ({
|
|
3335
3461
|
value: e.code,
|
|
3336
3462
|
label: I(e.label) || e.code
|
|
@@ -3342,7 +3468,7 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3342
3468
|
};
|
|
3343
3469
|
}), n = E && !D && !k ? [{
|
|
3344
3470
|
value: E,
|
|
3345
|
-
label:
|
|
3471
|
+
label: j
|
|
3346
3472
|
}] : [], r = t.length > 0 || n.length > 0;
|
|
3347
3473
|
return [
|
|
3348
3474
|
{
|
|
@@ -3368,7 +3494,7 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3368
3494
|
E,
|
|
3369
3495
|
D,
|
|
3370
3496
|
k,
|
|
3371
|
-
|
|
3497
|
+
j,
|
|
3372
3498
|
T,
|
|
3373
3499
|
y,
|
|
3374
3500
|
g
|
|
@@ -3379,7 +3505,7 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3379
3505
|
"aria-labelledby": o,
|
|
3380
3506
|
"aria-required": c || void 0,
|
|
3381
3507
|
value: E,
|
|
3382
|
-
options:
|
|
3508
|
+
options: te,
|
|
3383
3509
|
onChange: (e) => n(e || null),
|
|
3384
3510
|
onSearchChange: x,
|
|
3385
3511
|
placeholder: l
|
|
@@ -3387,8 +3513,8 @@ function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3387
3513
|
}
|
|
3388
3514
|
//#endregion
|
|
3389
3515
|
//#region src/components/fields/RefField.tsx
|
|
3390
|
-
function
|
|
3391
|
-
let s = e.ref?.entity, c =
|
|
3516
|
+
function Hi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
|
|
3517
|
+
let s = e.ref?.entity, c = Fi(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, d = u(() => {
|
|
3392
3518
|
if (t == null) return "—";
|
|
3393
3519
|
let e = F(t);
|
|
3394
3520
|
if (i && s) {
|
|
@@ -3405,7 +3531,7 @@ function Ai({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3405
3531
|
return n === "display" ? /* @__PURE__ */ v("span", {
|
|
3406
3532
|
style: { fontSize: 12.5 },
|
|
3407
3533
|
children: d
|
|
3408
|
-
}) : /* @__PURE__ */ v(
|
|
3534
|
+
}) : /* @__PURE__ */ v(Vi, {
|
|
3409
3535
|
ref: e.ref,
|
|
3410
3536
|
value: t,
|
|
3411
3537
|
onChange: (e) => r?.(e),
|
|
@@ -3418,29 +3544,29 @@ function Ai({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3418
3544
|
}
|
|
3419
3545
|
//#endregion
|
|
3420
3546
|
//#region src/components/fields/JsonField.tsx
|
|
3421
|
-
var
|
|
3422
|
-
function
|
|
3547
|
+
var Ui = a(() => import("./JsonEditor-KelPV-OQ.js").then((e) => ({ default: e.JsonEditor })));
|
|
3548
|
+
function Wi() {
|
|
3423
3549
|
return /* @__PURE__ */ v("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3424
3550
|
}
|
|
3425
|
-
function
|
|
3551
|
+
function Gi(e) {
|
|
3426
3552
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
|
|
3427
3553
|
}
|
|
3428
|
-
function
|
|
3429
|
-
return t === "display" ?
|
|
3554
|
+
function Ki({ value: e, mode: t, onChange: r, fieldId: i }) {
|
|
3555
|
+
return t === "display" ? Gi(e) ? /* @__PURE__ */ v("span", {
|
|
3430
3556
|
style: {
|
|
3431
3557
|
fontSize: 12.5,
|
|
3432
3558
|
color: "var(--text-4)"
|
|
3433
3559
|
},
|
|
3434
3560
|
children: "—"
|
|
3435
3561
|
}) : /* @__PURE__ */ v(n, {
|
|
3436
|
-
fallback: /* @__PURE__ */ v(
|
|
3437
|
-
children: /* @__PURE__ */ v(
|
|
3562
|
+
fallback: /* @__PURE__ */ v(Wi, {}),
|
|
3563
|
+
children: /* @__PURE__ */ v(Ui, {
|
|
3438
3564
|
value: e,
|
|
3439
3565
|
readOnly: !0
|
|
3440
3566
|
})
|
|
3441
3567
|
}) : /* @__PURE__ */ v(n, {
|
|
3442
|
-
fallback: /* @__PURE__ */ v(
|
|
3443
|
-
children: /* @__PURE__ */ v(
|
|
3568
|
+
fallback: /* @__PURE__ */ v(Wi, {}),
|
|
3569
|
+
children: /* @__PURE__ */ v(Ui, {
|
|
3444
3570
|
value: e,
|
|
3445
3571
|
onChange: r,
|
|
3446
3572
|
id: i
|
|
@@ -3449,14 +3575,14 @@ function Pi({ value: e, mode: t, onChange: r, fieldId: i }) {
|
|
|
3449
3575
|
}
|
|
3450
3576
|
//#endregion
|
|
3451
3577
|
//#region src/components/fields/MultilangField.tsx
|
|
3452
|
-
function
|
|
3578
|
+
function qi(e) {
|
|
3453
3579
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3454
3580
|
}
|
|
3455
|
-
function
|
|
3581
|
+
function Ji({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3456
3582
|
let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
|
|
3457
3583
|
code: "en",
|
|
3458
3584
|
name: { en: "English" }
|
|
3459
|
-
}], c =
|
|
3585
|
+
}], c = qi(n);
|
|
3460
3586
|
if (r === "display") return /* @__PURE__ */ v("span", {
|
|
3461
3587
|
style: { fontSize: 12.5 },
|
|
3462
3588
|
children: Object.values(c)[0] ?? "—"
|
|
@@ -3512,14 +3638,14 @@ function Ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3512
3638
|
}
|
|
3513
3639
|
//#endregion
|
|
3514
3640
|
//#region src/components/fields/MultilangTextField.tsx
|
|
3515
|
-
function
|
|
3641
|
+
function Yi(e) {
|
|
3516
3642
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3517
3643
|
}
|
|
3518
|
-
function
|
|
3644
|
+
function Xi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3519
3645
|
let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
|
|
3520
3646
|
code: "en",
|
|
3521
3647
|
name: { en: "English" }
|
|
3522
|
-
}], c =
|
|
3648
|
+
}], c = Yi(n);
|
|
3523
3649
|
if (r === "display") return /* @__PURE__ */ v("p", {
|
|
3524
3650
|
style: {
|
|
3525
3651
|
fontSize: 12.5,
|
|
@@ -3560,7 +3686,7 @@ function Ri({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3560
3686
|
fontWeight: 500
|
|
3561
3687
|
},
|
|
3562
3688
|
children: n.code
|
|
3563
|
-
}), /* @__PURE__ */ v(
|
|
3689
|
+
}), /* @__PURE__ */ v(Se, {
|
|
3564
3690
|
id: i,
|
|
3565
3691
|
name: t ? `${t}.${n.code}` : void 0,
|
|
3566
3692
|
ariaRequired: e.required && r === 0,
|
|
@@ -3575,25 +3701,25 @@ function Ri({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3575
3701
|
}
|
|
3576
3702
|
//#endregion
|
|
3577
3703
|
//#region src/components/fields/StructureField.tsx
|
|
3578
|
-
function
|
|
3704
|
+
function Zi(e) {
|
|
3579
3705
|
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = J(), c = t.structure ? s?.structures?.[t.structure] : void 0;
|
|
3580
|
-
return c ? t.array ? /* @__PURE__ */ v(
|
|
3706
|
+
return c ? t.array ? /* @__PURE__ */ v($i, {
|
|
3581
3707
|
structDef: c,
|
|
3582
3708
|
value: n,
|
|
3583
3709
|
mode: r,
|
|
3584
3710
|
onChange: i,
|
|
3585
3711
|
locale: a,
|
|
3586
3712
|
fieldId: o
|
|
3587
|
-
}) : /* @__PURE__ */ v(
|
|
3713
|
+
}) : /* @__PURE__ */ v(Qi, {
|
|
3588
3714
|
structDef: c,
|
|
3589
3715
|
value: n,
|
|
3590
3716
|
mode: r,
|
|
3591
3717
|
onChange: i,
|
|
3592
3718
|
locale: a,
|
|
3593
3719
|
fieldId: o
|
|
3594
|
-
}) : /* @__PURE__ */ v(
|
|
3720
|
+
}) : /* @__PURE__ */ v(Ki, { ...e });
|
|
3595
3721
|
}
|
|
3596
|
-
function
|
|
3722
|
+
function Qi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
|
|
3597
3723
|
let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
|
|
3598
3724
|
display: "flex",
|
|
3599
3725
|
flexDirection: "column",
|
|
@@ -3629,13 +3755,13 @@ function Bi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3629
3755
|
minWidth: 0,
|
|
3630
3756
|
flex: 1
|
|
3631
3757
|
},
|
|
3632
|
-
children: n.type === "structure" && n.structure ? /* @__PURE__ */ v(
|
|
3758
|
+
children: n.type === "structure" && n.structure ? /* @__PURE__ */ v(Zi, {
|
|
3633
3759
|
field: n,
|
|
3634
3760
|
fieldName: t,
|
|
3635
3761
|
value: r,
|
|
3636
3762
|
mode: "display",
|
|
3637
3763
|
locale: i
|
|
3638
|
-
}) :
|
|
3764
|
+
}) : ys({
|
|
3639
3765
|
field: n,
|
|
3640
3766
|
fieldName: t,
|
|
3641
3767
|
value: r,
|
|
@@ -3670,17 +3796,17 @@ function Bi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3670
3796
|
flexDirection: "column",
|
|
3671
3797
|
gap: 2
|
|
3672
3798
|
},
|
|
3673
|
-
children: [/* @__PURE__ */ v(
|
|
3799
|
+
children: [/* @__PURE__ */ v(be, {
|
|
3674
3800
|
required: n.required,
|
|
3675
3801
|
children: n.display ? I(n.display.name) : t
|
|
3676
|
-
}), n.type === "structure" && n.structure ? /* @__PURE__ */ v(
|
|
3802
|
+
}), n.type === "structure" && n.structure ? /* @__PURE__ */ v(Zi, {
|
|
3677
3803
|
field: n,
|
|
3678
3804
|
fieldName: t,
|
|
3679
3805
|
value: o[t],
|
|
3680
3806
|
mode: "edit",
|
|
3681
3807
|
onChange: l(t),
|
|
3682
3808
|
locale: i
|
|
3683
|
-
}) :
|
|
3809
|
+
}) : ys({
|
|
3684
3810
|
field: n,
|
|
3685
3811
|
fieldName: t,
|
|
3686
3812
|
value: o[t],
|
|
@@ -3692,7 +3818,7 @@ function Bi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3692
3818
|
})
|
|
3693
3819
|
});
|
|
3694
3820
|
}
|
|
3695
|
-
function
|
|
3821
|
+
function $i({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
|
|
3696
3822
|
let s = Array.isArray(n) ? n : [];
|
|
3697
3823
|
if (r === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3698
3824
|
style: {
|
|
@@ -3706,7 +3832,7 @@ function Vi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3706
3832
|
flexDirection: "column",
|
|
3707
3833
|
gap: 8
|
|
3708
3834
|
},
|
|
3709
|
-
children: s.map((e, n) => /* @__PURE__ */ v(
|
|
3835
|
+
children: s.map((e, n) => /* @__PURE__ */ v(Qi, {
|
|
3710
3836
|
structDef: t,
|
|
3711
3837
|
value: e,
|
|
3712
3838
|
mode: "display",
|
|
@@ -3732,7 +3858,7 @@ function Vi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3732
3858
|
role: "group",
|
|
3733
3859
|
children: [s.map((n, r) => /* @__PURE__ */ y("div", {
|
|
3734
3860
|
style: { position: "relative" },
|
|
3735
|
-
children: [/* @__PURE__ */ v(
|
|
3861
|
+
children: [/* @__PURE__ */ v(Qi, {
|
|
3736
3862
|
structDef: t,
|
|
3737
3863
|
value: n,
|
|
3738
3864
|
mode: "edit",
|
|
@@ -3760,16 +3886,16 @@ function Vi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3760
3886
|
}
|
|
3761
3887
|
//#endregion
|
|
3762
3888
|
//#region src/components/fields/SecretField.tsx
|
|
3763
|
-
var
|
|
3764
|
-
function
|
|
3765
|
-
let [s, c] = f(""), l = a !== void 0, u = n ===
|
|
3889
|
+
var ea = "[SET]";
|
|
3890
|
+
function ta({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3891
|
+
let [s, c] = f(""), l = a !== void 0, u = n === ea || typeof n == "string" && n !== "";
|
|
3766
3892
|
return r === "display" ? u ? /* @__PURE__ */ v("span", {
|
|
3767
3893
|
className: "mono",
|
|
3768
3894
|
style: {
|
|
3769
3895
|
fontSize: 12.5,
|
|
3770
3896
|
color: "var(--text-3)"
|
|
3771
3897
|
},
|
|
3772
|
-
children:
|
|
3898
|
+
children: ea
|
|
3773
3899
|
}) : /* @__PURE__ */ v("span", {
|
|
3774
3900
|
style: {
|
|
3775
3901
|
fontSize: 12.5,
|
|
@@ -3777,29 +3903,29 @@ function Ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3777
3903
|
fontStyle: "italic"
|
|
3778
3904
|
},
|
|
3779
3905
|
children: "Not set"
|
|
3780
|
-
}) : /* @__PURE__ */ v(
|
|
3906
|
+
}) : /* @__PURE__ */ v(Ae, {
|
|
3781
3907
|
id: o,
|
|
3782
3908
|
name: t,
|
|
3783
3909
|
ariaRequired: e.required,
|
|
3784
3910
|
value: s,
|
|
3785
3911
|
onChange: (e) => {
|
|
3786
|
-
c(e), l && e === "" ? i?.(u ?
|
|
3912
|
+
c(e), l && e === "" ? i?.(u ? ea : "") : i?.(e);
|
|
3787
3913
|
},
|
|
3788
3914
|
placeholder: l ? "Leave blank to keep existing value" : "Enter value"
|
|
3789
3915
|
});
|
|
3790
3916
|
}
|
|
3791
3917
|
//#endregion
|
|
3792
3918
|
//#region src/components/fields/PasswordField.tsx
|
|
3793
|
-
var
|
|
3794
|
-
function
|
|
3795
|
-
let [s, c] = f(""), l = a !== void 0, u = n ===
|
|
3919
|
+
var na = "[SET]";
|
|
3920
|
+
function ra({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3921
|
+
let [s, c] = f(""), l = a !== void 0, u = n === na || typeof n == "string" && n !== "";
|
|
3796
3922
|
return r === "display" ? u ? /* @__PURE__ */ v("span", {
|
|
3797
3923
|
className: "mono",
|
|
3798
3924
|
style: {
|
|
3799
3925
|
fontSize: 12.5,
|
|
3800
3926
|
color: "var(--text-3)"
|
|
3801
3927
|
},
|
|
3802
|
-
children:
|
|
3928
|
+
children: na
|
|
3803
3929
|
}) : /* @__PURE__ */ v("span", {
|
|
3804
3930
|
style: {
|
|
3805
3931
|
fontSize: 12.5,
|
|
@@ -3807,24 +3933,24 @@ function Gi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3807
3933
|
fontStyle: "italic"
|
|
3808
3934
|
},
|
|
3809
3935
|
children: "Not set"
|
|
3810
|
-
}) : /* @__PURE__ */ v(
|
|
3936
|
+
}) : /* @__PURE__ */ v(Ae, {
|
|
3811
3937
|
id: o,
|
|
3812
3938
|
name: t,
|
|
3813
3939
|
ariaRequired: e.required,
|
|
3814
3940
|
value: s,
|
|
3815
3941
|
onChange: (e) => {
|
|
3816
|
-
c(e), l && e === "" ? i?.(u ?
|
|
3942
|
+
c(e), l && e === "" ? i?.(u ? na : "") : i?.(e);
|
|
3817
3943
|
},
|
|
3818
3944
|
placeholder: l ? "Leave blank to keep existing value" : "Enter password"
|
|
3819
3945
|
});
|
|
3820
3946
|
}
|
|
3821
3947
|
//#endregion
|
|
3822
3948
|
//#region src/components/fields/StringArrayField.tsx
|
|
3823
|
-
function
|
|
3949
|
+
function ia(e) {
|
|
3824
3950
|
return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
|
|
3825
3951
|
}
|
|
3826
|
-
function
|
|
3827
|
-
let s =
|
|
3952
|
+
function aa({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
3953
|
+
let s = ia(r), [c, l] = f("");
|
|
3828
3954
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3829
3955
|
style: {
|
|
3830
3956
|
fontSize: 12.5,
|
|
@@ -3893,11 +4019,11 @@ function qi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3893
4019
|
}
|
|
3894
4020
|
//#endregion
|
|
3895
4021
|
//#region src/components/fields/IntArrayField.tsx
|
|
3896
|
-
function
|
|
4022
|
+
function oa(e) {
|
|
3897
4023
|
return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
|
|
3898
4024
|
}
|
|
3899
|
-
function
|
|
3900
|
-
let s =
|
|
4025
|
+
function sa({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
4026
|
+
let s = oa(r), [c, l] = f("");
|
|
3901
4027
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3902
4028
|
style: {
|
|
3903
4029
|
fontSize: 12.5,
|
|
@@ -3969,47 +4095,47 @@ function Yi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3969
4095
|
}
|
|
3970
4096
|
//#endregion
|
|
3971
4097
|
//#region src/lib/rich-text.ts
|
|
3972
|
-
var
|
|
3973
|
-
function
|
|
3974
|
-
return typeof e == "string" ? e :
|
|
4098
|
+
var ca = /declarion:\/\/file\/([0-9a-fA-F-]{36})/g;
|
|
4099
|
+
function la(e) {
|
|
4100
|
+
return typeof e == "string" ? e : _a(e) && typeof e.markdown == "string" ? e.markdown : "";
|
|
3975
4101
|
}
|
|
3976
|
-
function
|
|
4102
|
+
function ua(e, t) {
|
|
3977
4103
|
return {
|
|
3978
|
-
markdown:
|
|
3979
|
-
files:
|
|
4104
|
+
markdown: la(e),
|
|
4105
|
+
files: pa(t)
|
|
3980
4106
|
};
|
|
3981
4107
|
}
|
|
3982
|
-
function
|
|
3983
|
-
let n =
|
|
4108
|
+
function da(e, t) {
|
|
4109
|
+
let n = ua(e, null);
|
|
3984
4110
|
return n.files[t.id] = t, n;
|
|
3985
4111
|
}
|
|
3986
|
-
function
|
|
3987
|
-
let n =
|
|
4112
|
+
function fa(e, t) {
|
|
4113
|
+
let n = ua(e, null);
|
|
3988
4114
|
for (let e of t) delete n.files[e];
|
|
3989
4115
|
return n;
|
|
3990
4116
|
}
|
|
3991
|
-
function
|
|
4117
|
+
function pa(e) {
|
|
3992
4118
|
if (!Array.isArray(e)) return {};
|
|
3993
4119
|
let t = {};
|
|
3994
|
-
for (let n of e)
|
|
4120
|
+
for (let n of e) _a(n) && typeof n.id == "string" && (t[n.id] = n);
|
|
3995
4121
|
return t;
|
|
3996
4122
|
}
|
|
3997
|
-
function
|
|
4123
|
+
function ma(e) {
|
|
3998
4124
|
let t = /* @__PURE__ */ new Set(), n = [], r;
|
|
3999
|
-
for (
|
|
4125
|
+
for (ca.lastIndex = 0; (r = ca.exec(e)) !== null;) {
|
|
4000
4126
|
let e = r[1];
|
|
4001
4127
|
t.has(e) || (t.add(e), n.push(e));
|
|
4002
4128
|
}
|
|
4003
4129
|
return n;
|
|
4004
4130
|
}
|
|
4005
|
-
function
|
|
4131
|
+
function ha(e) {
|
|
4006
4132
|
return e ? /^declarion:\/\/file\/([0-9a-fA-F-]{36})$/.exec(e)?.[1] ?? null : null;
|
|
4007
4133
|
}
|
|
4008
|
-
function
|
|
4134
|
+
function ga(e) {
|
|
4009
4135
|
let t = `declarion://file/${e.id}`;
|
|
4010
4136
|
return e.content_type.startsWith("image/") ? `` : `[${e.filename || e.id}](${t})`;
|
|
4011
4137
|
}
|
|
4012
|
-
function
|
|
4138
|
+
function _a(e) {
|
|
4013
4139
|
return typeof e == "object" && !!e;
|
|
4014
4140
|
}
|
|
4015
4141
|
//#endregion
|
|
@@ -4021,30 +4147,30 @@ var Q = class extends Error {
|
|
|
4021
4147
|
super(n), this.code = t, this.status = e;
|
|
4022
4148
|
}
|
|
4023
4149
|
};
|
|
4024
|
-
async function
|
|
4025
|
-
let t =
|
|
4150
|
+
async function va(e) {
|
|
4151
|
+
let t = bt();
|
|
4026
4152
|
try {
|
|
4027
|
-
return await
|
|
4153
|
+
return await ya(e, t ? await Et() : null);
|
|
4028
4154
|
} catch (n) {
|
|
4029
4155
|
if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
|
|
4030
4156
|
let r = null;
|
|
4031
4157
|
try {
|
|
4032
|
-
t ? (
|
|
4158
|
+
t ? (Tt(), r = await Et()) : await dn();
|
|
4033
4159
|
} catch {
|
|
4034
|
-
throw
|
|
4160
|
+
throw pn()(), n;
|
|
4035
4161
|
}
|
|
4036
4162
|
try {
|
|
4037
|
-
return await
|
|
4163
|
+
return await ya(e, r);
|
|
4038
4164
|
} catch (e) {
|
|
4039
|
-
throw e instanceof Q && e.status === 401 &&
|
|
4165
|
+
throw e instanceof Q && e.status === 401 && pn()(), e;
|
|
4040
4166
|
}
|
|
4041
4167
|
}
|
|
4042
4168
|
}
|
|
4043
|
-
function
|
|
4169
|
+
function ya(e, t) {
|
|
4044
4170
|
let { file: n, entityCode: r, fieldCode: i, slotCode: a, onProgress: o, signal: s } = e;
|
|
4045
4171
|
return new Promise((e, c) => {
|
|
4046
4172
|
let l = new XMLHttpRequest();
|
|
4047
|
-
if (l.open("POST",
|
|
4173
|
+
if (l.open("POST", ba(r, i, a)), l.withCredentials = t === null, t && l.setRequestHeader("Authorization", `Bearer ${t}`), l.upload.onprogress = (e) => {
|
|
4048
4174
|
if (!o) return;
|
|
4049
4175
|
let t = e.lengthComputable ? e.total : n.size, r = t > 0 ? Math.min(100, Math.round(e.loaded / t * 100)) : 0;
|
|
4050
4176
|
o({
|
|
@@ -4058,7 +4184,7 @@ function sa(e, t) {
|
|
|
4058
4184
|
n = t ? JSON.parse(t) : null;
|
|
4059
4185
|
} catch {}
|
|
4060
4186
|
if (l.status >= 200 && l.status < 300) {
|
|
4061
|
-
let t =
|
|
4187
|
+
let t = xa(n);
|
|
4062
4188
|
if (!t || !t.id) {
|
|
4063
4189
|
c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
|
|
4064
4190
|
return;
|
|
@@ -4083,56 +4209,56 @@ function sa(e, t) {
|
|
|
4083
4209
|
u.append("file", n, n.name), l.send(u);
|
|
4084
4210
|
});
|
|
4085
4211
|
}
|
|
4086
|
-
function
|
|
4212
|
+
function ba(e, t, n) {
|
|
4087
4213
|
let r = new URLSearchParams();
|
|
4088
4214
|
e && t && (r.set("entity_code", e), r.set("field_code", t), n && r.set("slot_code", n));
|
|
4089
4215
|
let i = r.toString();
|
|
4090
4216
|
return i ? `/api/files/upload?${i}` : "/api/files/upload";
|
|
4091
4217
|
}
|
|
4092
|
-
function
|
|
4093
|
-
return
|
|
4218
|
+
function xa(e) {
|
|
4219
|
+
return Ca(e) ? Ca(e.result) ? xa(e.result) : Ca(e.file) ? Sa(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4094
4220
|
}
|
|
4095
|
-
function
|
|
4096
|
-
let t =
|
|
4221
|
+
function Sa(e) {
|
|
4222
|
+
let t = wa(e.file_id);
|
|
4097
4223
|
return t ? {
|
|
4098
4224
|
id: t,
|
|
4099
|
-
filename:
|
|
4100
|
-
content_type:
|
|
4101
|
-
size_bytes:
|
|
4102
|
-
sha256:
|
|
4103
|
-
dedup:
|
|
4225
|
+
filename: wa(e.filename_original) ?? wa(e.filename_normalized) ?? t,
|
|
4226
|
+
content_type: wa(e.content_type) ?? "application/octet-stream",
|
|
4227
|
+
size_bytes: Ta(e.size_bytes) ?? 0,
|
|
4228
|
+
sha256: wa(e.sha256) ?? "",
|
|
4229
|
+
dedup: Ea(e.dedup)
|
|
4104
4230
|
} : null;
|
|
4105
4231
|
}
|
|
4106
|
-
function
|
|
4232
|
+
function Ca(e) {
|
|
4107
4233
|
return typeof e == "object" && !!e;
|
|
4108
4234
|
}
|
|
4109
|
-
function
|
|
4235
|
+
function wa(e) {
|
|
4110
4236
|
return typeof e == "string" ? e : void 0;
|
|
4111
4237
|
}
|
|
4112
|
-
function
|
|
4238
|
+
function Ta(e) {
|
|
4113
4239
|
return typeof e == "number" ? e : void 0;
|
|
4114
4240
|
}
|
|
4115
|
-
function
|
|
4241
|
+
function Ea(e) {
|
|
4116
4242
|
return typeof e == "boolean" ? e : void 0;
|
|
4117
4243
|
}
|
|
4118
|
-
async function
|
|
4244
|
+
async function Da(e) {
|
|
4119
4245
|
await q("files.discard", { file_id: e });
|
|
4120
4246
|
}
|
|
4121
|
-
function
|
|
4247
|
+
function Oa(e, t, n) {
|
|
4122
4248
|
if (n && e.size > n) return {
|
|
4123
4249
|
code: "FILE_TOO_LARGE",
|
|
4124
|
-
message: `File is ${
|
|
4250
|
+
message: `File is ${Aa(e.size)}, max ${Aa(n)}`
|
|
4125
4251
|
};
|
|
4126
4252
|
if (t && t.length > 0) {
|
|
4127
4253
|
let n = e.type || "application/octet-stream";
|
|
4128
|
-
if (!t.some((e) =>
|
|
4254
|
+
if (!t.some((e) => ka(e, n))) return {
|
|
4129
4255
|
code: "MIME_NOT_ACCEPTED",
|
|
4130
4256
|
message: `File type ${n} is not accepted`
|
|
4131
4257
|
};
|
|
4132
4258
|
}
|
|
4133
4259
|
return null;
|
|
4134
4260
|
}
|
|
4135
|
-
function
|
|
4261
|
+
function ka(e, t) {
|
|
4136
4262
|
if (e === "*/*" || e === "*") return !0;
|
|
4137
4263
|
if (e.endsWith("/*")) {
|
|
4138
4264
|
let n = e.slice(0, e.length - 1);
|
|
@@ -4140,7 +4266,7 @@ function _a(e, t) {
|
|
|
4140
4266
|
}
|
|
4141
4267
|
return e === t;
|
|
4142
4268
|
}
|
|
4143
|
-
function
|
|
4269
|
+
function Aa(e) {
|
|
4144
4270
|
if (e < 1024) return `${e} B`;
|
|
4145
4271
|
let t = [
|
|
4146
4272
|
"KB",
|
|
@@ -4152,7 +4278,7 @@ function va(e) {
|
|
|
4152
4278
|
}
|
|
4153
4279
|
//#endregion
|
|
4154
4280
|
//#region src/components/file-widgets/draft-scope.tsx
|
|
4155
|
-
var
|
|
4281
|
+
var ja = r({
|
|
4156
4282
|
registerDraft() {},
|
|
4157
4283
|
unregisterDraft() {},
|
|
4158
4284
|
hasDraft() {
|
|
@@ -4161,7 +4287,7 @@ var ya = r({
|
|
|
4161
4287
|
flushAllDrafts: async () => {},
|
|
4162
4288
|
markCommitted() {}
|
|
4163
4289
|
});
|
|
4164
|
-
function
|
|
4290
|
+
function Ma({ children: e }) {
|
|
4165
4291
|
let t = d(/* @__PURE__ */ new Map()), n = u(() => ({
|
|
4166
4292
|
registerDraft(e) {
|
|
4167
4293
|
t.current.set(e.fileId, e);
|
|
@@ -4180,16 +4306,16 @@ function ba({ children: e }) {
|
|
|
4180
4306
|
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
4181
4307
|
}
|
|
4182
4308
|
}), []);
|
|
4183
|
-
return /* @__PURE__ */ v(
|
|
4309
|
+
return /* @__PURE__ */ v(ja.Provider, {
|
|
4184
4310
|
value: n,
|
|
4185
4311
|
children: e
|
|
4186
4312
|
});
|
|
4187
4313
|
}
|
|
4188
|
-
function
|
|
4189
|
-
return s(
|
|
4314
|
+
function Na() {
|
|
4315
|
+
return s(ja);
|
|
4190
4316
|
}
|
|
4191
|
-
function
|
|
4192
|
-
let e =
|
|
4317
|
+
function Pa() {
|
|
4318
|
+
let e = Na();
|
|
4193
4319
|
return {
|
|
4194
4320
|
register: o((t, n) => {
|
|
4195
4321
|
e.registerDraft({
|
|
@@ -4208,17 +4334,17 @@ function Sa() {
|
|
|
4208
4334
|
}
|
|
4209
4335
|
//#endregion
|
|
4210
4336
|
//#region src/components/fields/RichTextField.tsx
|
|
4211
|
-
function
|
|
4212
|
-
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: p } = t, m = d(null), h = d(null), g = d(/* @__PURE__ */ new Map()), _ = d(/* @__PURE__ */ new Set()), [b, x] = f(0), [S, C] = f(null), { register: w, unregister: E } =
|
|
4213
|
-
let n = new Set(
|
|
4337
|
+
function Fa(t) {
|
|
4338
|
+
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: p } = t, m = d(null), h = d(null), g = d(/* @__PURE__ */ new Map()), _ = d(/* @__PURE__ */ new Set()), [b, x] = f(0), [S, C] = f(null), { register: w, unregister: E } = Pa(), D = c?.$files?.[i], O = u(() => ua(a, D), [D, a]), k = O.markdown, A = n.files?.accepts, ee = n.files?.max_size_bytes, j = (e, t = O.files) => {
|
|
4339
|
+
let n = new Set(ma(e)), r = [];
|
|
4214
4340
|
for (let e of _.current) n.has(e) || r.push(e);
|
|
4215
4341
|
if (r.length > 0) {
|
|
4216
4342
|
for (let e of r) {
|
|
4217
|
-
_.current.delete(e), E(e),
|
|
4343
|
+
_.current.delete(e), E(e), Da(e).catch(() => {});
|
|
4218
4344
|
let t = g.current.get(e);
|
|
4219
4345
|
t && (URL.revokeObjectURL(t), g.current.delete(e));
|
|
4220
4346
|
}
|
|
4221
|
-
s?.(
|
|
4347
|
+
s?.(fa({
|
|
4222
4348
|
markdown: e,
|
|
4223
4349
|
files: t
|
|
4224
4350
|
}, r));
|
|
@@ -4228,14 +4354,14 @@ function Ca(t) {
|
|
|
4228
4354
|
markdown: e,
|
|
4229
4355
|
files: t
|
|
4230
4356
|
});
|
|
4231
|
-
},
|
|
4357
|
+
}, te = (e, t, n) => {
|
|
4232
4358
|
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length;
|
|
4233
|
-
|
|
4359
|
+
j(`${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, n ? da(e, n).files : e.files), requestAnimationFrame(() => {
|
|
4234
4360
|
if (!r) return;
|
|
4235
4361
|
let e = i + t.length;
|
|
4236
4362
|
r.focus(), r.setSelectionRange(e, e);
|
|
4237
4363
|
});
|
|
4238
|
-
},
|
|
4364
|
+
}, ne = async (e) => {
|
|
4239
4365
|
if (!r || !n.files) return;
|
|
4240
4366
|
let t = Array.from(e);
|
|
4241
4367
|
if (t.length === 0) return;
|
|
@@ -4245,31 +4371,31 @@ function Ca(t) {
|
|
|
4245
4371
|
files: O.files
|
|
4246
4372
|
};
|
|
4247
4373
|
for (let e of t) {
|
|
4248
|
-
let n =
|
|
4374
|
+
let n = Oa(e, A, ee);
|
|
4249
4375
|
if (n) {
|
|
4250
4376
|
C(n.message), x((e) => e - 1);
|
|
4251
4377
|
continue;
|
|
4252
4378
|
}
|
|
4253
4379
|
try {
|
|
4254
|
-
let n = await
|
|
4380
|
+
let n = await va({
|
|
4255
4381
|
file: e,
|
|
4256
4382
|
entityCode: r,
|
|
4257
4383
|
fieldCode: i
|
|
4258
4384
|
}), o = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
|
|
4259
4385
|
o && g.current.set(n.id, o);
|
|
4260
|
-
let s =
|
|
4261
|
-
if (w(n.id, () =>
|
|
4262
|
-
let e =
|
|
4263
|
-
|
|
4386
|
+
let s = La(n, o);
|
|
4387
|
+
if (w(n.id, () => Da(n.id)), _.current.add(n.id), t.length === 1) {
|
|
4388
|
+
let e = Ia(a.markdown, ga(s));
|
|
4389
|
+
te(a, e, s), a = da({
|
|
4264
4390
|
markdown: `${a.markdown}${e}`,
|
|
4265
4391
|
files: a.files
|
|
4266
4392
|
}, s);
|
|
4267
4393
|
} else {
|
|
4268
|
-
let e =
|
|
4269
|
-
a =
|
|
4394
|
+
let e = Ia(a.markdown, ga(s));
|
|
4395
|
+
a = da({
|
|
4270
4396
|
markdown: `${a.markdown}${e}`,
|
|
4271
4397
|
files: a.files
|
|
4272
|
-
}, s),
|
|
4398
|
+
}, s), j(a.markdown, a.files);
|
|
4273
4399
|
}
|
|
4274
4400
|
} catch (e) {
|
|
4275
4401
|
C(e instanceof Q ? e.message : "Upload failed");
|
|
@@ -4278,7 +4404,7 @@ function Ca(t) {
|
|
|
4278
4404
|
}
|
|
4279
4405
|
}
|
|
4280
4406
|
};
|
|
4281
|
-
return o === "display" ? k ? /* @__PURE__ */ v(
|
|
4407
|
+
return o === "display" ? k ? /* @__PURE__ */ v(li, {
|
|
4282
4408
|
content: k,
|
|
4283
4409
|
files: O.files
|
|
4284
4410
|
}) : /* @__PURE__ */ v("span", {
|
|
@@ -4292,7 +4418,7 @@ function Ca(t) {
|
|
|
4292
4418
|
name: i,
|
|
4293
4419
|
"aria-required": n.required || void 0,
|
|
4294
4420
|
value: k,
|
|
4295
|
-
onChange: (e) =>
|
|
4421
|
+
onChange: (e) => j(e)
|
|
4296
4422
|
}) : /* @__PURE__ */ y("div", {
|
|
4297
4423
|
style: {
|
|
4298
4424
|
display: "flex",
|
|
@@ -4311,7 +4437,7 @@ function Ca(t) {
|
|
|
4311
4437
|
/* @__PURE__ */ v(T, {
|
|
4312
4438
|
kind: "ghost",
|
|
4313
4439
|
size: "xs",
|
|
4314
|
-
icon: v(b > 0 ?
|
|
4440
|
+
icon: v(b > 0 ? ye : e.plus, { size: 12 }),
|
|
4315
4441
|
onClick: () => h.current?.click(),
|
|
4316
4442
|
disabled: !r || !n.files || b > 0,
|
|
4317
4443
|
children: b > 0 ? "Uploading…" : "Insert file"
|
|
@@ -4336,10 +4462,10 @@ function Ca(t) {
|
|
|
4336
4462
|
ref: h,
|
|
4337
4463
|
type: "file",
|
|
4338
4464
|
hidden: !0,
|
|
4339
|
-
accept:
|
|
4465
|
+
accept: A?.join(","),
|
|
4340
4466
|
multiple: !0,
|
|
4341
4467
|
onChange: (e) => {
|
|
4342
|
-
e.target.files &&
|
|
4468
|
+
e.target.files && ne(e.target.files), e.target.value = "";
|
|
4343
4469
|
}
|
|
4344
4470
|
}),
|
|
4345
4471
|
/* @__PURE__ */ v("textarea", {
|
|
@@ -4348,14 +4474,14 @@ function Ca(t) {
|
|
|
4348
4474
|
name: i,
|
|
4349
4475
|
"aria-required": n.required || void 0,
|
|
4350
4476
|
value: k,
|
|
4351
|
-
onChange: (e) =>
|
|
4477
|
+
onChange: (e) => j(e.target.value),
|
|
4352
4478
|
onPaste: (e) => {
|
|
4353
4479
|
let t = Array.from(e.clipboardData.files ?? []).filter((e) => e.size > 0);
|
|
4354
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4480
|
+
t.length !== 0 && (e.preventDefault(), ne(t));
|
|
4355
4481
|
},
|
|
4356
4482
|
onDrop: (e) => {
|
|
4357
4483
|
let t = Array.from(e.dataTransfer.files ?? []).filter((e) => e.size > 0);
|
|
4358
|
-
t.length !== 0 && (e.preventDefault(),
|
|
4484
|
+
t.length !== 0 && (e.preventDefault(), ne(t));
|
|
4359
4485
|
},
|
|
4360
4486
|
onDragOver: (e) => e.preventDefault(),
|
|
4361
4487
|
rows: 12,
|
|
@@ -4365,6 +4491,7 @@ function Ca(t) {
|
|
|
4365
4491
|
border: "1px solid var(--border)",
|
|
4366
4492
|
borderRadius: 8,
|
|
4367
4493
|
padding: "10px 12px",
|
|
4494
|
+
fontSize: "var(--control-font-size)",
|
|
4368
4495
|
lineHeight: 1.5,
|
|
4369
4496
|
fontFamily: "inherit",
|
|
4370
4497
|
resize: "vertical",
|
|
@@ -4393,7 +4520,7 @@ function Ca(t) {
|
|
|
4393
4520
|
marginBottom: 8
|
|
4394
4521
|
},
|
|
4395
4522
|
children: "Preview"
|
|
4396
|
-
}), k ? /* @__PURE__ */ v(
|
|
4523
|
+
}), k ? /* @__PURE__ */ v(li, {
|
|
4397
4524
|
content: k,
|
|
4398
4525
|
files: O.files
|
|
4399
4526
|
}) : /* @__PURE__ */ v("span", {
|
|
@@ -4407,10 +4534,10 @@ function Ca(t) {
|
|
|
4407
4534
|
]
|
|
4408
4535
|
});
|
|
4409
4536
|
}
|
|
4410
|
-
function
|
|
4537
|
+
function Ia(e, t) {
|
|
4411
4538
|
return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
|
|
4412
4539
|
}
|
|
4413
|
-
function
|
|
4540
|
+
function La(e, t) {
|
|
4414
4541
|
return {
|
|
4415
4542
|
id: e.id,
|
|
4416
4543
|
filename: e.filename,
|
|
@@ -4425,8 +4552,8 @@ function Ta(e, t) {
|
|
|
4425
4552
|
}
|
|
4426
4553
|
//#endregion
|
|
4427
4554
|
//#region src/components/fields/cells/factories/text.ts
|
|
4428
|
-
var
|
|
4429
|
-
let { field: t, fieldName: n, locale: r = "en" } = e, i =
|
|
4555
|
+
var Ra = () => (e) => e == null || e === "" ? "—" : F(e), za = (e) => {
|
|
4556
|
+
let { field: t, fieldName: n, locale: r = "en" } = e, i = Ba(t, n, r);
|
|
4430
4557
|
return (e) => {
|
|
4431
4558
|
if (e == null) return "—";
|
|
4432
4559
|
let t = !!e;
|
|
@@ -4437,7 +4564,7 @@ var Ea = () => (e) => e == null || e === "" ? "—" : F(e), Da = (e) => {
|
|
|
4437
4564
|
});
|
|
4438
4565
|
};
|
|
4439
4566
|
};
|
|
4440
|
-
function
|
|
4567
|
+
function Ba(e, t, n) {
|
|
4441
4568
|
if (e.display?.bool_labels) return {
|
|
4442
4569
|
trueLabel: I(e.display.bool_labels.true, n) || "Yes",
|
|
4443
4570
|
falseLabel: I(e.display.bool_labels.false, n) || "No"
|
|
@@ -4458,14 +4585,14 @@ function Oa(e, t, n) {
|
|
|
4458
4585
|
};
|
|
4459
4586
|
}
|
|
4460
4587
|
if (t.startsWith("is_")) {
|
|
4461
|
-
let e =
|
|
4588
|
+
let e = Va(t.slice(3));
|
|
4462
4589
|
return {
|
|
4463
4590
|
trueLabel: e,
|
|
4464
4591
|
falseLabel: `Not ${e}`
|
|
4465
4592
|
};
|
|
4466
4593
|
}
|
|
4467
4594
|
if (t.startsWith("has_")) {
|
|
4468
|
-
let e =
|
|
4595
|
+
let e = Va(t.slice(4));
|
|
4469
4596
|
return {
|
|
4470
4597
|
trueLabel: e,
|
|
4471
4598
|
falseLabel: `No ${e}`
|
|
@@ -4476,12 +4603,12 @@ function Oa(e, t, n) {
|
|
|
4476
4603
|
falseLabel: "No"
|
|
4477
4604
|
};
|
|
4478
4605
|
}
|
|
4479
|
-
function
|
|
4606
|
+
function Va(e) {
|
|
4480
4607
|
return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
|
|
4481
4608
|
}
|
|
4482
4609
|
//#endregion
|
|
4483
4610
|
//#region src/components/fields/cells/factories/badge.tsx
|
|
4484
|
-
var
|
|
4611
|
+
var Ha = /* @__PURE__ */ new Set([
|
|
4485
4612
|
"indigo",
|
|
4486
4613
|
"emerald",
|
|
4487
4614
|
"amber",
|
|
@@ -4491,17 +4618,17 @@ var Aa = /* @__PURE__ */ new Set([
|
|
|
4491
4618
|
"slate",
|
|
4492
4619
|
"teal"
|
|
4493
4620
|
]);
|
|
4494
|
-
function
|
|
4495
|
-
return e &&
|
|
4621
|
+
function Ua(e) {
|
|
4622
|
+
return e && Ha.has(e) ? e : "slate";
|
|
4496
4623
|
}
|
|
4497
|
-
var
|
|
4624
|
+
var Wa = (e) => {
|
|
4498
4625
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4499
4626
|
if (t.values) for (let e of t.values) r.set(e.code, {
|
|
4500
|
-
tone:
|
|
4627
|
+
tone: Ua(e.color),
|
|
4501
4628
|
label: I(e.name, n) || e.code
|
|
4502
4629
|
});
|
|
4503
4630
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
|
|
4504
|
-
let t = r.get(e), a = i.color ?
|
|
4631
|
+
let t = r.get(e), a = i.color ? Ua(i.color) : t?.tone ?? "slate", o = (i.label ? I(i.label, n) : "") || t?.label || e;
|
|
4505
4632
|
r.set(e, {
|
|
4506
4633
|
tone: a,
|
|
4507
4634
|
label: o
|
|
@@ -4516,7 +4643,7 @@ var Ma = (e) => {
|
|
|
4516
4643
|
children: n?.label ?? t
|
|
4517
4644
|
});
|
|
4518
4645
|
};
|
|
4519
|
-
},
|
|
4646
|
+
}, Ga = /* @__PURE__ */ new Set([
|
|
4520
4647
|
"indigo",
|
|
4521
4648
|
"emerald",
|
|
4522
4649
|
"amber",
|
|
@@ -4526,13 +4653,13 @@ var Ma = (e) => {
|
|
|
4526
4653
|
"slate",
|
|
4527
4654
|
"teal"
|
|
4528
4655
|
]);
|
|
4529
|
-
function
|
|
4530
|
-
return e &&
|
|
4656
|
+
function Ka(e) {
|
|
4657
|
+
return e && Ga.has(e) ? e : "slate";
|
|
4531
4658
|
}
|
|
4532
|
-
var
|
|
4659
|
+
var qa = (e) => {
|
|
4533
4660
|
let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4534
4661
|
if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
|
|
4535
|
-
tone:
|
|
4662
|
+
tone: Ka(t.color),
|
|
4536
4663
|
label: I(t.name, n) || t.code
|
|
4537
4664
|
});
|
|
4538
4665
|
return (e) => {
|
|
@@ -4544,7 +4671,7 @@ var Fa = (e) => {
|
|
|
4544
4671
|
children: n?.label ?? t
|
|
4545
4672
|
});
|
|
4546
4673
|
};
|
|
4547
|
-
},
|
|
4674
|
+
}, Ja = /* @__PURE__ */ new Set([
|
|
4548
4675
|
"indigo",
|
|
4549
4676
|
"emerald",
|
|
4550
4677
|
"amber",
|
|
@@ -4554,14 +4681,14 @@ var Fa = (e) => {
|
|
|
4554
4681
|
"slate",
|
|
4555
4682
|
"teal"
|
|
4556
4683
|
]);
|
|
4557
|
-
function
|
|
4558
|
-
return e &&
|
|
4684
|
+
function Ya(e) {
|
|
4685
|
+
return e && Ja.has(e) ? e : null;
|
|
4559
4686
|
}
|
|
4560
|
-
var
|
|
4687
|
+
var Xa = (e) => {
|
|
4561
4688
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4562
4689
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
|
|
4563
4690
|
label: i.label && I(i.label, n) || e,
|
|
4564
|
-
tone:
|
|
4691
|
+
tone: Ya(i.color)
|
|
4565
4692
|
});
|
|
4566
4693
|
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ v("span", {
|
|
4567
4694
|
style: {
|
|
@@ -4578,23 +4705,23 @@ var Ra = (e) => {
|
|
|
4578
4705
|
}, `${n}-${t}`) : /* @__PURE__ */ v(M, { children: i?.label ?? n }, `${n}-${t}`);
|
|
4579
4706
|
})
|
|
4580
4707
|
});
|
|
4581
|
-
},
|
|
4708
|
+
}, Za = () => (e) => {
|
|
4582
4709
|
if (e == null || e === "") return "—";
|
|
4583
|
-
let { text: t, absolute: n } =
|
|
4710
|
+
let { text: t, absolute: n } = Si(typeof e == "string" ? e : F(e));
|
|
4584
4711
|
return /* @__PURE__ */ v("span", {
|
|
4585
4712
|
title: n,
|
|
4586
4713
|
children: t
|
|
4587
4714
|
});
|
|
4588
|
-
},
|
|
4715
|
+
}, Qa = () => (e) => e == null || e === "" ? "—" : xi(typeof e == "string" ? e : F(e)), $a = 60 * 1e3, eo = 300 * 1e3, to = () => (e) => {
|
|
4589
4716
|
if (e == null || e === "") return "—";
|
|
4590
4717
|
let t = typeof e == "string" ? e : F(e), n = new Date(t);
|
|
4591
4718
|
if (isNaN(n.getTime())) return t;
|
|
4592
|
-
let r =
|
|
4719
|
+
let r = xi(t), i = Date.now() - n.getTime();
|
|
4593
4720
|
if (i <= 0) return /* @__PURE__ */ y("span", {
|
|
4594
4721
|
title: r,
|
|
4595
4722
|
children: ["in ", S(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
|
|
4596
4723
|
});
|
|
4597
|
-
if (i <=
|
|
4724
|
+
if (i <= $a) return /* @__PURE__ */ v("span", {
|
|
4598
4725
|
title: r,
|
|
4599
4726
|
children: /* @__PURE__ */ v(D, {
|
|
4600
4727
|
tone: "slate",
|
|
@@ -4606,13 +4733,13 @@ var Ra = (e) => {
|
|
|
4606
4733
|
return /* @__PURE__ */ v("span", {
|
|
4607
4734
|
title: r,
|
|
4608
4735
|
children: /* @__PURE__ */ y(D, {
|
|
4609
|
-
tone: i <=
|
|
4736
|
+
tone: i <= eo ? "amber" : "rose",
|
|
4610
4737
|
size: "xs",
|
|
4611
4738
|
children: ["overdue ", a]
|
|
4612
4739
|
})
|
|
4613
4740
|
});
|
|
4614
|
-
},
|
|
4615
|
-
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a =
|
|
4741
|
+
}, no = (e) => {
|
|
4742
|
+
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = ro(t.display?.currency_display), o = io(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
|
|
4616
4743
|
return (e, t = {}) => {
|
|
4617
4744
|
if (e == null || e === "") return "—";
|
|
4618
4745
|
let c = typeof e == "number" ? e : Number(e);
|
|
@@ -4627,7 +4754,7 @@ var Ra = (e) => {
|
|
|
4627
4754
|
}), s.set(d, f)), f.format(c);
|
|
4628
4755
|
};
|
|
4629
4756
|
};
|
|
4630
|
-
function
|
|
4757
|
+
function ro(e) {
|
|
4631
4758
|
switch (e) {
|
|
4632
4759
|
case "narrow_symbol": return "narrowSymbol";
|
|
4633
4760
|
case "code":
|
|
@@ -4636,16 +4763,16 @@ function Ga(e) {
|
|
|
4636
4763
|
default: return "symbol";
|
|
4637
4764
|
}
|
|
4638
4765
|
}
|
|
4639
|
-
function
|
|
4766
|
+
function io(e, t, n) {
|
|
4640
4767
|
return e < t ? t : e > n ? n : e;
|
|
4641
4768
|
}
|
|
4642
4769
|
//#endregion
|
|
4643
4770
|
//#region src/components/fields/cells/factories/refLink.tsx
|
|
4644
|
-
var
|
|
4771
|
+
var ao = (e) => {
|
|
4645
4772
|
let { field: n, entities: r, screens: i, refs: a, surface: o } = e, s = n.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = n.display?.ref_display_field ?? n.ref?.display?.field ?? c?.display?.display_field, p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
|
|
4646
4773
|
return (e, n) => {
|
|
4647
4774
|
if (e == null || e === "") return "—";
|
|
4648
|
-
let r = F(e), i =
|
|
4775
|
+
let r = F(e), i = oo(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
|
|
4649
4776
|
if (u) {
|
|
4650
4777
|
let e = /* @__PURE__ */ y(_, { children: [d && /* @__PURE__ */ v("span", {
|
|
4651
4778
|
style: {
|
|
@@ -4687,29 +4814,29 @@ var qa = (e) => {
|
|
|
4687
4814
|
}) : i;
|
|
4688
4815
|
};
|
|
4689
4816
|
};
|
|
4690
|
-
function
|
|
4817
|
+
function oo(e, t, n, r) {
|
|
4691
4818
|
let i = t && n ? n[t]?.[e] : void 0;
|
|
4692
4819
|
return i ? L(i, r, e) : e;
|
|
4693
4820
|
}
|
|
4694
4821
|
//#endregion
|
|
4695
4822
|
//#region src/components/fields/cells/factories/url-helpers.ts
|
|
4696
|
-
var
|
|
4697
|
-
function
|
|
4698
|
-
return /^[a-z]{2,3}$/i.test(e) ||
|
|
4823
|
+
var so = /^(https?|ftps?|ssh|mailto|tel):/i, co = /^(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;
|
|
4824
|
+
function lo(e) {
|
|
4825
|
+
return /^[a-z]{2,3}$/i.test(e) || co.test(e);
|
|
4699
4826
|
}
|
|
4700
|
-
function
|
|
4827
|
+
function uo(e) {
|
|
4701
4828
|
if (!e.includes(".")) return !1;
|
|
4702
4829
|
let t = e.split(".");
|
|
4703
4830
|
if (t.length < 3) return !0;
|
|
4704
4831
|
let n = t[0].toLowerCase();
|
|
4705
|
-
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ?
|
|
4832
|
+
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? lo(t[t.length - 1]) : !0;
|
|
4706
4833
|
}
|
|
4707
|
-
function
|
|
4708
|
-
if (
|
|
4834
|
+
function fo(e) {
|
|
4835
|
+
if (so.test(e)) return e;
|
|
4709
4836
|
let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
|
|
4710
4837
|
if (t) {
|
|
4711
4838
|
let n = t[1], r = e.slice(t[0].length);
|
|
4712
|
-
if (/^\d+([/?#]|$)/.test(r) &&
|
|
4839
|
+
if (/^\d+([/?#]|$)/.test(r) && uo(n)) {
|
|
4713
4840
|
let t = parseInt(r, 10);
|
|
4714
4841
|
if (t >= 1 && t <= 65535) return `https://${e}`;
|
|
4715
4842
|
}
|
|
@@ -4717,14 +4844,14 @@ function $a(e) {
|
|
|
4717
4844
|
}
|
|
4718
4845
|
return `https://${e}`;
|
|
4719
4846
|
}
|
|
4720
|
-
function
|
|
4847
|
+
function po(e) {
|
|
4721
4848
|
try {
|
|
4722
4849
|
return new URL(e).hostname.replace(/^www\./i, "") || null;
|
|
4723
4850
|
} catch {
|
|
4724
4851
|
return null;
|
|
4725
4852
|
}
|
|
4726
4853
|
}
|
|
4727
|
-
function
|
|
4854
|
+
function mo(e, t) {
|
|
4728
4855
|
if (t !== "linkedin.com") return null;
|
|
4729
4856
|
try {
|
|
4730
4857
|
let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
|
|
@@ -4732,7 +4859,7 @@ function to(e, t) {
|
|
|
4732
4859
|
} catch {}
|
|
4733
4860
|
return null;
|
|
4734
4861
|
}
|
|
4735
|
-
function
|
|
4862
|
+
function ho(e) {
|
|
4736
4863
|
try {
|
|
4737
4864
|
return new URL(e), !0;
|
|
4738
4865
|
} catch {
|
|
@@ -4741,7 +4868,7 @@ function no(e) {
|
|
|
4741
4868
|
}
|
|
4742
4869
|
//#endregion
|
|
4743
4870
|
//#region src/components/fields/cells/factories/host-icons.tsx
|
|
4744
|
-
function
|
|
4871
|
+
function go(e, t = "0 0 24 24") {
|
|
4745
4872
|
return (n) => /* @__PURE__ */ v("svg", {
|
|
4746
4873
|
width: 16,
|
|
4747
4874
|
height: 16,
|
|
@@ -4757,11 +4884,11 @@ function ro(e, t = "0 0 24 24") {
|
|
|
4757
4884
|
children: e
|
|
4758
4885
|
});
|
|
4759
4886
|
}
|
|
4760
|
-
var
|
|
4887
|
+
var _o = go(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
4761
4888
|
cx: "12",
|
|
4762
4889
|
cy: "12",
|
|
4763
4890
|
r: "9"
|
|
4764
|
-
}), /* @__PURE__ */ v("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })),
|
|
4891
|
+
}), /* @__PURE__ */ v("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), vo = (e) => /* @__PURE__ */ v("svg", {
|
|
4765
4892
|
width: 16,
|
|
4766
4893
|
height: 16,
|
|
4767
4894
|
viewBox: "0 0 24 24",
|
|
@@ -4770,7 +4897,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4770
4897
|
style: { flexShrink: 0 },
|
|
4771
4898
|
...e,
|
|
4772
4899
|
children: /* @__PURE__ */ v("path", { d: "M20.45 20.45h-3.55v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.36V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z" })
|
|
4773
|
-
}),
|
|
4900
|
+
}), yo = (e) => /* @__PURE__ */ v("svg", {
|
|
4774
4901
|
width: 16,
|
|
4775
4902
|
height: 16,
|
|
4776
4903
|
viewBox: "0 0 24 24",
|
|
@@ -4779,7 +4906,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4779
4906
|
style: { flexShrink: 0 },
|
|
4780
4907
|
...e,
|
|
4781
4908
|
children: /* @__PURE__ */ v("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" })
|
|
4782
|
-
}),
|
|
4909
|
+
}), bo = (e) => /* @__PURE__ */ v("svg", {
|
|
4783
4910
|
width: 16,
|
|
4784
4911
|
height: 16,
|
|
4785
4912
|
viewBox: "0 0 24 24",
|
|
@@ -4788,7 +4915,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4788
4915
|
style: { flexShrink: 0 },
|
|
4789
4916
|
...e,
|
|
4790
4917
|
children: /* @__PURE__ */ v("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" })
|
|
4791
|
-
}),
|
|
4918
|
+
}), xo = (e) => /* @__PURE__ */ v("svg", {
|
|
4792
4919
|
width: 16,
|
|
4793
4920
|
height: 16,
|
|
4794
4921
|
viewBox: "0 0 24 24",
|
|
@@ -4797,7 +4924,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4797
4924
|
style: { flexShrink: 0 },
|
|
4798
4925
|
...e,
|
|
4799
4926
|
children: /* @__PURE__ */ v("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" })
|
|
4800
|
-
}),
|
|
4927
|
+
}), So = (e) => /* @__PURE__ */ v("svg", {
|
|
4801
4928
|
width: 16,
|
|
4802
4929
|
height: 16,
|
|
4803
4930
|
viewBox: "0 0 24 24",
|
|
@@ -4806,7 +4933,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4806
4933
|
style: { flexShrink: 0 },
|
|
4807
4934
|
...e,
|
|
4808
4935
|
children: /* @__PURE__ */ v("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" })
|
|
4809
|
-
}),
|
|
4936
|
+
}), Co = (e) => /* @__PURE__ */ y("svg", {
|
|
4810
4937
|
width: 16,
|
|
4811
4938
|
height: 16,
|
|
4812
4939
|
viewBox: "0 0 24 24",
|
|
@@ -4831,7 +4958,7 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4831
4958
|
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"
|
|
4832
4959
|
})
|
|
4833
4960
|
]
|
|
4834
|
-
}),
|
|
4961
|
+
}), wo = (e) => /* @__PURE__ */ v("svg", {
|
|
4835
4962
|
width: 16,
|
|
4836
4963
|
height: 16,
|
|
4837
4964
|
viewBox: "0 0 24 24",
|
|
@@ -4840,39 +4967,39 @@ var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4840
4967
|
style: { flexShrink: 0 },
|
|
4841
4968
|
...e,
|
|
4842
4969
|
children: /* @__PURE__ */ v("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" })
|
|
4843
|
-
}),
|
|
4844
|
-
"linkedin.com":
|
|
4845
|
-
"github.com":
|
|
4846
|
-
"x.com":
|
|
4847
|
-
"twitter.com":
|
|
4848
|
-
"youtube.com":
|
|
4849
|
-
"youtu.be":
|
|
4850
|
-
"gmail.com":
|
|
4851
|
-
"mail.google.com":
|
|
4852
|
-
"slack.com":
|
|
4853
|
-
"notion.so":
|
|
4854
|
-
"notion.com":
|
|
4970
|
+
}), To = {
|
|
4971
|
+
"linkedin.com": vo,
|
|
4972
|
+
"github.com": yo,
|
|
4973
|
+
"x.com": bo,
|
|
4974
|
+
"twitter.com": bo,
|
|
4975
|
+
"youtube.com": xo,
|
|
4976
|
+
"youtu.be": xo,
|
|
4977
|
+
"gmail.com": So,
|
|
4978
|
+
"mail.google.com": So,
|
|
4979
|
+
"slack.com": Co,
|
|
4980
|
+
"notion.so": wo,
|
|
4981
|
+
"notion.com": wo
|
|
4855
4982
|
};
|
|
4856
|
-
function
|
|
4983
|
+
function Eo(e, t) {
|
|
4857
4984
|
return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
|
|
4858
4985
|
}
|
|
4859
|
-
var
|
|
4986
|
+
var Do = {
|
|
4860
4987
|
width: 16,
|
|
4861
4988
|
height: 16,
|
|
4862
4989
|
flexShrink: 0,
|
|
4863
4990
|
objectFit: "contain"
|
|
4864
4991
|
};
|
|
4865
|
-
function
|
|
4866
|
-
let t =
|
|
4992
|
+
function Oo({ domain: e }) {
|
|
4993
|
+
let t = ir((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? To[n] : void 0;
|
|
4867
4994
|
if (r) return /* @__PURE__ */ v(r, {});
|
|
4868
|
-
let i =
|
|
4869
|
-
return i ? /* @__PURE__ */ v(
|
|
4995
|
+
let i = Eo(n, t);
|
|
4996
|
+
return i ? /* @__PURE__ */ v(ko, { src: i }) : /* @__PURE__ */ v(_o, {});
|
|
4870
4997
|
}
|
|
4871
|
-
function
|
|
4998
|
+
function ko({ src: e }) {
|
|
4872
4999
|
let [t, n] = f(!1);
|
|
4873
5000
|
return c(() => {
|
|
4874
5001
|
n(!1);
|
|
4875
|
-
}, [e]), t ? /* @__PURE__ */ v(
|
|
5002
|
+
}, [e]), t ? /* @__PURE__ */ v(_o, {}) : /* @__PURE__ */ v("img", {
|
|
4876
5003
|
src: e,
|
|
4877
5004
|
alt: "",
|
|
4878
5005
|
width: 16,
|
|
@@ -4880,7 +5007,7 @@ function _o({ src: e }) {
|
|
|
4880
5007
|
loading: "lazy",
|
|
4881
5008
|
decoding: "async",
|
|
4882
5009
|
referrerPolicy: "no-referrer",
|
|
4883
|
-
style:
|
|
5010
|
+
style: Do,
|
|
4884
5011
|
onError: () => n(!0)
|
|
4885
5012
|
});
|
|
4886
5013
|
}
|
|
@@ -4890,72 +5017,72 @@ var $ = /* @__PURE__ */ v("span", {
|
|
|
4890
5017
|
color: "var(--text-4)"
|
|
4891
5018
|
},
|
|
4892
5019
|
children: "—"
|
|
4893
|
-
}),
|
|
5020
|
+
}), Ao = {
|
|
4894
5021
|
display: "inline-flex",
|
|
4895
5022
|
alignItems: "center",
|
|
4896
5023
|
gap: 4,
|
|
4897
5024
|
fontSize: 12.5,
|
|
4898
5025
|
color: "var(--accent)",
|
|
4899
5026
|
textDecoration: "none"
|
|
4900
|
-
},
|
|
5027
|
+
}, jo = { fontSize: 12.5 }, Mo = () => (t) => {
|
|
4901
5028
|
let n = t == null ? "" : F(t);
|
|
4902
5029
|
if (!n) return $;
|
|
4903
|
-
let r =
|
|
4904
|
-
if (r == null || !
|
|
4905
|
-
style:
|
|
5030
|
+
let r = fo(n);
|
|
5031
|
+
if (r == null || !ho(r)) return /* @__PURE__ */ v("span", {
|
|
5032
|
+
style: jo,
|
|
4906
5033
|
children: n
|
|
4907
5034
|
});
|
|
4908
|
-
let i =
|
|
5035
|
+
let i = po(r), a = mo(r, i ?? "") ?? i ?? n;
|
|
4909
5036
|
return /* @__PURE__ */ y("a", {
|
|
4910
5037
|
href: r,
|
|
4911
5038
|
target: "_blank",
|
|
4912
5039
|
rel: "noopener noreferrer",
|
|
4913
5040
|
title: n,
|
|
4914
5041
|
className: "mono",
|
|
4915
|
-
style:
|
|
5042
|
+
style: Ao,
|
|
4916
5043
|
children: [
|
|
4917
|
-
/* @__PURE__ */ v(
|
|
5044
|
+
/* @__PURE__ */ v(Oo, { domain: i }),
|
|
4918
5045
|
a,
|
|
4919
5046
|
/* @__PURE__ */ v(e.external, { size: 11 })
|
|
4920
5047
|
]
|
|
4921
5048
|
});
|
|
4922
|
-
},
|
|
5049
|
+
}, No = {
|
|
4923
5050
|
fontSize: 12.5,
|
|
4924
5051
|
color: "var(--accent)",
|
|
4925
5052
|
textDecoration: "none"
|
|
4926
|
-
},
|
|
5053
|
+
}, Po = () => (e) => {
|
|
4927
5054
|
let t = e == null ? "" : F(e);
|
|
4928
5055
|
return t ? /* @__PURE__ */ v("a", {
|
|
4929
5056
|
href: `mailto:${t}`,
|
|
4930
5057
|
className: "mono",
|
|
4931
|
-
style:
|
|
5058
|
+
style: No,
|
|
4932
5059
|
children: t
|
|
4933
5060
|
}) : $;
|
|
4934
|
-
},
|
|
5061
|
+
}, Fo = {
|
|
4935
5062
|
fontSize: 12.5,
|
|
4936
5063
|
color: "var(--accent)",
|
|
4937
5064
|
textDecoration: "none"
|
|
4938
|
-
},
|
|
5065
|
+
}, Io = { fontSize: 12.5 }, Lo = /^[+()\-.\s\d]+$/, Ro = () => (e) => {
|
|
4939
5066
|
let t = e == null ? "" : F(e);
|
|
4940
5067
|
if (!t) return $;
|
|
4941
5068
|
let n = t.trim();
|
|
4942
|
-
return
|
|
5069
|
+
return Lo.test(n) ? /* @__PURE__ */ v("a", {
|
|
4943
5070
|
href: `tel:${n.replace(/\s+/g, "")}`,
|
|
4944
5071
|
className: "mono",
|
|
4945
|
-
style:
|
|
5072
|
+
style: Fo,
|
|
4946
5073
|
children: t
|
|
4947
5074
|
}) : /* @__PURE__ */ v("span", {
|
|
4948
|
-
style:
|
|
5075
|
+
style: Io,
|
|
4949
5076
|
children: t
|
|
4950
5077
|
});
|
|
4951
|
-
},
|
|
5078
|
+
}, zo = {
|
|
4952
5079
|
fontSize: 12.5,
|
|
4953
5080
|
fontVariantNumeric: "tabular-nums"
|
|
4954
|
-
},
|
|
5081
|
+
}, Bo = {
|
|
4955
5082
|
color: "var(--text-3)",
|
|
4956
5083
|
marginLeft: 4
|
|
4957
|
-
},
|
|
4958
|
-
function
|
|
5084
|
+
}, Vo = { fontSize: 12.5 };
|
|
5085
|
+
function Ho(e, t) {
|
|
4959
5086
|
let n = e.trim();
|
|
4960
5087
|
if (n === "" || n === "-") return n;
|
|
4961
5088
|
let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
|
|
@@ -4967,45 +5094,45 @@ function Ao(e, t) {
|
|
|
4967
5094
|
let s = r ? `-${o}` : o;
|
|
4968
5095
|
return a !== void 0 && (s += `.${a}`), s;
|
|
4969
5096
|
}
|
|
4970
|
-
var
|
|
5097
|
+
var Uo = (e) => {
|
|
4971
5098
|
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;
|
|
4972
5099
|
return (e, t) => {
|
|
4973
5100
|
if (e == null) return $;
|
|
4974
5101
|
let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
|
|
4975
|
-
if (a && typeof e == "string") s =
|
|
5102
|
+
if (a && typeof e == "string") s = Ho(e, i);
|
|
4976
5103
|
else {
|
|
4977
5104
|
let t = typeof e == "number" ? e : Number(e);
|
|
4978
5105
|
s = Number.isFinite(t) ? i.format(t) : null;
|
|
4979
5106
|
}
|
|
4980
5107
|
return s == null ? /* @__PURE__ */ v("span", {
|
|
4981
|
-
style:
|
|
5108
|
+
style: Vo,
|
|
4982
5109
|
children: "—"
|
|
4983
5110
|
}) : /* @__PURE__ */ y("span", {
|
|
4984
5111
|
className: "num",
|
|
4985
|
-
style:
|
|
5112
|
+
style: zo,
|
|
4986
5113
|
children: [s, r && /* @__PURE__ */ v("span", {
|
|
4987
|
-
style:
|
|
5114
|
+
style: Bo,
|
|
4988
5115
|
children: r
|
|
4989
5116
|
})]
|
|
4990
5117
|
});
|
|
4991
5118
|
};
|
|
4992
|
-
},
|
|
5119
|
+
}, Wo = { fontSize: 12.5 }, Go = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ v("code", {
|
|
4993
5120
|
className: "mono",
|
|
4994
|
-
style:
|
|
5121
|
+
style: Wo,
|
|
4995
5122
|
children: F(e)
|
|
4996
|
-
}),
|
|
5123
|
+
}), Ko = {
|
|
4997
5124
|
display: "inline-flex",
|
|
4998
5125
|
alignItems: "center",
|
|
4999
5126
|
gap: 4,
|
|
5000
5127
|
fontSize: 12.5,
|
|
5001
5128
|
color: "var(--accent)",
|
|
5002
5129
|
textDecoration: "none"
|
|
5003
|
-
},
|
|
5130
|
+
}, qo = { fontSize: 12.5 }, Jo = () => (t) => {
|
|
5004
5131
|
let n = t == null ? "" : F(t);
|
|
5005
5132
|
if (!n) return $;
|
|
5006
|
-
let r =
|
|
5007
|
-
return r == null || !
|
|
5008
|
-
style:
|
|
5133
|
+
let r = fo(n);
|
|
5134
|
+
return r == null || !ho(r) ? /* @__PURE__ */ v("span", {
|
|
5135
|
+
style: qo,
|
|
5009
5136
|
children: n
|
|
5010
5137
|
}) : /* @__PURE__ */ y("a", {
|
|
5011
5138
|
href: r,
|
|
@@ -5013,21 +5140,21 @@ var jo = (e) => {
|
|
|
5013
5140
|
rel: "noopener noreferrer",
|
|
5014
5141
|
title: n,
|
|
5015
5142
|
className: "mono",
|
|
5016
|
-
style:
|
|
5143
|
+
style: Ko,
|
|
5017
5144
|
children: [n, /* @__PURE__ */ v(e.external, { size: 11 })]
|
|
5018
5145
|
});
|
|
5019
|
-
},
|
|
5020
|
-
function
|
|
5021
|
-
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) :
|
|
5146
|
+
}, Yo = 400, Xo = 2e3;
|
|
5147
|
+
function Zo(e) {
|
|
5148
|
+
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : Yo, Xo));
|
|
5022
5149
|
}
|
|
5023
|
-
function
|
|
5150
|
+
function Qo(e, t) {
|
|
5024
5151
|
return e.length <= t ? e : `${e.slice(0, t)}...`;
|
|
5025
5152
|
}
|
|
5026
|
-
function
|
|
5153
|
+
function $o(e, t, n, r = 0) {
|
|
5027
5154
|
if (e == null || e === "") return "";
|
|
5028
|
-
if (typeof e == "string") return
|
|
5155
|
+
if (typeof e == "string") return Qo(e, t);
|
|
5029
5156
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
5030
|
-
if (typeof e != "object") return
|
|
5157
|
+
if (typeof e != "object") return Qo(F(e), t);
|
|
5031
5158
|
if (n.has(e)) return "[Circular]";
|
|
5032
5159
|
if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
|
|
5033
5160
|
n.add(e);
|
|
@@ -5038,30 +5165,30 @@ function Vo(e, t, n, r = 0) {
|
|
|
5038
5165
|
a.push(a.length > 1 ? ",..." : "...");
|
|
5039
5166
|
break;
|
|
5040
5167
|
}
|
|
5041
|
-
let f =
|
|
5168
|
+
let f = $o(c, d, n, r + 1);
|
|
5042
5169
|
if (a.push(u, f), a.join("").length >= t) {
|
|
5043
5170
|
a.push(",...");
|
|
5044
5171
|
break;
|
|
5045
5172
|
}
|
|
5046
5173
|
}
|
|
5047
|
-
return a.push(i), n.delete(e),
|
|
5174
|
+
return a.push(i), n.delete(e), Qo(a.join(""), t);
|
|
5048
5175
|
}
|
|
5049
|
-
function
|
|
5050
|
-
return
|
|
5176
|
+
function es(e, t) {
|
|
5177
|
+
return $o(e, t, /* @__PURE__ */ new WeakSet());
|
|
5051
5178
|
}
|
|
5052
|
-
var
|
|
5053
|
-
let t = e.surface ?? "detail", n =
|
|
5179
|
+
var ts = (e) => {
|
|
5180
|
+
let t = e.surface ?? "detail", n = Zo(e.field.display?.list_preview?.max_chars);
|
|
5054
5181
|
return (r) => {
|
|
5055
|
-
if (
|
|
5182
|
+
if (Gi(r)) return $;
|
|
5056
5183
|
if (t === "list") {
|
|
5057
|
-
let e =
|
|
5184
|
+
let e = es(r, n);
|
|
5058
5185
|
return /* @__PURE__ */ v("span", {
|
|
5059
5186
|
className: "font-mono text-xs text-muted-foreground",
|
|
5060
5187
|
title: e,
|
|
5061
5188
|
children: e
|
|
5062
5189
|
});
|
|
5063
5190
|
}
|
|
5064
|
-
return /* @__PURE__ */ v(
|
|
5191
|
+
return /* @__PURE__ */ v(Ki, {
|
|
5065
5192
|
field: e.field,
|
|
5066
5193
|
fieldName: e.fieldName,
|
|
5067
5194
|
value: r,
|
|
@@ -5069,7 +5196,7 @@ var Uo = (e) => {
|
|
|
5069
5196
|
locale: e.locale
|
|
5070
5197
|
});
|
|
5071
5198
|
};
|
|
5072
|
-
},
|
|
5199
|
+
}, ns = [
|
|
5073
5200
|
{
|
|
5074
5201
|
pattern: /```[^\n]*\n?([\s\S]*?)```/g,
|
|
5075
5202
|
replacement: "$1"
|
|
@@ -5132,13 +5259,13 @@ var Uo = (e) => {
|
|
|
5132
5259
|
replacement: ""
|
|
5133
5260
|
}
|
|
5134
5261
|
];
|
|
5135
|
-
function
|
|
5262
|
+
function rs(e) {
|
|
5136
5263
|
if (!e) return {
|
|
5137
5264
|
text: "",
|
|
5138
5265
|
isPlain: !0
|
|
5139
5266
|
};
|
|
5140
5267
|
let t = e, n = !1;
|
|
5141
|
-
for (let e of
|
|
5268
|
+
for (let e of ns) {
|
|
5142
5269
|
let r = t.replace(e.pattern, e.replacement);
|
|
5143
5270
|
r !== t && e.structural !== !1 && (n = !0), t = r;
|
|
5144
5271
|
}
|
|
@@ -5149,123 +5276,123 @@ function Go(e) {
|
|
|
5149
5276
|
}
|
|
5150
5277
|
//#endregion
|
|
5151
5278
|
//#region src/components/fields/cells/factories/markdown.tsx
|
|
5152
|
-
function
|
|
5153
|
-
return /* @__PURE__ */ v(
|
|
5279
|
+
function is(e) {
|
|
5280
|
+
return /* @__PURE__ */ v(li, { content: e });
|
|
5154
5281
|
}
|
|
5155
|
-
var
|
|
5282
|
+
var as = (e) => {
|
|
5156
5283
|
let t = e.surface === "list";
|
|
5157
5284
|
return (e) => {
|
|
5158
5285
|
let n = e == null ? "" : F(e);
|
|
5159
5286
|
if (!n) return $;
|
|
5160
|
-
if (!t) return
|
|
5161
|
-
let { text: r, isPlain: i } =
|
|
5287
|
+
if (!t) return is(n);
|
|
5288
|
+
let { text: r, isPlain: i } = rs(n);
|
|
5162
5289
|
return i ? /* @__PURE__ */ v("span", {
|
|
5163
5290
|
title: r,
|
|
5164
5291
|
children: r
|
|
5165
|
-
}) : /* @__PURE__ */ v(
|
|
5166
|
-
content:
|
|
5292
|
+
}) : /* @__PURE__ */ v(oe, {
|
|
5293
|
+
content: is(n),
|
|
5167
5294
|
children: /* @__PURE__ */ v("span", {
|
|
5168
5295
|
title: r,
|
|
5169
5296
|
children: r
|
|
5170
5297
|
})
|
|
5171
5298
|
});
|
|
5172
5299
|
};
|
|
5173
|
-
},
|
|
5300
|
+
}, os = "[SET]", ss = {
|
|
5174
5301
|
fontSize: 12.5,
|
|
5175
5302
|
color: "var(--text-3)"
|
|
5176
|
-
},
|
|
5303
|
+
}, cs = {
|
|
5177
5304
|
fontSize: 12.5,
|
|
5178
5305
|
color: "var(--text-4)",
|
|
5179
5306
|
fontStyle: "italic"
|
|
5180
|
-
},
|
|
5307
|
+
}, ls = () => (e) => e === os || typeof e == "string" && e !== "" ? /* @__PURE__ */ v("span", {
|
|
5181
5308
|
className: "mono",
|
|
5182
|
-
style:
|
|
5183
|
-
children:
|
|
5309
|
+
style: ss,
|
|
5310
|
+
children: os
|
|
5184
5311
|
}) : /* @__PURE__ */ v("span", {
|
|
5185
|
-
style:
|
|
5312
|
+
style: cs,
|
|
5186
5313
|
children: "Not set"
|
|
5187
5314
|
});
|
|
5188
5315
|
//#endregion
|
|
5189
5316
|
//#region src/components/fields/cells/factories/richTextPreview.tsx
|
|
5190
|
-
function
|
|
5191
|
-
return /* @__PURE__ */ v(
|
|
5317
|
+
function us(e, t) {
|
|
5318
|
+
return /* @__PURE__ */ v(li, {
|
|
5192
5319
|
content: e,
|
|
5193
5320
|
files: t
|
|
5194
5321
|
});
|
|
5195
5322
|
}
|
|
5196
|
-
var
|
|
5323
|
+
var ds = (e) => {
|
|
5197
5324
|
let { fieldName: t } = e, n = e.surface === "list";
|
|
5198
5325
|
return (e, r) => {
|
|
5199
|
-
let i = r?.$files?.[t], a =
|
|
5326
|
+
let i = r?.$files?.[t], a = ua(e, i);
|
|
5200
5327
|
if (!a.markdown) return $;
|
|
5201
|
-
if (!n) return
|
|
5202
|
-
let { text: o, isPlain: s } =
|
|
5328
|
+
if (!n) return us(a.markdown, a.files);
|
|
5329
|
+
let { text: o, isPlain: s } = rs(a.markdown);
|
|
5203
5330
|
return s ? /* @__PURE__ */ v("span", {
|
|
5204
5331
|
title: o,
|
|
5205
5332
|
children: o
|
|
5206
|
-
}) : /* @__PURE__ */ v(
|
|
5207
|
-
content:
|
|
5333
|
+
}) : /* @__PURE__ */ v(oe, {
|
|
5334
|
+
content: us(a.markdown, a.files),
|
|
5208
5335
|
children: /* @__PURE__ */ v("span", {
|
|
5209
5336
|
title: o,
|
|
5210
5337
|
children: o
|
|
5211
5338
|
})
|
|
5212
5339
|
});
|
|
5213
5340
|
};
|
|
5214
|
-
},
|
|
5341
|
+
}, fs = { fontSize: 12.5 }, ps = {
|
|
5215
5342
|
fontSize: 12.5,
|
|
5216
5343
|
whiteSpace: "pre-wrap",
|
|
5217
5344
|
margin: 0
|
|
5218
5345
|
};
|
|
5219
|
-
function
|
|
5346
|
+
function ms(e) {
|
|
5220
5347
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
5221
5348
|
}
|
|
5222
|
-
function
|
|
5349
|
+
function hs(e, t) {
|
|
5223
5350
|
if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
|
|
5224
5351
|
for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
|
|
5225
5352
|
return null;
|
|
5226
5353
|
}
|
|
5227
5354
|
//#endregion
|
|
5228
5355
|
//#region src/components/fields/cells/registry.ts
|
|
5229
|
-
var
|
|
5230
|
-
text:
|
|
5231
|
-
bool_pill:
|
|
5232
|
-
badge:
|
|
5233
|
-
status_pill:
|
|
5234
|
-
tag_list:
|
|
5235
|
-
time_ago:
|
|
5236
|
-
timestamp_full:
|
|
5237
|
-
next_run:
|
|
5238
|
-
money:
|
|
5239
|
-
ref_link:
|
|
5240
|
-
url:
|
|
5241
|
-
email:
|
|
5242
|
-
phone:
|
|
5243
|
-
number:
|
|
5244
|
-
code:
|
|
5245
|
-
link:
|
|
5246
|
-
json:
|
|
5247
|
-
markdown:
|
|
5248
|
-
password_mask:
|
|
5249
|
-
rich_text_preview:
|
|
5356
|
+
var gs = {
|
|
5357
|
+
text: Ra,
|
|
5358
|
+
bool_pill: za,
|
|
5359
|
+
badge: Wa,
|
|
5360
|
+
status_pill: qa,
|
|
5361
|
+
tag_list: Xa,
|
|
5362
|
+
time_ago: Za,
|
|
5363
|
+
timestamp_full: Qa,
|
|
5364
|
+
next_run: to,
|
|
5365
|
+
money: no,
|
|
5366
|
+
ref_link: ao,
|
|
5367
|
+
url: Mo,
|
|
5368
|
+
email: Po,
|
|
5369
|
+
phone: Ro,
|
|
5370
|
+
number: Uo,
|
|
5371
|
+
code: Go,
|
|
5372
|
+
link: Jo,
|
|
5373
|
+
json: ts,
|
|
5374
|
+
markdown: as,
|
|
5375
|
+
password_mask: ls,
|
|
5376
|
+
rich_text_preview: ds,
|
|
5250
5377
|
multilang_inline: (e) => {
|
|
5251
5378
|
let { field: t, locale: n } = e, r = t.type === "multilang_text";
|
|
5252
5379
|
return (e) => {
|
|
5253
|
-
let t =
|
|
5380
|
+
let t = hs(ms(e), n);
|
|
5254
5381
|
if (!t) return r ? /* @__PURE__ */ v("p", {
|
|
5255
|
-
style:
|
|
5382
|
+
style: ps,
|
|
5256
5383
|
children: "—"
|
|
5257
5384
|
}) : /* @__PURE__ */ v("span", {
|
|
5258
|
-
style:
|
|
5385
|
+
style: fs,
|
|
5259
5386
|
children: "—"
|
|
5260
5387
|
});
|
|
5261
5388
|
let [i, a] = t;
|
|
5262
5389
|
return r ? /* @__PURE__ */ v("p", {
|
|
5263
|
-
style:
|
|
5390
|
+
style: ps,
|
|
5264
5391
|
lang: i,
|
|
5265
5392
|
dir: "auto",
|
|
5266
5393
|
children: a
|
|
5267
5394
|
}) : /* @__PURE__ */ v("span", {
|
|
5268
|
-
style:
|
|
5395
|
+
style: fs,
|
|
5269
5396
|
lang: i,
|
|
5270
5397
|
dir: "auto",
|
|
5271
5398
|
children: a
|
|
@@ -5273,53 +5400,53 @@ var is = {
|
|
|
5273
5400
|
};
|
|
5274
5401
|
}
|
|
5275
5402
|
};
|
|
5276
|
-
Object.keys(
|
|
5277
|
-
function
|
|
5278
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
5403
|
+
Object.keys(gs).sort();
|
|
5404
|
+
function _s(e) {
|
|
5405
|
+
let t = e.field.display?.widget ?? "text", n = gs[t];
|
|
5279
5406
|
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.`);
|
|
5280
5407
|
return n(e);
|
|
5281
5408
|
}
|
|
5282
5409
|
//#endregion
|
|
5283
5410
|
//#region src/components/fields/index.tsx
|
|
5284
|
-
var
|
|
5285
|
-
string:
|
|
5286
|
-
text:
|
|
5287
|
-
rich_text:
|
|
5288
|
-
int:
|
|
5289
|
-
float:
|
|
5290
|
-
decimal:
|
|
5291
|
-
bool:
|
|
5292
|
-
timestamp:
|
|
5293
|
-
date:
|
|
5294
|
-
time:
|
|
5295
|
-
enum:
|
|
5296
|
-
email:
|
|
5297
|
-
url:
|
|
5298
|
-
phone:
|
|
5299
|
-
uuid:
|
|
5300
|
-
bytes:
|
|
5301
|
-
ref:
|
|
5302
|
-
json:
|
|
5303
|
-
tags:
|
|
5304
|
-
string_array:
|
|
5305
|
-
int_array:
|
|
5306
|
-
uuid_array:
|
|
5307
|
-
multilang:
|
|
5308
|
-
multilang_text:
|
|
5309
|
-
structure:
|
|
5310
|
-
secret:
|
|
5311
|
-
password:
|
|
5411
|
+
var vs = {
|
|
5412
|
+
string: fi,
|
|
5413
|
+
text: pi,
|
|
5414
|
+
rich_text: Fa,
|
|
5415
|
+
int: Pi,
|
|
5416
|
+
float: Pi,
|
|
5417
|
+
decimal: Pi,
|
|
5418
|
+
bool: ji,
|
|
5419
|
+
timestamp: Ai,
|
|
5420
|
+
date: Ai,
|
|
5421
|
+
time: Ai,
|
|
5422
|
+
enum: hi,
|
|
5423
|
+
email: gi,
|
|
5424
|
+
url: _i,
|
|
5425
|
+
phone: vi,
|
|
5426
|
+
uuid: fi,
|
|
5427
|
+
bytes: fi,
|
|
5428
|
+
ref: Hi,
|
|
5429
|
+
json: Ki,
|
|
5430
|
+
tags: fi,
|
|
5431
|
+
string_array: aa,
|
|
5432
|
+
int_array: sa,
|
|
5433
|
+
uuid_array: aa,
|
|
5434
|
+
multilang: Ji,
|
|
5435
|
+
multilang_text: Xi,
|
|
5436
|
+
structure: Zi,
|
|
5437
|
+
secret: ta,
|
|
5438
|
+
password: ra
|
|
5312
5439
|
};
|
|
5313
|
-
for (let e of
|
|
5314
|
-
function
|
|
5315
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ v(
|
|
5440
|
+
for (let e of ui) if (!vs[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.`);
|
|
5441
|
+
function ys(e) {
|
|
5442
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ v(Zi, { ...e });
|
|
5316
5443
|
if (e.mode === "edit") {
|
|
5317
|
-
let t =
|
|
5444
|
+
let t = vs[e.field.type];
|
|
5318
5445
|
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.`);
|
|
5319
5446
|
return /* @__PURE__ */ v(t, { ...e });
|
|
5320
5447
|
}
|
|
5321
5448
|
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.`);
|
|
5322
|
-
return
|
|
5449
|
+
return _s({
|
|
5323
5450
|
field: e.field,
|
|
5324
5451
|
fieldName: e.fieldName,
|
|
5325
5452
|
surface: e.surface ?? "detail",
|
|
@@ -5332,98 +5459,98 @@ function ss(e) {
|
|
|
5332
5459
|
}
|
|
5333
5460
|
//#endregion
|
|
5334
5461
|
//#region src/hooks/useUserLocale.ts
|
|
5335
|
-
var
|
|
5336
|
-
function
|
|
5462
|
+
var bs = "en";
|
|
5463
|
+
function xs() {
|
|
5337
5464
|
if (typeof navigator > "u") return;
|
|
5338
5465
|
let e = navigator.language;
|
|
5339
5466
|
if (e) return e.split("-")[0] || void 0;
|
|
5340
5467
|
}
|
|
5341
|
-
function
|
|
5342
|
-
let e =
|
|
5468
|
+
function Ss() {
|
|
5469
|
+
let e = zn((e) => e.user), { data: t } = J(), n = e?.language;
|
|
5343
5470
|
if (n && n.trim()) return n;
|
|
5344
5471
|
let r = t?.languages?.[0]?.code;
|
|
5345
|
-
return r && r.trim() ? r :
|
|
5472
|
+
return r && r.trim() ? r : xs() || bs;
|
|
5346
5473
|
}
|
|
5347
5474
|
//#endregion
|
|
5348
5475
|
//#region src/lib/field-regions.ts
|
|
5349
|
-
var
|
|
5350
|
-
function
|
|
5351
|
-
return
|
|
5352
|
-
|
|
5476
|
+
var Cs = /* @__PURE__ */ new Map();
|
|
5477
|
+
function ws(e, t) {
|
|
5478
|
+
return Cs.set(e, t), () => {
|
|
5479
|
+
Cs.get(e) === t && Cs.delete(e);
|
|
5353
5480
|
};
|
|
5354
5481
|
}
|
|
5355
|
-
function
|
|
5356
|
-
return
|
|
5482
|
+
function Ts(e) {
|
|
5483
|
+
return Cs.get(e);
|
|
5357
5484
|
}
|
|
5358
5485
|
//#endregion
|
|
5359
5486
|
//#region src/lib/ui-actions.ts
|
|
5360
|
-
var
|
|
5361
|
-
function
|
|
5362
|
-
let n = e.match(
|
|
5487
|
+
var Es = /\$\{\s*([^}]+?)\s*\}/g, Ds = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, Os = Symbol("unresolved");
|
|
5488
|
+
function ks(e, t) {
|
|
5489
|
+
let n = e.match(Ds);
|
|
5363
5490
|
if (n) {
|
|
5364
|
-
let r =
|
|
5365
|
-
return r ===
|
|
5491
|
+
let r = As(n[1], t);
|
|
5492
|
+
return r === Os ? e : r;
|
|
5366
5493
|
}
|
|
5367
|
-
return e.replace(
|
|
5368
|
-
let r =
|
|
5369
|
-
return r ===
|
|
5494
|
+
return e.replace(Es, (e, n) => {
|
|
5495
|
+
let r = As(n, t);
|
|
5496
|
+
return r === Os ? e : F(r);
|
|
5370
5497
|
});
|
|
5371
5498
|
}
|
|
5372
|
-
function
|
|
5373
|
-
if (e === "now") return
|
|
5499
|
+
function As(e, t) {
|
|
5500
|
+
if (e === "now") return yi();
|
|
5374
5501
|
let [n, ...r] = e.split(".");
|
|
5375
|
-
if (n === "row") return !t.row || r.length === 0 ?
|
|
5502
|
+
if (n === "row") return !t.row || r.length === 0 ? Os : js(t.row, r);
|
|
5376
5503
|
if (n === "field" && r.length >= 2) {
|
|
5377
|
-
let [e, t] = r, n =
|
|
5378
|
-
return n ? n.getField(t) :
|
|
5504
|
+
let [e, t] = r, n = Ts(e);
|
|
5505
|
+
return n ? n.getField(t) : Os;
|
|
5379
5506
|
}
|
|
5380
|
-
return n === "params" ? !t.params || r.length === 0 ?
|
|
5507
|
+
return n === "params" ? !t.params || r.length === 0 ? Os : js(t.params, r) : Os;
|
|
5381
5508
|
}
|
|
5382
|
-
function
|
|
5509
|
+
function js(e, t) {
|
|
5383
5510
|
return t.reduce((e, t) => {
|
|
5384
5511
|
if (e && typeof e == "object") return e[t];
|
|
5385
5512
|
}, e);
|
|
5386
5513
|
}
|
|
5387
|
-
async function
|
|
5514
|
+
async function Ms(e, t) {
|
|
5388
5515
|
for (let n of e) try {
|
|
5389
|
-
await
|
|
5516
|
+
await Ns(n, t);
|
|
5390
5517
|
} catch (e) {
|
|
5391
5518
|
let t = e instanceof Error ? e.message : String(e);
|
|
5392
5519
|
Z.error(`ui_step failed: ${t}`);
|
|
5393
5520
|
return;
|
|
5394
5521
|
}
|
|
5395
5522
|
}
|
|
5396
|
-
async function
|
|
5523
|
+
async function Ns(e, t) {
|
|
5397
5524
|
if (e.copy_to_clipboard != null) {
|
|
5398
|
-
let n =
|
|
5525
|
+
let n = Fs(e.copy_to_clipboard, t);
|
|
5399
5526
|
await navigator.clipboard.writeText(n);
|
|
5400
5527
|
return;
|
|
5401
5528
|
}
|
|
5402
5529
|
if (e.set_field) {
|
|
5403
|
-
let { target: n, value: r } = e.set_field, { region: i, field: a } =
|
|
5530
|
+
let { target: n, value: r } = e.set_field, { region: i, field: a } = Is(n), o = Ts(i);
|
|
5404
5531
|
if (!o) throw Error(`region "${i}" not registered`);
|
|
5405
|
-
o.setField(a,
|
|
5532
|
+
o.setField(a, Ps(r, t));
|
|
5406
5533
|
return;
|
|
5407
5534
|
}
|
|
5408
5535
|
if (e.focus_field) {
|
|
5409
|
-
let { region: t, field: n } =
|
|
5536
|
+
let { region: t, field: n } = Is(e.focus_field), r = Ts(t);
|
|
5410
5537
|
if (!r) throw Error(`region "${t}" not registered`);
|
|
5411
5538
|
r.focusField(n);
|
|
5412
5539
|
return;
|
|
5413
5540
|
}
|
|
5414
5541
|
if (e.show_toast) {
|
|
5415
|
-
let n =
|
|
5542
|
+
let n = Fs(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
|
|
5416
5543
|
r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
|
|
5417
5544
|
return;
|
|
5418
5545
|
}
|
|
5419
5546
|
}
|
|
5420
|
-
function
|
|
5421
|
-
return typeof e == "string" ?
|
|
5547
|
+
function Ps(e, t) {
|
|
5548
|
+
return typeof e == "string" ? ks(e, t) : e;
|
|
5422
5549
|
}
|
|
5423
|
-
function
|
|
5424
|
-
return F(
|
|
5550
|
+
function Fs(e, t) {
|
|
5551
|
+
return F(ks(e, t));
|
|
5425
5552
|
}
|
|
5426
|
-
function
|
|
5553
|
+
function Is(e) {
|
|
5427
5554
|
let t = e.indexOf(".");
|
|
5428
5555
|
if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
|
|
5429
5556
|
return {
|
|
@@ -5431,12 +5558,12 @@ function ws(e) {
|
|
|
5431
5558
|
field: e.slice(t + 1)
|
|
5432
5559
|
};
|
|
5433
5560
|
}
|
|
5434
|
-
function
|
|
5561
|
+
function Ls(e) {
|
|
5435
5562
|
return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
|
|
5436
5563
|
}
|
|
5437
5564
|
//#endregion
|
|
5438
5565
|
//#region src/lib/mass-edit.ts
|
|
5439
|
-
function
|
|
5566
|
+
function Rs(e) {
|
|
5440
5567
|
if (!e) return [];
|
|
5441
5568
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5442
5569
|
for (let r of e.split(",")) {
|
|
@@ -5445,17 +5572,17 @@ function Es(e) {
|
|
|
5445
5572
|
}
|
|
5446
5573
|
return n;
|
|
5447
5574
|
}
|
|
5448
|
-
function
|
|
5449
|
-
if (!e || !
|
|
5450
|
-
let n = Array.isArray(t) ? t :
|
|
5575
|
+
function zs(e, t) {
|
|
5576
|
+
if (!e || !Ke(e, "update")) return [];
|
|
5577
|
+
let n = Array.isArray(t) ? t : Rs(t), r = n.length > 0 ? new Set(n) : null, i = rt(e), a = new Set(R(e)), o = r ? n : Bs(e, i, a), s = [];
|
|
5451
5578
|
for (let t of o) {
|
|
5452
5579
|
if (r && !r.has(t)) continue;
|
|
5453
|
-
let n =
|
|
5580
|
+
let n = Vs(e, t, i, a);
|
|
5454
5581
|
n && s.push(n);
|
|
5455
5582
|
}
|
|
5456
5583
|
return s;
|
|
5457
5584
|
}
|
|
5458
|
-
function
|
|
5585
|
+
function Bs(e, t, n) {
|
|
5459
5586
|
let r = [];
|
|
5460
5587
|
for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
|
|
5461
5588
|
if (!t) {
|
|
@@ -5464,7 +5591,7 @@ function Os(e, t, n) {
|
|
|
5464
5591
|
}
|
|
5465
5592
|
return r;
|
|
5466
5593
|
}
|
|
5467
|
-
function
|
|
5594
|
+
function Vs(e, t, n, r) {
|
|
5468
5595
|
if (t.startsWith("$status.")) {
|
|
5469
5596
|
if (n) return null;
|
|
5470
5597
|
let r = t.slice(8), i = e.status_groups?.[r];
|
|
@@ -5472,7 +5599,7 @@ function ks(e, t, n, r) {
|
|
|
5472
5599
|
code: t,
|
|
5473
5600
|
bare: r,
|
|
5474
5601
|
kind: "status",
|
|
5475
|
-
label:
|
|
5602
|
+
label: Hs(i.name, r),
|
|
5476
5603
|
statusGroup: i
|
|
5477
5604
|
} : null;
|
|
5478
5605
|
}
|
|
@@ -5483,7 +5610,7 @@ function ks(e, t, n, r) {
|
|
|
5483
5610
|
code: t,
|
|
5484
5611
|
bare: r,
|
|
5485
5612
|
kind: "property",
|
|
5486
|
-
label:
|
|
5613
|
+
label: Hs(i.name, r),
|
|
5487
5614
|
property: i
|
|
5488
5615
|
} : null;
|
|
5489
5616
|
}
|
|
@@ -5493,18 +5620,18 @@ function ks(e, t, n, r) {
|
|
|
5493
5620
|
code: t,
|
|
5494
5621
|
bare: t,
|
|
5495
5622
|
kind: "field",
|
|
5496
|
-
label:
|
|
5623
|
+
label: Hs(i.display?.name, t),
|
|
5497
5624
|
field: i
|
|
5498
5625
|
};
|
|
5499
5626
|
}
|
|
5500
|
-
function
|
|
5627
|
+
function Hs(e, t) {
|
|
5501
5628
|
return e && I(e) || t;
|
|
5502
5629
|
}
|
|
5503
5630
|
//#endregion
|
|
5504
5631
|
//#region src/components/mass-edit/PropertyGridEditor.tsx
|
|
5505
|
-
var
|
|
5506
|
-
function
|
|
5507
|
-
let a = u(() =>
|
|
5632
|
+
var Us = Symbol.for("declarion.mass-edit.multiple");
|
|
5633
|
+
function Ws({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
|
|
5634
|
+
let a = u(() => zs(e, t), [e, t]), s = u(() => Object.keys(r).map((e) => {
|
|
5508
5635
|
let t = a.find((t) => t.code === e);
|
|
5509
5636
|
return t ? {
|
|
5510
5637
|
target: t,
|
|
@@ -5514,8 +5641,8 @@ function Ms({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5514
5641
|
let e = new Set(s.map((e) => e.target.code));
|
|
5515
5642
|
return a.filter((t) => !e.has(t.code));
|
|
5516
5643
|
}, [s, a]), l = o((e) => {
|
|
5517
|
-
let t =
|
|
5518
|
-
a[e.code] = t ===
|
|
5644
|
+
let t = Ys(e, n), a = { ...r };
|
|
5645
|
+
a[e.code] = t === Us ? void 0 : t, i(a);
|
|
5519
5646
|
}, [
|
|
5520
5647
|
r,
|
|
5521
5648
|
n,
|
|
@@ -5543,12 +5670,12 @@ function Ms({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5543
5670
|
},
|
|
5544
5671
|
children: "No targets selected. Add a field, status, or property to edit across all selected rows."
|
|
5545
5672
|
}),
|
|
5546
|
-
s.map((e) => /* @__PURE__ */ v(
|
|
5673
|
+
s.map((e) => /* @__PURE__ */ v(Gs, {
|
|
5547
5674
|
row: e,
|
|
5548
5675
|
onChange: (t) => d(e.target.code, t),
|
|
5549
5676
|
onRemove: () => f(e.target.code)
|
|
5550
5677
|
}, e.target.code)),
|
|
5551
|
-
/* @__PURE__ */ v(
|
|
5678
|
+
/* @__PURE__ */ v(Js, {
|
|
5552
5679
|
targets: c,
|
|
5553
5680
|
onPick: l
|
|
5554
5681
|
})
|
|
@@ -5561,7 +5688,7 @@ function Ms({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5561
5688
|
children: "Entity schema unavailable. Mass edit requires an entity-bound action."
|
|
5562
5689
|
});
|
|
5563
5690
|
}
|
|
5564
|
-
function
|
|
5691
|
+
function Gs({ row: t, onChange: n, onRemove: r }) {
|
|
5565
5692
|
let { target: i } = t;
|
|
5566
5693
|
return /* @__PURE__ */ y("div", {
|
|
5567
5694
|
"data-testid": "mass-edit-row",
|
|
@@ -5580,7 +5707,7 @@ function Ns({ row: t, onChange: n, onRemove: r }) {
|
|
|
5580
5707
|
title: i.code,
|
|
5581
5708
|
children: i.label
|
|
5582
5709
|
}),
|
|
5583
|
-
/* @__PURE__ */ v(
|
|
5710
|
+
/* @__PURE__ */ v(Ks, {
|
|
5584
5711
|
row: t,
|
|
5585
5712
|
onChange: n
|
|
5586
5713
|
}),
|
|
@@ -5592,8 +5719,8 @@ function Ns({ row: t, onChange: n, onRemove: r }) {
|
|
|
5592
5719
|
]
|
|
5593
5720
|
});
|
|
5594
5721
|
}
|
|
5595
|
-
function
|
|
5596
|
-
let { target: n } = e, r =
|
|
5722
|
+
function Ks({ row: e, onChange: t }) {
|
|
5723
|
+
let { target: n } = e, r = Ss(), i = e.value === Us, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
|
|
5597
5724
|
if (n.kind === "status" && n.statusGroup) {
|
|
5598
5725
|
let e = n.statusGroup.statuses.map((e) => ({
|
|
5599
5726
|
value: e.code,
|
|
@@ -5609,11 +5736,11 @@ function Ps({ row: e, onChange: t }) {
|
|
|
5609
5736
|
})
|
|
5610
5737
|
});
|
|
5611
5738
|
}
|
|
5612
|
-
let s =
|
|
5739
|
+
let s = qs(n);
|
|
5613
5740
|
return /* @__PURE__ */ y("div", {
|
|
5614
5741
|
"data-testid": `value-${n.code}`,
|
|
5615
5742
|
style: { position: "relative" },
|
|
5616
|
-
children: [
|
|
5743
|
+
children: [ys({
|
|
5617
5744
|
field: s,
|
|
5618
5745
|
fieldName: n.bare,
|
|
5619
5746
|
value: o ?? "",
|
|
@@ -5632,7 +5759,7 @@ function Ps({ row: e, onChange: t }) {
|
|
|
5632
5759
|
})]
|
|
5633
5760
|
});
|
|
5634
5761
|
}
|
|
5635
|
-
function
|
|
5762
|
+
function qs(e) {
|
|
5636
5763
|
if (e.kind === "field" && e.field) return e.field;
|
|
5637
5764
|
if (e.kind === "property" && e.property) {
|
|
5638
5765
|
let t = e.property;
|
|
@@ -5647,7 +5774,7 @@ function Fs(e) {
|
|
|
5647
5774
|
}
|
|
5648
5775
|
return { type: "string" };
|
|
5649
5776
|
}
|
|
5650
|
-
function
|
|
5777
|
+
function Js({ targets: t, onPick: n }) {
|
|
5651
5778
|
let [r, i] = f(!1);
|
|
5652
5779
|
return t.length === 0 ? null : r ? /* @__PURE__ */ v("div", {
|
|
5653
5780
|
"data-testid": "mass-edit-target-picker",
|
|
@@ -5674,7 +5801,7 @@ function Is({ targets: t, onPick: n }) {
|
|
|
5674
5801
|
children: [/* @__PURE__ */ v(e.plus, { size: 12 }), " Add target"]
|
|
5675
5802
|
});
|
|
5676
5803
|
}
|
|
5677
|
-
function
|
|
5804
|
+
function Ys(e, t) {
|
|
5678
5805
|
if (!t || t.length === 0 || e.kind !== "field") return;
|
|
5679
5806
|
let n, r = !1;
|
|
5680
5807
|
for (let i of t) {
|
|
@@ -5683,21 +5810,21 @@ function Ls(e, t) {
|
|
|
5683
5810
|
n = t, r = !0;
|
|
5684
5811
|
continue;
|
|
5685
5812
|
}
|
|
5686
|
-
if (n !== t) return
|
|
5813
|
+
if (n !== t) return Us;
|
|
5687
5814
|
}
|
|
5688
5815
|
return n;
|
|
5689
5816
|
}
|
|
5690
5817
|
//#endregion
|
|
5691
5818
|
//#region src/components/shared/ActionDialog.tsx
|
|
5692
|
-
var
|
|
5693
|
-
function
|
|
5819
|
+
var Xs = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*)$/;
|
|
5820
|
+
function Zs(e, t) {
|
|
5694
5821
|
if (typeof e != "string") return e ?? "";
|
|
5695
|
-
let n = e.match(
|
|
5822
|
+
let n = e.match(Xs);
|
|
5696
5823
|
if (!n) return e;
|
|
5697
5824
|
let r = n[1];
|
|
5698
5825
|
return t && r in t ? t[r] ?? "" : (typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row missing or has no field '${r}'`), "");
|
|
5699
5826
|
}
|
|
5700
|
-
function
|
|
5827
|
+
function Qs(e) {
|
|
5701
5828
|
return {
|
|
5702
5829
|
type: e.type ?? "string",
|
|
5703
5830
|
required: e.required,
|
|
@@ -5707,21 +5834,21 @@ function Bs(e) {
|
|
|
5707
5834
|
} : void 0,
|
|
5708
5835
|
enum: e.enum,
|
|
5709
5836
|
values: e.values,
|
|
5710
|
-
ref:
|
|
5837
|
+
ref: Ue(e.ref)
|
|
5711
5838
|
};
|
|
5712
5839
|
}
|
|
5713
|
-
function
|
|
5840
|
+
function $s(e, t) {
|
|
5714
5841
|
if (!e.includes("${")) return e;
|
|
5715
|
-
let n =
|
|
5842
|
+
let n = ks(e, { params: t });
|
|
5716
5843
|
return n == null ? "" : F(n);
|
|
5717
5844
|
}
|
|
5718
|
-
var
|
|
5719
|
-
function
|
|
5845
|
+
var ec = /\$\{\s*([^}]+?)\s*\}/g;
|
|
5846
|
+
function tc(e, t) {
|
|
5720
5847
|
let n = `params.${t}`;
|
|
5721
|
-
for (let t of e.matchAll(
|
|
5848
|
+
for (let t of e.matchAll(ec)) if (t[1] === n) return !0;
|
|
5722
5849
|
return !1;
|
|
5723
5850
|
}
|
|
5724
|
-
function
|
|
5851
|
+
function nc({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
5725
5852
|
let i = u(() => {
|
|
5726
5853
|
let t = r ? Object.entries(r) : [];
|
|
5727
5854
|
return [{
|
|
@@ -5739,12 +5866,12 @@ function Ws({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
5739
5866
|
placeholder: "Select status group…"
|
|
5740
5867
|
});
|
|
5741
5868
|
}
|
|
5742
|
-
function
|
|
5869
|
+
function rc({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
5743
5870
|
let a = u(() => {
|
|
5744
5871
|
if (!r) return [];
|
|
5745
5872
|
let t = e.filter?.status_group;
|
|
5746
5873
|
if (t) {
|
|
5747
|
-
let e =
|
|
5874
|
+
let e = $s(t, i);
|
|
5748
5875
|
return e && r[e] ? r[e].statuses : [];
|
|
5749
5876
|
}
|
|
5750
5877
|
return Object.values(r).flatMap((e) => e.statuses);
|
|
@@ -5766,8 +5893,8 @@ function Gs({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
5766
5893
|
placeholder: "Select status…"
|
|
5767
5894
|
});
|
|
5768
5895
|
}
|
|
5769
|
-
function
|
|
5770
|
-
let { data: d } = J(), p =
|
|
5896
|
+
function ic({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: s, row: c, bulkSelection: l }) {
|
|
5897
|
+
let { data: d } = J(), p = Ss(), m = r.resolved_params, h = r.resolved_hidden_defaults ?? {}, g = u(() => m ? Array.from(m) : [], [m]), b = u(() => {
|
|
5771
5898
|
if (!(!r.entity || !d)) return d.entities[r.entity]?.status_groups;
|
|
5772
5899
|
}, [r.entity, d]), x = u(() => {
|
|
5773
5900
|
if (!(!r.entity || !d)) return d.entities[r.entity];
|
|
@@ -5791,7 +5918,7 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5791
5918
|
e[t] = n.default === !0 || n.default === "true";
|
|
5792
5919
|
continue;
|
|
5793
5920
|
}
|
|
5794
|
-
e[t] =
|
|
5921
|
+
e[t] = Zs(n.default, c);
|
|
5795
5922
|
}
|
|
5796
5923
|
return e;
|
|
5797
5924
|
}, [
|
|
@@ -5809,7 +5936,7 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5809
5936
|
for (let [t, n] of m) {
|
|
5810
5937
|
if (n.type !== "status") continue;
|
|
5811
5938
|
let i = n.filter?.status_group;
|
|
5812
|
-
i &&
|
|
5939
|
+
i && tc(i, e) && (r[t] = "");
|
|
5813
5940
|
}
|
|
5814
5941
|
return r;
|
|
5815
5942
|
});
|
|
@@ -5836,21 +5963,27 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5836
5963
|
backdropFilter: "blur(2px)"
|
|
5837
5964
|
}
|
|
5838
5965
|
}), /* @__PURE__ */ y("div", {
|
|
5966
|
+
"data-testid": "action-dialog",
|
|
5967
|
+
role: "dialog",
|
|
5968
|
+
"aria-modal": "true",
|
|
5969
|
+
"aria-label": i,
|
|
5839
5970
|
style: {
|
|
5840
5971
|
position: "fixed",
|
|
5841
5972
|
top: "50%",
|
|
5842
5973
|
left: "50%",
|
|
5843
5974
|
transform: "translate(-50%, -50%)",
|
|
5844
5975
|
zIndex: 61,
|
|
5845
|
-
width:
|
|
5846
|
-
maxHeight: "
|
|
5976
|
+
width: "min(480px, calc(100vw - var(--safe-area-left) - var(--safe-area-right) - 16px))",
|
|
5977
|
+
maxHeight: "calc(var(--app-height) - var(--safe-area-top) - var(--safe-area-bottom) - 16px)",
|
|
5847
5978
|
background: "var(--surface)",
|
|
5848
5979
|
borderRadius: 12,
|
|
5849
5980
|
boxShadow: "var(--shadow-lg)",
|
|
5850
5981
|
border: "1px solid var(--border)",
|
|
5851
5982
|
overflow: "hidden",
|
|
5852
5983
|
display: "flex",
|
|
5853
|
-
flexDirection: "column"
|
|
5984
|
+
flexDirection: "column",
|
|
5985
|
+
boxSizing: "border-box",
|
|
5986
|
+
minWidth: 0
|
|
5854
5987
|
},
|
|
5855
5988
|
children: [
|
|
5856
5989
|
/* @__PURE__ */ y("div", {
|
|
@@ -5908,53 +6041,58 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5908
6041
|
display: "flex",
|
|
5909
6042
|
flexDirection: "column",
|
|
5910
6043
|
gap: 12,
|
|
5911
|
-
overflowY: "auto"
|
|
6044
|
+
overflowY: "auto",
|
|
6045
|
+
minWidth: 0,
|
|
6046
|
+
minHeight: 0
|
|
5912
6047
|
},
|
|
5913
6048
|
children: g.map(([e, t]) => {
|
|
5914
6049
|
let n = I(t.display?.name) || e;
|
|
5915
6050
|
if (t.type === "id_array") return null;
|
|
5916
6051
|
let r;
|
|
5917
|
-
return r = t.type === "entity_patch" ? /* @__PURE__ */ v(
|
|
6052
|
+
return r = t.type === "entity_patch" ? /* @__PURE__ */ v(Ws, {
|
|
5918
6053
|
entity: x,
|
|
5919
6054
|
filterTargets: typeof t.filter?.targets == "string" ? t.filter.targets : void 0,
|
|
5920
6055
|
selectedRows: l,
|
|
5921
6056
|
value: C[e] ?? {},
|
|
5922
6057
|
onChange: (t) => D(e, t)
|
|
5923
|
-
}) : t.type === "status_group" ? /* @__PURE__ */ v(
|
|
6058
|
+
}) : t.type === "status_group" ? /* @__PURE__ */ v(nc, {
|
|
5924
6059
|
param: t,
|
|
5925
6060
|
value: C[e],
|
|
5926
6061
|
onChange: (t) => D(e, t),
|
|
5927
6062
|
statusGroups: b,
|
|
5928
6063
|
formData: C
|
|
5929
|
-
}) : t.type === "status" ? /* @__PURE__ */ v(
|
|
6064
|
+
}) : t.type === "status" ? /* @__PURE__ */ v(rc, {
|
|
5930
6065
|
param: t,
|
|
5931
6066
|
value: C[e],
|
|
5932
6067
|
onChange: (t) => D(e, t),
|
|
5933
6068
|
statusGroups: b,
|
|
5934
6069
|
formData: C
|
|
5935
|
-
}) :
|
|
5936
|
-
field:
|
|
6070
|
+
}) : ys({
|
|
6071
|
+
field: Qs(t),
|
|
5937
6072
|
fieldName: e,
|
|
5938
6073
|
value: C[e],
|
|
5939
6074
|
mode: "edit",
|
|
5940
6075
|
onChange: (t) => D(e, t),
|
|
5941
6076
|
locale: p
|
|
5942
|
-
}), /* @__PURE__ */ y("div", {
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
6077
|
+
}), /* @__PURE__ */ y("div", {
|
|
6078
|
+
style: { minWidth: 0 },
|
|
6079
|
+
children: [
|
|
6080
|
+
/* @__PURE__ */ v(be, {
|
|
6081
|
+
required: t.required,
|
|
6082
|
+
children: n
|
|
6083
|
+
}),
|
|
6084
|
+
r,
|
|
6085
|
+
t.display?.description && /* @__PURE__ */ v("p", {
|
|
6086
|
+
style: {
|
|
6087
|
+
fontSize: 11,
|
|
6088
|
+
color: "var(--text-3)",
|
|
6089
|
+
marginTop: 4,
|
|
6090
|
+
marginBottom: 0
|
|
6091
|
+
},
|
|
6092
|
+
children: I(t.display.description)
|
|
6093
|
+
})
|
|
6094
|
+
]
|
|
6095
|
+
}, e);
|
|
5958
6096
|
})
|
|
5959
6097
|
}),
|
|
5960
6098
|
/* @__PURE__ */ y("div", {
|
|
@@ -5963,8 +6101,11 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5963
6101
|
borderTop: "1px solid var(--divider)",
|
|
5964
6102
|
display: "flex",
|
|
5965
6103
|
alignItems: "center",
|
|
6104
|
+
justifyContent: "flex-end",
|
|
5966
6105
|
gap: 8,
|
|
5967
|
-
background: "var(--surface-2)"
|
|
6106
|
+
background: "var(--surface-2)",
|
|
6107
|
+
flexWrap: "wrap",
|
|
6108
|
+
minWidth: 0
|
|
5968
6109
|
},
|
|
5969
6110
|
children: [
|
|
5970
6111
|
/* @__PURE__ */ v("div", { style: { flex: 1 } }),
|
|
@@ -5975,7 +6116,7 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5975
6116
|
}),
|
|
5976
6117
|
/* @__PURE__ */ v(T, {
|
|
5977
6118
|
kind: "primary",
|
|
5978
|
-
icon: v(s ?
|
|
6119
|
+
icon: v(s ? ye : e.bolt, { size: 13 }),
|
|
5979
6120
|
onClick: O,
|
|
5980
6121
|
disabled: s,
|
|
5981
6122
|
children: s ? "Executing…" : "Execute"
|
|
@@ -5987,29 +6128,42 @@ function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5987
6128
|
}
|
|
5988
6129
|
//#endregion
|
|
5989
6130
|
//#region src/components/shared/ActionResultDialog.tsx
|
|
5990
|
-
function
|
|
5991
|
-
|
|
6131
|
+
function ac({ open: t, onClose: n, display: r }) {
|
|
6132
|
+
let i = d(null);
|
|
6133
|
+
return c(() => {
|
|
6134
|
+
t && i.current?.focus();
|
|
6135
|
+
}, [t]), t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", { style: {
|
|
5992
6136
|
position: "fixed",
|
|
5993
6137
|
inset: 0,
|
|
5994
6138
|
background: "var(--scrim)",
|
|
5995
6139
|
zIndex: 60,
|
|
5996
6140
|
backdropFilter: "blur(2px)"
|
|
5997
6141
|
} }), /* @__PURE__ */ y("div", {
|
|
6142
|
+
ref: i,
|
|
6143
|
+
role: "dialog",
|
|
6144
|
+
"aria-modal": "true",
|
|
6145
|
+
"aria-label": r.title ?? "Action Result",
|
|
6146
|
+
tabIndex: -1,
|
|
6147
|
+
onKeyDown: (e) => {
|
|
6148
|
+
e.key === "Escape" && n();
|
|
6149
|
+
},
|
|
5998
6150
|
style: {
|
|
5999
6151
|
position: "fixed",
|
|
6000
6152
|
top: "50%",
|
|
6001
6153
|
left: "50%",
|
|
6002
6154
|
transform: "translate(-50%, -50%)",
|
|
6003
6155
|
zIndex: 61,
|
|
6004
|
-
width:
|
|
6005
|
-
|
|
6156
|
+
width: "calc(100vw - 24px)",
|
|
6157
|
+
maxWidth: 480,
|
|
6158
|
+
maxHeight: "calc(var(--app-height) - var(--safe-area-top) - var(--safe-area-bottom) - 16px)",
|
|
6006
6159
|
background: "var(--surface)",
|
|
6007
6160
|
borderRadius: 12,
|
|
6008
6161
|
boxShadow: "var(--shadow-lg)",
|
|
6009
6162
|
border: "1px solid var(--border)",
|
|
6010
6163
|
overflow: "hidden",
|
|
6011
6164
|
display: "flex",
|
|
6012
|
-
flexDirection: "column"
|
|
6165
|
+
flexDirection: "column",
|
|
6166
|
+
outline: "none"
|
|
6013
6167
|
},
|
|
6014
6168
|
children: [
|
|
6015
6169
|
/* @__PURE__ */ y("div", {
|
|
@@ -6069,7 +6223,7 @@ function qs({ open: t, onClose: n, display: r }) {
|
|
|
6069
6223
|
gap: 12,
|
|
6070
6224
|
overflowY: "auto"
|
|
6071
6225
|
},
|
|
6072
|
-
children: r.fields.map((e, t) => /* @__PURE__ */ v(
|
|
6226
|
+
children: r.fields.map((e, t) => /* @__PURE__ */ v(oc, { field: e }, t))
|
|
6073
6227
|
}),
|
|
6074
6228
|
/* @__PURE__ */ y("div", {
|
|
6075
6229
|
style: {
|
|
@@ -6077,8 +6231,11 @@ function qs({ open: t, onClose: n, display: r }) {
|
|
|
6077
6231
|
borderTop: "1px solid var(--divider)",
|
|
6078
6232
|
display: "flex",
|
|
6079
6233
|
alignItems: "center",
|
|
6234
|
+
justifyContent: "flex-end",
|
|
6235
|
+
flexWrap: "wrap",
|
|
6080
6236
|
gap: 8,
|
|
6081
|
-
background: "var(--surface-2)"
|
|
6237
|
+
background: "var(--surface-2)",
|
|
6238
|
+
flexShrink: 0
|
|
6082
6239
|
},
|
|
6083
6240
|
children: [/* @__PURE__ */ v("div", { style: { flex: 1 } }), /* @__PURE__ */ v(T, {
|
|
6084
6241
|
kind: "primary",
|
|
@@ -6089,7 +6246,7 @@ function qs({ open: t, onClose: n, display: r }) {
|
|
|
6089
6246
|
]
|
|
6090
6247
|
})] }) : null;
|
|
6091
6248
|
}
|
|
6092
|
-
function
|
|
6249
|
+
function oc({ field: e }) {
|
|
6093
6250
|
return /* @__PURE__ */ y("div", {
|
|
6094
6251
|
style: {
|
|
6095
6252
|
display: "flex",
|
|
@@ -6126,14 +6283,14 @@ function Js({ field: e }) {
|
|
|
6126
6283
|
top: 4,
|
|
6127
6284
|
right: 4
|
|
6128
6285
|
},
|
|
6129
|
-
children: /* @__PURE__ */ v(
|
|
6286
|
+
children: /* @__PURE__ */ v(di, { value: e.value })
|
|
6130
6287
|
})]
|
|
6131
6288
|
})]
|
|
6132
6289
|
});
|
|
6133
6290
|
}
|
|
6134
6291
|
//#endregion
|
|
6135
6292
|
//#region src/components/shared/ActionRunner.tsx
|
|
6136
|
-
function
|
|
6293
|
+
function sc(e) {
|
|
6137
6294
|
if (!e || typeof e != "object") return { kind: "success" };
|
|
6138
6295
|
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;
|
|
6139
6296
|
if (n === "partial") {
|
|
@@ -6148,20 +6305,20 @@ function Ys(e) {
|
|
|
6148
6305
|
detail: "No items matched"
|
|
6149
6306
|
} : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
|
|
6150
6307
|
}
|
|
6151
|
-
function
|
|
6308
|
+
function cc(e) {
|
|
6152
6309
|
if (!e || typeof e != "object") return null;
|
|
6153
6310
|
let t = e.result;
|
|
6154
6311
|
if (!t || typeof t != "object") return null;
|
|
6155
6312
|
let n = t.$display;
|
|
6156
6313
|
return !n || typeof n != "object" ? null : n;
|
|
6157
6314
|
}
|
|
6158
|
-
function
|
|
6315
|
+
function lc(e) {
|
|
6159
6316
|
if (!e || typeof e != "object") return;
|
|
6160
6317
|
let t = e.result;
|
|
6161
6318
|
!t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
|
|
6162
6319
|
}
|
|
6163
|
-
function
|
|
6164
|
-
if (e instanceof
|
|
6320
|
+
function uc(e) {
|
|
6321
|
+
if (e instanceof Xr) {
|
|
6165
6322
|
let t = e.response.errors ?? [];
|
|
6166
6323
|
if (t.length === 1) return {
|
|
6167
6324
|
kind: "error",
|
|
@@ -6181,23 +6338,23 @@ function Qs(e) {
|
|
|
6181
6338
|
detail: e instanceof Error ? e.message : String(e)
|
|
6182
6339
|
};
|
|
6183
6340
|
}
|
|
6184
|
-
var
|
|
6185
|
-
function
|
|
6186
|
-
let e = s(
|
|
6341
|
+
var dc = r(null);
|
|
6342
|
+
function fc() {
|
|
6343
|
+
let e = s(dc);
|
|
6187
6344
|
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
6188
6345
|
return e;
|
|
6189
6346
|
}
|
|
6190
|
-
function
|
|
6347
|
+
function pc(e) {
|
|
6191
6348
|
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
6192
6349
|
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
6193
6350
|
return t;
|
|
6194
6351
|
}
|
|
6195
|
-
function
|
|
6196
|
-
let t =
|
|
6352
|
+
function mc({ children: e }) {
|
|
6353
|
+
let t = Dr(), { data: n } = J(), [r, i] = f(null), [a, s] = f(null), c = o((e) => {
|
|
6197
6354
|
if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
|
|
6198
6355
|
}, [n?.screens]), l = o((e, n, r, i, a) => {
|
|
6199
6356
|
let o = () => {
|
|
6200
|
-
let n =
|
|
6357
|
+
let n = hc(a), i = c(r), o = n ? `Job ${n} queued` : "Running in background";
|
|
6201
6358
|
Z.success(`${e} started`, o, i ? { action: {
|
|
6202
6359
|
label: "View",
|
|
6203
6360
|
onClick: () => t(i)
|
|
@@ -6236,16 +6393,16 @@ function nc({ children: e }) {
|
|
|
6236
6393
|
pending: !1
|
|
6237
6394
|
}), Promise.resolve()) : (async (n) => {
|
|
6238
6395
|
try {
|
|
6239
|
-
let i = await e.execute(n), o =
|
|
6396
|
+
let i = await e.execute(n), o = sc(i);
|
|
6240
6397
|
if (l(a, r, t, o, i), o.kind === "success" || o.kind === "accepted") {
|
|
6241
6398
|
e.onSuccess?.(i);
|
|
6242
|
-
let t =
|
|
6243
|
-
t && s(t),
|
|
6399
|
+
let t = cc(i);
|
|
6400
|
+
t && s(t), lc(i);
|
|
6244
6401
|
}
|
|
6245
6402
|
} catch (e) {
|
|
6246
|
-
l(a, r, t,
|
|
6403
|
+
l(a, r, t, uc(e));
|
|
6247
6404
|
}
|
|
6248
|
-
})(
|
|
6405
|
+
})(pc(e));
|
|
6249
6406
|
}, [l]), p = u(() => ({ run: d }), [d]), m = r?.opts.action, h = o(async (e) => {
|
|
6250
6407
|
if (!r) return;
|
|
6251
6408
|
let t = r.id, n = r, a = n.opts.action, o = n.opts.longRunning ?? a?.long_running ?? !1;
|
|
@@ -6254,15 +6411,15 @@ function nc({ children: e }) {
|
|
|
6254
6411
|
pending: !0
|
|
6255
6412
|
} : e);
|
|
6256
6413
|
try {
|
|
6257
|
-
let r = await n.opts.execute(e), c =
|
|
6414
|
+
let r = await n.opts.execute(e), c = sc(r);
|
|
6258
6415
|
if (l(n.title, o, a, c, r), c.kind === "success" || c.kind === "accepted") {
|
|
6259
6416
|
n.opts.onSuccess?.(r);
|
|
6260
|
-
let e =
|
|
6261
|
-
e && s(e),
|
|
6417
|
+
let e = cc(r);
|
|
6418
|
+
e && s(e), lc(r);
|
|
6262
6419
|
}
|
|
6263
6420
|
c.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
6264
6421
|
} catch (e) {
|
|
6265
|
-
l(n.title, o, a,
|
|
6422
|
+
l(n.title, o, a, uc(e));
|
|
6266
6423
|
} finally {
|
|
6267
6424
|
i((e) => e?.id === t ? {
|
|
6268
6425
|
...e,
|
|
@@ -6270,16 +6427,16 @@ function nc({ children: e }) {
|
|
|
6270
6427
|
} : e);
|
|
6271
6428
|
}
|
|
6272
6429
|
}, [r, l]);
|
|
6273
|
-
return /* @__PURE__ */ y(
|
|
6430
|
+
return /* @__PURE__ */ y(dc.Provider, {
|
|
6274
6431
|
value: p,
|
|
6275
6432
|
children: [
|
|
6276
6433
|
e,
|
|
6277
|
-
a && /* @__PURE__ */ v(
|
|
6434
|
+
a && /* @__PURE__ */ v(ac, {
|
|
6278
6435
|
open: !0,
|
|
6279
6436
|
onClose: () => s(null),
|
|
6280
6437
|
display: a
|
|
6281
6438
|
}),
|
|
6282
|
-
r?.kind === "params" && m && /* @__PURE__ */ v(
|
|
6439
|
+
r?.kind === "params" && m && /* @__PURE__ */ v(ic, {
|
|
6283
6440
|
open: !0,
|
|
6284
6441
|
onOpenChange: (e) => {
|
|
6285
6442
|
e || i(null);
|
|
@@ -6290,21 +6447,21 @@ function nc({ children: e }) {
|
|
|
6290
6447
|
isPending: r.pending,
|
|
6291
6448
|
bulkSelection: r.opts.bulkSelection
|
|
6292
6449
|
}),
|
|
6293
|
-
r?.kind === "confirm" && /* @__PURE__ */ v(
|
|
6450
|
+
r?.kind === "confirm" && /* @__PURE__ */ v(gc, {
|
|
6294
6451
|
state: r,
|
|
6295
6452
|
onClose: () => i(null),
|
|
6296
6453
|
onExecute: async (e) => {
|
|
6297
6454
|
let t = r.id, n = r, a = n.opts.action, o = n.opts.longRunning ?? a?.long_running ?? !1, c = !1;
|
|
6298
6455
|
try {
|
|
6299
|
-
let t = await n.opts.execute(e), r =
|
|
6456
|
+
let t = await n.opts.execute(e), r = sc(t);
|
|
6300
6457
|
if (l(n.title, o, a, r, t), r.kind === "success" || r.kind === "accepted") {
|
|
6301
6458
|
n.opts.onSuccess?.(t);
|
|
6302
|
-
let e =
|
|
6303
|
-
e && s(e),
|
|
6459
|
+
let e = cc(t);
|
|
6460
|
+
e && s(e), lc(t);
|
|
6304
6461
|
}
|
|
6305
6462
|
c = r.kind === "partial";
|
|
6306
6463
|
} catch (e) {
|
|
6307
|
-
l(n.title, o, a,
|
|
6464
|
+
l(n.title, o, a, uc(e));
|
|
6308
6465
|
} finally {
|
|
6309
6466
|
c || i((e) => e?.id === t ? null : e);
|
|
6310
6467
|
}
|
|
@@ -6313,12 +6470,12 @@ function nc({ children: e }) {
|
|
|
6313
6470
|
]
|
|
6314
6471
|
});
|
|
6315
6472
|
}
|
|
6316
|
-
function
|
|
6473
|
+
function hc(e) {
|
|
6317
6474
|
if (!e || typeof e != "object") return;
|
|
6318
6475
|
let t = e, n = t.job_id ?? t.id;
|
|
6319
6476
|
return typeof n == "string" ? n : void 0;
|
|
6320
6477
|
}
|
|
6321
|
-
function
|
|
6478
|
+
function gc({ state: t, onClose: n, onExecute: r }) {
|
|
6322
6479
|
let { title: i, opts: a } = t, [o, s] = f(!1), c = a.action, l = a.destructive ?? c?.destructive ?? !1;
|
|
6323
6480
|
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
|
|
6324
6481
|
onClick: n,
|
|
@@ -6404,11 +6561,11 @@ function ic({ state: t, onClose: n, onExecute: r }) {
|
|
|
6404
6561
|
/* @__PURE__ */ v(T, {
|
|
6405
6562
|
kind: "primary",
|
|
6406
6563
|
danger: l,
|
|
6407
|
-
icon: v(o ?
|
|
6564
|
+
icon: v(o ? ye : e.bolt, { size: 13 }),
|
|
6408
6565
|
onClick: async () => {
|
|
6409
6566
|
s(!0);
|
|
6410
6567
|
try {
|
|
6411
|
-
await r(
|
|
6568
|
+
await r(pc(a));
|
|
6412
6569
|
} finally {
|
|
6413
6570
|
s(!1);
|
|
6414
6571
|
}
|
|
@@ -6420,4 +6577,4 @@ function ic({ state: t, onClose: n, onExecute: r }) {
|
|
|
6420
6577
|
})] });
|
|
6421
6578
|
}
|
|
6422
6579
|
//#endregion
|
|
6423
|
-
export { Z as $,
|
|
6580
|
+
export { Z as $, nt as $t, Ii as A, ve as An, dn as At, Wr as B, D as Bn, wt as Bt, Oa as C, Ne as Cn, Dn as Ct, la as D, N as Dn, W as Dt, ma as E, Se as En, jn as Et, yi as F, ge as Fn, Et as Ft, Ur as G, dt as Gt, qr as H, T as Hn, ht as Ht, di as I, M as In, Tt as It, Jr as J, it as Jt, Hr as K, z as Kt, li as L, oe as Ln, xt as Lt, Li as M, se as Mn, fn as Mt, Fi as N, he as Nn, Mt as Nt, Vi as O, Pe as On, K as Ot, xi as P, ue as Pn, Ft as Pt, Gr as Q, tt as Qt, Xr as R, k as Rn, yt as Rt, va as S, Fe as Sn, An as St, ha as T, je as Tn, Pn as Tt, ai as U, gt as Ut, Kr as V, E as Vn, mt as Vt, Yr as W, ft as Wt, ii as X, Le as Xt, ei as Y, ot as Yt, ri as Z, et as Zt, Pa as _, Ie as _n, kn as _t, Us as a, R as an, xr as at, Da as b, Me as bn, In as bt, zs as c, Qe as cn, _r as ct, Ls as d, Ge as dn, $n as dt, We as en, Dr as et, ws as f, $e as fn, ir as ft, Ma as g, F as gn, En as gt, _s as h, Ze as hn, Rn as ht, ic as i, Re as in, wr as it, Ri as j, _e as jn, pn as jt, zi as k, ye as kn, q as kt, Rs as l, Xe as ln, vr as lt, ys as m, Ve as mn, zn as mt, fc as n, qe as nn, Or as nt, Ws as o, I as on, yr as ot, Ss as p, L as pn, J as pt, oi as q, at as qt, ac as r, He as rn, Er as rt, Ys as s, Je as sn, br as st, mc as t, Ke as tn, kr as tt, Ms as u, Ye as un, lr as ut, Na as v, Ee as vn, Ln as vt, ua as w, P as wn, On as wt, Aa as x, Ae as xn, Nn as xt, Q as y, be as yn, Fn as yt, Qr as z, O as zn, bt as zt };
|