@realtek/core-theme-live 0.0.380 → 0.0.381
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/{dependencyBusy-BOOD_t7i.cjs → dependencyBusy-BigmJgbk.cjs} +3 -3
- package/dist-lib/dependencyBusy-BigmJgbk.cjs.map +1 -0
- package/dist-lib/{dependencyBusy-DxiLAocF.js → dependencyBusy-_RkqSj9m.js} +713 -703
- package/dist-lib/dependencyBusy-_RkqSj9m.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +13944 -13845
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/style.css +1 -1
- package/package.json +1 -1
- package/dist-lib/dependencyBusy-BOOD_t7i.cjs.map +0 -1
- package/dist-lib/dependencyBusy-DxiLAocF.js.map +0 -1
|
@@ -2411,7 +2411,16 @@ async function hi(e, t = 10, n = 0, r = {}) {
|
|
|
2411
2411
|
}), d = String(i ?? "").trim();
|
|
2412
2412
|
return d && u.set("scope", d), o && u.set("sort", o), c && u.set("sortDir", c), Array.isArray(l) && l.some((e) => e?.field) && u.set("filters", JSON.stringify(l)), a(s, `/module-data-list?${u.toString()}`);
|
|
2413
2413
|
}
|
|
2414
|
-
async function gi(e, t
|
|
2414
|
+
async function gi(e, t) {
|
|
2415
|
+
if (!e || !t) return null;
|
|
2416
|
+
try {
|
|
2417
|
+
let n = await a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`), r = n?.data?.data ?? n?.data ?? n, i = Array.isArray(r) ? r[0] : r;
|
|
2418
|
+
return i && typeof i == "object" ? i : null;
|
|
2419
|
+
} catch {
|
|
2420
|
+
return null;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
async function _i(e, t = {}, n = {}, r = {}) {
|
|
2415
2424
|
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f = ui(u || String(t.selectedSource ?? "").split(",")), p = new URLSearchParams();
|
|
2416
2425
|
p.append("module", si(e)), p.append("limit", String(i)), p.append("offset", String(o)), f && (p.set("scope", f), console.log("[searchModuleData] Adding scope to query:", f)), c && p.set("sort", c), l && p.set("sortDir", l), Array.isArray(d) && d.some((e) => e?.field) && p.set("filters", JSON.stringify(d)), console.log("[searchModuleData] Final query string:", p.toString()), Object.entries(t).forEach(([e, t]) => {
|
|
2417
2426
|
if (t == null || t === "") return;
|
|
@@ -2431,9 +2440,9 @@ async function gi(e, t = {}, n = {}, r = {}) {
|
|
|
2431
2440
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
2432
2441
|
b = e(m, m)?.data?.data ?? g;
|
|
2433
2442
|
} catch (e) {
|
|
2434
|
-
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(
|
|
2443
|
+
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(bi);
|
|
2435
2444
|
}
|
|
2436
|
-
else b = Array.isArray(g) ? g.map(
|
|
2445
|
+
else b = Array.isArray(g) ? g.map(bi) : [];
|
|
2437
2446
|
return {
|
|
2438
2447
|
rows: b,
|
|
2439
2448
|
total: Number(_) || 0,
|
|
@@ -2446,10 +2455,10 @@ async function gi(e, t = {}, n = {}, r = {}) {
|
|
|
2446
2455
|
columnActions: h?.columnActions ?? []
|
|
2447
2456
|
};
|
|
2448
2457
|
}
|
|
2449
|
-
function
|
|
2458
|
+
function vi(e, t) {
|
|
2450
2459
|
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
2451
2460
|
}
|
|
2452
|
-
function
|
|
2461
|
+
function yi(e, t, n) {
|
|
2453
2462
|
let r = String(t).split(".").filter(Boolean);
|
|
2454
2463
|
if (!r.length) return e;
|
|
2455
2464
|
let i = { ...e }, a = i, o = e;
|
|
@@ -2458,7 +2467,7 @@ function vi(e, t, n) {
|
|
|
2458
2467
|
a[e] = n, a = n, o = t;
|
|
2459
2468
|
}), a[r[r.length - 1]] = n, i;
|
|
2460
2469
|
}
|
|
2461
|
-
function
|
|
2470
|
+
function bi(e) {
|
|
2462
2471
|
if (!e || typeof e != "object") return e;
|
|
2463
2472
|
let t = [
|
|
2464
2473
|
"skills",
|
|
@@ -2468,11 +2477,11 @@ function yi(e) {
|
|
|
2468
2477
|
"customFields.diceProfileData.skills"
|
|
2469
2478
|
], n = e, r = null;
|
|
2470
2479
|
if (t.forEach((e) => {
|
|
2471
|
-
let t =
|
|
2480
|
+
let t = vi(n, e);
|
|
2472
2481
|
if (t == null) return;
|
|
2473
2482
|
let i = c(t);
|
|
2474
|
-
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n =
|
|
2475
|
-
}), r &&
|
|
2483
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = yi(n, e, i));
|
|
2484
|
+
}), r && vi(n, "skills") === void 0 && (n = yi(n, "skills", r)), [
|
|
2476
2485
|
n?.sourceType,
|
|
2477
2486
|
n?.profileSource,
|
|
2478
2487
|
n?.selectedSource,
|
|
@@ -2491,10 +2500,10 @@ function yi(e) {
|
|
|
2491
2500
|
}
|
|
2492
2501
|
//#endregion
|
|
2493
2502
|
//#region src/services/documentApi.js
|
|
2494
|
-
function
|
|
2503
|
+
function xi(e) {
|
|
2495
2504
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
2496
2505
|
}
|
|
2497
|
-
async function
|
|
2506
|
+
async function Si(e, t, n = [], i = {}) {
|
|
2498
2507
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
2499
2508
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
2500
2509
|
if (!n.length) return {
|
|
@@ -2504,7 +2513,7 @@ async function xi(e, t, n = [], i = {}) {
|
|
|
2504
2513
|
let a = await r(), o = new FormData();
|
|
2505
2514
|
n.forEach(({ formKey: e, file: t }) => {
|
|
2506
2515
|
let n = t?.name ?? void 0;
|
|
2507
|
-
o.append(
|
|
2516
|
+
o.append(xi(e), t, n);
|
|
2508
2517
|
}), i && Object.keys(i).length > 0 && o.append("metadata", JSON.stringify(i));
|
|
2509
2518
|
let c = new URLSearchParams({
|
|
2510
2519
|
module: e,
|
|
@@ -2520,7 +2529,7 @@ async function xi(e, t, n = [], i = {}) {
|
|
|
2520
2529
|
}
|
|
2521
2530
|
return u?.data ?? u;
|
|
2522
2531
|
}
|
|
2523
|
-
async function
|
|
2532
|
+
async function Ci(e, t, n = "") {
|
|
2524
2533
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
2525
2534
|
if (!t) throw Error("refId is required to fetch documents");
|
|
2526
2535
|
let r = new URLSearchParams({
|
|
@@ -2534,7 +2543,7 @@ async function Si(e, t, n = "") {
|
|
|
2534
2543
|
total: o?.total ?? 0
|
|
2535
2544
|
};
|
|
2536
2545
|
}
|
|
2537
|
-
async function
|
|
2546
|
+
async function wi(e) {
|
|
2538
2547
|
if (!e) return !1;
|
|
2539
2548
|
try {
|
|
2540
2549
|
return await a(s, `/documents/${encodeURIComponent(String(e))}`, { method: "DELETE" }), !0;
|
|
@@ -2544,36 +2553,36 @@ async function Ci(e) {
|
|
|
2544
2553
|
}
|
|
2545
2554
|
//#endregion
|
|
2546
2555
|
//#region src/services/detailedViewApi.js
|
|
2547
|
-
var
|
|
2556
|
+
var Ti = {
|
|
2548
2557
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2549
2558
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2550
2559
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2551
2560
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2552
2561
|
};
|
|
2553
|
-
async function
|
|
2562
|
+
async function Ei(e, t) {
|
|
2554
2563
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2555
2564
|
if (n === "job" || n === "jobs") {
|
|
2556
2565
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2557
2566
|
return e(t);
|
|
2558
2567
|
}
|
|
2559
|
-
if (n === "candidate" || n === "candidates") return
|
|
2568
|
+
if (n === "candidate" || n === "candidates") return Oi(n === "candidate" ? "candidate" : "candidates", t);
|
|
2560
2569
|
let r = new URLSearchParams({
|
|
2561
2570
|
module: String(e ?? ""),
|
|
2562
2571
|
id: String(t)
|
|
2563
2572
|
});
|
|
2564
2573
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2565
2574
|
}
|
|
2566
|
-
async function
|
|
2575
|
+
async function Di(e) {
|
|
2567
2576
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2568
2577
|
return {
|
|
2569
2578
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2570
2579
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2571
2580
|
};
|
|
2572
2581
|
}
|
|
2573
|
-
async function
|
|
2582
|
+
async function Oi(e, t) {
|
|
2574
2583
|
if (!e) throw Error("module is required");
|
|
2575
2584
|
if (!t) throw Error("id is required");
|
|
2576
|
-
let n =
|
|
2585
|
+
let n = Ti[e];
|
|
2577
2586
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2578
2587
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2579
2588
|
method: "GET",
|
|
@@ -2586,7 +2595,7 @@ async function Di(e, t) {
|
|
|
2586
2595
|
let o = await a.json();
|
|
2587
2596
|
return o.data ?? o;
|
|
2588
2597
|
}
|
|
2589
|
-
async function
|
|
2598
|
+
async function ki(e, t, n, i = []) {
|
|
2590
2599
|
if (!e) throw Error("module is required");
|
|
2591
2600
|
if (!t) throw Error("id is required");
|
|
2592
2601
|
let a = await r(), o = new FormData();
|
|
@@ -2599,15 +2608,15 @@ async function Oi(e, t, n, i = []) {
|
|
|
2599
2608
|
if (!c.ok) {
|
|
2600
2609
|
let e = await c.text();
|
|
2601
2610
|
console.error("[updateRecord] Error response:", e);
|
|
2602
|
-
let t = Error(
|
|
2603
|
-
throw t.status = c.status, t.response =
|
|
2611
|
+
let t = Error(ji(e) || `API ${c.status}: ${c.statusText}`);
|
|
2612
|
+
throw t.status = c.status, t.response = Ai(e), t;
|
|
2604
2613
|
}
|
|
2605
2614
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2606
2615
|
l();
|
|
2607
2616
|
let u = await c.json();
|
|
2608
2617
|
return u.data ?? u;
|
|
2609
2618
|
}
|
|
2610
|
-
function
|
|
2619
|
+
function Ai(e) {
|
|
2611
2620
|
let t = String(e ?? "").trim();
|
|
2612
2621
|
if (!t.startsWith("{")) return null;
|
|
2613
2622
|
try {
|
|
@@ -2616,7 +2625,7 @@ function ki(e) {
|
|
|
2616
2625
|
return null;
|
|
2617
2626
|
}
|
|
2618
2627
|
}
|
|
2619
|
-
function
|
|
2628
|
+
function ji(e) {
|
|
2620
2629
|
let t = String(e ?? "").trim();
|
|
2621
2630
|
if (!t.startsWith("{")) return t;
|
|
2622
2631
|
try {
|
|
@@ -2626,22 +2635,22 @@ function Ai(e) {
|
|
|
2626
2635
|
return t;
|
|
2627
2636
|
}
|
|
2628
2637
|
}
|
|
2629
|
-
var
|
|
2630
|
-
async function
|
|
2638
|
+
var Mi = (e) => e?.data ?? e;
|
|
2639
|
+
async function Ni(e, t) {
|
|
2631
2640
|
if (!e || !t) return [];
|
|
2632
2641
|
let n = new URLSearchParams({
|
|
2633
2642
|
module: e,
|
|
2634
2643
|
id: String(t)
|
|
2635
|
-
}), r =
|
|
2644
|
+
}), r = Mi(await a(s, `/module-activity?${n.toString()}`));
|
|
2636
2645
|
return Array.isArray(r) ? r : [];
|
|
2637
2646
|
}
|
|
2638
|
-
async function
|
|
2647
|
+
async function Pi(e) {
|
|
2639
2648
|
if (!e) return [];
|
|
2640
|
-
let t =
|
|
2649
|
+
let t = Mi(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2641
2650
|
return Array.isArray(t) ? t : [];
|
|
2642
2651
|
}
|
|
2643
|
-
async function
|
|
2644
|
-
return
|
|
2652
|
+
async function Fi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2653
|
+
return Mi(await a(s, "/notes", {
|
|
2645
2654
|
method: "POST",
|
|
2646
2655
|
body: JSON.stringify({
|
|
2647
2656
|
relatedId: e,
|
|
@@ -2653,19 +2662,19 @@ async function Pi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2653
2662
|
}
|
|
2654
2663
|
//#endregion
|
|
2655
2664
|
//#region src/utils/roleFormPermissionGate.js
|
|
2656
|
-
function
|
|
2665
|
+
function Ii(e, t) {
|
|
2657
2666
|
if (!e) return !0;
|
|
2658
2667
|
let n = e.find((e) => e.name === t);
|
|
2659
2668
|
return !n || n.enabled !== !1;
|
|
2660
2669
|
}
|
|
2661
|
-
function
|
|
2670
|
+
function Li(e, t, n) {
|
|
2662
2671
|
if (!e) return !0;
|
|
2663
2672
|
let r = e.find((e) => e.name === t);
|
|
2664
2673
|
if (!r) return !0;
|
|
2665
2674
|
let i = r.fields?.find((e) => e.field === n);
|
|
2666
2675
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2667
2676
|
}
|
|
2668
|
-
function
|
|
2677
|
+
function Ri(e, t, n) {
|
|
2669
2678
|
if (!e) return !0;
|
|
2670
2679
|
let r = e.find((e) => e.name === t);
|
|
2671
2680
|
if (!r) return !0;
|
|
@@ -2675,7 +2684,7 @@ function Li(e, t, n) {
|
|
|
2675
2684
|
}
|
|
2676
2685
|
//#endregion
|
|
2677
2686
|
//#region src/components/form/inputSecurity.js
|
|
2678
|
-
var
|
|
2687
|
+
var zi = [
|
|
2679
2688
|
"p",
|
|
2680
2689
|
"br",
|
|
2681
2690
|
"strong",
|
|
@@ -2697,12 +2706,12 @@ var Ri = [
|
|
|
2697
2706
|
"a",
|
|
2698
2707
|
"code",
|
|
2699
2708
|
"pre"
|
|
2700
|
-
],
|
|
2709
|
+
], Bi = [
|
|
2701
2710
|
"href",
|
|
2702
2711
|
"title",
|
|
2703
2712
|
"target",
|
|
2704
2713
|
"rel"
|
|
2705
|
-
],
|
|
2714
|
+
], Vi = /[\u200B-\u200D\u2060\uFEFF]/g, Hi = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, Ui = /^[\p{L}\p{M}\p{N} .'-]+$/u, Wi = /^\+?[0-9 ()-]+$/, Gi = /^-?(?:\d+|\d*\.\d+)$/, Ki = [
|
|
2706
2715
|
{
|
|
2707
2716
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2708
2717
|
message: "HTML/script content is not allowed"
|
|
@@ -2729,12 +2738,12 @@ var Ri = [
|
|
|
2729
2738
|
plainOnly: !0
|
|
2730
2739
|
}
|
|
2731
2740
|
];
|
|
2732
|
-
function
|
|
2741
|
+
function qi(e) {
|
|
2733
2742
|
if (typeof document > "u") return e;
|
|
2734
2743
|
let t = document.createElement("textarea");
|
|
2735
2744
|
return t.innerHTML = e, t.value;
|
|
2736
2745
|
}
|
|
2737
|
-
function
|
|
2746
|
+
function Ji(e) {
|
|
2738
2747
|
let t = String(e ?? "");
|
|
2739
2748
|
for (let e = 0; e < 2; e += 1) try {
|
|
2740
2749
|
let e = decodeURIComponent(t);
|
|
@@ -2743,12 +2752,12 @@ function qi(e) {
|
|
|
2743
2752
|
} catch {
|
|
2744
2753
|
break;
|
|
2745
2754
|
}
|
|
2746
|
-
return t =
|
|
2755
|
+
return t = qi(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2747
2756
|
}
|
|
2748
|
-
function
|
|
2757
|
+
function Yi(e) {
|
|
2749
2758
|
return Pe.sanitize(String(e ?? ""), {
|
|
2750
|
-
ALLOWED_TAGS:
|
|
2751
|
-
ALLOWED_ATTR:
|
|
2759
|
+
ALLOWED_TAGS: zi,
|
|
2760
|
+
ALLOWED_ATTR: Bi,
|
|
2752
2761
|
ALLOW_DATA_ATTR: !1,
|
|
2753
2762
|
FORBID_TAGS: [
|
|
2754
2763
|
"script",
|
|
@@ -2768,35 +2777,35 @@ function Ji(e) {
|
|
|
2768
2777
|
]
|
|
2769
2778
|
});
|
|
2770
2779
|
}
|
|
2771
|
-
function
|
|
2780
|
+
function Xi(e) {
|
|
2772
2781
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2773
2782
|
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
2774
2783
|
}
|
|
2775
|
-
function
|
|
2784
|
+
function Zi(e) {
|
|
2776
2785
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2777
2786
|
}
|
|
2778
|
-
function
|
|
2787
|
+
function Qi(e, t = {}) {
|
|
2779
2788
|
if (typeof e != "string") return e;
|
|
2780
|
-
if (t.type === "text-editor") return
|
|
2781
|
-
let n = e.normalize("NFC").replace(
|
|
2782
|
-
return n =
|
|
2789
|
+
if (t.type === "text-editor") return Yi(e.normalize("NFC"));
|
|
2790
|
+
let n = e.normalize("NFC").replace(Vi, "").replace(/\u00A0/g, " ").replace(Hi, "");
|
|
2791
|
+
return n = Zi(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2783
2792
|
}
|
|
2784
|
-
function
|
|
2793
|
+
function $i(e, t = {}) {
|
|
2785
2794
|
if (typeof e != "string" || e === "") return null;
|
|
2786
|
-
let n = t.label || t.field || "Field", r =
|
|
2795
|
+
let n = t.label || t.field || "Field", r = Ji(e);
|
|
2787
2796
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2788
|
-
let i = t.type === "text-editor", a =
|
|
2797
|
+
let i = t.type === "text-editor", a = Ki.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2789
2798
|
if (a) return `${n}: ${a.message}`;
|
|
2790
|
-
let o =
|
|
2791
|
-
return [...o].length >
|
|
2799
|
+
let o = Qi(e, t);
|
|
2800
|
+
return [...o].length > Xi(t) ? `${n} is too long` : t.formatter === "name" && o && !Ui.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !Wi.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !Gi.test(o) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && o && !/^https?:\/\//i.test(o) ? `${n} must use http:// or https://` : null;
|
|
2792
2801
|
}
|
|
2793
|
-
function
|
|
2802
|
+
function ea(e) {
|
|
2794
2803
|
return { validator: (t, n) => {
|
|
2795
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2804
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => $i(t, e)).find(Boolean);
|
|
2796
2805
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2797
2806
|
} };
|
|
2798
2807
|
}
|
|
2799
|
-
function
|
|
2808
|
+
function ta(e = []) {
|
|
2800
2809
|
let t = /* @__PURE__ */ new Map();
|
|
2801
2810
|
return e.forEach((e) => {
|
|
2802
2811
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2808,12 +2817,12 @@ function ea(e = []) {
|
|
|
2808
2817
|
});
|
|
2809
2818
|
}), t;
|
|
2810
2819
|
}
|
|
2811
|
-
function
|
|
2812
|
-
let n =
|
|
2820
|
+
function na(e, t = []) {
|
|
2821
|
+
let n = ta(t), r = (e, t = "") => {
|
|
2813
2822
|
if (typeof e == "string") {
|
|
2814
|
-
let r = n.get(t) ?? {}, i =
|
|
2823
|
+
let r = n.get(t) ?? {}, i = $i(e, r);
|
|
2815
2824
|
if (i) throw Error(i);
|
|
2816
|
-
return
|
|
2825
|
+
return Qi(e, r);
|
|
2817
2826
|
}
|
|
2818
2827
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2819
2828
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2825,23 +2834,23 @@ function ta(e, t = []) {
|
|
|
2825
2834
|
}
|
|
2826
2835
|
//#endregion
|
|
2827
2836
|
//#region src/components/form/validationOverride.js
|
|
2828
|
-
var
|
|
2829
|
-
function
|
|
2837
|
+
var ra = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2838
|
+
function ia(e) {
|
|
2830
2839
|
let t = e?.overrideCheckbox;
|
|
2831
|
-
return !t || typeof t != "object" ? null :
|
|
2840
|
+
return !t || typeof t != "object" ? null : oa(e).size > 0 ? t : null;
|
|
2832
2841
|
}
|
|
2833
|
-
function
|
|
2842
|
+
function aa(e) {
|
|
2834
2843
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2835
2844
|
}
|
|
2836
|
-
function
|
|
2845
|
+
function oa(e) {
|
|
2837
2846
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2838
2847
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2839
2848
|
}
|
|
2840
|
-
function
|
|
2849
|
+
function sa(e) {
|
|
2841
2850
|
return e?.overrideCheckbox?.store !== !1;
|
|
2842
2851
|
}
|
|
2843
|
-
function
|
|
2844
|
-
let r =
|
|
2852
|
+
function ca(e, t, n) {
|
|
2853
|
+
let r = aa(e);
|
|
2845
2854
|
if (typeof n == "function") {
|
|
2846
2855
|
let e = n(r);
|
|
2847
2856
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2852,27 +2861,27 @@ function sa(e, t, n) {
|
|
|
2852
2861
|
r
|
|
2853
2862
|
] : [r];
|
|
2854
2863
|
}
|
|
2855
|
-
function
|
|
2864
|
+
function la(e, t) {
|
|
2856
2865
|
return (n) => {
|
|
2857
2866
|
let r = !1;
|
|
2858
2867
|
try {
|
|
2859
|
-
r =
|
|
2868
|
+
r = ra(n?.getFieldValue?.(t));
|
|
2860
2869
|
} catch {
|
|
2861
2870
|
r = !1;
|
|
2862
2871
|
}
|
|
2863
2872
|
return r ? {} : e;
|
|
2864
2873
|
};
|
|
2865
2874
|
}
|
|
2866
|
-
function
|
|
2867
|
-
if (!
|
|
2868
|
-
let i =
|
|
2875
|
+
function ua(e, t, n, r) {
|
|
2876
|
+
if (!ia(e)) return r;
|
|
2877
|
+
let i = oa(e), a = ca(e, t, n);
|
|
2869
2878
|
return (e) => {
|
|
2870
2879
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2871
|
-
return i.has(n) ?
|
|
2880
|
+
return i.has(n) ? la(t, a) : t;
|
|
2872
2881
|
};
|
|
2873
2882
|
}
|
|
2874
|
-
function
|
|
2875
|
-
let t =
|
|
2883
|
+
function da(e) {
|
|
2884
|
+
let t = ia(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2876
2885
|
return {
|
|
2877
2886
|
tone: t.tone ?? "overwrite",
|
|
2878
2887
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2883,12 +2892,12 @@ function ua(e) {
|
|
|
2883
2892
|
}
|
|
2884
2893
|
//#endregion
|
|
2885
2894
|
//#region src/components/form/optionMatching.js
|
|
2886
|
-
function
|
|
2895
|
+
function fa(e) {
|
|
2887
2896
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2888
2897
|
}
|
|
2889
|
-
function
|
|
2898
|
+
function pa(e) {
|
|
2890
2899
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2891
|
-
let r =
|
|
2900
|
+
let r = fa(e);
|
|
2892
2901
|
r && !t.has(r) && t.set(r, n);
|
|
2893
2902
|
};
|
|
2894
2903
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2896,37 +2905,37 @@ function fa(e) {
|
|
|
2896
2905
|
let t = typeof e == "object" ? e.value : e;
|
|
2897
2906
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2898
2907
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2899
|
-
let i = t.get(
|
|
2908
|
+
let i = t.get(fa(r));
|
|
2900
2909
|
i !== void 0 && n(e, i);
|
|
2901
2910
|
}), t;
|
|
2902
2911
|
}
|
|
2903
|
-
var
|
|
2904
|
-
function
|
|
2912
|
+
var ma = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2913
|
+
function ha(e, t) {
|
|
2905
2914
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2906
|
-
let n = e.get(
|
|
2915
|
+
let n = e.get(fa(t));
|
|
2907
2916
|
return n === void 0 ? t : n;
|
|
2908
2917
|
}
|
|
2909
|
-
function
|
|
2910
|
-
if (!
|
|
2911
|
-
let n =
|
|
2912
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2918
|
+
function ga(e, t) {
|
|
2919
|
+
if (!ma(e)) return t;
|
|
2920
|
+
let n = pa(e);
|
|
2921
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => ha(n, e)) : ha(n, t);
|
|
2913
2922
|
}
|
|
2914
2923
|
//#endregion
|
|
2915
2924
|
//#region src/components/form/payloadTransformer.js
|
|
2916
|
-
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2917
|
-
function _a(e) {
|
|
2918
|
-
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2919
|
-
}
|
|
2925
|
+
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, _a = (e) => e === !0 || e === 1 || e === "1", H = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !va(e);
|
|
2920
2926
|
function va(e) {
|
|
2921
|
-
return
|
|
2927
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2922
2928
|
}
|
|
2923
2929
|
function ya(e) {
|
|
2924
|
-
return
|
|
2930
|
+
return va(e) || e instanceof Date;
|
|
2931
|
+
}
|
|
2932
|
+
function ba(e) {
|
|
2933
|
+
return e instanceof Date ? e.toISOString() : va(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2925
2934
|
}
|
|
2926
|
-
function
|
|
2927
|
-
if (!sr(t)) return
|
|
2935
|
+
function xa(e, t) {
|
|
2936
|
+
if (!sr(t)) return ba(e);
|
|
2928
2937
|
let n = cr(e);
|
|
2929
|
-
return n ? n.toISOString() :
|
|
2938
|
+
return n ? n.toISOString() : ba(e);
|
|
2930
2939
|
}
|
|
2931
2940
|
function U(e, t) {
|
|
2932
2941
|
if (!t) return;
|
|
@@ -2951,7 +2960,7 @@ function K(e, t, n) {
|
|
|
2951
2960
|
}
|
|
2952
2961
|
return i[r[r.length - 1]] = n, e;
|
|
2953
2962
|
}
|
|
2954
|
-
function
|
|
2963
|
+
function Sa(e, t, n) {
|
|
2955
2964
|
let r = String(t).split("."), i = e;
|
|
2956
2965
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2957
2966
|
let t = r[e];
|
|
@@ -2963,24 +2972,24 @@ function xa(e, t, n) {
|
|
|
2963
2972
|
...i[a]
|
|
2964
2973
|
} : n, e;
|
|
2965
2974
|
}
|
|
2966
|
-
function
|
|
2975
|
+
function Ca(e) {
|
|
2967
2976
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2968
2977
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2969
2978
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2970
2979
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2971
2980
|
}
|
|
2972
|
-
function
|
|
2981
|
+
function wa(e, t) {
|
|
2973
2982
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2974
|
-
H(n) && H(e[t]) ?
|
|
2983
|
+
H(n) && H(e[t]) ? wa(e[t], n) : e[t] = n;
|
|
2975
2984
|
}), e;
|
|
2976
2985
|
}
|
|
2977
|
-
function
|
|
2986
|
+
function Ta(e, t) {
|
|
2978
2987
|
let n = e.options ?? e.values ?? [];
|
|
2979
2988
|
for (let e of n) if (typeof e == "string") {
|
|
2980
2989
|
if (e === t) return e;
|
|
2981
2990
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2982
2991
|
}
|
|
2983
|
-
function
|
|
2992
|
+
function Ea(e, t) {
|
|
2984
2993
|
if (H(e)) {
|
|
2985
2994
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2986
2995
|
return {
|
|
@@ -2990,10 +2999,10 @@ function Ta(e, t) {
|
|
|
2990
2999
|
}
|
|
2991
3000
|
return {
|
|
2992
3001
|
value: e,
|
|
2993
|
-
label:
|
|
3002
|
+
label: Ta(t, e) ?? e
|
|
2994
3003
|
};
|
|
2995
3004
|
}
|
|
2996
|
-
function
|
|
3005
|
+
function Da(e = {}) {
|
|
2997
3006
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2998
3007
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2999
3008
|
switch (e.type) {
|
|
@@ -3004,13 +3013,13 @@ function Ea(e = {}) {
|
|
|
3004
3013
|
}
|
|
3005
3014
|
}
|
|
3006
3015
|
function q(e, t, n = {}) {
|
|
3007
|
-
if (
|
|
3008
|
-
if (t === "string") return
|
|
3016
|
+
if (ya(e)) {
|
|
3017
|
+
if (t === "string") return xa(e, n);
|
|
3009
3018
|
if (t === "number") {
|
|
3010
|
-
let t =
|
|
3019
|
+
let t = va(e) ? e.valueOf() : e.getTime();
|
|
3011
3020
|
return Number.isNaN(t) ? null : t;
|
|
3012
3021
|
}
|
|
3013
|
-
if (t === "date" || t === "auto" || !t) return
|
|
3022
|
+
if (t === "date" || t === "auto" || !t) return xa(e, n);
|
|
3014
3023
|
}
|
|
3015
3024
|
switch (t) {
|
|
3016
3025
|
case "string": return e == null ? "" : String(e);
|
|
@@ -3025,14 +3034,14 @@ function q(e, t, n = {}) {
|
|
|
3025
3034
|
return t = Array.isArray(e) ? e : V(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => q(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
3026
3035
|
}
|
|
3027
3036
|
case "object": return H(e), e;
|
|
3028
|
-
case "date": return
|
|
3037
|
+
case "date": return xa(e, n);
|
|
3029
3038
|
case "custom":
|
|
3030
3039
|
case "auto":
|
|
3031
3040
|
case void 0:
|
|
3032
3041
|
default: return e;
|
|
3033
3042
|
}
|
|
3034
3043
|
}
|
|
3035
|
-
var
|
|
3044
|
+
var Oa = {
|
|
3036
3045
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
3037
3046
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
3038
3047
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -3040,11 +3049,11 @@ var Da = {
|
|
|
3040
3049
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
3041
3050
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
3042
3051
|
};
|
|
3043
|
-
function
|
|
3052
|
+
function ka(e, t) {
|
|
3044
3053
|
if (!t) return e;
|
|
3045
3054
|
let n = t;
|
|
3046
3055
|
if (typeof n == "string") {
|
|
3047
|
-
if (
|
|
3056
|
+
if (Oa[n]) return Oa[n](e);
|
|
3048
3057
|
try {
|
|
3049
3058
|
n = JSON.parse(n);
|
|
3050
3059
|
} catch {
|
|
@@ -3052,14 +3061,14 @@ function Oa(e, t) {
|
|
|
3052
3061
|
}
|
|
3053
3062
|
}
|
|
3054
3063
|
let r = e;
|
|
3055
|
-
if (n.name &&
|
|
3064
|
+
if (n.name && Oa[n.name] && (r = Oa[n.name](r)), n.map && typeof n.map == "object") {
|
|
3056
3065
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
3057
3066
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
3058
3067
|
}
|
|
3059
3068
|
return r;
|
|
3060
3069
|
}
|
|
3061
|
-
var
|
|
3062
|
-
function
|
|
3070
|
+
var Aa = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
3071
|
+
function ja(e, t) {
|
|
3063
3072
|
let [n, ...r] = e.split("."), i;
|
|
3064
3073
|
if (n === "value") i = t.value;
|
|
3065
3074
|
else if (n === "label") i = t.label;
|
|
@@ -3067,24 +3076,24 @@ function Aa(e, t) {
|
|
|
3067
3076
|
else return;
|
|
3068
3077
|
return r.length ? U(i, r.join(".")) : i;
|
|
3069
3078
|
}
|
|
3070
|
-
function
|
|
3079
|
+
function Ma(e, t) {
|
|
3071
3080
|
if (typeof e == "string") {
|
|
3072
3081
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
3073
|
-
return n ?
|
|
3074
|
-
let r =
|
|
3082
|
+
return n ? ja(n[1], t) : e.replace(Aa, (e, n) => {
|
|
3083
|
+
let r = ja(n, t);
|
|
3075
3084
|
return r == null ? "" : String(r);
|
|
3076
3085
|
});
|
|
3077
3086
|
}
|
|
3078
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
3087
|
+
if (Array.isArray(e)) return e.map((e) => Ma(e, t));
|
|
3079
3088
|
if (H(e)) {
|
|
3080
3089
|
let n = {};
|
|
3081
3090
|
return Object.entries(e).forEach(([e, r]) => {
|
|
3082
|
-
n[e] =
|
|
3091
|
+
n[e] = Ma(r, t);
|
|
3083
3092
|
}), n;
|
|
3084
3093
|
}
|
|
3085
3094
|
return e;
|
|
3086
3095
|
}
|
|
3087
|
-
function
|
|
3096
|
+
function Na(e) {
|
|
3088
3097
|
if (!e) return null;
|
|
3089
3098
|
if (typeof e == "string") try {
|
|
3090
3099
|
return JSON.parse(e);
|
|
@@ -3093,8 +3102,8 @@ function Ma(e) {
|
|
|
3093
3102
|
}
|
|
3094
3103
|
return e;
|
|
3095
3104
|
}
|
|
3096
|
-
function
|
|
3097
|
-
let n = e.payloadMode || "auto", r =
|
|
3105
|
+
function Pa(e, t) {
|
|
3106
|
+
let n = e.payloadMode || "auto", r = Da(e), { value: i, label: a } = Ea(t, e);
|
|
3098
3107
|
switch (n) {
|
|
3099
3108
|
case "value": return {
|
|
3100
3109
|
kind: "scalar",
|
|
@@ -3116,12 +3125,12 @@ function Na(e, t) {
|
|
|
3116
3125
|
}
|
|
3117
3126
|
case "custom":
|
|
3118
3127
|
case "template": {
|
|
3119
|
-
let n =
|
|
3128
|
+
let n = Na(e.payloadTemplate);
|
|
3120
3129
|
if (!n) return {
|
|
3121
3130
|
kind: "scalar",
|
|
3122
3131
|
out: q(i, r, e)
|
|
3123
3132
|
};
|
|
3124
|
-
let o =
|
|
3133
|
+
let o = Ma(n, {
|
|
3125
3134
|
value: q(i, e.elementType || "auto", {}),
|
|
3126
3135
|
label: a,
|
|
3127
3136
|
raw: t
|
|
@@ -3137,15 +3146,15 @@ function Na(e, t) {
|
|
|
3137
3146
|
};
|
|
3138
3147
|
}
|
|
3139
3148
|
}
|
|
3140
|
-
function
|
|
3149
|
+
function Fa(e, t) {
|
|
3141
3150
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
3142
3151
|
let n = t;
|
|
3143
|
-
return V(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n =
|
|
3152
|
+
return V(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = ka(n, e.transformRule), V(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Da(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
3144
3153
|
kind: "scalar",
|
|
3145
|
-
out: n.map((t) =>
|
|
3146
|
-
} :
|
|
3154
|
+
out: n.map((t) => Pa(e, t).out)
|
|
3155
|
+
} : Pa(e, n);
|
|
3147
3156
|
}
|
|
3148
|
-
function
|
|
3157
|
+
function Ia(e = {}) {
|
|
3149
3158
|
return !!e.richValue || [
|
|
3150
3159
|
"label",
|
|
3151
3160
|
"object",
|
|
@@ -3153,8 +3162,8 @@ function Fa(e = {}) {
|
|
|
3153
3162
|
"template"
|
|
3154
3163
|
].includes(e.payloadMode);
|
|
3155
3164
|
}
|
|
3156
|
-
function
|
|
3157
|
-
if (!
|
|
3165
|
+
function La(e, t, n = []) {
|
|
3166
|
+
if (!Ia(e) || t == null) return t;
|
|
3158
3167
|
let r = (e) => {
|
|
3159
3168
|
if (H(e) && e.value !== void 0) return e;
|
|
3160
3169
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -3165,7 +3174,7 @@ function Ia(e, t, n = []) {
|
|
|
3165
3174
|
};
|
|
3166
3175
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
3167
3176
|
}
|
|
3168
|
-
function
|
|
3177
|
+
function Ra(e, t, n) {
|
|
3169
3178
|
if (!e?.field) return !0;
|
|
3170
3179
|
let r = G(t, e.field) ? W(t, e.field) : W(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
3171
3180
|
switch (e.operator) {
|
|
@@ -3179,45 +3188,45 @@ function La(e, t, n) {
|
|
|
3179
3188
|
default: return !0;
|
|
3180
3189
|
}
|
|
3181
3190
|
}
|
|
3182
|
-
function
|
|
3191
|
+
function za(e) {
|
|
3183
3192
|
let t = [];
|
|
3184
3193
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
3185
3194
|
e?.field && t.push(e.field);
|
|
3186
3195
|
}), t;
|
|
3187
3196
|
}
|
|
3188
|
-
function
|
|
3197
|
+
function Ba(e, t, n) {
|
|
3189
3198
|
if (!e) return !0;
|
|
3190
3199
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
3191
3200
|
if (r.length) {
|
|
3192
|
-
let i = r.map((e) =>
|
|
3201
|
+
let i = r.map((e) => Ra(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
3193
3202
|
if (e.field) {
|
|
3194
|
-
let r =
|
|
3203
|
+
let r = Ra(e, t, n);
|
|
3195
3204
|
o = a ? o || r : o && r;
|
|
3196
3205
|
}
|
|
3197
3206
|
return o;
|
|
3198
3207
|
}
|
|
3199
|
-
return
|
|
3208
|
+
return Ra(e, t, n);
|
|
3200
3209
|
}
|
|
3201
|
-
function
|
|
3202
|
-
let a =
|
|
3203
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
3210
|
+
function Va(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
3211
|
+
let a = za(e?.showIf);
|
|
3212
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Ba(e.showIf, t, n) ? a.every((e) => {
|
|
3204
3213
|
let a = r?.get?.(e);
|
|
3205
|
-
return !a ||
|
|
3214
|
+
return !a || Va(a, t, n, r, i);
|
|
3206
3215
|
}) : !1);
|
|
3207
3216
|
}
|
|
3208
|
-
function
|
|
3217
|
+
function Ha(e = []) {
|
|
3209
3218
|
let t = /* @__PURE__ */ new Map();
|
|
3210
3219
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
3211
3220
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
3212
3221
|
})), t;
|
|
3213
3222
|
}
|
|
3214
|
-
function
|
|
3223
|
+
function Ua(e = {}, { editing: t = !1 } = {}) {
|
|
3215
3224
|
let n = {};
|
|
3216
3225
|
return (e.fields ?? []).forEach((e) => {
|
|
3217
|
-
!e.field ||
|
|
3226
|
+
!e.field || Ka(e) || t && !e.defaultOnEdit || e.defaultValue !== void 0 && e.defaultValue !== "" && (n[e.field] = e.defaultValue);
|
|
3218
3227
|
}), n;
|
|
3219
3228
|
}
|
|
3220
|
-
function
|
|
3229
|
+
function Wa(e = []) {
|
|
3221
3230
|
let t = [];
|
|
3222
3231
|
return e.forEach((e) => {
|
|
3223
3232
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -3228,27 +3237,27 @@ function Ua(e = []) {
|
|
|
3228
3237
|
});
|
|
3229
3238
|
}), t;
|
|
3230
3239
|
}
|
|
3231
|
-
var
|
|
3240
|
+
var Ga = [
|
|
3232
3241
|
"file",
|
|
3233
3242
|
"document",
|
|
3234
3243
|
"image",
|
|
3235
3244
|
"upload",
|
|
3236
3245
|
"attachment"
|
|
3237
3246
|
];
|
|
3238
|
-
function
|
|
3239
|
-
return
|
|
3247
|
+
function Ka(e) {
|
|
3248
|
+
return Ga.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
3240
3249
|
}
|
|
3241
|
-
function
|
|
3242
|
-
return
|
|
3250
|
+
function qa(e = []) {
|
|
3251
|
+
return Wa(e).map(({ field: e }) => e).filter(Ka);
|
|
3243
3252
|
}
|
|
3244
|
-
function
|
|
3253
|
+
function Ja(e) {
|
|
3245
3254
|
return String(e ?? "").trim().toLowerCase();
|
|
3246
3255
|
}
|
|
3247
|
-
function
|
|
3248
|
-
return !!t &&
|
|
3256
|
+
function Ya(e, t) {
|
|
3257
|
+
return !!t && Ja(e.moduleName) === t;
|
|
3249
3258
|
}
|
|
3250
|
-
function
|
|
3251
|
-
let r = [], i = n.scope ?? "all", a =
|
|
3259
|
+
function Xa(e, t = [], n = {}) {
|
|
3260
|
+
let r = [], i = n.scope ?? "all", a = Ja(n.module), o = (e, t) => {
|
|
3252
3261
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
3253
3262
|
let n = t?.originFileObj || t;
|
|
3254
3263
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -3258,9 +3267,9 @@ function Ya(e, t = [], n = {}) {
|
|
|
3258
3267
|
});
|
|
3259
3268
|
};
|
|
3260
3269
|
return (t ?? []).forEach((t) => {
|
|
3261
|
-
let r = (t.fields ?? []).filter(
|
|
3270
|
+
let r = (t.fields ?? []).filter(Ka);
|
|
3262
3271
|
if (!r.length) return;
|
|
3263
|
-
let s = t.moduleName && !
|
|
3272
|
+
let s = t.moduleName && !Ya(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
3264
3273
|
if (t.addRow) {
|
|
3265
3274
|
if (i === "flat") return;
|
|
3266
3275
|
let a = e[t.name];
|
|
@@ -3280,12 +3289,12 @@ function Ya(e, t = [], n = {}) {
|
|
|
3280
3289
|
});
|
|
3281
3290
|
}), r;
|
|
3282
3291
|
}
|
|
3283
|
-
function
|
|
3292
|
+
function Za(e, t, n = {}) {
|
|
3284
3293
|
let r = H(n.base) ? structuredClone(n.base) : {};
|
|
3285
|
-
|
|
3286
|
-
(e.payloadKey || e.field) && (
|
|
3294
|
+
qa(t).forEach((e) => {
|
|
3295
|
+
(e.payloadKey || e.field) && (eo(r, e.payloadKey || e.field), eo(r, e.field));
|
|
3287
3296
|
});
|
|
3288
|
-
let i =
|
|
3297
|
+
let i = Ja(n.module), a = Ha(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Ya(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
3289
3298
|
return (t ?? []).forEach((t) => {
|
|
3290
3299
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && G(e, t.toggleField) ? !!W(e, t.toggleField) : !1;
|
|
3291
3300
|
if (t.toggleEnabled && t.toggleField && G(e, t.toggleField) && (K(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -3295,29 +3304,29 @@ function Xa(e, t, n = {}) {
|
|
|
3295
3304
|
if (t.addRow) {
|
|
3296
3305
|
let i = e[t.name];
|
|
3297
3306
|
if (!Array.isArray(i)) return;
|
|
3298
|
-
K(n, t.payloadKey || t.name, i.map((t) =>
|
|
3307
|
+
K(n, t.payloadKey || t.name, i.map((t) => $a(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
3299
3308
|
return;
|
|
3300
3309
|
}
|
|
3301
|
-
r.forEach((t) =>
|
|
3310
|
+
r.forEach((t) => Qa(t, e, n, e, a));
|
|
3302
3311
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
3303
3312
|
moduleName: e,
|
|
3304
3313
|
data: t
|
|
3305
|
-
}))),
|
|
3314
|
+
}))), na(r, t);
|
|
3306
3315
|
}
|
|
3307
|
-
function
|
|
3308
|
-
if (
|
|
3309
|
-
let r =
|
|
3316
|
+
function Qa(e, t, n, r, i) {
|
|
3317
|
+
if (ia(e) && sa(e)) {
|
|
3318
|
+
let r = aa(e);
|
|
3310
3319
|
G(t, r) && K(n, r, !!W(t, r));
|
|
3311
3320
|
}
|
|
3312
|
-
if (
|
|
3313
|
-
let i =
|
|
3321
|
+
if (Ka(e)) {
|
|
3322
|
+
let i = Ca(W(t, e.field));
|
|
3314
3323
|
if (i !== void 0) {
|
|
3315
3324
|
let a = r !== void 0 && r !== t;
|
|
3316
|
-
|
|
3325
|
+
Sa(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
3317
3326
|
}
|
|
3318
3327
|
return;
|
|
3319
3328
|
}
|
|
3320
|
-
if (
|
|
3329
|
+
if (za(e.showIf).length && !Va(e, t, r, i)) {
|
|
3321
3330
|
(r === void 0 || r === t) && G(t, e.field) && K(n, e.payloadKey || e.field, null);
|
|
3322
3331
|
return;
|
|
3323
3332
|
}
|
|
@@ -3325,30 +3334,30 @@ function Za(e, t, n, r, i) {
|
|
|
3325
3334
|
if (!G(t, e.field)) return;
|
|
3326
3335
|
let a = W(t, e.field);
|
|
3327
3336
|
if (!Array.isArray(a)) return;
|
|
3328
|
-
let o = a.map((t) =>
|
|
3337
|
+
let o = a.map((t) => $a(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
3329
3338
|
K(n, e.payloadKey || e.field, o);
|
|
3330
3339
|
return;
|
|
3331
3340
|
}
|
|
3332
3341
|
if (!G(t, e.field)) return;
|
|
3333
|
-
if (
|
|
3334
|
-
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a =
|
|
3342
|
+
if (_a(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
3343
|
+
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a = no(e), o = i.map((e) => Fa(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
3335
3344
|
K(n, e.payloadKey || e.field, o);
|
|
3336
3345
|
return;
|
|
3337
3346
|
}
|
|
3338
|
-
let a =
|
|
3347
|
+
let a = Fa(e, W(t, e.field));
|
|
3339
3348
|
if (a.kind !== "skip") {
|
|
3340
3349
|
if (a.kind === "spread" && H(a.out)) {
|
|
3341
|
-
|
|
3350
|
+
wa(n, a.out);
|
|
3342
3351
|
return;
|
|
3343
3352
|
}
|
|
3344
3353
|
K(n, e.payloadKey || e.field, a.out);
|
|
3345
3354
|
}
|
|
3346
3355
|
}
|
|
3347
|
-
function
|
|
3356
|
+
function $a(e, t, n, r) {
|
|
3348
3357
|
let i = {};
|
|
3349
|
-
return e.forEach((e) =>
|
|
3358
|
+
return e.forEach((e) => Qa(e, t, i, n ?? t, r)), i;
|
|
3350
3359
|
}
|
|
3351
|
-
function
|
|
3360
|
+
function eo(e, t) {
|
|
3352
3361
|
let n = String(t).split("."), r = e;
|
|
3353
3362
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
3354
3363
|
if (!H(r[n[e]])) return;
|
|
@@ -3356,7 +3365,7 @@ function $a(e, t) {
|
|
|
3356
3365
|
}
|
|
3357
3366
|
delete r[n[n.length - 1]];
|
|
3358
3367
|
}
|
|
3359
|
-
var
|
|
3368
|
+
var to = /* @__PURE__ */ new Set([
|
|
3360
3369
|
"text",
|
|
3361
3370
|
"textarea",
|
|
3362
3371
|
"email",
|
|
@@ -3373,7 +3382,7 @@ function J(e, t) {
|
|
|
3373
3382
|
if (t == null) return r() ?? t;
|
|
3374
3383
|
if (n(t)) return r();
|
|
3375
3384
|
if (V(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
3376
|
-
if (
|
|
3385
|
+
if (to.has(e.type) && H(t)) {
|
|
3377
3386
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
3378
3387
|
if (r === void 0 || H(r)) return;
|
|
3379
3388
|
t = r;
|
|
@@ -3383,8 +3392,8 @@ function J(e, t) {
|
|
|
3383
3392
|
let e = E(t);
|
|
3384
3393
|
return e.isValid() ? e : null;
|
|
3385
3394
|
}
|
|
3386
|
-
t =
|
|
3387
|
-
let i = (t) => H(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
3395
|
+
t = ga(e, t);
|
|
3396
|
+
let i = (t) => H(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && Da(e) === "array", o = (t) => {
|
|
3388
3397
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
3389
3398
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
3390
3399
|
return n ? n.value : t;
|
|
@@ -3396,7 +3405,7 @@ function J(e, t) {
|
|
|
3396
3405
|
}
|
|
3397
3406
|
return t;
|
|
3398
3407
|
}
|
|
3399
|
-
function
|
|
3408
|
+
function no(e = {}) {
|
|
3400
3409
|
return {
|
|
3401
3410
|
...e,
|
|
3402
3411
|
addRow: !1,
|
|
@@ -3405,14 +3414,14 @@ function to(e = {}) {
|
|
|
3405
3414
|
dataType: void 0
|
|
3406
3415
|
};
|
|
3407
3416
|
}
|
|
3408
|
-
function
|
|
3417
|
+
function ro(e, t) {
|
|
3409
3418
|
let n = Math.max(0, Number(e.minRows ?? 0) || 0), r = e.initialRows !== void 0 && e.initialRows !== "" ? Math.max(n, Math.max(0, Number(e.initialRows) || 0)) : n;
|
|
3410
3419
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
3411
3420
|
let i = [];
|
|
3412
3421
|
Array.isArray(t) && (i = t.map((t) => {
|
|
3413
3422
|
let n = {};
|
|
3414
3423
|
return e.subFields.forEach((e) => {
|
|
3415
|
-
if (!e.field ||
|
|
3424
|
+
if (!e.field || Ka(e)) return;
|
|
3416
3425
|
let r = U(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
3417
3426
|
r != null && (n[e.field] = J(e, r));
|
|
3418
3427
|
}), n;
|
|
@@ -3421,7 +3430,7 @@ function no(e, t) {
|
|
|
3421
3430
|
for (; i.length < a;) i.push({});
|
|
3422
3431
|
return i;
|
|
3423
3432
|
}
|
|
3424
|
-
let i =
|
|
3433
|
+
let i = no(e), a = [];
|
|
3425
3434
|
if (Array.isArray(t)) a = t.map((e) => J(i, e)).filter((e) => e != null && e !== "");
|
|
3426
3435
|
else if (t != null && t !== "") {
|
|
3427
3436
|
let e = J(i, t);
|
|
@@ -3433,12 +3442,12 @@ function no(e, t) {
|
|
|
3433
3442
|
}
|
|
3434
3443
|
//#endregion
|
|
3435
3444
|
//#region src/components/form/linkedAddRowGroups.js
|
|
3436
|
-
var
|
|
3437
|
-
function
|
|
3445
|
+
var io = (e) => e === !0 || e === 1 || e === "1";
|
|
3446
|
+
function ao(e = []) {
|
|
3438
3447
|
let t = /* @__PURE__ */ new Map();
|
|
3439
3448
|
e.forEach((e) => {
|
|
3440
3449
|
let n = e?.linkGroup;
|
|
3441
|
-
!
|
|
3450
|
+
!io(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
3442
3451
|
});
|
|
3443
3452
|
let n = /* @__PURE__ */ new Map();
|
|
3444
3453
|
return t.forEach((e, t) => {
|
|
@@ -3448,11 +3457,11 @@ function io(e = []) {
|
|
|
3448
3457
|
});
|
|
3449
3458
|
}), n;
|
|
3450
3459
|
}
|
|
3451
|
-
function
|
|
3460
|
+
function oo(e, t) {
|
|
3452
3461
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3453
3462
|
return null;
|
|
3454
3463
|
}
|
|
3455
|
-
function
|
|
3464
|
+
function so(e, t = {}) {
|
|
3456
3465
|
let n = { ...t };
|
|
3457
3466
|
return e.forEach(({ memberNames: e }) => {
|
|
3458
3467
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3464,7 +3473,7 @@ function oo(e, t = {}) {
|
|
|
3464
3473
|
}
|
|
3465
3474
|
//#endregion
|
|
3466
3475
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3467
|
-
var
|
|
3476
|
+
var co = {
|
|
3468
3477
|
duplicate: {
|
|
3469
3478
|
className: "fdd-tone-amber",
|
|
3470
3479
|
Icon: me
|
|
@@ -3482,8 +3491,8 @@ var so = {
|
|
|
3482
3491
|
Icon: ce
|
|
3483
3492
|
}
|
|
3484
3493
|
};
|
|
3485
|
-
function
|
|
3486
|
-
let { className: c, Icon: l } =
|
|
3494
|
+
function lo({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s } = {}) {
|
|
3495
|
+
let { className: c, Icon: l } = co[e] ?? co.suggestion, u = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3487
3496
|
return new Promise((e) => {
|
|
3488
3497
|
x.confirm({
|
|
3489
3498
|
icon: null,
|
|
@@ -3533,8 +3542,8 @@ function co({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3533
3542
|
});
|
|
3534
3543
|
});
|
|
3535
3544
|
}
|
|
3536
|
-
function
|
|
3537
|
-
let { className: a, Icon: o } =
|
|
3545
|
+
function uo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3546
|
+
let { className: a, Icon: o } = co[e] ?? co.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3538
3547
|
return new Promise((e) => {
|
|
3539
3548
|
x.warning({
|
|
3540
3549
|
icon: null,
|
|
@@ -3576,7 +3585,7 @@ function lo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3576
3585
|
}
|
|
3577
3586
|
//#endregion
|
|
3578
3587
|
//#region src/services/aiActionApi.js
|
|
3579
|
-
async function
|
|
3588
|
+
async function fo({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3580
3589
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3581
3590
|
let c = await r(), l = new FormData();
|
|
3582
3591
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3602,17 +3611,17 @@ async function uo({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3602
3611
|
}
|
|
3603
3612
|
//#endregion
|
|
3604
3613
|
//#region src/components/detail/phoneDisplay.js
|
|
3605
|
-
var
|
|
3606
|
-
function
|
|
3614
|
+
var po = (e) => e == null || e === "";
|
|
3615
|
+
function mo(e, t) {
|
|
3607
3616
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3608
3617
|
}
|
|
3609
|
-
function
|
|
3618
|
+
function ho(e) {
|
|
3610
3619
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3611
3620
|
if (!t) return "";
|
|
3612
3621
|
let n = t.replace(/^\+/, "");
|
|
3613
3622
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3614
3623
|
}
|
|
3615
|
-
function
|
|
3624
|
+
function go(e) {
|
|
3616
3625
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3617
3626
|
return [
|
|
3618
3627
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3625,15 +3634,15 @@ function ho(e) {
|
|
|
3625
3634
|
"isdCode"
|
|
3626
3635
|
];
|
|
3627
3636
|
}
|
|
3628
|
-
function
|
|
3629
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3637
|
+
function _o(e, t, n = "") {
|
|
3638
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...go(e)] : go(e);
|
|
3630
3639
|
for (let e of i) {
|
|
3631
|
-
let n = mo(
|
|
3640
|
+
let n = ho(mo(t, e));
|
|
3632
3641
|
if (n) return n;
|
|
3633
3642
|
}
|
|
3634
|
-
return
|
|
3643
|
+
return ho(n);
|
|
3635
3644
|
}
|
|
3636
|
-
function
|
|
3645
|
+
function vo(e) {
|
|
3637
3646
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3638
3647
|
return n ? {
|
|
3639
3648
|
code: n[1],
|
|
@@ -3643,17 +3652,17 @@ function _o(e) {
|
|
|
3643
3652
|
rest: t
|
|
3644
3653
|
};
|
|
3645
3654
|
}
|
|
3646
|
-
function
|
|
3647
|
-
if (
|
|
3648
|
-
let { code: n, rest: r } =
|
|
3655
|
+
function yo(e, t = "") {
|
|
3656
|
+
if (po(e)) return "";
|
|
3657
|
+
let { code: n, rest: r } = vo(e), i = n || ho(t), a = Yn(r) || r;
|
|
3649
3658
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3650
3659
|
}
|
|
3651
|
-
function
|
|
3652
|
-
return
|
|
3660
|
+
function bo(e, t, n) {
|
|
3661
|
+
return yo(t, _o(e, n, qn()));
|
|
3653
3662
|
}
|
|
3654
3663
|
//#endregion
|
|
3655
3664
|
//#region src/components/detail/renderConfig.js
|
|
3656
|
-
var
|
|
3665
|
+
var xo = [
|
|
3657
3666
|
{
|
|
3658
3667
|
value: "auto",
|
|
3659
3668
|
label: "Default (auto)"
|
|
@@ -3710,7 +3719,7 @@ var bo = [
|
|
|
3710
3719
|
value: "html",
|
|
3711
3720
|
label: "HTML"
|
|
3712
3721
|
}
|
|
3713
|
-
],
|
|
3722
|
+
], So = [
|
|
3714
3723
|
{
|
|
3715
3724
|
value: "preview",
|
|
3716
3725
|
label: "Preview (viewer)"
|
|
@@ -3731,7 +3740,7 @@ var bo = [
|
|
|
3731
3740
|
value: "text",
|
|
3732
3741
|
label: "Text (filename)"
|
|
3733
3742
|
}
|
|
3734
|
-
],
|
|
3743
|
+
], Co = [
|
|
3735
3744
|
{
|
|
3736
3745
|
value: "none",
|
|
3737
3746
|
label: "None"
|
|
@@ -3748,76 +3757,76 @@ var bo = [
|
|
|
3748
3757
|
value: "title",
|
|
3749
3758
|
label: "Title Case"
|
|
3750
3759
|
}
|
|
3751
|
-
],
|
|
3760
|
+
], wo = [
|
|
3752
3761
|
"location",
|
|
3753
3762
|
"path",
|
|
3754
3763
|
"url",
|
|
3755
3764
|
"key"
|
|
3756
|
-
],
|
|
3765
|
+
], To = [
|
|
3757
3766
|
"location",
|
|
3758
3767
|
"filepath",
|
|
3759
3768
|
"path",
|
|
3760
3769
|
"url",
|
|
3761
3770
|
"key"
|
|
3762
|
-
],
|
|
3771
|
+
], Eo = [
|
|
3763
3772
|
"uploadedfilename",
|
|
3764
3773
|
"uploadname",
|
|
3765
3774
|
"originalname",
|
|
3766
3775
|
"displayname",
|
|
3767
3776
|
"documentname",
|
|
3768
3777
|
"filename"
|
|
3769
|
-
],
|
|
3770
|
-
function
|
|
3778
|
+
], Do = ["name"], Oo = (e) => String(e).toLowerCase(), ko = (e) => e == null || e === "";
|
|
3779
|
+
function Ao(e, t) {
|
|
3771
3780
|
for (let n of t) {
|
|
3772
3781
|
let t = e[n];
|
|
3773
3782
|
if (typeof t == "string" && t) return t;
|
|
3774
3783
|
}
|
|
3775
3784
|
return "";
|
|
3776
3785
|
}
|
|
3777
|
-
function
|
|
3778
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3786
|
+
function jo(e, t) {
|
|
3787
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Oo(t).endsWith(n)) return r;
|
|
3779
3788
|
return "";
|
|
3780
3789
|
}
|
|
3781
|
-
function
|
|
3790
|
+
function Mo(e) {
|
|
3782
3791
|
if (!e) return "";
|
|
3783
3792
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3784
3793
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3785
3794
|
}
|
|
3786
|
-
function
|
|
3795
|
+
function No(e) {
|
|
3787
3796
|
if (!e) return "";
|
|
3788
3797
|
let t = String(e);
|
|
3789
3798
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3790
3799
|
}
|
|
3791
|
-
function
|
|
3800
|
+
function Po(e) {
|
|
3792
3801
|
let t = String(e ?? "").trim();
|
|
3793
3802
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3794
3803
|
}
|
|
3795
|
-
function Po(e) {
|
|
3796
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : ko(e, Co) || Ao(e, wo);
|
|
3797
|
-
}
|
|
3798
3804
|
function Fo(e) {
|
|
3799
|
-
return
|
|
3805
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Ao(e, wo) || jo(e, To);
|
|
3800
3806
|
}
|
|
3801
3807
|
function Io(e) {
|
|
3802
|
-
|
|
3808
|
+
return e ? typeof e == "string" ? Mo(e) || e : typeof e == "object" && (Ao(e, F().documentNameOrder ?? []) || jo(e, Eo) || Mo(Fo(e)) || jo(e, Do)) || "Document" : "Document";
|
|
3809
|
+
}
|
|
3810
|
+
function Lo(e) {
|
|
3811
|
+
if (ko(e)) return [];
|
|
3803
3812
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3804
|
-
for (let e of t) if (!
|
|
3813
|
+
for (let e of t) if (!ko(e)) {
|
|
3805
3814
|
if (typeof e == "string") {
|
|
3806
3815
|
let t = e.includes("/") ? e : "";
|
|
3807
3816
|
n.push({
|
|
3808
3817
|
location: t,
|
|
3809
|
-
name:
|
|
3810
|
-
url:
|
|
3811
|
-
needsAuthFetch:
|
|
3818
|
+
name: Mo(e) || e,
|
|
3819
|
+
url: No(t),
|
|
3820
|
+
needsAuthFetch: Po(t)
|
|
3812
3821
|
});
|
|
3813
3822
|
} else if (typeof e == "object") {
|
|
3814
|
-
let t =
|
|
3823
|
+
let t = Fo(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3815
3824
|
n.push({
|
|
3816
3825
|
location: t,
|
|
3817
|
-
name:
|
|
3818
|
-
url: r ||
|
|
3826
|
+
name: Io(e),
|
|
3827
|
+
url: r || No(t),
|
|
3819
3828
|
documentId: e.id || e._id || e.documentId || "",
|
|
3820
|
-
needsAuthFetch: !r &&
|
|
3829
|
+
needsAuthFetch: !r && Po(t)
|
|
3821
3830
|
});
|
|
3822
3831
|
}
|
|
3823
3832
|
}
|
|
@@ -3825,24 +3834,24 @@ function Io(e) {
|
|
|
3825
3834
|
}
|
|
3826
3835
|
//#endregion
|
|
3827
3836
|
//#region src/components/form/repeatableRowShape.js
|
|
3828
|
-
function
|
|
3837
|
+
function Ro(e) {
|
|
3829
3838
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3830
3839
|
}
|
|
3831
|
-
function
|
|
3840
|
+
function zo(e, t) {
|
|
3832
3841
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3833
|
-
let n =
|
|
3842
|
+
let n = Ro(e);
|
|
3834
3843
|
if (!n) return t;
|
|
3835
3844
|
let r = !1, i = t.map((e) => typeof e == "object" && e && !Array.isArray(e) ? e : e == null || String(e).trim() === "" ? (r = !0, {}) : (r = !0, { [n]: e }));
|
|
3836
3845
|
return r ? i : t;
|
|
3837
3846
|
}
|
|
3838
3847
|
//#endregion
|
|
3839
3848
|
//#region src/components/form/applyGroupValues.js
|
|
3840
|
-
var
|
|
3841
|
-
function
|
|
3849
|
+
var Bo = (e) => e === !0 || e === 1 || e === "1", Vo = (e) => e == null || e === "";
|
|
3850
|
+
function Ho(e) {
|
|
3842
3851
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3843
3852
|
}
|
|
3844
3853
|
function Y(e, t, n) {
|
|
3845
|
-
let r = Array.isArray(t) ? t :
|
|
3854
|
+
let r = Array.isArray(t) ? t : Ho(t);
|
|
3846
3855
|
if (!r.length) return e;
|
|
3847
3856
|
let i = e;
|
|
3848
3857
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3851,23 +3860,23 @@ function Y(e, t, n) {
|
|
|
3851
3860
|
}
|
|
3852
3861
|
return i[r[r.length - 1]] = n, e;
|
|
3853
3862
|
}
|
|
3854
|
-
function
|
|
3863
|
+
function Uo(e, t = []) {
|
|
3855
3864
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3856
3865
|
if (!n) continue;
|
|
3857
3866
|
let t = U(e, n);
|
|
3858
|
-
if (!
|
|
3867
|
+
if (!Vo(t)) return t;
|
|
3859
3868
|
}
|
|
3860
3869
|
}
|
|
3861
|
-
function
|
|
3870
|
+
function Wo(e, t) {
|
|
3862
3871
|
if (!e || typeof e != "object") return;
|
|
3863
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3872
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Vo(n));
|
|
3864
3873
|
if (r) return r[1];
|
|
3865
3874
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3866
|
-
let n =
|
|
3867
|
-
if (!
|
|
3875
|
+
let n = Wo(e, t);
|
|
3876
|
+
if (!Vo(n)) return n;
|
|
3868
3877
|
}
|
|
3869
3878
|
}
|
|
3870
|
-
function
|
|
3879
|
+
function Go(e, t) {
|
|
3871
3880
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3872
3881
|
if (!n.length) return;
|
|
3873
3882
|
let r = n.map((e, n) => {
|
|
@@ -3877,9 +3886,9 @@ function Wo(e, t) {
|
|
|
3877
3886
|
status: "done"
|
|
3878
3887
|
};
|
|
3879
3888
|
if (!e || typeof e != "object") return null;
|
|
3880
|
-
let r =
|
|
3889
|
+
let r = Uo(e, [t.fileUrlKey, t.locationKey]) ?? Wo(e, /(location|url|path)$/i) ?? "", i = Uo(e, [t.fileNameKey]) ?? Wo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3881
3890
|
if (!r && !i) return null;
|
|
3882
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3891
|
+
let a = r && !String(r).startsWith("http") ? No(r) : r;
|
|
3883
3892
|
return {
|
|
3884
3893
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3885
3894
|
name: i || "file",
|
|
@@ -3891,11 +3900,11 @@ function Wo(e, t) {
|
|
|
3891
3900
|
}).filter(Boolean);
|
|
3892
3901
|
return r.length ? r : void 0;
|
|
3893
3902
|
}
|
|
3894
|
-
function
|
|
3903
|
+
function Ko(e, t) {
|
|
3895
3904
|
if (!e || typeof e != "object") return;
|
|
3896
|
-
let n =
|
|
3905
|
+
let n = Uo(e, [t.fileNameKey, t.field]) ?? Wo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Uo(e, [t.fileUrlKey, t.locationKey]) ?? Wo(e, /(location|url|path)$/i) ?? "";
|
|
3897
3906
|
if (!n && !r) return;
|
|
3898
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3907
|
+
let i = r && !String(r).startsWith("http") ? No(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3899
3908
|
return [{
|
|
3900
3909
|
uid: String(a),
|
|
3901
3910
|
name: n ?? "file",
|
|
@@ -3904,7 +3913,7 @@ function Go(e, t) {
|
|
|
3904
3913
|
url: i || void 0
|
|
3905
3914
|
}];
|
|
3906
3915
|
}
|
|
3907
|
-
function
|
|
3916
|
+
function qo(e, t, n, r) {
|
|
3908
3917
|
(e.fields ?? []).forEach((e) => {
|
|
3909
3918
|
e?.verifyAction && [
|
|
3910
3919
|
e.verifyResultField,
|
|
@@ -3917,8 +3926,8 @@ function Ko(e, t, n, r) {
|
|
|
3917
3926
|
});
|
|
3918
3927
|
});
|
|
3919
3928
|
}
|
|
3920
|
-
function
|
|
3921
|
-
let t = Array.isArray(e.rows) ?
|
|
3929
|
+
function Jo(e) {
|
|
3930
|
+
let t = Array.isArray(e.rows) ? zo(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3922
3931
|
let i = {};
|
|
3923
3932
|
return (e.fields ?? []).forEach((e) => {
|
|
3924
3933
|
if (!e.field) return;
|
|
@@ -3932,26 +3941,26 @@ function qo(e) {
|
|
|
3932
3941
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Y(i, e.field, e.defaultValue);
|
|
3933
3942
|
return;
|
|
3934
3943
|
}
|
|
3935
|
-
Y(i, e.field,
|
|
3936
|
-
}),
|
|
3937
|
-
}, i =
|
|
3944
|
+
Y(i, e.field, Bo(e.addRow) ? ro(e, a) : J(e, a));
|
|
3945
|
+
}), qo(e, t, i, r), i;
|
|
3946
|
+
}, i = Ua(e, { editing: !0 });
|
|
3938
3947
|
if (t && t.length > 0) {
|
|
3939
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3948
|
+
let e = t.map((e) => r(e, (e, t) => Ko(e, t), (e, t) => U(e, t.field)));
|
|
3940
3949
|
for (; e.length < n;) e.push({ ...i });
|
|
3941
3950
|
return e;
|
|
3942
3951
|
}
|
|
3943
|
-
let a = r(e, (e, t) =>
|
|
3952
|
+
let a = r(e, (e, t) => Go(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3944
3953
|
for (; o.length < n;) o.push({ ...i });
|
|
3945
3954
|
return o;
|
|
3946
3955
|
}
|
|
3947
|
-
function
|
|
3956
|
+
function Yo(e, t = []) {
|
|
3948
3957
|
let n = {};
|
|
3949
3958
|
return t.forEach((e) => {
|
|
3950
3959
|
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3951
3960
|
if (!e.field || e.addRow) return;
|
|
3952
3961
|
let t = e.value, r = e.field;
|
|
3953
3962
|
if (e.type === "file") {
|
|
3954
|
-
let i =
|
|
3963
|
+
let i = Go(t, e);
|
|
3955
3964
|
i && Y(n, r, i);
|
|
3956
3965
|
return;
|
|
3957
3966
|
}
|
|
@@ -3961,12 +3970,12 @@ function Jo(e, t = []) {
|
|
|
3961
3970
|
if (i) {
|
|
3962
3971
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3963
3972
|
Y(n, r, e ? [e[0]] : []);
|
|
3964
|
-
} else Y(n, r,
|
|
3973
|
+
} else Y(n, r, ga(e, Array.isArray(t) ? t : [t]));
|
|
3965
3974
|
return;
|
|
3966
3975
|
}
|
|
3967
3976
|
let i = e.splitDialCodeInto;
|
|
3968
3977
|
if (i && typeof t == "string") {
|
|
3969
|
-
let { code: a, rest: o } =
|
|
3978
|
+
let { code: a, rest: o } = vo(t), s = ho(a);
|
|
3970
3979
|
s && Y(n, i, s), Y(n, r, J(e, o || t));
|
|
3971
3980
|
return;
|
|
3972
3981
|
}
|
|
@@ -3976,27 +3985,27 @@ function Jo(e, t = []) {
|
|
|
3976
3985
|
}
|
|
3977
3986
|
//#endregion
|
|
3978
3987
|
//#region src/components/form/useAiActions.js
|
|
3979
|
-
function
|
|
3988
|
+
function Xo(e) {
|
|
3980
3989
|
let t = document.createElement("div");
|
|
3981
3990
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3982
3991
|
}
|
|
3983
|
-
function
|
|
3984
|
-
return t && t === "stripHtml" ?
|
|
3992
|
+
function Zo(e, t) {
|
|
3993
|
+
return t && t === "stripHtml" ? Xo(e) : e;
|
|
3985
3994
|
}
|
|
3986
|
-
function
|
|
3995
|
+
function Qo(e) {
|
|
3987
3996
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3988
3997
|
}
|
|
3989
|
-
function
|
|
3998
|
+
function $o(e) {
|
|
3990
3999
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3991
4000
|
}
|
|
3992
|
-
function
|
|
4001
|
+
function es(e, t) {
|
|
3993
4002
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3994
|
-
let n =
|
|
4003
|
+
let n = Zo(t, e.transform), r = String(n ?? "").trim();
|
|
3995
4004
|
if (!r) return !1;
|
|
3996
4005
|
let i = Number(e.minWords) || 0;
|
|
3997
|
-
return i > 0 ?
|
|
4006
|
+
return i > 0 ? Qo(r) >= i : !0;
|
|
3998
4007
|
}
|
|
3999
|
-
function
|
|
4008
|
+
function ts(e, t) {
|
|
4000
4009
|
let n = e.inputs || [];
|
|
4001
4010
|
if (n.length === 0) return !0;
|
|
4002
4011
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -4004,10 +4013,10 @@ function es(e, t) {
|
|
|
4004
4013
|
let n = e.group || `__solo_${t}`;
|
|
4005
4014
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
4006
4015
|
});
|
|
4007
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
4016
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => es(e, t(e.sourceField)))) return !1;
|
|
4008
4017
|
return !0;
|
|
4009
4018
|
}
|
|
4010
|
-
function
|
|
4019
|
+
function ns(e = []) {
|
|
4011
4020
|
let t = [];
|
|
4012
4021
|
return e.forEach((e) => {
|
|
4013
4022
|
if (e?.addRow) {
|
|
@@ -4020,32 +4029,32 @@ function ts(e = []) {
|
|
|
4020
4029
|
});
|
|
4021
4030
|
}), t;
|
|
4022
4031
|
}
|
|
4023
|
-
function
|
|
4024
|
-
return
|
|
4032
|
+
function rs(e, t) {
|
|
4033
|
+
return ns(t).some((t) => {
|
|
4025
4034
|
let n = e.getFieldValue(t);
|
|
4026
|
-
return Array.isArray(n) ? n.some(
|
|
4035
|
+
return Array.isArray(n) ? n.some($o) : n != null && n !== "";
|
|
4027
4036
|
});
|
|
4028
4037
|
}
|
|
4029
|
-
function
|
|
4030
|
-
let
|
|
4031
|
-
return Object.entries(
|
|
4032
|
-
if (!(
|
|
4038
|
+
function is(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
4039
|
+
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = n || typeof e.isFieldTouched != "function" ? () => !0 : (t) => e.isFieldTouched(t), o = 0;
|
|
4040
|
+
return Object.entries(r).forEach(([e, t]) => {
|
|
4041
|
+
if (!(i.has(e) || !a(e) || !as(t))) {
|
|
4033
4042
|
if (Array.isArray(t)) {
|
|
4034
|
-
|
|
4043
|
+
o += t.filter((e) => e && typeof e == "object" ? $o(e) : !!e).length;
|
|
4035
4044
|
return;
|
|
4036
4045
|
}
|
|
4037
|
-
|
|
4046
|
+
o += 1;
|
|
4038
4047
|
}
|
|
4039
|
-
}),
|
|
4048
|
+
}), o;
|
|
4040
4049
|
}
|
|
4041
|
-
function
|
|
4042
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
4050
|
+
function as(e) {
|
|
4051
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? $o(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
4043
4052
|
}
|
|
4044
|
-
function
|
|
4045
|
-
let
|
|
4046
|
-
return typeof e.isFieldTouched == "function" ?
|
|
4053
|
+
function os(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
4054
|
+
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
4055
|
+
return n ? a.some((e) => as(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && as(r[t])) : a.some((e) => as(r[e]));
|
|
4047
4056
|
}
|
|
4048
|
-
function
|
|
4057
|
+
function ss(e = []) {
|
|
4049
4058
|
let t = {};
|
|
4050
4059
|
return (e ?? []).forEach((e) => {
|
|
4051
4060
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4056,38 +4065,38 @@ function os(e = []) {
|
|
|
4056
4065
|
});
|
|
4057
4066
|
}), t;
|
|
4058
4067
|
}
|
|
4059
|
-
function
|
|
4068
|
+
function cs(e, t, n) {
|
|
4060
4069
|
let r = e?.confirmWhen ?? "never";
|
|
4061
|
-
return r === "never" ? !1 : r === "always" ||
|
|
4070
|
+
return r === "never" ? !1 : r === "always" || rs(t, n);
|
|
4062
4071
|
}
|
|
4063
|
-
var
|
|
4072
|
+
var ls = [
|
|
4064
4073
|
"top-left",
|
|
4065
4074
|
"top-center",
|
|
4066
4075
|
"top-right",
|
|
4067
4076
|
"bottom-left",
|
|
4068
4077
|
"bottom-center",
|
|
4069
4078
|
"bottom-right"
|
|
4070
|
-
],
|
|
4071
|
-
function
|
|
4079
|
+
], us = "bottom-left";
|
|
4080
|
+
function ds(e = []) {
|
|
4072
4081
|
let t = {};
|
|
4073
4082
|
return e.forEach((e) => {
|
|
4074
|
-
let n =
|
|
4083
|
+
let n = ls.includes(e.position) ? e.position : us;
|
|
4075
4084
|
(t[n] ??= []).push(e);
|
|
4076
4085
|
}), t;
|
|
4077
4086
|
}
|
|
4078
|
-
function
|
|
4079
|
-
let [
|
|
4087
|
+
function fs({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
4088
|
+
let [o, s] = g(null), [c, l] = g(""), u = b.useWatch((e) => e, e), d = f((e) => ts(e, (e) => (u || {})[e]), [u]), p = f((t) => {
|
|
4080
4089
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
4081
|
-
let n =
|
|
4090
|
+
let n = Yo(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
4082
4091
|
return t.forEach((t) => {
|
|
4083
4092
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
4084
|
-
let n =
|
|
4093
|
+
let n = Jo(t);
|
|
4085
4094
|
if (n.length === 0) return;
|
|
4086
4095
|
r = !0;
|
|
4087
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
4096
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter($o);
|
|
4088
4097
|
if (a.length) {
|
|
4089
4098
|
let e = t.label || t.name;
|
|
4090
|
-
|
|
4099
|
+
lo({
|
|
4091
4100
|
tone: "overwrite",
|
|
4092
4101
|
title: `Replace what's in ${e}?`,
|
|
4093
4102
|
facts: [
|
|
@@ -4115,11 +4124,11 @@ function ds({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4115
4124
|
}), r;
|
|
4116
4125
|
}, [e]);
|
|
4117
4126
|
return {
|
|
4118
|
-
runAction: f(async (t,
|
|
4119
|
-
let
|
|
4120
|
-
if (
|
|
4121
|
-
let t =
|
|
4122
|
-
if (!await
|
|
4127
|
+
runAction: f(async (t, o, c, u) => {
|
|
4128
|
+
let d = c?.confirmWhen ?? "never";
|
|
4129
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || os(e, [o?.field], { includeUntouched: a }))) {
|
|
4130
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = is(e, [o?.field], { includeUntouched: a });
|
|
4131
|
+
if (!await lo({
|
|
4123
4132
|
tone: "overwrite",
|
|
4124
4133
|
title: t.title || "Read this file and fill the form in?",
|
|
4125
4134
|
facts: [{
|
|
@@ -4134,36 +4143,36 @@ function ds({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4134
4143
|
cancelText: t.cancel || "Keep what I typed"
|
|
4135
4144
|
})) return;
|
|
4136
4145
|
}
|
|
4137
|
-
|
|
4146
|
+
s(c.key), l(c.loadingText || `Reading ${c.label || "the file"}…`);
|
|
4138
4147
|
try {
|
|
4139
|
-
let
|
|
4140
|
-
(
|
|
4148
|
+
let a = {}, s = {};
|
|
4149
|
+
(c.inputs || []).forEach((t) => {
|
|
4141
4150
|
if (t.kind === "file") {
|
|
4142
|
-
let n = e.getFieldValue(t.sourceField), r =
|
|
4143
|
-
r && (
|
|
4151
|
+
let n = e.getFieldValue(t.sourceField), r = u ?? n?.[n.length - 1]?.originFileObj;
|
|
4152
|
+
r && (s[t.param] = r);
|
|
4144
4153
|
} else {
|
|
4145
4154
|
let n = e.getFieldValue(t.sourceField);
|
|
4146
|
-
n != null && n !== "" && (
|
|
4155
|
+
n != null && n !== "" && (a[t.param] = Zo(n, t.transform));
|
|
4147
4156
|
}
|
|
4148
|
-
}), (
|
|
4149
|
-
!e.group || e.kind !== "text" || (
|
|
4157
|
+
}), (c.inputs || []).forEach((e) => {
|
|
4158
|
+
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
4150
4159
|
});
|
|
4151
|
-
let
|
|
4160
|
+
let l = await fo({
|
|
4152
4161
|
module: n,
|
|
4153
4162
|
group: t,
|
|
4154
|
-
field:
|
|
4155
|
-
actionKey:
|
|
4156
|
-
inputs:
|
|
4157
|
-
files:
|
|
4158
|
-
}),
|
|
4159
|
-
if (
|
|
4160
|
-
let e =
|
|
4161
|
-
if (!await
|
|
4163
|
+
field: o.field,
|
|
4164
|
+
actionKey: c.key,
|
|
4165
|
+
inputs: a,
|
|
4166
|
+
files: s
|
|
4167
|
+
}), d = c.label || "AI action", f = l?.groups;
|
|
4168
|
+
if (c?.trigger !== "upload" && cs(c, e, f)) {
|
|
4169
|
+
let e = c.confirmMessages ?? {}, t = ns(f).length;
|
|
4170
|
+
if (!await lo({
|
|
4162
4171
|
tone: "overwrite",
|
|
4163
|
-
title: e.title || `Fill the form in from ${
|
|
4172
|
+
title: e.title || `Fill the form in from ${d}?`,
|
|
4164
4173
|
facts: [{
|
|
4165
4174
|
label: "Source",
|
|
4166
|
-
value:
|
|
4175
|
+
value: d
|
|
4167
4176
|
}, {
|
|
4168
4177
|
label: "Boxes it would fill",
|
|
4169
4178
|
value: t || void 0
|
|
@@ -4171,46 +4180,47 @@ function ds({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4171
4180
|
body: e.body || "We found details you can use. Applying them will replace what you have already entered in those boxes.",
|
|
4172
4181
|
okText: e.ok || "Use these details",
|
|
4173
4182
|
cancelText: e.cancel || "Keep what I typed"
|
|
4174
|
-
})) return C.info(`${
|
|
4183
|
+
})) return C.info(`${d} cancelled — your entries were kept.`), l;
|
|
4175
4184
|
}
|
|
4176
4185
|
if (i) {
|
|
4177
4186
|
let e = await i({
|
|
4178
|
-
action:
|
|
4179
|
-
field:
|
|
4187
|
+
action: c,
|
|
4188
|
+
field: o,
|
|
4180
4189
|
groupName: t,
|
|
4181
|
-
responseGroups:
|
|
4182
|
-
payload:
|
|
4190
|
+
responseGroups: f,
|
|
4191
|
+
payload: ss(f)
|
|
4183
4192
|
});
|
|
4184
|
-
if (e === !1 || e === "abort") return
|
|
4193
|
+
if (e === !1 || e === "abort") return l;
|
|
4185
4194
|
}
|
|
4186
|
-
let m =
|
|
4187
|
-
return m ? C.success(`${
|
|
4188
|
-
action:
|
|
4189
|
-
field:
|
|
4195
|
+
let m = p(f);
|
|
4196
|
+
return m ? C.success(`${d} completed successfully.`) : C.info(`${d} completed, but no matching details were found.`), m && r && await r({
|
|
4197
|
+
action: c,
|
|
4198
|
+
field: o,
|
|
4190
4199
|
groupName: t
|
|
4191
|
-
}),
|
|
4200
|
+
}), l;
|
|
4192
4201
|
} catch (e) {
|
|
4193
|
-
C.error(e?.message || `${
|
|
4202
|
+
C.error(e?.message || `${c.label || "AI action"} failed`);
|
|
4194
4203
|
return;
|
|
4195
4204
|
} finally {
|
|
4196
|
-
|
|
4205
|
+
s(null), l("");
|
|
4197
4206
|
}
|
|
4198
4207
|
}, [
|
|
4199
4208
|
e,
|
|
4200
4209
|
n,
|
|
4201
|
-
|
|
4210
|
+
p,
|
|
4202
4211
|
r,
|
|
4203
|
-
i
|
|
4212
|
+
i,
|
|
4213
|
+
a
|
|
4204
4214
|
]),
|
|
4205
|
-
loadingKey:
|
|
4206
|
-
loadingText:
|
|
4207
|
-
busy:
|
|
4208
|
-
isActionEnabled:
|
|
4215
|
+
loadingKey: o,
|
|
4216
|
+
loadingText: c,
|
|
4217
|
+
busy: o !== null,
|
|
4218
|
+
isActionEnabled: d
|
|
4209
4219
|
};
|
|
4210
4220
|
}
|
|
4211
4221
|
//#endregion
|
|
4212
4222
|
//#region src/components/form/AiActionButtons.jsx
|
|
4213
|
-
function
|
|
4223
|
+
function ps({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
4214
4224
|
if (!t || t.length === 0) return null;
|
|
4215
4225
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
4216
4226
|
return /* @__PURE__ */ w(ee, {
|
|
@@ -4231,18 +4241,18 @@ function fs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
4231
4241
|
}
|
|
4232
4242
|
//#endregion
|
|
4233
4243
|
//#region src/components/form/emailValidator.js
|
|
4234
|
-
function
|
|
4244
|
+
function ms(e) {
|
|
4235
4245
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
4236
4246
|
if (!n) return !1;
|
|
4237
4247
|
let [, r, i] = n;
|
|
4238
4248
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
4239
4249
|
}
|
|
4240
|
-
function
|
|
4241
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
4250
|
+
function hs(e = "Email", t) {
|
|
4251
|
+
return { validator: (n, r) => r == null || r === "" || ms(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
4242
4252
|
}
|
|
4243
4253
|
//#endregion
|
|
4244
4254
|
//#region src/components/form/inputValidator.js
|
|
4245
|
-
var
|
|
4255
|
+
var gs = [
|
|
4246
4256
|
{
|
|
4247
4257
|
label: "Only Numbers",
|
|
4248
4258
|
value: "onlyNumber"
|
|
@@ -4315,7 +4325,7 @@ var hs = [
|
|
|
4315
4325
|
label: "Website URL",
|
|
4316
4326
|
value: "websiteUrl"
|
|
4317
4327
|
}
|
|
4318
|
-
],
|
|
4328
|
+
], _s = {
|
|
4319
4329
|
onlyNumber: /^[0-9]$/,
|
|
4320
4330
|
experience: /^[0-9]$/,
|
|
4321
4331
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -4331,10 +4341,10 @@ var hs = [
|
|
|
4331
4341
|
decimalRange: /^[0-9.]$/,
|
|
4332
4342
|
contactNumber: /^[0-9()\-+\s]$/
|
|
4333
4343
|
};
|
|
4334
|
-
function
|
|
4335
|
-
return
|
|
4344
|
+
function vs(e) {
|
|
4345
|
+
return _s[e] ?? null;
|
|
4336
4346
|
}
|
|
4337
|
-
function
|
|
4347
|
+
function ys(e, t = {}, n = "change") {
|
|
4338
4348
|
if (!t?.type || e == null) return {
|
|
4339
4349
|
cleaned: e ?? "",
|
|
4340
4350
|
error: null
|
|
@@ -4417,7 +4427,7 @@ function vs(e, t = {}, n = "change") {
|
|
|
4417
4427
|
break;
|
|
4418
4428
|
}
|
|
4419
4429
|
case "email":
|
|
4420
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4430
|
+
c = n === "blur" ? r.trim() : r, c && !ms(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
4421
4431
|
break;
|
|
4422
4432
|
case "websiteUrl":
|
|
4423
4433
|
c = n === "blur" ? r.trim() : r, c && !/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c) && (l = `${s} must be a valid URL.`);
|
|
@@ -4429,21 +4439,21 @@ function vs(e, t = {}, n = "change") {
|
|
|
4429
4439
|
error: l
|
|
4430
4440
|
};
|
|
4431
4441
|
}
|
|
4432
|
-
var
|
|
4433
|
-
function
|
|
4442
|
+
var bs = "This value is already present";
|
|
4443
|
+
function xs(e) {
|
|
4434
4444
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
4435
4445
|
}
|
|
4436
|
-
function
|
|
4437
|
-
if (
|
|
4446
|
+
function Ss(e) {
|
|
4447
|
+
if (xs(e) !== "unique") return null;
|
|
4438
4448
|
if (typeof e == "string") return {
|
|
4439
|
-
message:
|
|
4449
|
+
message: bs,
|
|
4440
4450
|
normalizer: "trim",
|
|
4441
4451
|
skipBlank: !0,
|
|
4442
4452
|
validateOn: "blur"
|
|
4443
4453
|
};
|
|
4444
4454
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4445
4455
|
return {
|
|
4446
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4456
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : bs,
|
|
4447
4457
|
collectionField: t.collectionField ?? "",
|
|
4448
4458
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4449
4459
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4454,20 +4464,20 @@ function xs(e) {
|
|
|
4454
4464
|
].includes(n) ? n : "blur"
|
|
4455
4465
|
};
|
|
4456
4466
|
}
|
|
4457
|
-
function
|
|
4467
|
+
function Cs(e) {
|
|
4458
4468
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4459
4469
|
if (!Array.isArray(t)) return null;
|
|
4460
4470
|
for (let e of t) {
|
|
4461
|
-
let t =
|
|
4471
|
+
let t = Ss(e);
|
|
4462
4472
|
if (t) return t;
|
|
4463
4473
|
}
|
|
4464
4474
|
return null;
|
|
4465
4475
|
}
|
|
4466
|
-
function
|
|
4476
|
+
function ws(e = []) {
|
|
4467
4477
|
let t = [];
|
|
4468
4478
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4469
4479
|
(e?.fields ?? []).forEach((e) => {
|
|
4470
|
-
let n =
|
|
4480
|
+
let n = Cs(e);
|
|
4471
4481
|
!n || !e?.field || t.push({
|
|
4472
4482
|
field: e.field,
|
|
4473
4483
|
label: e.label ?? e.field,
|
|
@@ -4476,10 +4486,10 @@ function Cs(e = []) {
|
|
|
4476
4486
|
});
|
|
4477
4487
|
}), t;
|
|
4478
4488
|
}
|
|
4479
|
-
function
|
|
4489
|
+
function Ts(e) {
|
|
4480
4490
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4481
4491
|
}
|
|
4482
|
-
function
|
|
4492
|
+
function Es(e, t = "trim") {
|
|
4483
4493
|
if (e == null) return "";
|
|
4484
4494
|
let n = String(e);
|
|
4485
4495
|
switch (String(t)) {
|
|
@@ -4491,10 +4501,10 @@ function Ts(e, t = "trim") {
|
|
|
4491
4501
|
default: return n.trim();
|
|
4492
4502
|
}
|
|
4493
4503
|
}
|
|
4494
|
-
function
|
|
4495
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4504
|
+
function Ds(e, t) {
|
|
4505
|
+
return !(!e || e.skipBlank !== !1 && Ts(t));
|
|
4496
4506
|
}
|
|
4497
|
-
function
|
|
4507
|
+
function Os(e) {
|
|
4498
4508
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4499
4509
|
}
|
|
4500
4510
|
var X = {
|
|
@@ -4504,21 +4514,21 @@ var X = {
|
|
|
4504
4514
|
STALE: "stale",
|
|
4505
4515
|
ERROR: "error"
|
|
4506
4516
|
};
|
|
4507
|
-
function
|
|
4517
|
+
function ks({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4508
4518
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4509
4519
|
}
|
|
4510
|
-
function
|
|
4520
|
+
function As({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4511
4521
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4512
4522
|
function o(e) {
|
|
4513
4523
|
a = e, typeof t == "function" && t(a);
|
|
4514
4524
|
}
|
|
4515
4525
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4516
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4517
|
-
let p =
|
|
4526
|
+
if (!c || !t || !s || typeof e != "function" || !Ds(c, l)) return { status: X.SKIPPED };
|
|
4527
|
+
let p = ks({
|
|
4518
4528
|
module: t,
|
|
4519
4529
|
field: s,
|
|
4520
4530
|
recordId: u,
|
|
4521
|
-
normalized:
|
|
4531
|
+
normalized: Es(l, c.normalizer)
|
|
4522
4532
|
});
|
|
4523
4533
|
if (n.has(p)) return n.get(p);
|
|
4524
4534
|
i += 1;
|
|
@@ -4536,7 +4546,7 @@ function ks({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4536
4546
|
if (r.get(s) !== m) return { status: X.STALE };
|
|
4537
4547
|
let a = i?.available === !1 ? {
|
|
4538
4548
|
status: X.DUPLICATE,
|
|
4539
|
-
message:
|
|
4549
|
+
message: js(i) || c.message || bs
|
|
4540
4550
|
} : { status: X.AVAILABLE };
|
|
4541
4551
|
return n.set(p, a), a;
|
|
4542
4552
|
} catch (e) {
|
|
@@ -4557,17 +4567,17 @@ function ks({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4557
4567
|
}
|
|
4558
4568
|
};
|
|
4559
4569
|
}
|
|
4560
|
-
function
|
|
4570
|
+
function js(e) {
|
|
4561
4571
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4562
4572
|
}
|
|
4563
|
-
var
|
|
4564
|
-
function
|
|
4565
|
-
let r =
|
|
4573
|
+
var Ms = "__uniqueRule";
|
|
4574
|
+
function Ns({ field: e, validation: t, context: n }) {
|
|
4575
|
+
let r = Ss(t);
|
|
4566
4576
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4567
4577
|
let i = e?.field ?? "";
|
|
4568
4578
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4569
|
-
[
|
|
4570
|
-
validateTrigger:
|
|
4579
|
+
[Ms]: r,
|
|
4580
|
+
validateTrigger: Os(r),
|
|
4571
4581
|
validator: async (e, t) => {
|
|
4572
4582
|
let a = await n.checker.check({
|
|
4573
4583
|
module: n.module,
|
|
@@ -4582,22 +4592,22 @@ function Ms({ field: e, validation: t, context: n }) {
|
|
|
4582
4592
|
}
|
|
4583
4593
|
};
|
|
4584
4594
|
}
|
|
4585
|
-
function
|
|
4595
|
+
function Ps(e = []) {
|
|
4586
4596
|
let t = Array.isArray(e) ? e : [];
|
|
4587
|
-
if (!t.some((e) => e && e[
|
|
4588
|
-
let n = t.filter((e) => e && !e[
|
|
4597
|
+
if (!t.some((e) => e && e[Ms])) return t;
|
|
4598
|
+
let n = t.filter((e) => e && !e[Ms]);
|
|
4589
4599
|
return t.map((e) => {
|
|
4590
|
-
if (!e || !e[
|
|
4600
|
+
if (!e || !e[Ms]) return e;
|
|
4591
4601
|
let t = e.validator;
|
|
4592
4602
|
return {
|
|
4593
4603
|
...e,
|
|
4594
|
-
validator: async (e, r) => await
|
|
4604
|
+
validator: async (e, r) => await Fs(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4595
4605
|
};
|
|
4596
4606
|
});
|
|
4597
4607
|
}
|
|
4598
|
-
async function
|
|
4608
|
+
async function Fs(e = [], t, n = {}) {
|
|
4599
4609
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4600
|
-
if (r.required &&
|
|
4610
|
+
if (r.required && Ts(t) || !Ts(t) && (r.pattern instanceof RegExp && !new RegExp(r.pattern.source, r.pattern.flags).test(String(t)) || r.len != null && String(t).length !== Number(r.len))) return !0;
|
|
4601
4611
|
if (typeof r.validator == "function") try {
|
|
4602
4612
|
await r.validator(n, t);
|
|
4603
4613
|
} catch {
|
|
@@ -4606,7 +4616,7 @@ async function Ps(e = [], t, n = {}) {
|
|
|
4606
4616
|
}
|
|
4607
4617
|
return !1;
|
|
4608
4618
|
}
|
|
4609
|
-
function
|
|
4619
|
+
function Is(e) {
|
|
4610
4620
|
let t = String(e ?? "").trim();
|
|
4611
4621
|
if (!t.startsWith("{")) return null;
|
|
4612
4622
|
try {
|
|
@@ -4615,19 +4625,19 @@ function Fs(e) {
|
|
|
4615
4625
|
return null;
|
|
4616
4626
|
}
|
|
4617
4627
|
}
|
|
4618
|
-
function
|
|
4628
|
+
function Ls(e) {
|
|
4619
4629
|
if (!e) return null;
|
|
4620
|
-
if (typeof e == "string") return
|
|
4630
|
+
if (typeof e == "string") return Is(e);
|
|
4621
4631
|
let t = [
|
|
4622
4632
|
e.data,
|
|
4623
4633
|
e.response,
|
|
4624
4634
|
e,
|
|
4625
|
-
|
|
4635
|
+
Is(e.message)
|
|
4626
4636
|
];
|
|
4627
4637
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4628
4638
|
return null;
|
|
4629
4639
|
}
|
|
4630
|
-
function
|
|
4640
|
+
function Rs({ field: e, group: t, rowIndex: n }) {
|
|
4631
4641
|
let r = String(e ?? ""), i = Number(n);
|
|
4632
4642
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4633
4643
|
String(t),
|
|
@@ -4635,14 +4645,14 @@ function Ls({ field: e, group: t, rowIndex: n }) {
|
|
|
4635
4645
|
...r.split(".")
|
|
4636
4646
|
] : r;
|
|
4637
4647
|
}
|
|
4638
|
-
function
|
|
4639
|
-
let n =
|
|
4648
|
+
function zs(e, { uniqueRules: t = [] } = {}) {
|
|
4649
|
+
let n = Ls(e);
|
|
4640
4650
|
if (n) {
|
|
4641
4651
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4642
4652
|
let t = {
|
|
4643
4653
|
field: e.field,
|
|
4644
|
-
name:
|
|
4645
|
-
message: e.message || n.message ||
|
|
4654
|
+
name: Rs(e),
|
|
4655
|
+
message: e.message || n.message || bs
|
|
4646
4656
|
};
|
|
4647
4657
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4648
4658
|
});
|
|
@@ -4659,7 +4669,7 @@ function Rs(e, { uniqueRules: t = [] } = {}) {
|
|
|
4659
4669
|
}
|
|
4660
4670
|
//#endregion
|
|
4661
4671
|
//#region src/services/uniqueValidationApi.js
|
|
4662
|
-
async function
|
|
4672
|
+
async function Bs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4663
4673
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4664
4674
|
let c = {
|
|
4665
4675
|
field: t,
|
|
@@ -4693,7 +4703,7 @@ async function zs({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4693
4703
|
throw e;
|
|
4694
4704
|
}
|
|
4695
4705
|
}
|
|
4696
|
-
async function
|
|
4706
|
+
async function Vs({ module: e, payload: t, excludeId: n } = {}) {
|
|
4697
4707
|
if (!e || !t) return { duplicate: !1 };
|
|
4698
4708
|
try {
|
|
4699
4709
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4711,7 +4721,7 @@ async function Bs({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4711
4721
|
}
|
|
4712
4722
|
//#endregion
|
|
4713
4723
|
//#region src/components/form/uploadAccept.js
|
|
4714
|
-
var
|
|
4724
|
+
var Hs = [
|
|
4715
4725
|
"jpg",
|
|
4716
4726
|
"jpeg",
|
|
4717
4727
|
"png",
|
|
@@ -4720,18 +4730,18 @@ var Vs = [
|
|
|
4720
4730
|
"bmp",
|
|
4721
4731
|
"svg",
|
|
4722
4732
|
"avif"
|
|
4723
|
-
],
|
|
4733
|
+
], Us = [
|
|
4724
4734
|
"mp4",
|
|
4725
4735
|
"webm",
|
|
4726
4736
|
"ogg",
|
|
4727
4737
|
"ogv",
|
|
4728
4738
|
"mov",
|
|
4729
4739
|
"m4v"
|
|
4730
|
-
],
|
|
4740
|
+
], Ws = [
|
|
4731
4741
|
"pdf",
|
|
4732
4742
|
"doc",
|
|
4733
4743
|
"docx"
|
|
4734
|
-
],
|
|
4744
|
+
], Gs = [
|
|
4735
4745
|
{
|
|
4736
4746
|
label: "Any file",
|
|
4737
4747
|
value: "any"
|
|
@@ -4756,45 +4766,45 @@ var Vs = [
|
|
|
4756
4766
|
label: "Images & Videos",
|
|
4757
4767
|
value: "imagesAndVideos"
|
|
4758
4768
|
}
|
|
4759
|
-
],
|
|
4769
|
+
], Ks = {
|
|
4760
4770
|
resume: {
|
|
4761
|
-
exts:
|
|
4771
|
+
exts: Ws,
|
|
4762
4772
|
maxSizeMB: 2,
|
|
4763
4773
|
hint: "PDF, DOC or DOCX",
|
|
4764
4774
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4765
4775
|
},
|
|
4766
4776
|
documents: {
|
|
4767
|
-
exts: [...
|
|
4777
|
+
exts: [...Ws, ...Hs],
|
|
4768
4778
|
hint: "PDF, DOC or image files",
|
|
4769
4779
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4770
4780
|
},
|
|
4771
4781
|
images: {
|
|
4772
|
-
exts:
|
|
4782
|
+
exts: Hs,
|
|
4773
4783
|
hint: "Image files",
|
|
4774
4784
|
error: "Only image files are allowed"
|
|
4775
4785
|
},
|
|
4776
4786
|
videos: {
|
|
4777
|
-
exts:
|
|
4787
|
+
exts: Us,
|
|
4778
4788
|
hint: "Video files",
|
|
4779
4789
|
error: "Only video files are allowed"
|
|
4780
4790
|
},
|
|
4781
4791
|
imagesAndVideos: {
|
|
4782
|
-
exts: [...
|
|
4792
|
+
exts: [...Hs, ...Us],
|
|
4783
4793
|
hint: "Image or video files",
|
|
4784
4794
|
error: "Only image or video files are allowed"
|
|
4785
4795
|
}
|
|
4786
4796
|
};
|
|
4787
|
-
function
|
|
4797
|
+
function qs(e) {
|
|
4788
4798
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4789
4799
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4790
4800
|
}
|
|
4791
|
-
function
|
|
4801
|
+
function Js(e) {
|
|
4792
4802
|
let t = String(e?.accept ?? "").trim();
|
|
4793
|
-
return t && t !== "any" ?
|
|
4803
|
+
return t && t !== "any" ? Ks[t] ?? null : !t && qs(e) ? Ks.resume : Ks[t] ?? null;
|
|
4794
4804
|
}
|
|
4795
4805
|
//#endregion
|
|
4796
4806
|
//#region src/components/form/quickActionLabels.js
|
|
4797
|
-
var
|
|
4807
|
+
var Ys = /* @__PURE__ */ new Set([
|
|
4798
4808
|
"of",
|
|
4799
4809
|
"and",
|
|
4800
4810
|
"the",
|
|
@@ -4803,7 +4813,7 @@ var Js = /* @__PURE__ */ new Set([
|
|
|
4803
4813
|
"in",
|
|
4804
4814
|
"a",
|
|
4805
4815
|
"an"
|
|
4806
|
-
]),
|
|
4816
|
+
]), Xs = {
|
|
4807
4817
|
addresses: "address",
|
|
4808
4818
|
branches: "branch",
|
|
4809
4819
|
batches: "batch",
|
|
@@ -4814,43 +4824,43 @@ var Js = /* @__PURE__ */ new Set([
|
|
|
4814
4824
|
people: "person",
|
|
4815
4825
|
statuses: "status"
|
|
4816
4826
|
};
|
|
4817
|
-
function
|
|
4827
|
+
function Zs(e) {
|
|
4818
4828
|
let t = String(e ?? "").trim();
|
|
4819
4829
|
if (!t) return "";
|
|
4820
4830
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4821
4831
|
let n = t.toLowerCase();
|
|
4822
|
-
return
|
|
4832
|
+
return Xs[n] ? Xs[n] : /[^aeiou]ies$/i.test(t) ? t.slice(0, -3) + "y" : /(s|x|z|ch|sh)es$/i.test(t) ? t.slice(0, -2) : /[^s]s$/i.test(t) ? t.slice(0, -1) : t;
|
|
4823
4833
|
}
|
|
4824
|
-
function
|
|
4834
|
+
function Qs(e) {
|
|
4825
4835
|
let t = String(e ?? "").trim();
|
|
4826
4836
|
if (!t) return "";
|
|
4827
4837
|
let n = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-.]+/g, " ").split(/\s+/).filter(Boolean);
|
|
4828
4838
|
if (!n.length) return "";
|
|
4829
|
-
let r =
|
|
4839
|
+
let r = Zs(n[n.length - 1]);
|
|
4830
4840
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4831
4841
|
let n = e.toLowerCase();
|
|
4832
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4842
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Ys.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4833
4843
|
}).join(" ");
|
|
4834
4844
|
}
|
|
4835
|
-
function
|
|
4845
|
+
function $s(e, t) {
|
|
4836
4846
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4837
4847
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4838
|
-
let r =
|
|
4848
|
+
let r = Qs(e?.quickCreateModule || t);
|
|
4839
4849
|
return r ? `Add New ${r}` : "Add New";
|
|
4840
4850
|
}
|
|
4841
|
-
function
|
|
4851
|
+
function ec(e, t) {
|
|
4842
4852
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4843
4853
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4844
|
-
let r =
|
|
4854
|
+
let r = Qs(e?.quickEditModule || t);
|
|
4845
4855
|
return r ? `Edit ${r}` : "Edit";
|
|
4846
4856
|
}
|
|
4847
|
-
function
|
|
4848
|
-
let r =
|
|
4849
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4857
|
+
function tc(e, t, n) {
|
|
4858
|
+
let r = Qs((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4859
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : $s(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : ec(t, n));
|
|
4850
4860
|
}
|
|
4851
4861
|
//#endregion
|
|
4852
4862
|
//#region src/components/AppButton.jsx
|
|
4853
|
-
function
|
|
4863
|
+
function nc({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4854
4864
|
let o = /* @__PURE__ */ w(v, {
|
|
4855
4865
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4856
4866
|
icon: n,
|
|
@@ -4865,13 +4875,13 @@ function tc({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4865
4875
|
}
|
|
4866
4876
|
//#endregion
|
|
4867
4877
|
//#region src/components/detail/userNames.js
|
|
4868
|
-
function
|
|
4878
|
+
function rc(e) {
|
|
4869
4879
|
return !e || typeof e != "object" ? "" : [e.first_name ?? e.firstName ?? e.FIRST_NAME, e.last_name ?? e.lastName ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.user_name || e.userName || e.username || e.email || "";
|
|
4870
4880
|
}
|
|
4871
|
-
function
|
|
4881
|
+
function ic(e) {
|
|
4872
4882
|
let t = {};
|
|
4873
4883
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4874
|
-
let n =
|
|
4884
|
+
let n = rc(e);
|
|
4875
4885
|
n && [
|
|
4876
4886
|
e.legacyUserId,
|
|
4877
4887
|
e.userId,
|
|
@@ -4885,16 +4895,16 @@ function rc(e) {
|
|
|
4885
4895
|
});
|
|
4886
4896
|
}), t;
|
|
4887
4897
|
}
|
|
4888
|
-
var
|
|
4889
|
-
function
|
|
4898
|
+
var ac = /* @__PURE__ */ new Map();
|
|
4899
|
+
function oc(e) {
|
|
4890
4900
|
let t = String(e ?? "").trim();
|
|
4891
4901
|
if (!t) return Promise.resolve("");
|
|
4892
|
-
if (
|
|
4893
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4894
|
-
return
|
|
4902
|
+
if (ac.has(t)) return ac.get(t);
|
|
4903
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => rc(e?.data ?? e ?? null)).catch(() => "");
|
|
4904
|
+
return ac.set(t, n), n;
|
|
4895
4905
|
}
|
|
4896
4906
|
var Z = (e) => e == null ? "" : String(e).trim();
|
|
4897
|
-
function
|
|
4907
|
+
function sc(e) {
|
|
4898
4908
|
let t = e?.quickCreateNotice;
|
|
4899
4909
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4900
4910
|
enabled: !0,
|
|
@@ -4907,7 +4917,7 @@ function oc(e) {
|
|
|
4907
4917
|
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
4908
4918
|
};
|
|
4909
4919
|
}
|
|
4910
|
-
var
|
|
4920
|
+
var cc = [
|
|
4911
4921
|
"clientName",
|
|
4912
4922
|
"companyName",
|
|
4913
4923
|
"name",
|
|
@@ -4917,24 +4927,24 @@ var sc = [
|
|
|
4917
4927
|
"label",
|
|
4918
4928
|
"employerName",
|
|
4919
4929
|
"vendorName"
|
|
4920
|
-
],
|
|
4930
|
+
], lc = (e, t) => {
|
|
4921
4931
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4922
|
-
},
|
|
4923
|
-
function
|
|
4932
|
+
}, uc = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4933
|
+
function dc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4924
4934
|
if (!e || typeof e != "object") return "";
|
|
4925
4935
|
for (let r of [
|
|
4926
4936
|
t,
|
|
4927
4937
|
n,
|
|
4928
|
-
...
|
|
4938
|
+
...cc
|
|
4929
4939
|
]) {
|
|
4930
4940
|
if (!r) continue;
|
|
4931
|
-
let t = lc(
|
|
4941
|
+
let t = uc(lc(e, r));
|
|
4932
4942
|
if (t) return t;
|
|
4933
4943
|
}
|
|
4934
4944
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4935
4945
|
return r ? Z(e[r]) : "";
|
|
4936
4946
|
}
|
|
4937
|
-
function
|
|
4947
|
+
function fc(e) {
|
|
4938
4948
|
if (!e || typeof e != "object") return "";
|
|
4939
4949
|
let t = [
|
|
4940
4950
|
e.createdBy,
|
|
@@ -4956,36 +4966,36 @@ function dc(e) {
|
|
|
4956
4966
|
}
|
|
4957
4967
|
return "";
|
|
4958
4968
|
}
|
|
4959
|
-
function
|
|
4969
|
+
function pc(e = i) {
|
|
4960
4970
|
try {
|
|
4961
|
-
return
|
|
4971
|
+
return rc(e()) || "";
|
|
4962
4972
|
} catch {
|
|
4963
4973
|
return "";
|
|
4964
4974
|
}
|
|
4965
4975
|
}
|
|
4966
|
-
var
|
|
4976
|
+
var mc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4967
4977
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4968
4978
|
return Array.isArray(t) ? t[0] : t;
|
|
4969
4979
|
});
|
|
4970
|
-
async function
|
|
4971
|
-
let { fetchRecord: o =
|
|
4980
|
+
async function hc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4981
|
+
let { fetchRecord: o = mc, fetchUserNameFn: s = oc, getUser: c = i } = a, l = null;
|
|
4972
4982
|
if (e && t) try {
|
|
4973
4983
|
l = await o(e, t);
|
|
4974
4984
|
} catch {
|
|
4975
4985
|
l = null;
|
|
4976
4986
|
}
|
|
4977
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4987
|
+
let u = n?.showRecordName === !1 ? "" : dc(l, {
|
|
4978
4988
|
recordNameField: n?.recordNameField,
|
|
4979
4989
|
displayField: r
|
|
4980
4990
|
}), d = "";
|
|
4981
4991
|
if (n?.showCreator !== !1) {
|
|
4982
|
-
let e =
|
|
4992
|
+
let e = fc(l);
|
|
4983
4993
|
if (e) try {
|
|
4984
4994
|
d = Z(await s(e));
|
|
4985
4995
|
} catch {
|
|
4986
4996
|
d = "";
|
|
4987
4997
|
}
|
|
4988
|
-
d ||=
|
|
4998
|
+
d ||= pc(c);
|
|
4989
4999
|
}
|
|
4990
5000
|
return {
|
|
4991
5001
|
recordName: u,
|
|
@@ -4994,17 +5004,17 @@ async function mc({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
4994
5004
|
}
|
|
4995
5005
|
//#endregion
|
|
4996
5006
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4997
|
-
var
|
|
4998
|
-
function
|
|
5007
|
+
var gc = d(() => import("./index.js").then((e) => e.i)), _c = d(() => import("./index.js").then((e) => e.n)), vc = (e) => e == null || e === "", yc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
5008
|
+
function bc(e, t, n, r, i) {
|
|
4999
5009
|
let a = e.quickEditIdFrom;
|
|
5000
5010
|
if (a) {
|
|
5001
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
5002
|
-
return
|
|
5011
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...yc(a)] : yc(a), i = t?.getFieldValue?.(e);
|
|
5012
|
+
return vc(i) && (i = r?.[a]), vc(i) ? null : i;
|
|
5003
5013
|
}
|
|
5004
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
5014
|
+
return i && typeof i == "object" ? i.value ?? null : vc(i) ? null : i;
|
|
5005
5015
|
}
|
|
5006
|
-
function
|
|
5007
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ?
|
|
5016
|
+
function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
5017
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ? bc(e, t, n, i, a) : null, [
|
|
5008
5018
|
p,
|
|
5009
5019
|
e,
|
|
5010
5020
|
t,
|
|
@@ -5034,12 +5044,12 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5034
5044
|
module: _,
|
|
5035
5045
|
recordId: String(y)
|
|
5036
5046
|
}), C = (t) => {
|
|
5037
|
-
let n =
|
|
5047
|
+
let n = sc(e);
|
|
5038
5048
|
n && (d({
|
|
5039
5049
|
...n,
|
|
5040
5050
|
recordName: "",
|
|
5041
5051
|
creatorName: ""
|
|
5042
|
-
}),
|
|
5052
|
+
}), hc({
|
|
5043
5053
|
module: h,
|
|
5044
5054
|
recordId: t,
|
|
5045
5055
|
notice: n,
|
|
@@ -5069,20 +5079,20 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5069
5079
|
icon: /* @__PURE__ */ w(fe, {}),
|
|
5070
5080
|
onClick: S,
|
|
5071
5081
|
style: { paddingLeft: 0 },
|
|
5072
|
-
children:
|
|
5082
|
+
children: $s(e, h)
|
|
5073
5083
|
}), p && /* @__PURE__ */ w(v, {
|
|
5074
5084
|
type: "link",
|
|
5075
5085
|
size: "small",
|
|
5076
5086
|
icon: /* @__PURE__ */ w(oe, {}),
|
|
5077
5087
|
onClick: ne,
|
|
5078
5088
|
disabled: !y,
|
|
5079
|
-
title: y ? void 0 : `Choose a ${
|
|
5080
|
-
children:
|
|
5089
|
+
title: y ? void 0 : `Choose a ${Qs(_) || "record"} above first, then edit it here`,
|
|
5090
|
+
children: ec(e, _)
|
|
5081
5091
|
})]
|
|
5082
5092
|
})
|
|
5083
5093
|
}), ie = s ? /* @__PURE__ */ w(x, {
|
|
5084
5094
|
open: !0,
|
|
5085
|
-
title:
|
|
5095
|
+
title: tc(s.mode, e, s.mode === "create" ? h : _),
|
|
5086
5096
|
width: "min(1080px, 96vw)",
|
|
5087
5097
|
footer: null,
|
|
5088
5098
|
destroyOnClose: !0,
|
|
@@ -5100,7 +5110,7 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5100
5110
|
},
|
|
5101
5111
|
children: /* @__PURE__ */ w(te, {})
|
|
5102
5112
|
}),
|
|
5103
|
-
children: s.mode === "create" ? /* @__PURE__ */ w(
|
|
5113
|
+
children: s.mode === "create" ? /* @__PURE__ */ w(gc, {
|
|
5104
5114
|
moduleName: s.module,
|
|
5105
5115
|
embedded: !0,
|
|
5106
5116
|
breadcrumbItems: [],
|
|
@@ -5108,7 +5118,7 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5108
5118
|
onSuccess: (e) => {
|
|
5109
5119
|
b(), C(e), o?.("create", e);
|
|
5110
5120
|
}
|
|
5111
|
-
}) : /* @__PURE__ */ w(
|
|
5121
|
+
}) : /* @__PURE__ */ w(_c, {
|
|
5112
5122
|
moduleName: s.module,
|
|
5113
5123
|
recordId: s.recordId,
|
|
5114
5124
|
embedded: !0,
|
|
@@ -5132,7 +5142,7 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5132
5142
|
width: "min(520px, 94vw)",
|
|
5133
5143
|
maskClosable: !1,
|
|
5134
5144
|
onCancel: () => d(null),
|
|
5135
|
-
footer: /* @__PURE__ */ w(
|
|
5145
|
+
footer: /* @__PURE__ */ w(nc, {
|
|
5136
5146
|
variant: "primary",
|
|
5137
5147
|
type: "primary",
|
|
5138
5148
|
onClick: () => d(null),
|
|
@@ -5169,8 +5179,8 @@ function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5169
5179
|
}
|
|
5170
5180
|
//#endregion
|
|
5171
5181
|
//#region src/components/form/crossFieldRules.js
|
|
5172
|
-
var
|
|
5173
|
-
function
|
|
5182
|
+
var Sc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5183
|
+
function Cc(e, t, n) {
|
|
5174
5184
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
5175
5185
|
if (typeof n == "function") {
|
|
5176
5186
|
let e = n(t);
|
|
@@ -5178,23 +5188,23 @@ function Sc(e, t, n) {
|
|
|
5178
5188
|
}
|
|
5179
5189
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
5180
5190
|
}
|
|
5181
|
-
function
|
|
5191
|
+
function wc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
5182
5192
|
let s = n.field ?? n.compareField ?? r;
|
|
5183
5193
|
return { validator: async (n, r) => {
|
|
5184
|
-
if (!s ||
|
|
5185
|
-
let c = i?.getFieldValue?.(
|
|
5186
|
-
if (
|
|
5194
|
+
if (!s || Sc(r)) return Promise.resolve();
|
|
5195
|
+
let c = i?.getFieldValue?.(Cc(a, s, o));
|
|
5196
|
+
if (Sc(c)) return Promise.resolve();
|
|
5187
5197
|
let l = Number(c), u = Number(r);
|
|
5188
5198
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
5189
5199
|
} };
|
|
5190
5200
|
}
|
|
5191
|
-
function
|
|
5201
|
+
function Tc(e = {}, t, n) {
|
|
5192
5202
|
let r = e.field ?? e.compareField ?? e.value;
|
|
5193
|
-
return r ?
|
|
5203
|
+
return r ? Cc(t, r, n) : null;
|
|
5194
5204
|
}
|
|
5195
5205
|
//#endregion
|
|
5196
5206
|
//#region src/components/form/maxCeiling.js
|
|
5197
|
-
function
|
|
5207
|
+
function Ec(e, t) {
|
|
5198
5208
|
let n = String(t).split(".").filter(Boolean);
|
|
5199
5209
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
5200
5210
|
if (n.length > 1) {
|
|
@@ -5207,14 +5217,14 @@ function Tc(e, t) {
|
|
|
5207
5217
|
let r = [...e];
|
|
5208
5218
|
return r[r.length - 1] = n[0], r;
|
|
5209
5219
|
}
|
|
5210
|
-
function
|
|
5211
|
-
let r = e?.getFieldValue?.(
|
|
5220
|
+
function Dc(e, t, n) {
|
|
5221
|
+
let r = e?.getFieldValue?.(Ec(t, n));
|
|
5212
5222
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
5213
5223
|
}
|
|
5214
|
-
function
|
|
5224
|
+
function Oc(e) {
|
|
5215
5225
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
5216
5226
|
}
|
|
5217
|
-
function
|
|
5227
|
+
function kc(e, t) {
|
|
5218
5228
|
for (let n of e ?? []) {
|
|
5219
5229
|
let e = t(n);
|
|
5220
5230
|
if (e == null || e === "") continue;
|
|
@@ -5226,14 +5236,14 @@ function Oc(e, t) {
|
|
|
5226
5236
|
}
|
|
5227
5237
|
return null;
|
|
5228
5238
|
}
|
|
5229
|
-
function
|
|
5239
|
+
function Ac({ input: e, compareFields: t, readValue: n }) {
|
|
5230
5240
|
let r = {
|
|
5231
5241
|
ok: !0,
|
|
5232
5242
|
field: null,
|
|
5233
5243
|
maximum: null
|
|
5234
5244
|
};
|
|
5235
5245
|
if (e == null || e === "") return r;
|
|
5236
|
-
let i =
|
|
5246
|
+
let i = kc(t, n);
|
|
5237
5247
|
if (!i) return r;
|
|
5238
5248
|
let a = Number(e);
|
|
5239
5249
|
return Number.isFinite(a) ? {
|
|
@@ -5244,39 +5254,39 @@ function kc({ input: e, compareFields: t, readValue: n }) {
|
|
|
5244
5254
|
}
|
|
5245
5255
|
//#endregion
|
|
5246
5256
|
//#region src/components/form/contextPrefill.js
|
|
5247
|
-
var
|
|
5248
|
-
function
|
|
5257
|
+
var jc = { candidates: ["applicantId"] };
|
|
5258
|
+
function Mc(e) {
|
|
5249
5259
|
let t = String(e ?? "").trim();
|
|
5250
5260
|
if (!t) return [];
|
|
5251
5261
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
5252
5262
|
return [.../* @__PURE__ */ new Set([
|
|
5253
5263
|
`${n}Id`,
|
|
5254
5264
|
`${t}Id`,
|
|
5255
|
-
...
|
|
5265
|
+
...jc[t] ?? []
|
|
5256
5266
|
])];
|
|
5257
5267
|
}
|
|
5258
|
-
function
|
|
5268
|
+
function Nc(e, t) {
|
|
5259
5269
|
if (!t) return "";
|
|
5260
5270
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
5261
|
-
for (let r of
|
|
5271
|
+
for (let r of Mc(e)) {
|
|
5262
5272
|
let e = String(n(t[r]) || "");
|
|
5263
5273
|
if (e) return e;
|
|
5264
5274
|
}
|
|
5265
5275
|
return "";
|
|
5266
5276
|
}
|
|
5267
|
-
function
|
|
5277
|
+
function Pc(e, t) {
|
|
5268
5278
|
let n = /* @__PURE__ */ new Set();
|
|
5269
5279
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
5270
5280
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
5271
5281
|
})), [...n];
|
|
5272
5282
|
}
|
|
5273
|
-
function
|
|
5283
|
+
function Fc(e) {
|
|
5274
5284
|
return e?.payloadMode === "skip";
|
|
5275
5285
|
}
|
|
5276
|
-
function
|
|
5286
|
+
function Ic(e) {
|
|
5277
5287
|
return Array.isArray(e) ? e : Array.isArray(e?.groups) ? e.groups : Array.isArray(e?.data) ? e.data : Array.isArray(e?.data?.groups) ? e.data.groups : [];
|
|
5278
5288
|
}
|
|
5279
|
-
function
|
|
5289
|
+
function Lc(e) {
|
|
5280
5290
|
let t = {};
|
|
5281
5291
|
return (e ?? []).forEach((e) => {
|
|
5282
5292
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -5284,7 +5294,7 @@ function Ic(e) {
|
|
|
5284
5294
|
});
|
|
5285
5295
|
}), t;
|
|
5286
5296
|
}
|
|
5287
|
-
function
|
|
5297
|
+
function Rc(e, t) {
|
|
5288
5298
|
if (!e || !t) return;
|
|
5289
5299
|
let n = e;
|
|
5290
5300
|
for (let e of String(t).split(".")) {
|
|
@@ -5299,7 +5309,7 @@ function Lc(e, t) {
|
|
|
5299
5309
|
}
|
|
5300
5310
|
return n;
|
|
5301
5311
|
}
|
|
5302
|
-
function
|
|
5312
|
+
function zc(e, t) {
|
|
5303
5313
|
if (!(!e || !t)) for (let n of [
|
|
5304
5314
|
t.prefillFrom,
|
|
5305
5315
|
t.field,
|
|
@@ -5307,13 +5317,13 @@ function Rc(e, t) {
|
|
|
5307
5317
|
]) {
|
|
5308
5318
|
if (!n) continue;
|
|
5309
5319
|
let t = e[n];
|
|
5310
|
-
if (t ??= U(e, n), t ??=
|
|
5320
|
+
if (t ??= U(e, n), t ??= Rc(e, n), t != null) return t;
|
|
5311
5321
|
}
|
|
5312
5322
|
}
|
|
5313
5323
|
//#endregion
|
|
5314
5324
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
5315
|
-
function
|
|
5316
|
-
let a =
|
|
5325
|
+
function Bc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
5326
|
+
let a = ia(t), o = b.useWatch(n, e);
|
|
5317
5327
|
if (!a) return null;
|
|
5318
5328
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
5319
5329
|
setTimeout(() => {
|
|
@@ -5324,7 +5334,7 @@ function zc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5324
5334
|
e.setFieldValue(n, !1), c();
|
|
5325
5335
|
return;
|
|
5326
5336
|
}
|
|
5327
|
-
let i = await
|
|
5337
|
+
let i = await lo(da(t));
|
|
5328
5338
|
e.setFieldValue(n, !!i), c();
|
|
5329
5339
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
5330
5340
|
return /* @__PURE__ */ w(S, {
|
|
@@ -5343,34 +5353,34 @@ function zc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5343
5353
|
}
|
|
5344
5354
|
//#endregion
|
|
5345
5355
|
//#region src/components/form/prefillWhenRules.js
|
|
5346
|
-
var
|
|
5347
|
-
function
|
|
5356
|
+
var Vc = (e) => String(e ?? "");
|
|
5357
|
+
function Hc(e) {
|
|
5348
5358
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5349
5359
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5350
5360
|
let r = e?.field;
|
|
5351
5361
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
5352
5362
|
}), n;
|
|
5353
5363
|
}
|
|
5354
|
-
function
|
|
5355
|
-
return
|
|
5364
|
+
function Uc(e, t, n, r) {
|
|
5365
|
+
return Hc(e).map((e) => ({
|
|
5356
5366
|
field: e,
|
|
5357
5367
|
path: n(t, e, r)
|
|
5358
5368
|
}));
|
|
5359
5369
|
}
|
|
5360
|
-
function
|
|
5361
|
-
return !e || !e.field ? !1 :
|
|
5370
|
+
function Wc(e, t = {}) {
|
|
5371
|
+
return !e || !e.field ? !1 : Vc(t[e.field]) === Vc(e.value);
|
|
5362
5372
|
}
|
|
5363
|
-
function
|
|
5364
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
5373
|
+
function Gc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
5374
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Wc(e, t));
|
|
5365
5375
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
5366
5376
|
action: "set",
|
|
5367
5377
|
value: o.setValue
|
|
5368
|
-
} : i && r !== void 0 &&
|
|
5378
|
+
} : i && r !== void 0 && Vc(n) === Vc(r) ? { action: "clear" } : { action: "none" };
|
|
5369
5379
|
}
|
|
5370
5380
|
//#endregion
|
|
5371
5381
|
//#region src/components/form/optionConstraints.js
|
|
5372
5382
|
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
5373
|
-
function
|
|
5383
|
+
function Kc(e) {
|
|
5374
5384
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
5375
5385
|
return t.forEach((e) => {
|
|
5376
5386
|
if (e != null && e !== "") {
|
|
@@ -5390,38 +5400,38 @@ function Gc(e) {
|
|
|
5390
5400
|
}
|
|
5391
5401
|
}), n;
|
|
5392
5402
|
}
|
|
5393
|
-
function
|
|
5394
|
-
let n =
|
|
5403
|
+
function qc(e = [], t) {
|
|
5404
|
+
let n = Kc(t);
|
|
5395
5405
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5396
5406
|
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(Q(e.value)) || r.has(Q(e.label)) : r.has(Q(e)));
|
|
5397
5407
|
return i.length > 0 ? i : e;
|
|
5398
5408
|
}
|
|
5399
|
-
function
|
|
5409
|
+
function Jc(e) {
|
|
5400
5410
|
let t = [];
|
|
5401
5411
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
5402
5412
|
e != null && e !== "" && t.push(Q(e));
|
|
5403
5413
|
}), t;
|
|
5404
5414
|
}
|
|
5405
|
-
function
|
|
5415
|
+
function Yc(e, t = {}) {
|
|
5406
5416
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5407
5417
|
return n.forEach((e) => {
|
|
5408
5418
|
if (!e || e.clearValue) return;
|
|
5409
|
-
let n =
|
|
5419
|
+
let n = Jc(e);
|
|
5410
5420
|
if (!n.length) return;
|
|
5411
|
-
let a =
|
|
5421
|
+
let a = Wc(e, t) ? i : r;
|
|
5412
5422
|
n.forEach((e) => a.add(e));
|
|
5413
5423
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
5414
5424
|
}
|
|
5415
|
-
function
|
|
5416
|
-
let r =
|
|
5425
|
+
function Xc(e = [], t, n) {
|
|
5426
|
+
let r = Yc(t, n);
|
|
5417
5427
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5418
5428
|
let i = new Set(r);
|
|
5419
5429
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
5420
5430
|
}
|
|
5421
5431
|
//#endregion
|
|
5422
5432
|
//#region src/components/form/optionRowFilters.js
|
|
5423
|
-
var
|
|
5424
|
-
function
|
|
5433
|
+
var Zc = 64;
|
|
5434
|
+
function Qc(e) {
|
|
5425
5435
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5426
5436
|
try {
|
|
5427
5437
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5429,34 +5439,34 @@ function Zc(e) {
|
|
|
5429
5439
|
return "";
|
|
5430
5440
|
}
|
|
5431
5441
|
}
|
|
5432
|
-
var
|
|
5433
|
-
function
|
|
5442
|
+
var $c = (e) => String(e ?? "").trim().toLowerCase(), el = (e) => e != null && String(e).trim() !== "";
|
|
5443
|
+
function tl(e) {
|
|
5434
5444
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5435
|
-
return new Set(t.map(
|
|
5445
|
+
return new Set(t.map($c).filter((e) => e !== ""));
|
|
5436
5446
|
}
|
|
5437
|
-
function
|
|
5438
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5447
|
+
function nl(e, t) {
|
|
5448
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => el(e?.extraData?.[t]));
|
|
5439
5449
|
}
|
|
5440
|
-
function
|
|
5450
|
+
function rl(e, t, n) {
|
|
5441
5451
|
let r = e?.extraData?.[t];
|
|
5442
|
-
if (
|
|
5443
|
-
let i =
|
|
5444
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5452
|
+
if (!el(n)) return r === !0;
|
|
5453
|
+
let i = tl(n);
|
|
5454
|
+
return i.size === 0 ? r === !0 : i.has($c(r));
|
|
5445
5455
|
}
|
|
5446
|
-
function
|
|
5456
|
+
function il(e, t) {
|
|
5447
5457
|
let n = /* @__PURE__ */ new Map();
|
|
5448
5458
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5449
|
-
let r =
|
|
5450
|
-
r && n.set(r,
|
|
5459
|
+
let r = $c(e?.value);
|
|
5460
|
+
r && n.set(r, $c(e?.extraData?.[t]));
|
|
5451
5461
|
}), n;
|
|
5452
5462
|
}
|
|
5453
|
-
function
|
|
5454
|
-
let r =
|
|
5463
|
+
function al(e, t, n) {
|
|
5464
|
+
let r = $c(n);
|
|
5455
5465
|
if (!r) return !1;
|
|
5456
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5466
|
+
let i = /* @__PURE__ */ new Set(), a = $c(e);
|
|
5457
5467
|
if (!a) return !1;
|
|
5458
5468
|
i.add(a);
|
|
5459
|
-
for (let e = 0; e <
|
|
5469
|
+
for (let e = 0; e < Zc; e += 1) {
|
|
5460
5470
|
let e = t.get(a);
|
|
5461
5471
|
if (!e) return !1;
|
|
5462
5472
|
if (e === r) return !0;
|
|
@@ -5465,63 +5475,63 @@ function il(e, t, n) {
|
|
|
5465
5475
|
}
|
|
5466
5476
|
return !1;
|
|
5467
5477
|
}
|
|
5468
|
-
function
|
|
5478
|
+
function ol(e = {}) {
|
|
5469
5479
|
let t = [], n = (e) => {
|
|
5470
5480
|
let n = String(e ?? "").trim();
|
|
5471
5481
|
n && !t.includes(n) && t.push(n);
|
|
5472
5482
|
};
|
|
5473
5483
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5474
5484
|
}
|
|
5475
|
-
function
|
|
5485
|
+
function sl(e, t = {}, n = {}) {
|
|
5476
5486
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5477
5487
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5478
5488
|
typeof console < "u" && console.warn(e);
|
|
5479
5489
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5480
|
-
s && (
|
|
5490
|
+
s && (nl(o, s) ? o = o.filter((e) => rl(e, s, t.optionsRequireExtraValue)) : a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));
|
|
5481
5491
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5482
5492
|
if (c) {
|
|
5483
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5493
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Qc(n);
|
|
5484
5494
|
if (!s) a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);
|
|
5485
|
-
else if (!
|
|
5495
|
+
else if (!nl(e, c)) a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);
|
|
5486
5496
|
else {
|
|
5487
|
-
let t =
|
|
5488
|
-
o = o.filter((e) =>
|
|
5497
|
+
let t = il(e, c);
|
|
5498
|
+
o = o.filter((e) => al(e?.value, t, s));
|
|
5489
5499
|
}
|
|
5490
5500
|
}
|
|
5491
5501
|
return o;
|
|
5492
5502
|
}
|
|
5493
5503
|
//#endregion
|
|
5494
5504
|
//#region src/components/form/fieldTooltip.js
|
|
5495
|
-
var
|
|
5496
|
-
function
|
|
5497
|
-
return
|
|
5505
|
+
var cl = (e) => e == null || String(e).trim() === "", ll = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5506
|
+
function ul(e) {
|
|
5507
|
+
return cl(e?.tooltip) ? ll(e?.infoEnabled) && !cl(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5498
5508
|
}
|
|
5499
5509
|
//#endregion
|
|
5500
5510
|
//#region src/components/form/dependentLookupReset.js
|
|
5501
|
-
var
|
|
5502
|
-
function
|
|
5503
|
-
return !(!r || e ===
|
|
5511
|
+
var dl = Symbol("parentFilterUnseen"), fl = (e) => e == null || e === "", pl = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5512
|
+
function ml({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5513
|
+
return !(!r || e === dl || pl(e, t) || fl(e) || fl(n));
|
|
5504
5514
|
}
|
|
5505
5515
|
//#endregion
|
|
5506
5516
|
//#region src/utils/roleAllowsAction.js
|
|
5507
|
-
function
|
|
5508
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5517
|
+
function hl(e) {
|
|
5518
|
+
return e == null ? !0 : typeof e == "object" ? hl(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5509
5519
|
}
|
|
5510
|
-
function
|
|
5520
|
+
function gl(e, t) {
|
|
5511
5521
|
if (!e) return !0;
|
|
5512
5522
|
try {
|
|
5513
5523
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
5514
|
-
return
|
|
5524
|
+
return hl((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
5515
5525
|
} catch {
|
|
5516
5526
|
return !0;
|
|
5517
5527
|
}
|
|
5518
5528
|
}
|
|
5519
5529
|
//#endregion
|
|
5520
5530
|
//#region src/utils/afterSubmitNav.js
|
|
5521
|
-
function
|
|
5531
|
+
function _l(e) {
|
|
5522
5532
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5523
5533
|
}
|
|
5524
|
-
function
|
|
5534
|
+
function vl(e, t, n) {
|
|
5525
5535
|
let r = String(e ?? "").trim();
|
|
5526
5536
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5527
5537
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5530,50 +5540,50 @@ function _l(e, t, n) {
|
|
|
5530
5540
|
}
|
|
5531
5541
|
//#endregion
|
|
5532
5542
|
//#region src/utils/backNav.js
|
|
5533
|
-
function
|
|
5543
|
+
function yl(e = typeof window < "u" ? window : void 0) {
|
|
5534
5544
|
let t = e?.history?.state?.idx;
|
|
5535
5545
|
return typeof t == "number" && t > 0;
|
|
5536
5546
|
}
|
|
5537
|
-
function
|
|
5538
|
-
return t && e ? { path: e } :
|
|
5547
|
+
function bl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5548
|
+
return t && e ? { path: e } : yl(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5539
5549
|
}
|
|
5540
|
-
function
|
|
5541
|
-
let n =
|
|
5550
|
+
function xl(e, t = {}) {
|
|
5551
|
+
let n = bl(t);
|
|
5542
5552
|
return n.back ? e(-1) : e(n.path), n;
|
|
5543
5553
|
}
|
|
5544
5554
|
//#endregion
|
|
5545
5555
|
//#region src/components/form/educationRules.js
|
|
5546
|
-
var
|
|
5547
|
-
function
|
|
5556
|
+
var Sl = (e) => e == null ? "" : String(e).trim();
|
|
5557
|
+
function Cl(e, t) {
|
|
5548
5558
|
let n = e?.regionRules;
|
|
5549
5559
|
if (!n || typeof n != "object") return e ?? {};
|
|
5550
|
-
let r =
|
|
5560
|
+
let r = Sl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5551
5561
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5552
5562
|
...e,
|
|
5553
5563
|
...i
|
|
5554
5564
|
};
|
|
5555
5565
|
}
|
|
5556
|
-
function Cl(e) {
|
|
5557
|
-
return e?.allowInProgress !== !1;
|
|
5558
|
-
}
|
|
5559
5566
|
function wl(e) {
|
|
5560
|
-
return
|
|
5567
|
+
return e?.allowInProgress !== !1;
|
|
5561
5568
|
}
|
|
5562
5569
|
function Tl(e) {
|
|
5563
|
-
return
|
|
5570
|
+
return wl(e) ? "" : Ol(e) ? e?.inProgressWarningMessage || e?.inProgressMessage || "In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted." : e?.inProgressMessage || "This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.";
|
|
5564
5571
|
}
|
|
5565
5572
|
function El(e) {
|
|
5566
|
-
return
|
|
5573
|
+
return wl(e) ? "allow" : Sl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5567
5574
|
}
|
|
5568
5575
|
function Dl(e) {
|
|
5569
|
-
return
|
|
5576
|
+
return El(e) === "block";
|
|
5570
5577
|
}
|
|
5571
5578
|
function Ol(e) {
|
|
5572
|
-
|
|
5573
|
-
|
|
5579
|
+
return El(e) === "warn";
|
|
5580
|
+
}
|
|
5581
|
+
function kl(e) {
|
|
5582
|
+
if (!Dl(e)) return null;
|
|
5583
|
+
let t = Tl(e);
|
|
5574
5584
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5575
5585
|
}
|
|
5576
|
-
function
|
|
5586
|
+
function Al(e, t = {}) {
|
|
5577
5587
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5578
5588
|
for (let t of [n, r]) {
|
|
5579
5589
|
let n = e?.[t];
|
|
@@ -5583,50 +5593,50 @@ function kl(e, t = {}) {
|
|
|
5583
5593
|
}
|
|
5584
5594
|
return null;
|
|
5585
5595
|
}
|
|
5586
|
-
function
|
|
5596
|
+
function jl(e, t = {}) {
|
|
5587
5597
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5588
5598
|
return !!e?.[n];
|
|
5589
5599
|
}
|
|
5590
|
-
function
|
|
5600
|
+
function Ml(e = [], t = {}) {
|
|
5591
5601
|
let n = (t.direction ?? "desc") === "desc";
|
|
5592
5602
|
return e.map((e, n) => ({
|
|
5593
5603
|
index: n,
|
|
5594
|
-
key:
|
|
5595
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5604
|
+
key: Al(e, t),
|
|
5605
|
+
ongoing: t.inProgressFirst !== !1 && jl(e, t)
|
|
5596
5606
|
})).slice().sort((e, t) => e.ongoing === t.ongoing ? e.key === null && t.key === null ? e.index - t.index : e.key === null ? 1 : t.key === null ? -1 : e.key === t.key ? e.index - t.index : n ? t.key - e.key : e.key - t.key : e.ongoing ? -1 : 1).map((e) => e.index);
|
|
5597
5607
|
}
|
|
5598
|
-
function
|
|
5608
|
+
function Nl(e, t, n = {}) {
|
|
5599
5609
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5600
|
-
let r =
|
|
5610
|
+
let r = Ml(e, n).indexOf(t);
|
|
5601
5611
|
return r === -1 || r === t ? null : {
|
|
5602
5612
|
from: t,
|
|
5603
5613
|
to: r,
|
|
5604
|
-
reason:
|
|
5614
|
+
reason: jl(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5605
5615
|
};
|
|
5606
5616
|
}
|
|
5607
|
-
var
|
|
5617
|
+
var Pl = Object.freeze({
|
|
5608
5618
|
inProgress: "You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.",
|
|
5609
5619
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5610
5620
|
ok: "Yes, move it up",
|
|
5611
5621
|
keep: "No, leave it here"
|
|
5612
5622
|
});
|
|
5613
|
-
function
|
|
5623
|
+
function Fl(e, t = {}) {
|
|
5614
5624
|
let n = {
|
|
5615
|
-
...
|
|
5625
|
+
...Pl,
|
|
5616
5626
|
...t.messages ?? {}
|
|
5617
5627
|
};
|
|
5618
5628
|
return n[e] ?? n.outOfOrder;
|
|
5619
5629
|
}
|
|
5620
|
-
function
|
|
5621
|
-
let n = t.levelField ?? "qualification", r =
|
|
5630
|
+
function Il(e, t = {}) {
|
|
5631
|
+
let n = t.levelField ?? "qualification", r = Sl(e?.[n]);
|
|
5622
5632
|
if (!r) return null;
|
|
5623
5633
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5624
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5634
|
+
return Number.isFinite(Number(a)) ? Number(a) : Ll(r, t);
|
|
5625
5635
|
}
|
|
5626
|
-
function
|
|
5636
|
+
function Ll(e, t) {
|
|
5627
5637
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5628
5638
|
for (let e of n) {
|
|
5629
|
-
let t =
|
|
5639
|
+
let t = Sl(e?.match);
|
|
5630
5640
|
if (!t) continue;
|
|
5631
5641
|
let n;
|
|
5632
5642
|
try {
|
|
@@ -5638,14 +5648,14 @@ function Il(e, t) {
|
|
|
5638
5648
|
}
|
|
5639
5649
|
return null;
|
|
5640
5650
|
}
|
|
5641
|
-
function
|
|
5642
|
-
return
|
|
5651
|
+
function Rl(e, t = {}) {
|
|
5652
|
+
return Sl((t?.levelLabels ?? {})[e]) || Sl(e);
|
|
5643
5653
|
}
|
|
5644
|
-
function
|
|
5654
|
+
function zl(e = [], t = {}) {
|
|
5645
5655
|
if (!t || t.requireBelow === !1) return [];
|
|
5646
5656
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5647
5657
|
if (!r.length) return [];
|
|
5648
|
-
let i = e.map((e) =>
|
|
5658
|
+
let i = e.map((e) => Il(e, t)).filter((e) => e !== null);
|
|
5649
5659
|
if (!i.length) return [];
|
|
5650
5660
|
let a = Math.max(...i), o = [];
|
|
5651
5661
|
return r.forEach((e) => {
|
|
@@ -5653,43 +5663,43 @@ function Rl(e = [], t = {}) {
|
|
|
5653
5663
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5654
5664
|
}), o;
|
|
5655
5665
|
}
|
|
5656
|
-
function
|
|
5657
|
-
let n =
|
|
5666
|
+
function Bl(e, t = {}) {
|
|
5667
|
+
let n = zl(e, t);
|
|
5658
5668
|
if (!n.length) return "";
|
|
5659
|
-
let r = n.map((e) =>
|
|
5669
|
+
let r = n.map((e) => Rl(e, t)).join(", ");
|
|
5660
5670
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5661
5671
|
}
|
|
5662
|
-
async function
|
|
5672
|
+
async function Vl({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5663
5673
|
let a = e?.orderBy;
|
|
5664
5674
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5665
|
-
let o =
|
|
5675
|
+
let o = Nl(t, n, a);
|
|
5666
5676
|
if (!o) return !1;
|
|
5667
5677
|
let s = {
|
|
5668
|
-
...
|
|
5678
|
+
...Pl,
|
|
5669
5679
|
...a.messages ?? {}
|
|
5670
5680
|
};
|
|
5671
5681
|
return await i({
|
|
5672
5682
|
reason: o.reason,
|
|
5673
5683
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5674
|
-
body:
|
|
5684
|
+
body: Fl(o.reason, a),
|
|
5675
5685
|
okText: s.ok,
|
|
5676
5686
|
cancelText: s.keep,
|
|
5677
5687
|
from: o.from,
|
|
5678
5688
|
to: o.to
|
|
5679
5689
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5680
5690
|
}
|
|
5681
|
-
function
|
|
5682
|
-
let n =
|
|
5691
|
+
function Hl(e, t) {
|
|
5692
|
+
let n = Cl(e, t), r = n?.orderBy?.inProgressField;
|
|
5683
5693
|
return r ? {
|
|
5684
5694
|
name: n.name,
|
|
5685
5695
|
label: n.label ?? n.name,
|
|
5686
5696
|
rowsKey: n.payloadKey || n.name,
|
|
5687
5697
|
inProgressField: r,
|
|
5688
|
-
severity:
|
|
5689
|
-
message:
|
|
5698
|
+
severity: El(n),
|
|
5699
|
+
message: Tl(n)
|
|
5690
5700
|
} : null;
|
|
5691
5701
|
}
|
|
5692
|
-
function
|
|
5702
|
+
function Ul(e = [], t, n) {
|
|
5693
5703
|
if (!n) return {
|
|
5694
5704
|
severity: "allow",
|
|
5695
5705
|
message: "",
|
|
@@ -5697,8 +5707,8 @@ function Hl(e = [], t, n) {
|
|
|
5697
5707
|
};
|
|
5698
5708
|
let r = null;
|
|
5699
5709
|
for (let i of e) {
|
|
5700
|
-
let e =
|
|
5701
|
-
if (!(!e || e.severity === "allow") &&
|
|
5710
|
+
let e = Hl(i, t);
|
|
5711
|
+
if (!(!e || e.severity === "allow") && Wl(n, e.rowsKey).some((t) => jl(t, e))) {
|
|
5702
5712
|
if (e.severity === "block") return {
|
|
5703
5713
|
severity: "block",
|
|
5704
5714
|
message: e.message,
|
|
@@ -5717,23 +5727,23 @@ function Hl(e = [], t, n) {
|
|
|
5717
5727
|
group: null
|
|
5718
5728
|
};
|
|
5719
5729
|
}
|
|
5720
|
-
function
|
|
5730
|
+
function Wl(e, t) {
|
|
5721
5731
|
let n = e?.[t];
|
|
5722
5732
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5723
5733
|
}
|
|
5724
|
-
function
|
|
5734
|
+
function Gl(e) {
|
|
5725
5735
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5726
5736
|
}
|
|
5727
|
-
function
|
|
5737
|
+
function Kl(e = [], t = {}) {
|
|
5728
5738
|
let n = null;
|
|
5729
5739
|
for (let r of e) {
|
|
5730
5740
|
let e = r?.levelRule;
|
|
5731
5741
|
if (!e) continue;
|
|
5732
|
-
let i =
|
|
5742
|
+
let i = ql(t, r);
|
|
5733
5743
|
if (!i.length) continue;
|
|
5734
|
-
let a =
|
|
5744
|
+
let a = Bl(i, e);
|
|
5735
5745
|
if (a) {
|
|
5736
|
-
if (
|
|
5746
|
+
if (Gl(e) === "block") return {
|
|
5737
5747
|
severity: "block",
|
|
5738
5748
|
message: a,
|
|
5739
5749
|
group: r
|
|
@@ -5751,7 +5761,7 @@ function Gl(e = [], t = {}) {
|
|
|
5751
5761
|
group: null
|
|
5752
5762
|
};
|
|
5753
5763
|
}
|
|
5754
|
-
function
|
|
5764
|
+
function ql(e, t) {
|
|
5755
5765
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5756
5766
|
if (!n) continue;
|
|
5757
5767
|
let t = e?.[n];
|
|
@@ -5761,10 +5771,10 @@ function Kl(e, t) {
|
|
|
5761
5771
|
}
|
|
5762
5772
|
//#endregion
|
|
5763
5773
|
//#region src/components/form/clearGroupOnChange.js
|
|
5764
|
-
function
|
|
5774
|
+
function Jl(e, t) {
|
|
5765
5775
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5766
5776
|
}
|
|
5767
|
-
function
|
|
5777
|
+
function Yl(e, t) {
|
|
5768
5778
|
let n = e?.field, r = [];
|
|
5769
5779
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5770
5780
|
e && e !== n && r.push(e);
|
|
@@ -5774,24 +5784,24 @@ function Jl(e, t) {
|
|
|
5774
5784
|
e && e !== n && r.push(e);
|
|
5775
5785
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5776
5786
|
}
|
|
5777
|
-
function
|
|
5778
|
-
let i =
|
|
5787
|
+
function Xl(e, t, n, r) {
|
|
5788
|
+
let i = Yl(t, r).map((e) => Jl(n, e));
|
|
5779
5789
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5780
5790
|
}
|
|
5781
5791
|
//#endregion
|
|
5782
5792
|
//#region src/components/form/resolveStoredOptions.js
|
|
5783
|
-
function
|
|
5793
|
+
function Zl(e) {
|
|
5784
5794
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5785
5795
|
}
|
|
5786
|
-
function
|
|
5796
|
+
function Ql(e, t = []) {
|
|
5787
5797
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5788
|
-
for (let t of
|
|
5798
|
+
for (let t of Zl(e)) {
|
|
5789
5799
|
let e = String(t);
|
|
5790
5800
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5791
5801
|
}
|
|
5792
5802
|
return r;
|
|
5793
5803
|
}
|
|
5794
|
-
async function
|
|
5804
|
+
async function $l(e, t) {
|
|
5795
5805
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5796
5806
|
let n = new URLSearchParams({
|
|
5797
5807
|
collection: e.lookupCollection,
|
|
@@ -5803,7 +5813,7 @@ async function Ql(e, t) {
|
|
|
5803
5813
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5804
5814
|
return Array.isArray(i) ? i : [];
|
|
5805
5815
|
}
|
|
5806
|
-
function
|
|
5816
|
+
function eu(e = [], t = []) {
|
|
5807
5817
|
if (!t.length) return e;
|
|
5808
5818
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5809
5819
|
...e,
|
|
@@ -5813,8 +5823,8 @@ function $l(e = [], t = []) {
|
|
|
5813
5823
|
}
|
|
5814
5824
|
//#endregion
|
|
5815
5825
|
//#region src/components/form/dateRules.js
|
|
5816
|
-
var
|
|
5817
|
-
function
|
|
5826
|
+
var tu = (e) => e == null || e === "";
|
|
5827
|
+
function nu(e) {
|
|
5818
5828
|
if (!e) return null;
|
|
5819
5829
|
if (typeof e.valueOf == "function") {
|
|
5820
5830
|
let t = e.valueOf();
|
|
@@ -5828,12 +5838,12 @@ function $(e) {
|
|
|
5828
5838
|
let t = E(e);
|
|
5829
5839
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5830
5840
|
}
|
|
5831
|
-
function
|
|
5841
|
+
function ru(e) {
|
|
5832
5842
|
if (!e) return null;
|
|
5833
5843
|
let t = E(e);
|
|
5834
5844
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5835
5845
|
}
|
|
5836
|
-
var
|
|
5846
|
+
var iu = {
|
|
5837
5847
|
d: "day",
|
|
5838
5848
|
day: "day",
|
|
5839
5849
|
days: "day",
|
|
@@ -5849,13 +5859,13 @@ var ru = {
|
|
|
5849
5859
|
year: "year",
|
|
5850
5860
|
years: "year"
|
|
5851
5861
|
};
|
|
5852
|
-
function
|
|
5862
|
+
function au(e) {
|
|
5853
5863
|
if (e == null || e === "") return null;
|
|
5854
5864
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5855
5865
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5856
5866
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5857
5867
|
value: t,
|
|
5858
|
-
unit:
|
|
5868
|
+
unit: iu[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5859
5869
|
};
|
|
5860
5870
|
}
|
|
5861
5871
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5865,49 +5875,49 @@ function iu(e) {
|
|
|
5865
5875
|
let r = Number(n[1]);
|
|
5866
5876
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5867
5877
|
value: r,
|
|
5868
|
-
unit:
|
|
5878
|
+
unit: iu[n[2]] ?? "month"
|
|
5869
5879
|
};
|
|
5870
5880
|
}
|
|
5871
|
-
function
|
|
5881
|
+
function ou(e, t) {
|
|
5872
5882
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5873
5883
|
if (n && typeof t == "function") {
|
|
5874
|
-
let e =
|
|
5884
|
+
let e = au(t(n));
|
|
5875
5885
|
if (e) return e;
|
|
5876
5886
|
}
|
|
5877
|
-
return
|
|
5887
|
+
return au(e?.minGap);
|
|
5878
5888
|
}
|
|
5879
|
-
function
|
|
5889
|
+
function su(e, t, n, r) {
|
|
5880
5890
|
if (t === null) return null;
|
|
5881
|
-
let i =
|
|
5891
|
+
let i = ou(n, r), a = E(t);
|
|
5882
5892
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5883
5893
|
}
|
|
5884
|
-
function
|
|
5894
|
+
function cu(e, t, n, r, i) {
|
|
5885
5895
|
if (t === null || n === null) return !1;
|
|
5886
|
-
let a =
|
|
5896
|
+
let a = su(e, n, r, i);
|
|
5887
5897
|
if (a === null) return !1;
|
|
5888
|
-
let o = !!r?.strict && !
|
|
5898
|
+
let o = !!r?.strict && !ou(r, i);
|
|
5889
5899
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5890
5900
|
}
|
|
5891
|
-
function
|
|
5901
|
+
function lu(e, t, n, r) {
|
|
5892
5902
|
if (n?.message) return n.message;
|
|
5893
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5903
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = ou(n, r);
|
|
5894
5904
|
if (a) {
|
|
5895
5905
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5896
5906
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5897
5907
|
}
|
|
5898
5908
|
return n?.strict ? e === "dateAfterField" ? `${t} must be after ${i}` : `${t} must be before ${i}` : e === "dateAfterField" ? `${t} must be on or after ${i}` : `${t} must be on or before ${i}`;
|
|
5899
5909
|
}
|
|
5900
|
-
function
|
|
5910
|
+
function uu({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5901
5911
|
return { validator: async (i, a) => {
|
|
5902
5912
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5903
|
-
if (!o ||
|
|
5913
|
+
if (!o || tu(a)) return Promise.resolve();
|
|
5904
5914
|
let s = r(o);
|
|
5905
|
-
if (
|
|
5915
|
+
if (tu(s)) return Promise.resolve();
|
|
5906
5916
|
let c = $(a), l = $(s);
|
|
5907
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5917
|
+
return c === null || l === null ? Promise.resolve() : cu(e, c, l, n, r) ? Promise.reject(Error(lu(e, t, n, r))) : Promise.resolve();
|
|
5908
5918
|
} };
|
|
5909
5919
|
}
|
|
5910
|
-
function
|
|
5920
|
+
function du(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5911
5921
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5912
5922
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5913
5923
|
if (o) {
|
|
@@ -5921,11 +5931,11 @@ function uu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5921
5931
|
}
|
|
5922
5932
|
return !1;
|
|
5923
5933
|
}
|
|
5924
|
-
function
|
|
5934
|
+
function fu(e, t = "above") {
|
|
5925
5935
|
let n = e?.messages ?? {};
|
|
5926
5936
|
return t === "below" ? n.below || "This starts before the entry below it finished. Entries are listed newest first, so they cannot overlap." : n.above || "This overlaps the entry above it. Entries are listed newest first, so this one must finish before that one started.";
|
|
5927
5937
|
}
|
|
5928
|
-
function
|
|
5938
|
+
function pu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = tr }) {
|
|
5929
5939
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5930
5940
|
for (let e of a) {
|
|
5931
5941
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5939,16 +5949,16 @@ function fu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = tr }) {
|
|
|
5939
5949
|
o.push((i) => {
|
|
5940
5950
|
if (!i) return !1;
|
|
5941
5951
|
let a = t(e);
|
|
5942
|
-
return !
|
|
5952
|
+
return !tu(a) && cu(r, $(i), $(a), n, t);
|
|
5943
5953
|
});
|
|
5944
5954
|
}
|
|
5945
5955
|
}
|
|
5946
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5956
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? du($(t), e.rowHierarchy, {
|
|
5947
5957
|
rows: n,
|
|
5948
5958
|
rowIndex: r
|
|
5949
5959
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5950
5960
|
}
|
|
5951
|
-
function
|
|
5961
|
+
function mu(e, t = tr) {
|
|
5952
5962
|
let n = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5953
5963
|
for (let e of n) {
|
|
5954
5964
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5956,44 +5966,44 @@ function pu(e, t = tr) {
|
|
|
5956
5966
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5957
5967
|
}
|
|
5958
5968
|
}
|
|
5959
|
-
function
|
|
5969
|
+
function hu({ field: e, rows: t, rowIndex: n }) {
|
|
5960
5970
|
let r = e?.rowHierarchy;
|
|
5961
5971
|
return { validator: async (e, i) => {
|
|
5962
|
-
if (!r ||
|
|
5972
|
+
if (!r || tu(i) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5963
5973
|
let a = $(i);
|
|
5964
|
-
if (a === null || !
|
|
5974
|
+
if (a === null || !du(a, r, {
|
|
5965
5975
|
rows: t,
|
|
5966
5976
|
rowIndex: n
|
|
5967
5977
|
})) return Promise.resolve();
|
|
5968
5978
|
let o = r.startField ?? "startDate", s = t[n - 1], c = s ? $(s[o]) : null, l = c !== null && a >= c ? "above" : "below";
|
|
5969
|
-
return Promise.reject(Error(
|
|
5979
|
+
return Promise.reject(Error(fu(r, l)));
|
|
5970
5980
|
} };
|
|
5971
5981
|
}
|
|
5972
5982
|
//#endregion
|
|
5973
5983
|
//#region src/utils/submitMessages.js
|
|
5974
|
-
function
|
|
5984
|
+
function gu(e) {
|
|
5975
5985
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5976
5986
|
}
|
|
5977
|
-
function
|
|
5987
|
+
function _u(e) {
|
|
5978
5988
|
let t = String(e ?? "").trim();
|
|
5979
5989
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5980
5990
|
}
|
|
5981
|
-
function
|
|
5982
|
-
return String(e).replaceAll("${module}",
|
|
5991
|
+
function vu(e, t) {
|
|
5992
|
+
return String(e).replaceAll("${module}", _u(t)).replaceAll("${moduleName}", _u(t));
|
|
5983
5993
|
}
|
|
5984
|
-
function
|
|
5985
|
-
let r =
|
|
5994
|
+
function yu(e, t, n) {
|
|
5995
|
+
let r = gu(e);
|
|
5986
5996
|
if (r?.suppress) return null;
|
|
5987
5997
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5988
|
-
return i && String(i).trim() ?
|
|
5998
|
+
return i && String(i).trim() ? vu(i, t) : n === "edit" ? `${_u(t)} has Updated successfully` : `${_u(t)} has added successfully`;
|
|
5989
5999
|
}
|
|
5990
|
-
function
|
|
5991
|
-
let i =
|
|
5992
|
-
return a && String(a).trim() ?
|
|
6000
|
+
function bu(e, t, n, r) {
|
|
6001
|
+
let i = gu(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
6002
|
+
return a && String(a).trim() ? vu(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${_u(t)}` : `Failed to create ${_u(t)}`;
|
|
5993
6003
|
}
|
|
5994
6004
|
//#endregion
|
|
5995
6005
|
//#region src/utils/scrollToFirstFormError.js
|
|
5996
|
-
function
|
|
6006
|
+
function xu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5997
6007
|
if (!e?.length) return;
|
|
5998
6008
|
let r = e[0]?.name;
|
|
5999
6009
|
setTimeout(() => {
|
|
@@ -6018,10 +6028,10 @@ function bu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
6018
6028
|
}
|
|
6019
6029
|
//#endregion
|
|
6020
6030
|
//#region src/components/form/conditionalFieldLabel.js
|
|
6021
|
-
function
|
|
6031
|
+
function Su(e) {
|
|
6022
6032
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
6023
6033
|
}
|
|
6024
|
-
function
|
|
6034
|
+
function Cu(e, t) {
|
|
6025
6035
|
if (!e?.field) return !1;
|
|
6026
6036
|
switch (e.operator ?? "eq") {
|
|
6027
6037
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -6029,58 +6039,58 @@ function Su(e, t) {
|
|
|
6029
6039
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
6030
6040
|
case "falsy": return t == null || t === "" || t === !1;
|
|
6031
6041
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
6032
|
-
case "in": return
|
|
6033
|
-
case "notIn": return !
|
|
6042
|
+
case "in": return Su(e.value).includes(String(t ?? ""));
|
|
6043
|
+
case "notIn": return !Su(e.value).includes(String(t ?? ""));
|
|
6034
6044
|
default: return !1;
|
|
6035
6045
|
}
|
|
6036
6046
|
}
|
|
6037
|
-
function
|
|
6047
|
+
function wu(e, t, n = !1) {
|
|
6038
6048
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
6039
|
-
return
|
|
6049
|
+
return Cu(i, t) && i?.label ? i.label : r;
|
|
6040
6050
|
}
|
|
6041
|
-
function
|
|
6051
|
+
function Tu(e) {
|
|
6042
6052
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
6043
6053
|
}
|
|
6044
|
-
function
|
|
6045
|
-
let n =
|
|
6054
|
+
function Eu(e, t) {
|
|
6055
|
+
let n = Tu(e);
|
|
6046
6056
|
if (!n.length) return !0;
|
|
6047
|
-
let r = n.map((e) =>
|
|
6057
|
+
let r = n.map((e) => Cu(e, t(e.field)));
|
|
6048
6058
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
6049
6059
|
}
|
|
6050
|
-
function
|
|
6060
|
+
function Du(e) {
|
|
6051
6061
|
let t = e?.colWhen;
|
|
6052
6062
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
6053
6063
|
}
|
|
6054
|
-
function
|
|
6055
|
-
for (let t of
|
|
6064
|
+
function Ou(e, t, n) {
|
|
6065
|
+
for (let t of Du(e)) if (Cu(t, n(t))) return Number(t.col);
|
|
6056
6066
|
return t;
|
|
6057
6067
|
}
|
|
6058
|
-
function
|
|
6068
|
+
function ku(e, t) {
|
|
6059
6069
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
6060
6070
|
}
|
|
6061
6071
|
//#endregion
|
|
6062
6072
|
//#region src/components/form/conditionalRequired.js
|
|
6063
|
-
function
|
|
6073
|
+
function Au(e, t) {
|
|
6064
6074
|
return (n) => {
|
|
6065
6075
|
if (!e || !n) return;
|
|
6066
6076
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
6067
6077
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
6068
6078
|
};
|
|
6069
6079
|
}
|
|
6070
|
-
function
|
|
6080
|
+
function ju(e, t, n) {
|
|
6071
6081
|
let r = e?.requiredWhen;
|
|
6072
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
6082
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Eu(r, Au(t, n));
|
|
6073
6083
|
}
|
|
6074
|
-
function
|
|
6084
|
+
function Mu(e, t, n) {
|
|
6075
6085
|
return { validator: (r, i) => {
|
|
6076
|
-
if (!
|
|
6086
|
+
if (!ju(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
6077
6087
|
let a = e?.label ?? e?.field ?? "This field";
|
|
6078
6088
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
6079
6089
|
} };
|
|
6080
6090
|
}
|
|
6081
6091
|
//#endregion
|
|
6082
6092
|
//#region src/components/Breadcrumb.jsx
|
|
6083
|
-
function
|
|
6093
|
+
function Nu({ items: e = [] }) {
|
|
6084
6094
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(Dr, {
|
|
6085
6095
|
variant: "body",
|
|
6086
6096
|
weight: "medium",
|
|
@@ -6098,34 +6108,34 @@ function Mu({ items: e = [] }) {
|
|
|
6098
6108
|
}
|
|
6099
6109
|
//#endregion
|
|
6100
6110
|
//#region src/components/form/canonicalOption.js
|
|
6101
|
-
var
|
|
6102
|
-
function
|
|
6111
|
+
var Pu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
6112
|
+
function Fu(e = []) {
|
|
6103
6113
|
let t = /* @__PURE__ */ new Map();
|
|
6104
6114
|
for (let n of e) {
|
|
6105
6115
|
if (n == null) continue;
|
|
6106
6116
|
let e = typeof n == "object" ? n.value : n;
|
|
6107
6117
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
6108
|
-
let n =
|
|
6118
|
+
let n = Pu(r);
|
|
6109
6119
|
n && !t.has(n) && t.set(n, e);
|
|
6110
6120
|
}
|
|
6111
6121
|
}
|
|
6112
6122
|
return t;
|
|
6113
6123
|
}
|
|
6114
|
-
function
|
|
6124
|
+
function Iu(e, t) {
|
|
6115
6125
|
if (!Array.isArray(e)) {
|
|
6116
|
-
let n =
|
|
6126
|
+
let n = Iu([e], t);
|
|
6117
6127
|
return n.length ? n[0] : e;
|
|
6118
6128
|
}
|
|
6119
|
-
let n =
|
|
6129
|
+
let n = Fu(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
6120
6130
|
for (let t of e) {
|
|
6121
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
6131
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Pu(e)) ?? e, o = Pu(a);
|
|
6122
6132
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
6123
6133
|
}
|
|
6124
6134
|
return i;
|
|
6125
6135
|
}
|
|
6126
6136
|
//#endregion
|
|
6127
6137
|
//#region src/components/form/dependencyBusy.js
|
|
6128
|
-
function
|
|
6138
|
+
function Lu(e, t = []) {
|
|
6129
6139
|
if (!e) return [];
|
|
6130
6140
|
let n = /* @__PURE__ */ new Set();
|
|
6131
6141
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -6135,14 +6145,14 @@ function Iu(e, t = []) {
|
|
|
6135
6145
|
}
|
|
6136
6146
|
return n.delete(e), [...n];
|
|
6137
6147
|
}
|
|
6138
|
-
function
|
|
6139
|
-
return e?.blockWhileResolving ?
|
|
6148
|
+
function Ru(e, t = []) {
|
|
6149
|
+
return e?.blockWhileResolving ? Lu(e.field, t).length > 0 : !1;
|
|
6140
6150
|
}
|
|
6141
|
-
function
|
|
6151
|
+
function zu(e) {
|
|
6142
6152
|
let t = String(e?.label ?? "").trim();
|
|
6143
6153
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
6144
6154
|
}
|
|
6145
6155
|
//#endregion
|
|
6146
|
-
export {
|
|
6156
|
+
export { Nc as $, Jn as $n, wn as $r, Za as $t, Dl as A, Zt as Ai, gi as An, bt as Ar, vs as At, gl as B, rr as Bn, rn as Br, So as Bt, $l as C, Bn as Ci, Oi as Cn, ht as Cr, Ps as Ct, kl as D, Fn as Di, Si as Dn, pn as Dr, zs as Dt, Xl as E, Tn as Ei, Ci as En, Jt as Er, As as Et, Cl as F, Nr as Fn, ft as Fr, fs as Ft, ol as G, ur as Gn, Ve as Gr, go as Gt, ml as H, I as Hn, vn as Hr, Co as Ht, xl as I, Dr as In, Xt as Ir, Yo as It, Hc as J, Xn as Jn, tt as Jr, uo as Jt, qc as K, ir as Kn, qe as Kr, bo as Kt, _l as L, R as Ln, wt as Lr, Jo as Lt, Ul as M, si as Mn, fn as Mr, ms as Mt, Kl as N, oi as Nn, Dn as Nr, ps as Nt, Hl as O, Ft as Oi, mi as On, dn as Or, gs as Ot, Vl as P, ai as Pn, ct as Pr, ds as Pt, Pc as Q, Gn as Qn, Rt as Qr, J as Qt, vl as R, L as Rn, Ct as Rr, Ho as Rt, ru as S, gn as Si, Pi as Sn, $e as Sr, Bs as St, Ql as T, Ht as Ti, wi as Tn, Pt as Tr, ws as Tt, ul as U, pr as Un, mn as Ur, No as Ut, dl as V, or as Vn, an as Vr, xo as Vt, sl as W, nr as Wn, Rn as Wr, Lo as Wt, Gc as X, F as Xn, N as Xr, oo as Xt, Uc as Y, Yn, Gt as Yr, ao as Yt, Bc as Z, Zn, Lt as Zr, so as Zt, pu as _, vt as _i, Ii as _n, We as _r, $s as _t, ju as a, sn as ai, Ua as an, hn as ar, Ac as at, mu as b, kn as bi, Di as bn, Qt as br, Js as bt, ku as c, xt as ci, Ia as cn, Pn as cr, Ec as ct, Eu as d, Tt as di, ua as dn, An as dr, Cc as dt, Nn as ei, ro as en, ot as er, Ic as et, Ou as f, Ge as fi, Yi as fn, Et as fr, xc as ft, yu as g, Yt as gi, Ri as gn, nn as gr, Qs as gt, bu as h, Kt as hi, Li as hn, Vn as hr, nc as ht, Nu as i, on as ii, Ka as in, yn as ir, Rc as it, Tl as j, un as ji, _i as jn, St as jr, hs as jt, wl as k, qt as ki, hi as kn, Ke as kr, ys as kt, Cu as l, lt as li, ia as ln, it as lr, Tc as lt, xu as m, Ue as mi, $i as mn, _n as mr, ic as mt, Ru as n, $t as ni, Da as nn, nt as nr, Fc as nt, Mu as o, at as oi, no as on, zn as or, Oc as ot, Tu as p, ln as pi, ea as pn, xn as pr, oc as pt, Xc as q, Hn as qn, cn as qr, lo as qt, Iu as r, He as ri, U as rn, On as rr, zc as rt, Du as s, gt as si, La as sn, en as sr, Dc as st, zu as t, zt as ti, Xa as tn, kt as tr, Lc as tt, wu as u, pt as ui, ca as un, _t as ur, wc as ut, uu as v, Dt as vi, Fi as vn, In as vr, ec as vt, eu as w, tn as wi, ki as wn, jt as wr, Ns as wt, nu as x, bn as xi, Ei as xn, et as xr, Vs as xt, hu as y, rt as yi, Ni as yn, ut as yr, Gs as yt, hl as z, tr as zn, Ot as zr, Y as zt };
|
|
6147
6157
|
|
|
6148
|
-
//# sourceMappingURL=dependencyBusy-
|
|
6158
|
+
//# sourceMappingURL=dependencyBusy-_RkqSj9m.js.map
|