@eox/itemfilter 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-itemfilter.js +693 -611
- package/dist/eox-itemfilter.umd.cjs +55 -38
- package/package.json +1 -1
- package/test/general.cy.ts +8 -4
- package/test/reducedWidth.cy.ts +1 -0
- package/test/testItems.json +40 -0
package/dist/eox-itemfilter.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var ae = Object.defineProperty;
|
|
2
|
-
var ue = (
|
|
3
|
-
var
|
|
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
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2019 Google LLC
|
|
7
7
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
8
|
*/
|
|
9
|
-
const et = window,
|
|
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
10
|
let de = class {
|
|
11
11
|
constructor(t, e, s) {
|
|
12
12
|
if (this._$cssResult$ = !0, s !== Jt)
|
|
@@ -16,7 +16,7 @@ let de = class {
|
|
|
16
16
|
get styleSheet() {
|
|
17
17
|
let t = this.o;
|
|
18
18
|
const e = this.t;
|
|
19
|
-
if (
|
|
19
|
+
if (wt && t === void 0) {
|
|
20
20
|
const s = e !== void 0 && e.length === 1;
|
|
21
21
|
s && (t = Lt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Lt.set(e, t));
|
|
22
22
|
}
|
|
@@ -26,53 +26,53 @@ let de = class {
|
|
|
26
26
|
return this.cssText;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const fe = (
|
|
30
|
-
|
|
31
|
-
const s = document.createElement("style"),
|
|
32
|
-
|
|
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
33
|
});
|
|
34
|
-
},
|
|
34
|
+
}, Ot = wt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
35
35
|
let e = "";
|
|
36
36
|
for (const s of t.cssRules)
|
|
37
37
|
e += s.cssText;
|
|
38
38
|
return fe(e);
|
|
39
|
-
})(
|
|
39
|
+
})(i) : i;
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
44
|
*/
|
|
45
|
-
var
|
|
46
|
-
const st = window,
|
|
45
|
+
var ht;
|
|
46
|
+
const st = window, kt = st.trustedTypes, ge = kt ? kt.emptyScript : "", Nt = st.reactiveElementPolyfillSupport, mt = { toAttribute(i, t) {
|
|
47
47
|
switch (t) {
|
|
48
48
|
case Boolean:
|
|
49
|
-
|
|
49
|
+
i = i ? ge : null;
|
|
50
50
|
break;
|
|
51
51
|
case Object:
|
|
52
52
|
case Array:
|
|
53
|
-
|
|
53
|
+
i = i == null ? i : JSON.stringify(i);
|
|
54
54
|
}
|
|
55
|
-
return
|
|
56
|
-
}, fromAttribute(
|
|
57
|
-
let e =
|
|
55
|
+
return i;
|
|
56
|
+
}, fromAttribute(i, t) {
|
|
57
|
+
let e = i;
|
|
58
58
|
switch (t) {
|
|
59
59
|
case Boolean:
|
|
60
|
-
e =
|
|
60
|
+
e = i !== null;
|
|
61
61
|
break;
|
|
62
62
|
case Number:
|
|
63
|
-
e =
|
|
63
|
+
e = i === null ? null : Number(i);
|
|
64
64
|
break;
|
|
65
65
|
case Object:
|
|
66
66
|
case Array:
|
|
67
67
|
try {
|
|
68
|
-
e = JSON.parse(
|
|
68
|
+
e = JSON.parse(i);
|
|
69
69
|
} catch {
|
|
70
70
|
e = null;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return e;
|
|
74
|
-
} }, Qt = (
|
|
75
|
-
let
|
|
74
|
+
} }, Qt = (i, t) => t !== i && (t == t || i == i), at = { attribute: !0, type: String, converter: mt, reflect: !1, hasChanged: Qt };
|
|
75
|
+
let z = class extends HTMLElement {
|
|
76
76
|
constructor() {
|
|
77
77
|
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
|
78
78
|
}
|
|
@@ -84,26 +84,26 @@ let F = class extends HTMLElement {
|
|
|
84
84
|
this.finalize();
|
|
85
85
|
const t = [];
|
|
86
86
|
return this.elementProperties.forEach((e, s) => {
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const r = this._$Ep(s, e);
|
|
88
|
+
r !== void 0 && (this._$Ev.set(r, s), t.push(r));
|
|
89
89
|
}), t;
|
|
90
90
|
}
|
|
91
|
-
static createProperty(t, e =
|
|
91
|
+
static createProperty(t, e = at) {
|
|
92
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,
|
|
94
|
-
|
|
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
95
|
}
|
|
96
96
|
}
|
|
97
97
|
static getPropertyDescriptor(t, e, s) {
|
|
98
98
|
return { get() {
|
|
99
99
|
return this[e];
|
|
100
|
-
}, set(
|
|
101
|
-
const
|
|
102
|
-
this[e] =
|
|
100
|
+
}, set(r) {
|
|
101
|
+
const n = this[t];
|
|
102
|
+
this[e] = r, this.requestUpdate(t, n, s);
|
|
103
103
|
}, configurable: !0, enumerable: !0 };
|
|
104
104
|
}
|
|
105
105
|
static getPropertyOptions(t) {
|
|
106
|
-
return this.elementProperties.get(t) ||
|
|
106
|
+
return this.elementProperties.get(t) || at;
|
|
107
107
|
}
|
|
108
108
|
static finalize() {
|
|
109
109
|
if (this.hasOwnProperty("finalized"))
|
|
@@ -112,8 +112,8 @@ let F = class extends HTMLElement {
|
|
|
112
112
|
const t = Object.getPrototypeOf(this);
|
|
113
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
114
|
const e = this.properties, s = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
|
|
115
|
-
for (const
|
|
116
|
-
this.createProperty(
|
|
115
|
+
for (const r of s)
|
|
116
|
+
this.createProperty(r, e[r]);
|
|
117
117
|
}
|
|
118
118
|
return this.elementStyles = this.finalizeStyles(this.styles), !0;
|
|
119
119
|
}
|
|
@@ -121,10 +121,10 @@ let F = class extends HTMLElement {
|
|
|
121
121
|
const e = [];
|
|
122
122
|
if (Array.isArray(t)) {
|
|
123
123
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
124
|
-
for (const
|
|
125
|
-
e.unshift(
|
|
124
|
+
for (const r of s)
|
|
125
|
+
e.unshift(Ot(r));
|
|
126
126
|
} else
|
|
127
|
-
t !== void 0 && e.push(
|
|
127
|
+
t !== void 0 && e.push(Ot(t));
|
|
128
128
|
return e;
|
|
129
129
|
}
|
|
130
130
|
static _$Ep(t, e) {
|
|
@@ -172,25 +172,25 @@ let F = class extends HTMLElement {
|
|
|
172
172
|
attributeChangedCallback(t, e, s) {
|
|
173
173
|
this._$AK(t, s);
|
|
174
174
|
}
|
|
175
|
-
_$EO(t, e, s =
|
|
176
|
-
var
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
const o = (((
|
|
180
|
-
this._$El = t, o == null ? this.removeAttribute(
|
|
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 : mt).toAttribute(e, s.type);
|
|
180
|
+
this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
_$AK(t, e) {
|
|
184
184
|
var s;
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const o =
|
|
188
|
-
this._$El =
|
|
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 : mt;
|
|
188
|
+
this._$El = n, this[n] = c.fromAttribute(e, o.type), this._$El = null;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
requestUpdate(t, e, s) {
|
|
192
|
-
let
|
|
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))) :
|
|
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
194
|
}
|
|
195
195
|
async _$Ej() {
|
|
196
196
|
this.isUpdatePending = !0;
|
|
@@ -209,16 +209,16 @@ let F = class extends HTMLElement {
|
|
|
209
209
|
var t;
|
|
210
210
|
if (!this.isUpdatePending)
|
|
211
211
|
return;
|
|
212
|
-
this.hasUpdated, this._$Ei && (this._$Ei.forEach((
|
|
212
|
+
this.hasUpdated, this._$Ei && (this._$Ei.forEach((r, n) => this[n] = r), this._$Ei = void 0);
|
|
213
213
|
let e = !1;
|
|
214
214
|
const s = this._$AL;
|
|
215
215
|
try {
|
|
216
|
-
e = this.shouldUpdate(s), e ? (this.willUpdate(s), (t = this._$ES) === null || t === void 0 || t.forEach((
|
|
217
|
-
var
|
|
218
|
-
return (
|
|
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
219
|
}), this.update(s)) : this._$Ek();
|
|
220
|
-
} catch (
|
|
221
|
-
throw e = !1, this._$Ek(),
|
|
220
|
+
} catch (r) {
|
|
221
|
+
throw e = !1, this._$Ek(), r;
|
|
222
222
|
}
|
|
223
223
|
e && this._$AE(s);
|
|
224
224
|
}
|
|
@@ -227,8 +227,8 @@ let F = class extends HTMLElement {
|
|
|
227
227
|
_$AE(t) {
|
|
228
228
|
var e;
|
|
229
229
|
(e = this._$ES) === null || e === void 0 || e.forEach((s) => {
|
|
230
|
-
var
|
|
231
|
-
return (
|
|
230
|
+
var r;
|
|
231
|
+
return (r = s.hostUpdated) === null || r === void 0 ? void 0 : r.call(s);
|
|
232
232
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
233
233
|
}
|
|
234
234
|
_$Ek() {
|
|
@@ -251,75 +251,75 @@ let F = class extends HTMLElement {
|
|
|
251
251
|
firstUpdated(t) {
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
|
|
254
|
+
z.finalized = !0, z.elementProperties = /* @__PURE__ */ new Map(), z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, Nt == null || Nt({ ReactiveElement: z }), ((ht = st.reactiveElementVersions) !== null && ht !== void 0 ? ht : st.reactiveElementVersions = []).push("1.6.1");
|
|
255
255
|
/**
|
|
256
256
|
* @license
|
|
257
257
|
* Copyright 2017 Google LLC
|
|
258
258
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
259
259
|
*/
|
|
260
|
-
var
|
|
261
|
-
const it = window,
|
|
262
|
-
\f\r]`, K = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
263
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
264
|
-
const e =
|
|
265
|
-
let
|
|
260
|
+
var ut;
|
|
261
|
+
const it = window, D = it.trustedTypes, Pt = D ? D.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, $t = "$lit$", M = `lit$${(Math.random() + "").slice(9)}$`, Xt = "?" + M, _e = `<${Xt}>`, T = document, G = () => T.createComment(""), J = (i) => i === null || typeof i != "object" && typeof i != "function", Zt = Array.isArray, me = (i) => Zt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", dt = `[
|
|
262
|
+
\f\r]`, K = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, Ut = />/g, O = RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
|
|
263
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, jt = /"/g, qt = /^(?:script|style|textarea|title)$/i, $e = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), k = $e(1), U = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), P = T.createTreeWalker(T, 129, null, !1), ve = (i, t) => {
|
|
264
|
+
const e = i.length - 1, s = [];
|
|
265
|
+
let r, n = t === 2 ? "<svg>" : "", o = K;
|
|
266
266
|
for (let l = 0; l < e; l++) {
|
|
267
|
-
const h =
|
|
268
|
-
let
|
|
269
|
-
for (; p < h.length && (o.lastIndex = p,
|
|
270
|
-
p = o.lastIndex, o === K ?
|
|
271
|
-
const g = o ===
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
const c =
|
|
275
|
-
if (!Array.isArray(
|
|
267
|
+
const h = i[l];
|
|
268
|
+
let a, u, d = -1, p = 0;
|
|
269
|
+
for (; p < h.length && (o.lastIndex = p, u = o.exec(h), u !== null); )
|
|
270
|
+
p = o.lastIndex, o === K ? u[1] === "!--" ? o = Tt : u[1] !== void 0 ? o = Ut : u[2] !== void 0 ? (qt.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = O) : u[3] !== void 0 && (o = O) : o === O ? u[0] === ">" ? (o = r ?? K, d = -1) : u[1] === void 0 ? d = -2 : (d = o.lastIndex - u[2].length, a = u[1], o = u[3] === void 0 ? O : u[3] === '"' ? jt : Ht) : o === jt || o === Ht ? o = O : o === Tt || o === Ut ? o = K : (o = O, r = void 0);
|
|
271
|
+
const g = o === O && i[l + 1].startsWith("/>") ? " " : "";
|
|
272
|
+
n += o === K ? h + _e : d >= 0 ? (s.push(a), h.slice(0, d) + $t + h.slice(d) + M + g) : h + M + (d === -2 ? (s.push(void 0), l) : g);
|
|
273
|
+
}
|
|
274
|
+
const c = n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "");
|
|
275
|
+
if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
|
|
276
276
|
throw Error("invalid template strings array");
|
|
277
|
-
return [
|
|
277
|
+
return [Pt !== void 0 ? Pt.createHTML(c) : c, s];
|
|
278
278
|
};
|
|
279
279
|
class Q {
|
|
280
280
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
281
|
-
let
|
|
281
|
+
let r;
|
|
282
282
|
this.parts = [];
|
|
283
|
-
let
|
|
284
|
-
const c = t.length - 1, l = this.parts, [h,
|
|
285
|
-
if (this.el = Q.createElement(h, s),
|
|
286
|
-
const
|
|
287
|
-
d.remove(),
|
|
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
288
|
}
|
|
289
|
-
for (; (
|
|
290
|
-
if (
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
for (const d of
|
|
294
|
-
if (d.endsWith(
|
|
295
|
-
const p =
|
|
296
|
-
if (
|
|
297
|
-
const g =
|
|
298
|
-
l.push({ type: 1, index:
|
|
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), m = /([.?@])?(.*)/.exec(p);
|
|
298
|
+
l.push({ type: 1, index: n, name: m[2], strings: g, ctor: m[1] === "." ? Ae : m[1] === "?" ? xe : m[1] === "@" ? Se : nt });
|
|
299
299
|
} else
|
|
300
|
-
l.push({ type: 6, index:
|
|
300
|
+
l.push({ type: 6, index: n });
|
|
301
301
|
}
|
|
302
|
-
for (const d of
|
|
303
|
-
|
|
302
|
+
for (const d of u)
|
|
303
|
+
r.removeAttribute(d);
|
|
304
304
|
}
|
|
305
|
-
if (qt.test(
|
|
306
|
-
const
|
|
305
|
+
if (qt.test(r.tagName)) {
|
|
306
|
+
const u = r.textContent.split(M), d = u.length - 1;
|
|
307
307
|
if (d > 0) {
|
|
308
|
-
|
|
308
|
+
r.textContent = D ? D.emptyScript : "";
|
|
309
309
|
for (let p = 0; p < d; p++)
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
r.append(u[p], G()), P.nextNode(), l.push({ type: 2, index: ++n });
|
|
311
|
+
r.append(u[d], G());
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
} else if (
|
|
315
|
-
if (
|
|
316
|
-
l.push({ type: 2, index:
|
|
314
|
+
} else if (r.nodeType === 8)
|
|
315
|
+
if (r.data === Xt)
|
|
316
|
+
l.push({ type: 2, index: n });
|
|
317
317
|
else {
|
|
318
|
-
let
|
|
319
|
-
for (; (
|
|
320
|
-
l.push({ type: 7, index:
|
|
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
321
|
}
|
|
322
|
-
|
|
322
|
+
n++;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
static createElement(t, e) {
|
|
@@ -327,13 +327,13 @@ class Q {
|
|
|
327
327
|
return s.innerHTML = t, s;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
var
|
|
332
|
-
if (t ===
|
|
330
|
+
function B(i, t, e = i, s) {
|
|
331
|
+
var r, n, o, c;
|
|
332
|
+
if (t === U)
|
|
333
333
|
return t;
|
|
334
|
-
let l = s !== void 0 ? (
|
|
334
|
+
let l = s !== void 0 ? (r = e._$Co) === null || r === void 0 ? void 0 : r[s] : e._$Cl;
|
|
335
335
|
const h = J(t) ? void 0 : t._$litDirective$;
|
|
336
|
-
return (l == null ? void 0 : l.constructor) !== h && ((
|
|
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
337
|
}
|
|
338
338
|
class ye {
|
|
339
339
|
constructor(t, e) {
|
|
@@ -347,17 +347,17 @@ class ye {
|
|
|
347
347
|
}
|
|
348
348
|
u(t) {
|
|
349
349
|
var e;
|
|
350
|
-
const { el: { content: s }, parts:
|
|
351
|
-
|
|
352
|
-
let o =
|
|
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
353
|
for (; h !== void 0; ) {
|
|
354
354
|
if (c === h.index) {
|
|
355
|
-
let
|
|
356
|
-
h.type === 2 ?
|
|
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
357
|
}
|
|
358
|
-
c !== (h == null ? void 0 : h.index) && (o =
|
|
358
|
+
c !== (h == null ? void 0 : h.index) && (o = P.nextNode(), c++);
|
|
359
359
|
}
|
|
360
|
-
return
|
|
360
|
+
return P.currentNode = T, n;
|
|
361
361
|
}
|
|
362
362
|
v(t) {
|
|
363
363
|
let e = 0;
|
|
@@ -366,9 +366,9 @@ class ye {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
class X {
|
|
369
|
-
constructor(t, e, s,
|
|
370
|
-
var
|
|
371
|
-
this.type = 2, this._$AH =
|
|
369
|
+
constructor(t, e, s, r) {
|
|
370
|
+
var n;
|
|
371
|
+
this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cp = (n = r == null ? void 0 : r.isConnected) === null || n === void 0 || n;
|
|
372
372
|
}
|
|
373
373
|
get _$AU() {
|
|
374
374
|
var t, e;
|
|
@@ -386,7 +386,7 @@ class X {
|
|
|
386
386
|
return this._$AB;
|
|
387
387
|
}
|
|
388
388
|
_$AI(t, e = this) {
|
|
389
|
-
t =
|
|
389
|
+
t = B(this, t, e), J(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : me(t) ? this.T(t) : this._(t);
|
|
390
390
|
}
|
|
391
391
|
k(t) {
|
|
392
392
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -395,15 +395,15 @@ class X {
|
|
|
395
395
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
|
396
396
|
}
|
|
397
397
|
_(t) {
|
|
398
|
-
this._$AH !==
|
|
398
|
+
this._$AH !== _ && J(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
|
|
399
399
|
}
|
|
400
400
|
g(t) {
|
|
401
401
|
var e;
|
|
402
|
-
const { values: s, _$litType$:
|
|
403
|
-
if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) ===
|
|
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
404
|
this._$AH.v(s);
|
|
405
405
|
else {
|
|
406
|
-
const o = new ye(
|
|
406
|
+
const o = new ye(n, this), c = o.u(this.options);
|
|
407
407
|
o.v(s), this.$(c), this._$AH = o;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
@@ -414,16 +414,16 @@ class X {
|
|
|
414
414
|
T(t) {
|
|
415
415
|
Zt(this._$AH) || (this._$AH = [], this._$AR());
|
|
416
416
|
const e = this._$AH;
|
|
417
|
-
let s,
|
|
418
|
-
for (const
|
|
419
|
-
|
|
420
|
-
|
|
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
421
|
}
|
|
422
422
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
423
423
|
var s;
|
|
424
424
|
for ((s = this._$AP) === null || s === void 0 || s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
425
|
-
const
|
|
426
|
-
t.remove(), t =
|
|
425
|
+
const r = t.nextSibling;
|
|
426
|
+
t.remove(), t = r;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
setConnected(t) {
|
|
@@ -431,9 +431,9 @@ class X {
|
|
|
431
431
|
this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
435
|
-
constructor(t, e, s,
|
|
436
|
-
this.type = 1, this._$AH =
|
|
434
|
+
class nt {
|
|
435
|
+
constructor(t, e, s, r, n) {
|
|
436
|
+
this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = _;
|
|
437
437
|
}
|
|
438
438
|
get tagName() {
|
|
439
439
|
return this.element.tagName;
|
|
@@ -441,50 +441,50 @@ class rt {
|
|
|
441
441
|
get _$AU() {
|
|
442
442
|
return this._$AM._$AU;
|
|
443
443
|
}
|
|
444
|
-
_$AI(t, e = this, s,
|
|
445
|
-
const
|
|
444
|
+
_$AI(t, e = this, s, r) {
|
|
445
|
+
const n = this.strings;
|
|
446
446
|
let o = !1;
|
|
447
|
-
if (
|
|
448
|
-
t =
|
|
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
449
|
else {
|
|
450
450
|
const c = t;
|
|
451
451
|
let l, h;
|
|
452
|
-
for (t =
|
|
453
|
-
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 === _ ? t = _ : t !== _ && (t += (h ?? "") + n[l + 1]), this._$AH[l] = h;
|
|
454
454
|
}
|
|
455
|
-
o && !
|
|
455
|
+
o && !r && this.j(t);
|
|
456
456
|
}
|
|
457
457
|
j(t) {
|
|
458
|
-
t ===
|
|
458
|
+
t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class Ae extends
|
|
461
|
+
class Ae extends nt {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
465
465
|
j(t) {
|
|
466
|
-
this.element[this.name] = t ===
|
|
466
|
+
this.element[this.name] = t === _ ? void 0 : t;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const Ee =
|
|
470
|
-
class xe extends
|
|
469
|
+
const Ee = D ? D.emptyScript : "";
|
|
470
|
+
class xe extends nt {
|
|
471
471
|
constructor() {
|
|
472
472
|
super(...arguments), this.type = 4;
|
|
473
473
|
}
|
|
474
474
|
j(t) {
|
|
475
|
-
t && t !==
|
|
475
|
+
t && t !== _ ? this.element.setAttribute(this.name, Ee) : this.element.removeAttribute(this.name);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
class Se extends
|
|
479
|
-
constructor(t, e, s,
|
|
480
|
-
super(t, e, s,
|
|
478
|
+
class Se extends nt {
|
|
479
|
+
constructor(t, e, s, r, n) {
|
|
480
|
+
super(t, e, s, r, n), this.type = 5;
|
|
481
481
|
}
|
|
482
482
|
_$AI(t, e = this) {
|
|
483
483
|
var s;
|
|
484
|
-
if ((t = (s =
|
|
484
|
+
if ((t = (s = B(this, t, e, 0)) !== null && s !== void 0 ? s : _) === U)
|
|
485
485
|
return;
|
|
486
|
-
const
|
|
487
|
-
|
|
486
|
+
const r = this._$AH, n = t === _ && r !== _ || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, o = t !== _ && (r === _ || n);
|
|
487
|
+
n && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
488
488
|
}
|
|
489
489
|
handleEvent(t) {
|
|
490
490
|
var e, s;
|
|
@@ -499,28 +499,28 @@ class be {
|
|
|
499
499
|
return this._$AM._$AU;
|
|
500
500
|
}
|
|
501
501
|
_$AI(t) {
|
|
502
|
-
|
|
502
|
+
B(this, t);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
const zt = it.litHtmlPolyfillSupport;
|
|
506
|
-
zt == null || zt(Q, X), ((
|
|
507
|
-
const we = (
|
|
508
|
-
var s,
|
|
509
|
-
const
|
|
510
|
-
let o =
|
|
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
511
|
if (o === void 0) {
|
|
512
|
-
const c = (
|
|
513
|
-
|
|
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
514
|
}
|
|
515
|
-
return o._$AI(
|
|
515
|
+
return o._$AI(i), o;
|
|
516
516
|
};
|
|
517
517
|
/**
|
|
518
518
|
* @license
|
|
519
519
|
* Copyright 2017 Google LLC
|
|
520
520
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
521
521
|
*/
|
|
522
|
-
var
|
|
523
|
-
class Y extends
|
|
522
|
+
var ft, pt;
|
|
523
|
+
class Y extends z {
|
|
524
524
|
constructor() {
|
|
525
525
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
526
526
|
}
|
|
@@ -542,65 +542,65 @@ class Y extends F {
|
|
|
542
542
|
super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
|
|
543
543
|
}
|
|
544
544
|
render() {
|
|
545
|
-
return
|
|
545
|
+
return U;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
Y.finalized = !0, Y._$litElement$ = !0, (
|
|
548
|
+
Y.finalized = !0, Y._$litElement$ = !0, (ft = globalThis.litElementHydrateSupport) === null || ft === void 0 || ft.call(globalThis, { LitElement: Y });
|
|
549
549
|
const Dt = globalThis.litElementPolyfillSupport;
|
|
550
550
|
Dt == null || Dt({ LitElement: Y });
|
|
551
|
-
((
|
|
551
|
+
((pt = globalThis.litElementVersions) !== null && pt !== void 0 ? pt : globalThis.litElementVersions = []).push("3.3.2");
|
|
552
552
|
/**
|
|
553
553
|
* @license
|
|
554
554
|
* Copyright 2017 Google LLC
|
|
555
555
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
556
556
|
*/
|
|
557
|
-
const Me = (
|
|
558
|
-
const { kind:
|
|
559
|
-
return { kind:
|
|
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
560
|
customElements.define(e, o);
|
|
561
561
|
} };
|
|
562
|
-
})(
|
|
562
|
+
})(i, t);
|
|
563
563
|
/**
|
|
564
564
|
* @license
|
|
565
565
|
* Copyright 2017 Google LLC
|
|
566
566
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
567
567
|
*/
|
|
568
|
-
const
|
|
569
|
-
e.createProperty(t.key,
|
|
568
|
+
const Re = (i, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) {
|
|
569
|
+
e.createProperty(t.key, i);
|
|
570
570
|
} } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() {
|
|
571
571
|
typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this));
|
|
572
572
|
}, finisher(e) {
|
|
573
|
-
e.createProperty(t.key,
|
|
573
|
+
e.createProperty(t.key, i);
|
|
574
574
|
} };
|
|
575
|
-
function
|
|
576
|
-
return (t, e) => e !== void 0 ? ((s,
|
|
577
|
-
|
|
578
|
-
})(
|
|
575
|
+
function Mt(i) {
|
|
576
|
+
return (t, e) => e !== void 0 ? ((s, r, n) => {
|
|
577
|
+
r.constructor.createProperty(n, s);
|
|
578
|
+
})(i, t, e) : Re(i, t);
|
|
579
579
|
}
|
|
580
580
|
/**
|
|
581
581
|
* @license
|
|
582
582
|
* Copyright 2017 Google LLC
|
|
583
583
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
584
584
|
*/
|
|
585
|
-
function
|
|
586
|
-
return
|
|
585
|
+
function ot(i) {
|
|
586
|
+
return Mt({ ...i, state: !0 });
|
|
587
587
|
}
|
|
588
588
|
/**
|
|
589
589
|
* @license
|
|
590
590
|
* Copyright 2021 Google LLC
|
|
591
591
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
592
592
|
*/
|
|
593
|
-
var
|
|
594
|
-
((
|
|
593
|
+
var gt;
|
|
594
|
+
((gt = window.HTMLSlotElement) === null || gt === void 0 ? void 0 : gt.prototype.assignedElements) != null;
|
|
595
595
|
/**
|
|
596
596
|
* @license
|
|
597
597
|
* Copyright 2021 Google LLC
|
|
598
598
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
599
599
|
*/
|
|
600
|
-
function* V(
|
|
601
|
-
if (
|
|
600
|
+
function* V(i, t) {
|
|
601
|
+
if (i !== void 0) {
|
|
602
602
|
let e = 0;
|
|
603
|
-
for (const s of
|
|
603
|
+
for (const s of i)
|
|
604
604
|
yield t(s, e++);
|
|
605
605
|
}
|
|
606
606
|
}
|
|
@@ -609,7 +609,7 @@ function* V(n, t) {
|
|
|
609
609
|
* Copyright 2017 Google LLC
|
|
610
610
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
611
611
|
*/
|
|
612
|
-
const
|
|
612
|
+
const Ce = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Ie = (i) => (...t) => ({ _$litDirective$: i, values: t });
|
|
613
613
|
class Le {
|
|
614
614
|
constructor(t) {
|
|
615
615
|
}
|
|
@@ -631,15 +631,15 @@ class Le {
|
|
|
631
631
|
* Copyright 2017 Google LLC
|
|
632
632
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
633
633
|
*/
|
|
634
|
-
class
|
|
634
|
+
class vt extends Le {
|
|
635
635
|
constructor(t) {
|
|
636
|
-
if (super(t), this.et =
|
|
636
|
+
if (super(t), this.et = _, t.type !== Ce.CHILD)
|
|
637
637
|
throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
638
638
|
}
|
|
639
639
|
render(t) {
|
|
640
|
-
if (t ===
|
|
640
|
+
if (t === _ || t == null)
|
|
641
641
|
return this.ft = void 0, this.et = t;
|
|
642
|
-
if (t ===
|
|
642
|
+
if (t === U)
|
|
643
643
|
return t;
|
|
644
644
|
if (typeof t != "string")
|
|
645
645
|
throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
@@ -650,53 +650,53 @@ class $t extends Le {
|
|
|
650
650
|
return e.raw = e, this.ft = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
|
|
654
|
-
const Bt =
|
|
655
|
-
function
|
|
656
|
-
return Array.isArray ? Array.isArray(
|
|
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
657
|
}
|
|
658
|
-
const
|
|
659
|
-
function
|
|
660
|
-
if (typeof
|
|
661
|
-
return
|
|
662
|
-
let t =
|
|
663
|
-
return t == "0" && 1 /
|
|
658
|
+
const Oe = 1 / 0;
|
|
659
|
+
function ke(i) {
|
|
660
|
+
if (typeof i == "string")
|
|
661
|
+
return i;
|
|
662
|
+
let t = i + "";
|
|
663
|
+
return t == "0" && 1 / i == -Oe ? "-0" : t;
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
665
|
+
function Ne(i) {
|
|
666
|
+
return i == null ? "" : ke(i);
|
|
667
667
|
}
|
|
668
|
-
function A(
|
|
669
|
-
return typeof
|
|
668
|
+
function A(i) {
|
|
669
|
+
return typeof i == "string";
|
|
670
670
|
}
|
|
671
|
-
function te(
|
|
672
|
-
return typeof
|
|
671
|
+
function te(i) {
|
|
672
|
+
return typeof i == "number";
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
return
|
|
674
|
+
function Pe(i) {
|
|
675
|
+
return i === !0 || i === !1 || Te(i) && se(i) == "[object Boolean]";
|
|
676
676
|
}
|
|
677
|
-
function ee(
|
|
678
|
-
return typeof
|
|
677
|
+
function ee(i) {
|
|
678
|
+
return typeof i == "object";
|
|
679
679
|
}
|
|
680
|
-
function
|
|
681
|
-
return ee(
|
|
680
|
+
function Te(i) {
|
|
681
|
+
return ee(i) && i !== null;
|
|
682
682
|
}
|
|
683
|
-
function $(
|
|
684
|
-
return
|
|
683
|
+
function $(i) {
|
|
684
|
+
return i != null;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
return !
|
|
686
|
+
function _t(i) {
|
|
687
|
+
return !i.trim().length;
|
|
688
688
|
}
|
|
689
|
-
function se(
|
|
690
|
-
return
|
|
689
|
+
function se(i) {
|
|
690
|
+
return i == null ? i === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(i);
|
|
691
691
|
}
|
|
692
|
-
const
|
|
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
693
|
class De {
|
|
694
694
|
constructor(t) {
|
|
695
695
|
this._keys = [], this._keyMap = {};
|
|
696
696
|
let e = 0;
|
|
697
697
|
t.forEach((s) => {
|
|
698
|
-
let
|
|
699
|
-
e +=
|
|
698
|
+
let r = ie(s);
|
|
699
|
+
e += r.weight, this._keys.push(r), this._keyMap[r.id] = r, e += r.weight;
|
|
700
700
|
}), this._keys.forEach((s) => {
|
|
701
701
|
s.weight /= e;
|
|
702
702
|
});
|
|
@@ -711,48 +711,48 @@ class De {
|
|
|
711
711
|
return JSON.stringify(this._keys);
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
-
function ie(
|
|
715
|
-
let t = null, e = null, s = null,
|
|
716
|
-
if (A(
|
|
717
|
-
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);
|
|
718
718
|
else {
|
|
719
|
-
if (!Wt.call(
|
|
719
|
+
if (!Wt.call(i, "name"))
|
|
720
720
|
throw new Error(Fe("name"));
|
|
721
|
-
const o =
|
|
722
|
-
if (s = o, Wt.call(
|
|
721
|
+
const o = i.name;
|
|
722
|
+
if (s = o, Wt.call(i, "weight") && (r = i.weight, r <= 0))
|
|
723
723
|
throw new Error(ze(o));
|
|
724
|
-
t = Kt(o), e =
|
|
724
|
+
t = Kt(o), e = yt(o), n = i.getFn;
|
|
725
725
|
}
|
|
726
|
-
return { path: t, id: e, weight:
|
|
726
|
+
return { path: t, id: e, weight: r, src: s, getFn: n };
|
|
727
727
|
}
|
|
728
|
-
function Kt(
|
|
729
|
-
return
|
|
728
|
+
function Kt(i) {
|
|
729
|
+
return S(i) ? i : i.split(".");
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
return
|
|
731
|
+
function yt(i) {
|
|
732
|
+
return S(i) ? i.join(".") : i;
|
|
733
733
|
}
|
|
734
|
-
function Be(
|
|
734
|
+
function Be(i, t) {
|
|
735
735
|
let e = [], s = !1;
|
|
736
|
-
const
|
|
737
|
-
if ($(
|
|
736
|
+
const r = (n, o, c) => {
|
|
737
|
+
if ($(n))
|
|
738
738
|
if (!o[c])
|
|
739
|
-
e.push(
|
|
739
|
+
e.push(n);
|
|
740
740
|
else {
|
|
741
741
|
let l = o[c];
|
|
742
|
-
const h =
|
|
742
|
+
const h = n[l];
|
|
743
743
|
if (!$(h))
|
|
744
744
|
return;
|
|
745
|
-
if (c === o.length - 1 && (A(h) || te(h) ||
|
|
746
|
-
e.push(
|
|
747
|
-
else if (
|
|
745
|
+
if (c === o.length - 1 && (A(h) || te(h) || Pe(h)))
|
|
746
|
+
e.push(Ne(h));
|
|
747
|
+
else if (S(h)) {
|
|
748
748
|
s = !0;
|
|
749
|
-
for (let
|
|
750
|
-
|
|
749
|
+
for (let a = 0, u = h.length; a < u; a += 1)
|
|
750
|
+
r(h[a], o, c + 1);
|
|
751
751
|
} else
|
|
752
|
-
o.length &&
|
|
752
|
+
o.length && r(h, o, c + 1);
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
|
-
return i
|
|
755
|
+
return r(i, A(t) ? t.split(".") : t, 0), s ? e : e[0];
|
|
756
756
|
}
|
|
757
757
|
const We = {
|
|
758
758
|
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
@@ -775,7 +775,7 @@ const We = {
|
|
|
775
775
|
// Whether to sort the result list, by score
|
|
776
776
|
shouldSort: !0,
|
|
777
777
|
// Default sort function: sort by ascending score, ascending index
|
|
778
|
-
sortFn: (
|
|
778
|
+
sortFn: (i, t) => i.score === t.score ? i.idx < t.idx ? -1 : 1 : i.score < t.score ? -1 : 1
|
|
779
779
|
}, Ve = {
|
|
780
780
|
// Approximately where in the text is the pattern expected to be found?
|
|
781
781
|
location: 0,
|
|
@@ -812,22 +812,22 @@ var f = {
|
|
|
812
812
|
...Ye
|
|
813
813
|
};
|
|
814
814
|
const Ge = /[^ ]+/g;
|
|
815
|
-
function Je(
|
|
815
|
+
function Je(i = 1, t = 3) {
|
|
816
816
|
const e = /* @__PURE__ */ new Map(), s = Math.pow(10, t);
|
|
817
817
|
return {
|
|
818
|
-
get(
|
|
819
|
-
const
|
|
820
|
-
if (e.has(
|
|
821
|
-
return e.get(
|
|
822
|
-
const o = 1 / Math.pow(
|
|
823
|
-
return e.set(
|
|
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;
|
|
824
824
|
},
|
|
825
825
|
clear() {
|
|
826
826
|
e.clear();
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
|
-
class
|
|
830
|
+
class Rt {
|
|
831
831
|
constructor({
|
|
832
832
|
getFn: t = f.getFn,
|
|
833
833
|
fieldNormWeight: e = f.fieldNormWeight
|
|
@@ -870,7 +870,7 @@ class Ct {
|
|
|
870
870
|
return this.records.length;
|
|
871
871
|
}
|
|
872
872
|
_addString(t, e) {
|
|
873
|
-
if (!$(t) ||
|
|
873
|
+
if (!$(t) || _t(t))
|
|
874
874
|
return;
|
|
875
875
|
let s = {
|
|
876
876
|
v: t,
|
|
@@ -881,37 +881,37 @@ class Ct {
|
|
|
881
881
|
}
|
|
882
882
|
_addObject(t, e) {
|
|
883
883
|
let s = { i: e, $: {} };
|
|
884
|
-
this.keys.forEach((
|
|
885
|
-
let o =
|
|
884
|
+
this.keys.forEach((r, n) => {
|
|
885
|
+
let o = r.getFn ? r.getFn(t) : this.getFn(t, r.path);
|
|
886
886
|
if ($(o)) {
|
|
887
|
-
if (
|
|
887
|
+
if (S(o)) {
|
|
888
888
|
let c = [];
|
|
889
889
|
const l = [{ nestedArrIndex: -1, value: o }];
|
|
890
890
|
for (; l.length; ) {
|
|
891
|
-
const { nestedArrIndex: h, value:
|
|
892
|
-
if ($(
|
|
893
|
-
if (A(
|
|
894
|
-
let
|
|
895
|
-
v:
|
|
891
|
+
const { nestedArrIndex: h, value: a } = l.pop();
|
|
892
|
+
if ($(a))
|
|
893
|
+
if (A(a) && !_t(a)) {
|
|
894
|
+
let u = {
|
|
895
|
+
v: a,
|
|
896
896
|
i: h,
|
|
897
|
-
n: this.norm.get(
|
|
897
|
+
n: this.norm.get(a)
|
|
898
898
|
};
|
|
899
|
-
c.push(
|
|
899
|
+
c.push(u);
|
|
900
900
|
} else
|
|
901
|
-
|
|
901
|
+
S(a) && a.forEach((u, d) => {
|
|
902
902
|
l.push({
|
|
903
903
|
nestedArrIndex: d,
|
|
904
|
-
value:
|
|
904
|
+
value: u
|
|
905
905
|
});
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
|
-
s.$[
|
|
909
|
-
} else if (A(o) && !
|
|
908
|
+
s.$[n] = c;
|
|
909
|
+
} else if (A(o) && !_t(o)) {
|
|
910
910
|
let c = {
|
|
911
911
|
v: o,
|
|
912
912
|
n: this.norm.get(o)
|
|
913
913
|
};
|
|
914
|
-
s.$[
|
|
914
|
+
s.$[n] = c;
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
}), this.records.push(s);
|
|
@@ -923,40 +923,40 @@ class Ct {
|
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
const
|
|
928
|
-
return
|
|
926
|
+
function re(i, t, { getFn: e = f.getFn, fieldNormWeight: s = f.fieldNormWeight } = {}) {
|
|
927
|
+
const r = new Rt({ getFn: e, fieldNormWeight: s });
|
|
928
|
+
return r.setKeys(i.map(ie)), r.setSources(t), r.create(), r;
|
|
929
929
|
}
|
|
930
|
-
function Qe(
|
|
931
|
-
const { keys: s, records:
|
|
932
|
-
return
|
|
930
|
+
function Qe(i, { getFn: t = f.getFn, fieldNormWeight: e = f.fieldNormWeight } = {}) {
|
|
931
|
+
const { keys: s, records: r } = i, n = new Rt({ getFn: t, fieldNormWeight: e });
|
|
932
|
+
return n.setKeys(s), n.setIndexRecords(r), n;
|
|
933
933
|
}
|
|
934
|
-
function tt(
|
|
934
|
+
function tt(i, {
|
|
935
935
|
errors: t = 0,
|
|
936
936
|
currentLocation: e = 0,
|
|
937
937
|
expectedLocation: s = 0,
|
|
938
|
-
distance:
|
|
939
|
-
ignoreLocation:
|
|
938
|
+
distance: r = f.distance,
|
|
939
|
+
ignoreLocation: n = f.ignoreLocation
|
|
940
940
|
} = {}) {
|
|
941
|
-
const o = t /
|
|
942
|
-
if (
|
|
941
|
+
const o = t / i.length;
|
|
942
|
+
if (n)
|
|
943
943
|
return o;
|
|
944
944
|
const c = Math.abs(s - e);
|
|
945
|
-
return
|
|
945
|
+
return r ? o + c / r : c ? 1 : o;
|
|
946
946
|
}
|
|
947
|
-
function Xe(
|
|
948
|
-
let e = [], s = -1,
|
|
949
|
-
for (let o =
|
|
950
|
-
let c = n
|
|
951
|
-
c && s === -1 ? s =
|
|
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
952
|
}
|
|
953
|
-
return n
|
|
953
|
+
return i[n - 1] && n - s >= t && e.push([s, n - 1]), e;
|
|
954
954
|
}
|
|
955
955
|
const N = 32;
|
|
956
|
-
function Ze(
|
|
956
|
+
function Ze(i, t, e, {
|
|
957
957
|
location: s = f.location,
|
|
958
|
-
distance:
|
|
959
|
-
threshold:
|
|
958
|
+
distance: r = f.distance,
|
|
959
|
+
threshold: n = f.threshold,
|
|
960
960
|
findAllMatches: o = f.findAllMatches,
|
|
961
961
|
minMatchCharLength: c = f.minMatchCharLength,
|
|
962
962
|
includeMatches: l = f.includeMatches,
|
|
@@ -964,88 +964,88 @@ function Ze(n, t, e, {
|
|
|
964
964
|
} = {}) {
|
|
965
965
|
if (t.length > N)
|
|
966
966
|
throw new Error(je(N));
|
|
967
|
-
const
|
|
968
|
-
let p =
|
|
969
|
-
const
|
|
967
|
+
const a = t.length, u = i.length, d = Math.max(0, Math.min(s, u));
|
|
968
|
+
let p = n, g = d;
|
|
969
|
+
const m = c > 1 || l, I = m ? Array(u) : [];
|
|
970
970
|
let E;
|
|
971
|
-
for (; (E =
|
|
971
|
+
for (; (E = i.indexOf(t, g)) > -1; ) {
|
|
972
972
|
let v = tt(t, {
|
|
973
973
|
currentLocation: E,
|
|
974
974
|
expectedLocation: d,
|
|
975
|
-
distance:
|
|
975
|
+
distance: r,
|
|
976
976
|
ignoreLocation: h
|
|
977
977
|
});
|
|
978
|
-
if (p = Math.min(v, p), g = E +
|
|
979
|
-
let
|
|
980
|
-
for (;
|
|
981
|
-
I[E +
|
|
978
|
+
if (p = Math.min(v, p), g = E + a, m) {
|
|
979
|
+
let b = 0;
|
|
980
|
+
for (; b < a; )
|
|
981
|
+
I[E + b] = 1, b += 1;
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
g = -1;
|
|
985
|
-
let
|
|
986
|
-
const he = 1 <<
|
|
987
|
-
for (let v = 0; v <
|
|
988
|
-
let
|
|
989
|
-
for (;
|
|
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
990
|
tt(t, {
|
|
991
991
|
errors: v,
|
|
992
|
-
currentLocation: d +
|
|
992
|
+
currentLocation: d + w,
|
|
993
993
|
expectedLocation: d,
|
|
994
|
-
distance:
|
|
994
|
+
distance: r,
|
|
995
995
|
ignoreLocation: h
|
|
996
|
-
}) <= p ?
|
|
997
|
-
Z =
|
|
998
|
-
let
|
|
999
|
-
|
|
1000
|
-
for (let y =
|
|
1001
|
-
let q = y - 1,
|
|
1002
|
-
if (
|
|
996
|
+
}) <= p ? b = w : Z = w, w = Math.floor((Z - b) / 2 + b);
|
|
997
|
+
Z = w;
|
|
998
|
+
let Ct = Math.max(1, d - w + 1), ct = o ? u : Math.min(d + w, u) + a, F = Array(ct + 2);
|
|
999
|
+
F[ct + 1] = (1 << v) - 1;
|
|
1000
|
+
for (let y = ct; y >= Ct; y -= 1) {
|
|
1001
|
+
let q = y - 1, It = e[i.charAt(q)];
|
|
1002
|
+
if (m && (I[q] = +!!It), F[y] = (F[y + 1] << 1 | 1) & It, v && (F[y] |= (j[y + 1] | j[y]) << 1 | 1 | j[y + 1]), F[y] & he && (L = tt(t, {
|
|
1003
1003
|
errors: v,
|
|
1004
1004
|
currentLocation: q,
|
|
1005
1005
|
expectedLocation: d,
|
|
1006
|
-
distance:
|
|
1006
|
+
distance: r,
|
|
1007
1007
|
ignoreLocation: h
|
|
1008
|
-
}),
|
|
1009
|
-
if (p =
|
|
1008
|
+
}), L <= p)) {
|
|
1009
|
+
if (p = L, g = q, g <= d)
|
|
1010
1010
|
break;
|
|
1011
|
-
|
|
1011
|
+
Ct = Math.max(1, 2 * d - g);
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
if (tt(t, {
|
|
1015
1015
|
errors: v + 1,
|
|
1016
1016
|
currentLocation: d,
|
|
1017
1017
|
expectedLocation: d,
|
|
1018
|
-
distance:
|
|
1018
|
+
distance: r,
|
|
1019
1019
|
ignoreLocation: h
|
|
1020
1020
|
}) > p)
|
|
1021
1021
|
break;
|
|
1022
|
-
|
|
1022
|
+
j = F;
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
1024
|
+
const lt = {
|
|
1025
1025
|
isMatch: g >= 0,
|
|
1026
1026
|
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
1027
|
-
score: Math.max(1e-3,
|
|
1027
|
+
score: Math.max(1e-3, L)
|
|
1028
1028
|
};
|
|
1029
|
-
if (
|
|
1029
|
+
if (m) {
|
|
1030
1030
|
const v = Xe(I, c);
|
|
1031
|
-
v.length ? l && (
|
|
1031
|
+
v.length ? l && (lt.indices = v) : lt.isMatch = !1;
|
|
1032
1032
|
}
|
|
1033
|
-
return
|
|
1033
|
+
return lt;
|
|
1034
1034
|
}
|
|
1035
|
-
function qe(
|
|
1035
|
+
function qe(i) {
|
|
1036
1036
|
let t = {};
|
|
1037
|
-
for (let e = 0, s =
|
|
1038
|
-
const
|
|
1039
|
-
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;
|
|
1040
1040
|
}
|
|
1041
1041
|
return t;
|
|
1042
1042
|
}
|
|
1043
|
-
class
|
|
1043
|
+
class ne {
|
|
1044
1044
|
constructor(t, {
|
|
1045
1045
|
location: e = f.location,
|
|
1046
1046
|
threshold: s = f.threshold,
|
|
1047
|
-
distance:
|
|
1048
|
-
includeMatches:
|
|
1047
|
+
distance: r = f.distance,
|
|
1048
|
+
includeMatches: n = f.includeMatches,
|
|
1049
1049
|
findAllMatches: o = f.findAllMatches,
|
|
1050
1050
|
minMatchCharLength: c = f.minMatchCharLength,
|
|
1051
1051
|
isCaseSensitive: l = f.isCaseSensitive,
|
|
@@ -1054,32 +1054,32 @@ class re {
|
|
|
1054
1054
|
if (this.options = {
|
|
1055
1055
|
location: e,
|
|
1056
1056
|
threshold: s,
|
|
1057
|
-
distance:
|
|
1058
|
-
includeMatches:
|
|
1057
|
+
distance: r,
|
|
1058
|
+
includeMatches: n,
|
|
1059
1059
|
findAllMatches: o,
|
|
1060
1060
|
minMatchCharLength: c,
|
|
1061
1061
|
isCaseSensitive: l,
|
|
1062
1062
|
ignoreLocation: h
|
|
1063
1063
|
}, this.pattern = l ? t : t.toLowerCase(), this.chunks = [], !this.pattern.length)
|
|
1064
1064
|
return;
|
|
1065
|
-
const
|
|
1065
|
+
const a = (d, p) => {
|
|
1066
1066
|
this.chunks.push({
|
|
1067
1067
|
pattern: d,
|
|
1068
1068
|
alphabet: qe(d),
|
|
1069
1069
|
startIndex: p
|
|
1070
1070
|
});
|
|
1071
|
-
},
|
|
1072
|
-
if (
|
|
1071
|
+
}, u = this.pattern.length;
|
|
1072
|
+
if (u > N) {
|
|
1073
1073
|
let d = 0;
|
|
1074
|
-
const p =
|
|
1074
|
+
const p = u % N, g = u - p;
|
|
1075
1075
|
for (; d < g; )
|
|
1076
|
-
|
|
1076
|
+
a(this.pattern.substr(d, N), d), d += N;
|
|
1077
1077
|
if (p) {
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1078
|
+
const m = u - N;
|
|
1079
|
+
a(this.pattern.substr(m), m);
|
|
1080
1080
|
}
|
|
1081
1081
|
} else
|
|
1082
|
-
|
|
1082
|
+
a(this.pattern, 0);
|
|
1083
1083
|
}
|
|
1084
1084
|
searchIn(t) {
|
|
1085
1085
|
const { isCaseSensitive: e, includeMatches: s } = this.options;
|
|
@@ -1091,31 +1091,31 @@ class re {
|
|
|
1091
1091
|
return s && (g.indices = [[0, t.length - 1]]), g;
|
|
1092
1092
|
}
|
|
1093
1093
|
const {
|
|
1094
|
-
location:
|
|
1095
|
-
distance:
|
|
1094
|
+
location: r,
|
|
1095
|
+
distance: n,
|
|
1096
1096
|
threshold: o,
|
|
1097
1097
|
findAllMatches: c,
|
|
1098
1098
|
minMatchCharLength: l,
|
|
1099
1099
|
ignoreLocation: h
|
|
1100
1100
|
} = this.options;
|
|
1101
|
-
let
|
|
1102
|
-
this.chunks.forEach(({ pattern: g, alphabet:
|
|
1103
|
-
const { isMatch: E, score:
|
|
1104
|
-
location:
|
|
1105
|
-
distance:
|
|
1101
|
+
let a = [], u = 0, d = !1;
|
|
1102
|
+
this.chunks.forEach(({ pattern: g, alphabet: m, startIndex: I }) => {
|
|
1103
|
+
const { isMatch: E, score: j, indices: L } = Ze(t, g, m, {
|
|
1104
|
+
location: r + I,
|
|
1105
|
+
distance: n,
|
|
1106
1106
|
threshold: o,
|
|
1107
1107
|
findAllMatches: c,
|
|
1108
1108
|
minMatchCharLength: l,
|
|
1109
1109
|
includeMatches: s,
|
|
1110
1110
|
ignoreLocation: h
|
|
1111
1111
|
});
|
|
1112
|
-
E && (d = !0),
|
|
1112
|
+
E && (d = !0), u += j, E && L && (a = [...a, ...L]);
|
|
1113
1113
|
});
|
|
1114
1114
|
let p = {
|
|
1115
1115
|
isMatch: d,
|
|
1116
|
-
score: d ?
|
|
1116
|
+
score: d ? u / this.chunks.length : 1
|
|
1117
1117
|
};
|
|
1118
|
-
return d && s && (p.indices =
|
|
1118
|
+
return d && s && (p.indices = a), p;
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
1121
|
class C {
|
|
@@ -1131,8 +1131,8 @@ class C {
|
|
|
1131
1131
|
search() {
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
function Vt(
|
|
1135
|
-
const e =
|
|
1134
|
+
function Vt(i, t) {
|
|
1135
|
+
const e = i.match(t);
|
|
1136
1136
|
return e ? e[1] : null;
|
|
1137
1137
|
}
|
|
1138
1138
|
class ts extends C {
|
|
@@ -1223,7 +1223,7 @@ class is extends C {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
class
|
|
1226
|
+
class rs extends C {
|
|
1227
1227
|
constructor(t) {
|
|
1228
1228
|
super(t);
|
|
1229
1229
|
}
|
|
@@ -1245,7 +1245,7 @@ class ns extends C {
|
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
class
|
|
1248
|
+
class ns extends C {
|
|
1249
1249
|
constructor(t) {
|
|
1250
1250
|
super(t);
|
|
1251
1251
|
}
|
|
@@ -1271,18 +1271,18 @@ class oe extends C {
|
|
|
1271
1271
|
constructor(t, {
|
|
1272
1272
|
location: e = f.location,
|
|
1273
1273
|
threshold: s = f.threshold,
|
|
1274
|
-
distance:
|
|
1275
|
-
includeMatches:
|
|
1274
|
+
distance: r = f.distance,
|
|
1275
|
+
includeMatches: n = f.includeMatches,
|
|
1276
1276
|
findAllMatches: o = f.findAllMatches,
|
|
1277
1277
|
minMatchCharLength: c = f.minMatchCharLength,
|
|
1278
1278
|
isCaseSensitive: l = f.isCaseSensitive,
|
|
1279
1279
|
ignoreLocation: h = f.ignoreLocation
|
|
1280
1280
|
} = {}) {
|
|
1281
|
-
super(t), this._bitapSearch = new
|
|
1281
|
+
super(t), this._bitapSearch = new ne(t, {
|
|
1282
1282
|
location: e,
|
|
1283
1283
|
threshold: s,
|
|
1284
|
-
distance:
|
|
1285
|
-
includeMatches:
|
|
1284
|
+
distance: r,
|
|
1285
|
+
includeMatches: n,
|
|
1286
1286
|
findAllMatches: o,
|
|
1287
1287
|
minMatchCharLength: c,
|
|
1288
1288
|
isCaseSensitive: l,
|
|
@@ -1317,49 +1317,49 @@ class le extends C {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
search(t) {
|
|
1319
1319
|
let e = 0, s;
|
|
1320
|
-
const
|
|
1320
|
+
const r = [], n = this.pattern.length;
|
|
1321
1321
|
for (; (s = t.indexOf(this.pattern, e)) > -1; )
|
|
1322
|
-
e = s +
|
|
1323
|
-
const o = !!
|
|
1322
|
+
e = s + n, r.push([s, e - 1]);
|
|
1323
|
+
const o = !!r.length;
|
|
1324
1324
|
return {
|
|
1325
1325
|
isMatch: o,
|
|
1326
1326
|
score: o ? 0 : 1,
|
|
1327
|
-
indices:
|
|
1327
|
+
indices: r
|
|
1328
1328
|
};
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
|
-
const
|
|
1331
|
+
const At = [
|
|
1332
1332
|
ts,
|
|
1333
1333
|
le,
|
|
1334
1334
|
ss,
|
|
1335
1335
|
is,
|
|
1336
|
-
rs,
|
|
1337
1336
|
ns,
|
|
1337
|
+
rs,
|
|
1338
1338
|
es,
|
|
1339
1339
|
oe
|
|
1340
|
-
], Yt =
|
|
1341
|
-
function cs(
|
|
1342
|
-
return
|
|
1343
|
-
let s = e.trim().split(os).filter((
|
|
1344
|
-
for (let
|
|
1345
|
-
const c = s[
|
|
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
1346
|
let l = !1, h = -1;
|
|
1347
1347
|
for (; !l && ++h < Yt; ) {
|
|
1348
|
-
const
|
|
1349
|
-
let
|
|
1350
|
-
|
|
1348
|
+
const a = At[h];
|
|
1349
|
+
let u = a.isMultiMatch(c);
|
|
1350
|
+
u && (r.push(new a(u, t)), l = !0);
|
|
1351
1351
|
}
|
|
1352
1352
|
if (!l)
|
|
1353
1353
|
for (h = -1; ++h < Yt; ) {
|
|
1354
|
-
const
|
|
1355
|
-
let
|
|
1356
|
-
if (
|
|
1357
|
-
|
|
1354
|
+
const a = At[h];
|
|
1355
|
+
let u = a.isSingleMatch(c);
|
|
1356
|
+
if (u) {
|
|
1357
|
+
r.push(new a(u, t));
|
|
1358
1358
|
break;
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
return
|
|
1362
|
+
return r;
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
1365
|
const hs = /* @__PURE__ */ new Set([oe.type, le.type]);
|
|
@@ -1367,8 +1367,8 @@ class as {
|
|
|
1367
1367
|
constructor(t, {
|
|
1368
1368
|
isCaseSensitive: e = f.isCaseSensitive,
|
|
1369
1369
|
includeMatches: s = f.includeMatches,
|
|
1370
|
-
minMatchCharLength:
|
|
1371
|
-
ignoreLocation:
|
|
1370
|
+
minMatchCharLength: r = f.minMatchCharLength,
|
|
1371
|
+
ignoreLocation: n = f.ignoreLocation,
|
|
1372
1372
|
findAllMatches: o = f.findAllMatches,
|
|
1373
1373
|
location: c = f.location,
|
|
1374
1374
|
threshold: l = f.threshold,
|
|
@@ -1377,9 +1377,9 @@ class as {
|
|
|
1377
1377
|
this.query = null, this.options = {
|
|
1378
1378
|
isCaseSensitive: e,
|
|
1379
1379
|
includeMatches: s,
|
|
1380
|
-
minMatchCharLength:
|
|
1380
|
+
minMatchCharLength: r,
|
|
1381
1381
|
findAllMatches: o,
|
|
1382
|
-
ignoreLocation:
|
|
1382
|
+
ignoreLocation: n,
|
|
1383
1383
|
location: c,
|
|
1384
1384
|
threshold: l,
|
|
1385
1385
|
distance: h
|
|
@@ -1395,30 +1395,30 @@ class as {
|
|
|
1395
1395
|
isMatch: !1,
|
|
1396
1396
|
score: 1
|
|
1397
1397
|
};
|
|
1398
|
-
const { includeMatches: s, isCaseSensitive:
|
|
1399
|
-
t =
|
|
1400
|
-
let
|
|
1398
|
+
const { includeMatches: s, isCaseSensitive: r } = this.options;
|
|
1399
|
+
t = r ? t : t.toLowerCase();
|
|
1400
|
+
let n = 0, o = [], c = 0;
|
|
1401
1401
|
for (let l = 0, h = e.length; l < h; l += 1) {
|
|
1402
|
-
const
|
|
1403
|
-
o.length = 0,
|
|
1404
|
-
for (let
|
|
1405
|
-
const p = u
|
|
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: m, score: I } = p.search(t);
|
|
1406
1406
|
if (g) {
|
|
1407
|
-
if (
|
|
1407
|
+
if (n += 1, c += I, s) {
|
|
1408
1408
|
const E = p.constructor.type;
|
|
1409
|
-
hs.has(E) ? o = [...o, ...
|
|
1409
|
+
hs.has(E) ? o = [...o, ...m] : o.push(m);
|
|
1410
1410
|
}
|
|
1411
1411
|
} else {
|
|
1412
|
-
c = 0,
|
|
1412
|
+
c = 0, n = 0, o.length = 0;
|
|
1413
1413
|
break;
|
|
1414
1414
|
}
|
|
1415
1415
|
}
|
|
1416
|
-
if (
|
|
1417
|
-
let
|
|
1416
|
+
if (n) {
|
|
1417
|
+
let u = {
|
|
1418
1418
|
isMatch: !0,
|
|
1419
|
-
score: c /
|
|
1419
|
+
score: c / n
|
|
1420
1420
|
};
|
|
1421
|
-
return s && (
|
|
1421
|
+
return s && (u.indices = o), u;
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
1424
|
return {
|
|
@@ -1427,109 +1427,109 @@ class as {
|
|
|
1427
1427
|
};
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
|
-
const
|
|
1431
|
-
function us(...
|
|
1432
|
-
|
|
1430
|
+
const Et = [];
|
|
1431
|
+
function us(...i) {
|
|
1432
|
+
Et.push(...i);
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1435
|
-
for (let e = 0, s =
|
|
1436
|
-
let
|
|
1437
|
-
if (
|
|
1438
|
-
return new i
|
|
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);
|
|
1439
1439
|
}
|
|
1440
|
-
return new
|
|
1440
|
+
return new ne(i, t);
|
|
1441
1441
|
}
|
|
1442
|
-
const
|
|
1442
|
+
const rt = {
|
|
1443
1443
|
AND: "$and",
|
|
1444
1444
|
OR: "$or"
|
|
1445
|
-
},
|
|
1445
|
+
}, St = {
|
|
1446
1446
|
PATH: "$path",
|
|
1447
1447
|
PATTERN: "$val"
|
|
1448
|
-
},
|
|
1449
|
-
[
|
|
1450
|
-
[t]:
|
|
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]
|
|
1451
1451
|
}))
|
|
1452
1452
|
});
|
|
1453
|
-
function ce(
|
|
1454
|
-
const s = (
|
|
1455
|
-
let
|
|
1456
|
-
const o = ds(
|
|
1457
|
-
if (!o &&
|
|
1458
|
-
return s(Gt(
|
|
1459
|
-
if (fs(
|
|
1460
|
-
const l = o ?
|
|
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
1461
|
if (!A(h))
|
|
1462
|
-
throw new Error(
|
|
1463
|
-
const
|
|
1464
|
-
keyId:
|
|
1462
|
+
throw new Error(He(l));
|
|
1463
|
+
const a = {
|
|
1464
|
+
keyId: yt(l),
|
|
1465
1465
|
pattern: h
|
|
1466
1466
|
};
|
|
1467
|
-
return e && (
|
|
1467
|
+
return e && (a.searcher = xt(h, t)), a;
|
|
1468
1468
|
}
|
|
1469
1469
|
let c = {
|
|
1470
1470
|
children: [],
|
|
1471
|
-
operator:
|
|
1471
|
+
operator: n[0]
|
|
1472
1472
|
};
|
|
1473
|
-
return
|
|
1474
|
-
const h =
|
|
1475
|
-
|
|
1476
|
-
c.children.push(s(
|
|
1473
|
+
return n.forEach((l) => {
|
|
1474
|
+
const h = r[l];
|
|
1475
|
+
S(h) && h.forEach((a) => {
|
|
1476
|
+
c.children.push(s(a));
|
|
1477
1477
|
});
|
|
1478
1478
|
}), c;
|
|
1479
1479
|
};
|
|
1480
|
-
return
|
|
1480
|
+
return bt(i) || (i = Gt(i)), s(i);
|
|
1481
1481
|
}
|
|
1482
|
-
function ps(
|
|
1483
|
-
|
|
1482
|
+
function ps(i, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
|
|
1483
|
+
i.forEach((e) => {
|
|
1484
1484
|
let s = 1;
|
|
1485
|
-
e.matches.forEach(({ key:
|
|
1486
|
-
const c =
|
|
1485
|
+
e.matches.forEach(({ key: r, norm: n, score: o }) => {
|
|
1486
|
+
const c = r ? r.weight : null;
|
|
1487
1487
|
s *= Math.pow(
|
|
1488
1488
|
o === 0 && c ? Number.EPSILON : o,
|
|
1489
|
-
(c || 1) * (t ? 1 :
|
|
1489
|
+
(c || 1) * (t ? 1 : n)
|
|
1490
1490
|
);
|
|
1491
1491
|
}), e.score = s;
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
|
-
function gs(
|
|
1495
|
-
const e =
|
|
1494
|
+
function gs(i, t) {
|
|
1495
|
+
const e = i.matches;
|
|
1496
1496
|
t.matches = [], $(e) && e.forEach((s) => {
|
|
1497
1497
|
if (!$(s.indices) || !s.indices.length)
|
|
1498
1498
|
return;
|
|
1499
|
-
const { indices:
|
|
1499
|
+
const { indices: r, value: n } = s;
|
|
1500
1500
|
let o = {
|
|
1501
|
-
indices:
|
|
1502
|
-
value:
|
|
1501
|
+
indices: r,
|
|
1502
|
+
value: n
|
|
1503
1503
|
};
|
|
1504
1504
|
s.key && (o.key = s.key.src), s.idx > -1 && (o.refIndex = s.idx), t.matches.push(o);
|
|
1505
1505
|
});
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1508
|
-
t.score =
|
|
1507
|
+
function _s(i, t) {
|
|
1508
|
+
t.score = i.score;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function ms(i, t, {
|
|
1511
1511
|
includeMatches: e = f.includeMatches,
|
|
1512
1512
|
includeScore: s = f.includeScore
|
|
1513
1513
|
} = {}) {
|
|
1514
|
-
const
|
|
1515
|
-
return e &&
|
|
1516
|
-
const { idx: o } =
|
|
1514
|
+
const r = [];
|
|
1515
|
+
return e && r.push(gs), s && r.push(_s), i.map((n) => {
|
|
1516
|
+
const { idx: o } = n, c = {
|
|
1517
1517
|
item: t[o],
|
|
1518
1518
|
refIndex: o
|
|
1519
1519
|
};
|
|
1520
|
-
return
|
|
1521
|
-
l(
|
|
1520
|
+
return r.length && r.forEach((l) => {
|
|
1521
|
+
l(n, c);
|
|
1522
1522
|
}), c;
|
|
1523
1523
|
});
|
|
1524
1524
|
}
|
|
1525
|
-
class
|
|
1525
|
+
class W {
|
|
1526
1526
|
constructor(t, e = {}, s) {
|
|
1527
1527
|
this.options = { ...f, ...e }, this.options.useExtendedSearch, this._keyStore = new De(this.options.keys), this.setCollection(t, s);
|
|
1528
1528
|
}
|
|
1529
1529
|
setCollection(t, e) {
|
|
1530
|
-
if (this._docs = t, e && !(e instanceof
|
|
1531
|
-
throw new Error(
|
|
1532
|
-
this._myIndex = e ||
|
|
1530
|
+
if (this._docs = t, e && !(e instanceof Rt))
|
|
1531
|
+
throw new Error(Ue);
|
|
1532
|
+
this._myIndex = e || re(this.options.keys, this._docs, {
|
|
1533
1533
|
getFn: this.options.getFn,
|
|
1534
1534
|
fieldNormWeight: this.options.fieldNormWeight
|
|
1535
1535
|
});
|
|
@@ -1539,9 +1539,9 @@ class B {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
remove(t = () => !1) {
|
|
1541
1541
|
const e = [];
|
|
1542
|
-
for (let s = 0,
|
|
1543
|
-
const
|
|
1544
|
-
t(
|
|
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));
|
|
1545
1545
|
}
|
|
1546
1546
|
return e;
|
|
1547
1547
|
}
|
|
@@ -1554,36 +1554,36 @@ class B {
|
|
|
1554
1554
|
search(t, { limit: e = -1 } = {}) {
|
|
1555
1555
|
const {
|
|
1556
1556
|
includeMatches: s,
|
|
1557
|
-
includeScore:
|
|
1558
|
-
shouldSort:
|
|
1557
|
+
includeScore: r,
|
|
1558
|
+
shouldSort: n,
|
|
1559
1559
|
sortFn: o,
|
|
1560
1560
|
ignoreFieldNorm: c
|
|
1561
1561
|
} = this.options;
|
|
1562
1562
|
let l = A(t) ? A(this._docs[0]) ? this._searchStringList(t) : this._searchObjectList(t) : this._searchLogical(t);
|
|
1563
|
-
return ps(l, { ignoreFieldNorm: c }),
|
|
1563
|
+
return ps(l, { ignoreFieldNorm: c }), n && l.sort(o), te(e) && e > -1 && (l = l.slice(0, e)), ms(l, this._docs, {
|
|
1564
1564
|
includeMatches: s,
|
|
1565
|
-
includeScore:
|
|
1565
|
+
includeScore: r
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
_searchStringList(t) {
|
|
1569
|
-
const e =
|
|
1570
|
-
return s.forEach(({ v:
|
|
1571
|
-
if (!$(
|
|
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))
|
|
1572
1572
|
return;
|
|
1573
|
-
const { isMatch: l, score: h, indices:
|
|
1574
|
-
l &&
|
|
1575
|
-
item:
|
|
1573
|
+
const { isMatch: l, score: h, indices: a } = e.searchIn(n);
|
|
1574
|
+
l && r.push({
|
|
1575
|
+
item: n,
|
|
1576
1576
|
idx: o,
|
|
1577
|
-
matches: [{ score: h, value:
|
|
1577
|
+
matches: [{ score: h, value: n, norm: c, indices: a }]
|
|
1578
1578
|
});
|
|
1579
|
-
}),
|
|
1579
|
+
}), r;
|
|
1580
1580
|
}
|
|
1581
1581
|
_searchLogical(t) {
|
|
1582
1582
|
const e = ce(t, this.options), s = (c, l, h) => {
|
|
1583
1583
|
if (!c.children) {
|
|
1584
|
-
const { keyId:
|
|
1585
|
-
key: this._keyStore.get(
|
|
1586
|
-
value: this._myIndex.getValueForItemAtKeyId(l,
|
|
1584
|
+
const { keyId: u, searcher: d } = c, p = this._findMatches({
|
|
1585
|
+
key: this._keyStore.get(u),
|
|
1586
|
+
value: this._myIndex.getValueForItemAtKeyId(l, u),
|
|
1587
1587
|
searcher: d
|
|
1588
1588
|
});
|
|
1589
1589
|
return p && p.length ? [
|
|
@@ -1594,105 +1594,105 @@ class B {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
] : [];
|
|
1596
1596
|
}
|
|
1597
|
-
const
|
|
1598
|
-
for (let
|
|
1599
|
-
const p = c.children[
|
|
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
1600
|
if (g.length)
|
|
1601
|
-
|
|
1602
|
-
else if (c.operator ===
|
|
1601
|
+
a.push(...g);
|
|
1602
|
+
else if (c.operator === rt.AND)
|
|
1603
1603
|
return [];
|
|
1604
1604
|
}
|
|
1605
|
-
return
|
|
1606
|
-
},
|
|
1607
|
-
return
|
|
1605
|
+
return a;
|
|
1606
|
+
}, r = this._myIndex.records, n = {}, o = [];
|
|
1607
|
+
return r.forEach(({ $: c, i: l }) => {
|
|
1608
1608
|
if ($(c)) {
|
|
1609
1609
|
let h = s(e, c, l);
|
|
1610
|
-
h.length && (
|
|
1611
|
-
|
|
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);
|
|
1612
1612
|
}));
|
|
1613
1613
|
}
|
|
1614
1614
|
}), o;
|
|
1615
1615
|
}
|
|
1616
1616
|
_searchObjectList(t) {
|
|
1617
|
-
const e =
|
|
1618
|
-
return
|
|
1617
|
+
const e = xt(t, this.options), { keys: s, records: r } = this._myIndex, n = [];
|
|
1618
|
+
return r.forEach(({ $: o, i: c }) => {
|
|
1619
1619
|
if (!$(o))
|
|
1620
1620
|
return;
|
|
1621
1621
|
let l = [];
|
|
1622
|
-
s.forEach((h,
|
|
1622
|
+
s.forEach((h, a) => {
|
|
1623
1623
|
l.push(
|
|
1624
1624
|
...this._findMatches({
|
|
1625
1625
|
key: h,
|
|
1626
|
-
value: o[
|
|
1626
|
+
value: o[a],
|
|
1627
1627
|
searcher: e
|
|
1628
1628
|
})
|
|
1629
1629
|
);
|
|
1630
|
-
}), l.length &&
|
|
1630
|
+
}), l.length && n.push({
|
|
1631
1631
|
idx: c,
|
|
1632
1632
|
item: o,
|
|
1633
1633
|
matches: l
|
|
1634
1634
|
});
|
|
1635
|
-
}),
|
|
1635
|
+
}), n;
|
|
1636
1636
|
}
|
|
1637
1637
|
_findMatches({ key: t, value: e, searcher: s }) {
|
|
1638
1638
|
if (!$(e))
|
|
1639
1639
|
return [];
|
|
1640
|
-
let
|
|
1641
|
-
if (
|
|
1642
|
-
e.forEach(({ v:
|
|
1643
|
-
if (!$(
|
|
1640
|
+
let r = [];
|
|
1641
|
+
if (S(e))
|
|
1642
|
+
e.forEach(({ v: n, i: o, n: c }) => {
|
|
1643
|
+
if (!$(n))
|
|
1644
1644
|
return;
|
|
1645
|
-
const { isMatch: l, score: h, indices:
|
|
1646
|
-
l &&
|
|
1645
|
+
const { isMatch: l, score: h, indices: a } = s.searchIn(n);
|
|
1646
|
+
l && r.push({
|
|
1647
1647
|
score: h,
|
|
1648
1648
|
key: t,
|
|
1649
|
-
value:
|
|
1649
|
+
value: n,
|
|
1650
1650
|
idx: o,
|
|
1651
1651
|
norm: c,
|
|
1652
|
-
indices:
|
|
1652
|
+
indices: a
|
|
1653
1653
|
});
|
|
1654
1654
|
});
|
|
1655
1655
|
else {
|
|
1656
|
-
const { v:
|
|
1657
|
-
c &&
|
|
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 });
|
|
1658
1658
|
}
|
|
1659
|
-
return
|
|
1659
|
+
return r;
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1662
|
+
W.version = "6.6.2";
|
|
1663
|
+
W.createIndex = re;
|
|
1664
|
+
W.parseIndex = Qe;
|
|
1665
|
+
W.config = f;
|
|
1666
|
+
W.parseQuery = ce;
|
|
1667
1667
|
us(as);
|
|
1668
|
-
const $s = (
|
|
1669
|
-
const
|
|
1670
|
-
const
|
|
1671
|
-
let
|
|
1672
|
-
for (
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
},
|
|
1676
|
-
let
|
|
1677
|
-
return
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1680
|
-
|
|
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
1681
|
`<mark class="${t}">`,
|
|
1682
|
-
|
|
1682
|
+
n.substring(h[0], a),
|
|
1683
1683
|
"</mark>"
|
|
1684
|
-
].join(""),
|
|
1685
|
-
}),
|
|
1684
|
+
].join(""), l = a;
|
|
1685
|
+
}), c += n.substring(l), c;
|
|
1686
1686
|
};
|
|
1687
|
-
return
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
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
1694
|
);
|
|
1695
|
-
}),
|
|
1695
|
+
}), c;
|
|
1696
1696
|
});
|
|
1697
1697
|
}, vs = `
|
|
1698
1698
|
:host {
|
|
@@ -1761,7 +1761,7 @@ details summary {
|
|
|
1761
1761
|
#details-results[open] summary svg {
|
|
1762
1762
|
transform: rotate(0deg);
|
|
1763
1763
|
}
|
|
1764
|
-
li span,
|
|
1764
|
+
#details-filter li span,
|
|
1765
1765
|
details summary {
|
|
1766
1766
|
text-transform: capitalize;
|
|
1767
1767
|
}
|
|
@@ -1780,6 +1780,7 @@ input[type="radio"] {
|
|
|
1780
1780
|
input[type="text"] {
|
|
1781
1781
|
width: 100%;
|
|
1782
1782
|
margin-bottom: 0.5rem;
|
|
1783
|
+
padding: 5px 7px;
|
|
1783
1784
|
}
|
|
1784
1785
|
section {
|
|
1785
1786
|
padding-left: 1rem;
|
|
@@ -1803,26 +1804,31 @@ ul#results {
|
|
|
1803
1804
|
ul#results li {
|
|
1804
1805
|
padding-left: 0.5rem;
|
|
1805
1806
|
}
|
|
1807
|
+
#filter-reset {
|
|
1808
|
+
cursor: pointer;
|
|
1809
|
+
}
|
|
1806
1810
|
.scroll {
|
|
1807
1811
|
height: 100%;
|
|
1808
1812
|
overflow-x: hidden;
|
|
1809
1813
|
overflow-y: auto;
|
|
1810
1814
|
}
|
|
1811
1815
|
`;
|
|
1812
|
-
var ys = Object.defineProperty, As = Object.getOwnPropertyDescriptor,
|
|
1813
|
-
for (var
|
|
1814
|
-
(o = n
|
|
1815
|
-
return s &&
|
|
1816
|
+
var ys = Object.defineProperty, As = Object.getOwnPropertyDescriptor, H = (i, t, e, s) => {
|
|
1817
|
+
for (var r = s > 1 ? void 0 : s ? As(t, e) : t, n = i.length - 1, o; n >= 0; n--)
|
|
1818
|
+
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
|
|
1819
|
+
return s && r && ys(t, e, r), r;
|
|
1816
1820
|
};
|
|
1817
|
-
let
|
|
1821
|
+
let R = class extends Y {
|
|
1818
1822
|
constructor() {
|
|
1819
1823
|
super(...arguments);
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1824
|
+
x(this, "_fuse");
|
|
1825
|
+
x(this, "_resultAggregation", []);
|
|
1826
|
+
x(this, "_items", []);
|
|
1827
|
+
x(this, "_results", []);
|
|
1828
|
+
x(this, "_filters", {});
|
|
1829
|
+
x(this, "_selectedResult");
|
|
1830
|
+
x(this, "config", {
|
|
1831
|
+
titleProperty: "title",
|
|
1826
1832
|
filterProperties: ["themes"],
|
|
1827
1833
|
aggregateResults: "themes",
|
|
1828
1834
|
fuseConfig: {},
|
|
@@ -1833,22 +1839,26 @@ let P = class extends Y {
|
|
|
1833
1839
|
matchAllWhenEmpty: !0,
|
|
1834
1840
|
exclusiveFilters: !1
|
|
1835
1841
|
});
|
|
1836
|
-
|
|
1837
|
-
this._items = t,
|
|
1838
|
-
|
|
1842
|
+
x(this, "apply", (t) => {
|
|
1843
|
+
this._items = t.map((e, s) => ({
|
|
1844
|
+
...e,
|
|
1845
|
+
id: `item-${s}`
|
|
1846
|
+
})), this._fuse = new W(this._items, {
|
|
1847
|
+
minMatchCharLength: 3,
|
|
1848
|
+
// location: 0,
|
|
1849
|
+
threshold: 0.4,
|
|
1850
|
+
distance: 50,
|
|
1839
1851
|
includeMatches: !0,
|
|
1840
|
-
// Search in same fields as specified by filter properties, plus name
|
|
1841
|
-
keys: ["name", ...this.config.filterProperties],
|
|
1842
1852
|
useExtendedSearch: !0,
|
|
1843
1853
|
...this.config.fuseConfig
|
|
1844
1854
|
}), this.config.filterProperties.forEach((e) => {
|
|
1845
1855
|
const s = {};
|
|
1846
|
-
this._items.forEach((
|
|
1847
|
-
Array.isArray(
|
|
1848
|
-
s[
|
|
1849
|
-
}) : s[
|
|
1856
|
+
this._items.forEach((r) => {
|
|
1857
|
+
Array.isArray(r[e]) ? r[e].forEach((n) => {
|
|
1858
|
+
s[n] = void 0;
|
|
1859
|
+
}) : s[r[e]] = void 0;
|
|
1850
1860
|
}), this._filters[e] = s;
|
|
1851
|
-
}), this.config.matchAllWhenEmpty !== !1 && (this._results = this._items, this.requestUpdate()), this.config.aggregateResults && (this._resultAggregation = [
|
|
1861
|
+
}), this.config.matchAllWhenEmpty !== !1 && (this._results = this.sortResults(this._items), this.requestUpdate()), this.config.aggregateResults && (this._resultAggregation = [
|
|
1852
1862
|
...new Set(
|
|
1853
1863
|
this._items.reduce((e, s) => e.concat(s[this.config.aggregateResults]), [])
|
|
1854
1864
|
)
|
|
@@ -1857,55 +1867,105 @@ let P = class extends Y {
|
|
|
1857
1867
|
}
|
|
1858
1868
|
search(t = "", e = this._filters) {
|
|
1859
1869
|
const s = Object.entries(e).reduce(
|
|
1860
|
-
(
|
|
1870
|
+
(n, [o, c]) => {
|
|
1861
1871
|
const l = (h) => {
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1872
|
+
const a = {};
|
|
1873
|
+
a[o] = `="${h}"`, n.push(a);
|
|
1864
1874
|
};
|
|
1865
|
-
return Object.entries(c).filter(([h,
|
|
1875
|
+
return Object.entries(c).filter(([h, a]) => a).forEach(([h, a]) => l(h)), n;
|
|
1866
1876
|
},
|
|
1867
1877
|
[]
|
|
1868
1878
|
);
|
|
1869
|
-
let
|
|
1870
|
-
if (!t.length && !s.length && this.config.matchAllWhenEmpty !== !1)
|
|
1871
|
-
|
|
1879
|
+
let r;
|
|
1880
|
+
if (!(t.length > 2) && !s.length && this.config.matchAllWhenEmpty !== !1)
|
|
1881
|
+
r = this._items;
|
|
1872
1882
|
else {
|
|
1873
|
-
const
|
|
1874
|
-
...t.length && s.length ? {
|
|
1883
|
+
const n = {
|
|
1884
|
+
...t.length > 2 && s.length ? {
|
|
1875
1885
|
$and: [
|
|
1876
|
-
{
|
|
1886
|
+
{
|
|
1887
|
+
$or: [
|
|
1888
|
+
// @ts-ignore
|
|
1889
|
+
...this.config.fuseConfig.keys.map((c) => ({
|
|
1890
|
+
[c]: t
|
|
1891
|
+
}))
|
|
1892
|
+
]
|
|
1893
|
+
},
|
|
1877
1894
|
{
|
|
1878
1895
|
$or: s
|
|
1879
1896
|
}
|
|
1880
1897
|
]
|
|
1881
1898
|
} : {
|
|
1882
1899
|
$or: [
|
|
1883
|
-
|
|
1900
|
+
// @ts-ignore
|
|
1901
|
+
...this.config.fuseConfig.keys.map((c) => ({
|
|
1902
|
+
[c]: t
|
|
1903
|
+
})),
|
|
1884
1904
|
{
|
|
1885
1905
|
$or: s
|
|
1886
1906
|
}
|
|
1887
1907
|
]
|
|
1888
1908
|
}
|
|
1889
|
-
}, o = this._fuse.search(
|
|
1890
|
-
|
|
1909
|
+
}, o = this._fuse.search(n);
|
|
1910
|
+
r = this.config.enableHighlighting ? $s(o, "highlight", this.config.titleProperty) : o.map((c) => c.item);
|
|
1891
1911
|
}
|
|
1892
|
-
this._results =
|
|
1912
|
+
this._results = this.sortResults(r), this.requestUpdate();
|
|
1893
1913
|
}
|
|
1894
1914
|
aggregateResults(t, e) {
|
|
1895
1915
|
return t.filter((s) => {
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1916
|
+
const r = s[this.config.aggregateResults], n = Object.keys(
|
|
1917
|
+
// @ts-ignore
|
|
1918
|
+
this._filters[this.config.aggregateResults]
|
|
1919
|
+
// @ts-ignore
|
|
1920
|
+
).filter((c) => this._filters[this.config.aggregateResults][c]);
|
|
1921
|
+
return (n.length ? (
|
|
1922
|
+
// @ts-ignore
|
|
1923
|
+
n.includes(e)
|
|
1924
|
+
) : !0) && Array.isArray(r) ? r.includes(e) : r === e;
|
|
1898
1925
|
});
|
|
1899
1926
|
}
|
|
1927
|
+
sortResults(t) {
|
|
1928
|
+
return [...t].sort(
|
|
1929
|
+
(e, s) => (
|
|
1930
|
+
// @ts-ignore
|
|
1931
|
+
e[this.config.titleProperty] < s[this.config.titleProperty] ? -1 : 1
|
|
1932
|
+
)
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1900
1935
|
toggleFilter(t, e) {
|
|
1901
|
-
this.config.exclusiveFilters === !0 && Object.keys(this._filters).forEach((
|
|
1902
|
-
Object.keys(this._filters[
|
|
1903
|
-
this._filters[
|
|
1936
|
+
this.config.exclusiveFilters === !0 && Object.keys(this._filters).forEach((n) => {
|
|
1937
|
+
Object.keys(this._filters[n]).forEach((o) => {
|
|
1938
|
+
this._filters[n][o] = !1;
|
|
1939
|
+
});
|
|
1940
|
+
}), this._filters[t][e] = !this._filters[t][e];
|
|
1941
|
+
const s = this.renderRoot.querySelector('input[type="text"]');
|
|
1942
|
+
s ? this.search(s.value) : this.search();
|
|
1943
|
+
const r = this.renderRoot.querySelectorAll(
|
|
1944
|
+
"ul#results input[type='radio']"
|
|
1945
|
+
);
|
|
1946
|
+
for (let n = 0; n < r.length; n++)
|
|
1947
|
+
r[n].checked = !1;
|
|
1948
|
+
this._selectedResult && setTimeout(() => {
|
|
1949
|
+
const n = this.renderRoot.querySelector(
|
|
1950
|
+
// @ts-ignore
|
|
1951
|
+
`#${this._selectedResult.id}`
|
|
1952
|
+
);
|
|
1953
|
+
n && (n.checked = !0, this.requestUpdate());
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
resetFilters() {
|
|
1957
|
+
this.renderRoot.querySelectorAll("#details-filter input").forEach((e) => {
|
|
1958
|
+
e.checked = !1;
|
|
1959
|
+
});
|
|
1960
|
+
const t = this.renderRoot.querySelector('input[type="text"]');
|
|
1961
|
+
t && (t.value = ""), Object.keys(this._filters).forEach((e) => {
|
|
1962
|
+
Object.keys(this._filters[e]).forEach((s) => {
|
|
1963
|
+
this._filters[e][s] = !1;
|
|
1904
1964
|
});
|
|
1905
|
-
}), this.
|
|
1965
|
+
}), this.search(), this.requestUpdate();
|
|
1906
1966
|
}
|
|
1907
1967
|
render() {
|
|
1908
|
-
return
|
|
1968
|
+
return k`
|
|
1909
1969
|
<style>
|
|
1910
1970
|
${vs}
|
|
1911
1971
|
</style>
|
|
@@ -1923,8 +1983,14 @@ let P = class extends Y {
|
|
|
1923
1983
|
<ul id="filters">
|
|
1924
1984
|
${V(
|
|
1925
1985
|
this.config.filterProperties,
|
|
1926
|
-
(t) =>
|
|
1927
|
-
<details
|
|
1986
|
+
(t) => k`
|
|
1987
|
+
<details
|
|
1988
|
+
id="details-filter"
|
|
1989
|
+
data-filter="${t}"
|
|
1990
|
+
@click=${() => this.renderRoot.querySelectorAll("details#details-filter").forEach((e) => {
|
|
1991
|
+
e.getAttribute("data-filter") !== t && (e.removeAttribute("open"), this.requestUpdate());
|
|
1992
|
+
})}
|
|
1993
|
+
>
|
|
1928
1994
|
<summary>
|
|
1929
1995
|
<small>
|
|
1930
1996
|
<strong class="title"> ${t} </strong>
|
|
@@ -1941,37 +2007,43 @@ let P = class extends Y {
|
|
|
1941
2007
|
</svg>
|
|
1942
2008
|
</div>
|
|
1943
2009
|
</summary>
|
|
1944
|
-
<
|
|
1945
|
-
|
|
2010
|
+
<div class="scroll" style="max-height: 150px">
|
|
2011
|
+
<ul>
|
|
2012
|
+
${// @ts-ignore
|
|
1946
2013
|
this._filters[t] ? V(
|
|
1947
2014
|
// @ts-ignore
|
|
1948
2015
|
Object.keys(this._filters[t]).sort(),
|
|
1949
|
-
(e) =>
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
this._filters[t][e] ||
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2016
|
+
(e) => k`
|
|
2017
|
+
<li>
|
|
2018
|
+
<label>
|
|
2019
|
+
<input
|
|
2020
|
+
name="selection"
|
|
2021
|
+
type="${this.config.exclusiveFilters === !0 ? "radio" : "checkbox"}"
|
|
2022
|
+
checked="${// @ts-ignore
|
|
2023
|
+
this._filters[t][e] || _}"
|
|
2024
|
+
@click=${() => this.toggleFilter(t, e)}
|
|
2025
|
+
/>
|
|
2026
|
+
<span class="title">${e}</span>
|
|
2027
|
+
</label>
|
|
2028
|
+
</li>
|
|
2029
|
+
`
|
|
1963
2030
|
) : null}
|
|
1964
|
-
|
|
2031
|
+
</ul>
|
|
2032
|
+
</div>
|
|
1965
2033
|
</details>
|
|
1966
2034
|
`
|
|
1967
2035
|
)}
|
|
1968
2036
|
</ul>
|
|
2037
|
+
<a id="filter-reset" @click=${() => this.resetFilters()}
|
|
2038
|
+
><small>Reset filters</small></a
|
|
2039
|
+
>
|
|
1969
2040
|
</section>
|
|
1970
2041
|
<section id="section-results">
|
|
1971
2042
|
<div>
|
|
1972
2043
|
<slot name="resultstitle"></slot>
|
|
1973
2044
|
</div>
|
|
1974
2045
|
<div id="container-results" class="scroll">
|
|
2046
|
+
${this._results.length < 1 ? k` <small class="no-results">No matching items</small> ` : _}
|
|
1975
2047
|
<ul id="results">
|
|
1976
2048
|
${this.config.aggregateResults ? V(
|
|
1977
2049
|
this._resultAggregation.filter(
|
|
@@ -1980,7 +2052,7 @@ let P = class extends Y {
|
|
|
1980
2052
|
t
|
|
1981
2053
|
).length
|
|
1982
2054
|
),
|
|
1983
|
-
(t) =>
|
|
2055
|
+
(t) => k`<details
|
|
1984
2056
|
id="details-results"
|
|
1985
2057
|
open
|
|
1986
2058
|
>
|
|
@@ -2009,17 +2081,21 @@ let P = class extends Y {
|
|
|
2009
2081
|
t
|
|
2010
2082
|
),
|
|
2011
2083
|
// @ts-ignore
|
|
2012
|
-
(e) =>
|
|
2084
|
+
(e) => k`
|
|
2013
2085
|
<li>
|
|
2014
2086
|
<label>
|
|
2015
2087
|
<input
|
|
2016
2088
|
type="radio"
|
|
2017
2089
|
name="result"
|
|
2018
|
-
|
|
2090
|
+
id="${// @ts-ignore
|
|
2091
|
+
e.id}"
|
|
2092
|
+
@click=${() => {
|
|
2093
|
+
this._selectedResult = e, this.config.onSelect(e);
|
|
2094
|
+
}}
|
|
2019
2095
|
/>
|
|
2020
2096
|
<span class="title"
|
|
2021
2097
|
>${// @ts-ignore
|
|
2022
|
-
Bt(e.
|
|
2098
|
+
Bt(e[this.config.titleProperty])}</span
|
|
2023
2099
|
>
|
|
2024
2100
|
</label>
|
|
2025
2101
|
</li>
|
|
@@ -2030,7 +2106,10 @@ let P = class extends Y {
|
|
|
2030
2106
|
) : V(
|
|
2031
2107
|
this._results,
|
|
2032
2108
|
// @ts-ignore
|
|
2033
|
-
(t) =>
|
|
2109
|
+
(t) => k`<li>
|
|
2110
|
+
${// @ts-ignore
|
|
2111
|
+
Bt(t[this.config.titleProperty])}
|
|
2112
|
+
</li>`
|
|
2034
2113
|
)}
|
|
2035
2114
|
</ul>
|
|
2036
2115
|
</div>
|
|
@@ -2039,24 +2118,27 @@ let P = class extends Y {
|
|
|
2039
2118
|
`;
|
|
2040
2119
|
}
|
|
2041
2120
|
};
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
],
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
],
|
|
2048
|
-
|
|
2121
|
+
H([
|
|
2122
|
+
ot()
|
|
2123
|
+
], R.prototype, "_items", 2);
|
|
2124
|
+
H([
|
|
2125
|
+
ot()
|
|
2126
|
+
], R.prototype, "_results", 2);
|
|
2127
|
+
H([
|
|
2128
|
+
ot()
|
|
2129
|
+
], R.prototype, "_filters", 2);
|
|
2130
|
+
H([
|
|
2131
|
+
ot()
|
|
2132
|
+
], R.prototype, "_selectedResult", 2);
|
|
2133
|
+
H([
|
|
2134
|
+
Mt({ attribute: !1 })
|
|
2135
|
+
], R.prototype, "config", 2);
|
|
2136
|
+
H([
|
|
2049
2137
|
Mt()
|
|
2050
|
-
],
|
|
2051
|
-
|
|
2052
|
-
wt({ attribute: !1 })
|
|
2053
|
-
], P.prototype, "config", 2);
|
|
2054
|
-
W([
|
|
2055
|
-
wt()
|
|
2056
|
-
], P.prototype, "apply", 2);
|
|
2057
|
-
P = W([
|
|
2138
|
+
], R.prototype, "apply", 2);
|
|
2139
|
+
R = H([
|
|
2058
2140
|
Me("eox-itemfilter")
|
|
2059
|
-
],
|
|
2141
|
+
], R);
|
|
2060
2142
|
export {
|
|
2061
|
-
|
|
2143
|
+
R as EOxItemFilter
|
|
2062
2144
|
};
|