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