@webority/ui-react 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui-react.js CHANGED
@@ -8,9 +8,9 @@ import h from "react-bootstrap/Form";
8
8
  import { createPortal as g } from "react-dom";
9
9
  import _ from "react-bootstrap/Modal";
10
10
  import v from "react-bootstrap/Dropdown";
11
- import { toast as y } from "react-toastify";
12
- import b from "react-bootstrap/Offcanvas";
13
- import x from "react-bootstrap/Nav";
11
+ import y from "react-bootstrap/Offcanvas";
12
+ import b from "react-bootstrap/Nav";
13
+ import { toast as x } from "react-toastify";
14
14
  //#region src/components/warnUnknownProps.js
15
15
  var S = /* @__PURE__ */ new Set(/* @__PURE__ */ "id.title.role.style.className.class.tabIndex.lang.dir.hidden.slot.part.draggable.spellCheck.translate.inert.popover.name.type.value.defaultValue.checked.defaultChecked.placeholder.disabled.readOnly.required.autoFocus.autoComplete.form.formAction.formMethod.formNoValidate.formTarget.min.max.step.minLength.maxLength.pattern.multiple.accept.capture.rows.cols.wrap.list.htmlFor.inputMode.enterKeyHint.href.target.rel.download.ping.referrerPolicy.src.srcSet.alt.width.height.loading.decoding.sizes.crossOrigin.useMap.colSpan.rowSpan.headers.scope.span.key.ref.children.dangerouslySetInnerHTML.suppressHydrationWarning".split(".")), C = () => {
16
16
  try {
@@ -36,15 +36,20 @@ var D = {
36
36
  "arrow-right": "arrow-right",
37
37
  "rotate-ccw": "arrow-counterclockwise",
38
38
  "arrow-up-right": "arrow-up-right",
39
+ "arrow-down-up": "arrow-down-up",
39
40
  "badge-check": "patch-check",
40
41
  bell: "bell",
42
+ "box-seam": "box-seam",
41
43
  briefcase: "briefcase",
44
+ bug: "bug",
42
45
  building: "building",
43
46
  "building-2": "buildings",
47
+ bullseye: "bullseye",
44
48
  calculator: "calculator",
45
49
  calendar: "calendar",
46
50
  "calendar-check": "calendar-check",
47
51
  "calendar-dots": "calendar3",
52
+ "cash-stack": "cash-stack",
48
53
  "chart-column": "bar-chart",
49
54
  check: "check-lg",
50
55
  "check-check": "check-all",
@@ -55,12 +60,17 @@ var D = {
55
60
  circle: "circle-fill",
56
61
  "circle-help": "question-circle",
57
62
  "clipboard-check": "clipboard-check",
63
+ clock: "clock",
64
+ cloud: "cloud",
58
65
  coins: "coin",
59
66
  contact: "person-vcard",
60
67
  copy: "copy",
61
68
  "credit-card": "credit-card",
69
+ "diagram-3": "diagram-3",
70
+ display: "display",
62
71
  download: "download",
63
72
  edit: "pencil-square",
73
+ "emoji-smile": "emoji-smile",
64
74
  "external-link": "box-arrow-up-right",
65
75
  eye: "eye",
66
76
  "eye-off": "eye-slash",
@@ -73,10 +83,13 @@ var D = {
73
83
  gauge: "speedometer2",
74
84
  gift: "gift",
75
85
  globe: "globe2",
86
+ globe2: "globe2",
87
+ grid: "grid",
76
88
  history: "clock-history",
77
89
  house: "house",
78
90
  image: "image",
79
91
  info: "info-circle",
92
+ key: "key",
80
93
  "layout-dashboard": "grid-1x2",
81
94
  "layout-grid": "grid-3x3-gap",
82
95
  lightbulb: "lightbulb",
@@ -102,6 +115,7 @@ var D = {
102
115
  "zoom-out": "zoom-out",
103
116
  "two-page": "layout-split",
104
117
  "plus-circle": "plus-circle",
118
+ receipt: "receipt",
105
119
  "refresh-cw": "arrow-clockwise",
106
120
  repeat: "arrow-repeat",
107
121
  search: "search",
@@ -111,9 +125,13 @@ var D = {
111
125
  "share-2": "share",
112
126
  shield: "shield",
113
127
  "shield-check": "shield-check",
128
+ "shield-lock": "shield-lock",
114
129
  "shield-plus": "shield-plus",
130
+ shop: "shop",
115
131
  sparkles: "stars",
132
+ stars: "stars",
116
133
  sun: "sun",
134
+ telephone: "telephone",
117
135
  "trash-2": "trash",
118
136
  "trending-up": "graph-up-arrow",
119
137
  triangle: "triangle",
@@ -123,6 +141,7 @@ var D = {
123
141
  "user-minus": "person-dash",
124
142
  "user-plus": "person-plus",
125
143
  users: "people",
144
+ wallet2: "wallet2",
126
145
  "wand-sparkles": "magic",
127
146
  x: "x-lg",
128
147
  zap: "lightning-charge"
@@ -287,26 +306,26 @@ function I(e, t) {
287
306
  function L(e) {
288
307
  e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchor, !0), e._reanchor = null);
289
308
  }
290
- var te = "data-wui-mirror";
291
- function R(e, t) {
292
- let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${te}]`);
309
+ var R = "data-wui-mirror";
310
+ function z(e, t) {
311
+ let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${R}]`);
293
312
  if (!n) {
294
313
  r?.remove();
295
314
  return;
296
315
  }
297
- r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(te, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
316
+ r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(R, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
298
317
  for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
299
318
  r.disabled = e.hasAttribute("disabled");
300
319
  }
301
- var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), ne = (e) => {
320
+ var B = Symbol("wui.trustedHtml"), V = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), te = (e) => {
302
321
  if (!e) return "";
303
322
  let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
304
323
  return t ? `<i class="bi bi-${t}" aria-hidden="true"></i>` : "";
305
- }, V = (e) => {
324
+ }, H = (e) => {
306
325
  if (e == null) return "";
307
- let t = e[z] ? String(e.label ?? "") : B(e.label), n = ne(e.icon);
326
+ let t = e[B] ? String(e.label ?? "") : V(e.label), n = te(e.icon);
308
327
  return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
309
- }, re = class extends HTMLElement {
328
+ }, ne = class extends HTMLElement {
310
329
  _accessibleName() {
311
330
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
312
331
  }
@@ -335,14 +354,14 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
335
354
  return this._value;
336
355
  }
337
356
  set value(e) {
338
- this._value = e == null ? "" : String(e), R(this, this._value);
357
+ this._value = e == null ? "" : String(e), z(this, this._value);
339
358
  let t = this._readOptions().find((e) => String(e.value) === this._value);
340
- this._label = t ? ae(t.label) : "", this._syncInput(), this._renderOptions("");
359
+ this._label = t ? U(t.label) : "", this._syncInput(), this._renderOptions("");
341
360
  }
342
361
  set options(e) {
343
362
  this._optionsProp = Array.isArray(e) ? e : [];
344
363
  let t = this._readOptions().find((e) => String(e.value) === this._value);
345
- t && (this._label = ae(t.label)), this._renderOptions(), this._syncInput();
364
+ t && (this._label = U(t.label)), this._renderOptions(), this._syncInput();
346
365
  }
347
366
  get options() {
348
367
  return this._readOptions();
@@ -372,7 +391,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
372
391
  value: e.getAttribute("value") ?? e.textContent.trim(),
373
392
  label: e.innerHTML,
374
393
  icon: e.getAttribute("icon") || void 0,
375
- [z]: !0,
394
+ [B]: !0,
376
395
  selected: e.hasAttribute("selected")
377
396
  })));
378
397
  }
@@ -384,8 +403,8 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
384
403
  let e = this.getAttribute("placeholder") || "Search…", t = this.getAttribute("size"), n = t === "sm" ? " search-select-sm" : t === "lg" ? " search-select-lg" : "";
385
404
  this.innerHTML = `
386
405
  <div class="search-select${n}">
387
- <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${ie(this._accessibleName())}">
388
- <input class="search-select-input search-select-ac-input" placeholder="${ie(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
406
+ <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${re(this._accessibleName())}">
407
+ <input class="search-select-input search-select-ac-input" placeholder="${re(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
389
408
  <span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
390
409
  <button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
391
410
  </div>
@@ -394,7 +413,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
394
413
  <div class="search-select-empty" hidden>No matches</div>
395
414
  <div class="search-select-hint" hidden>Type to search…</div>
396
415
  </div>
397
- </div>`, this._rendered = !0, R(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
416
+ </div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
398
417
  }
399
418
  _refs() {
400
419
  return {
@@ -423,9 +442,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
423
442
  let t = this._refs();
424
443
  if (!t.optionsWrap) return;
425
444
  let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
426
- !this._remote && n && (r = r.filter((e) => ae(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
445
+ !this._remote && n && (r = r.filter((e) => U(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
427
446
  let t = String(e.value) === String(this._value);
428
- return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${ie(e.value)}" aria-selected="${t}">${V(e)}</button>`;
447
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${re(e.value)}" aria-selected="${t}">${H(e)}</button>`;
429
448
  }).join(""), this._active = -1;
430
449
  let i = n.length < this._minChars;
431
450
  t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
@@ -443,7 +462,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
443
462
  }, o = () => {
444
463
  e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
445
464
  }, s = (t) => {
446
- this._value = t.dataset.value, this._label = ae(t.innerHTML), R(this, this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
465
+ this._value = t.dataset.value, this._label = U(t.innerHTML), z(this, this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
447
466
  };
448
467
  e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
449
468
  let t = e.input.value;
@@ -466,7 +485,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
466
485
  let t = e.target.closest(".search-select-option");
467
486
  t && r(this._optionEls().indexOf(t));
468
487
  }), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
469
- this._value = "", this._label = "", R(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
488
+ this._value = "", this._label = "", z(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
470
489
  }), this._onDocClick = (e) => {
471
490
  i() && !this.contains(e.target) && o();
472
491
  }, document.addEventListener("click", this._onDocClick), I(this, () => {
@@ -476,7 +495,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
476
495
  disconnectedCallback() {
477
496
  this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), clearTimeout(this._timer);
478
497
  }
479
- }, ie = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), ae = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), oe = [
498
+ }, re = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), U = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ie = [
480
499
  "January",
481
500
  "February",
482
501
  "March",
@@ -489,7 +508,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
489
508
  "October",
490
509
  "November",
491
510
  "December"
492
- ], se = [
511
+ ], W = [
493
512
  "Su",
494
513
  "Mo",
495
514
  "Tu",
@@ -497,24 +516,24 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
497
516
  "Th",
498
517
  "Fr",
499
518
  "Sa"
500
- ], H = (e) => String(e).padStart(2, "0"), U = (e, t, n) => `${e}-${H(t + 1)}-${H(n)}`, W = (e) => {
519
+ ], G = (e) => String(e).padStart(2, "0"), K = (e, t, n) => `${e}-${G(t + 1)}-${G(n)}`, q = (e) => {
501
520
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
502
521
  return t ? {
503
522
  y: +t[1],
504
523
  m: t[2] - 1,
505
524
  d: +t[3]
506
525
  } : null;
507
- }, ce = (e) => {
508
- let t = W(e);
509
- return t ? `${H(t.d)} ${oe[t.m].slice(0, 3)} ${t.y}` : "";
510
- }, G = (e, t) => new Date(e, t + 1, 0).getDate(), K = (e, t) => {
526
+ }, J = (e) => {
527
+ let t = q(e);
528
+ return t ? `${G(t.d)} ${ie[t.m].slice(0, 3)} ${t.y}` : "";
529
+ }, Y = (e, t) => new Date(e, t + 1, 0).getDate(), X = (e, t) => {
511
530
  for (; t < 0;) t += 12, --e;
512
531
  for (; t > 11;) t -= 12, e += 1;
513
532
  return {
514
533
  y: e,
515
534
  m: t
516
535
  };
517
- }, le = class extends HTMLElement {
536
+ }, ae = class extends HTMLElement {
518
537
  static get observedAttributes() {
519
538
  return [
520
539
  "value",
@@ -541,7 +560,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
541
560
  return this._value;
542
561
  }
543
562
  set value(e) {
544
- this._value = e || "", R(this, this._value), this._syncTrigger(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
563
+ this._value = e || "", z(this, this._value), this._syncTrigger(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
545
564
  }
546
565
  _firstDay() {
547
566
  let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
@@ -549,29 +568,29 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
549
568
  }
550
569
  render() {
551
570
  this._value = this.getAttribute("value") || this._value;
552
- let e = this.getAttribute("placeholder") || "Enter Date", t = W(this._value);
571
+ let e = this.getAttribute("placeholder") || "Enter Date", t = q(this._value);
553
572
  t && (this._viewY = t.y, this._viewM = t.m);
554
573
  let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "";
555
574
  this.innerHTML = `
556
575
  <div class="datepicker">
557
576
  <button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
558
- <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? ce(this._value) : e}</span>
577
+ <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? J(this._value) : e}</span>
559
578
  <i class="bi bi-calendar3" aria-hidden="true"></i>
560
579
  </button>
561
580
  <div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
562
- </div>`, this._rendered = !0, R(this, this._value), this._wire();
581
+ </div>`, this._rendered = !0, z(this, this._value), this._wire();
563
582
  }
564
583
  _syncFormValue() {
565
- R(this, this._value);
584
+ z(this, this._value);
566
585
  }
567
586
  _syncTrigger() {
568
587
  let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
569
588
  if (!t) return;
570
- let n = W(this._value);
571
- t.textContent = n ? ce(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
589
+ let n = q(this._value);
590
+ t.textContent = n ? J(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
572
591
  }
573
592
  _limits() {
574
- let e = W(this.getAttribute("min")), t = W(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
593
+ let e = q(this.getAttribute("min")), t = q(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
575
594
  return {
576
595
  dayDisabled: (e, t, i) => {
577
596
  let a = new Date(e, t, i).getTime();
@@ -579,7 +598,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
579
598
  },
580
599
  monthDisabled: (e, t) => {
581
600
  let i = new Date(e, t, 1).getTime();
582
- return new Date(e, t, G(e, t)).getTime() < n || i > r;
601
+ return new Date(e, t, Y(e, t)).getTime() < n || i > r;
583
602
  },
584
603
  yearDisabled: (e) => {
585
604
  let t = new Date(e, 0, 1).getTime();
@@ -592,28 +611,28 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
592
611
  e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
593
612
  }
594
613
  _daysHtml() {
595
- let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = G(this._viewY, this._viewM), r = W(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
614
+ let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = Y(this._viewY, this._viewM), r = q(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
596
615
  y: this._viewY,
597
616
  m: this._viewM,
598
617
  d: 1
599
618
  }, s = (e, t, n, s) => {
600
- let c = U(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
619
+ let c = K(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
601
620
  return `<button type="button" class="${[
602
621
  "datepicker-day",
603
622
  s ? "is-outside" : "",
604
623
  u ? "is-today" : "",
605
624
  l ? "is-selected" : ""
606
625
  ].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
607
- }, c = "", l = K(this._viewY, this._viewM - 1), u = G(l.y, l.m);
626
+ }, c = "", l = X(this._viewY, this._viewM - 1), u = Y(l.y, l.m);
608
627
  for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
609
628
  for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
610
- let d = K(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
629
+ let d = X(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
611
630
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
612
- let p = se.map((t, n) => se[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
631
+ let p = W.map((t, n) => W[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
613
632
  return `
614
633
  <div class="datepicker-head">
615
634
  <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
616
- <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${oe[this._viewM]} ${this._viewY}</button>
635
+ <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${ie[this._viewM]} ${this._viewY}</button>
617
636
  <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
618
637
  </div>
619
638
  <div class="datepicker-weekdays">${p}</div>
@@ -624,14 +643,14 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
624
643
  </div>`;
625
644
  }
626
645
  _monthsHtml() {
627
- let e = W(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
646
+ let e = q(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
628
647
  for (let i = 0; i < 12; i++) {
629
648
  let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
630
649
  "datepicker-cell",
631
650
  o ? "is-today" : "",
632
651
  a ? "is-selected" : ""
633
652
  ].filter(Boolean).join(" ");
634
- r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${oe[i].slice(0, 3)}</button>`;
653
+ r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${ie[i].slice(0, 3)}</button>`;
635
654
  }
636
655
  return `
637
656
  <div class="datepicker-head">
@@ -642,7 +661,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
642
661
  <div class="datepicker-cells">${r}</div>`;
643
662
  }
644
663
  _yearsHtml() {
645
- let e = W(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
664
+ let e = q(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
646
665
  for (let a = 0; a < 12; a++) {
647
666
  let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
648
667
  "datepicker-cell",
@@ -667,21 +686,21 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
667
686
  F(e, t);
668
687
  }
669
688
  _setFocus(e, t, n, r) {
670
- let { y: i, m: a } = K(e, t);
689
+ let { y: i, m: a } = X(e, t);
671
690
  this._focus = {
672
691
  y: i,
673
692
  m: a,
674
693
  d: n
675
694
  };
676
695
  let o = i !== this._viewY || a !== this._viewM;
677
- this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${U(i, a, n)}"]`)?.focus();
696
+ this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${K(i, a, n)}"]`)?.focus();
678
697
  }
679
698
  _onKey(e) {
680
699
  if (this._mode !== "days") {
681
700
  e.key === "Escape" && this._close();
682
701
  return;
683
702
  }
684
- let t = this._focus || W(this._value) || {
703
+ let t = this._focus || q(this._value) || {
685
704
  y: this._viewY,
686
705
  m: this._viewM,
687
706
  d: 1
@@ -699,17 +718,17 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
699
718
  case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
700
719
  case "PageUp": {
701
720
  e.preventDefault();
702
- let n = K(t.y, t.m - (e.shiftKey ? 12 : 1));
703
- return this._setFocus(n.y, n.m, Math.min(t.d, G(n.y, n.m)), "slide-prev");
721
+ let n = X(t.y, t.m - (e.shiftKey ? 12 : 1));
722
+ return this._setFocus(n.y, n.m, Math.min(t.d, Y(n.y, n.m)), "slide-prev");
704
723
  }
705
724
  case "PageDown": {
706
725
  e.preventDefault();
707
- let n = K(t.y, t.m + (e.shiftKey ? 12 : 1));
708
- return this._setFocus(n.y, n.m, Math.min(t.d, G(n.y, n.m)), "slide-next");
726
+ let n = X(t.y, t.m + (e.shiftKey ? 12 : 1));
727
+ return this._setFocus(n.y, n.m, Math.min(t.d, Y(n.y, n.m)), "slide-next");
709
728
  }
710
729
  case "Enter":
711
730
  case " ":
712
- e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = U(t.y, t.m, t.d), this._close());
731
+ e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = K(t.y, t.m, t.d), this._close());
713
732
  return;
714
733
  case "Escape": return this._close();
715
734
  default:
@@ -720,11 +739,11 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
720
739
  if (!e || !t) return;
721
740
  let r = () => !t.hidden;
722
741
  this._open = () => {
723
- if (!W(this._value) && !this._viewNavigated) {
742
+ if (!q(this._value) && !this._viewNavigated) {
724
743
  let e = /* @__PURE__ */ new Date();
725
744
  this._viewY = e.getFullYear(), this._viewM = e.getMonth();
726
745
  }
727
- let r = W(this._value), i = /* @__PURE__ */ new Date();
746
+ let r = q(this._value), i = /* @__PURE__ */ new Date();
728
747
  this._mode = "days", this._focus = r || {
729
748
  y: this._viewY,
730
749
  m: this._viewM,
@@ -737,7 +756,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
737
756
  let t = e.target.closest("[data-nav]");
738
757
  if (t) {
739
758
  this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
740
- let e = K(this._viewY, this._viewM + Number(t.dataset.nav));
759
+ let e = X(this._viewY, this._viewM + Number(t.dataset.nav));
741
760
  this._viewY = e.y, this._viewM = e.m, this._focus = {
742
761
  y: e.y,
743
762
  m: e.m,
@@ -776,7 +795,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
776
795
  }
777
796
  if (e.target.closest("[data-today]")) {
778
797
  let e = /* @__PURE__ */ new Date();
779
- this.value = U(e.getFullYear(), e.getMonth(), e.getDate()), this._close();
798
+ this.value = K(e.getFullYear(), e.getMonth(), e.getDate()), this._close();
780
799
  return;
781
800
  }
782
801
  if (e.target.closest("[data-clear]")) {
@@ -797,7 +816,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
797
816
  disconnectedCallback() {
798
817
  this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this);
799
818
  }
800
- }, ue = [
819
+ }, oe = [
801
820
  "January",
802
821
  "February",
803
822
  "March",
@@ -810,7 +829,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
810
829
  "October",
811
830
  "November",
812
831
  "December"
813
- ], de = [
832
+ ], se = [
814
833
  "Su",
815
834
  "Mo",
816
835
  "Tu",
@@ -818,24 +837,24 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
818
837
  "Th",
819
838
  "Fr",
820
839
  "Sa"
821
- ], fe = (e) => String(e).padStart(2, "0"), pe = (e, t, n) => `${e}-${fe(t + 1)}-${fe(n)}`, q = (e) => {
840
+ ], ce = (e) => String(e).padStart(2, "0"), le = (e, t, n) => `${e}-${ce(t + 1)}-${ce(n)}`, ue = (e) => {
822
841
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
823
842
  return t ? {
824
843
  y: +t[1],
825
844
  m: t[2] - 1,
826
845
  d: +t[3]
827
846
  } : null;
828
- }, me = (e) => {
829
- let t = q(e);
830
- return t ? `${fe(t.d)} ${ue[t.m].slice(0, 3)} ${t.y}` : "";
831
- }, he = (e, t) => new Date(e, t + 1, 0).getDate(), ge = (e, t) => {
847
+ }, de = (e) => {
848
+ let t = ue(e);
849
+ return t ? `${ce(t.d)} ${oe[t.m].slice(0, 3)} ${t.y}` : "";
850
+ }, fe = (e, t) => new Date(e, t + 1, 0).getDate(), pe = (e, t) => {
832
851
  for (; t < 0;) t += 12, --e;
833
852
  for (; t > 11;) t -= 12, e += 1;
834
853
  return {
835
854
  y: e,
836
855
  m: t
837
856
  };
838
- }, _e = class extends HTMLElement {
857
+ }, me = class extends HTMLElement {
839
858
  static get observedAttributes() {
840
859
  return [
841
860
  "start",
@@ -878,13 +897,13 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
878
897
  text: e,
879
898
  empty: !0
880
899
  } : {
881
- text: `${me(this._start) || "Start"} – ${me(this._end) || "End"}`,
900
+ text: `${de(this._start) || "Start"} – ${de(this._end) || "End"}`,
882
901
  empty: !1
883
902
  };
884
903
  }
885
904
  render() {
886
905
  this._start = this.getAttribute("start") || this._start, this._end = this.getAttribute("end") || this._end;
887
- let e = q(this._start);
906
+ let e = ue(this._start);
888
907
  e && (this._viewY = e.y, this._viewM = e.m);
889
908
  let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label();
890
909
  this.innerHTML = `
@@ -912,24 +931,24 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
912
931
  r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "";
913
932
  }
914
933
  _limits() {
915
- let e = q(this.getAttribute("min")), t = q(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
934
+ let e = ue(this.getAttribute("min")), t = ue(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
916
935
  return (e, t, i) => {
917
936
  let a = new Date(e, t, i).getTime();
918
937
  return a < n || a > r;
919
938
  };
920
939
  }
921
940
  _monthHtml(e, t) {
922
- let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = he(e, t), a = this._limits(), o = de.map((e, t) => de[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
923
- let i = pe(e, t, n), o = a(e, t, n);
941
+ let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = fe(e, t), a = this._limits(), o = se.map((e, t) => se[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
942
+ let i = le(e, t, n), o = a(e, t, n);
924
943
  return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
925
- }, c = "", l = ge(e, t - 1), u = he(l.y, l.m);
944
+ }, c = "", l = pe(e, t - 1), u = fe(l.y, l.m);
926
945
  for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
927
946
  for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
928
- let d = ge(e, t + 1), f = (7 - (r + i) % 7) % 7;
947
+ let d = pe(e, t + 1), f = (7 - (r + i) % 7) % 7;
929
948
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
930
949
  return `
931
950
  <div class="daterange-cal">
932
- <div class="datepicker-month-label">${ue[t]} ${e}</div>
951
+ <div class="datepicker-month-label">${oe[t]} ${e}</div>
933
952
  <div class="datepicker-weekdays">${o}</div>
934
953
  <div class="datepicker-grid" role="grid">${c}</div>
935
954
  </div>`;
@@ -937,7 +956,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
937
956
  _renderView() {
938
957
  let e = this.querySelector(".daterange-pop");
939
958
  if (!e) return;
940
- let t = ge(this._viewY, this._viewM + 1);
959
+ let t = pe(this._viewY, this._viewM + 1);
941
960
  e.innerHTML = `
942
961
  <div class="daterange-head">
943
962
  <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
@@ -963,7 +982,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
963
982
  n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
964
983
  }
965
984
  let i = e.querySelector("[data-range-hint]");
966
- i && (i.textContent = this._start ? this._end ? `${me(this._start)} – ${me(this._end)}` : "Pick an end date" : "Pick a start date");
985
+ i && (i.textContent = this._start ? this._end ? `${de(this._start)} – ${de(this._end)}` : "Pick an end date" : "Pick a start date");
967
986
  }
968
987
  _position(e, t) {
969
988
  F(e, t);
@@ -984,7 +1003,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
984
1003
  if (!e || !t) return;
985
1004
  let r = () => !t.hidden;
986
1005
  this._open = () => {
987
- let r = q(this._start);
1006
+ let r = ue(this._start);
988
1007
  if (r) this._viewY = r.y, this._viewM = r.m;
989
1008
  else {
990
1009
  let e = /* @__PURE__ */ new Date();
@@ -997,7 +1016,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
997
1016
  this._popClick = !0;
998
1017
  let t = e.target.closest("[data-nav]");
999
1018
  if (t) {
1000
- let e = ge(this._viewY, this._viewM + Number(t.dataset.nav));
1019
+ let e = pe(this._viewY, this._viewM + Number(t.dataset.nav));
1001
1020
  this._viewY = e.y, this._viewM = e.m, this._renderView();
1002
1021
  return;
1003
1022
  }
@@ -1022,7 +1041,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1022
1041
  disconnectedCallback() {
1023
1042
  this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey), L(this);
1024
1043
  }
1025
- }, ve = class extends HTMLElement {
1044
+ }, he = class extends HTMLElement {
1026
1045
  _accessibleName() {
1027
1046
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
1028
1047
  }
@@ -1057,7 +1076,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1057
1076
  return this._values.slice();
1058
1077
  }
1059
1078
  set values(e) {
1060
- this._values = Array.isArray(e) ? e.map(String) : [], R(this, this._values.join(",")), this._rendered && this._renderControl();
1079
+ this._values = Array.isArray(e) ? e.map(String) : [], z(this, this._values.join(",")), this._rendered && this._renderControl();
1061
1080
  }
1062
1081
  set options(e) {
1063
1082
  this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
@@ -1072,7 +1091,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1072
1091
  value: e.getAttribute("value") ?? e.textContent.trim(),
1073
1092
  label: e.innerHTML,
1074
1093
  icon: e.getAttribute("icon") || void 0,
1075
- [z]: !0,
1094
+ [B]: !0,
1076
1095
  selected: e.hasAttribute("selected")
1077
1096
  })));
1078
1097
  }
@@ -1085,34 +1104,34 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1085
1104
  }
1086
1105
  _labelHtmlFor(e) {
1087
1106
  let t = this._readOptions().find((t) => String(t.value) === String(e));
1088
- return t ? V(t) : B(e);
1107
+ return t ? H(t) : V(e);
1089
1108
  }
1090
1109
  render() {
1091
1110
  this._snapshotDeclared();
1092
1111
  let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…", n = this.getAttribute("icon"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "";
1093
- R(this, this._values.join(",")), this.innerHTML = `
1112
+ z(this, this._values.join(",")), this.innerHTML = `
1094
1113
  <div class="search-select${i}">
1095
- <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${J(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
1096
- ${n ? `<i class="bi bi-${J(n)} search-select-icon" aria-hidden="true"></i>` : ""}
1114
+ <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${ge(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
1115
+ ${n ? `<i class="bi bi-${ge(n)} search-select-icon" aria-hidden="true"></i>` : ""}
1097
1116
  <div class="ms-chips" data-chips></div>
1098
1117
  <i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
1099
1118
  </div>
1100
1119
  <div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
1101
- ${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${J(t)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
1120
+ ${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${ge(t)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
1102
1121
  <div class="search-select-options"></div>
1103
1122
  <div class="search-select-empty" hidden>No matches</div>
1104
1123
  </div>
1105
- </div>`, this._rendered = !0, R(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
1124
+ </div>`, this._rendered = !0, z(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
1106
1125
  }
1107
1126
  _renderControl() {
1108
1127
  let e = this.querySelector("[data-chips]");
1109
1128
  if (!e) return;
1110
1129
  let t = this.getAttribute("placeholder") || "Select…";
1111
1130
  if (!this._values.length) {
1112
- e.innerHTML = `<span class="search-select-placeholder">${B(t)}</span>`;
1131
+ e.innerHTML = `<span class="search-select-placeholder">${V(t)}</span>`;
1113
1132
  return;
1114
1133
  }
1115
- e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${J(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join(""), this._collapseChips();
1134
+ e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${ge(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join(""), this._collapseChips();
1116
1135
  }
1117
1136
  _collapseChips() {
1118
1137
  let e = this.querySelector("[data-chips]");
@@ -1136,9 +1155,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1136
1155
  let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
1137
1156
  if (!t) return;
1138
1157
  let r = (e || "").trim().toLowerCase(), i = this._readOptions();
1139
- r && (i = i.filter((e) => ye(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
1158
+ r && (i = i.filter((e) => _e(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
1140
1159
  let t = this._values.includes(String(e.value));
1141
- return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${t}"><span class="ms-opt-label">${V(e)}</span><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span></button>`;
1160
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${ge(e.value)}" aria-selected="${t}"><span class="ms-opt-label">${H(e)}</span><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span></button>`;
1142
1161
  }).join(""), n && (n.hidden = i.length > 0), this._active = -1;
1143
1162
  }
1144
1163
  _wire() {
@@ -1156,7 +1175,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1156
1175
  }, f = () => {
1157
1176
  t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
1158
1177
  }, p = () => {
1159
- R(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
1178
+ z(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
1160
1179
  }, m = (e) => {
1161
1180
  let t = String(e);
1162
1181
  this._values.includes(t) ? this._values = this._values.filter((e) => e !== t) : this._values = [...this._values, t], this._renderControl(), this._renderOptions(n ? n.value : ""), p();
@@ -1200,7 +1219,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1200
1219
  disconnectedCallback() {
1201
1220
  this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), this._ro?.disconnect(), this._ro = null;
1202
1221
  }
1203
- }, J = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), ye = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), be = /[^0-9]/g, xe = /[^0-9a-zA-Z]/g, Se = class extends HTMLElement {
1222
+ }, ge = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), _e = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ve = /[^0-9]/g, ye = /[^0-9a-zA-Z]/g, be = class extends HTMLElement {
1204
1223
  static get observedAttributes() {
1205
1224
  return [
1206
1225
  "value",
@@ -1227,16 +1246,16 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1227
1246
  return this._value ?? "";
1228
1247
  }
1229
1248
  set value(e) {
1230
- this._value = this._clean(e), R(this, this._value), this._paint();
1249
+ this._value = this._clean(e), z(this, this._value), this._paint();
1231
1250
  }
1232
1251
  _clean(e) {
1233
- return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? xe : be, "").slice(0, this.length);
1252
+ return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? ye : ve, "").slice(0, this.length);
1234
1253
  }
1235
1254
  connectedCallback() {
1236
1255
  this._rendered || this.render();
1237
1256
  }
1238
1257
  attributeChangedCallback(e, t, n) {
1239
- this._rendered && (e === "value" ? (this._value = this._clean(n), R(this, this._value), this._paint()) : this.render());
1258
+ this._rendered && (e === "value" ? (this._value = this._clean(n), z(this, this._value), this._paint()) : this.render());
1240
1259
  }
1241
1260
  render() {
1242
1261
  this._value = this._clean(this.getAttribute("value") ?? this._value);
@@ -1254,7 +1273,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1254
1273
  spellcheck="false"
1255
1274
  ${n ? "disabled" : ""} />
1256
1275
  <div class="otp-slots" aria-hidden="true">${r}</div>
1257
- </div>`, this._rendered = !0, R(this, this._value), this._wire(), this._paint();
1276
+ </div>`, this._rendered = !0, z(this, this._value), this._wire(), this._paint();
1258
1277
  }
1259
1278
  _refs() {
1260
1279
  return {
@@ -1276,7 +1295,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1276
1295
  if (!e) return;
1277
1296
  let t = (e) => {
1278
1297
  let t = this._clean(e), n = t !== this._value;
1279
- this._value = t, R(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
1298
+ this._value = t, z(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
1280
1299
  bubbles: !0,
1281
1300
  detail: t
1282
1301
  }));
@@ -1296,7 +1315,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
1296
1315
  document.activeElement === e && this._paint();
1297
1316
  });
1298
1317
  }
1299
- }, Ce = [
1318
+ }, xe = [
1300
1319
  [
1301
1320
  "AF",
1302
1321
  "Afghanistan",
@@ -2522,56 +2541,56 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
2522
2541
  "Zimbabwe",
2523
2542
  "263"
2524
2543
  ]
2525
- ], we = (e) => (Ce.find((t) => t[0] === e) || [
2544
+ ], Se = (e) => (xe.find((t) => t[0] === e) || [
2526
2545
  "",
2527
2546
  "",
2528
2547
  ""
2529
- ])[2], Te = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, Y = null, Ee = null;
2530
- function De() {
2531
- return Y ? Promise.resolve(Y) : (Ee ||= Promise.all([import("./libphonenumber-js-BcNT8oq0-DMpMlice.js"), import("./examples.mobile.json-BMXTGiGC-Dl_Tt3py.js")]).then(([e, t]) => (Y = {
2548
+ ])[2], Ce = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, Z = null, we = null;
2549
+ function Te() {
2550
+ return Z ? Promise.resolve(Z) : (we ||= Promise.all([import("./libphonenumber-js-BcNT8oq0-DMpMlice.js"), import("./examples.mobile.json-BMXTGiGC-Dl_Tt3py.js")]).then(([e, t]) => (Z = {
2532
2551
  AsYouType: e.AsYouType,
2533
2552
  getExampleNumber: e.getExampleNumber,
2534
2553
  isValidPhoneNumber: e.isValidPhoneNumber,
2535
2554
  examples: t.default || t
2536
- }, Y)).catch(() => null), Ee);
2555
+ }, Z)).catch(() => null), we);
2537
2556
  }
2538
- function Oe(e, t) {
2539
- if (!Y || !t) return t;
2557
+ function Ee(e, t) {
2558
+ if (!Z || !t) return t;
2540
2559
  try {
2541
- return new Y.AsYouType(e).input(t);
2560
+ return new Z.AsYouType(e).input(t);
2542
2561
  } catch {
2543
2562
  return t;
2544
2563
  }
2545
2564
  }
2546
- function ke(e) {
2547
- if (!Y) return null;
2565
+ function De(e) {
2566
+ if (!Z) return null;
2548
2567
  try {
2549
- return Y.getExampleNumber(e, Y.examples)?.formatNational() || null;
2568
+ return Z.getExampleNumber(e, Z.examples)?.formatNational() || null;
2550
2569
  } catch {
2551
2570
  return null;
2552
2571
  }
2553
2572
  }
2554
- function Ae(e) {
2555
- if (!Y || !e) return null;
2573
+ function Oe(e) {
2574
+ if (!Z || !e) return null;
2556
2575
  try {
2557
- return Y.isValidPhoneNumber(e);
2576
+ return Z.isValidPhoneNumber(e);
2558
2577
  } catch {
2559
2578
  return null;
2560
2579
  }
2561
2580
  }
2562
- function je(e) {
2563
- if (!Y) return null;
2581
+ function ke(e) {
2582
+ if (!Z) return null;
2564
2583
  try {
2565
- let t = Y.getExampleNumber(e, Y.examples);
2584
+ let t = Z.getExampleNumber(e, Z.examples);
2566
2585
  return t?.nationalNumber ? t.nationalNumber.length : null;
2567
2586
  } catch {
2568
2587
  return null;
2569
2588
  }
2570
2589
  }
2571
- function Me(e) {
2572
- if (!Y || !e?.trim().startsWith("+")) return null;
2590
+ function Ae(e) {
2591
+ if (!Z || !e?.trim().startsWith("+")) return null;
2573
2592
  try {
2574
- let t = new Y.AsYouType();
2593
+ let t = new Z.AsYouType();
2575
2594
  t.input(e.trim());
2576
2595
  let n = t.getCountry();
2577
2596
  return n ? {
@@ -2582,7 +2601,7 @@ function Me(e) {
2582
2601
  return null;
2583
2602
  }
2584
2603
  }
2585
- var Ne = class extends HTMLElement {
2604
+ var je = class extends HTMLElement {
2586
2605
  static get observedAttributes() {
2587
2606
  return [
2588
2607
  "value",
@@ -2601,40 +2620,40 @@ var Ne = class extends HTMLElement {
2601
2620
  this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
2602
2621
  }
2603
2622
  get value() {
2604
- return `+${we(this._country)}${this._national}`;
2623
+ return `+${Se(this._country)}${this._national}`;
2605
2624
  }
2606
2625
  set value(e) {
2607
- let t = String(e ?? "").trim(), n = Me(t);
2626
+ let t = String(e ?? "").trim(), n = Ae(t);
2608
2627
  if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
2609
2628
  else if (t.startsWith("+")) {
2610
- let e = t.replace(/[^0-9]/g, ""), n = String(we(this._country));
2629
+ let e = t.replace(/[^0-9]/g, ""), n = String(Se(this._country));
2611
2630
  n && e.startsWith(n) && (e = e.slice(n.length)), this._national = e;
2612
2631
  } else this._national = t.replace(/[^0-9]/g, "");
2613
2632
  n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._commit();
2614
2633
  }
2615
2634
  _commit() {
2616
- R(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
2635
+ z(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
2617
2636
  }
2618
2637
  render() {
2619
- let e = this.getAttribute("placeholder") || ke(this._country) || "Enter phone number";
2638
+ let e = this.getAttribute("placeholder") || De(this._country) || "Enter phone number";
2620
2639
  this._country = this.getAttribute("country") || this._country;
2621
- let t = Ce.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${Te(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
2640
+ let t = xe.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${Ce(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
2622
2641
  this.innerHTML = `
2623
2642
  <div class="phone-input-wrap">
2624
2643
  <div class="phone-country-adornment">
2625
2644
  <button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
2626
- <span class="${Te(this._country)}" data-flag aria-hidden="true"></span>
2645
+ <span class="${Ce(this._country)}" data-flag aria-hidden="true"></span>
2627
2646
  <i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
2628
- <span class="phone-dial" data-dial>+${we(this._country)}</span>
2647
+ <span class="phone-dial" data-dial>+${Se(this._country)}</span>
2629
2648
  </button>
2630
2649
  <div class="country-dropdown-menu" role="listbox" hidden>
2631
2650
  <div class="dropdown-search-wrapper"><span class="dropdown-search-icon"><i class="bi bi-search" aria-hidden="true"></i></span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" /></div>
2632
2651
  <div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
2633
2652
  </div>
2634
2653
  </div>
2635
- <input type="tel" class="input" placeholder="${Pe(e)}" value="${Pe(Oe(this._country, this._national))}"${this.hasAttribute("disabled") ? " disabled" : ""} />
2654
+ <input type="tel" class="input" placeholder="${Me(e)}" value="${Me(Ee(this._country, this._national))}"${this.hasAttribute("disabled") ? " disabled" : ""} />
2636
2655
  </div>
2637
- <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, R(this, this.value), this._wire();
2656
+ <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, z(this, this.value), this._wire();
2638
2657
  }
2639
2658
  _wire() {
2640
2659
  let e = this.querySelector(".country-toggle"), t = this.querySelector(".phone-input-wrap"), n = this.querySelector(".country-dropdown-menu"), r = this.querySelector(".dropdown-search-input"), i = this.querySelector(".country-list-scroll"), a = this.querySelector(".country-empty"), o = this.querySelector("input[type=tel]"), s = this.querySelector("[data-flag]"), c = this.querySelector("[data-dial]");
@@ -2658,7 +2677,7 @@ var Ne = class extends HTMLElement {
2658
2677
  }
2659
2678
  a && (a.hidden = n > 0);
2660
2679
  }, m = (e) => {
2661
- this._country = e, this.setAttribute("country", e), s && (s.className = Te(e)), c && (c.textContent = `+${we(e)}`);
2680
+ this._country = e, this.setAttribute("country", e), s && (s.className = Ce(e)), c && (c.textContent = `+${Se(e)}`);
2662
2681
  for (let t of i.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
2663
2682
  f(), this._commit();
2664
2683
  };
@@ -2669,35 +2688,35 @@ var Ne = class extends HTMLElement {
2669
2688
  let h = this.querySelector("[data-phone-error]"), g = (e) => {
2670
2689
  if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), h) {
2671
2690
  if (e) {
2672
- let e = ke(this._country);
2691
+ let e = De(this._country);
2673
2692
  h.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
2674
2693
  }
2675
2694
  h.hidden = !e;
2676
2695
  }
2677
2696
  };
2678
2697
  o.addEventListener("input", () => {
2679
- let e = o.value.replace(/[^0-9]/g, ""), t = je(this._country);
2698
+ let e = o.value.replace(/[^0-9]/g, ""), t = ke(this._country);
2680
2699
  t && e.length > t && (e = e.slice(0, t)), this._national = e;
2681
- let n = Oe(this._country, this._national);
2682
- o.value !== n && (o.value = n), this._commit(), o.classList.contains("is-invalid") && (!this._national || Ae(this.value) === !0) && g(!1);
2700
+ let n = Ee(this._country, this._national);
2701
+ o.value !== n && (o.value = n), this._commit(), o.classList.contains("is-invalid") && (!this._national || Oe(this.value) === !0) && g(!1);
2683
2702
  }), o.addEventListener("blur", () => {
2684
- g(this._national.length > 0 && Ae(this.value) === !1);
2703
+ g(this._national.length > 0 && Oe(this.value) === !1);
2685
2704
  }), o.addEventListener("paste", (e) => {
2686
- let t = Me(e.clipboardData?.getData("text"));
2687
- t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = Oe(this._country, this._national) : this.setAttribute("country", t.country), this._commit(), this.querySelector("input[type=tel]")?.focus());
2705
+ let t = Ae(e.clipboardData?.getData("text"));
2706
+ t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = Ee(this._country, this._national) : this.setAttribute("country", t.country), this._commit(), this.querySelector("input[type=tel]")?.focus());
2688
2707
  }), this._onDocClick = (e) => {
2689
2708
  l() && !this.contains(e.target) && f();
2690
- }, document.addEventListener("click", this._onDocClick), De().then((e) => {
2691
- if (!(!e || !o) && (this._national && (o.value = Oe(this._country, this._national)), !this.getAttribute("placeholder"))) {
2692
- let e = ke(this._country);
2709
+ }, document.addEventListener("click", this._onDocClick), Te().then((e) => {
2710
+ if (!(!e || !o) && (this._national && (o.value = Ee(this._country, this._national)), !this.getAttribute("placeholder"))) {
2711
+ let e = De(this._country);
2693
2712
  e && (o.placeholder = e);
2694
2713
  }
2695
- }), R(this, this.value);
2714
+ }), z(this, this.value);
2696
2715
  }
2697
2716
  disconnectedCallback() {
2698
2717
  this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
2699
2718
  }
2700
- }, Pe = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Fe = class extends HTMLElement {
2719
+ }, Me = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Ne = class extends HTMLElement {
2701
2720
  static get observedAttributes() {
2702
2721
  return [
2703
2722
  "value",
@@ -2733,7 +2752,7 @@ var Ne = class extends HTMLElement {
2733
2752
  return this._value;
2734
2753
  }
2735
2754
  set value(e) {
2736
- this._value = e == null ? "" : String(e), R(this, this._value), this._syncSelected(), this._syncReset();
2755
+ this._value = e == null ? "" : String(e), z(this, this._value), this._syncSelected(), this._syncReset();
2737
2756
  }
2738
2757
  set options(e) {
2739
2758
  this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
@@ -2748,7 +2767,7 @@ var Ne = class extends HTMLElement {
2748
2767
  value: e.getAttribute("value") ?? e.textContent.trim(),
2749
2768
  label: e.innerHTML,
2750
2769
  icon: e.getAttribute("icon") || void 0,
2751
- [z]: !0,
2770
+ [B]: !0,
2752
2771
  selected: e.hasAttribute("selected")
2753
2772
  })));
2754
2773
  }
@@ -2758,25 +2777,25 @@ var Ne = class extends HTMLElement {
2758
2777
  render() {
2759
2778
  this._snapshotDeclared();
2760
2779
  let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.hasAttribute("clearable"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "", a = this.getAttribute("icon"), o = this.getAttribute("prefix"), s = this.getAttribute("placeholder") || "Select...", c = this.getAttribute("search-placeholder") || "Search...", l = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
2761
- l && (this._value = String(l.value)), R(this, this._value);
2780
+ l && (this._value = String(l.value)), z(this, this._value);
2762
2781
  let u = e.map((e) => {
2763
2782
  let t = String(e.value) === String(this._value);
2764
- return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${Ie(e.value)}" aria-selected="${t}">${V(e)}</button>`;
2783
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${Pe(e.value)}" aria-selected="${t}">${H(e)}</button>`;
2765
2784
  }).join("");
2766
2785
  this.innerHTML = `
2767
2786
  <div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
2768
- <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${Ie(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
2769
- ${a ? `<i class="bi bi-${Ie(a)} search-select-icon" aria-hidden="true"></i>` : ""}
2770
- ${o ? `<span class="search-select-prefix">${B(o)}</span>` : ""}
2771
- <span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? V(l) : B(s)}</span>
2787
+ <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${Pe(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
2788
+ ${a ? `<i class="bi bi-${Pe(a)} search-select-icon" aria-hidden="true"></i>` : ""}
2789
+ ${o ? `<span class="search-select-prefix">${V(o)}</span>` : ""}
2790
+ <span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? H(l) : V(s)}</span>
2772
2791
  ${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
2773
2792
  <i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
2774
2793
  </button>
2775
2794
  <div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
2776
- ${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Ie(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
2795
+ ${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Pe(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
2777
2796
  <div class="search-select-options">${u}<div class="search-select-empty" hidden>No matches</div></div>
2778
2797
  </div>
2779
- </div>`, this._rendered = !0, R(this, this._value), this._wire(), this._syncReset();
2798
+ </div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncReset();
2780
2799
  }
2781
2800
  _refs() {
2782
2801
  return {
@@ -2802,7 +2821,7 @@ var Ne = class extends HTMLElement {
2802
2821
  let t = e.dataset.value === String(this._value);
2803
2822
  e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
2804
2823
  }
2805
- e && (e.innerHTML = t ? V(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
2824
+ e && (e.innerHTML = t ? H(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
2806
2825
  }
2807
2826
  _syncReset() {
2808
2827
  let { reset: e } = this._refs();
@@ -2865,14 +2884,14 @@ var Ne = class extends HTMLElement {
2865
2884
  disconnectedCallback() {
2866
2885
  this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this);
2867
2886
  }
2868
- }, Ie = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Le = "image/png,image/jpeg,image/webp", Re = {
2887
+ }, Pe = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Fe = "image/png,image/jpeg,image/webp", Ie = {
2869
2888
  "image/png": [".png"],
2870
2889
  "image/jpeg": [".jpg", ".jpeg"],
2871
2890
  "image/webp": [".webp"],
2872
2891
  "image/gif": [".gif"],
2873
2892
  "image/svg+xml": [".svg"],
2874
2893
  "application/pdf": [".pdf"]
2875
- }, ze = {
2894
+ }, Le = {
2876
2895
  "image/png": "PNG",
2877
2896
  "image/jpeg": "JPG",
2878
2897
  "image/webp": "WEBP",
@@ -2886,36 +2905,57 @@ var Ne = class extends HTMLElement {
2886
2905
  ".gif": "GIF",
2887
2906
  ".svg": "SVG",
2888
2907
  ".pdf": "PDF"
2889
- }, Be = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2908
+ }, Re = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), ze = [
2909
+ ".png",
2910
+ ".jpg",
2911
+ ".jpeg",
2912
+ ".webp",
2913
+ ".gif",
2914
+ ".svg",
2915
+ ".bmp",
2916
+ ".avif",
2917
+ ".heic"
2918
+ ];
2919
+ function Be(e) {
2920
+ if (!e) return !1;
2921
+ let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
2922
+ if (t) return t.startsWith("image/");
2923
+ let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
2924
+ return ze.some((e) => r.endsWith(e));
2925
+ }
2890
2926
  function Ve(e) {
2927
+ let t = Re(e);
2928
+ return t.length ? t.every((e) => e.startsWith(".") ? ze.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
2929
+ }
2930
+ function He(e) {
2891
2931
  let t = [];
2892
- for (let n of Be(e)) {
2893
- let e = ze[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
2932
+ for (let n of Re(e)) {
2933
+ let e = Le[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
2894
2934
  t.includes(e) || t.push(e);
2895
2935
  }
2896
2936
  return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
2897
2937
  }
2898
- function He(e, t) {
2899
- let n = Be(t);
2938
+ function Ue(e, t) {
2939
+ let n = Re(t);
2900
2940
  if (!n.length) return !0;
2901
2941
  let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
2902
- return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (Re[e] || []).some((e) => i.endsWith(e)));
2942
+ return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (Ie[e] || []).some((e) => i.endsWith(e)));
2903
2943
  }
2904
- function Ue(e, t = {}) {
2944
+ function We(e, t = {}) {
2905
2945
  if (!e) return null;
2906
- let n = t.accept === void 0 ? Le : t.accept, r = t.maxSizeMb || 5;
2907
- return He(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Ve(n)} file.`;
2946
+ let n = t.accept === void 0 ? Fe : t.accept, r = t.maxSizeMb || 5;
2947
+ return Ue(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${He(n)} file.`;
2908
2948
  }
2909
- var X = (e, t) => {
2949
+ var Q = (e, t) => {
2910
2950
  typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
2911
2951
  };
2912
- function We() {
2913
- X("wui-select", Fe), X("wui-phone", Ne), X("wui-datepicker", le), X("wui-date-range", _e), X("wui-autocomplete", re), X("wui-multiselect", ve), X("wui-otp", Se), X("wui-status-icon", ee);
2952
+ function Ge() {
2953
+ Q("wui-select", Ne), Q("wui-phone", je), Q("wui-datepicker", ae), Q("wui-date-range", me), Q("wui-autocomplete", ne), Q("wui-multiselect", he), Q("wui-otp", be), Q("wui-status-icon", ee);
2914
2954
  }
2915
- We();
2955
+ Ge();
2916
2956
  //#endregion
2917
2957
  //#region src/components/RequiredMark.jsx
2918
- function Z() {
2958
+ function $() {
2919
2959
  return /* @__PURE__ */ t("span", {
2920
2960
  className: "required",
2921
2961
  "aria-hidden": "true",
@@ -2924,7 +2964,7 @@ function Z() {
2924
2964
  }
2925
2965
  //#endregion
2926
2966
  //#region src/components/AppAutocomplete.jsx
2927
- function Ge({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s = "Search…", minChars: c, debounce: u, disabled: d = !1, size: f, name: p, label: m, error: h, hint: g, required: _ = !1, fieldClassName: v = "", ...y }) {
2967
+ function Ke({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s = "Search…", minChars: c, debounce: u, disabled: d = !1, size: f, name: p, label: m, error: h, hint: g, required: _ = !1, fieldClassName: v = "", ...y }) {
2928
2968
  E("AppAutocomplete", y);
2929
2969
  let b = l(null), x = typeof o == "function";
2930
2970
  return a(() => {
@@ -2959,7 +2999,7 @@ function Ge({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
2959
2999
  m && /* @__PURE__ */ n("label", {
2960
3000
  className: "label",
2961
3001
  htmlFor: p,
2962
- children: [m, _ && /* @__PURE__ */ t(Z, {})]
3002
+ children: [m, _ && /* @__PURE__ */ t($, {})]
2963
3003
  }),
2964
3004
  /* @__PURE__ */ t("wui-autocomplete", {
2965
3005
  "aria-label": typeof m == "string" ? m : void 0,
@@ -2986,13 +3026,13 @@ function Ge({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
2986
3026
  }
2987
3027
  //#endregion
2988
3028
  //#region src/components/AppAvatar.jsx
2989
- function Ke(e) {
3029
+ function qe(e) {
2990
3030
  let t = (e || "").trim();
2991
3031
  if (!t) return "?";
2992
3032
  let n = t.split(/\s+/).filter(Boolean);
2993
3033
  return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
2994
3034
  }
2995
- function qe({ name: e, src: n, className: r = "", ...i }) {
3035
+ function Je({ name: e, src: n, className: r = "", ...i }) {
2996
3036
  E("AppAvatar", i);
2997
3037
  let a = ["avatar", r].filter(Boolean).join(" ");
2998
3038
  return n ? /* @__PURE__ */ t("span", {
@@ -3006,12 +3046,12 @@ function qe({ name: e, src: n, className: r = "", ...i }) {
3006
3046
  className: a,
3007
3047
  role: "img",
3008
3048
  "aria-label": e,
3009
- children: Ke(e)
3049
+ children: qe(e)
3010
3050
  });
3011
3051
  }
3012
3052
  //#endregion
3013
3053
  //#region src/components/AppBadge.jsx
3014
- function Je({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
3054
+ function Ye({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
3015
3055
  return E("AppBadge", a), /* @__PURE__ */ t(f, {
3016
3056
  bg: !1,
3017
3057
  className: [
@@ -3025,14 +3065,17 @@ function Je({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
3025
3065
  }
3026
3066
  //#endregion
3027
3067
  //#region src/components/AppButton.jsx
3028
- var Ye = {
3068
+ var Xe = {
3029
3069
  primary: "primary",
3030
3070
  secondary: "secondary",
3031
3071
  outline: "outline-primary",
3032
3072
  ghost: "link",
3033
- danger: "danger"
3073
+ danger: "danger",
3074
+ "outline-danger": "outline-danger",
3075
+ light: "light",
3076
+ warning: "warning"
3034
3077
  };
3035
- function Xe(e, n) {
3078
+ function Ze(e, n) {
3036
3079
  if (!e) return null;
3037
3080
  let r = n === "left" ? "me-2" : "ms-2";
3038
3081
  return typeof e == "string" ? /* @__PURE__ */ t(k, {
@@ -3044,12 +3087,12 @@ function Xe(e, n) {
3044
3087
  children: e
3045
3088
  });
3046
3089
  }
3047
- function Q({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: d = "", ...f }) {
3090
+ function Qe({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: d = "", ...f }) {
3048
3091
  E("AppButton", f);
3049
3092
  let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
3050
3093
  return /* @__PURE__ */ n(p, {
3051
3094
  type: (f.as === void 0 || f.as === "button") && f.href === void 0 ? a : void 0,
3052
- variant: Ye[r] ?? "primary",
3095
+ variant: Xe[r] ?? "primary",
3053
3096
  size: i === "md" ? void 0 : i,
3054
3097
  disabled: s || o,
3055
3098
  className: m || void 0,
@@ -3059,15 +3102,15 @@ function Q({ children: e, variant: r = "primary", size: i = "md", type: a = "but
3059
3102
  className: "spinner-border spinner-border-sm me-2",
3060
3103
  "aria-hidden": "true"
3061
3104
  }),
3062
- !o && Xe(l, "left"),
3105
+ !o && Ze(l, "left"),
3063
3106
  e,
3064
- !o && Xe(u, "right")
3107
+ !o && Ze(u, "right")
3065
3108
  ]
3066
3109
  });
3067
3110
  }
3068
3111
  //#endregion
3069
3112
  //#region src/components/AppCallout.jsx
3070
- function Ze({ children: e, icon: r = "info", className: i = "", ...a }) {
3113
+ function $e({ children: e, icon: r = "info", className: i = "", ...a }) {
3071
3114
  return E("AppCallout", a), /* @__PURE__ */ n("div", {
3072
3115
  className: `info-callout${i ? ` ${i}` : ""}`,
3073
3116
  children: [r && /* @__PURE__ */ t("span", {
@@ -3081,7 +3124,7 @@ function Ze({ children: e, icon: r = "info", className: i = "", ...a }) {
3081
3124
  }
3082
3125
  //#endregion
3083
3126
  //#region src/components/AppCard.jsx
3084
- function Qe({ title: r, titleClassName: i = "", header: a, headerExtra: o, headerActions: s, children: c, className: l = "", bodyClassName: u = "", headerClassName: d = "", body: f = !0, lifted: p = !1, ...h }) {
3127
+ function et({ title: r, titleClassName: i = "", header: a, headerExtra: o, headerActions: s, children: c, className: l = "", bodyClassName: u = "", headerClassName: d = "", body: f = !0, lifted: p = !1, ...h }) {
3085
3128
  E("AppCard", h);
3086
3129
  let g = a != null || r != null || o != null || s != null;
3087
3130
  return /* @__PURE__ */ n(m, {
@@ -3109,28 +3152,39 @@ function Qe({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
3109
3152
  }
3110
3153
  //#endregion
3111
3154
  //#region src/components/AppCheckbox.jsx
3112
- var $e = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
3113
- E("AppCheckbox", s);
3114
- let l = o(), u = r || i || l;
3155
+ var tt = r(function({ label: e, id: r, name: i, error: a, hint: s, className: c = "", ...l }, u) {
3156
+ E("AppCheckbox", l);
3157
+ let d = o(), f = r || i || d;
3115
3158
  return /* @__PURE__ */ n("div", {
3116
- className: `form-check${a ? ` ${a}` : ""}`,
3117
- children: [/* @__PURE__ */ t("input", {
3118
- type: "checkbox",
3119
- className: "form-check-input",
3120
- id: u,
3121
- name: i,
3122
- ref: c,
3123
- ...s
3124
- }), e != null && /* @__PURE__ */ t("label", {
3125
- className: "form-check-label",
3126
- htmlFor: u,
3127
- children: e
3128
- })]
3159
+ className: `form-check${c ? ` ${c}` : ""}`,
3160
+ children: [
3161
+ /* @__PURE__ */ t("input", {
3162
+ type: "checkbox",
3163
+ className: "form-check-input",
3164
+ id: f,
3165
+ name: i,
3166
+ ref: u,
3167
+ "aria-invalid": a ? "true" : "false",
3168
+ ...l
3169
+ }),
3170
+ e != null && /* @__PURE__ */ t("label", {
3171
+ className: "form-check-label",
3172
+ htmlFor: f,
3173
+ children: e
3174
+ }),
3175
+ a ? /* @__PURE__ */ t("div", {
3176
+ className: "field-error",
3177
+ children: a
3178
+ }) : s ? /* @__PURE__ */ t("div", {
3179
+ className: "field-hint",
3180
+ children: s
3181
+ }) : null
3182
+ ]
3129
3183
  });
3130
3184
  });
3131
3185
  //#endregion
3132
3186
  //#region src/components/AppChip.jsx
3133
- function et({ label: r, children: i, tone: a = "neutral", size: o = "md", leadingIcon: s, avatar: c, onRemove: l, onClick: u, disabled: d = !1, removeLabel: f, className: p = "", ...m }) {
3187
+ function nt({ label: r, children: i, tone: a = "neutral", size: o = "md", leadingIcon: s, avatar: c, onRemove: l, onClick: u, disabled: d = !1, removeLabel: f, className: p = "", ...m }) {
3134
3188
  E("AppChip", m);
3135
3189
  let h = r ?? i, g = [
3136
3190
  "chip",
@@ -3182,7 +3236,7 @@ function et({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
3182
3236
  }
3183
3237
  //#endregion
3184
3238
  //#region src/components/AppChoiceCard.jsx
3185
- function tt({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon: c, iconNode: l, iconSize: u = 18, image: d, imageAlt: f = "", children: p, title: m, description: h, checkIcon: g = "check", checkSize: _ = 12, className: v = "", ...y }) {
3239
+ function rt({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon: c, iconNode: l, iconSize: u = 18, image: d, imageAlt: f = "", children: p, title: m, description: h, checkIcon: g = "check", checkSize: _ = 12, className: v = "", ...y }) {
3186
3240
  return E("AppChoiceCard", y), /* @__PURE__ */ n("label", {
3187
3241
  className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
3188
3242
  children: [
@@ -3230,7 +3284,7 @@ function tt({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
3230
3284
  }
3231
3285
  //#endregion
3232
3286
  //#region src/components/AppChoiceChip.jsx
3233
- function nt({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
3287
+ function it({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
3234
3288
  return E("AppChoiceChip", d), /* @__PURE__ */ n("label", {
3235
3289
  className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
3236
3290
  children: [
@@ -3251,7 +3305,7 @@ function nt({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
3251
3305
  }
3252
3306
  //#endregion
3253
3307
  //#region src/components/AppColorField.jsx
3254
- function rt({ value: e = "#000000", onChange: r, label: i, required: a = !1, error: s, hint: c, name: l, id: u, disabled: d = !1, size: f = "md", className: p = "", ...m }) {
3308
+ function at({ value: e = "#000000", onChange: r, label: i, required: a = !1, error: s, hint: c, name: l, id: u, disabled: d = !1, size: f = "md", className: p = "", ...m }) {
3255
3309
  E("AppColorField", m);
3256
3310
  let h = o(), g = u || l || h, _ = (e) => /^#[0-9a-f]{6}$/i.test(e), v = f === "sm" ? " color-field-sm" : f === "lg" ? " color-field-lg" : "", y = f === "sm" ? " input-sm" : f === "lg" ? " input-lg" : "";
3257
3311
  return /* @__PURE__ */ n("div", {
@@ -3260,7 +3314,7 @@ function rt({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
3260
3314
  i && /* @__PURE__ */ n("label", {
3261
3315
  className: "label",
3262
3316
  htmlFor: g,
3263
- children: [i, a && /* @__PURE__ */ t(Z, {})]
3317
+ children: [i, a && /* @__PURE__ */ t($, {})]
3264
3318
  }),
3265
3319
  /* @__PURE__ */ n("div", {
3266
3320
  className: `color-field${v}`,
@@ -3299,7 +3353,7 @@ function rt({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
3299
3353
  }
3300
3354
  //#endregion
3301
3355
  //#region src/components/AppCompareTable.jsx
3302
- function it({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
3356
+ function ot({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
3303
3357
  E("AppCompareTable", o);
3304
3358
  let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
3305
3359
  className: "compare-yes",
@@ -3335,7 +3389,7 @@ function it({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o
3335
3389
  }
3336
3390
  //#endregion
3337
3391
  //#region src/components/AppInfoTip.jsx
3338
- function at({ label: e, children: r, ...i }) {
3392
+ function st({ label: e, children: r, ...i }) {
3339
3393
  E("AppInfoTip", i);
3340
3394
  let [a, c] = u(!1), [d, f] = u(null), p = l(null), m = l(null), h = o(), _ = l(!1);
3341
3395
  return s(() => {
@@ -3392,29 +3446,29 @@ function at({ label: e, children: r, ...i }) {
3392
3446
  }
3393
3447
  //#endregion
3394
3448
  //#region src/components/AppInput.jsx
3395
- var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: c = "text", size: d = "md", leftIcon: f, rightIcon: p, onRightIconClick: m, rightIconLabel: g, unit: _, id: v, name: y, className: b = "", fieldClassName: x = "", disabled: S = !1, clearable: C = !1, showCount: w = !1, maxLength: T, prefix: D, suffix: O, floatingLabel: A = !1, ...j }, M) {
3449
+ var ct = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: c = "text", size: d = "md", leftIcon: f, rightIcon: p, onRightIconClick: m, rightIconLabel: g, unit: _, id: v, name: y, className: b = "", fieldClassName: x = "", disabled: S = !1, clearable: C = !1, showCount: w = !1, maxLength: T, prefix: D, suffix: O, floatingLabel: A = !1, ...j }, M) {
3396
3450
  E("AppInput", j);
3397
- let [N, ee] = u(!1), P = v || y, F = c === "password", I = F && N ? "text" : c, L = l(null), te = (e) => {
3451
+ let [N, ee] = u(!1), P = v || y, F = c === "password", I = F && N ? "text" : c, L = l(null), R = (e) => {
3398
3452
  L.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
3399
- }, R = String(j.value ?? j.defaultValue ?? ""), [z, B] = u(() => !!R), [ne, V] = u(() => R.length), re = C && !S, ie = C || w, ae = (e) => {
3400
- B(!!e.target.value), V(e.target.value.length), j.onInput?.(e);
3401
- }, oe = re ? /* @__PURE__ */ t("button", {
3453
+ }, z = String(j.value ?? j.defaultValue ?? ""), [B, V] = u(() => !!z), [te, H] = u(() => z.length), ne = C && !S, re = C || w, U = (e) => {
3454
+ V(!!e.target.value), H(e.target.value.length), j.onInput?.(e);
3455
+ }, ie = ne ? /* @__PURE__ */ t("button", {
3402
3456
  type: "button",
3403
3457
  className: "input-clear",
3404
3458
  onClick: () => {
3405
3459
  let e = L.current;
3406
3460
  if (!e) return;
3407
3461
  let t = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
3408
- t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), B(!1), e.focus();
3462
+ t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), V(!1), e.focus();
3409
3463
  },
3410
3464
  "aria-label": "Clear",
3411
3465
  tabIndex: -1,
3412
- hidden: !z,
3466
+ hidden: !B,
3413
3467
  children: /* @__PURE__ */ t(k, {
3414
3468
  name: "x",
3415
3469
  size: 16
3416
3470
  })
3417
- }) : null, se = [
3471
+ }) : null, W = i && P ? `${P}-error` : void 0, G = a && P ? `${P}-hint` : void 0, K = W || G, q = [
3418
3472
  "input",
3419
3473
  d === "sm" ? "input-sm" : "",
3420
3474
  d === "lg" ? "input-lg" : "",
@@ -3423,26 +3477,27 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3423
3477
  _ ? "num-input" : "",
3424
3478
  C ? "has-clear" : "",
3425
3479
  b
3426
- ].filter(Boolean).join(" "), H = /* @__PURE__ */ t(h.Control, {
3480
+ ].filter(Boolean).join(" "), J = /* @__PURE__ */ t(h.Control, {
3427
3481
  id: P,
3428
3482
  name: y,
3429
3483
  type: I,
3430
- className: se,
3484
+ className: q,
3431
3485
  disabled: S,
3432
3486
  required: r,
3433
3487
  "aria-invalid": i ? "true" : "false",
3488
+ "aria-describedby": K,
3434
3489
  maxLength: T,
3435
3490
  ...j,
3436
3491
  placeholder: A ? " " : j.placeholder,
3437
- ref: te,
3438
- onInput: ie ? ae : j.onInput
3439
- }), U;
3440
- return U = A && e ? /* @__PURE__ */ n("div", {
3492
+ ref: R,
3493
+ onInput: re ? U : j.onInput
3494
+ }), Y;
3495
+ return Y = A && e ? /* @__PURE__ */ n("div", {
3441
3496
  className: "field-float",
3442
- children: [H, /* @__PURE__ */ n("label", {
3497
+ children: [J, /* @__PURE__ */ n("label", {
3443
3498
  className: "float-label",
3444
3499
  htmlFor: P,
3445
- children: [e, r && /* @__PURE__ */ t(Z, {})]
3500
+ children: [e, r && /* @__PURE__ */ t($, {})]
3446
3501
  })]
3447
3502
  }) : D || O ? /* @__PURE__ */ n("div", {
3448
3503
  className: "input-affixed",
@@ -3451,7 +3506,7 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3451
3506
  className: "affix affix-pre",
3452
3507
  children: D
3453
3508
  }),
3454
- H,
3509
+ J,
3455
3510
  O != null && /* @__PURE__ */ t("span", {
3456
3511
  className: "affix affix-suf",
3457
3512
  children: O
@@ -3459,13 +3514,13 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3459
3514
  ]
3460
3515
  }) : _ ? /* @__PURE__ */ n("div", {
3461
3516
  className: "input-with-unit",
3462
- children: [H, /* @__PURE__ */ t("span", {
3517
+ children: [J, /* @__PURE__ */ t("span", {
3463
3518
  className: "unit",
3464
3519
  children: _
3465
3520
  })]
3466
3521
  }) : F ? /* @__PURE__ */ n("div", {
3467
3522
  className: "input-wrap",
3468
- children: [H, /* @__PURE__ */ t("button", {
3523
+ children: [J, /* @__PURE__ */ t("button", {
3469
3524
  type: "button",
3470
3525
  className: "pw-toggle",
3471
3526
  onClick: () => ee((e) => !e),
@@ -3478,7 +3533,7 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3478
3533
  })]
3479
3534
  }) : p ? /* @__PURE__ */ n("div", {
3480
3535
  className: "input-wrap",
3481
- children: [H, /* @__PURE__ */ t("button", {
3536
+ children: [J, /* @__PURE__ */ t("button", {
3482
3537
  type: "button",
3483
3538
  className: "pw-toggle",
3484
3539
  onClick: m,
@@ -3500,8 +3555,8 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3500
3555
  size: 16
3501
3556
  })
3502
3557
  }),
3503
- H,
3504
- oe
3558
+ J,
3559
+ ie
3505
3560
  ]
3506
3561
  }) : f ? /* @__PURE__ */ n("div", {
3507
3562
  className: "input-icon",
@@ -3511,8 +3566,8 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3511
3566
  name: f,
3512
3567
  size: 16
3513
3568
  })
3514
- }), H]
3515
- }) : H, /* @__PURE__ */ n(h.Group, {
3569
+ }), J]
3570
+ }) : J, /* @__PURE__ */ n(h.Group, {
3516
3571
  className: `field${x ? ` ${x}` : ""}`,
3517
3572
  children: [
3518
3573
  e && !A && /* @__PURE__ */ n(h.Label, {
@@ -3520,59 +3575,61 @@ var ot = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
3520
3575
  htmlFor: P,
3521
3576
  children: [
3522
3577
  e,
3523
- r && /* @__PURE__ */ t(Z, {}),
3524
- o && /* @__PURE__ */ t(at, {
3578
+ r && /* @__PURE__ */ t($, {}),
3579
+ o && /* @__PURE__ */ t(st, {
3525
3580
  label: s,
3526
3581
  children: o
3527
3582
  })
3528
3583
  ]
3529
3584
  }),
3530
- U,
3585
+ Y,
3531
3586
  i ? /* @__PURE__ */ t("div", {
3532
3587
  className: "field-error",
3588
+ id: W,
3533
3589
  children: i
3534
3590
  }) : a ? /* @__PURE__ */ t("div", {
3535
3591
  className: "field-hint",
3592
+ id: G,
3536
3593
  children: a
3537
3594
  }) : null,
3538
3595
  w && /* @__PURE__ */ n("div", {
3539
- className: `field-count${T && ne >= T ? " at-limit" : ""}`,
3540
- children: [ne, T ? ` / ${T}` : ""]
3596
+ className: `field-count${T && te >= T ? " at-limit" : ""}`,
3597
+ children: [te, T ? ` / ${T}` : ""]
3541
3598
  })
3542
3599
  ]
3543
3600
  });
3544
- }), st = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
3545
- function ct({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer: c, size: u, wide: d = !1, side: f = !1, maxWidth: p, hideHeader: m = !1, className: h = "", children: g, ...v }) {
3546
- E("AppModal", v);
3547
- let y = l(null);
3601
+ }), lt = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
3602
+ function ut({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer: c, size: u, wide: d = !1, side: f = !1, maxWidth: p, hideHeader: m = !1, staticBackdrop: h = !1, className: g = "", children: v, ...y }) {
3603
+ E("AppModal", y);
3604
+ let b = l(null);
3548
3605
  a(() => {
3549
3606
  if (!e) return;
3550
- let t = y.current?.closest(".modal-content");
3607
+ let t = b.current?.closest(".modal-content");
3551
3608
  if (!t) return;
3552
- let n = () => Array.from(t.querySelectorAll(st));
3609
+ let n = () => Array.from(t.querySelectorAll(lt));
3553
3610
  (t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("wui-modal-close")) || n()[0] || t).focus?.();
3554
3611
  }, [e]);
3555
- let b = ["wui-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
3612
+ let x = ["wui-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), S = [
3556
3613
  "wui-modal",
3557
3614
  d ? "wui-modal-wide" : "",
3558
3615
  f ? "wui-modal-side" : "",
3559
- h
3616
+ g
3560
3617
  ].filter(Boolean).join(" ");
3561
3618
  return /* @__PURE__ */ n(_, {
3562
3619
  show: e,
3563
3620
  onHide: s,
3564
3621
  animation: !1,
3565
- backdrop: !0,
3566
- keyboard: !0,
3622
+ backdrop: !h || "static",
3623
+ keyboard: !h,
3567
3624
  autoFocus: !1,
3568
3625
  enforceFocus: !0,
3569
3626
  restoreFocus: !0,
3570
3627
  size: u,
3571
3628
  centered: !f,
3572
- className: b,
3629
+ className: x,
3573
3630
  style: p == null ? void 0 : { "--wui-modal-max-width": typeof p == "number" ? `${p}px` : p },
3574
3631
  dialogClassName: "wui-rb-dialog",
3575
- contentClassName: x,
3632
+ contentClassName: S,
3576
3633
  backdropClassName: "wui-modal-dim",
3577
3634
  "aria-label": typeof r == "string" ? r : void 0,
3578
3635
  children: [
@@ -3617,8 +3674,8 @@ function ct({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer:
3617
3674
  }),
3618
3675
  /* @__PURE__ */ t("div", {
3619
3676
  className: "wui-modal-body",
3620
- ref: y,
3621
- children: g
3677
+ ref: b,
3678
+ children: v
3622
3679
  }),
3623
3680
  c && /* @__PURE__ */ t("div", {
3624
3681
  className: "wui-modal-footer",
@@ -3629,42 +3686,47 @@ function ct({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer:
3629
3686
  }
3630
3687
  //#endregion
3631
3688
  //#region src/components/ModalIcons.jsx
3632
- var $ = (e) => function({ size: n = 72 }) {
3689
+ var dt = (e) => function({ size: n = 72 }) {
3633
3690
  return /* @__PURE__ */ t("wui-status-icon", {
3634
3691
  tone: e,
3635
3692
  size: n
3636
3693
  });
3637
- }, lt = {
3638
- success: $("success"),
3639
- error: $("error"),
3640
- warning: $("warning"),
3641
- info: $("info"),
3642
- delete: $("delete")
3694
+ }, ft = {
3695
+ success: dt("success"),
3696
+ error: dt("error"),
3697
+ warning: dt("warning"),
3698
+ info: dt("info"),
3699
+ delete: dt("delete")
3643
3700
  };
3644
3701
  //#endregion
3645
3702
  //#region src/components/AppConfirmDialog.jsx
3646
- function ut({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancelLabel: c = "Cancel", danger: l = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m, ...h }) {
3647
- E("AppConfirmDialog", h);
3648
- let [g, _] = u("");
3703
+ function pt({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancelLabel: c = "Cancel", danger: l = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m, loading: h = !1, staticBackdrop: g = !1, ..._ }) {
3704
+ E("AppConfirmDialog", _);
3705
+ let [v, y] = u("");
3649
3706
  if (a(() => {
3650
- r || _("");
3707
+ r || y("");
3651
3708
  }, [r]), !r) return null;
3652
- let v = !!f && g.trim() !== f, y = lt[d || (l ? "delete" : "info")];
3653
- return /* @__PURE__ */ t(ct, {
3709
+ let b = !!f && v.trim() !== f, x = ft[d || (l ? "delete" : "info")], S = () => {
3710
+ h || m?.();
3711
+ };
3712
+ return /* @__PURE__ */ t(ut, {
3654
3713
  open: r,
3655
3714
  hideHeader: !0,
3656
3715
  title: i,
3657
- onClose: m,
3716
+ onClose: S,
3717
+ staticBackdrop: g,
3658
3718
  className: "wui-confirm",
3659
3719
  footer: /* @__PURE__ */ n("div", {
3660
3720
  className: "wui-confirm-actions",
3661
- children: [/* @__PURE__ */ t(Q, {
3721
+ children: [/* @__PURE__ */ t(Qe, {
3662
3722
  variant: "secondary",
3663
- onClick: m,
3723
+ disabled: h,
3724
+ onClick: S,
3664
3725
  children: c
3665
- }), /* @__PURE__ */ t(Q, {
3726
+ }), /* @__PURE__ */ t(Qe, {
3666
3727
  variant: l ? "danger" : "primary",
3667
- disabled: v,
3728
+ disabled: b,
3729
+ loading: h,
3668
3730
  onClick: p,
3669
3731
  children: s
3670
3732
  })]
@@ -3672,9 +3734,9 @@ function ut({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
3672
3734
  children: /* @__PURE__ */ n("div", {
3673
3735
  className: "wui-confirm-content",
3674
3736
  children: [
3675
- y && /* @__PURE__ */ t("span", {
3737
+ x && /* @__PURE__ */ t("span", {
3676
3738
  className: "wui-confirm-icon",
3677
- children: /* @__PURE__ */ t(y, { size: 104 })
3739
+ children: /* @__PURE__ */ t(x, { size: 104 })
3678
3740
  }),
3679
3741
  /* @__PURE__ */ t("h3", {
3680
3742
  className: "wui-confirm-title",
@@ -3686,16 +3748,17 @@ function ut({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
3686
3748
  className: "wui-confirm-msg",
3687
3749
  children: o
3688
3750
  }),
3689
- f && /* @__PURE__ */ t(ot, {
3751
+ f && /* @__PURE__ */ t(ct, {
3690
3752
  fieldClassName: "mt-3 mb-0 w-100 text-start",
3691
3753
  label: /* @__PURE__ */ n(e, { children: [
3692
3754
  "Type ",
3693
3755
  /* @__PURE__ */ t("strong", { children: f }),
3694
3756
  " to confirm"
3695
3757
  ] }),
3696
- value: g,
3697
- onChange: (e) => _(e.target.value),
3698
- "aria-label": `Type ${f} to confirm`
3758
+ value: v,
3759
+ onChange: (e) => y(e.target.value),
3760
+ "aria-label": `Type ${f} to confirm`,
3761
+ disabled: h
3699
3762
  })
3700
3763
  ]
3701
3764
  })
@@ -3703,7 +3766,7 @@ function ut({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
3703
3766
  }
3704
3767
  //#endregion
3705
3768
  //#region src/components/AppSkeleton.jsx
3706
- function dt({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
3769
+ function mt({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
3707
3770
  return E("AppSkeleton", o), /* @__PURE__ */ t("span", {
3708
3771
  className: `skeleton${i ? ` ${i}` : ""}`,
3709
3772
  "aria-hidden": "true",
@@ -3716,7 +3779,7 @@ function dt({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
3716
3779
  ...o
3717
3780
  });
3718
3781
  }
3719
- var ft = [
3782
+ var ht = [
3720
3783
  "r0",
3721
3784
  "r1",
3722
3785
  "r2",
@@ -3725,7 +3788,7 @@ var ft = [
3725
3788
  "r5",
3726
3789
  "r6",
3727
3790
  "r7"
3728
- ], pt = [
3791
+ ], gt = [
3729
3792
  "c0",
3730
3793
  "c1",
3731
3794
  "c2",
@@ -3735,15 +3798,15 @@ var ft = [
3735
3798
  "c6",
3736
3799
  "c7"
3737
3800
  ];
3738
- function mt({ rows: e = 4, cols: n = 5 }) {
3739
- return ft.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: pt.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(dt, {
3801
+ function _t({ rows: e = 4, cols: n = 5 }) {
3802
+ return ht.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: gt.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(mt, {
3740
3803
  width: n === 0 ? "70%" : "50%",
3741
3804
  height: 12
3742
3805
  }) }, e)) }, e));
3743
3806
  }
3744
3807
  //#endregion
3745
3808
  //#region src/components/AppSelectMini.jsx
3746
- function ht({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: c, disabled: u, size: d, icon: f, prefix: p, className: m, ...h }) {
3809
+ function vt({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: c, disabled: u, size: d, icon: f, prefix: p, className: m, ...h }) {
3747
3810
  E("AppSelectMini", h);
3748
3811
  let g = l(null);
3749
3812
  return a(() => {
@@ -3777,19 +3840,19 @@ function ht({ value: e, onChange: n, options: r = [], placeholder: i = "Select..
3777
3840
  }
3778
3841
  //#endregion
3779
3842
  //#region src/components/AppTablePagination.jsx
3780
- var gt = [
3843
+ var yt = [
3781
3844
  5,
3782
3845
  10,
3783
3846
  25,
3784
3847
  50
3785
3848
  ];
3786
- function _t({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = gt, ...d }) {
3849
+ function bt({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = yt, ...d }) {
3787
3850
  return E("AppTablePagination", d), /* @__PURE__ */ n("div", {
3788
3851
  className: "table-pagination",
3789
3852
  children: [
3790
3853
  /* @__PURE__ */ n("span", {
3791
3854
  className: "tpg-rows",
3792
- children: ["Rows per page:", /* @__PURE__ */ t(ht, {
3855
+ children: ["Rows per page:", /* @__PURE__ */ t(vt, {
3793
3856
  value: i,
3794
3857
  onChange: (e) => l(Number(e)),
3795
3858
  ariaLabel: "Rows per page",
@@ -3838,15 +3901,15 @@ function _t({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
3838
3901
  }
3839
3902
  //#endregion
3840
3903
  //#region src/components/AppDataTable.jsx
3841
- function vt(e) {
3904
+ function xt(e) {
3842
3905
  return e === "end" ? "wui-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
3843
3906
  }
3844
- function yt(e) {
3907
+ function St(e) {
3845
3908
  return e == null || e === "" ? "—" : typeof e == "boolean" ? String(e) : e;
3846
3909
  }
3847
- function bt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: x, ...S }) {
3910
+ function Ct({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: x, ...S }) {
3848
3911
  E("AppDataTable", S);
3849
- let C = Math.max(1, r.length + +!!p + +!!v), w = v && i ? i.reduce((e, t) => e + +!!y?.has(a(t)), 0) : 0, T = v && i && i.length > 0 && w === i.length, D = w > 0 && !T, O = (e) => {
3912
+ let C = Math.max(1, r.length + +!!p + +!!v), w = v && i ? i.reduce((e, t, n) => e + +!!y?.has(a(t, n)), 0) : 0, T = v && i && i.length > 0 && w === i.length, D = w > 0 && !T, O = (e) => {
3850
3913
  e && (e.indeterminate = D);
3851
3914
  }, A = d !== void 0 && f > 0 ? d : u;
3852
3915
  return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
@@ -3869,7 +3932,7 @@ function bt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
3869
3932
  r.map((e, r) => {
3870
3933
  let i = !!(e.sortable && s), a = o && o.key === e.key;
3871
3934
  return /* @__PURE__ */ n("th", {
3872
- className: (i ? "sortable " : "") + (r === 0 ? "wui-name-cell " : "") + vt(e.align),
3935
+ className: (i ? "sortable " : "") + (r === 0 ? "wui-name-cell " : "") + xt(e.align),
3873
3936
  style: e.width ? { width: e.width } : void 0,
3874
3937
  tabIndex: i ? 0 : void 0,
3875
3938
  "aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
@@ -3896,41 +3959,41 @@ function bt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
3896
3959
  children: "Actions"
3897
3960
  })
3898
3961
  }))
3899
- ] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(mt, {
3962
+ ] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(_t, {
3900
3963
  rows: l,
3901
3964
  cols: C
3902
- }) : i?.length ? i.map((e) => {
3903
- let i = a(e);
3965
+ }) : i?.length ? i.map((e, i) => {
3966
+ let o = a(e, i);
3904
3967
  return /* @__PURE__ */ n("tr", {
3905
- className: v && y?.has(i) ? "is-selected" : void 0,
3968
+ className: v && y?.has(o) ? "is-selected" : void 0,
3906
3969
  children: [
3907
3970
  v && /* @__PURE__ */ t("td", {
3908
3971
  className: "wui-select-cell",
3909
3972
  children: /* @__PURE__ */ t("input", {
3910
3973
  type: "checkbox",
3911
3974
  className: "wui-check",
3912
- checked: y?.has(i) || !1,
3913
- onChange: () => b?.(i),
3975
+ checked: y?.has(o) || !1,
3976
+ onChange: () => b?.(o),
3914
3977
  "aria-label": "Select row"
3915
3978
  })
3916
3979
  }),
3917
3980
  r.map((n, r) => /* @__PURE__ */ t("td", {
3918
- className: (r === 0 ? "wui-name-cell " : "") + vt(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
3919
- children: n.render ? n.render(e) : yt(e[n.key])
3981
+ className: (r === 0 ? "wui-name-cell " : "") + xt(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
3982
+ children: n.render ? n.render(e) : St(e[n.key])
3920
3983
  }, n.key)),
3921
3984
  p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
3922
3985
  className: "u-row-actions",
3923
3986
  children: p(e)
3924
3987
  }) })
3925
3988
  ]
3926
- }, i);
3989
+ }, o);
3927
3990
  }) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
3928
3991
  colSpan: C,
3929
3992
  className: "wui-table-empty",
3930
3993
  children: A
3931
3994
  }) }) })]
3932
3995
  })
3933
- }), h && !c && h.total > 0 && /* @__PURE__ */ t(_t, {
3996
+ }), h && !c && h.total > 0 && /* @__PURE__ */ t(bt, {
3934
3997
  page: h.page,
3935
3998
  totalPages: h.totalPages,
3936
3999
  pageSize: h.pageSize,
@@ -3943,7 +4006,7 @@ function bt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
3943
4006
  }
3944
4007
  //#endregion
3945
4008
  //#region src/components/AppDatePicker.jsx
3946
- function xt({ value: e, onChange: r, label: i, required: s = !1, hint: c, error: u, name: d, min: f, max: p, placeholder: m = "Enter Date", disabled: h, size: g, firstDay: _, id: v, ariaLabel: y, className: b = "", ...x }) {
4009
+ function wt({ value: e, onChange: r, label: i, required: s = !1, hint: c, error: u, name: d, min: f, max: p, placeholder: m = "Enter Date", disabled: h, size: g, firstDay: _, id: v, ariaLabel: y, className: b = "", ...x }) {
3947
4010
  E("AppDatePicker", x);
3948
4011
  let S = l(null), C = o(), w = v || d || C;
3949
4012
  a(() => {
@@ -3996,7 +4059,7 @@ function xt({ value: e, onChange: r, label: i, required: s = !1, hint: c, error:
3996
4059
  }
3997
4060
  //#endregion
3998
4061
  //#region src/components/AppDateRangePicker.jsx
3999
- function St({ start: e, end: r, onChange: i, label: s, required: c = !1, hint: u, error: d, startName: f, endName: p, min: m, max: h, placeholder: g = "Start – End", disabled: _, size: v, firstDay: y, id: b, ariaLabel: x, className: S = "", ...C }) {
4062
+ function Tt({ start: e, end: r, onChange: i, label: s, required: c = !1, hint: u, error: d, startName: f, endName: p, min: m, max: h, placeholder: g = "Start – End", disabled: _, size: v, firstDay: y, id: b, ariaLabel: x, className: S = "", ...C }) {
4000
4063
  E("AppDateRangePicker", C);
4001
4064
  let w = l(null), T = o(), D = b || f || T;
4002
4065
  a(() => {
@@ -4053,7 +4116,7 @@ function St({ start: e, end: r, onChange: i, label: s, required: c = !1, hint: u
4053
4116
  }
4054
4117
  //#endregion
4055
4118
  //#region src/components/AppDropdown.jsx
4056
- var Ct = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
4119
+ var Et = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
4057
4120
  return /* @__PURE__ */ t("button", {
4058
4121
  ref: l,
4059
4122
  type: "button",
@@ -4067,11 +4130,11 @@ var Ct = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
4067
4130
  })
4068
4131
  });
4069
4132
  });
4070
- function wt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u, ...d }) {
4133
+ function Dt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u, ...d }) {
4071
4134
  return E("AppDropdown", d), /* @__PURE__ */ n(v, {
4072
4135
  align: s,
4073
4136
  children: [/* @__PURE__ */ t(v.Toggle, {
4074
- as: Ct,
4137
+ as: Et,
4075
4138
  icon: e,
4076
4139
  iconSize: r,
4077
4140
  btnClassName: i,
@@ -4081,6 +4144,7 @@ function wt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
4081
4144
  className: l,
4082
4145
  renderOnMount: !0,
4083
4146
  children: c.map((e) => {
4147
+ if (e.divider) return /* @__PURE__ */ t(v.Divider, {}, e.key);
4084
4148
  let r = e.to ? u ? {
4085
4149
  as: u,
4086
4150
  to: e.to
@@ -4109,7 +4173,7 @@ function wt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
4109
4173
  }
4110
4174
  //#endregion
4111
4175
  //#region src/components/AppEmptyState.jsx
4112
- function Tt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
4176
+ function Ot({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
4113
4177
  return E("AppEmptyState", u), /* @__PURE__ */ n("div", {
4114
4178
  className: [
4115
4179
  "empty-state",
@@ -4142,33 +4206,33 @@ function Tt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
4142
4206
  }
4143
4207
  //#endregion
4144
4208
  //#region src/components/AppFileAttachment.jsx
4145
- function Et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: l = Le, maxSizeMb: d = 5, optional: f = !1, error: p, id: m, ...h }) {
4209
+ function kt({ label: r = "Attachment", value: i, name: a, onChange: s, multiple: c = !1, accept: l = Fe, maxSizeMb: d = 5, optional: f = !1, error: p, id: m, ...h }) {
4146
4210
  E("AppFileAttachment", h);
4147
- let g = o(), _ = m || s || g, [v, y] = u(null), [b, x] = u("");
4148
- a(() => {
4149
- if (i instanceof File) {
4150
- let e = URL.createObjectURL(i);
4151
- return y(e), () => URL.revokeObjectURL(e);
4152
- }
4153
- y(i?.url || null);
4154
- }, [i]);
4155
- function S(e) {
4156
- let t = e.target.files?.[0];
4157
- if (e.target.value = "", !t) return;
4158
- let n = Ue(t, {
4159
- accept: l,
4160
- maxSizeMb: d
4161
- });
4162
- if (n) {
4163
- x(n);
4164
- return;
4211
+ let g = o(), _ = m || a || g, [v, y] = u(""), b = c && Array.isArray(i) ? i : i ? [i] : [], x = Ve(l), S = (e) => e instanceof File ? Be(e) : x || Be(e), C = !c && b.length === 1 && S(b[0]);
4212
+ function w(e) {
4213
+ let t = Array.from(e.target.files || []);
4214
+ if (e.target.value = "", !t.length) return;
4215
+ let n = [], r = "";
4216
+ for (let e of t) {
4217
+ let t = We(e, {
4218
+ accept: l,
4219
+ maxSizeMb: d
4220
+ });
4221
+ if (t) {
4222
+ r ||= t;
4223
+ continue;
4224
+ }
4225
+ n.push(e);
4165
4226
  }
4166
- x(""), c(t);
4227
+ if (y(r), n.length) if (c) {
4228
+ let e = Array.isArray(i) ? i : i ? [i] : [], t = new Set(e.map(At));
4229
+ s(e.concat(n.filter((e) => !t.has(At(e)))));
4230
+ } else s(n[0]);
4167
4231
  }
4168
- function C() {
4169
- x(""), c(null);
4232
+ function T(e) {
4233
+ y(""), s(c ? b.filter((t, n) => n !== e) : null);
4170
4234
  }
4171
- let w = i instanceof File ? i.name : i?.name, T = i instanceof File ? `${(i.size / 1024).toFixed(0)} KB` : null, D = p || b;
4235
+ let D = p || v, O = c || b.length === 0, A = x ? "image" : "file", j = c ? `Add ${A}s` : `Add ${x ? "an" : "a"} ${A}`;
4172
4236
  return /* @__PURE__ */ n("div", {
4173
4237
  className: "field",
4174
4238
  children: [
@@ -4180,41 +4244,14 @@ function Et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: l
4180
4244
  children: " (optional)"
4181
4245
  })]
4182
4246
  }),
4183
- i ? /* @__PURE__ */ n("div", {
4184
- className: "attach-preview",
4185
- children: [/* @__PURE__ */ n("div", {
4186
- className: "attach-figure",
4187
- children: [/* @__PURE__ */ t("img", {
4188
- src: v,
4189
- alt: w
4190
- }), /* @__PURE__ */ t("button", {
4191
- type: "button",
4192
- className: "attach-remove",
4193
- "aria-label": "Remove attachment",
4194
- onClick: C,
4195
- children: /* @__PURE__ */ t(k, {
4196
- name: "x",
4197
- size: 18
4198
- })
4199
- })]
4200
- }), /* @__PURE__ */ n("div", {
4201
- className: "attach-meta",
4202
- children: [/* @__PURE__ */ t("div", {
4203
- className: "attach-name",
4204
- children: w
4205
- }), T && /* @__PURE__ */ t("div", {
4206
- className: "attach-size",
4207
- children: T
4208
- })]
4209
- })]
4210
- }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("label", {
4247
+ O && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("label", {
4211
4248
  className: "attach-drop",
4212
4249
  htmlFor: _,
4213
4250
  children: [
4214
4251
  /* @__PURE__ */ t("span", {
4215
4252
  className: "attach-drop-icon",
4216
4253
  children: /* @__PURE__ */ t(k, {
4217
- name: "image",
4254
+ name: x ? "image" : "file-text",
4218
4255
  size: 18
4219
4256
  })
4220
4257
  }),
@@ -4222,11 +4259,12 @@ function Et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: l
4222
4259
  className: "attach-drop-copy",
4223
4260
  children: [/* @__PURE__ */ t("span", {
4224
4261
  className: "attach-drop-title",
4225
- children: "Add an image"
4262
+ children: j
4226
4263
  }), /* @__PURE__ */ n("span", {
4227
4264
  className: "attach-drop-hint",
4228
4265
  children: [
4229
- "PNG, JPG or WEBP, up to ",
4266
+ He(l),
4267
+ ", up to ",
4230
4268
  d,
4231
4269
  " MB"
4232
4270
  ]
@@ -4240,11 +4278,24 @@ function Et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: l
4240
4278
  }), /* @__PURE__ */ t("input", {
4241
4279
  id: _,
4242
4280
  type: "file",
4243
- className: "visually-hidden-input",
4244
- name: s,
4281
+ hidden: !0,
4282
+ name: a,
4245
4283
  accept: l,
4246
- onChange: S
4284
+ multiple: c || void 0,
4285
+ onChange: w
4247
4286
  })] }),
4287
+ C ? /* @__PURE__ */ t(Nt, {
4288
+ item: b[0],
4289
+ isImage: !0,
4290
+ onRemove: () => T(0)
4291
+ }) : b.length > 0 && /* @__PURE__ */ t("div", {
4292
+ className: "attach-list",
4293
+ children: b.map((e, n) => /* @__PURE__ */ t(Pt, {
4294
+ item: e,
4295
+ isImage: S(e),
4296
+ onRemove: () => T(n)
4297
+ }, At(e)))
4298
+ }),
4248
4299
  D && /* @__PURE__ */ t("div", {
4249
4300
  className: "field-error",
4250
4301
  children: D
@@ -4252,76 +4303,177 @@ function Et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: l
4252
4303
  ]
4253
4304
  });
4254
4305
  }
4255
- //#endregion
4256
- //#region src/components/toast.js
4257
- var Dt = /* @__PURE__ */ new Set([
4258
- "success",
4259
- "info",
4260
- "warning",
4261
- "error"
4262
- ]);
4263
- function Ot(e, t = "success") {
4264
- let n = Dt.has(t) ? t : "success";
4265
- y[n](e, { toastId: `${n}:${e}` });
4306
+ function At(e) {
4307
+ return e instanceof File ? `${e.name}:${e.size}` : e?.url || e?.name || "item";
4266
4308
  }
4267
- function kt(e) {
4268
- y.error(e, { toastId: `error:${e}` });
4309
+ function jt(e) {
4310
+ return e instanceof File ? e.name : e?.name;
4311
+ }
4312
+ function Mt(e, t) {
4313
+ let [n, r] = u(null);
4314
+ return a(() => {
4315
+ if (!t) {
4316
+ r(null);
4317
+ return;
4318
+ }
4319
+ if (e instanceof File) {
4320
+ let t = URL.createObjectURL(e);
4321
+ return r(t), () => URL.revokeObjectURL(t);
4322
+ }
4323
+ r(e?.url || null);
4324
+ }, [e, t]), n;
4325
+ }
4326
+ function Nt({ item: e, isImage: r, onRemove: i }) {
4327
+ let a = Mt(e, r), o = jt(e), s = e instanceof File ? `${(e.size / 1024).toFixed(0)} KB` : null;
4328
+ return /* @__PURE__ */ n("div", {
4329
+ className: "attach-preview",
4330
+ children: [/* @__PURE__ */ n("div", {
4331
+ className: "attach-figure",
4332
+ children: [/* @__PURE__ */ t("img", {
4333
+ src: a,
4334
+ alt: o
4335
+ }), /* @__PURE__ */ t("button", {
4336
+ type: "button",
4337
+ className: "attach-remove",
4338
+ "aria-label": "Remove attachment",
4339
+ onClick: i,
4340
+ children: /* @__PURE__ */ t(k, {
4341
+ name: "x",
4342
+ size: 18
4343
+ })
4344
+ })]
4345
+ }), /* @__PURE__ */ n("div", {
4346
+ className: "attach-meta",
4347
+ children: [/* @__PURE__ */ t("div", {
4348
+ className: "attach-name",
4349
+ children: o
4350
+ }), s && /* @__PURE__ */ t("div", {
4351
+ className: "attach-size",
4352
+ children: s
4353
+ })]
4354
+ })]
4355
+ });
4356
+ }
4357
+ function Pt({ item: e, isImage: r, onRemove: i }) {
4358
+ let a = Mt(e, r), o = jt(e), s = e instanceof File ? `${(e.size / 1024).toFixed(0)} KB` : null;
4359
+ return /* @__PURE__ */ n("div", {
4360
+ className: "attach-item",
4361
+ children: [
4362
+ /* @__PURE__ */ t("span", {
4363
+ className: "attach-item-media",
4364
+ children: a ? /* @__PURE__ */ t("img", {
4365
+ src: a,
4366
+ alt: o
4367
+ }) : /* @__PURE__ */ t(k, {
4368
+ name: "file-text",
4369
+ size: 18
4370
+ })
4371
+ }),
4372
+ /* @__PURE__ */ n("span", {
4373
+ className: "attach-item-info",
4374
+ children: [/* @__PURE__ */ t("span", {
4375
+ className: "attach-name",
4376
+ children: o
4377
+ }), s && /* @__PURE__ */ t("span", {
4378
+ className: "attach-size",
4379
+ children: s
4380
+ })]
4381
+ }),
4382
+ /* @__PURE__ */ t("button", {
4383
+ type: "button",
4384
+ className: "attach-item-remove",
4385
+ "aria-label": `Remove ${o || "attachment"}`,
4386
+ onClick: i,
4387
+ children: /* @__PURE__ */ t(k, {
4388
+ name: "x",
4389
+ size: 16
4390
+ })
4391
+ })
4392
+ ]
4393
+ });
4269
4394
  }
4270
4395
  //#endregion
4271
4396
  //#region src/components/AppFilePicker.jsx
4272
- function At({ label: e, value: r, name: i, onPick: s, accept: c = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p, ...m }) {
4273
- E("AppFilePicker", m);
4274
- let [h, g] = u(null), [_, v] = u(!1), y = l(null), b = o(), x = i || b;
4397
+ function Ft({ label: e, value: r, name: i, onPick: s, multiple: c = !1, maxFiles: d, accept: f = ".jpg,.jpeg,.png", maxSizeMb: p = 5, required: m, error: h, className: g = "", ..._ }) {
4398
+ E("AppFilePicker", _);
4399
+ let [v, y] = u(null), [b, x] = u(!1), [S, C] = u(""), w = l(null), T = o(), D = i || T;
4275
4400
  a(() => {
4276
- if (r instanceof File) {
4401
+ if (!c && r instanceof File) {
4277
4402
  let e = URL.createObjectURL(r);
4278
- return g(e), () => URL.revokeObjectURL(e);
4403
+ return y(e), () => URL.revokeObjectURL(e);
4279
4404
  }
4280
- g(null);
4281
- }, [r]);
4282
- let S = r?.url || h, C = (e) => {
4283
- let t = Ue(e, {
4284
- accept: c,
4285
- maxSizeMb: d
4405
+ y(null);
4406
+ }, [r, c]);
4407
+ let O = c ? Array.isArray(r) ? r : r ? [r] : [] : [], A = c ? null : r?.url || v, j = h || S, M = Ve(f), N = (e) => {
4408
+ let t = We(e, {
4409
+ accept: f,
4410
+ maxSizeMb: p
4286
4411
  });
4287
- return t ? (Ot(t, "error"), !1) : (s(e), !0);
4288
- }, w = (e) => {
4412
+ return t ? (C(t), !1) : (C(""), s(e), !0);
4413
+ }, ee = (e) => {
4414
+ let t = Array.from(e || []);
4415
+ if (!t.length) return;
4416
+ let n = Array.isArray(r) ? r : r ? [r] : [], i = new Set(n.map(It)), a = "", o = [];
4417
+ for (let e of t) {
4418
+ let t = We(e, {
4419
+ accept: f,
4420
+ maxSizeMb: p
4421
+ });
4422
+ if (t) {
4423
+ a ||= t;
4424
+ continue;
4425
+ }
4426
+ i.has(It(e)) || (i.add(It(e)), o.push(e));
4427
+ }
4428
+ let c = n.concat(o);
4429
+ d && c.length > d && (c = c.slice(0, d), a ||= `Up to ${d} files.`), C(a), s(c);
4430
+ }, P = (e) => {
4431
+ if (c) {
4432
+ ee(e.target.files);
4433
+ return;
4434
+ }
4289
4435
  let t = e.target.files?.[0] || null;
4290
- t && (C(t) || (e.target.value = ""));
4291
- }, T = (e) => {
4292
- e.preventDefault(), v(!1);
4436
+ t && (N(t) || (e.target.value = ""));
4437
+ }, F = (e) => {
4438
+ if (e.preventDefault(), x(!1), c) {
4439
+ ee(e.dataTransfer.files);
4440
+ return;
4441
+ }
4293
4442
  let t = e.dataTransfer.files?.[0];
4294
- t && C(t);
4295
- }, D = () => y.current?.click(), O = /* @__PURE__ */ t("input", {
4296
- id: x,
4443
+ t && N(t);
4444
+ }, I = (e) => {
4445
+ C(""), s(O.filter((t, n) => n !== e));
4446
+ }, L = () => w.current?.click(), R = /* @__PURE__ */ t("input", {
4447
+ id: D,
4297
4448
  name: i,
4298
- ref: y,
4449
+ ref: w,
4299
4450
  type: "file",
4300
- accept: c,
4451
+ accept: f,
4452
+ multiple: c || void 0,
4301
4453
  hidden: !0,
4302
4454
  onClick: (e) => {
4303
4455
  e.currentTarget.value = "";
4304
4456
  },
4305
- onChange: w
4457
+ onChange: P
4306
4458
  });
4307
4459
  return /* @__PURE__ */ n("div", {
4308
- className: "field",
4460
+ className: `field${g ? ` ${g}` : ""}`,
4309
4461
  children: [
4310
4462
  /* @__PURE__ */ n("label", {
4311
4463
  className: "label",
4312
- htmlFor: x,
4313
- children: [e, f && /* @__PURE__ */ t(Z, {})]
4464
+ htmlFor: D,
4465
+ children: [e, m && /* @__PURE__ */ t($, {})]
4314
4466
  }),
4315
- S ? /* @__PURE__ */ n("div", {
4316
- className: `file-preview${p ? " error" : ""}`,
4467
+ A ? /* @__PURE__ */ n("div", {
4468
+ className: `file-preview${j ? " error" : ""}`,
4317
4469
  children: [
4318
4470
  /* @__PURE__ */ n("button", {
4319
4471
  type: "button",
4320
4472
  className: "file-preview-open",
4321
4473
  "aria-label": `Change ${e}`,
4322
- onClick: D,
4474
+ onClick: L,
4323
4475
  children: [/* @__PURE__ */ t("img", {
4324
- src: S,
4476
+ src: A,
4325
4477
  alt: `${e} preview`,
4326
4478
  className: "file-preview-img"
4327
4479
  }), /* @__PURE__ */ t("span", {
@@ -4346,56 +4498,121 @@ function At({ label: e, value: r, name: i, onPick: s, accept: c = ".jpg,.jpeg,.p
4346
4498
  size: 16
4347
4499
  })
4348
4500
  }),
4349
- O
4501
+ R
4350
4502
  ]
4351
4503
  }) : /* @__PURE__ */ n("div", {
4352
- className: `file-input file-input-tall${_ ? " dragging" : ""}${p ? " error" : ""}`,
4504
+ className: `file-input file-input-tall${b ? " dragging" : ""}${j ? " error" : ""}${c && O.length > 0 ? " has-files" : ""}`,
4353
4505
  onDragOver: (e) => {
4354
- e.preventDefault(), _ || v(!0);
4506
+ e.preventDefault(), b || x(!0);
4355
4507
  },
4356
4508
  onDragLeave: (e) => {
4357
- e.preventDefault(), v(!1);
4509
+ e.preventDefault(), x(!1);
4358
4510
  },
4359
- onDrop: T,
4360
- children: [/* @__PURE__ */ n("label", {
4361
- htmlFor: x,
4362
- className: "file-input-zone-label",
4363
- children: [
4364
- /* @__PURE__ */ t("span", {
4365
- className: "file-input-icon",
4366
- children: /* @__PURE__ */ t(k, {
4367
- name: "upload",
4368
- size: 24
4511
+ onDrop: F,
4512
+ children: [
4513
+ /* @__PURE__ */ n("label", {
4514
+ htmlFor: D,
4515
+ className: "file-input-zone-label",
4516
+ children: [
4517
+ /* @__PURE__ */ t("span", {
4518
+ className: "file-input-icon",
4519
+ children: /* @__PURE__ */ t(k, {
4520
+ name: "upload",
4521
+ size: 24
4522
+ })
4523
+ }),
4524
+ /* @__PURE__ */ n("span", {
4525
+ className: "file-input-title",
4526
+ children: [/* @__PURE__ */ t("span", {
4527
+ className: "browse",
4528
+ children: "Click to upload"
4529
+ }), " or drag & drop"]
4530
+ }),
4531
+ /* @__PURE__ */ n("span", {
4532
+ className: "file-input-text",
4533
+ children: [
4534
+ He(f),
4535
+ " · up to ",
4536
+ p,
4537
+ " MB"
4538
+ ]
4369
4539
  })
4370
- }),
4371
- /* @__PURE__ */ n("span", {
4372
- className: "file-input-title",
4373
- children: [/* @__PURE__ */ t("span", {
4374
- className: "browse",
4375
- children: "Click to upload"
4376
- }), " or drag & drop"]
4377
- }),
4378
- /* @__PURE__ */ n("span", {
4379
- className: "file-input-text",
4380
- children: [
4381
- "JPG, JPEG or PNG · up to ",
4382
- d,
4383
- " MB"
4384
- ]
4385
- })
4386
- ]
4387
- }), O]
4540
+ ]
4541
+ }),
4542
+ R,
4543
+ c && O.length > 0 && /* @__PURE__ */ t("div", {
4544
+ className: "attach-list",
4545
+ children: O.map((e, n) => /* @__PURE__ */ t(Lt, {
4546
+ item: e,
4547
+ isImage: e instanceof File ? Be(e) : M || Be(e),
4548
+ onRemove: () => I(n)
4549
+ }, It(e)))
4550
+ })
4551
+ ]
4388
4552
  }),
4389
- p && /* @__PURE__ */ t("div", {
4553
+ j && /* @__PURE__ */ t("div", {
4390
4554
  className: "field-error",
4391
- children: p
4555
+ children: j
4556
+ })
4557
+ ]
4558
+ });
4559
+ }
4560
+ function It(e) {
4561
+ return e instanceof File ? `${e.name}:${e.size}` : e?.url || e?.name || "item";
4562
+ }
4563
+ function Lt({ item: e, isImage: r, onRemove: i }) {
4564
+ let [o, s] = u(null);
4565
+ a(() => {
4566
+ if (!r) {
4567
+ s(null);
4568
+ return;
4569
+ }
4570
+ if (e instanceof File) {
4571
+ let t = URL.createObjectURL(e);
4572
+ return s(t), () => URL.revokeObjectURL(t);
4573
+ }
4574
+ s(e?.url || null);
4575
+ }, [e, r]);
4576
+ let c = e instanceof File ? e.name : e?.name, l = e instanceof File ? `${(e.size / 1024).toFixed(0)} KB` : null;
4577
+ return /* @__PURE__ */ n("div", {
4578
+ className: "attach-item",
4579
+ children: [
4580
+ /* @__PURE__ */ t("span", {
4581
+ className: "attach-item-media",
4582
+ children: o ? /* @__PURE__ */ t("img", {
4583
+ src: o,
4584
+ alt: c
4585
+ }) : /* @__PURE__ */ t(k, {
4586
+ name: "file-text",
4587
+ size: 18
4588
+ })
4589
+ }),
4590
+ /* @__PURE__ */ n("span", {
4591
+ className: "attach-item-info",
4592
+ children: [/* @__PURE__ */ t("span", {
4593
+ className: "attach-name",
4594
+ children: c
4595
+ }), l && /* @__PURE__ */ t("span", {
4596
+ className: "attach-size",
4597
+ children: l
4598
+ })]
4599
+ }),
4600
+ /* @__PURE__ */ t("button", {
4601
+ type: "button",
4602
+ className: "attach-item-remove",
4603
+ "aria-label": `Remove ${c || "file"}`,
4604
+ onClick: i,
4605
+ children: /* @__PURE__ */ t(k, {
4606
+ name: "x",
4607
+ size: 16
4608
+ })
4392
4609
  })
4393
4610
  ]
4394
4611
  });
4395
4612
  }
4396
4613
  //#endregion
4397
4614
  //#region src/components/AppInfoList.jsx
4398
- function jt({ items: r = [], className: i = "", ...a }) {
4615
+ function Rt({ items: r = [], className: i = "", ...a }) {
4399
4616
  return E("AppInfoList", a), /* @__PURE__ */ t("div", {
4400
4617
  className: `info-list${i ? ` ${i}` : ""}`,
4401
4618
  children: r.map((r, i) => {
@@ -4428,7 +4645,7 @@ function jt({ items: r = [], className: i = "", ...a }) {
4428
4645
  }
4429
4646
  //#endregion
4430
4647
  //#region src/components/AppKpiTile.jsx
4431
- function Mt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
4648
+ function zt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
4432
4649
  E("AppKpiTile", l);
4433
4650
  let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
4434
4651
  return /* @__PURE__ */ n("div", {
@@ -4461,68 +4678,138 @@ function Mt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
4461
4678
  }
4462
4679
  //#endregion
4463
4680
  //#region src/components/AppLogoPicker.jsx
4464
- function Nt({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept: c = "image/png,image/jpeg", maxSizeMb: u = 5, overlayIcon: d = "image", overlayLabel: f = "Update photo", ariaLabel: p = "Upload photo", ...m }) {
4465
- E("AppLogoPicker", m);
4466
- let h = l(null);
4467
- return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
4468
- type: "button",
4469
- className: "set-uploader",
4470
- "aria-busy": s || void 0,
4471
- disabled: s,
4472
- onClick: () => {
4473
- s || h.current?.click();
4474
- },
4475
- "aria-label": p,
4476
- children: /* @__PURE__ */ n("span", {
4477
- className: "set-uploader-ring",
4478
- children: [r ? /* @__PURE__ */ t("img", {
4479
- className: "set-uploader-img",
4480
- src: r,
4481
- alt: ""
4482
- }) : /* @__PURE__ */ t("span", {
4483
- className: "set-uploader-logo",
4484
- children: i
4485
- }), s ? /* @__PURE__ */ t("span", {
4486
- className: "set-uploader-overlay is-loading",
4487
- "aria-hidden": "true",
4488
- children: /* @__PURE__ */ t(k, {
4489
- name: "refresh-cw",
4490
- size: 22,
4491
- className: "wui-spin"
4492
- })
4493
- }) : /* @__PURE__ */ n("span", {
4494
- className: "set-uploader-overlay",
4495
- children: [/* @__PURE__ */ t(k, {
4496
- name: d,
4497
- size: 22
4498
- }), /* @__PURE__ */ t("span", { children: f })]
4499
- })]
4500
- })
4501
- }), /* @__PURE__ */ t("input", {
4502
- ref: h,
4503
- type: "file",
4504
- name: a,
4505
- hidden: !0,
4506
- accept: c,
4507
- onChange: (e) => {
4508
- let t = e.target.files?.[0];
4509
- if (e.target.value = "", !t) return;
4510
- let n = Ue(t, {
4511
- accept: c,
4512
- maxSizeMb: u
4513
- });
4514
- if (n) {
4515
- Ot(n, "error");
4516
- return;
4517
- }
4518
- o(t);
4519
- },
4520
- disabled: s
4521
- })] });
4681
+ var Bt = {
4682
+ sm: 72,
4683
+ md: 120,
4684
+ lg: 160
4685
+ };
4686
+ function Vt({ value: e, fallback: r, name: i, onPick: s, onRemove: c, loading: d = !1, disabled: f = !1, accept: p = "image/png,image/jpeg,image/webp", maxSizeMb: m = 5, overlayIcon: h = "image", overlayLabel: g = "Update photo", ariaLabel: _ = "Upload photo", label: v, hint: y, error: b, required: x = !1, variant: S = "initials", size: C = "md", shape: w = "circle", className: T = "", ...D }) {
4687
+ E("AppLogoPicker", D);
4688
+ let O = l(null), A = o(), j = i || A, [M, N] = u(null), [ee, P] = u(""), [F, I] = u(!1), [L, R] = u(!1);
4689
+ a(() => () => M && URL.revokeObjectURL(M), [M]), a(() => {
4690
+ N(null), I(!1);
4691
+ }, [e]);
4692
+ let z = d || f, B = M || (e && !F ? e : null), V = b || ee, te = !z && (!!M || !!B && !!c), H = () => {
4693
+ z || O.current?.click();
4694
+ }, ne = (e) => {
4695
+ let t = We(e, {
4696
+ accept: p,
4697
+ maxSizeMb: m
4698
+ });
4699
+ if (t) {
4700
+ P(t);
4701
+ return;
4702
+ }
4703
+ P(""), I(!1), N(URL.createObjectURL(e)), s(e);
4704
+ }, re = (e) => {
4705
+ let t = e.target.files?.[0];
4706
+ e.target.value = "", t && ne(t);
4707
+ }, U = (e) => {
4708
+ if (e.preventDefault(), R(!1), z) return;
4709
+ let t = e.dataTransfer.files?.[0];
4710
+ t && ne(t);
4711
+ }, ie = () => {
4712
+ N(null), P(""), I(!1), O.current && (O.current.value = ""), c?.();
4713
+ }, W = typeof C == "number" ? C : Bt[C] ?? Bt.md, G = Math.max(14, Math.round(W * .18)), K = Math.round(W * .5), q = [
4714
+ "set-uploader",
4715
+ S === "avatar" ? "set-uploader--avatar" : "",
4716
+ w === "rounded" ? "set-uploader--rounded" : w === "square" ? "set-uploader--square" : "",
4717
+ L && "is-dragging"
4718
+ ].filter(Boolean).join(" ");
4719
+ return /* @__PURE__ */ n("div", {
4720
+ className: `field set-uploader-field${T ? ` ${T}` : ""}`,
4721
+ children: [
4722
+ v && /* @__PURE__ */ n("label", {
4723
+ className: "label",
4724
+ htmlFor: j,
4725
+ children: [v, x && /* @__PURE__ */ t($, {})]
4726
+ }),
4727
+ /* @__PURE__ */ n("div", {
4728
+ className: "set-uploader-shell",
4729
+ children: [
4730
+ /* @__PURE__ */ t("button", {
4731
+ type: "button",
4732
+ className: q,
4733
+ style: { "--wui-logo-size": `${W}px` },
4734
+ "aria-busy": d || void 0,
4735
+ disabled: z,
4736
+ onClick: H,
4737
+ "aria-label": _,
4738
+ onDragOver: (e) => {
4739
+ e.preventDefault(), !z && !L && R(!0);
4740
+ },
4741
+ onDragLeave: (e) => {
4742
+ e.preventDefault(), R(!1);
4743
+ },
4744
+ onDrop: U,
4745
+ children: /* @__PURE__ */ n("span", {
4746
+ className: "set-uploader-ring",
4747
+ children: [B ? /* @__PURE__ */ t("img", {
4748
+ className: "set-uploader-img",
4749
+ src: B,
4750
+ alt: "",
4751
+ onError: () => I(!0)
4752
+ }) : /* @__PURE__ */ t("span", {
4753
+ className: "set-uploader-logo",
4754
+ children: r || S === "avatar" && /* @__PURE__ */ t(k, {
4755
+ name: "person",
4756
+ size: K
4757
+ })
4758
+ }), d ? /* @__PURE__ */ t("span", {
4759
+ className: "set-uploader-overlay is-loading",
4760
+ "aria-hidden": "true",
4761
+ children: /* @__PURE__ */ t(k, {
4762
+ name: "refresh-cw",
4763
+ size: G,
4764
+ className: "wui-spin"
4765
+ })
4766
+ }) : !f && /* @__PURE__ */ n("span", {
4767
+ className: "set-uploader-overlay",
4768
+ children: [/* @__PURE__ */ t(k, {
4769
+ name: h,
4770
+ size: G
4771
+ }), /* @__PURE__ */ t("span", { children: g })]
4772
+ })]
4773
+ })
4774
+ }),
4775
+ /* @__PURE__ */ t("button", {
4776
+ type: "button",
4777
+ className: "set-uploader-remove",
4778
+ hidden: !te,
4779
+ "aria-label": "Remove photo",
4780
+ title: "Remove photo",
4781
+ onClick: ie,
4782
+ children: /* @__PURE__ */ t(k, {
4783
+ name: "x",
4784
+ size: 14
4785
+ })
4786
+ }),
4787
+ /* @__PURE__ */ t("input", {
4788
+ id: j,
4789
+ ref: O,
4790
+ type: "file",
4791
+ name: i,
4792
+ hidden: !0,
4793
+ accept: p,
4794
+ onChange: re,
4795
+ disabled: z
4796
+ })
4797
+ ]
4798
+ }),
4799
+ y && !V && /* @__PURE__ */ t("div", {
4800
+ className: "set-uploader-hint",
4801
+ children: y
4802
+ }),
4803
+ V && /* @__PURE__ */ t("div", {
4804
+ className: "field-error",
4805
+ children: V
4806
+ })
4807
+ ]
4808
+ });
4522
4809
  }
4523
4810
  //#endregion
4524
4811
  //#region src/components/AppMultiSelect.jsx
4525
- function Pt({ values: e, onChange: r, options: i, placeholder: o = "Select…", searchPlaceholder: s = "Search…", searchable: c = !0, disabled: u = !1, icon: d, size: f, collapseChips: p = !1, name: m, label: h, error: g, hint: _, required: v = !1, fieldClassName: y = "", ...b }) {
4812
+ function Ht({ values: e, onChange: r, options: i, placeholder: o = "Select…", searchPlaceholder: s = "Search…", searchable: c = !0, disabled: u = !1, icon: d, size: f, collapseChips: p = !1, name: m, label: h, error: g, hint: _, required: v = !1, fieldClassName: y = "", ...b }) {
4526
4813
  E("AppMultiSelect", b);
4527
4814
  let x = l(null);
4528
4815
  return a(() => {
@@ -4544,7 +4831,7 @@ function Pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
4544
4831
  h && /* @__PURE__ */ n("label", {
4545
4832
  className: "label",
4546
4833
  htmlFor: m,
4547
- children: [h, v && /* @__PURE__ */ t(Z, {})]
4834
+ children: [h, v && /* @__PURE__ */ t($, {})]
4548
4835
  }),
4549
4836
  /* @__PURE__ */ t("wui-multiselect", {
4550
4837
  "aria-label": typeof h == "string" ? h : void 0,
@@ -4572,7 +4859,7 @@ function Pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
4572
4859
  }
4573
4860
  //#endregion
4574
4861
  //#region src/components/AppOtpInput.jsx
4575
- var Ft = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode: c = "numeric", label: u, required: d = !1, hint: f, error: p, disabled: m = !1, name: h, id: g, className: _ = "", ...v }, y) {
4862
+ var Ut = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode: c = "numeric", label: u, required: d = !1, hint: f, error: p, disabled: m = !1, name: h, id: g, className: _ = "", ...v }, y) {
4576
4863
  E("AppOtpInput", v);
4577
4864
  let b = l(null), x = o(), S = g || h || x, C = (e) => {
4578
4865
  b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
@@ -4625,7 +4912,7 @@ var Ft = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode:
4625
4912
  });
4626
4913
  //#endregion
4627
4914
  //#region src/components/AppPageHeader.jsx
4628
- function It({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
4915
+ function Wt({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
4629
4916
  return E("AppPageHeader", o), /* @__PURE__ */ n("div", {
4630
4917
  className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
4631
4918
  children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
@@ -4642,7 +4929,7 @@ function It({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
4642
4929
  }
4643
4930
  //#endregion
4644
4931
  //#region src/components/AppPhoneNumberInput.jsx
4645
- function Lt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, label: c = "Phone number", placeholder: u, required: d = !1, error: f, fieldClassName: p = "", ...m }) {
4932
+ function Gt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, label: c = "Phone number", placeholder: u, required: d = !1, error: f, fieldClassName: p = "", ...m }) {
4646
4933
  E("AppPhoneNumberInput", m);
4647
4934
  let h = l(null);
4648
4935
  return a(() => {
@@ -4659,7 +4946,7 @@ function Lt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
4659
4946
  c && /* @__PURE__ */ n("label", {
4660
4947
  className: "label",
4661
4948
  htmlFor: s,
4662
- children: [c, d && /* @__PURE__ */ t(Z, {})]
4949
+ children: [c, d && /* @__PURE__ */ t($, {})]
4663
4950
  }),
4664
4951
  /* @__PURE__ */ t("wui-phone", {
4665
4952
  ref: h,
@@ -4677,7 +4964,7 @@ function Lt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
4677
4964
  }
4678
4965
  //#endregion
4679
4966
  //#region src/components/AppPricingCard.jsx
4680
- function Rt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s, featured: c = !1, current: l = !1, badge: u = "Most popular", className: d = "", ...f }) {
4967
+ function Kt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s, featured: c = !1, current: l = !1, badge: u = "Most popular", className: d = "", ...f }) {
4681
4968
  return E("AppPricingCard", f), /* @__PURE__ */ n("div", {
4682
4969
  className: [
4683
4970
  "plan-card",
@@ -4730,28 +5017,39 @@ function Rt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
4730
5017
  }
4731
5018
  //#endregion
4732
5019
  //#region src/components/AppRadio.jsx
4733
- var zt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
4734
- E("AppRadio", s);
4735
- let l = o(), u = r || l;
5020
+ var qt = r(function({ label: e, id: r, name: i, error: a, hint: s, className: c = "", ...l }, u) {
5021
+ E("AppRadio", l);
5022
+ let d = o(), f = r || d;
4736
5023
  return /* @__PURE__ */ n("div", {
4737
- className: `form-check${a ? ` ${a}` : ""}`,
4738
- children: [/* @__PURE__ */ t("input", {
4739
- type: "radio",
4740
- className: "form-check-input",
4741
- id: u,
4742
- name: i,
4743
- ref: c,
4744
- ...s
4745
- }), e != null && /* @__PURE__ */ t("label", {
4746
- className: "form-check-label",
4747
- htmlFor: u,
4748
- children: e
4749
- })]
5024
+ className: `form-check${c ? ` ${c}` : ""}`,
5025
+ children: [
5026
+ /* @__PURE__ */ t("input", {
5027
+ type: "radio",
5028
+ className: "form-check-input",
5029
+ id: f,
5030
+ name: i,
5031
+ ref: u,
5032
+ "aria-invalid": a ? "true" : "false",
5033
+ ...l
5034
+ }),
5035
+ e != null && /* @__PURE__ */ t("label", {
5036
+ className: "form-check-label",
5037
+ htmlFor: f,
5038
+ children: e
5039
+ }),
5040
+ a ? /* @__PURE__ */ t("div", {
5041
+ className: "field-error",
5042
+ children: a
5043
+ }) : s ? /* @__PURE__ */ t("div", {
5044
+ className: "field-hint",
5045
+ children: s
5046
+ }) : null
5047
+ ]
4750
5048
  });
4751
5049
  });
4752
5050
  //#endregion
4753
5051
  //#region src/components/AppRepeater.jsx
4754
- function Bt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "Add another", removeLabel: s = "Remove row", emptyText: c, min: l = 0, max: u, numbered: d = !0, className: f = "", ...p }) {
5052
+ function Jt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "Add another", removeLabel: s = "Remove row", emptyText: c, min: l = 0, max: u, numbered: d = !0, className: f = "", ...p }) {
4755
5053
  E("AppRepeater", p);
4756
5054
  let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
4757
5055
  return /* @__PURE__ */ n("div", {
@@ -4781,7 +5079,7 @@ function Bt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
4781
5079
  })
4782
5080
  ]
4783
5081
  }, e.id ?? i)),
4784
- /* @__PURE__ */ t(Q, {
5082
+ /* @__PURE__ */ t(Qe, {
4785
5083
  variant: "secondary",
4786
5084
  size: "sm",
4787
5085
  leftIcon: "plus",
@@ -4795,7 +5093,7 @@ function Bt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
4795
5093
  }
4796
5094
  //#endregion
4797
5095
  //#region src/components/AppResourceCard.jsx
4798
- function Vt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
5096
+ function Yt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
4799
5097
  E("AppResourceCard", u);
4800
5098
  let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
4801
5099
  className: "res-card-icon",
@@ -4827,7 +5125,7 @@ function Vt({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
4827
5125
  }
4828
5126
  //#endregion
4829
5127
  //#region src/components/AppSearch.jsx
4830
- function Ht({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabel: a, iconSize: o = 18, size: s, loading: c = !1, disabled: l = !1, className: u = "", ...d }) {
5128
+ function Xt({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabel: a, iconSize: o = 18, size: s, loading: c = !1, disabled: l = !1, className: u = "", ...d }) {
4831
5129
  return E("AppSearch", d), /* @__PURE__ */ n("div", {
4832
5130
  className: [
4833
5131
  "search-wrap",
@@ -4871,7 +5169,7 @@ function Ht({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabe
4871
5169
  }
4872
5170
  //#endregion
4873
5171
  //#region src/components/AppSegmented.jsx
4874
- function Ut({ options: e = [], value: r, onChange: i, label: c, name: u, size: d = "md", fullWidth: f = !1, disabled: p = !1, className: m = "", ...h }) {
5172
+ function Zt({ options: e = [], value: r, onChange: i, label: c, name: u, size: d = "md", fullWidth: f = !1, disabled: p = !1, className: m = "", ...h }) {
4875
5173
  E("AppSegmented", h);
4876
5174
  let g = o(), _ = u || g, v = l(null), y = l(null), b = [
4877
5175
  "segmented",
@@ -4936,28 +5234,30 @@ function Ut({ options: e = [], value: r, onChange: i, label: c, name: u, size: d
4936
5234
  }
4937
5235
  //#endregion
4938
5236
  //#region src/components/AppSelect.jsx
4939
- var Wt = (e) => e == null ? "" : e.label ?? e.text ?? "";
4940
- function Gt({ value: e, onChange: r, options: i = [], placeholder: o = "Select...", searchPlaceholder: s = "Search...", searchable: c = !1, clearable: u = !1, size: d, icon: f, floatingLabel: p = !1, disabled: m, label: h, required: g = !1, error: _, hint: v, help: y, helpLabel: b = "More information", id: x, name: S, className: C = "", fieldClassName: w = "", ...T }) {
4941
- E("AppSelect", T);
4942
- let D = l(null);
5237
+ var Qt = (e) => e == null ? "" : e.label ?? e.text ?? "";
5238
+ function $t({ value: e, onChange: r, options: i = [], placeholder: o = "Select...", searchPlaceholder: s = "Search...", searchable: c = !1, clearable: u = !1, size: d, icon: f, floatingLabel: p = !1, disabled: m, label: h, required: g = !1, error: _, hint: v, help: y, helpLabel: b = "More information", id: x, name: S, className: C = "", fieldClassName: w = "", "aria-label": T, "aria-labelledby": D, "aria-describedby": O, ...k }) {
5239
+ E("AppSelect", k);
5240
+ let A = l(null);
4943
5241
  a(() => {
4944
- D.current && (D.current.options = i.map((e) => ({
5242
+ A.current && (A.current.options = i.map((e) => ({
4945
5243
  value: e.value,
4946
- label: Wt(e),
5244
+ label: Qt(e),
4947
5245
  icon: e.icon
4948
5246
  })));
4949
5247
  }, [i]), a(() => {
4950
- let t = D.current;
5248
+ let t = A.current;
4951
5249
  t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
4952
5250
  }, [e]), a(() => {
4953
- let e = D.current;
5251
+ let e = A.current;
4954
5252
  if (!e) return;
4955
5253
  let t = () => r?.(e.value);
4956
5254
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
4957
5255
  }, [r]);
4958
- let O = /* @__PURE__ */ t("wui-select", {
4959
- "aria-label": typeof h == "string" ? h : void 0,
4960
- ref: D,
5256
+ let j = /* @__PURE__ */ t("wui-select", {
5257
+ "aria-label": T || (typeof h == "string" ? h : void 0),
5258
+ "aria-labelledby": D || void 0,
5259
+ "aria-describedby": O || void 0,
5260
+ ref: A,
4961
5261
  id: x || S,
4962
5262
  name: S,
4963
5263
  placeholder: p && h ? " " : o,
@@ -4969,8 +5269,8 @@ function Gt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
4969
5269
  disabled: m ? "" : void 0,
4970
5270
  required: g ? "" : void 0
4971
5271
  });
4972
- if (!h && !_ && !v) return O;
4973
- let k = x || S, A = p && h;
5272
+ if (!h && !_ && !v) return j;
5273
+ let M = x || S, N = p && h;
4974
5274
  return /* @__PURE__ */ n("div", {
4975
5275
  className: [
4976
5276
  "field",
@@ -4978,26 +5278,26 @@ function Gt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
4978
5278
  w
4979
5279
  ].filter(Boolean).join(" "),
4980
5280
  children: [
4981
- h && !A && /* @__PURE__ */ n("label", {
5281
+ h && !N && /* @__PURE__ */ n("label", {
4982
5282
  className: "label",
4983
- htmlFor: k,
5283
+ htmlFor: M,
4984
5284
  children: [
4985
5285
  h,
4986
- g && /* @__PURE__ */ t(Z, {}),
4987
- y && /* @__PURE__ */ t(at, {
5286
+ g && /* @__PURE__ */ t($, {}),
5287
+ y && /* @__PURE__ */ t(st, {
4988
5288
  label: b,
4989
5289
  children: y
4990
5290
  })
4991
5291
  ]
4992
5292
  }),
4993
- A ? /* @__PURE__ */ n("div", {
5293
+ N ? /* @__PURE__ */ n("div", {
4994
5294
  className: "field-float",
4995
- children: [O, /* @__PURE__ */ n("label", {
5295
+ children: [j, /* @__PURE__ */ n("label", {
4996
5296
  className: "float-label",
4997
- htmlFor: k,
4998
- children: [h, g && /* @__PURE__ */ t(Z, {})]
5297
+ htmlFor: M,
5298
+ children: [h, g && /* @__PURE__ */ t($, {})]
4999
5299
  })]
5000
- }) : O,
5300
+ }) : j,
5001
5301
  _ ? /* @__PURE__ */ t("div", {
5002
5302
  className: "field-error",
5003
5303
  children: _
@@ -5010,7 +5310,7 @@ function Gt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
5010
5310
  }
5011
5311
  //#endregion
5012
5312
  //#region src/components/AppShell.jsx
5013
- function Kt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbarEnd: s, footer: c, children: l, collapsed: d, onCollapsedChange: f, noSidebar: p = !1, navLabel: m = "Main navigation", linkComponent: h, className: g = "", ..._ }) {
5313
+ function en({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbarEnd: s, footer: c, children: l, collapsed: d, onCollapsedChange: f, noSidebar: p = !1, navLabel: m = "Main navigation", linkComponent: h, className: g = "", ..._ }) {
5014
5314
  E("AppShell", _);
5015
5315
  let [v, y] = u(!1), [b, x] = u(!1), [S, C] = u(!1), w = d ?? v;
5016
5316
  return a(() => {
@@ -5046,7 +5346,7 @@ function Kt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
5046
5346
  children: [e.label && /* @__PURE__ */ t("div", {
5047
5347
  className: "app-nav-group-label",
5048
5348
  children: e.label
5049
- }), e.items.map((e) => /* @__PURE__ */ t(qt, {
5349
+ }), e.items.map((e) => /* @__PURE__ */ t(tn, {
5050
5350
  item: e,
5051
5351
  linkComponent: h,
5052
5352
  onNavigate: () => x(!1)
@@ -5116,7 +5416,7 @@ function Kt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
5116
5416
  ]
5117
5417
  });
5118
5418
  }
5119
- function qt({ item: r, linkComponent: i, onNavigate: a }) {
5419
+ function tn({ item: r, linkComponent: i, onNavigate: a }) {
5120
5420
  let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
5121
5421
  r.icon && /* @__PURE__ */ t("span", {
5122
5422
  className: "app-nav-icon",
@@ -5150,7 +5450,7 @@ function qt({ item: r, linkComponent: i, onNavigate: a }) {
5150
5450
  }
5151
5451
  //#endregion
5152
5452
  //#region src/components/AppSidebarMenu.jsx
5153
- var Jt = {
5453
+ var nn = {
5154
5454
  left: "start",
5155
5455
  right: "end",
5156
5456
  start: "start",
@@ -5158,20 +5458,23 @@ var Jt = {
5158
5458
  top: "top",
5159
5459
  bottom: "bottom"
5160
5460
  };
5161
- function Yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, backdrop: d = !0, scroll: f = !1, keyboard: p = !0, closeButton: m = !0, responsive: h, className: g = "", bodyClassName: _ = "", ariaLabel: v, ...y }) {
5162
- return E("AppSidebarMenu", y), /* @__PURE__ */ n(b, {
5461
+ function rn({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, maxWidth: d, backdrop: f = !0, scroll: p = !1, keyboard: m = !0, closeButton: h = !0, responsive: g, className: _ = "", bodyClassName: v = "", ariaLabel: b, ...x }) {
5462
+ return E("AppSidebarMenu", x), /* @__PURE__ */ n(y, {
5163
5463
  show: e,
5164
5464
  onHide: r,
5165
- placement: Jt[i] || "end",
5166
- backdrop: d,
5167
- scroll: f,
5168
- keyboard: p,
5169
- responsive: h,
5170
- style: u ? { "--asm-width": u } : void 0,
5171
- className: `app-sidebar-menu${g ? ` ${g}` : ""}`,
5172
- "aria-label": v || (typeof a == "string" ? a : void 0),
5465
+ placement: nn[i] || "end",
5466
+ backdrop: f,
5467
+ scroll: p,
5468
+ keyboard: m,
5469
+ responsive: g,
5470
+ style: u || d ? {
5471
+ ...u && { "--asm-width": u },
5472
+ ...d && { "--asm-max-width": d }
5473
+ } : void 0,
5474
+ className: `app-sidebar-menu${_ ? ` ${_}` : ""}`,
5475
+ "aria-label": b || (typeof a == "string" ? a : void 0),
5173
5476
  children: [
5174
- s === void 0 ? (a != null || m) && /* @__PURE__ */ n("div", {
5477
+ s === void 0 ? (a != null || h) && /* @__PURE__ */ n("div", {
5175
5478
  className: "drawer-header",
5176
5479
  children: [a != null && /* @__PURE__ */ n("div", {
5177
5480
  className: "drawer-title",
@@ -5182,7 +5485,7 @@ function Yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
5182
5485
  size: 18
5183
5486
  })
5184
5487
  }), a]
5185
- }), m && /* @__PURE__ */ t(Q, {
5488
+ }), h && /* @__PURE__ */ t(Qe, {
5186
5489
  variant: "ghost",
5187
5490
  className: "btn-icon",
5188
5491
  onClick: r,
@@ -5193,8 +5496,8 @@ function Yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
5193
5496
  })
5194
5497
  })]
5195
5498
  }) : s,
5196
- /* @__PURE__ */ t(b.Body, {
5197
- className: _,
5499
+ /* @__PURE__ */ t(y.Body, {
5500
+ className: v,
5198
5501
  children: c
5199
5502
  }),
5200
5503
  l && /* @__PURE__ */ t("div", {
@@ -5206,7 +5509,7 @@ function Yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
5206
5509
  }
5207
5510
  //#endregion
5208
5511
  //#region src/components/AppSpinner.jsx
5209
- function Xt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
5512
+ function an({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
5210
5513
  return E("AppSpinner", i), /* @__PURE__ */ t("span", {
5211
5514
  className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
5212
5515
  role: "status",
@@ -5215,7 +5518,7 @@ function Xt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
5215
5518
  }
5216
5519
  //#endregion
5217
5520
  //#region src/components/AppSplash.jsx
5218
- function Zt({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
5521
+ function on({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
5219
5522
  return E("AppSplash", s), /* @__PURE__ */ t("div", {
5220
5523
  className: `splash${o ? ` ${o}` : ""}`,
5221
5524
  role: "status",
@@ -5242,7 +5545,7 @@ function Zt({ logo: e, initials: r, text: i, label: a = "Loading", className: o
5242
5545
  }
5243
5546
  //#endregion
5244
5547
  //#region src/components/AppStatusBadge.jsx
5245
- function Qt({ label: e, tone: n = "neutral", className: r = "", ...i }) {
5548
+ function sn({ label: e, tone: n = "neutral", className: r = "", ...i }) {
5246
5549
  return E("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
5247
5550
  className: `status-label ${n}${r ? ` ${r}` : ""}`,
5248
5551
  ...i,
@@ -5251,7 +5554,7 @@ function Qt({ label: e, tone: n = "neutral", className: r = "", ...i }) {
5251
5554
  }
5252
5555
  //#endregion
5253
5556
  //#region src/components/AppStepper.jsx
5254
- function $t({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
5557
+ function cn({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
5255
5558
  return E("AppStepper", c), /* @__PURE__ */ t("nav", {
5256
5559
  className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
5257
5560
  "aria-label": a,
@@ -5298,28 +5601,39 @@ function $t({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
5298
5601
  }
5299
5602
  //#endregion
5300
5603
  //#region src/components/AppSwitch.jsx
5301
- var en = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
5302
- E("AppSwitch", s);
5303
- let l = o(), u = r || i || l;
5604
+ var ln = r(function({ label: e, id: r, name: i, error: a, hint: s, className: c = "", ...l }, u) {
5605
+ E("AppSwitch", l);
5606
+ let d = o(), f = r || i || d;
5304
5607
  return /* @__PURE__ */ n("div", {
5305
- className: `form-check form-switch${a ? ` ${a}` : ""}`,
5306
- children: [/* @__PURE__ */ t("input", {
5307
- type: "checkbox",
5308
- className: "form-check-input",
5309
- id: u,
5310
- name: i,
5311
- ref: c,
5312
- ...s
5313
- }), e != null && /* @__PURE__ */ t("label", {
5314
- className: "form-check-label",
5315
- htmlFor: u,
5316
- children: e
5317
- })]
5608
+ className: `form-check form-switch${c ? ` ${c}` : ""}`,
5609
+ children: [
5610
+ /* @__PURE__ */ t("input", {
5611
+ type: "checkbox",
5612
+ className: "form-check-input",
5613
+ id: f,
5614
+ name: i,
5615
+ ref: u,
5616
+ "aria-invalid": a ? "true" : "false",
5617
+ ...l
5618
+ }),
5619
+ e != null && /* @__PURE__ */ t("label", {
5620
+ className: "form-check-label",
5621
+ htmlFor: f,
5622
+ children: e
5623
+ }),
5624
+ a ? /* @__PURE__ */ t("div", {
5625
+ className: "field-error",
5626
+ children: a
5627
+ }) : s ? /* @__PURE__ */ t("div", {
5628
+ className: "field-hint",
5629
+ children: s
5630
+ }) : null
5631
+ ]
5318
5632
  });
5319
5633
  });
5320
5634
  //#endregion
5321
5635
  //#region src/components/AppTableEmptyState.jsx
5322
- function tn({ icon: e, title: r, text: i, action: a, ...o }) {
5636
+ function un({ icon: e, title: r, text: i, action: a, ...o }) {
5323
5637
  return E("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
5324
5638
  className: "tbl-empty",
5325
5639
  children: [
@@ -5347,10 +5661,10 @@ function tn({ icon: e, title: r, text: i, action: a, ...o }) {
5347
5661
  }
5348
5662
  //#endregion
5349
5663
  //#region src/components/AppTabs.jsx
5350
- function nn({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...c }) {
5351
- E("AppTabs", c);
5352
- let u = l(null);
5353
- function d(t) {
5664
+ function dn({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", style: c, ...u }) {
5665
+ E("AppTabs", u);
5666
+ let d = l(null);
5667
+ function f(t) {
5354
5668
  let n = e.findIndex((e) => e.key === r);
5355
5669
  if (n < 0) return;
5356
5670
  let a = e.length, o = (t, n) => {
@@ -5363,21 +5677,22 @@ function nn({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
5363
5677
  if (t.key === "ArrowRight" ? s = o(n, 1) : t.key === "ArrowLeft" ? s = o(n, -1) : t.key === "Home" ? s = e.find((e) => !e.disabled) ?? null : t.key === "End" && (s = [...e].reverse().find((e) => !e.disabled) ?? null), !s) return;
5364
5678
  t.preventDefault(), i(s.key);
5365
5679
  let c = CSS.escape(String(s.key));
5366
- u.current?.querySelector(`[data-rr-ui-event-key="${c}"]`)?.focus();
5680
+ d.current?.querySelector(`[data-rr-ui-event-key="${c}"]`)?.focus();
5367
5681
  }
5368
- return /* @__PURE__ */ t(x, {
5682
+ return /* @__PURE__ */ t(b, {
5369
5683
  as: "div",
5370
5684
  role: "tablist",
5371
- ref: u,
5685
+ ref: d,
5372
5686
  activeKey: r,
5373
5687
  onSelect: (e) => {
5374
5688
  e != null && i(e);
5375
5689
  },
5376
- onKeyDown: d,
5690
+ onKeyDown: f,
5377
5691
  bsPrefix: "app-tabs",
5378
5692
  className: [a === "pills" ? "app-tabs-pills" : "", s].filter(Boolean).join(" "),
5693
+ style: c,
5379
5694
  "aria-label": o,
5380
- children: e.map((e) => /* @__PURE__ */ n(x.Link, {
5695
+ children: e.map((e) => /* @__PURE__ */ n(b.Link, {
5381
5696
  as: "button",
5382
5697
  type: "button",
5383
5698
  eventKey: e.key,
@@ -5398,28 +5713,28 @@ function nn({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
5398
5713
  }
5399
5714
  //#endregion
5400
5715
  //#region src/components/AppTextarea.jsx
5401
- var rn = r(function({ label: e, required: r = !1, error: a, hint: o, help: c, helpLabel: u = "More information", id: d, name: f, rows: p = 4, autoGrow: m = !1, className: g = "", fieldClassName: _ = "", ...v }, y) {
5716
+ var fn = r(function({ label: e, required: r = !1, error: a, hint: o, help: c, helpLabel: u = "More information", id: d, name: f, rows: p = 4, autoGrow: m = !1, className: g = "", fieldClassName: _ = "", ...v }, y) {
5402
5717
  E("AppTextarea", v);
5403
5718
  let b = d || f, x = [
5404
5719
  "textarea",
5405
5720
  m ? "autosize" : "",
5406
5721
  a ? "error" : "",
5407
5722
  g
5408
- ].filter(Boolean).join(" "), S = l(null), C = (e) => {
5409
- S.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
5410
- }, w = i(() => {
5411
- let e = S.current;
5723
+ ].filter(Boolean).join(" "), S = a && b ? `${b}-error` : void 0, C = o && b ? `${b}-hint` : void 0, w = S || C, T = l(null), D = (e) => {
5724
+ T.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
5725
+ }, O = i(() => {
5726
+ let e = T.current;
5412
5727
  e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
5413
5728
  }, []);
5414
5729
  s(() => {
5415
- m && w();
5730
+ m && O();
5416
5731
  }, [
5417
5732
  m,
5418
- w,
5733
+ O,
5419
5734
  v.value
5420
5735
  ]);
5421
- let T = (e) => {
5422
- m && w(), v.onInput?.(e);
5736
+ let k = (e) => {
5737
+ m && O(), v.onInput?.(e);
5423
5738
  };
5424
5739
  return /* @__PURE__ */ n(h.Group, {
5425
5740
  className: `field${_ ? ` ${_}` : ""}`,
@@ -5429,8 +5744,8 @@ var rn = r(function({ label: e, required: r = !1, error: a, hint: o, help: c, he
5429
5744
  htmlFor: b,
5430
5745
  children: [
5431
5746
  e,
5432
- r && /* @__PURE__ */ t(Z, {}),
5433
- c && /* @__PURE__ */ t(at, {
5747
+ r && /* @__PURE__ */ t($, {}),
5748
+ c && /* @__PURE__ */ t(st, {
5434
5749
  label: u,
5435
5750
  children: c
5436
5751
  })
@@ -5443,16 +5758,19 @@ var rn = r(function({ label: e, required: r = !1, error: a, hint: o, help: c, he
5443
5758
  rows: p,
5444
5759
  className: x,
5445
5760
  "aria-invalid": a ? "true" : "false",
5761
+ "aria-describedby": w,
5446
5762
  required: r,
5447
5763
  ...v,
5448
- ref: C,
5449
- onInput: T
5764
+ ref: D,
5765
+ onInput: k
5450
5766
  }),
5451
5767
  a ? /* @__PURE__ */ t("div", {
5452
5768
  className: "field-error",
5769
+ id: S,
5453
5770
  children: a
5454
5771
  }) : o ? /* @__PURE__ */ t("div", {
5455
5772
  className: "field-hint",
5773
+ id: C,
5456
5774
  children: o
5457
5775
  }) : null
5458
5776
  ]
@@ -5460,7 +5778,7 @@ var rn = r(function({ label: e, required: r = !1, error: a, hint: o, help: c, he
5460
5778
  });
5461
5779
  //#endregion
5462
5780
  //#region src/components/AppTimeline.jsx
5463
- function an({ items: e = [], className: r = "", ...i }) {
5781
+ function pn({ items: e = [], className: r = "", ...i }) {
5464
5782
  return E("AppTimeline", i), /* @__PURE__ */ t("ol", {
5465
5783
  className: `timeline${r ? ` ${r}` : ""}`,
5466
5784
  children: e.map((e, r) => /* @__PURE__ */ n("li", {
@@ -5498,8 +5816,23 @@ function an({ items: e = [], className: r = "", ...i }) {
5498
5816
  });
5499
5817
  }
5500
5818
  //#endregion
5819
+ //#region src/components/toast.js
5820
+ var mn = /* @__PURE__ */ new Set([
5821
+ "success",
5822
+ "info",
5823
+ "warning",
5824
+ "error"
5825
+ ]);
5826
+ function hn(e, t = "success") {
5827
+ let n = mn.has(t) ? t : "success";
5828
+ x[n](e, { toastId: `${n}:${e}` });
5829
+ }
5830
+ function gn(e) {
5831
+ x.error(e, { toastId: `error:${e}` });
5832
+ }
5833
+ //#endregion
5501
5834
  //#region src/lib/usePagination.js
5502
- function on(e, t = 10) {
5835
+ function _n(e, t = 10) {
5503
5836
  let [n, r] = u(1), [i, o] = u(t), s = e.length, l = Math.max(1, Math.ceil(s / i));
5504
5837
  a(() => {
5505
5838
  n > l && r(l);
@@ -5525,4 +5858,4 @@ function on(e, t = 10) {
5525
5858
  };
5526
5859
  }
5527
5860
  //#endregion
5528
- export { A as ActionIcon, j as AppAccordion, M as AppAlert, Ge as AppAutocomplete, qe as AppAvatar, Je as AppBadge, Q as AppButton, Ze as AppCallout, Qe as AppCard, $e as AppCheckbox, et as AppChip, tt as AppChoiceCard, nt as AppChoiceChip, rt as AppColorField, it as AppCompareTable, ut as AppConfirmDialog, bt as AppDataTable, xt as AppDatePicker, St as AppDateRangePicker, wt as AppDropdown, Tt as AppEmptyState, Et as AppFileAttachment, At as AppFilePicker, jt as AppInfoList, at as AppInfoTip, ot as AppInput, Mt as AppKpiTile, Nt as AppLogoPicker, ct as AppModal, Pt as AppMultiSelect, Ft as AppOtpInput, It as AppPageHeader, Lt as AppPhoneNumberInput, Rt as AppPricingCard, zt as AppRadio, Bt as AppRepeater, Vt as AppResourceCard, Ht as AppSearch, Ut as AppSegmented, Gt as AppSelect, ht as AppSelectMini, Kt as AppShell, Yt as AppSidebarMenu, dt as AppSkeleton, mt as AppSkeletonRows, Xt as AppSpinner, Zt as AppSplash, Qt as AppStatusBadge, $t as AppStepper, en as AppSwitch, tn as AppTableEmptyState, _t as AppTablePagination, nn as AppTabs, rn as AppTextarea, an as AppTimeline, k as Icon, lt as MODAL_ICONS, Z as RequiredMark, kt as errorToast, O as iconNames, Ot as toast, on as usePagination };
5861
+ export { A as ActionIcon, j as AppAccordion, M as AppAlert, Ke as AppAutocomplete, Je as AppAvatar, Ye as AppBadge, Qe as AppButton, $e as AppCallout, et as AppCard, tt as AppCheckbox, nt as AppChip, rt as AppChoiceCard, it as AppChoiceChip, at as AppColorField, ot as AppCompareTable, pt as AppConfirmDialog, Ct as AppDataTable, wt as AppDatePicker, Tt as AppDateRangePicker, Dt as AppDropdown, Ot as AppEmptyState, kt as AppFileAttachment, Ft as AppFilePicker, Rt as AppInfoList, st as AppInfoTip, ct as AppInput, zt as AppKpiTile, Vt as AppLogoPicker, ut as AppModal, Ht as AppMultiSelect, Ut as AppOtpInput, Wt as AppPageHeader, Gt as AppPhoneNumberInput, Kt as AppPricingCard, qt as AppRadio, Jt as AppRepeater, Yt as AppResourceCard, Xt as AppSearch, Zt as AppSegmented, $t as AppSelect, vt as AppSelectMini, en as AppShell, rn as AppSidebarMenu, mt as AppSkeleton, _t as AppSkeletonRows, an as AppSpinner, on as AppSplash, sn as AppStatusBadge, cn as AppStepper, ln as AppSwitch, un as AppTableEmptyState, bt as AppTablePagination, dn as AppTabs, fn as AppTextarea, pn as AppTimeline, k as Icon, ft as MODAL_ICONS, $ as RequiredMark, gn as errorToast, O as iconNames, hn as toast, _n as usePagination };