@prometa/sleek 0.0.9 → 0.0.11

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.
@@ -1,12 +1,12 @@
1
- var Pt = Object.defineProperty;
1
+ var qt = Object.defineProperty;
2
2
  var yt = (i) => {
3
3
  throw TypeError(i);
4
4
  };
5
- var qt = (i, t, e) => t in i ? Pt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
6
- var k = (i, t, e) => qt(i, typeof t != "symbol" ? t + "" : t, e), ct = (i, t, e) => t.has(i) || yt("Cannot " + e);
7
- var G = (i, t, e) => (ct(i, t, "read from private field"), e ? e.call(i) : t.get(i)), x = (i, t, e) => t.has(i) ? yt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), j = (i, t, e, n) => (ct(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), P = (i, t, e) => (ct(i, t, "access private method"), e);
8
- import { snakeToCamel as te } from "./chartjs-chart.js";
9
- import { t as ee } from "./utils.js";
5
+ var te = (i, t, e) => t in i ? qt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
6
+ var k = (i, t, e) => te(i, typeof t != "symbol" ? t + "" : t, e), ct = (i, t, e) => t.has(i) || yt("Cannot " + e);
7
+ var B = (i, t, e) => (ct(i, t, "read from private field"), e ? e.call(i) : t.get(i)), x = (i, t, e) => t.has(i) ? yt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), j = (i, t, e, n) => (ct(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), P = (i, t, e) => (ct(i, t, "access private method"), e);
8
+ import { snakeToCamel as ee } from "./chartjs-chart.js";
9
+ import { t as Zt } from "./utils.js";
10
10
  function at(i, t) {
11
11
  i.split(/\s+/).forEach((e) => {
12
12
  t(e);
@@ -117,7 +117,7 @@ function ne(i) {
117
117
  }
118
118
  };
119
119
  }
120
- const lt = (i) => (i = i.filter(Boolean), i.length < 2 ? i[0] || "" : re(i) == 1 ? "[" + i.join("") + "]" : "(?:" + i.join("|") + ")"), St = (i) => {
120
+ const lt = (i) => (i = i.filter(Boolean), i.length < 2 ? i[0] || "" : re(i) == 1 ? "[" + i.join("") + "]" : "(?:" + i.join("|") + ")"), Ft = (i) => {
121
121
  if (!se(i))
122
122
  return i.join("");
123
123
  let t = "", e = 0;
@@ -131,21 +131,21 @@ const lt = (i) => (i = i.filter(Boolean), i.length < 2 ? i[0] || "" : re(i) == 1
131
131
  }
132
132
  n(), t += s, e = 1;
133
133
  }), n(), t;
134
- }, Ft = (i) => {
134
+ }, Kt = (i) => {
135
135
  let t = Array.from(i);
136
136
  return lt(t);
137
- }, se = (i) => new Set(i).size !== i.length, T = (i) => (i + "").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu, "\\$1"), re = (i) => i.reduce((t, e) => Math.max(t, oe(e)), 0), oe = (i) => Array.from(i).length, Kt = (i) => {
137
+ }, se = (i) => new Set(i).size !== i.length, T = (i) => (i + "").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu, "\\$1"), re = (i) => i.reduce((t, e) => Math.max(t, oe(e)), 0), oe = (i) => Array.from(i).length, xt = (i) => {
138
138
  if (i.length === 1)
139
139
  return [[i]];
140
140
  let t = [];
141
141
  const e = i.substring(1);
142
- return Kt(e).forEach(function(s) {
142
+ return xt(e).forEach(function(s) {
143
143
  let o = s.slice(0);
144
144
  o[0] = i.charAt(0) + o[0], t.push(o), o = s.slice(0), o.unshift(i.charAt(0)), t.push(o);
145
145
  }), t;
146
146
  }, le = [[0, 65535]], ce = "[̀-ͯ·ʾʼ]";
147
- let st, xt;
148
- const ae = 3, It = {}, Zt = {
147
+ let st, Dt;
148
+ const ae = 3, It = {}, wt = {
149
149
  "/": "⁄∕",
150
150
  0: "߀",
151
151
  a: "ⱥɐɑ",
@@ -188,8 +188,8 @@ const ae = 3, It = {}, Zt = {
188
188
  z: "ƶȥɀⱬꝣ",
189
189
  hv: "ƕ"
190
190
  };
191
- for (let i in Zt) {
192
- let t = Zt[i] || "";
191
+ for (let i in wt) {
192
+ let t = wt[i] || "";
193
193
  for (let e = 0; e < t.length; e++) {
194
194
  let n = t.substring(e, e + 1);
195
195
  It[n] = i;
@@ -197,14 +197,14 @@ for (let i in Zt) {
197
197
  }
198
198
  const de = new RegExp(Object.keys(It).join("|") + "|" + ce, "gu"), ue = (i) => {
199
199
  st === void 0 && (st = me(le));
200
- }, wt = (i, t = "NFKD") => i.normalize(t), rt = (i) => Array.from(i).reduce(
200
+ }, Lt = (i, t = "NFKD") => i.normalize(t), rt = (i) => Array.from(i).reduce(
201
201
  /**
202
202
  * @param {string} result
203
203
  * @param {string} char
204
204
  */
205
205
  (t, e) => t + ge(e),
206
206
  ""
207
- ), ge = (i) => (i = wt(i).toLowerCase().replace(de, (t) => It[t] || ""), wt(i, "NFC"));
207
+ ), ge = (i) => (i = Lt(i).toLowerCase().replace(de, (t) => It[t] || ""), Lt(i, "NFC"));
208
208
  function* pe(i) {
209
209
  for (const [t, e] of i)
210
210
  for (let n = t; n <= e; n++) {
@@ -214,7 +214,7 @@ function* pe(i) {
214
214
  }
215
215
  const he = (i) => {
216
216
  const t = {}, e = (n, s) => {
217
- const o = t[n] || /* @__PURE__ */ new Set(), r = new RegExp("^" + Ft(o) + "$", "iu");
217
+ const o = t[n] || /* @__PURE__ */ new Set(), r = new RegExp("^" + Kt(o) + "$", "iu");
218
218
  s.match(r) || (o.add(T(s)), t[n] = o);
219
219
  };
220
220
  for (let n of pe(i))
@@ -225,22 +225,22 @@ const he = (i) => {
225
225
  let n = [];
226
226
  for (let o in t) {
227
227
  let r = t[o];
228
- r && (e[o] = Ft(r)), o.length > 1 && n.push(T(o));
228
+ r && (e[o] = Kt(r)), o.length > 1 && n.push(T(o));
229
229
  }
230
230
  n.sort((o, r) => r.length - o.length);
231
231
  const s = lt(n);
232
- return xt = new RegExp("^" + s, "u"), e;
232
+ return Dt = new RegExp("^" + s, "u"), e;
233
233
  }, fe = (i, t = 1) => {
234
234
  let e = 0;
235
- return i = i.map((n) => (st[n] && (e += n.length), st[n] || n)), e >= t ? St(i) : "";
236
- }, be = (i, t = 1) => (t = Math.max(t, i.length - 1), lt(Kt(i).map((e) => fe(e, t)))), Lt = (i, t = !0) => {
235
+ return i = i.map((n) => (st[n] && (e += n.length), st[n] || n)), e >= t ? Ft(i) : "";
236
+ }, be = (i, t = 1) => (t = Math.max(t, i.length - 1), lt(xt(i).map((e) => fe(e, t)))), Wt = (i, t = !0) => {
237
237
  let e = i.length > 1 ? 1 : 0;
238
238
  return lt(i.map((n) => {
239
239
  let s = [];
240
240
  const o = t ? n.length() : n.length() - 1;
241
241
  for (let r = 0; r < o; r++)
242
242
  s.push(be(n.substrs[r] || "", e));
243
- return St(s);
243
+ return Ft(s);
244
244
  }));
245
245
  }, ve = (i, t) => {
246
246
  for (const e of t) {
@@ -290,7 +290,7 @@ const Ie = (i) => {
290
290
  ue(), i = rt(i);
291
291
  let t = "", e = [new ot()];
292
292
  for (let n = 0; n < i.length; n++) {
293
- let o = i.substring(n).match(xt);
293
+ let o = i.substring(n).match(Dt);
294
294
  const r = i.substring(n, n + 1), l = o ? o[0] : null;
295
295
  let a = [], c = /* @__PURE__ */ new Set();
296
296
  for (const u of e) {
@@ -315,13 +315,13 @@ const Ie = (i) => {
315
315
  continue;
316
316
  }
317
317
  if (n > 0 && c.size == 1 && !c.has("3")) {
318
- t += Lt(e, !1);
318
+ t += Wt(e, !1);
319
319
  let u = new ot();
320
320
  const d = e[0];
321
321
  d && u.add(d.last()), e = [u];
322
322
  }
323
323
  }
324
- return t += Lt(e, !0), t;
324
+ return t += Wt(e, !0), t;
325
325
  }, Ce = (i, t) => {
326
326
  if (i)
327
327
  return i[t];
@@ -529,7 +529,7 @@ const H = (i) => typeof i > "u" || i === null ? null : nt(i), nt = (i) => typeof
529
529
  e = null, o.loadedSearches[n] = !0, i.call(o, n, s);
530
530
  }, t);
531
531
  };
532
- }, Wt = (i, t, e) => {
532
+ }, Gt = (i, t, e) => {
533
533
  var n, s = i.trigger, o = {};
534
534
  i.trigger = function() {
535
535
  var r = arguments[0];
@@ -555,56 +555,56 @@ const H = (i) => typeof i > "u" || i === null ? null : nt(i), nt = (i) => typeof
555
555
  }, pt = (i, t) => {
556
556
  const e = i.getAttribute("id");
557
557
  return e || (i.setAttribute("id", t), t);
558
- }, Gt = (i) => i.replace(/[\\"']/g, "\\$&"), F = (i, t) => {
558
+ }, At = (i) => i.replace(/[\\"']/g, "\\$&"), F = (i, t) => {
559
559
  t && i.append(t);
560
- }, A = (i, t) => {
560
+ }, G = (i, t) => {
561
561
  if (Array.isArray(i))
562
562
  i.forEach(t);
563
563
  else
564
564
  for (var e in i)
565
565
  i.hasOwnProperty(e) && t(i[e], e);
566
- }, R = (i) => {
566
+ }, M = (i) => {
567
567
  if (i.jquery)
568
568
  return i[0];
569
569
  if (i instanceof HTMLElement)
570
570
  return i;
571
- if (Dt(i)) {
571
+ if (_t(i)) {
572
572
  var t = document.createElement("template");
573
573
  return t.innerHTML = i.trim(), t.content.firstChild;
574
574
  }
575
575
  return document.querySelector(i);
576
- }, Dt = (i) => typeof i == "string" && i.indexOf("<") > -1, Ae = (i) => i.replace(/['"\\]/g, "\\$&"), ht = (i, t) => {
576
+ }, _t = (i) => typeof i == "string" && i.indexOf("<") > -1, Ae = (i) => i.replace(/['"\\]/g, "\\$&"), ht = (i, t) => {
577
577
  var e = document.createEvent("HTMLEvents");
578
578
  e.initEvent(t, !0, !1), i.dispatchEvent(e);
579
579
  }, tt = (i, t) => {
580
580
  Object.assign(i.style, t);
581
581
  }, J = (i, ...t) => {
582
- var e = _t(t);
583
- i = jt(i), i.map((n) => {
582
+ var e = jt(t);
583
+ i = Tt(i), i.map((n) => {
584
584
  e.map((s) => {
585
585
  n.classList.add(s);
586
586
  });
587
587
  });
588
588
  }, V = (i, ...t) => {
589
- var e = _t(t);
590
- i = jt(i), i.map((n) => {
589
+ var e = jt(t);
590
+ i = Tt(i), i.map((n) => {
591
591
  e.map((s) => {
592
592
  n.classList.remove(s);
593
593
  });
594
594
  });
595
- }, _t = (i) => {
595
+ }, jt = (i) => {
596
596
  var t = [];
597
- return A(i, (e) => {
597
+ return G(i, (e) => {
598
598
  typeof e == "string" && (e = e.trim().split(/[\t\n\f\r\s]/)), Array.isArray(e) && (t = t.concat(e));
599
599
  }), t.filter(Boolean);
600
- }, jt = (i) => (Array.isArray(i) || (i = [i]), i), mt = (i, t, e) => {
600
+ }, Tt = (i) => (Array.isArray(i) || (i = [i]), i), mt = (i, t, e) => {
601
601
  if (!(e && !e.contains(i)))
602
602
  for (; i && i.matches; ) {
603
603
  if (i.matches(t))
604
604
  return i;
605
605
  i = i.parentNode;
606
606
  }
607
- }, At = (i, t = 0) => t > 0 ? i[i.length - 1] : i[0], Be = (i) => Object.keys(i).length === 0, Bt = (i, t) => {
607
+ }, Bt = (i, t = 0) => t > 0 ? i[i.length - 1] : i[0], Be = (i) => Object.keys(i).length === 0, Xt = (i, t) => {
608
608
  if (!i)
609
609
  return -1;
610
610
  t = t || i.nodeName;
@@ -612,7 +612,7 @@ const H = (i) => typeof i > "u" || i === null ? null : nt(i), nt = (i) => typeof
612
612
  i.matches(t) && e++;
613
613
  return e;
614
614
  }, w = (i, t) => {
615
- A(t, (e, n) => {
615
+ G(t, (e, n) => {
616
616
  e == null ? i.removeAttribute(n) : i.setAttribute(n, "" + e);
617
617
  });
618
618
  }, bt = (i, t) => {
@@ -648,7 +648,7 @@ const H = (i) => typeof i > "u" || i === null ? null : nt(i), nt = (i) => typeof
648
648
  var n = e.parentNode;
649
649
  n.replaceChild(e.firstChild, e), n.normalize();
650
650
  });
651
- }, Je = 65, He = 13, Oe = 27, Me = 37, Re = 38, Ne = 39, Ve = 40, Xt = 8, ze = 46, Yt = 9, ke = typeof navigator > "u" ? !1 : /Mac/.test(navigator.userAgent), et = ke ? "metaKey" : "ctrlKey", Jt = {
651
+ }, Je = 65, He = 13, Oe = 27, Me = 37, Re = 38, Ne = 39, Ve = 40, Yt = 8, ze = 46, Jt = 9, ke = typeof navigator > "u" ? !1 : /Mac/.test(navigator.userAgent), et = ke ? "metaKey" : "ctrlKey", Ht = {
652
652
  options: [],
653
653
  optgroups: [],
654
654
  plugins: [],
@@ -731,8 +731,8 @@ const H = (i) => typeof i > "u" || i === null ? null : nt(i), nt = (i) => typeof
731
731
  */
732
732
  }
733
733
  };
734
- function Ht(i, t) {
735
- var e = Object.assign({}, Jt, t), n = e.dataAttr, s = e.labelField, o = e.valueField, r = e.disabledField, l = e.optgroupField, a = e.optgroupLabelField, c = e.optgroupValueField, u = i.tagName.toLowerCase(), d = i.getAttribute("placeholder") || i.getAttribute("data-placeholder");
734
+ function Ot(i, t) {
735
+ var e = Object.assign({}, Ht, t), n = e.dataAttr, s = e.labelField, o = e.valueField, r = e.disabledField, l = e.optgroupField, a = e.optgroupLabelField, c = e.optgroupValueField, u = i.tagName.toLowerCase(), d = i.getAttribute("placeholder") || i.getAttribute("data-placeholder");
736
736
  if (!d && !e.allowEmptyOption) {
737
737
  let b = i.querySelector('option[value=""]');
738
738
  b && (d = b.textContent);
@@ -746,7 +746,7 @@ function Ht(i, t) {
746
746
  }, y = () => {
747
747
  var b, Z = p.options, I = {}, h = 1;
748
748
  let L = 0;
749
- var M = (f) => {
749
+ var O = (f) => {
750
750
  var v = Object.assign({}, f.dataset), m = n && v[n];
751
751
  return typeof m == "string" && m.length && (v = Object.assign(v, JSON.parse(m))), v;
752
752
  }, E = (f, v) => {
@@ -754,28 +754,28 @@ function Ht(i, t) {
754
754
  if (m != null && !(!m && !e.allowEmptyOption)) {
755
755
  if (I.hasOwnProperty(m)) {
756
756
  if (v) {
757
- var B = I[m][l];
758
- B ? Array.isArray(B) ? B.push(v) : I[m][l] = [B, v] : I[m][l] = v;
757
+ var A = I[m][l];
758
+ A ? Array.isArray(A) ? A.push(v) : I[m][l] = [A, v] : I[m][l] = v;
759
759
  }
760
760
  } else {
761
- var C = M(f);
761
+ var C = O(f);
762
762
  C[s] = C[s] || f.textContent, C[o] = C[o] || m, C[r] = C[r] || f.disabled, C[l] = C[l] || v, C.$option = f, C.$order = C.$order || ++L, I[m] = C, Z.push(C);
763
763
  }
764
764
  f.selected && p.items.push(m);
765
765
  }
766
766
  }, K = (f) => {
767
767
  var v, m;
768
- m = M(f), m[a] = m[a] || f.getAttribute("label") || "", m[c] = m[c] || h++, m[r] = m[r] || f.disabled, m.$order = m.$order || ++L, p.optgroups.push(m), v = m[c], A(f.children, (B) => {
769
- E(B, v);
768
+ m = O(f), m[a] = m[a] || f.getAttribute("label") || "", m[c] = m[c] || h++, m[r] = m[r] || f.disabled, m.$order = m.$order || ++L, p.optgroups.push(m), v = m[c], G(f.children, (A) => {
769
+ E(A, v);
770
770
  });
771
771
  };
772
- p.maxItems = i.hasAttribute("multiple") ? null : 1, A(i.children, (f) => {
772
+ p.maxItems = i.hasAttribute("multiple") ? null : 1, G(i.children, (f) => {
773
773
  b = f.tagName.toLowerCase(), b === "optgroup" ? K(f) : b === "option" && E(f);
774
774
  });
775
775
  }, g = () => {
776
776
  const b = i.getAttribute(n);
777
777
  if (b)
778
- p.options = JSON.parse(b), A(p.options, (I) => {
778
+ p.options = JSON.parse(b), G(p.options, (I) => {
779
779
  p.items.push(I[o]);
780
780
  });
781
781
  else {
@@ -783,37 +783,37 @@ function Ht(i, t) {
783
783
  if (!e.allowEmptyOption && !Z.length)
784
784
  return;
785
785
  const I = Z.split(e.delimiter);
786
- A(I, (h) => {
786
+ G(I, (h) => {
787
787
  const L = {};
788
788
  L[s] = h, L[o] = h, p.options.push(L);
789
789
  }), p.items = I;
790
790
  }
791
791
  };
792
- return u === "select" ? y() : g(), Object.assign({}, Jt, p, t);
792
+ return u === "select" ? y() : g(), Object.assign({}, Ht, p, t);
793
793
  }
794
- var Ot = 0;
794
+ var Mt = 0;
795
795
  class Y extends ne(ie) {
796
796
  constructor(t, e) {
797
- super(), this.order = 0, this.isOpen = !1, this.isDisabled = !1, this.isReadOnly = !1, this.isInvalid = !1, this.isValid = !0, this.isLocked = !1, this.isFocused = !1, this.isInputHidden = !1, this.isSetup = !1, this.ignoreFocus = !1, this.ignoreHover = !1, this.hasOptions = !1, this.lastValue = "", this.caretPos = 0, this.loading = 0, this.loadedSearches = {}, this.activeOption = null, this.activeItems = [], this.optgroups = {}, this.options = {}, this.userOptions = {}, this.items = [], this.refreshTimeout = null, Ot++;
798
- var n, s = R(t);
797
+ super(), this.order = 0, this.isOpen = !1, this.isDisabled = !1, this.isReadOnly = !1, this.isInvalid = !1, this.isValid = !0, this.isLocked = !1, this.isFocused = !1, this.isInputHidden = !1, this.isSetup = !1, this.ignoreFocus = !1, this.ignoreHover = !1, this.hasOptions = !1, this.lastValue = "", this.caretPos = 0, this.loading = 0, this.loadedSearches = {}, this.activeOption = null, this.activeItems = [], this.optgroups = {}, this.options = {}, this.userOptions = {}, this.items = [], this.refreshTimeout = null, Mt++;
798
+ var n, s = M(t);
799
799
  if (s.tomselect)
800
800
  throw new Error("Tom Select already initialized on this element");
801
801
  s.tomselect = this;
802
802
  var o = window.getComputedStyle && window.getComputedStyle(s, null);
803
803
  n = o.getPropertyValue("direction");
804
- const r = Ht(s, e);
805
- this.settings = r, this.input = s, this.tabIndex = s.tabIndex || 0, this.is_select_tag = s.tagName.toLowerCase() === "select", this.rtl = /rtl/i.test(n), this.inputId = pt(s, "tomselect-" + Ot), this.isRequired = s.required, this.sifter = new we(this.options, { diacritics: r.diacritics }), r.mode = r.mode || (r.maxItems === 1 ? "single" : "multi"), typeof r.hideSelected != "boolean" && (r.hideSelected = r.mode === "multi"), typeof r.hidePlaceholder != "boolean" && (r.hidePlaceholder = r.mode !== "multi");
804
+ const r = Ot(s, e);
805
+ this.settings = r, this.input = s, this.tabIndex = s.tabIndex || 0, this.is_select_tag = s.tagName.toLowerCase() === "select", this.rtl = /rtl/i.test(n), this.inputId = pt(s, "tomselect-" + Mt), this.isRequired = s.required, this.sifter = new we(this.options, { diacritics: r.diacritics }), r.mode = r.mode || (r.maxItems === 1 ? "single" : "multi"), typeof r.hideSelected != "boolean" && (r.hideSelected = r.mode === "multi"), typeof r.hidePlaceholder != "boolean" && (r.hidePlaceholder = r.mode !== "multi");
806
806
  var l = r.createFilter;
807
807
  typeof l != "function" && (typeof l == "string" && (l = new RegExp(l)), l instanceof RegExp ? r.createFilter = (Z) => l.test(Z) : r.createFilter = (Z) => this.settings.duplicates || !this.options[Z]), this.initializePlugins(r.plugins), this.setupCallbacks(), this.setupTemplates();
808
- const a = R("<div>"), c = R("<div>"), u = this._render("dropdown"), d = R('<div role="listbox" tabindex="-1">'), p = this.input.getAttribute("class") || "", y = r.mode;
808
+ const a = M("<div>"), c = M("<div>"), u = this._render("dropdown"), d = M('<div role="listbox" tabindex="-1">'), p = this.input.getAttribute("class") || "", y = r.mode;
809
809
  var g;
810
- if (J(a, r.wrapperClass, p, y), J(c, r.controlClass), F(a, c), J(u, r.dropdownClass, y), r.copyClassesToDropdown && J(u, p), J(d, r.dropdownContentClass), F(u, d), R(r.dropdownParent || a).appendChild(u), Dt(r.controlInput)) {
811
- g = R(r.controlInput);
810
+ if (J(a, r.wrapperClass, p, y), J(c, r.controlClass), F(a, c), J(u, r.dropdownClass, y), r.copyClassesToDropdown && J(u, p), J(d, r.dropdownContentClass), F(u, d), M(r.dropdownParent || a).appendChild(u), _t(r.controlInput)) {
811
+ g = M(r.controlInput);
812
812
  var b = ["autocorrect", "autocapitalize", "autocomplete", "spellcheck"];
813
- A(b, (Z) => {
813
+ G(b, (Z) => {
814
814
  s.getAttribute(Z) && w(g, { [Z]: s.getAttribute(Z) });
815
815
  }), g.tabIndex = -1, c.appendChild(g), this.focus_node = g;
816
- } else r.controlInput ? (g = R(r.controlInput), this.focus_node = g) : (g = R("<input/>"), this.focus_node = c);
816
+ } else r.controlInput ? (g = M(r.controlInput), this.focus_node = g) : (g = M("<input/>"), this.focus_node = c);
817
817
  this.wrapper = a, this.dropdown = u, this.dropdown_content = d, this.control = c, this.control_input = g, this.setup();
818
818
  }
819
819
  /**
@@ -880,7 +880,7 @@ class Y extends ne(ie) {
880
880
  *
881
881
  */
882
882
  setupOptions(t = [], e = []) {
883
- this.addOptions(t), A(e, (n) => {
883
+ this.addOptions(t), G(e, (n) => {
884
884
  this.registerOptionGroup(n);
885
885
  });
886
886
  }
@@ -938,7 +938,7 @@ class Y extends ne(ie) {
938
938
  *
939
939
  */
940
940
  sync(t = !0) {
941
- const e = this, n = t ? Ht(e.input, { delimiter: e.settings.delimiter }) : e.settings;
941
+ const e = this, n = t ? Ot(e.input, { delimiter: e.settings.delimiter }) : e.settings;
942
942
  e.setupOptions(n.options, n.optgroups), e.setValue(n.items || [], !0), e.lastQuery = null;
943
943
  }
944
944
  /**
@@ -982,7 +982,7 @@ class Y extends ne(ie) {
982
982
  var n = e.inputValue();
983
983
  if (n.match(e.settings.splitOn)) {
984
984
  var s = n.trim().split(e.settings.splitOn);
985
- A(s, (o) => {
985
+ G(s, (o) => {
986
986
  H(o) && (this.options[o] ? e.addItem(o) : e.createItem(o));
987
987
  });
988
988
  }
@@ -1011,7 +1011,7 @@ class Y extends ne(ie) {
1011
1011
  onKeyDown(t) {
1012
1012
  var e = this;
1013
1013
  if (e.ignoreHover = !0, e.isLocked) {
1014
- t.keyCode !== Yt && W(t);
1014
+ t.keyCode !== Jt && W(t);
1015
1015
  return;
1016
1016
  }
1017
1017
  switch (t.keyCode) {
@@ -1057,11 +1057,11 @@ class Y extends ne(ie) {
1057
1057
  e.advanceSelection(1, t);
1058
1058
  return;
1059
1059
  // tab: select active option and/or create item
1060
- case Yt:
1060
+ case Jt:
1061
1061
  e.settings.selectOnTab && (e.canSelect(e.activeOption) && (e.onOptionSelect(t, e.activeOption), W(t)), e.settings.create && e.createItem() && W(t));
1062
1062
  return;
1063
1063
  // delete|backspace: delete items
1064
- case Xt:
1064
+ case Yt:
1065
1065
  case ze:
1066
1066
  e.deleteSelection(t);
1067
1067
  return;
@@ -1220,7 +1220,7 @@ class Y extends ne(ie) {
1220
1220
  */
1221
1221
  setValue(t, e) {
1222
1222
  var n = e ? [] : ["change"];
1223
- Wt(this, n, () => {
1223
+ Gt(this, n, () => {
1224
1224
  this.clear(e), this.addItems(t, e);
1225
1225
  });
1226
1226
  }
@@ -1314,7 +1314,7 @@ class Y extends ne(ie) {
1314
1314
  if (t.settings.mode === "single")
1315
1315
  return;
1316
1316
  const e = t.controlChildren();
1317
- e.length && (t.inputState(), t.close(), t.activeItems = e, A(e, (n) => {
1317
+ e.length && (t.inputState(), t.close(), t.activeItems = e, G(e, (n) => {
1318
1318
  t.setActiveItemClass(n);
1319
1319
  }));
1320
1320
  }
@@ -1398,7 +1398,7 @@ class Y extends ne(ie) {
1398
1398
  const p = {}, y = [];
1399
1399
  var g = this, b = g.inputValue();
1400
1400
  const Z = b === g.lastQuery || b == "" && g.lastQuery == null;
1401
- var I = g.search(b), h = null, L = g.settings.shouldOpen || !1, M = g.dropdown_content;
1401
+ var I = g.search(b), h = null, L = g.settings.shouldOpen || !1, O = g.dropdown_content;
1402
1402
  Z && (h = g.activeOption, h && (u = h.closest("[data-group]"))), o = I.items.length, typeof g.settings.maxOptions == "number" && (o = Math.min(o, g.settings.maxOptions)), o > 0 && (L = !0);
1403
1403
  const E = (f, v) => {
1404
1404
  let m = p[f];
@@ -1407,8 +1407,8 @@ class Y extends ne(ie) {
1407
1407
  if (C !== void 0)
1408
1408
  return [m, C.fragment];
1409
1409
  }
1410
- let B = document.createDocumentFragment();
1411
- return m = y.length, y.push({ fragment: B, order: v, optgroup: f }), [m, B];
1410
+ let A = document.createDocumentFragment();
1411
+ return m = y.length, y.push({ fragment: A, order: v, optgroup: f }), [m, A];
1412
1412
  };
1413
1413
  for (e = 0; e < o; e++) {
1414
1414
  let f = I.items[e];
@@ -1417,37 +1417,37 @@ class Y extends ne(ie) {
1417
1417
  let v = f.id, m = g.options[v];
1418
1418
  if (m === void 0)
1419
1419
  continue;
1420
- let B = nt(v), C = g.getOption(B, !0);
1421
- for (g.settings.hideSelected || C.classList.toggle("selected", g.items.includes(B)), r = m[g.settings.optgroupField] || "", l = Array.isArray(r) ? r : [r], n = 0, s = l && l.length; n < s; n++) {
1420
+ let A = nt(v), C = g.getOption(A, !0);
1421
+ for (g.settings.hideSelected || C.classList.toggle("selected", g.items.includes(A)), r = m[g.settings.optgroupField] || "", l = Array.isArray(r) ? r : [r], n = 0, s = l && l.length; n < s; n++) {
1422
1422
  r = l[n];
1423
1423
  let U = m.$order, $ = g.optgroups[r];
1424
1424
  $ === void 0 ? r = "" : U = $.$order;
1425
- const [Ut, $t] = E(r, U);
1426
- n > 0 && (C = C.cloneNode(!0), w(C, { id: m.$id + "-clone-" + n, "aria-selected": null }), C.classList.add("ts-cloned"), V(C, "active"), g.activeOption && g.activeOption.dataset.value == v && u && u.dataset.group === r.toString() && (h = C)), $t.appendChild(C), r != "" && (p[r] = Ut);
1425
+ const [$t, Pt] = E(r, U);
1426
+ n > 0 && (C = C.cloneNode(!0), w(C, { id: m.$id + "-clone-" + n, "aria-selected": null }), C.classList.add("ts-cloned"), V(C, "active"), g.activeOption && g.activeOption.dataset.value == v && u && u.dataset.group === r.toString() && (h = C)), Pt.appendChild(C), r != "" && (p[r] = $t);
1427
1427
  }
1428
1428
  }
1429
- g.settings.lockOptgroupOrder && y.sort((f, v) => f.order - v.order), a = document.createDocumentFragment(), A(y, (f) => {
1429
+ g.settings.lockOptgroupOrder && y.sort((f, v) => f.order - v.order), a = document.createDocumentFragment(), G(y, (f) => {
1430
1430
  let v = f.fragment, m = f.optgroup;
1431
1431
  if (!v || !v.children.length)
1432
1432
  return;
1433
- let B = g.optgroups[m];
1434
- if (B !== void 0) {
1435
- let C = document.createDocumentFragment(), U = g.render("optgroup_header", B);
1433
+ let A = g.optgroups[m];
1434
+ if (A !== void 0) {
1435
+ let C = document.createDocumentFragment(), U = g.render("optgroup_header", A);
1436
1436
  F(C, U), F(C, v);
1437
- let $ = g.render("optgroup", { group: B, options: C });
1437
+ let $ = g.render("optgroup", { group: A, options: C });
1438
1438
  F(a, $);
1439
1439
  } else
1440
1440
  F(a, v);
1441
- }), M.innerHTML = "", F(M, a), g.settings.highlight && (Ye(M), I.query.length && I.tokens.length && A(I.tokens, (f) => {
1442
- Xe(M, f.regex);
1441
+ }), O.innerHTML = "", F(O, a), g.settings.highlight && (Ye(O), I.query.length && I.tokens.length && G(I.tokens, (f) => {
1442
+ Xe(O, f.regex);
1443
1443
  }));
1444
1444
  var K = (f) => {
1445
1445
  let v = g.render(f, { input: b });
1446
- return v && (L = !0, M.insertBefore(v, M.firstChild)), v;
1446
+ return v && (L = !0, O.insertBefore(v, O.firstChild)), v;
1447
1447
  };
1448
1448
  if (g.loading ? K("loading") : g.settings.shouldLoad.call(g, b) ? I.items.length === 0 && K("no_results") : K("not_loading"), c = g.canCreate(b), c && (d = K("option_create")), g.hasOptions = I.items.length > 0 || c, L) {
1449
1449
  if (I.items.length > 0) {
1450
- if (!h && g.settings.mode === "single" && g.items[0] != null && (h = g.getOption(g.items[0])), !M.contains(h)) {
1450
+ if (!h && g.settings.mode === "single" && g.items[0] != null && (h = g.getOption(g.items[0])), !O.contains(h)) {
1451
1451
  let f = 0;
1452
1452
  d && !g.settings.addPrecedence && (f = 1), h = g.selectable()[f];
1453
1453
  }
@@ -1486,7 +1486,7 @@ class Y extends ne(ie) {
1486
1486
  *
1487
1487
  */
1488
1488
  addOptions(t, e = !1) {
1489
- A(t, (n) => {
1489
+ G(t, (n) => {
1490
1490
  this.addOption(n, e);
1491
1491
  });
1492
1492
  }
@@ -1569,7 +1569,7 @@ class Y extends ne(ie) {
1569
1569
  const e = (t || this.clearFilter).bind(this);
1570
1570
  this.loadedSearches = {}, this.userOptions = {}, this.clearCache();
1571
1571
  const n = {};
1572
- A(this.options, (s, o) => {
1572
+ G(this.options, (s, o) => {
1573
1573
  e(s, o) && (n[o] = s);
1574
1574
  }), this.options = this.sifter.items = n, this.lastQuery = null, this.trigger("option_clear");
1575
1575
  }
@@ -1623,7 +1623,7 @@ class Y extends ne(ie) {
1623
1623
  if (typeof t == "object")
1624
1624
  return t;
1625
1625
  var e = H(t);
1626
- return e !== null ? this.control.querySelector(`[data-value="${Gt(e)}"]`) : null;
1626
+ return e !== null ? this.control.querySelector(`[data-value="${At(e)}"]`) : null;
1627
1627
  }
1628
1628
  /**
1629
1629
  * "Selects" multiple items at once. Adds them to the list
@@ -1645,7 +1645,7 @@ class Y extends ne(ie) {
1645
1645
  */
1646
1646
  addItem(t, e) {
1647
1647
  var n = e ? [] : ["change", "dropdown_close"];
1648
- Wt(this, n, () => {
1648
+ Gt(this, n, () => {
1649
1649
  var s, o;
1650
1650
  const r = this, l = r.settings.mode, a = H(t);
1651
1651
  if (!(a && r.items.indexOf(a) !== -1 && (l === "single" && r.close(), l === "single" || !r.settings.duplicates)) && !(a === null || !r.options.hasOwnProperty(a)) && (l === "single" && r.clear(e), !(l === "multi" && r.isFull()))) {
@@ -1671,7 +1671,7 @@ class Y extends ne(ie) {
1671
1671
  return;
1672
1672
  var s, o;
1673
1673
  const r = t.dataset.value;
1674
- s = Bt(t), t.remove(), t.classList.contains("active") && (o = n.activeItems.indexOf(t), n.activeItems.splice(o, 1), V(t, "active")), n.items.splice(s, 1), n.lastQuery = null, !n.settings.persist && n.userOptions.hasOwnProperty(r) && n.removeOption(r, e), s < n.caretPos && n.setCaret(n.caretPos - 1), n.updateOriginalInput({ silent: e }), n.refreshState(), n.positionDropdown(), n.trigger("item_remove", r, t);
1674
+ s = Xt(t), t.remove(), t.classList.contains("active") && (o = n.activeItems.indexOf(t), n.activeItems.splice(o, 1), V(t, "active")), n.items.splice(s, 1), n.lastQuery = null, !n.settings.persist && n.userOptions.hasOwnProperty(r) && n.removeOption(r, e), s < n.caretPos && n.setCaret(n.caretPos - 1), n.updateOriginalInput({ silent: e }), n.refreshState(), n.positionDropdown(), n.trigger("item_remove", r, t);
1675
1675
  }
1676
1676
  /**
1677
1677
  * Invokes the `create` method provided in the
@@ -1754,14 +1754,14 @@ class Y extends ne(ie) {
1754
1754
  const o = e.input.querySelector('option[value=""]');
1755
1755
  if (e.is_select_tag) {
1756
1756
  let a = function(c, u, d) {
1757
- return c || (c = R('<option value="' + gt(u) + '">' + gt(d) + "</option>")), c != o && e.input.append(c), r.push(c), (c != o || l > 0) && (c.selected = !0), c;
1757
+ return c || (c = M('<option value="' + gt(u) + '">' + gt(d) + "</option>")), c != o && e.input.append(c), r.push(c), (c != o || l > 0) && (c.selected = !0), c;
1758
1758
  };
1759
1759
  const r = [], l = e.input.querySelectorAll("option:checked").length;
1760
1760
  e.input.querySelectorAll("option:checked").forEach((c) => {
1761
1761
  c.selected = !1;
1762
1762
  }), e.items.length == 0 && e.settings.mode == "single" ? a(o, "", "") : e.items.forEach((c) => {
1763
1763
  if (n = e.options[c], s = n[e.settings.labelField] || "", r.includes(n.$option)) {
1764
- const u = e.input.querySelector(`option[value="${Gt(c)}"]:not(:checked)`);
1764
+ const u = e.input.querySelector(`option[value="${At(c)}"]:not(:checked)`);
1765
1765
  a(u, c, s);
1766
1766
  } else
1767
1767
  n.$option = a(n.$option, c, s);
@@ -1809,7 +1809,7 @@ class Y extends ne(ie) {
1809
1809
  var e = this;
1810
1810
  if (e.items.length) {
1811
1811
  var n = e.controlChildren();
1812
- A(n, (s) => {
1812
+ G(n, (s) => {
1813
1813
  e.removeItem(s, !0);
1814
1814
  }), e.inputState(), t || e.updateOriginalInput(), e.trigger("clear");
1815
1815
  }
@@ -1829,10 +1829,10 @@ class Y extends ne(ie) {
1829
1829
  */
1830
1830
  deleteSelection(t) {
1831
1831
  var e, n, s, o, r = this;
1832
- e = t && t.keyCode === Xt ? -1 : 1, n = Ge(r.control_input);
1832
+ e = t && t.keyCode === Yt ? -1 : 1, n = Ge(r.control_input);
1833
1833
  const l = [];
1834
1834
  if (r.activeItems.length)
1835
- o = At(r.activeItems, e), s = Bt(o), e > 0 && s++, A(r.activeItems, (a) => l.push(a));
1835
+ o = Bt(r.activeItems, e), s = Xt(o), e > 0 && s++, G(r.activeItems, (a) => l.push(a));
1836
1836
  else if ((r.isFocused || r.settings.mode === "single") && r.items.length) {
1837
1837
  const a = r.controlChildren();
1838
1838
  let c;
@@ -1874,7 +1874,7 @@ class Y extends ne(ie) {
1874
1874
  return e;
1875
1875
  var n = this.control.querySelectorAll(".active");
1876
1876
  if (n)
1877
- return At(n, t);
1877
+ return Bt(n, t);
1878
1878
  }
1879
1879
  /**
1880
1880
  * Moves the caret to the specified index.
@@ -1952,7 +1952,7 @@ class Y extends ne(ie) {
1952
1952
  const o = this;
1953
1953
  if (typeof this.settings.render[t] != "function" || (s = o.settings.render[t].call(this, e, gt), !s))
1954
1954
  return null;
1955
- if (s = R(s), t === "option" || t === "option_create" ? e[o.settings.disabledField] ? w(s, { "aria-disabled": "true" }) : w(s, { "data-selectable": "" }) : t === "optgroup" && (n = e.group[o.settings.optgroupValueField], w(s, { "data-group": n }), e.group[o.settings.disabledField] && w(s, { "data-disabled": "" })), t === "option" || t === "item") {
1955
+ if (s = M(s), t === "option" || t === "option_create" ? e[o.settings.disabledField] ? w(s, { "aria-disabled": "true" }) : w(s, { "data-selectable": "" }) : t === "optgroup" && (n = e.group[o.settings.optgroupValueField], w(s, { "data-group": n }), e.group[o.settings.disabledField] && w(s, { "data-disabled": "" })), t === "option" || t === "item") {
1956
1956
  const r = nt(e[o.settings.valueField]);
1957
1957
  w(s, { "data-value": r }), t === "item" ? (J(s, o.settings.itemClass), w(s, { "data-ts-item": "" })) : (J(s, o.settings.optionClass), w(s, {
1958
1958
  role: "option",
@@ -1978,7 +1978,7 @@ class Y extends ne(ie) {
1978
1978
  *
1979
1979
  */
1980
1980
  clearCache() {
1981
- A(this.options, (t) => {
1981
+ G(this.options, (t) => {
1982
1982
  t.$div && (t.$div.remove(), delete t.$div);
1983
1983
  });
1984
1984
  }
@@ -2021,7 +2021,7 @@ function Fe() {
2021
2021
  this.sync();
2022
2022
  });
2023
2023
  }
2024
- const Ke = (i) => typeof i > "u" || i === null ? null : xe(i), xe = (i) => typeof i == "boolean" ? i ? "1" : "0" : i + "", Mt = (i, t = !1) => {
2024
+ const Ke = (i) => typeof i > "u" || i === null ? null : xe(i), xe = (i) => typeof i == "boolean" ? i ? "1" : "0" : i + "", Rt = (i, t = !1) => {
2025
2025
  i && (i.preventDefault(), t && i.stopPropagation());
2026
2026
  }, De = (i) => {
2027
2027
  if (i.jquery)
@@ -2057,7 +2057,7 @@ function je(i) {
2057
2057
  t.settings.render.option = (l, a) => {
2058
2058
  var c = De(r.call(t, l, a)), u = document.createElement("input");
2059
2059
  n.className && u.classList.add(n.className), u.addEventListener("click", function(p) {
2060
- Mt(p);
2060
+ Rt(p);
2061
2061
  }), u.type = "checkbox";
2062
2062
  const d = Ke(l[t.settings.valueField]);
2063
2063
  return s(u, !!(d && t.items.indexOf(d) > -1)), c.prepend(u), c;
@@ -2070,7 +2070,7 @@ function je(i) {
2070
2070
  l && o(l);
2071
2071
  }), t.hook("instead", "onOptionSelect", (r, l) => {
2072
2072
  if (l.classList.contains("selected")) {
2073
- l.classList.remove("selected"), t.removeItem(l.dataset.value), t.refreshOptions(), Mt(r, !0);
2073
+ l.classList.remove("selected"), t.removeItem(l.dataset.value), t.refreshOptions(), Rt(r, !0);
2074
2074
  return;
2075
2075
  }
2076
2076
  e.call(t, r, l), o(l);
@@ -2257,7 +2257,7 @@ const mi = 27, fi = 9, bi = (i, t = !1) => {
2257
2257
  else
2258
2258
  for (var e in i)
2259
2259
  i.hasOwnProperty(e) && t(i[e], e);
2260
- }, Rt = (i) => {
2260
+ }, Nt = (i) => {
2261
2261
  if (i.jquery)
2262
2262
  return i[0];
2263
2263
  if (i instanceof HTMLElement)
@@ -2284,9 +2284,9 @@ function Li() {
2284
2284
  const i = this;
2285
2285
  i.settings.shouldOpen = !0, i.hook("before", "setup", () => {
2286
2286
  i.focus_node = i.control, yi(i.control_input, "dropdown-input");
2287
- const t = Rt('<div class="dropdown-input-wrap">');
2287
+ const t = Nt('<div class="dropdown-input-wrap">');
2288
2288
  t.append(i.control_input), i.dropdown.insertBefore(t, i.dropdown.firstChild);
2289
- const e = Rt('<input class="items-placeholder" tabindex="-1" />');
2289
+ const e = Nt('<input class="items-placeholder" tabindex="-1" />');
2290
2290
  e.placeholder = i.settings.placeholder || "", i.control.append(e);
2291
2291
  }), i.on("initialize", () => {
2292
2292
  i.control_input.addEventListener("keydown", (e) => {
@@ -2341,7 +2341,7 @@ function Ai() {
2341
2341
  }), this.hook("instead", "selectAll", () => {
2342
2342
  });
2343
2343
  }
2344
- const Nt = 37, Bi = 39, Xi = (i, t, e) => {
2344
+ const Vt = 37, Bi = 39, Xi = (i, t, e) => {
2345
2345
  for (; i && i.matches; ) {
2346
2346
  if (i.matches(t))
2347
2347
  return i;
@@ -2358,16 +2358,16 @@ function Ji() {
2358
2358
  var i = this, t = i.onKeyDown;
2359
2359
  i.hook("instead", "onKeyDown", (e) => {
2360
2360
  var n, s, o, r;
2361
- if (!i.isOpen || !(e.keyCode === Nt || e.keyCode === Bi))
2361
+ if (!i.isOpen || !(e.keyCode === Vt || e.keyCode === Bi))
2362
2362
  return t.call(i, e);
2363
- i.ignoreHover = !0, r = Xi(i.activeOption, "[data-group]"), n = Yi(i.activeOption, "[data-selectable]"), r && (e.keyCode === Nt ? r = r.previousSibling : r = r.nextSibling, r && (o = r.querySelectorAll("[data-selectable]"), s = o[Math.min(o.length - 1, n)], s && i.setActiveOption(s)));
2363
+ i.ignoreHover = !0, r = Xi(i.activeOption, "[data-group]"), n = Yi(i.activeOption, "[data-selectable]"), r && (e.keyCode === Vt ? r = r.previousSibling : r = r.nextSibling, r && (o = r.querySelectorAll("[data-selectable]"), s = o[Math.min(o.length - 1, n)], s && i.setActiveOption(s)));
2364
2364
  });
2365
2365
  }
2366
- const Hi = (i) => (i + "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), Vt = (i, t = !1) => {
2366
+ const Hi = (i) => (i + "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), zt = (i, t = !1) => {
2367
2367
  i && (i.preventDefault(), t && i.stopPropagation());
2368
- }, zt = (i, t, e, n) => {
2368
+ }, kt = (i, t, e, n) => {
2369
2369
  i.addEventListener(t, e, n);
2370
- }, kt = (i) => {
2370
+ }, St = (i) => {
2371
2371
  if (i.jquery)
2372
2372
  return i[0];
2373
2373
  if (i instanceof HTMLElement)
@@ -2391,11 +2391,11 @@ function Mi(i) {
2391
2391
  e.hook("after", "setupTemplates", () => {
2392
2392
  var s = e.settings.render.item;
2393
2393
  e.settings.render.item = (o, r) => {
2394
- var l = kt(s.call(e, o, r)), a = kt(n);
2395
- return l.appendChild(a), zt(a, "mousedown", (c) => {
2396
- Vt(c, !0);
2397
- }), zt(a, "click", (c) => {
2398
- e.isLocked || (Vt(c, !0), !e.isLocked && e.shouldDelete([l], c) && (e.removeItem(l), e.refreshOptions(!1), e.inputState()));
2394
+ var l = St(s.call(e, o, r)), a = St(n);
2395
+ return l.appendChild(a), kt(a, "mousedown", (c) => {
2396
+ zt(c, !0);
2397
+ }), kt(a, "click", (c) => {
2398
+ e.isLocked || (zt(c, !0), !e.isLocked && e.shouldDelete([l], c) && (e.removeItem(l), e.refreshOptions(!1), e.inputState()));
2399
2399
  }), l;
2400
2400
  };
2401
2401
  });
@@ -2508,33 +2508,35 @@ let ft = null;
2508
2508
  function Ki() {
2509
2509
  return ft === null && (ft = document.querySelectorAll("head > link[rel=stylesheet]")), ft;
2510
2510
  }
2511
- var O, N, _, Q, z, Tt, Qt, Et;
2511
+ var N, R, _, Q, z, Qt, Et, Ut;
2512
2512
  const Ct = class Ct extends HTMLElement {
2513
2513
  constructor() {
2514
2514
  super(...arguments);
2515
2515
  x(this, z);
2516
- x(this, O);
2517
2516
  x(this, N);
2517
+ x(this, R);
2518
2518
  x(this, _);
2519
2519
  x(this, Q, {});
2520
2520
  }
2521
2521
  connectedCallback() {
2522
2522
  this.style.display = "block";
2523
- const e = P(this, z, Qt).call(this);
2524
- j(this, N, this.attachShadow({ mode: "open" })), j(this, _, this.attachInternals());
2523
+ const e = P(this, z, Et).call(this);
2524
+ j(this, R, this.attachShadow({ mode: "open" })), j(this, _, this.attachInternals());
2525
2525
  const n = document.createElement("link");
2526
- n.setAttribute("rel", "stylesheet"), n.setAttribute("href", Fi.href), G(this, N).appendChild(e), G(this, N).appendChild(n), Ki().forEach((s) => {
2527
- G(this, N).appendChild(s.cloneNode());
2526
+ n.setAttribute("rel", "stylesheet"), n.setAttribute("href", Fi.href), B(this, R).appendChild(e), B(this, R).appendChild(n), Ki().forEach((s) => {
2527
+ B(this, R).appendChild(s.cloneNode());
2528
2528
  }), j(this, Q, this.getAttributeNames().filter(
2529
2529
  (s) => !["name", "multiple"].includes(s)
2530
2530
  ).reduce((s, o) => {
2531
2531
  const r = o.split("."), l = r.pop(), a = this.getAttribute(o), c = r.reduce((u, d) => (d in u || (u[d] = {}), u[d]), s);
2532
- return c[te(l)] = ee(a), s;
2533
- }, {})), this.tomSelect = new Y(G(this, O), {
2534
- ...G(this, Q),
2535
- plugins: ["remove_button", "clear_button"],
2532
+ return r[0] === "render" ? c[l] = Zt(a) : c[ee(l)] = Zt(a), s;
2533
+ }, {})), this.tomSelect = new Y(B(this, N), {
2534
+ ...B(this, Q),
2535
+ plugins: ["clear_button"].concat(
2536
+ this.hasAttribute("multiple") ? ["remove_button"] : []
2537
+ ),
2536
2538
  highlight: !0
2537
- }), P(this, z, Et).call(this), this.value = this.tomSelect.getValue(), G(this, O).addEventListener("change", (s) => P(this, z, Tt).call(this, s)), this.dispatchEvent(new CustomEvent("upgrade"));
2539
+ }), P(this, z, Ut).call(this), this.value = this.tomSelect.getValue(), this.tomSelect.on("change", P(this, z, Qt).bind(this)), this.dispatchEvent(new CustomEvent("upgrade"));
2538
2540
  }
2539
2541
  get value() {
2540
2542
  let e = this.tomSelect.getValue();
@@ -2544,24 +2546,25 @@ const Ct = class Ct extends HTMLElement {
2544
2546
  if (xi(this.value, e) || this.tomSelect.setValue(e, !0), Array.isArray(e)) {
2545
2547
  const n = new FormData();
2546
2548
  for (const s of e)
2547
- n.append(G(this, O).name, s);
2548
- G(this, _).setFormValue(n);
2549
+ n.append(B(this, N).name, s);
2550
+ B(this, _).setFormValue(n);
2549
2551
  } else
2550
- G(this, _).setFormValue(e);
2552
+ B(this, _).setFormValue(e);
2551
2553
  }
2552
2554
  };
2553
- O = new WeakMap(), N = new WeakMap(), _ = new WeakMap(), Q = new WeakMap(), z = new WeakSet(), Tt = function(e) {
2554
- this.value = Array.from(G(this, O).selectedOptions).map((n) => n.value), this.dispatchEvent(new Event("change"));
2555
- }, Qt = function() {
2555
+ N = new WeakMap(), R = new WeakMap(), _ = new WeakMap(), Q = new WeakMap(), z = new WeakSet(), Qt = function(e) {
2556
+ this.value = e, this.dispatchEvent(new Event("change"));
2557
+ }, Et = function() {
2556
2558
  const e = document.createElement("div");
2557
- e.classList.add("form-floating"), j(this, O, document.createElement("select")), e.appendChild(G(this, O));
2559
+ e.classList.add("form-floating"), j(this, N, document.createElement("select")), e.appendChild(B(this, N));
2558
2560
  const n = document.createElement("label"), s = document.createElement("slot");
2559
- return s.setAttribute("name", "label"), s.innerHTML = this.getAttribute("label"), n.appendChild(s), e.appendChild(n), this.hasAttribute("name") && (G(this, O).name = this.getAttribute("name")), this.hasAttribute("multiple") && G(this, O).setAttribute("multiple", ""), e;
2560
- }, Et = function() {
2561
- G(this, N).querySelector(".ts-wrapper").classList.add("form-control"), G(this, N).querySelector(".ts-wrapper").style = `
2561
+ return s.setAttribute("name", "label"), s.innerHTML = this.getAttribute("label"), n.appendChild(s), e.appendChild(n), this.hasAttribute("name") && (B(this, N).name = this.getAttribute("name")), this.hasAttribute("multiple") && B(this, N).setAttribute("multiple", ""), e;
2562
+ }, Ut = function() {
2563
+ B(this, R).querySelector(".ts-wrapper").classList.add("form-control"), B(this, R).querySelector(".ts-wrapper").style = `
2564
+ --ts-pr-caret: 1rem;
2562
2565
  height: unset;
2563
2566
  min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
2564
- `, G(this, N).querySelector(".ts-control").style = `
2567
+ `, B(this, R).querySelector(".ts-control").style = `
2565
2568
  padding-top: 1.625rem;
2566
2569
  padding-bottom: 0.625rem;
2567
2570
  `;