@expofp/floorplan 3.1.5 → 3.1.7
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/browser/{CookieConsent-CGFAI892.js → CookieConsent-DfE_fkts.js} +34 -32
- package/dist/browser/{Debug-BAAWHY1b.js → Debug-BjYRfFht.js} +6 -6
- package/dist/browser/{Demo-Cm_by3lL.js → Demo-Dbi2jpnc.js} +8 -8
- package/dist/browser/{Free-CUPxUHvY.js → Free-BSnZx5sK.js} +8 -8
- package/dist/browser/{Gallery-DtNCOKUl.js → Gallery-CXDwIc_X.js} +8 -8
- package/dist/browser/{GpsLoader-DKUaUUoH.js → GpsLoader-BxC0jQJL.js} +8 -8
- package/dist/browser/{KioskStore-BAmI2FTC.js → KioskStore-Bx9njFnf.js} +3 -3
- package/dist/browser/{Mapbox-DjOk35zh.js → Mapbox-BL4uCq3u.js} +8 -8
- package/dist/browser/{SetKioskMode-BMpt2zSm.js → SetKioskMode-CmUEpNr8.js} +7 -7
- package/dist/browser/{ShowKiosk-liYrlKC7.js → ShowKiosk-Dqk68IPs.js} +9 -9
- package/dist/browser/{ThreeComponent-Bw9_agz4.js → ThreeComponent-Bs4fIgXe.js} +9 -9
- package/dist/browser/{TouchHand-CyxZwo32.js → TouchHand-F4RwHukr.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-DMfQx5Ja.js → ViewerMenuPanel-Da8d4AKA.js} +7 -7
- package/dist/browser/{add-debug-secret-listener-mC8ioAqk.js → add-debug-secret-listener-CzY7rBoG.js} +1 -1
- package/dist/browser/{boolean-editor-CRYNpeqJ.js → boolean-editor-EtntC8E2.js} +6 -6
- package/dist/browser/{bootIntercom-_3LLB12h.js → bootIntercom-DgAJUEEd.js} +1 -1
- package/dist/browser/bundle.json +44 -44
- package/dist/browser/{chunk-CVMCP8yt.js → chunk-RBEdwIRm.js} +1 -1
- package/dist/browser/{classnames-BUX2Oklh.js → classnames-qZ9_2hbn.js} +2 -2
- package/dist/browser/{client-xgqRsUiA.js → client-C19UpouP.js} +4 -4
- package/dist/browser/{data-CydRbpN8.js → data-oHqnWMYj.js} +3 -3
- package/dist/browser/{debug-overlay-Bn2KbCKg.js → debug-overlay-BMB9VRVy.js} +8 -8
- package/dist/browser/{debug-ui-BFXB-AHK.js → debug-ui-CeUHj66R.js} +6 -6
- package/dist/browser/{dist-ClOaKySy.js → dist-DV-fRVqs.js} +5 -5
- package/dist/browser/{exports-C46oFGwo.js → exports-BLsk2ygZ.js} +1 -1
- package/dist/browser/{favicon-BVZCGJ03.js → favicon-DHl8ze48.js} +1 -1
- package/dist/browser/{fetch-retry.umd-GNk8060O.js → fetch-retry.umd-BeZhMPIj.js} +2 -2
- package/dist/browser/{flex-Dxc6hY3Z.js → flex-BiRWYXbM.js} +6 -6
- package/dist/browser/{floorplan.loader-BC-tDHoL.js → floorplan.loader-ic4sBsDi.js} +9 -9
- package/dist/browser/{floorplan.ready-CStDgQOC.js → floorplan.ready-DucQMO3I.js} +10 -10
- package/dist/browser/fuse-nzPqJLRF.js +1177 -0
- package/dist/browser/index.js +11 -11
- package/dist/browser/{is-debug-YMktIloe.js → is-debug-BTIP9fyG.js} +2 -2
- package/dist/browser/{jsx-runtime-C5d_Cwou.js → jsx-runtime-C40T-D9O.js} +2 -2
- package/dist/browser/{lib-zd-dWEXB.js → lib-CviNrhqa.js} +4 -4
- package/dist/browser/{main-iX2tegqy.js → main-B_zTGBSI.js} +1 -1
- package/dist/browser/{mobx-BMMCrtUu.js → mobx-B035tRw8.js} +4 -4
- package/dist/browser/{particles.min-DaqLS_tp.js → particles.min-DSPwSJ2J.js} +2 -2
- package/dist/browser/{prop-types-BGx1FmF8.js → prop-types-BW7NYwOo.js} +2 -2
- package/dist/browser/{react-VwIX1aro.js → react-BrB6NhR9.js} +2 -2
- package/dist/browser/{react-dom-CMGEX3eG.js → react-dom-D67jzu6q.js} +3 -3
- package/dist/browser/{reset-all-settings-CK1tFj38.js → reset-all-settings-B4otpIDL.js} +1 -1
- package/dist/browser/{settings-CRLQ_hS2.js → settings-CB1rylda.js} +6 -6
- package/dist/browser/{src-B0HnxTLj.js → src-DdXQDzCb.js} +4 -4
- package/dist/browser/{store-BKvT1wpF.js → store-BnxcP6Pt.js} +7 -7
- package/dist/browser/{ui-DU6ggbCR.js → ui-24Jpsemb.js} +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/package.json +4 -4
- package/dist/browser/fuse-SiDaNxKZ.js +0 -887
|
@@ -1,887 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
try {
|
|
3
|
-
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.1.5" };
|
|
5
|
-
var t = new e.Error().stack;
|
|
6
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "27406276-98c6-4cd0-9788-0e6c83f10be0", e._sentryDebugIdIdentifier = "sentry-dbid-27406276-98c6-4cd0-9788-0e6c83f10be0");
|
|
7
|
-
} catch {}
|
|
8
|
-
})();
|
|
9
|
-
import { n as e } from "./chunk-CVMCP8yt.js";
|
|
10
|
-
//#region ../../node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.mjs
|
|
11
|
-
var t = /* @__PURE__ */ e({ default: () => $ });
|
|
12
|
-
function n(e) {
|
|
13
|
-
return Array.isArray ? Array.isArray(e) : p(e) === "[object Array]";
|
|
14
|
-
}
|
|
15
|
-
var r = Infinity;
|
|
16
|
-
function i(e) {
|
|
17
|
-
if (typeof e == "string") return e;
|
|
18
|
-
let t = e + "";
|
|
19
|
-
return t == "0" && 1 / e == -r ? "-0" : t;
|
|
20
|
-
}
|
|
21
|
-
function a(e) {
|
|
22
|
-
return e == null ? "" : i(e);
|
|
23
|
-
}
|
|
24
|
-
function o(e) {
|
|
25
|
-
return typeof e == "string";
|
|
26
|
-
}
|
|
27
|
-
function s(e) {
|
|
28
|
-
return typeof e == "number";
|
|
29
|
-
}
|
|
30
|
-
function c(e) {
|
|
31
|
-
return e === !0 || e === !1 || u(e) && p(e) == "[object Boolean]";
|
|
32
|
-
}
|
|
33
|
-
function l(e) {
|
|
34
|
-
return typeof e == "object";
|
|
35
|
-
}
|
|
36
|
-
function u(e) {
|
|
37
|
-
return l(e) && e !== null;
|
|
38
|
-
}
|
|
39
|
-
function d(e) {
|
|
40
|
-
return e != null;
|
|
41
|
-
}
|
|
42
|
-
function f(e) {
|
|
43
|
-
return !e.trim().length;
|
|
44
|
-
}
|
|
45
|
-
function p(e) {
|
|
46
|
-
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
47
|
-
}
|
|
48
|
-
var m = "Incorrect 'index' type", h = (e) => `Invalid value for key ${e}`, g = (e) => `Pattern length exceeds max of ${e}.`, _ = (e) => `Missing ${e} property in key`, v = (e) => `Property 'weight' in key '${e}' must be a positive integer`, y = Object.prototype.hasOwnProperty, b = class {
|
|
49
|
-
constructor(e) {
|
|
50
|
-
this._keys = [], this._keyMap = {};
|
|
51
|
-
let t = 0;
|
|
52
|
-
e.forEach((e) => {
|
|
53
|
-
let n = x(e);
|
|
54
|
-
this._keys.push(n), this._keyMap[n.id] = n, t += n.weight;
|
|
55
|
-
}), this._keys.forEach((e) => {
|
|
56
|
-
e.weight /= t;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
get(e) {
|
|
60
|
-
return this._keyMap[e];
|
|
61
|
-
}
|
|
62
|
-
keys() {
|
|
63
|
-
return this._keys;
|
|
64
|
-
}
|
|
65
|
-
toJSON() {
|
|
66
|
-
return JSON.stringify(this._keys);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
function x(e) {
|
|
70
|
-
let t = null, r = null, i = null, a = 1, s = null;
|
|
71
|
-
if (o(e) || n(e)) i = e, t = S(e), r = C(e);
|
|
72
|
-
else {
|
|
73
|
-
if (!y.call(e, "name")) throw Error(_("name"));
|
|
74
|
-
let n = e.name;
|
|
75
|
-
if (i = n, y.call(e, "weight") && (a = e.weight, a <= 0)) throw Error(v(n));
|
|
76
|
-
t = S(n), r = C(n), s = e.getFn;
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
path: t,
|
|
80
|
-
id: r,
|
|
81
|
-
weight: a,
|
|
82
|
-
src: i,
|
|
83
|
-
getFn: s
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function S(e) {
|
|
87
|
-
return n(e) ? e : e.split(".");
|
|
88
|
-
}
|
|
89
|
-
function C(e) {
|
|
90
|
-
return n(e) ? e.join(".") : e;
|
|
91
|
-
}
|
|
92
|
-
function w(e, t) {
|
|
93
|
-
let r = [], i = !1, l = (e, t, u) => {
|
|
94
|
-
if (d(e)) if (!t[u]) r.push(e);
|
|
95
|
-
else {
|
|
96
|
-
let f = e[t[u]];
|
|
97
|
-
if (!d(f)) return;
|
|
98
|
-
if (u === t.length - 1 && (o(f) || s(f) || c(f))) r.push(a(f));
|
|
99
|
-
else if (n(f)) {
|
|
100
|
-
i = !0;
|
|
101
|
-
for (let e = 0, n = f.length; e < n; e += 1) l(f[e], t, u + 1);
|
|
102
|
-
} else t.length && l(f, t, u + 1);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return l(e, o(t) ? t.split(".") : t, 0), i ? r : r[0];
|
|
106
|
-
}
|
|
107
|
-
var ee = {
|
|
108
|
-
includeMatches: !1,
|
|
109
|
-
findAllMatches: !1,
|
|
110
|
-
minMatchCharLength: 1
|
|
111
|
-
}, te = {
|
|
112
|
-
isCaseSensitive: !1,
|
|
113
|
-
ignoreDiacritics: !1,
|
|
114
|
-
includeScore: !1,
|
|
115
|
-
keys: [],
|
|
116
|
-
shouldSort: !0,
|
|
117
|
-
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1
|
|
118
|
-
}, ne = {
|
|
119
|
-
location: 0,
|
|
120
|
-
threshold: .6,
|
|
121
|
-
distance: 100
|
|
122
|
-
}, T = {
|
|
123
|
-
useExtendedSearch: !1,
|
|
124
|
-
getFn: w,
|
|
125
|
-
ignoreLocation: !1,
|
|
126
|
-
ignoreFieldNorm: !1,
|
|
127
|
-
fieldNormWeight: 1
|
|
128
|
-
}, E = {
|
|
129
|
-
...te,
|
|
130
|
-
...ee,
|
|
131
|
-
...ne,
|
|
132
|
-
...T
|
|
133
|
-
}, D = /[^ ]+/g;
|
|
134
|
-
function re(e = 1, t = 3) {
|
|
135
|
-
let n = /* @__PURE__ */ new Map(), r = 10 ** t;
|
|
136
|
-
return {
|
|
137
|
-
get(t) {
|
|
138
|
-
let i = t.match(D).length;
|
|
139
|
-
if (n.has(i)) return n.get(i);
|
|
140
|
-
let a = 1 / i ** (.5 * e), o = parseFloat(Math.round(a * r) / r);
|
|
141
|
-
return n.set(i, o), o;
|
|
142
|
-
},
|
|
143
|
-
clear() {
|
|
144
|
-
n.clear();
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
var O = class {
|
|
149
|
-
constructor({ getFn: e = E.getFn, fieldNormWeight: t = E.fieldNormWeight } = {}) {
|
|
150
|
-
this.norm = re(t, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
|
|
151
|
-
}
|
|
152
|
-
setSources(e = []) {
|
|
153
|
-
this.docs = e;
|
|
154
|
-
}
|
|
155
|
-
setIndexRecords(e = []) {
|
|
156
|
-
this.records = e;
|
|
157
|
-
}
|
|
158
|
-
setKeys(e = []) {
|
|
159
|
-
this.keys = e, this._keysMap = {}, e.forEach((e, t) => {
|
|
160
|
-
this._keysMap[e.id] = t;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
create() {
|
|
164
|
-
this.isCreated || !this.docs.length || (this.isCreated = !0, o(this.docs[0]) ? this.docs.forEach((e, t) => {
|
|
165
|
-
this._addString(e, t);
|
|
166
|
-
}) : this.docs.forEach((e, t) => {
|
|
167
|
-
this._addObject(e, t);
|
|
168
|
-
}), this.norm.clear());
|
|
169
|
-
}
|
|
170
|
-
add(e) {
|
|
171
|
-
let t = this.size();
|
|
172
|
-
o(e) ? this._addString(e, t) : this._addObject(e, t);
|
|
173
|
-
}
|
|
174
|
-
removeAt(e) {
|
|
175
|
-
this.records.splice(e, 1);
|
|
176
|
-
for (let t = e, n = this.size(); t < n; t += 1) --this.records[t].i;
|
|
177
|
-
}
|
|
178
|
-
getValueForItemAtKeyId(e, t) {
|
|
179
|
-
return e[this._keysMap[t]];
|
|
180
|
-
}
|
|
181
|
-
size() {
|
|
182
|
-
return this.records.length;
|
|
183
|
-
}
|
|
184
|
-
_addString(e, t) {
|
|
185
|
-
if (!d(e) || f(e)) return;
|
|
186
|
-
let n = {
|
|
187
|
-
v: e,
|
|
188
|
-
i: t,
|
|
189
|
-
n: this.norm.get(e)
|
|
190
|
-
};
|
|
191
|
-
this.records.push(n);
|
|
192
|
-
}
|
|
193
|
-
_addObject(e, t) {
|
|
194
|
-
let r = {
|
|
195
|
-
i: t,
|
|
196
|
-
$: {}
|
|
197
|
-
};
|
|
198
|
-
this.keys.forEach((t, i) => {
|
|
199
|
-
let a = t.getFn ? t.getFn(e) : this.getFn(e, t.path);
|
|
200
|
-
if (d(a)) {
|
|
201
|
-
if (n(a)) {
|
|
202
|
-
let e = [], t = [{
|
|
203
|
-
nestedArrIndex: -1,
|
|
204
|
-
value: a
|
|
205
|
-
}];
|
|
206
|
-
for (; t.length;) {
|
|
207
|
-
let { nestedArrIndex: r, value: i } = t.pop();
|
|
208
|
-
if (d(i)) if (o(i) && !f(i)) {
|
|
209
|
-
let t = {
|
|
210
|
-
v: i,
|
|
211
|
-
i: r,
|
|
212
|
-
n: this.norm.get(i)
|
|
213
|
-
};
|
|
214
|
-
e.push(t);
|
|
215
|
-
} else n(i) && i.forEach((e, n) => {
|
|
216
|
-
t.push({
|
|
217
|
-
nestedArrIndex: n,
|
|
218
|
-
value: e
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
r.$[i] = e;
|
|
223
|
-
} else if (o(a) && !f(a)) {
|
|
224
|
-
let e = {
|
|
225
|
-
v: a,
|
|
226
|
-
n: this.norm.get(a)
|
|
227
|
-
};
|
|
228
|
-
r.$[i] = e;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}), this.records.push(r);
|
|
232
|
-
}
|
|
233
|
-
toJSON() {
|
|
234
|
-
return {
|
|
235
|
-
keys: this.keys,
|
|
236
|
-
records: this.records
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
function k(e, t, { getFn: n = E.getFn, fieldNormWeight: r = E.fieldNormWeight } = {}) {
|
|
241
|
-
let i = new O({
|
|
242
|
-
getFn: n,
|
|
243
|
-
fieldNormWeight: r
|
|
244
|
-
});
|
|
245
|
-
return i.setKeys(e.map(x)), i.setSources(t), i.create(), i;
|
|
246
|
-
}
|
|
247
|
-
function ie(e, { getFn: t = E.getFn, fieldNormWeight: n = E.fieldNormWeight } = {}) {
|
|
248
|
-
let { keys: r, records: i } = e, a = new O({
|
|
249
|
-
getFn: t,
|
|
250
|
-
fieldNormWeight: n
|
|
251
|
-
});
|
|
252
|
-
return a.setKeys(r), a.setIndexRecords(i), a;
|
|
253
|
-
}
|
|
254
|
-
function A(e, { errors: t = 0, currentLocation: n = 0, expectedLocation: r = 0, distance: i = E.distance, ignoreLocation: a = E.ignoreLocation } = {}) {
|
|
255
|
-
let o = t / e.length;
|
|
256
|
-
if (a) return o;
|
|
257
|
-
let s = Math.abs(r - n);
|
|
258
|
-
return i ? o + s / i : s ? 1 : o;
|
|
259
|
-
}
|
|
260
|
-
function ae(e = [], t = E.minMatchCharLength) {
|
|
261
|
-
let n = [], r = -1, i = -1, a = 0;
|
|
262
|
-
for (let o = e.length; a < o; a += 1) {
|
|
263
|
-
let o = e[a];
|
|
264
|
-
o && r === -1 ? r = a : !o && r !== -1 && (i = a - 1, i - r + 1 >= t && n.push([r, i]), r = -1);
|
|
265
|
-
}
|
|
266
|
-
return e[a - 1] && a - r >= t && n.push([r, a - 1]), n;
|
|
267
|
-
}
|
|
268
|
-
var j = 32;
|
|
269
|
-
function oe(e, t, n, { location: r = E.location, distance: i = E.distance, threshold: a = E.threshold, findAllMatches: o = E.findAllMatches, minMatchCharLength: s = E.minMatchCharLength, includeMatches: c = E.includeMatches, ignoreLocation: l = E.ignoreLocation } = {}) {
|
|
270
|
-
if (t.length > j) throw Error(g(j));
|
|
271
|
-
let u = t.length, d = e.length, f = Math.max(0, Math.min(r, d)), p = a, m = f, h = s > 1 || c, _ = h ? Array(d) : [], v;
|
|
272
|
-
for (; (v = e.indexOf(t, m)) > -1;) {
|
|
273
|
-
let e = A(t, {
|
|
274
|
-
currentLocation: v,
|
|
275
|
-
expectedLocation: f,
|
|
276
|
-
distance: i,
|
|
277
|
-
ignoreLocation: l
|
|
278
|
-
});
|
|
279
|
-
if (p = Math.min(e, p), m = v + u, h) {
|
|
280
|
-
let e = 0;
|
|
281
|
-
for (; e < u;) _[v + e] = 1, e += 1;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
m = -1;
|
|
285
|
-
let y = [], b = 1, x = u + d, S = 1 << u - 1;
|
|
286
|
-
for (let r = 0; r < u; r += 1) {
|
|
287
|
-
let a = 0, s = x;
|
|
288
|
-
for (; a < s;) A(t, {
|
|
289
|
-
errors: r,
|
|
290
|
-
currentLocation: f + s,
|
|
291
|
-
expectedLocation: f,
|
|
292
|
-
distance: i,
|
|
293
|
-
ignoreLocation: l
|
|
294
|
-
}) <= p ? a = s : x = s, s = Math.floor((x - a) / 2 + a);
|
|
295
|
-
x = s;
|
|
296
|
-
let c = Math.max(1, f - s + 1), g = o ? d : Math.min(f + s, d) + u, v = Array(g + 2);
|
|
297
|
-
v[g + 1] = (1 << r) - 1;
|
|
298
|
-
for (let a = g; a >= c; --a) {
|
|
299
|
-
let o = a - 1, s = n[e.charAt(o)];
|
|
300
|
-
if (h && (_[o] = +!!s), v[a] = (v[a + 1] << 1 | 1) & s, r && (v[a] |= (y[a + 1] | y[a]) << 1 | 1 | y[a + 1]), v[a] & S && (b = A(t, {
|
|
301
|
-
errors: r,
|
|
302
|
-
currentLocation: o,
|
|
303
|
-
expectedLocation: f,
|
|
304
|
-
distance: i,
|
|
305
|
-
ignoreLocation: l
|
|
306
|
-
}), b <= p)) {
|
|
307
|
-
if (p = b, m = o, m <= f) break;
|
|
308
|
-
c = Math.max(1, 2 * f - m);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
if (A(t, {
|
|
312
|
-
errors: r + 1,
|
|
313
|
-
currentLocation: f,
|
|
314
|
-
expectedLocation: f,
|
|
315
|
-
distance: i,
|
|
316
|
-
ignoreLocation: l
|
|
317
|
-
}) > p) break;
|
|
318
|
-
y = v;
|
|
319
|
-
}
|
|
320
|
-
let C = {
|
|
321
|
-
isMatch: m >= 0,
|
|
322
|
-
score: Math.max(.001, b)
|
|
323
|
-
};
|
|
324
|
-
if (h) {
|
|
325
|
-
let e = ae(_, s);
|
|
326
|
-
e.length ? c && (C.indices = e) : C.isMatch = !1;
|
|
327
|
-
}
|
|
328
|
-
return C;
|
|
329
|
-
}
|
|
330
|
-
function M(e) {
|
|
331
|
-
let t = {};
|
|
332
|
-
for (let n = 0, r = e.length; n < r; n += 1) {
|
|
333
|
-
let i = e.charAt(n);
|
|
334
|
-
t[i] = (t[i] || 0) | 1 << r - n - 1;
|
|
335
|
-
}
|
|
336
|
-
return t;
|
|
337
|
-
}
|
|
338
|
-
var N = String.prototype.normalize ? ((e) => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((e) => e), P = class {
|
|
339
|
-
constructor(e, { location: t = E.location, threshold: n = E.threshold, distance: r = E.distance, includeMatches: i = E.includeMatches, findAllMatches: a = E.findAllMatches, minMatchCharLength: o = E.minMatchCharLength, isCaseSensitive: s = E.isCaseSensitive, ignoreDiacritics: c = E.ignoreDiacritics, ignoreLocation: l = E.ignoreLocation } = {}) {
|
|
340
|
-
if (this.options = {
|
|
341
|
-
location: t,
|
|
342
|
-
threshold: n,
|
|
343
|
-
distance: r,
|
|
344
|
-
includeMatches: i,
|
|
345
|
-
findAllMatches: a,
|
|
346
|
-
minMatchCharLength: o,
|
|
347
|
-
isCaseSensitive: s,
|
|
348
|
-
ignoreDiacritics: c,
|
|
349
|
-
ignoreLocation: l
|
|
350
|
-
}, e = s ? e : e.toLowerCase(), e = c ? N(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
|
|
351
|
-
let u = (e, t) => {
|
|
352
|
-
this.chunks.push({
|
|
353
|
-
pattern: e,
|
|
354
|
-
alphabet: M(e),
|
|
355
|
-
startIndex: t
|
|
356
|
-
});
|
|
357
|
-
}, d = this.pattern.length;
|
|
358
|
-
if (d > j) {
|
|
359
|
-
let e = 0, t = d % j, n = d - t;
|
|
360
|
-
for (; e < n;) u(this.pattern.substr(e, j), e), e += j;
|
|
361
|
-
if (t) {
|
|
362
|
-
let e = d - j;
|
|
363
|
-
u(this.pattern.substr(e), e);
|
|
364
|
-
}
|
|
365
|
-
} else u(this.pattern, 0);
|
|
366
|
-
}
|
|
367
|
-
searchIn(e) {
|
|
368
|
-
let { isCaseSensitive: t, ignoreDiacritics: n, includeMatches: r } = this.options;
|
|
369
|
-
if (e = t ? e : e.toLowerCase(), e = n ? N(e) : e, this.pattern === e) {
|
|
370
|
-
let t = {
|
|
371
|
-
isMatch: !0,
|
|
372
|
-
score: 0
|
|
373
|
-
};
|
|
374
|
-
return r && (t.indices = [[0, e.length - 1]]), t;
|
|
375
|
-
}
|
|
376
|
-
let { location: i, distance: a, threshold: o, findAllMatches: s, minMatchCharLength: c, ignoreLocation: l } = this.options, u = [], d = 0, f = !1;
|
|
377
|
-
this.chunks.forEach(({ pattern: t, alphabet: n, startIndex: p }) => {
|
|
378
|
-
let { isMatch: m, score: h, indices: g } = oe(e, t, n, {
|
|
379
|
-
location: i + p,
|
|
380
|
-
distance: a,
|
|
381
|
-
threshold: o,
|
|
382
|
-
findAllMatches: s,
|
|
383
|
-
minMatchCharLength: c,
|
|
384
|
-
includeMatches: r,
|
|
385
|
-
ignoreLocation: l
|
|
386
|
-
});
|
|
387
|
-
m && (f = !0), d += h, m && g && (u = [...u, ...g]);
|
|
388
|
-
});
|
|
389
|
-
let p = {
|
|
390
|
-
isMatch: f,
|
|
391
|
-
score: f ? d / this.chunks.length : 1
|
|
392
|
-
};
|
|
393
|
-
return f && r && (p.indices = u), p;
|
|
394
|
-
}
|
|
395
|
-
}, F = class {
|
|
396
|
-
constructor(e) {
|
|
397
|
-
this.pattern = e;
|
|
398
|
-
}
|
|
399
|
-
static isMultiMatch(e) {
|
|
400
|
-
return I(e, this.multiRegex);
|
|
401
|
-
}
|
|
402
|
-
static isSingleMatch(e) {
|
|
403
|
-
return I(e, this.singleRegex);
|
|
404
|
-
}
|
|
405
|
-
search() {}
|
|
406
|
-
};
|
|
407
|
-
function I(e, t) {
|
|
408
|
-
let n = e.match(t);
|
|
409
|
-
return n ? n[1] : null;
|
|
410
|
-
}
|
|
411
|
-
var L = class extends F {
|
|
412
|
-
constructor(e) {
|
|
413
|
-
super(e);
|
|
414
|
-
}
|
|
415
|
-
static get type() {
|
|
416
|
-
return "exact";
|
|
417
|
-
}
|
|
418
|
-
static get multiRegex() {
|
|
419
|
-
return /^="(.*)"$/;
|
|
420
|
-
}
|
|
421
|
-
static get singleRegex() {
|
|
422
|
-
return /^=(.*)$/;
|
|
423
|
-
}
|
|
424
|
-
search(e) {
|
|
425
|
-
let t = e === this.pattern;
|
|
426
|
-
return {
|
|
427
|
-
isMatch: t,
|
|
428
|
-
score: +!t,
|
|
429
|
-
indices: [0, this.pattern.length - 1]
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
}, se = class extends F {
|
|
433
|
-
constructor(e) {
|
|
434
|
-
super(e);
|
|
435
|
-
}
|
|
436
|
-
static get type() {
|
|
437
|
-
return "inverse-exact";
|
|
438
|
-
}
|
|
439
|
-
static get multiRegex() {
|
|
440
|
-
return /^!"(.*)"$/;
|
|
441
|
-
}
|
|
442
|
-
static get singleRegex() {
|
|
443
|
-
return /^!(.*)$/;
|
|
444
|
-
}
|
|
445
|
-
search(e) {
|
|
446
|
-
let t = e.indexOf(this.pattern) === -1;
|
|
447
|
-
return {
|
|
448
|
-
isMatch: t,
|
|
449
|
-
score: +!t,
|
|
450
|
-
indices: [0, e.length - 1]
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
}, ce = class extends F {
|
|
454
|
-
constructor(e) {
|
|
455
|
-
super(e);
|
|
456
|
-
}
|
|
457
|
-
static get type() {
|
|
458
|
-
return "prefix-exact";
|
|
459
|
-
}
|
|
460
|
-
static get multiRegex() {
|
|
461
|
-
return /^\^"(.*)"$/;
|
|
462
|
-
}
|
|
463
|
-
static get singleRegex() {
|
|
464
|
-
return /^\^(.*)$/;
|
|
465
|
-
}
|
|
466
|
-
search(e) {
|
|
467
|
-
let t = e.startsWith(this.pattern);
|
|
468
|
-
return {
|
|
469
|
-
isMatch: t,
|
|
470
|
-
score: +!t,
|
|
471
|
-
indices: [0, this.pattern.length - 1]
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
}, R = class extends F {
|
|
475
|
-
constructor(e) {
|
|
476
|
-
super(e);
|
|
477
|
-
}
|
|
478
|
-
static get type() {
|
|
479
|
-
return "inverse-prefix-exact";
|
|
480
|
-
}
|
|
481
|
-
static get multiRegex() {
|
|
482
|
-
return /^!\^"(.*)"$/;
|
|
483
|
-
}
|
|
484
|
-
static get singleRegex() {
|
|
485
|
-
return /^!\^(.*)$/;
|
|
486
|
-
}
|
|
487
|
-
search(e) {
|
|
488
|
-
let t = !e.startsWith(this.pattern);
|
|
489
|
-
return {
|
|
490
|
-
isMatch: t,
|
|
491
|
-
score: +!t,
|
|
492
|
-
indices: [0, e.length - 1]
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
}, z = class extends F {
|
|
496
|
-
constructor(e) {
|
|
497
|
-
super(e);
|
|
498
|
-
}
|
|
499
|
-
static get type() {
|
|
500
|
-
return "suffix-exact";
|
|
501
|
-
}
|
|
502
|
-
static get multiRegex() {
|
|
503
|
-
return /^"(.*)"\$$/;
|
|
504
|
-
}
|
|
505
|
-
static get singleRegex() {
|
|
506
|
-
return /^(.*)\$$/;
|
|
507
|
-
}
|
|
508
|
-
search(e) {
|
|
509
|
-
let t = e.endsWith(this.pattern);
|
|
510
|
-
return {
|
|
511
|
-
isMatch: t,
|
|
512
|
-
score: +!t,
|
|
513
|
-
indices: [e.length - this.pattern.length, e.length - 1]
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
}, B = class extends F {
|
|
517
|
-
constructor(e) {
|
|
518
|
-
super(e);
|
|
519
|
-
}
|
|
520
|
-
static get type() {
|
|
521
|
-
return "inverse-suffix-exact";
|
|
522
|
-
}
|
|
523
|
-
static get multiRegex() {
|
|
524
|
-
return /^!"(.*)"\$$/;
|
|
525
|
-
}
|
|
526
|
-
static get singleRegex() {
|
|
527
|
-
return /^!(.*)\$$/;
|
|
528
|
-
}
|
|
529
|
-
search(e) {
|
|
530
|
-
let t = !e.endsWith(this.pattern);
|
|
531
|
-
return {
|
|
532
|
-
isMatch: t,
|
|
533
|
-
score: +!t,
|
|
534
|
-
indices: [0, e.length - 1]
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
}, V = class extends F {
|
|
538
|
-
constructor(e, { location: t = E.location, threshold: n = E.threshold, distance: r = E.distance, includeMatches: i = E.includeMatches, findAllMatches: a = E.findAllMatches, minMatchCharLength: o = E.minMatchCharLength, isCaseSensitive: s = E.isCaseSensitive, ignoreDiacritics: c = E.ignoreDiacritics, ignoreLocation: l = E.ignoreLocation } = {}) {
|
|
539
|
-
super(e), this._bitapSearch = new P(e, {
|
|
540
|
-
location: t,
|
|
541
|
-
threshold: n,
|
|
542
|
-
distance: r,
|
|
543
|
-
includeMatches: i,
|
|
544
|
-
findAllMatches: a,
|
|
545
|
-
minMatchCharLength: o,
|
|
546
|
-
isCaseSensitive: s,
|
|
547
|
-
ignoreDiacritics: c,
|
|
548
|
-
ignoreLocation: l
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
static get type() {
|
|
552
|
-
return "fuzzy";
|
|
553
|
-
}
|
|
554
|
-
static get multiRegex() {
|
|
555
|
-
return /^"(.*)"$/;
|
|
556
|
-
}
|
|
557
|
-
static get singleRegex() {
|
|
558
|
-
return /^(.*)$/;
|
|
559
|
-
}
|
|
560
|
-
search(e) {
|
|
561
|
-
return this._bitapSearch.searchIn(e);
|
|
562
|
-
}
|
|
563
|
-
}, H = class extends F {
|
|
564
|
-
constructor(e) {
|
|
565
|
-
super(e);
|
|
566
|
-
}
|
|
567
|
-
static get type() {
|
|
568
|
-
return "include";
|
|
569
|
-
}
|
|
570
|
-
static get multiRegex() {
|
|
571
|
-
return /^'"(.*)"$/;
|
|
572
|
-
}
|
|
573
|
-
static get singleRegex() {
|
|
574
|
-
return /^'(.*)$/;
|
|
575
|
-
}
|
|
576
|
-
search(e) {
|
|
577
|
-
let t = 0, n, r = [], i = this.pattern.length;
|
|
578
|
-
for (; (n = e.indexOf(this.pattern, t)) > -1;) t = n + i, r.push([n, t - 1]);
|
|
579
|
-
let a = !!r.length;
|
|
580
|
-
return {
|
|
581
|
-
isMatch: a,
|
|
582
|
-
score: +!a,
|
|
583
|
-
indices: r
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
}, U = [
|
|
587
|
-
L,
|
|
588
|
-
H,
|
|
589
|
-
ce,
|
|
590
|
-
R,
|
|
591
|
-
B,
|
|
592
|
-
z,
|
|
593
|
-
se,
|
|
594
|
-
V
|
|
595
|
-
], W = U.length, G = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, le = "|";
|
|
596
|
-
function ue(e, t = {}) {
|
|
597
|
-
return e.split(le).map((e) => {
|
|
598
|
-
let n = e.trim().split(G).filter((e) => e && !!e.trim()), r = [];
|
|
599
|
-
for (let e = 0, i = n.length; e < i; e += 1) {
|
|
600
|
-
let i = n[e], a = !1, o = -1;
|
|
601
|
-
for (; !a && ++o < W;) {
|
|
602
|
-
let e = U[o], n = e.isMultiMatch(i);
|
|
603
|
-
n && (r.push(new e(n, t)), a = !0);
|
|
604
|
-
}
|
|
605
|
-
if (!a) for (o = -1; ++o < W;) {
|
|
606
|
-
let e = U[o], n = e.isSingleMatch(i);
|
|
607
|
-
if (n) {
|
|
608
|
-
r.push(new e(n, t));
|
|
609
|
-
break;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
return r;
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
var de = new Set([V.type, H.type]), fe = class {
|
|
617
|
-
constructor(e, { isCaseSensitive: t = E.isCaseSensitive, ignoreDiacritics: n = E.ignoreDiacritics, includeMatches: r = E.includeMatches, minMatchCharLength: i = E.minMatchCharLength, ignoreLocation: a = E.ignoreLocation, findAllMatches: o = E.findAllMatches, location: s = E.location, threshold: c = E.threshold, distance: l = E.distance } = {}) {
|
|
618
|
-
this.query = null, this.options = {
|
|
619
|
-
isCaseSensitive: t,
|
|
620
|
-
ignoreDiacritics: n,
|
|
621
|
-
includeMatches: r,
|
|
622
|
-
minMatchCharLength: i,
|
|
623
|
-
findAllMatches: o,
|
|
624
|
-
ignoreLocation: a,
|
|
625
|
-
location: s,
|
|
626
|
-
threshold: c,
|
|
627
|
-
distance: l
|
|
628
|
-
}, e = t ? e : e.toLowerCase(), e = n ? N(e) : e, this.pattern = e, this.query = ue(this.pattern, this.options);
|
|
629
|
-
}
|
|
630
|
-
static condition(e, t) {
|
|
631
|
-
return t.useExtendedSearch;
|
|
632
|
-
}
|
|
633
|
-
searchIn(e) {
|
|
634
|
-
let t = this.query;
|
|
635
|
-
if (!t) return {
|
|
636
|
-
isMatch: !1,
|
|
637
|
-
score: 1
|
|
638
|
-
};
|
|
639
|
-
let { includeMatches: n, isCaseSensitive: r, ignoreDiacritics: i } = this.options;
|
|
640
|
-
e = r ? e : e.toLowerCase(), e = i ? N(e) : e;
|
|
641
|
-
let a = 0, o = [], s = 0;
|
|
642
|
-
for (let r = 0, i = t.length; r < i; r += 1) {
|
|
643
|
-
let i = t[r];
|
|
644
|
-
o.length = 0, a = 0;
|
|
645
|
-
for (let t = 0, r = i.length; t < r; t += 1) {
|
|
646
|
-
let r = i[t], { isMatch: c, indices: l, score: u } = r.search(e);
|
|
647
|
-
if (c) {
|
|
648
|
-
if (a += 1, s += u, n) {
|
|
649
|
-
let e = r.constructor.type;
|
|
650
|
-
de.has(e) ? o = [...o, ...l] : o.push(l);
|
|
651
|
-
}
|
|
652
|
-
} else {
|
|
653
|
-
s = 0, a = 0, o.length = 0;
|
|
654
|
-
break;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
if (a) {
|
|
658
|
-
let e = {
|
|
659
|
-
isMatch: !0,
|
|
660
|
-
score: s / a
|
|
661
|
-
};
|
|
662
|
-
return n && (e.indices = o), e;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
return {
|
|
666
|
-
isMatch: !1,
|
|
667
|
-
score: 1
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
}, K = [];
|
|
671
|
-
function pe(...e) {
|
|
672
|
-
K.push(...e);
|
|
673
|
-
}
|
|
674
|
-
function q(e, t) {
|
|
675
|
-
for (let n = 0, r = K.length; n < r; n += 1) {
|
|
676
|
-
let r = K[n];
|
|
677
|
-
if (r.condition(e, t)) return new r(e, t);
|
|
678
|
-
}
|
|
679
|
-
return new P(e, t);
|
|
680
|
-
}
|
|
681
|
-
var J = {
|
|
682
|
-
AND: "$and",
|
|
683
|
-
OR: "$or"
|
|
684
|
-
}, Y = {
|
|
685
|
-
PATH: "$path",
|
|
686
|
-
PATTERN: "$val"
|
|
687
|
-
}, X = (e) => !!(e[J.AND] || e[J.OR]), me = (e) => !!e[Y.PATH], he = (e) => !n(e) && l(e) && !X(e), Z = (e) => ({ [J.AND]: Object.keys(e).map((t) => ({ [t]: e[t] })) });
|
|
688
|
-
function Q(e, t, { auto: r = !0 } = {}) {
|
|
689
|
-
let i = (e) => {
|
|
690
|
-
let a = Object.keys(e), s = me(e);
|
|
691
|
-
if (!s && a.length > 1 && !X(e)) return i(Z(e));
|
|
692
|
-
if (he(e)) {
|
|
693
|
-
let n = s ? e[Y.PATH] : a[0], i = s ? e[Y.PATTERN] : e[n];
|
|
694
|
-
if (!o(i)) throw Error(h(n));
|
|
695
|
-
let c = {
|
|
696
|
-
keyId: C(n),
|
|
697
|
-
pattern: i
|
|
698
|
-
};
|
|
699
|
-
return r && (c.searcher = q(i, t)), c;
|
|
700
|
-
}
|
|
701
|
-
let c = {
|
|
702
|
-
children: [],
|
|
703
|
-
operator: a[0]
|
|
704
|
-
};
|
|
705
|
-
return a.forEach((t) => {
|
|
706
|
-
let r = e[t];
|
|
707
|
-
n(r) && r.forEach((e) => {
|
|
708
|
-
c.children.push(i(e));
|
|
709
|
-
});
|
|
710
|
-
}), c;
|
|
711
|
-
};
|
|
712
|
-
return X(e) || (e = Z(e)), i(e);
|
|
713
|
-
}
|
|
714
|
-
function ge(e, { ignoreFieldNorm: t = E.ignoreFieldNorm }) {
|
|
715
|
-
e.forEach((e) => {
|
|
716
|
-
let n = 1;
|
|
717
|
-
e.matches.forEach(({ key: e, norm: r, score: i }) => {
|
|
718
|
-
let a = e ? e.weight : null;
|
|
719
|
-
n *= (i === 0 && a ? 2 ** -52 : i) ** +((a || 1) * (t ? 1 : r));
|
|
720
|
-
}), e.score = n;
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
function _e(e, t) {
|
|
724
|
-
let n = e.matches;
|
|
725
|
-
t.matches = [], d(n) && n.forEach((e) => {
|
|
726
|
-
if (!d(e.indices) || !e.indices.length) return;
|
|
727
|
-
let { indices: n, value: r } = e, i = {
|
|
728
|
-
indices: n,
|
|
729
|
-
value: r
|
|
730
|
-
};
|
|
731
|
-
e.key && (i.key = e.key.src), e.idx > -1 && (i.refIndex = e.idx), t.matches.push(i);
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
function ve(e, t) {
|
|
735
|
-
t.score = e.score;
|
|
736
|
-
}
|
|
737
|
-
function ye(e, t, { includeMatches: n = E.includeMatches, includeScore: r = E.includeScore } = {}) {
|
|
738
|
-
let i = [];
|
|
739
|
-
return n && i.push(_e), r && i.push(ve), e.map((e) => {
|
|
740
|
-
let { idx: n } = e, r = {
|
|
741
|
-
item: t[n],
|
|
742
|
-
refIndex: n
|
|
743
|
-
};
|
|
744
|
-
return i.length && i.forEach((t) => {
|
|
745
|
-
t(e, r);
|
|
746
|
-
}), r;
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
var $ = class {
|
|
750
|
-
constructor(e, t = {}, n) {
|
|
751
|
-
this.options = {
|
|
752
|
-
...E,
|
|
753
|
-
...t
|
|
754
|
-
}, this.options.useExtendedSearch, this._keyStore = new b(this.options.keys), this.setCollection(e, n);
|
|
755
|
-
}
|
|
756
|
-
setCollection(e, t) {
|
|
757
|
-
if (this._docs = e, t && !(t instanceof O)) throw Error(m);
|
|
758
|
-
this._myIndex = t || k(this.options.keys, this._docs, {
|
|
759
|
-
getFn: this.options.getFn,
|
|
760
|
-
fieldNormWeight: this.options.fieldNormWeight
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
add(e) {
|
|
764
|
-
d(e) && (this._docs.push(e), this._myIndex.add(e));
|
|
765
|
-
}
|
|
766
|
-
remove(e = () => !1) {
|
|
767
|
-
let t = [];
|
|
768
|
-
for (let n = 0, r = this._docs.length; n < r; n += 1) {
|
|
769
|
-
let i = this._docs[n];
|
|
770
|
-
e(i, n) && (this.removeAt(n), --n, --r, t.push(i));
|
|
771
|
-
}
|
|
772
|
-
return t;
|
|
773
|
-
}
|
|
774
|
-
removeAt(e) {
|
|
775
|
-
this._docs.splice(e, 1), this._myIndex.removeAt(e);
|
|
776
|
-
}
|
|
777
|
-
getIndex() {
|
|
778
|
-
return this._myIndex;
|
|
779
|
-
}
|
|
780
|
-
search(e, { limit: t = -1 } = {}) {
|
|
781
|
-
let { includeMatches: n, includeScore: r, shouldSort: i, sortFn: a, ignoreFieldNorm: c } = this.options, l = o(e) ? o(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
|
|
782
|
-
return ge(l, { ignoreFieldNorm: c }), i && l.sort(a), s(t) && t > -1 && (l = l.slice(0, t)), ye(l, this._docs, {
|
|
783
|
-
includeMatches: n,
|
|
784
|
-
includeScore: r
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
_searchStringList(e) {
|
|
788
|
-
let t = q(e, this.options), { records: n } = this._myIndex, r = [];
|
|
789
|
-
return n.forEach(({ v: e, i: n, n: i }) => {
|
|
790
|
-
if (!d(e)) return;
|
|
791
|
-
let { isMatch: a, score: o, indices: s } = t.searchIn(e);
|
|
792
|
-
a && r.push({
|
|
793
|
-
item: e,
|
|
794
|
-
idx: n,
|
|
795
|
-
matches: [{
|
|
796
|
-
score: o,
|
|
797
|
-
value: e,
|
|
798
|
-
norm: i,
|
|
799
|
-
indices: s
|
|
800
|
-
}]
|
|
801
|
-
});
|
|
802
|
-
}), r;
|
|
803
|
-
}
|
|
804
|
-
_searchLogical(e) {
|
|
805
|
-
let t = Q(e, this.options), n = (e, t, r) => {
|
|
806
|
-
if (!e.children) {
|
|
807
|
-
let { keyId: n, searcher: i } = e, a = this._findMatches({
|
|
808
|
-
key: this._keyStore.get(n),
|
|
809
|
-
value: this._myIndex.getValueForItemAtKeyId(t, n),
|
|
810
|
-
searcher: i
|
|
811
|
-
});
|
|
812
|
-
return a && a.length ? [{
|
|
813
|
-
idx: r,
|
|
814
|
-
item: t,
|
|
815
|
-
matches: a
|
|
816
|
-
}] : [];
|
|
817
|
-
}
|
|
818
|
-
let i = [];
|
|
819
|
-
for (let a = 0, o = e.children.length; a < o; a += 1) {
|
|
820
|
-
let o = e.children[a], s = n(o, t, r);
|
|
821
|
-
if (s.length) i.push(...s);
|
|
822
|
-
else if (e.operator === J.AND) return [];
|
|
823
|
-
}
|
|
824
|
-
return i;
|
|
825
|
-
}, r = this._myIndex.records, i = {}, a = [];
|
|
826
|
-
return r.forEach(({ $: e, i: r }) => {
|
|
827
|
-
if (d(e)) {
|
|
828
|
-
let o = n(t, e, r);
|
|
829
|
-
o.length && (i[r] || (i[r] = {
|
|
830
|
-
idx: r,
|
|
831
|
-
item: e,
|
|
832
|
-
matches: []
|
|
833
|
-
}, a.push(i[r])), o.forEach(({ matches: e }) => {
|
|
834
|
-
i[r].matches.push(...e);
|
|
835
|
-
}));
|
|
836
|
-
}
|
|
837
|
-
}), a;
|
|
838
|
-
}
|
|
839
|
-
_searchObjectList(e) {
|
|
840
|
-
let t = q(e, this.options), { keys: n, records: r } = this._myIndex, i = [];
|
|
841
|
-
return r.forEach(({ $: e, i: r }) => {
|
|
842
|
-
if (!d(e)) return;
|
|
843
|
-
let a = [];
|
|
844
|
-
n.forEach((n, r) => {
|
|
845
|
-
a.push(...this._findMatches({
|
|
846
|
-
key: n,
|
|
847
|
-
value: e[r],
|
|
848
|
-
searcher: t
|
|
849
|
-
}));
|
|
850
|
-
}), a.length && i.push({
|
|
851
|
-
idx: r,
|
|
852
|
-
item: e,
|
|
853
|
-
matches: a
|
|
854
|
-
});
|
|
855
|
-
}), i;
|
|
856
|
-
}
|
|
857
|
-
_findMatches({ key: e, value: t, searcher: r }) {
|
|
858
|
-
if (!d(t)) return [];
|
|
859
|
-
let i = [];
|
|
860
|
-
if (n(t)) t.forEach(({ v: t, i: n, n: a }) => {
|
|
861
|
-
if (!d(t)) return;
|
|
862
|
-
let { isMatch: o, score: s, indices: c } = r.searchIn(t);
|
|
863
|
-
o && i.push({
|
|
864
|
-
score: s,
|
|
865
|
-
key: e,
|
|
866
|
-
value: t,
|
|
867
|
-
idx: n,
|
|
868
|
-
norm: a,
|
|
869
|
-
indices: c
|
|
870
|
-
});
|
|
871
|
-
});
|
|
872
|
-
else {
|
|
873
|
-
let { v: n, n: a } = t, { isMatch: o, score: s, indices: c } = r.searchIn(n);
|
|
874
|
-
o && i.push({
|
|
875
|
-
score: s,
|
|
876
|
-
key: e,
|
|
877
|
-
value: n,
|
|
878
|
-
norm: a,
|
|
879
|
-
indices: c
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
return i;
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
$.version = "7.1.0", $.createIndex = k, $.parseIndex = ie, $.config = E, $.parseQuery = Q, pe(fe);
|
|
886
|
-
//#endregion
|
|
887
|
-
export { t as n, $ as t };
|