@webority/ui-elements 0.23.1 → 0.25.0

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.
@@ -56,20 +56,34 @@ function u(e) {
56
56
  //#endregion
57
57
  //#region src/formMirror.js
58
58
  var d = "data-wui-mirror";
59
- function f(e, t) {
59
+ function f(e, t, n, r) {
60
+ t.name = n, t.value = r == null ? "" : String(r);
61
+ for (let n of [...t.attributes]) n.name.startsWith("data-val") && !e.hasAttribute(n.name) && t.removeAttribute(n.name);
62
+ for (let n of e.attributes) n.name.startsWith("data-val") && t.setAttribute(n.name, n.value);
63
+ t.disabled = e.hasAttribute("disabled");
64
+ }
65
+ function p(e) {
66
+ let t = document.createElement("input");
67
+ return t.type = "hidden", t.setAttribute(d, ""), e.appendChild(t), t;
68
+ }
69
+ function m(e, t) {
60
70
  let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${d}]`);
61
71
  if (!n) {
62
72
  r?.remove();
63
73
  return;
64
74
  }
65
- r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(d, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
66
- for (let t of [...r.attributes]) t.name.startsWith("data-val") && !e.hasAttribute(t.name) && r.removeAttribute(t.name);
67
- for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
68
- r.disabled = e.hasAttribute("disabled");
75
+ r ||= p(e), f(e, r, n, t);
76
+ }
77
+ function h(e, t) {
78
+ let n = e.getAttribute("name"), r = [...e.querySelectorAll(`:scope > input[${d}]`)], i = n ? t.length > 0 ? t : [""] : [];
79
+ for (let e of r.splice(i.length)) e.remove();
80
+ i.forEach((t, i) => {
81
+ f(e, r[i] ?? p(e), n, t);
82
+ });
69
83
  }
70
84
  //#endregion
71
85
  //#region src/iconGlyphs.g.js
72
- var p = {
86
+ var g = {
73
87
  activity: "<path d=\"M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"m7.33 14.49 2.38-3.09c.34-.44.97-.52 1.41-.18l1.83 1.44c.44.34 1.07.26 1.41-.17l2.31-2.98\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
74
88
  alarm: "<path d=\"M2 22h20M12 6a9 9 0 0 0-9 9v7h18v-7a9 9 0 0 0-9-9ZM12 2v1M4 4l1 1M20 4l-1 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
75
89
  "alert-circle": "<path d=\"M12 7.75V13M21.08 8.58v6.84c0 1.12-.6 2.16-1.57 2.73l-5.94 3.43c-.97.56-2.17.56-3.15 0l-5.94-3.43a3.15 3.15 0 0 1-1.57-2.73V8.58c0-1.12.6-2.16 1.57-2.73l5.94-3.43c.97-.56 2.17-.56 3.15 0l5.94 3.43c.97.57 1.57 1.6 1.57 2.73Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M12 16.2v.1\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
@@ -226,14 +240,14 @@ var p = {
226
240
  "zoom-in": "<path d=\"M11 20a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM8.5 11h5M11 13.5v-5M18.93 20.69c.53 1.6 1.74 1.76 2.67.36.85-1.28.29-2.33-1.25-2.33-1.14-.01-1.78.88-1.42 1.97Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
227
241
  "zoom-out": "<path d=\"M9 11.7h5M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>"
228
242
  };
229
- Object.keys(p);
230
- function m(e, { size: t = 16, className: n = "", style: r = "" } = {}) {
231
- let i = p[e];
243
+ Object.keys(g);
244
+ function _(e, { size: t = 16, className: n = "", style: r = "" } = {}) {
245
+ let i = g[e];
232
246
  return i ? `<svg class="${n ? `wui-icon ${n}` : "wui-icon"}" data-icon="${e}" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" aria-hidden="true" style="vertical-align:-.125em${r ? `;${r}` : ""}">${i}</svg>` : "";
233
247
  }
234
248
  //#endregion
235
249
  //#region src/listboxKeyNav.js
236
- function h(e) {
250
+ function v(e) {
237
251
  let { getVisibleOptions: t, getActive: n, setActive: r, onEnter: i, onEscape: a, onTypeahead: o, typeaheadMs: s = 500 } = e, c = "", l = null, u = () => {
238
252
  clearTimeout(l), l = null, c = "";
239
253
  };
@@ -264,18 +278,18 @@ function h(e) {
264
278
  }
265
279
  //#endregion
266
280
  //#region src/optionLabel.js
267
- var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), v = (e) => {
281
+ var y = Symbol("wui.trustedHtml"), b = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), x = (e) => {
268
282
  if (!e) return "";
269
283
  let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
270
- return t ? m(t) : "";
271
- }, y = (e) => `wui-flag wui-flag-${e}`, b = (e) => {
284
+ return t ? _(t) : "";
285
+ }, S = (e) => `wui-flag wui-flag-${e}`, ee = (e) => {
272
286
  let t = String(e ?? "").toLowerCase();
273
- return /^[a-z]{2}$/.test(t) ? `<span class="${y(t)}" aria-hidden="true"></span>` : "";
274
- }, x = (e) => {
287
+ return /^[a-z]{2}$/.test(t) ? `<span class="${S(t)}" aria-hidden="true"></span>` : "";
288
+ }, C = (e) => {
275
289
  if (e == null) return "";
276
- let t = e[g] ? String(e.label ?? "") : _(e.label), n = b(e.flag) + v(e.icon);
290
+ let t = e[y] ? String(e.label ?? "") : b(e.label), n = ee(e.flag) + x(e.icon);
277
291
  return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
278
- }, S = class extends e {
292
+ }, w = class extends e {
279
293
  static formAssociated = !0;
280
294
  _accessibleName() {
281
295
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
@@ -334,14 +348,14 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
334
348
  return this._value;
335
349
  }
336
350
  set value(e) {
337
- this._value = e == null ? "" : String(e), f(this, this._value);
351
+ this._value = e == null ? "" : String(e), m(this, this._value);
338
352
  let t = this._readOptions().find((e) => String(e.value) === this._value);
339
- this._label = t ? w(t.label) : "", this._syncInput(), this._renderOptions("");
353
+ this._label = t ? E(t.label) : "", this._syncInput(), this._renderOptions("");
340
354
  }
341
355
  set options(e) {
342
356
  this._optionsProp = Array.isArray(e) ? e : [];
343
357
  let t = this._readOptions().find((e) => String(e.value) === this._value);
344
- t && (this._label = w(t.label)), this._renderOptions(), this._syncInput();
358
+ t && (this._label = E(t.label)), this._renderOptions(), this._syncInput();
345
359
  }
346
360
  get options() {
347
361
  return this._readOptions();
@@ -360,7 +374,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
360
374
  }
361
375
  _matchesKnownOption(e) {
362
376
  let t = e.toLowerCase();
363
- return this._readOptions().some((e) => w(e.label).toLowerCase() === t || String(e.value ?? "").toLowerCase() === t);
377
+ return this._readOptions().some((e) => E(e.label).toLowerCase() === t || String(e.value ?? "").toLowerCase() === t);
364
378
  }
365
379
  get _minChars() {
366
380
  return Math.max(0, Number(this.getAttribute("min-chars")) || +!!this._remote);
@@ -378,7 +392,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
378
392
  value: e.getAttribute("value") ?? e.textContent.trim(),
379
393
  label: e.innerHTML,
380
394
  icon: e.getAttribute("icon") || void 0,
381
- [g]: !0,
395
+ [y]: !0,
382
396
  selected: e.hasAttribute("selected")
383
397
  })));
384
398
  }
@@ -392,17 +406,17 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
392
406
  let r = `${this.id}-listbox`;
393
407
  this._listboxId = r, this.innerHTML = `
394
408
  <div class="search-select${n}">
395
- <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${C(r)}" aria-label="${C(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}>
396
- <input class="search-select-input search-select-ac-input" placeholder="${C(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
409
+ <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${T(r)}" aria-label="${T(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}>
410
+ <input class="search-select-input search-select-ac-input" placeholder="${T(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
397
411
  <span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
398
- <button type="button" class="search-select-clear" aria-label="Clear" hidden>${m("x")}</button>
412
+ <button type="button" class="search-select-clear" aria-label="Clear" hidden>${_("x")}</button>
399
413
  </div>
400
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${C(r)}" tabindex="-1" hidden>
414
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${T(r)}" tabindex="-1" hidden>
401
415
  <div class="search-select-options"></div>
402
416
  <div class="search-select-empty" hidden>No matches</div>
403
417
  <div class="search-select-hint" hidden>Type to search…</div>
404
418
  </div>
405
- </div>`, this._rendered = !0, f(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
419
+ </div>`, this._rendered = !0, m(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
406
420
  }
407
421
  _refs() {
408
422
  return {
@@ -431,7 +445,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
431
445
  let t = this._refs();
432
446
  if (!t.optionsWrap) return;
433
447
  let n = e ?? (t.input ? t.input.value : ""), r = n.trim().toLowerCase(), i = this._readOptions();
434
- !this._remote && r && (i = i.filter((e) => w(e.label).toLowerCase().includes(r)));
448
+ !this._remote && r && (i = i.filter((e) => E(e.label).toLowerCase().includes(r)));
435
449
  let a = n.trim(), o = this._allowCustom && a && !this._matchesKnownOption(a) ? [...i, {
436
450
  value: a,
437
451
  custom: !0
@@ -439,11 +453,11 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
439
453
  t.optionsWrap.innerHTML = o.map((e, t) => {
440
454
  let n = `${s}-opt-${t}`;
441
455
  if (e.custom) {
442
- let t = `Add “${_(e.value)}”`;
443
- return `<button type="button" role="option" id="${C(n)}" class="search-select-option search-select-option-custom" data-value="${C(e.value)}" data-custom="true" aria-selected="false">${t}</button>`;
456
+ let t = `Add “${b(e.value)}”`;
457
+ return `<button type="button" role="option" id="${T(n)}" class="search-select-option search-select-option-custom" data-value="${T(e.value)}" data-custom="true" aria-selected="false">${t}</button>`;
444
458
  }
445
459
  let r = String(e.value) === String(this._value);
446
- return `<button type="button" role="option" id="${C(n)}" class="search-select-option${r ? " selected" : ""}" data-value="${C(e.value)}" aria-selected="${r}">${x(e)}</button>`;
460
+ return `<button type="button" role="option" id="${T(n)}" class="search-select-option${r ? " selected" : ""}" data-value="${T(e.value)}" aria-selected="${r}">${C(e)}</button>`;
447
461
  }).join(""), this._active = -1, t.control?.removeAttribute("aria-activedescendant");
448
462
  let c = r.length < this._minChars;
449
463
  t.hint && (t.hint.hidden = !(this._remote && c && !i.length)), t.empty && (t.empty.hidden = this._loading || o.length > 0 || this._remote && c), this._reanchor?.();
@@ -463,12 +477,12 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
463
477
  e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "", this._syncInput();
464
478
  }, s = (t) => {
465
479
  let n = t.dataset.custom === "true";
466
- this._value = t.dataset.value, this._label = n ? t.dataset.value : w(t.innerHTML), f(this, this._value), e.input.value = this._label, this.dispatchEvent(new CustomEvent("change", {
480
+ this._value = t.dataset.value, this._label = n ? t.dataset.value : E(t.innerHTML), m(this, this._value), e.input.value = this._label, this.dispatchEvent(new CustomEvent("change", {
467
481
  bubbles: !0,
468
482
  detail: { isCustom: n }
469
483
  })), o(), e.input.focus();
470
484
  }, u = (t) => {
471
- this._value = t, this._label = t, f(this, t), e.input.value = t, this.dispatchEvent(new CustomEvent("change", {
485
+ this._value = t, this._label = t, m(this, t), e.input.value = t, this.dispatchEvent(new CustomEvent("change", {
472
486
  bubbles: !0,
473
487
  detail: { isCustom: !0 }
474
488
  })), o();
@@ -486,7 +500,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
486
500
  }, this._timer = setTimeout(() => this._fireSearch(t, e), this._debounceMs);
487
501
  } else this._renderOptions(t);
488
502
  };
489
- this._navHandler = h({
503
+ this._navHandler = v({
490
504
  getVisibleOptions: n,
491
505
  getActive: () => this._active,
492
506
  setActive: (e) => r(e),
@@ -501,7 +515,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
501
515
  this._navHandler.clearTypeahead(), o();
502
516
  }
503
517
  });
504
- let p = (e) => {
518
+ let f = (e) => {
505
519
  let t = e.target?.tagName === "INPUT" || e.target?.tagName === "TEXTAREA";
506
520
  if (e.key === "ArrowDown") {
507
521
  e.preventDefault(), i() || a();
@@ -515,7 +529,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
515
529
  else if (e.key.length === 1 && (e.ctrlKey || e.metaKey || e.altKey || !i() || e.target?.tagName === "INPUT" || e.target?.tagName === "TEXTAREA") && (!i() || e.target?.tagName === "INPUT" || e.target?.tagName === "TEXTAREA")) return;
516
530
  this._navHandler.handler(e);
517
531
  };
518
- e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", d), e.input.addEventListener("keydown", p), e.menu.addEventListener("keydown", p), e.input.addEventListener("blur", (t) => {
532
+ e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", d), e.input.addEventListener("keydown", f), e.menu.addEventListener("keydown", f), e.input.addEventListener("blur", (t) => {
519
533
  if (!this._allowCustom || t.relatedTarget && this.contains(t.relatedTarget)) return;
520
534
  let n = e.input.value.trim();
521
535
  !n || n === this._label || this._matchesKnownOption(n) || u(n);
@@ -526,7 +540,7 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
526
540
  let t = e.target.closest(".search-select-option");
527
541
  t && r(this._optionEls().indexOf(t));
528
542
  }), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
529
- this._value = "", this._label = "", f(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
543
+ this._value = "", this._label = "", m(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
530
544
  }), this._bindGlobal = () => {
531
545
  this._teardown(), this._onDocClick = (e) => {
532
546
  i() && !this.contains(e.target) && o();
@@ -550,10 +564,10 @@ var g = Symbol("wui.trustedHtml"), _ = (e) => String(e ?? "").replace(/&/g, "&am
550
564
  disconnectedCallback() {
551
565
  this._teardown();
552
566
  }
553
- }, C = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), w = (e) => String(e ?? "").replace(/<[^>]*>/g, "");
567
+ }, T = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), E = (e) => String(e ?? "").replace(/<[^>]*>/g, "");
554
568
  //#endregion
555
569
  //#region src/textMatch.js
556
- function T(e, t) {
570
+ function D(e, t) {
557
571
  let n = String(e ?? ""), r = String(t ?? "").trim();
558
572
  if (!r || !n) return [{
559
573
  text: n,
@@ -579,7 +593,7 @@ function T(e, t) {
579
593
  }
580
594
  //#endregion
581
595
  //#region src/WuiCommandPalette.js
582
- var E = "[role=\"option\"]", D = "No results", ee = class extends e {
596
+ var O = "[role=\"option\"]", te = "No results", ne = class extends e {
583
597
  static get observedAttributes() {
584
598
  return [
585
599
  "filter",
@@ -592,7 +606,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
592
606
  let t = this._optionFrom(e.target);
593
607
  t && this._select(t);
594
608
  }, this._onMouseDown = (e) => {
595
- this._optionFrom(e.target) && e.preventDefault();
609
+ this._optionFrom(e.target, !0) && e.preventDefault();
596
610
  }, this._onMouseMove = (e) => {
597
611
  let t = this._optionFrom(e.target);
598
612
  t && t.id !== this._activeId && (this._userChose = !0, this._setActive(t, !1));
@@ -622,7 +636,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
622
636
  this.setAttribute("highlight", e ? "true" : "false");
623
637
  }
624
638
  get emptyText() {
625
- return this.getAttribute("empty-text") ?? D;
639
+ return this.getAttribute("empty-text") ?? te;
626
640
  }
627
641
  set emptyText(e) {
628
642
  this.setAttribute("empty-text", String(e ?? ""));
@@ -630,7 +644,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
630
644
  refresh() {
631
645
  let e = this._input(), t = e ? e.value : "", n = t !== this._lastQuery;
632
646
  this._lastQuery = t;
633
- let r = this._visibleOptions(), i = r.map((e) => e.id).join("\n"), a = i !== this._lastIds;
647
+ let r = this._selectableOptions(), i = r.map((e) => e.id).join("\n"), a = i !== this._lastIds;
634
648
  this._lastIds = i;
635
649
  let o = !n && (this._userChose || !a) ? r.find((e) => e.id === this._activeId) : null;
636
650
  o || (this._userChose = !1), this._setActive(o ?? r[0] ?? null, n);
@@ -638,24 +652,27 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
638
652
  _input() {
639
653
  return this.querySelector("[role=\"combobox\"]");
640
654
  }
641
- _optionFrom(e) {
642
- let t = e?.closest?.(E);
643
- return t && this.contains(t) && !this._isHidden(t) ? t : null;
655
+ _optionFrom(e, t = !1) {
656
+ let n = e?.closest?.(O);
657
+ return n && this.contains(n) && !this._isHidden(n) && (t || !this._isDisabled(n)) ? n : null;
658
+ }
659
+ _isDisabled(e) {
660
+ return e.getAttribute("aria-disabled") === "true";
644
661
  }
645
662
  _isHidden(e) {
646
663
  return e.hidden || !!e.closest("[role=\"group\"]")?.hidden;
647
664
  }
648
- _visibleOptions() {
649
- return [...this.querySelectorAll(E)].filter((e) => !this._isHidden(e));
665
+ _selectableOptions() {
666
+ return [...this.querySelectorAll(O)].filter((e) => !this._isHidden(e) && !this._isDisabled(e));
650
667
  }
651
668
  _setActive(e, t) {
652
669
  this._activeId = e ? e.id : null;
653
- for (let t of this.querySelectorAll(E)) t.setAttribute("aria-selected", t === e ? "true" : "false");
670
+ for (let t of this.querySelectorAll(O)) t.setAttribute("aria-selected", t === e ? "true" : "false");
654
671
  let n = this._input();
655
672
  n && (e ? n.setAttribute("aria-activedescendant", e.id) : n.removeAttribute("aria-activedescendant")), e && t && e.scrollIntoView({ block: "nearest" });
656
673
  }
657
674
  _move(e) {
658
- let t = this._visibleOptions();
675
+ let t = this._selectableOptions();
659
676
  if (!t.length) return;
660
677
  let n = t.findIndex((e) => e.id === this._activeId), r = n < 0 ? e > 0 ? 0 : t.length - 1 : (n + e + t.length) % t.length;
661
678
  this._userChose = !0, this._setActive(t[r], !0);
@@ -664,7 +681,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
664
681
  if (e.target === this._input()) {
665
682
  if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), this._move(e.key === "ArrowDown" ? 1 : -1);
666
683
  else if (e.key === "Enter" && !e.isComposing) {
667
- let t = this._visibleOptions().find((e) => e.id === this._activeId);
684
+ let t = this._selectableOptions().find((e) => e.id === this._activeId);
668
685
  if (!t) return;
669
686
  e.preventDefault(), this._select(t);
670
687
  }
@@ -686,11 +703,11 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
686
703
  }
687
704
  _applyFilter() {
688
705
  let e = this._input(), t = (e ? e.value : "").trim(), n = t.toLowerCase(), r = this.highlight, i = 0;
689
- for (let e of this.querySelectorAll(E)) {
706
+ for (let e of this.querySelectorAll(O)) {
690
707
  let a = e.querySelector(".wui-cmd-item-label"), o = e.dataset.label ?? a?.textContent ?? "", s = !n || o.toLowerCase().includes(n);
691
- e.hidden = !s, s && i++, a && (a.innerHTML = T(o, r ? t : "").map((e) => e.match ? `<mark class="wui-cmd-mark">${_(e.text)}</mark>` : _(e.text)).join(""));
708
+ e.hidden = !s, s && i++, a && (a.innerHTML = D(o, r ? t : "").map((e) => e.match ? `<mark class="wui-cmd-mark">${b(e.text)}</mark>` : b(e.text)).join(""));
692
709
  }
693
- for (let e of this.querySelectorAll("[role=\"group\"]")) e.hidden = ![...e.querySelectorAll(E)].some((e) => !e.hidden);
710
+ for (let e of this.querySelectorAll("[role=\"group\"]")) e.hidden = ![...e.querySelectorAll(O)].some((e) => !e.hidden);
694
711
  let a = this.querySelector("[role=\"listbox\"]");
695
712
  a && (a.hidden = i === 0);
696
713
  let o = this.querySelector(".wui-cmd-empty");
@@ -699,7 +716,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
699
716
  _teardown() {
700
717
  this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("click", this._onClick), this.removeEventListener("mousedown", this._onMouseDown), this.removeEventListener("mousemove", this._onMouseMove), this.removeEventListener("input", this._onInput);
701
718
  }
702
- }, te = {
719
+ }, re = {
703
720
  "--color-primary": "#4F46E5",
704
721
  "--color-primary-hover": "#4338CA",
705
722
  "--color-text": "#071437",
@@ -709,21 +726,21 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
709
726
  "--wui-radius-lg": "14px",
710
727
  "--wui-shadow-overlay-lg": "0 24px 60px -16px rgba(7, 20, 55, 0.28)",
711
728
  "--wui-z-fixed": "1030"
712
- }, O = (e) => `var(${e}, ${te[e]})`, ne = `
729
+ }, k = (e) => `var(${e}, ${re[e]})`, ie = `
713
730
  :host {
714
731
  all: initial;
715
732
  position: fixed;
716
733
  bottom: 20px;
717
734
  left: 20px;
718
735
  right: auto;
719
- z-index: ${O("--wui-z-fixed")};
736
+ z-index: ${k("--wui-z-fixed")};
720
737
  display: block;
721
738
  width: 420px;
722
739
  max-width: calc(100vw - 40px);
723
740
  font-family: inherit;
724
741
  font-size: 16px;
725
742
  line-height: 1.5;
726
- color: ${O("--color-text")};
743
+ color: ${k("--color-text")};
727
744
  }
728
745
  :host([position="bottom-right"]) {
729
746
  right: 20px;
@@ -741,10 +758,10 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
741
758
 
742
759
  .wui-consent-banner-panel {
743
760
  padding: 20px;
744
- background: ${O("--color-surface")};
745
- border: 1px solid ${O("--color-border")};
746
- border-radius: ${O("--wui-radius-lg")};
747
- box-shadow: ${O("--wui-shadow-overlay-lg")};
761
+ background: ${k("--color-surface")};
762
+ border: 1px solid ${k("--color-border")};
763
+ border-radius: ${k("--wui-radius-lg")};
764
+ box-shadow: ${k("--wui-shadow-overlay-lg")};
748
765
  text-align: start;
749
766
  pointer-events: auto;
750
767
  }
@@ -753,16 +770,16 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
753
770
  font-size: 18px;
754
771
  font-weight: 600;
755
772
  line-height: 1.3;
756
- color: ${O("--color-text")};
773
+ color: ${k("--color-text")};
757
774
  }
758
775
  .wui-consent-banner-description {
759
776
  margin: 0 0 16px;
760
777
  font-size: 14px;
761
778
  line-height: 1.5;
762
- color: ${O("--color-text-muted")};
779
+ color: ${k("--color-text-muted")};
763
780
  }
764
781
  .wui-consent-banner-policy {
765
- color: ${O("--color-primary")};
782
+ color: ${k("--color-primary")};
766
783
  font-weight: 500;
767
784
  }
768
785
 
@@ -773,15 +790,15 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
773
790
  margin: 0 0 16px;
774
791
  padding: 12px 0;
775
792
  overflow-y: auto;
776
- border-top: 1px solid ${O("--color-border")};
777
- border-bottom: 1px solid ${O("--color-border")};
793
+ border-top: 1px solid ${k("--color-border")};
794
+ border-bottom: 1px solid ${k("--color-border")};
778
795
  }
779
796
  .wui-consent-banner-category-description {
780
797
  margin: 2px 0 0;
781
798
  padding-inline-start: 2.5em;
782
799
  font-size: 12px;
783
800
  line-height: 1.4;
784
- color: ${O("--color-text-muted")};
801
+ color: ${k("--color-text-muted")};
785
802
  }
786
803
 
787
804
  .form-check {
@@ -799,20 +816,20 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
799
816
  margin: 0;
800
817
  border: 1px solid rgba(0, 0, 0, 0.25);
801
818
  border-radius: 2em;
802
- background: ${O("--color-surface")} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat;
819
+ background: ${k("--color-surface")} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat;
803
820
  cursor: pointer;
804
821
  transition: background-position 0.15s ease-in-out;
805
822
  }
806
823
  .form-check-input:checked {
807
- border-color: ${O("--color-primary")};
808
- background: ${O("--color-primary")} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat;
824
+ border-color: ${k("--color-primary")};
825
+ background: ${k("--color-primary")} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat;
809
826
  }
810
827
  .form-check-input:disabled {
811
828
  opacity: 0.5;
812
829
  cursor: default;
813
830
  }
814
831
  .form-check-input:focus-visible {
815
- outline: 2px solid ${O("--color-primary")};
832
+ outline: 2px solid ${k("--color-primary")};
816
833
  outline-offset: 2px;
817
834
  }
818
835
  .form-check-label {
@@ -841,33 +858,33 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
841
858
  cursor: pointer;
842
859
  }
843
860
  .btn:focus-visible {
844
- outline: 2px solid ${O("--color-primary")};
861
+ outline: 2px solid ${k("--color-primary")};
845
862
  outline-offset: 2px;
846
863
  }
847
864
  .btn-primary {
848
- background: ${O("--color-primary")};
849
- border-color: ${O("--color-primary")};
865
+ background: ${k("--color-primary")};
866
+ border-color: ${k("--color-primary")};
850
867
  color: #fff;
851
868
  }
852
869
  .btn-primary:hover {
853
- background: ${O("--color-primary-hover")};
854
- border-color: ${O("--color-primary-hover")};
870
+ background: ${k("--color-primary-hover")};
871
+ border-color: ${k("--color-primary-hover")};
855
872
  }
856
873
  .btn-outline-secondary {
857
- border-color: ${O("--color-text-muted")};
858
- color: ${O("--color-text-muted")};
874
+ border-color: ${k("--color-text-muted")};
875
+ color: ${k("--color-text-muted")};
859
876
  }
860
877
  .btn-outline-secondary:hover {
861
- background: ${O("--color-text-muted")};
878
+ background: ${k("--color-text-muted")};
862
879
  color: #fff;
863
880
  }
864
881
  .btn-link {
865
882
  font-weight: 400;
866
- color: ${O("--color-primary")};
883
+ color: ${k("--color-primary")};
867
884
  text-decoration: underline;
868
885
  }
869
886
  .btn-link:hover {
870
- color: ${O("--color-primary-hover")};
887
+ color: ${k("--color-primary-hover")};
871
888
  }
872
889
  .wui-consent-banner-settings-toggle {
873
890
  margin-inline-end: auto;
@@ -887,7 +904,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
887
904
  max-width: none;
888
905
  }
889
906
  }
890
- `, re = "wui-consent-save", ie = "[data-consent-settings]", k = {
907
+ `, ae = "wui-consent-save", oe = "[data-consent-settings]", A = {
891
908
  heading: "Cookies on this site",
892
909
  description: "We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.",
893
910
  policyLabel: "Cookie policy",
@@ -903,11 +920,11 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
903
920
  rejectLabel: "Reject all",
904
921
  acceptLabel: "Accept all",
905
922
  saveLabel: "Save preferences"
906
- }, ae = [
923
+ }, se = [
907
924
  "analytics",
908
925
  "functional",
909
926
  "marketing"
910
- ], oe = 0, se = class extends e {
927
+ ], ce = 0, le = class extends e {
911
928
  static get observedAttributes() {
912
929
  return [
913
930
  "heading",
@@ -920,12 +937,12 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
920
937
  ];
921
938
  }
922
939
  constructor() {
923
- super(), oe += 1, this._uid = `wui-consent-${oe}`, this._preferences = {
940
+ super(), ce += 1, this._uid = `wui-consent-${ce}`, this._preferences = {
924
941
  analytics: !1,
925
942
  functional: !1,
926
943
  marketing: !1
927
944
  }, this._settings = !1, this._onDocumentClick = (e) => {
928
- e.target instanceof Element && e.target.closest(ie) && (e.preventDefault(), this.open({
945
+ e.target instanceof Element && e.target.closest(oe) && (e.preventDefault(), this.open({
929
946
  settings: !0,
930
947
  focus: !0
931
948
  }));
@@ -944,13 +961,13 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
944
961
  this.toggleAttribute("standalone", e === !0 || e === "" || e === "true");
945
962
  }
946
963
  get heading() {
947
- return this.getAttribute("heading") || k.heading;
964
+ return this.getAttribute("heading") || A.heading;
948
965
  }
949
966
  set heading(e) {
950
967
  this.setAttribute("heading", String(e ?? ""));
951
968
  }
952
969
  get description() {
953
- return this.getAttribute("description") || k.description;
970
+ return this.getAttribute("description") || A.description;
954
971
  }
955
972
  set description(e) {
956
973
  this.setAttribute("description", String(e ?? ""));
@@ -962,25 +979,25 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
962
979
  this.setAttribute("policy-href", String(e ?? ""));
963
980
  }
964
981
  get policyLabel() {
965
- return this.getAttribute("policy-label") || k.policyLabel;
982
+ return this.getAttribute("policy-label") || A.policyLabel;
966
983
  }
967
984
  set policyLabel(e) {
968
985
  this.setAttribute("policy-label", String(e ?? ""));
969
986
  }
970
987
  get analyticsDescription() {
971
- return this.getAttribute("analytics-description") || k.analyticsDescription;
988
+ return this.getAttribute("analytics-description") || A.analyticsDescription;
972
989
  }
973
990
  set analyticsDescription(e) {
974
991
  this.setAttribute("analytics-description", String(e ?? ""));
975
992
  }
976
993
  get functionalDescription() {
977
- return this.getAttribute("functional-description") || k.functionalDescription;
994
+ return this.getAttribute("functional-description") || A.functionalDescription;
978
995
  }
979
996
  set functionalDescription(e) {
980
997
  this.setAttribute("functional-description", String(e ?? ""));
981
998
  }
982
999
  get marketingDescription() {
983
- return this.getAttribute("marketing-description") || k.marketingDescription;
1000
+ return this.getAttribute("marketing-description") || A.marketingDescription;
984
1001
  }
985
1002
  set marketingDescription(e) {
986
1003
  this.setAttribute("marketing-description", String(e ?? ""));
@@ -1008,22 +1025,22 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
1008
1025
  this._rendered && this.render();
1009
1026
  }
1010
1027
  render() {
1011
- let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${ce(this.policyHref)}">${j(this.policyLabel)}</a>` : "", r = this._root();
1012
- r.innerHTML = `${r === this ? "" : `<style>${ne}</style>`}
1028
+ let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${fe(this.policyHref)}">${de(this.policyLabel)}</a>` : "", r = this._root();
1029
+ r.innerHTML = `${r === this ? "" : `<style>${ie}</style>`}
1013
1030
  <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden>
1014
- <h2 class="wui-consent-banner-heading" id="${t}-heading">${j(this.heading)}</h2>
1015
- <p class="wui-consent-banner-description" id="${t}-description">${j(this.description)}${n}</p>
1031
+ <h2 class="wui-consent-banner-heading" id="${t}-heading">${de(this.heading)}</h2>
1032
+ <p class="wui-consent-banner-description" id="${t}-description">${de(this.description)}${n}</p>
1016
1033
  <div class="wui-consent-banner-settings" hidden>
1017
- ${A(t, "essential", k.essentialLabel, k.essentialDescription, !0)}
1018
- ${A(t, "analytics", k.analyticsLabel, this.analyticsDescription, !1)}
1019
- ${A(t, "functional", k.functionalLabel, this.functionalDescription, !1)}
1020
- ${A(t, "marketing", k.marketingLabel, this.marketingDescription, !1)}
1034
+ ${ue(t, "essential", A.essentialLabel, A.essentialDescription, !0)}
1035
+ ${ue(t, "analytics", A.analyticsLabel, this.analyticsDescription, !1)}
1036
+ ${ue(t, "functional", A.functionalLabel, this.functionalDescription, !1)}
1037
+ ${ue(t, "marketing", A.marketingLabel, this.marketingDescription, !1)}
1021
1038
  </div>
1022
1039
  <div class="wui-consent-banner-actions">
1023
- <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${k.settingsLabel}</button>
1024
- <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${k.rejectLabel}</button>
1025
- <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${k.acceptLabel}</button>
1026
- <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${k.saveLabel}</button>
1040
+ <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${A.settingsLabel}</button>
1041
+ <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${A.rejectLabel}</button>
1042
+ <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${A.acceptLabel}</button>
1043
+ <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${A.saveLabel}</button>
1027
1044
  </div>
1028
1045
  </div>`, this._rendered = !0, this._wire(), this._applyPreferences(), this._showSettings(this._settings), e && (this._panel().hidden = !1);
1029
1046
  }
@@ -1053,7 +1070,7 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
1053
1070
  })), e.querySelector(".wui-consent-banner-save")?.addEventListener("click", () => this._save(this._switchValues())), e.querySelector(".wui-consent-banner-settings-toggle")?.addEventListener("click", () => this._showSettings(!this._settings));
1054
1071
  }
1055
1072
  _save(e) {
1056
- this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(re, {
1073
+ this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(ae, {
1057
1074
  bubbles: !0,
1058
1075
  composed: !0,
1059
1076
  detail: { ...e }
@@ -1061,11 +1078,11 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
1061
1078
  }
1062
1079
  _switchValues() {
1063
1080
  let e = {};
1064
- for (let t of ae) e[t] = this._root().querySelector(`input[data-category="${t}"]`)?.checked === !0;
1081
+ for (let t of se) e[t] = this._root().querySelector(`input[data-category="${t}"]`)?.checked === !0;
1065
1082
  return e;
1066
1083
  }
1067
1084
  _applyPreferences() {
1068
- for (let e of ae) {
1085
+ for (let e of se) {
1069
1086
  let t = this._root().querySelector(`input[data-category="${e}"]`);
1070
1087
  t && (t.checked = this._preferences[e]);
1071
1088
  }
@@ -1083,17 +1100,221 @@ var E = "[role=\"option\"]", D = "No results", ee = class extends e {
1083
1100
  }
1084
1101
  }
1085
1102
  };
1086
- function A(e, t, n, r, i) {
1103
+ function ue(e, t, n, r, i) {
1087
1104
  let a = `${e}-${t}`;
1088
1105
  return `<div class="wui-consent-banner-category">
1089
1106
  <div class="form-check form-switch">
1090
1107
  <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i ? " checked disabled" : ""} />
1091
- <label class="form-check-label" for="${a}">${j(n)}</label>
1108
+ <label class="form-check-label" for="${a}">${de(n)}</label>
1092
1109
  </div>
1093
- <p class="wui-consent-banner-category-description">${j(r)}</p>
1110
+ <p class="wui-consent-banner-category-description">${de(r)}</p>
1094
1111
  </div>`;
1095
1112
  }
1096
- var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ce = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), M = [
1113
+ var de = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), fe = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), pe = "[role=\"menuitem\"]", me = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]", he = "data-open", ge = 500, _e = 10, ve = 400, j = null, ye = null, be = /* @__PURE__ */ new WeakMap();
1114
+ function xe(e, t, n) {
1115
+ let r = be.get(e);
1116
+ if (r) {
1117
+ if (r.region === t || t.contains(r.region)) return !1;
1118
+ r.cancel();
1119
+ }
1120
+ return be.set(e, {
1121
+ region: t,
1122
+ cancel: n
1123
+ }), !0;
1124
+ }
1125
+ var M = (e) => e instanceof Element ? e : e?.parentElement ?? null, Se = class extends e {
1126
+ static get observedAttributes() {
1127
+ return ["disabled"];
1128
+ }
1129
+ constructor() {
1130
+ super(), this._region = null, this._origin = null, this._returnFocus = null, this._press = null, this._swallowClick = !1, this._nav = v({
1131
+ getVisibleOptions: () => this._items(),
1132
+ getActive: () => this._items().indexOf(document.activeElement),
1133
+ setActive: (e) => this._items()[e]?.focus({ preventScroll: !0 })
1134
+ }), this._onContextMenu = (e) => this._handleContextMenu(e), this._onContextMenuCapture = (e) => {
1135
+ this.isOpen && !this._inPanel(e.target) && !this._isKeyEcho() && this.close();
1136
+ }, this._onDocKeyDown = (e) => this._handleDocKeyDown(e), this._onPointerDown = (e) => this._handlePointerDown(e), this._onPressMove = (e) => {
1137
+ this._press && Math.hypot(e.clientX - this._press.x, e.clientY - this._press.y) > _e && this._cancelPress();
1138
+ }, this._onPressEnd = () => this._cancelPress(), this._onClickCapture = (e) => {
1139
+ !this._swallowClick || !this._region?.contains(e.target) || (this._swallowClick = !1, e.preventDefault(), e.stopImmediatePropagation());
1140
+ }, this._onKeyDown = (e) => {
1141
+ this._inPanel(e.target) && this._handleMenuKey(e);
1142
+ }, this._onClick = (e) => this._handleClick(e), this._onMouseMove = (e) => {
1143
+ let t = M(e.target)?.closest(pe);
1144
+ t && this._inPanel(t) && !this._isDisabled(t) && t !== document.activeElement && t.focus({ preventScroll: !0 });
1145
+ }, this._onDismiss = (e) => {
1146
+ e.type === "scroll" && this._inPanel(e.target) || this.close();
1147
+ }, this._onPointerDownCapture = (e) => {
1148
+ this._swallowClick = !1, this.isOpen && !this._inPanel(e.target) && this.close();
1149
+ };
1150
+ }
1151
+ connectedCallback() {
1152
+ this._teardown(), document.addEventListener("contextmenu", this._onContextMenuCapture, !0), document.addEventListener("contextmenu", this._onContextMenu), document.addEventListener("keydown", this._onDocKeyDown), document.addEventListener("pointerdown", this._onPointerDownCapture, !0), document.addEventListener("pointerdown", this._onPointerDown), document.addEventListener("click", this._onClickCapture, !0), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("click", this._onClick), this.addEventListener("mousemove", this._onMouseMove);
1153
+ }
1154
+ disconnectedCallback() {
1155
+ this._teardown();
1156
+ }
1157
+ attributeChangedCallback() {
1158
+ this.disabled && this.close();
1159
+ }
1160
+ get target() {
1161
+ return this.getAttribute("target");
1162
+ }
1163
+ set target(e) {
1164
+ e == null || e === "" ? this.removeAttribute("target") : this.setAttribute("target", String(e));
1165
+ }
1166
+ get disabled() {
1167
+ return this.hasAttribute("disabled");
1168
+ }
1169
+ set disabled(e) {
1170
+ this.toggleAttribute("disabled", !!e);
1171
+ }
1172
+ get isOpen() {
1173
+ return this._panel()?.hasAttribute(he) ?? !1;
1174
+ }
1175
+ open(e, t, { region: n = this, origin: r = n, keyboard: i = !1 } = {}) {
1176
+ let a = this._panel();
1177
+ if (a) {
1178
+ if (j && j !== this && j.close(!0), !this.isOpen) {
1179
+ let e = document.activeElement;
1180
+ this._returnFocus = e && e !== document.body && !this._inPanel(e) ? e : null;
1181
+ }
1182
+ this._region = n, this._origin = r, ye = null, a.setAttribute(he, ""), j = this, c({ getBoundingClientRect: () => ({
1183
+ left: e,
1184
+ right: e,
1185
+ top: t,
1186
+ bottom: t,
1187
+ width: 0,
1188
+ height: 0
1189
+ }) }, a, { clampHeight: !0 }), window.addEventListener("scroll", this._onDismiss, !0), window.addEventListener("resize", this._onDismiss), window.addEventListener("blur", this._onDismiss), ((i ? this._items()[0] : null) ?? a).focus({ preventScroll: !0 }), this.dispatchEvent(new CustomEvent("wui-context-menu:open", {
1190
+ bubbles: !0,
1191
+ detail: {
1192
+ region: n,
1193
+ origin: r,
1194
+ x: e,
1195
+ y: t
1196
+ }
1197
+ }));
1198
+ }
1199
+ }
1200
+ close(e = !1) {
1201
+ let t = this._panel();
1202
+ if (!t?.hasAttribute(he)) return;
1203
+ t.removeAttribute(he), j === this && (j = null), window.removeEventListener("scroll", this._onDismiss, !0), window.removeEventListener("resize", this._onDismiss), window.removeEventListener("blur", this._onDismiss), this._nav.teardown();
1204
+ let n = this._returnFocus;
1205
+ this._returnFocus = null, e && n?.isConnected && n.focus({ preventScroll: !0 });
1206
+ }
1207
+ _panel() {
1208
+ return [...this.children].find((e) => e.getAttribute("role") === "menu") ?? null;
1209
+ }
1210
+ _inPanel(e) {
1211
+ return !!e && !!this._panel()?.contains(e);
1212
+ }
1213
+ _items() {
1214
+ return [...this._panel()?.querySelectorAll(pe) ?? []].filter((e) => !this._isDisabled(e));
1215
+ }
1216
+ _isDisabled(e) {
1217
+ return e.getAttribute("aria-disabled") === "true";
1218
+ }
1219
+ _regionFor(e) {
1220
+ let t = M(e);
1221
+ if (!t || this.disabled || !this._panel() || this._inPanel(t) || t.closest(me)) return null;
1222
+ let n = this.target;
1223
+ return n ? t.closest(n) : this.contains(t) ? this : null;
1224
+ }
1225
+ _isKeyEcho() {
1226
+ return ye?.menu === this && this.isOpen && performance.now() - ye.at < ve;
1227
+ }
1228
+ _handleContextMenu(e) {
1229
+ if (this._inPanel(e.target)) {
1230
+ e.preventDefault();
1231
+ return;
1232
+ }
1233
+ if (e.defaultPrevented && !be.has(e)) return;
1234
+ let t = this._regionFor(e.target);
1235
+ if (t) {
1236
+ if (this._isKeyEcho()) {
1237
+ e.preventDefault();
1238
+ return;
1239
+ }
1240
+ e.shiftKey || xe(e, t, () => this.close(!0)) && (e.preventDefault(), this.open(e.clientX, e.clientY, {
1241
+ region: t,
1242
+ origin: M(e.target)
1243
+ }));
1244
+ }
1245
+ }
1246
+ _handleDocKeyDown(e) {
1247
+ if (e.defaultPrevented && !be.has(e) || !(e.key === "ContextMenu" || e.key === "F10" && e.shiftKey) || this._inPanel(e.target)) return;
1248
+ let t = this._regionFor(e.target);
1249
+ if (!t || !xe(e, t, () => this.close(!0))) return;
1250
+ e.preventDefault();
1251
+ let n = M(e.target), r = n.getBoundingClientRect();
1252
+ this.open(r.left + Math.min(16, r.width / 2), r.bottom, {
1253
+ region: t,
1254
+ origin: n,
1255
+ keyboard: !0
1256
+ }), ye = {
1257
+ menu: this,
1258
+ at: performance.now()
1259
+ };
1260
+ }
1261
+ _handlePointerDown(e) {
1262
+ if (e.pointerType !== "touch") return;
1263
+ let t = this._regionFor(e.target);
1264
+ if (!t || !xe(e, t, () => this._cancelPress())) return;
1265
+ this._cancelPress();
1266
+ let { clientX: n, clientY: r } = e, i = M(e.target);
1267
+ this._press = {
1268
+ x: n,
1269
+ y: r,
1270
+ timer: setTimeout(() => {
1271
+ this._cancelPress(), this._swallowClick = !0, this.open(n, r, {
1272
+ region: t,
1273
+ origin: i
1274
+ });
1275
+ }, ge)
1276
+ }, document.addEventListener("pointermove", this._onPressMove, { passive: !0 }), document.addEventListener("pointerup", this._onPressEnd), document.addEventListener("pointercancel", this._onPressEnd), window.addEventListener("scroll", this._onPressEnd, !0);
1277
+ }
1278
+ _cancelPress() {
1279
+ this._press && (clearTimeout(this._press.timer), this._press = null, document.removeEventListener("pointermove", this._onPressMove), document.removeEventListener("pointerup", this._onPressEnd), document.removeEventListener("pointercancel", this._onPressEnd), window.removeEventListener("scroll", this._onPressEnd, !0));
1280
+ }
1281
+ _handleMenuKey(e) {
1282
+ if (this.isOpen) if (e.key === "Escape") e.preventDefault(), e.stopPropagation(), this.close(!0);
1283
+ else if (e.key === "Tab") this.close(!0);
1284
+ else if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), this._step(e.key === "ArrowDown" ? 1 : -1);
1285
+ else if (e.key === " ") {
1286
+ let t = M(e.target)?.closest(pe);
1287
+ e.preventDefault(), t && t.click();
1288
+ } else this._nav.handler(e);
1289
+ }
1290
+ _step(e) {
1291
+ let t = this._items();
1292
+ if (!t.length) return;
1293
+ let n = t.indexOf(document.activeElement);
1294
+ t[n < 0 ? e > 0 ? 0 : t.length - 1 : (n + e + t.length) % t.length].focus({ preventScroll: !0 });
1295
+ }
1296
+ _handleClick(e) {
1297
+ let t = M(e.target)?.closest(pe);
1298
+ if (!(!t || !this._inPanel(t))) {
1299
+ if (this._isDisabled(t)) {
1300
+ e.preventDefault(), e.stopPropagation();
1301
+ return;
1302
+ }
1303
+ this.close(!0), this.dispatchEvent(new CustomEvent("wui-context-menu:select", {
1304
+ bubbles: !0,
1305
+ detail: {
1306
+ key: t.dataset.key ?? null,
1307
+ item: t,
1308
+ region: this._region,
1309
+ origin: this._origin
1310
+ }
1311
+ }));
1312
+ }
1313
+ }
1314
+ _teardown() {
1315
+ this.close(), this._cancelPress(), document.removeEventListener("contextmenu", this._onContextMenuCapture, !0), document.removeEventListener("contextmenu", this._onContextMenu), document.removeEventListener("keydown", this._onDocKeyDown), document.removeEventListener("pointerdown", this._onPointerDownCapture, !0), document.removeEventListener("pointerdown", this._onPointerDown), document.removeEventListener("click", this._onClickCapture, !0), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("click", this._onClick), this.removeEventListener("mousemove", this._onMouseMove);
1316
+ }
1317
+ }, Ce = [
1097
1318
  [
1098
1319
  "AF",
1099
1320
  "Afghanistan",
@@ -2319,11 +2540,11 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2319
2540
  "Zimbabwe",
2320
2541
  "263"
2321
2542
  ]
2322
- ], N = (e) => (M.find((t) => t[0] === e) || [
2543
+ ], N = (e) => (Ce.find((t) => t[0] === e) || [
2323
2544
  "",
2324
2545
  "",
2325
2546
  ""
2326
- ])[2], P = class extends e {
2547
+ ])[2], we = class extends e {
2327
2548
  static formAssociated = !0;
2328
2549
  static get observedAttributes() {
2329
2550
  return [
@@ -2382,7 +2603,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2382
2603
  return this._value;
2383
2604
  }
2384
2605
  set value(e) {
2385
- this._value = e == null ? "" : String(e), f(this, this._value), this._syncSelected(), this._syncReset();
2606
+ this._value = e == null ? "" : String(e), m(this, this._value), this._syncSelected(), this._syncReset();
2386
2607
  }
2387
2608
  set options(e) {
2388
2609
  this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
@@ -2397,7 +2618,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2397
2618
  value: e.getAttribute("value") ?? e.textContent.trim(),
2398
2619
  label: e.innerHTML,
2399
2620
  icon: e.getAttribute("icon") || void 0,
2400
- [g]: !0,
2621
+ [y]: !0,
2401
2622
  selected: e.hasAttribute("selected")
2402
2623
  })));
2403
2624
  }
@@ -2407,27 +2628,27 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2407
2628
  render() {
2408
2629
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._snapshotDeclared();
2409
2630
  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);
2410
- l && (this._value = String(l.value)), f(this, this._value), this.id ||= `wui-select-${Math.random().toString(36).slice(2, 9)}`;
2631
+ l && (this._value = String(l.value)), m(this, this._value), this.id ||= `wui-select-${Math.random().toString(36).slice(2, 9)}`;
2411
2632
  let u = `${this.id}-listbox`;
2412
2633
  this._listboxId = u;
2413
2634
  let d = e.map((e, t) => {
2414
2635
  let n = String(e.value) === String(this._value);
2415
- return `<button type="button" role="option" id="${F(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${F(e.value)}" aria-selected="${n}">${x(e)}</button>`;
2636
+ return `<button type="button" role="option" id="${P(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${P(e.value)}" aria-selected="${n}">${C(e)}</button>`;
2416
2637
  }).join("");
2417
2638
  this.innerHTML = `
2418
2639
  <div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
2419
- <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${F(u)}" aria-label="${F(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}>
2420
- ${a ? m(a, { className: "search-select-icon" }) : ""}
2421
- ${o ? `<span class="search-select-prefix">${_(o)}</span>` : ""}
2422
- <span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? x(l) : _(s)}</span>
2423
- ${n ? `<span class="search-select-reset" role="button" aria-label="Clear selection" hidden>${m("x")}</span>` : ""}
2424
- ${m("chevron-down", { className: "search-select-caret" })}
2640
+ <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${P(u)}" aria-label="${P(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}>
2641
+ ${a ? _(a, { className: "search-select-icon" }) : ""}
2642
+ ${o ? `<span class="search-select-prefix">${b(o)}</span>` : ""}
2643
+ <span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? C(l) : b(s)}</span>
2644
+ ${n ? `<span class="search-select-reset" role="button" aria-label="Clear selection" hidden>${_("x")}</span>` : ""}
2645
+ ${_("chevron-down", { className: "search-select-caret" })}
2425
2646
  </button>
2426
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${F(u)}" tabindex="-1" hidden>
2427
- ${t ? `<div class="search-select-search">${m("search")}<input class="search-select-input" placeholder="${F(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${m("x")}</button></div>` : ""}
2647
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${P(u)}" tabindex="-1" hidden>
2648
+ ${t ? `<div class="search-select-search">${_("search")}<input class="search-select-input" placeholder="${P(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${_("x")}</button></div>` : ""}
2428
2649
  <div class="search-select-options">${d}<div class="search-select-empty" hidden>No matches</div></div>
2429
2650
  </div>
2430
- </div>`, this._rendered = !0, f(this, this._value), this._wire(), this._syncReset();
2651
+ </div>`, this._rendered = !0, m(this, this._value), this._wire(), this._syncReset();
2431
2652
  }
2432
2653
  _refs() {
2433
2654
  return {
@@ -2453,7 +2674,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2453
2674
  let t = e.dataset.value === String(this._value);
2454
2675
  e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
2455
2676
  }
2456
- e && (e.innerHTML = t ? x(t) : _(this.getAttribute("placeholder") || "Select..."), e.classList.toggle("search-select-placeholder", !t));
2677
+ e && (e.innerHTML = t ? C(t) : b(this.getAttribute("placeholder") || "Select..."), e.classList.toggle("search-select-placeholder", !t));
2457
2678
  }
2458
2679
  _syncReset() {
2459
2680
  let { reset: e } = this._refs();
@@ -2487,7 +2708,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2487
2708
  }, s = (t) => {
2488
2709
  this.value = t.dataset.value, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.control.focus();
2489
2710
  };
2490
- this._navHandler = h({
2711
+ this._navHandler = v({
2491
2712
  getVisibleOptions: () => this._visible(),
2492
2713
  getActive: () => this._active,
2493
2714
  setActive: (e) => n(e),
@@ -2529,29 +2750,29 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2529
2750
  disconnectedCallback() {
2530
2751
  this._teardown();
2531
2752
  }
2532
- }, F = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), le = (e) => {
2753
+ }, P = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Te = (e) => {
2533
2754
  if (e == null) return null;
2534
2755
  let t = String(e).split(",").map((e) => e.trim().toUpperCase()).filter(Boolean);
2535
2756
  return t.length ? new Set(t) : null;
2536
- }, ue = (e) => {
2537
- let t = le(e);
2538
- return M.filter(([e]) => !t || t.has(e)).map(([e, t]) => ({
2757
+ }, Ee = (e) => {
2758
+ let t = Te(e);
2759
+ return Ce.filter(([e]) => !t || t.has(e)).map(([e, t]) => ({
2539
2760
  value: e,
2540
2761
  label: t,
2541
2762
  flag: e
2542
2763
  }));
2543
- }, de = class extends P {
2764
+ }, De = class extends we {
2544
2765
  static get observedAttributes() {
2545
- return [...P.observedAttributes, "countries"];
2766
+ return [...we.observedAttributes, "countries"];
2546
2767
  }
2547
2768
  _readOptions() {
2548
2769
  let e = this.getAttribute("countries");
2549
2770
  return this._countryCache?.attr !== e && (this._countryCache = {
2550
2771
  attr: e,
2551
- options: ue(e)
2772
+ options: Ee(e)
2552
2773
  }), this._countryCache.options;
2553
2774
  }
2554
- }, fe = [
2775
+ }, Oe = [
2555
2776
  "January",
2556
2777
  "February",
2557
2778
  "March",
@@ -2564,7 +2785,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2564
2785
  "October",
2565
2786
  "November",
2566
2787
  "December"
2567
- ], I = [
2788
+ ], ke = [
2568
2789
  "Su",
2569
2790
  "Mo",
2570
2791
  "Tu",
@@ -2572,24 +2793,24 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2572
2793
  "Th",
2573
2794
  "Fr",
2574
2795
  "Sa"
2575
- ], pe = (e) => String(e).padStart(2, "0"), L = (e, t, n) => `${e}-${pe(t + 1)}-${pe(n)}`, R = (e) => {
2796
+ ], Ae = (e) => String(e).padStart(2, "0"), je = (e, t, n) => `${e}-${Ae(t + 1)}-${Ae(n)}`, F = (e) => {
2576
2797
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
2577
2798
  return t ? {
2578
2799
  y: +t[1],
2579
2800
  m: t[2] - 1,
2580
2801
  d: +t[3]
2581
2802
  } : null;
2582
- }, z = (e) => {
2583
- let t = R(e);
2584
- return t ? `${pe(t.d)} ${fe[t.m].slice(0, 3)} ${t.y}` : "";
2585
- }, B = (e, t) => new Date(e, t + 1, 0).getDate(), V = (e, t) => {
2803
+ }, I = (e) => {
2804
+ let t = F(e);
2805
+ return t ? `${Ae(t.d)} ${Oe[t.m].slice(0, 3)} ${t.y}` : "";
2806
+ }, L = (e, t) => new Date(e, t + 1, 0).getDate(), R = (e, t) => {
2586
2807
  for (; t < 0;) t += 12, --e;
2587
2808
  for (; t > 11;) t -= 12, e += 1;
2588
2809
  return {
2589
2810
  y: e,
2590
2811
  m: t
2591
2812
  };
2592
- }, me = class extends e {
2813
+ }, Me = class extends e {
2593
2814
  static formAssociated = !0;
2594
2815
  static get observedAttributes() {
2595
2816
  return [
@@ -2641,7 +2862,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2641
2862
  return this._value;
2642
2863
  }
2643
2864
  set value(e) {
2644
- this._value = e || "", f(this, this._value), this._syncTrigger();
2865
+ this._value = e || "", m(this, this._value), this._syncTrigger();
2645
2866
  }
2646
2867
  _firstDay() {
2647
2868
  let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
@@ -2649,29 +2870,29 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2649
2870
  }
2650
2871
  render() {
2651
2872
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
2652
- let e = this.getAttribute("placeholder") || "Enter Date", t = R(this._value);
2873
+ let e = this.getAttribute("placeholder") || "Enter Date", t = F(this._value);
2653
2874
  t && (this._viewY = t.y, this._viewM = t.m);
2654
2875
  let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "", i = this.getAttribute("aria-label"), a = this.getAttribute("aria-describedby");
2655
2876
  this.innerHTML = `
2656
2877
  <div class="datepicker">
2657
- <button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${_(i)}"` : ""}${a ? ` aria-describedby="${_(a)}"` : ""}>
2658
- <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? z(this._value) : _(e)}</span>
2659
- ${m("calendar-dots")}
2878
+ <button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${b(i)}"` : ""}${a ? ` aria-describedby="${b(a)}"` : ""}>
2879
+ <span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? I(this._value) : b(e)}</span>
2880
+ ${_("calendar-dots")}
2660
2881
  </button>
2661
2882
  <div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
2662
- </div>`, this._rendered = !0, f(this, this._value), this._wire();
2883
+ </div>`, this._rendered = !0, m(this, this._value), this._wire();
2663
2884
  }
2664
2885
  _syncFormValue() {
2665
- f(this, this._value);
2886
+ m(this, this._value);
2666
2887
  }
2667
2888
  _syncTrigger() {
2668
2889
  let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
2669
2890
  if (!t) return;
2670
- let n = R(this._value);
2671
- t.textContent = n ? z(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
2891
+ let n = F(this._value);
2892
+ t.textContent = n ? I(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
2672
2893
  }
2673
2894
  _limits() {
2674
- let e = R(this.getAttribute("min")), t = R(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;
2895
+ let e = F(this.getAttribute("min")), t = F(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;
2675
2896
  return {
2676
2897
  dayDisabled: (e, t, i) => {
2677
2898
  let a = new Date(e, t, i).getTime();
@@ -2679,7 +2900,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2679
2900
  },
2680
2901
  monthDisabled: (e, t) => {
2681
2902
  let i = new Date(e, t, 1).getTime();
2682
- return new Date(e, t, B(e, t)).getTime() < n || i > r;
2903
+ return new Date(e, t, L(e, t)).getTime() < n || i > r;
2683
2904
  },
2684
2905
  yearDisabled: (e) => {
2685
2906
  let t = new Date(e, 0, 1).getTime();
@@ -2692,31 +2913,31 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2692
2913
  e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
2693
2914
  }
2694
2915
  _daysHtml() {
2695
- let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = B(this._viewY, this._viewM), r = R(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
2916
+ let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = L(this._viewY, this._viewM), r = F(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
2696
2917
  y: this._viewY,
2697
2918
  m: this._viewM,
2698
2919
  d: 1
2699
2920
  }, s = (e, t, n, s) => {
2700
- let c = L(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);
2921
+ let c = je(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);
2701
2922
  return `<button type="button" class="${[
2702
2923
  "datepicker-day",
2703
2924
  s ? "is-outside" : "",
2704
2925
  u ? "is-today" : "",
2705
2926
  l ? "is-selected" : ""
2706
2927
  ].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
2707
- }, c = "", l = V(this._viewY, this._viewM - 1), u = B(l.y, l.m);
2928
+ }, c = "", l = R(this._viewY, this._viewM - 1), u = L(l.y, l.m);
2708
2929
  for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
2709
2930
  for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
2710
- let d = V(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
2931
+ let d = R(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
2711
2932
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
2712
- let p = a(i.getFullYear(), i.getMonth(), i.getDate()), h = I.map((t, n) => I[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
2933
+ let p = a(i.getFullYear(), i.getMonth(), i.getDate()), m = ke.map((t, n) => ke[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
2713
2934
  return `
2714
2935
  <div class="datepicker-head">
2715
- <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${m("chevron-left")}</button>
2716
- <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${fe[this._viewM]} ${this._viewY}</button>
2717
- <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${m("chevron-right")}</button>
2936
+ <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${_("chevron-left")}</button>
2937
+ <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${Oe[this._viewM]} ${this._viewY}</button>
2938
+ <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${_("chevron-right")}</button>
2718
2939
  </div>
2719
- <div class="datepicker-weekdays">${h}</div>
2940
+ <div class="datepicker-weekdays">${m}</div>
2720
2941
  <div class="datepicker-grid${this._slide ? ` ${this._slide}` : ""}" role="grid">${c}</div>
2721
2942
  <div class="datepicker-foot">
2722
2943
  <button type="button" class="datepicker-link" data-today${p ? " disabled" : ""}>Today</button>
@@ -2724,25 +2945,25 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2724
2945
  </div>`;
2725
2946
  }
2726
2947
  _monthsHtml() {
2727
- let e = R(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
2948
+ let e = F(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
2728
2949
  for (let i = 0; i < 12; i++) {
2729
2950
  let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
2730
2951
  "datepicker-cell",
2731
2952
  o ? "is-today" : "",
2732
2953
  a ? "is-selected" : ""
2733
2954
  ].filter(Boolean).join(" ");
2734
- r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${fe[i].slice(0, 3)}</button>`;
2955
+ r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${Oe[i].slice(0, 3)}</button>`;
2735
2956
  }
2736
2957
  return `
2737
2958
  <div class="datepicker-head">
2738
- <button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${m("chevron-left")}</button>
2959
+ <button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${_("chevron-left")}</button>
2739
2960
  <button type="button" class="datepicker-month" data-view="years" aria-label="Choose year">${this._viewY}</button>
2740
- <button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${m("chevron-right")}</button>
2961
+ <button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${_("chevron-right")}</button>
2741
2962
  </div>
2742
2963
  <div class="datepicker-cells">${r}</div>`;
2743
2964
  }
2744
2965
  _yearsHtml() {
2745
- let e = R(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
2966
+ let e = F(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
2746
2967
  for (let a = 0; a < 12; a++) {
2747
2968
  let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
2748
2969
  "datepicker-cell",
@@ -2753,9 +2974,9 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2753
2974
  }
2754
2975
  return `
2755
2976
  <div class="datepicker-head">
2756
- <button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${m("chevron-left")}</button>
2977
+ <button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${_("chevron-left")}</button>
2757
2978
  <span class="datepicker-month">${r + 1} to ${r + 10}</span>
2758
- <button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${m("chevron-right")}</button>
2979
+ <button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${_("chevron-right")}</button>
2759
2980
  </div>
2760
2981
  <div class="datepicker-cells">${i}</div>`;
2761
2982
  }
@@ -2767,21 +2988,21 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2767
2988
  c(e, t, { clampHeight: !0 });
2768
2989
  }
2769
2990
  _setFocus(e, t, n, r) {
2770
- let { y: i, m: a } = V(e, t);
2991
+ let { y: i, m: a } = R(e, t);
2771
2992
  this._focus = {
2772
2993
  y: i,
2773
2994
  m: a,
2774
2995
  d: n
2775
2996
  };
2776
2997
  let o = i !== this._viewY || a !== this._viewM;
2777
- this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${L(i, a, n)}"]`)?.focus();
2998
+ this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${je(i, a, n)}"]`)?.focus();
2778
2999
  }
2779
3000
  _onKey(e) {
2780
3001
  if (this._mode !== "days") {
2781
3002
  e.key === "Escape" && this._close();
2782
3003
  return;
2783
3004
  }
2784
- let t = this._focus || R(this._value) || {
3005
+ let t = this._focus || F(this._value) || {
2785
3006
  y: this._viewY,
2786
3007
  m: this._viewM,
2787
3008
  d: 1
@@ -2799,17 +3020,17 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2799
3020
  case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
2800
3021
  case "PageUp": {
2801
3022
  e.preventDefault();
2802
- let n = V(t.y, t.m - (e.shiftKey ? 12 : 1));
2803
- return this._setFocus(n.y, n.m, Math.min(t.d, B(n.y, n.m)), "slide-prev");
3023
+ let n = R(t.y, t.m - (e.shiftKey ? 12 : 1));
3024
+ return this._setFocus(n.y, n.m, Math.min(t.d, L(n.y, n.m)), "slide-prev");
2804
3025
  }
2805
3026
  case "PageDown": {
2806
3027
  e.preventDefault();
2807
- let n = V(t.y, t.m + (e.shiftKey ? 12 : 1));
2808
- return this._setFocus(n.y, n.m, Math.min(t.d, B(n.y, n.m)), "slide-next");
3028
+ let n = R(t.y, t.m + (e.shiftKey ? 12 : 1));
3029
+ return this._setFocus(n.y, n.m, Math.min(t.d, L(n.y, n.m)), "slide-next");
2809
3030
  }
2810
3031
  case "Enter":
2811
3032
  case " ":
2812
- e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = L(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
3033
+ e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = je(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
2813
3034
  return;
2814
3035
  case "Escape": return this._close();
2815
3036
  default:
@@ -2821,7 +3042,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2821
3042
  if (!e || !t) return;
2822
3043
  let r = () => !t.hidden;
2823
3044
  this._open = () => {
2824
- let r = /* @__PURE__ */ new Date(), i = R(this._value);
3045
+ let r = /* @__PURE__ */ new Date(), i = F(this._value);
2825
3046
  (i || !this._viewNavigated) && (this._viewY = r.getFullYear(), this._viewM = r.getMonth()), this._mode = "days";
2826
3047
  let a = r.getFullYear() === this._viewY && r.getMonth() === this._viewM, o = i && i.y === this._viewY && i.m === this._viewM;
2827
3048
  this._focus = o ? i : {
@@ -2836,7 +3057,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2836
3057
  let t = e.target.closest("[data-nav]");
2837
3058
  if (t) {
2838
3059
  this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
2839
- let e = V(this._viewY, this._viewM + Number(t.dataset.nav));
3060
+ let e = R(this._viewY, this._viewM + Number(t.dataset.nav));
2840
3061
  this._viewY = e.y, this._viewM = e.m, this._focus = {
2841
3062
  y: e.y,
2842
3063
  m: e.m,
@@ -2876,7 +3097,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2876
3097
  if (e.target.closest("[data-today]")) {
2877
3098
  let e = /* @__PURE__ */ new Date();
2878
3099
  if (this._limits().dayDisabled(e.getFullYear(), e.getMonth(), e.getDate())) return;
2879
- this.value = L(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
3100
+ this.value = je(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
2880
3101
  return;
2881
3102
  }
2882
3103
  if (e.target.closest("[data-clear]")) {
@@ -2904,7 +3125,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2904
3125
  disconnectedCallback() {
2905
3126
  this._teardown();
2906
3127
  }
2907
- }, he = class extends e {
3128
+ }, Ne = class extends e {
2908
3129
  static formAssociated = !0;
2909
3130
  static get observedAttributes() {
2910
3131
  return [
@@ -2972,20 +3193,20 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
2972
3193
  text: e,
2973
3194
  empty: !0
2974
3195
  } : {
2975
- text: `${z(this._start) || "Start"} to ${z(this._end) || "End"}`,
3196
+ text: `${I(this._start) || "Start"} to ${I(this._end) || "End"}`,
2976
3197
  empty: !1
2977
3198
  };
2978
3199
  }
2979
3200
  render() {
2980
3201
  this._defaultStart === void 0 && (this._defaultStart = this.getAttribute("start") || "", this._defaultEnd = this.getAttribute("end") || "", this._start = this._defaultStart || this._start, this._end = this._defaultEnd || this._end);
2981
- let e = R(this._start);
3202
+ let e = F(this._start);
2982
3203
  e && (this._viewY = e.y, this._viewM = e.m);
2983
3204
  let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label(), a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
2984
3205
  this.innerHTML = `
2985
3206
  <div class="daterange">
2986
- <button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${_(a)}"` : ""}${o ? ` aria-describedby="${_(o)}"` : ""}>
2987
- <span data-range-label class="${i ? "search-select-placeholder" : ""}">${_(r)}</span>
2988
- ${m("calendar")}
3207
+ <button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${b(a)}"` : ""}${o ? ` aria-describedby="${b(o)}"` : ""}>
3208
+ <span data-range-label class="${i ? "search-select-placeholder" : ""}">${b(r)}</span>
3209
+ ${_("calendar")}
2989
3210
  </button>
2990
3211
  <div class="daterange-pop" role="dialog" aria-modal="false" hidden></div>
2991
3212
  </div>`, this._rendered = !0, this._syncMirrors(), this._wire();
@@ -3012,24 +3233,24 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3012
3233
  r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "", r.disabled = this.hasAttribute("disabled");
3013
3234
  }
3014
3235
  _limits() {
3015
- let e = R(this.getAttribute("min")), t = R(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;
3236
+ let e = F(this.getAttribute("min")), t = F(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;
3016
3237
  return (e, t, i) => {
3017
3238
  let a = new Date(e, t, i).getTime();
3018
3239
  return a < n || a > r;
3019
3240
  };
3020
3241
  }
3021
3242
  _monthHtml(e, t) {
3022
- let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = B(e, t), a = this._limits(), o = I.map((e, t) => I[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
3023
- let i = L(e, t, n), o = a(e, t, n);
3243
+ let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = L(e, t), a = this._limits(), o = ke.map((e, t) => ke[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
3244
+ let i = je(e, t, n), o = a(e, t, n);
3024
3245
  return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
3025
- }, c = "", l = V(e, t - 1), u = B(l.y, l.m);
3246
+ }, c = "", l = R(e, t - 1), u = L(l.y, l.m);
3026
3247
  for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
3027
3248
  for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
3028
- let d = V(e, t + 1), f = (7 - (r + i) % 7) % 7;
3249
+ let d = R(e, t + 1), f = (7 - (r + i) % 7) % 7;
3029
3250
  for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
3030
3251
  return `
3031
3252
  <div class="daterange-cal">
3032
- <div class="datepicker-month-label">${fe[t]} ${e}</div>
3253
+ <div class="datepicker-month-label">${Oe[t]} ${e}</div>
3033
3254
  <div class="datepicker-weekdays">${o}</div>
3034
3255
  <div class="datepicker-grid" role="grid">${c}</div>
3035
3256
  </div>`;
@@ -3037,11 +3258,11 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3037
3258
  _renderView() {
3038
3259
  let e = this.querySelector(".daterange-pop");
3039
3260
  if (!e) return;
3040
- let t = V(this._viewY, this._viewM + 1);
3261
+ let t = R(this._viewY, this._viewM + 1);
3041
3262
  e.innerHTML = `
3042
3263
  <div class="daterange-head">
3043
- <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${m("chevron-left")}</button>
3044
- <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${m("chevron-right")}</button>
3264
+ <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${_("chevron-left")}</button>
3265
+ <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${_("chevron-right")}</button>
3045
3266
  </div>
3046
3267
  <div class="daterange-cals">
3047
3268
  ${this._monthHtml(this._viewY, this._viewM)}
@@ -3063,7 +3284,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3063
3284
  n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
3064
3285
  }
3065
3286
  let i = e.querySelector("[data-range-hint]");
3066
- i && (i.textContent = this._start ? this._end ? `${z(this._start)} to ${z(this._end)}` : "Pick an end date" : "Pick a start date");
3287
+ i && (i.textContent = this._start ? this._end ? `${I(this._start)} to ${I(this._end)}` : "Pick an end date" : "Pick a start date");
3067
3288
  }
3068
3289
  _position(e, t) {
3069
3290
  c(e, t, { clampHeight: !0 });
@@ -3085,7 +3306,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3085
3306
  if (!e || !t) return;
3086
3307
  let r = () => !t.hidden;
3087
3308
  this._open = () => {
3088
- let r = R(this._start);
3309
+ let r = F(this._start);
3089
3310
  if (r) this._viewY = r.y, this._viewM = r.m;
3090
3311
  else {
3091
3312
  let e = /* @__PURE__ */ new Date();
@@ -3098,7 +3319,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3098
3319
  this._popClick = !0;
3099
3320
  let t = e.target.closest("[data-nav]");
3100
3321
  if (t) {
3101
- let e = V(this._viewY, this._viewM + Number(t.dataset.nav));
3322
+ let e = R(this._viewY, this._viewM + Number(t.dataset.nav));
3102
3323
  this._viewY = e.y, this._viewM = e.m, this._renderView();
3103
3324
  return;
3104
3325
  }
@@ -3128,7 +3349,7 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3128
3349
  disconnectedCallback() {
3129
3350
  this._teardown();
3130
3351
  }
3131
- }, ge = class extends e {
3352
+ }, Pe = class extends e {
3132
3353
  static get observedAttributes() {
3133
3354
  return [
3134
3355
  "static",
@@ -3149,10 +3370,10 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3149
3370
  e === "static" && this.isConnected && this._wire();
3150
3371
  }
3151
3372
  _maxScale() {
3152
- return _e(this.getAttribute("max-scale"), 1.6);
3373
+ return Fe(this.getAttribute("max-scale"), 1.6);
3153
3374
  }
3154
3375
  _radius() {
3155
- return _e(this.getAttribute("radius"), 100);
3376
+ return Fe(this.getAttribute("radius"), 100);
3156
3377
  }
3157
3378
  _magnifyEnabled() {
3158
3379
  return !(this.hasAttribute("static") || typeof matchMedia == "function" && (matchMedia("(pointer: coarse)").matches || matchMedia("(prefers-reduced-motion: reduce)").matches));
@@ -3177,26 +3398,352 @@ var j = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").repl
3177
3398
  _teardown() {
3178
3399
  this._pointerMoveListener &&= (this.removeEventListener("pointermove", this._pointerMoveListener), null), this._pointerLeaveListener &&= (this.removeEventListener("pointerleave", this._pointerLeaveListener), null), this._resetMagnification();
3179
3400
  }
3180
- }, _e = (e, t) => {
3401
+ }, Fe = (e, t) => {
3181
3402
  let n = Number.parseFloat(e);
3182
3403
  return Number.isFinite(n) ? n : t;
3183
- }, ve = {
3404
+ }, Ie = 4096, Le = [
3405
+ .92,
3406
+ .8,
3407
+ .65,
3408
+ .5
3409
+ ], Re = .8, ze = 8;
3410
+ function Be(e) {
3411
+ if (e == null || e === "" || e === "free") return null;
3412
+ let t = typeof e == "number" ? e : Number(e);
3413
+ return Number.isFinite(t) && t > 0 ? t : null;
3414
+ }
3415
+ function Ve(e, t, n) {
3416
+ if (!n) return {
3417
+ x: 0,
3418
+ y: 0,
3419
+ w: e,
3420
+ h: t
3421
+ };
3422
+ let r = e, i = r / n;
3423
+ return i > t && (i = t, r = i * n), {
3424
+ x: (e - r) / 2,
3425
+ y: (t - i) / 2,
3426
+ w: r,
3427
+ h: i
3428
+ };
3429
+ }
3430
+ function He(e, t, n) {
3431
+ return {
3432
+ ...e,
3433
+ x: Math.min(Math.max(e.x, 0), Math.max(t - e.w, 0)),
3434
+ y: Math.min(Math.max(e.y, 0), Math.max(n - e.h, 0))
3435
+ };
3436
+ }
3437
+ function Ue(e, t, n, r, i) {
3438
+ return He({
3439
+ ...e,
3440
+ x: e.x + t,
3441
+ y: e.y + n
3442
+ }, r, i);
3443
+ }
3444
+ function We(e, t) {
3445
+ return Math.min(32, e, t);
3446
+ }
3447
+ function Ge(e, t) {
3448
+ return t.w / e.w;
3449
+ }
3450
+ function Ke(e, t) {
3451
+ return Math.max(4, Ge(e, t));
3452
+ }
3453
+ function qe(e, t, n, r, i) {
3454
+ let a = Math.min(Math.max(n, 1), Ke(e, t)), o = e.h / e.w, s = Math.min(r, i / o), c = Math.min(Math.max(We(r, i), We(r, i) / o), s), l = Math.min(Math.max(t.w / a, c), s), u = l * o, d = e.x + e.w / 2, f = e.y + e.h / 2;
3455
+ return He({
3456
+ x: d - l / 2,
3457
+ y: f - u / 2,
3458
+ w: l,
3459
+ h: u
3460
+ }, r, i);
3461
+ }
3462
+ var Je = [
3463
+ "nw",
3464
+ "ne",
3465
+ "sw",
3466
+ "se"
3467
+ ];
3468
+ function Ye(e, t, n, r, i, a) {
3469
+ let o = We(i, a), s = t.endsWith("w"), c = t.startsWith("n"), l = s ? e.x + e.w : e.x, u = c ? e.y + e.h : e.y, d = Math.min(Math.max(n, 0), i), f = Math.min(Math.max(r, 0), a);
3470
+ return d = s ? Math.min(d, l - o) : Math.max(d, l + o), f = c ? Math.min(f, u - o) : Math.max(f, u + o), {
3471
+ x: Math.min(d, l),
3472
+ y: Math.min(f, u),
3473
+ w: Math.abs(d - l),
3474
+ h: Math.abs(f - u)
3475
+ };
3476
+ }
3477
+ function Xe(e, t = Ie) {
3478
+ let n = Math.min(1, t / Math.max(e.w, e.h));
3479
+ return {
3480
+ width: Math.max(1, Math.round(e.w * n)),
3481
+ height: Math.max(1, Math.round(e.h * n))
3482
+ };
3483
+ }
3484
+ var Ze = [
3485
+ "image/png",
3486
+ "image/jpeg",
3487
+ "image/webp"
3488
+ ], Qe = {
3489
+ "image/png": ".png",
3490
+ "image/jpeg": ".jpg",
3491
+ "image/webp": ".webp"
3492
+ };
3493
+ function $e(e) {
3494
+ let t = String(e || "").toLowerCase();
3495
+ return Ze.includes(t) ? t : "image/png";
3496
+ }
3497
+ function et(e, t) {
3498
+ let n = String(e || "image"), r = Qe[t];
3499
+ return (t === "image/jpeg" ? /\.jpe?g$/i.test(n) : n.toLowerCase().endsWith(r)) ? n : `${n.replace(/\.[^./\\]+$/, "") || "image"}${r}`;
3500
+ }
3501
+ async function tt(e, { width: t, height: n, type: r, maxBytes: i }) {
3502
+ let a = r, o = t, s = n, c = null;
3503
+ for (let t = 0; t <= ze; t++) {
3504
+ let n = a === "image/png" ? [void 0] : t === 0 ? Le : [Le[1]];
3505
+ for (let t of n) {
3506
+ if (c = await e(o, s, a, t), !c || (c.type && c.type !== a && (a = c.type), !(i > 0) || c.size <= i)) return c;
3507
+ if (a === "image/png") break;
3508
+ }
3509
+ o = Math.max(1, Math.round(o * Re)), s = Math.max(1, Math.round(s * Re));
3510
+ }
3511
+ return c;
3512
+ }
3513
+ //#endregion
3514
+ //#region src/WuiImageCrop.js
3515
+ var nt = .05, rt = .2, it = {
3516
+ w: 320,
3517
+ h: 240
3518
+ }, at = {
3519
+ nw: "top left",
3520
+ ne: "top right",
3521
+ sw: "bottom left",
3522
+ se: "bottom right"
3523
+ }, ot = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M5 12h14\"/></svg>", st = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M5 12h14M12 5v14\"/></svg>", ct = class extends e {
3524
+ static get observedAttributes() {
3525
+ return [
3526
+ "src",
3527
+ "aspect",
3528
+ "round"
3529
+ ];
3530
+ }
3531
+ constructor() {
3532
+ super(), this._rect = null, this._base = null, this._natural = null, this._drag = null, this._resizeObserver = null;
3533
+ }
3534
+ get src() {
3535
+ return this.getAttribute("src") || "";
3536
+ }
3537
+ set src(e) {
3538
+ e == null || e === "" ? this.removeAttribute("src") : this.setAttribute("src", String(e));
3539
+ }
3540
+ get aspect() {
3541
+ return Be(this.getAttribute("aspect"));
3542
+ }
3543
+ set aspect(e) {
3544
+ e == null || e === "" ? this.removeAttribute("aspect") : this.setAttribute("aspect", String(e));
3545
+ }
3546
+ get round() {
3547
+ return this.hasAttribute("round");
3548
+ }
3549
+ set round(e) {
3550
+ this.toggleAttribute("round", !!e);
3551
+ }
3552
+ get rect() {
3553
+ return this._rect ? { ...this._rect } : null;
3554
+ }
3555
+ get zoom() {
3556
+ return this._rect ? Ge(this._rect, this._base) : 1;
3557
+ }
3558
+ set zoom(e) {
3559
+ this._rect && (this._rect = qe(this._rect, this._base, Number(e) || 1, this._natural.w, this._natural.h), this._paint(), this._announce());
3560
+ }
3561
+ connectedCallback() {
3562
+ if (!this._rendered) {
3563
+ this.render();
3564
+ return;
3565
+ }
3566
+ this._observe();
3567
+ }
3568
+ disconnectedCallback() {
3569
+ this._resizeObserver?.disconnect(), this._resizeObserver = null;
3570
+ }
3571
+ attributeChangedCallback(e) {
3572
+ this._rendered && (e === "src" ? this._loadImage() : e === "aspect" ? (this._rebuildHandles(), this._resetRect()) : this._frame.classList.toggle("wui-crop-frame--round", this.round));
3573
+ }
3574
+ render() {
3575
+ this.innerHTML = `<div>
3576
+ <div class="wui-crop-stage" tabindex="0" role="group" aria-label="Crop area. Drag the frame or use the arrow keys to move it, and plus or minus to zoom.">
3577
+ <img class="wui-crop-img" alt="" draggable="false">
3578
+ <div class="wui-crop-frame"></div>
3579
+ </div>
3580
+ <div class="wui-crop-controls">
3581
+ <button type="button" class="wui-crop-zoombtn" data-zoom="out" aria-label="Zoom out">${ot}</button>
3582
+ <input type="range" class="form-range wui-crop-zoom" min="1" max="4" step="0.01" value="1" aria-label="Zoom">
3583
+ <button type="button" class="wui-crop-zoombtn" data-zoom="in" aria-label="Zoom in">${st}</button>
3584
+ </div>
3585
+ <div class="visually-hidden" data-wui-crop-live aria-live="polite"></div>
3586
+ </div>`, this._stage = this.querySelector(".wui-crop-stage"), this._img = this.querySelector(".wui-crop-img"), this._frame = this.querySelector(".wui-crop-frame"), this._slider = this.querySelector(".wui-crop-zoom"), this._live = this.querySelector("[data-wui-crop-live]"), this._rendered = !0, this._frame.classList.toggle("wui-crop-frame--round", this.round), this._rebuildHandles(), this._wire(), this._observe(), this._loadImage();
3587
+ }
3588
+ _rebuildHandles() {
3589
+ for (let e of this._frame.querySelectorAll(".wui-crop-handle")) e.remove();
3590
+ if (!this.aspect) for (let e of Je) {
3591
+ let t = document.createElement("button");
3592
+ t.type = "button", t.className = `wui-crop-handle wui-crop-handle--${e}`, t.dataset.handle = e, t.setAttribute("aria-label", `Resize ${at[e]} corner`), this._frame.appendChild(t);
3593
+ }
3594
+ }
3595
+ _loadImage() {
3596
+ this._rect = null, this._natural = null, this._drag = null;
3597
+ let e = this.src;
3598
+ this._img.hidden = !e, this._frame.hidden = !0, e && (this._img.onload = () => {
3599
+ this._natural = {
3600
+ w: this._img.naturalWidth,
3601
+ h: this._img.naturalHeight
3602
+ }, this._resetRect(), this.dispatchEvent(new Event("load"));
3603
+ }, this._img.onerror = () => {
3604
+ this._frame.hidden = !0, this.dispatchEvent(new Event("error"));
3605
+ }, this._img.src = e);
3606
+ }
3607
+ _resetRect() {
3608
+ this._natural && (this._base = Ve(this._natural.w, this._natural.h, this.aspect), this._rect = { ...this._base }, this._frame.hidden = !1, this._paint());
3609
+ }
3610
+ _observe() {
3611
+ typeof ResizeObserver > "u" || this._resizeObserver || (this._resizeObserver = new ResizeObserver(() => this._paint()), this._resizeObserver.observe(this._stage));
3612
+ }
3613
+ _view() {
3614
+ let e = this._stage.clientWidth || it.w, t = this._stage.clientHeight || it.h, n = Math.min(e / this._natural.w, t / this._natural.h), r = this._natural.w * n, i = this._natural.h * n;
3615
+ return {
3616
+ scale: n,
3617
+ left: (e - r) / 2,
3618
+ top: (t - i) / 2,
3619
+ iw: r,
3620
+ ih: i
3621
+ };
3622
+ }
3623
+ _paint() {
3624
+ if (!this._rect) return;
3625
+ let e = this._view();
3626
+ Object.assign(this._img.style, {
3627
+ left: `${e.left}px`,
3628
+ top: `${e.top}px`,
3629
+ width: `${e.iw}px`,
3630
+ height: `${e.ih}px`
3631
+ });
3632
+ let t = this._rect;
3633
+ Object.assign(this._frame.style, {
3634
+ left: `${e.left + t.x * e.scale}px`,
3635
+ top: `${e.top + t.y * e.scale}px`,
3636
+ width: `${t.w * e.scale}px`,
3637
+ height: `${t.h * e.scale}px`
3638
+ });
3639
+ let n = Ge(t, this._base), r = Ke(t, this._base);
3640
+ this._slider.max = String(r), this._slider.value = String(Math.min(Math.max(n, 1), r)), this._slider.setAttribute("aria-valuetext", `${Math.round(n * 100)}%`);
3641
+ }
3642
+ _announce() {
3643
+ this.dispatchEvent(new CustomEvent("change", {
3644
+ bubbles: !0,
3645
+ detail: this.rect
3646
+ }));
3647
+ }
3648
+ _say() {
3649
+ let e = this._rect, t = `Frame ${Math.round(e.w)} by ${Math.round(e.h)} pixels, ${Math.round(e.x)} from the left, ${Math.round(e.y)} from the top, zoom ${Math.round(Ge(e, this._base) * 100)}%.`;
3650
+ this._live.textContent = t === this._live.textContent ? `${t}\u00a0` : t;
3651
+ }
3652
+ _wire() {
3653
+ let e = this._stage;
3654
+ e.addEventListener("pointerdown", (t) => {
3655
+ if (!this._rect || t.button > 0) return;
3656
+ let n = t.target.closest?.(".wui-crop-handle");
3657
+ this._drag = {
3658
+ id: t.pointerId,
3659
+ corner: n ? n.dataset.handle : null,
3660
+ x: t.clientX,
3661
+ y: t.clientY,
3662
+ start: { ...this._rect }
3663
+ }, e.setPointerCapture?.(t.pointerId), n || e.focus(), t.preventDefault();
3664
+ }), e.addEventListener("pointermove", (t) => {
3665
+ let n = this._drag;
3666
+ if (!n || n.id !== t.pointerId) return;
3667
+ let r = this._view(), { w: i, h: a } = this._natural;
3668
+ if (n.corner) {
3669
+ let o = e.getBoundingClientRect(), s = (t.clientX - o.left - e.clientLeft - r.left) / r.scale, c = (t.clientY - o.top - e.clientTop - r.top) / r.scale;
3670
+ this._rect = Ye(this._rect, n.corner, s, c, i, a);
3671
+ } else this._rect = Ue(n.start, (t.clientX - n.x) / r.scale, (t.clientY - n.y) / r.scale, i, a);
3672
+ this._paint();
3673
+ });
3674
+ let t = (t) => {
3675
+ let n = this._drag;
3676
+ !n || n.id !== t.pointerId || (this._drag = null, e.releasePointerCapture?.(t.pointerId), this._announce());
3677
+ };
3678
+ e.addEventListener("pointerup", t), e.addEventListener("pointercancel", t), e.addEventListener("keydown", (e) => this._onKey(e)), e.addEventListener("wheel", (t) => {
3679
+ !this._rect || document.activeElement !== e || (t.preventDefault(), this.zoom *= t.deltaY < 0 ? 1.1 : 1 / 1.1);
3680
+ }, { passive: !1 });
3681
+ for (let e of ["input", "change"]) this._slider.addEventListener(e, (e) => e.stopPropagation());
3682
+ this._slider.addEventListener("input", () => {
3683
+ this.zoom = Number(this._slider.value);
3684
+ });
3685
+ for (let e of this.querySelectorAll(".wui-crop-zoombtn")) e.addEventListener("click", () => {
3686
+ this.zoom *= e.dataset.zoom === "in" ? 1.25 : .8;
3687
+ });
3688
+ }
3689
+ _onKey(e) {
3690
+ if (!this._rect || e.altKey || e.ctrlKey || e.metaKey) return;
3691
+ let { w: t, h: n } = this._natural;
3692
+ if (e.key === "+" || e.key === "=") this.zoom *= 1.25, this._say();
3693
+ else if (e.key === "-" || e.key === "_") this.zoom *= .8, this._say();
3694
+ else if (e.key.startsWith("Arrow")) {
3695
+ let r = e.shiftKey ? rt : nt, i = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0, a = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0, o = e.target.closest?.(".wui-crop-handle")?.dataset.handle;
3696
+ if (o) {
3697
+ let e = this._rect, s = (o.endsWith("w") ? e.x : e.x + e.w) + i * r * e.w, c = (o.startsWith("n") ? e.y : e.y + e.h) + a * r * e.h;
3698
+ this._rect = Ye(e, o, s, c, t, n);
3699
+ } else this._rect = Ue(this._rect, i * r * this._rect.w, a * r * this._rect.h, t, n);
3700
+ this._paint(), this._announce(), this._say();
3701
+ } else return;
3702
+ e.preventDefault();
3703
+ }
3704
+ async toBlob({ type: e, maxBytes: t = 0 } = {}) {
3705
+ if (!this._rect) return null;
3706
+ let n = $e(e), r = He(this._rect, this._natural.w, this._natural.h), { width: i, height: a } = Xe(r);
3707
+ return tt((e, t, n, i) => new Promise((a) => {
3708
+ let o = document.createElement("canvas");
3709
+ o.width = e, o.height = t;
3710
+ let s = o.getContext("2d");
3711
+ if (!s) {
3712
+ a(null);
3713
+ return;
3714
+ }
3715
+ n === "image/jpeg" && (s.fillStyle = "#fff", s.fillRect(0, 0, e, t)), s.drawImage(this._img, r.x, r.y, r.w, r.h, 0, 0, e, t), o.toBlob(a, n, i);
3716
+ }), {
3717
+ width: i,
3718
+ height: a,
3719
+ type: n,
3720
+ maxBytes: t
3721
+ });
3722
+ }
3723
+ async toFile({ name: e, type: t, maxBytes: n = 0 } = {}) {
3724
+ let r = await this.toBlob({
3725
+ type: t,
3726
+ maxBytes: n
3727
+ });
3728
+ return r ? new File([r], et(e, r.type), { type: r.type }) : null;
3729
+ }
3730
+ }, lt = {
3184
3731
  enter: "Enter",
3185
3732
  comma: ",",
3186
3733
  space: " ",
3187
3734
  tab: "Tab"
3188
- }, ye = {
3735
+ }, ut = {
3189
3736
  enter: "\n",
3190
3737
  comma: ",",
3191
3738
  space: " ",
3192
3739
  tab: " "
3193
- }, be = (e) => ve[e], xe = (e) => ye[e];
3194
- function Se(e, t) {
3740
+ }, dt = (e) => lt[e], ft = (e) => ut[e];
3741
+ function pt(e, t) {
3195
3742
  let n = [String(e ?? "")];
3196
3743
  for (let e of t) n = n.flatMap((t) => t.split(e));
3197
3744
  return n.map((e) => e.trim()).filter(Boolean);
3198
3745
  }
3199
- var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extends e {
3746
+ var mt = (e, t) => t.some((t) => String(e ?? "").includes(t)), ht = class extends e {
3200
3747
  static formAssociated = !0;
3201
3748
  _accessibleName() {
3202
3749
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
@@ -3260,7 +3807,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3260
3807
  return this._values.slice();
3261
3808
  }
3262
3809
  set values(e) {
3263
- this._values = Array.isArray(e) ? e.map(String) : [], f(this, this._values.join(",")), this._rendered && (this._renderControl(), this._renderOptions(this._query()));
3810
+ this._values = Array.isArray(e) ? e.map(String) : [], h(this, this._values), this._rendered && (this._renderControl(), this._renderOptions(this._query()));
3264
3811
  }
3265
3812
  set options(e) {
3266
3813
  if (this._optionsProp = Array.isArray(e) ? e : null, this._rendered && this._allowCustom) {
@@ -3293,10 +3840,10 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3293
3840
  value: e.getAttribute("value") ?? e.textContent.trim(),
3294
3841
  label: e.innerHTML,
3295
3842
  icon: e.getAttribute("icon") || void 0,
3296
- [g]: !0,
3843
+ [y]: !0,
3297
3844
  selected: e.hasAttribute("selected")
3298
3845
  };
3299
- for (let [n, r] of Ee) {
3846
+ for (let [n, r] of _t) {
3300
3847
  let i = e.getAttribute(n);
3301
3848
  i && (t[r] = i);
3302
3849
  }
@@ -3312,12 +3859,12 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3312
3859
  }
3313
3860
  _labelHtmlFor(e) {
3314
3861
  let t = this._readOptions().find((t) => String(t.value) === String(e));
3315
- return t ? x(t) : _(e);
3862
+ return t ? C(t) : b(e);
3316
3863
  }
3317
3864
  render() {
3318
3865
  this._snapshotDeclared();
3319
3866
  let e = this._allowCustom, t = this.hasAttribute("searchable") && !e, n = this.getAttribute("search-placeholder") || "Search…", r = this.getAttribute("icon"), i = this.getAttribute("size"), a = i === "sm" ? " search-select-sm" : i === "lg" ? " search-select-lg" : "";
3320
- f(this, this._values.join(",")), this.id ||= `wui-multiselect-${Math.random().toString(36).slice(2, 9)}`;
3867
+ h(this, this._values), this.id ||= `wui-multiselect-${Math.random().toString(36).slice(2, 9)}`;
3321
3868
  let o = `${this.id}-listbox`;
3322
3869
  this._listboxId = o;
3323
3870
  let s = this.hasAttribute("disabled");
@@ -3326,41 +3873,41 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3326
3873
  this.innerHTML = `
3327
3874
  <div class="search-select${a}">
3328
3875
  <div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : ""}>
3329
- ${r ? m(r, { className: "search-select-icon" }) : ""}
3330
- <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${H(o)}" aria-label="${H(this._accessibleName())}" aria-describedby="${H(e)}" autocomplete="off"${s ? " disabled" : ""} /></div>
3331
- ${m("chevron-down", { className: "search-select-caret" })}
3876
+ ${r ? _(r, { className: "search-select-icon" }) : ""}
3877
+ <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${z(o)}" aria-label="${z(this._accessibleName())}" aria-describedby="${z(e)}" autocomplete="off"${s ? " disabled" : ""} /></div>
3878
+ ${_("chevron-down", { className: "search-select-caret" })}
3332
3879
  </div>
3333
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${H(o)}" aria-multiselectable="true" tabindex="-1" hidden>
3880
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${z(o)}" aria-multiselectable="true" tabindex="-1" hidden>
3334
3881
  <div class="search-select-options"></div>
3335
3882
  </div>
3336
3883
  </div>
3337
- <div class="field-error wui-ms-custom-error" id="${H(e)}" aria-live="polite" hidden></div>`;
3884
+ <div class="field-error wui-ms-custom-error" id="${z(e)}" aria-live="polite" hidden></div>`;
3338
3885
  } else this.innerHTML = `
3339
3886
  <div class="search-select${a}">
3340
- <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${H(o)}" aria-label="${H(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
3341
- ${r ? m(r, { className: "search-select-icon" }) : ""}
3887
+ <div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${z(o)}" aria-label="${z(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
3888
+ ${r ? _(r, { className: "search-select-icon" }) : ""}
3342
3889
  <div class="ms-chips" data-chips></div>
3343
- ${m("chevron-down", { className: "search-select-caret" })}
3890
+ ${_("chevron-down", { className: "search-select-caret" })}
3344
3891
  </div>
3345
- <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${H(o)}" aria-multiselectable="true" tabindex="-1" hidden>
3346
- ${t ? `<div class="search-select-search">${m("search")}<input class="search-select-input" placeholder="${H(n)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${m("x")}</button></div>` : ""}
3892
+ <div class="search-select-menu search-select-menu-fixed" role="listbox" id="${z(o)}" aria-multiselectable="true" tabindex="-1" hidden>
3893
+ ${t ? `<div class="search-select-search">${_("search")}<input class="search-select-input" placeholder="${z(n)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${_("x")}</button></div>` : ""}
3347
3894
  <div class="search-select-options"></div>
3348
3895
  <div class="search-select-empty" hidden>No matches</div>
3349
3896
  </div>
3350
3897
  </div>`;
3351
- this._rendered = !0, this._customError = "", f(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
3898
+ this._rendered = !0, this._customError = "", h(this, this._values), this._renderControl(), this._renderOptions(), this._wire();
3352
3899
  }
3353
3900
  _renderControl() {
3354
3901
  let e = this.querySelector("[data-chips]");
3355
3902
  if (!e) return;
3356
- let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = 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="${H(e)}" aria-label="Remove ${H(Ne(this._labelFor(e)))}">${m("x")}</button></span>`).join("");
3903
+ let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = 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="${z(e)}" aria-label="Remove ${z(wt(this._labelFor(e)))}">${_("x")}</button></span>`).join("");
3357
3904
  if (n) {
3358
3905
  for (let t of [...e.querySelectorAll(":scope > .chip")]) t.remove();
3359
3906
  n.insertAdjacentHTML("beforebegin", r), n.placeholder = this._values.length ? "" : t, this._collapseChips();
3360
3907
  return;
3361
3908
  }
3362
3909
  if (!this._values.length) {
3363
- e.innerHTML = `<span class="search-select-placeholder">${_(t)}</span>`;
3910
+ e.innerHTML = `<span class="search-select-placeholder">${b(t)}</span>`;
3364
3911
  return;
3365
3912
  }
3366
3913
  e.innerHTML = r, this._collapseChips();
@@ -3384,11 +3931,11 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3384
3931
  i.textContent = `+${t.length - o}`;
3385
3932
  }
3386
3933
  _matches(e, t) {
3387
- return Ne(e.label).toLowerCase().includes(t) || String(e.description ?? "").toLowerCase().includes(t);
3934
+ return wt(e.label).toLowerCase().includes(t) || String(e.description ?? "").toLowerCase().includes(t);
3388
3935
  }
3389
3936
  _optionNamed(e) {
3390
3937
  let t = e.trim().toLowerCase();
3391
- return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t || Ne(e.label).trim().toLowerCase() === t);
3938
+ return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t || wt(e.label).trim().toLowerCase() === t);
3392
3939
  }
3393
3940
  _renderOptions(e) {
3394
3941
  let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
@@ -3397,9 +3944,9 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3397
3944
  i && (a = a.filter((e) => this._matches(e, i)));
3398
3945
  let o = this._listboxId || `${this.id || "wui-multiselect"}-listbox`, s = this._allowCustom && r && !this._optionNamed(r), c = a.map((e, t) => {
3399
3946
  let n = this._values.includes(String(e.value)), r = `${o}-opt-${t}`;
3400
- return De(e) ? Ae(e, r, n) : `<button type="button" role="option" id="${H(r)}" class="search-select-option${n ? " selected" : ""}" data-value="${H(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${x(e)}</span><span class="ms-check">${m("check")}</span></button>`;
3947
+ return vt(e) ? xt(e, r, n) : `<button type="button" role="option" id="${z(r)}" class="search-select-option${n ? " selected" : ""}" data-value="${z(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${C(e)}</span><span class="ms-check">${_("check")}</span></button>`;
3401
3948
  });
3402
- s && c.push(`<button type="button" role="option" id="${H(`${o}-opt-${a.length}`)}" class="search-select-option search-select-option-custom" data-value="${H(r)}" data-custom="true" aria-selected="false">Add “${_(r)}”</button>`), t.innerHTML = c.join(""), n && (n.hidden = a.length > 0), this._active = -1, this._combobox()?.removeAttribute("aria-activedescendant"), this._allowCustom && this._syncCustomMenu?.(), this._reanchor?.();
3949
+ s && c.push(`<button type="button" role="option" id="${z(`${o}-opt-${a.length}`)}" class="search-select-option search-select-option-custom" data-value="${z(r)}" data-custom="true" aria-selected="false">Add “${b(r)}”</button>`), t.innerHTML = c.join(""), n && (n.hidden = a.length > 0), this._active = -1, this._combobox()?.removeAttribute("aria-activedescendant"), this._allowCustom && this._syncCustomMenu?.(), this._reanchor?.();
3403
3950
  }
3404
3951
  _combobox() {
3405
3952
  return this._allowCustom ? this.querySelector("[data-input]") : this.querySelector(".search-select-control");
@@ -3412,7 +3959,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3412
3959
  _customRefusal(e) {
3413
3960
  let t = this.getAttribute("custom-invalid-message") || "Enter a valid value.", n = this.getAttribute("custom-pattern");
3414
3961
  if (n) {
3415
- let r = Me(n);
3962
+ let r = Ct(n);
3416
3963
  if (r && !r.test(e)) return t;
3417
3964
  }
3418
3965
  let r = this._validateCustom;
@@ -3441,95 +3988,95 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3441
3988
  this._teardown();
3442
3989
  let e = this.querySelector(".search-select-control"), t = this.querySelector(".search-select-menu"), n = this.querySelector(".search-select-input"), r = this.querySelector(".search-select-clear"), i = this.querySelector(".search-select-options"), a = this._allowCustom, o = a ? this.querySelector("[data-input]") : null, s = o || e;
3443
3990
  if (!e || !t) return;
3444
- let u = () => this.hasAttribute("disabled"), d = () => c(e, t, { matchWidth: !0 }), p = () => [...this.querySelectorAll(".search-select-option")], m = () => p().filter((e) => !e.hidden), g = (e) => {
3445
- let t = m();
3991
+ let u = () => this.hasAttribute("disabled"), d = () => c(e, t, { matchWidth: !0 }), f = () => [...this.querySelectorAll(".search-select-option")], p = () => f().filter((e) => !e.hidden), m = (e) => {
3992
+ let t = p();
3446
3993
  this._active = e;
3447
- for (let e of p()) e.classList.remove("is-active");
3994
+ for (let e of f()) e.classList.remove("is-active");
3448
3995
  e >= 0 && t[e] ? (t[e].classList.add("is-active"), t[e].scrollIntoView({ block: "nearest" }), s.setAttribute("aria-activedescendant", t[e].id)) : s.removeAttribute("aria-activedescendant");
3449
- }, _ = !1, v = () => a ? _ : !t.hidden, y = () => {
3450
- let n = _ && p().length > 0, r = t.hidden;
3996
+ }, g = !1, _ = () => a ? g : !t.hidden, y = () => {
3997
+ let n = g && f().length > 0, r = t.hidden;
3451
3998
  t.hidden = !n, s.setAttribute("aria-expanded", String(n)), e.classList.toggle("open", n), n && r && d();
3452
3999
  };
3453
4000
  this._syncCustomMenu = a ? y : null;
3454
4001
  let b = () => {
3455
4002
  if (!u()) {
3456
4003
  if (a) {
3457
- _ = !0, y();
4004
+ g = !0, y();
3458
4005
  return;
3459
4006
  }
3460
4007
  t.hidden = !1, e.setAttribute("aria-expanded", "true"), e.classList.add("open"), d(), n && (n.value = "", this._renderOptions(""), n.focus());
3461
4008
  }
3462
4009
  }, x = () => {
3463
- a ? (_ = !1, y()) : (t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open")), g(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "";
4010
+ a ? (g = !1, y()) : (t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open")), m(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "";
3464
4011
  }, S = () => {
3465
- f(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
3466
- }, C = (e) => {
4012
+ h(this, this._values), this.dispatchEvent(new Event("change", { bubbles: !0 }));
4013
+ }, ee = (e) => {
3467
4014
  let t = String(e);
3468
4015
  if (this._values.includes(t)) this._values = this._values.filter((e) => e !== t);
3469
4016
  else if (a && this._values.some((e) => e.toLowerCase() === t.toLowerCase())) return;
3470
4017
  else this._values = [...this._values, t];
3471
4018
  this._renderControl(), this._renderOptions(this._query()), S();
3472
- }, w = (e) => {
4019
+ }, C = (e) => {
3473
4020
  this._values = this._values.filter((t) => t !== String(e)), this._renderControl(), this._renderOptions(this._query()), S();
3474
- }, T = (e, { quiet: t = !1 } = {}) => {
3475
- let n = this._values.length, r = Ce(e, Te) ? Se(e, Te) : [e], i = [], a = "";
4021
+ }, w = (e, { quiet: t = !1 } = {}) => {
4022
+ let n = this._values.length, r = mt(e, gt) ? pt(e, gt) : [e], i = [], a = "";
3476
4023
  for (let e of r) {
3477
4024
  let t = this._commitTyped(e);
3478
4025
  t && (i.push(e.trim()), a ||= t);
3479
4026
  }
3480
4027
  t && i.length || (o.value = i.join(", "), this._setCustomError(a), this._values.length !== n && (this._renderControl(), S()), this._renderOptions(o.value));
3481
- }, E = (e) => {
4028
+ }, T = (e) => {
3482
4029
  if (!(!e || e.getAttribute("aria-disabled") === "true")) {
3483
4030
  if (e.dataset.custom === "true") {
3484
- T(e.dataset.value);
4031
+ w(e.dataset.value);
3485
4032
  return;
3486
4033
  }
3487
- C(e.dataset.value), o?.value && (o.value = "", this._setCustomError(""), this._renderOptions(""));
4034
+ ee(e.dataset.value), o?.value && (o.value = "", this._setCustomError(""), this._renderOptions(""));
3488
4035
  }
3489
4036
  };
3490
4037
  e.addEventListener("click", (e) => {
3491
4038
  if (u()) return;
3492
4039
  let t = e.target.closest("[data-remove]");
3493
4040
  if (t) {
3494
- e.stopPropagation(), w(t.dataset.remove), o?.focus();
4041
+ e.stopPropagation(), C(t.dataset.remove), o?.focus();
3495
4042
  return;
3496
4043
  }
3497
4044
  if (o) {
3498
- let t = v();
4045
+ let t = _();
3499
4046
  e.target !== o && o.focus(), e.target === o || !t ? b() : x();
3500
4047
  return;
3501
4048
  }
3502
- v() ? x() : b();
4049
+ _() ? x() : b();
3503
4050
  }), i.addEventListener("click", (e) => {
3504
4051
  let t = e.target.closest(".search-select-option");
3505
- t && (E(t), (o || n)?.focus());
4052
+ t && (T(t), (o || n)?.focus());
3506
4053
  }), i.addEventListener("mousemove", (e) => {
3507
4054
  let t = e.target.closest(".search-select-option");
3508
- t && g(m().indexOf(t));
3509
- }), i.addEventListener("mouseleave", () => g(-1)), i.addEventListener("error", (e) => {
4055
+ t && m(p().indexOf(t));
4056
+ }), i.addEventListener("mouseleave", () => m(-1)), i.addEventListener("error", (e) => {
3510
4057
  e.target?.classList?.contains("avatar-img") && e.target.remove();
3511
4058
  }, !0), n?.addEventListener("input", () => {
3512
- this._renderOptions(n.value), r && (r.hidden = !n.value), g(-1);
3513
- }), this._navHandler = h({
3514
- getVisibleOptions: m,
4059
+ this._renderOptions(n.value), r && (r.hidden = !n.value), m(-1);
4060
+ }), this._navHandler = v({
4061
+ getVisibleOptions: p,
3515
4062
  getActive: () => this._active,
3516
- setActive: (e) => g(e),
4063
+ setActive: (e) => m(e),
3517
4064
  onEnter: (e) => {
3518
- e ? E(e) : o?.value.trim() && T(o.value);
4065
+ e ? T(e) : o?.value.trim() && w(o.value);
3519
4066
  },
3520
4067
  onEscape: () => {
3521
4068
  this._navHandler.clearTypeahead(), x(), o || e.focus();
3522
4069
  }
3523
4070
  });
3524
- let D = (e) => {
4071
+ let E = (e) => {
3525
4072
  let t = o || n;
3526
4073
  if (e.key === "Backspace" && !t?.value && this._values.length) {
3527
- w(this._values[this._values.length - 1]);
4074
+ C(this._values[this._values.length - 1]);
3528
4075
  return;
3529
4076
  }
3530
4077
  this._navHandler.handler(e);
3531
4078
  };
3532
- if (n?.addEventListener("keydown", D), r?.addEventListener("click", () => {
4079
+ if (n?.addEventListener("keydown", E), r?.addEventListener("click", () => {
3533
4080
  n.value = "", this._renderOptions(""), r.hidden = !0, n.focus();
3534
4081
  }), o) {
3535
4082
  let t = (e) => {
@@ -3539,7 +4086,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3539
4086
  this._customError && this._setCustomError(""), this._renderOptions(o.value), b();
3540
4087
  }), o.addEventListener("keydown", (e) => {
3541
4088
  if (e.key === "," && o.value.trim()) {
3542
- e.preventDefault(), T(o.value);
4089
+ e.preventDefault(), w(o.value);
3543
4090
  return;
3544
4091
  }
3545
4092
  if (e.key === "Enter") {
@@ -3547,25 +4094,25 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3547
4094
  this._navHandler.handler(e);
3548
4095
  return;
3549
4096
  }
3550
- (e.key === "ArrowDown" || e.key === "ArrowUp") && !v() && b(), D(e);
4097
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && !_() && b(), E(e);
3551
4098
  }), o.addEventListener("paste", (e) => {
3552
4099
  let t = e.clipboardData?.getData("text/plain") ?? "";
3553
- Ce(t, Te) && (e.preventDefault(), T(`${o.value}${t}`));
4100
+ mt(t, gt) && (e.preventDefault(), w(`${o.value}${t}`));
3554
4101
  }), o.addEventListener("blur", (e) => {
3555
- e.relatedTarget && this.contains(e.relatedTarget) || (o.value.trim() && T(o.value, { quiet: !0 }), x());
4102
+ e.relatedTarget && this.contains(e.relatedTarget) || (o.value.trim() && w(o.value, { quiet: !0 }), x());
3556
4103
  });
3557
4104
  } else e.addEventListener("keydown", (e) => {
3558
- if (v()) {
3559
- D(e);
4105
+ if (_()) {
4106
+ E(e);
3560
4107
  return;
3561
4108
  }
3562
4109
  (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), b());
3563
4110
  });
3564
4111
  this._bindGlobal = () => {
3565
4112
  this._teardown(), !this._ro && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._collapseChips()), this._ro.observe(this)), this._onDocClick = (e) => {
3566
- v() && !this.contains(e.target) && x();
4113
+ _() && !this.contains(e.target) && x();
3567
4114
  }, document.addEventListener("click", this._onDocClick), l(this, () => {
3568
- v() && d();
4115
+ _() && d();
3569
4116
  });
3570
4117
  }, this._bindGlobal();
3571
4118
  }
@@ -3575,35 +4122,35 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3575
4122
  disconnectedCallback() {
3576
4123
  this._teardown(), this._ro?.disconnect(), this._ro = null;
3577
4124
  }
3578
- }, Te = [
4125
+ }, gt = [
3579
4126
  ",",
3580
4127
  ";",
3581
4128
  "\n",
3582
4129
  " "
3583
- ], Ee = [
4130
+ ], _t = [
3584
4131
  ["description", "description"],
3585
4132
  ["avatar", "avatar"],
3586
4133
  ["initials", "initials"],
3587
4134
  ["disabled-hint", "disabledHint"]
3588
- ], De = (e) => !!(e.description || e.avatar || e.initials || e.disabled || e.disabledHint), Oe = (e) => {
4135
+ ], vt = (e) => !!(e.description || e.avatar || e.initials || e.disabled || e.disabledHint), yt = (e) => {
3589
4136
  let t = String(e ?? "").trim();
3590
4137
  return /^(https?:)?\/\//i.test(t) || /^\/(?!\/)/.test(t) || /^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t) ? t : "";
3591
- }, ke = (e) => {
3592
- let t = Oe(e.avatar);
3593
- return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${_(e.initials ?? "")}</span>${t ? `<img class="avatar-img" src="${H(t)}" alt="" />` : ""}</span>`;
3594
- }, Ae = (e, t, n) => {
3595
- let r = !!e.disabled, i = e.description ? `<span class="wui-opt-desc">${_(e.description)}</span>` : "", a = e.disabledHint && r ? `<span class="wui-opt-hint">${_(e.disabledHint)}</span>` : "";
3596
- return `<button type="button" role="option" id="${H(t)}" class="search-select-option wui-opt-rich${n ? " selected" : ""}" data-value="${H(e.value)}" aria-selected="${n}"${r ? " aria-disabled=\"true\"" : ""}><span class="ms-opt-label"><span class="wui-opt-name">${x(e)}</span>${i}</span>${a}${ke(e)}<span class="ms-check">${m("check")}</span></button>`;
3597
- }, je = /* @__PURE__ */ new Map(), Me = (e) => {
3598
- if (je.has(e)) return je.get(e);
4138
+ }, bt = (e) => {
4139
+ let t = yt(e.avatar);
4140
+ return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${b(e.initials ?? "")}</span>${t ? `<img class="avatar-img" src="${z(t)}" alt="" />` : ""}</span>`;
4141
+ }, xt = (e, t, n) => {
4142
+ let r = !!e.disabled, i = e.description ? `<span class="wui-opt-desc">${b(e.description)}</span>` : "", a = e.disabledHint && r ? `<span class="wui-opt-hint">${b(e.disabledHint)}</span>` : "";
4143
+ return `<button type="button" role="option" id="${z(t)}" class="search-select-option wui-opt-rich${n ? " selected" : ""}" data-value="${z(e.value)}" aria-selected="${n}"${r ? " aria-disabled=\"true\"" : ""}><span class="ms-opt-label"><span class="wui-opt-name">${C(e)}</span>${i}</span>${a}${bt(e)}<span class="ms-check">${_("check")}</span></button>`;
4144
+ }, St = /* @__PURE__ */ new Map(), Ct = (e) => {
4145
+ if (St.has(e)) return St.get(e);
3599
4146
  let t = null;
3600
4147
  try {
3601
4148
  t = RegExp(`^(?:${e})$`, "u");
3602
4149
  } catch {
3603
4150
  console.warn(`<wui-multiselect> custom-pattern is not a valid regular expression and is ignored: ${e}`);
3604
4151
  }
3605
- return je.set(e, t), t;
3606
- }, H = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Ne = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), Pe = /[^0-9]/g, Fe = /[^0-9a-zA-Z]/g, Ie = class extends e {
4152
+ return St.set(e, t), t;
4153
+ }, z = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), wt = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), Tt = /[^0-9]/g, Et = /[^0-9a-zA-Z]/g, Dt = class extends e {
3607
4154
  static formAssociated = !0;
3608
4155
  static get observedAttributes() {
3609
4156
  return [
@@ -3631,10 +4178,10 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3631
4178
  return this._value ?? "";
3632
4179
  }
3633
4180
  set value(e) {
3634
- this._value = this._clean(e), f(this, this._value), this._paint();
4181
+ this._value = this._clean(e), m(this, this._value), this._paint();
3635
4182
  }
3636
4183
  _clean(e) {
3637
- return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? Fe : Pe, "").slice(0, this.length);
4184
+ return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? Et : Tt, "").slice(0, this.length);
3638
4185
  }
3639
4186
  constructor() {
3640
4187
  super();
@@ -3648,10 +4195,10 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3648
4195
  this._rendered ? this._onSelectionChange && document.addEventListener("selectionchange", this._onSelectionChange) : (this._defaultCaptured ||= (this._defaultValue = this._value, !0), this.render());
3649
4196
  }
3650
4197
  formResetCallback() {
3651
- this._value = this._defaultValue || "", f(this, this._value), this._paint();
4198
+ this._value = this._defaultValue || "", m(this, this._value), this._paint();
3652
4199
  }
3653
4200
  attributeChangedCallback(e, t, n) {
3654
- this._rendered && (e === "value" ? (this._value = this._clean(n), f(this, this._value), this._paint()) : this.render());
4201
+ this._rendered && (e === "value" ? (this._value = this._clean(n), m(this, this._value), this._paint()) : this.render());
3655
4202
  }
3656
4203
  render() {
3657
4204
  this._value = this._clean(this.getAttribute("value") ?? this._value);
@@ -3669,7 +4216,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3669
4216
  spellcheck="false"
3670
4217
  ${n ? "disabled" : ""} />
3671
4218
  <div class="otp-slots" aria-hidden="true">${r}</div>
3672
- </div>`, this._rendered = !0, f(this, this._value), this._wire(), this._paint();
4219
+ </div>`, this._rendered = !0, m(this, this._value), this._wire(), this._paint();
3673
4220
  }
3674
4221
  _refs() {
3675
4222
  return {
@@ -3691,7 +4238,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3691
4238
  if (!e) return;
3692
4239
  let t = (e) => {
3693
4240
  let t = this._clean(e), n = t !== this._value;
3694
- this._value = t, f(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
4241
+ this._value = t, m(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
3695
4242
  bubbles: !0,
3696
4243
  detail: t
3697
4244
  }));
@@ -3725,7 +4272,7 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
3725
4272
  disconnectedCallback() {
3726
4273
  this._onSelectionChange && document.removeEventListener("selectionchange", this._onSelectionChange);
3727
4274
  }
3728
- }, Le = {
4275
+ }, Ot = {
3729
4276
  AD: ["Europe/Andorra"],
3730
4277
  AE: ["Asia/Dubai"],
3731
4278
  AF: ["Asia/Kabul"],
@@ -4127,13 +4674,13 @@ var Ce = (e, t) => t.some((t) => String(e ?? "").includes(t)), we = class extend
4127
4674
  ZA: ["Africa/Johannesburg"],
4128
4675
  ZM: ["Africa/Lusaka"],
4129
4676
  ZW: ["Africa/Harare"]
4130
- }, Re = new Set(M.map(([e]) => e)), ze = /* @__PURE__ */ new Map();
4131
- for (let [e, t] of Object.entries(Le)) for (let n of t) ze.set(n, e);
4132
- function Be(e) {
4133
- let t = ze.get(e);
4134
- return t && Re.has(t) ? t : null;
4677
+ }, kt = new Set(Ce.map(([e]) => e)), At = /* @__PURE__ */ new Map();
4678
+ for (let [e, t] of Object.entries(Ot)) for (let n of t) At.set(n, e);
4679
+ function jt(e) {
4680
+ let t = At.get(e);
4681
+ return t && kt.has(t) ? t : null;
4135
4682
  }
4136
- function Ve(e) {
4683
+ function Mt(e) {
4137
4684
  if (!e) return null;
4138
4685
  let t;
4139
4686
  try {
@@ -4141,9 +4688,9 @@ function Ve(e) {
4141
4688
  } catch {
4142
4689
  return null;
4143
4690
  }
4144
- return t && Re.has(t) ? t : null;
4691
+ return t && kt.has(t) ? t : null;
4145
4692
  }
4146
- function He() {
4693
+ function Nt() {
4147
4694
  let e;
4148
4695
  try {
4149
4696
  e = Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -4151,77 +4698,77 @@ function He() {
4151
4698
  e = void 0;
4152
4699
  }
4153
4700
  let t = typeof navigator > "u" ? void 0 : navigator.language;
4154
- return Be(e) || Ve(t) || "IN";
4701
+ return jt(e) || Mt(t) || "IN";
4155
4702
  }
4156
4703
  //#endregion
4157
4704
  //#region src/WuiPhone.js
4158
- var Ue = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, U = null, We = null;
4159
- function Ge() {
4160
- return U ? Promise.resolve(U) : (We ||= Promise.all([import("./max-BDKx469G.js"), import("./examples.mobile.json-BMXTGiGC.js")]).then(([e, t]) => (U = {
4705
+ var Pt = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, B = null, Ft = null;
4706
+ function It() {
4707
+ return B ? Promise.resolve(B) : (Ft ||= Promise.all([import("./max-BDKx469G.js"), import("./examples.mobile.json-BMXTGiGC.js")]).then(([e, t]) => (B = {
4161
4708
  AsYouType: e.AsYouType,
4162
4709
  getExampleNumber: e.getExampleNumber,
4163
4710
  isValidPhoneNumber: e.isValidPhoneNumber,
4164
4711
  parsePhoneNumber: e.parsePhoneNumber,
4165
4712
  examples: t.default || t
4166
- }, U)).catch(() => null), We);
4713
+ }, B)).catch(() => null), Ft);
4167
4714
  }
4168
- function Ke(e, t) {
4715
+ function Lt(e, t) {
4169
4716
  let n = `+${N(e)}`;
4170
4717
  return t?.startsWith(n) ? t.slice(n.length).trimStart() : null;
4171
4718
  }
4172
- function W(e, t) {
4173
- if (!U || !t) return t;
4719
+ function Rt(e, t) {
4720
+ if (!B || !t) return t;
4174
4721
  try {
4175
- return Ke(e, new U.AsYouType(e).input(`+${N(e)}${t}`)) || t;
4722
+ return Lt(e, new B.AsYouType(e).input(`+${N(e)}${t}`)) || t;
4176
4723
  } catch {
4177
4724
  return t;
4178
4725
  }
4179
4726
  }
4180
- function qe(e, t) {
4727
+ function zt(e, t) {
4181
4728
  if (t <= 0) return 0;
4182
4729
  let n = 0;
4183
4730
  for (let r = 0; r < e.length; r++) if (/[0-9]/.test(e[r]) && (n += 1, n === t)) return r + 1;
4184
4731
  return e.length;
4185
4732
  }
4186
- function G(e) {
4187
- if (!U) return null;
4733
+ function Bt(e) {
4734
+ if (!B) return null;
4188
4735
  try {
4189
- return Ke(e, U.getExampleNumber(e, U.examples)?.formatInternational()) || null;
4736
+ return Lt(e, B.getExampleNumber(e, B.examples)?.formatInternational()) || null;
4190
4737
  } catch {
4191
4738
  return null;
4192
4739
  }
4193
4740
  }
4194
- function Je(e) {
4195
- if (!U || !e) return null;
4741
+ function Vt(e) {
4742
+ if (!B || !e) return null;
4196
4743
  try {
4197
- if (!U.isValidPhoneNumber(e)) return !1;
4198
- let t = U.parsePhoneNumber(e)?.getType?.();
4744
+ if (!B.isValidPhoneNumber(e)) return !1;
4745
+ let t = B.parsePhoneNumber(e)?.getType?.();
4199
4746
  return t === void 0 || t === "MOBILE" || t === "FIXED_LINE_OR_MOBILE";
4200
4747
  } catch {
4201
4748
  return null;
4202
4749
  }
4203
4750
  }
4204
- function Ye(e) {
4205
- if (!U) return null;
4751
+ function Ht(e) {
4752
+ if (!B) return null;
4206
4753
  try {
4207
- let t = U.getExampleNumber(e, U.examples);
4754
+ let t = B.getExampleNumber(e, B.examples);
4208
4755
  return t?.nationalNumber ? t.nationalNumber.length : null;
4209
4756
  } catch {
4210
4757
  return null;
4211
4758
  }
4212
4759
  }
4213
- function Xe(e, t, n) {
4760
+ function Ut(e, t, n) {
4214
4761
  try {
4215
- let r = U.parsePhoneNumber(t, e), i = r?.nationalNumber;
4762
+ let r = B.parsePhoneNumber(t, e), i = r?.nationalNumber;
4216
4763
  return !i || r.country !== e || i.length > n || !t.endsWith(i) ? null : i;
4217
4764
  } catch {
4218
4765
  return null;
4219
4766
  }
4220
4767
  }
4221
- function Ze(e) {
4222
- if (!U || !e?.trim().startsWith("+")) return null;
4768
+ function Wt(e) {
4769
+ if (!B || !e?.trim().startsWith("+")) return null;
4223
4770
  try {
4224
- let t = new U.AsYouType();
4771
+ let t = new B.AsYouType();
4225
4772
  t.input(e.trim());
4226
4773
  let n = t.getCountry();
4227
4774
  return n ? {
@@ -4232,7 +4779,7 @@ function Ze(e) {
4232
4779
  return null;
4233
4780
  }
4234
4781
  }
4235
- var Qe = class extends e {
4782
+ var Gt = class extends e {
4236
4783
  static formAssociated = !0;
4237
4784
  static get observedAttributes() {
4238
4785
  return [
@@ -4252,7 +4799,7 @@ var Qe = class extends e {
4252
4799
  } catch {
4253
4800
  this._internals = null;
4254
4801
  }
4255
- this._defaultCountry = He(), this._country = this._defaultCountry, this._national = "", this._active = -1, this._committedValue = "";
4802
+ this._defaultCountry = Nt(), this._country = this._defaultCountry, this._national = "", this._active = -1, this._committedValue = "";
4256
4803
  }
4257
4804
  connectedCallback() {
4258
4805
  if (!this._rendered) {
@@ -4282,7 +4829,7 @@ var Qe = class extends e {
4282
4829
  return this._national ? `+${N(this._country)}${this._national}` : "";
4283
4830
  }
4284
4831
  set value(e) {
4285
- let t = String(e ?? "").trim(), n = Ze(t);
4832
+ let t = String(e ?? "").trim(), n = Wt(t);
4286
4833
  if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
4287
4834
  else if (t.startsWith("+")) {
4288
4835
  let e = t.replace(/[^0-9]/g, ""), n = String(N(this._country));
@@ -4291,7 +4838,7 @@ var Qe = class extends e {
4291
4838
  n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._committedValue = this.value, this._syncMirror();
4292
4839
  }
4293
4840
  _syncMirror() {
4294
- f(this, this.value);
4841
+ m(this, this.value);
4295
4842
  }
4296
4843
  _emitInput() {
4297
4844
  this.dispatchEvent(new Event("input", { bubbles: !0 }));
@@ -4301,27 +4848,27 @@ var Qe = class extends e {
4301
4848
  }
4302
4849
  render() {
4303
4850
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._country = this.getAttribute("country") || this._country;
4304
- let e = this.getAttribute("placeholder") || G(this._country) || "Enter phone number";
4851
+ let e = this.getAttribute("placeholder") || Bt(this._country) || "Enter phone number";
4305
4852
  this.id ||= `wui-phone-${Math.random().toString(36).slice(2, 9)}`;
4306
4853
  let t = `${this.id}-listbox`;
4307
4854
  this._listboxId = t;
4308
- let n = M.map(([e, n, r], i) => `<button type="button" role="option" id="${K(`${t}-opt-${i}`)}" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}" aria-selected="${e === this._country}"><span class="${Ue(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join("");
4855
+ let n = Ce.map(([e, n, r], i) => `<button type="button" role="option" id="${V(`${t}-opt-${i}`)}" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}" aria-selected="${e === this._country}"><span class="${Pt(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join("");
4309
4856
  this.innerHTML = `
4310
4857
  <div class="phone-input-wrap">
4311
4858
  <div class="phone-country-adornment">
4312
- <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${K(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
4313
- <span class="${Ue(this._country)}" data-flag aria-hidden="true"></span>
4314
- ${m("chevron-down", { className: "phone-chevron" })}
4859
+ <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${V(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
4860
+ <span class="${Pt(this._country)}" data-flag aria-hidden="true"></span>
4861
+ ${_("chevron-down", { className: "phone-chevron" })}
4315
4862
  <span class="phone-dial" data-dial>+${N(this._country)}</span>
4316
4863
  </button>
4317
- <div class="country-dropdown-menu" role="listbox" id="${K(t)}" tabindex="-1" hidden>
4318
- <div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${m("search")}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${K(t)}" aria-autocomplete="list" /></div>
4864
+ <div class="country-dropdown-menu" role="listbox" id="${V(t)}" tabindex="-1" hidden>
4865
+ <div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${_("search")}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${V(t)}" aria-autocomplete="list" /></div>
4319
4866
  <div class="country-list-scroll">${n}<div class="country-empty" hidden>No countries found</div></div>
4320
4867
  </div>
4321
4868
  </div>
4322
- <input type="tel" class="input" placeholder="${K(e)}" value="${K(W(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${K(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${K(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
4869
+ <input type="tel" class="input" placeholder="${V(e)}" value="${V(Rt(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${V(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${V(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
4323
4870
  </div>
4324
- <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, f(this, this.value), this._wire();
4871
+ <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, m(this, this.value), this._wire();
4325
4872
  }
4326
4873
  _itemEls() {
4327
4874
  return [...this.querySelectorAll(".country-dropdown-item")];
@@ -4350,12 +4897,12 @@ var Qe = class extends e {
4350
4897
  }
4351
4898
  a && (a.hidden = n > 0);
4352
4899
  }, v = (e) => {
4353
- this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), s && (s.className = Ue(e)), d && (d.textContent = `+${N(e)}`);
4900
+ this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), s && (s.className = Pt(e)), d && (d.textContent = `+${N(e)}`);
4354
4901
  for (let t of this._itemEls()) {
4355
4902
  let n = t.dataset.iso === e;
4356
4903
  t.classList.toggle("selected", n), t.setAttribute("aria-selected", String(n));
4357
4904
  }
4358
- !this.getAttribute("placeholder") && o && (o.placeholder = G(e) || "Enter phone number"), o && this._national && (o.value = W(e, this._national)), g(), this._syncMirror(), this._emitChange(), o?.focus();
4905
+ !this.getAttribute("placeholder") && o && (o.placeholder = Bt(e) || "Enter phone number"), o && this._national && (o.value = Rt(e, this._national)), g(), this._syncMirror(), this._emitChange(), o?.focus();
4359
4906
  }, y = (t) => {
4360
4907
  let n = this._visibleItems();
4361
4908
  if (t.key === "ArrowDown") {
@@ -4389,7 +4936,7 @@ var Qe = class extends e {
4389
4936
  let b = this.querySelector("[data-phone-error]"), x = (e) => {
4390
4937
  if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), b) {
4391
4938
  if (e) {
4392
- let e = G(this._country);
4939
+ let e = Bt(this._country);
4393
4940
  b.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
4394
4941
  }
4395
4942
  b.hidden = !e;
@@ -4397,24 +4944,24 @@ var Qe = class extends e {
4397
4944
  };
4398
4945
  o.addEventListener("input", (e) => {
4399
4946
  e.stopPropagation();
4400
- let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i = Ye(this._country);
4947
+ let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i = Ht(this._country);
4401
4948
  if (i && r.length > i) {
4402
- let e = Xe(this._country, r, i);
4949
+ let e = Ut(this._country, r, i);
4403
4950
  e ? (n = Math.max(0, n - (r.length - e.length)), r = e) : r = r.slice(0, i);
4404
4951
  }
4405
4952
  this._national = r;
4406
- let a = W(this._country, this._national);
4953
+ let a = Rt(this._country, this._national);
4407
4954
  if (o.value !== a) {
4408
4955
  o.value = a;
4409
- let e = qe(a, Math.min(n, r.length));
4956
+ let e = zt(a, Math.min(n, r.length));
4410
4957
  o.setSelectionRange(e, e);
4411
4958
  }
4412
- this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national || Je(this.value) === !0) && x(!1);
4959
+ this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national || Vt(this.value) === !0) && x(!1);
4413
4960
  }), o.addEventListener("change", (e) => e.stopPropagation()), o.addEventListener("blur", () => {
4414
- x(this._national.length > 0 && Je(this.value) === !1), this.value !== this._committedValue && this._emitChange();
4961
+ x(this._national.length > 0 && Vt(this.value) === !1), this.value !== this._committedValue && this._emitChange();
4415
4962
  }), o.addEventListener("paste", (e) => {
4416
- let t = Ze(e.clipboardData?.getData("text"));
4417
- t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = W(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this._emitInput(), this._emitChange(), this.querySelector("input[type=tel]")?.focus());
4963
+ let t = Wt(e.clipboardData?.getData("text"));
4964
+ t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = Rt(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this._emitInput(), this._emitChange(), this.querySelector("input[type=tel]")?.focus());
4418
4965
  }), this._bindGlobal = () => {
4419
4966
  this._teardownGlobals?.(), this._onDocClick = (e) => {
4420
4967
  f() && !this.contains(e.target) && g();
@@ -4423,9 +4970,9 @@ var Qe = class extends e {
4423
4970
  });
4424
4971
  }, this._teardownGlobals = () => {
4425
4972
  this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), u(this);
4426
- }, this._bindGlobal(), Ge().then((e) => {
4427
- if (!(!e || !o.isConnected) && (this._national && (o.value = W(this._country, this._national)), !this.getAttribute("placeholder"))) {
4428
- let e = G(this._country);
4973
+ }, this._bindGlobal(), It().then((e) => {
4974
+ if (!(!e || !o.isConnected) && (this._national && (o.value = Rt(this._country, this._national)), !this.getAttribute("placeholder"))) {
4975
+ let e = Bt(this._country);
4429
4976
  e && (o.placeholder = e);
4430
4977
  }
4431
4978
  }), this._syncMirror();
@@ -4436,7 +4983,7 @@ var Qe = class extends e {
4436
4983
  disconnectedCallback() {
4437
4984
  this._teardown();
4438
4985
  }
4439
- }, K = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), $e = class extends e {
4986
+ }, V = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Kt = class extends e {
4440
4987
  static formAssociated = !0;
4441
4988
  static get observedAttributes() {
4442
4989
  return [
@@ -4476,19 +5023,19 @@ var Qe = class extends e {
4476
5023
  return this._value;
4477
5024
  }
4478
5025
  set value(e) {
4479
- this._value = this._snapToStep(this._clamp(q(e, this._value))), this._syncValue(), this._syncMirrors();
5026
+ this._value = this._snapToStep(this._clamp(H(e, this._value))), this._syncValue(), this._syncMirrors();
4480
5027
  }
4481
5028
  get start() {
4482
5029
  return this._start;
4483
5030
  }
4484
5031
  set start(e) {
4485
- this._start = Math.min(this._snapToStep(this._clamp(q(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
5032
+ this._start = Math.min(this._snapToStep(this._clamp(H(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
4486
5033
  }
4487
5034
  get end() {
4488
5035
  return this._end;
4489
5036
  }
4490
5037
  set end(e) {
4491
- this._end = Math.max(this._snapToStep(this._clamp(q(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
5038
+ this._end = Math.max(this._snapToStep(this._clamp(H(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
4492
5039
  }
4493
5040
  attributeChangedCallback(e, t, n) {
4494
5041
  if (e === "value" || e === "start" || e === "end" || e === "min" || e === "max" || e === "step") {
@@ -4501,19 +5048,19 @@ var Qe = class extends e {
4501
5048
  this._isRange() ? this._resetRange() : this._resetSingle();
4502
5049
  }
4503
5050
  _updateFromAttribute(e) {
4504
- e === "value" ? this._value = this._snapToStep(this._clamp(q(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(q(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(q(this.getAttribute("end"), this._end))));
5051
+ e === "value" ? this._value = this._snapToStep(this._clamp(H(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(H(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(H(this.getAttribute("end"), this._end))));
4505
5052
  }
4506
5053
  _isRange() {
4507
5054
  return this.hasAttribute("range");
4508
5055
  }
4509
5056
  _min() {
4510
- return q(this.getAttribute("min"), 0);
5057
+ return H(this.getAttribute("min"), 0);
4511
5058
  }
4512
5059
  _max() {
4513
- return q(this.getAttribute("max"), 100);
5060
+ return H(this.getAttribute("max"), 100);
4514
5061
  }
4515
5062
  _step() {
4516
- return q(this.getAttribute("step"), 1);
5063
+ return H(this.getAttribute("step"), 1);
4517
5064
  }
4518
5065
  _clamp(e) {
4519
5066
  return Math.max(this._min(), Math.min(e, this._max()));
@@ -4581,7 +5128,7 @@ var Qe = class extends e {
4581
5128
  aria-valuenow="${this._value}"
4582
5129
  aria-valuetext="${this._formatValue(this._value)}"
4583
5130
  ${a ? "disabled" : ""}
4584
- aria-label="${et(this.getAttribute("aria-label") || "Value")}"
5131
+ aria-label="${qt(this.getAttribute("aria-label") || "Value")}"
4585
5132
  ></button>
4586
5133
  `}
4587
5134
  ${this.hasAttribute("show-value") ? n ? `<span class="slider-value">${this._formatValue(this._start)} to ${this._formatValue(this._end)}</span>` : `<span class="slider-value">${this._formatValue(this._value)}</span>` : ""}
@@ -4616,7 +5163,7 @@ var Qe = class extends e {
4616
5163
  this._isRange() ? this._syncRangeMirrors() : this._syncSingleMirror();
4617
5164
  }
4618
5165
  _syncSingleMirror() {
4619
- this.getAttribute("name") && f(this, String(this._value));
5166
+ this.getAttribute("name") && m(this, String(this._value));
4620
5167
  }
4621
5168
  _syncRangeMirrors() {
4622
5169
  let e = this.getAttribute("start-name") || this.getAttribute("name"), t = this.getAttribute("end-name");
@@ -4683,10 +5230,287 @@ var Qe = class extends e {
4683
5230
  disconnectedCallback() {
4684
5231
  this._teardown();
4685
5232
  }
4686
- }, q = (e, t) => {
5233
+ }, H = (e, t) => {
4687
5234
  let n = Number.parseFloat(e);
4688
5235
  return Number.isFinite(n) ? n : t;
4689
- }, et = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), tt = class extends e {
5236
+ }, qt = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Jt = /* @__PURE__ */ new Set(), Yt = ".wui-sortable-handle", Xt = "a[href],button,input,select,textarea,label,summary,[contenteditable='true'],[role='button'],[role='link']", Zt = 4, Qt = 8, $t = 250, U = 48, en = 18, tn = class extends e {
5237
+ static get observedAttributes() {
5238
+ return ["name", "disabled"];
5239
+ }
5240
+ constructor() {
5241
+ super(), this._drag = null, this._kb = null, this._moving = !1, this.controlled = !1, this._observer = null, this._onPointerDown = this._onPointerDown.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusOut = this._onFocusOut.bind(this), this._onDragStart = (e) => e.preventDefault(), this._onDocMove = this._onDocMove.bind(this), this._onDocUp = this._onDocUp.bind(this), this._onDocCancel = this._onDocCancel.bind(this), this._onDocKey = this._onDocKey.bind(this), this._onDocTouchMove = (e) => {
5242
+ this._drag?.started && e.preventDefault();
5243
+ }, this._onSelectStart = (e) => e.preventDefault(), this._scrollTick = this._scrollTick.bind(this);
5244
+ }
5245
+ connectedCallback() {
5246
+ Jt.add(this), this.addEventListener("pointerdown", this._onPointerDown), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("focusout", this._onFocusOut), this.addEventListener("dragstart", this._onDragStart), this._observer = new MutationObserver(() => this._syncMirrors()), this._observer.observe(this, { childList: !0 }), this._syncMirrors();
5247
+ }
5248
+ disconnectedCallback() {
5249
+ Jt.delete(this), this.removeEventListener("pointerdown", this._onPointerDown), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("dragstart", this._onDragStart), this._observer?.disconnect(), this._observer = null, this._abort();
5250
+ }
5251
+ attributeChangedCallback(e) {
5252
+ e === "disabled" && this._abort(), this.isConnected && this._syncMirrors();
5253
+ }
5254
+ get order() {
5255
+ return this._items().map((e) => e.getAttribute("data-id"));
5256
+ }
5257
+ set order(e) {
5258
+ if (this._drag?.started || this._kb) return;
5259
+ let t = this._items(), n = new Map(t.map((e) => [e.getAttribute("data-id"), e])), r = [];
5260
+ for (let t of e ?? []) {
5261
+ let e = n.get(String(t));
5262
+ e && !r.includes(e) && r.push(e);
5263
+ }
5264
+ [...r, ...t.filter((e) => !r.includes(e))].forEach((e, t) => {
5265
+ let n = this._items()[t];
5266
+ n !== e && this.insertBefore(e, n);
5267
+ }), this._syncMirrors();
5268
+ }
5269
+ _items() {
5270
+ return [...this.querySelectorAll(":scope > [data-id]")];
5271
+ }
5272
+ _itemFrom(e) {
5273
+ let t = e;
5274
+ for (; t && t.parentElement !== this;) t = t.parentElement;
5275
+ return t?.hasAttribute("data-id") ? t : null;
5276
+ }
5277
+ _itemDisabled(e) {
5278
+ return e.hasAttribute("data-disabled");
5279
+ }
5280
+ _horizontal() {
5281
+ return this.getAttribute("orientation") === "horizontal";
5282
+ }
5283
+ _syncMirrors() {
5284
+ h(this, this.order);
5285
+ }
5286
+ _insertAt(e, t) {
5287
+ let n = this._items();
5288
+ if (n.indexOf(e) === t) return;
5289
+ let r = n.filter((t) => t !== e), i = r[t] ?? null;
5290
+ i ? this.insertBefore(e, i) : r.length > 0 ? r[r.length - 1].after(e) : this.appendChild(e);
5291
+ }
5292
+ _indexFor(e, t, n) {
5293
+ let r = this._items().filter((t) => t !== e), i = this._horizontal();
5294
+ for (let e = 0; e < r.length; e++) {
5295
+ let a = r[e].getBoundingClientRect();
5296
+ if (i ? n < a.top || n <= a.bottom && t < a.left + a.width / 2 : n < a.top + a.height / 2) return e;
5297
+ }
5298
+ return r.length;
5299
+ }
5300
+ _peers() {
5301
+ let e = this.getAttribute("group");
5302
+ return [...Jt].filter((t) => t === this || e && t.getAttribute("group") === e && !t.hasAttribute("disabled"));
5303
+ }
5304
+ _labelOf(e) {
5305
+ return e.getAttribute("data-label") || e.textContent.replace(/\s+/g, " ").trim() || e.getAttribute("data-id");
5306
+ }
5307
+ _announce(e) {
5308
+ let t = this.querySelector(":scope > .wui-sortable-live");
5309
+ t || (t = document.createElement("div"), t.className = "wui-sortable-live", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), this.appendChild(t)), t.textContent = e;
5310
+ }
5311
+ _position(e) {
5312
+ let t = this._items();
5313
+ return `position ${t.indexOf(e) + 1} of ${t.length}`;
5314
+ }
5315
+ _onPointerDown(e) {
5316
+ if (this._drag || this._kb || this.hasAttribute("disabled") || e.pointerType === "mouse" && e.button !== 0) return;
5317
+ let t = this._itemFrom(e.target);
5318
+ if (!t || this._itemDisabled(t)) return;
5319
+ let n = t.querySelector(`:scope > ${Yt}`), r = !!n && n.contains(e.target);
5320
+ if (this.hasAttribute("handle") && !r) return;
5321
+ if (!r) {
5322
+ let n = e.target.closest?.(Xt);
5323
+ if (n && n !== t && t.contains(n)) return;
5324
+ }
5325
+ let i = e.pointerType === "touch" && !r, a = {
5326
+ item: t,
5327
+ pointerId: e.pointerId,
5328
+ startX: e.clientX,
5329
+ startY: e.clientY,
5330
+ x: e.clientX,
5331
+ y: e.clientY,
5332
+ slop: e.pointerType === "touch" ? Qt : Zt,
5333
+ ready: !i,
5334
+ started: !1,
5335
+ timer: null,
5336
+ raf: 0,
5337
+ list: this,
5338
+ ghost: null
5339
+ };
5340
+ this._drag = a, i && (a.timer = setTimeout(() => {
5341
+ a.timer = null, a.ready = !0, this._begin();
5342
+ }, $t)), document.addEventListener("pointermove", this._onDocMove), document.addEventListener("pointerup", this._onDocUp), document.addEventListener("pointercancel", this._onDocCancel), document.addEventListener("keydown", this._onDocKey, !0), document.addEventListener("touchmove", this._onDocTouchMove, { passive: !1 });
5343
+ }
5344
+ _onDocMove(e) {
5345
+ let t = this._drag;
5346
+ if (!(!t || e.pointerId !== t.pointerId)) {
5347
+ if (t.x = e.clientX, t.y = e.clientY, !t.started) {
5348
+ let e = Math.hypot(t.x - t.startX, t.y - t.startY);
5349
+ if (!t.ready) {
5350
+ e > t.slop && this._finish(!0);
5351
+ return;
5352
+ }
5353
+ if (e < t.slop || (this._begin(), !this._drag?.started)) return;
5354
+ }
5355
+ e.preventDefault?.(), this._moveGhost(), this._update();
5356
+ }
5357
+ }
5358
+ _onDocUp(e) {
5359
+ this._drag && e.pointerId === this._drag.pointerId && this._finish(!1);
5360
+ }
5361
+ _onDocCancel(e) {
5362
+ this._drag && e.pointerId === this._drag.pointerId && this._finish(!0);
5363
+ }
5364
+ _onDocKey(e) {
5365
+ e.key !== "Escape" || !this._drag || (e.preventDefault(), e.stopPropagation(), this._finish(!0));
5366
+ }
5367
+ _begin() {
5368
+ let e = this._drag;
5369
+ if (!e || e.started) return;
5370
+ e.started = !0;
5371
+ let t = e.item.getBoundingClientRect();
5372
+ e.offsetX = e.startX - t.left, e.offsetY = e.startY - t.top, e.fromIndex = this._items().indexOf(e.item);
5373
+ let n = e.item.cloneNode(!0);
5374
+ for (let e of [n, ...n.querySelectorAll("[id],[data-id]")]) e.removeAttribute("id"), e.removeAttribute("data-id");
5375
+ n.classList.add("wui-sortable-ghost"), n.setAttribute("aria-hidden", "true"), n.inert = !0, n.style.width = `${t.width}px`, n.style.height = `${t.height}px`, e.ghost = n, e.item.classList.add("wui-sortable-dragging"), document.body.appendChild(n), document.documentElement.classList.add("wui-sortable-active"), document.addEventListener("selectstart", this._onSelectStart), this._moveGhost(), e.raf = requestAnimationFrame(this._scrollTick), this._emit(this, "wui-sortable:start", { id: e.item.getAttribute("data-id") });
5376
+ }
5377
+ _moveGhost() {
5378
+ let e = this._drag;
5379
+ e?.ghost && (e.ghost.style.transform = `translate(${e.x - e.offsetX}px, ${e.y - e.offsetY}px)`);
5380
+ }
5381
+ _update() {
5382
+ let e = this._drag;
5383
+ if (!e?.started) return;
5384
+ let t = e.list;
5385
+ for (let n of this._peers()) {
5386
+ let r = n.getBoundingClientRect();
5387
+ if (e.x >= r.left && e.x <= r.right && e.y >= r.top && e.y <= r.bottom) {
5388
+ t = n;
5389
+ break;
5390
+ }
5391
+ }
5392
+ let n = t._indexFor(e.item, e.x, e.y);
5393
+ (t !== e.list || n !== t._items().indexOf(e.item)) && t._insertAt(e.item, n), e.list = t;
5394
+ }
5395
+ _scrollTick() {
5396
+ let e = this._drag;
5397
+ if (!e?.started) return;
5398
+ let t = rn(e.list), n = t ? t.getBoundingClientRect() : null, r = Math.max(n?.top ?? 0, 0), i = Math.min(n?.bottom ?? window.innerHeight, window.innerHeight), a = Math.max(n?.left ?? 0, 0), o = Math.min(n?.right ?? window.innerWidth, window.innerWidth), s = nn(e.y, r, i), c = nn(e.x, a, o);
5399
+ (c || s) && (t ? (t.scrollTop += s, t.scrollLeft += c) : window.scrollBy(c, s), this._update()), e.raf = requestAnimationFrame(this._scrollTick);
5400
+ }
5401
+ _finish(e) {
5402
+ let t = this._drag;
5403
+ if (!t || (this._drag = null, clearTimeout(t.timer), cancelAnimationFrame(t.raf), document.removeEventListener("pointermove", this._onDocMove), document.removeEventListener("pointerup", this._onDocUp), document.removeEventListener("pointercancel", this._onDocCancel), document.removeEventListener("keydown", this._onDocKey, !0), document.removeEventListener("touchmove", this._onDocTouchMove), document.removeEventListener("selectstart", this._onSelectStart), !t.started)) return;
5404
+ t.ghost?.remove(), document.documentElement.classList.remove("wui-sortable-active"), t.item.classList.remove("wui-sortable-dragging");
5405
+ let n = t.item.getAttribute("data-id");
5406
+ e ? (this._insertAt(t.item, t.fromIndex), this._syncMirrors(), t.list !== this && t.list._syncMirrors()) : this._settle(t.item, this, t.fromIndex, t.list), this._emit(this, "wui-sortable:end", {
5407
+ id: n,
5408
+ cancelled: e
5409
+ });
5410
+ }
5411
+ _settle(e, t, n, r) {
5412
+ let i = r._items().indexOf(e);
5413
+ if (r === t && i === n) return;
5414
+ let a = e.getAttribute("data-id"), o = r.order, s = r !== t, c = t.order;
5415
+ s && (t.controlled || r.controlled) && t._insertAt(e, n), t._syncMirrors(), r._syncMirrors();
5416
+ let l = r._labelOf(e), u = s && r.getAttribute("aria-label") ? ` to ${r.getAttribute("aria-label")}` : "", d = {
5417
+ id: a,
5418
+ fromIndex: n,
5419
+ toIndex: i,
5420
+ from: t,
5421
+ to: r
5422
+ };
5423
+ s && this._emit(t, "wui-sortable:change", {
5424
+ ...d,
5425
+ ids: c
5426
+ }), this._emit(r, "wui-sortable:change", {
5427
+ ...d,
5428
+ ids: o
5429
+ }), r._announce(`${l} moved${u}, position ${i + 1} of ${o.length}.`);
5430
+ }
5431
+ _emit(e, t, n) {
5432
+ e.dispatchEvent(new CustomEvent(t, {
5433
+ bubbles: !0,
5434
+ detail: n
5435
+ }));
5436
+ }
5437
+ _abort() {
5438
+ this._drag && this._finish(!0), this._kb && this._dropKeyboard(!0);
5439
+ }
5440
+ _onKeyDown(e) {
5441
+ if (this.hasAttribute("disabled")) return;
5442
+ let t = e.target.closest?.(Yt), n = t && t.parentElement?.parentElement === this ? t.parentElement : null;
5443
+ if (!n || this._itemDisabled(n) || this._drag) return;
5444
+ let r = e.key;
5445
+ if (!this._kb) {
5446
+ if (r !== " " && r !== "Enter") return;
5447
+ e.preventDefault(), this._liftKeyboard(n, t);
5448
+ return;
5449
+ }
5450
+ if (this._kb.item === n) {
5451
+ if (r === " " || r === "Enter") e.preventDefault(), this._dropKeyboard(!1);
5452
+ else if (r === "Escape") e.preventDefault(), e.stopPropagation(), this._dropKeyboard(!0);
5453
+ else if ([
5454
+ "ArrowUp",
5455
+ "ArrowLeft",
5456
+ "ArrowDown",
5457
+ "ArrowRight",
5458
+ "Home",
5459
+ "End"
5460
+ ].includes(r)) {
5461
+ e.preventDefault();
5462
+ let i = this._items(), a = i.indexOf(n), o = i.length - 1, s = r === "Home" ? 0 : r === "End" ? o : Math.max(0, Math.min(o, a + (r === "ArrowUp" || r === "ArrowLeft" ? -1 : 1)));
5463
+ if (s === a) {
5464
+ this._announce(`${this._labelOf(n)} is already ${a === 0 ? "first" : "last"}, ${this._position(n)}.`);
5465
+ return;
5466
+ }
5467
+ this._moveFocused(() => this._insertAt(n, s), t), this._announce(`${this._labelOf(n)} moved to ${this._position(n)}.`);
5468
+ }
5469
+ }
5470
+ }
5471
+ _onFocusOut(e) {
5472
+ !this._kb || this._moving || e.relatedTarget && this._kb.handle.contains(e.relatedTarget) || this._dropKeyboard(!1);
5473
+ }
5474
+ _liftKeyboard(e, t) {
5475
+ this._kb = {
5476
+ item: e,
5477
+ handle: t,
5478
+ fromIndex: this._items().indexOf(e)
5479
+ }, t.setAttribute("aria-pressed", "true"), this._announce(`${this._labelOf(e)} lifted, ${this._position(e)}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`);
5480
+ }
5481
+ _dropKeyboard(e) {
5482
+ let t = this._kb;
5483
+ if (t) {
5484
+ if (this._kb = null, t.handle.removeAttribute("aria-pressed"), e) {
5485
+ this._moveFocused(() => this._insertAt(t.item, t.fromIndex), t.handle), this._announce(`Reorder cancelled. ${this._labelOf(t.item)} is back at ${this._position(t.item)}.`);
5486
+ return;
5487
+ }
5488
+ if (this._items().indexOf(t.item) === t.fromIndex) {
5489
+ this._announce(`${this._labelOf(t.item)} dropped, ${this._position(t.item)}.`);
5490
+ return;
5491
+ }
5492
+ this._settle(t.item, this, t.fromIndex, this);
5493
+ }
5494
+ }
5495
+ _moveFocused(e, t) {
5496
+ this._moving = !0;
5497
+ let n = this.contains(document.activeElement);
5498
+ e(), n && document.activeElement !== t && t.focus(), this._moving = !1;
5499
+ }
5500
+ };
5501
+ function nn(e, t, n) {
5502
+ return e < t + U ? -Math.ceil(en * Math.min(1, (t + U - e) / U)) : e > n - U ? Math.ceil(en * Math.min(1, (e - (n - U)) / U)) : 0;
5503
+ }
5504
+ function rn(e) {
5505
+ for (let t = e.parentElement; t && t !== document.body && t !== document.documentElement; t = t.parentElement) {
5506
+ let e = getComputedStyle(t), n = /(auto|scroll)/.test(e.overflowY) && t.scrollHeight > t.clientHeight, r = /(auto|scroll)/.test(e.overflowX) && t.scrollWidth > t.clientWidth;
5507
+ if (n || r) return t;
5508
+ }
5509
+ return null;
5510
+ }
5511
+ //#endregion
5512
+ //#region src/WuiTagInput.js
5513
+ var an = class extends e {
4690
5514
  static formAssociated = !0;
4691
5515
  _accessibleName() {
4692
5516
  return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Add tags";
@@ -4752,30 +5576,30 @@ var Qe = class extends e {
4752
5576
  return this._values.slice();
4753
5577
  }
4754
5578
  set values(e) {
4755
- this._values = Array.isArray(e) ? e.map(String) : [], f(this, this._values.join(",")), this._rendered && this._renderControl();
5579
+ this._values = Array.isArray(e) ? e.map(String) : [], h(this, this._values), this._rendered && this._renderControl();
4756
5580
  }
4757
5581
  render() {
4758
5582
  let e = this.getAttribute("size"), t = e === "sm" ? " search-select-sm" : e === "lg" ? " search-select-lg" : "";
4759
- f(this, this._values.join(",")), this.innerHTML = `
5583
+ h(this, this._values), this.innerHTML = `
4760
5584
  <div class="search-select${t}">
4761
5585
  <div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
4762
- <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input aria-label="${J(this._accessibleName())}" placeholder="${J(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/></div>
5586
+ <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input aria-label="${sn(this._accessibleName())}" placeholder="${sn(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/></div>
4763
5587
  </div>
4764
- </div>`, this._rendered = !0, f(this, this._values.join(",")), this._renderControl(), this._wire();
5588
+ </div>`, this._rendered = !0, h(this, this._values), this._renderControl(), this._wire();
4765
5589
  }
4766
5590
  _renderControl() {
4767
5591
  let e = this.querySelector("[data-chips]");
4768
5592
  if (e) {
4769
5593
  for (let t of e.querySelectorAll(":scope > .chip")) t.remove();
4770
- this._values.length && e.querySelector("[data-input]").insertAdjacentHTML("beforebegin", this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${nt(e)}</span><button type="button" class="chip-remove" data-remove="${J(e)}" aria-label="Remove ${J(e)}">${m("x")}</button></span>`).join(""));
5594
+ this._values.length && e.querySelector("[data-input]").insertAdjacentHTML("beforebegin", this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${on(e)}</span><button type="button" class="chip-remove" data-remove="${sn(e)}" aria-label="Remove ${sn(e)}">${_("x")}</button></span>`).join(""));
4771
5595
  }
4772
5596
  }
4773
5597
  _wire() {
4774
5598
  this._teardown();
4775
5599
  let e = this.querySelector(".search-select-control"), t = this.querySelector("[data-input]");
4776
5600
  if (!e || !t) return;
4777
- let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(be).filter(Boolean)), s = () => {
4778
- f(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
5601
+ let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(dt).filter(Boolean)), s = () => {
5602
+ h(this, this._values), this.dispatchEvent(new Event("change", { bubbles: !0 }));
4779
5603
  }, c = (e) => {
4780
5604
  let t = e.trim();
4781
5605
  if (!t || i && this._values.length >= parseInt(i, 10)) return;
@@ -4806,9 +5630,9 @@ var Qe = class extends e {
4806
5630
  e.preventDefault();
4807
5631
  let n = e.clipboardData.getData("text/plain"), a = [];
4808
5632
  for (let e of r) {
4809
- let t = xe(e) ?? e;
4810
- if (Ce(n, [t])) {
4811
- a.push(...Se(n, [t]));
5633
+ let t = ft(e) ?? e;
5634
+ if (mt(n, [t])) {
5635
+ a.push(...pt(n, [t]));
4812
5636
  break;
4813
5637
  }
4814
5638
  }
@@ -4836,18 +5660,18 @@ var Qe = class extends e {
4836
5660
  disconnectedCallback() {
4837
5661
  this._teardown();
4838
5662
  }
4839
- }, nt = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), J = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), rt = (e) => String(e).padStart(2, "0"), it = (e, t) => `${rt(e)}:${rt(t)}`, Y = (e) => {
5663
+ }, on = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), sn = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), cn = (e) => String(e).padStart(2, "0"), ln = (e, t) => `${cn(e)}:${cn(t)}`, un = (e) => {
4840
5664
  let t = /^(\d{2}):(\d{2})$/.exec(e || "");
4841
5665
  return t ? {
4842
5666
  h: +t[1],
4843
5667
  m: +t[2]
4844
5668
  } : null;
4845
- }, at = (e, t = "24") => {
5669
+ }, dn = (e, t = "24") => {
4846
5670
  if (!e) return "";
4847
- if (t === "24") return it(e.h, e.m);
5671
+ if (t === "24") return ln(e.h, e.m);
4848
5672
  let n = e.h % 12 || 12, r = e.h >= 12 ? "PM" : "AM";
4849
- return `${n}:${rt(e.m)} ${r}`;
4850
- }, ot = class extends e {
5673
+ return `${n}:${cn(e.m)} ${r}`;
5674
+ }, fn = class extends e {
4851
5675
  static formAssociated = !0;
4852
5676
  static get observedAttributes() {
4853
5677
  return [
@@ -4899,34 +5723,34 @@ var Qe = class extends e {
4899
5723
  return this._value;
4900
5724
  }
4901
5725
  set value(e) {
4902
- this._value = e || "", f(this, this._value), this._syncTrigger();
5726
+ this._value = e || "", m(this, this._value), this._syncTrigger();
4903
5727
  }
4904
5728
  render() {
4905
5729
  this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
4906
- let e = this.getAttribute("placeholder") || "Select time", t = Y(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
5730
+ let e = this.getAttribute("placeholder") || "Select time", t = un(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
4907
5731
  this.innerHTML = `
4908
5732
  <div class="timepicker">
4909
- <button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${_(a)}"` : ""}${o ? ` aria-describedby="${_(o)}"` : ""}>
4910
- <span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? at(t, n) : _(e)}</span>
4911
- ${m("clock")}
5733
+ <button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${b(a)}"` : ""}${o ? ` aria-describedby="${b(o)}"` : ""}>
5734
+ <span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? dn(t, n) : b(e)}</span>
5735
+ ${_("clock")}
4912
5736
  </button>
4913
5737
  <div class="timepicker-pop" role="listbox" tabindex="-1" hidden></div>
4914
- </div>`, this._rendered = !0, f(this, this._value), this._wire();
5738
+ </div>`, this._rendered = !0, m(this, this._value), this._wire();
4915
5739
  }
4916
5740
  _syncFormValue() {
4917
- f(this, this._value);
5741
+ m(this, this._value);
4918
5742
  }
4919
5743
  _syncTrigger() {
4920
5744
  let e = this.querySelector(".timepicker-trigger"), t = this.querySelector("[data-trigger-label]");
4921
5745
  if (!t) return;
4922
- let n = Y(this._value), r = this.getAttribute("format") || "24";
4923
- t.textContent = n ? at(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
5746
+ let n = un(this._value), r = this.getAttribute("format") || "24";
5747
+ t.textContent = n ? dn(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
4924
5748
  }
4925
5749
  _buildTimes() {
4926
- let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = Y(t) || {
5750
+ let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = un(t) || {
4927
5751
  h: 0,
4928
5752
  m: 0
4929
- }, i = Y(n) || {
5753
+ }, i = un(n) || {
4930
5754
  h: 23,
4931
5755
  m: 59
4932
5756
  }, a = [], o = r.h, s = r.m;
@@ -4939,10 +5763,10 @@ var Qe = class extends e {
4939
5763
  _renderOptions() {
4940
5764
  let e = this.querySelector(".timepicker-pop");
4941
5765
  if (!e) return;
4942
- let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = Y(this._value), i = this._focus, a = "";
5766
+ let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = un(this._value), i = this._focus, a = "";
4943
5767
  for (let e = 0; e < n.length; e++) {
4944
- let o = n[e], s = it(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
4945
- a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${at(o, t)}</button>`;
5768
+ let o = n[e], s = ln(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
5769
+ a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${dn(o, t)}</button>`;
4946
5770
  }
4947
5771
  e.innerHTML = a, this._focusActive();
4948
5772
  }
@@ -5040,7 +5864,498 @@ var Qe = class extends e {
5040
5864
  disconnectedCallback() {
5041
5865
  this._teardown();
5042
5866
  }
5043
- }, st = "wui-wizard-step", ct = class extends e {
5867
+ }, pn = "wui-csrf", mn = "RequestVerificationToken", W = Object.freeze({
5868
+ fragment: "X-Wui-Fragment",
5869
+ message: "X-Wui-Message",
5870
+ redirect: "X-Wui-Redirect",
5871
+ result: "X-Wui-Result",
5872
+ keepOpen: "X-Wui-Keep-Open"
5873
+ }), hn = Object.freeze([
5874
+ "ok",
5875
+ "validation",
5876
+ "forbidden",
5877
+ "client",
5878
+ "server",
5879
+ "network",
5880
+ "aborted",
5881
+ "stale",
5882
+ "session"
5883
+ ]), gn = /* @__PURE__ */ new Set(["GET", "HEAD"]);
5884
+ function _n(e = document) {
5885
+ let t = e.querySelector(`meta[name="${pn}"]`), n = t?.getAttribute("content");
5886
+ return n ? {
5887
+ header: t.getAttribute("data-header") || "RequestVerificationToken",
5888
+ token: n
5889
+ } : null;
5890
+ }
5891
+ var vn = (e) => {
5892
+ try {
5893
+ return new URL(e, window.location.href).origin === window.location.origin;
5894
+ } catch {
5895
+ return !1;
5896
+ }
5897
+ };
5898
+ function yn(e) {
5899
+ return e >= 200 && e < 300 ? "ok" : e === 401 ? "session" : e === 403 ? "forbidden" : e === 422 ? "validation" : e >= 400 && e < 500 ? "client" : "server";
5900
+ }
5901
+ var bn = (e) => e?.name === "AbortError";
5902
+ async function xn(e, t = {}) {
5903
+ let n = (t.method || "GET").toUpperCase(), r = t.navigate || ((e) => window.location.assign(e)), i = {
5904
+ Accept: "text/html",
5905
+ "X-Requested-With": "XMLHttpRequest",
5906
+ ...t.headers
5907
+ };
5908
+ if (!gn.has(n) && vn(e)) {
5909
+ let e = _n();
5910
+ e && (i[e.header] = e.token);
5911
+ }
5912
+ let a = (e, t = null, n = "") => {
5913
+ let r = (e) => t?.headers.get(e) ?? null;
5914
+ return {
5915
+ kind: e,
5916
+ ok: e === "ok",
5917
+ status: t?.status ?? 0,
5918
+ html: n,
5919
+ response: t,
5920
+ message: r(W.message),
5921
+ redirect: r(W.redirect),
5922
+ result: r(W.result),
5923
+ keepOpen: r(W.keepOpen) === "1",
5924
+ fragment: r(W.fragment) === "1"
5925
+ };
5926
+ }, o;
5927
+ try {
5928
+ o = await fetch(e, {
5929
+ method: n,
5930
+ body: t.body,
5931
+ headers: i,
5932
+ signal: t.signal,
5933
+ credentials: "same-origin"
5934
+ });
5935
+ } catch (e) {
5936
+ return a(bn(e) || t.signal?.aborted ? "aborted" : "network");
5937
+ }
5938
+ let s = yn(o.status);
5939
+ if (s === "ok" && o.redirected && o.headers.get(W.fragment) !== "1" && (s = "session"), s === "session") return r(o.status === 401 ? o.headers.get("Location") || window.location.href : o.url), a(s, o);
5940
+ let c = "";
5941
+ if (s === "ok" || s === "validation") try {
5942
+ c = await o.text();
5943
+ } catch (e) {
5944
+ return a(bn(e) || t.signal?.aborted ? "aborted" : "network", o);
5945
+ }
5946
+ return a(s, o, c);
5947
+ }
5948
+ function Sn() {
5949
+ let e = null, t = 0;
5950
+ return {
5951
+ async run(n, r = {}) {
5952
+ e?.abort();
5953
+ let i = new AbortController();
5954
+ e = i;
5955
+ let a = ++t, o = r.signal;
5956
+ o && (o.aborted ? i.abort() : o.addEventListener("abort", () => i.abort(), { once: !0 }));
5957
+ let s = await xn(n, {
5958
+ ...r,
5959
+ signal: i.signal
5960
+ });
5961
+ return e === i && (e = null), a !== t && s.kind !== "aborted" ? {
5962
+ ...s,
5963
+ kind: "stale",
5964
+ ok: !1
5965
+ } : s;
5966
+ },
5967
+ abort() {
5968
+ e?.abort(), e = null;
5969
+ }
5970
+ };
5971
+ }
5972
+ //#endregion
5973
+ //#region src/WuiTree.js
5974
+ var Cn = [
5975
+ "none",
5976
+ "single",
5977
+ "multiple"
5978
+ ], wn = "parentId", Tn = "Loading", En = "Could not load. Try again.", Dn = ":scope > input[data-wui-mirror]", On = [
5979
+ "nodes",
5980
+ "selection",
5981
+ "selected",
5982
+ "values",
5983
+ "loadChildren",
5984
+ "loadUrl",
5985
+ "name"
5986
+ ], kn = 0;
5987
+ function G(e, t, n) {
5988
+ let r = document.createElement(e);
5989
+ t && (r.className = t);
5990
+ for (let [e, t] of Object.entries(n ?? {})) t != null && r.setAttribute(e, String(t));
5991
+ return r;
5992
+ }
5993
+ var An = class extends e {
5994
+ static get observedAttributes() {
5995
+ return [
5996
+ "selection",
5997
+ "selected",
5998
+ "name",
5999
+ "aria-label",
6000
+ "loading-text",
6001
+ "error-text"
6002
+ ];
6003
+ }
6004
+ constructor() {
6005
+ super(), this._uid = `wui-tree-${++kn}`, this._seq = 0, this._roots = [], this._byId = /* @__PURE__ */ new Map(), this._prev = null, this._staged = null, this._els = /* @__PURE__ */ new Map(), this._checked = /* @__PURE__ */ new Set(), this._selected = null, this._focusId = null, this._loader = null, this._list = null, this._live = null, this._ready = !1, this._nav = v({
6006
+ getVisibleOptions: () => this._visible().map((e) => this._els.get(e.id)?.row),
6007
+ getActive: () => this._visible().findIndex((e) => e.id === this._focusId),
6008
+ setActive: (e) => this._focusNode(this._visible()[e]),
6009
+ onEnter: () => {
6010
+ let e = this._byId.get(this._focusId);
6011
+ e && this._activate(e);
6012
+ }
6013
+ }), this._onKeyDown = (e) => this._handleKeyDown(e), this._onClick = (e) => this._handleClick(e), this._onFocusIn = (e) => {
6014
+ let t = this._nodeFrom(e.target);
6015
+ t && t.id !== this._focusId && this._setRoving(t);
6016
+ };
6017
+ }
6018
+ connectedCallback() {
6019
+ let e = {};
6020
+ for (let t of On) Object.hasOwn(this, t) && (e[t] = this[t], delete this[t]);
6021
+ if (!this._ready) {
6022
+ this._ready = !0;
6023
+ let e = this._readScript();
6024
+ this.replaceChildren(), this._list = G("ul", "wui-tree"), this._list.setAttribute("role", "tree"), this._live = G("div", "visually-hidden", {
6025
+ role: "status",
6026
+ "aria-live": "polite"
6027
+ }), this.append(this._list, this._live), e && this._adoptAll(e);
6028
+ }
6029
+ for (let [t, n] of Object.entries(e)) this[t] = n;
6030
+ this.addEventListener("keydown", this._onKeyDown), this.addEventListener("click", this._onClick), this.addEventListener("focusin", this._onFocusIn), this._render(), this._loadOpenNodes();
6031
+ }
6032
+ disconnectedCallback() {
6033
+ this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("click", this._onClick), this.removeEventListener("focusin", this._onFocusIn), this._nav.teardown();
6034
+ }
6035
+ attributeChangedCallback(e, t, n) {
6036
+ e === "selected" && (this._selected = n), this._ready && this.isConnected && this._render();
6037
+ }
6038
+ get nodes() {
6039
+ return this._roots.map((e) => e.raw);
6040
+ }
6041
+ set nodes(e) {
6042
+ this._adoptAll(e ?? []), this._render(), this._loadOpenNodes();
6043
+ }
6044
+ get selection() {
6045
+ let e = this.getAttribute("selection");
6046
+ return Cn.includes(e) ? e : "none";
6047
+ }
6048
+ set selection(e) {
6049
+ this.setAttribute("selection", String(e));
6050
+ }
6051
+ get selected() {
6052
+ return this._selected;
6053
+ }
6054
+ set selected(e) {
6055
+ this._selected = e == null ? null : String(e), this._render();
6056
+ }
6057
+ get values() {
6058
+ let e = [], t = (n) => {
6059
+ for (let r of n) this._state(r) === "checked" && e.push(r.id), r.children && t(r.children);
6060
+ };
6061
+ return t(this._roots), [...e, ...[...this._checked].filter((e) => !this._byId.has(e))];
6062
+ }
6063
+ set values(e) {
6064
+ this._checked.clear();
6065
+ for (let t of e ?? []) {
6066
+ let e = this._byId.get(String(t));
6067
+ e ? this._setChecked(e, !0) : this._checked.add(String(t));
6068
+ }
6069
+ this._render();
6070
+ }
6071
+ get loadChildren() {
6072
+ return this._loader;
6073
+ }
6074
+ set loadChildren(e) {
6075
+ this._loader = typeof e == "function" ? e : null;
6076
+ }
6077
+ get loadUrl() {
6078
+ return this.getAttribute("load-url");
6079
+ }
6080
+ set loadUrl(e) {
6081
+ e == null ? this.removeAttribute("load-url") : this.setAttribute("load-url", String(e));
6082
+ }
6083
+ get name() {
6084
+ return this.getAttribute("name");
6085
+ }
6086
+ set name(e) {
6087
+ e == null ? this.removeAttribute("name") : this.setAttribute("name", String(e));
6088
+ }
6089
+ get loadingText() {
6090
+ return this.getAttribute("loading-text") ?? Tn;
6091
+ }
6092
+ set loadingText(e) {
6093
+ this.setAttribute("loading-text", String(e ?? ""));
6094
+ }
6095
+ get errorText() {
6096
+ return this.getAttribute("error-text") ?? En;
6097
+ }
6098
+ set errorText(e) {
6099
+ this.setAttribute("error-text", String(e ?? ""));
6100
+ }
6101
+ _readScript() {
6102
+ let e = this.querySelector(":scope > script[type='application/json']");
6103
+ if (!e) return null;
6104
+ try {
6105
+ return JSON.parse(e.textContent);
6106
+ } catch (e) {
6107
+ return console.error("[@webority/ui-elements] <wui-tree> could not read its JSON nodes:", e?.message), null;
6108
+ }
6109
+ }
6110
+ _adoptAll(e) {
6111
+ let t = this._byId;
6112
+ this._prev = t, this._byId = /* @__PURE__ */ new Map();
6113
+ let n;
6114
+ try {
6115
+ n = this._adoptStaged(e, null, 1);
6116
+ } catch (e) {
6117
+ throw this._byId = t, e;
6118
+ } finally {
6119
+ this._prev = null;
6120
+ }
6121
+ this._roots = n;
6122
+ for (let e of t.keys()) this._byId.has(e) || this._checked.delete(e);
6123
+ for (let e of this._roots) this._passChecksDown(e);
6124
+ this._focusId && !this._byId.has(this._focusId) && (this._focusId = null);
6125
+ }
6126
+ _adoptStaged(e, t, n) {
6127
+ let r = [], i = [];
6128
+ this._staged = {
6129
+ ids: r,
6130
+ checks: i
6131
+ };
6132
+ try {
6133
+ let r = this._adopt(e, t, n);
6134
+ for (let e of i) this._checked.add(e);
6135
+ return r;
6136
+ } catch (e) {
6137
+ for (let e of r) this._byId.delete(e);
6138
+ throw e;
6139
+ } finally {
6140
+ this._staged = null;
6141
+ }
6142
+ }
6143
+ _adopt(e, t, n) {
6144
+ if (!Array.isArray(e)) throw Error("<wui-tree> nodes must be an array.");
6145
+ return e.map((e) => {
6146
+ let r = e?.id == null ? "" : String(e.id);
6147
+ if (!r) throw Error("<wui-tree> every node needs an id.");
6148
+ if (this._byId.has(r)) throw Error(`<wui-tree> node id "${r}" is used twice.`);
6149
+ let i = this._prev?.get(r), a = {
6150
+ id: r,
6151
+ raw: e,
6152
+ parent: t,
6153
+ level: n,
6154
+ seq: ++this._seq,
6155
+ label: e.label == null ? r : String(e.label),
6156
+ icon: e.icon || null,
6157
+ badge: e.badge == null || e.badge === "" ? null : String(e.badge),
6158
+ badgeTone: e.badgeTone || null,
6159
+ disabled: !!e.disabled,
6160
+ hasChildren: !!e.hasChildren,
6161
+ children: null,
6162
+ expanded: i ? i.expanded : !!e.expanded,
6163
+ loading: !1,
6164
+ failed: !1
6165
+ };
6166
+ this._byId.set(r, a), this._staged.ids.push(r);
6167
+ let o = e.children ?? (e.hasChildren ? i?.children?.map((e) => e.raw) : void 0);
6168
+ return Array.isArray(o) && (a.children = this._adopt(o, a, n + 1)), a.loading = !!i?.loading && a.children === null && a.hasChildren, e.checked && !i && this._staged.checks.push(r), a;
6169
+ });
6170
+ }
6171
+ _passChecksDown(e) {
6172
+ e.children?.length && this._checked.has(e.id) && (this._checked.delete(e.id), this._setChecked(e, !0));
6173
+ for (let t of e.children ?? []) this._passChecksDown(t);
6174
+ }
6175
+ _loadOpenNodes() {
6176
+ queueMicrotask(() => {
6177
+ if (this.isConnected) for (let e of [...this._byId.values()]) e.expanded && e.children === null && e.hasChildren && !e.loading && this._load(e);
6178
+ });
6179
+ }
6180
+ _isBranch(e) {
6181
+ return e.children ? e.children.length > 0 : e.hasChildren;
6182
+ }
6183
+ _visible() {
6184
+ let e = [], t = (n) => {
6185
+ for (let r of n) e.push(r), r.expanded && r.children && t(r.children);
6186
+ };
6187
+ return t(this._roots), e;
6188
+ }
6189
+ _state(e) {
6190
+ if (e.children?.length) {
6191
+ let t = 0, n = 0;
6192
+ for (let r of e.children) {
6193
+ let e = this._state(r);
6194
+ e === "checked" ? t++ : e === "unchecked" && n++;
6195
+ }
6196
+ return t === e.children.length ? "checked" : n === e.children.length ? "unchecked" : "mixed";
6197
+ }
6198
+ return this._checked.has(e.id) ? "checked" : "unchecked";
6199
+ }
6200
+ _setChecked(e, t) {
6201
+ if (e.children?.length) for (let n of e.children) n.disabled || this._setChecked(n, t);
6202
+ else t ? this._checked.add(e.id) : this._checked.delete(e.id);
6203
+ }
6204
+ _nodeFrom(e) {
6205
+ let t = e?.closest?.("li.wui-tree-item");
6206
+ if (!t) return null;
6207
+ for (let [e, n] of this._els) if (n.li === t) return this._byId.get(e) ?? null;
6208
+ return null;
6209
+ }
6210
+ _emit(e, t) {
6211
+ this.dispatchEvent(new CustomEvent(`wui-tree:${e}`, {
6212
+ detail: t,
6213
+ bubbles: !0,
6214
+ composed: !0
6215
+ }));
6216
+ }
6217
+ _announce(e) {
6218
+ this._live && (this._live.textContent = e);
6219
+ }
6220
+ _setRoving(e) {
6221
+ let t = this._els.get(this._focusId);
6222
+ t && (t.li.tabIndex = -1), this._focusId = e.id;
6223
+ let n = this._els.get(e.id);
6224
+ n && (n.li.tabIndex = 0);
6225
+ }
6226
+ _focusNode(e) {
6227
+ e && (this._setRoving(e), this._els.get(e.id)?.li.focus());
6228
+ }
6229
+ _activate(e) {
6230
+ e.disabled || (this.selection === "single" && (this._selected = e.id, this._render(), this._syncForm()), this._emit("select", {
6231
+ id: e.id,
6232
+ node: e.raw
6233
+ }));
6234
+ }
6235
+ _enabledLeaves(e) {
6236
+ return e.disabled ? [] : e.children?.length ? e.children.flatMap((e) => this._enabledLeaves(e)) : [e];
6237
+ }
6238
+ _toggleCheck(e) {
6239
+ let t = this._enabledLeaves(e);
6240
+ if (!t.length) return;
6241
+ let n = !t.every((e) => this._checked.has(e.id));
6242
+ this._setChecked(e, n), this._render(), this._syncForm(), this._emit("check", {
6243
+ id: e.id,
6244
+ checked: n,
6245
+ values: this.values
6246
+ });
6247
+ }
6248
+ _toggleExpand(e) {
6249
+ e.disabled || !this._isBranch(e) || (e.expanded ? (e.expanded = !1, this._render()) : this._expand(e));
6250
+ }
6251
+ _expand(e) {
6252
+ e.expanded = !0, e.children === null ? this._load(e) : this._render();
6253
+ }
6254
+ async _load(e) {
6255
+ if (e.loading) return;
6256
+ e.loading = !0, e.failed = !1, this._announce(this.loadingText), this._render();
6257
+ let t, n = null;
6258
+ try {
6259
+ t = await this._fetchChildren(e);
6260
+ } catch (e) {
6261
+ n = e;
6262
+ }
6263
+ let r = this._byId.get(e.id);
6264
+ if (!r) {
6265
+ this._announce("");
6266
+ return;
6267
+ }
6268
+ if (r.loading) {
6269
+ if (r.loading = !1, !n) try {
6270
+ r.children = this._adoptStaged(t, r, r.level + 1), this._passChecksDown(r), this._announce("");
6271
+ } catch (e) {
6272
+ n = e;
6273
+ }
6274
+ n && (r.failed = !0, r.expanded = !1, this._announce(this.errorText), this._emit("error", {
6275
+ id: r.id,
6276
+ message: n?.message ?? String(n)
6277
+ })), this._render(), this._syncForm();
6278
+ }
6279
+ }
6280
+ async _fetchChildren(e) {
6281
+ if (this._loader) return this._loader(e.raw);
6282
+ let t = this.getAttribute("load-url");
6283
+ if (!t) throw Error("<wui-tree> has a node with children to load but no loadChildren or load-url.");
6284
+ let n = new URL(t, window.location.href);
6285
+ n.searchParams.set(wn, e.id);
6286
+ let r = await xn(n.href, { headers: { Accept: "application/json" } });
6287
+ if (!r.ok) throw Error(`Loading children answered ${r.kind}.`);
6288
+ return JSON.parse(r.html);
6289
+ }
6290
+ _handleClick(e) {
6291
+ let t = this._nodeFrom(e.target);
6292
+ !t || t.disabled || (this._focusNode(t), e.target.closest(".wui-tree-toggle") ? this._toggleExpand(t) : e.target.closest(".wui-tree-check") ? (e.preventDefault(), this._toggleCheck(t)) : this._activate(t));
6293
+ }
6294
+ _handleKeyDown(e) {
6295
+ if (e.ctrlKey || e.metaKey || e.altKey) return;
6296
+ let t = this._nodeFrom(e.target);
6297
+ if (!(!t || e.target !== this._els.get(t.id)?.li)) if (e.key === "ArrowRight") {
6298
+ if (e.preventDefault(), !this._isBranch(t) || t.disabled) return;
6299
+ t.expanded ? t.children?.length && this._focusNode(t.children[0]) : this._expand(t);
6300
+ } else e.key === "ArrowLeft" ? (e.preventDefault(), t.expanded && this._isBranch(t) && !t.disabled ? this._toggleExpand(t) : t.parent && this._focusNode(t.parent)) : e.key === " " ? (e.preventDefault(), this.selection === "multiple" ? this._toggleCheck(t) : this.selection === "single" && this._activate(t)) : this._nav.handler(e);
6301
+ }
6302
+ _syncForm() {
6303
+ let e = this.selection;
6304
+ if (e === "multiple") h(this, this.values);
6305
+ else if (e === "single") m(this, this._selected ?? "");
6306
+ else for (let e of this.querySelectorAll(Dn)) e.remove();
6307
+ }
6308
+ _render() {
6309
+ if (!this._list) return;
6310
+ let e = document.activeElement, t = !!e && this._list.contains(e), n = this._visible();
6311
+ n.some((e) => e.id === this._focusId) || (this._focusId = (n.find((e) => e.id === this._selected) ?? n[0])?.id ?? null), this._els = /* @__PURE__ */ new Map();
6312
+ let r = this.getAttribute("aria-label");
6313
+ r ? this._list.setAttribute("aria-label", r) : this._list.removeAttribute("aria-label"), this._list.replaceChildren(...this._buildLevel(this._roots)), t && this._focusId && this._els.get(this._focusId)?.li.focus(), this._syncForm();
6314
+ }
6315
+ _buildLevel(e) {
6316
+ return e.map((t, n) => this._buildItem(t, n + 1, e.length));
6317
+ }
6318
+ _buildItem(e, t, n) {
6319
+ let r = this.selection, i = this._isBranch(e), a = this._state(e), o = G("li", "wui-tree-item", {
6320
+ role: "treeitem",
6321
+ tabindex: e.id === this._focusId ? 0 : -1,
6322
+ "aria-level": e.level,
6323
+ "aria-setsize": n,
6324
+ "aria-posinset": t,
6325
+ "aria-labelledby": `${this._uid}-${e.seq}`,
6326
+ "aria-describedby": e.badge ? `${this._uid}-${e.seq}-badge` : null
6327
+ });
6328
+ i && o.setAttribute("aria-expanded", String(e.expanded)), e.disabled && o.setAttribute("aria-disabled", "true"), e.loading && o.setAttribute("aria-busy", "true"), r === "single" && o.setAttribute("aria-selected", String(e.id === this._selected)), r === "multiple" && o.setAttribute("aria-checked", a === "mixed" ? "mixed" : String(a === "checked"));
6329
+ let s = G("div", "wui-tree-row", { role: "presentation" });
6330
+ s.style.setProperty("--wui-tree-level", String(e.level - 1)), r === "single" && e.id === this._selected && s.classList.add("wui-tree-row-selected"), e.failed && s.classList.add("wui-tree-row-error");
6331
+ let c = G("span", i ? "wui-tree-toggle" : "wui-tree-toggle wui-tree-toggle-leaf", { "aria-hidden": "true" });
6332
+ if (i && (c.innerHTML = _("chevron-right", { size: 16 })), s.append(c), r === "multiple") {
6333
+ let t = G("input", "form-check-input wui-tree-check", {
6334
+ type: "checkbox",
6335
+ tabindex: -1,
6336
+ "aria-hidden": "true"
6337
+ });
6338
+ t.checked = a === "checked", t.indeterminate = a === "mixed", t.disabled = e.disabled, t.addEventListener("mousedown", (e) => e.preventDefault()), s.append(t);
6339
+ }
6340
+ if (e.icon) {
6341
+ let t = G("span", "wui-tree-icon", { "aria-hidden": "true" });
6342
+ t.innerHTML = _(e.icon, { size: 16 }), s.append(t);
6343
+ }
6344
+ let l = G("span", "wui-tree-label", { id: `${this._uid}-${e.seq}` });
6345
+ if (l.textContent = e.label, s.append(l), e.badge) {
6346
+ let t = G("span", `badge wui-tree-badge${e.badgeTone && e.badgeTone !== "neutral" ? ` badge-${e.badgeTone}` : ""}`, { id: `${this._uid}-${e.seq}-badge` });
6347
+ t.textContent = e.badge, s.append(t);
6348
+ }
6349
+ if (e.loading && s.append(G("span", "wui-tree-spinner", { "aria-hidden": "true" })), o.append(s), e.expanded && e.children?.length) {
6350
+ let t = G("ul", "wui-tree-group", { role: "group" });
6351
+ t.append(...this._buildLevel(e.children)), o.append(t);
6352
+ }
6353
+ return this._els.set(e.id, {
6354
+ li: o,
6355
+ row: s
6356
+ }), o;
6357
+ }
6358
+ }, jn = "wui-wizard-step", Mn = class extends e {
5044
6359
  static get observedAttributes() {
5045
6360
  return [
5046
6361
  "active",
@@ -5074,7 +6389,7 @@ var Qe = class extends e {
5074
6389
  this._beforeNext = typeof e == "function" ? e : null;
5075
6390
  }
5076
6391
  get _steps() {
5077
- return [...this.querySelectorAll(`:scope > ${st}`)];
6392
+ return [...this.querySelectorAll(`:scope > ${jn}`)];
5078
6393
  }
5079
6394
  refresh() {
5080
6395
  this._rendered && this._renderChrome();
@@ -5113,7 +6428,7 @@ var Qe = class extends e {
5113
6428
  }
5114
6429
  _reconcileSteps() {
5115
6430
  let e = this._steps, t = this._known;
5116
- if (this._known = e, lt(e, t)) return e;
6431
+ if (this._known = e, Nn(e, t)) return e;
5117
6432
  let n = (n) => new Set([...n].map((n) => e.indexOf(t[n])).filter((e) => e >= 0));
5118
6433
  this._skipped = n(this._skipped), this._invalid = n(this._invalid);
5119
6434
  let r = t[this._active];
@@ -5133,7 +6448,7 @@ var Qe = class extends e {
5133
6448
  _onStepsMutated() {
5134
6449
  if (!this._rendered) return;
5135
6450
  let e = this._steps;
5136
- (!e.length || this._header.nextElementSibling === e[0] && this._footer.previousElementSibling === e[e.length - 1]) && lt(e, this._known) || (this._renderChrome(), this._observer?.takeRecords());
6451
+ (!e.length || this._header.nextElementSibling === e[0] && this._footer.previousElementSibling === e[e.length - 1]) && Nn(e, this._known) || (this._renderChrome(), this._observer?.takeRecords());
5137
6452
  }
5138
6453
  _syncPanels(e) {
5139
6454
  e.forEach((e, t) => {
@@ -5156,14 +6471,14 @@ var Qe = class extends e {
5156
6471
  let i = this.hasAttribute("non-linear");
5157
6472
  return e.map((e, r) => {
5158
6473
  let a = this._stepStatus(e, r), o = e.getAttribute("label") || "", s = e.getAttribute("description") || "", c = e.getAttribute("icon") || "", l = r + 1, u;
5159
- u = a === "done" ? m("check") : a === "error" ? m("alert-triangle") : a === "skipped" ? m("minus") : c ? m(c) : String(l);
5160
- let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", p = i || r < this._active, h = s ? `<span class="step-desc">${X(s)}</span>` : "", g;
5161
- return g = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${X(o)}</span>${h}</span>` : n ? `<span class="step-circle">${u}</span><span class="step-index">Step ${l}</span><span class="step-label">${X(o)}</span>${h}` : `<span class="step-circle">${u}</span><span class="step-label">${X(o)}</span>${h}`, p ? `<button type="button" class="${d}" data-step="${r}"${f}>${g}</button>` : `<div class="${d}"${f}>${g}</div>`;
6474
+ u = a === "done" ? _("check") : a === "error" ? _("alert-triangle") : a === "skipped" ? _("minus") : c ? _(c) : String(l);
6475
+ let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", p = i || r < this._active, m = s ? `<span class="step-desc">${K(s)}</span>` : "", h;
6476
+ return h = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${K(o)}</span>${m}</span>` : n ? `<span class="step-circle">${u}</span><span class="step-index">Step ${l}</span><span class="step-label">${K(o)}</span>${m}` : `<span class="step-circle">${u}</span><span class="step-label">${K(o)}</span>${m}`, p ? `<button type="button" class="${d}" data-step="${r}"${f}>${h}</button>` : `<div class="${d}"${f}>${h}</div>`;
5162
6477
  }).join("");
5163
6478
  }
5164
6479
  _footerHtml(e) {
5165
6480
  let t = this._active, n = e.length - 1, r = this.hasAttribute("disabled") ? " disabled" : "", i = e[t]?.hasAttribute("optional") || this.hasAttribute("skippable"), a = this.getAttribute("back-label") || "Back", o = this.getAttribute("next-label") || "Next", s = this.getAttribute("skip-label") || "Skip", c = this.getAttribute("finish-label") || "Finish";
5166
- return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${m("arrow-left", { className: "me-2" })}${X(a)}</button>` : "<span></span>"}<span class="wizard-footer-actions">${i && t < n ? `<button type="button" class="btn btn-subtle" data-nav="skip"${r}>${X(s)}</button>` : ""}${t < n ? `<button type="button" class="btn btn-primary" data-nav="next"${r}>${X(o)}${m("arrow-right", { className: "ms-2" })}</button>` : `<button type="button" class="btn btn-primary" data-nav="finish"${r}>${X(c)}</button>`}</span>`;
6481
+ return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${_("arrow-left", { className: "me-2" })}${K(a)}</button>` : "<span></span>"}<span class="wizard-footer-actions">${i && t < n ? `<button type="button" class="btn btn-subtle" data-nav="skip"${r}>${K(s)}</button>` : ""}${t < n ? `<button type="button" class="btn btn-primary" data-nav="next"${r}>${K(o)}${_("arrow-right", { className: "ms-2" })}</button>` : `<button type="button" class="btn btn-primary" data-nav="finish"${r}>${K(c)}</button>`}</span>`;
5167
6482
  }
5168
6483
  _wire() {
5169
6484
  this._teardown(), this._onHeaderClick = (e) => {
@@ -5237,7 +6552,7 @@ var Qe = class extends e {
5237
6552
  _reflectActive(e) {
5238
6553
  this._reflecting = !0, this.setAttribute("active", String(e)), this._reflecting = !1;
5239
6554
  }
5240
- }, lt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), X = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ut = class extends e {
6555
+ }, Nn = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), K = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Pn = class extends e {
5241
6556
  static get observedAttributes() {
5242
6557
  return [
5243
6558
  "label",
@@ -5251,8 +6566,8 @@ var Qe = class extends e {
5251
6566
  let e = this.closest("wui-wizard");
5252
6567
  e && typeof e.refresh == "function" && e.refresh();
5253
6568
  }
5254
- }, dt = 2e3;
5255
- async function ft(e) {
6569
+ }, Fn = 2e3;
6570
+ async function In(e) {
5256
6571
  try {
5257
6572
  if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
5258
6573
  } catch {}
@@ -5267,14 +6582,14 @@ async function ft(e) {
5267
6582
  }
5268
6583
  //#endregion
5269
6584
  //#region src/fileValidation.js
5270
- var pt = "image/png,image/jpeg,image/webp", mt = 5, ht = {
6585
+ var Ln = "image/png,image/jpeg,image/webp", Rn = 5, zn = {
5271
6586
  "image/png": [".png"],
5272
6587
  "image/jpeg": [".jpg", ".jpeg"],
5273
6588
  "image/webp": [".webp"],
5274
6589
  "image/gif": [".gif"],
5275
6590
  "image/svg+xml": [".svg"],
5276
6591
  "application/pdf": [".pdf"]
5277
- }, gt = {
6592
+ }, Bn = {
5278
6593
  "image/png": "PNG",
5279
6594
  "image/jpeg": "JPG",
5280
6595
  "image/webp": "WEBP",
@@ -5288,7 +6603,7 @@ var pt = "image/png,image/jpeg,image/webp", mt = 5, ht = {
5288
6603
  ".gif": "GIF",
5289
6604
  ".svg": "SVG",
5290
6605
  ".pdf": "PDF"
5291
- }, _t = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), vt = [
6606
+ }, Vn = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), Hn = [
5292
6607
  ".png",
5293
6608
  ".jpg",
5294
6609
  ".jpeg",
@@ -5299,54 +6614,459 @@ var pt = "image/png,image/jpeg,image/webp", mt = 5, ht = {
5299
6614
  ".avif",
5300
6615
  ".heic"
5301
6616
  ];
5302
- function yt(e) {
6617
+ function Un(e) {
5303
6618
  if (!e) return !1;
5304
6619
  let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
5305
6620
  if (t) return t.startsWith("image/");
5306
6621
  let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
5307
- return vt.some((e) => r.endsWith(e));
6622
+ return Hn.some((e) => r.endsWith(e));
5308
6623
  }
5309
- function bt(e) {
5310
- let t = _t(e);
5311
- return t.length ? t.every((e) => e.startsWith(".") ? vt.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
6624
+ function Wn(e) {
6625
+ let t = Vn(e);
6626
+ return t.length ? t.every((e) => e.startsWith(".") ? Hn.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
5312
6627
  }
5313
- function xt(e) {
6628
+ function Gn(e) {
5314
6629
  let t = [];
5315
- for (let n of _t(e)) {
5316
- let e = gt[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
6630
+ for (let n of Vn(e)) {
6631
+ let e = Bn[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
5317
6632
  t.includes(e) || t.push(e);
5318
6633
  }
5319
6634
  return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
5320
6635
  }
5321
- function St(e, t) {
5322
- let n = _t(t);
6636
+ function Kn(e, t) {
6637
+ let n = Vn(t);
5323
6638
  if (!n.length) return !0;
5324
6639
  let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
5325
- return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ht[e] || []).some((e) => i.endsWith(e)));
6640
+ return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (zn[e] || []).some((e) => i.endsWith(e)));
5326
6641
  }
5327
- function Ct(e, t = {}) {
6642
+ function qn(e, t = {}) {
5328
6643
  if (!e) return null;
5329
- let n = t.accept === void 0 ? pt : t.accept, r = t.maxSizeMb === void 0 ? 5 : t.maxSizeMb;
5330
- return St(e, n) ? r > 0 && e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${xt(n)} file.`;
6644
+ let n = t.accept === void 0 ? Ln : t.accept, r = t.maxSizeMb === void 0 ? 5 : t.maxSizeMb;
6645
+ return Kn(e, n) ? r > 0 && e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Gn(n)} file.`;
6646
+ }
6647
+ //#endregion
6648
+ //#region src/formatters.js
6649
+ var Jn = [
6650
+ "number",
6651
+ "currency",
6652
+ "percent",
6653
+ "compact",
6654
+ "duration",
6655
+ "date"
6656
+ ], Yn = ["INR"], Xn = ["rupees", "paise"], Zn = [
6657
+ "ms",
6658
+ "s",
6659
+ "min",
6660
+ "h"
6661
+ ], Qn = [
6662
+ "day",
6663
+ "month",
6664
+ "year",
6665
+ "datetime",
6666
+ "time"
6667
+ ], $n = "Asia/Kolkata", er = "-", tr = "−", nr = "₹", rr = 330 * 60 * 1e3, ir = [
6668
+ "Jan",
6669
+ "Feb",
6670
+ "Mar",
6671
+ "Apr",
6672
+ "May",
6673
+ "Jun",
6674
+ "Jul",
6675
+ "Aug",
6676
+ "Sep",
6677
+ "Oct",
6678
+ "Nov",
6679
+ "Dec"
6680
+ ], ar = [
6681
+ [1e7, "Cr"],
6682
+ [1e5, "L"],
6683
+ [1e3, "K"]
6684
+ ], or = (e, t) => Number.isInteger(e) && e >= 0 && e <= 20 ? e : t, sr = /* @__PURE__ */ new Map(), q = (e) => (sr.has(e) || sr.set(e, new Intl.NumberFormat("en-IN", {
6685
+ minimumFractionDigits: 0,
6686
+ maximumFractionDigits: e
6687
+ })), sr.get(e)), cr = /* @__PURE__ */ new Map(), lr = (e) => (cr.has(e) || cr.set(e, new Intl.NumberFormat("en-IN", {
6688
+ minimumFractionDigits: e,
6689
+ maximumFractionDigits: e
6690
+ })), cr.get(e)), ur = (e) => typeof e == "number" && Number.isFinite(e), dr = (e) => e < 0 && !Object.is(Math.abs(e), 0) ? tr : "", fr = (e, t) => t === "paise" ? e / 100 : e;
6691
+ function pr(e, { decimals: t } = {}) {
6692
+ if (!ur(e)) return "-";
6693
+ let n = q(or(t, 2)).format(Math.abs(e));
6694
+ return n === "0" ? "0" : dr(e) + n;
6695
+ }
6696
+ function mr(e, { unit: t = "rupees", decimals: n } = {}) {
6697
+ if (!ur(e)) return "-";
6698
+ let r = fr(e, t), i = lr(or(n, 0)).format(Math.abs(r));
6699
+ return (Number(i.replace(/,/g, "")) === 0 ? "" : dr(r)) + nr + i;
6700
+ }
6701
+ var hr = (e) => e > 0 && e < .1 ? Math.min(20, 1 - Math.floor(Math.log10(e))) : 2;
6702
+ function gr(e, { currency: t, unit: n = "rupees" } = {}) {
6703
+ if (!ur(e)) return "-";
6704
+ let r = t ? fr(e, n) : e, i = t ? nr : "", a = Math.abs(r), o = ar.findIndex(([e]) => a >= e);
6705
+ if (o === -1) {
6706
+ let e = q(hr(a)).format(a);
6707
+ if (e !== "1,000") return (e === "0" ? "" : dr(r)) + i + e;
6708
+ o = ar.length - 1;
6709
+ }
6710
+ let [s, c] = ar[o], l = a / s, u = l >= 100 ? 0 : l >= 10 ? 1 : 2, d = Number(l.toFixed(u));
6711
+ return d >= 100 && o > 0 && (--o, [s, c] = ar[o], l = a / s, u = l >= 100 ? 0 : l >= 10 ? 1 : 2, d = Number(l.toFixed(u))), `${dr(r)}${i}${q(u).format(d)} ${c}`;
6712
+ }
6713
+ function _r(e, { decimals: t } = {}) {
6714
+ return ur(e) ? `${pr(e * 100, { decimals: or(t, 1) })}%` : "-";
6715
+ }
6716
+ function vr(e, { unit: t = "s" } = {}) {
6717
+ if (!ur(e)) return "-";
6718
+ let n = {
6719
+ ms: 1,
6720
+ s: 1e3,
6721
+ min: 6e4,
6722
+ h: 36e5
6723
+ }[t] ?? 1e3, r = Math.abs(e * n), i = dr(e);
6724
+ if (Math.round(r) < 1e3) return `${i}${q(0).format(r)} ms`;
6725
+ let a = r / 1e3;
6726
+ if (a < 10) return `${i}${q(1).format(a)}s`;
6727
+ let o = Math.round(a);
6728
+ if (o < 60) return `${i}${o}s`;
6729
+ let s = (e) => String(e).padStart(2, "0"), c = Math.floor(o / 60);
6730
+ if (c < 60) return `${i}${c}m ${s(o % 60)}s`;
6731
+ let l = Math.floor(c / 60);
6732
+ return `${i}${q(0).format(l)}h ${s(c % 60)}m`;
6733
+ }
6734
+ function yr(e) {
6735
+ if (e instanceof Date) return e.getTime();
6736
+ if (ur(e)) return e;
6737
+ if (typeof e != "string") return NaN;
6738
+ let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
6739
+ if (t) {
6740
+ let [e, n, r] = [
6741
+ Number(t[1]),
6742
+ Number(t[2]),
6743
+ Number(t[3])
6744
+ ], i = new Date(Date.UTC(2e3, n - 1, r));
6745
+ return i.setUTCFullYear(e), i.getUTCFullYear() === e && i.getUTCMonth() === n - 1 && i.getUTCDate() === r ? i.getTime() - rr : NaN;
6746
+ }
6747
+ return Date.parse(e);
6748
+ }
6749
+ function br(e) {
6750
+ let t = new Date(e + rr);
6751
+ return {
6752
+ year: t.getUTCFullYear(),
6753
+ month: t.getUTCMonth(),
6754
+ day: t.getUTCDate(),
6755
+ hour: t.getUTCHours(),
6756
+ minute: t.getUTCMinutes()
6757
+ };
6758
+ }
6759
+ function xr(e, { pattern: t = "day" } = {}) {
6760
+ let n = yr(e);
6761
+ if (!Number.isFinite(n)) return "-";
6762
+ let r = br(n), i = (e) => String(e).padStart(2, "0"), a = `${i(r.day)}-${ir[r.month]}-${r.year}`, o = `${i(r.hour)}:${i(r.minute)}`;
6763
+ switch (t) {
6764
+ case "month": return `${ir[r.month]}-${r.year}`;
6765
+ case "year": return String(r.year);
6766
+ case "datetime": return `${a} ${o}`;
6767
+ case "time": return o;
6768
+ default: return a;
6769
+ }
6770
+ }
6771
+ function Sr(e, t) {
6772
+ if (e == null || e === "") return "-";
6773
+ let n = t?.style;
6774
+ if (n === "date") return xr(e, t);
6775
+ if (typeof e != "number") return String(e);
6776
+ switch (n) {
6777
+ case "currency": return mr(e, t);
6778
+ case "percent": return _r(e, t);
6779
+ case "compact": return gr(e, t);
6780
+ case "duration": return vr(e, t);
6781
+ default: return pr(e, t);
6782
+ }
6783
+ }
6784
+ //#endregion
6785
+ //#region src/inputMask.js
6786
+ var Cr = /[0-9]/, wr = {
6787
+ 9: Cr,
6788
+ A: /[A-Za-z]/,
6789
+ "*": /[0-9A-Za-z]/
6790
+ }, Tr = /[9A*]/, Er = /* @__PURE__ */ new Set([
6791
+ "text",
6792
+ "tel",
6793
+ "search",
6794
+ "url",
6795
+ "password"
6796
+ ]), Dr = (e) => {
6797
+ let t = e.replace(/\D/g, "");
6798
+ return t.length === 12 && t.startsWith("91") ? t.slice(2) : t.length === 11 && t.startsWith("0") ? t.slice(1) : e;
6799
+ }, Or = (e) => {
6800
+ let t = Number(e.slice(0, 2)), n = Number(e.slice(2, 4)), r = Number(e.slice(4, 8));
6801
+ if (r < 1) return !1;
6802
+ let i = new Date(Date.UTC(r, n - 1, t));
6803
+ return i.getUTCFullYear() === r && i.getUTCMonth() === n - 1 && i.getUTCDate() === t;
6804
+ }, kr = (e) => e.length <= 3 ? e : `${e.slice(0, -3).replace(/\B(?=(\d{2})+(?!\d))/g, ",")},${e.slice(-3)}`, Ar = (e) => {
6805
+ let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
6806
+ return t ? `${t[3]}-${t[2]}-${t[1]}` : e;
6807
+ };
6808
+ function J(e, { upper: t = !1, normalize: n, valid: r, post: i = (e) => e, message: a = "Enter the full value" } = {}) {
6809
+ let o = [...e].map((e) => wr[e] ? { re: wr[e] } : { lit: e }), s = o.filter((e) => e.re).length;
6810
+ return {
6811
+ inputMode: o.every((e) => !e.re || e.re === Cr) ? "numeric" : "text",
6812
+ normalize: n,
6813
+ post: i,
6814
+ message: a,
6815
+ extract(e) {
6816
+ let n = "", r = 0;
6817
+ for (let i of e) {
6818
+ for (; r < o.length && o[r].lit !== void 0 && o[r].lit !== i;) r++;
6819
+ if (r >= o.length) break;
6820
+ let e = o[r];
6821
+ e.lit === void 0 ? e.re.test(i) && (n += t ? i.toUpperCase() : i, r++) : r++;
6822
+ }
6823
+ return n;
6824
+ },
6825
+ layout(e) {
6826
+ let t = "", n = [], r = 0;
6827
+ for (let i = 0; i < o.length && r < e.length; i++) o[i].lit === void 0 ? (t += e[r++], n.push(!0)) : (t += o[i].lit, n.push(!1));
6828
+ return {
6829
+ text: t,
6830
+ isRaw: n
6831
+ };
6832
+ },
6833
+ isValid: (e) => e.length === s && (!r || r(e))
6834
+ };
6835
+ }
6836
+ function jr() {
6837
+ return {
6838
+ inputMode: "decimal",
6839
+ post: (e) => e,
6840
+ message: "Enter a valid amount",
6841
+ extract(e) {
6842
+ let t = "", n = !1, r = 0;
6843
+ for (let i of e) Cr.test(i) ? n ? r < 2 && (t += i, r++) : t += i : i === "." && !n && (n = !0, t += i);
6844
+ return t.startsWith(".") && (t = `0${t}`), t.replace(/^0+(?=\d)/, "");
6845
+ },
6846
+ layout(e) {
6847
+ let [t, n] = e.split("."), r = kr(t) + (e.includes(".") ? `.${n}` : "");
6848
+ return {
6849
+ text: r,
6850
+ isRaw: [...r].map((e) => e !== ",")
6851
+ };
6852
+ },
6853
+ isValid: (e) => /^\d+(\.\d{1,2})?$/.test(e)
6854
+ };
6855
+ }
6856
+ var Mr = {
6857
+ "phone-in": () => J("99999 99999", {
6858
+ normalize: Dr,
6859
+ valid: (e) => /^[6-9]/.test(e),
6860
+ message: "Enter a 10-digit mobile number"
6861
+ }),
6862
+ pan: () => J("AAAAA9999A", {
6863
+ upper: !0,
6864
+ valid: (e) => /^[A-Z]{5}\d{4}[A-Z]$/.test(e),
6865
+ message: "Enter a valid PAN"
6866
+ }),
6867
+ gstin: () => J("99AAAAA9999A***", {
6868
+ upper: !0,
6869
+ valid: (e) => /^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),
6870
+ message: "Enter a valid GSTIN"
6871
+ }),
6872
+ aadhaar: () => J("9999 9999 9999", {
6873
+ valid: (e) => /^[2-9]/.test(e),
6874
+ message: "Enter a valid 12-digit Aadhaar number"
6875
+ }),
6876
+ ifsc: () => J("AAAA*******", {
6877
+ upper: !0,
6878
+ valid: (e) => /^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),
6879
+ message: "Enter a valid IFSC"
6880
+ }),
6881
+ "pin-code": () => J("999999", {
6882
+ valid: (e) => /^[1-9]/.test(e),
6883
+ message: "Enter a valid 6-digit PIN code"
6884
+ }),
6885
+ date: () => J("99-99-9999", {
6886
+ normalize: Ar,
6887
+ valid: Or,
6888
+ post: (e, t) => e.length === 8 && Or(e) ? `${e.slice(4)}-${e.slice(2, 4)}-${e.slice(0, 2)}` : t,
6889
+ message: "Enter a valid date as DD-MM-YYYY"
6890
+ }),
6891
+ amount: jr
6892
+ }, Nr = Object.keys(Mr), Pr = (e) => {
6893
+ let t = String(e).toLowerCase();
6894
+ return Object.hasOwn(Mr, t) ? t : void 0;
6895
+ }, Fr = (e) => Tr.test(String(e)) && Pr(e) === void 0, Ir = /* @__PURE__ */ new Map();
6896
+ function Lr(e) {
6897
+ if (e == null || e === "") return null;
6898
+ let t = String(e);
6899
+ return Ir.has(t) || (Fr(t) ? Ir.set(t, J(t)) : Ir.set(t, Object.hasOwn(Mr, t) ? Mr[t]() : null)), Ir.get(t);
6900
+ }
6901
+ var Y = (e, t) => e.normalize ? e.normalize(t) : t;
6902
+ function Rr(e, t) {
6903
+ let n = Lr(e);
6904
+ return n ? n.extract(Y(n, String(t ?? ""))) : String(t ?? "");
6905
+ }
6906
+ function zr(e, t) {
6907
+ let n = Lr(e);
6908
+ if (!n) return String(t ?? "");
6909
+ let r = n.extract(Y(n, String(t ?? "")));
6910
+ return n.post(r, n.layout(r).text);
6911
+ }
6912
+ function Br(e, t) {
6913
+ let n = Lr(e);
6914
+ return n ? n.layout(n.extract(Y(n, String(t ?? "")))).text : String(t ?? "");
6915
+ }
6916
+ var Vr = (e, t) => {
6917
+ if (t <= 0) return 0;
6918
+ let n = 0;
6919
+ for (let r = 0; r < e.length; r++) if (e[r] && ++n === t) return r + 1;
6920
+ return e.length;
6921
+ }, Hr = /* @__PURE__ */ new WeakMap(), Ur = (e) => Hr.get(e)?.(), Wr = /* @__PURE__ */ new WeakMap();
6922
+ function Gr(e, t, n, r) {
6923
+ let i = e.getAll(t), a = Wr.get(e);
6924
+ a || Wr.set(e, a = /* @__PURE__ */ new Set());
6925
+ let o = i.findIndex((e, r) => e === n && !a.has(`${t}\u0000${r}`));
6926
+ if (!(o < 0)) {
6927
+ if (a.add(`${t}\u0000${o}`), i[o] = r, i.length === 1) {
6928
+ e.set(t, r);
6929
+ return;
6930
+ }
6931
+ e.delete(t);
6932
+ for (let n of i) e.append(t, n);
6933
+ }
6934
+ }
6935
+ function Kr(e) {
6936
+ let t = null, n = null, r = !1, i = (t, n) => n === null ? e.removeAttribute(t) : e.setAttribute(t, n), a, o, s = () => {
6937
+ t?.remove(), t = null, n && (n.hidden = !1), n = null, r && e.classList.remove("error"), r = !1, a !== void 0 && i("aria-invalid", a), o !== void 0 && i("aria-describedby", o), a = void 0, o = void 0;
6938
+ };
6939
+ return (i) => {
6940
+ if (!i) {
6941
+ s();
6942
+ return;
6943
+ }
6944
+ let c = e.closest(".field"), l = c?.querySelector(".field-error");
6945
+ l && l !== t && l.textContent.trim() || (t || (r = !e.classList.contains("error"), e.classList.add("error"), a = e.getAttribute("aria-invalid"), o = e.getAttribute("aria-describedby"), c && (t = document.createElement("div"), t.className = "field-error", e.id && (t.id = `${e.id}-error`), n = c.querySelector(".field-hint"), n && (n.hidden = !0), c.insertBefore(t, [...c.children].find((e) => e.classList.contains("field-count")) ?? null), t.id && e.setAttribute("aria-describedby", t.id)), e.setAttribute("aria-invalid", "true")), t && (t.textContent = i));
6946
+ };
6947
+ }
6948
+ function qr(e, { mask: t, postFormatted: n = !1, onChange: r, onInvalidChange: i } = {}) {
6949
+ let a = Lr(t);
6950
+ if (!a || !Er.has(e.type)) return () => {};
6951
+ let o = Object.getPrototypeOf(e), s = Object.getOwnPropertyDescriptor(o, "value").set, c = !e.hasAttribute("inputmode");
6952
+ c && e.setAttribute("inputmode", a.inputMode);
6953
+ let l = i ?? Kr(e), u = null, d = !1, f = !1, p = !1, m = "", h = "", g, _ = () => {
6954
+ let e = p ? m : "";
6955
+ e !== h && (h = e, l(h));
6956
+ }, v = (t, n, i) => {
6957
+ let o = a.extract(t.slice(0, n)).length, c = a.extract(t), { text: l, isRaw: d } = a.layout(c);
6958
+ if (e.value !== l && (s.call(e, l), document.activeElement === e && Er.has(e.type))) {
6959
+ let t = Vr(d, o);
6960
+ e.setSelectionRange(t, t);
6961
+ }
6962
+ e.dataset.maskRaw = c, m = c && !a.isValid(c) ? a.message : "", e.setCustomValidity(m), _(), i && c !== u && r?.(c, l), u = c;
6963
+ }, y = Object.getOwnPropertyDescriptor(e, "value"), b = y ?? Object.getOwnPropertyDescriptor(o, "value");
6964
+ Object.defineProperty(e, "value", {
6965
+ configurable: !0,
6966
+ enumerable: b.enumerable,
6967
+ get: () => b.get.call(e),
6968
+ set: (t) => {
6969
+ if (b.set.call(e, t), f) return;
6970
+ let n = Y(a, e.value);
6971
+ v(n, n.length, !0);
6972
+ }
6973
+ });
6974
+ let x = () => {
6975
+ d = !0, e.dispatchEvent(new Event("input", { bubbles: !0 })), d = !1;
6976
+ }, S = (t) => {
6977
+ if (d || f || t.isComposing) return;
6978
+ let n = t.inputType === "insertText" && (t.data?.length ?? 0) <= 1 || t.inputType?.startsWith("delete") ? e.value : Y(a, e.value);
6979
+ v(n, e.selectionStart ?? n.length, !0);
6980
+ }, ee = () => {
6981
+ f = !0;
6982
+ }, C = () => {
6983
+ f = !1;
6984
+ let t = Y(a, e.value);
6985
+ v(t, e.selectionStart ?? t.length, !0), x();
6986
+ }, w = (t) => {
6987
+ let n = t.inputType === "deleteContentBackward";
6988
+ if (!n && t.inputType !== "deleteContentForward" || t.isComposing) return;
6989
+ let r = e.selectionStart;
6990
+ if (r == null || r !== e.selectionEnd) return;
6991
+ let { isRaw: i } = a.layout(a.extract(e.value)), o = n ? r - 1 : r;
6992
+ for (; o >= 0 && o < i.length && !i[o];) o += n ? -1 : 1;
6993
+ o !== (n ? r - 1 : r) && (t.preventDefault(), !(o < 0 || o >= i.length) && (v(e.value.slice(0, o) + e.value.slice(o + 1), n ? o : r, !0), x()));
6994
+ }, T = (t) => {
6995
+ if (e.readOnly || e.disabled) return;
6996
+ let n = t.clipboardData?.getData("text");
6997
+ if (n == null) return;
6998
+ t.preventDefault();
6999
+ let r = Y(a, n), i = e.selectionStart ?? e.value.length, o = e.selectionEnd ?? i;
7000
+ v(e.value.slice(0, i) + r + e.value.slice(o), i + r.length, !0), x();
7001
+ }, E = () => {
7002
+ let t = a.extract(e.value);
7003
+ return a.post(t, a.layout(t).text);
7004
+ }, D = () => {
7005
+ p = !0, _();
7006
+ };
7007
+ e.addEventListener("input", S), e.addEventListener("beforeinput", w), e.addEventListener("paste", T), e.addEventListener("compositionstart", ee), e.addEventListener("compositionend", C), e.addEventListener("blur", D), e.addEventListener("invalid", D);
7008
+ let O = e.form, te = (t) => {
7009
+ e.name && !e.disabled && Gr(t.formData, e.name, e.value, E());
7010
+ }, ne = () => {
7011
+ clearTimeout(g), g = setTimeout(() => {
7012
+ p = !1, v(Y(a, e.value), e.value.length, !0);
7013
+ }, 0);
7014
+ };
7015
+ n || (O?.addEventListener("formdata", te), Hr.set(e, E)), O?.addEventListener("reset", ne), O?.addEventListener("submit", D);
7016
+ let re = Y(a, e.value);
7017
+ return v(re, re.length, !1), () => {
7018
+ clearTimeout(g), e.removeEventListener("input", S), e.removeEventListener("beforeinput", w), e.removeEventListener("paste", T), e.removeEventListener("compositionstart", ee), e.removeEventListener("compositionend", C), e.removeEventListener("blur", D), e.removeEventListener("invalid", D), O?.removeEventListener("formdata", te), O?.removeEventListener("reset", ne), O?.removeEventListener("submit", D), Hr.delete(e), y ? Object.defineProperty(e, "value", y) : delete e.value, p = !1, m = "", _(), e.setCustomValidity(""), delete e.dataset.maskRaw, c && e.removeAttribute("inputmode");
7019
+ };
7020
+ }
7021
+ function Jr() {
7022
+ let e = typeof window > "u" ? void 0 : window.jQuery?.validator?.prototype;
7023
+ if (!e || e.wuiMaskHook) return;
7024
+ let t = e.elementValue;
7025
+ e.elementValue = function(e) {
7026
+ let n = Ur(e);
7027
+ return n === void 0 ? t.call(this, e) : n;
7028
+ }, e.wuiMaskHook = !0;
7029
+ }
7030
+ var Yr = /* @__PURE__ */ new WeakMap(), Xr, Zr = (e) => {
7031
+ Yr.has(e) || Yr.set(e, qr(e, {
7032
+ mask: e.dataset.appMask,
7033
+ postFormatted: e.hasAttribute("data-mask-post-formatted")
7034
+ }));
7035
+ }, Qr = (e) => e.nodeType === 1 ? [...e.matches("input[data-app-mask]") ? [e] : [], ...e.querySelectorAll("input[data-app-mask]")] : [];
7036
+ function $r() {
7037
+ Xr || typeof MutationObserver > "u" || (Xr = new MutationObserver((e) => {
7038
+ for (let t of e) {
7039
+ for (let e of t.removedNodes) for (let t of Qr(e)) Yr.get(t)?.(), Yr.delete(t);
7040
+ for (let e of t.addedNodes) for (let t of Qr(e)) Zr(t);
7041
+ }
7042
+ }), Xr.observe(document.documentElement, {
7043
+ childList: !0,
7044
+ subtree: !0
7045
+ }));
7046
+ }
7047
+ function ei(e = document) {
7048
+ Jr();
7049
+ for (let t of e.querySelectorAll("input[data-app-mask]")) Zr(t);
7050
+ e === document && $r();
5331
7051
  }
5332
7052
  //#endregion
5333
7053
  //#region src/passwordRules.js
5334
- var wt = {
7054
+ var ti = {
5335
7055
  minLength: 8,
5336
7056
  uppercase: !0,
5337
7057
  lowercase: !0,
5338
7058
  digit: !0,
5339
7059
  special: !0,
5340
7060
  uniqueChars: 0
5341
- }, Tt = "Password requirements";
5342
- function Et(e) {
5343
- return e === !0 || e == null ? { ...wt } : {
5344
- ...wt,
7061
+ }, ni = "Password requirements";
7062
+ function ri(e) {
7063
+ return e === !0 || e == null ? { ...ti } : {
7064
+ ...ti,
5345
7065
  ...e
5346
7066
  };
5347
7067
  }
5348
- function Dt(e) {
5349
- let t = Et(e), n = [];
7068
+ function ii(e) {
7069
+ let t = ri(e), n = [];
5350
7070
  if (t.minLength > 0 && n.push({
5351
7071
  key: "length",
5352
7072
  label: `At least ${t.minLength} characters long`,
@@ -5377,89 +7097,145 @@ function Dt(e) {
5377
7097
  }
5378
7098
  return n;
5379
7099
  }
5380
- function Ot(e, t) {
7100
+ function ai(e, t) {
5381
7101
  let n = e == null ? "" : String(e);
5382
- return Dt(t).map((e) => ({
7102
+ return ii(t).map((e) => ({
5383
7103
  key: e.key,
5384
7104
  label: e.label,
5385
7105
  met: e.test(n)
5386
7106
  }));
5387
7107
  }
5388
- function kt(e, t) {
5389
- return Ot(e, t).every((e) => e.met);
7108
+ function oi(e, t) {
7109
+ return ai(e, t).every((e) => e.met);
7110
+ }
7111
+ //#endregion
7112
+ //#region src/remoteModal.js
7113
+ function si(e = document) {}
7114
+ function ci(e, t = {}) {
7115
+ return Promise.reject(/* @__PURE__ */ Error(`WUI.modal.load(${String(e)}): server-loaded modals are not available in this build.`));
7116
+ }
7117
+ //#endregion
7118
+ //#region src/serverTable.js
7119
+ function li(e = document) {}
7120
+ function ui(e) {
7121
+ return null;
7122
+ }
7123
+ //#endregion
7124
+ //#region src/shellParts.js
7125
+ function di(e = document) {}
7126
+ function fi(e) {
7127
+ return null;
7128
+ }
7129
+ //#endregion
7130
+ //#region src/tableSelect.js
7131
+ var pi = "Select all rows", mi = "Select row", X = "wui-select-cell", hi = (e, t) => {
7132
+ let n = e.createElement("input");
7133
+ return n.type = "checkbox", n.className = "wui-check", n.setAttribute("aria-label", t), n;
7134
+ };
7135
+ function gi(e = document) {
7136
+ let t = e.createElement("th");
7137
+ return t.className = X, t.appendChild(hi(e, pi)), t;
7138
+ }
7139
+ function _i(e = document) {
7140
+ let t = e.createElement("td");
7141
+ return t.className = X, t.appendChild(hi(e, mi)), t;
7142
+ }
7143
+ function vi(e = document) {
7144
+ let t = e.createElement("td");
7145
+ return t.className = X, t;
7146
+ }
7147
+ var yi = (e) => e.firstElementChild?.classList.contains(X);
7148
+ function bi(e) {
7149
+ for (let t of e) yi(t) || t.insertBefore(_i(t.ownerDocument), t.firstChild);
7150
+ }
7151
+ function xi(e) {
7152
+ let t = e.querySelector("thead tr");
7153
+ if (!t) return null;
7154
+ yi(t) || t.insertBefore(gi(e.ownerDocument), t.firstChild), bi(e.querySelectorAll("tbody tr"));
7155
+ for (let t of e.querySelectorAll("tfoot tr")) yi(t) || t.insertBefore(vi(e.ownerDocument), t.firstChild);
7156
+ return t.querySelector(`.${X} .wui-check`);
7157
+ }
7158
+ function Si(e) {
7159
+ let t = e.querySelector(`thead .${X} .wui-check`), n = [...e.querySelectorAll("tbody tr .wui-check")], r = n.length, i = n.filter((e) => e.checked).length;
7160
+ t && (t.checked = r > 0 && i === r, t.indeterminate = i > 0 && i < r);
7161
+ for (let t of e.querySelectorAll("tbody tr")) t.classList.toggle("is-selected", !!t.querySelector(".wui-check")?.checked);
7162
+ return {
7163
+ selected: i,
7164
+ total: r
7165
+ };
5390
7166
  }
5391
7167
  //#endregion
5392
7168
  //#region src/themeTransition.js
5393
- var At = [
7169
+ var Ci = [
5394
7170
  "light",
5395
7171
  "dark",
5396
7172
  "auto"
5397
- ], jt = [
7173
+ ], wi = [
5398
7174
  "wave",
5399
7175
  "circle",
5400
7176
  "slide",
5401
7177
  "blinds",
5402
7178
  "fade",
5403
7179
  "none"
5404
- ], Mt = "wave", Nt = "theme", Pt = {
7180
+ ], Ti = "wave", Ei = "theme", Di = {
5405
7181
  wave: 1100,
5406
7182
  circle: 700,
5407
7183
  slide: 600,
5408
7184
  blinds: 900,
5409
7185
  fade: 350,
5410
7186
  none: 0
5411
- }, Ft = "wui-theme-switching", It = "wui-theme-change", Lt = "wui-theme-toggle", Rt = "(prefers-color-scheme: dark)", zt = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, Bt = (e) => At.includes(e);
5412
- function Vt(e) {
5413
- return e === "dark" || e === "auto" && zt(Rt) ? "dark" : "light";
7187
+ }, Oi = "wui-theme-switching", ki = "wui-theme-change", Ai = "wui-theme-toggle", ji = "(prefers-color-scheme: dark)", Mi = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, Ni = (e) => Ci.includes(e);
7188
+ function Pi(e) {
7189
+ return e === "dark" || e === "auto" && Mi(ji) ? "dark" : "light";
5414
7190
  }
5415
- function Ht(e = Nt, { includeAuto: t = !1 } = {}) {
7191
+ function Fi(e = Ei, { includeAuto: t = !1 } = {}) {
5416
7192
  let n = null;
5417
7193
  try {
5418
7194
  n = window.localStorage.getItem(e);
5419
7195
  } catch {}
5420
- return !Bt(n) || n === "auto" && !t ? "light" : n;
7196
+ return !Ni(n) || n === "auto" && !t ? "light" : n;
5421
7197
  }
5422
- function Ut(e, t = Nt) {
7198
+ function Ii(e, t = Ei) {
5423
7199
  try {
5424
7200
  window.localStorage.setItem(t, e);
5425
7201
  } catch {}
5426
7202
  }
5427
- function Wt(e) {
7203
+ function Li(e) {
5428
7204
  let t = document.documentElement;
5429
- t.setAttribute("data-theme", e), t.setAttribute("data-bs-theme", Vt(e)), document.dispatchEvent(new CustomEvent(It, { detail: { mode: e } }));
7205
+ t.setAttribute("data-theme", e), t.setAttribute("data-bs-theme", Pi(e)), document.dispatchEvent(new CustomEvent(ki, { detail: { mode: e } }));
5430
7206
  }
5431
- function Gt(e, { includeAuto: t = !1 } = {}) {
7207
+ function Ri(e, { includeAuto: t = !1 } = {}) {
5432
7208
  return e === "light" ? "dark" : e === "dark" && t ? "auto" : "light";
5433
7209
  }
5434
- function Kt(e) {
7210
+ function zi(e) {
5435
7211
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
5436
- let t = window.matchMedia(Rt), n = () => e(t.matches ? "dark" : "light");
7212
+ let t = window.matchMedia(ji), n = () => e(t.matches ? "dark" : "light");
5437
7213
  return t.addEventListener("change", n), () => t.removeEventListener("change", n);
5438
7214
  }
5439
- var qt = 60, Jt = (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2, Z = (e) => e.toFixed(1), Q = (e, t) => `${Z(e)}px ${Z(t)}px`, Yt = {
7215
+ var Bi = 60, Vi = (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2, Z = (e) => e.toFixed(1), Q = (e, t) => `${Z(e)}px ${Z(t)}px`, Hi = {
5440
7216
  amplitude: 22,
5441
7217
  segments: 36,
5442
7218
  cycles: 1.5,
5443
7219
  ripples: 2
5444
- }, Xt = 6, Zt = (e, t, n, r, i) => {
5445
- let { amplitude: a, segments: o, cycles: s } = Yt, c = n * (t + 2 * a), l = i ? t + a - c : c - a, u = i ? t + 2 * a : -2 * a, d = [Q(0, u)];
7220
+ }, Ui = 6, Wi = (e, t, n, r, i) => {
7221
+ let { amplitude: a, segments: o, cycles: s } = Hi, c = n * (t + 2 * a), l = i ? t + a - c : c - a, u = i ? t + 2 * a : -2 * a, d = [Q(0, u)];
5446
7222
  for (let t = 0; t <= o; t++) {
5447
7223
  let n = e * t / o, i = l + a * Math.sin(2 * Math.PI * s * t / o + r);
5448
7224
  d.push(Q(n, i));
5449
7225
  }
5450
7226
  return d.push(Q(e, u)), `polygon(${d.join(", ")})`;
5451
- }, Qt = (e, t, n, r) => {
5452
- let i = t / Xt, a = [];
5453
- for (let t = 0; t < Xt; t++) {
7227
+ }, Gi = (e, t, n, r) => {
7228
+ let i = t / Ui, a = [];
7229
+ for (let t = 0; t < Ui; t++) {
5454
7230
  let o = t * i, s = i * n, c = r ? o + i - s : o, l = r ? o + i : o + s;
5455
7231
  a.push(Q(0, c), Q(e, c), Q(e, l), Q(0, l));
5456
7232
  }
5457
7233
  return `polygon(${a.join(", ")})`;
5458
7234
  };
5459
- function $t(e, { width: t, height: n, to: r = "dark", origin: i } = {}) {
7235
+ function Ki(e, { width: t, height: n, to: r = "dark", origin: i } = {}) {
5460
7236
  let a = r === "dark", o = [];
5461
- for (let r = 0; r <= qt; r++) {
5462
- let s = r / qt, c = Jt(s);
7237
+ for (let r = 0; r <= Bi; r++) {
7238
+ let s = r / Bi, c = Vi(s);
5463
7239
  switch (e) {
5464
7240
  case "circle": {
5465
7241
  let e = i?.x ?? t / 2, r = i?.y ?? n / 2, a = Math.hypot(Math.max(e, t - e), Math.max(r, n - r));
@@ -5472,7 +7248,7 @@ function $t(e, { width: t, height: n, to: r = "dark", origin: i } = {}) {
5472
7248
  break;
5473
7249
  }
5474
7250
  case "blinds":
5475
- o.push({ clipPath: Qt(t, n, c, a) });
7251
+ o.push({ clipPath: Gi(t, n, c, a) });
5476
7252
  break;
5477
7253
  case "fade":
5478
7254
  o.push({
@@ -5481,20 +7257,20 @@ function $t(e, { width: t, height: n, to: r = "dark", origin: i } = {}) {
5481
7257
  });
5482
7258
  break;
5483
7259
  case "none": return [];
5484
- default: o.push({ clipPath: Zt(t, n, c, s * Yt.ripples * 2 * Math.PI, a) });
7260
+ default: o.push({ clipPath: Wi(t, n, c, s * Hi.ripples * 2 * Math.PI, a) });
5485
7261
  }
5486
7262
  }
5487
7263
  return o;
5488
7264
  }
5489
- function en(e, { effect: t = Mt, to: n, origin: r, duration: i, live: a } = {}) {
7265
+ function qi(e, { effect: t = Ti, to: n, origin: r, duration: i, live: a } = {}) {
5490
7266
  let o = document.documentElement, s = n !== void 0 && o.getAttribute("data-bs-theme") === n;
5491
- if (t === "none" || s || zt("(prefers-reduced-motion: reduce)") || typeof document.startViewTransition != "function" || typeof o.animate != "function") return e(), Promise.resolve(!1);
5492
- o.classList.add(Ft);
7267
+ if (t === "none" || s || Mi("(prefers-reduced-motion: reduce)") || typeof document.startViewTransition != "function" || typeof o.animate != "function") return e(), Promise.resolve(!1);
7268
+ o.classList.add(Oi);
5493
7269
  let c = a instanceof Element ? a : null;
5494
- c && (c.style.viewTransitionName = Lt);
5495
- let l = document.startViewTransition(e), u = i ?? Pt[t] ?? Pt.wave;
7270
+ c && (c.style.viewTransitionName = Ai);
7271
+ let l = document.startViewTransition(e), u = i ?? Di[t] ?? Di.wave;
5496
7272
  return l.ready.then(() => {
5497
- let e = $t(t, {
7273
+ let e = Ki(t, {
5498
7274
  width: window.innerWidth,
5499
7275
  height: window.innerHeight,
5500
7276
  to: n,
@@ -5506,16 +7282,16 @@ function en(e, { effect: t = Mt, to: n, origin: r, duration: i, live: a } = {})
5506
7282
  fill: "both",
5507
7283
  pseudoElement: "::view-transition-new(root)"
5508
7284
  });
5509
- }).catch(() => {}), l.finished.catch(() => {}).then(() => (o.classList.remove(Ft), c && (c.style.viewTransitionName = ""), !0));
7285
+ }).catch(() => {}), l.finished.catch(() => {}).then(() => (o.classList.remove(Oi), c && (c.style.viewTransitionName = ""), !0));
5510
7286
  }
5511
7287
  //#endregion
5512
7288
  //#region src/index.js
5513
7289
  var $ = (e, t) => {
5514
7290
  typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
5515
7291
  };
5516
- function tn() {
5517
- $("wui-select", P), $("wui-country-select", de), $("wui-phone", Qe), $("wui-datepicker", me), $("wui-date-range", he), $("wui-dock", ge), $("wui-consent-banner", se), $("wui-slider", $e), $("wui-timepicker", ot), $("wui-autocomplete", S), $("wui-command-palette", ee), $("wui-multiselect", we), $("wui-taginput", tt), $("wui-otp", Ie), $("wui-status-icon", i), $("wui-wizard-step", ut), $("wui-wizard", ct);
7292
+ function Ji() {
7293
+ $("wui-select", we), $("wui-country-select", De), $("wui-phone", Gt), $("wui-datepicker", Me), $("wui-date-range", Ne), $("wui-dock", Pe), $("wui-image-crop", ct), $("wui-consent-banner", le), $("wui-slider", Kt), $("wui-sortable", tn), $("wui-timepicker", fn), $("wui-tree", An), $("wui-autocomplete", w), $("wui-command-palette", ne), $("wui-context-menu", Se), $("wui-multiselect", ht), $("wui-taginput", an), $("wui-otp", Dt), $("wui-status-icon", i), $("wui-wizard-step", Pn), $("wui-wizard", Mn);
5518
7294
  }
5519
- tn();
7295
+ Ji();
5520
7296
  //#endregion
5521
- export { dt as COPY_FEEDBACK_MS, pt as DEFAULT_IMAGE_ACCEPT, mt as DEFAULT_MAX_SIZE_MB, wt as DEFAULT_PASSWORD_RULES, Tt as DEFAULT_REQUIREMENTS_TITLE, Mt as DEFAULT_THEME_EFFECT, Nt as DEFAULT_THEME_STORAGE_KEY, r as STATUS_TONES, It as THEME_CHANGE_EVENT, jt as THEME_EFFECTS, Pt as THEME_EFFECT_DURATION, Lt as THEME_LIVE_NAME, At as THEME_MODES, Ft as THEME_SWITCHING_CLASS, S as WuiAutocomplete, ee as WuiCommandPalette, se as WuiConsentBanner, de as WuiCountrySelect, me as WuiDatePicker, he as WuiDateRange, ge as WuiDock, we as WuiMultiSelect, Ie as WuiOtp, Qe as WuiPhone, P as WuiSelect, $e as WuiSlider, i as WuiStatusIcon, tt as WuiTagInput, ot as WuiTimePicker, ct as WuiWizard, ut as WuiWizardStep, xt as acceptLabel, Wt as applyTheme, Dt as buildPasswordRules, ft as copyTextToClipboard, tn as defineWeborityElements, Ot as evaluatePassword, m as glyphSvg, yt as isImageFile, bt as isImageOnlyAccept, T as matchSegments, St as matchesAccept, Gt as nextTheme, kt as passwordSatisfies, Ht as readStoredTheme, Vt as resolveTheme, Ut as storeTheme, $t as themeKeyframes, en as transitionTheme, Ct as validateFile, Kt as watchSystemTheme };
7297
+ export { Fn as COPY_FEEDBACK_MS, pn as CSRF_META_NAME, Yn as CURRENCIES, Qn as DATE_PATTERNS, mn as DEFAULT_CSRF_HEADER, Ln as DEFAULT_IMAGE_ACCEPT, Rn as DEFAULT_MAX_SIZE_MB, ti as DEFAULT_PASSWORD_RULES, ni as DEFAULT_REQUIREMENTS_TITLE, Ti as DEFAULT_THEME_EFFECT, Ei as DEFAULT_THEME_STORAGE_KEY, Zn as DURATION_UNITS, er as EMPTY_VALUE, Jn as FORMAT_STYLES, hn as HTTP_KINDS, $n as IST_TIME_ZONE, Er as MASK_INPUT_TYPES, Nr as MASK_NAMES, Xn as MONEY_UNITS, pi as SELECT_ALL_LABEL, X as SELECT_CELL_CLASS, mi as SELECT_ROW_LABEL, r as STATUS_TONES, ki as THEME_CHANGE_EVENT, wi as THEME_EFFECTS, Di as THEME_EFFECT_DURATION, Ai as THEME_LIVE_NAME, Ci as THEME_MODES, Oi as THEME_SWITCHING_CLASS, W as WUI_HEADERS, w as WuiAutocomplete, ne as WuiCommandPalette, le as WuiConsentBanner, Se as WuiContextMenu, De as WuiCountrySelect, Me as WuiDatePicker, Ne as WuiDateRange, Pe as WuiDock, ht as WuiMultiSelect, Dt as WuiOtp, Gt as WuiPhone, we as WuiSelect, Kt as WuiSlider, tn as WuiSortable, i as WuiStatusIcon, an as WuiTagInput, fn as WuiTimePicker, An as WuiTree, Mn as WuiWizard, Pn as WuiWizardStep, Gn as acceptLabel, bi as addRowSelectCells, xi as addSelectColumn, Li as applyTheme, qr as attachInputMask, ii as buildPasswordRules, yn as classifyStatus, In as copyTextToClipboard, Sn as createRequestQueue, gi as createSelectHeaderCell, _i as createSelectRowCell, vi as createSelectSpacerCell, Ji as defineWeborityElements, ai as evaluatePassword, gr as formatCompact, mr as formatCurrency, xr as formatDate, vr as formatDuration, Br as formatMasked, pr as formatNumber, _r as formatPercent, Sr as formatValue, ui as getServerTable, fi as getShell, _ as glyphSvg, ei as initInputMasks, si as initRemoteModals, li as initServerTables, di as initShellParts, Un as isImageFile, Wn as isImageOnlyAccept, Fr as isMaskPattern, ci as loadRemoteModal, Ur as maskedPostValue, D as matchSegments, Kn as matchesAccept, Ri as nextTheme, oi as passwordSatisfies, zr as postedMasked, Rr as rawMasked, _n as readCsrf, Fi as readStoredTheme, Lr as resolveMask, Pi as resolveTheme, Ii as storeTheme, Si as syncSelectAll, Ki as themeKeyframes, yr as toInstant, qi as transitionTheme, qn as validateFile, zi as watchSystemTheme, xn as wuiFetch };