iconfont-preview-cli 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/index-B4R2H-je.js +28 -0
- package/app/assets/index-C7JBaBdr.css +7 -0
- package/app/index.html +2 -2
- package/components/index.cjs +7 -1
- package/components/index.css +7 -1
- package/components/index.mjs +937 -743
- package/components/types/render-icon-list/src/components/use-toast.d.ts +10 -0
- package/package.json +2 -1
- package/app/assets/index-BN1JFPmQ.js +0 -22
- package/app/assets/index-fas_yV9m.css +0 -1
package/components/index.mjs
CHANGED
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return Array.isArray ? Array.isArray(t) : oe(t) === "[object Array]";
|
|
1
|
+
import { defineComponent as X, createVNode as L, computed as vt, ref as O, onMounted as Mt, createElementBlock as bt, openBlock as Ft, renderSlot as xt, unref as Bt } from "vue";
|
|
2
|
+
function F(s) {
|
|
3
|
+
return Array.isArray ? Array.isArray(s) : pt(s) === "[object Array]";
|
|
5
4
|
}
|
|
6
|
-
function
|
|
7
|
-
if (typeof
|
|
8
|
-
return
|
|
9
|
-
let
|
|
10
|
-
return
|
|
5
|
+
function Dt(s) {
|
|
6
|
+
if (typeof s == "string")
|
|
7
|
+
return s;
|
|
8
|
+
let t = s + "";
|
|
9
|
+
return t == "0" && 1 / s == -1 / 0 ? "-0" : t;
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
function It(s) {
|
|
12
|
+
return s == null ? "" : Dt(s);
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
return typeof
|
|
14
|
+
function b(s) {
|
|
15
|
+
return typeof s == "string";
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
return typeof
|
|
17
|
+
function ft(s) {
|
|
18
|
+
return typeof s == "number";
|
|
20
19
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
20
|
+
function kt(s) {
|
|
21
|
+
return s === !0 || s === !1 || _t(s) && pt(s) == "[object Boolean]";
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
return typeof
|
|
23
|
+
function dt(s) {
|
|
24
|
+
return typeof s == "object";
|
|
26
25
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
26
|
+
function _t(s) {
|
|
27
|
+
return dt(s) && s !== null;
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
29
|
+
function y(s) {
|
|
30
|
+
return s != null;
|
|
32
31
|
}
|
|
33
|
-
function
|
|
34
|
-
return !
|
|
32
|
+
function H(s) {
|
|
33
|
+
return !s.trim().length;
|
|
35
34
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
35
|
+
function pt(s) {
|
|
36
|
+
return s == null ? s === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(s);
|
|
38
37
|
}
|
|
39
|
-
const
|
|
40
|
-
class
|
|
41
|
-
constructor(
|
|
38
|
+
const St = "Incorrect 'index' type", Lt = (s) => `Invalid value for key ${s}`, Nt = (s) => `Pattern length exceeds max of ${s}.`, Ot = (s) => `Missing ${s} property in key`, Rt = (s) => `Property 'weight' in key '${s}' must be a positive integer`, et = Object.prototype.hasOwnProperty;
|
|
39
|
+
class Tt {
|
|
40
|
+
constructor(t) {
|
|
42
41
|
this._keys = [], this._keyMap = {};
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
this._keys.push(
|
|
47
|
-
}), this._keys.forEach((
|
|
48
|
-
|
|
42
|
+
let e = 0;
|
|
43
|
+
t.forEach((i) => {
|
|
44
|
+
let o = gt(i);
|
|
45
|
+
this._keys.push(o), this._keyMap[o.id] = o, e += o.weight;
|
|
46
|
+
}), this._keys.forEach((i) => {
|
|
47
|
+
i.weight /= e;
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
|
-
get(
|
|
52
|
-
return this._keyMap[
|
|
50
|
+
get(t) {
|
|
51
|
+
return this._keyMap[t];
|
|
53
52
|
}
|
|
54
53
|
keys() {
|
|
55
54
|
return this._keys;
|
|
@@ -58,49 +57,49 @@ class ve {
|
|
|
58
57
|
return JSON.stringify(this._keys);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
|
-
function
|
|
62
|
-
let
|
|
63
|
-
if (
|
|
64
|
-
|
|
60
|
+
function gt(s) {
|
|
61
|
+
let t = null, e = null, i = null, o = 1, r = null;
|
|
62
|
+
if (b(s) || F(s))
|
|
63
|
+
i = s, t = st(s), e = V(s);
|
|
65
64
|
else {
|
|
66
|
-
if (!
|
|
67
|
-
throw new Error(
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
throw new Error(
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return { path:
|
|
65
|
+
if (!et.call(s, "name"))
|
|
66
|
+
throw new Error(Ot("name"));
|
|
67
|
+
const n = s.name;
|
|
68
|
+
if (i = n, et.call(s, "weight") && (o = s.weight, o <= 0))
|
|
69
|
+
throw new Error(Rt(n));
|
|
70
|
+
t = st(n), e = V(n), r = s.getFn;
|
|
71
|
+
}
|
|
72
|
+
return { path: t, id: e, weight: o, src: i, getFn: r };
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
74
|
+
function st(s) {
|
|
75
|
+
return F(s) ? s : s.split(".");
|
|
77
76
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
77
|
+
function V(s) {
|
|
78
|
+
return F(s) ? s.join(".") : s;
|
|
80
79
|
}
|
|
81
|
-
function
|
|
82
|
-
let
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
if (!c
|
|
86
|
-
|
|
80
|
+
function $t(s, t) {
|
|
81
|
+
let e = [], i = !1;
|
|
82
|
+
const o = (r, n, c) => {
|
|
83
|
+
if (y(r))
|
|
84
|
+
if (!n[c])
|
|
85
|
+
e.push(r);
|
|
87
86
|
else {
|
|
88
|
-
let
|
|
89
|
-
const
|
|
90
|
-
if (!
|
|
87
|
+
let a = n[c];
|
|
88
|
+
const l = r[a];
|
|
89
|
+
if (!y(l))
|
|
91
90
|
return;
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
else if (
|
|
95
|
-
|
|
96
|
-
for (let
|
|
97
|
-
|
|
98
|
-
} else
|
|
91
|
+
if (c === n.length - 1 && (b(l) || ft(l) || kt(l)))
|
|
92
|
+
e.push(It(l));
|
|
93
|
+
else if (F(l)) {
|
|
94
|
+
i = !0;
|
|
95
|
+
for (let u = 0, h = l.length; u < h; u += 1)
|
|
96
|
+
o(l[u], n, c + 1);
|
|
97
|
+
} else n.length && o(l, n, c + 1);
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
|
-
return
|
|
100
|
+
return o(s, b(t) ? t.split(".") : t, 0), i ? e : e[0];
|
|
102
101
|
}
|
|
103
|
-
const
|
|
102
|
+
const Pt = {
|
|
104
103
|
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
105
104
|
// set will include the indices of the matched characters.
|
|
106
105
|
// These can consequently be used for highlighting purposes.
|
|
@@ -110,7 +109,7 @@ const ke = {
|
|
|
110
109
|
findAllMatches: !1,
|
|
111
110
|
// Minimum number of characters that must be matched before a result is considered a match
|
|
112
111
|
minMatchCharLength: 1
|
|
113
|
-
},
|
|
112
|
+
}, jt = {
|
|
114
113
|
// When `true`, the algorithm continues searching to the end of the input even if a perfect
|
|
115
114
|
// match is found before the end of the same input.
|
|
116
115
|
isCaseSensitive: !1,
|
|
@@ -123,8 +122,8 @@ const ke = {
|
|
|
123
122
|
// Whether to sort the result list, by score
|
|
124
123
|
shouldSort: !0,
|
|
125
124
|
// Default sort function: sort by ascending score, ascending index
|
|
126
|
-
sortFn: (
|
|
127
|
-
},
|
|
125
|
+
sortFn: (s, t) => s.score === t.score ? s.idx < t.idx ? -1 : 1 : s.score < t.score ? -1 : 1
|
|
126
|
+
}, Wt = {
|
|
128
127
|
// Approximately where in the text is the pattern expected to be found?
|
|
129
128
|
location: 0,
|
|
130
129
|
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
|
|
@@ -136,12 +135,12 @@ const ke = {
|
|
|
136
135
|
// the exact location specified, a threshold of '1000' would require a perfect match
|
|
137
136
|
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
|
|
138
137
|
distance: 100
|
|
139
|
-
},
|
|
138
|
+
}, zt = {
|
|
140
139
|
// When `true`, it enables the use of unix-like search commands
|
|
141
140
|
useExtendedSearch: !1,
|
|
142
141
|
// The get function to use when fetching an object's properties.
|
|
143
142
|
// The default will search nested paths *ie foo.bar.baz*
|
|
144
|
-
getFn:
|
|
143
|
+
getFn: $t,
|
|
145
144
|
// When `true`, search will ignore `location` and `distance`, so it won't matter
|
|
146
145
|
// where in the string the pattern appears.
|
|
147
146
|
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
|
|
@@ -154,114 +153,114 @@ const ke = {
|
|
|
154
153
|
fieldNormWeight: 1
|
|
155
154
|
};
|
|
156
155
|
var f = {
|
|
157
|
-
...
|
|
158
|
-
...
|
|
159
|
-
...
|
|
160
|
-
|
|
156
|
+
...jt,
|
|
157
|
+
...Pt,
|
|
158
|
+
...Wt,
|
|
159
|
+
...zt
|
|
161
160
|
};
|
|
162
|
-
const
|
|
163
|
-
function
|
|
164
|
-
const
|
|
161
|
+
const Ht = /[^ ]+/g;
|
|
162
|
+
function Kt(s = 1, t = 3) {
|
|
163
|
+
const e = /* @__PURE__ */ new Map(), i = Math.pow(10, t);
|
|
165
164
|
return {
|
|
166
|
-
get(
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
const
|
|
171
|
-
return
|
|
165
|
+
get(o) {
|
|
166
|
+
const r = o.match(Ht).length;
|
|
167
|
+
if (e.has(r))
|
|
168
|
+
return e.get(r);
|
|
169
|
+
const n = 1 / Math.pow(r, 0.5 * s), c = parseFloat(Math.round(n * i) / i);
|
|
170
|
+
return e.set(r, c), c;
|
|
172
171
|
},
|
|
173
172
|
clear() {
|
|
174
|
-
|
|
173
|
+
e.clear();
|
|
175
174
|
}
|
|
176
175
|
};
|
|
177
176
|
}
|
|
178
|
-
class
|
|
177
|
+
class q {
|
|
179
178
|
constructor({
|
|
180
|
-
getFn:
|
|
181
|
-
fieldNormWeight:
|
|
179
|
+
getFn: t = f.getFn,
|
|
180
|
+
fieldNormWeight: e = f.fieldNormWeight
|
|
182
181
|
} = {}) {
|
|
183
|
-
this.norm =
|
|
182
|
+
this.norm = Kt(e, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
|
|
184
183
|
}
|
|
185
|
-
setSources(
|
|
186
|
-
this.docs =
|
|
184
|
+
setSources(t = []) {
|
|
185
|
+
this.docs = t;
|
|
187
186
|
}
|
|
188
|
-
setIndexRecords(
|
|
189
|
-
this.records =
|
|
187
|
+
setIndexRecords(t = []) {
|
|
188
|
+
this.records = t;
|
|
190
189
|
}
|
|
191
|
-
setKeys(
|
|
192
|
-
this.keys =
|
|
193
|
-
this._keysMap[
|
|
190
|
+
setKeys(t = []) {
|
|
191
|
+
this.keys = t, this._keysMap = {}, t.forEach((e, i) => {
|
|
192
|
+
this._keysMap[e.id] = i;
|
|
194
193
|
});
|
|
195
194
|
}
|
|
196
195
|
create() {
|
|
197
|
-
this.isCreated || !this.docs.length || (this.isCreated = !0,
|
|
198
|
-
this._addString(
|
|
199
|
-
}) : this.docs.forEach((
|
|
200
|
-
this._addObject(
|
|
196
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, b(this.docs[0]) ? this.docs.forEach((t, e) => {
|
|
197
|
+
this._addString(t, e);
|
|
198
|
+
}) : this.docs.forEach((t, e) => {
|
|
199
|
+
this._addObject(t, e);
|
|
201
200
|
}), this.norm.clear());
|
|
202
201
|
}
|
|
203
202
|
// Adds a doc to the end of the index
|
|
204
|
-
add(
|
|
205
|
-
const
|
|
206
|
-
|
|
203
|
+
add(t) {
|
|
204
|
+
const e = this.size();
|
|
205
|
+
b(t) ? this._addString(t, e) : this._addObject(t, e);
|
|
207
206
|
}
|
|
208
207
|
// Removes the doc at the specified index of the index
|
|
209
|
-
removeAt(
|
|
210
|
-
this.records.splice(
|
|
211
|
-
for (let
|
|
212
|
-
this.records[
|
|
208
|
+
removeAt(t) {
|
|
209
|
+
this.records.splice(t, 1);
|
|
210
|
+
for (let e = t, i = this.size(); e < i; e += 1)
|
|
211
|
+
this.records[e].i -= 1;
|
|
213
212
|
}
|
|
214
|
-
getValueForItemAtKeyId(
|
|
215
|
-
return
|
|
213
|
+
getValueForItemAtKeyId(t, e) {
|
|
214
|
+
return t[this._keysMap[e]];
|
|
216
215
|
}
|
|
217
216
|
size() {
|
|
218
217
|
return this.records.length;
|
|
219
218
|
}
|
|
220
|
-
_addString(
|
|
221
|
-
if (!
|
|
219
|
+
_addString(t, e) {
|
|
220
|
+
if (!y(t) || H(t))
|
|
222
221
|
return;
|
|
223
|
-
let
|
|
224
|
-
v:
|
|
225
|
-
i:
|
|
226
|
-
n: this.norm.get(
|
|
222
|
+
let i = {
|
|
223
|
+
v: t,
|
|
224
|
+
i: e,
|
|
225
|
+
n: this.norm.get(t)
|
|
227
226
|
};
|
|
228
|
-
this.records.push(
|
|
229
|
-
}
|
|
230
|
-
_addObject(
|
|
231
|
-
let
|
|
232
|
-
this.keys.forEach((
|
|
233
|
-
let
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
-
let
|
|
237
|
-
const
|
|
238
|
-
for (;
|
|
239
|
-
const { nestedArrIndex:
|
|
240
|
-
if (
|
|
241
|
-
if (
|
|
242
|
-
let
|
|
243
|
-
v:
|
|
244
|
-
i:
|
|
245
|
-
n: this.norm.get(
|
|
227
|
+
this.records.push(i);
|
|
228
|
+
}
|
|
229
|
+
_addObject(t, e) {
|
|
230
|
+
let i = { i: e, $: {} };
|
|
231
|
+
this.keys.forEach((o, r) => {
|
|
232
|
+
let n = o.getFn ? o.getFn(t) : this.getFn(t, o.path);
|
|
233
|
+
if (y(n)) {
|
|
234
|
+
if (F(n)) {
|
|
235
|
+
let c = [];
|
|
236
|
+
const a = [{ nestedArrIndex: -1, value: n }];
|
|
237
|
+
for (; a.length; ) {
|
|
238
|
+
const { nestedArrIndex: l, value: u } = a.pop();
|
|
239
|
+
if (y(u))
|
|
240
|
+
if (b(u) && !H(u)) {
|
|
241
|
+
let h = {
|
|
242
|
+
v: u,
|
|
243
|
+
i: l,
|
|
244
|
+
n: this.norm.get(u)
|
|
246
245
|
};
|
|
247
|
-
|
|
248
|
-
} else
|
|
249
|
-
|
|
246
|
+
c.push(h);
|
|
247
|
+
} else F(u) && u.forEach((h, d) => {
|
|
248
|
+
a.push({
|
|
250
249
|
nestedArrIndex: d,
|
|
251
|
-
value:
|
|
250
|
+
value: h
|
|
252
251
|
});
|
|
253
252
|
});
|
|
254
253
|
}
|
|
255
|
-
|
|
256
|
-
} else if (
|
|
257
|
-
let
|
|
258
|
-
v:
|
|
259
|
-
n: this.norm.get(
|
|
254
|
+
i.$[r] = c;
|
|
255
|
+
} else if (b(n) && !H(n)) {
|
|
256
|
+
let c = {
|
|
257
|
+
v: n,
|
|
258
|
+
n: this.norm.get(n)
|
|
260
259
|
};
|
|
261
|
-
|
|
260
|
+
i.$[r] = c;
|
|
262
261
|
}
|
|
263
262
|
}
|
|
264
|
-
}), this.records.push(
|
|
263
|
+
}), this.records.push(i);
|
|
265
264
|
}
|
|
266
265
|
toJSON() {
|
|
267
266
|
return {
|
|
@@ -270,224 +269,224 @@ class X {
|
|
|
270
269
|
};
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
275
|
-
return
|
|
272
|
+
function mt(s, t, { getFn: e = f.getFn, fieldNormWeight: i = f.fieldNormWeight } = {}) {
|
|
273
|
+
const o = new q({ getFn: e, fieldNormWeight: i });
|
|
274
|
+
return o.setKeys(s.map(gt)), o.setSources(t), o.create(), o;
|
|
276
275
|
}
|
|
277
|
-
function
|
|
278
|
-
const { keys:
|
|
279
|
-
return
|
|
276
|
+
function Vt(s, { getFn: t = f.getFn, fieldNormWeight: e = f.fieldNormWeight } = {}) {
|
|
277
|
+
const { keys: i, records: o } = s, r = new q({ getFn: t, fieldNormWeight: e });
|
|
278
|
+
return r.setKeys(i), r.setIndexRecords(o), r;
|
|
280
279
|
}
|
|
281
|
-
function
|
|
282
|
-
errors:
|
|
283
|
-
currentLocation:
|
|
284
|
-
expectedLocation:
|
|
285
|
-
distance:
|
|
286
|
-
ignoreLocation:
|
|
280
|
+
function R(s, {
|
|
281
|
+
errors: t = 0,
|
|
282
|
+
currentLocation: e = 0,
|
|
283
|
+
expectedLocation: i = 0,
|
|
284
|
+
distance: o = f.distance,
|
|
285
|
+
ignoreLocation: r = f.ignoreLocation
|
|
287
286
|
} = {}) {
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
return
|
|
291
|
-
const
|
|
292
|
-
return
|
|
287
|
+
const n = t / s.length;
|
|
288
|
+
if (r)
|
|
289
|
+
return n;
|
|
290
|
+
const c = Math.abs(i - e);
|
|
291
|
+
return o ? n + c / o : c ? 1 : n;
|
|
293
292
|
}
|
|
294
|
-
function
|
|
295
|
-
let
|
|
296
|
-
for (let
|
|
297
|
-
let
|
|
298
|
-
|
|
293
|
+
function Gt(s = [], t = f.minMatchCharLength) {
|
|
294
|
+
let e = [], i = -1, o = -1, r = 0;
|
|
295
|
+
for (let n = s.length; r < n; r += 1) {
|
|
296
|
+
let c = s[r];
|
|
297
|
+
c && i === -1 ? i = r : !c && i !== -1 && (o = r - 1, o - i + 1 >= t && e.push([i, o]), i = -1);
|
|
299
298
|
}
|
|
300
|
-
return
|
|
299
|
+
return s[r - 1] && r - i >= t && e.push([i, r - 1]), e;
|
|
301
300
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
location:
|
|
305
|
-
distance:
|
|
306
|
-
threshold:
|
|
307
|
-
findAllMatches:
|
|
308
|
-
minMatchCharLength:
|
|
309
|
-
includeMatches:
|
|
310
|
-
ignoreLocation:
|
|
301
|
+
const k = 32;
|
|
302
|
+
function Yt(s, t, e, {
|
|
303
|
+
location: i = f.location,
|
|
304
|
+
distance: o = f.distance,
|
|
305
|
+
threshold: r = f.threshold,
|
|
306
|
+
findAllMatches: n = f.findAllMatches,
|
|
307
|
+
minMatchCharLength: c = f.minMatchCharLength,
|
|
308
|
+
includeMatches: a = f.includeMatches,
|
|
309
|
+
ignoreLocation: l = f.ignoreLocation
|
|
311
310
|
} = {}) {
|
|
312
|
-
if (
|
|
313
|
-
throw new Error(
|
|
314
|
-
const
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
for (; (
|
|
319
|
-
let
|
|
320
|
-
currentLocation:
|
|
311
|
+
if (t.length > k)
|
|
312
|
+
throw new Error(Nt(k));
|
|
313
|
+
const u = t.length, h = s.length, d = Math.max(0, Math.min(i, h));
|
|
314
|
+
let p = r, g = d;
|
|
315
|
+
const m = c > 1 || a, A = m ? Array(h) : [];
|
|
316
|
+
let w;
|
|
317
|
+
for (; (w = s.indexOf(t, g)) > -1; ) {
|
|
318
|
+
let E = R(t, {
|
|
319
|
+
currentLocation: w,
|
|
321
320
|
expectedLocation: d,
|
|
322
|
-
distance:
|
|
323
|
-
ignoreLocation:
|
|
321
|
+
distance: o,
|
|
322
|
+
ignoreLocation: l
|
|
324
323
|
});
|
|
325
|
-
if (
|
|
326
|
-
let
|
|
327
|
-
for (;
|
|
328
|
-
|
|
324
|
+
if (p = Math.min(E, p), g = w + u, m) {
|
|
325
|
+
let B = 0;
|
|
326
|
+
for (; B < u; )
|
|
327
|
+
A[w + B] = 1, B += 1;
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
|
-
|
|
332
|
-
let
|
|
333
|
-
const
|
|
334
|
-
for (let
|
|
335
|
-
let
|
|
336
|
-
for (;
|
|
337
|
-
|
|
338
|
-
errors:
|
|
339
|
-
currentLocation: d +
|
|
330
|
+
g = -1;
|
|
331
|
+
let C = [], x = 1, M = u + h;
|
|
332
|
+
const j = 1 << u - 1;
|
|
333
|
+
for (let E = 0; E < u; E += 1) {
|
|
334
|
+
let B = 0, D = M;
|
|
335
|
+
for (; B < D; )
|
|
336
|
+
R(t, {
|
|
337
|
+
errors: E,
|
|
338
|
+
currentLocation: d + D,
|
|
340
339
|
expectedLocation: d,
|
|
341
|
-
distance:
|
|
342
|
-
ignoreLocation:
|
|
343
|
-
}) <=
|
|
344
|
-
|
|
345
|
-
let Z = Math.max(1, d -
|
|
346
|
-
|
|
347
|
-
for (let
|
|
348
|
-
let
|
|
349
|
-
if (
|
|
350
|
-
errors:
|
|
351
|
-
currentLocation:
|
|
340
|
+
distance: o,
|
|
341
|
+
ignoreLocation: l
|
|
342
|
+
}) <= p ? B = D : M = D, D = Math.floor((M - B) / 2 + B);
|
|
343
|
+
M = D;
|
|
344
|
+
let Z = Math.max(1, d - D + 1), z = n ? h : Math.min(d + D, h) + u, _ = Array(z + 2);
|
|
345
|
+
_[z + 1] = (1 << E) - 1;
|
|
346
|
+
for (let v = z; v >= Z; v -= 1) {
|
|
347
|
+
let N = v - 1, tt = e[s.charAt(N)];
|
|
348
|
+
if (m && (A[N] = +!!tt), _[v] = (_[v + 1] << 1 | 1) & tt, E && (_[v] |= (C[v + 1] | C[v]) << 1 | 1 | C[v + 1]), _[v] & j && (x = R(t, {
|
|
349
|
+
errors: E,
|
|
350
|
+
currentLocation: N,
|
|
352
351
|
expectedLocation: d,
|
|
353
|
-
distance:
|
|
354
|
-
ignoreLocation:
|
|
355
|
-
}),
|
|
356
|
-
if (
|
|
352
|
+
distance: o,
|
|
353
|
+
ignoreLocation: l
|
|
354
|
+
}), x <= p)) {
|
|
355
|
+
if (p = x, g = N, g <= d)
|
|
357
356
|
break;
|
|
358
|
-
Z = Math.max(1, 2 * d -
|
|
357
|
+
Z = Math.max(1, 2 * d - g);
|
|
359
358
|
}
|
|
360
359
|
}
|
|
361
|
-
if (
|
|
362
|
-
errors:
|
|
360
|
+
if (R(t, {
|
|
361
|
+
errors: E + 1,
|
|
363
362
|
currentLocation: d,
|
|
364
363
|
expectedLocation: d,
|
|
365
|
-
distance:
|
|
366
|
-
ignoreLocation:
|
|
367
|
-
}) >
|
|
364
|
+
distance: o,
|
|
365
|
+
ignoreLocation: l
|
|
366
|
+
}) > p)
|
|
368
367
|
break;
|
|
369
|
-
|
|
368
|
+
C = _;
|
|
370
369
|
}
|
|
371
|
-
const
|
|
372
|
-
isMatch:
|
|
370
|
+
const W = {
|
|
371
|
+
isMatch: g >= 0,
|
|
373
372
|
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
374
|
-
score: Math.max(1e-3,
|
|
373
|
+
score: Math.max(1e-3, x)
|
|
375
374
|
};
|
|
376
|
-
if (
|
|
377
|
-
const
|
|
378
|
-
|
|
375
|
+
if (m) {
|
|
376
|
+
const E = Gt(A, c);
|
|
377
|
+
E.length ? a && (W.indices = E) : W.isMatch = !1;
|
|
379
378
|
}
|
|
380
|
-
return
|
|
379
|
+
return W;
|
|
381
380
|
}
|
|
382
|
-
function
|
|
383
|
-
let
|
|
384
|
-
for (let
|
|
385
|
-
const
|
|
386
|
-
|
|
381
|
+
function Ut(s) {
|
|
382
|
+
let t = {};
|
|
383
|
+
for (let e = 0, i = s.length; e < i; e += 1) {
|
|
384
|
+
const o = s.charAt(e);
|
|
385
|
+
t[o] = (t[o] || 0) | 1 << i - e - 1;
|
|
387
386
|
}
|
|
388
|
-
return
|
|
387
|
+
return t;
|
|
389
388
|
}
|
|
390
|
-
const
|
|
391
|
-
class
|
|
392
|
-
constructor(
|
|
393
|
-
location:
|
|
394
|
-
threshold:
|
|
395
|
-
distance:
|
|
396
|
-
includeMatches:
|
|
397
|
-
findAllMatches:
|
|
398
|
-
minMatchCharLength:
|
|
399
|
-
isCaseSensitive:
|
|
400
|
-
ignoreDiacritics:
|
|
401
|
-
ignoreLocation:
|
|
389
|
+
const $ = String.prototype.normalize ? ((s) => s.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, "")) : ((s) => s);
|
|
390
|
+
class At {
|
|
391
|
+
constructor(t, {
|
|
392
|
+
location: e = f.location,
|
|
393
|
+
threshold: i = f.threshold,
|
|
394
|
+
distance: o = f.distance,
|
|
395
|
+
includeMatches: r = f.includeMatches,
|
|
396
|
+
findAllMatches: n = f.findAllMatches,
|
|
397
|
+
minMatchCharLength: c = f.minMatchCharLength,
|
|
398
|
+
isCaseSensitive: a = f.isCaseSensitive,
|
|
399
|
+
ignoreDiacritics: l = f.ignoreDiacritics,
|
|
400
|
+
ignoreLocation: u = f.ignoreLocation
|
|
402
401
|
} = {}) {
|
|
403
402
|
if (this.options = {
|
|
404
|
-
location:
|
|
405
|
-
threshold:
|
|
406
|
-
distance:
|
|
407
|
-
includeMatches:
|
|
408
|
-
findAllMatches:
|
|
409
|
-
minMatchCharLength:
|
|
410
|
-
isCaseSensitive:
|
|
411
|
-
ignoreDiacritics:
|
|
412
|
-
ignoreLocation:
|
|
413
|
-
},
|
|
403
|
+
location: e,
|
|
404
|
+
threshold: i,
|
|
405
|
+
distance: o,
|
|
406
|
+
includeMatches: r,
|
|
407
|
+
findAllMatches: n,
|
|
408
|
+
minMatchCharLength: c,
|
|
409
|
+
isCaseSensitive: a,
|
|
410
|
+
ignoreDiacritics: l,
|
|
411
|
+
ignoreLocation: u
|
|
412
|
+
}, t = a ? t : t.toLowerCase(), t = l ? $(t) : t, this.pattern = t, this.chunks = [], !this.pattern.length)
|
|
414
413
|
return;
|
|
415
|
-
const
|
|
414
|
+
const h = (p, g) => {
|
|
416
415
|
this.chunks.push({
|
|
417
|
-
pattern:
|
|
418
|
-
alphabet:
|
|
419
|
-
startIndex:
|
|
416
|
+
pattern: p,
|
|
417
|
+
alphabet: Ut(p),
|
|
418
|
+
startIndex: g
|
|
420
419
|
});
|
|
421
420
|
}, d = this.pattern.length;
|
|
422
|
-
if (d >
|
|
423
|
-
let
|
|
424
|
-
const
|
|
425
|
-
for (;
|
|
426
|
-
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
|
|
421
|
+
if (d > k) {
|
|
422
|
+
let p = 0;
|
|
423
|
+
const g = d % k, m = d - g;
|
|
424
|
+
for (; p < m; )
|
|
425
|
+
h(this.pattern.substr(p, k), p), p += k;
|
|
426
|
+
if (g) {
|
|
427
|
+
const A = d - k;
|
|
428
|
+
h(this.pattern.substr(A), A);
|
|
430
429
|
}
|
|
431
430
|
} else
|
|
432
|
-
|
|
431
|
+
h(this.pattern, 0);
|
|
433
432
|
}
|
|
434
|
-
searchIn(
|
|
435
|
-
const { isCaseSensitive:
|
|
436
|
-
if (
|
|
437
|
-
let
|
|
433
|
+
searchIn(t) {
|
|
434
|
+
const { isCaseSensitive: e, ignoreDiacritics: i, includeMatches: o } = this.options;
|
|
435
|
+
if (t = e ? t : t.toLowerCase(), t = i ? $(t) : t, this.pattern === t) {
|
|
436
|
+
let m = {
|
|
438
437
|
isMatch: !0,
|
|
439
438
|
score: 0
|
|
440
439
|
};
|
|
441
|
-
return
|
|
440
|
+
return o && (m.indices = [[0, t.length - 1]]), m;
|
|
442
441
|
}
|
|
443
442
|
const {
|
|
444
|
-
location:
|
|
445
|
-
distance:
|
|
446
|
-
threshold:
|
|
447
|
-
findAllMatches:
|
|
448
|
-
minMatchCharLength:
|
|
449
|
-
ignoreLocation:
|
|
443
|
+
location: r,
|
|
444
|
+
distance: n,
|
|
445
|
+
threshold: c,
|
|
446
|
+
findAllMatches: a,
|
|
447
|
+
minMatchCharLength: l,
|
|
448
|
+
ignoreLocation: u
|
|
450
449
|
} = this.options;
|
|
451
|
-
let
|
|
452
|
-
this.chunks.forEach(({ pattern:
|
|
453
|
-
const { isMatch:
|
|
454
|
-
location:
|
|
455
|
-
distance:
|
|
456
|
-
threshold:
|
|
457
|
-
findAllMatches:
|
|
458
|
-
minMatchCharLength:
|
|
459
|
-
includeMatches:
|
|
460
|
-
ignoreLocation:
|
|
450
|
+
let h = [], d = 0, p = !1;
|
|
451
|
+
this.chunks.forEach(({ pattern: m, alphabet: A, startIndex: w }) => {
|
|
452
|
+
const { isMatch: C, score: x, indices: M } = Yt(t, m, A, {
|
|
453
|
+
location: r + w,
|
|
454
|
+
distance: n,
|
|
455
|
+
threshold: c,
|
|
456
|
+
findAllMatches: a,
|
|
457
|
+
minMatchCharLength: l,
|
|
458
|
+
includeMatches: o,
|
|
459
|
+
ignoreLocation: u
|
|
461
460
|
});
|
|
462
|
-
|
|
461
|
+
C && (p = !0), d += x, C && M && (h = [...h, ...M]);
|
|
463
462
|
});
|
|
464
|
-
let
|
|
465
|
-
isMatch:
|
|
466
|
-
score:
|
|
463
|
+
let g = {
|
|
464
|
+
isMatch: p,
|
|
465
|
+
score: p ? d / this.chunks.length : 1
|
|
467
466
|
};
|
|
468
|
-
return
|
|
467
|
+
return p && o && (g.indices = h), g;
|
|
469
468
|
}
|
|
470
469
|
}
|
|
471
|
-
class
|
|
472
|
-
constructor(
|
|
473
|
-
this.pattern =
|
|
470
|
+
class I {
|
|
471
|
+
constructor(t) {
|
|
472
|
+
this.pattern = t;
|
|
474
473
|
}
|
|
475
|
-
static isMultiMatch(
|
|
476
|
-
return
|
|
474
|
+
static isMultiMatch(t) {
|
|
475
|
+
return nt(t, this.multiRegex);
|
|
477
476
|
}
|
|
478
|
-
static isSingleMatch(
|
|
479
|
-
return
|
|
477
|
+
static isSingleMatch(t) {
|
|
478
|
+
return nt(t, this.singleRegex);
|
|
480
479
|
}
|
|
481
480
|
search() {
|
|
482
481
|
}
|
|
483
482
|
}
|
|
484
|
-
function
|
|
485
|
-
const
|
|
486
|
-
return
|
|
483
|
+
function nt(s, t) {
|
|
484
|
+
const e = s.match(t);
|
|
485
|
+
return e ? e[1] : null;
|
|
487
486
|
}
|
|
488
|
-
class
|
|
489
|
-
constructor(
|
|
490
|
-
super(
|
|
487
|
+
class Qt extends I {
|
|
488
|
+
constructor(t) {
|
|
489
|
+
super(t);
|
|
491
490
|
}
|
|
492
491
|
static get type() {
|
|
493
492
|
return "exact";
|
|
@@ -498,18 +497,18 @@ class ze extends S {
|
|
|
498
497
|
static get singleRegex() {
|
|
499
498
|
return /^=(.*)$/;
|
|
500
499
|
}
|
|
501
|
-
search(
|
|
502
|
-
const
|
|
500
|
+
search(t) {
|
|
501
|
+
const e = t === this.pattern;
|
|
503
502
|
return {
|
|
504
|
-
isMatch:
|
|
505
|
-
score:
|
|
503
|
+
isMatch: e,
|
|
504
|
+
score: e ? 0 : 1,
|
|
506
505
|
indices: [0, this.pattern.length - 1]
|
|
507
506
|
};
|
|
508
507
|
}
|
|
509
508
|
}
|
|
510
|
-
class
|
|
511
|
-
constructor(
|
|
512
|
-
super(
|
|
509
|
+
class Jt extends I {
|
|
510
|
+
constructor(t) {
|
|
511
|
+
super(t);
|
|
513
512
|
}
|
|
514
513
|
static get type() {
|
|
515
514
|
return "inverse-exact";
|
|
@@ -520,18 +519,18 @@ class He extends S {
|
|
|
520
519
|
static get singleRegex() {
|
|
521
520
|
return /^!(.*)$/;
|
|
522
521
|
}
|
|
523
|
-
search(
|
|
524
|
-
const
|
|
522
|
+
search(t) {
|
|
523
|
+
const i = t.indexOf(this.pattern) === -1;
|
|
525
524
|
return {
|
|
526
|
-
isMatch:
|
|
527
|
-
score:
|
|
528
|
-
indices: [0,
|
|
525
|
+
isMatch: i,
|
|
526
|
+
score: i ? 0 : 1,
|
|
527
|
+
indices: [0, t.length - 1]
|
|
529
528
|
};
|
|
530
529
|
}
|
|
531
530
|
}
|
|
532
|
-
class
|
|
533
|
-
constructor(
|
|
534
|
-
super(
|
|
531
|
+
class Xt extends I {
|
|
532
|
+
constructor(t) {
|
|
533
|
+
super(t);
|
|
535
534
|
}
|
|
536
535
|
static get type() {
|
|
537
536
|
return "prefix-exact";
|
|
@@ -542,18 +541,18 @@ class Ge extends S {
|
|
|
542
541
|
static get singleRegex() {
|
|
543
542
|
return /^\^(.*)$/;
|
|
544
543
|
}
|
|
545
|
-
search(
|
|
546
|
-
const
|
|
544
|
+
search(t) {
|
|
545
|
+
const e = t.startsWith(this.pattern);
|
|
547
546
|
return {
|
|
548
|
-
isMatch:
|
|
549
|
-
score:
|
|
547
|
+
isMatch: e,
|
|
548
|
+
score: e ? 0 : 1,
|
|
550
549
|
indices: [0, this.pattern.length - 1]
|
|
551
550
|
};
|
|
552
551
|
}
|
|
553
552
|
}
|
|
554
|
-
class
|
|
555
|
-
constructor(
|
|
556
|
-
super(
|
|
553
|
+
class qt extends I {
|
|
554
|
+
constructor(t) {
|
|
555
|
+
super(t);
|
|
557
556
|
}
|
|
558
557
|
static get type() {
|
|
559
558
|
return "inverse-prefix-exact";
|
|
@@ -564,18 +563,18 @@ class Ve extends S {
|
|
|
564
563
|
static get singleRegex() {
|
|
565
564
|
return /^!\^(.*)$/;
|
|
566
565
|
}
|
|
567
|
-
search(
|
|
568
|
-
const
|
|
566
|
+
search(t) {
|
|
567
|
+
const e = !t.startsWith(this.pattern);
|
|
569
568
|
return {
|
|
570
|
-
isMatch:
|
|
571
|
-
score:
|
|
572
|
-
indices: [0,
|
|
569
|
+
isMatch: e,
|
|
570
|
+
score: e ? 0 : 1,
|
|
571
|
+
indices: [0, t.length - 1]
|
|
573
572
|
};
|
|
574
573
|
}
|
|
575
574
|
}
|
|
576
|
-
class
|
|
577
|
-
constructor(
|
|
578
|
-
super(
|
|
575
|
+
class Zt extends I {
|
|
576
|
+
constructor(t) {
|
|
577
|
+
super(t);
|
|
579
578
|
}
|
|
580
579
|
static get type() {
|
|
581
580
|
return "suffix-exact";
|
|
@@ -586,18 +585,18 @@ class Ye extends S {
|
|
|
586
585
|
static get singleRegex() {
|
|
587
586
|
return /^(.*)\$$/;
|
|
588
587
|
}
|
|
589
|
-
search(
|
|
590
|
-
const
|
|
588
|
+
search(t) {
|
|
589
|
+
const e = t.endsWith(this.pattern);
|
|
591
590
|
return {
|
|
592
|
-
isMatch:
|
|
593
|
-
score:
|
|
594
|
-
indices: [
|
|
591
|
+
isMatch: e,
|
|
592
|
+
score: e ? 0 : 1,
|
|
593
|
+
indices: [t.length - this.pattern.length, t.length - 1]
|
|
595
594
|
};
|
|
596
595
|
}
|
|
597
596
|
}
|
|
598
|
-
class
|
|
599
|
-
constructor(
|
|
600
|
-
super(
|
|
597
|
+
class te extends I {
|
|
598
|
+
constructor(t) {
|
|
599
|
+
super(t);
|
|
601
600
|
}
|
|
602
601
|
static get type() {
|
|
603
602
|
return "inverse-suffix-exact";
|
|
@@ -608,37 +607,37 @@ class Qe extends S {
|
|
|
608
607
|
static get singleRegex() {
|
|
609
608
|
return /^!(.*)\$$/;
|
|
610
609
|
}
|
|
611
|
-
search(
|
|
612
|
-
const
|
|
610
|
+
search(t) {
|
|
611
|
+
const e = !t.endsWith(this.pattern);
|
|
613
612
|
return {
|
|
614
|
-
isMatch:
|
|
615
|
-
score:
|
|
616
|
-
indices: [0,
|
|
613
|
+
isMatch: e,
|
|
614
|
+
score: e ? 0 : 1,
|
|
615
|
+
indices: [0, t.length - 1]
|
|
617
616
|
};
|
|
618
617
|
}
|
|
619
618
|
}
|
|
620
|
-
class
|
|
621
|
-
constructor(
|
|
622
|
-
location:
|
|
623
|
-
threshold:
|
|
624
|
-
distance:
|
|
625
|
-
includeMatches:
|
|
626
|
-
findAllMatches:
|
|
627
|
-
minMatchCharLength:
|
|
628
|
-
isCaseSensitive:
|
|
629
|
-
ignoreDiacritics:
|
|
630
|
-
ignoreLocation:
|
|
619
|
+
class Ct extends I {
|
|
620
|
+
constructor(t, {
|
|
621
|
+
location: e = f.location,
|
|
622
|
+
threshold: i = f.threshold,
|
|
623
|
+
distance: o = f.distance,
|
|
624
|
+
includeMatches: r = f.includeMatches,
|
|
625
|
+
findAllMatches: n = f.findAllMatches,
|
|
626
|
+
minMatchCharLength: c = f.minMatchCharLength,
|
|
627
|
+
isCaseSensitive: a = f.isCaseSensitive,
|
|
628
|
+
ignoreDiacritics: l = f.ignoreDiacritics,
|
|
629
|
+
ignoreLocation: u = f.ignoreLocation
|
|
631
630
|
} = {}) {
|
|
632
|
-
super(
|
|
633
|
-
location:
|
|
634
|
-
threshold:
|
|
635
|
-
distance:
|
|
636
|
-
includeMatches:
|
|
637
|
-
findAllMatches:
|
|
638
|
-
minMatchCharLength:
|
|
639
|
-
isCaseSensitive:
|
|
640
|
-
ignoreDiacritics:
|
|
641
|
-
ignoreLocation:
|
|
631
|
+
super(t), this._bitapSearch = new At(t, {
|
|
632
|
+
location: e,
|
|
633
|
+
threshold: i,
|
|
634
|
+
distance: o,
|
|
635
|
+
includeMatches: r,
|
|
636
|
+
findAllMatches: n,
|
|
637
|
+
minMatchCharLength: c,
|
|
638
|
+
isCaseSensitive: a,
|
|
639
|
+
ignoreDiacritics: l,
|
|
640
|
+
ignoreLocation: u
|
|
642
641
|
});
|
|
643
642
|
}
|
|
644
643
|
static get type() {
|
|
@@ -650,13 +649,13 @@ class fe extends S {
|
|
|
650
649
|
static get singleRegex() {
|
|
651
650
|
return /^(.*)$/;
|
|
652
651
|
}
|
|
653
|
-
search(
|
|
654
|
-
return this._bitapSearch.searchIn(
|
|
652
|
+
search(t) {
|
|
653
|
+
return this._bitapSearch.searchIn(t);
|
|
655
654
|
}
|
|
656
655
|
}
|
|
657
|
-
class
|
|
658
|
-
constructor(
|
|
659
|
-
super(
|
|
656
|
+
class yt extends I {
|
|
657
|
+
constructor(t) {
|
|
658
|
+
super(t);
|
|
660
659
|
}
|
|
661
660
|
static get type() {
|
|
662
661
|
return "include";
|
|
@@ -667,112 +666,112 @@ class de extends S {
|
|
|
667
666
|
static get singleRegex() {
|
|
668
667
|
return /^'(.*)$/;
|
|
669
668
|
}
|
|
670
|
-
search(
|
|
671
|
-
let
|
|
672
|
-
const
|
|
673
|
-
for (; (
|
|
674
|
-
|
|
675
|
-
const
|
|
669
|
+
search(t) {
|
|
670
|
+
let e = 0, i;
|
|
671
|
+
const o = [], r = this.pattern.length;
|
|
672
|
+
for (; (i = t.indexOf(this.pattern, e)) > -1; )
|
|
673
|
+
e = i + r, o.push([i, e - 1]);
|
|
674
|
+
const n = !!o.length;
|
|
676
675
|
return {
|
|
677
|
-
isMatch:
|
|
678
|
-
score:
|
|
679
|
-
indices:
|
|
676
|
+
isMatch: n,
|
|
677
|
+
score: n ? 0 : 1,
|
|
678
|
+
indices: o
|
|
680
679
|
};
|
|
681
680
|
}
|
|
682
681
|
}
|
|
683
682
|
const G = [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
],
|
|
693
|
-
function
|
|
694
|
-
return
|
|
695
|
-
let
|
|
696
|
-
for (let
|
|
697
|
-
const
|
|
698
|
-
let
|
|
699
|
-
for (; !
|
|
700
|
-
const
|
|
701
|
-
let
|
|
702
|
-
|
|
683
|
+
Qt,
|
|
684
|
+
yt,
|
|
685
|
+
Xt,
|
|
686
|
+
qt,
|
|
687
|
+
te,
|
|
688
|
+
Zt,
|
|
689
|
+
Jt,
|
|
690
|
+
Ct
|
|
691
|
+
], it = G.length, ee = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, se = "|";
|
|
692
|
+
function ne(s, t = {}) {
|
|
693
|
+
return s.split(se).map((e) => {
|
|
694
|
+
let i = e.trim().split(ee).filter((r) => r && !!r.trim()), o = [];
|
|
695
|
+
for (let r = 0, n = i.length; r < n; r += 1) {
|
|
696
|
+
const c = i[r];
|
|
697
|
+
let a = !1, l = -1;
|
|
698
|
+
for (; !a && ++l < it; ) {
|
|
699
|
+
const u = G[l];
|
|
700
|
+
let h = u.isMultiMatch(c);
|
|
701
|
+
h && (o.push(new u(h, t)), a = !0);
|
|
703
702
|
}
|
|
704
|
-
if (!
|
|
705
|
-
for (
|
|
706
|
-
const
|
|
707
|
-
let
|
|
708
|
-
if (
|
|
709
|
-
|
|
703
|
+
if (!a)
|
|
704
|
+
for (l = -1; ++l < it; ) {
|
|
705
|
+
const u = G[l];
|
|
706
|
+
let h = u.isSingleMatch(c);
|
|
707
|
+
if (h) {
|
|
708
|
+
o.push(new u(h, t));
|
|
710
709
|
break;
|
|
711
710
|
}
|
|
712
711
|
}
|
|
713
712
|
}
|
|
714
|
-
return
|
|
713
|
+
return o;
|
|
715
714
|
});
|
|
716
715
|
}
|
|
717
|
-
const
|
|
718
|
-
class
|
|
719
|
-
constructor(
|
|
720
|
-
isCaseSensitive:
|
|
721
|
-
ignoreDiacritics:
|
|
722
|
-
includeMatches:
|
|
723
|
-
minMatchCharLength:
|
|
724
|
-
ignoreLocation:
|
|
725
|
-
findAllMatches:
|
|
726
|
-
location:
|
|
727
|
-
threshold:
|
|
728
|
-
distance:
|
|
716
|
+
const ie = /* @__PURE__ */ new Set([Ct.type, yt.type]);
|
|
717
|
+
class oe {
|
|
718
|
+
constructor(t, {
|
|
719
|
+
isCaseSensitive: e = f.isCaseSensitive,
|
|
720
|
+
ignoreDiacritics: i = f.ignoreDiacritics,
|
|
721
|
+
includeMatches: o = f.includeMatches,
|
|
722
|
+
minMatchCharLength: r = f.minMatchCharLength,
|
|
723
|
+
ignoreLocation: n = f.ignoreLocation,
|
|
724
|
+
findAllMatches: c = f.findAllMatches,
|
|
725
|
+
location: a = f.location,
|
|
726
|
+
threshold: l = f.threshold,
|
|
727
|
+
distance: u = f.distance
|
|
729
728
|
} = {}) {
|
|
730
729
|
this.query = null, this.options = {
|
|
731
|
-
isCaseSensitive:
|
|
732
|
-
ignoreDiacritics:
|
|
733
|
-
includeMatches:
|
|
734
|
-
minMatchCharLength:
|
|
735
|
-
findAllMatches:
|
|
736
|
-
ignoreLocation:
|
|
737
|
-
location:
|
|
738
|
-
threshold:
|
|
739
|
-
distance:
|
|
740
|
-
},
|
|
741
|
-
}
|
|
742
|
-
static condition(
|
|
743
|
-
return
|
|
744
|
-
}
|
|
745
|
-
searchIn(
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
730
|
+
isCaseSensitive: e,
|
|
731
|
+
ignoreDiacritics: i,
|
|
732
|
+
includeMatches: o,
|
|
733
|
+
minMatchCharLength: r,
|
|
734
|
+
findAllMatches: c,
|
|
735
|
+
ignoreLocation: n,
|
|
736
|
+
location: a,
|
|
737
|
+
threshold: l,
|
|
738
|
+
distance: u
|
|
739
|
+
}, t = e ? t : t.toLowerCase(), t = i ? $(t) : t, this.pattern = t, this.query = ne(this.pattern, this.options);
|
|
740
|
+
}
|
|
741
|
+
static condition(t, e) {
|
|
742
|
+
return e.useExtendedSearch;
|
|
743
|
+
}
|
|
744
|
+
searchIn(t) {
|
|
745
|
+
const e = this.query;
|
|
746
|
+
if (!e)
|
|
748
747
|
return {
|
|
749
748
|
isMatch: !1,
|
|
750
749
|
score: 1
|
|
751
750
|
};
|
|
752
|
-
const { includeMatches:
|
|
753
|
-
|
|
754
|
-
let
|
|
755
|
-
for (let
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
for (let d = 0,
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
if (
|
|
762
|
-
const
|
|
763
|
-
|
|
751
|
+
const { includeMatches: i, isCaseSensitive: o, ignoreDiacritics: r } = this.options;
|
|
752
|
+
t = o ? t : t.toLowerCase(), t = r ? $(t) : t;
|
|
753
|
+
let n = 0, c = [], a = 0;
|
|
754
|
+
for (let l = 0, u = e.length; l < u; l += 1) {
|
|
755
|
+
const h = e[l];
|
|
756
|
+
c.length = 0, n = 0;
|
|
757
|
+
for (let d = 0, p = h.length; d < p; d += 1) {
|
|
758
|
+
const g = h[d], { isMatch: m, indices: A, score: w } = g.search(t);
|
|
759
|
+
if (m) {
|
|
760
|
+
if (n += 1, a += w, i) {
|
|
761
|
+
const C = g.constructor.type;
|
|
762
|
+
ie.has(C) ? c = [...c, ...A] : c.push(A);
|
|
764
763
|
}
|
|
765
764
|
} else {
|
|
766
|
-
|
|
765
|
+
a = 0, n = 0, c.length = 0;
|
|
767
766
|
break;
|
|
768
767
|
}
|
|
769
768
|
}
|
|
770
|
-
if (
|
|
769
|
+
if (n) {
|
|
771
770
|
let d = {
|
|
772
771
|
isMatch: !0,
|
|
773
|
-
score:
|
|
772
|
+
score: a / n
|
|
774
773
|
};
|
|
775
|
-
return
|
|
774
|
+
return i && (d.indices = c), d;
|
|
776
775
|
}
|
|
777
776
|
}
|
|
778
777
|
return {
|
|
@@ -781,17 +780,17 @@ class qe {
|
|
|
781
780
|
};
|
|
782
781
|
}
|
|
783
782
|
}
|
|
784
|
-
const
|
|
785
|
-
function
|
|
786
|
-
|
|
783
|
+
const Y = [];
|
|
784
|
+
function re(...s) {
|
|
785
|
+
Y.push(...s);
|
|
787
786
|
}
|
|
788
|
-
function
|
|
789
|
-
for (let
|
|
790
|
-
let
|
|
791
|
-
if (
|
|
792
|
-
return new
|
|
787
|
+
function U(s, t) {
|
|
788
|
+
for (let e = 0, i = Y.length; e < i; e += 1) {
|
|
789
|
+
let o = Y[e];
|
|
790
|
+
if (o.condition(s, t))
|
|
791
|
+
return new o(s, t);
|
|
793
792
|
}
|
|
794
|
-
return new
|
|
793
|
+
return new At(s, t);
|
|
795
794
|
}
|
|
796
795
|
const P = {
|
|
797
796
|
AND: "$and",
|
|
@@ -799,227 +798,227 @@ const P = {
|
|
|
799
798
|
}, Q = {
|
|
800
799
|
PATH: "$path",
|
|
801
800
|
PATTERN: "$val"
|
|
802
|
-
},
|
|
803
|
-
[P.AND]: Object.keys(
|
|
804
|
-
[
|
|
801
|
+
}, J = (s) => !!(s[P.AND] || s[P.OR]), ce = (s) => !!s[Q.PATH], ue = (s) => !F(s) && dt(s) && !J(s), ot = (s) => ({
|
|
802
|
+
[P.AND]: Object.keys(s).map((t) => ({
|
|
803
|
+
[t]: s[t]
|
|
805
804
|
}))
|
|
806
805
|
});
|
|
807
|
-
function
|
|
808
|
-
const
|
|
809
|
-
let
|
|
810
|
-
const
|
|
811
|
-
if (!
|
|
812
|
-
return
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
if (!
|
|
816
|
-
throw new Error(
|
|
817
|
-
const
|
|
818
|
-
keyId:
|
|
819
|
-
pattern:
|
|
806
|
+
function Et(s, t, { auto: e = !0 } = {}) {
|
|
807
|
+
const i = (o) => {
|
|
808
|
+
let r = Object.keys(o);
|
|
809
|
+
const n = ce(o);
|
|
810
|
+
if (!n && r.length > 1 && !J(o))
|
|
811
|
+
return i(ot(o));
|
|
812
|
+
if (ue(o)) {
|
|
813
|
+
const a = n ? o[Q.PATH] : r[0], l = n ? o[Q.PATTERN] : o[a];
|
|
814
|
+
if (!b(l))
|
|
815
|
+
throw new Error(Lt(a));
|
|
816
|
+
const u = {
|
|
817
|
+
keyId: V(a),
|
|
818
|
+
pattern: l
|
|
820
819
|
};
|
|
821
|
-
return
|
|
820
|
+
return e && (u.searcher = U(l, t)), u;
|
|
822
821
|
}
|
|
823
|
-
let
|
|
822
|
+
let c = {
|
|
824
823
|
children: [],
|
|
825
|
-
operator:
|
|
824
|
+
operator: r[0]
|
|
826
825
|
};
|
|
827
|
-
return
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
|
|
826
|
+
return r.forEach((a) => {
|
|
827
|
+
const l = o[a];
|
|
828
|
+
F(l) && l.forEach((u) => {
|
|
829
|
+
c.children.push(i(u));
|
|
831
830
|
});
|
|
832
|
-
}),
|
|
831
|
+
}), c;
|
|
833
832
|
};
|
|
834
|
-
return
|
|
833
|
+
return J(s) || (s = ot(s)), i(s);
|
|
835
834
|
}
|
|
836
|
-
function
|
|
837
|
-
|
|
838
|
-
let
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
(
|
|
835
|
+
function ae(s, { ignoreFieldNorm: t = f.ignoreFieldNorm }) {
|
|
836
|
+
s.forEach((e) => {
|
|
837
|
+
let i = 1;
|
|
838
|
+
e.matches.forEach(({ key: o, norm: r, score: n }) => {
|
|
839
|
+
const c = o ? o.weight : null;
|
|
840
|
+
i *= Math.pow(
|
|
841
|
+
n === 0 && c ? Number.EPSILON : n,
|
|
842
|
+
(c || 1) * (t ? 1 : r)
|
|
844
843
|
);
|
|
845
|
-
}),
|
|
844
|
+
}), e.score = i;
|
|
846
845
|
});
|
|
847
846
|
}
|
|
848
|
-
function
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
if (!
|
|
847
|
+
function le(s, t) {
|
|
848
|
+
const e = s.matches;
|
|
849
|
+
t.matches = [], y(e) && e.forEach((i) => {
|
|
850
|
+
if (!y(i.indices) || !i.indices.length)
|
|
852
851
|
return;
|
|
853
|
-
const { indices:
|
|
854
|
-
let
|
|
855
|
-
indices:
|
|
856
|
-
value:
|
|
852
|
+
const { indices: o, value: r } = i;
|
|
853
|
+
let n = {
|
|
854
|
+
indices: o,
|
|
855
|
+
value: r
|
|
857
856
|
};
|
|
858
|
-
|
|
857
|
+
i.key && (n.key = i.key.src), i.idx > -1 && (n.refIndex = i.idx), t.matches.push(n);
|
|
859
858
|
});
|
|
860
859
|
}
|
|
861
|
-
function
|
|
862
|
-
|
|
860
|
+
function he(s, t) {
|
|
861
|
+
t.score = s.score;
|
|
863
862
|
}
|
|
864
|
-
function
|
|
865
|
-
includeMatches:
|
|
866
|
-
includeScore:
|
|
863
|
+
function fe(s, t, {
|
|
864
|
+
includeMatches: e = f.includeMatches,
|
|
865
|
+
includeScore: i = f.includeScore
|
|
867
866
|
} = {}) {
|
|
868
|
-
const
|
|
869
|
-
return
|
|
870
|
-
const { idx:
|
|
871
|
-
item:
|
|
872
|
-
refIndex:
|
|
867
|
+
const o = [];
|
|
868
|
+
return e && o.push(le), i && o.push(he), s.map((r) => {
|
|
869
|
+
const { idx: n } = r, c = {
|
|
870
|
+
item: t[n],
|
|
871
|
+
refIndex: n
|
|
873
872
|
};
|
|
874
|
-
return
|
|
875
|
-
|
|
876
|
-
}),
|
|
873
|
+
return o.length && o.forEach((a) => {
|
|
874
|
+
a(r, c);
|
|
875
|
+
}), c;
|
|
877
876
|
});
|
|
878
877
|
}
|
|
879
|
-
class
|
|
880
|
-
constructor(
|
|
881
|
-
this.options = { ...f, ...
|
|
882
|
-
}
|
|
883
|
-
setCollection(
|
|
884
|
-
if (this._docs =
|
|
885
|
-
throw new Error(
|
|
886
|
-
this._myIndex =
|
|
878
|
+
class S {
|
|
879
|
+
constructor(t, e = {}, i) {
|
|
880
|
+
this.options = { ...f, ...e }, this.options.useExtendedSearch, this._keyStore = new Tt(this.options.keys), this.setCollection(t, i);
|
|
881
|
+
}
|
|
882
|
+
setCollection(t, e) {
|
|
883
|
+
if (this._docs = t, e && !(e instanceof q))
|
|
884
|
+
throw new Error(St);
|
|
885
|
+
this._myIndex = e || mt(this.options.keys, this._docs, {
|
|
887
886
|
getFn: this.options.getFn,
|
|
888
887
|
fieldNormWeight: this.options.fieldNormWeight
|
|
889
888
|
});
|
|
890
889
|
}
|
|
891
|
-
add(
|
|
892
|
-
|
|
890
|
+
add(t) {
|
|
891
|
+
y(t) && (this._docs.push(t), this._myIndex.add(t));
|
|
893
892
|
}
|
|
894
|
-
remove(
|
|
895
|
-
const
|
|
896
|
-
for (let
|
|
897
|
-
const
|
|
898
|
-
|
|
893
|
+
remove(t = () => !1) {
|
|
894
|
+
const e = [];
|
|
895
|
+
for (let i = 0, o = this._docs.length; i < o; i += 1) {
|
|
896
|
+
const r = this._docs[i];
|
|
897
|
+
t(r, i) && (this.removeAt(i), i -= 1, o -= 1, e.push(r));
|
|
899
898
|
}
|
|
900
|
-
return
|
|
899
|
+
return e;
|
|
901
900
|
}
|
|
902
|
-
removeAt(
|
|
903
|
-
this._docs.splice(
|
|
901
|
+
removeAt(t) {
|
|
902
|
+
this._docs.splice(t, 1), this._myIndex.removeAt(t);
|
|
904
903
|
}
|
|
905
904
|
getIndex() {
|
|
906
905
|
return this._myIndex;
|
|
907
906
|
}
|
|
908
|
-
search(
|
|
907
|
+
search(t, { limit: e = -1 } = {}) {
|
|
909
908
|
const {
|
|
910
|
-
includeMatches:
|
|
911
|
-
includeScore:
|
|
912
|
-
shouldSort:
|
|
913
|
-
sortFn:
|
|
914
|
-
ignoreFieldNorm:
|
|
909
|
+
includeMatches: i,
|
|
910
|
+
includeScore: o,
|
|
911
|
+
shouldSort: r,
|
|
912
|
+
sortFn: n,
|
|
913
|
+
ignoreFieldNorm: c
|
|
915
914
|
} = this.options;
|
|
916
|
-
let
|
|
917
|
-
return
|
|
918
|
-
includeMatches:
|
|
919
|
-
includeScore:
|
|
915
|
+
let a = b(t) ? b(this._docs[0]) ? this._searchStringList(t) : this._searchObjectList(t) : this._searchLogical(t);
|
|
916
|
+
return ae(a, { ignoreFieldNorm: c }), r && a.sort(n), ft(e) && e > -1 && (a = a.slice(0, e)), fe(a, this._docs, {
|
|
917
|
+
includeMatches: i,
|
|
918
|
+
includeScore: o
|
|
920
919
|
});
|
|
921
920
|
}
|
|
922
|
-
_searchStringList(
|
|
923
|
-
const
|
|
924
|
-
return
|
|
925
|
-
if (!
|
|
921
|
+
_searchStringList(t) {
|
|
922
|
+
const e = U(t, this.options), { records: i } = this._myIndex, o = [];
|
|
923
|
+
return i.forEach(({ v: r, i: n, n: c }) => {
|
|
924
|
+
if (!y(r))
|
|
926
925
|
return;
|
|
927
|
-
const { isMatch:
|
|
928
|
-
|
|
929
|
-
item:
|
|
930
|
-
idx:
|
|
931
|
-
matches: [{ score:
|
|
926
|
+
const { isMatch: a, score: l, indices: u } = e.searchIn(r);
|
|
927
|
+
a && o.push({
|
|
928
|
+
item: r,
|
|
929
|
+
idx: n,
|
|
930
|
+
matches: [{ score: l, value: r, norm: c, indices: u }]
|
|
932
931
|
});
|
|
933
|
-
}),
|
|
934
|
-
}
|
|
935
|
-
_searchLogical(
|
|
936
|
-
const
|
|
937
|
-
if (!
|
|
938
|
-
const { keyId:
|
|
939
|
-
key: this._keyStore.get(
|
|
940
|
-
value: this._myIndex.getValueForItemAtKeyId(
|
|
932
|
+
}), o;
|
|
933
|
+
}
|
|
934
|
+
_searchLogical(t) {
|
|
935
|
+
const e = Et(t, this.options), i = (c, a, l) => {
|
|
936
|
+
if (!c.children) {
|
|
937
|
+
const { keyId: h, searcher: d } = c, p = this._findMatches({
|
|
938
|
+
key: this._keyStore.get(h),
|
|
939
|
+
value: this._myIndex.getValueForItemAtKeyId(a, h),
|
|
941
940
|
searcher: d
|
|
942
941
|
});
|
|
943
|
-
return
|
|
942
|
+
return p && p.length ? [
|
|
944
943
|
{
|
|
945
|
-
idx:
|
|
946
|
-
item:
|
|
947
|
-
matches:
|
|
944
|
+
idx: l,
|
|
945
|
+
item: a,
|
|
946
|
+
matches: p
|
|
948
947
|
}
|
|
949
948
|
] : [];
|
|
950
949
|
}
|
|
951
|
-
const
|
|
952
|
-
for (let
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
955
|
-
|
|
956
|
-
else if (
|
|
950
|
+
const u = [];
|
|
951
|
+
for (let h = 0, d = c.children.length; h < d; h += 1) {
|
|
952
|
+
const p = c.children[h], g = i(p, a, l);
|
|
953
|
+
if (g.length)
|
|
954
|
+
u.push(...g);
|
|
955
|
+
else if (c.operator === P.AND)
|
|
957
956
|
return [];
|
|
958
957
|
}
|
|
959
|
-
return
|
|
960
|
-
},
|
|
961
|
-
return
|
|
962
|
-
if (
|
|
963
|
-
let
|
|
964
|
-
|
|
965
|
-
|
|
958
|
+
return u;
|
|
959
|
+
}, o = this._myIndex.records, r = {}, n = [];
|
|
960
|
+
return o.forEach(({ $: c, i: a }) => {
|
|
961
|
+
if (y(c)) {
|
|
962
|
+
let l = i(e, c, a);
|
|
963
|
+
l.length && (r[a] || (r[a] = { idx: a, item: c, matches: [] }, n.push(r[a])), l.forEach(({ matches: u }) => {
|
|
964
|
+
r[a].matches.push(...u);
|
|
966
965
|
}));
|
|
967
966
|
}
|
|
968
|
-
}),
|
|
967
|
+
}), n;
|
|
969
968
|
}
|
|
970
|
-
_searchObjectList(
|
|
971
|
-
const
|
|
972
|
-
return
|
|
973
|
-
if (!
|
|
969
|
+
_searchObjectList(t) {
|
|
970
|
+
const e = U(t, this.options), { keys: i, records: o } = this._myIndex, r = [];
|
|
971
|
+
return o.forEach(({ $: n, i: c }) => {
|
|
972
|
+
if (!y(n))
|
|
974
973
|
return;
|
|
975
|
-
let
|
|
976
|
-
|
|
977
|
-
|
|
974
|
+
let a = [];
|
|
975
|
+
i.forEach((l, u) => {
|
|
976
|
+
a.push(
|
|
978
977
|
...this._findMatches({
|
|
979
|
-
key:
|
|
980
|
-
value:
|
|
981
|
-
searcher:
|
|
978
|
+
key: l,
|
|
979
|
+
value: n[u],
|
|
980
|
+
searcher: e
|
|
982
981
|
})
|
|
983
982
|
);
|
|
984
|
-
}),
|
|
985
|
-
idx:
|
|
986
|
-
item:
|
|
987
|
-
matches:
|
|
983
|
+
}), a.length && r.push({
|
|
984
|
+
idx: c,
|
|
985
|
+
item: n,
|
|
986
|
+
matches: a
|
|
988
987
|
});
|
|
989
|
-
}),
|
|
988
|
+
}), r;
|
|
990
989
|
}
|
|
991
|
-
_findMatches({ key:
|
|
992
|
-
if (!
|
|
990
|
+
_findMatches({ key: t, value: e, searcher: i }) {
|
|
991
|
+
if (!y(e))
|
|
993
992
|
return [];
|
|
994
|
-
let
|
|
995
|
-
if (
|
|
996
|
-
|
|
997
|
-
if (!
|
|
993
|
+
let o = [];
|
|
994
|
+
if (F(e))
|
|
995
|
+
e.forEach(({ v: r, i: n, n: c }) => {
|
|
996
|
+
if (!y(r))
|
|
998
997
|
return;
|
|
999
|
-
const { isMatch:
|
|
1000
|
-
|
|
1001
|
-
score:
|
|
1002
|
-
key:
|
|
1003
|
-
value:
|
|
1004
|
-
idx:
|
|
1005
|
-
norm:
|
|
1006
|
-
indices:
|
|
998
|
+
const { isMatch: a, score: l, indices: u } = i.searchIn(r);
|
|
999
|
+
a && o.push({
|
|
1000
|
+
score: l,
|
|
1001
|
+
key: t,
|
|
1002
|
+
value: r,
|
|
1003
|
+
idx: n,
|
|
1004
|
+
norm: c,
|
|
1005
|
+
indices: u
|
|
1007
1006
|
});
|
|
1008
1007
|
});
|
|
1009
1008
|
else {
|
|
1010
|
-
const { v:
|
|
1011
|
-
|
|
1009
|
+
const { v: r, n } = e, { isMatch: c, score: a, indices: l } = i.searchIn(r);
|
|
1010
|
+
c && o.push({ score: a, key: t, value: r, norm: n, indices: l });
|
|
1012
1011
|
}
|
|
1013
|
-
return
|
|
1012
|
+
return o;
|
|
1014
1013
|
}
|
|
1015
1014
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
const
|
|
1015
|
+
S.version = "7.1.0";
|
|
1016
|
+
S.createIndex = mt;
|
|
1017
|
+
S.parseIndex = Vt;
|
|
1018
|
+
S.config = f;
|
|
1019
|
+
S.parseQuery = Et;
|
|
1020
|
+
re(oe);
|
|
1021
|
+
const de = /* @__PURE__ */ X({
|
|
1023
1022
|
name: "RenderIconClass",
|
|
1024
1023
|
props: {
|
|
1025
1024
|
iconClass: {
|
|
@@ -1031,71 +1030,268 @@ const ut = /* @__PURE__ */ J({
|
|
|
1031
1030
|
default: () => []
|
|
1032
1031
|
}
|
|
1033
1032
|
},
|
|
1034
|
-
setup(
|
|
1035
|
-
const
|
|
1033
|
+
setup(s) {
|
|
1034
|
+
const t = () => {
|
|
1036
1035
|
const {
|
|
1037
|
-
iconClass:
|
|
1038
|
-
highlightChunks:
|
|
1039
|
-
} =
|
|
1040
|
-
if (!
|
|
1041
|
-
return
|
|
1042
|
-
const
|
|
1043
|
-
let
|
|
1044
|
-
for (const [
|
|
1045
|
-
|
|
1036
|
+
iconClass: e,
|
|
1037
|
+
highlightChunks: i
|
|
1038
|
+
} = s;
|
|
1039
|
+
if (!e || i.length === 0)
|
|
1040
|
+
return e;
|
|
1041
|
+
const o = [];
|
|
1042
|
+
let r = 0;
|
|
1043
|
+
for (const [n, c] of i)
|
|
1044
|
+
n > r && o.push(e.slice(r, n)), o.push(L("span", {
|
|
1046
1045
|
class: "highlight"
|
|
1047
|
-
}, [
|
|
1048
|
-
return
|
|
1046
|
+
}, [e.slice(n, c + 1)])), r = c + 1;
|
|
1047
|
+
return r < e.length && o.push(e.slice(r)), o;
|
|
1049
1048
|
};
|
|
1050
|
-
return () =>
|
|
1049
|
+
return () => L("span", {
|
|
1051
1050
|
class: "render-icon-class"
|
|
1052
|
-
}, [
|
|
1051
|
+
}, [t()]);
|
|
1053
1052
|
}
|
|
1054
1053
|
});
|
|
1055
|
-
function
|
|
1056
|
-
return
|
|
1054
|
+
function wt(s) {
|
|
1055
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
1057
1056
|
}
|
|
1058
1057
|
/*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1059
|
-
var
|
|
1060
|
-
function
|
|
1061
|
-
if (
|
|
1062
|
-
|
|
1063
|
-
function
|
|
1058
|
+
var K, rt;
|
|
1059
|
+
function pe() {
|
|
1060
|
+
if (rt) return K;
|
|
1061
|
+
rt = 1, K = i;
|
|
1062
|
+
function s() {
|
|
1064
1063
|
return new DOMException("The request is not allowed", "NotAllowedError");
|
|
1065
1064
|
}
|
|
1066
|
-
async function
|
|
1065
|
+
async function t(o) {
|
|
1067
1066
|
if (!navigator.clipboard)
|
|
1068
|
-
throw
|
|
1069
|
-
return navigator.clipboard.writeText(
|
|
1070
|
-
}
|
|
1071
|
-
async function
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
let
|
|
1067
|
+
throw s();
|
|
1068
|
+
return navigator.clipboard.writeText(o);
|
|
1069
|
+
}
|
|
1070
|
+
async function e(o) {
|
|
1071
|
+
const r = document.createElement("span");
|
|
1072
|
+
r.textContent = o, r.style.whiteSpace = "pre", r.style.webkitUserSelect = "auto", r.style.userSelect = "all", document.body.appendChild(r);
|
|
1073
|
+
const n = window.getSelection(), c = window.document.createRange();
|
|
1074
|
+
n.removeAllRanges(), c.selectNode(r), n.addRange(c);
|
|
1075
|
+
let a = !1;
|
|
1077
1076
|
try {
|
|
1078
|
-
|
|
1077
|
+
a = window.document.execCommand("copy");
|
|
1079
1078
|
} finally {
|
|
1080
|
-
|
|
1079
|
+
n.removeAllRanges(), window.document.body.removeChild(r);
|
|
1081
1080
|
}
|
|
1082
|
-
if (!
|
|
1081
|
+
if (!a) throw s();
|
|
1083
1082
|
}
|
|
1084
|
-
async function
|
|
1083
|
+
async function i(o) {
|
|
1085
1084
|
try {
|
|
1086
|
-
await
|
|
1087
|
-
} catch (
|
|
1085
|
+
await t(o);
|
|
1086
|
+
} catch (r) {
|
|
1088
1087
|
try {
|
|
1089
|
-
await
|
|
1090
|
-
} catch (
|
|
1091
|
-
throw
|
|
1088
|
+
await e(o);
|
|
1089
|
+
} catch (n) {
|
|
1090
|
+
throw n || r || s();
|
|
1092
1091
|
}
|
|
1093
1092
|
}
|
|
1094
1093
|
}
|
|
1095
|
-
return
|
|
1094
|
+
return K;
|
|
1096
1095
|
}
|
|
1097
|
-
var
|
|
1098
|
-
const
|
|
1096
|
+
var ge = pe();
|
|
1097
|
+
const me = /* @__PURE__ */ wt(ge);
|
|
1098
|
+
var T = { exports: {} };
|
|
1099
|
+
/*!
|
|
1100
|
+
* Toastify js 1.12.0
|
|
1101
|
+
* https://github.com/apvarun/toastify-js
|
|
1102
|
+
* @license MIT licensed
|
|
1103
|
+
*
|
|
1104
|
+
* Copyright (C) 2018 Varun A P
|
|
1105
|
+
*/
|
|
1106
|
+
var Ae = T.exports, ct;
|
|
1107
|
+
function Ce() {
|
|
1108
|
+
return ct || (ct = 1, (function(s) {
|
|
1109
|
+
(function(t, e) {
|
|
1110
|
+
s.exports ? s.exports = e() : t.Toastify = e();
|
|
1111
|
+
})(Ae, function(t) {
|
|
1112
|
+
var e = function(n) {
|
|
1113
|
+
return new e.lib.init(n);
|
|
1114
|
+
}, i = "1.12.0";
|
|
1115
|
+
e.defaults = {
|
|
1116
|
+
oldestFirst: !0,
|
|
1117
|
+
text: "Toastify is awesome!",
|
|
1118
|
+
node: void 0,
|
|
1119
|
+
duration: 3e3,
|
|
1120
|
+
selector: void 0,
|
|
1121
|
+
callback: function() {
|
|
1122
|
+
},
|
|
1123
|
+
destination: void 0,
|
|
1124
|
+
newWindow: !1,
|
|
1125
|
+
close: !1,
|
|
1126
|
+
gravity: "toastify-top",
|
|
1127
|
+
positionLeft: !1,
|
|
1128
|
+
position: "",
|
|
1129
|
+
backgroundColor: "",
|
|
1130
|
+
avatar: "",
|
|
1131
|
+
className: "",
|
|
1132
|
+
stopOnFocus: !0,
|
|
1133
|
+
onClick: function() {
|
|
1134
|
+
},
|
|
1135
|
+
offset: { x: 0, y: 0 },
|
|
1136
|
+
escapeMarkup: !0,
|
|
1137
|
+
ariaLive: "polite",
|
|
1138
|
+
style: { background: "" }
|
|
1139
|
+
}, e.lib = e.prototype = {
|
|
1140
|
+
toastify: i,
|
|
1141
|
+
constructor: e,
|
|
1142
|
+
// Initializing the object with required parameters
|
|
1143
|
+
init: function(n) {
|
|
1144
|
+
return n || (n = {}), this.options = {}, this.toastElement = null, this.options.text = n.text || e.defaults.text, this.options.node = n.node || e.defaults.node, this.options.duration = n.duration === 0 ? 0 : n.duration || e.defaults.duration, this.options.selector = n.selector || e.defaults.selector, this.options.callback = n.callback || e.defaults.callback, this.options.destination = n.destination || e.defaults.destination, this.options.newWindow = n.newWindow || e.defaults.newWindow, this.options.close = n.close || e.defaults.close, this.options.gravity = n.gravity === "bottom" ? "toastify-bottom" : e.defaults.gravity, this.options.positionLeft = n.positionLeft || e.defaults.positionLeft, this.options.position = n.position || e.defaults.position, this.options.backgroundColor = n.backgroundColor || e.defaults.backgroundColor, this.options.avatar = n.avatar || e.defaults.avatar, this.options.className = n.className || e.defaults.className, this.options.stopOnFocus = n.stopOnFocus === void 0 ? e.defaults.stopOnFocus : n.stopOnFocus, this.options.onClick = n.onClick || e.defaults.onClick, this.options.offset = n.offset || e.defaults.offset, this.options.escapeMarkup = n.escapeMarkup !== void 0 ? n.escapeMarkup : e.defaults.escapeMarkup, this.options.ariaLive = n.ariaLive || e.defaults.ariaLive, this.options.style = n.style || e.defaults.style, n.backgroundColor && (this.options.style.background = n.backgroundColor), this;
|
|
1145
|
+
},
|
|
1146
|
+
// Building the DOM element
|
|
1147
|
+
buildToast: function() {
|
|
1148
|
+
if (!this.options)
|
|
1149
|
+
throw "Toastify is not initialized";
|
|
1150
|
+
var n = document.createElement("div");
|
|
1151
|
+
n.className = "toastify on " + this.options.className, this.options.position ? n.className += " toastify-" + this.options.position : this.options.positionLeft === !0 ? (n.className += " toastify-left", console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")) : n.className += " toastify-right", n.className += " " + this.options.gravity, this.options.backgroundColor && console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
|
|
1152
|
+
for (var c in this.options.style)
|
|
1153
|
+
n.style[c] = this.options.style[c];
|
|
1154
|
+
if (this.options.ariaLive && n.setAttribute("aria-live", this.options.ariaLive), this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE)
|
|
1155
|
+
n.appendChild(this.options.node);
|
|
1156
|
+
else if (this.options.escapeMarkup ? n.innerText = this.options.text : n.innerHTML = this.options.text, this.options.avatar !== "") {
|
|
1157
|
+
var a = document.createElement("img");
|
|
1158
|
+
a.src = this.options.avatar, a.className = "toastify-avatar", this.options.position == "left" || this.options.positionLeft === !0 ? n.appendChild(a) : n.insertAdjacentElement("afterbegin", a);
|
|
1159
|
+
}
|
|
1160
|
+
if (this.options.close === !0) {
|
|
1161
|
+
var l = document.createElement("button");
|
|
1162
|
+
l.type = "button", l.setAttribute("aria-label", "Close"), l.className = "toast-close", l.innerHTML = "✖", l.addEventListener(
|
|
1163
|
+
"click",
|
|
1164
|
+
(function(A) {
|
|
1165
|
+
A.stopPropagation(), this.removeElement(this.toastElement), window.clearTimeout(this.toastElement.timeOutValue);
|
|
1166
|
+
}).bind(this)
|
|
1167
|
+
);
|
|
1168
|
+
var u = window.innerWidth > 0 ? window.innerWidth : screen.width;
|
|
1169
|
+
(this.options.position == "left" || this.options.positionLeft === !0) && u > 360 ? n.insertAdjacentElement("afterbegin", l) : n.appendChild(l);
|
|
1170
|
+
}
|
|
1171
|
+
if (this.options.stopOnFocus && this.options.duration > 0) {
|
|
1172
|
+
var h = this;
|
|
1173
|
+
n.addEventListener(
|
|
1174
|
+
"mouseover",
|
|
1175
|
+
function(A) {
|
|
1176
|
+
window.clearTimeout(n.timeOutValue);
|
|
1177
|
+
}
|
|
1178
|
+
), n.addEventListener(
|
|
1179
|
+
"mouseleave",
|
|
1180
|
+
function() {
|
|
1181
|
+
n.timeOutValue = window.setTimeout(
|
|
1182
|
+
function() {
|
|
1183
|
+
h.removeElement(n);
|
|
1184
|
+
},
|
|
1185
|
+
h.options.duration
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
);
|
|
1189
|
+
}
|
|
1190
|
+
if (typeof this.options.destination < "u" && n.addEventListener(
|
|
1191
|
+
"click",
|
|
1192
|
+
(function(A) {
|
|
1193
|
+
A.stopPropagation(), this.options.newWindow === !0 ? window.open(this.options.destination, "_blank") : window.location = this.options.destination;
|
|
1194
|
+
}).bind(this)
|
|
1195
|
+
), typeof this.options.onClick == "function" && typeof this.options.destination > "u" && n.addEventListener(
|
|
1196
|
+
"click",
|
|
1197
|
+
(function(A) {
|
|
1198
|
+
A.stopPropagation(), this.options.onClick();
|
|
1199
|
+
}).bind(this)
|
|
1200
|
+
), typeof this.options.offset == "object") {
|
|
1201
|
+
var d = o("x", this.options), p = o("y", this.options), g = this.options.position == "left" ? d : "-" + d, m = this.options.gravity == "toastify-top" ? p : "-" + p;
|
|
1202
|
+
n.style.transform = "translate(" + g + "," + m + ")";
|
|
1203
|
+
}
|
|
1204
|
+
return n;
|
|
1205
|
+
},
|
|
1206
|
+
// Displaying the toast
|
|
1207
|
+
showToast: function() {
|
|
1208
|
+
this.toastElement = this.buildToast();
|
|
1209
|
+
var n;
|
|
1210
|
+
if (typeof this.options.selector == "string" ? n = document.getElementById(this.options.selector) : this.options.selector instanceof HTMLElement || typeof ShadowRoot < "u" && this.options.selector instanceof ShadowRoot ? n = this.options.selector : n = document.body, !n)
|
|
1211
|
+
throw "Root element is not defined";
|
|
1212
|
+
var c = e.defaults.oldestFirst ? n.firstChild : n.lastChild;
|
|
1213
|
+
return n.insertBefore(this.toastElement, c), e.reposition(), this.options.duration > 0 && (this.toastElement.timeOutValue = window.setTimeout(
|
|
1214
|
+
(function() {
|
|
1215
|
+
this.removeElement(this.toastElement);
|
|
1216
|
+
}).bind(this),
|
|
1217
|
+
this.options.duration
|
|
1218
|
+
)), this;
|
|
1219
|
+
},
|
|
1220
|
+
hideToast: function() {
|
|
1221
|
+
this.toastElement.timeOutValue && clearTimeout(this.toastElement.timeOutValue), this.removeElement(this.toastElement);
|
|
1222
|
+
},
|
|
1223
|
+
// Removing the element from the DOM
|
|
1224
|
+
removeElement: function(n) {
|
|
1225
|
+
n.className = n.className.replace(" on", ""), window.setTimeout(
|
|
1226
|
+
(function() {
|
|
1227
|
+
this.options.node && this.options.node.parentNode && this.options.node.parentNode.removeChild(this.options.node), n.parentNode && n.parentNode.removeChild(n), this.options.callback.call(n), e.reposition();
|
|
1228
|
+
}).bind(this),
|
|
1229
|
+
400
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
}, e.reposition = function() {
|
|
1233
|
+
for (var n = {
|
|
1234
|
+
top: 15,
|
|
1235
|
+
bottom: 15
|
|
1236
|
+
}, c = {
|
|
1237
|
+
top: 15,
|
|
1238
|
+
bottom: 15
|
|
1239
|
+
}, a = {
|
|
1240
|
+
top: 15,
|
|
1241
|
+
bottom: 15
|
|
1242
|
+
}, l = document.getElementsByClassName("toastify"), u, h = 0; h < l.length; h++) {
|
|
1243
|
+
r(l[h], "toastify-top") === !0 ? u = "toastify-top" : u = "toastify-bottom";
|
|
1244
|
+
var d = l[h].offsetHeight;
|
|
1245
|
+
u = u.substr(9, u.length - 1);
|
|
1246
|
+
var p = 15, g = window.innerWidth > 0 ? window.innerWidth : screen.width;
|
|
1247
|
+
g <= 360 ? (l[h].style[u] = a[u] + "px", a[u] += d + p) : r(l[h], "toastify-left") === !0 ? (l[h].style[u] = n[u] + "px", n[u] += d + p) : (l[h].style[u] = c[u] + "px", c[u] += d + p);
|
|
1248
|
+
}
|
|
1249
|
+
return this;
|
|
1250
|
+
};
|
|
1251
|
+
function o(n, c) {
|
|
1252
|
+
return c.offset[n] ? isNaN(c.offset[n]) ? c.offset[n] : c.offset[n] + "px" : "0px";
|
|
1253
|
+
}
|
|
1254
|
+
function r(n, c) {
|
|
1255
|
+
return !n || typeof c != "string" ? !1 : !!(n.className && n.className.trim().split(/\s+/gi).indexOf(c) > -1);
|
|
1256
|
+
}
|
|
1257
|
+
return e.lib.init.prototype = e.lib, e;
|
|
1258
|
+
});
|
|
1259
|
+
})(T)), T.exports;
|
|
1260
|
+
}
|
|
1261
|
+
var ye = Ce();
|
|
1262
|
+
const ut = /* @__PURE__ */ wt(ye), at = {
|
|
1263
|
+
duration: 3e3,
|
|
1264
|
+
gravity: "top",
|
|
1265
|
+
position: "center",
|
|
1266
|
+
stopOnFocus: !0
|
|
1267
|
+
}, lt = {
|
|
1268
|
+
padding: "11px 15px",
|
|
1269
|
+
"box-shadow": "unset",
|
|
1270
|
+
"border-radius": "4px",
|
|
1271
|
+
"font-size": "14px"
|
|
1272
|
+
}, Ee = () => ({ success: (e) => {
|
|
1273
|
+
ut({
|
|
1274
|
+
...at,
|
|
1275
|
+
text: e,
|
|
1276
|
+
style: {
|
|
1277
|
+
...lt,
|
|
1278
|
+
background: "#f0f9eb",
|
|
1279
|
+
color: "#67c23a",
|
|
1280
|
+
border: "1px solid #e1f3d8"
|
|
1281
|
+
}
|
|
1282
|
+
}).showToast();
|
|
1283
|
+
}, error: (e) => {
|
|
1284
|
+
ut({
|
|
1285
|
+
...at,
|
|
1286
|
+
text: e,
|
|
1287
|
+
style: {
|
|
1288
|
+
...lt,
|
|
1289
|
+
background: "#fef0f0",
|
|
1290
|
+
color: "#f56c6c",
|
|
1291
|
+
border: "1px solid #fde2e2"
|
|
1292
|
+
}
|
|
1293
|
+
}).showToast();
|
|
1294
|
+
} }), ht = Ee(), we = /* @__PURE__ */ X({
|
|
1099
1295
|
name: "RenderIcon",
|
|
1100
1296
|
props: {
|
|
1101
1297
|
iconInfo: {
|
|
@@ -1108,53 +1304,51 @@ const lt = /* @__PURE__ */ ot(ht), ft = /* @__PURE__ */ J({
|
|
|
1108
1304
|
},
|
|
1109
1305
|
copyHandler: Function
|
|
1110
1306
|
},
|
|
1111
|
-
setup(
|
|
1112
|
-
const
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1307
|
+
setup(s) {
|
|
1308
|
+
const t = async (i) => {
|
|
1309
|
+
if (s.copyHandler) {
|
|
1310
|
+
s.copyHandler(i);
|
|
1115
1311
|
return;
|
|
1116
1312
|
}
|
|
1117
|
-
let
|
|
1313
|
+
let o = "";
|
|
1118
1314
|
try {
|
|
1119
|
-
await
|
|
1315
|
+
await me(i), o = "success";
|
|
1120
1316
|
} catch {
|
|
1121
|
-
|
|
1317
|
+
o = "error";
|
|
1122
1318
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
});
|
|
1127
|
-
}, s = pe(() => t.iconInfo.baseClassName ? `${t.iconInfo.baseClassName} ${t.iconClass}` : t.iconClass);
|
|
1319
|
+
const r = `copy ${o} [${i}]`;
|
|
1320
|
+
o === "success" ? ht.success(r) : ht.error(r);
|
|
1321
|
+
}, e = vt(() => s.iconInfo.baseClassName ? `${s.iconInfo.baseClassName} ${s.iconClass}` : s.iconClass);
|
|
1128
1322
|
return () => {
|
|
1129
|
-
var
|
|
1130
|
-
return
|
|
1323
|
+
var i;
|
|
1324
|
+
return L("span", {
|
|
1131
1325
|
class: "render-icon",
|
|
1132
|
-
onClick: () => e
|
|
1133
|
-
}, [
|
|
1134
|
-
class: [
|
|
1135
|
-
}, null),
|
|
1136
|
-
iconClass:
|
|
1137
|
-
"highlight-chunks": (
|
|
1326
|
+
onClick: () => t(e.value)
|
|
1327
|
+
}, [s.iconInfo.renderIcon ? s.iconInfo.renderIcon(e.value) : L("i", {
|
|
1328
|
+
class: [s.iconInfo.baseClassName, s.iconClass]
|
|
1329
|
+
}, null), L(de, {
|
|
1330
|
+
iconClass: s.iconClass,
|
|
1331
|
+
"highlight-chunks": (i = s.iconInfo.matchesMap) == null ? void 0 : i.get(s.iconClass)
|
|
1138
1332
|
}, null)]);
|
|
1139
1333
|
};
|
|
1140
1334
|
}
|
|
1141
|
-
}),
|
|
1335
|
+
}), ve = {
|
|
1142
1336
|
getIconsInfo: {
|
|
1143
1337
|
type: Function,
|
|
1144
1338
|
required: !0
|
|
1145
1339
|
},
|
|
1146
1340
|
cssLinkFormat: {
|
|
1147
1341
|
type: Function,
|
|
1148
|
-
default: (
|
|
1342
|
+
default: (s) => s
|
|
1149
1343
|
}
|
|
1150
|
-
},
|
|
1344
|
+
}, Me = { class: "render-icon-list" }, xe = /* @__PURE__ */ X({
|
|
1151
1345
|
__name: "render-icon-list",
|
|
1152
|
-
props:
|
|
1153
|
-
setup(
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1156
|
-
iconInfo:
|
|
1157
|
-
fuse: new
|
|
1346
|
+
props: ve,
|
|
1347
|
+
setup(s, { expose: t }) {
|
|
1348
|
+
const e = s, i = O(), o = O(), r = O([]), n = O([]), c = (u) => {
|
|
1349
|
+
i.value = u, o.value = u, r.value = u.map((h) => h.filePath), n.value = u.map((h) => ({
|
|
1350
|
+
iconInfo: h,
|
|
1351
|
+
fuse: new S(h.classNames, {
|
|
1158
1352
|
/**
|
|
1159
1353
|
* 搜索结果是否包含匹配的相关性分数,开启后会额外包含一个 score 字段,表示匹配的相似度分数
|
|
1160
1354
|
* 0 表示完全匹配
|
|
@@ -1173,61 +1367,61 @@ const lt = /* @__PURE__ */ ot(ht), ft = /* @__PURE__ */ J({
|
|
|
1173
1367
|
// 是否按分数对结果列表进行排序
|
|
1174
1368
|
})
|
|
1175
1369
|
}));
|
|
1176
|
-
},
|
|
1177
|
-
const
|
|
1178
|
-
if (!
|
|
1370
|
+
}, a = (u) => {
|
|
1371
|
+
const h = document.querySelector("head");
|
|
1372
|
+
if (!h) {
|
|
1179
1373
|
console.error("Head element not found");
|
|
1180
1374
|
return;
|
|
1181
1375
|
}
|
|
1182
1376
|
const d = document.createDocumentFragment();
|
|
1183
|
-
|
|
1184
|
-
if (!
|
|
1185
|
-
const
|
|
1186
|
-
if (document.querySelector(`link[rel='stylesheet'][href='${
|
|
1377
|
+
u.forEach((p) => {
|
|
1378
|
+
if (!p.filePath) return;
|
|
1379
|
+
const g = e.cssLinkFormat(p.filePath);
|
|
1380
|
+
if (document.querySelector(`link[rel='stylesheet'][href='${g}']`))
|
|
1187
1381
|
return;
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1190
|
-
}),
|
|
1382
|
+
const m = document.createElement("link");
|
|
1383
|
+
m.rel = "stylesheet", m.href = g, d.appendChild(m);
|
|
1384
|
+
}), h.appendChild(d);
|
|
1191
1385
|
};
|
|
1192
|
-
return
|
|
1193
|
-
var
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
}),
|
|
1197
|
-
onSearch: (
|
|
1198
|
-
const
|
|
1199
|
-
if (!
|
|
1200
|
-
if (!
|
|
1201
|
-
|
|
1386
|
+
return Mt(async () => {
|
|
1387
|
+
var h;
|
|
1388
|
+
const u = await ((h = e.getIconsInfo) == null ? void 0 : h.call(e)) || [];
|
|
1389
|
+
a(u), c(u);
|
|
1390
|
+
}), t({
|
|
1391
|
+
onSearch: (u) => {
|
|
1392
|
+
const h = u.trim();
|
|
1393
|
+
if (!i.value) return;
|
|
1394
|
+
if (!h) {
|
|
1395
|
+
r.value = i.value.map((p) => p.filePath), o.value = i.value;
|
|
1202
1396
|
return;
|
|
1203
1397
|
}
|
|
1204
1398
|
const d = [];
|
|
1205
|
-
|
|
1206
|
-
const
|
|
1207
|
-
if (
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}),
|
|
1399
|
+
n.value.forEach(({ iconInfo: p, fuse: g }) => {
|
|
1400
|
+
const m = g.search(h);
|
|
1401
|
+
if (m.length) {
|
|
1402
|
+
const A = /* @__PURE__ */ new Map(), w = [];
|
|
1403
|
+
m.forEach((C) => {
|
|
1404
|
+
const x = C.matches || [], M = [];
|
|
1405
|
+
x.forEach((j) => {
|
|
1406
|
+
M.push(...j.indices);
|
|
1407
|
+
}), A.set(C.item, M), w.push(C.item);
|
|
1214
1408
|
}), d.push({
|
|
1215
|
-
...
|
|
1216
|
-
matchesMap:
|
|
1217
|
-
classNames:
|
|
1409
|
+
...p,
|
|
1410
|
+
matchesMap: A,
|
|
1411
|
+
classNames: w
|
|
1218
1412
|
});
|
|
1219
1413
|
}
|
|
1220
|
-
}),
|
|
1414
|
+
}), o.value = d, r.value = d.map((p) => p.filePath);
|
|
1221
1415
|
}
|
|
1222
|
-
}), (
|
|
1223
|
-
|
|
1224
|
-
iconsInfo:
|
|
1225
|
-
renderIcon:
|
|
1416
|
+
}), (u, h) => (Ft(), bt("div", Me, [
|
|
1417
|
+
xt(u.$slots, "default", {
|
|
1418
|
+
iconsInfo: o.value,
|
|
1419
|
+
renderIcon: Bt(we)
|
|
1226
1420
|
})
|
|
1227
1421
|
]));
|
|
1228
1422
|
}
|
|
1229
1423
|
});
|
|
1230
1424
|
export {
|
|
1231
|
-
|
|
1232
|
-
|
|
1425
|
+
xe as RenderIconList,
|
|
1426
|
+
ve as renderIconListProps
|
|
1233
1427
|
};
|