@realtek/core-theme 0.0.346 → 0.0.348

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.
@@ -2370,23 +2370,28 @@ async function _i(e, t, n = [], i = {}) {
2370
2370
  data: [],
2371
2371
  total: 0
2372
2372
  };
2373
- let a = await r(), o = /* @__PURE__ */ new Map();
2374
- n.forEach((t) => {
2373
+ let a = n.filter((e) => !e?.skipDocumentRegistry);
2374
+ if (!a.length) return {
2375
+ data: [],
2376
+ total: 0
2377
+ };
2378
+ let o = await r(), c = /* @__PURE__ */ new Map();
2379
+ a.forEach((t) => {
2375
2380
  let n = String(t?.documentModule || e).trim() || e;
2376
- o.has(n) || o.set(n, []), o.get(n).push(t);
2381
+ c.has(n) || c.set(n, []), c.get(n).push(t);
2377
2382
  });
2378
- let c = async (e, n) => {
2383
+ let l = async (e, n) => {
2379
2384
  let r = new FormData();
2380
2385
  n.forEach(({ formKey: e, file: t }) => {
2381
2386
  let n = t?.name ?? void 0;
2382
2387
  r.append(gi(e), t, n);
2383
2388
  }), i && Object.keys(i).length > 0 && r.append("metadata", JSON.stringify(i));
2384
- let o = new URLSearchParams({
2389
+ let a = new URLSearchParams({
2385
2390
  module: e,
2386
2391
  refId: String(t)
2387
- }), c = await fetch(`${s}/documents/upload?${o.toString()}`, {
2392
+ }), c = await fetch(`${s}/documents/upload?${a.toString()}`, {
2388
2393
  method: "POST",
2389
- headers: { Authorization: `Bearer ${a}` },
2394
+ headers: { Authorization: `Bearer ${o}` },
2390
2395
  body: r
2391
2396
  }), l = (c.headers.get("content-type") || "").includes("application/json") ? await c.json() : await c.text();
2392
2397
  if (!c.ok) {
@@ -2394,10 +2399,10 @@ async function _i(e, t, n = [], i = {}) {
2394
2399
  throw e.status = c.status, e.data = l, e;
2395
2400
  }
2396
2401
  return l?.data ?? l;
2397
- }, l = await Promise.all(Array.from(o, ([e, t]) => c(e, t)));
2398
- return l.length === 1 ? l[0] : {
2399
- data: l.flatMap((e) => Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []),
2400
- total: l.reduce((e, t) => e + Number(t?.total ?? (Array.isArray(t) ? t.length : t?.data?.length) ?? 0), 0)
2402
+ }, u = await Promise.all(Array.from(c, ([e, t]) => l(e, t)));
2403
+ return u.length === 1 ? u[0] : {
2404
+ data: u.flatMap((e) => Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []),
2405
+ total: u.reduce((e, t) => e + Number(t?.total ?? (Array.isArray(t) ? t.length : t?.data?.length) ?? 0), 0)
2401
2406
  };
2402
2407
  }
2403
2408
  async function vi(e, t, n = "") {
@@ -3148,20 +3153,23 @@ function Wa(e, t) {
3148
3153
  }
3149
3154
  return B(i) && (i = i.value ?? i.id ?? i._id ?? i.key ?? i.code), i == null ? "" : String(i).trim();
3150
3155
  }
3151
- function Ga(e, t = [], n = {}) {
3152
- let r = [], i = n.scope ?? "all", a = Ha(n.module), o = (e, t, n = "") => {
3156
+ function Ga(e, t) {
3157
+ return t === "documents" && Ha(e?.moduleName) === "documents";
3158
+ }
3159
+ function Ka(e, t = [], n = {}) {
3160
+ let r = [], i = n.scope ?? "all", a = Ha(n.module), o = (e, t, n = "", i = !1) => {
3153
3161
  t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
3154
- let i = t?.originFileObj || t, a = {
3162
+ let a = t?.originFileObj || t, o = {
3155
3163
  formKey: e,
3156
- file: i
3164
+ file: a
3157
3165
  };
3158
- n && (a.documentModule = n), (typeof File < "u" && i instanceof File || typeof Blob < "u" && i instanceof Blob) && r.push(a);
3166
+ n && (o.documentModule = n), i && (o.skipDocumentRegistry = !0), (typeof File < "u" && a instanceof File || typeof Blob < "u" && a instanceof Blob) && r.push(o);
3159
3167
  });
3160
3168
  };
3161
3169
  return (t ?? []).forEach((t) => {
3162
3170
  let r = (t.fields ?? []).filter(K);
3163
3171
  if (!r.length) return;
3164
- let s = t.moduleName && !Ua(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
3172
+ let s = t.moduleName && !Ua(t, a), c = Ga(t, a), l = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
3165
3173
  if (t.addRow) {
3166
3174
  if (i === "flat") return;
3167
3175
  let a = e[t.name];
@@ -3169,22 +3177,22 @@ function Ga(e, t = [], n = {}) {
3169
3177
  r.forEach((e) => {
3170
3178
  let r = e.fileKey ?? String(e.field).split(".")[0];
3171
3179
  a.forEach((i, a) => {
3172
- let s = c(n.indexed ? `${r}[${a}]` : r);
3173
- o(s, H(i, e.field), Wa(t, i));
3180
+ let s = l(n.indexed ? `${r}[${a}]` : r);
3181
+ o(s, H(i, e.field), Wa(t, i), c);
3174
3182
  });
3175
3183
  });
3176
3184
  return;
3177
3185
  }
3178
3186
  i !== "addRow" && r.forEach((n) => {
3179
- let r = c(n.fileKey ?? String(n.field).split(".")[0]);
3180
- o(r, H(e, n.field), Wa(t, e));
3187
+ let r = l(n.fileKey ?? String(n.field).split(".")[0]);
3188
+ o(r, H(e, n.field), Wa(t, e), c);
3181
3189
  });
3182
3190
  }), r;
3183
3191
  }
3184
- function Ka(e, t, n = {}) {
3192
+ function qa(e, t, n = {}) {
3185
3193
  let r = B(n.base) ? structuredClone(n.base) : {};
3186
3194
  Va(t).forEach((e) => {
3187
- (e.payloadKey || e.field) && (Ya(r, e.payloadKey || e.field), Ya(r, e.field));
3195
+ (e.payloadKey || e.field) && (Xa(r, e.payloadKey || e.field), Xa(r, e.field));
3188
3196
  });
3189
3197
  let i = Ha(n.module), a = La(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Ua(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
3190
3198
  return (t ?? []).forEach((t) => {
@@ -3196,25 +3204,30 @@ function Ka(e, t, n = {}) {
3196
3204
  if (t.addRow) {
3197
3205
  let i = e[t.name];
3198
3206
  if (!Array.isArray(i)) return;
3199
- W(n, t.payloadKey || t.name, i.map((t) => Ja(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
3207
+ W(n, t.payloadKey || t.name, i.map((t) => Ya(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
3200
3208
  return;
3201
3209
  }
3202
- r.forEach((t) => qa(t, e, n, e, a));
3210
+ r.forEach((t) => Ja(t, e, n, e, a));
3203
3211
  }), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
3204
3212
  moduleName: e,
3205
3213
  data: t
3206
3214
  }))), Xi(r, t);
3207
3215
  }
3208
- function qa(e, t, n, r, i) {
3216
+ function Ja(e, t, n, r, i) {
3209
3217
  if (Qi(e) && ta(e)) {
3210
3218
  let r = $i(e);
3211
3219
  U(t, r) && W(n, r, !!H(t, r));
3212
3220
  }
3213
3221
  if (K(e)) {
3214
- let i = va(H(t, e.field));
3215
- if (i !== void 0) {
3216
- let a = r !== void 0 && r !== t;
3217
- _a(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
3222
+ let i = H(t, e.field), a = (Array.isArray(i) ? i : [i]).flatMap((e) => {
3223
+ let t = e?.originFileObj || e, n = typeof File < "u" && t instanceof File || typeof Blob < "u" && t instanceof Blob ? String(t?.name ?? e?.name ?? "").trim() : "";
3224
+ return n ? [n] : [];
3225
+ });
3226
+ e.fileNameKey && a.length && W(n, e.fileNameKey, fa(e.multiple) || a.length > 1 ? a : a[0]);
3227
+ let o = va(H(t, e.field));
3228
+ if (o !== void 0) {
3229
+ let i = r !== void 0 && r !== t;
3230
+ _a(n, e.payloadKey || (i ? e.field : e.fileKey || e.field), o);
3218
3231
  }
3219
3232
  return;
3220
3233
  }
@@ -3226,13 +3239,13 @@ function qa(e, t, n, r, i) {
3226
3239
  if (!U(t, e.field)) return;
3227
3240
  let a = H(t, e.field);
3228
3241
  if (!Array.isArray(a)) return;
3229
- let o = a.map((t) => Ja(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
3242
+ let o = a.map((t) => Ya(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
3230
3243
  W(n, e.payloadKey || e.field, o);
3231
3244
  return;
3232
3245
  }
3233
3246
  if (!U(t, e.field)) return;
3234
3247
  if (fa(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
3235
- let r = H(t, e.field), i = Array.isArray(r) ? r : da(r) ? [] : [r], a = Za(e), o = i.map((e) => Aa(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
3248
+ let r = H(t, e.field), i = Array.isArray(r) ? r : da(r) ? [] : [r], a = Qa(e), o = i.map((e) => Aa(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
3236
3249
  W(n, e.payloadKey || e.field, o);
3237
3250
  return;
3238
3251
  }
@@ -3245,11 +3258,11 @@ function qa(e, t, n, r, i) {
3245
3258
  W(n, e.payloadKey || e.field, a.out);
3246
3259
  }
3247
3260
  }
3248
- function Ja(e, t, n, r) {
3261
+ function Ya(e, t, n, r) {
3249
3262
  let i = {};
3250
- return e.forEach((e) => qa(e, t, i, n ?? t, r)), i;
3263
+ return e.forEach((e) => Ja(e, t, i, n ?? t, r)), i;
3251
3264
  }
3252
- function Ya(e, t) {
3265
+ function Xa(e, t) {
3253
3266
  let n = String(t).split("."), r = e;
3254
3267
  for (let e = 0; e < n.length - 1; e += 1) {
3255
3268
  if (!B(r[n[e]])) return;
@@ -3257,7 +3270,7 @@ function Ya(e, t) {
3257
3270
  }
3258
3271
  delete r[n[n.length - 1]];
3259
3272
  }
3260
- var Xa = /* @__PURE__ */ new Set([
3273
+ var Za = /* @__PURE__ */ new Set([
3261
3274
  "text",
3262
3275
  "textarea",
3263
3276
  "email",
@@ -3274,7 +3287,7 @@ function q(e, t) {
3274
3287
  if (t == null) return r() ?? t;
3275
3288
  if (n(t)) return r();
3276
3289
  if (da(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
3277
- if (Xa.has(e.type) && B(t)) {
3290
+ if (Za.has(e.type) && B(t)) {
3278
3291
  let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
3279
3292
  if (r === void 0 || B(r)) return;
3280
3293
  t = r;
@@ -3297,7 +3310,7 @@ function q(e, t) {
3297
3310
  }
3298
3311
  return t;
3299
3312
  }
3300
- function Za(e = {}) {
3313
+ function Qa(e = {}) {
3301
3314
  return {
3302
3315
  ...e,
3303
3316
  addRow: !1,
@@ -3306,7 +3319,7 @@ function Za(e = {}) {
3306
3319
  dataType: void 0
3307
3320
  };
3308
3321
  }
3309
- function Qa(e, t) {
3322
+ function $a(e, t) {
3310
3323
  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;
3311
3324
  if (Array.isArray(e.subFields) && e.subFields.length > 0) {
3312
3325
  let i = [];
@@ -3322,7 +3335,7 @@ function Qa(e, t) {
3322
3335
  for (; i.length < a;) i.push({});
3323
3336
  return i;
3324
3337
  }
3325
- let i = Za(e), a = [];
3338
+ let i = Qa(e), a = [];
3326
3339
  if (Array.isArray(t)) a = t.map((e) => q(i, e)).filter((e) => e != null && e !== "");
3327
3340
  else if (t != null && t !== "") {
3328
3341
  let e = q(i, t);
@@ -3334,12 +3347,12 @@ function Qa(e, t) {
3334
3347
  }
3335
3348
  //#endregion
3336
3349
  //#region src/components/form/linkedAddRowGroups.js
3337
- var $a = (e) => e === !0 || e === 1 || e === "1";
3338
- function eo(e = []) {
3350
+ var eo = (e) => e === !0 || e === 1 || e === "1";
3351
+ function to(e = []) {
3339
3352
  let t = /* @__PURE__ */ new Map();
3340
3353
  e.forEach((e) => {
3341
3354
  let n = e?.linkGroup;
3342
- !$a(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
3355
+ !eo(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
3343
3356
  });
3344
3357
  let n = /* @__PURE__ */ new Map();
3345
3358
  return t.forEach((e, t) => {
@@ -3349,11 +3362,11 @@ function eo(e = []) {
3349
3362
  });
3350
3363
  }), n;
3351
3364
  }
3352
- function to(e, t) {
3365
+ function no(e, t) {
3353
3366
  for (let n of e.values()) if (n.memberNames.includes(t)) return n;
3354
3367
  return null;
3355
3368
  }
3356
- function no(e, t = {}) {
3369
+ function ro(e, t = {}) {
3357
3370
  let n = { ...t };
3358
3371
  return e.forEach(({ memberNames: e }) => {
3359
3372
  let t = Math.max(...e.map((e) => (n[e] ?? []).length));
@@ -3365,7 +3378,7 @@ function no(e, t = {}) {
3365
3378
  }
3366
3379
  //#endregion
3367
3380
  //#region src/components/form/formDecisionDialog.jsx
3368
- var ro = {
3381
+ var io = {
3369
3382
  duplicate: {
3370
3383
  className: "fdd-tone-amber",
3371
3384
  Icon: me
@@ -3383,8 +3396,8 @@ var ro = {
3383
3396
  Icon: ce
3384
3397
  }
3385
3398
  };
3386
- function io({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s } = {}) {
3387
- let { className: c, Icon: l } = ro[e] ?? ro.suggestion, u = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
3399
+ function ao({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s } = {}) {
3400
+ let { className: c, Icon: l } = io[e] ?? io.suggestion, u = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
3388
3401
  return new Promise((e) => {
3389
3402
  x.confirm({
3390
3403
  icon: null,
@@ -3434,8 +3447,8 @@ function io({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
3434
3447
  });
3435
3448
  });
3436
3449
  }
3437
- function ao({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
3438
- let { className: a, Icon: o } = ro[e] ?? ro.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
3450
+ function oo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
3451
+ let { className: a, Icon: o } = io[e] ?? io.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
3439
3452
  return new Promise((e) => {
3440
3453
  x.warning({
3441
3454
  icon: null,
@@ -3477,7 +3490,7 @@ function ao({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
3477
3490
  }
3478
3491
  //#endregion
3479
3492
  //#region src/services/aiActionApi.js
3480
- async function oo({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
3493
+ async function so({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
3481
3494
  if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
3482
3495
  let c = await r(), l = new FormData();
3483
3496
  l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
@@ -3503,17 +3516,17 @@ async function oo({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
3503
3516
  }
3504
3517
  //#endregion
3505
3518
  //#region src/components/detail/phoneDisplay.js
3506
- var so = (e) => e == null || e === "";
3507
- function co(e, t) {
3519
+ var co = (e) => e == null || e === "";
3520
+ function lo(e, t) {
3508
3521
  return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
3509
3522
  }
3510
- function lo(e) {
3523
+ function uo(e) {
3511
3524
  let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
3512
3525
  if (!t) return "";
3513
3526
  let n = t.replace(/^\+/, "");
3514
3527
  return /^\d{1,4}$/.test(n) ? `+${n}` : "";
3515
3528
  }
3516
- function uo(e) {
3529
+ function fo(e) {
3517
3530
  let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
3518
3531
  return [
3519
3532
  ...t ? [`${t}CountryCode`, `${t}Code`] : [],
@@ -3526,15 +3539,15 @@ function uo(e) {
3526
3539
  "isdCode"
3527
3540
  ];
3528
3541
  }
3529
- function fo(e, t, n = "") {
3530
- let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...uo(e)] : uo(e);
3542
+ function po(e, t, n = "") {
3543
+ let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...fo(e)] : fo(e);
3531
3544
  for (let e of i) {
3532
- let n = lo(co(t, e));
3545
+ let n = uo(lo(t, e));
3533
3546
  if (n) return n;
3534
3547
  }
3535
- return lo(n);
3548
+ return uo(n);
3536
3549
  }
3537
- function po(e) {
3550
+ function mo(e) {
3538
3551
  let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
3539
3552
  return n ? {
3540
3553
  code: n[1],
@@ -3544,17 +3557,17 @@ function po(e) {
3544
3557
  rest: t
3545
3558
  };
3546
3559
  }
3547
- function mo(e, t = "") {
3548
- if (so(e)) return "";
3549
- let { code: n, rest: r } = po(e), i = n || lo(t), a = Zn(r) || r;
3560
+ function ho(e, t = "") {
3561
+ if (co(e)) return "";
3562
+ let { code: n, rest: r } = mo(e), i = n || uo(t), a = Zn(r) || r;
3550
3563
  return `${i ? `${i} ` : ""}${a}`.trim();
3551
3564
  }
3552
- function ho(e, t, n) {
3553
- return mo(t, fo(e, n, Yn()));
3565
+ function go(e, t, n) {
3566
+ return ho(t, po(e, n, Yn()));
3554
3567
  }
3555
3568
  //#endregion
3556
3569
  //#region src/components/detail/renderConfig.js
3557
- var go = [
3570
+ var _o = [
3558
3571
  {
3559
3572
  value: "auto",
3560
3573
  label: "Default (auto)"
@@ -3611,7 +3624,7 @@ var go = [
3611
3624
  value: "html",
3612
3625
  label: "HTML"
3613
3626
  }
3614
- ], _o = [
3627
+ ], vo = [
3615
3628
  {
3616
3629
  value: "preview",
3617
3630
  label: "Preview (viewer)"
@@ -3632,7 +3645,7 @@ var go = [
3632
3645
  value: "text",
3633
3646
  label: "Text (filename)"
3634
3647
  }
3635
- ], vo = [
3648
+ ], yo = [
3636
3649
  {
3637
3650
  value: "none",
3638
3651
  label: "None"
@@ -3649,71 +3662,71 @@ var go = [
3649
3662
  value: "title",
3650
3663
  label: "Title Case"
3651
3664
  }
3652
- ], yo = [
3665
+ ], bo = [
3653
3666
  "location",
3654
3667
  "path",
3655
3668
  "url",
3656
3669
  "key"
3657
- ], bo = [
3670
+ ], xo = [
3658
3671
  "location",
3659
3672
  "filepath",
3660
3673
  "path",
3661
3674
  "url",
3662
3675
  "key"
3663
- ], xo = [
3676
+ ], So = [
3664
3677
  "uploadedfilename",
3665
3678
  "uploadname",
3666
3679
  "originalname",
3667
3680
  "displayname",
3668
3681
  "documentname",
3669
3682
  "filename"
3670
- ], So = ["name"], Co = (e) => String(e).toLowerCase(), wo = (e) => e == null || e === "";
3671
- function To(e, t) {
3683
+ ], Co = ["name"], wo = (e) => String(e).toLowerCase(), To = (e) => e == null || e === "";
3684
+ function Eo(e, t) {
3672
3685
  for (let n of t) {
3673
3686
  let t = e[n];
3674
3687
  if (typeof t == "string" && t) return t;
3675
3688
  }
3676
3689
  return "";
3677
3690
  }
3678
- function Eo(e, t) {
3679
- for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Co(t).endsWith(n)) return r;
3691
+ function Do(e, t) {
3692
+ for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && wo(t).endsWith(n)) return r;
3680
3693
  return "";
3681
3694
  }
3682
- function Do(e) {
3695
+ function Oo(e) {
3683
3696
  if (!e) return "";
3684
3697
  let t = String(e).split("?")[0].split("#")[0];
3685
3698
  return decodeURIComponent(t.split("/").pop() || "");
3686
3699
  }
3687
- function Oo(e) {
3700
+ function ko(e) {
3688
3701
  if (!e) return "";
3689
3702
  let t = String(e);
3690
3703
  if (/^https?:\/\//i.test(t)) return t;
3691
3704
  let n = P().s3BaseUrl || "";
3692
3705
  return n ? `${n}/${t.replace(/^\/+/, "")}` : "";
3693
3706
  }
3694
- function ko(e) {
3695
- return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : To(e, yo) || Eo(e, bo);
3696
- }
3697
3707
  function Ao(e) {
3698
- return e ? typeof e == "string" ? Do(e) || e : typeof e == "object" && (To(e, P().documentNameOrder ?? []) || Eo(e, xo) || Do(ko(e)) || Eo(e, So)) || "Document" : "Document";
3708
+ return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Eo(e, bo) || Do(e, xo);
3699
3709
  }
3700
3710
  function jo(e) {
3701
- if (wo(e)) return [];
3711
+ return e ? typeof e == "string" ? Oo(e) || e : typeof e == "object" && (Eo(e, P().documentNameOrder ?? []) || Do(e, So) || Oo(Ao(e)) || Do(e, Co)) || "Document" : "Document";
3712
+ }
3713
+ function Mo(e) {
3714
+ if (To(e)) return [];
3702
3715
  let t = Array.isArray(e) ? e : [e], n = [];
3703
- for (let e of t) if (!wo(e)) {
3716
+ for (let e of t) if (!To(e)) {
3704
3717
  if (typeof e == "string") {
3705
3718
  let t = e.includes("/") ? e : "";
3706
3719
  n.push({
3707
3720
  location: t,
3708
- name: Do(e) || e,
3709
- url: Oo(t)
3721
+ name: Oo(e) || e,
3722
+ url: ko(t)
3710
3723
  });
3711
3724
  } else if (typeof e == "object") {
3712
- let t = ko(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
3725
+ let t = Ao(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
3713
3726
  n.push({
3714
3727
  location: t,
3715
- name: Ao(e),
3716
- url: r || Oo(t)
3728
+ name: jo(e),
3729
+ url: r || ko(t)
3717
3730
  });
3718
3731
  }
3719
3732
  }
@@ -3721,12 +3734,12 @@ function jo(e) {
3721
3734
  }
3722
3735
  //#endregion
3723
3736
  //#region src/components/form/applyGroupValues.js
3724
- var Mo = (e) => e === !0 || e === 1 || e === "1", No = (e) => e == null || e === "";
3725
- function Po(e) {
3737
+ var No = (e) => e === !0 || e === 1 || e === "1", Po = (e) => e == null || e === "";
3738
+ function Fo(e) {
3726
3739
  return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
3727
3740
  }
3728
3741
  function J(e, t, n) {
3729
- let r = Array.isArray(t) ? t : Po(t);
3742
+ let r = Array.isArray(t) ? t : Fo(t);
3730
3743
  if (!r.length) return e;
3731
3744
  let i = e;
3732
3745
  for (let e = 0; e < r.length - 1; e += 1) {
@@ -3735,35 +3748,40 @@ function J(e, t, n) {
3735
3748
  }
3736
3749
  return i[r[r.length - 1]] = n, e;
3737
3750
  }
3738
- function Fo(e, t = []) {
3751
+ function Io(e, t = []) {
3739
3752
  if (!(!e || typeof e != "object")) for (let n of t) {
3740
3753
  if (!n) continue;
3741
3754
  let t = V(e, n);
3742
- if (!No(t)) return t;
3755
+ if (!Po(t)) return t;
3743
3756
  }
3744
3757
  }
3745
- function Io(e, t) {
3758
+ function Lo(e, t) {
3746
3759
  if (!e || typeof e != "object") return;
3747
- let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !No(n));
3760
+ let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Po(n));
3748
3761
  if (r) return r[1];
3749
3762
  for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
3750
- let n = Io(e, t);
3751
- if (!No(n)) return n;
3763
+ let n = Lo(e, t);
3764
+ if (!Po(n)) return n;
3752
3765
  }
3753
3766
  }
3754
- function Lo(e, t) {
3767
+ function Ro(e, t) {
3755
3768
  let n = Array.isArray(e) ? e : e ? [e] : [];
3756
3769
  if (!n.length) return;
3757
3770
  let r = n.map((e, n) => {
3758
- if (typeof e == "string") return {
3759
- uid: `${t.field}-${n}`,
3760
- name: e,
3761
- status: "done"
3762
- };
3771
+ if (typeof e == "string") {
3772
+ let r = e.includes("/") ? ko(e) : "";
3773
+ return {
3774
+ uid: `${t.field}-${n}`,
3775
+ name: Oo(e) || e,
3776
+ status: "done",
3777
+ existing: !0,
3778
+ url: r || void 0
3779
+ };
3780
+ }
3763
3781
  if (!e || typeof e != "object") return null;
3764
- let r = Fo(e, [t.fileUrlKey, t.locationKey]) ?? Io(e, /(location|url|path)$/i) ?? "", i = Fo(e, [t.fileNameKey]) ?? Io(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
3782
+ let r = Io(e, [t.fileUrlKey, t.locationKey]) ?? Lo(e, /(location|url|path)$/i) ?? "", i = Io(e, [t.fileNameKey]) ?? Lo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
3765
3783
  if (!r && !i) return null;
3766
- let a = r && !String(r).startsWith("http") ? Oo(r) : r;
3784
+ let a = r && !String(r).startsWith("http") ? ko(r) : r;
3767
3785
  return {
3768
3786
  uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
3769
3787
  name: i || "file",
@@ -3775,11 +3793,11 @@ function Lo(e, t) {
3775
3793
  }).filter(Boolean);
3776
3794
  return r.length ? r : void 0;
3777
3795
  }
3778
- function Ro(e, t) {
3796
+ function zo(e, t) {
3779
3797
  if (!e || typeof e != "object") return;
3780
- let n = Fo(e, [t.fileNameKey, t.field]) ?? Io(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Fo(e, [t.fileUrlKey, t.locationKey]) ?? Io(e, /(location|url|path)$/i) ?? "";
3798
+ let n = Io(e, [t.fileNameKey, t.field]) ?? Lo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Io(e, [t.fileUrlKey, t.locationKey]) ?? Lo(e, /(location|url|path)$/i) ?? "";
3781
3799
  if (!n && !r) return;
3782
- let i = r && !String(r).startsWith("http") ? Oo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
3800
+ let i = r && !String(r).startsWith("http") ? ko(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
3783
3801
  return [{
3784
3802
  uid: String(a),
3785
3803
  name: n ?? "file",
@@ -3788,7 +3806,7 @@ function Ro(e, t) {
3788
3806
  url: i || void 0
3789
3807
  }];
3790
3808
  }
3791
- function zo(e, t, n, r) {
3809
+ function Bo(e, t, n, r) {
3792
3810
  (e.fields ?? []).forEach((e) => {
3793
3811
  e?.verifyAction && [
3794
3812
  e.verifyResultField,
@@ -3801,7 +3819,7 @@ function zo(e, t, n, r) {
3801
3819
  });
3802
3820
  });
3803
3821
  }
3804
- function Bo(e) {
3822
+ function Vo(e) {
3805
3823
  let t = Array.isArray(e.rows) ? e.rows : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
3806
3824
  let i = {};
3807
3825
  return (e.fields ?? []).forEach((e) => {
@@ -3816,26 +3834,26 @@ function Bo(e) {
3816
3834
  e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && J(i, e.field, e.defaultValue);
3817
3835
  return;
3818
3836
  }
3819
- J(i, e.field, Mo(e.addRow) ? Qa(e, a) : q(e, a));
3820
- }), zo(e, t, i, r), i;
3837
+ J(i, e.field, No(e.addRow) ? $a(e, a) : q(e, a));
3838
+ }), Bo(e, t, i, r), i;
3821
3839
  }, i = Ra(e, { editing: !0 });
3822
3840
  if (t && t.length > 0) {
3823
- let e = t.map((e) => r(e, (e, t) => Ro(e, t), (e, t) => V(e, t.field)));
3841
+ let e = t.map((e) => r(e, (e, t) => zo(e, t), (e, t) => V(e, t.field)));
3824
3842
  for (; e.length < n;) e.push({ ...i });
3825
3843
  return e;
3826
3844
  }
3827
- let a = r(e, (e, t) => Lo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
3845
+ let a = r(e, (e, t) => Ro(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
3828
3846
  for (; o.length < n;) o.push({ ...i });
3829
3847
  return o;
3830
3848
  }
3831
- function Vo(e, t = []) {
3849
+ function Ho(e, t = []) {
3832
3850
  let n = {};
3833
3851
  return t.forEach((e) => {
3834
3852
  e.toggleEnabled && e.toggleField && J(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
3835
3853
  if (!e.field || e.addRow) return;
3836
3854
  let t = e.value, r = e.field;
3837
3855
  if (e.type === "file") {
3838
- let i = Lo(t, e);
3856
+ let i = Ro(t, e);
3839
3857
  i && J(n, r, i);
3840
3858
  return;
3841
3859
  }
@@ -3850,7 +3868,7 @@ function Vo(e, t = []) {
3850
3868
  }
3851
3869
  let i = e.splitDialCodeInto;
3852
3870
  if (i && typeof t == "string") {
3853
- let { code: a, rest: o } = po(t), s = lo(a);
3871
+ let { code: a, rest: o } = mo(t), s = uo(a);
3854
3872
  s && J(n, i, s), J(n, r, q(e, o || t));
3855
3873
  return;
3856
3874
  }
@@ -3860,27 +3878,27 @@ function Vo(e, t = []) {
3860
3878
  }
3861
3879
  //#endregion
3862
3880
  //#region src/components/form/useAiActions.js
3863
- function Ho(e) {
3881
+ function Uo(e) {
3864
3882
  let t = document.createElement("div");
3865
3883
  return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
3866
3884
  }
3867
- function Uo(e, t) {
3868
- return t && t === "stripHtml" ? Ho(e) : e;
3885
+ function Wo(e, t) {
3886
+ return t && t === "stripHtml" ? Uo(e) : e;
3869
3887
  }
3870
- function Wo(e) {
3888
+ function Go(e) {
3871
3889
  return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
3872
3890
  }
3873
- function Go(e) {
3891
+ function Ko(e) {
3874
3892
  return Object.values(e || {}).some((e) => e != null && e !== "");
3875
3893
  }
3876
- function Ko(e, t) {
3894
+ function qo(e, t) {
3877
3895
  if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
3878
- let n = Uo(t, e.transform), r = String(n ?? "").trim();
3896
+ let n = Wo(t, e.transform), r = String(n ?? "").trim();
3879
3897
  if (!r) return !1;
3880
3898
  let i = Number(e.minWords) || 0;
3881
- return i > 0 ? Wo(r) >= i : !0;
3899
+ return i > 0 ? Go(r) >= i : !0;
3882
3900
  }
3883
- function qo(e, t) {
3901
+ function Jo(e, t) {
3884
3902
  let n = e.inputs || [];
3885
3903
  if (n.length === 0) return !0;
3886
3904
  let r = /* @__PURE__ */ new Map();
@@ -3888,10 +3906,10 @@ function qo(e, t) {
3888
3906
  let n = e.group || `__solo_${t}`;
3889
3907
  r.has(n) || r.set(n, []), r.get(n).push(e);
3890
3908
  });
3891
- for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => Ko(e, t(e.sourceField)))) return !1;
3909
+ for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => qo(e, t(e.sourceField)))) return !1;
3892
3910
  return !0;
3893
3911
  }
3894
- function Jo(e = []) {
3912
+ function Yo(e = []) {
3895
3913
  let t = [];
3896
3914
  return e.forEach((e) => {
3897
3915
  if (e?.addRow) {
@@ -3904,32 +3922,32 @@ function Jo(e = []) {
3904
3922
  });
3905
3923
  }), t;
3906
3924
  }
3907
- function Yo(e, t) {
3908
- return Jo(t).some((t) => {
3925
+ function Xo(e, t) {
3926
+ return Yo(t).some((t) => {
3909
3927
  let n = e.getFieldValue(t);
3910
- return Array.isArray(n) ? n.some(Go) : n != null && n !== "";
3928
+ return Array.isArray(n) ? n.some(Ko) : n != null && n !== "";
3911
3929
  });
3912
3930
  }
3913
- function Xo(e, t = []) {
3931
+ function Zo(e, t = []) {
3914
3932
  let n = e.getFieldsValue(!0) ?? {}, r = new Set([t].flat().filter(Boolean)), i = typeof e.isFieldTouched == "function" ? (t) => e.isFieldTouched(t) : () => !0, a = 0;
3915
3933
  return Object.entries(n).forEach(([e, t]) => {
3916
- if (!(r.has(e) || !i(e) || !Zo(t))) {
3934
+ if (!(r.has(e) || !i(e) || !Qo(t))) {
3917
3935
  if (Array.isArray(t)) {
3918
- a += t.filter((e) => e && typeof e == "object" ? Go(e) : !!e).length;
3936
+ a += t.filter((e) => e && typeof e == "object" ? Ko(e) : !!e).length;
3919
3937
  return;
3920
3938
  }
3921
3939
  a += 1;
3922
3940
  }
3923
3941
  }), a;
3924
3942
  }
3925
- function Zo(e) {
3926
- return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? Go(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
3943
+ function Qo(e) {
3944
+ return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? Ko(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
3927
3945
  }
3928
- function Qo(e, t = []) {
3946
+ function $o(e, t = []) {
3929
3947
  let n = e.getFieldsValue(!0) ?? {}, r = new Set([t].flat().filter(Boolean)), i = Object.keys(n).filter((e) => !r.has(e));
3930
- return typeof e.isFieldTouched == "function" ? i.some((t) => e.isFieldTouched(t) && Zo(n[t])) : i.some((e) => Zo(n[e]));
3948
+ return typeof e.isFieldTouched == "function" ? i.some((t) => e.isFieldTouched(t) && Qo(n[t])) : i.some((e) => Qo(n[e]));
3931
3949
  }
3932
- function $o(e = []) {
3950
+ function es(e = []) {
3933
3951
  let t = {};
3934
3952
  return (e ?? []).forEach((e) => {
3935
3953
  e?.addRow || (e?.fields ?? []).forEach((e) => {
@@ -3940,38 +3958,38 @@ function $o(e = []) {
3940
3958
  });
3941
3959
  }), t;
3942
3960
  }
3943
- function es(e, t, n) {
3961
+ function ts(e, t, n) {
3944
3962
  let r = e?.confirmWhen ?? "never";
3945
- return r === "never" ? !1 : r === "always" || Yo(t, n);
3963
+ return r === "never" ? !1 : r === "always" || Xo(t, n);
3946
3964
  }
3947
- var ts = [
3965
+ var ns = [
3948
3966
  "top-left",
3949
3967
  "top-center",
3950
3968
  "top-right",
3951
3969
  "bottom-left",
3952
3970
  "bottom-center",
3953
3971
  "bottom-right"
3954
- ], ns = "bottom-left";
3955
- function rs(e = []) {
3972
+ ], rs = "bottom-left";
3973
+ function is(e = []) {
3956
3974
  let t = {};
3957
3975
  return e.forEach((e) => {
3958
- let n = ts.includes(e.position) ? e.position : ns;
3976
+ let n = ns.includes(e.position) ? e.position : rs;
3959
3977
  (t[n] ??= []).push(e);
3960
3978
  }), t;
3961
3979
  }
3962
- function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
3963
- let [a, o] = g(null), [s, c] = g(""), l = b.useWatch((e) => e, e), u = f((e) => qo(e, (e) => (l || {})[e]), [l]), d = f((t) => {
3980
+ function as({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
3981
+ let [a, o] = g(null), [s, c] = g(""), l = b.useWatch((e) => e, e), u = f((e) => Jo(e, (e) => (l || {})[e]), [l]), d = f((t) => {
3964
3982
  if (!Array.isArray(t) || t.length === 0) return !1;
3965
- let n = Vo(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
3983
+ let n = Ho(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
3966
3984
  return t.forEach((t) => {
3967
3985
  if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
3968
- let n = Bo(t);
3986
+ let n = Vo(t);
3969
3987
  if (n.length === 0) return;
3970
3988
  r = !0;
3971
- let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Go);
3989
+ let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Ko);
3972
3990
  if (a.length) {
3973
3991
  let e = t.label || t.name;
3974
- io({
3992
+ ao({
3975
3993
  tone: "overwrite",
3976
3994
  title: `Replace what's in ${e}?`,
3977
3995
  facts: [
@@ -4001,9 +4019,9 @@ function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
4001
4019
  return {
4002
4020
  runAction: f(async (t, a, s, l) => {
4003
4021
  let u = s?.confirmWhen ?? "never";
4004
- if (s?.trigger === "upload" && u !== "never" && (u === "always" || Qo(e, [a?.field]))) {
4005
- let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(a?.field)?.slice?.(-1)?.[0]?.name, r = Xo(e, [a?.field]);
4006
- if (!await io({
4022
+ if (s?.trigger === "upload" && u !== "never" && (u === "always" || $o(e, [a?.field]))) {
4023
+ let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(a?.field)?.slice?.(-1)?.[0]?.name, r = Zo(e, [a?.field]);
4024
+ if (!await ao({
4007
4025
  tone: "overwrite",
4008
4026
  title: t.title || "Read this file and fill the form in?",
4009
4027
  facts: [{
@@ -4027,12 +4045,12 @@ function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
4027
4045
  r && (c[t.param] = r);
4028
4046
  } else {
4029
4047
  let n = e.getFieldValue(t.sourceField);
4030
- n != null && n !== "" && (o[t.param] = Uo(n, t.transform));
4048
+ n != null && n !== "" && (o[t.param] = Wo(n, t.transform));
4031
4049
  }
4032
4050
  }), (s.inputs || []).forEach((e) => {
4033
4051
  !e.group || e.kind !== "text" || (s.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete o[e.param];
4034
4052
  });
4035
- let u = await oo({
4053
+ let u = await so({
4036
4054
  module: n,
4037
4055
  group: t,
4038
4056
  field: a.field,
@@ -4040,9 +4058,9 @@ function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
4040
4058
  inputs: o,
4041
4059
  files: c
4042
4060
  }), f = s.label || "AI action", p = u?.groups;
4043
- if (s?.trigger !== "upload" && es(s, e, p)) {
4044
- let e = s.confirmMessages ?? {}, t = Jo(p).length;
4045
- if (!await io({
4061
+ if (s?.trigger !== "upload" && ts(s, e, p)) {
4062
+ let e = s.confirmMessages ?? {}, t = Yo(p).length;
4063
+ if (!await ao({
4046
4064
  tone: "overwrite",
4047
4065
  title: e.title || `Fill the form in from ${f}?`,
4048
4066
  facts: [{
@@ -4063,7 +4081,7 @@ function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
4063
4081
  field: a,
4064
4082
  groupName: t,
4065
4083
  responseGroups: p,
4066
- payload: $o(p)
4084
+ payload: es(p)
4067
4085
  });
4068
4086
  if (e === !1 || e === "abort") return u;
4069
4087
  }
@@ -4094,7 +4112,7 @@ function is({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
4094
4112
  }
4095
4113
  //#endregion
4096
4114
  //#region src/components/form/AiActionButtons.jsx
4097
- function as({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
4115
+ function os({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
4098
4116
  if (!t || t.length === 0) return null;
4099
4117
  let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
4100
4118
  return /* @__PURE__ */ w(ee, {
@@ -4115,18 +4133,18 @@ function as({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
4115
4133
  }
4116
4134
  //#endregion
4117
4135
  //#region src/components/form/emailValidator.js
4118
- function os(e) {
4136
+ function ss(e) {
4119
4137
  let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
4120
4138
  if (!n) return !1;
4121
4139
  let [, r, i] = n;
4122
4140
  return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
4123
4141
  }
4124
- function ss(e = "Email", t) {
4125
- return { validator: (n, r) => r == null || r === "" || os(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
4142
+ function cs(e = "Email", t) {
4143
+ return { validator: (n, r) => r == null || r === "" || ss(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
4126
4144
  }
4127
4145
  //#endregion
4128
4146
  //#region src/components/form/inputValidator.js
4129
- var cs = [
4147
+ var ls = [
4130
4148
  {
4131
4149
  label: "Only Numbers",
4132
4150
  value: "onlyNumber"
@@ -4199,7 +4217,7 @@ var cs = [
4199
4217
  label: "Website URL",
4200
4218
  value: "websiteUrl"
4201
4219
  }
4202
- ], ls = {
4220
+ ], us = {
4203
4221
  onlyNumber: /^[0-9]$/,
4204
4222
  experience: /^[0-9]$/,
4205
4223
  numericTwoDigits: /^[0-9]$/,
@@ -4215,10 +4233,10 @@ var cs = [
4215
4233
  decimalRange: /^[0-9.]$/,
4216
4234
  contactNumber: /^[0-9()\-+\s]$/
4217
4235
  };
4218
- function us(e) {
4219
- return ls[e] ?? null;
4236
+ function ds(e) {
4237
+ return us[e] ?? null;
4220
4238
  }
4221
- function ds(e, t = {}, n = "change") {
4239
+ function fs(e, t = {}, n = "change") {
4222
4240
  if (!t?.type || e == null) return {
4223
4241
  cleaned: e ?? "",
4224
4242
  error: null
@@ -4301,7 +4319,7 @@ function ds(e, t = {}, n = "change") {
4301
4319
  break;
4302
4320
  }
4303
4321
  case "email":
4304
- c = n === "blur" ? r.trim() : r, c && !os(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
4322
+ c = n === "blur" ? r.trim() : r, c && !ss(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
4305
4323
  break;
4306
4324
  case "websiteUrl":
4307
4325
  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.`);
@@ -4313,21 +4331,21 @@ function ds(e, t = {}, n = "change") {
4313
4331
  error: l
4314
4332
  };
4315
4333
  }
4316
- var fs = "This value is already present";
4317
- function ps(e) {
4334
+ var ps = "This value is already present";
4335
+ function ms(e) {
4318
4336
  return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
4319
4337
  }
4320
- function ms(e) {
4321
- if (ps(e) !== "unique") return null;
4338
+ function hs(e) {
4339
+ if (ms(e) !== "unique") return null;
4322
4340
  if (typeof e == "string") return {
4323
- message: fs,
4341
+ message: ps,
4324
4342
  normalizer: "trim",
4325
4343
  skipBlank: !0,
4326
4344
  validateOn: "blur"
4327
4345
  };
4328
4346
  let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
4329
4347
  return {
4330
- message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : fs,
4348
+ message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ps,
4331
4349
  collectionField: t.collectionField ?? "",
4332
4350
  normalizer: String(t.normalizer ?? "trim"),
4333
4351
  skipBlank: t.skipBlank !== !1,
@@ -4338,20 +4356,20 @@ function ms(e) {
4338
4356
  ].includes(n) ? n : "blur"
4339
4357
  };
4340
4358
  }
4341
- function hs(e) {
4359
+ function gs(e) {
4342
4360
  let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
4343
4361
  if (!Array.isArray(t)) return null;
4344
4362
  for (let e of t) {
4345
- let t = ms(e);
4363
+ let t = hs(e);
4346
4364
  if (t) return t;
4347
4365
  }
4348
4366
  return null;
4349
4367
  }
4350
- function gs(e = []) {
4368
+ function _s(e = []) {
4351
4369
  let t = [];
4352
4370
  return (Array.isArray(e) ? e : []).forEach((e) => {
4353
4371
  (e?.fields ?? []).forEach((e) => {
4354
- let n = hs(e);
4372
+ let n = gs(e);
4355
4373
  !n || !e?.field || t.push({
4356
4374
  field: e.field,
4357
4375
  label: e.label ?? e.field,
@@ -4360,10 +4378,10 @@ function gs(e = []) {
4360
4378
  });
4361
4379
  }), t;
4362
4380
  }
4363
- function _s(e) {
4381
+ function vs(e) {
4364
4382
  return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
4365
4383
  }
4366
- function vs(e, t = "trim") {
4384
+ function ys(e, t = "trim") {
4367
4385
  if (e == null) return "";
4368
4386
  let n = String(e);
4369
4387
  switch (String(t)) {
@@ -4375,10 +4393,10 @@ function vs(e, t = "trim") {
4375
4393
  default: return n.trim();
4376
4394
  }
4377
4395
  }
4378
- function ys(e, t) {
4379
- return !(!e || e.skipBlank !== !1 && _s(t));
4396
+ function bs(e, t) {
4397
+ return !(!e || e.skipBlank !== !1 && vs(t));
4380
4398
  }
4381
- function bs(e) {
4399
+ function xs(e) {
4382
4400
  return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
4383
4401
  }
4384
4402
  var Y = {
@@ -4388,21 +4406,21 @@ var Y = {
4388
4406
  STALE: "stale",
4389
4407
  ERROR: "error"
4390
4408
  };
4391
- function xs({ module: e, field: t, recordId: n, normalized: r }) {
4409
+ function Ss({ module: e, field: t, recordId: n, normalized: r }) {
4392
4410
  return `${e}${t}${n ?? ""}${r}`;
4393
4411
  }
4394
- function Ss({ checkFieldUnique: e, onPendingChange: t } = {}) {
4412
+ function Cs({ checkFieldUnique: e, onPendingChange: t } = {}) {
4395
4413
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
4396
4414
  function o(e) {
4397
4415
  a = e, typeof t == "function" && t(a);
4398
4416
  }
4399
4417
  async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
4400
- if (!c || !t || !s || typeof e != "function" || !ys(c, l)) return { status: Y.SKIPPED };
4401
- let p = xs({
4418
+ if (!c || !t || !s || typeof e != "function" || !bs(c, l)) return { status: Y.SKIPPED };
4419
+ let p = Ss({
4402
4420
  module: t,
4403
4421
  field: s,
4404
4422
  recordId: u,
4405
- normalized: vs(l, c.normalizer)
4423
+ normalized: ys(l, c.normalizer)
4406
4424
  });
4407
4425
  if (n.has(p)) return n.get(p);
4408
4426
  i += 1;
@@ -4420,7 +4438,7 @@ function Ss({ checkFieldUnique: e, onPendingChange: t } = {}) {
4420
4438
  if (r.get(s) !== m) return { status: Y.STALE };
4421
4439
  let a = i?.available === !1 ? {
4422
4440
  status: Y.DUPLICATE,
4423
- message: Cs(i) || c.message || fs
4441
+ message: ws(i) || c.message || ps
4424
4442
  } : { status: Y.AVAILABLE };
4425
4443
  return n.set(p, a), a;
4426
4444
  } catch (e) {
@@ -4441,17 +4459,17 @@ function Ss({ checkFieldUnique: e, onPendingChange: t } = {}) {
4441
4459
  }
4442
4460
  };
4443
4461
  }
4444
- function Cs(e) {
4462
+ function ws(e) {
4445
4463
  return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
4446
4464
  }
4447
- var ws = "__uniqueRule";
4448
- function Ts({ field: e, validation: t, context: n }) {
4449
- let r = ms(t);
4465
+ var Ts = "__uniqueRule";
4466
+ function Es({ field: e, validation: t, context: n }) {
4467
+ let r = hs(t);
4450
4468
  if (!r) return { validator: () => Promise.resolve() };
4451
4469
  let i = e?.field ?? "";
4452
4470
  return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
4453
- [ws]: r,
4454
- validateTrigger: bs(r),
4471
+ [Ts]: r,
4472
+ validateTrigger: xs(r),
4455
4473
  validator: async (e, t) => {
4456
4474
  let a = await n.checker.check({
4457
4475
  module: n.module,
@@ -4466,22 +4484,22 @@ function Ts({ field: e, validation: t, context: n }) {
4466
4484
  }
4467
4485
  };
4468
4486
  }
4469
- function Es(e = []) {
4487
+ function Ds(e = []) {
4470
4488
  let t = Array.isArray(e) ? e : [];
4471
- if (!t.some((e) => e && e[ws])) return t;
4472
- let n = t.filter((e) => e && !e[ws]);
4489
+ if (!t.some((e) => e && e[Ts])) return t;
4490
+ let n = t.filter((e) => e && !e[Ts]);
4473
4491
  return t.map((e) => {
4474
- if (!e || !e[ws]) return e;
4492
+ if (!e || !e[Ts]) return e;
4475
4493
  let t = e.validator;
4476
4494
  return {
4477
4495
  ...e,
4478
- validator: async (e, r) => await Ds(n, r, e) ? Promise.resolve() : t(e, r)
4496
+ validator: async (e, r) => await Os(n, r, e) ? Promise.resolve() : t(e, r)
4479
4497
  };
4480
4498
  });
4481
4499
  }
4482
- async function Ds(e = [], t, n = {}) {
4500
+ async function Os(e = [], t, n = {}) {
4483
4501
  for (let r of e) if (!(!r || typeof r == "string")) {
4484
- if (r.required && _s(t) || !_s(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;
4502
+ if (r.required && vs(t) || !vs(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;
4485
4503
  if (typeof r.validator == "function") try {
4486
4504
  await r.validator(n, t);
4487
4505
  } catch {
@@ -4490,7 +4508,7 @@ async function Ds(e = [], t, n = {}) {
4490
4508
  }
4491
4509
  return !1;
4492
4510
  }
4493
- function Os(e) {
4511
+ function ks(e) {
4494
4512
  let t = String(e ?? "").trim();
4495
4513
  if (!t.startsWith("{")) return null;
4496
4514
  try {
@@ -4499,19 +4517,19 @@ function Os(e) {
4499
4517
  return null;
4500
4518
  }
4501
4519
  }
4502
- function ks(e) {
4520
+ function As(e) {
4503
4521
  if (!e) return null;
4504
- if (typeof e == "string") return Os(e);
4522
+ if (typeof e == "string") return ks(e);
4505
4523
  let t = [
4506
4524
  e.data,
4507
4525
  e.response,
4508
4526
  e,
4509
- Os(e.message)
4527
+ ks(e.message)
4510
4528
  ];
4511
4529
  for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
4512
4530
  return null;
4513
4531
  }
4514
- function As({ field: e, group: t, rowIndex: n }) {
4532
+ function js({ field: e, group: t, rowIndex: n }) {
4515
4533
  let r = String(e ?? ""), i = Number(n);
4516
4534
  return t && Number.isInteger(i) && i >= 0 ? [
4517
4535
  String(t),
@@ -4519,14 +4537,14 @@ function As({ field: e, group: t, rowIndex: n }) {
4519
4537
  ...r.split(".")
4520
4538
  ] : r;
4521
4539
  }
4522
- function js(e, { uniqueRules: t = [] } = {}) {
4523
- let n = ks(e);
4540
+ function Ms(e, { uniqueRules: t = [] } = {}) {
4541
+ let n = As(e);
4524
4542
  if (n) {
4525
4543
  let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
4526
4544
  let t = {
4527
4545
  field: e.field,
4528
- name: As(e),
4529
- message: e.message || n.message || fs
4546
+ name: js(e),
4547
+ message: e.message || n.message || ps
4530
4548
  };
4531
4549
  return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
4532
4550
  });
@@ -4543,7 +4561,7 @@ function js(e, { uniqueRules: t = [] } = {}) {
4543
4561
  }
4544
4562
  //#endregion
4545
4563
  //#region src/services/uniqueValidationApi.js
4546
- async function Ms({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
4564
+ async function Ns({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
4547
4565
  if (!e || !t) throw Error("module and field are required to check uniqueness");
4548
4566
  let c = {
4549
4567
  field: t,
@@ -4577,7 +4595,7 @@ async function Ms({ module: e, field: t, value: n, recordId: r, clientId: i, reg
4577
4595
  throw e;
4578
4596
  }
4579
4597
  }
4580
- async function Ns({ module: e, payload: t, excludeId: n } = {}) {
4598
+ async function Ps({ module: e, payload: t, excludeId: n } = {}) {
4581
4599
  if (!e || !t) return { duplicate: !1 };
4582
4600
  try {
4583
4601
  let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
@@ -4595,7 +4613,7 @@ async function Ns({ module: e, payload: t, excludeId: n } = {}) {
4595
4613
  }
4596
4614
  //#endregion
4597
4615
  //#region src/components/form/uploadAccept.js
4598
- var Ps = [
4616
+ var Fs = [
4599
4617
  "jpg",
4600
4618
  "jpeg",
4601
4619
  "png",
@@ -4604,18 +4622,18 @@ var Ps = [
4604
4622
  "bmp",
4605
4623
  "svg",
4606
4624
  "avif"
4607
- ], Fs = [
4625
+ ], Is = [
4608
4626
  "mp4",
4609
4627
  "webm",
4610
4628
  "ogg",
4611
4629
  "ogv",
4612
4630
  "mov",
4613
4631
  "m4v"
4614
- ], Is = [
4632
+ ], Ls = [
4615
4633
  "pdf",
4616
4634
  "doc",
4617
4635
  "docx"
4618
- ], Ls = [
4636
+ ], Rs = [
4619
4637
  {
4620
4638
  label: "Any file",
4621
4639
  value: "any"
@@ -4636,34 +4654,34 @@ var Ps = [
4636
4654
  label: "Images & Videos",
4637
4655
  value: "imagesAndVideos"
4638
4656
  }
4639
- ], Rs = {
4657
+ ], zs = {
4640
4658
  documents: {
4641
- exts: [...Is, ...Ps],
4659
+ exts: [...Ls, ...Fs],
4642
4660
  hint: "PDF, DOC or image files",
4643
4661
  error: "Only document (PDF/DOC) or image files are allowed"
4644
4662
  },
4645
4663
  images: {
4646
- exts: Ps,
4664
+ exts: Fs,
4647
4665
  hint: "Image files",
4648
4666
  error: "Only image files are allowed"
4649
4667
  },
4650
4668
  videos: {
4651
- exts: Fs,
4669
+ exts: Is,
4652
4670
  hint: "Video files",
4653
4671
  error: "Only video files are allowed"
4654
4672
  },
4655
4673
  imagesAndVideos: {
4656
- exts: [...Ps, ...Fs],
4674
+ exts: [...Fs, ...Is],
4657
4675
  hint: "Image or video files",
4658
4676
  error: "Only image or video files are allowed"
4659
4677
  }
4660
4678
  };
4661
- function zs(e) {
4662
- return Rs[String(e?.accept ?? "").trim()] ?? null;
4679
+ function Bs(e) {
4680
+ return zs[String(e?.accept ?? "").trim()] ?? null;
4663
4681
  }
4664
4682
  //#endregion
4665
4683
  //#region src/components/form/quickActionLabels.js
4666
- var Bs = /* @__PURE__ */ new Set([
4684
+ var Vs = /* @__PURE__ */ new Set([
4667
4685
  "of",
4668
4686
  "and",
4669
4687
  "the",
@@ -4672,7 +4690,7 @@ var Bs = /* @__PURE__ */ new Set([
4672
4690
  "in",
4673
4691
  "a",
4674
4692
  "an"
4675
- ]), Vs = {
4693
+ ]), Hs = {
4676
4694
  addresses: "address",
4677
4695
  branches: "branch",
4678
4696
  batches: "batch",
@@ -4683,43 +4701,43 @@ var Bs = /* @__PURE__ */ new Set([
4683
4701
  people: "person",
4684
4702
  statuses: "status"
4685
4703
  };
4686
- function Hs(e) {
4704
+ function Us(e) {
4687
4705
  let t = String(e ?? "").trim();
4688
4706
  if (!t) return "";
4689
4707
  if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
4690
4708
  let n = t.toLowerCase();
4691
- return Vs[n] ? Vs[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;
4709
+ return Hs[n] ? Hs[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;
4692
4710
  }
4693
- function Us(e) {
4711
+ function Ws(e) {
4694
4712
  let t = String(e ?? "").trim();
4695
4713
  if (!t) return "";
4696
4714
  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);
4697
4715
  if (!n.length) return "";
4698
- let r = Hs(n[n.length - 1]);
4716
+ let r = Us(n[n.length - 1]);
4699
4717
  return [...n.slice(0, -1), r].map((e, t) => {
4700
4718
  let n = e.toLowerCase();
4701
- return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Bs.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
4719
+ return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Vs.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
4702
4720
  }).join(" ");
4703
4721
  }
4704
- function Ws(e, t) {
4722
+ function Gs(e, t) {
4705
4723
  let n = String(e?.quickCreateLabel ?? "").trim();
4706
4724
  if (n && n.toLowerCase() !== "add more") return n;
4707
- let r = Us(e?.quickCreateModule || t);
4725
+ let r = Ws(e?.quickCreateModule || t);
4708
4726
  return r ? `Add New ${r}` : "Add New";
4709
4727
  }
4710
- function Gs(e, t) {
4728
+ function Ks(e, t) {
4711
4729
  let n = String(e?.quickEditLabel ?? "").trim();
4712
4730
  if (n && n.toLowerCase() !== "add more") return n;
4713
- let r = Us(e?.quickEditModule || t);
4731
+ let r = Ws(e?.quickEditModule || t);
4714
4732
  return r ? `Edit ${r}` : "Edit";
4715
4733
  }
4716
- function Ks(e, t, n) {
4717
- let r = Us((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
4718
- return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : Ws(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : Gs(t, n));
4734
+ function qs(e, t, n) {
4735
+ let r = Ws((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
4736
+ return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : Gs(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : Ks(t, n));
4719
4737
  }
4720
4738
  //#endregion
4721
4739
  //#region src/components/AppButton.jsx
4722
- function qs({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
4740
+ function Js({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
4723
4741
  let o = /* @__PURE__ */ w(v, {
4724
4742
  className: `app-button app-button--${i} ${t}`.trim(),
4725
4743
  icon: n,
@@ -4734,13 +4752,13 @@ function qs({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
4734
4752
  }
4735
4753
  //#endregion
4736
4754
  //#region src/components/detail/userNames.js
4737
- function Js(e) {
4755
+ function Ys(e) {
4738
4756
  return !e || typeof e != "object" ? "" : [e.firstName ?? e.first_name ?? e.FIRST_NAME, e.lastName ?? e.last_name ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.userName || e.user_name || e.username || e.email || "";
4739
4757
  }
4740
4758
  function X(e) {
4741
4759
  return e == null || e === "" ? "" : typeof e == "object" ? String(e.$oid ?? e.id ?? e._id ?? "").trim() : String(e).trim();
4742
4760
  }
4743
- function Ys(e = {}) {
4761
+ function Xs(e = {}) {
4744
4762
  return [
4745
4763
  e.legacyUserId,
4746
4764
  e.userId,
@@ -4749,32 +4767,32 @@ function Ys(e = {}) {
4749
4767
  e.id
4750
4768
  ].map(X).filter(Boolean);
4751
4769
  }
4752
- function Xs(e) {
4770
+ function Zs(e) {
4753
4771
  let t = {};
4754
4772
  return (Array.isArray(e) ? e : []).forEach((e) => {
4755
- let n = Js(e);
4756
- n && Ys(e).forEach((e) => {
4773
+ let n = Ys(e);
4774
+ n && Xs(e).forEach((e) => {
4757
4775
  t[e] === void 0 && (t[e] = n);
4758
4776
  });
4759
4777
  }), t;
4760
4778
  }
4761
- var Zs;
4762
- function Qs() {
4763
- return Zs ||= a(s, "/module/list?module=users").then((e) => {
4779
+ var Qs;
4780
+ function $s() {
4781
+ return Qs ||= a(s, "/module/list?module=users").then((e) => {
4764
4782
  let t = e?.data?.data ?? e?.data ?? [];
4765
4783
  return Array.isArray(t) ? t : [];
4766
- }).catch(() => []), Zs;
4784
+ }).catch(() => []), Qs;
4767
4785
  }
4768
- var $s = /* @__PURE__ */ new Map();
4769
- function ec(e) {
4786
+ var ec = /* @__PURE__ */ new Map();
4787
+ function tc(e) {
4770
4788
  let t = X(e);
4771
4789
  if (!t) return Promise.resolve("");
4772
- if ($s.has(t)) return $s.get(t);
4773
- let n = Qs().then((e) => Js(e.find((e) => X(e?.legacyUserId) === t || X(e?.userId) === t || X(e?.user_id) === t) || e.find((e) => X(e?._id) === t || X(e?.id) === t))).catch(() => "");
4774
- return $s.set(t, n), n;
4790
+ if (ec.has(t)) return ec.get(t);
4791
+ let n = $s().then((e) => Ys(e.find((e) => X(e?.legacyUserId) === t || X(e?.userId) === t || X(e?.user_id) === t) || e.find((e) => X(e?._id) === t || X(e?.id) === t))).catch(() => "");
4792
+ return ec.set(t, n), n;
4775
4793
  }
4776
4794
  var Z = (e) => e == null ? "" : String(e).trim();
4777
- function tc(e) {
4795
+ function nc(e) {
4778
4796
  let t = e?.quickCreateNotice;
4779
4797
  return !t || typeof t != "object" || t.enabled === !1 ? null : {
4780
4798
  enabled: !0,
@@ -4787,7 +4805,7 @@ function tc(e) {
4787
4805
  creatorLabel: Z(t.creatorLabel) || "Created by"
4788
4806
  };
4789
4807
  }
4790
- var nc = [
4808
+ var rc = [
4791
4809
  "clientName",
4792
4810
  "companyName",
4793
4811
  "name",
@@ -4797,24 +4815,24 @@ var nc = [
4797
4815
  "label",
4798
4816
  "employerName",
4799
4817
  "vendorName"
4800
- ], rc = (e, t) => {
4818
+ ], ic = (e, t) => {
4801
4819
  if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
4802
- }, ic = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
4803
- function ac(e, { recordNameField: t = "", displayField: n = "" } = {}) {
4820
+ }, ac = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
4821
+ function oc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
4804
4822
  if (!e || typeof e != "object") return "";
4805
4823
  for (let r of [
4806
4824
  t,
4807
4825
  n,
4808
- ...nc
4826
+ ...rc
4809
4827
  ]) {
4810
4828
  if (!r) continue;
4811
- let t = ic(rc(e, r));
4829
+ let t = ac(ic(e, r));
4812
4830
  if (t) return t;
4813
4831
  }
4814
4832
  let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
4815
4833
  return r ? Z(e[r]) : "";
4816
4834
  }
4817
- function oc(e) {
4835
+ function sc(e) {
4818
4836
  if (!e || typeof e != "object") return "";
4819
4837
  let t = [
4820
4838
  e.createdBy,
@@ -4836,36 +4854,36 @@ function oc(e) {
4836
4854
  }
4837
4855
  return "";
4838
4856
  }
4839
- function sc(e = i) {
4857
+ function cc(e = i) {
4840
4858
  try {
4841
- return Js(e()) || "";
4859
+ return Ys(e()) || "";
4842
4860
  } catch {
4843
4861
  return "";
4844
4862
  }
4845
4863
  }
4846
- var cc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
4864
+ var lc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
4847
4865
  let t = e?.data?.data ?? e?.data ?? [];
4848
4866
  return Array.isArray(t) ? t[0] : t;
4849
4867
  });
4850
- async function lc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
4851
- let { fetchRecord: o = cc, fetchUserNameFn: s = ec, getUser: c = i } = a, l = null;
4868
+ async function uc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
4869
+ let { fetchRecord: o = lc, fetchUserNameFn: s = tc, getUser: c = i } = a, l = null;
4852
4870
  if (e && t) try {
4853
4871
  l = await o(e, t);
4854
4872
  } catch {
4855
4873
  l = null;
4856
4874
  }
4857
- let u = n?.showRecordName === !1 ? "" : ac(l, {
4875
+ let u = n?.showRecordName === !1 ? "" : oc(l, {
4858
4876
  recordNameField: n?.recordNameField,
4859
4877
  displayField: r
4860
4878
  }), d = "";
4861
4879
  if (n?.showCreator !== !1) {
4862
- let e = oc(l);
4880
+ let e = sc(l);
4863
4881
  if (e) try {
4864
4882
  d = Z(await s(e));
4865
4883
  } catch {
4866
4884
  d = "";
4867
4885
  }
4868
- d ||= sc(c);
4886
+ d ||= cc(c);
4869
4887
  }
4870
4888
  return {
4871
4889
  recordName: u,
@@ -4874,17 +4892,17 @@ async function lc({ module: e, recordId: t, notice: n, displayField: r = "", dep
4874
4892
  }
4875
4893
  //#endregion
4876
4894
  //#region src/components/form/QuickCreateEditField.jsx
4877
- var uc = d(() => import("./index.js").then((e) => e.i)), dc = d(() => import("./index.js").then((e) => e.n)), fc = (e) => e == null || e === "", pc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
4878
- function mc(e, t, n, r, i) {
4895
+ var dc = d(() => import("./index.js").then((e) => e.i)), fc = d(() => import("./index.js").then((e) => e.n)), pc = (e) => e == null || e === "", mc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
4896
+ function hc(e, t, n, r, i) {
4879
4897
  let a = e.quickEditIdFrom;
4880
4898
  if (a) {
4881
- let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...pc(a)] : pc(a), i = t?.getFieldValue?.(e);
4882
- return fc(i) && (i = r?.[a]), fc(i) ? null : i;
4899
+ let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...mc(a)] : mc(a), i = t?.getFieldValue?.(e);
4900
+ return pc(i) && (i = r?.[a]), pc(i) ? null : i;
4883
4901
  }
4884
- return i && typeof i == "object" ? i.value ?? null : fc(i) ? null : i;
4902
+ return i && typeof i == "object" ? i.value ?? null : pc(i) ? null : i;
4885
4903
  }
4886
- function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
4887
- 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 ? mc(e, t, n, i, a) : null, [
4904
+ function gc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
4905
+ 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 ? hc(e, t, n, i, a) : null, [
4888
4906
  p,
4889
4907
  e,
4890
4908
  t,
@@ -4914,12 +4932,12 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
4914
4932
  module: _,
4915
4933
  recordId: String(y)
4916
4934
  }), C = (t) => {
4917
- let n = tc(e);
4935
+ let n = nc(e);
4918
4936
  n && (d({
4919
4937
  ...n,
4920
4938
  recordName: "",
4921
4939
  creatorName: ""
4922
- }), lc({
4940
+ }), uc({
4923
4941
  module: h,
4924
4942
  recordId: t,
4925
4943
  notice: n,
@@ -4949,20 +4967,20 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
4949
4967
  icon: /* @__PURE__ */ w(fe, {}),
4950
4968
  onClick: S,
4951
4969
  style: { paddingLeft: 0 },
4952
- children: Ws(e, h)
4970
+ children: Gs(e, h)
4953
4971
  }), p && /* @__PURE__ */ w(v, {
4954
4972
  type: "link",
4955
4973
  size: "small",
4956
4974
  icon: /* @__PURE__ */ w(oe, {}),
4957
4975
  onClick: ne,
4958
4976
  disabled: !y,
4959
- title: y ? void 0 : `Choose a ${Us(_) || "record"} above first, then edit it here`,
4960
- children: Gs(e, _)
4977
+ title: y ? void 0 : `Choose a ${Ws(_) || "record"} above first, then edit it here`,
4978
+ children: Ks(e, _)
4961
4979
  })]
4962
4980
  })
4963
4981
  }), ie = s ? /* @__PURE__ */ w(x, {
4964
4982
  open: !0,
4965
- title: Ks(s.mode, e, s.mode === "create" ? h : _),
4983
+ title: qs(s.mode, e, s.mode === "create" ? h : _),
4966
4984
  width: "min(1080px, 96vw)",
4967
4985
  footer: null,
4968
4986
  destroyOnClose: !0,
@@ -4980,7 +4998,7 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
4980
4998
  },
4981
4999
  children: /* @__PURE__ */ w(te, {})
4982
5000
  }),
4983
- children: s.mode === "create" ? /* @__PURE__ */ w(uc, {
5001
+ children: s.mode === "create" ? /* @__PURE__ */ w(dc, {
4984
5002
  moduleName: s.module,
4985
5003
  embedded: !0,
4986
5004
  breadcrumbItems: [],
@@ -4988,7 +5006,7 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
4988
5006
  onSuccess: (e) => {
4989
5007
  b(), C(e), o?.("create", e);
4990
5008
  }
4991
- }) : /* @__PURE__ */ w(dc, {
5009
+ }) : /* @__PURE__ */ w(fc, {
4992
5010
  moduleName: s.module,
4993
5011
  recordId: s.recordId,
4994
5012
  embedded: !0,
@@ -5012,7 +5030,7 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
5012
5030
  width: "min(520px, 94vw)",
5013
5031
  maskClosable: !1,
5014
5032
  onCancel: () => d(null),
5015
- footer: /* @__PURE__ */ w(qs, {
5033
+ footer: /* @__PURE__ */ w(Js, {
5016
5034
  variant: "primary",
5017
5035
  type: "primary",
5018
5036
  onClick: () => d(null),
@@ -5049,8 +5067,8 @@ function hc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
5049
5067
  }
5050
5068
  //#endregion
5051
5069
  //#region src/components/form/crossFieldRules.js
5052
- var gc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
5053
- function _c(e, t, n) {
5070
+ var _c = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
5071
+ function vc(e, t, n) {
5054
5072
  let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
5055
5073
  if (typeof n == "function") {
5056
5074
  let e = n(t);
@@ -5058,23 +5076,23 @@ function _c(e, t, n) {
5058
5076
  }
5059
5077
  return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
5060
5078
  }
5061
- function vc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
5079
+ function yc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
5062
5080
  let s = n.field ?? n.compareField ?? r;
5063
5081
  return { validator: async (n, r) => {
5064
- if (!s || gc(r)) return Promise.resolve();
5065
- let c = i?.getFieldValue?.(_c(a, s, o));
5066
- if (gc(c)) return Promise.resolve();
5082
+ if (!s || _c(r)) return Promise.resolve();
5083
+ let c = i?.getFieldValue?.(vc(a, s, o));
5084
+ if (_c(c)) return Promise.resolve();
5067
5085
  let l = Number(c), u = Number(r);
5068
5086
  return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
5069
5087
  } };
5070
5088
  }
5071
- function yc(e = {}, t, n) {
5089
+ function bc(e = {}, t, n) {
5072
5090
  let r = e.field ?? e.compareField ?? e.value;
5073
- return r ? _c(t, r, n) : null;
5091
+ return r ? vc(t, r, n) : null;
5074
5092
  }
5075
5093
  //#endregion
5076
5094
  //#region src/components/form/maxCeiling.js
5077
- function bc(e, t) {
5095
+ function xc(e, t) {
5078
5096
  let n = String(t).split(".").filter(Boolean);
5079
5097
  if (!Array.isArray(e)) return n.length > 1 ? n : t;
5080
5098
  if (n.length > 1) {
@@ -5087,14 +5105,14 @@ function bc(e, t) {
5087
5105
  let r = [...e];
5088
5106
  return r[r.length - 1] = n[0], r;
5089
5107
  }
5090
- function xc(e, t, n) {
5091
- let r = e?.getFieldValue?.(bc(t, n));
5108
+ function Sc(e, t, n) {
5109
+ let r = e?.getFieldValue?.(xc(t, n));
5092
5110
  return r != null && r !== "" ? r : e?.getFieldValue?.(n);
5093
5111
  }
5094
- function Sc(e) {
5112
+ function Cc(e) {
5095
5113
  return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
5096
5114
  }
5097
- function Cc(e, t) {
5115
+ function wc(e, t) {
5098
5116
  for (let n of e ?? []) {
5099
5117
  let e = t(n);
5100
5118
  if (e == null || e === "") continue;
@@ -5106,14 +5124,14 @@ function Cc(e, t) {
5106
5124
  }
5107
5125
  return null;
5108
5126
  }
5109
- function wc({ input: e, compareFields: t, readValue: n }) {
5127
+ function Tc({ input: e, compareFields: t, readValue: n }) {
5110
5128
  let r = {
5111
5129
  ok: !0,
5112
5130
  field: null,
5113
5131
  maximum: null
5114
5132
  };
5115
5133
  if (e == null || e === "") return r;
5116
- let i = Cc(t, n);
5134
+ let i = wc(t, n);
5117
5135
  if (!i) return r;
5118
5136
  let a = Number(e);
5119
5137
  return Number.isFinite(a) ? {
@@ -5124,39 +5142,39 @@ function wc({ input: e, compareFields: t, readValue: n }) {
5124
5142
  }
5125
5143
  //#endregion
5126
5144
  //#region src/components/form/contextPrefill.js
5127
- var Tc = { candidates: ["applicantId"] };
5128
- function Ec(e) {
5145
+ var Ec = { candidates: ["applicantId"] };
5146
+ function Dc(e) {
5129
5147
  let t = String(e ?? "").trim();
5130
5148
  if (!t) return [];
5131
5149
  let n = t.endsWith("s") ? t.slice(0, -1) : t;
5132
5150
  return [.../* @__PURE__ */ new Set([
5133
5151
  `${n}Id`,
5134
5152
  `${t}Id`,
5135
- ...Tc[t] ?? []
5153
+ ...Ec[t] ?? []
5136
5154
  ])];
5137
5155
  }
5138
- function Dc(e, t) {
5156
+ function Oc(e, t) {
5139
5157
  if (!t) return "";
5140
5158
  let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
5141
- for (let r of Ec(e)) {
5159
+ for (let r of Dc(e)) {
5142
5160
  let e = String(n(t[r]) || "");
5143
5161
  if (e) return e;
5144
5162
  }
5145
5163
  return "";
5146
5164
  }
5147
- function Oc(e, t) {
5165
+ function kc(e, t) {
5148
5166
  let n = /* @__PURE__ */ new Set();
5149
5167
  return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
5150
5168
  e?.prefillFromModule && n.add(t(e.prefillFromModule));
5151
5169
  })), [...n];
5152
5170
  }
5153
- function kc(e) {
5171
+ function Ac(e) {
5154
5172
  return e?.payloadMode === "skip";
5155
5173
  }
5156
- function Ac(e) {
5174
+ function jc(e) {
5157
5175
  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 : [];
5158
5176
  }
5159
- function jc(e) {
5177
+ function Mc(e) {
5160
5178
  let t = {};
5161
5179
  return (e ?? []).forEach((e) => {
5162
5180
  e?.addRow || (e?.fields ?? []).forEach((e) => {
@@ -5164,7 +5182,7 @@ function jc(e) {
5164
5182
  });
5165
5183
  }), t;
5166
5184
  }
5167
- function Mc(e, t) {
5185
+ function Nc(e, t) {
5168
5186
  if (!(!e || !t)) for (let n of [
5169
5187
  t.prefillFrom,
5170
5188
  t.field,
@@ -5177,7 +5195,7 @@ function Mc(e, t) {
5177
5195
  }
5178
5196
  //#endregion
5179
5197
  //#region src/components/form/ValidationOverrideCheckbox.jsx
5180
- function Nc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
5198
+ function Pc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
5181
5199
  let a = Qi(t), o = b.useWatch(n, e);
5182
5200
  if (!a) return null;
5183
5201
  let s = a.label || "Allow beyond the limit", c = () => {
@@ -5189,7 +5207,7 @@ function Nc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
5189
5207
  e.setFieldValue(n, !1), c();
5190
5208
  return;
5191
5209
  }
5192
- let i = await io(aa(t));
5210
+ let i = await ao(aa(t));
5193
5211
  e.setFieldValue(n, !!i), c();
5194
5212
  }, u = a.help ? `${s} — ${a.help}` : s;
5195
5213
  return /* @__PURE__ */ w(S, {
@@ -5208,34 +5226,34 @@ function Nc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
5208
5226
  }
5209
5227
  //#endregion
5210
5228
  //#region src/components/form/prefillWhenRules.js
5211
- var Pc = (e) => String(e ?? "");
5212
- function Fc(e) {
5229
+ var Fc = (e) => String(e ?? "");
5230
+ function Ic(e) {
5213
5231
  let t = /* @__PURE__ */ new Set(), n = [];
5214
5232
  return (Array.isArray(e) ? e : []).forEach((e) => {
5215
5233
  let r = e?.field;
5216
5234
  !r || t.has(r) || (t.add(r), n.push(r));
5217
5235
  }), n;
5218
5236
  }
5219
- function Ic(e, t, n, r) {
5220
- return Fc(e).map((e) => ({
5237
+ function Lc(e, t, n, r) {
5238
+ return Ic(e).map((e) => ({
5221
5239
  field: e,
5222
5240
  path: n(t, e, r)
5223
5241
  }));
5224
5242
  }
5225
- function Lc(e, t = {}) {
5226
- return !e || !e.field ? !1 : Pc(t[e.field]) === Pc(e.value);
5243
+ function Rc(e, t = {}) {
5244
+ return !e || !e.field ? !1 : Fc(t[e.field]) === Fc(e.value);
5227
5245
  }
5228
- function Rc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
5229
- let o = (Array.isArray(e) ? e : []).find((e) => Lc(e, t));
5246
+ function zc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
5247
+ let o = (Array.isArray(e) ? e : []).find((e) => Rc(e, t));
5230
5248
  return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
5231
5249
  action: "set",
5232
5250
  value: o.setValue
5233
- } : i && r !== void 0 && Pc(n) === Pc(r) ? { action: "clear" } : { action: "none" };
5251
+ } : i && r !== void 0 && Fc(n) === Fc(r) ? { action: "clear" } : { action: "none" };
5234
5252
  }
5235
5253
  //#endregion
5236
5254
  //#region src/components/form/optionConstraints.js
5237
5255
  var Q = (e) => String(e ?? "").trim().toLowerCase();
5238
- function zc(e) {
5256
+ function Bc(e) {
5239
5257
  let t = Array.isArray(e) ? e : [e], n = [];
5240
5258
  return t.forEach((e) => {
5241
5259
  if (e != null && e !== "") {
@@ -5255,38 +5273,38 @@ function zc(e) {
5255
5273
  }
5256
5274
  }), n;
5257
5275
  }
5258
- function Bc(e = [], t) {
5259
- let n = zc(t);
5276
+ function Vc(e = [], t) {
5277
+ let n = Bc(t);
5260
5278
  if (!n.length || !Array.isArray(e) || e.length === 0) return e;
5261
5279
  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)));
5262
5280
  return i.length > 0 ? i : e;
5263
5281
  }
5264
- function Vc(e) {
5282
+ function Hc(e) {
5265
5283
  let t = [];
5266
5284
  return [e?.setValue, e?.setValueLabel].forEach((e) => {
5267
5285
  e != null && e !== "" && t.push(Q(e));
5268
5286
  }), t;
5269
5287
  }
5270
- function Hc(e, t = {}) {
5288
+ function Uc(e, t = {}) {
5271
5289
  let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
5272
5290
  return n.forEach((e) => {
5273
5291
  if (!e || e.clearValue) return;
5274
- let n = Vc(e);
5292
+ let n = Hc(e);
5275
5293
  if (!n.length) return;
5276
- let a = Lc(e, t) ? i : r;
5294
+ let a = Rc(e, t) ? i : r;
5277
5295
  n.forEach((e) => a.add(e));
5278
5296
  }), i.forEach((e) => r.delete(e)), [...r];
5279
5297
  }
5280
- function Uc(e = [], t, n) {
5281
- let r = Hc(t, n);
5298
+ function Wc(e = [], t, n) {
5299
+ let r = Uc(t, n);
5282
5300
  if (!r.length || !Array.isArray(e) || e.length === 0) return e;
5283
5301
  let i = new Set(r);
5284
5302
  return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
5285
5303
  }
5286
5304
  //#endregion
5287
5305
  //#region src/components/form/optionRowFilters.js
5288
- var Wc = 64;
5289
- function Gc(e) {
5306
+ var Gc = 64;
5307
+ function Kc(e) {
5290
5308
  if (String(e ?? "").trim() !== "currentUserId") return "";
5291
5309
  try {
5292
5310
  return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
@@ -5294,34 +5312,34 @@ function Gc(e) {
5294
5312
  return "";
5295
5313
  }
5296
5314
  }
5297
- var Kc = (e) => String(e ?? "").trim().toLowerCase(), qc = (e) => e != null && String(e).trim() !== "";
5298
- function Jc(e) {
5315
+ var qc = (e) => String(e ?? "").trim().toLowerCase(), Jc = (e) => e != null && String(e).trim() !== "";
5316
+ function Yc(e) {
5299
5317
  let t = Array.isArray(e) ? e : String(e ?? "").split(",");
5300
- return new Set(t.map(Kc).filter((e) => e !== ""));
5318
+ return new Set(t.map(qc).filter((e) => e !== ""));
5301
5319
  }
5302
- function Yc(e, t) {
5303
- return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => qc(e?.extraData?.[t]));
5320
+ function Xc(e, t) {
5321
+ return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => Jc(e?.extraData?.[t]));
5304
5322
  }
5305
- function Xc(e, t, n) {
5323
+ function Zc(e, t, n) {
5306
5324
  let r = e?.extraData?.[t];
5307
- if (!qc(n)) return r === !0;
5308
- let i = Jc(n);
5309
- return i.size === 0 ? r === !0 : i.has(Kc(r));
5325
+ if (!Jc(n)) return r === !0;
5326
+ let i = Yc(n);
5327
+ return i.size === 0 ? r === !0 : i.has(qc(r));
5310
5328
  }
5311
- function Zc(e, t) {
5329
+ function Qc(e, t) {
5312
5330
  let n = /* @__PURE__ */ new Map();
5313
5331
  return (Array.isArray(e) ? e : []).forEach((e) => {
5314
- let r = Kc(e?.value);
5315
- r && n.set(r, Kc(e?.extraData?.[t]));
5332
+ let r = qc(e?.value);
5333
+ r && n.set(r, qc(e?.extraData?.[t]));
5316
5334
  }), n;
5317
5335
  }
5318
- function Qc(e, t, n) {
5319
- let r = Kc(n);
5336
+ function $c(e, t, n) {
5337
+ let r = qc(n);
5320
5338
  if (!r) return !1;
5321
- let i = /* @__PURE__ */ new Set(), a = Kc(e);
5339
+ let i = /* @__PURE__ */ new Set(), a = qc(e);
5322
5340
  if (!a) return !1;
5323
5341
  i.add(a);
5324
- for (let e = 0; e < Wc; e += 1) {
5342
+ for (let e = 0; e < Gc; e += 1) {
5325
5343
  let e = t.get(a);
5326
5344
  if (!e) return !1;
5327
5345
  if (e === r) return !0;
@@ -5330,68 +5348,68 @@ function Qc(e, t, n) {
5330
5348
  }
5331
5349
  return !1;
5332
5350
  }
5333
- function $c(e = {}) {
5351
+ function el(e = {}) {
5334
5352
  let t = [], n = (e) => {
5335
5353
  let n = String(e ?? "").trim();
5336
5354
  n && !t.includes(n) && t.push(n);
5337
5355
  };
5338
5356
  return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
5339
5357
  }
5340
- function el(e, t = {}, n = {}) {
5358
+ function tl(e, t = {}, n = {}) {
5341
5359
  if (!Array.isArray(e) || e.length === 0) return e;
5342
5360
  let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
5343
5361
  typeof console < "u" && console.warn(e);
5344
5362
  }, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
5345
- s && (Yc(o, s) ? o = o.filter((e) => Xc(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".`));
5363
+ s && (Xc(o, s) ? o = o.filter((e) => Zc(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".`));
5346
5364
  let c = String(t.optionsHierarchyParentField ?? "").trim();
5347
5365
  if (c) {
5348
- let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Gc(n);
5366
+ let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Kc(n);
5349
5367
  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.`);
5350
- else if (!Yc(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".`);
5368
+ else if (!Xc(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".`);
5351
5369
  else {
5352
- let t = Zc(e, c);
5353
- o = o.filter((e) => Qc(e?.value, t, s));
5370
+ let t = Qc(e, c);
5371
+ o = o.filter((e) => $c(e?.value, t, s));
5354
5372
  }
5355
5373
  }
5356
5374
  return o;
5357
5375
  }
5358
5376
  //#endregion
5359
5377
  //#region src/components/form/fieldTooltip.js
5360
- var tl = (e) => e == null || String(e).trim() === "", nl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
5361
- function rl(e) {
5362
- return tl(e?.tooltip) ? nl(e?.infoEnabled) && !tl(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
5378
+ var nl = (e) => e == null || String(e).trim() === "", rl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
5379
+ function il(e) {
5380
+ return nl(e?.tooltip) ? rl(e?.infoEnabled) && !nl(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
5363
5381
  }
5364
5382
  //#endregion
5365
5383
  //#region src/components/form/dependentLookupReset.js
5366
- var il = Symbol("parentFilterUnseen"), al = (e) => e == null || e === "", ol = (e, t) => String(e ?? "") === String(t ?? "");
5367
- function sl({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
5368
- return !(!r || e === il || ol(e, t) || al(e) || al(n));
5384
+ var al = Symbol("parentFilterUnseen"), ol = (e) => e == null || e === "", sl = (e, t) => String(e ?? "") === String(t ?? "");
5385
+ function cl({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
5386
+ return !(!r || e === al || sl(e, t) || ol(e) || ol(n));
5369
5387
  }
5370
5388
  //#endregion
5371
5389
  //#region src/utils/roleAllowsAction.js
5372
- function cl(e) {
5373
- return e == null ? !0 : typeof e == "object" ? cl(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
5390
+ function ll(e) {
5391
+ return e == null ? !0 : typeof e == "object" ? ll(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
5374
5392
  }
5375
- function ll(e, t, n) {
5393
+ function ul(e, t, n) {
5376
5394
  if (!t || typeof e != "function") return !0;
5377
5395
  let [r, i] = String(t).split(".");
5378
5396
  return e(i ? r : n || r, i ?? r);
5379
5397
  }
5380
- function ul(e, t) {
5398
+ function dl(e, t) {
5381
5399
  if (!e) return !0;
5382
5400
  try {
5383
5401
  let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
5384
- return cl((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
5402
+ return ll((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
5385
5403
  } catch {
5386
5404
  return !0;
5387
5405
  }
5388
5406
  }
5389
5407
  //#endregion
5390
5408
  //#region src/utils/afterSubmitNav.js
5391
- function dl(e) {
5409
+ function fl(e) {
5392
5410
  return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
5393
5411
  }
5394
- function fl(e, t, n) {
5412
+ function pl(e, t, n) {
5395
5413
  let r = String(e ?? "").trim();
5396
5414
  return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
5397
5415
  let i = r === "id" ? t : n?.[r];
@@ -5400,50 +5418,50 @@ function fl(e, t, n) {
5400
5418
  }
5401
5419
  //#endregion
5402
5420
  //#region src/utils/backNav.js
5403
- function pl(e = typeof window < "u" ? window : void 0) {
5421
+ function ml(e = typeof window < "u" ? window : void 0) {
5404
5422
  let t = e?.history?.state?.idx;
5405
5423
  return typeof t == "number" && t > 0;
5406
5424
  }
5407
- function ml({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
5408
- return t && e ? { path: e } : pl(r) ? { back: !0 } : e ? { path: e } : { path: n };
5425
+ function hl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
5426
+ return t && e ? { path: e } : ml(r) ? { back: !0 } : e ? { path: e } : { path: n };
5409
5427
  }
5410
- function hl(e, t = {}) {
5411
- let n = ml(t);
5428
+ function gl(e, t = {}) {
5429
+ let n = hl(t);
5412
5430
  return n.back ? e(-1) : e(n.path), n;
5413
5431
  }
5414
5432
  //#endregion
5415
5433
  //#region src/components/form/educationRules.js
5416
- var gl = (e) => e == null ? "" : String(e).trim();
5417
- function _l(e, t) {
5434
+ var _l = (e) => e == null ? "" : String(e).trim();
5435
+ function vl(e, t) {
5418
5436
  let n = e?.regionRules;
5419
5437
  if (!n || typeof n != "object") return e ?? {};
5420
- let r = gl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
5438
+ let r = _l(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
5421
5439
  return !i || typeof i != "object" ? e ?? {} : {
5422
5440
  ...e,
5423
5441
  ...i
5424
5442
  };
5425
5443
  }
5426
- function vl(e) {
5427
- return e?.allowInProgress !== !1;
5428
- }
5429
5444
  function yl(e) {
5430
- return vl(e) ? "" : Sl(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.";
5445
+ return e?.allowInProgress !== !1;
5431
5446
  }
5432
5447
  function bl(e) {
5433
- return vl(e) ? "allow" : gl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
5448
+ return yl(e) ? "" : Cl(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.";
5434
5449
  }
5435
5450
  function xl(e) {
5436
- return bl(e) === "block";
5451
+ return yl(e) ? "allow" : _l(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
5437
5452
  }
5438
5453
  function Sl(e) {
5439
- return bl(e) === "warn";
5454
+ return xl(e) === "block";
5440
5455
  }
5441
5456
  function Cl(e) {
5442
- if (!xl(e)) return null;
5443
- let t = yl(e);
5457
+ return xl(e) === "warn";
5458
+ }
5459
+ function wl(e) {
5460
+ if (!Sl(e)) return null;
5461
+ let t = bl(e);
5444
5462
  return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
5445
5463
  }
5446
- function wl(e, t = {}) {
5464
+ function Tl(e, t = {}) {
5447
5465
  let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
5448
5466
  for (let t of [n, r]) {
5449
5467
  let n = e?.[t];
@@ -5453,50 +5471,50 @@ function wl(e, t = {}) {
5453
5471
  }
5454
5472
  return null;
5455
5473
  }
5456
- function Tl(e, t = {}) {
5474
+ function El(e, t = {}) {
5457
5475
  let n = t.inProgressField ?? "currentStudyingHere";
5458
5476
  return !!e?.[n];
5459
5477
  }
5460
- function El(e = [], t = {}) {
5478
+ function Dl(e = [], t = {}) {
5461
5479
  let n = (t.direction ?? "desc") === "desc";
5462
5480
  return e.map((e, n) => ({
5463
5481
  index: n,
5464
- key: wl(e, t),
5465
- ongoing: t.inProgressFirst !== !1 && Tl(e, t)
5482
+ key: Tl(e, t),
5483
+ ongoing: t.inProgressFirst !== !1 && El(e, t)
5466
5484
  })).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);
5467
5485
  }
5468
- function Dl(e, t, n = {}) {
5486
+ function Ol(e, t, n = {}) {
5469
5487
  if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
5470
- let r = El(e, n).indexOf(t);
5488
+ let r = Dl(e, n).indexOf(t);
5471
5489
  return r === -1 || r === t ? null : {
5472
5490
  from: t,
5473
5491
  to: r,
5474
- reason: Tl(e[t], n) ? "inProgress" : "outOfOrder"
5492
+ reason: El(e[t], n) ? "inProgress" : "outOfOrder"
5475
5493
  };
5476
5494
  }
5477
- var Ol = Object.freeze({
5495
+ var kl = Object.freeze({
5478
5496
  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.",
5479
5497
  outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
5480
5498
  ok: "Yes, move it up",
5481
5499
  keep: "No, leave it here"
5482
5500
  });
5483
- function kl(e, t = {}) {
5501
+ function Al(e, t = {}) {
5484
5502
  let n = {
5485
- ...Ol,
5503
+ ...kl,
5486
5504
  ...t.messages ?? {}
5487
5505
  };
5488
5506
  return n[e] ?? n.outOfOrder;
5489
5507
  }
5490
- function Al(e, t = {}) {
5491
- let n = t.levelField ?? "qualification", r = gl(e?.[n]);
5508
+ function jl(e, t = {}) {
5509
+ let n = t.levelField ?? "qualification", r = _l(e?.[n]);
5492
5510
  if (!r) return null;
5493
5511
  let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
5494
- return Number.isFinite(Number(a)) ? Number(a) : jl(r, t);
5512
+ return Number.isFinite(Number(a)) ? Number(a) : Ml(r, t);
5495
5513
  }
5496
- function jl(e, t) {
5514
+ function Ml(e, t) {
5497
5515
  let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
5498
5516
  for (let e of n) {
5499
- let t = gl(e?.match);
5517
+ let t = _l(e?.match);
5500
5518
  if (!t) continue;
5501
5519
  let n;
5502
5520
  try {
@@ -5508,14 +5526,14 @@ function jl(e, t) {
5508
5526
  }
5509
5527
  return null;
5510
5528
  }
5511
- function Ml(e, t = {}) {
5512
- return gl((t?.levelLabels ?? {})[e]) || gl(e);
5529
+ function Nl(e, t = {}) {
5530
+ return _l((t?.levelLabels ?? {})[e]) || _l(e);
5513
5531
  }
5514
- function Nl(e = [], t = {}) {
5532
+ function Pl(e = [], t = {}) {
5515
5533
  if (!t || t.requireBelow === !1) return [];
5516
5534
  let n = t.levels ?? {}, r = t.requiredLevels ?? [];
5517
5535
  if (!r.length) return [];
5518
- let i = e.map((e) => Al(e, t)).filter((e) => e !== null);
5536
+ let i = e.map((e) => jl(e, t)).filter((e) => e !== null);
5519
5537
  if (!i.length) return [];
5520
5538
  let a = Math.max(...i), o = [];
5521
5539
  return r.forEach((e) => {
@@ -5523,43 +5541,43 @@ function Nl(e = [], t = {}) {
5523
5541
  Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
5524
5542
  }), o;
5525
5543
  }
5526
- function Pl(e, t = {}) {
5527
- let n = Nl(e, t);
5544
+ function Fl(e, t = {}) {
5545
+ let n = Pl(e, t);
5528
5546
  if (!n.length) return "";
5529
- let r = n.map((e) => Ml(e, t)).join(", ");
5547
+ let r = n.map((e) => Nl(e, t)).join(", ");
5530
5548
  return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
5531
5549
  }
5532
- async function Fl({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
5550
+ async function Il({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
5533
5551
  let a = e?.orderBy;
5534
5552
  if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
5535
- let o = Dl(t, n, a);
5553
+ let o = Ol(t, n, a);
5536
5554
  if (!o) return !1;
5537
5555
  let s = {
5538
- ...Ol,
5556
+ ...kl,
5539
5557
  ...a.messages ?? {}
5540
5558
  };
5541
5559
  return await i({
5542
5560
  reason: o.reason,
5543
5561
  title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
5544
- body: kl(o.reason, a),
5562
+ body: Al(o.reason, a),
5545
5563
  okText: s.ok,
5546
5564
  cancelText: s.keep,
5547
5565
  from: o.from,
5548
5566
  to: o.to
5549
5567
  }) ? (r(o.from, o.to), !0) : !1;
5550
5568
  }
5551
- function Il(e, t) {
5552
- let n = _l(e, t), r = n?.orderBy?.inProgressField;
5569
+ function Ll(e, t) {
5570
+ let n = vl(e, t), r = n?.orderBy?.inProgressField;
5553
5571
  return r ? {
5554
5572
  name: n.name,
5555
5573
  label: n.label ?? n.name,
5556
5574
  rowsKey: n.payloadKey || n.name,
5557
5575
  inProgressField: r,
5558
- severity: bl(n),
5559
- message: yl(n)
5576
+ severity: xl(n),
5577
+ message: bl(n)
5560
5578
  } : null;
5561
5579
  }
5562
- function Ll(e = [], t, n) {
5580
+ function Rl(e = [], t, n) {
5563
5581
  if (!n) return {
5564
5582
  severity: "allow",
5565
5583
  message: "",
@@ -5567,8 +5585,8 @@ function Ll(e = [], t, n) {
5567
5585
  };
5568
5586
  let r = null;
5569
5587
  for (let i of e) {
5570
- let e = Il(i, t);
5571
- if (!(!e || e.severity === "allow") && Rl(n, e.rowsKey).some((t) => Tl(t, e))) {
5588
+ let e = Ll(i, t);
5589
+ if (!(!e || e.severity === "allow") && zl(n, e.rowsKey).some((t) => El(t, e))) {
5572
5590
  if (e.severity === "block") return {
5573
5591
  severity: "block",
5574
5592
  message: e.message,
@@ -5587,23 +5605,23 @@ function Ll(e = [], t, n) {
5587
5605
  group: null
5588
5606
  };
5589
5607
  }
5590
- function Rl(e, t) {
5608
+ function zl(e, t) {
5591
5609
  let n = e?.[t];
5592
5610
  return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
5593
5611
  }
5594
- function zl(e) {
5612
+ function Bl(e) {
5595
5613
  return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
5596
5614
  }
5597
- function Bl(e = [], t = {}) {
5615
+ function Vl(e = [], t = {}) {
5598
5616
  let n = null;
5599
5617
  for (let r of e) {
5600
5618
  let e = r?.levelRule;
5601
5619
  if (!e) continue;
5602
- let i = Vl(t, r);
5620
+ let i = Hl(t, r);
5603
5621
  if (!i.length) continue;
5604
- let a = Pl(i, e);
5622
+ let a = Fl(i, e);
5605
5623
  if (a) {
5606
- if (zl(e) === "block") return {
5624
+ if (Bl(e) === "block") return {
5607
5625
  severity: "block",
5608
5626
  message: a,
5609
5627
  group: r
@@ -5621,7 +5639,7 @@ function Bl(e = [], t = {}) {
5621
5639
  group: null
5622
5640
  };
5623
5641
  }
5624
- function Vl(e, t) {
5642
+ function Hl(e, t) {
5625
5643
  for (let n of [t?.name, t?.payloadKey]) {
5626
5644
  if (!n) continue;
5627
5645
  let t = e?.[n];
@@ -5631,10 +5649,10 @@ function Vl(e, t) {
5631
5649
  }
5632
5650
  //#endregion
5633
5651
  //#region src/components/form/clearGroupOnChange.js
5634
- function Hl(e, t) {
5652
+ function Ul(e, t) {
5635
5653
  return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
5636
5654
  }
5637
- function Ul(e, t) {
5655
+ function Wl(e, t) {
5638
5656
  let n = e?.field, r = [];
5639
5657
  e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
5640
5658
  e && e !== n && r.push(e);
@@ -5644,24 +5662,24 @@ function Ul(e, t) {
5644
5662
  e && e !== n && r.push(e);
5645
5663
  }) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
5646
5664
  }
5647
- function Wl(e, t, n, r) {
5648
- let i = Ul(t, r).map((e) => Hl(n, e));
5665
+ function Gl(e, t, n, r) {
5666
+ let i = Wl(t, r).map((e) => Ul(n, e));
5649
5667
  return i.forEach((t) => e.setFieldValue(t, null)), i;
5650
5668
  }
5651
5669
  //#endregion
5652
5670
  //#region src/components/form/resolveStoredOptions.js
5653
- function Gl(e) {
5671
+ function Kl(e) {
5654
5672
  return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
5655
5673
  }
5656
- function Kl(e, t = []) {
5674
+ function ql(e, t = []) {
5657
5675
  let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
5658
- for (let t of Gl(e)) {
5676
+ for (let t of Kl(e)) {
5659
5677
  let e = String(t);
5660
5678
  !n.has(e) && !r.includes(e) && r.push(e);
5661
5679
  }
5662
5680
  return r;
5663
5681
  }
5664
- async function ql(e, t) {
5682
+ async function Jl(e, t) {
5665
5683
  if (!e?.lookupCollection || !t?.length) return [];
5666
5684
  let n = new URLSearchParams({
5667
5685
  collection: e.lookupCollection,
@@ -5673,7 +5691,7 @@ async function ql(e, t) {
5673
5691
  let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
5674
5692
  return Array.isArray(i) ? i : [];
5675
5693
  }
5676
- function Jl(e = [], t = []) {
5694
+ function Yl(e = [], t = []) {
5677
5695
  if (!t.length) return e;
5678
5696
  let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
5679
5697
  ...e,
@@ -5683,8 +5701,8 @@ function Jl(e = [], t = []) {
5683
5701
  }
5684
5702
  //#endregion
5685
5703
  //#region src/components/form/dateRules.js
5686
- var Yl = (e) => e == null || e === "";
5687
- function Xl(e) {
5704
+ var Xl = (e) => e == null || e === "";
5705
+ function Zl(e) {
5688
5706
  if (!e) return null;
5689
5707
  if (typeof e.valueOf == "function") {
5690
5708
  let t = e.valueOf();
@@ -5698,12 +5716,12 @@ function $(e) {
5698
5716
  let t = E(e);
5699
5717
  return t.isValid() ? t.startOf("day").valueOf() : null;
5700
5718
  }
5701
- function Zl(e) {
5719
+ function Ql(e) {
5702
5720
  if (!e) return null;
5703
5721
  let t = E(e);
5704
5722
  return t.isValid() ? t.hour() * 60 + t.minute() : null;
5705
5723
  }
5706
- var Ql = {
5724
+ var $l = {
5707
5725
  d: "day",
5708
5726
  day: "day",
5709
5727
  days: "day",
@@ -5719,13 +5737,13 @@ var Ql = {
5719
5737
  year: "year",
5720
5738
  years: "year"
5721
5739
  };
5722
- function $l(e) {
5740
+ function eu(e) {
5723
5741
  if (e == null || e === "") return null;
5724
5742
  if (typeof e == "object" && !Array.isArray(e)) {
5725
5743
  let t = Number(e.value ?? e.count ?? e.amount);
5726
5744
  return !Number.isFinite(t) || t <= 0 ? null : {
5727
5745
  value: t,
5728
- unit: Ql[String(e.unit ?? "month").toLowerCase()] ?? "month"
5746
+ unit: $l[String(e.unit ?? "month").toLowerCase()] ?? "month"
5729
5747
  };
5730
5748
  }
5731
5749
  let t = String(e).trim().toLowerCase();
@@ -5735,49 +5753,49 @@ function $l(e) {
5735
5753
  let r = Number(n[1]);
5736
5754
  return !Number.isFinite(r) || r <= 0 ? null : {
5737
5755
  value: r,
5738
- unit: Ql[n[2]] ?? "month"
5756
+ unit: $l[n[2]] ?? "month"
5739
5757
  };
5740
5758
  }
5741
- function eu(e, t) {
5759
+ function tu(e, t) {
5742
5760
  let n = e?.minGapFrom ?? e?.gapFrom;
5743
5761
  if (n && typeof t == "function") {
5744
- let e = $l(t(n));
5762
+ let e = eu(t(n));
5745
5763
  if (e) return e;
5746
5764
  }
5747
- return $l(e?.minGap);
5765
+ return eu(e?.minGap);
5748
5766
  }
5749
- function tu(e, t, n, r) {
5767
+ function nu(e, t, n, r) {
5750
5768
  if (t === null) return null;
5751
- let i = eu(n, r), a = E(t);
5769
+ let i = tu(n, r), a = E(t);
5752
5770
  return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
5753
5771
  }
5754
- function nu(e, t, n, r, i) {
5772
+ function ru(e, t, n, r, i) {
5755
5773
  if (t === null || n === null) return !1;
5756
- let a = tu(e, n, r, i);
5774
+ let a = nu(e, n, r, i);
5757
5775
  if (a === null) return !1;
5758
- let o = !!r?.strict && !eu(r, i);
5776
+ let o = !!r?.strict && !tu(r, i);
5759
5777
  return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
5760
5778
  }
5761
- function ru(e, t, n, r) {
5779
+ function iu(e, t, n, r) {
5762
5780
  if (n?.message) return n.message;
5763
- let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = eu(n, r);
5781
+ let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = tu(n, r);
5764
5782
  if (a) {
5765
5783
  let n = a.value === 1 ? a.unit : `${a.unit}s`;
5766
5784
  return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
5767
5785
  }
5768
5786
  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}`;
5769
5787
  }
5770
- function iu({ type: e, label: t, rule: n, readSibling: r }) {
5788
+ function au({ type: e, label: t, rule: n, readSibling: r }) {
5771
5789
  return { validator: async (i, a) => {
5772
5790
  let o = n?.value ?? n?.compareField ?? n?.field;
5773
- if (!o || Yl(a)) return Promise.resolve();
5791
+ if (!o || Xl(a)) return Promise.resolve();
5774
5792
  let s = r(o);
5775
- if (Yl(s)) return Promise.resolve();
5793
+ if (Xl(s)) return Promise.resolve();
5776
5794
  let c = $(a), l = $(s);
5777
- return c === null || l === null ? Promise.resolve() : nu(e, c, l, n, r) ? Promise.reject(Error(ru(e, t, n, r))) : Promise.resolve();
5795
+ return c === null || l === null ? Promise.resolve() : ru(e, c, l, n, r) ? Promise.reject(Error(iu(e, t, n, r))) : Promise.resolve();
5778
5796
  } };
5779
5797
  }
5780
- function au(e, t, { rows: n, rowIndex: r } = {}) {
5798
+ function ou(e, t, { rows: n, rowIndex: r } = {}) {
5781
5799
  if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
5782
5800
  let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
5783
5801
  if (o) {
@@ -5791,11 +5809,11 @@ function au(e, t, { rows: n, rowIndex: r } = {}) {
5791
5809
  }
5792
5810
  return !1;
5793
5811
  }
5794
- function ou(e, t = "above") {
5812
+ function su(e, t = "above") {
5795
5813
  let n = e?.messages ?? {};
5796
5814
  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.";
5797
5815
  }
5798
- function su({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = rr }) {
5816
+ function cu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = rr }) {
5799
5817
  let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
5800
5818
  for (let e of a) {
5801
5819
  let n = typeof e == "string" ? { type: e } : e, r = n?.type;
@@ -5809,16 +5827,16 @@ function su({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = rr }) {
5809
5827
  o.push((i) => {
5810
5828
  if (!i) return !1;
5811
5829
  let a = t(e);
5812
- return !Yl(a) && nu(r, $(i), $(a), n, t);
5830
+ return !Xl(a) && ru(r, $(i), $(a), n, t);
5813
5831
  });
5814
5832
  }
5815
5833
  }
5816
- return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? au($(t), e.rowHierarchy, {
5834
+ return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? ou($(t), e.rowHierarchy, {
5817
5835
  rows: n,
5818
5836
  rowIndex: r
5819
5837
  }) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
5820
5838
  }
5821
- function cu(e, t = rr) {
5839
+ function lu(e, t = rr) {
5822
5840
  let n = e?.validations ?? e?.validation ?? e?.rules ?? [];
5823
5841
  for (let e of n) {
5824
5842
  let n = typeof e == "string" ? { type: e } : e;
@@ -5826,44 +5844,44 @@ function cu(e, t = rr) {
5826
5844
  if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
5827
5845
  }
5828
5846
  }
5829
- function lu({ field: e, rows: t, rowIndex: n }) {
5847
+ function uu({ field: e, rows: t, rowIndex: n }) {
5830
5848
  let r = e?.rowHierarchy;
5831
5849
  return { validator: async (e, i) => {
5832
- if (!r || Yl(i) || !Array.isArray(t) || n == null) return Promise.resolve();
5850
+ if (!r || Xl(i) || !Array.isArray(t) || n == null) return Promise.resolve();
5833
5851
  let a = $(i);
5834
- if (a === null || !au(a, r, {
5852
+ if (a === null || !ou(a, r, {
5835
5853
  rows: t,
5836
5854
  rowIndex: n
5837
5855
  })) return Promise.resolve();
5838
5856
  let o = r.startField ?? "startDate", s = t[n - 1], c = s ? $(s[o]) : null, l = c !== null && a >= c ? "above" : "below";
5839
- return Promise.reject(Error(ou(r, l)));
5857
+ return Promise.reject(Error(su(r, l)));
5840
5858
  } };
5841
5859
  }
5842
5860
  //#endregion
5843
5861
  //#region src/utils/submitMessages.js
5844
- function uu(e) {
5862
+ function du(e) {
5845
5863
  return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
5846
5864
  }
5847
- function du(e) {
5865
+ function fu(e) {
5848
5866
  let t = String(e ?? "").trim();
5849
5867
  return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
5850
5868
  }
5851
- function fu(e, t) {
5852
- return String(e).replaceAll("${module}", du(t)).replaceAll("${moduleName}", du(t));
5869
+ function pu(e, t) {
5870
+ return String(e).replaceAll("${module}", fu(t)).replaceAll("${moduleName}", fu(t));
5853
5871
  }
5854
- function pu(e, t, n) {
5855
- let r = uu(e);
5872
+ function mu(e, t, n) {
5873
+ let r = du(e);
5856
5874
  if (r?.suppress) return null;
5857
5875
  let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
5858
- return i && String(i).trim() ? fu(i, t) : n === "edit" ? `${du(t)} has Updated successfully` : `${du(t)} has added successfully`;
5876
+ return i && String(i).trim() ? pu(i, t) : n === "edit" ? `${fu(t)} has Updated successfully` : `${fu(t)} has added successfully`;
5859
5877
  }
5860
- function mu(e, t, n, r) {
5861
- let i = uu(e), a = n === "edit" ? i?.editError : i?.addError;
5862
- return a && String(a).trim() ? fu(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${du(t)}` : `Failed to create ${du(t)}`;
5878
+ function hu(e, t, n, r) {
5879
+ let i = du(e), a = n === "edit" ? i?.editError : i?.addError;
5880
+ return a && String(a).trim() ? pu(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${fu(t)}` : `Failed to create ${fu(t)}`;
5863
5881
  }
5864
5882
  //#endregion
5865
5883
  //#region src/utils/scrollToFirstFormError.js
5866
- function hu({ errorFields: e } = {}, t, { root: n = document } = {}) {
5884
+ function gu({ errorFields: e } = {}, t, { root: n = document } = {}) {
5867
5885
  if (!e?.length) return;
5868
5886
  let r = e[0]?.name;
5869
5887
  setTimeout(() => {
@@ -5888,10 +5906,10 @@ function hu({ errorFields: e } = {}, t, { root: n = document } = {}) {
5888
5906
  }
5889
5907
  //#endregion
5890
5908
  //#region src/components/form/conditionalFieldLabel.js
5891
- function gu(e) {
5909
+ function _u(e) {
5892
5910
  return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
5893
5911
  }
5894
- function _u(e, t) {
5912
+ function vu(e, t) {
5895
5913
  if (!e?.field) return !1;
5896
5914
  switch (e.operator ?? "eq") {
5897
5915
  case "eq": return String(t ?? "") === String(e.value ?? "");
@@ -5899,38 +5917,38 @@ function _u(e, t) {
5899
5917
  case "truthy": return t != null && t !== "" && t !== !1;
5900
5918
  case "falsy": return t == null || t === "" || t === !1;
5901
5919
  case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
5902
- case "in": return gu(e.value).includes(String(t ?? ""));
5903
- case "notIn": return !gu(e.value).includes(String(t ?? ""));
5920
+ case "in": return _u(e.value).includes(String(t ?? ""));
5921
+ case "notIn": return !_u(e.value).includes(String(t ?? ""));
5904
5922
  default: return !1;
5905
5923
  }
5906
5924
  }
5907
- function vu(e, t, n = !1) {
5925
+ function yu(e, t, n = !1) {
5908
5926
  let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
5909
- return _u(i, t) && i?.label ? i.label : r;
5927
+ return vu(i, t) && i?.label ? i.label : r;
5910
5928
  }
5911
- function yu(e) {
5929
+ function bu(e) {
5912
5930
  return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
5913
5931
  }
5914
- function bu(e, t) {
5915
- let n = yu(e);
5932
+ function xu(e, t) {
5933
+ let n = bu(e);
5916
5934
  if (!n.length) return !0;
5917
- let r = n.map((e) => _u(e, t(e.field)));
5935
+ let r = n.map((e) => vu(e, t(e.field)));
5918
5936
  return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
5919
5937
  }
5920
- function xu(e) {
5938
+ function Su(e) {
5921
5939
  let t = e?.colWhen;
5922
5940
  return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
5923
5941
  }
5924
- function Su(e, t, n) {
5925
- for (let t of xu(e)) if (_u(t, n(t))) return Number(t.col);
5942
+ function Cu(e, t, n) {
5943
+ for (let t of Su(e)) if (vu(t, n(t))) return Number(t.col);
5926
5944
  return t;
5927
5945
  }
5928
- function Cu(e, t) {
5946
+ function wu(e, t) {
5929
5947
  return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
5930
5948
  }
5931
5949
  //#endregion
5932
5950
  //#region src/components/Breadcrumb.jsx
5933
- function wu({ items: e = [] }) {
5951
+ function Tu({ items: e = [] }) {
5934
5952
  let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(kr, {
5935
5953
  variant: "body",
5936
5954
  weight: "medium",
@@ -5947,6 +5965,6 @@ function wu({ items: e = [] }) {
5947
5965
  return /* @__PURE__ */ w(_, { items: t });
5948
5966
  }
5949
5967
  //#endregion
5950
- export { Mc as $, at as $n, xt as $r, Ra as $t, _l as A, ar as An, an as Ar, Vo as At, el as B, P as Bn, Tn as Br, ho as Bt, Il as C, ni as Cn, Dn as Cr, ds as Ct, Ll as D, L as Dn, wt as Dr, as as Dt, yl as E, kr as En, Zt as Er, os as Et, cl as F, fr as Fn, He as Fr, go as Ft, Ic as G, kt as Gn, zt as Gr, no as Gt, Bc as H, qn as Hn, Kt as Hr, ao as Ht, ul as I, or as In, Je as Ir, vo as It, Oc as J, vn as Jn, Bt as Jr, Qa as Jt, Rc as K, rt as Kn, Cn as Kr, q as Kt, il as L, Wn as Ln, sn as Lr, Oo as Lt, dl as M, F as Mn, _n as Mr, Po as Mt, fl as N, hr as Nn, pn as Nr, J as Nt, Bl as O, I as On, Ct as Or, rs as Ot, ll as P, ir as Pn, Rn as Pr, _o as Pt, kc as Q, Pn as Qn, _t as Qr, K as Qt, sl as R, Qn as Rn, At as Rr, jo as Rt, Cl as S, ln as Si, ri as Sn, dn as Sr, cs as St, xl as T, Fr as Tn, pt as Tr, ss as Tt, Uc as U, Xn as Un, M as Ur, eo as Ut, $c as V, $n as Vn, Hn as Vr, io as Vt, Fc as W, st as Wn, Rt as Wr, to as Wt, Ac as X, zn as Xn, Ue as Xr, Sa as Xt, Dc as Y, mn as Yn, en as Yr, Ga as Yt, jc as Z, tn as Zn, ot as Zr, V as Zt, Zl as _, wn as _i, vi as _n, fn as _r, Es as _t, vu as a, Un as ai, ia as an, Vn as ar, vc as at, Kl as b, Jt as bi, di as bn, bt as br, Ss as bt, yu as c, Xt as ci, Mi as cn, In as cr, ec as ct, pu as d, kn as di, Di as dn, tt as dr, Ws as dt, ut as ei, Za as en, vt as er, wc as et, su as f, yn as fi, xi as fn, et as fr, Gs as ft, Xl as g, Ut as gi, Ci as gn, Yt as gr, Ms as gt, cu as h, nn as hi, Si as hn, Ft as hr, Ns as ht, _u as i, cn as ii, na as in, gn as ir, yc as it, hl as j, cr as jn, on as jr, Bo as jt, Fl as k, rr as kn, Ot as kr, is as kt, hu as l, Dt as li, Ai as ln, dt as lr, Xs as lt, lu as m, Bn as mi, Oi as mn, Mt as mr, zs as mt, xu as n, Tt as ni, ja as nn, Et as nr, xc as nt, bu as o, We as oi, Ji as on, rn as or, _c as ot, iu as p, hn as pi, bi as pn, gt as pr, Ls as pt, Nc as q, On as qn, Nn as qr, Ka as qt, Cu as r, Ke as ri, Qi as rn, bn as rr, bc as rt, Su as s, qt as si, ji as sn, Ge as sr, hc as st, wu as t, mt as ti, Ma as tn, An as tr, Sc as tt, mu as u, it as ui, ki as un, $t as ur, qs as ut, ql as v, Fn as vi, _i as vn, un as vr, Ts as vt, vl as w, ti as wn, lt as wr, us as wt, Wl as x, Qt as xi, fi as xn, St as xr, js as xt, Jl as y, It as yi, ui as yn, qe as yr, gs as yt, rl as z, Zn as zn, nt as zr, uo as zt };
5968
+ export { Nc as $, at as $n, xt as $r, Ra as $t, vl as A, ar as An, an as Ar, Ho as At, tl as B, P as Bn, Tn as Br, go as Bt, Ll as C, ni as Cn, Dn as Cr, fs as Ct, Rl as D, L as Dn, wt as Dr, os as Dt, bl as E, kr as En, Zt as Er, ss as Et, ll as F, fr as Fn, He as Fr, _o as Ft, Lc as G, kt as Gn, zt as Gr, ro as Gt, Vc as H, qn as Hn, Kt as Hr, oo as Ht, dl as I, or as In, Je as Ir, yo as It, kc as J, vn as Jn, Bt as Jr, $a as Jt, zc as K, rt as Kn, Cn as Kr, q as Kt, al as L, Wn as Ln, sn as Lr, ko as Lt, fl as M, F as Mn, _n as Mr, Fo as Mt, pl as N, hr as Nn, pn as Nr, J as Nt, Vl as O, I as On, Ct as Or, is as Ot, ul as P, ir as Pn, Rn as Pr, vo as Pt, Ac as Q, Pn as Qn, _t as Qr, K as Qt, cl as R, Qn as Rn, At as Rr, Mo as Rt, wl as S, ln as Si, ri as Sn, dn as Sr, ls as St, Sl as T, Fr as Tn, pt as Tr, cs as Tt, Wc as U, Xn as Un, M as Ur, to as Ut, el as V, $n as Vn, Hn as Vr, ao as Vt, Ic as W, st as Wn, Rt as Wr, no as Wt, jc as X, zn as Xn, Ue as Xr, Sa as Xt, Oc as Y, mn as Yn, en as Yr, Ka as Yt, Mc as Z, tn as Zn, ot as Zr, V as Zt, Ql as _, wn as _i, vi as _n, fn as _r, Ds as _t, yu as a, Un as ai, ia as an, Vn as ar, yc as at, ql as b, Jt as bi, di as bn, bt as br, Cs as bt, bu as c, Xt as ci, Mi as cn, In as cr, tc as ct, mu as d, kn as di, Di as dn, tt as dr, Gs as dt, ut as ei, Qa as en, vt as er, Tc as et, cu as f, yn as fi, xi as fn, et as fr, Ks as ft, Zl as g, Ut as gi, Ci as gn, Yt as gr, Ns as gt, lu as h, nn as hi, Si as hn, Ft as hr, Ps as ht, vu as i, cn as ii, na as in, gn as ir, bc as it, gl as j, cr as jn, on as jr, Vo as jt, Il as k, rr as kn, Ot as kr, as as kt, gu as l, Dt as li, Ai as ln, dt as lr, Zs as lt, uu as m, Bn as mi, Oi as mn, Mt as mr, Bs as mt, Su as n, Tt as ni, ja as nn, Et as nr, Sc as nt, xu as o, We as oi, Ji as on, rn as or, vc as ot, au as p, hn as pi, bi as pn, gt as pr, Rs as pt, Pc as q, On as qn, Nn as qr, qa as qt, wu as r, Ke as ri, Qi as rn, bn as rr, xc as rt, Cu as s, qt as si, ji as sn, Ge as sr, gc as st, Tu as t, mt as ti, Ma as tn, An as tr, Cc as tt, hu as u, it as ui, ki as un, $t as ur, Js as ut, Jl as v, Fn as vi, _i as vn, un as vr, Es as vt, yl as w, ti as wn, lt as wr, ds as wt, Gl as x, Qt as xi, fi as xn, St as xr, Ms as xt, Yl as y, It as yi, ui as yn, qe as yr, _s as yt, il as z, Zn as zn, nt as zr, fo as zt };
5951
5969
 
5952
- //# sourceMappingURL=Breadcrumb-CNUQe0GE.js.map
5970
+ //# sourceMappingURL=Breadcrumb-KBlZwXLK.js.map