@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.
- package/dist/eox-itemfilter.js +1597 -860
- package/dist/eox-itemfilter.umd.cjs +168 -68
- package/package.json +3 -2
- package/test/general.cy.ts +9 -5
- package/test/reducedWidth.cy.ts +1 -0
- package/test/testItems.json +40 -0
package/dist/eox-itemfilter.js
CHANGED
|
@@ -1,57 +1,708 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ue = (
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
15
|
-
return
|
|
665
|
+
function ke(i) {
|
|
666
|
+
return i == null ? "" : Oe(i);
|
|
16
667
|
}
|
|
17
|
-
function
|
|
18
|
-
return typeof
|
|
668
|
+
function A(i) {
|
|
669
|
+
return typeof i == "string";
|
|
19
670
|
}
|
|
20
|
-
function
|
|
21
|
-
return typeof
|
|
671
|
+
function te(i) {
|
|
672
|
+
return typeof i == "number";
|
|
22
673
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
674
|
+
function Pe(i) {
|
|
675
|
+
return i === !0 || i === !1 || Te(i) && se(i) == "[object Boolean]";
|
|
25
676
|
}
|
|
26
|
-
function
|
|
27
|
-
return typeof
|
|
677
|
+
function ee(i) {
|
|
678
|
+
return typeof i == "object";
|
|
28
679
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
680
|
+
function Te(i) {
|
|
681
|
+
return ee(i) && i !== null;
|
|
31
682
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
683
|
+
function $(i) {
|
|
684
|
+
return i != null;
|
|
34
685
|
}
|
|
35
|
-
function
|
|
36
|
-
return !
|
|
686
|
+
function mt(i) {
|
|
687
|
+
return !i.trim().length;
|
|
37
688
|
}
|
|
38
|
-
function se(
|
|
39
|
-
return
|
|
689
|
+
function se(i) {
|
|
690
|
+
return i == null ? i === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(i);
|
|
40
691
|
}
|
|
41
|
-
const
|
|
42
|
-
class
|
|
43
|
-
constructor(
|
|
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
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
}), this._keys.forEach((
|
|
50
|
-
|
|
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(
|
|
54
|
-
return this._keyMap[
|
|
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(
|
|
64
|
-
let
|
|
65
|
-
if (
|
|
66
|
-
|
|
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 (!
|
|
69
|
-
throw new Error(
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
throw new Error(
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
return { path:
|
|
76
|
-
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
if (!
|
|
88
|
-
|
|
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 =
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
741
|
+
let l = o[c];
|
|
742
|
+
const h = n[l];
|
|
743
|
+
if (!$(h))
|
|
93
744
|
return;
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
else if (
|
|
97
|
-
|
|
98
|
-
for (let
|
|
99
|
-
|
|
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
|
-
|
|
752
|
+
o.length && r(h, o, c + 1);
|
|
102
753
|
}
|
|
103
754
|
};
|
|
104
|
-
return i
|
|
755
|
+
return r(i, A(t) ? t.split(".") : t, 0), s ? e : e[0];
|
|
105
756
|
}
|
|
106
|
-
const
|
|
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
|
-
},
|
|
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: (
|
|
128
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
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
|
|
158
|
-
...
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
...
|
|
808
|
+
var f = {
|
|
809
|
+
...Ke,
|
|
810
|
+
...We,
|
|
811
|
+
...Ve,
|
|
812
|
+
...Ye
|
|
162
813
|
};
|
|
163
|
-
const
|
|
164
|
-
function
|
|
165
|
-
const
|
|
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(
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
return
|
|
171
|
-
const
|
|
172
|
-
return
|
|
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
|
-
|
|
826
|
+
e.clear();
|
|
176
827
|
}
|
|
177
828
|
};
|
|
178
829
|
}
|
|
179
|
-
class
|
|
830
|
+
class Ct {
|
|
180
831
|
constructor({
|
|
181
|
-
getFn:
|
|
182
|
-
fieldNormWeight:
|
|
832
|
+
getFn: t = f.getFn,
|
|
833
|
+
fieldNormWeight: e = f.fieldNormWeight
|
|
183
834
|
} = {}) {
|
|
184
|
-
this.norm =
|
|
835
|
+
this.norm = Je(e, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
|
|
185
836
|
}
|
|
186
|
-
setSources(
|
|
187
|
-
this.docs =
|
|
837
|
+
setSources(t = []) {
|
|
838
|
+
this.docs = t;
|
|
188
839
|
}
|
|
189
|
-
setIndexRecords(
|
|
190
|
-
this.records =
|
|
840
|
+
setIndexRecords(t = []) {
|
|
841
|
+
this.records = t;
|
|
191
842
|
}
|
|
192
|
-
setKeys(
|
|
193
|
-
this.keys =
|
|
194
|
-
this._keysMap[
|
|
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,
|
|
199
|
-
this._addString(
|
|
200
|
-
}) : this.docs.forEach((
|
|
201
|
-
this._addObject(
|
|
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(
|
|
206
|
-
const
|
|
207
|
-
|
|
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(
|
|
211
|
-
this.records.splice(
|
|
212
|
-
for (let
|
|
213
|
-
this.records[
|
|
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(
|
|
216
|
-
return
|
|
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(
|
|
222
|
-
if (
|
|
872
|
+
_addString(t, e) {
|
|
873
|
+
if (!$(t) || mt(t))
|
|
223
874
|
return;
|
|
224
|
-
let
|
|
225
|
-
v:
|
|
226
|
-
i:
|
|
227
|
-
n: this.norm.get(
|
|
875
|
+
let s = {
|
|
876
|
+
v: t,
|
|
877
|
+
i: e,
|
|
878
|
+
n: this.norm.get(t)
|
|
228
879
|
};
|
|
229
|
-
this.records.push(
|
|
230
|
-
}
|
|
231
|
-
_addObject(
|
|
232
|
-
let
|
|
233
|
-
this.keys.forEach((
|
|
234
|
-
let
|
|
235
|
-
if (
|
|
236
|
-
if (
|
|
237
|
-
let
|
|
238
|
-
const l = [{ nestedArrIndex: -1, value:
|
|
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:
|
|
241
|
-
if (
|
|
242
|
-
if (
|
|
891
|
+
const { nestedArrIndex: h, value: a } = l.pop();
|
|
892
|
+
if ($(a))
|
|
893
|
+
if (A(a) && !mt(a)) {
|
|
243
894
|
let u = {
|
|
244
|
-
v:
|
|
245
|
-
i:
|
|
246
|
-
n: this.norm.get(
|
|
895
|
+
v: a,
|
|
896
|
+
i: h,
|
|
897
|
+
n: this.norm.get(a)
|
|
247
898
|
};
|
|
248
|
-
|
|
899
|
+
c.push(u);
|
|
249
900
|
} else
|
|
250
|
-
|
|
901
|
+
S(a) && a.forEach((u, d) => {
|
|
251
902
|
l.push({
|
|
252
|
-
nestedArrIndex:
|
|
903
|
+
nestedArrIndex: d,
|
|
253
904
|
value: u
|
|
254
905
|
});
|
|
255
906
|
});
|
|
256
907
|
}
|
|
257
|
-
|
|
258
|
-
} else if (
|
|
259
|
-
let
|
|
260
|
-
v:
|
|
261
|
-
n: this.norm.get(
|
|
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
|
-
|
|
914
|
+
s.$[n] = c;
|
|
264
915
|
}
|
|
265
916
|
}
|
|
266
|
-
}), this.records.push(
|
|
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(
|
|
276
|
-
const
|
|
277
|
-
return
|
|
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
|
|
280
|
-
const { keys:
|
|
281
|
-
return
|
|
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
|
|
284
|
-
errors:
|
|
285
|
-
currentLocation:
|
|
286
|
-
expectedLocation:
|
|
287
|
-
distance:
|
|
288
|
-
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
|
|
291
|
-
if (
|
|
292
|
-
return
|
|
293
|
-
const
|
|
294
|
-
return
|
|
295
|
-
}
|
|
296
|
-
function
|
|
297
|
-
let
|
|
298
|
-
for (let
|
|
299
|
-
let
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
return
|
|
303
|
-
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
306
|
-
location:
|
|
307
|
-
distance:
|
|
308
|
-
threshold:
|
|
309
|
-
findAllMatches:
|
|
310
|
-
minMatchCharLength:
|
|
311
|
-
includeMatches: l =
|
|
312
|
-
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 (
|
|
315
|
-
throw new Error(
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
let
|
|
320
|
-
for (; (
|
|
321
|
-
let
|
|
322
|
-
currentLocation:
|
|
323
|
-
expectedLocation:
|
|
324
|
-
distance:
|
|
325
|
-
ignoreLocation:
|
|
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 (
|
|
328
|
-
let
|
|
329
|
-
for (;
|
|
330
|
-
E
|
|
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
|
-
|
|
334
|
-
let
|
|
335
|
-
const
|
|
336
|
-
for (let
|
|
337
|
-
let
|
|
338
|
-
for (;
|
|
339
|
-
|
|
340
|
-
errors:
|
|
341
|
-
currentLocation:
|
|
342
|
-
expectedLocation:
|
|
343
|
-
distance:
|
|
344
|
-
ignoreLocation:
|
|
345
|
-
}) <=
|
|
346
|
-
|
|
347
|
-
let
|
|
348
|
-
|
|
349
|
-
for (let
|
|
350
|
-
let
|
|
351
|
-
if (
|
|
352
|
-
errors:
|
|
353
|
-
currentLocation:
|
|
354
|
-
expectedLocation:
|
|
355
|
-
distance:
|
|
356
|
-
ignoreLocation:
|
|
357
|
-
}),
|
|
358
|
-
if (
|
|
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
|
-
|
|
1011
|
+
Rt = Math.max(1, 2 * d - g);
|
|
361
1012
|
}
|
|
362
1013
|
}
|
|
363
|
-
if (
|
|
364
|
-
errors:
|
|
365
|
-
currentLocation:
|
|
366
|
-
expectedLocation:
|
|
367
|
-
distance:
|
|
368
|
-
ignoreLocation:
|
|
369
|
-
}) >
|
|
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
|
-
|
|
1022
|
+
j = F;
|
|
372
1023
|
}
|
|
373
|
-
const
|
|
374
|
-
isMatch:
|
|
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,
|
|
1027
|
+
score: Math.max(1e-3, L)
|
|
377
1028
|
};
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
|
|
1029
|
+
if (_) {
|
|
1030
|
+
const v = Xe(I, c);
|
|
1031
|
+
v.length ? l && (lt.indices = v) : lt.isMatch = !1;
|
|
381
1032
|
}
|
|
382
|
-
return
|
|
1033
|
+
return lt;
|
|
383
1034
|
}
|
|
384
|
-
function
|
|
385
|
-
let
|
|
386
|
-
for (let
|
|
387
|
-
const
|
|
388
|
-
|
|
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
|
|
1041
|
+
return t;
|
|
391
1042
|
}
|
|
392
1043
|
class ne {
|
|
393
|
-
constructor(
|
|
394
|
-
location:
|
|
395
|
-
threshold:
|
|
396
|
-
distance:
|
|
397
|
-
includeMatches:
|
|
398
|
-
findAllMatches:
|
|
399
|
-
minMatchCharLength:
|
|
400
|
-
isCaseSensitive: l =
|
|
401
|
-
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:
|
|
405
|
-
threshold:
|
|
406
|
-
distance:
|
|
407
|
-
includeMatches:
|
|
408
|
-
findAllMatches:
|
|
409
|
-
minMatchCharLength:
|
|
1055
|
+
location: e,
|
|
1056
|
+
threshold: s,
|
|
1057
|
+
distance: r,
|
|
1058
|
+
includeMatches: n,
|
|
1059
|
+
findAllMatches: o,
|
|
1060
|
+
minMatchCharLength: c,
|
|
410
1061
|
isCaseSensitive: l,
|
|
411
|
-
ignoreLocation:
|
|
412
|
-
}, this.pattern = l ?
|
|
1062
|
+
ignoreLocation: h
|
|
1063
|
+
}, this.pattern = l ? t : t.toLowerCase(), this.chunks = [], !this.pattern.length)
|
|
413
1064
|
return;
|
|
414
|
-
const
|
|
1065
|
+
const a = (d, p) => {
|
|
415
1066
|
this.chunks.push({
|
|
416
|
-
pattern:
|
|
417
|
-
alphabet:
|
|
418
|
-
startIndex:
|
|
1067
|
+
pattern: d,
|
|
1068
|
+
alphabet: qe(d),
|
|
1069
|
+
startIndex: p
|
|
419
1070
|
});
|
|
420
1071
|
}, u = this.pattern.length;
|
|
421
|
-
if (u >
|
|
422
|
-
let
|
|
423
|
-
const
|
|
424
|
-
for (;
|
|
425
|
-
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
428
|
-
|
|
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
|
-
|
|
1082
|
+
a(this.pattern, 0);
|
|
432
1083
|
}
|
|
433
|
-
searchIn(
|
|
434
|
-
const { isCaseSensitive:
|
|
435
|
-
if (
|
|
436
|
-
let
|
|
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
|
|
1091
|
+
return s && (g.indices = [[0, t.length - 1]]), g;
|
|
441
1092
|
}
|
|
442
1093
|
const {
|
|
443
|
-
location:
|
|
444
|
-
distance:
|
|
445
|
-
threshold:
|
|
446
|
-
findAllMatches:
|
|
1094
|
+
location: r,
|
|
1095
|
+
distance: n,
|
|
1096
|
+
threshold: o,
|
|
1097
|
+
findAllMatches: c,
|
|
447
1098
|
minMatchCharLength: l,
|
|
448
|
-
ignoreLocation:
|
|
1099
|
+
ignoreLocation: h
|
|
449
1100
|
} = this.options;
|
|
450
|
-
let
|
|
451
|
-
this.chunks.forEach(({ pattern:
|
|
452
|
-
const { isMatch:
|
|
453
|
-
location:
|
|
454
|
-
distance:
|
|
455
|
-
threshold:
|
|
456
|
-
findAllMatches:
|
|
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:
|
|
459
|
-
ignoreLocation:
|
|
1109
|
+
includeMatches: s,
|
|
1110
|
+
ignoreLocation: h
|
|
460
1111
|
});
|
|
461
|
-
|
|
1112
|
+
E && (d = !0), u += j, E && L && (a = [...a, ...L]);
|
|
462
1113
|
});
|
|
463
|
-
let
|
|
464
|
-
isMatch:
|
|
465
|
-
score:
|
|
1114
|
+
let p = {
|
|
1115
|
+
isMatch: d,
|
|
1116
|
+
score: d ? u / this.chunks.length : 1
|
|
466
1117
|
};
|
|
467
|
-
return
|
|
1118
|
+
return d && s && (p.indices = a), p;
|
|
468
1119
|
}
|
|
469
1120
|
}
|
|
470
|
-
class
|
|
471
|
-
constructor(
|
|
472
|
-
this.pattern =
|
|
1121
|
+
class R {
|
|
1122
|
+
constructor(t) {
|
|
1123
|
+
this.pattern = t;
|
|
473
1124
|
}
|
|
474
|
-
static isMultiMatch(
|
|
475
|
-
return
|
|
1125
|
+
static isMultiMatch(t) {
|
|
1126
|
+
return Vt(t, this.multiRegex);
|
|
476
1127
|
}
|
|
477
|
-
static isSingleMatch(
|
|
478
|
-
return
|
|
1128
|
+
static isSingleMatch(t) {
|
|
1129
|
+
return Vt(t, this.singleRegex);
|
|
479
1130
|
}
|
|
480
1131
|
search() {
|
|
481
1132
|
}
|
|
482
1133
|
}
|
|
483
|
-
function
|
|
484
|
-
const
|
|
485
|
-
return
|
|
1134
|
+
function Vt(i, t) {
|
|
1135
|
+
const e = i.match(t);
|
|
1136
|
+
return e ? e[1] : null;
|
|
486
1137
|
}
|
|
487
|
-
class
|
|
488
|
-
constructor(
|
|
489
|
-
super(
|
|
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(
|
|
501
|
-
const
|
|
1151
|
+
search(t) {
|
|
1152
|
+
const e = t === this.pattern;
|
|
502
1153
|
return {
|
|
503
|
-
isMatch:
|
|
504
|
-
score:
|
|
1154
|
+
isMatch: e,
|
|
1155
|
+
score: e ? 0 : 1,
|
|
505
1156
|
indices: [0, this.pattern.length - 1]
|
|
506
1157
|
};
|
|
507
1158
|
}
|
|
508
1159
|
}
|
|
509
|
-
class
|
|
510
|
-
constructor(
|
|
511
|
-
super(
|
|
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(
|
|
523
|
-
const
|
|
1173
|
+
search(t) {
|
|
1174
|
+
const s = t.indexOf(this.pattern) === -1;
|
|
524
1175
|
return {
|
|
525
|
-
isMatch:
|
|
526
|
-
score:
|
|
527
|
-
indices: [0,
|
|
1176
|
+
isMatch: s,
|
|
1177
|
+
score: s ? 0 : 1,
|
|
1178
|
+
indices: [0, t.length - 1]
|
|
528
1179
|
};
|
|
529
1180
|
}
|
|
530
1181
|
}
|
|
531
|
-
class
|
|
532
|
-
constructor(
|
|
533
|
-
super(
|
|
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(
|
|
545
|
-
const
|
|
1195
|
+
search(t) {
|
|
1196
|
+
const e = t.startsWith(this.pattern);
|
|
546
1197
|
return {
|
|
547
|
-
isMatch:
|
|
548
|
-
score:
|
|
1198
|
+
isMatch: e,
|
|
1199
|
+
score: e ? 0 : 1,
|
|
549
1200
|
indices: [0, this.pattern.length - 1]
|
|
550
1201
|
};
|
|
551
1202
|
}
|
|
552
1203
|
}
|
|
553
|
-
class
|
|
554
|
-
constructor(
|
|
555
|
-
super(
|
|
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(
|
|
567
|
-
const
|
|
1217
|
+
search(t) {
|
|
1218
|
+
const e = !t.startsWith(this.pattern);
|
|
568
1219
|
return {
|
|
569
|
-
isMatch:
|
|
570
|
-
score:
|
|
571
|
-
indices: [0,
|
|
1220
|
+
isMatch: e,
|
|
1221
|
+
score: e ? 0 : 1,
|
|
1222
|
+
indices: [0, t.length - 1]
|
|
572
1223
|
};
|
|
573
1224
|
}
|
|
574
1225
|
}
|
|
575
|
-
class
|
|
576
|
-
constructor(
|
|
577
|
-
super(
|
|
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(
|
|
589
|
-
const
|
|
1239
|
+
search(t) {
|
|
1240
|
+
const e = t.endsWith(this.pattern);
|
|
590
1241
|
return {
|
|
591
|
-
isMatch:
|
|
592
|
-
score:
|
|
593
|
-
indices: [
|
|
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
|
|
598
|
-
constructor(
|
|
599
|
-
super(
|
|
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(
|
|
611
|
-
const
|
|
1261
|
+
search(t) {
|
|
1262
|
+
const e = !t.endsWith(this.pattern);
|
|
612
1263
|
return {
|
|
613
|
-
isMatch:
|
|
614
|
-
score:
|
|
615
|
-
indices: [0,
|
|
1264
|
+
isMatch: e,
|
|
1265
|
+
score: e ? 0 : 1,
|
|
1266
|
+
indices: [0, t.length - 1]
|
|
616
1267
|
};
|
|
617
1268
|
}
|
|
618
1269
|
}
|
|
619
|
-
class
|
|
620
|
-
constructor(
|
|
621
|
-
location:
|
|
622
|
-
threshold:
|
|
623
|
-
distance:
|
|
624
|
-
includeMatches:
|
|
625
|
-
findAllMatches:
|
|
626
|
-
minMatchCharLength:
|
|
627
|
-
isCaseSensitive: l =
|
|
628
|
-
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(
|
|
631
|
-
location:
|
|
632
|
-
threshold:
|
|
633
|
-
distance:
|
|
634
|
-
includeMatches:
|
|
635
|
-
findAllMatches:
|
|
636
|
-
minMatchCharLength:
|
|
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:
|
|
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(
|
|
651
|
-
return this._bitapSearch.searchIn(
|
|
1301
|
+
search(t) {
|
|
1302
|
+
return this._bitapSearch.searchIn(t);
|
|
652
1303
|
}
|
|
653
1304
|
}
|
|
654
|
-
class
|
|
655
|
-
constructor(
|
|
656
|
-
super(
|
|
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(
|
|
668
|
-
let
|
|
669
|
-
const
|
|
670
|
-
for (; (
|
|
671
|
-
|
|
672
|
-
const
|
|
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:
|
|
675
|
-
score:
|
|
676
|
-
indices:
|
|
1325
|
+
isMatch: o,
|
|
1326
|
+
score: o ? 0 : 1,
|
|
1327
|
+
indices: r
|
|
677
1328
|
};
|
|
678
1329
|
}
|
|
679
1330
|
}
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
],
|
|
690
|
-
function
|
|
691
|
-
return
|
|
692
|
-
let
|
|
693
|
-
for (let
|
|
694
|
-
const
|
|
695
|
-
let l = !1,
|
|
696
|
-
for (; !l && ++
|
|
697
|
-
const
|
|
698
|
-
let u =
|
|
699
|
-
u && (
|
|
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 (
|
|
703
|
-
const
|
|
704
|
-
let u =
|
|
1353
|
+
for (h = -1; ++h < Yt; ) {
|
|
1354
|
+
const a = At[h];
|
|
1355
|
+
let u = a.isSingleMatch(c);
|
|
705
1356
|
if (u) {
|
|
706
|
-
|
|
1357
|
+
r.push(new a(u, t));
|
|
707
1358
|
break;
|
|
708
1359
|
}
|
|
709
1360
|
}
|
|
710
1361
|
}
|
|
711
|
-
return
|
|
1362
|
+
return r;
|
|
712
1363
|
});
|
|
713
1364
|
}
|
|
714
|
-
const
|
|
715
|
-
class
|
|
716
|
-
constructor(
|
|
717
|
-
isCaseSensitive:
|
|
718
|
-
includeMatches:
|
|
719
|
-
minMatchCharLength:
|
|
720
|
-
ignoreLocation:
|
|
721
|
-
findAllMatches:
|
|
722
|
-
location:
|
|
723
|
-
threshold: l =
|
|
724
|
-
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:
|
|
728
|
-
includeMatches:
|
|
729
|
-
minMatchCharLength:
|
|
730
|
-
findAllMatches:
|
|
731
|
-
ignoreLocation:
|
|
732
|
-
location:
|
|
1378
|
+
isCaseSensitive: e,
|
|
1379
|
+
includeMatches: s,
|
|
1380
|
+
minMatchCharLength: r,
|
|
1381
|
+
findAllMatches: o,
|
|
1382
|
+
ignoreLocation: n,
|
|
1383
|
+
location: c,
|
|
733
1384
|
threshold: l,
|
|
734
|
-
distance:
|
|
735
|
-
}, this.pattern =
|
|
1385
|
+
distance: h
|
|
1386
|
+
}, this.pattern = e ? t : t.toLowerCase(), this.query = cs(this.pattern, this.options);
|
|
736
1387
|
}
|
|
737
|
-
static condition(
|
|
738
|
-
return
|
|
1388
|
+
static condition(t, e) {
|
|
1389
|
+
return e.useExtendedSearch;
|
|
739
1390
|
}
|
|
740
|
-
searchIn(
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
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:
|
|
748
|
-
|
|
749
|
-
let
|
|
750
|
-
for (let l = 0,
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
for (let u = 0,
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
758
|
-
|
|
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
|
-
|
|
1412
|
+
c = 0, n = 0, o.length = 0;
|
|
762
1413
|
break;
|
|
763
1414
|
}
|
|
764
1415
|
}
|
|
765
|
-
if (
|
|
1416
|
+
if (n) {
|
|
766
1417
|
let u = {
|
|
767
1418
|
isMatch: !0,
|
|
768
|
-
score:
|
|
1419
|
+
score: c / n
|
|
769
1420
|
};
|
|
770
|
-
return
|
|
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
|
|
780
|
-
function
|
|
781
|
-
|
|
1430
|
+
const Et = [];
|
|
1431
|
+
function us(...i) {
|
|
1432
|
+
Et.push(...i);
|
|
782
1433
|
}
|
|
783
|
-
function
|
|
784
|
-
for (let
|
|
785
|
-
let
|
|
786
|
-
if (
|
|
787
|
-
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);
|
|
788
1439
|
}
|
|
789
|
-
return new ne(
|
|
1440
|
+
return new ne(i, t);
|
|
790
1441
|
}
|
|
791
|
-
const
|
|
1442
|
+
const rt = {
|
|
792
1443
|
AND: "$and",
|
|
793
1444
|
OR: "$or"
|
|
794
|
-
},
|
|
1445
|
+
}, St = {
|
|
795
1446
|
PATH: "$path",
|
|
796
1447
|
PATTERN: "$val"
|
|
797
|
-
},
|
|
798
|
-
[
|
|
799
|
-
[
|
|
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
|
|
803
|
-
const
|
|
804
|
-
let
|
|
805
|
-
const
|
|
806
|
-
if (!
|
|
807
|
-
return
|
|
808
|
-
if (
|
|
809
|
-
const l =
|
|
810
|
-
if (!
|
|
811
|
-
throw new Error(
|
|
812
|
-
const
|
|
813
|
-
keyId:
|
|
814
|
-
pattern:
|
|
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
|
|
1467
|
+
return e && (a.searcher = xt(h, t)), a;
|
|
817
1468
|
}
|
|
818
|
-
let
|
|
1469
|
+
let c = {
|
|
819
1470
|
children: [],
|
|
820
|
-
operator:
|
|
1471
|
+
operator: n[0]
|
|
821
1472
|
};
|
|
822
|
-
return
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
|
|
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
|
-
}),
|
|
1478
|
+
}), c;
|
|
828
1479
|
};
|
|
829
|
-
return
|
|
830
|
-
}
|
|
831
|
-
function
|
|
832
|
-
|
|
833
|
-
let
|
|
834
|
-
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
(
|
|
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
|
-
}),
|
|
1491
|
+
}), e.score = s;
|
|
841
1492
|
});
|
|
842
1493
|
}
|
|
843
|
-
function
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
if (
|
|
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:
|
|
849
|
-
let
|
|
850
|
-
indices:
|
|
851
|
-
value:
|
|
1499
|
+
const { indices: r, value: n } = s;
|
|
1500
|
+
let o = {
|
|
1501
|
+
indices: r,
|
|
1502
|
+
value: n
|
|
852
1503
|
};
|
|
853
|
-
|
|
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
|
|
857
|
-
|
|
1507
|
+
function ms(i, t) {
|
|
1508
|
+
t.score = i.score;
|
|
858
1509
|
}
|
|
859
|
-
function
|
|
860
|
-
includeMatches:
|
|
861
|
-
includeScore:
|
|
1510
|
+
function _s(i, t, {
|
|
1511
|
+
includeMatches: e = f.includeMatches,
|
|
1512
|
+
includeScore: s = f.includeScore
|
|
862
1513
|
} = {}) {
|
|
863
|
-
const
|
|
864
|
-
return
|
|
865
|
-
const { idx:
|
|
866
|
-
item:
|
|
867
|
-
refIndex:
|
|
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
|
|
870
|
-
l(
|
|
871
|
-
}),
|
|
1520
|
+
return r.length && r.forEach((l) => {
|
|
1521
|
+
l(n, c);
|
|
1522
|
+
}), c;
|
|
872
1523
|
});
|
|
873
1524
|
}
|
|
874
|
-
class
|
|
875
|
-
constructor(
|
|
876
|
-
this.options = { ...
|
|
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(
|
|
879
|
-
if (this._docs =
|
|
880
|
-
throw new Error(
|
|
881
|
-
this._myIndex =
|
|
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(
|
|
887
|
-
|
|
1537
|
+
add(t) {
|
|
1538
|
+
$(t) && (this._docs.push(t), this._myIndex.add(t));
|
|
888
1539
|
}
|
|
889
|
-
remove(
|
|
890
|
-
const
|
|
891
|
-
for (let
|
|
892
|
-
const
|
|
893
|
-
|
|
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
|
|
1546
|
+
return e;
|
|
896
1547
|
}
|
|
897
|
-
removeAt(
|
|
898
|
-
this._docs.splice(
|
|
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(
|
|
1554
|
+
search(t, { limit: e = -1 } = {}) {
|
|
904
1555
|
const {
|
|
905
|
-
includeMatches:
|
|
906
|
-
includeScore:
|
|
907
|
-
shouldSort:
|
|
908
|
-
sortFn:
|
|
909
|
-
ignoreFieldNorm:
|
|
1556
|
+
includeMatches: s,
|
|
1557
|
+
includeScore: r,
|
|
1558
|
+
shouldSort: n,
|
|
1559
|
+
sortFn: o,
|
|
1560
|
+
ignoreFieldNorm: c
|
|
910
1561
|
} = this.options;
|
|
911
|
-
let l =
|
|
912
|
-
return
|
|
913
|
-
includeMatches:
|
|
914
|
-
includeScore:
|
|
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(
|
|
918
|
-
const
|
|
919
|
-
return
|
|
920
|
-
if (
|
|
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:
|
|
923
|
-
l &&
|
|
924
|
-
item:
|
|
925
|
-
idx:
|
|
926
|
-
matches: [{ score:
|
|
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
|
-
}),
|
|
1579
|
+
}), r;
|
|
929
1580
|
}
|
|
930
|
-
_searchLogical(
|
|
931
|
-
const
|
|
932
|
-
if (!
|
|
933
|
-
const { keyId: u, searcher:
|
|
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:
|
|
1587
|
+
searcher: d
|
|
937
1588
|
});
|
|
938
|
-
return
|
|
1589
|
+
return p && p.length ? [
|
|
939
1590
|
{
|
|
940
|
-
idx:
|
|
1591
|
+
idx: h,
|
|
941
1592
|
item: l,
|
|
942
|
-
matches:
|
|
1593
|
+
matches: p
|
|
943
1594
|
}
|
|
944
1595
|
] : [];
|
|
945
1596
|
}
|
|
946
|
-
const
|
|
947
|
-
for (let u = 0,
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
|
|
951
|
-
else if (
|
|
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
|
|
955
|
-
},
|
|
956
|
-
return
|
|
957
|
-
if (
|
|
958
|
-
let
|
|
959
|
-
|
|
960
|
-
|
|
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
|
-
}),
|
|
1614
|
+
}), o;
|
|
964
1615
|
}
|
|
965
|
-
_searchObjectList(
|
|
966
|
-
const
|
|
967
|
-
return
|
|
968
|
-
if (
|
|
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
|
-
|
|
1622
|
+
s.forEach((h, a) => {
|
|
972
1623
|
l.push(
|
|
973
1624
|
...this._findMatches({
|
|
974
|
-
key:
|
|
975
|
-
value:
|
|
976
|
-
searcher:
|
|
1625
|
+
key: h,
|
|
1626
|
+
value: o[a],
|
|
1627
|
+
searcher: e
|
|
977
1628
|
})
|
|
978
1629
|
);
|
|
979
|
-
}), l.length &&
|
|
980
|
-
idx:
|
|
981
|
-
item:
|
|
1630
|
+
}), l.length && n.push({
|
|
1631
|
+
idx: c,
|
|
1632
|
+
item: o,
|
|
982
1633
|
matches: l
|
|
983
1634
|
});
|
|
984
|
-
}),
|
|
1635
|
+
}), n;
|
|
985
1636
|
}
|
|
986
|
-
_findMatches({ key:
|
|
987
|
-
if (
|
|
1637
|
+
_findMatches({ key: t, value: e, searcher: s }) {
|
|
1638
|
+
if (!$(e))
|
|
988
1639
|
return [];
|
|
989
|
-
let
|
|
990
|
-
if (
|
|
991
|
-
|
|
992
|
-
if (
|
|
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:
|
|
995
|
-
l &&
|
|
996
|
-
score:
|
|
997
|
-
key:
|
|
998
|
-
value:
|
|
999
|
-
idx:
|
|
1000
|
-
norm:
|
|
1001
|
-
indices:
|
|
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:
|
|
1006
|
-
|
|
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
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
|
|
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
|
-
*,
|
|
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
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
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
|
|
1818
|
+
let C = class extends Y {
|
|
1218
1819
|
constructor() {
|
|
1219
|
-
super();
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
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((
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
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
|
-
|
|
1883
|
+
// @ts-ignore
|
|
1884
|
+
...this.config.fuseConfig.keys.map((c) => ({
|
|
1885
|
+
[c]: t
|
|
1886
|
+
})),
|
|
1350
1887
|
{
|
|
1351
|
-
$or:
|
|
1888
|
+
$or: s
|
|
1352
1889
|
}
|
|
1353
1890
|
]
|
|
1354
1891
|
} : {
|
|
1355
1892
|
$or: [
|
|
1356
|
-
|
|
1893
|
+
// @ts-ignore
|
|
1894
|
+
...this.config.fuseConfig.keys.map((c) => ({
|
|
1895
|
+
[c]: t
|
|
1896
|
+
})),
|
|
1357
1897
|
{
|
|
1358
|
-
$or:
|
|
1898
|
+
$or: s
|
|
1359
1899
|
}
|
|
1360
1900
|
]
|
|
1361
1901
|
}
|
|
1362
|
-
}
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2113
|
+
C as EOxItemFilter
|
|
1377
2114
|
};
|