@eox/itemfilter 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,57 +1,708 @@
1
- var he = Object.defineProperty;
2
- var ue = (s, e, t) => e in s ? he(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var b = (s, e, t) => (ue(s, typeof e != "symbol" ? e + "" : e, t), t);
4
- function L(s) {
5
- return Array.isArray ? Array.isArray(s) : se(s) === "[object Array]";
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);
4
+ /**
5
+ * @license
6
+ * Copyright 2019 Google LLC
7
+ * SPDX-License-Identifier: BSD-3-Clause
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 {
11
+ constructor(t, e, s) {
12
+ if (this._$cssResult$ = !0, s !== Jt)
13
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
14
+ this.cssText = t, this.t = e;
15
+ }
16
+ get styleSheet() {
17
+ let t = this.o;
18
+ const e = this.t;
19
+ if (wt && t === void 0) {
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));
22
+ }
23
+ return t;
24
+ }
25
+ toString() {
26
+ return this.cssText;
27
+ }
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;
32
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
33
+ });
34
+ }, Nt = wt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
35
+ let e = "";
36
+ for (const s of t.cssRules)
37
+ e += s.cssText;
38
+ return fe(e);
39
+ })(i) : i;
40
+ /**
41
+ * @license
42
+ * Copyright 2017 Google LLC
43
+ * SPDX-License-Identifier: BSD-3-Clause
44
+ */
45
+ var ht;
46
+ const st = window, Ot = st.trustedTypes, ge = Ot ? Ot.emptyScript : "", kt = st.reactiveElementPolyfillSupport, _t = { toAttribute(i, t) {
47
+ switch (t) {
48
+ case Boolean:
49
+ i = i ? ge : null;
50
+ break;
51
+ case Object:
52
+ case Array:
53
+ i = i == null ? i : JSON.stringify(i);
54
+ }
55
+ return i;
56
+ }, fromAttribute(i, t) {
57
+ let e = i;
58
+ switch (t) {
59
+ case Boolean:
60
+ e = i !== null;
61
+ break;
62
+ case Number:
63
+ e = i === null ? null : Number(i);
64
+ break;
65
+ case Object:
66
+ case Array:
67
+ try {
68
+ e = JSON.parse(i);
69
+ } catch {
70
+ e = null;
71
+ }
72
+ }
73
+ return e;
74
+ } }, Qt = (i, t) => t !== i && (t == t || i == i), at = { attribute: !0, type: String, converter: _t, reflect: !1, hasChanged: Qt };
75
+ let z = class extends HTMLElement {
76
+ constructor() {
77
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
78
+ }
79
+ static addInitializer(t) {
80
+ var e;
81
+ this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
82
+ }
83
+ static get observedAttributes() {
84
+ this.finalize();
85
+ const t = [];
86
+ return this.elementProperties.forEach((e, s) => {
87
+ const r = this._$Ep(s, e);
88
+ r !== void 0 && (this._$Ev.set(r, s), t.push(r));
89
+ }), t;
90
+ }
91
+ static createProperty(t, e = at) {
92
+ if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
93
+ const s = typeof t == "symbol" ? Symbol() : "__" + t, r = this.getPropertyDescriptor(t, s, e);
94
+ r !== void 0 && Object.defineProperty(this.prototype, t, r);
95
+ }
96
+ }
97
+ static getPropertyDescriptor(t, e, s) {
98
+ return { get() {
99
+ return this[e];
100
+ }, set(r) {
101
+ const n = this[t];
102
+ this[e] = r, this.requestUpdate(t, n, s);
103
+ }, configurable: !0, enumerable: !0 };
104
+ }
105
+ static getPropertyOptions(t) {
106
+ return this.elementProperties.get(t) || at;
107
+ }
108
+ static finalize() {
109
+ if (this.hasOwnProperty("finalized"))
110
+ return !1;
111
+ this.finalized = !0;
112
+ const t = Object.getPrototypeOf(this);
113
+ if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
114
+ const e = this.properties, s = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
115
+ for (const r of s)
116
+ this.createProperty(r, e[r]);
117
+ }
118
+ return this.elementStyles = this.finalizeStyles(this.styles), !0;
119
+ }
120
+ static finalizeStyles(t) {
121
+ const e = [];
122
+ if (Array.isArray(t)) {
123
+ const s = new Set(t.flat(1 / 0).reverse());
124
+ for (const r of s)
125
+ e.unshift(Nt(r));
126
+ } else
127
+ t !== void 0 && e.push(Nt(t));
128
+ return e;
129
+ }
130
+ static _$Ep(t, e) {
131
+ const s = e.attribute;
132
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
133
+ }
134
+ u() {
135
+ var t;
136
+ this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this));
137
+ }
138
+ addController(t) {
139
+ var e, s;
140
+ ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((s = t.hostConnected) === null || s === void 0 || s.call(t));
141
+ }
142
+ removeController(t) {
143
+ var e;
144
+ (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1);
145
+ }
146
+ _$Eg() {
147
+ this.constructor.elementProperties.forEach((t, e) => {
148
+ this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
149
+ });
150
+ }
151
+ createRenderRoot() {
152
+ var t;
153
+ const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
154
+ return pe(e, this.constructor.elementStyles), e;
155
+ }
156
+ connectedCallback() {
157
+ var t;
158
+ this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
159
+ var s;
160
+ return (s = e.hostConnected) === null || s === void 0 ? void 0 : s.call(e);
161
+ });
162
+ }
163
+ enableUpdating(t) {
164
+ }
165
+ disconnectedCallback() {
166
+ var t;
167
+ (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
168
+ var s;
169
+ return (s = e.hostDisconnected) === null || s === void 0 ? void 0 : s.call(e);
170
+ });
171
+ }
172
+ attributeChangedCallback(t, e, s) {
173
+ this._$AK(t, s);
174
+ }
175
+ _$EO(t, e, s = at) {
176
+ var r;
177
+ const n = this.constructor._$Ep(t, s);
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 : _t).toAttribute(e, s.type);
180
+ this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
181
+ }
182
+ }
183
+ _$AK(t, e) {
184
+ var s;
185
+ const r = this.constructor, n = r._$Ev.get(t);
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 : _t;
188
+ this._$El = n, this[n] = c.fromAttribute(e, o.type), this._$El = null;
189
+ }
190
+ }
191
+ requestUpdate(t, e, s) {
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());
194
+ }
195
+ async _$Ej() {
196
+ this.isUpdatePending = !0;
197
+ try {
198
+ await this._$E_;
199
+ } catch (e) {
200
+ Promise.reject(e);
201
+ }
202
+ const t = this.scheduleUpdate();
203
+ return t != null && await t, !this.isUpdatePending;
204
+ }
205
+ scheduleUpdate() {
206
+ return this.performUpdate();
207
+ }
208
+ performUpdate() {
209
+ var t;
210
+ if (!this.isUpdatePending)
211
+ return;
212
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((r, n) => this[n] = r), this._$Ei = void 0);
213
+ let e = !1;
214
+ const s = this._$AL;
215
+ try {
216
+ e = this.shouldUpdate(s), e ? (this.willUpdate(s), (t = this._$ES) === null || t === void 0 || t.forEach((r) => {
217
+ var n;
218
+ return (n = r.hostUpdate) === null || n === void 0 ? void 0 : n.call(r);
219
+ }), this.update(s)) : this._$Ek();
220
+ } catch (r) {
221
+ throw e = !1, this._$Ek(), r;
222
+ }
223
+ e && this._$AE(s);
224
+ }
225
+ willUpdate(t) {
226
+ }
227
+ _$AE(t) {
228
+ var e;
229
+ (e = this._$ES) === null || e === void 0 || e.forEach((s) => {
230
+ var r;
231
+ return (r = s.hostUpdated) === null || r === void 0 ? void 0 : r.call(s);
232
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
233
+ }
234
+ _$Ek() {
235
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
236
+ }
237
+ get updateComplete() {
238
+ return this.getUpdateComplete();
239
+ }
240
+ getUpdateComplete() {
241
+ return this._$E_;
242
+ }
243
+ shouldUpdate(t) {
244
+ return !0;
245
+ }
246
+ update(t) {
247
+ this._$EC !== void 0 && (this._$EC.forEach((e, s) => this._$EO(s, this[s], e)), this._$EC = void 0), this._$Ek();
248
+ }
249
+ updated(t) {
250
+ }
251
+ firstUpdated(t) {
252
+ }
253
+ };
254
+ z.finalized = !0, z.elementProperties = /* @__PURE__ */ new Map(), z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, kt == null || kt({ ReactiveElement: z }), ((ht = st.reactiveElementVersions) !== null && ht !== void 0 ? ht : st.reactiveElementVersions = []).push("1.6.1");
255
+ /**
256
+ * @license
257
+ * Copyright 2017 Google LLC
258
+ * SPDX-License-Identifier: BSD-3-Clause
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, me = `<${Xt}>`, T = document, G = () => T.createComment(""), J = (i) => i === null || typeof i != "object" && typeof i != "function", Zt = Array.isArray, _e = (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, N = 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 }), O = $e(1), U = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), P = T.createTreeWalker(T, 129, null, !1), ve = (i, t) => {
264
+ const e = i.length - 1, s = [];
265
+ let r, n = t === 2 ? "<svg>" : "", o = K;
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 = N) : u[3] !== void 0 && (o = N) : o === N ? 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 ? N : u[3] === '"' ? jt : Ht) : o === jt || o === Ht ? o = N : o === Tt || o === Ut ? o = K : (o = N, r = void 0);
271
+ const g = o === N && i[l + 1].startsWith("/>") ? " " : "";
272
+ n += o === K ? h + me : 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);
273
+ }
274
+ const c = n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "");
275
+ if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
276
+ throw Error("invalid template strings array");
277
+ return [Pt !== void 0 ? Pt.createHTML(c) : c, s];
278
+ };
279
+ class Q {
280
+ constructor({ strings: t, _$litType$: e }, s) {
281
+ let r;
282
+ this.parts = [];
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);
288
+ }
289
+ for (; (r = P.nextNode()) !== null && l.length < c; ) {
290
+ if (r.nodeType === 1) {
291
+ if (r.hasAttributes()) {
292
+ const u = [];
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), _ = /([.?@])?(.*)/.exec(p);
298
+ l.push({ type: 1, index: n, name: _[2], strings: g, ctor: _[1] === "." ? Ae : _[1] === "?" ? xe : _[1] === "@" ? Se : nt });
299
+ } else
300
+ l.push({ type: 6, index: n });
301
+ }
302
+ for (const d of u)
303
+ r.removeAttribute(d);
304
+ }
305
+ if (qt.test(r.tagName)) {
306
+ const u = r.textContent.split(M), d = u.length - 1;
307
+ if (d > 0) {
308
+ r.textContent = D ? D.emptyScript : "";
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());
312
+ }
313
+ }
314
+ } else if (r.nodeType === 8)
315
+ if (r.data === Xt)
316
+ l.push({ type: 2, index: n });
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;
321
+ }
322
+ n++;
323
+ }
324
+ }
325
+ static createElement(t, e) {
326
+ const s = T.createElement("template");
327
+ return s.innerHTML = t, s;
328
+ }
329
+ }
330
+ function B(i, t, e = i, s) {
331
+ var r, n, o, c;
332
+ if (t === U)
333
+ return t;
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;
337
+ }
338
+ class ye {
339
+ constructor(t, e) {
340
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
341
+ }
342
+ get parentNode() {
343
+ return this._$AM.parentNode;
344
+ }
345
+ get _$AU() {
346
+ return this._$AM._$AU;
347
+ }
348
+ u(t) {
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];
357
+ }
358
+ c !== (h == null ? void 0 : h.index) && (o = P.nextNode(), c++);
359
+ }
360
+ return P.currentNode = T, n;
361
+ }
362
+ v(t) {
363
+ let e = 0;
364
+ for (const s of this._$AV)
365
+ s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
366
+ }
367
+ }
368
+ class X {
369
+ constructor(t, e, s, r) {
370
+ var n;
371
+ this.type = 2, this._$AH = m, 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;
372
+ }
373
+ get _$AU() {
374
+ var t, e;
375
+ return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
376
+ }
377
+ get parentNode() {
378
+ let t = this._$AA.parentNode;
379
+ const e = this._$AM;
380
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
381
+ }
382
+ get startNode() {
383
+ return this._$AA;
384
+ }
385
+ get endNode() {
386
+ return this._$AB;
387
+ }
388
+ _$AI(t, e = this) {
389
+ t = B(this, t, e), J(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : _e(t) ? this.T(t) : this._(t);
390
+ }
391
+ k(t) {
392
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
393
+ }
394
+ $(t) {
395
+ this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
396
+ }
397
+ _(t) {
398
+ this._$AH !== m && J(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
399
+ }
400
+ g(t) {
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);
403
+ if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n)
404
+ this._$AH.v(s);
405
+ else {
406
+ const o = new ye(n, this), c = o.u(this.options);
407
+ o.v(s), this.$(c), this._$AH = o;
408
+ }
409
+ }
410
+ _$AC(t) {
411
+ let e = Ft.get(t.strings);
412
+ return e === void 0 && Ft.set(t.strings, e = new Q(t)), e;
413
+ }
414
+ T(t) {
415
+ Zt(this._$AH) || (this._$AH = [], this._$AR());
416
+ const e = this._$AH;
417
+ let s, r = 0;
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++;
420
+ r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
421
+ }
422
+ _$AR(t = this._$AA.nextSibling, e) {
423
+ var s;
424
+ for ((s = this._$AP) === null || s === void 0 || s.call(this, !1, !0, e); t && t !== this._$AB; ) {
425
+ const r = t.nextSibling;
426
+ t.remove(), t = r;
427
+ }
428
+ }
429
+ setConnected(t) {
430
+ var e;
431
+ this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
432
+ }
433
+ }
434
+ class nt {
435
+ constructor(t, e, s, r, n) {
436
+ this.type = 1, this._$AH = m, 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 = m;
437
+ }
438
+ get tagName() {
439
+ return this.element.tagName;
440
+ }
441
+ get _$AU() {
442
+ return this._$AM._$AU;
443
+ }
444
+ _$AI(t, e = this, s, r) {
445
+ const n = this.strings;
446
+ let o = !1;
447
+ if (n === void 0)
448
+ t = B(this, t, e, 0), o = !J(t) || t !== this._$AH && t !== U, o && (this._$AH = t);
449
+ else {
450
+ const c = t;
451
+ let l, h;
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 === m ? t = m : t !== m && (t += (h ?? "") + n[l + 1]), this._$AH[l] = h;
454
+ }
455
+ o && !r && this.j(t);
456
+ }
457
+ j(t) {
458
+ t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
+ }
460
+ }
461
+ class Ae extends nt {
462
+ constructor() {
463
+ super(...arguments), this.type = 3;
464
+ }
465
+ j(t) {
466
+ this.element[this.name] = t === m ? void 0 : t;
467
+ }
468
+ }
469
+ const Ee = D ? D.emptyScript : "";
470
+ class xe extends nt {
471
+ constructor() {
472
+ super(...arguments), this.type = 4;
473
+ }
474
+ j(t) {
475
+ t && t !== m ? this.element.setAttribute(this.name, Ee) : this.element.removeAttribute(this.name);
476
+ }
477
+ }
478
+ class Se extends nt {
479
+ constructor(t, e, s, r, n) {
480
+ super(t, e, s, r, n), this.type = 5;
481
+ }
482
+ _$AI(t, e = this) {
483
+ var s;
484
+ if ((t = (s = B(this, t, e, 0)) !== null && s !== void 0 ? s : m) === U)
485
+ return;
486
+ const r = this._$AH, n = t === m && r !== m || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, o = t !== m && (r === m || n);
487
+ n && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
488
+ }
489
+ handleEvent(t) {
490
+ var e, s;
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
+ }
493
+ }
494
+ class be {
495
+ constructor(t, e, s) {
496
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
497
+ }
498
+ get _$AU() {
499
+ return this._$AM._$AU;
500
+ }
501
+ _$AI(t) {
502
+ B(this, t);
503
+ }
6
504
  }
7
- const fe = 1 / 0;
8
- function de(s) {
9
- if (typeof s == "string")
10
- return s;
11
- let e = s + "";
12
- return e == "0" && 1 / s == -fe ? "-0" : e;
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) => {
508
+ var s, r;
509
+ const n = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : t;
510
+ let o = n._$litPart$;
511
+ if (o === void 0) {
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 ?? {});
514
+ }
515
+ return o._$AI(i), o;
516
+ };
517
+ /**
518
+ * @license
519
+ * Copyright 2017 Google LLC
520
+ * SPDX-License-Identifier: BSD-3-Clause
521
+ */
522
+ var ft, pt;
523
+ class Y extends z {
524
+ constructor() {
525
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
526
+ }
527
+ createRenderRoot() {
528
+ var t, e;
529
+ const s = super.createRenderRoot();
530
+ return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = s.firstChild), s;
531
+ }
532
+ update(t) {
533
+ const e = this.render();
534
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = we(e, this.renderRoot, this.renderOptions);
535
+ }
536
+ connectedCallback() {
537
+ var t;
538
+ super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0);
539
+ }
540
+ disconnectedCallback() {
541
+ var t;
542
+ super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
543
+ }
544
+ render() {
545
+ return U;
546
+ }
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");
552
+ /**
553
+ * @license
554
+ * Copyright 2017 Google LLC
555
+ * SPDX-License-Identifier: BSD-3-Clause
556
+ */
557
+ const Me = (i) => (t) => typeof t == "function" ? ((e, s) => (customElements.define(e, s), s))(i, t) : ((e, s) => {
558
+ const { kind: r, elements: n } = s;
559
+ return { kind: r, elements: n, finisher(o) {
560
+ customElements.define(e, o);
561
+ } };
562
+ })(i, t);
563
+ /**
564
+ * @license
565
+ * Copyright 2017 Google LLC
566
+ * SPDX-License-Identifier: BSD-3-Clause
567
+ */
568
+ const Ce = (i, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) {
569
+ e.createProperty(t.key, i);
570
+ } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() {
571
+ typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this));
572
+ }, finisher(e) {
573
+ e.createProperty(t.key, i);
574
+ } };
575
+ function Mt(i) {
576
+ return (t, e) => e !== void 0 ? ((s, r, n) => {
577
+ r.constructor.createProperty(n, s);
578
+ })(i, t, e) : Ce(i, t);
579
+ }
580
+ /**
581
+ * @license
582
+ * Copyright 2017 Google LLC
583
+ * SPDX-License-Identifier: BSD-3-Clause
584
+ */
585
+ function ot(i) {
586
+ return Mt({ ...i, state: !0 });
587
+ }
588
+ /**
589
+ * @license
590
+ * Copyright 2021 Google LLC
591
+ * SPDX-License-Identifier: BSD-3-Clause
592
+ */
593
+ var gt;
594
+ ((gt = window.HTMLSlotElement) === null || gt === void 0 ? void 0 : gt.prototype.assignedElements) != null;
595
+ /**
596
+ * @license
597
+ * Copyright 2021 Google LLC
598
+ * SPDX-License-Identifier: BSD-3-Clause
599
+ */
600
+ function* V(i, t) {
601
+ if (i !== void 0) {
602
+ let e = 0;
603
+ for (const s of i)
604
+ yield t(s, e++);
605
+ }
606
+ }
607
+ /**
608
+ * @license
609
+ * Copyright 2017 Google LLC
610
+ * SPDX-License-Identifier: BSD-3-Clause
611
+ */
612
+ const Re = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Ie = (i) => (...t) => ({ _$litDirective$: i, values: t });
613
+ class Le {
614
+ constructor(t) {
615
+ }
616
+ get _$AU() {
617
+ return this._$AM._$AU;
618
+ }
619
+ _$AT(t, e, s) {
620
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
621
+ }
622
+ _$AS(t, e) {
623
+ return this.update(t, e);
624
+ }
625
+ update(t, e) {
626
+ return this.render(...e);
627
+ }
628
+ }
629
+ /**
630
+ * @license
631
+ * Copyright 2017 Google LLC
632
+ * SPDX-License-Identifier: BSD-3-Clause
633
+ */
634
+ class vt extends Le {
635
+ constructor(t) {
636
+ if (super(t), this.et = m, t.type !== Re.CHILD)
637
+ throw Error(this.constructor.directiveName + "() can only be used in child bindings");
638
+ }
639
+ render(t) {
640
+ if (t === m || t == null)
641
+ return this.ft = void 0, this.et = t;
642
+ if (t === U)
643
+ return t;
644
+ if (typeof t != "string")
645
+ throw Error(this.constructor.directiveName + "() called with a non-string value");
646
+ if (t === this.et)
647
+ return this.ft;
648
+ this.et = t;
649
+ const e = [t];
650
+ return e.raw = e, this.ft = { _$litType$: this.constructor.resultType, strings: e, values: [] };
651
+ }
652
+ }
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]";
657
+ }
658
+ const Ne = 1 / 0;
659
+ function Oe(i) {
660
+ if (typeof i == "string")
661
+ return i;
662
+ let t = i + "";
663
+ return t == "0" && 1 / i == -Ne ? "-0" : t;
13
664
  }
14
- function ge(s) {
15
- return s == null ? "" : de(s);
665
+ function ke(i) {
666
+ return i == null ? "" : Oe(i);
16
667
  }
17
- function w(s) {
18
- return typeof s == "string";
668
+ function A(i) {
669
+ return typeof i == "string";
19
670
  }
20
- function ee(s) {
21
- return typeof s == "number";
671
+ function te(i) {
672
+ return typeof i == "number";
22
673
  }
23
- function pe(s) {
24
- return s === !0 || s === !1 || me(s) && se(s) == "[object Boolean]";
674
+ function Pe(i) {
675
+ return i === !0 || i === !1 || Te(i) && se(i) == "[object Boolean]";
25
676
  }
26
- function te(s) {
27
- return typeof s == "object";
677
+ function ee(i) {
678
+ return typeof i == "object";
28
679
  }
29
- function me(s) {
30
- return te(s) && s !== null;
680
+ function Te(i) {
681
+ return ee(i) && i !== null;
31
682
  }
32
- function y(s) {
33
- return s != null;
683
+ function $(i) {
684
+ return i != null;
34
685
  }
35
- function P(s) {
36
- return !s.trim().length;
686
+ function mt(i) {
687
+ return !i.trim().length;
37
688
  }
38
- function se(s) {
39
- return s == null ? s === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(s);
689
+ function se(i) {
690
+ return i == null ? i === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(i);
40
691
  }
41
- const ye = "Incorrect 'index' type", xe = (s) => `Invalid value for key ${s}`, Me = (s) => `Pattern length exceeds max of ${s}.`, Ee = (s) => `Missing ${s} property in key`, we = (s) => `Property 'weight' in key '${s}' must be a positive integer`, G = Object.prototype.hasOwnProperty;
42
- class Se {
43
- constructor(e) {
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 {
694
+ constructor(t) {
44
695
  this._keys = [], this._keyMap = {};
45
- let t = 0;
46
- e.forEach((r) => {
47
- let i = ie(r);
48
- t += i.weight, this._keys.push(i), this._keyMap[i.id] = i, t += i.weight;
49
- }), this._keys.forEach((r) => {
50
- r.weight /= t;
696
+ let e = 0;
697
+ t.forEach((s) => {
698
+ let r = ie(s);
699
+ e += r.weight, this._keys.push(r), this._keyMap[r.id] = r, e += r.weight;
700
+ }), this._keys.forEach((s) => {
701
+ s.weight /= e;
51
702
  });
52
703
  }
53
- get(e) {
54
- return this._keyMap[e];
704
+ get(t) {
705
+ return this._keyMap[t];
55
706
  }
56
707
  keys() {
57
708
  return this._keys;
@@ -60,50 +711,50 @@ class Se {
60
711
  return JSON.stringify(this._keys);
61
712
  }
62
713
  }
63
- function ie(s) {
64
- let e = null, t = null, r = null, i = 1, c = null;
65
- if (w(s) || L(s))
66
- r = s, e = Q(s), t = B(s);
714
+ function ie(i) {
715
+ 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);
67
718
  else {
68
- if (!G.call(s, "name"))
69
- throw new Error(Ee("name"));
70
- const n = s.name;
71
- if (r = n, G.call(s, "weight") && (i = s.weight, i <= 0))
72
- throw new Error(we(n));
73
- e = Q(n), t = B(n), c = s.getFn;
74
- }
75
- return { path: e, id: t, weight: i, src: r, getFn: c };
76
- }
77
- function Q(s) {
78
- return L(s) ? s : s.split(".");
79
- }
80
- function B(s) {
81
- return L(s) ? s.join(".") : s;
82
- }
83
- function Le(s, e) {
84
- let t = [], r = !1;
85
- const i = (c, n, o) => {
86
- if (y(c))
87
- if (!n[o])
88
- t.push(c);
719
+ if (!Wt.call(i, "name"))
720
+ throw new Error(Fe("name"));
721
+ 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;
725
+ }
726
+ return { path: t, id: e, weight: r, src: s, getFn: n };
727
+ }
728
+ function Kt(i) {
729
+ return S(i) ? i : i.split(".");
730
+ }
731
+ function yt(i) {
732
+ return S(i) ? i.join(".") : i;
733
+ }
734
+ function Be(i, t) {
735
+ let e = [], s = !1;
736
+ const r = (n, o, c) => {
737
+ if ($(n))
738
+ if (!o[c])
739
+ e.push(n);
89
740
  else {
90
- let l = n[o];
91
- const a = c[l];
92
- if (!y(a))
741
+ let l = o[c];
742
+ const h = n[l];
743
+ if (!$(h))
93
744
  return;
94
- if (o === n.length - 1 && (w(a) || ee(a) || pe(a)))
95
- t.push(ge(a));
96
- else if (L(a)) {
97
- r = !0;
98
- for (let h = 0, u = a.length; h < u; h += 1)
99
- i(a[h], n, o + 1);
745
+ if (c === o.length - 1 && (A(h) || te(h) || Pe(h)))
746
+ e.push(ke(h));
747
+ else if (S(h)) {
748
+ s = !0;
749
+ for (let a = 0, u = h.length; a < u; a += 1)
750
+ r(h[a], o, c + 1);
100
751
  } else
101
- n.length && i(a, n, o + 1);
752
+ o.length && r(h, o, c + 1);
102
753
  }
103
754
  };
104
- return i(s, w(e) ? e.split(".") : e, 0), r ? t : t[0];
755
+ return r(i, A(t) ? t.split(".") : t, 0), s ? e : e[0];
105
756
  }
106
- const Ae = {
757
+ const We = {
107
758
  // Whether the matches should be included in the result set. When `true`, each record in the result
108
759
  // set will include the indices of the matched characters.
109
760
  // These can consequently be used for highlighting purposes.
@@ -113,7 +764,7 @@ const Ae = {
113
764
  findAllMatches: !1,
114
765
  // Minimum number of characters that must be matched before a result is considered a match
115
766
  minMatchCharLength: 1
116
- }, Ie = {
767
+ }, Ke = {
117
768
  // When `true`, the algorithm continues searching to the end of the input even if a perfect
118
769
  // match is found before the end of the same input.
119
770
  isCaseSensitive: !1,
@@ -124,8 +775,8 @@ const Ae = {
124
775
  // Whether to sort the result list, by score
125
776
  shouldSort: !0,
126
777
  // Default sort function: sort by ascending score, ascending index
127
- sortFn: (s, e) => s.score === e.score ? s.idx < e.idx ? -1 : 1 : s.score < e.score ? -1 : 1
128
- }, be = {
778
+ sortFn: (i, t) => i.score === t.score ? i.idx < t.idx ? -1 : 1 : i.score < t.score ? -1 : 1
779
+ }, Ve = {
129
780
  // Approximately where in the text is the pattern expected to be found?
130
781
  location: 0,
131
782
  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
@@ -137,12 +788,12 @@ const Ae = {
137
788
  // the exact location specified, a threshold of '1000' would require a perfect match
138
789
  // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
139
790
  distance: 100
140
- }, _e = {
791
+ }, Ye = {
141
792
  // When `true`, it enables the use of unix-like search commands
142
793
  useExtendedSearch: !1,
143
794
  // The get function to use when fetching an object's properties.
144
795
  // The default will search nested paths *ie foo.bar.baz*
145
- getFn: Le,
796
+ getFn: Be,
146
797
  // When `true`, search will ignore `location` and `distance`, so it won't matter
147
798
  // where in the string the pattern appears.
148
799
  // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
@@ -154,116 +805,116 @@ const Ae = {
154
805
  // The weight to determine how much field length norm effects scoring.
155
806
  fieldNormWeight: 1
156
807
  };
157
- var d = {
158
- ...Ie,
159
- ...Ae,
160
- ...be,
161
- ..._e
808
+ var f = {
809
+ ...Ke,
810
+ ...We,
811
+ ...Ve,
812
+ ...Ye
162
813
  };
163
- const Re = /[^ ]+/g;
164
- function ve(s = 1, e = 3) {
165
- const t = /* @__PURE__ */ new Map(), r = Math.pow(10, e);
814
+ const Ge = /[^ ]+/g;
815
+ function Je(i = 1, t = 3) {
816
+ const e = /* @__PURE__ */ new Map(), s = Math.pow(10, t);
166
817
  return {
167
- get(i) {
168
- const c = i.match(Re).length;
169
- if (t.has(c))
170
- return t.get(c);
171
- const n = 1 / Math.pow(c, 0.5 * s), o = parseFloat(Math.round(n * r) / r);
172
- return t.set(c, o), o;
818
+ get(r) {
819
+ const n = r.match(Ge).length;
820
+ if (e.has(n))
821
+ return e.get(n);
822
+ const o = 1 / Math.pow(n, 0.5 * i), c = parseFloat(Math.round(o * s) / s);
823
+ return e.set(n, c), c;
173
824
  },
174
825
  clear() {
175
- t.clear();
826
+ e.clear();
176
827
  }
177
828
  };
178
829
  }
179
- class V {
830
+ class Ct {
180
831
  constructor({
181
- getFn: e = d.getFn,
182
- fieldNormWeight: t = d.fieldNormWeight
832
+ getFn: t = f.getFn,
833
+ fieldNormWeight: e = f.fieldNormWeight
183
834
  } = {}) {
184
- this.norm = ve(t, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
835
+ this.norm = Je(e, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
185
836
  }
186
- setSources(e = []) {
187
- this.docs = e;
837
+ setSources(t = []) {
838
+ this.docs = t;
188
839
  }
189
- setIndexRecords(e = []) {
190
- this.records = e;
840
+ setIndexRecords(t = []) {
841
+ this.records = t;
191
842
  }
192
- setKeys(e = []) {
193
- this.keys = e, this._keysMap = {}, e.forEach((t, r) => {
194
- this._keysMap[t.id] = r;
843
+ setKeys(t = []) {
844
+ this.keys = t, this._keysMap = {}, t.forEach((e, s) => {
845
+ this._keysMap[e.id] = s;
195
846
  });
196
847
  }
197
848
  create() {
198
- this.isCreated || !this.docs.length || (this.isCreated = !0, w(this.docs[0]) ? this.docs.forEach((e, t) => {
199
- this._addString(e, t);
200
- }) : this.docs.forEach((e, t) => {
201
- this._addObject(e, t);
849
+ this.isCreated || !this.docs.length || (this.isCreated = !0, A(this.docs[0]) ? this.docs.forEach((t, e) => {
850
+ this._addString(t, e);
851
+ }) : this.docs.forEach((t, e) => {
852
+ this._addObject(t, e);
202
853
  }), this.norm.clear());
203
854
  }
204
855
  // Adds a doc to the end of the index
205
- add(e) {
206
- const t = this.size();
207
- w(e) ? this._addString(e, t) : this._addObject(e, t);
856
+ add(t) {
857
+ const e = this.size();
858
+ A(t) ? this._addString(t, e) : this._addObject(t, e);
208
859
  }
209
860
  // Removes the doc at the specified index of the index
210
- removeAt(e) {
211
- this.records.splice(e, 1);
212
- for (let t = e, r = this.size(); t < r; t += 1)
213
- this.records[t].i -= 1;
861
+ removeAt(t) {
862
+ this.records.splice(t, 1);
863
+ for (let e = t, s = this.size(); e < s; e += 1)
864
+ this.records[e].i -= 1;
214
865
  }
215
- getValueForItemAtKeyId(e, t) {
216
- return e[this._keysMap[t]];
866
+ getValueForItemAtKeyId(t, e) {
867
+ return t[this._keysMap[e]];
217
868
  }
218
869
  size() {
219
870
  return this.records.length;
220
871
  }
221
- _addString(e, t) {
222
- if (!y(e) || P(e))
872
+ _addString(t, e) {
873
+ if (!$(t) || mt(t))
223
874
  return;
224
- let r = {
225
- v: e,
226
- i: t,
227
- n: this.norm.get(e)
875
+ let s = {
876
+ v: t,
877
+ i: e,
878
+ n: this.norm.get(t)
228
879
  };
229
- this.records.push(r);
230
- }
231
- _addObject(e, t) {
232
- let r = { i: t, $: {} };
233
- this.keys.forEach((i, c) => {
234
- let n = i.getFn ? i.getFn(e) : this.getFn(e, i.path);
235
- if (y(n)) {
236
- if (L(n)) {
237
- let o = [];
238
- const l = [{ nestedArrIndex: -1, value: n }];
880
+ this.records.push(s);
881
+ }
882
+ _addObject(t, e) {
883
+ let s = { i: e, $: {} };
884
+ this.keys.forEach((r, n) => {
885
+ let o = r.getFn ? r.getFn(t) : this.getFn(t, r.path);
886
+ if ($(o)) {
887
+ if (S(o)) {
888
+ let c = [];
889
+ const l = [{ nestedArrIndex: -1, value: o }];
239
890
  for (; l.length; ) {
240
- const { nestedArrIndex: a, value: h } = l.pop();
241
- if (y(h))
242
- if (w(h) && !P(h)) {
891
+ const { nestedArrIndex: h, value: a } = l.pop();
892
+ if ($(a))
893
+ if (A(a) && !mt(a)) {
243
894
  let u = {
244
- v: h,
245
- i: a,
246
- n: this.norm.get(h)
895
+ v: a,
896
+ i: h,
897
+ n: this.norm.get(a)
247
898
  };
248
- o.push(u);
899
+ c.push(u);
249
900
  } else
250
- L(h) && h.forEach((u, f) => {
901
+ S(a) && a.forEach((u, d) => {
251
902
  l.push({
252
- nestedArrIndex: f,
903
+ nestedArrIndex: d,
253
904
  value: u
254
905
  });
255
906
  });
256
907
  }
257
- r.$[c] = o;
258
- } else if (w(n) && !P(n)) {
259
- let o = {
260
- v: n,
261
- n: this.norm.get(n)
908
+ s.$[n] = c;
909
+ } else if (A(o) && !mt(o)) {
910
+ let c = {
911
+ v: o,
912
+ n: this.norm.get(o)
262
913
  };
263
- r.$[c] = o;
914
+ s.$[n] = c;
264
915
  }
265
916
  }
266
- }), this.records.push(r);
917
+ }), this.records.push(s);
267
918
  }
268
919
  toJSON() {
269
920
  return {
@@ -272,221 +923,221 @@ class V {
272
923
  };
273
924
  }
274
925
  }
275
- function re(s, e, { getFn: t = d.getFn, fieldNormWeight: r = d.fieldNormWeight } = {}) {
276
- const i = new V({ getFn: t, fieldNormWeight: r });
277
- return i.setKeys(s.map(ie)), i.setSources(e), i.create(), i;
926
+ function re(i, t, { getFn: e = f.getFn, fieldNormWeight: s = f.fieldNormWeight } = {}) {
927
+ const r = new Ct({ getFn: e, fieldNormWeight: s });
928
+ return r.setKeys(i.map(ie)), r.setSources(t), r.create(), r;
278
929
  }
279
- function Te(s, { getFn: e = d.getFn, fieldNormWeight: t = d.fieldNormWeight } = {}) {
280
- const { keys: r, records: i } = s, c = new V({ getFn: e, fieldNormWeight: t });
281
- return c.setKeys(r), c.setIndexRecords(i), c;
930
+ function Qe(i, { getFn: t = f.getFn, fieldNormWeight: e = f.fieldNormWeight } = {}) {
931
+ const { keys: s, records: r } = i, n = new Ct({ getFn: t, fieldNormWeight: e });
932
+ return n.setKeys(s), n.setIndexRecords(r), n;
282
933
  }
283
- function C(s, {
284
- errors: e = 0,
285
- currentLocation: t = 0,
286
- expectedLocation: r = 0,
287
- distance: i = d.distance,
288
- ignoreLocation: c = d.ignoreLocation
934
+ function tt(i, {
935
+ errors: t = 0,
936
+ currentLocation: e = 0,
937
+ expectedLocation: s = 0,
938
+ distance: r = f.distance,
939
+ ignoreLocation: n = f.ignoreLocation
289
940
  } = {}) {
290
- const n = e / s.length;
291
- if (c)
292
- return n;
293
- const o = Math.abs(r - t);
294
- return i ? n + o / i : o ? 1 : n;
295
- }
296
- function ke(s = [], e = d.minMatchCharLength) {
297
- let t = [], r = -1, i = -1, c = 0;
298
- for (let n = s.length; c < n; c += 1) {
299
- let o = s[c];
300
- o && r === -1 ? r = c : !o && r !== -1 && (i = c - 1, i - r + 1 >= e && t.push([r, i]), r = -1);
301
- }
302
- return s[c - 1] && c - r >= e && t.push([r, c - 1]), t;
303
- }
304
- const v = 32;
305
- function $e(s, e, t, {
306
- location: r = d.location,
307
- distance: i = d.distance,
308
- threshold: c = d.threshold,
309
- findAllMatches: n = d.findAllMatches,
310
- minMatchCharLength: o = d.minMatchCharLength,
311
- includeMatches: l = d.includeMatches,
312
- ignoreLocation: a = d.ignoreLocation
941
+ const o = t / i.length;
942
+ if (n)
943
+ return o;
944
+ const c = Math.abs(s - e);
945
+ return r ? o + c / r : c ? 1 : o;
946
+ }
947
+ function Xe(i = [], t = f.minMatchCharLength) {
948
+ let e = [], s = -1, r = -1, n = 0;
949
+ for (let o = i.length; n < o; n += 1) {
950
+ let c = i[n];
951
+ c && s === -1 ? s = n : !c && s !== -1 && (r = n - 1, r - s + 1 >= t && e.push([s, r]), s = -1);
952
+ }
953
+ return i[n - 1] && n - s >= t && e.push([s, n - 1]), e;
954
+ }
955
+ const k = 32;
956
+ function Ze(i, t, e, {
957
+ location: s = f.location,
958
+ distance: r = f.distance,
959
+ threshold: n = f.threshold,
960
+ findAllMatches: o = f.findAllMatches,
961
+ minMatchCharLength: c = f.minMatchCharLength,
962
+ includeMatches: l = f.includeMatches,
963
+ ignoreLocation: h = f.ignoreLocation
313
964
  } = {}) {
314
- if (e.length > v)
315
- throw new Error(Me(v));
316
- const h = e.length, u = s.length, f = Math.max(0, Math.min(r, u));
317
- let g = c, p = f;
318
- const m = o > 1 || l, E = m ? Array(u) : [];
319
- let S;
320
- for (; (S = s.indexOf(e, p)) > -1; ) {
321
- let x = C(e, {
322
- currentLocation: S,
323
- expectedLocation: f,
324
- distance: i,
325
- ignoreLocation: a
965
+ if (t.length > k)
966
+ throw new Error(je(k));
967
+ const a = t.length, u = i.length, d = Math.max(0, Math.min(s, u));
968
+ let p = n, g = d;
969
+ const _ = c > 1 || l, I = _ ? Array(u) : [];
970
+ let E;
971
+ for (; (E = i.indexOf(t, g)) > -1; ) {
972
+ let v = tt(t, {
973
+ currentLocation: E,
974
+ expectedLocation: d,
975
+ distance: r,
976
+ ignoreLocation: h
326
977
  });
327
- if (g = Math.min(x, g), p = S + h, m) {
328
- let A = 0;
329
- for (; A < h; )
330
- E[S + A] = 1, A += 1;
978
+ if (p = Math.min(v, p), g = E + a, _) {
979
+ let b = 0;
980
+ for (; b < a; )
981
+ I[E + b] = 1, b += 1;
331
982
  }
332
983
  }
333
- p = -1;
334
- let T = [], R = 1, N = h + u;
335
- const ae = 1 << h - 1;
336
- for (let x = 0; x < h; x += 1) {
337
- let A = 0, I = N;
338
- for (; A < I; )
339
- C(e, {
340
- errors: x,
341
- currentLocation: f + I,
342
- expectedLocation: f,
343
- distance: i,
344
- ignoreLocation: a
345
- }) <= g ? A = I : N = I, I = Math.floor((N - A) / 2 + A);
346
- N = I;
347
- let U = Math.max(1, f - I + 1), H = n ? u : Math.min(f + I, u) + h, k = Array(H + 2);
348
- k[H + 1] = (1 << x) - 1;
349
- for (let M = H; M >= U; M -= 1) {
350
- let O = M - 1, Y = t[s.charAt(O)];
351
- if (m && (E[O] = +!!Y), k[M] = (k[M + 1] << 1 | 1) & Y, x && (k[M] |= (T[M + 1] | T[M]) << 1 | 1 | T[M + 1]), k[M] & ae && (R = C(e, {
352
- errors: x,
353
- currentLocation: O,
354
- expectedLocation: f,
355
- distance: i,
356
- ignoreLocation: a
357
- }), R <= g)) {
358
- if (g = R, p = O, p <= f)
984
+ 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
+ expectedLocation: d,
994
+ distance: r,
995
+ ignoreLocation: h
996
+ }) <= p ? b = w : Z = w, w = Math.floor((Z - b) / 2 + b);
997
+ Z = w;
998
+ let Rt = 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 >= Rt; y -= 1) {
1001
+ let q = y - 1, It = e[i.charAt(q)];
1002
+ if (_ && (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,
1005
+ expectedLocation: d,
1006
+ distance: r,
1007
+ ignoreLocation: h
1008
+ }), L <= p)) {
1009
+ if (p = L, g = q, g <= d)
359
1010
  break;
360
- U = Math.max(1, 2 * f - p);
1011
+ Rt = Math.max(1, 2 * d - g);
361
1012
  }
362
1013
  }
363
- if (C(e, {
364
- errors: x + 1,
365
- currentLocation: f,
366
- expectedLocation: f,
367
- distance: i,
368
- ignoreLocation: a
369
- }) > g)
1014
+ if (tt(t, {
1015
+ errors: v + 1,
1016
+ currentLocation: d,
1017
+ expectedLocation: d,
1018
+ distance: r,
1019
+ ignoreLocation: h
1020
+ }) > p)
370
1021
  break;
371
- T = k;
1022
+ j = F;
372
1023
  }
373
- const j = {
374
- isMatch: p >= 0,
1024
+ const lt = {
1025
+ isMatch: g >= 0,
375
1026
  // Count exact matches (those with a score of 0) to be "almost" exact
376
- score: Math.max(1e-3, R)
1027
+ score: Math.max(1e-3, L)
377
1028
  };
378
- if (m) {
379
- const x = ke(E, o);
380
- x.length ? l && (j.indices = x) : j.isMatch = !1;
1029
+ if (_) {
1030
+ const v = Xe(I, c);
1031
+ v.length ? l && (lt.indices = v) : lt.isMatch = !1;
381
1032
  }
382
- return j;
1033
+ return lt;
383
1034
  }
384
- function Ne(s) {
385
- let e = {};
386
- for (let t = 0, r = s.length; t < r; t += 1) {
387
- const i = s.charAt(t);
388
- e[i] = (e[i] || 0) | 1 << r - t - 1;
1035
+ function qe(i) {
1036
+ let t = {};
1037
+ for (let e = 0, s = i.length; e < s; e += 1) {
1038
+ const r = i.charAt(e);
1039
+ t[r] = (t[r] || 0) | 1 << s - e - 1;
389
1040
  }
390
- return e;
1041
+ return t;
391
1042
  }
392
1043
  class ne {
393
- constructor(e, {
394
- location: t = d.location,
395
- threshold: r = d.threshold,
396
- distance: i = d.distance,
397
- includeMatches: c = d.includeMatches,
398
- findAllMatches: n = d.findAllMatches,
399
- minMatchCharLength: o = d.minMatchCharLength,
400
- isCaseSensitive: l = d.isCaseSensitive,
401
- ignoreLocation: a = d.ignoreLocation
1044
+ constructor(t, {
1045
+ location: e = f.location,
1046
+ threshold: s = f.threshold,
1047
+ distance: r = f.distance,
1048
+ includeMatches: n = f.includeMatches,
1049
+ findAllMatches: o = f.findAllMatches,
1050
+ minMatchCharLength: c = f.minMatchCharLength,
1051
+ isCaseSensitive: l = f.isCaseSensitive,
1052
+ ignoreLocation: h = f.ignoreLocation
402
1053
  } = {}) {
403
1054
  if (this.options = {
404
- location: t,
405
- threshold: r,
406
- distance: i,
407
- includeMatches: c,
408
- findAllMatches: n,
409
- minMatchCharLength: o,
1055
+ location: e,
1056
+ threshold: s,
1057
+ distance: r,
1058
+ includeMatches: n,
1059
+ findAllMatches: o,
1060
+ minMatchCharLength: c,
410
1061
  isCaseSensitive: l,
411
- ignoreLocation: a
412
- }, this.pattern = l ? e : e.toLowerCase(), this.chunks = [], !this.pattern.length)
1062
+ ignoreLocation: h
1063
+ }, this.pattern = l ? t : t.toLowerCase(), this.chunks = [], !this.pattern.length)
413
1064
  return;
414
- const h = (f, g) => {
1065
+ const a = (d, p) => {
415
1066
  this.chunks.push({
416
- pattern: f,
417
- alphabet: Ne(f),
418
- startIndex: g
1067
+ pattern: d,
1068
+ alphabet: qe(d),
1069
+ startIndex: p
419
1070
  });
420
1071
  }, u = this.pattern.length;
421
- if (u > v) {
422
- let f = 0;
423
- const g = u % v, p = u - g;
424
- for (; f < p; )
425
- h(this.pattern.substr(f, v), f), f += v;
426
- if (g) {
427
- const m = u - v;
428
- h(this.pattern.substr(m), m);
1072
+ if (u > k) {
1073
+ let d = 0;
1074
+ const p = u % k, g = u - p;
1075
+ for (; d < g; )
1076
+ a(this.pattern.substr(d, k), d), d += k;
1077
+ if (p) {
1078
+ const _ = u - k;
1079
+ a(this.pattern.substr(_), _);
429
1080
  }
430
1081
  } else
431
- h(this.pattern, 0);
1082
+ a(this.pattern, 0);
432
1083
  }
433
- searchIn(e) {
434
- const { isCaseSensitive: t, includeMatches: r } = this.options;
435
- if (t || (e = e.toLowerCase()), this.pattern === e) {
436
- let p = {
1084
+ searchIn(t) {
1085
+ const { isCaseSensitive: e, includeMatches: s } = this.options;
1086
+ if (e || (t = t.toLowerCase()), this.pattern === t) {
1087
+ let g = {
437
1088
  isMatch: !0,
438
1089
  score: 0
439
1090
  };
440
- return r && (p.indices = [[0, e.length - 1]]), p;
1091
+ return s && (g.indices = [[0, t.length - 1]]), g;
441
1092
  }
442
1093
  const {
443
- location: i,
444
- distance: c,
445
- threshold: n,
446
- findAllMatches: o,
1094
+ location: r,
1095
+ distance: n,
1096
+ threshold: o,
1097
+ findAllMatches: c,
447
1098
  minMatchCharLength: l,
448
- ignoreLocation: a
1099
+ ignoreLocation: h
449
1100
  } = this.options;
450
- let h = [], u = 0, f = !1;
451
- this.chunks.forEach(({ pattern: p, alphabet: m, startIndex: E }) => {
452
- const { isMatch: S, score: T, indices: R } = $e(e, p, m, {
453
- location: i + E,
454
- distance: c,
455
- threshold: n,
456
- findAllMatches: o,
1101
+ let a = [], u = 0, d = !1;
1102
+ this.chunks.forEach(({ pattern: g, alphabet: _, startIndex: I }) => {
1103
+ const { isMatch: E, score: j, indices: L } = Ze(t, g, _, {
1104
+ location: r + I,
1105
+ distance: n,
1106
+ threshold: o,
1107
+ findAllMatches: c,
457
1108
  minMatchCharLength: l,
458
- includeMatches: r,
459
- ignoreLocation: a
1109
+ includeMatches: s,
1110
+ ignoreLocation: h
460
1111
  });
461
- S && (f = !0), u += T, S && R && (h = [...h, ...R]);
1112
+ E && (d = !0), u += j, E && L && (a = [...a, ...L]);
462
1113
  });
463
- let g = {
464
- isMatch: f,
465
- score: f ? u / this.chunks.length : 1
1114
+ let p = {
1115
+ isMatch: d,
1116
+ score: d ? u / this.chunks.length : 1
466
1117
  };
467
- return f && r && (g.indices = h), g;
1118
+ return d && s && (p.indices = a), p;
468
1119
  }
469
1120
  }
470
- class _ {
471
- constructor(e) {
472
- this.pattern = e;
1121
+ class R {
1122
+ constructor(t) {
1123
+ this.pattern = t;
473
1124
  }
474
- static isMultiMatch(e) {
475
- return X(e, this.multiRegex);
1125
+ static isMultiMatch(t) {
1126
+ return Vt(t, this.multiRegex);
476
1127
  }
477
- static isSingleMatch(e) {
478
- return X(e, this.singleRegex);
1128
+ static isSingleMatch(t) {
1129
+ return Vt(t, this.singleRegex);
479
1130
  }
480
1131
  search() {
481
1132
  }
482
1133
  }
483
- function X(s, e) {
484
- const t = s.match(e);
485
- return t ? t[1] : null;
1134
+ function Vt(i, t) {
1135
+ const e = i.match(t);
1136
+ return e ? e[1] : null;
486
1137
  }
487
- class Oe extends _ {
488
- constructor(e) {
489
- super(e);
1138
+ class ts extends R {
1139
+ constructor(t) {
1140
+ super(t);
490
1141
  }
491
1142
  static get type() {
492
1143
  return "exact";
@@ -497,18 +1148,18 @@ class Oe extends _ {
497
1148
  static get singleRegex() {
498
1149
  return /^=(.*)$/;
499
1150
  }
500
- search(e) {
501
- const t = e === this.pattern;
1151
+ search(t) {
1152
+ const e = t === this.pattern;
502
1153
  return {
503
- isMatch: t,
504
- score: t ? 0 : 1,
1154
+ isMatch: e,
1155
+ score: e ? 0 : 1,
505
1156
  indices: [0, this.pattern.length - 1]
506
1157
  };
507
1158
  }
508
1159
  }
509
- class Ce extends _ {
510
- constructor(e) {
511
- super(e);
1160
+ class es extends R {
1161
+ constructor(t) {
1162
+ super(t);
512
1163
  }
513
1164
  static get type() {
514
1165
  return "inverse-exact";
@@ -519,18 +1170,18 @@ class Ce extends _ {
519
1170
  static get singleRegex() {
520
1171
  return /^!(.*)$/;
521
1172
  }
522
- search(e) {
523
- const r = e.indexOf(this.pattern) === -1;
1173
+ search(t) {
1174
+ const s = t.indexOf(this.pattern) === -1;
524
1175
  return {
525
- isMatch: r,
526
- score: r ? 0 : 1,
527
- indices: [0, e.length - 1]
1176
+ isMatch: s,
1177
+ score: s ? 0 : 1,
1178
+ indices: [0, t.length - 1]
528
1179
  };
529
1180
  }
530
1181
  }
531
- class Fe extends _ {
532
- constructor(e) {
533
- super(e);
1182
+ class ss extends R {
1183
+ constructor(t) {
1184
+ super(t);
534
1185
  }
535
1186
  static get type() {
536
1187
  return "prefix-exact";
@@ -541,18 +1192,18 @@ class Fe extends _ {
541
1192
  static get singleRegex() {
542
1193
  return /^\^(.*)$/;
543
1194
  }
544
- search(e) {
545
- const t = e.startsWith(this.pattern);
1195
+ search(t) {
1196
+ const e = t.startsWith(this.pattern);
546
1197
  return {
547
- isMatch: t,
548
- score: t ? 0 : 1,
1198
+ isMatch: e,
1199
+ score: e ? 0 : 1,
549
1200
  indices: [0, this.pattern.length - 1]
550
1201
  };
551
1202
  }
552
1203
  }
553
- class je extends _ {
554
- constructor(e) {
555
- super(e);
1204
+ class is extends R {
1205
+ constructor(t) {
1206
+ super(t);
556
1207
  }
557
1208
  static get type() {
558
1209
  return "inverse-prefix-exact";
@@ -563,18 +1214,18 @@ class je extends _ {
563
1214
  static get singleRegex() {
564
1215
  return /^!\^(.*)$/;
565
1216
  }
566
- search(e) {
567
- const t = !e.startsWith(this.pattern);
1217
+ search(t) {
1218
+ const e = !t.startsWith(this.pattern);
568
1219
  return {
569
- isMatch: t,
570
- score: t ? 0 : 1,
571
- indices: [0, e.length - 1]
1220
+ isMatch: e,
1221
+ score: e ? 0 : 1,
1222
+ indices: [0, t.length - 1]
572
1223
  };
573
1224
  }
574
1225
  }
575
- class He extends _ {
576
- constructor(e) {
577
- super(e);
1226
+ class rs extends R {
1227
+ constructor(t) {
1228
+ super(t);
578
1229
  }
579
1230
  static get type() {
580
1231
  return "suffix-exact";
@@ -585,18 +1236,18 @@ class He extends _ {
585
1236
  static get singleRegex() {
586
1237
  return /^(.*)\$$/;
587
1238
  }
588
- search(e) {
589
- const t = e.endsWith(this.pattern);
1239
+ search(t) {
1240
+ const e = t.endsWith(this.pattern);
590
1241
  return {
591
- isMatch: t,
592
- score: t ? 0 : 1,
593
- indices: [e.length - this.pattern.length, e.length - 1]
1242
+ isMatch: e,
1243
+ score: e ? 0 : 1,
1244
+ indices: [t.length - this.pattern.length, t.length - 1]
594
1245
  };
595
1246
  }
596
1247
  }
597
- class Pe extends _ {
598
- constructor(e) {
599
- super(e);
1248
+ class ns extends R {
1249
+ constructor(t) {
1250
+ super(t);
600
1251
  }
601
1252
  static get type() {
602
1253
  return "inverse-suffix-exact";
@@ -607,35 +1258,35 @@ class Pe extends _ {
607
1258
  static get singleRegex() {
608
1259
  return /^!(.*)\$$/;
609
1260
  }
610
- search(e) {
611
- const t = !e.endsWith(this.pattern);
1261
+ search(t) {
1262
+ const e = !t.endsWith(this.pattern);
612
1263
  return {
613
- isMatch: t,
614
- score: t ? 0 : 1,
615
- indices: [0, e.length - 1]
1264
+ isMatch: e,
1265
+ score: e ? 0 : 1,
1266
+ indices: [0, t.length - 1]
616
1267
  };
617
1268
  }
618
1269
  }
619
- class ce extends _ {
620
- constructor(e, {
621
- location: t = d.location,
622
- threshold: r = d.threshold,
623
- distance: i = d.distance,
624
- includeMatches: c = d.includeMatches,
625
- findAllMatches: n = d.findAllMatches,
626
- minMatchCharLength: o = d.minMatchCharLength,
627
- isCaseSensitive: l = d.isCaseSensitive,
628
- ignoreLocation: a = d.ignoreLocation
1270
+ class oe extends R {
1271
+ constructor(t, {
1272
+ location: e = f.location,
1273
+ threshold: s = f.threshold,
1274
+ distance: r = f.distance,
1275
+ includeMatches: n = f.includeMatches,
1276
+ findAllMatches: o = f.findAllMatches,
1277
+ minMatchCharLength: c = f.minMatchCharLength,
1278
+ isCaseSensitive: l = f.isCaseSensitive,
1279
+ ignoreLocation: h = f.ignoreLocation
629
1280
  } = {}) {
630
- super(e), this._bitapSearch = new ne(e, {
631
- location: t,
632
- threshold: r,
633
- distance: i,
634
- includeMatches: c,
635
- findAllMatches: n,
636
- minMatchCharLength: o,
1281
+ super(t), this._bitapSearch = new ne(t, {
1282
+ location: e,
1283
+ threshold: s,
1284
+ distance: r,
1285
+ includeMatches: n,
1286
+ findAllMatches: o,
1287
+ minMatchCharLength: c,
637
1288
  isCaseSensitive: l,
638
- ignoreLocation: a
1289
+ ignoreLocation: h
639
1290
  });
640
1291
  }
641
1292
  static get type() {
@@ -647,13 +1298,13 @@ class ce extends _ {
647
1298
  static get singleRegex() {
648
1299
  return /^(.*)$/;
649
1300
  }
650
- search(e) {
651
- return this._bitapSearch.searchIn(e);
1301
+ search(t) {
1302
+ return this._bitapSearch.searchIn(t);
652
1303
  }
653
1304
  }
654
- class oe extends _ {
655
- constructor(e) {
656
- super(e);
1305
+ class le extends R {
1306
+ constructor(t) {
1307
+ super(t);
657
1308
  }
658
1309
  static get type() {
659
1310
  return "include";
@@ -664,110 +1315,110 @@ class oe extends _ {
664
1315
  static get singleRegex() {
665
1316
  return /^'(.*)$/;
666
1317
  }
667
- search(e) {
668
- let t = 0, r;
669
- const i = [], c = this.pattern.length;
670
- for (; (r = e.indexOf(this.pattern, t)) > -1; )
671
- t = r + c, i.push([r, t - 1]);
672
- const n = !!i.length;
1318
+ search(t) {
1319
+ let e = 0, s;
1320
+ const r = [], n = this.pattern.length;
1321
+ for (; (s = t.indexOf(this.pattern, e)) > -1; )
1322
+ e = s + n, r.push([s, e - 1]);
1323
+ const o = !!r.length;
673
1324
  return {
674
- isMatch: n,
675
- score: n ? 0 : 1,
676
- indices: i
1325
+ isMatch: o,
1326
+ score: o ? 0 : 1,
1327
+ indices: r
677
1328
  };
678
1329
  }
679
1330
  }
680
- const K = [
681
- Oe,
682
- oe,
683
- Fe,
684
- je,
685
- Pe,
686
- He,
687
- Ce,
688
- ce
689
- ], J = K.length, Be = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Ke = "|";
690
- function We(s, e = {}) {
691
- return s.split(Ke).map((t) => {
692
- let r = t.trim().split(Be).filter((c) => c && !!c.trim()), i = [];
693
- for (let c = 0, n = r.length; c < n; c += 1) {
694
- const o = r[c];
695
- let l = !1, a = -1;
696
- for (; !l && ++a < J; ) {
697
- const h = K[a];
698
- let u = h.isMultiMatch(o);
699
- u && (i.push(new h(u, e)), l = !0);
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 = [];
1344
+ for (let n = 0, o = s.length; n < o; n += 1) {
1345
+ 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);
700
1351
  }
701
1352
  if (!l)
702
- for (a = -1; ++a < J; ) {
703
- const h = K[a];
704
- let u = h.isSingleMatch(o);
1353
+ for (h = -1; ++h < Yt; ) {
1354
+ const a = At[h];
1355
+ let u = a.isSingleMatch(c);
705
1356
  if (u) {
706
- i.push(new h(u, e));
1357
+ r.push(new a(u, t));
707
1358
  break;
708
1359
  }
709
1360
  }
710
1361
  }
711
- return i;
1362
+ return r;
712
1363
  });
713
1364
  }
714
- const De = /* @__PURE__ */ new Set([ce.type, oe.type]);
715
- class ze {
716
- constructor(e, {
717
- isCaseSensitive: t = d.isCaseSensitive,
718
- includeMatches: r = d.includeMatches,
719
- minMatchCharLength: i = d.minMatchCharLength,
720
- ignoreLocation: c = d.ignoreLocation,
721
- findAllMatches: n = d.findAllMatches,
722
- location: o = d.location,
723
- threshold: l = d.threshold,
724
- distance: a = d.distance
1365
+ const hs = /* @__PURE__ */ new Set([oe.type, le.type]);
1366
+ class as {
1367
+ constructor(t, {
1368
+ isCaseSensitive: e = f.isCaseSensitive,
1369
+ includeMatches: s = f.includeMatches,
1370
+ minMatchCharLength: r = f.minMatchCharLength,
1371
+ ignoreLocation: n = f.ignoreLocation,
1372
+ findAllMatches: o = f.findAllMatches,
1373
+ location: c = f.location,
1374
+ threshold: l = f.threshold,
1375
+ distance: h = f.distance
725
1376
  } = {}) {
726
1377
  this.query = null, this.options = {
727
- isCaseSensitive: t,
728
- includeMatches: r,
729
- minMatchCharLength: i,
730
- findAllMatches: n,
731
- ignoreLocation: c,
732
- location: o,
1378
+ isCaseSensitive: e,
1379
+ includeMatches: s,
1380
+ minMatchCharLength: r,
1381
+ findAllMatches: o,
1382
+ ignoreLocation: n,
1383
+ location: c,
733
1384
  threshold: l,
734
- distance: a
735
- }, this.pattern = t ? e : e.toLowerCase(), this.query = We(this.pattern, this.options);
1385
+ distance: h
1386
+ }, this.pattern = e ? t : t.toLowerCase(), this.query = cs(this.pattern, this.options);
736
1387
  }
737
- static condition(e, t) {
738
- return t.useExtendedSearch;
1388
+ static condition(t, e) {
1389
+ return e.useExtendedSearch;
739
1390
  }
740
- searchIn(e) {
741
- const t = this.query;
742
- if (!t)
1391
+ searchIn(t) {
1392
+ const e = this.query;
1393
+ if (!e)
743
1394
  return {
744
1395
  isMatch: !1,
745
1396
  score: 1
746
1397
  };
747
- const { includeMatches: r, isCaseSensitive: i } = this.options;
748
- e = i ? e : e.toLowerCase();
749
- let c = 0, n = [], o = 0;
750
- for (let l = 0, a = t.length; l < a; l += 1) {
751
- const h = t[l];
752
- n.length = 0, c = 0;
753
- for (let u = 0, f = h.length; u < f; u += 1) {
754
- const g = h[u], { isMatch: p, indices: m, score: E } = g.search(e);
755
- if (p) {
756
- if (c += 1, o += E, r) {
757
- const S = g.constructor.type;
758
- De.has(S) ? n = [...n, ...m] : n.push(m);
1398
+ const { includeMatches: s, isCaseSensitive: r } = this.options;
1399
+ t = r ? t : t.toLowerCase();
1400
+ let n = 0, o = [], c = 0;
1401
+ for (let l = 0, h = e.length; l < h; l += 1) {
1402
+ const a = e[l];
1403
+ 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: _, score: I } = p.search(t);
1406
+ if (g) {
1407
+ if (n += 1, c += I, s) {
1408
+ const E = p.constructor.type;
1409
+ hs.has(E) ? o = [...o, ..._] : o.push(_);
759
1410
  }
760
1411
  } else {
761
- o = 0, c = 0, n.length = 0;
1412
+ c = 0, n = 0, o.length = 0;
762
1413
  break;
763
1414
  }
764
1415
  }
765
- if (c) {
1416
+ if (n) {
766
1417
  let u = {
767
1418
  isMatch: !0,
768
- score: o / c
1419
+ score: c / n
769
1420
  };
770
- return r && (u.indices = n), u;
1421
+ return s && (u.indices = o), u;
771
1422
  }
772
1423
  }
773
1424
  return {
@@ -776,257 +1427,288 @@ class ze {
776
1427
  };
777
1428
  }
778
1429
  }
779
- const W = [];
780
- function qe(...s) {
781
- W.push(...s);
1430
+ const Et = [];
1431
+ function us(...i) {
1432
+ Et.push(...i);
782
1433
  }
783
- function D(s, e) {
784
- for (let t = 0, r = W.length; t < r; t += 1) {
785
- let i = W[t];
786
- if (i.condition(s, e))
787
- return new i(s, e);
1434
+ function xt(i, t) {
1435
+ for (let e = 0, s = Et.length; e < s; e += 1) {
1436
+ let r = Et[e];
1437
+ if (r.condition(i, t))
1438
+ return new r(i, t);
788
1439
  }
789
- return new ne(s, e);
1440
+ return new ne(i, t);
790
1441
  }
791
- const F = {
1442
+ const rt = {
792
1443
  AND: "$and",
793
1444
  OR: "$or"
794
- }, z = {
1445
+ }, St = {
795
1446
  PATH: "$path",
796
1447
  PATTERN: "$val"
797
- }, q = (s) => !!(s[F.AND] || s[F.OR]), Ve = (s) => !!s[z.PATH], Ue = (s) => !L(s) && te(s) && !q(s), Z = (s) => ({
798
- [F.AND]: Object.keys(s).map((e) => ({
799
- [e]: s[e]
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) => ({
1450
+ [t]: i[t]
800
1451
  }))
801
1452
  });
802
- function le(s, e, { auto: t = !0 } = {}) {
803
- const r = (i) => {
804
- let c = Object.keys(i);
805
- const n = Ve(i);
806
- if (!n && c.length > 1 && !q(i))
807
- return r(Z(i));
808
- if (Ue(i)) {
809
- const l = n ? i[z.PATH] : c[0], a = n ? i[z.PATTERN] : i[l];
810
- if (!w(a))
811
- throw new Error(xe(l));
812
- const h = {
813
- keyId: B(l),
814
- pattern: a
1453
+ function ce(i, t, { auto: e = !0 } = {}) {
1454
+ const s = (r) => {
1455
+ 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
815
1466
  };
816
- return t && (h.searcher = D(a, e)), h;
1467
+ return e && (a.searcher = xt(h, t)), a;
817
1468
  }
818
- let o = {
1469
+ let c = {
819
1470
  children: [],
820
- operator: c[0]
1471
+ operator: n[0]
821
1472
  };
822
- return c.forEach((l) => {
823
- const a = i[l];
824
- L(a) && a.forEach((h) => {
825
- o.children.push(r(h));
1473
+ return n.forEach((l) => {
1474
+ const h = r[l];
1475
+ S(h) && h.forEach((a) => {
1476
+ c.children.push(s(a));
826
1477
  });
827
- }), o;
1478
+ }), c;
828
1479
  };
829
- return q(s) || (s = Z(s)), r(s);
830
- }
831
- function Ye(s, { ignoreFieldNorm: e = d.ignoreFieldNorm }) {
832
- s.forEach((t) => {
833
- let r = 1;
834
- t.matches.forEach(({ key: i, norm: c, score: n }) => {
835
- const o = i ? i.weight : null;
836
- r *= Math.pow(
837
- n === 0 && o ? Number.EPSILON : n,
838
- (o || 1) * (e ? 1 : c)
1480
+ return bt(i) || (i = Gt(i)), s(i);
1481
+ }
1482
+ function ps(i, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
1483
+ i.forEach((e) => {
1484
+ let s = 1;
1485
+ e.matches.forEach(({ key: r, norm: n, score: o }) => {
1486
+ const c = r ? r.weight : null;
1487
+ s *= Math.pow(
1488
+ o === 0 && c ? Number.EPSILON : o,
1489
+ (c || 1) * (t ? 1 : n)
839
1490
  );
840
- }), t.score = r;
1491
+ }), e.score = s;
841
1492
  });
842
1493
  }
843
- function Ge(s, e) {
844
- const t = s.matches;
845
- e.matches = [], y(t) && t.forEach((r) => {
846
- if (!y(r.indices) || !r.indices.length)
1494
+ function gs(i, t) {
1495
+ const e = i.matches;
1496
+ t.matches = [], $(e) && e.forEach((s) => {
1497
+ if (!$(s.indices) || !s.indices.length)
847
1498
  return;
848
- const { indices: i, value: c } = r;
849
- let n = {
850
- indices: i,
851
- value: c
1499
+ const { indices: r, value: n } = s;
1500
+ let o = {
1501
+ indices: r,
1502
+ value: n
852
1503
  };
853
- r.key && (n.key = r.key.src), r.idx > -1 && (n.refIndex = r.idx), e.matches.push(n);
1504
+ s.key && (o.key = s.key.src), s.idx > -1 && (o.refIndex = s.idx), t.matches.push(o);
854
1505
  });
855
1506
  }
856
- function Qe(s, e) {
857
- e.score = s.score;
1507
+ function ms(i, t) {
1508
+ t.score = i.score;
858
1509
  }
859
- function Xe(s, e, {
860
- includeMatches: t = d.includeMatches,
861
- includeScore: r = d.includeScore
1510
+ function _s(i, t, {
1511
+ includeMatches: e = f.includeMatches,
1512
+ includeScore: s = f.includeScore
862
1513
  } = {}) {
863
- const i = [];
864
- return t && i.push(Ge), r && i.push(Qe), s.map((c) => {
865
- const { idx: n } = c, o = {
866
- item: e[n],
867
- refIndex: n
1514
+ const r = [];
1515
+ return e && r.push(gs), s && r.push(ms), i.map((n) => {
1516
+ const { idx: o } = n, c = {
1517
+ item: t[o],
1518
+ refIndex: o
868
1519
  };
869
- return i.length && i.forEach((l) => {
870
- l(c, o);
871
- }), o;
1520
+ return r.length && r.forEach((l) => {
1521
+ l(n, c);
1522
+ }), c;
872
1523
  });
873
1524
  }
874
- class $ {
875
- constructor(e, t = {}, r) {
876
- this.options = { ...d, ...t }, this.options.useExtendedSearch, this._keyStore = new Se(this.options.keys), this.setCollection(e, r);
1525
+ class W {
1526
+ constructor(t, e = {}, s) {
1527
+ this.options = { ...f, ...e }, this.options.useExtendedSearch, this._keyStore = new De(this.options.keys), this.setCollection(t, s);
877
1528
  }
878
- setCollection(e, t) {
879
- if (this._docs = e, t && !(t instanceof V))
880
- throw new Error(ye);
881
- this._myIndex = t || re(this.options.keys, this._docs, {
1529
+ setCollection(t, e) {
1530
+ if (this._docs = t, e && !(e instanceof Ct))
1531
+ throw new Error(Ue);
1532
+ this._myIndex = e || re(this.options.keys, this._docs, {
882
1533
  getFn: this.options.getFn,
883
1534
  fieldNormWeight: this.options.fieldNormWeight
884
1535
  });
885
1536
  }
886
- add(e) {
887
- y(e) && (this._docs.push(e), this._myIndex.add(e));
1537
+ add(t) {
1538
+ $(t) && (this._docs.push(t), this._myIndex.add(t));
888
1539
  }
889
- remove(e = () => !1) {
890
- const t = [];
891
- for (let r = 0, i = this._docs.length; r < i; r += 1) {
892
- const c = this._docs[r];
893
- e(c, r) && (this.removeAt(r), r -= 1, i -= 1, t.push(c));
1540
+ remove(t = () => !1) {
1541
+ const e = [];
1542
+ for (let s = 0, r = this._docs.length; s < r; s += 1) {
1543
+ const n = this._docs[s];
1544
+ t(n, s) && (this.removeAt(s), s -= 1, r -= 1, e.push(n));
894
1545
  }
895
- return t;
1546
+ return e;
896
1547
  }
897
- removeAt(e) {
898
- this._docs.splice(e, 1), this._myIndex.removeAt(e);
1548
+ removeAt(t) {
1549
+ this._docs.splice(t, 1), this._myIndex.removeAt(t);
899
1550
  }
900
1551
  getIndex() {
901
1552
  return this._myIndex;
902
1553
  }
903
- search(e, { limit: t = -1 } = {}) {
1554
+ search(t, { limit: e = -1 } = {}) {
904
1555
  const {
905
- includeMatches: r,
906
- includeScore: i,
907
- shouldSort: c,
908
- sortFn: n,
909
- ignoreFieldNorm: o
1556
+ includeMatches: s,
1557
+ includeScore: r,
1558
+ shouldSort: n,
1559
+ sortFn: o,
1560
+ ignoreFieldNorm: c
910
1561
  } = this.options;
911
- let l = w(e) ? w(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
912
- return Ye(l, { ignoreFieldNorm: o }), c && l.sort(n), ee(t) && t > -1 && (l = l.slice(0, t)), Xe(l, this._docs, {
913
- includeMatches: r,
914
- includeScore: i
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)), _s(l, this._docs, {
1564
+ includeMatches: s,
1565
+ includeScore: r
915
1566
  });
916
1567
  }
917
- _searchStringList(e) {
918
- const t = D(e, this.options), { records: r } = this._myIndex, i = [];
919
- return r.forEach(({ v: c, i: n, n: o }) => {
920
- if (!y(c))
1568
+ _searchStringList(t) {
1569
+ const e = xt(t, this.options), { records: s } = this._myIndex, r = [];
1570
+ return s.forEach(({ v: n, i: o, n: c }) => {
1571
+ if (!$(n))
921
1572
  return;
922
- const { isMatch: l, score: a, indices: h } = t.searchIn(c);
923
- l && i.push({
924
- item: c,
925
- idx: n,
926
- matches: [{ score: a, value: c, norm: o, indices: h }]
1573
+ const { isMatch: l, score: h, indices: a } = e.searchIn(n);
1574
+ l && r.push({
1575
+ item: n,
1576
+ idx: o,
1577
+ matches: [{ score: h, value: n, norm: c, indices: a }]
927
1578
  });
928
- }), i;
1579
+ }), r;
929
1580
  }
930
- _searchLogical(e) {
931
- const t = le(e, this.options), r = (o, l, a) => {
932
- if (!o.children) {
933
- const { keyId: u, searcher: f } = o, g = this._findMatches({
1581
+ _searchLogical(t) {
1582
+ const e = ce(t, this.options), s = (c, l, h) => {
1583
+ if (!c.children) {
1584
+ const { keyId: u, searcher: d } = c, p = this._findMatches({
934
1585
  key: this._keyStore.get(u),
935
1586
  value: this._myIndex.getValueForItemAtKeyId(l, u),
936
- searcher: f
1587
+ searcher: d
937
1588
  });
938
- return g && g.length ? [
1589
+ return p && p.length ? [
939
1590
  {
940
- idx: a,
1591
+ idx: h,
941
1592
  item: l,
942
- matches: g
1593
+ matches: p
943
1594
  }
944
1595
  ] : [];
945
1596
  }
946
- const h = [];
947
- for (let u = 0, f = o.children.length; u < f; u += 1) {
948
- const g = o.children[u], p = r(g, l, a);
949
- if (p.length)
950
- h.push(...p);
951
- else if (o.operator === F.AND)
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);
1600
+ if (g.length)
1601
+ a.push(...g);
1602
+ else if (c.operator === rt.AND)
952
1603
  return [];
953
1604
  }
954
- return h;
955
- }, i = this._myIndex.records, c = {}, n = [];
956
- return i.forEach(({ $: o, i: l }) => {
957
- if (y(o)) {
958
- let a = r(t, o, l);
959
- a.length && (c[l] || (c[l] = { idx: l, item: o, matches: [] }, n.push(c[l])), a.forEach(({ matches: h }) => {
960
- c[l].matches.push(...h);
1605
+ return a;
1606
+ }, r = this._myIndex.records, n = {}, o = [];
1607
+ 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);
961
1612
  }));
962
1613
  }
963
- }), n;
1614
+ }), o;
964
1615
  }
965
- _searchObjectList(e) {
966
- const t = D(e, this.options), { keys: r, records: i } = this._myIndex, c = [];
967
- return i.forEach(({ $: n, i: o }) => {
968
- if (!y(n))
1616
+ _searchObjectList(t) {
1617
+ const e = xt(t, this.options), { keys: s, records: r } = this._myIndex, n = [];
1618
+ return r.forEach(({ $: o, i: c }) => {
1619
+ if (!$(o))
969
1620
  return;
970
1621
  let l = [];
971
- r.forEach((a, h) => {
1622
+ s.forEach((h, a) => {
972
1623
  l.push(
973
1624
  ...this._findMatches({
974
- key: a,
975
- value: n[h],
976
- searcher: t
1625
+ key: h,
1626
+ value: o[a],
1627
+ searcher: e
977
1628
  })
978
1629
  );
979
- }), l.length && c.push({
980
- idx: o,
981
- item: n,
1630
+ }), l.length && n.push({
1631
+ idx: c,
1632
+ item: o,
982
1633
  matches: l
983
1634
  });
984
- }), c;
1635
+ }), n;
985
1636
  }
986
- _findMatches({ key: e, value: t, searcher: r }) {
987
- if (!y(t))
1637
+ _findMatches({ key: t, value: e, searcher: s }) {
1638
+ if (!$(e))
988
1639
  return [];
989
- let i = [];
990
- if (L(t))
991
- t.forEach(({ v: c, i: n, n: o }) => {
992
- if (!y(c))
1640
+ let r = [];
1641
+ if (S(e))
1642
+ e.forEach(({ v: n, i: o, n: c }) => {
1643
+ if (!$(n))
993
1644
  return;
994
- const { isMatch: l, score: a, indices: h } = r.searchIn(c);
995
- l && i.push({
996
- score: a,
997
- key: e,
998
- value: c,
999
- idx: n,
1000
- norm: o,
1001
- indices: h
1645
+ const { isMatch: l, score: h, indices: a } = s.searchIn(n);
1646
+ l && r.push({
1647
+ score: h,
1648
+ key: t,
1649
+ value: n,
1650
+ idx: o,
1651
+ norm: c,
1652
+ indices: a
1002
1653
  });
1003
1654
  });
1004
1655
  else {
1005
- const { v: c, n } = t, { isMatch: o, score: l, indices: a } = r.searchIn(c);
1006
- o && i.push({ score: l, key: e, value: c, norm: n, indices: a });
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 });
1007
1658
  }
1008
- return i;
1009
- }
1010
- }
1011
- $.version = "6.6.2";
1012
- $.createIndex = re;
1013
- $.parseIndex = Te;
1014
- $.config = d;
1015
- $.parseQuery = le;
1016
- qe(ze);
1017
- const Je = `
1018
- <style>
1659
+ return r;
1660
+ }
1661
+ }
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") => {
1669
+ const s = (n, o, c) => {
1670
+ 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;
1675
+ }, r = (n, o = []) => {
1676
+ let c = "", l = 0;
1677
+ return o.forEach((h) => {
1678
+ const a = h[1] + 1;
1679
+ c += [
1680
+ n.substring(l, h[0]),
1681
+ `<mark class="${t}">`,
1682
+ n.substring(h[0], a),
1683
+ "</mark>"
1684
+ ].join(""), l = a;
1685
+ }), c += n.substring(l), c;
1686
+ };
1687
+ return i.filter(({ matches: n }) => n && n.length).map(({ item: n, matches: o }) => {
1688
+ const c = { ...n };
1689
+ return o.forEach((l) => {
1690
+ l.key === e && s(
1691
+ c,
1692
+ l.key,
1693
+ r(l.value, l.indices)
1694
+ );
1695
+ }), c;
1696
+ });
1697
+ }, vs = `
1019
1698
  :host {
1020
1699
  display: flex;
1021
1700
  box-sizing: border-box;
1022
1701
  height: 100%;
1023
1702
  overflow: hidden;
1024
1703
  }
1025
- *, *:before, *:after {
1704
+ *,
1705
+ *:before,
1706
+ *:after {
1026
1707
  box-sizing: inherit;
1027
1708
  }
1028
1709
  form {
1029
1710
  height: 100%;
1711
+ width: 100%;
1030
1712
  max-width: 100%;
1031
1713
  display: flex;
1032
1714
  flex-direction: column;
@@ -1079,26 +1761,26 @@ details summary {
1079
1761
  #details-results[open] summary svg {
1080
1762
  transform: rotate(0deg);
1081
1763
  }
1082
- li span,
1764
+ #details-filter li span,
1083
1765
  details summary {
1084
1766
  text-transform: capitalize;
1085
1767
  }
1086
1768
  li,
1087
1769
  label,
1088
1770
  details,
1089
- input[type=checkbox],
1090
- input[type=radio] {
1771
+ input[type="checkbox"],
1772
+ input[type="radio"] {
1091
1773
  cursor: pointer;
1092
1774
  }
1093
- input[type=checkbox],
1094
- input[type=radio] {
1775
+ input[type="checkbox"],
1776
+ input[type="radio"] {
1095
1777
  margin: 0;
1096
1778
  margin-right: 0.5rem;
1097
1779
  }
1098
- input[type=text] {
1099
- display: none;
1780
+ input[type="text"] {
1100
1781
  width: 100%;
1101
1782
  margin-bottom: 0.5rem;
1783
+ padding: 5px 7px;
1102
1784
  }
1103
1785
  section {
1104
1786
  padding-left: 1rem;
@@ -1127,251 +1809,306 @@ ul#results li {
1127
1809
  overflow-x: hidden;
1128
1810
  overflow-y: auto;
1129
1811
  }
1130
- </style>
1131
- <form>
1132
- <section>
1133
- <input type="text" placeholder="Search" />
1134
- </section>
1135
- <section>
1136
- <slot name="filterstitle"></slot>
1137
- <ul id="filters"></ul>
1138
- </section>
1139
- <section id="section-results">
1140
- <div>
1141
- <slot name="resultstitle"></slot>
1142
- </div>
1143
- <div id="container-results" class="scroll">
1144
- <ul id="results"></ul>
1145
- </div>
1146
- </section>
1147
- </form>
1148
- `, Ze = `
1149
- <li>
1150
- <label>
1151
- <input type="checkbox" />
1152
- <span class="title">FILTERITEMTITLE</span>
1153
- </label>
1154
- </li>
1155
- `, et = `
1156
- <details id="details-filter">
1157
- <summary>
1158
- <small>
1159
- <strong class="title">
1160
- FILTERTITLE
1161
- </strong>
1162
- </small>
1163
- <div>
1164
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>chevron-down</title><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg>
1165
- </div>
1166
- </summary>
1167
- <ul></ul>
1168
- </details>
1169
- `, tt = `
1170
- <li>
1171
- <label>
1172
- <input type="radio" name="result" />
1173
- <span class="title">RESULTTITLE</span>
1174
- </label>
1175
- </li>
1176
- `, st = `
1177
- <details id="details-results" open>
1178
- <summary>
1179
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>chevron-down</title><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg>
1180
- <strong class="title">
1181
- SUMMARYTITLE
1182
- </strong>
1183
- <span style="margin-left: 0.25rem">(<span class="count"></span>)</span>
1184
- </summary>
1185
- <ul></ul>
1186
- </details>
1187
- `, it = (s, e = "highlight") => {
1188
- const t = (i, c, n) => {
1189
- const o = c.split(".");
1190
- let l;
1191
- for (l = 0; l < o.length - 1; l++)
1192
- i = i[o[l]];
1193
- i[o[l]] = n;
1194
- }, r = (i, c = []) => {
1195
- let n = "", o = 0;
1196
- return c.forEach((l) => {
1197
- const a = l[1] + 1;
1198
- n += [
1199
- i.substring(o, l[0]),
1200
- `<mark class="${e}">`,
1201
- i.substring(l[0], a),
1202
- "</mark>"
1203
- ].join(""), o = a;
1204
- }), n += i.substring(o), n;
1205
- };
1206
- return s.filter(({ matches: i }) => i && i.length).map(({ item: i, matches: c }) => {
1207
- const n = { ...i };
1208
- return c.forEach((o) => {
1209
- o.key === "name" && t(
1210
- n,
1211
- o.key,
1212
- r(o.value, o.indices)
1213
- );
1214
- }), n;
1215
- });
1812
+ `;
1813
+ var ys = Object.defineProperty, As = Object.getOwnPropertyDescriptor, H = (i, t, e, s) => {
1814
+ for (var r = s > 1 ? void 0 : s ? As(t, e) : t, n = i.length - 1, o; n >= 0; n--)
1815
+ (o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
1816
+ return s && r && ys(t, e, r), r;
1216
1817
  };
1217
- class rt extends HTMLElement {
1818
+ let C = class extends Y {
1218
1819
  constructor() {
1219
- super();
1220
- b(this, "shadowRoot");
1221
- /**
1222
- * Apply JSON items to itemfilter.
1223
- * @param json
1224
- */
1225
- b(this, "apply");
1226
- b(this, "items");
1227
- b(this, "fuse");
1228
- // TODO proper typing
1229
- b(this, "filters");
1230
- b(this, "aggregateBy");
1231
- b(this, "config");
1232
- this.filters = {}, this.shadowRoot = this.attachShadow({ mode: "open" });
1233
- const t = document.createElement("template");
1234
- t.innerHTML = Je, this.shadowRoot.appendChild(t.content.cloneNode(!0)), this.apply = (n) => {
1235
- this.config.enableSearch && (this.shadowRoot.querySelector("input[type=text").style.display = "block"), this.items = n, this.fuse = new $(this.items, {
1236
- minMatchCharLength: 1,
1820
+ super(...arguments);
1821
+ x(this, "_fuse");
1822
+ x(this, "_resultAggregation", []);
1823
+ x(this, "_items", []);
1824
+ x(this, "_results", []);
1825
+ x(this, "_filters", {});
1826
+ x(this, "_selectedResult");
1827
+ x(this, "config", {
1828
+ titleProperty: "title",
1829
+ filterProperties: ["themes"],
1830
+ aggregateResults: "themes",
1831
+ fuseConfig: {},
1832
+ enableSearch: !0,
1833
+ enableHighlighting: !1,
1834
+ onSelect: () => {
1835
+ },
1836
+ matchAllWhenEmpty: !0,
1837
+ exclusiveFilters: !1
1838
+ });
1839
+ x(this, "apply", (t) => {
1840
+ this._items = t.map((e, s) => ({
1841
+ ...e,
1842
+ id: `item-${s}`
1843
+ })), this._fuse = new W(this._items, {
1844
+ minMatchCharLength: 3,
1845
+ // location: 0,
1846
+ threshold: 0.4,
1847
+ distance: 50,
1237
1848
  includeMatches: !0,
1238
- // Search in same fields as specified by filter properties, plus name
1239
- // @ts-ignore
1240
- keys: ["name", ...this.config.filterProperties],
1241
1849
  useExtendedSearch: !0,
1242
1850
  ...this.config.fuseConfig
1243
- }), this.config.filterProperties.forEach((o) => {
1244
- const l = [
1245
- ...new Set(
1246
- this.items.reduce((f, g) => f.concat(g[o]), [])
1247
- )
1248
- ].sort(), a = this.shadowRoot.querySelector("ul#filters"), h = document.createElement("template");
1249
- h.innerHTML = et;
1250
- const u = h.content.cloneNode(!0);
1251
- u.querySelector(".title").innerHTML = o, u.querySelector("details").setAttribute("data-filter", o), a.appendChild(u), l.forEach((f) => {
1252
- const g = document.createElement("template");
1253
- g.innerHTML = Ze;
1254
- const p = g.content.cloneNode(!0), m = p.querySelector("input[type='checkbox']");
1255
- m.setAttribute("data-filter-key", o), m.setAttribute("name", "filter"), this.config.exclusiveFilters === !0 && (m.type = "radio"), m.setAttribute("data-filter-value", f), p.querySelector("span.title").innerHTML = f, this.shadowRoot.querySelector(`details[data-filter='${o}']`).appendChild(p);
1256
- }), this.config.aggregateResults === o && (this.aggregateBy = l);
1257
- }), r(), this.config.matchAllWhenEmpty !== !1 && i(this.items);
1258
- };
1259
- const r = () => {
1260
- const n = this.shadowRoot.querySelectorAll(
1261
- `input[type="${this.config.exclusiveFilters === !0 ? "radio" : "checkbox"}"]`
1262
- ), o = (l) => {
1263
- n.forEach((a) => {
1264
- var f, g;
1265
- const h = a.getAttribute("data-filter-key"), u = a.getAttribute("data-filter-value");
1266
- if (a.checked)
1267
- this.filters[h] || (this.filters[h] = []), this.filters[h].includes(u) || this.filters[h].push(u);
1268
- else {
1269
- if (l === a) {
1270
- if (!this.filters[h])
1271
- return;
1272
- this.filters[h].splice(
1273
- // @ts-ignore
1274
- this.filters[h].indexOf(u),
1275
- 1
1276
- );
1277
- } else
1278
- this.config.exclusiveFilters === !0 && // @ts-ignore
1279
- this.filters[h] && // @ts-ignore
1280
- this.filters[h].includes(u) && ((f = this.filters[h]) == null || f.splice(
1281
- // @ts-ignore
1282
- this.filters[h].indexOf(u),
1283
- 1
1284
- ));
1285
- ((g = this.filters[h]) == null ? void 0 : g.length) === 0 && delete this.filters[h];
1286
- }
1287
- });
1288
- };
1289
- n.forEach((l) => {
1290
- l.addEventListener("click", (a) => {
1291
- o(a.target), this.config.matchAllWhenEmpty !== !1 && Object.keys(this.filters).length === 0 ? i(this.items) : c(
1292
- // @ts-ignore
1293
- this.shadowRoot.querySelector("input[type='text']").value
1294
- );
1295
- });
1296
- });
1297
- }, i = (n) => {
1298
- const o = this.shadowRoot.querySelector("ul#results");
1299
- if (o.innerHTML = "", this.config.aggregateResults) {
1300
- const l = document.createElement("template");
1301
- l.innerHTML = st, this.aggregateBy.forEach((a) => {
1302
- if (
1303
- // @ts-ignore
1304
- !n.find(
1305
- (u) => Array.isArray(u[this.config.aggregateResults]) ? u[this.config.aggregateResults].includes(a) : u[this.config.aggregateResults] === a
1306
- )
1307
- )
1308
- return;
1309
- const h = l.content.cloneNode(!0);
1310
- h.querySelector("summary .title").innerHTML = a, h.querySelector("details").setAttribute("data-aggregate", a), o.appendChild(h);
1311
- });
1312
- }
1313
- n.forEach((l) => {
1314
- const a = document.createElement("template");
1315
- a.innerHTML = tt;
1316
- const h = a.content.cloneNode(!0);
1317
- h.querySelector(".title").innerHTML = l.name;
1318
- let u;
1319
- if (this.aggregateBy) {
1320
- const f = l[this.config.aggregateResults];
1321
- Array.isArray(f) ? f.forEach((g) => {
1322
- u = this.shadowRoot.querySelector(
1323
- `details[data-aggregate=${g}]`
1324
- );
1325
- }) : u = this.shadowRoot.querySelector(
1326
- `details[data-aggregate=${f}]`
1327
- );
1328
- } else
1329
- u = o;
1330
- h.querySelector("input").addEventListener("click", () => {
1331
- this.config.onSelect && this.config.onSelect(l);
1332
- }), u.appendChild(h);
1333
- }), this.config.aggregateResults && this.shadowRoot.querySelectorAll("#results details").forEach((a) => {
1334
- a.querySelector("summary .count").innerHTML = a.querySelectorAll("li").length;
1335
- });
1336
- }, c = (n, o = this.filters) => {
1337
- const l = Object.entries(o).reduce(
1338
- (u, [f, g]) => {
1339
- const p = (m) => {
1340
- const E = {};
1341
- E[f] = `=${m}`, u.push(E);
1342
- };
1343
- return Array.isArray(g) ? g.forEach((m) => p(m)) : p(g), u;
1344
- },
1345
- []
1346
- ), a = this.fuse.search({
1347
- ...n.length && Object.keys(l).length ? {
1851
+ }), this.config.filterProperties.forEach((e) => {
1852
+ const s = {};
1853
+ this._items.forEach((r) => {
1854
+ Array.isArray(r[e]) ? r[e].forEach((n) => {
1855
+ s[n] = void 0;
1856
+ }) : s[r[e]] = void 0;
1857
+ }), this._filters[e] = s;
1858
+ }), this.config.matchAllWhenEmpty !== !1 && (this._results = this.sortResults(this._items), this.requestUpdate()), this.config.aggregateResults && (this._resultAggregation = [
1859
+ ...new Set(
1860
+ this._items.reduce((e, s) => e.concat(s[this.config.aggregateResults]), [])
1861
+ )
1862
+ ].sort());
1863
+ });
1864
+ }
1865
+ search(t = "", e = this._filters) {
1866
+ const s = Object.entries(e).reduce(
1867
+ (n, [o, c]) => {
1868
+ const l = (h) => {
1869
+ const a = {};
1870
+ a[o] = `="${h}"`, n.push(a);
1871
+ };
1872
+ return Object.entries(c).filter(([h, a]) => a).forEach(([h, a]) => l(h)), n;
1873
+ },
1874
+ []
1875
+ );
1876
+ let r;
1877
+ if (!(t.length > 2) && !s.length && this.config.matchAllWhenEmpty !== !1)
1878
+ r = this._items;
1879
+ else {
1880
+ const n = {
1881
+ ...t.length > 2 && s.length ? {
1348
1882
  $and: [
1349
- { name: n },
1883
+ // @ts-ignore
1884
+ ...this.config.fuseConfig.keys.map((c) => ({
1885
+ [c]: t
1886
+ })),
1350
1887
  {
1351
- $or: l
1888
+ $or: s
1352
1889
  }
1353
1890
  ]
1354
1891
  } : {
1355
1892
  $or: [
1356
- { name: n },
1893
+ // @ts-ignore
1894
+ ...this.config.fuseConfig.keys.map((c) => ({
1895
+ [c]: t
1896
+ })),
1357
1897
  {
1358
- $or: l
1898
+ $or: s
1359
1899
  }
1360
1900
  ]
1361
1901
  }
1362
- }), h = this.config.enableHighlighting ? it(a) : (
1902
+ }, o = this._fuse.search(n);
1903
+ r = this.config.enableHighlighting ? $s(o, "highlight", this.config.titleProperty) : o.map((c) => c.item);
1904
+ }
1905
+ this._results = this.sortResults(r), this.requestUpdate();
1906
+ }
1907
+ aggregateResults(t, e) {
1908
+ return t.filter((s) => {
1909
+ const r = s[this.config.aggregateResults];
1910
+ return Array.isArray(r) ? r.includes(e) : r === e;
1911
+ });
1912
+ }
1913
+ sortResults(t) {
1914
+ return [...t].sort(
1915
+ (e, s) => (
1363
1916
  // @ts-ignore
1364
- a.map((u) => u.item)
1917
+ e[this.config.titleProperty] < s[this.config.titleProperty] ? -1 : 1
1918
+ )
1919
+ );
1920
+ }
1921
+ toggleFilter(t, e) {
1922
+ this.config.exclusiveFilters === !0 && Object.keys(this._filters).forEach((r) => {
1923
+ Object.keys(this._filters[r]).forEach((n) => {
1924
+ this._filters[r][n] = !1;
1925
+ });
1926
+ }), this._filters[t][e] = !this._filters[t][e], this.search();
1927
+ const s = this.renderRoot.querySelectorAll(
1928
+ "ul#results input[type='radio']"
1929
+ );
1930
+ for (let r = 0; r < s.length; r++)
1931
+ s[r].checked = !1;
1932
+ setTimeout(() => {
1933
+ const r = this.renderRoot.querySelector(
1934
+ // @ts-ignore
1935
+ `#${this._selectedResult.id}`
1365
1936
  );
1366
- i(h);
1367
- };
1368
- this.shadowRoot.querySelector("input[type='text']").addEventListener("input", (n) => {
1369
- const o = n.target.value;
1370
- !o && this.config.matchAllWhenEmpty !== !1 ? i(this.items) : c(o);
1937
+ r && (r.checked = !0, this.requestUpdate());
1371
1938
  });
1372
1939
  }
1373
- }
1374
- customElements.define("eox-itemfilter", rt);
1940
+ render() {
1941
+ return O`
1942
+ <style>
1943
+ ${vs}
1944
+ </style>
1945
+ <form>
1946
+ <section>
1947
+ <input
1948
+ type="text"
1949
+ placeholder="Search"
1950
+ style="display:${this.config.enableSearch ? "block" : "none"}"
1951
+ @input="${(t) => this.search(t.target.value)}"
1952
+ />
1953
+ </section>
1954
+ <section>
1955
+ <slot name="filterstitle"></slot>
1956
+ <ul id="filters">
1957
+ ${V(
1958
+ this.config.filterProperties,
1959
+ (t) => O`
1960
+ <details
1961
+ id="details-filter"
1962
+ data-filter="${t}"
1963
+ @click=${() => this.renderRoot.querySelectorAll("details#details-filter").forEach((e) => {
1964
+ e.getAttribute("data-filter") !== t && (e.removeAttribute("open"), this.requestUpdate());
1965
+ })}
1966
+ >
1967
+ <summary>
1968
+ <small>
1969
+ <strong class="title"> ${t} </strong>
1970
+ </small>
1971
+ <div>
1972
+ <svg
1973
+ xmlns="http://www.w3.org/2000/svg"
1974
+ viewBox="0 0 24 24"
1975
+ >
1976
+ <title>chevron-down</title>
1977
+ <path
1978
+ d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
1979
+ />
1980
+ </svg>
1981
+ </div>
1982
+ </summary>
1983
+ <div class="scroll" style="max-height: 150px">
1984
+ <ul>
1985
+ ${// @ts-ignore
1986
+ this._filters[t] ? V(
1987
+ // @ts-ignore
1988
+ Object.keys(this._filters[t]).sort(),
1989
+ (e) => O`
1990
+ <li>
1991
+ <label>
1992
+ <input
1993
+ name="selection"
1994
+ type="${this.config.exclusiveFilters === !0 ? "radio" : "checkbox"}"
1995
+ checked="${// @ts-ignore
1996
+ this._filters[t][e] || m}"
1997
+ @click=${() => this.toggleFilter(t, e)}
1998
+ />
1999
+ <span class="title">${e}</span>
2000
+ </label>
2001
+ </li>
2002
+ `
2003
+ ) : null}
2004
+ </ul>
2005
+ </div>
2006
+ </details>
2007
+ `
2008
+ )}
2009
+ </ul>
2010
+ </section>
2011
+ <section id="section-results">
2012
+ <div>
2013
+ <slot name="resultstitle"></slot>
2014
+ </div>
2015
+ <div id="container-results" class="scroll">
2016
+ ${this._results.length < 1 ? O` <small class="no-results">No matching items</small> ` : m}
2017
+ <ul id="results">
2018
+ ${this.config.aggregateResults ? V(
2019
+ this._resultAggregation.filter(
2020
+ (t) => this.aggregateResults(
2021
+ this._results,
2022
+ t
2023
+ ).length
2024
+ ),
2025
+ (t) => O`<details
2026
+ id="details-results"
2027
+ open
2028
+ >
2029
+ <summary>
2030
+ <svg
2031
+ xmlns="http://www.w3.org/2000/svg"
2032
+ viewBox="0 0 24 24"
2033
+ >
2034
+ <title>chevron-down</title>
2035
+ <path
2036
+ d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
2037
+ />
2038
+ </svg>
2039
+ <strong class="title"> ${t} </strong>
2040
+ <span style="margin-left: 0.25rem"
2041
+ >(${this.aggregateResults(
2042
+ this._results,
2043
+ t
2044
+ ).length})</span
2045
+ >
2046
+ </summary>
2047
+ <ul>
2048
+ ${V(
2049
+ this.aggregateResults(
2050
+ this._results,
2051
+ t
2052
+ ),
2053
+ // @ts-ignore
2054
+ (e) => O`
2055
+ <li>
2056
+ <label>
2057
+ <input
2058
+ type="radio"
2059
+ name="result"
2060
+ id="${// @ts-ignore
2061
+ e.id}"
2062
+ @click=${() => {
2063
+ this._selectedResult = e, this.config.onSelect(e);
2064
+ }}
2065
+ />
2066
+ <span class="title"
2067
+ >${// @ts-ignore
2068
+ Bt(e[this.config.titleProperty])}</span
2069
+ >
2070
+ </label>
2071
+ </li>
2072
+ `
2073
+ )}
2074
+ </ul>
2075
+ </details>`
2076
+ ) : V(
2077
+ this._results,
2078
+ // @ts-ignore
2079
+ (t) => O`<li>
2080
+ ${// @ts-ignore
2081
+ Bt(t[this.config.titleProperty])}
2082
+ </li>`
2083
+ )}
2084
+ </ul>
2085
+ </div>
2086
+ </section>
2087
+ </form>
2088
+ `;
2089
+ }
2090
+ };
2091
+ H([
2092
+ ot()
2093
+ ], C.prototype, "_items", 2);
2094
+ H([
2095
+ ot()
2096
+ ], C.prototype, "_results", 2);
2097
+ H([
2098
+ ot()
2099
+ ], C.prototype, "_filters", 2);
2100
+ H([
2101
+ ot()
2102
+ ], C.prototype, "_selectedResult", 2);
2103
+ H([
2104
+ Mt({ attribute: !1 })
2105
+ ], C.prototype, "config", 2);
2106
+ H([
2107
+ Mt()
2108
+ ], C.prototype, "apply", 2);
2109
+ C = H([
2110
+ Me("eox-itemfilter")
2111
+ ], C);
1375
2112
  export {
1376
- rt as EOxItemFilter
2113
+ C as EOxItemFilter
1377
2114
  };