@eox/itemfilter 0.2.2 → 0.3.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.
@@ -1,24 +1,24 @@
1
- var ae = Object.defineProperty;
2
- var ue = (i, t, e) => t in i ? ae(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var x = (i, t, e) => (ue(i, typeof t != "symbol" ? t + "" : t, e), e);
1
+ var _e = Object.defineProperty;
2
+ var $e = (i, t, e) => t in i ? _e(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var m = (i, t, e) => ($e(i, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC
7
7
  * SPDX-License-Identifier: BSD-3-Clause
8
8
  */
9
- const et = window, wt = et.ShadowRoot && (et.ShadyCSS === void 0 || et.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Jt = Symbol(), Lt = /* @__PURE__ */ new WeakMap();
10
- let de = class {
9
+ const nt = window, Ot = nt.ShadowRoot && (nt.ShadyCSS === void 0 || nt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ie = Symbol(), Pt = /* @__PURE__ */ new WeakMap();
10
+ let ye = class {
11
11
  constructor(t, e, s) {
12
- if (this._$cssResult$ = !0, s !== Jt)
12
+ if (this._$cssResult$ = !0, s !== ie)
13
13
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
14
14
  this.cssText = t, this.t = e;
15
15
  }
16
16
  get styleSheet() {
17
17
  let t = this.o;
18
18
  const e = this.t;
19
- if (wt && t === void 0) {
19
+ if (Ot && t === void 0) {
20
20
  const s = e !== void 0 && e.length === 1;
21
- s && (t = Lt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Lt.set(e, t));
21
+ s && (t = Pt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Pt.set(e, t));
22
22
  }
23
23
  return t;
24
24
  }
@@ -26,27 +26,27 @@ let de = class {
26
26
  return this.cssText;
27
27
  }
28
28
  };
29
- const fe = (i) => new de(typeof i == "string" ? i : i + "", void 0, Jt), pe = (i, t) => {
30
- wt ? i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
31
- const s = document.createElement("style"), r = et.litNonce;
29
+ const ve = (i) => new ye(typeof i == "string" ? i : i + "", void 0, ie), Ae = (i, t) => {
30
+ Ot ? i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
31
+ const s = document.createElement("style"), r = nt.litNonce;
32
32
  r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
33
33
  });
34
- }, Ot = wt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
34
+ }, jt = Ot ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
35
35
  let e = "";
36
36
  for (const s of t.cssRules)
37
37
  e += s.cssText;
38
- return fe(e);
38
+ return ve(e);
39
39
  })(i) : i;
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
- var ht;
46
- const st = window, kt = st.trustedTypes, ge = kt ? kt.emptyScript : "", Nt = st.reactiveElementPolyfillSupport, mt = { toAttribute(i, t) {
45
+ var dt;
46
+ const ot = window, Ht = ot.trustedTypes, Ee = Ht ? Ht.emptyScript : "", Ut = ot.reactiveElementPolyfillSupport, At = { toAttribute(i, t) {
47
47
  switch (t) {
48
48
  case Boolean:
49
- i = i ? ge : null;
49
+ i = i ? Ee : null;
50
50
  break;
51
51
  case Object:
52
52
  case Array:
@@ -71,7 +71,7 @@ const st = window, kt = st.trustedTypes, ge = kt ? kt.emptyScript : "", Nt = st.
71
71
  }
72
72
  }
73
73
  return e;
74
- } }, Qt = (i, t) => t !== i && (t == t || i == i), at = { attribute: !0, type: String, converter: mt, reflect: !1, hasChanged: Qt };
74
+ } }, re = (i, t) => t !== i && (t == t || i == i), ft = { attribute: !0, type: String, converter: At, reflect: !1, hasChanged: re };
75
75
  let z = class extends HTMLElement {
76
76
  constructor() {
77
77
  super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
@@ -88,7 +88,7 @@ let z = class extends HTMLElement {
88
88
  r !== void 0 && (this._$Ev.set(r, s), t.push(r));
89
89
  }), t;
90
90
  }
91
- static createProperty(t, e = at) {
91
+ static createProperty(t, e = ft) {
92
92
  if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
93
93
  const s = typeof t == "symbol" ? Symbol() : "__" + t, r = this.getPropertyDescriptor(t, s, e);
94
94
  r !== void 0 && Object.defineProperty(this.prototype, t, r);
@@ -103,7 +103,7 @@ let z = class extends HTMLElement {
103
103
  }, configurable: !0, enumerable: !0 };
104
104
  }
105
105
  static getPropertyOptions(t) {
106
- return this.elementProperties.get(t) || at;
106
+ return this.elementProperties.get(t) || ft;
107
107
  }
108
108
  static finalize() {
109
109
  if (this.hasOwnProperty("finalized"))
@@ -122,9 +122,9 @@ let z = class extends HTMLElement {
122
122
  if (Array.isArray(t)) {
123
123
  const s = new Set(t.flat(1 / 0).reverse());
124
124
  for (const r of s)
125
- e.unshift(Ot(r));
125
+ e.unshift(jt(r));
126
126
  } else
127
- t !== void 0 && e.push(Ot(t));
127
+ t !== void 0 && e.push(jt(t));
128
128
  return e;
129
129
  }
130
130
  static _$Ep(t, e) {
@@ -151,7 +151,7 @@ let z = class extends HTMLElement {
151
151
  createRenderRoot() {
152
152
  var t;
153
153
  const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
154
- return pe(e, this.constructor.elementStyles), e;
154
+ return Ae(e, this.constructor.elementStyles), e;
155
155
  }
156
156
  connectedCallback() {
157
157
  var t;
@@ -172,11 +172,11 @@ let z = class extends HTMLElement {
172
172
  attributeChangedCallback(t, e, s) {
173
173
  this._$AK(t, s);
174
174
  }
175
- _$EO(t, e, s = at) {
175
+ _$EO(t, e, s = ft) {
176
176
  var r;
177
177
  const n = this.constructor._$Ep(t, s);
178
178
  if (n !== void 0 && s.reflect === !0) {
179
- const o = (((r = s.converter) === null || r === void 0 ? void 0 : r.toAttribute) !== void 0 ? s.converter : mt).toAttribute(e, s.type);
179
+ const o = (((r = s.converter) === null || r === void 0 ? void 0 : r.toAttribute) !== void 0 ? s.converter : At).toAttribute(e, s.type);
180
180
  this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
181
181
  }
182
182
  }
@@ -184,13 +184,13 @@ let z = class extends HTMLElement {
184
184
  var s;
185
185
  const r = this.constructor, n = r._$Ev.get(t);
186
186
  if (n !== void 0 && this._$El !== n) {
187
- const o = r.getPropertyOptions(n), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((s = o.converter) === null || s === void 0 ? void 0 : s.fromAttribute) !== void 0 ? o.converter : mt;
187
+ const o = r.getPropertyOptions(n), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((s = o.converter) === null || s === void 0 ? void 0 : s.fromAttribute) !== void 0 ? o.converter : At;
188
188
  this._$El = n, this[n] = c.fromAttribute(e, o.type), this._$El = null;
189
189
  }
190
190
  }
191
191
  requestUpdate(t, e, s) {
192
192
  let r = !0;
193
- t !== void 0 && (((s = s || this.constructor.getPropertyOptions(t)).hasChanged || Qt)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, s))) : r = !1), !this.isUpdatePending && r && (this._$E_ = this._$Ej());
193
+ t !== void 0 && (((s = s || this.constructor.getPropertyOptions(t)).hasChanged || re)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, s))) : r = !1), !this.isUpdatePending && r && (this._$E_ = this._$Ej());
194
194
  }
195
195
  async _$Ej() {
196
196
  this.isUpdatePending = !0;
@@ -251,91 +251,91 @@ let z = class extends HTMLElement {
251
251
  firstUpdated(t) {
252
252
  }
253
253
  };
254
- z.finalized = !0, z.elementProperties = /* @__PURE__ */ new Map(), z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, Nt == null || Nt({ ReactiveElement: z }), ((ht = st.reactiveElementVersions) !== null && ht !== void 0 ? ht : st.reactiveElementVersions = []).push("1.6.1");
254
+ z.finalized = !0, z.elementProperties = /* @__PURE__ */ new Map(), z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, Ut == null || Ut({ ReactiveElement: z }), ((dt = ot.reactiveElementVersions) !== null && dt !== void 0 ? dt : ot.reactiveElementVersions = []).push("1.6.1");
255
255
  /**
256
256
  * @license
257
257
  * Copyright 2017 Google LLC
258
258
  * SPDX-License-Identifier: BSD-3-Clause
259
259
  */
260
- var ut;
261
- const it = window, D = it.trustedTypes, Pt = D ? D.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, $t = "$lit$", M = `lit$${(Math.random() + "").slice(9)}$`, Xt = "?" + M, _e = `<${Xt}>`, T = document, G = () => T.createComment(""), J = (i) => i === null || typeof i != "object" && typeof i != "function", Zt = Array.isArray, me = (i) => Zt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", dt = `[
262
- \f\r]`, K = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, Ut = />/g, O = RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
263
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, jt = /"/g, qt = /^(?:script|style|textarea|title)$/i, $e = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), k = $e(1), U = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), P = T.createTreeWalker(T, 129, null, !1), ve = (i, t) => {
260
+ var pt;
261
+ const lt = window, W = lt.trustedTypes, Ft = W ? W.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Et = "$lit$", T = `lit$${(Math.random() + "").slice(9)}$`, ne = "?" + T, be = `<${ne}>`, H = document, Q = () => H.createComment(""), Z = (i) => i === null || typeof i != "object" && typeof i != "function", oe = Array.isArray, xe = (i) => oe(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", gt = `[
262
+ \f\r]`, Y = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Dt = /-->/g, Bt = />/g, N = RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
263
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), zt = /'/g, Wt = /"/g, le = /^(?:script|style|textarea|title)$/i, Se = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), x = Se(1), U = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), j = H.createTreeWalker(H, 129, null, !1), we = (i, t) => {
264
264
  const e = i.length - 1, s = [];
265
- let r, n = t === 2 ? "<svg>" : "", o = K;
265
+ let r, n = t === 2 ? "<svg>" : "", o = Y;
266
266
  for (let l = 0; l < e; l++) {
267
- const h = i[l];
268
- let a, u, d = -1, p = 0;
269
- for (; p < h.length && (o.lastIndex = p, u = o.exec(h), u !== null); )
270
- p = o.lastIndex, o === K ? u[1] === "!--" ? o = Tt : u[1] !== void 0 ? o = Ut : u[2] !== void 0 ? (qt.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = O) : u[3] !== void 0 && (o = O) : o === O ? u[0] === ">" ? (o = r ?? K, d = -1) : u[1] === void 0 ? d = -2 : (d = o.lastIndex - u[2].length, a = u[1], o = u[3] === void 0 ? O : u[3] === '"' ? jt : Ht) : o === jt || o === Ht ? o = O : o === Tt || o === Ut ? o = K : (o = O, r = void 0);
271
- const g = o === O && i[l + 1].startsWith("/>") ? " " : "";
272
- n += o === K ? h + _e : d >= 0 ? (s.push(a), h.slice(0, d) + $t + h.slice(d) + M + g) : h + M + (d === -2 ? (s.push(void 0), l) : g);
267
+ const a = i[l];
268
+ let u, h, d = -1, p = 0;
269
+ for (; p < a.length && (o.lastIndex = p, h = o.exec(a), h !== null); )
270
+ p = o.lastIndex, o === Y ? h[1] === "!--" ? o = Dt : h[1] !== void 0 ? o = Bt : h[2] !== void 0 ? (le.test(h[2]) && (r = RegExp("</" + h[2], "g")), o = N) : h[3] !== void 0 && (o = N) : o === N ? h[0] === ">" ? (o = r ?? Y, d = -1) : h[1] === void 0 ? d = -2 : (d = o.lastIndex - h[2].length, u = h[1], o = h[3] === void 0 ? N : h[3] === '"' ? Wt : zt) : o === Wt || o === zt ? o = N : o === Dt || o === Bt ? o = Y : (o = N, r = void 0);
271
+ const g = o === N && i[l + 1].startsWith("/>") ? " " : "";
272
+ n += o === Y ? a + be : d >= 0 ? (s.push(u), a.slice(0, d) + Et + a.slice(d) + T + g) : a + T + (d === -2 ? (s.push(void 0), l) : g);
273
273
  }
274
274
  const c = n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "");
275
275
  if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
276
276
  throw Error("invalid template strings array");
277
- return [Pt !== void 0 ? Pt.createHTML(c) : c, s];
277
+ return [Ft !== void 0 ? Ft.createHTML(c) : c, s];
278
278
  };
279
- class Q {
279
+ class tt {
280
280
  constructor({ strings: t, _$litType$: e }, s) {
281
281
  let r;
282
282
  this.parts = [];
283
283
  let n = 0, o = 0;
284
- const c = t.length - 1, l = this.parts, [h, a] = ve(t, e);
285
- if (this.el = Q.createElement(h, s), P.currentNode = this.el.content, e === 2) {
286
- const u = this.el.content, d = u.firstChild;
287
- d.remove(), u.append(...d.childNodes);
284
+ const c = t.length - 1, l = this.parts, [a, u] = we(t, e);
285
+ if (this.el = tt.createElement(a, s), j.currentNode = this.el.content, e === 2) {
286
+ const h = this.el.content, d = h.firstChild;
287
+ d.remove(), h.append(...d.childNodes);
288
288
  }
289
- for (; (r = P.nextNode()) !== null && l.length < c; ) {
289
+ for (; (r = j.nextNode()) !== null && l.length < c; ) {
290
290
  if (r.nodeType === 1) {
291
291
  if (r.hasAttributes()) {
292
- const u = [];
292
+ const h = [];
293
293
  for (const d of r.getAttributeNames())
294
- if (d.endsWith($t) || d.startsWith(M)) {
295
- const p = a[o++];
296
- if (u.push(d), p !== void 0) {
297
- const g = r.getAttribute(p.toLowerCase() + $t).split(M), m = /([.?@])?(.*)/.exec(p);
298
- l.push({ type: 1, index: n, name: m[2], strings: g, ctor: m[1] === "." ? Ae : m[1] === "?" ? xe : m[1] === "@" ? Se : nt });
294
+ if (d.endsWith(Et) || d.startsWith(T)) {
295
+ const p = u[o++];
296
+ if (h.push(d), p !== void 0) {
297
+ const g = r.getAttribute(p.toLowerCase() + Et).split(T), v = /([.?@])?(.*)/.exec(p);
298
+ l.push({ type: 1, index: n, name: v[2], strings: g, ctor: v[1] === "." ? Re : v[1] === "?" ? Ie : v[1] === "@" ? Oe : at });
299
299
  } else
300
300
  l.push({ type: 6, index: n });
301
301
  }
302
- for (const d of u)
302
+ for (const d of h)
303
303
  r.removeAttribute(d);
304
304
  }
305
- if (qt.test(r.tagName)) {
306
- const u = r.textContent.split(M), d = u.length - 1;
305
+ if (le.test(r.tagName)) {
306
+ const h = r.textContent.split(T), d = h.length - 1;
307
307
  if (d > 0) {
308
- r.textContent = D ? D.emptyScript : "";
308
+ r.textContent = W ? W.emptyScript : "";
309
309
  for (let p = 0; p < d; p++)
310
- r.append(u[p], G()), P.nextNode(), l.push({ type: 2, index: ++n });
311
- r.append(u[d], G());
310
+ r.append(h[p], Q()), j.nextNode(), l.push({ type: 2, index: ++n });
311
+ r.append(h[d], Q());
312
312
  }
313
313
  }
314
314
  } else if (r.nodeType === 8)
315
- if (r.data === Xt)
315
+ if (r.data === ne)
316
316
  l.push({ type: 2, index: n });
317
317
  else {
318
- let u = -1;
319
- for (; (u = r.data.indexOf(M, u + 1)) !== -1; )
320
- l.push({ type: 7, index: n }), u += M.length - 1;
318
+ let h = -1;
319
+ for (; (h = r.data.indexOf(T, h + 1)) !== -1; )
320
+ l.push({ type: 7, index: n }), h += T.length - 1;
321
321
  }
322
322
  n++;
323
323
  }
324
324
  }
325
325
  static createElement(t, e) {
326
- const s = T.createElement("template");
326
+ const s = H.createElement("template");
327
327
  return s.innerHTML = t, s;
328
328
  }
329
329
  }
330
- function B(i, t, e = i, s) {
330
+ function V(i, t, e = i, s) {
331
331
  var r, n, o, c;
332
332
  if (t === U)
333
333
  return t;
334
334
  let l = s !== void 0 ? (r = e._$Co) === null || r === void 0 ? void 0 : r[s] : e._$Cl;
335
- const h = J(t) ? void 0 : t._$litDirective$;
336
- return (l == null ? void 0 : l.constructor) !== h && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), h === void 0 ? l = void 0 : (l = new h(i), l._$AT(i, e, s)), s !== void 0 ? ((o = (c = e)._$Co) !== null && o !== void 0 ? o : c._$Co = [])[s] = l : e._$Cl = l), l !== void 0 && (t = B(i, l._$AS(i, t.values), l, s)), t;
335
+ const a = Z(t) ? void 0 : t._$litDirective$;
336
+ return (l == null ? void 0 : l.constructor) !== a && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), a === void 0 ? l = void 0 : (l = new a(i), l._$AT(i, e, s)), s !== void 0 ? ((o = (c = e)._$Co) !== null && o !== void 0 ? o : c._$Co = [])[s] = l : e._$Cl = l), l !== void 0 && (t = V(i, l._$AS(i, t.values), l, s)), t;
337
337
  }
338
- class ye {
338
+ class Me {
339
339
  constructor(t, e) {
340
340
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
341
341
  }
@@ -347,17 +347,17 @@ class ye {
347
347
  }
348
348
  u(t) {
349
349
  var e;
350
- const { el: { content: s }, parts: r } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : T).importNode(s, !0);
351
- P.currentNode = n;
352
- let o = P.nextNode(), c = 0, l = 0, h = r[0];
353
- for (; h !== void 0; ) {
354
- if (c === h.index) {
355
- let a;
356
- h.type === 2 ? a = new X(o, o.nextSibling, this, t) : h.type === 1 ? a = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (a = new be(o, this, t)), this._$AV.push(a), h = r[++l];
350
+ const { el: { content: s }, parts: r } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : H).importNode(s, !0);
351
+ j.currentNode = n;
352
+ let o = j.nextNode(), c = 0, l = 0, a = r[0];
353
+ for (; a !== void 0; ) {
354
+ if (c === a.index) {
355
+ let u;
356
+ a.type === 2 ? u = new et(o, o.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (u = new Te(o, this, t)), this._$AV.push(u), a = r[++l];
357
357
  }
358
- c !== (h == null ? void 0 : h.index) && (o = P.nextNode(), c++);
358
+ c !== (a == null ? void 0 : a.index) && (o = j.nextNode(), c++);
359
359
  }
360
- return P.currentNode = T, n;
360
+ return j.currentNode = H, n;
361
361
  }
362
362
  v(t) {
363
363
  let e = 0;
@@ -365,7 +365,7 @@ class ye {
365
365
  s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
366
366
  }
367
367
  }
368
- class X {
368
+ class et {
369
369
  constructor(t, e, s, r) {
370
370
  var n;
371
371
  this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cp = (n = r == null ? void 0 : r.isConnected) === null || n === void 0 || n;
@@ -386,7 +386,7 @@ class X {
386
386
  return this._$AB;
387
387
  }
388
388
  _$AI(t, e = this) {
389
- t = B(this, t, e), J(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : me(t) ? this.T(t) : this._(t);
389
+ t = V(this, t, e), Z(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : xe(t) ? this.T(t) : this._(t);
390
390
  }
391
391
  k(t) {
392
392
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -395,28 +395,28 @@ class X {
395
395
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
396
396
  }
397
397
  _(t) {
398
- this._$AH !== _ && J(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
398
+ this._$AH !== _ && Z(this._$AH) ? this._$AA.nextSibling.data = t : this.$(H.createTextNode(t)), this._$AH = t;
399
399
  }
400
400
  g(t) {
401
401
  var e;
402
- const { values: s, _$litType$: r } = t, n = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Q.createElement(r.h, this.options)), r);
402
+ const { values: s, _$litType$: r } = t, n = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = tt.createElement(r.h, this.options)), r);
403
403
  if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n)
404
404
  this._$AH.v(s);
405
405
  else {
406
- const o = new ye(n, this), c = o.u(this.options);
406
+ const o = new Me(n, this), c = o.u(this.options);
407
407
  o.v(s), this.$(c), this._$AH = o;
408
408
  }
409
409
  }
410
410
  _$AC(t) {
411
- let e = Ft.get(t.strings);
412
- return e === void 0 && Ft.set(t.strings, e = new Q(t)), e;
411
+ let e = Vt.get(t.strings);
412
+ return e === void 0 && Vt.set(t.strings, e = new tt(t)), e;
413
413
  }
414
414
  T(t) {
415
- Zt(this._$AH) || (this._$AH = [], this._$AR());
415
+ oe(this._$AH) || (this._$AH = [], this._$AR());
416
416
  const e = this._$AH;
417
417
  let s, r = 0;
418
418
  for (const n of t)
419
- r === e.length ? e.push(s = new X(this.k(G()), this.k(G()), this, this.options)) : s = e[r], s._$AI(n), r++;
419
+ r === e.length ? e.push(s = new et(this.k(Q()), this.k(Q()), this, this.options)) : s = e[r], s._$AI(n), r++;
420
420
  r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
421
421
  }
422
422
  _$AR(t = this._$AA.nextSibling, e) {
@@ -431,7 +431,7 @@ class X {
431
431
  this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
432
432
  }
433
433
  }
434
- class nt {
434
+ class at {
435
435
  constructor(t, e, s, r, n) {
436
436
  this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = _;
437
437
  }
@@ -445,12 +445,12 @@ class nt {
445
445
  const n = this.strings;
446
446
  let o = !1;
447
447
  if (n === void 0)
448
- t = B(this, t, e, 0), o = !J(t) || t !== this._$AH && t !== U, o && (this._$AH = t);
448
+ t = V(this, t, e, 0), o = !Z(t) || t !== this._$AH && t !== U, o && (this._$AH = t);
449
449
  else {
450
450
  const c = t;
451
- let l, h;
451
+ let l, a;
452
452
  for (t = n[0], l = 0; l < n.length - 1; l++)
453
- h = B(this, c[s + l], e, l), h === U && (h = this._$AH[l]), o || (o = !J(h) || h !== this._$AH[l]), h === _ ? t = _ : t !== _ && (t += (h ?? "") + n[l + 1]), this._$AH[l] = h;
453
+ a = V(this, c[s + l], e, l), a === U && (a = this._$AH[l]), o || (o = !Z(a) || a !== this._$AH[l]), a === _ ? t = _ : t !== _ && (t += (a ?? "") + n[l + 1]), this._$AH[l] = a;
454
454
  }
455
455
  o && !r && this.j(t);
456
456
  }
@@ -458,7 +458,7 @@ class nt {
458
458
  t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
459
  }
460
460
  }
461
- class Ae extends nt {
461
+ class Re extends at {
462
462
  constructor() {
463
463
  super(...arguments), this.type = 3;
464
464
  }
@@ -466,22 +466,22 @@ class Ae extends nt {
466
466
  this.element[this.name] = t === _ ? void 0 : t;
467
467
  }
468
468
  }
469
- const Ee = D ? D.emptyScript : "";
470
- class xe extends nt {
469
+ const Ce = W ? W.emptyScript : "";
470
+ class Ie extends at {
471
471
  constructor() {
472
472
  super(...arguments), this.type = 4;
473
473
  }
474
474
  j(t) {
475
- t && t !== _ ? this.element.setAttribute(this.name, Ee) : this.element.removeAttribute(this.name);
475
+ t && t !== _ ? this.element.setAttribute(this.name, Ce) : this.element.removeAttribute(this.name);
476
476
  }
477
477
  }
478
- class Se extends nt {
478
+ class Oe extends at {
479
479
  constructor(t, e, s, r, n) {
480
480
  super(t, e, s, r, n), this.type = 5;
481
481
  }
482
482
  _$AI(t, e = this) {
483
483
  var s;
484
- if ((t = (s = B(this, t, e, 0)) !== null && s !== void 0 ? s : _) === U)
484
+ if ((t = (s = V(this, t, e, 0)) !== null && s !== void 0 ? s : _) === U)
485
485
  return;
486
486
  const r = this._$AH, n = t === _ && r !== _ || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, o = t !== _ && (r === _ || n);
487
487
  n && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
@@ -491,7 +491,7 @@ class Se extends nt {
491
491
  typeof this._$AH == "function" ? this._$AH.call((s = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && s !== void 0 ? s : this.element, t) : this._$AH.handleEvent(t);
492
492
  }
493
493
  }
494
- class be {
494
+ class Te {
495
495
  constructor(t, e, s) {
496
496
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
497
497
  }
@@ -499,18 +499,18 @@ class be {
499
499
  return this._$AM._$AU;
500
500
  }
501
501
  _$AI(t) {
502
- B(this, t);
502
+ V(this, t);
503
503
  }
504
504
  }
505
- const zt = it.litHtmlPolyfillSupport;
506
- zt == null || zt(Q, X), ((ut = it.litHtmlVersions) !== null && ut !== void 0 ? ut : it.litHtmlVersions = []).push("2.7.4");
507
- const we = (i, t, e) => {
505
+ const Kt = lt.litHtmlPolyfillSupport;
506
+ Kt == null || Kt(tt, et), ((pt = lt.litHtmlVersions) !== null && pt !== void 0 ? pt : lt.litHtmlVersions = []).push("2.7.4");
507
+ const ke = (i, t, e) => {
508
508
  var s, r;
509
509
  const n = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : t;
510
510
  let o = n._$litPart$;
511
511
  if (o === void 0) {
512
512
  const c = (r = e == null ? void 0 : e.renderBefore) !== null && r !== void 0 ? r : null;
513
- n._$litPart$ = o = new X(t.insertBefore(G(), c), c, void 0, e ?? {});
513
+ n._$litPart$ = o = new et(t.insertBefore(Q(), c), c, void 0, e ?? {});
514
514
  }
515
515
  return o._$AI(i), o;
516
516
  };
@@ -519,8 +519,8 @@ const we = (i, t, e) => {
519
519
  * Copyright 2017 Google LLC
520
520
  * SPDX-License-Identifier: BSD-3-Clause
521
521
  */
522
- var ft, pt;
523
- class Y extends z {
522
+ var mt, _t;
523
+ class X extends z {
524
524
  constructor() {
525
525
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
526
526
  }
@@ -531,7 +531,7 @@ class Y extends z {
531
531
  }
532
532
  update(t) {
533
533
  const e = this.render();
534
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = we(e, this.renderRoot, this.renderOptions);
534
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ke(e, this.renderRoot, this.renderOptions);
535
535
  }
536
536
  connectedCallback() {
537
537
  var t;
@@ -545,16 +545,16 @@ class Y extends z {
545
545
  return U;
546
546
  }
547
547
  }
548
- Y.finalized = !0, Y._$litElement$ = !0, (ft = globalThis.litElementHydrateSupport) === null || ft === void 0 || ft.call(globalThis, { LitElement: Y });
549
- const Dt = globalThis.litElementPolyfillSupport;
550
- Dt == null || Dt({ LitElement: Y });
551
- ((pt = globalThis.litElementVersions) !== null && pt !== void 0 ? pt : globalThis.litElementVersions = []).push("3.3.2");
548
+ X.finalized = !0, X._$litElement$ = !0, (mt = globalThis.litElementHydrateSupport) === null || mt === void 0 || mt.call(globalThis, { LitElement: X });
549
+ const Gt = globalThis.litElementPolyfillSupport;
550
+ Gt == null || Gt({ LitElement: X });
551
+ ((_t = globalThis.litElementVersions) !== null && _t !== void 0 ? _t : globalThis.litElementVersions = []).push("3.3.2");
552
552
  /**
553
553
  * @license
554
554
  * Copyright 2017 Google LLC
555
555
  * SPDX-License-Identifier: BSD-3-Clause
556
556
  */
557
- const Me = (i) => (t) => typeof t == "function" ? ((e, s) => (customElements.define(e, s), s))(i, t) : ((e, s) => {
557
+ const Le = (i) => (t) => typeof t == "function" ? ((e, s) => (customElements.define(e, s), s))(i, t) : ((e, s) => {
558
558
  const { kind: r, elements: n } = s;
559
559
  return { kind: r, elements: n, finisher(o) {
560
560
  customElements.define(e, o);
@@ -565,39 +565,47 @@ const Me = (i) => (t) => typeof t == "function" ? ((e, s) => (customElements.def
565
565
  * Copyright 2017 Google LLC
566
566
  * SPDX-License-Identifier: BSD-3-Clause
567
567
  */
568
- const Re = (i, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) {
568
+ const Ne = (i, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) {
569
569
  e.createProperty(t.key, i);
570
570
  } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() {
571
571
  typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this));
572
572
  }, finisher(e) {
573
573
  e.createProperty(t.key, i);
574
574
  } };
575
- function Mt(i) {
575
+ function Tt(i) {
576
576
  return (t, e) => e !== void 0 ? ((s, r, n) => {
577
577
  r.constructor.createProperty(n, s);
578
- })(i, t, e) : Re(i, t);
578
+ })(i, t, e) : Ne(i, t);
579
579
  }
580
580
  /**
581
581
  * @license
582
582
  * Copyright 2017 Google LLC
583
583
  * SPDX-License-Identifier: BSD-3-Clause
584
584
  */
585
- function ot(i) {
586
- return Mt({ ...i, state: !0 });
585
+ function ht(i) {
586
+ return Tt({ ...i, state: !0 });
587
587
  }
588
588
  /**
589
589
  * @license
590
590
  * Copyright 2021 Google LLC
591
591
  * SPDX-License-Identifier: BSD-3-Clause
592
592
  */
593
- var gt;
594
- ((gt = window.HTMLSlotElement) === null || gt === void 0 ? void 0 : gt.prototype.assignedElements) != null;
593
+ var $t;
594
+ (($t = window.HTMLSlotElement) === null || $t === void 0 ? void 0 : $t.prototype.assignedElements) != null;
595
595
  /**
596
596
  * @license
597
597
  * Copyright 2021 Google LLC
598
598
  * SPDX-License-Identifier: BSD-3-Clause
599
599
  */
600
- function* V(i, t) {
600
+ function q(i, t, e) {
601
+ return i ? t() : e == null ? void 0 : e();
602
+ }
603
+ /**
604
+ * @license
605
+ * Copyright 2021 Google LLC
606
+ * SPDX-License-Identifier: BSD-3-Clause
607
+ */
608
+ function* J(i, t) {
601
609
  if (i !== void 0) {
602
610
  let e = 0;
603
611
  for (const s of i)
@@ -609,8 +617,8 @@ function* V(i, t) {
609
617
  * Copyright 2017 Google LLC
610
618
  * SPDX-License-Identifier: BSD-3-Clause
611
619
  */
612
- const Ce = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Ie = (i) => (...t) => ({ _$litDirective$: i, values: t });
613
- class Le {
620
+ const Pe = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, je = (i) => (...t) => ({ _$litDirective$: i, values: t });
621
+ class He {
614
622
  constructor(t) {
615
623
  }
616
624
  get _$AU() {
@@ -631,9 +639,9 @@ class Le {
631
639
  * Copyright 2017 Google LLC
632
640
  * SPDX-License-Identifier: BSD-3-Clause
633
641
  */
634
- class vt extends Le {
642
+ class bt extends He {
635
643
  constructor(t) {
636
- if (super(t), this.et = _, t.type !== Ce.CHILD)
644
+ if (super(t), this.et = _, t.type !== Pe.CHILD)
637
645
  throw Error(this.constructor.directiveName + "() can only be used in child bindings");
638
646
  }
639
647
  render(t) {
@@ -650,52 +658,52 @@ class vt extends Le {
650
658
  return e.raw = e, this.ft = { _$litType$: this.constructor.resultType, strings: e, values: [] };
651
659
  }
652
660
  }
653
- vt.directiveName = "unsafeHTML", vt.resultType = 1;
654
- const Bt = Ie(vt);
655
- function S(i) {
656
- return Array.isArray ? Array.isArray(i) : se(i) === "[object Array]";
661
+ bt.directiveName = "unsafeHTML", bt.resultType = 1;
662
+ const Yt = je(bt);
663
+ function O(i) {
664
+ return Array.isArray ? Array.isArray(i) : he(i) === "[object Array]";
657
665
  }
658
- const Oe = 1 / 0;
659
- function ke(i) {
666
+ const Ue = 1 / 0;
667
+ function Fe(i) {
660
668
  if (typeof i == "string")
661
669
  return i;
662
670
  let t = i + "";
663
- return t == "0" && 1 / i == -Oe ? "-0" : t;
671
+ return t == "0" && 1 / i == -Ue ? "-0" : t;
664
672
  }
665
- function Ne(i) {
666
- return i == null ? "" : ke(i);
673
+ function De(i) {
674
+ return i == null ? "" : Fe(i);
667
675
  }
668
- function A(i) {
676
+ function R(i) {
669
677
  return typeof i == "string";
670
678
  }
671
- function te(i) {
679
+ function ce(i) {
672
680
  return typeof i == "number";
673
681
  }
674
- function Pe(i) {
675
- return i === !0 || i === !1 || Te(i) && se(i) == "[object Boolean]";
682
+ function Be(i) {
683
+ return i === !0 || i === !1 || ze(i) && he(i) == "[object Boolean]";
676
684
  }
677
- function ee(i) {
685
+ function ae(i) {
678
686
  return typeof i == "object";
679
687
  }
680
- function Te(i) {
681
- return ee(i) && i !== null;
688
+ function ze(i) {
689
+ return ae(i) && i !== null;
682
690
  }
683
- function $(i) {
691
+ function b(i) {
684
692
  return i != null;
685
693
  }
686
- function _t(i) {
694
+ function yt(i) {
687
695
  return !i.trim().length;
688
696
  }
689
- function se(i) {
697
+ function he(i) {
690
698
  return i == null ? i === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(i);
691
699
  }
692
- const Ue = "Incorrect 'index' type", He = (i) => `Invalid value for key ${i}`, je = (i) => `Pattern length exceeds max of ${i}.`, Fe = (i) => `Missing ${i} property in key`, ze = (i) => `Property 'weight' in key '${i}' must be a positive integer`, Wt = Object.prototype.hasOwnProperty;
693
- class De {
700
+ const We = "Incorrect 'index' type", Ve = (i) => `Invalid value for key ${i}`, Ke = (i) => `Pattern length exceeds max of ${i}.`, Ge = (i) => `Missing ${i} property in key`, Ye = (i) => `Property 'weight' in key '${i}' must be a positive integer`, qt = Object.prototype.hasOwnProperty;
701
+ class qe {
694
702
  constructor(t) {
695
703
  this._keys = [], this._keyMap = {};
696
704
  let e = 0;
697
705
  t.forEach((s) => {
698
- let r = ie(s);
706
+ let r = ue(s);
699
707
  e += r.weight, this._keys.push(r), this._keyMap[r.id] = r, e += r.weight;
700
708
  }), this._keys.forEach((s) => {
701
709
  s.weight /= e;
@@ -711,50 +719,50 @@ class De {
711
719
  return JSON.stringify(this._keys);
712
720
  }
713
721
  }
714
- function ie(i) {
722
+ function ue(i) {
715
723
  let t = null, e = null, s = null, r = 1, n = null;
716
- if (A(i) || S(i))
717
- s = i, t = Kt(i), e = yt(i);
724
+ if (R(i) || O(i))
725
+ s = i, t = Jt(i), e = xt(i);
718
726
  else {
719
- if (!Wt.call(i, "name"))
720
- throw new Error(Fe("name"));
727
+ if (!qt.call(i, "name"))
728
+ throw new Error(Ge("name"));
721
729
  const o = i.name;
722
- if (s = o, Wt.call(i, "weight") && (r = i.weight, r <= 0))
723
- throw new Error(ze(o));
724
- t = Kt(o), e = yt(o), n = i.getFn;
730
+ if (s = o, qt.call(i, "weight") && (r = i.weight, r <= 0))
731
+ throw new Error(Ye(o));
732
+ t = Jt(o), e = xt(o), n = i.getFn;
725
733
  }
726
734
  return { path: t, id: e, weight: r, src: s, getFn: n };
727
735
  }
728
- function Kt(i) {
729
- return S(i) ? i : i.split(".");
736
+ function Jt(i) {
737
+ return O(i) ? i : i.split(".");
730
738
  }
731
- function yt(i) {
732
- return S(i) ? i.join(".") : i;
739
+ function xt(i) {
740
+ return O(i) ? i.join(".") : i;
733
741
  }
734
- function Be(i, t) {
742
+ function Je(i, t) {
735
743
  let e = [], s = !1;
736
744
  const r = (n, o, c) => {
737
- if ($(n))
745
+ if (b(n))
738
746
  if (!o[c])
739
747
  e.push(n);
740
748
  else {
741
749
  let l = o[c];
742
- const h = n[l];
743
- if (!$(h))
750
+ const a = n[l];
751
+ if (!b(a))
744
752
  return;
745
- if (c === o.length - 1 && (A(h) || te(h) || Pe(h)))
746
- e.push(Ne(h));
747
- else if (S(h)) {
753
+ if (c === o.length - 1 && (R(a) || ce(a) || Be(a)))
754
+ e.push(De(a));
755
+ else if (O(a)) {
748
756
  s = !0;
749
- for (let a = 0, u = h.length; a < u; a += 1)
750
- r(h[a], o, c + 1);
757
+ for (let u = 0, h = a.length; u < h; u += 1)
758
+ r(a[u], o, c + 1);
751
759
  } else
752
- o.length && r(h, o, c + 1);
760
+ o.length && r(a, o, c + 1);
753
761
  }
754
762
  };
755
- return r(i, A(t) ? t.split(".") : t, 0), s ? e : e[0];
763
+ return r(i, R(t) ? t.split(".") : t, 0), s ? e : e[0];
756
764
  }
757
- const We = {
765
+ const Xe = {
758
766
  // Whether the matches should be included in the result set. When `true`, each record in the result
759
767
  // set will include the indices of the matched characters.
760
768
  // These can consequently be used for highlighting purposes.
@@ -764,7 +772,7 @@ const We = {
764
772
  findAllMatches: !1,
765
773
  // Minimum number of characters that must be matched before a result is considered a match
766
774
  minMatchCharLength: 1
767
- }, Ke = {
775
+ }, Qe = {
768
776
  // When `true`, the algorithm continues searching to the end of the input even if a perfect
769
777
  // match is found before the end of the same input.
770
778
  isCaseSensitive: !1,
@@ -776,7 +784,7 @@ const We = {
776
784
  shouldSort: !0,
777
785
  // Default sort function: sort by ascending score, ascending index
778
786
  sortFn: (i, t) => i.score === t.score ? i.idx < t.idx ? -1 : 1 : i.score < t.score ? -1 : 1
779
- }, Ve = {
787
+ }, Ze = {
780
788
  // Approximately where in the text is the pattern expected to be found?
781
789
  location: 0,
782
790
  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
@@ -788,12 +796,12 @@ const We = {
788
796
  // the exact location specified, a threshold of '1000' would require a perfect match
789
797
  // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
790
798
  distance: 100
791
- }, Ye = {
799
+ }, ts = {
792
800
  // When `true`, it enables the use of unix-like search commands
793
801
  useExtendedSearch: !1,
794
802
  // The get function to use when fetching an object's properties.
795
803
  // The default will search nested paths *ie foo.bar.baz*
796
- getFn: Be,
804
+ getFn: Je,
797
805
  // When `true`, search will ignore `location` and `distance`, so it won't matter
798
806
  // where in the string the pattern appears.
799
807
  // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
@@ -806,17 +814,17 @@ const We = {
806
814
  fieldNormWeight: 1
807
815
  };
808
816
  var f = {
809
- ...Ke,
810
- ...We,
811
- ...Ve,
812
- ...Ye
817
+ ...Qe,
818
+ ...Xe,
819
+ ...Ze,
820
+ ...ts
813
821
  };
814
- const Ge = /[^ ]+/g;
815
- function Je(i = 1, t = 3) {
822
+ const es = /[^ ]+/g;
823
+ function ss(i = 1, t = 3) {
816
824
  const e = /* @__PURE__ */ new Map(), s = Math.pow(10, t);
817
825
  return {
818
826
  get(r) {
819
- const n = r.match(Ge).length;
827
+ const n = r.match(es).length;
820
828
  if (e.has(n))
821
829
  return e.get(n);
822
830
  const o = 1 / Math.pow(n, 0.5 * i), c = parseFloat(Math.round(o * s) / s);
@@ -827,12 +835,12 @@ function Je(i = 1, t = 3) {
827
835
  }
828
836
  };
829
837
  }
830
- class Rt {
838
+ class kt {
831
839
  constructor({
832
840
  getFn: t = f.getFn,
833
841
  fieldNormWeight: e = f.fieldNormWeight
834
842
  } = {}) {
835
- this.norm = Je(e, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
843
+ this.norm = ss(e, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
836
844
  }
837
845
  setSources(t = []) {
838
846
  this.docs = t;
@@ -846,7 +854,7 @@ class Rt {
846
854
  });
847
855
  }
848
856
  create() {
849
- this.isCreated || !this.docs.length || (this.isCreated = !0, A(this.docs[0]) ? this.docs.forEach((t, e) => {
857
+ this.isCreated || !this.docs.length || (this.isCreated = !0, R(this.docs[0]) ? this.docs.forEach((t, e) => {
850
858
  this._addString(t, e);
851
859
  }) : this.docs.forEach((t, e) => {
852
860
  this._addObject(t, e);
@@ -855,7 +863,7 @@ class Rt {
855
863
  // Adds a doc to the end of the index
856
864
  add(t) {
857
865
  const e = this.size();
858
- A(t) ? this._addString(t, e) : this._addObject(t, e);
866
+ R(t) ? this._addString(t, e) : this._addObject(t, e);
859
867
  }
860
868
  // Removes the doc at the specified index of the index
861
869
  removeAt(t) {
@@ -870,7 +878,7 @@ class Rt {
870
878
  return this.records.length;
871
879
  }
872
880
  _addString(t, e) {
873
- if (!$(t) || _t(t))
881
+ if (!b(t) || yt(t))
874
882
  return;
875
883
  let s = {
876
884
  v: t,
@@ -883,30 +891,30 @@ class Rt {
883
891
  let s = { i: e, $: {} };
884
892
  this.keys.forEach((r, n) => {
885
893
  let o = r.getFn ? r.getFn(t) : this.getFn(t, r.path);
886
- if ($(o)) {
887
- if (S(o)) {
894
+ if (b(o)) {
895
+ if (O(o)) {
888
896
  let c = [];
889
897
  const l = [{ nestedArrIndex: -1, value: o }];
890
898
  for (; l.length; ) {
891
- const { nestedArrIndex: h, value: a } = l.pop();
892
- if ($(a))
893
- if (A(a) && !_t(a)) {
894
- let u = {
895
- v: a,
896
- i: h,
897
- n: this.norm.get(a)
899
+ const { nestedArrIndex: a, value: u } = l.pop();
900
+ if (b(u))
901
+ if (R(u) && !yt(u)) {
902
+ let h = {
903
+ v: u,
904
+ i: a,
905
+ n: this.norm.get(u)
898
906
  };
899
- c.push(u);
907
+ c.push(h);
900
908
  } else
901
- S(a) && a.forEach((u, d) => {
909
+ O(u) && u.forEach((h, d) => {
902
910
  l.push({
903
911
  nestedArrIndex: d,
904
- value: u
912
+ value: h
905
913
  });
906
914
  });
907
915
  }
908
916
  s.$[n] = c;
909
- } else if (A(o) && !_t(o)) {
917
+ } else if (R(o) && !yt(o)) {
910
918
  let c = {
911
919
  v: o,
912
920
  n: this.norm.get(o)
@@ -923,15 +931,15 @@ class Rt {
923
931
  };
924
932
  }
925
933
  }
926
- function re(i, t, { getFn: e = f.getFn, fieldNormWeight: s = f.fieldNormWeight } = {}) {
927
- const r = new Rt({ getFn: e, fieldNormWeight: s });
928
- return r.setKeys(i.map(ie)), r.setSources(t), r.create(), r;
934
+ function de(i, t, { getFn: e = f.getFn, fieldNormWeight: s = f.fieldNormWeight } = {}) {
935
+ const r = new kt({ getFn: e, fieldNormWeight: s });
936
+ return r.setKeys(i.map(ue)), r.setSources(t), r.create(), r;
929
937
  }
930
- function Qe(i, { getFn: t = f.getFn, fieldNormWeight: e = f.fieldNormWeight } = {}) {
931
- const { keys: s, records: r } = i, n = new Rt({ getFn: t, fieldNormWeight: e });
938
+ function is(i, { getFn: t = f.getFn, fieldNormWeight: e = f.fieldNormWeight } = {}) {
939
+ const { keys: s, records: r } = i, n = new kt({ getFn: t, fieldNormWeight: e });
932
940
  return n.setKeys(s), n.setIndexRecords(r), n;
933
941
  }
934
- function tt(i, {
942
+ function it(i, {
935
943
  errors: t = 0,
936
944
  currentLocation: e = 0,
937
945
  expectedLocation: s = 0,
@@ -944,7 +952,7 @@ function tt(i, {
944
952
  const c = Math.abs(s - e);
945
953
  return r ? o + c / r : c ? 1 : o;
946
954
  }
947
- function Xe(i = [], t = f.minMatchCharLength) {
955
+ function rs(i = [], t = f.minMatchCharLength) {
948
956
  let e = [], s = -1, r = -1, n = 0;
949
957
  for (let o = i.length; n < o; n += 1) {
950
958
  let c = i[n];
@@ -952,87 +960,87 @@ function Xe(i = [], t = f.minMatchCharLength) {
952
960
  }
953
961
  return i[n - 1] && n - s >= t && e.push([s, n - 1]), e;
954
962
  }
955
- const N = 32;
956
- function Ze(i, t, e, {
963
+ const P = 32;
964
+ function ns(i, t, e, {
957
965
  location: s = f.location,
958
966
  distance: r = f.distance,
959
967
  threshold: n = f.threshold,
960
968
  findAllMatches: o = f.findAllMatches,
961
969
  minMatchCharLength: c = f.minMatchCharLength,
962
970
  includeMatches: l = f.includeMatches,
963
- ignoreLocation: h = f.ignoreLocation
971
+ ignoreLocation: a = f.ignoreLocation
964
972
  } = {}) {
965
- if (t.length > N)
966
- throw new Error(je(N));
967
- const a = t.length, u = i.length, d = Math.max(0, Math.min(s, u));
973
+ if (t.length > P)
974
+ throw new Error(Ke(P));
975
+ const u = t.length, h = i.length, d = Math.max(0, Math.min(s, h));
968
976
  let p = n, g = d;
969
- const m = c > 1 || l, I = m ? Array(u) : [];
970
- let E;
971
- for (; (E = i.indexOf(t, g)) > -1; ) {
972
- let v = tt(t, {
973
- currentLocation: E,
977
+ const v = c > 1 || l, M = v ? Array(h) : [];
978
+ let A;
979
+ for (; (A = i.indexOf(t, g)) > -1; ) {
980
+ let y = it(t, {
981
+ currentLocation: A,
974
982
  expectedLocation: d,
975
983
  distance: r,
976
- ignoreLocation: h
984
+ ignoreLocation: a
977
985
  });
978
- if (p = Math.min(v, p), g = E + a, m) {
979
- let b = 0;
980
- for (; b < a; )
981
- I[E + b] = 1, b += 1;
986
+ if (p = Math.min(y, p), g = A + u, v) {
987
+ let E = 0;
988
+ for (; E < u; )
989
+ M[A + E] = 1, E += 1;
982
990
  }
983
991
  }
984
992
  g = -1;
985
- let j = [], L = 1, Z = a + u;
986
- const he = 1 << a - 1;
987
- for (let v = 0; v < a; v += 1) {
988
- let b = 0, w = Z;
989
- for (; b < w; )
990
- tt(t, {
991
- errors: v,
992
- currentLocation: d + w,
993
+ let C = [], I = 1, D = u + h;
994
+ const G = 1 << u - 1;
995
+ for (let y = 0; y < u; y += 1) {
996
+ let E = 0, S = D;
997
+ for (; E < S; )
998
+ it(t, {
999
+ errors: y,
1000
+ currentLocation: d + S,
993
1001
  expectedLocation: d,
994
1002
  distance: r,
995
- ignoreLocation: h
996
- }) <= p ? b = w : Z = w, w = Math.floor((Z - b) / 2 + b);
997
- Z = w;
998
- let Ct = Math.max(1, d - w + 1), ct = o ? u : Math.min(d + w, u) + a, F = Array(ct + 2);
999
- F[ct + 1] = (1 << v) - 1;
1000
- for (let y = ct; y >= Ct; y -= 1) {
1001
- let q = y - 1, It = e[i.charAt(q)];
1002
- if (m && (I[q] = +!!It), F[y] = (F[y + 1] << 1 | 1) & It, v && (F[y] |= (j[y + 1] | j[y]) << 1 | 1 | j[y + 1]), F[y] & he && (L = tt(t, {
1003
- errors: v,
1004
- currentLocation: q,
1003
+ ignoreLocation: a
1004
+ }) <= p ? E = S : D = S, S = Math.floor((D - E) / 2 + E);
1005
+ D = S;
1006
+ let Lt = Math.max(1, d - S + 1), ut = o ? h : Math.min(d + S, h) + u, B = Array(ut + 2);
1007
+ B[ut + 1] = (1 << y) - 1;
1008
+ for (let w = ut; w >= Lt; w -= 1) {
1009
+ let st = w - 1, Nt = e[i.charAt(st)];
1010
+ if (v && (M[st] = +!!Nt), B[w] = (B[w + 1] << 1 | 1) & Nt, y && (B[w] |= (C[w + 1] | C[w]) << 1 | 1 | C[w + 1]), B[w] & G && (I = it(t, {
1011
+ errors: y,
1012
+ currentLocation: st,
1005
1013
  expectedLocation: d,
1006
1014
  distance: r,
1007
- ignoreLocation: h
1008
- }), L <= p)) {
1009
- if (p = L, g = q, g <= d)
1015
+ ignoreLocation: a
1016
+ }), I <= p)) {
1017
+ if (p = I, g = st, g <= d)
1010
1018
  break;
1011
- Ct = Math.max(1, 2 * d - g);
1019
+ Lt = Math.max(1, 2 * d - g);
1012
1020
  }
1013
1021
  }
1014
- if (tt(t, {
1015
- errors: v + 1,
1022
+ if (it(t, {
1023
+ errors: y + 1,
1016
1024
  currentLocation: d,
1017
1025
  expectedLocation: d,
1018
1026
  distance: r,
1019
- ignoreLocation: h
1027
+ ignoreLocation: a
1020
1028
  }) > p)
1021
1029
  break;
1022
- j = F;
1030
+ C = B;
1023
1031
  }
1024
- const lt = {
1032
+ const $ = {
1025
1033
  isMatch: g >= 0,
1026
1034
  // Count exact matches (those with a score of 0) to be "almost" exact
1027
- score: Math.max(1e-3, L)
1035
+ score: Math.max(1e-3, I)
1028
1036
  };
1029
- if (m) {
1030
- const v = Xe(I, c);
1031
- v.length ? l && (lt.indices = v) : lt.isMatch = !1;
1037
+ if (v) {
1038
+ const y = rs(M, c);
1039
+ y.length ? l && ($.indices = y) : $.isMatch = !1;
1032
1040
  }
1033
- return lt;
1041
+ return $;
1034
1042
  }
1035
- function qe(i) {
1043
+ function os(i) {
1036
1044
  let t = {};
1037
1045
  for (let e = 0, s = i.length; e < s; e += 1) {
1038
1046
  const r = i.charAt(e);
@@ -1040,7 +1048,7 @@ function qe(i) {
1040
1048
  }
1041
1049
  return t;
1042
1050
  }
1043
- class ne {
1051
+ class fe {
1044
1052
  constructor(t, {
1045
1053
  location: e = f.location,
1046
1054
  threshold: s = f.threshold,
@@ -1049,7 +1057,7 @@ class ne {
1049
1057
  findAllMatches: o = f.findAllMatches,
1050
1058
  minMatchCharLength: c = f.minMatchCharLength,
1051
1059
  isCaseSensitive: l = f.isCaseSensitive,
1052
- ignoreLocation: h = f.ignoreLocation
1060
+ ignoreLocation: a = f.ignoreLocation
1053
1061
  } = {}) {
1054
1062
  if (this.options = {
1055
1063
  location: e,
@@ -1059,27 +1067,27 @@ class ne {
1059
1067
  findAllMatches: o,
1060
1068
  minMatchCharLength: c,
1061
1069
  isCaseSensitive: l,
1062
- ignoreLocation: h
1070
+ ignoreLocation: a
1063
1071
  }, this.pattern = l ? t : t.toLowerCase(), this.chunks = [], !this.pattern.length)
1064
1072
  return;
1065
- const a = (d, p) => {
1073
+ const u = (d, p) => {
1066
1074
  this.chunks.push({
1067
1075
  pattern: d,
1068
- alphabet: qe(d),
1076
+ alphabet: os(d),
1069
1077
  startIndex: p
1070
1078
  });
1071
- }, u = this.pattern.length;
1072
- if (u > N) {
1079
+ }, h = this.pattern.length;
1080
+ if (h > P) {
1073
1081
  let d = 0;
1074
- const p = u % N, g = u - p;
1082
+ const p = h % P, g = h - p;
1075
1083
  for (; d < g; )
1076
- a(this.pattern.substr(d, N), d), d += N;
1084
+ u(this.pattern.substr(d, P), d), d += P;
1077
1085
  if (p) {
1078
- const m = u - N;
1079
- a(this.pattern.substr(m), m);
1086
+ const v = h - P;
1087
+ u(this.pattern.substr(v), v);
1080
1088
  }
1081
1089
  } else
1082
- a(this.pattern, 0);
1090
+ u(this.pattern, 0);
1083
1091
  }
1084
1092
  searchIn(t) {
1085
1093
  const { isCaseSensitive: e, includeMatches: s } = this.options;
@@ -1096,46 +1104,46 @@ class ne {
1096
1104
  threshold: o,
1097
1105
  findAllMatches: c,
1098
1106
  minMatchCharLength: l,
1099
- ignoreLocation: h
1107
+ ignoreLocation: a
1100
1108
  } = this.options;
1101
- let a = [], u = 0, d = !1;
1102
- this.chunks.forEach(({ pattern: g, alphabet: m, startIndex: I }) => {
1103
- const { isMatch: E, score: j, indices: L } = Ze(t, g, m, {
1104
- location: r + I,
1109
+ let u = [], h = 0, d = !1;
1110
+ this.chunks.forEach(({ pattern: g, alphabet: v, startIndex: M }) => {
1111
+ const { isMatch: A, score: C, indices: I } = ns(t, g, v, {
1112
+ location: r + M,
1105
1113
  distance: n,
1106
1114
  threshold: o,
1107
1115
  findAllMatches: c,
1108
1116
  minMatchCharLength: l,
1109
1117
  includeMatches: s,
1110
- ignoreLocation: h
1118
+ ignoreLocation: a
1111
1119
  });
1112
- E && (d = !0), u += j, E && L && (a = [...a, ...L]);
1120
+ A && (d = !0), h += C, A && I && (u = [...u, ...I]);
1113
1121
  });
1114
1122
  let p = {
1115
1123
  isMatch: d,
1116
- score: d ? u / this.chunks.length : 1
1124
+ score: d ? h / this.chunks.length : 1
1117
1125
  };
1118
- return d && s && (p.indices = a), p;
1126
+ return d && s && (p.indices = u), p;
1119
1127
  }
1120
1128
  }
1121
- class C {
1129
+ class L {
1122
1130
  constructor(t) {
1123
1131
  this.pattern = t;
1124
1132
  }
1125
1133
  static isMultiMatch(t) {
1126
- return Vt(t, this.multiRegex);
1134
+ return Xt(t, this.multiRegex);
1127
1135
  }
1128
1136
  static isSingleMatch(t) {
1129
- return Vt(t, this.singleRegex);
1137
+ return Xt(t, this.singleRegex);
1130
1138
  }
1131
1139
  search() {
1132
1140
  }
1133
1141
  }
1134
- function Vt(i, t) {
1142
+ function Xt(i, t) {
1135
1143
  const e = i.match(t);
1136
1144
  return e ? e[1] : null;
1137
1145
  }
1138
- class ts extends C {
1146
+ class ls extends L {
1139
1147
  constructor(t) {
1140
1148
  super(t);
1141
1149
  }
@@ -1157,7 +1165,7 @@ class ts extends C {
1157
1165
  };
1158
1166
  }
1159
1167
  }
1160
- class es extends C {
1168
+ class cs extends L {
1161
1169
  constructor(t) {
1162
1170
  super(t);
1163
1171
  }
@@ -1179,7 +1187,7 @@ class es extends C {
1179
1187
  };
1180
1188
  }
1181
1189
  }
1182
- class ss extends C {
1190
+ class as extends L {
1183
1191
  constructor(t) {
1184
1192
  super(t);
1185
1193
  }
@@ -1201,7 +1209,7 @@ class ss extends C {
1201
1209
  };
1202
1210
  }
1203
1211
  }
1204
- class is extends C {
1212
+ class hs extends L {
1205
1213
  constructor(t) {
1206
1214
  super(t);
1207
1215
  }
@@ -1223,7 +1231,7 @@ class is extends C {
1223
1231
  };
1224
1232
  }
1225
1233
  }
1226
- class rs extends C {
1234
+ class us extends L {
1227
1235
  constructor(t) {
1228
1236
  super(t);
1229
1237
  }
@@ -1245,7 +1253,7 @@ class rs extends C {
1245
1253
  };
1246
1254
  }
1247
1255
  }
1248
- class ns extends C {
1256
+ class ds extends L {
1249
1257
  constructor(t) {
1250
1258
  super(t);
1251
1259
  }
@@ -1267,7 +1275,7 @@ class ns extends C {
1267
1275
  };
1268
1276
  }
1269
1277
  }
1270
- class oe extends C {
1278
+ class pe extends L {
1271
1279
  constructor(t, {
1272
1280
  location: e = f.location,
1273
1281
  threshold: s = f.threshold,
@@ -1276,9 +1284,9 @@ class oe extends C {
1276
1284
  findAllMatches: o = f.findAllMatches,
1277
1285
  minMatchCharLength: c = f.minMatchCharLength,
1278
1286
  isCaseSensitive: l = f.isCaseSensitive,
1279
- ignoreLocation: h = f.ignoreLocation
1287
+ ignoreLocation: a = f.ignoreLocation
1280
1288
  } = {}) {
1281
- super(t), this._bitapSearch = new ne(t, {
1289
+ super(t), this._bitapSearch = new fe(t, {
1282
1290
  location: e,
1283
1291
  threshold: s,
1284
1292
  distance: r,
@@ -1286,7 +1294,7 @@ class oe extends C {
1286
1294
  findAllMatches: o,
1287
1295
  minMatchCharLength: c,
1288
1296
  isCaseSensitive: l,
1289
- ignoreLocation: h
1297
+ ignoreLocation: a
1290
1298
  });
1291
1299
  }
1292
1300
  static get type() {
@@ -1302,7 +1310,7 @@ class oe extends C {
1302
1310
  return this._bitapSearch.searchIn(t);
1303
1311
  }
1304
1312
  }
1305
- class le extends C {
1313
+ class ge extends L {
1306
1314
  constructor(t) {
1307
1315
  super(t);
1308
1316
  }
@@ -1328,33 +1336,33 @@ class le extends C {
1328
1336
  };
1329
1337
  }
1330
1338
  }
1331
- const At = [
1332
- ts,
1333
- le,
1334
- ss,
1335
- is,
1336
- ns,
1337
- rs,
1338
- es,
1339
- oe
1340
- ], Yt = At.length, os = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, ls = "|";
1341
- function cs(i, t = {}) {
1342
- return i.split(ls).map((e) => {
1343
- let s = e.trim().split(os).filter((n) => n && !!n.trim()), r = [];
1339
+ const St = [
1340
+ ls,
1341
+ ge,
1342
+ as,
1343
+ hs,
1344
+ ds,
1345
+ us,
1346
+ cs,
1347
+ pe
1348
+ ], Qt = St.length, fs = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, ps = "|";
1349
+ function gs(i, t = {}) {
1350
+ return i.split(ps).map((e) => {
1351
+ let s = e.trim().split(fs).filter((n) => n && !!n.trim()), r = [];
1344
1352
  for (let n = 0, o = s.length; n < o; n += 1) {
1345
1353
  const c = s[n];
1346
- let l = !1, h = -1;
1347
- for (; !l && ++h < Yt; ) {
1348
- const a = At[h];
1349
- let u = a.isMultiMatch(c);
1350
- u && (r.push(new a(u, t)), l = !0);
1354
+ let l = !1, a = -1;
1355
+ for (; !l && ++a < Qt; ) {
1356
+ const u = St[a];
1357
+ let h = u.isMultiMatch(c);
1358
+ h && (r.push(new u(h, t)), l = !0);
1351
1359
  }
1352
1360
  if (!l)
1353
- for (h = -1; ++h < Yt; ) {
1354
- const a = At[h];
1355
- let u = a.isSingleMatch(c);
1356
- if (u) {
1357
- r.push(new a(u, t));
1361
+ for (a = -1; ++a < Qt; ) {
1362
+ const u = St[a];
1363
+ let h = u.isSingleMatch(c);
1364
+ if (h) {
1365
+ r.push(new u(h, t));
1358
1366
  break;
1359
1367
  }
1360
1368
  }
@@ -1362,8 +1370,8 @@ function cs(i, t = {}) {
1362
1370
  return r;
1363
1371
  });
1364
1372
  }
1365
- const hs = /* @__PURE__ */ new Set([oe.type, le.type]);
1366
- class as {
1373
+ const ms = /* @__PURE__ */ new Set([pe.type, ge.type]);
1374
+ class _s {
1367
1375
  constructor(t, {
1368
1376
  isCaseSensitive: e = f.isCaseSensitive,
1369
1377
  includeMatches: s = f.includeMatches,
@@ -1372,7 +1380,7 @@ class as {
1372
1380
  findAllMatches: o = f.findAllMatches,
1373
1381
  location: c = f.location,
1374
1382
  threshold: l = f.threshold,
1375
- distance: h = f.distance
1383
+ distance: a = f.distance
1376
1384
  } = {}) {
1377
1385
  this.query = null, this.options = {
1378
1386
  isCaseSensitive: e,
@@ -1382,8 +1390,8 @@ class as {
1382
1390
  ignoreLocation: n,
1383
1391
  location: c,
1384
1392
  threshold: l,
1385
- distance: h
1386
- }, this.pattern = e ? t : t.toLowerCase(), this.query = cs(this.pattern, this.options);
1393
+ distance: a
1394
+ }, this.pattern = e ? t : t.toLowerCase(), this.query = gs(this.pattern, this.options);
1387
1395
  }
1388
1396
  static condition(t, e) {
1389
1397
  return e.useExtendedSearch;
@@ -1398,15 +1406,15 @@ class as {
1398
1406
  const { includeMatches: s, isCaseSensitive: r } = this.options;
1399
1407
  t = r ? t : t.toLowerCase();
1400
1408
  let n = 0, o = [], c = 0;
1401
- for (let l = 0, h = e.length; l < h; l += 1) {
1402
- const a = e[l];
1409
+ for (let l = 0, a = e.length; l < a; l += 1) {
1410
+ const u = e[l];
1403
1411
  o.length = 0, n = 0;
1404
- for (let u = 0, d = a.length; u < d; u += 1) {
1405
- const p = a[u], { isMatch: g, indices: m, score: I } = p.search(t);
1412
+ for (let h = 0, d = u.length; h < d; h += 1) {
1413
+ const p = u[h], { isMatch: g, indices: v, score: M } = p.search(t);
1406
1414
  if (g) {
1407
- if (n += 1, c += I, s) {
1408
- const E = p.constructor.type;
1409
- hs.has(E) ? o = [...o, ...m] : o.push(m);
1415
+ if (n += 1, c += M, s) {
1416
+ const A = p.constructor.type;
1417
+ ms.has(A) ? o = [...o, ...v] : o.push(v);
1410
1418
  }
1411
1419
  } else {
1412
1420
  c = 0, n = 0, o.length = 0;
@@ -1414,11 +1422,11 @@ class as {
1414
1422
  }
1415
1423
  }
1416
1424
  if (n) {
1417
- let u = {
1425
+ let h = {
1418
1426
  isMatch: !0,
1419
1427
  score: c / n
1420
1428
  };
1421
- return s && (u.indices = o), u;
1429
+ return s && (h.indices = o), h;
1422
1430
  }
1423
1431
  }
1424
1432
  return {
@@ -1427,59 +1435,59 @@ class as {
1427
1435
  };
1428
1436
  }
1429
1437
  }
1430
- const Et = [];
1431
- function us(...i) {
1432
- Et.push(...i);
1438
+ const wt = [];
1439
+ function $s(...i) {
1440
+ wt.push(...i);
1433
1441
  }
1434
- function xt(i, t) {
1435
- for (let e = 0, s = Et.length; e < s; e += 1) {
1436
- let r = Et[e];
1442
+ function Mt(i, t) {
1443
+ for (let e = 0, s = wt.length; e < s; e += 1) {
1444
+ let r = wt[e];
1437
1445
  if (r.condition(i, t))
1438
1446
  return new r(i, t);
1439
1447
  }
1440
- return new ne(i, t);
1448
+ return new fe(i, t);
1441
1449
  }
1442
- const rt = {
1450
+ const ct = {
1443
1451
  AND: "$and",
1444
1452
  OR: "$or"
1445
- }, St = {
1453
+ }, Rt = {
1446
1454
  PATH: "$path",
1447
1455
  PATTERN: "$val"
1448
- }, bt = (i) => !!(i[rt.AND] || i[rt.OR]), ds = (i) => !!i[St.PATH], fs = (i) => !S(i) && ee(i) && !bt(i), Gt = (i) => ({
1449
- [rt.AND]: Object.keys(i).map((t) => ({
1456
+ }, Ct = (i) => !!(i[ct.AND] || i[ct.OR]), ys = (i) => !!i[Rt.PATH], vs = (i) => !O(i) && ae(i) && !Ct(i), Zt = (i) => ({
1457
+ [ct.AND]: Object.keys(i).map((t) => ({
1450
1458
  [t]: i[t]
1451
1459
  }))
1452
1460
  });
1453
- function ce(i, t, { auto: e = !0 } = {}) {
1461
+ function me(i, t, { auto: e = !0 } = {}) {
1454
1462
  const s = (r) => {
1455
1463
  let n = Object.keys(r);
1456
- const o = ds(r);
1457
- if (!o && n.length > 1 && !bt(r))
1458
- return s(Gt(r));
1459
- if (fs(r)) {
1460
- const l = o ? r[St.PATH] : n[0], h = o ? r[St.PATTERN] : r[l];
1461
- if (!A(h))
1462
- throw new Error(He(l));
1463
- const a = {
1464
- keyId: yt(l),
1465
- pattern: h
1464
+ const o = ys(r);
1465
+ if (!o && n.length > 1 && !Ct(r))
1466
+ return s(Zt(r));
1467
+ if (vs(r)) {
1468
+ const l = o ? r[Rt.PATH] : n[0], a = o ? r[Rt.PATTERN] : r[l];
1469
+ if (!R(a))
1470
+ throw new Error(Ve(l));
1471
+ const u = {
1472
+ keyId: xt(l),
1473
+ pattern: a
1466
1474
  };
1467
- return e && (a.searcher = xt(h, t)), a;
1475
+ return e && (u.searcher = Mt(a, t)), u;
1468
1476
  }
1469
1477
  let c = {
1470
1478
  children: [],
1471
1479
  operator: n[0]
1472
1480
  };
1473
1481
  return n.forEach((l) => {
1474
- const h = r[l];
1475
- S(h) && h.forEach((a) => {
1476
- c.children.push(s(a));
1482
+ const a = r[l];
1483
+ O(a) && a.forEach((u) => {
1484
+ c.children.push(s(u));
1477
1485
  });
1478
1486
  }), c;
1479
1487
  };
1480
- return bt(i) || (i = Gt(i)), s(i);
1488
+ return Ct(i) || (i = Zt(i)), s(i);
1481
1489
  }
1482
- function ps(i, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
1490
+ function As(i, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
1483
1491
  i.forEach((e) => {
1484
1492
  let s = 1;
1485
1493
  e.matches.forEach(({ key: r, norm: n, score: o }) => {
@@ -1491,10 +1499,10 @@ function ps(i, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
1491
1499
  }), e.score = s;
1492
1500
  });
1493
1501
  }
1494
- function gs(i, t) {
1502
+ function Es(i, t) {
1495
1503
  const e = i.matches;
1496
- t.matches = [], $(e) && e.forEach((s) => {
1497
- if (!$(s.indices) || !s.indices.length)
1504
+ t.matches = [], b(e) && e.forEach((s) => {
1505
+ if (!b(s.indices) || !s.indices.length)
1498
1506
  return;
1499
1507
  const { indices: r, value: n } = s;
1500
1508
  let o = {
@@ -1504,15 +1512,15 @@ function gs(i, t) {
1504
1512
  s.key && (o.key = s.key.src), s.idx > -1 && (o.refIndex = s.idx), t.matches.push(o);
1505
1513
  });
1506
1514
  }
1507
- function _s(i, t) {
1515
+ function bs(i, t) {
1508
1516
  t.score = i.score;
1509
1517
  }
1510
- function ms(i, t, {
1518
+ function xs(i, t, {
1511
1519
  includeMatches: e = f.includeMatches,
1512
1520
  includeScore: s = f.includeScore
1513
1521
  } = {}) {
1514
1522
  const r = [];
1515
- return e && r.push(gs), s && r.push(_s), i.map((n) => {
1523
+ return e && r.push(Es), s && r.push(bs), i.map((n) => {
1516
1524
  const { idx: o } = n, c = {
1517
1525
  item: t[o],
1518
1526
  refIndex: o
@@ -1522,20 +1530,20 @@ function ms(i, t, {
1522
1530
  }), c;
1523
1531
  });
1524
1532
  }
1525
- class W {
1533
+ class K {
1526
1534
  constructor(t, e = {}, s) {
1527
- this.options = { ...f, ...e }, this.options.useExtendedSearch, this._keyStore = new De(this.options.keys), this.setCollection(t, s);
1535
+ this.options = { ...f, ...e }, this.options.useExtendedSearch, this._keyStore = new qe(this.options.keys), this.setCollection(t, s);
1528
1536
  }
1529
1537
  setCollection(t, e) {
1530
- if (this._docs = t, e && !(e instanceof Rt))
1531
- throw new Error(Ue);
1532
- this._myIndex = e || re(this.options.keys, this._docs, {
1538
+ if (this._docs = t, e && !(e instanceof kt))
1539
+ throw new Error(We);
1540
+ this._myIndex = e || de(this.options.keys, this._docs, {
1533
1541
  getFn: this.options.getFn,
1534
1542
  fieldNormWeight: this.options.fieldNormWeight
1535
1543
  });
1536
1544
  }
1537
1545
  add(t) {
1538
- $(t) && (this._docs.push(t), this._myIndex.add(t));
1546
+ b(t) && (this._docs.push(t), this._myIndex.add(t));
1539
1547
  }
1540
1548
  remove(t = () => !1) {
1541
1549
  const e = [];
@@ -1559,71 +1567,71 @@ class W {
1559
1567
  sortFn: o,
1560
1568
  ignoreFieldNorm: c
1561
1569
  } = this.options;
1562
- let l = A(t) ? A(this._docs[0]) ? this._searchStringList(t) : this._searchObjectList(t) : this._searchLogical(t);
1563
- return ps(l, { ignoreFieldNorm: c }), n && l.sort(o), te(e) && e > -1 && (l = l.slice(0, e)), ms(l, this._docs, {
1570
+ let l = R(t) ? R(this._docs[0]) ? this._searchStringList(t) : this._searchObjectList(t) : this._searchLogical(t);
1571
+ return As(l, { ignoreFieldNorm: c }), n && l.sort(o), ce(e) && e > -1 && (l = l.slice(0, e)), xs(l, this._docs, {
1564
1572
  includeMatches: s,
1565
1573
  includeScore: r
1566
1574
  });
1567
1575
  }
1568
1576
  _searchStringList(t) {
1569
- const e = xt(t, this.options), { records: s } = this._myIndex, r = [];
1577
+ const e = Mt(t, this.options), { records: s } = this._myIndex, r = [];
1570
1578
  return s.forEach(({ v: n, i: o, n: c }) => {
1571
- if (!$(n))
1579
+ if (!b(n))
1572
1580
  return;
1573
- const { isMatch: l, score: h, indices: a } = e.searchIn(n);
1581
+ const { isMatch: l, score: a, indices: u } = e.searchIn(n);
1574
1582
  l && r.push({
1575
1583
  item: n,
1576
1584
  idx: o,
1577
- matches: [{ score: h, value: n, norm: c, indices: a }]
1585
+ matches: [{ score: a, value: n, norm: c, indices: u }]
1578
1586
  });
1579
1587
  }), r;
1580
1588
  }
1581
1589
  _searchLogical(t) {
1582
- const e = ce(t, this.options), s = (c, l, h) => {
1590
+ const e = me(t, this.options), s = (c, l, a) => {
1583
1591
  if (!c.children) {
1584
- const { keyId: u, searcher: d } = c, p = this._findMatches({
1585
- key: this._keyStore.get(u),
1586
- value: this._myIndex.getValueForItemAtKeyId(l, u),
1592
+ const { keyId: h, searcher: d } = c, p = this._findMatches({
1593
+ key: this._keyStore.get(h),
1594
+ value: this._myIndex.getValueForItemAtKeyId(l, h),
1587
1595
  searcher: d
1588
1596
  });
1589
1597
  return p && p.length ? [
1590
1598
  {
1591
- idx: h,
1599
+ idx: a,
1592
1600
  item: l,
1593
1601
  matches: p
1594
1602
  }
1595
1603
  ] : [];
1596
1604
  }
1597
- const a = [];
1598
- for (let u = 0, d = c.children.length; u < d; u += 1) {
1599
- const p = c.children[u], g = s(p, l, h);
1605
+ const u = [];
1606
+ for (let h = 0, d = c.children.length; h < d; h += 1) {
1607
+ const p = c.children[h], g = s(p, l, a);
1600
1608
  if (g.length)
1601
- a.push(...g);
1602
- else if (c.operator === rt.AND)
1609
+ u.push(...g);
1610
+ else if (c.operator === ct.AND)
1603
1611
  return [];
1604
1612
  }
1605
- return a;
1613
+ return u;
1606
1614
  }, r = this._myIndex.records, n = {}, o = [];
1607
1615
  return r.forEach(({ $: c, i: l }) => {
1608
- if ($(c)) {
1609
- let h = s(e, c, l);
1610
- h.length && (n[l] || (n[l] = { idx: l, item: c, matches: [] }, o.push(n[l])), h.forEach(({ matches: a }) => {
1611
- n[l].matches.push(...a);
1616
+ if (b(c)) {
1617
+ let a = s(e, c, l);
1618
+ a.length && (n[l] || (n[l] = { idx: l, item: c, matches: [] }, o.push(n[l])), a.forEach(({ matches: u }) => {
1619
+ n[l].matches.push(...u);
1612
1620
  }));
1613
1621
  }
1614
1622
  }), o;
1615
1623
  }
1616
1624
  _searchObjectList(t) {
1617
- const e = xt(t, this.options), { keys: s, records: r } = this._myIndex, n = [];
1625
+ const e = Mt(t, this.options), { keys: s, records: r } = this._myIndex, n = [];
1618
1626
  return r.forEach(({ $: o, i: c }) => {
1619
- if (!$(o))
1627
+ if (!b(o))
1620
1628
  return;
1621
1629
  let l = [];
1622
- s.forEach((h, a) => {
1630
+ s.forEach((a, u) => {
1623
1631
  l.push(
1624
1632
  ...this._findMatches({
1625
- key: h,
1626
- value: o[a],
1633
+ key: a,
1634
+ value: o[u],
1627
1635
  searcher: e
1628
1636
  })
1629
1637
  );
@@ -1635,53 +1643,133 @@ class W {
1635
1643
  }), n;
1636
1644
  }
1637
1645
  _findMatches({ key: t, value: e, searcher: s }) {
1638
- if (!$(e))
1646
+ if (!b(e))
1639
1647
  return [];
1640
1648
  let r = [];
1641
- if (S(e))
1649
+ if (O(e))
1642
1650
  e.forEach(({ v: n, i: o, n: c }) => {
1643
- if (!$(n))
1651
+ if (!b(n))
1644
1652
  return;
1645
- const { isMatch: l, score: h, indices: a } = s.searchIn(n);
1653
+ const { isMatch: l, score: a, indices: u } = s.searchIn(n);
1646
1654
  l && r.push({
1647
- score: h,
1655
+ score: a,
1648
1656
  key: t,
1649
1657
  value: n,
1650
1658
  idx: o,
1651
1659
  norm: c,
1652
- indices: a
1660
+ indices: u
1653
1661
  });
1654
1662
  });
1655
1663
  else {
1656
- const { v: n, n: o } = e, { isMatch: c, score: l, indices: h } = s.searchIn(n);
1657
- c && r.push({ score: l, key: t, value: n, norm: o, indices: h });
1664
+ const { v: n, n: o } = e, { isMatch: c, score: l, indices: a } = s.searchIn(n);
1665
+ c && r.push({ score: l, key: t, value: n, norm: o, indices: a });
1658
1666
  }
1659
1667
  return r;
1660
1668
  }
1661
1669
  }
1662
- W.version = "6.6.2";
1663
- W.createIndex = re;
1664
- W.parseIndex = Qe;
1665
- W.config = f;
1666
- W.parseQuery = ce;
1667
- us(as);
1668
- const $s = (i, t = "highlight", e = "title") => {
1670
+ K.version = "6.6.2";
1671
+ K.createIndex = de;
1672
+ K.parseIndex = is;
1673
+ K.config = f;
1674
+ K.parseQuery = me;
1675
+ $s(_s);
1676
+ var rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1677
+ function Ss(i) {
1678
+ return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
1679
+ }
1680
+ var ws = "Expected a function", te = 0 / 0, Ms = "[object Symbol]", Rs = /^\s+|\s+$/g, Cs = /^[-+]0x[0-9a-f]+$/i, Is = /^0b[01]+$/i, Os = /^0o[0-7]+$/i, Ts = parseInt, ks = typeof rt == "object" && rt && rt.Object === Object && rt, Ls = typeof self == "object" && self && self.Object === Object && self, Ns = ks || Ls || Function("return this")(), Ps = Object.prototype, js = Ps.toString, Hs = Math.max, Us = Math.min, vt = function() {
1681
+ return Ns.Date.now();
1682
+ };
1683
+ function Fs(i, t, e) {
1684
+ var s, r, n, o, c, l, a = 0, u = !1, h = !1, d = !0;
1685
+ if (typeof i != "function")
1686
+ throw new TypeError(ws);
1687
+ t = ee(t) || 0, It(e) && (u = !!e.leading, h = "maxWait" in e, n = h ? Hs(ee(e.maxWait) || 0, t) : n, d = "trailing" in e ? !!e.trailing : d);
1688
+ function p($) {
1689
+ var y = s, E = r;
1690
+ return s = r = void 0, a = $, o = i.apply(E, y), o;
1691
+ }
1692
+ function g($) {
1693
+ return a = $, c = setTimeout(A, t), u ? p($) : o;
1694
+ }
1695
+ function v($) {
1696
+ var y = $ - l, E = $ - a, S = t - y;
1697
+ return h ? Us(S, n - E) : S;
1698
+ }
1699
+ function M($) {
1700
+ var y = $ - l, E = $ - a;
1701
+ return l === void 0 || y >= t || y < 0 || h && E >= n;
1702
+ }
1703
+ function A() {
1704
+ var $ = vt();
1705
+ if (M($))
1706
+ return C($);
1707
+ c = setTimeout(A, v($));
1708
+ }
1709
+ function C($) {
1710
+ return c = void 0, d && s ? p($) : (s = r = void 0, o);
1711
+ }
1712
+ function I() {
1713
+ c !== void 0 && clearTimeout(c), a = 0, s = l = r = c = void 0;
1714
+ }
1715
+ function D() {
1716
+ return c === void 0 ? o : C(vt());
1717
+ }
1718
+ function G() {
1719
+ var $ = vt(), y = M($);
1720
+ if (s = arguments, r = this, l = $, y) {
1721
+ if (c === void 0)
1722
+ return g(l);
1723
+ if (h)
1724
+ return c = setTimeout(A, t), p(l);
1725
+ }
1726
+ return c === void 0 && (c = setTimeout(A, t)), o;
1727
+ }
1728
+ return G.cancel = I, G.flush = D, G;
1729
+ }
1730
+ function It(i) {
1731
+ var t = typeof i;
1732
+ return !!i && (t == "object" || t == "function");
1733
+ }
1734
+ function Ds(i) {
1735
+ return !!i && typeof i == "object";
1736
+ }
1737
+ function Bs(i) {
1738
+ return typeof i == "symbol" || Ds(i) && js.call(i) == Ms;
1739
+ }
1740
+ function ee(i) {
1741
+ if (typeof i == "number")
1742
+ return i;
1743
+ if (Bs(i))
1744
+ return te;
1745
+ if (It(i)) {
1746
+ var t = typeof i.valueOf == "function" ? i.valueOf() : i;
1747
+ i = It(t) ? t + "" : t;
1748
+ }
1749
+ if (typeof i != "string")
1750
+ return i === 0 ? i : +i;
1751
+ i = i.replace(Rs, "");
1752
+ var e = Is.test(i);
1753
+ return e || Os.test(i) ? Ts(i.slice(2), e ? 2 : 8) : Cs.test(i) ? te : +i;
1754
+ }
1755
+ var zs = Fs;
1756
+ const Ws = /* @__PURE__ */ Ss(zs), Vs = (i, t = "highlight", e = "title") => {
1669
1757
  const s = (n, o, c) => {
1670
1758
  const l = o.split(".");
1671
- let h;
1672
- for (h = 0; h < l.length - 1; h++)
1673
- n = n[l[h]];
1674
- n[l[h]] = c;
1759
+ let a;
1760
+ for (a = 0; a < l.length - 1; a++)
1761
+ n = n[l[a]];
1762
+ n[l[a]] = c;
1675
1763
  }, r = (n, o = []) => {
1676
1764
  let c = "", l = 0;
1677
- return o.forEach((h) => {
1678
- const a = h[1] + 1;
1765
+ return o.forEach((a) => {
1766
+ const u = a[1] + 1;
1679
1767
  c += [
1680
- n.substring(l, h[0]),
1768
+ n.substring(l, a[0]),
1681
1769
  `<mark class="${t}">`,
1682
- n.substring(h[0], a),
1770
+ n.substring(a[0], u),
1683
1771
  "</mark>"
1684
- ].join(""), l = a;
1772
+ ].join(""), l = u;
1685
1773
  }), c += n.substring(l), c;
1686
1774
  };
1687
1775
  return i.filter(({ matches: n }) => n && n.length).map(({ item: n, matches: o }) => {
@@ -1694,12 +1782,11 @@ const $s = (i, t = "highlight", e = "title") => {
1694
1782
  );
1695
1783
  }), c;
1696
1784
  });
1697
- }, vs = `
1785
+ }, Ks = `
1698
1786
  :host {
1699
1787
  display: flex;
1700
1788
  box-sizing: border-box;
1701
1789
  height: 100%;
1702
- overflow: hidden;
1703
1790
  }
1704
1791
  *,
1705
1792
  *:before,
@@ -1733,6 +1820,14 @@ label {
1733
1820
  details {
1734
1821
  margin-bottom: 0.5rem;
1735
1822
  }
1823
+ details[open] {
1824
+ position: absolute;
1825
+ left: 16px;
1826
+ right: 12px;
1827
+ }
1828
+ details[open] summary {
1829
+ height: 30px;
1830
+ }
1736
1831
  details summary > * {
1737
1832
  display: inline;
1738
1833
  }
@@ -1740,28 +1835,28 @@ details summary {
1740
1835
  display: flex;
1741
1836
  align-items: center;
1742
1837
  }
1743
- #details-filter summary {
1838
+ .details-filter summary {
1744
1839
  justify-content: space-between;
1745
1840
  }
1746
1841
  #details-results summary {
1747
1842
  list-style: none;
1748
1843
  }
1749
- #details-filter summary svg,
1844
+ .details-filter summary svg,
1750
1845
  #details-results summary svg {
1751
- width: 24px;
1752
- height: 24px;
1846
+ width: 14px;
1847
+ height: 14px;
1753
1848
  transition: all ease-in-out 0.3s;
1754
1849
  }
1755
1850
  #details-results summary svg {
1756
1851
  transform: rotate(-90deg);
1757
1852
  }
1758
- #details-filter[open] summary svg {
1853
+ .details-filter[open] summary svg {
1759
1854
  transform: rotate(180deg);
1760
1855
  }
1761
1856
  #details-results[open] summary svg {
1762
1857
  transform: rotate(0deg);
1763
1858
  }
1764
- #details-filter li span,
1859
+ .details-filter li span,
1765
1860
  details summary {
1766
1861
  text-transform: capitalize;
1767
1862
  }
@@ -1807,78 +1902,172 @@ ul#results li {
1807
1902
  #filter-reset {
1808
1903
  cursor: pointer;
1809
1904
  }
1905
+ section.inline,
1906
+ section.inline > ul {
1907
+ display: flex;
1908
+ align-items: flex-start;
1909
+ flex-wrap: wrap;
1910
+ justify-content: space-between;
1911
+ margin: 0;
1912
+ }
1913
+ section.inline details.details-filter {
1914
+ background: lightgrey;
1915
+ border-radius: 13px;
1916
+ margin: 0;
1917
+ margin-right: 4px;
1918
+ padding: 4px 7px;
1919
+ }
1920
+ section.inline details.details-filter summary {
1921
+ display: flex;
1922
+ align-items: center;
1923
+ }
1810
1924
  .scroll {
1811
1925
  height: 100%;
1812
1926
  overflow-x: hidden;
1813
1927
  overflow-y: auto;
1814
1928
  }
1815
1929
  `;
1816
- var ys = Object.defineProperty, As = Object.getOwnPropertyDescriptor, H = (i, t, e, s) => {
1817
- for (var r = s > 1 ? void 0 : s ? As(t, e) : t, n = i.length - 1, o; n >= 0; n--)
1930
+ var Gs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, F = (i, t, e, s) => {
1931
+ for (var r = s > 1 ? void 0 : s ? Ys(t, e) : t, n = i.length - 1, o; n >= 0; n--)
1818
1932
  (o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
1819
- return s && r && ys(t, e, r), r;
1933
+ return s && r && Gs(t, e, r), r;
1820
1934
  };
1821
- let R = class extends Y {
1935
+ class se {
1822
1936
  constructor() {
1823
- super(...arguments);
1824
- x(this, "_fuse");
1825
- x(this, "_resultAggregation", []);
1826
- x(this, "_items", []);
1827
- x(this, "_results", []);
1828
- x(this, "_filters", {});
1829
- x(this, "_selectedResult");
1830
- x(this, "config", {
1831
- titleProperty: "title",
1832
- filterProperties: ["themes"],
1833
- aggregateResults: "themes",
1834
- fuseConfig: {},
1835
- enableSearch: !0,
1836
- enableHighlighting: !1,
1837
- onSelect: () => {
1838
- },
1839
- matchAllWhenEmpty: !0,
1840
- exclusiveFilters: !1
1937
+ /**
1938
+ * Aggregate results by a property key
1939
+ */
1940
+ m(this, "aggregateResults");
1941
+ /**
1942
+ * Highlighting of search result character matches
1943
+ */
1944
+ m(this, "enableHighlighting", !1);
1945
+ /**
1946
+ * Search functionality
1947
+ */
1948
+ m(this, "enableSearch", !1);
1949
+ /**
1950
+ * Make the filters mutually exclusive
1951
+ */
1952
+ m(this, "exclusiveFilters", !1);
1953
+ /**
1954
+ * Use an external search endpoint instead of fuse search.
1955
+ * Passed properties: input string, filters object
1956
+ */
1957
+ m(this, "externalSearch");
1958
+ /**
1959
+ * The filter properties.
1960
+ * @param filterProperties
1961
+ */
1962
+ m(this, "filterProperties", []);
1963
+ /**
1964
+ * Native fuse.js config override
1965
+ */
1966
+ m(this, "fuseConfig", {
1967
+ keys: ["title"]
1968
+ });
1969
+ /**
1970
+ * Inline mode, for rendering the itemfilter in avery condensed space.
1971
+ * Expexts showResults to be false and enableSearch to be true
1972
+ */
1973
+ m(this, "inlineMode", !1);
1974
+ /**
1975
+ * Show all result items if nothing is input by the user
1976
+ * @default true
1977
+ */
1978
+ m(this, "matchAllWhenEmpty", !0);
1979
+ /**
1980
+ * Callback that is triggered on item search
1981
+ * @returns result items
1982
+ */
1983
+ m(this, "onSearch", () => {
1841
1984
  });
1842
- x(this, "apply", (t) => {
1985
+ /**
1986
+ * Callback that is triggered on item selection
1987
+ * @returns selected item
1988
+ */
1989
+ m(this, "onSelect", () => {
1990
+ });
1991
+ /**
1992
+ * Display results list
1993
+ */
1994
+ m(this, "showResults", !0);
1995
+ /**
1996
+ * The property of the result items used for display
1997
+ */
1998
+ m(this, "titleProperty", "title");
1999
+ }
2000
+ }
2001
+ let k = class extends X {
2002
+ constructor() {
2003
+ super(...arguments);
2004
+ m(this, "_fuse");
2005
+ m(this, "_resultAggregation", []);
2006
+ m(this, "_items", []);
2007
+ m(this, "_results");
2008
+ m(this, "_filters", {});
2009
+ m(this, "_selectedResult");
2010
+ m(this, "_config", new se());
2011
+ m(this, "apply", (t) => {
1843
2012
  this._items = t.map((e, s) => ({
1844
2013
  ...e,
1845
2014
  id: `item-${s}`
1846
- })), this._fuse = new W(this._items, {
2015
+ })), this._fuse = new K(this._items, {
1847
2016
  minMatchCharLength: 3,
1848
2017
  // location: 0,
1849
2018
  threshold: 0.4,
1850
2019
  distance: 50,
1851
2020
  includeMatches: !0,
1852
2021
  useExtendedSearch: !0,
1853
- ...this.config.fuseConfig
1854
- }), this.config.filterProperties.forEach((e) => {
2022
+ ...this._config.fuseConfig
2023
+ }), this._config.filterProperties.length && this._config.filterProperties.forEach((e) => {
1855
2024
  const s = {};
1856
2025
  this._items.forEach((r) => {
1857
2026
  Array.isArray(r[e]) ? r[e].forEach((n) => {
1858
2027
  s[n] = void 0;
1859
2028
  }) : s[r[e]] = void 0;
1860
2029
  }), this._filters[e] = s;
1861
- }), this.config.matchAllWhenEmpty !== !1 && (this._results = this.sortResults(this._items), this.requestUpdate()), this.config.aggregateResults && (this._resultAggregation = [
2030
+ }), this._config.matchAllWhenEmpty !== !1 && (this._results = this.sortResults(this._items), this.requestUpdate()), this._config.aggregateResults && (this._resultAggregation = [
1862
2031
  ...new Set(
1863
- this._items.reduce((e, s) => e.concat(s[this.config.aggregateResults]), [])
2032
+ this._items.reduce((e, s) => e.concat(s[this._config.aggregateResults]), [])
1864
2033
  )
1865
2034
  ].sort());
1866
2035
  });
2036
+ m(this, "inputHandler", () => {
2037
+ this.search(this.renderRoot.querySelector("input[type='text']").value);
2038
+ });
2039
+ m(this, "debouncedInputHandler", Ws(this.inputHandler, 500, {
2040
+ leading: !0
2041
+ }));
2042
+ }
2043
+ set config(t) {
2044
+ const e = this._config;
2045
+ this._config = {
2046
+ ...new se(),
2047
+ ...t
2048
+ }, this.requestUpdate("config", e);
1867
2049
  }
1868
- search(t = "", e = this._filters) {
2050
+ get config() {
2051
+ return this._config;
2052
+ }
2053
+ async search(t = "", e = this._filters) {
1869
2054
  const s = Object.entries(e).reduce(
1870
2055
  (n, [o, c]) => {
1871
- const l = (h) => {
1872
- const a = {};
1873
- a[o] = `="${h}"`, n.push(a);
2056
+ const l = (a) => {
2057
+ const u = {};
2058
+ u[o] = `="${a}"`, n.push(u);
1874
2059
  };
1875
- return Object.entries(c).filter(([h, a]) => a).forEach(([h, a]) => l(h)), n;
2060
+ return Object.entries(c).filter(([a, u]) => u).forEach(([a, u]) => l(a)), n;
1876
2061
  },
1877
2062
  []
1878
2063
  );
1879
2064
  let r;
1880
- if (!(t.length > 2) && !s.length && this.config.matchAllWhenEmpty !== !1)
2065
+ if (!(t.length > 2) && !s.length && this._config.matchAllWhenEmpty !== !1)
1881
2066
  r = this._items;
2067
+ else if (this.config.externalSearch)
2068
+ r = (await (await fetch(
2069
+ `${this.config.externalSearch(t, e)}`
2070
+ )).json()).features;
1882
2071
  else {
1883
2072
  const n = {
1884
2073
  ...t.length > 2 && s.length ? {
@@ -1886,7 +2075,7 @@ let R = class extends Y {
1886
2075
  {
1887
2076
  $or: [
1888
2077
  // @ts-ignore
1889
- ...this.config.fuseConfig.keys.map((c) => ({
2078
+ ...this._config.fuseConfig.keys.map((c) => ({
1890
2079
  [c]: t
1891
2080
  }))
1892
2081
  ]
@@ -1898,7 +2087,7 @@ let R = class extends Y {
1898
2087
  } : {
1899
2088
  $or: [
1900
2089
  // @ts-ignore
1901
- ...this.config.fuseConfig.keys.map((c) => ({
2090
+ ...this._config.fuseConfig.keys.map((c) => ({
1902
2091
  [c]: t
1903
2092
  })),
1904
2093
  {
@@ -1907,17 +2096,17 @@ let R = class extends Y {
1907
2096
  ]
1908
2097
  }
1909
2098
  }, o = this._fuse.search(n);
1910
- r = this.config.enableHighlighting ? $s(o, "highlight", this.config.titleProperty) : o.map((c) => c.item);
2099
+ r = this._config.enableHighlighting ? Vs(o, "highlight", this._config.titleProperty) : o.map((c) => c.item);
1911
2100
  }
1912
- this._results = this.sortResults(r), this.requestUpdate();
2101
+ this._results = this.sortResults(r), this._config.onSearch(r), this.requestUpdate();
1913
2102
  }
1914
2103
  aggregateResults(t, e) {
1915
2104
  return t.filter((s) => {
1916
- const r = s[this.config.aggregateResults], n = Object.keys(
2105
+ const r = s[this._config.aggregateResults], n = Object.keys(
1917
2106
  // @ts-ignore
1918
- this._filters[this.config.aggregateResults]
2107
+ this._filters[this._config.aggregateResults]
1919
2108
  // @ts-ignore
1920
- ).filter((c) => this._filters[this.config.aggregateResults][c]);
2109
+ ).filter((c) => this._filters[this._config.aggregateResults][c]);
1921
2110
  return (n.length ? (
1922
2111
  // @ts-ignore
1923
2112
  n.includes(e)
@@ -1928,12 +2117,12 @@ let R = class extends Y {
1928
2117
  return [...t].sort(
1929
2118
  (e, s) => (
1930
2119
  // @ts-ignore
1931
- e[this.config.titleProperty] < s[this.config.titleProperty] ? -1 : 1
2120
+ e[this._config.titleProperty] < s[this._config.titleProperty] ? -1 : 1
1932
2121
  )
1933
2122
  );
1934
2123
  }
1935
2124
  toggleFilter(t, e) {
1936
- this.config.exclusiveFilters === !0 && Object.keys(this._filters).forEach((n) => {
2125
+ this._config.exclusiveFilters === !0 && Object.keys(this._filters).forEach((n) => {
1937
2126
  Object.keys(this._filters[n]).forEach((o) => {
1938
2127
  this._filters[n][o] = !1;
1939
2128
  });
@@ -1954,7 +2143,7 @@ let R = class extends Y {
1954
2143
  });
1955
2144
  }
1956
2145
  resetFilters() {
1957
- this.renderRoot.querySelectorAll("#details-filter input").forEach((e) => {
2146
+ this.renderRoot.querySelectorAll(".details-filter input").forEach((e) => {
1958
2147
  e.checked = !1;
1959
2148
  });
1960
2149
  const t = this.renderRoot.querySelector('input[type="text"]');
@@ -1965,180 +2154,240 @@ let R = class extends Y {
1965
2154
  }), this.search(), this.requestUpdate();
1966
2155
  }
1967
2156
  render() {
1968
- return k`
2157
+ return x`
1969
2158
  <style>
1970
- ${vs}
2159
+ ${Ks}
1971
2160
  </style>
1972
2161
  <form>
1973
- <section>
1974
- <input
1975
- type="text"
1976
- placeholder="Search"
1977
- style="display:${this.config.enableSearch ? "block" : "none"}"
1978
- @input="${(t) => this.search(t.target.value)}"
1979
- />
1980
- </section>
1981
- <section>
1982
- <slot name="filterstitle"></slot>
1983
- <ul id="filters">
1984
- ${V(
1985
- this.config.filterProperties,
1986
- (t) => k`
1987
- <details
1988
- id="details-filter"
1989
- data-filter="${t}"
1990
- @click=${() => this.renderRoot.querySelectorAll("details#details-filter").forEach((e) => {
1991
- e.getAttribute("data-filter") !== t && (e.removeAttribute("open"), this.requestUpdate());
1992
- })}
1993
- >
1994
- <summary>
1995
- <small>
1996
- <strong class="title"> ${t} </strong>
1997
- </small>
1998
- <div>
1999
- <svg
2000
- xmlns="http://www.w3.org/2000/svg"
2001
- viewBox="0 0 24 24"
2002
- >
2003
- <title>chevron-down</title>
2004
- <path
2005
- d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
2006
- />
2007
- </svg>
2008
- </div>
2009
- </summary>
2010
- <div class="scroll" style="max-height: 150px">
2011
- <ul>
2012
- ${// @ts-ignore
2013
- this._filters[t] ? V(
2014
- // @ts-ignore
2015
- Object.keys(this._filters[t]).sort(),
2016
- (e) => k`
2162
+ ${q(
2163
+ this._config.enableSearch,
2164
+ () => x`
2165
+ <section>
2166
+ <input
2167
+ type="text"
2168
+ placeholder="Type something..."
2169
+ data-cy="search"
2170
+ part="input-search"
2171
+ @input="${this.debouncedInputHandler}"
2172
+ />
2173
+ </section>
2174
+ `
2175
+ )}
2176
+ ${q(
2177
+ this._config.filterProperties.length,
2178
+ () => x`
2179
+ <section class="${this.config.inlineMode ? "inline" : _}">
2180
+ ${q(
2181
+ !this.config.inlineMode,
2182
+ () => x` <slot name="filterstitle"></slot> `
2183
+ )}
2184
+ <ul id="filters">
2185
+ ${J(
2186
+ this._config.filterProperties,
2187
+ (t) => x`
2188
+ <details
2189
+ class="details-filter"
2190
+ part="details-filter"
2191
+ data-filter="${t}"
2192
+ @click=${() => this.renderRoot.querySelectorAll("details.details-filter").forEach((e) => {
2193
+ e.getAttribute("data-filter") !== t && (e.removeAttribute("open"), this.requestUpdate());
2194
+ })}
2195
+ >
2196
+ <summary>
2197
+ <small>
2198
+ <strong class="title">
2199
+ ${t}
2200
+ ${// @ts-ignore
2201
+ Object.values(this._filters[t]).filter(
2202
+ (e) => e
2203
+ ).length ? `(${// @ts-ignore
2204
+ Object.values(this._filters[t]).filter(
2205
+ (e) => e
2206
+ ).length})` : _}
2207
+ </strong>
2208
+ </small>
2209
+ <div
2210
+ style="display: flex; align-items: center; justify-content: center; margin-left: 4px;"
2211
+ >
2212
+ <svg
2213
+ data-cy="expand-button"
2214
+ xmlns="http://www.w3.org/2000/svg"
2215
+ viewBox="6 6 12 12"
2216
+ >
2217
+ <title>chevron-down</title>
2218
+ <path
2219
+ d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
2220
+ />
2221
+ </svg>
2222
+ </div>
2223
+ </summary>
2224
+ <div class="scroll" style="max-height: 150px">
2225
+ <ul>
2226
+ ${// @ts-ignore
2227
+ this._filters[t] ? J(
2228
+ // @ts-ignore
2229
+ Object.keys(this._filters[t]).sort(),
2230
+ (e) => x`
2231
+ <li>
2232
+ <label>
2233
+ <input
2234
+ name="selection"
2235
+ type="${this._config.exclusiveFilters === !0 ? "radio" : "checkbox"}"
2236
+ checked="${// @ts-ignore
2237
+ this._filters[t][e] || _}"
2238
+ @click=${() => this.toggleFilter(t, e)}
2239
+ />
2240
+ <span class="title">${e}</span>
2241
+ </label>
2242
+ </li>
2243
+ `
2244
+ ) : null}
2245
+ </ul>
2246
+ </div>
2247
+ </details>
2248
+ `
2249
+ )}
2250
+ </ul>
2251
+ ${q(
2252
+ this._config.filterProperties,
2253
+ () => x`
2254
+ <a
2255
+ id="filter-reset"
2256
+ data-cy="filter-reset"
2257
+ @click=${() => this.resetFilters()}
2258
+ ><small>Reset filters</small></a
2259
+ >
2260
+ `
2261
+ )}
2262
+ </section>
2263
+ `
2264
+ )}
2265
+ ${q(
2266
+ this.config.showResults && this._results,
2267
+ () => x`
2268
+ <section id="section-results">
2269
+ <div>
2270
+ <slot name="resultstitle"></slot>
2271
+ </div>
2272
+ <div id="container-results" class="scroll">
2273
+ ${this._results.length < 1 ? x` <small class="no-results">No matching items</small> ` : _}
2274
+ <ul id="results" part="results">
2275
+ ${this._config.aggregateResults ? J(
2276
+ this._resultAggregation.filter(
2277
+ (t) => this.aggregateResults(
2278
+ this._results,
2279
+ t
2280
+ ).length
2281
+ ),
2282
+ (t) => x`<details
2283
+ id="details-results"
2284
+ open
2285
+ >
2286
+ <summary>
2287
+ <svg
2288
+ xmlns="http://www.w3.org/2000/svg"
2289
+ viewBox="0 0 24 24"
2290
+ >
2291
+ <title>chevron-down</title>
2292
+ <path
2293
+ d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
2294
+ />
2295
+ </svg>
2296
+ <strong class="title">
2297
+ ${t}
2298
+ </strong>
2299
+ <span style="margin-left: 0.25rem"
2300
+ >(${this.aggregateResults(
2301
+ this._results,
2302
+ t
2303
+ ).length})</span
2304
+ >
2305
+ </summary>
2306
+ <ul>
2307
+ ${J(
2308
+ this.aggregateResults(
2309
+ this._results,
2310
+ t
2311
+ ),
2312
+ // @ts-ignore
2313
+ (e) => x`
2017
2314
  <li>
2018
2315
  <label>
2019
2316
  <input
2020
- name="selection"
2021
- type="${this.config.exclusiveFilters === !0 ? "radio" : "checkbox"}"
2022
- checked="${// @ts-ignore
2023
- this._filters[t][e] || _}"
2024
- @click=${() => this.toggleFilter(t, e)}
2317
+ type="radio"
2318
+ name="result"
2319
+ id="${// @ts-ignore
2320
+ e.id}"
2321
+ @click=${() => {
2322
+ this._selectedResult = e, this._config.onSelect(e);
2323
+ }}
2025
2324
  />
2026
- <span class="title">${e}</span>
2325
+ <span class="title"
2326
+ >${Yt(
2327
+ // @ts-ignore
2328
+ e[this._config.titleProperty]
2329
+ )}</span
2330
+ >
2027
2331
  </label>
2028
2332
  </li>
2029
2333
  `
2030
- ) : null}
2031
- </ul>
2032
- </div>
2033
- </details>
2034
- `
2035
- )}
2036
- </ul>
2037
- <a id="filter-reset" @click=${() => this.resetFilters()}
2038
- ><small>Reset filters</small></a
2039
- >
2040
- </section>
2041
- <section id="section-results">
2042
- <div>
2043
- <slot name="resultstitle"></slot>
2044
- </div>
2045
- <div id="container-results" class="scroll">
2046
- ${this._results.length < 1 ? k` <small class="no-results">No matching items</small> ` : _}
2047
- <ul id="results">
2048
- ${this.config.aggregateResults ? V(
2049
- this._resultAggregation.filter(
2050
- (t) => this.aggregateResults(
2051
- this._results,
2052
- t
2053
- ).length
2054
- ),
2055
- (t) => k`<details
2056
- id="details-results"
2057
- open
2058
- >
2059
- <summary>
2060
- <svg
2061
- xmlns="http://www.w3.org/2000/svg"
2062
- viewBox="0 0 24 24"
2063
- >
2064
- <title>chevron-down</title>
2065
- <path
2066
- d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
2067
- />
2068
- </svg>
2069
- <strong class="title"> ${t} </strong>
2070
- <span style="margin-left: 0.25rem"
2071
- >(${this.aggregateResults(
2334
+ )}
2335
+ </ul>
2336
+ </details>`
2337
+ ) : J(
2072
2338
  this._results,
2073
- t
2074
- ).length})</span
2075
- >
2076
- </summary>
2077
- <ul>
2078
- ${V(
2079
- this.aggregateResults(
2080
- this._results,
2081
- t
2082
- ),
2083
2339
  // @ts-ignore
2084
- (e) => k`
2085
- <li>
2086
- <label>
2087
- <input
2088
- type="radio"
2089
- name="result"
2090
- id="${// @ts-ignore
2091
- e.id}"
2092
- @click=${() => {
2093
- this._selectedResult = e, this.config.onSelect(e);
2094
- }}
2095
- />
2096
- <span class="title"
2097
- >${// @ts-ignore
2098
- Bt(e[this.config.titleProperty])}</span
2099
- >
2100
- </label>
2101
- </li>
2102
- `
2340
+ (t) => x`<li part="result">
2341
+ ${// @ts-ignore
2342
+ Yt(t[this._config.titleProperty])}
2343
+ </li>`
2103
2344
  )}
2104
- </ul>
2105
- </details>`
2106
- ) : V(
2107
- this._results,
2108
- // @ts-ignore
2109
- (t) => k`<li>
2110
- ${// @ts-ignore
2111
- Bt(t[this.config.titleProperty])}
2112
- </li>`
2345
+ </ul>
2346
+ </div>
2347
+ </section>
2348
+ `
2113
2349
  )}
2114
- </ul>
2115
- </div>
2116
- </section>
2117
2350
  </form>
2118
2351
  `;
2119
2352
  }
2353
+ // protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
2354
+ // function parseStringTemplate(str, obj, key) {
2355
+ // const strP = str.replaceAll(`${key}.`, '')
2356
+ // let parts = strP.split(/\$\{(?!\d)[\wæøåÆØÅ]*\}/);
2357
+ // let args = strP.match(/[^{\}]+(?=})/g) || [];
2358
+ // let parameters = args.map(argument => obj[argument] || (obj[argument] === undefined ? "" : obj[argument]));
2359
+ // return String.raw({ raw: parts }, ...parameters);
2360
+ // }
2361
+ // const slot = this.shadowRoot.querySelector('slot[name=results]');
2362
+ // const template = slot.assignedElements({flatten: true})[0]
2363
+ // const dataType = template.getAttribute('data-type')
2364
+ // const pT = parseStringTemplate(template.innerHTML, this[dataType], dataType);
2365
+ // template.innerHTML = pT
2366
+ // let clon = template.content.cloneNode(true);
2367
+ // slot.replaceWith(clon);
2368
+ // }
2120
2369
  };
2121
- H([
2122
- ot()
2123
- ], R.prototype, "_items", 2);
2124
- H([
2125
- ot()
2126
- ], R.prototype, "_results", 2);
2127
- H([
2128
- ot()
2129
- ], R.prototype, "_filters", 2);
2130
- H([
2131
- ot()
2132
- ], R.prototype, "_selectedResult", 2);
2133
- H([
2134
- Mt({ attribute: !1 })
2135
- ], R.prototype, "config", 2);
2136
- H([
2137
- Mt()
2138
- ], R.prototype, "apply", 2);
2139
- R = H([
2140
- Me("eox-itemfilter")
2141
- ], R);
2370
+ F([
2371
+ ht()
2372
+ ], k.prototype, "_items", 2);
2373
+ F([
2374
+ ht()
2375
+ ], k.prototype, "_results", 2);
2376
+ F([
2377
+ ht()
2378
+ ], k.prototype, "_filters", 2);
2379
+ F([
2380
+ ht()
2381
+ ], k.prototype, "_selectedResult", 2);
2382
+ F([
2383
+ Tt({ attribute: !1 })
2384
+ ], k.prototype, "config", 1);
2385
+ F([
2386
+ Tt()
2387
+ ], k.prototype, "apply", 2);
2388
+ k = F([
2389
+ Le("eox-itemfilter")
2390
+ ], k);
2142
2391
  export {
2143
- R as EOxItemFilter
2392
+ k as EOxItemFilter
2144
2393
  };