@music-lyric-player/base 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.comm.js +1 -1
- package/dist/index.comm.js.map +1 -1
- package/dist/index.ecma.d.ts +23 -5
- package/dist/index.ecma.js +1207 -772
- package/dist/index.ecma.js.map +1 -1
- package/package.json +3 -3
package/dist/index.ecma.js
CHANGED
|
@@ -1,191 +1,660 @@
|
|
|
1
|
-
import { freezeObjectDeep as
|
|
1
|
+
import { freezeObjectDeep as fr, ConfigManager as mr, Event as pr } from "@music-lyric-player/utils";
|
|
2
2
|
import "lodash-es";
|
|
3
|
-
const
|
|
3
|
+
const Ht = fr({
|
|
4
4
|
driver: "animation",
|
|
5
5
|
bridgeActive: !0,
|
|
6
6
|
mergeWindow: 300,
|
|
7
|
+
mergeLimit: 3,
|
|
7
8
|
offset: {
|
|
8
9
|
global: 0,
|
|
9
10
|
useMeta: !0,
|
|
10
11
|
resetTempOnLyricChange: !0
|
|
11
12
|
}
|
|
12
|
-
}),
|
|
13
|
+
}), ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13
14
|
__proto__: null,
|
|
14
|
-
DEFAULT:
|
|
15
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
for (let r = 0; r < s.length; r++)
|
|
21
|
-
s[r] = Math.floor(Math.random() * 256);
|
|
22
|
-
return Array.from(s).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
15
|
+
DEFAULT: Ht
|
|
16
|
+
}, Symbol.toStringTag, { value: "Module" })), B = (s = 8) => {
|
|
17
|
+
let e = "";
|
|
18
|
+
for (; e.length < s; )
|
|
19
|
+
e += Math.random().toString(36).slice(2);
|
|
20
|
+
return e.slice(0, s);
|
|
23
21
|
};
|
|
24
|
-
|
|
22
|
+
var zt = /* @__PURE__ */ ((s) => (s.ChineseSimplified = "zh-hans", s.ChineseTraditional = "zh-hant", s.English = "en", s.Japanese = "ja", s.Korean = "ko", s.Russian = "ru", s.French = "fr", s.German = "de", s.Spanish = "es", s.Italian = "it", s.Portuguese = "pt", s))(zt || {});
|
|
23
|
+
class dr {
|
|
24
|
+
/**
|
|
25
|
+
* Language tag.
|
|
26
|
+
*/
|
|
27
|
+
tag = "";
|
|
28
|
+
/**
|
|
29
|
+
* Share within the lyric, ranging from 0 to 100.
|
|
30
|
+
* Recommended to be computed from word-level language counts.
|
|
31
|
+
*/
|
|
32
|
+
percent = 0;
|
|
33
|
+
}
|
|
34
|
+
class Yt {
|
|
35
|
+
/**
|
|
36
|
+
* All languages with their shares.
|
|
37
|
+
*/
|
|
38
|
+
list = [];
|
|
39
|
+
/**
|
|
40
|
+
* The language with the highest share.
|
|
41
|
+
*/
|
|
42
|
+
get primary() {
|
|
43
|
+
let e;
|
|
44
|
+
for (let t = 0, n = this.list.length; t < n; t++)
|
|
45
|
+
(!e || this.list[t].percent > e.percent) && (e = this.list[t]);
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class Kt {
|
|
50
|
+
/**
|
|
51
|
+
* Start time in milliseconds.
|
|
52
|
+
*/
|
|
25
53
|
start = 0;
|
|
54
|
+
/**
|
|
55
|
+
* End time in milliseconds.
|
|
56
|
+
*/
|
|
26
57
|
end = 0;
|
|
58
|
+
/**
|
|
59
|
+
* Duration in milliseconds, derived from end minus start.
|
|
60
|
+
*/
|
|
27
61
|
get duration() {
|
|
28
62
|
return this.end - this.start;
|
|
29
63
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
64
|
+
}
|
|
65
|
+
class Er {
|
|
66
|
+
/**
|
|
67
|
+
* Unique identifier of the token.
|
|
68
|
+
*/
|
|
69
|
+
id = B(6).toUpperCase();
|
|
70
|
+
/**
|
|
71
|
+
* Time range of the token.
|
|
72
|
+
*/
|
|
73
|
+
time;
|
|
74
|
+
/**
|
|
75
|
+
* Text content of the token.
|
|
76
|
+
*/
|
|
77
|
+
content = "";
|
|
78
|
+
}
|
|
79
|
+
class Jt {
|
|
80
|
+
/**
|
|
81
|
+
* Unique identifier of the item.
|
|
82
|
+
*/
|
|
83
|
+
id = B(6).toUpperCase();
|
|
84
|
+
/**
|
|
85
|
+
* Time range of the item, independent from its words.
|
|
86
|
+
*/
|
|
87
|
+
time;
|
|
88
|
+
/**
|
|
89
|
+
* Tokens composing the item in order.
|
|
90
|
+
*/
|
|
91
|
+
words = [];
|
|
92
|
+
/**
|
|
93
|
+
* Language or transliteration scheme of this item.
|
|
94
|
+
* Should be set when multiple languages coexist, since line-level aggregation groups items by it.
|
|
95
|
+
*/
|
|
96
|
+
language;
|
|
97
|
+
/**
|
|
98
|
+
* Flat text joined from every word.
|
|
99
|
+
*/
|
|
100
|
+
get content() {
|
|
101
|
+
let e = "";
|
|
102
|
+
for (let t = 0, n = this.words.length; t < n; t++)
|
|
103
|
+
e += this.words[t].content;
|
|
104
|
+
return e;
|
|
36
105
|
}
|
|
37
106
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
107
|
+
class gr extends Jt {
|
|
108
|
+
/**
|
|
109
|
+
* Original annotation type name.
|
|
110
|
+
*/
|
|
111
|
+
key = "";
|
|
112
|
+
}
|
|
113
|
+
class Rr {
|
|
114
|
+
/**
|
|
115
|
+
* Ruby annotation such as furigana.
|
|
116
|
+
*/
|
|
117
|
+
ruby;
|
|
118
|
+
/**
|
|
119
|
+
* Romanized transliterations.
|
|
120
|
+
*/
|
|
121
|
+
romans;
|
|
122
|
+
/**
|
|
123
|
+
* Unknown annotations keyed by their original type name.
|
|
124
|
+
*/
|
|
125
|
+
unknowns;
|
|
41
126
|
}
|
|
42
|
-
|
|
127
|
+
var k = /* @__PURE__ */ ((s) => (s.Normal = "Normal", s.Space = "Space", s))(k || {});
|
|
128
|
+
class vr {
|
|
129
|
+
/**
|
|
130
|
+
* Unique identifier of the word.
|
|
131
|
+
*/
|
|
132
|
+
id = B(6).toUpperCase();
|
|
133
|
+
/**
|
|
134
|
+
* Discriminant marking this as a normal word.
|
|
135
|
+
*/
|
|
43
136
|
type = "Normal";
|
|
44
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Time range of the word.
|
|
139
|
+
*/
|
|
140
|
+
time;
|
|
141
|
+
/**
|
|
142
|
+
* Text content of the word.
|
|
143
|
+
*/
|
|
45
144
|
content = "";
|
|
46
|
-
|
|
47
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Language of this word.
|
|
147
|
+
*/
|
|
148
|
+
language;
|
|
149
|
+
/**
|
|
150
|
+
* Annotations attached to this word.
|
|
151
|
+
*/
|
|
152
|
+
annotation;
|
|
153
|
+
/**
|
|
154
|
+
* Whether the word is stressed.
|
|
155
|
+
*/
|
|
156
|
+
stress = !1;
|
|
48
157
|
}
|
|
49
|
-
class
|
|
158
|
+
class Ir {
|
|
159
|
+
/**
|
|
160
|
+
* Discriminant marking this as a space.
|
|
161
|
+
*/
|
|
50
162
|
type = "Space";
|
|
163
|
+
/**
|
|
164
|
+
* Number of consecutive space characters.
|
|
165
|
+
*/
|
|
51
166
|
count = 1;
|
|
52
167
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
168
|
+
class Y {
|
|
169
|
+
/**
|
|
170
|
+
* Language or transliteration scheme of this item.
|
|
171
|
+
* Should be set when multiple languages coexist, since aggregation from words groups by it.
|
|
172
|
+
*/
|
|
173
|
+
language;
|
|
174
|
+
/**
|
|
175
|
+
* Original text.
|
|
176
|
+
*/
|
|
56
177
|
content = "";
|
|
57
178
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
179
|
+
class Zt extends Y {
|
|
180
|
+
/**
|
|
181
|
+
* Original annotation type name.
|
|
182
|
+
*/
|
|
183
|
+
key = "";
|
|
63
184
|
}
|
|
64
|
-
class
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return this.words.map((s) => s.type === Ye.Normal ? s.content : " ".repeat(s.count)).join("");
|
|
185
|
+
class Qt {
|
|
186
|
+
#e;
|
|
187
|
+
constructor(e) {
|
|
188
|
+
this.#e = e;
|
|
69
189
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Aggregate one per-word item into a single line item, padding spaces to follow word spacing.
|
|
192
|
+
*/
|
|
193
|
+
#i(e) {
|
|
194
|
+
let t = "", n = 0, i, c = !1;
|
|
195
|
+
for (let h = 0, o = this.#e.words.length; h < o; h++) {
|
|
196
|
+
const a = this.#e.words[h];
|
|
197
|
+
if (a.type === k.Space) {
|
|
198
|
+
n += a.count;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const r = e(a);
|
|
202
|
+
r && (c && (t += " ".repeat(n)), t += r.content, i ??= r.language, n = 0, c = !0);
|
|
203
|
+
}
|
|
204
|
+
if (!c)
|
|
205
|
+
return;
|
|
206
|
+
const l = new Y();
|
|
207
|
+
return l.content = t, l.language = i, l;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Aggregate multi-value per-word items into line items, one per language.
|
|
211
|
+
*/
|
|
212
|
+
#a(e) {
|
|
213
|
+
const t = [];
|
|
214
|
+
for (let i = 0, c = this.#e.words.length; i < c; i++) {
|
|
215
|
+
const l = this.#e.words[i];
|
|
216
|
+
if (l.type === k.Space)
|
|
217
|
+
continue;
|
|
218
|
+
const h = e(l);
|
|
219
|
+
if (h)
|
|
220
|
+
for (const o of h) {
|
|
221
|
+
const a = o.language ?? "";
|
|
222
|
+
t.includes(a) || t.push(a);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!t.length)
|
|
226
|
+
return;
|
|
227
|
+
const n = [];
|
|
228
|
+
for (const i of t) {
|
|
229
|
+
let c = "", l = 0, h = !1;
|
|
230
|
+
for (let a = 0, r = this.#e.words.length; a < r; a++) {
|
|
231
|
+
const u = this.#e.words[a];
|
|
232
|
+
if (u.type === k.Space) {
|
|
233
|
+
l += u.count;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const f = e(u)?.find((E) => (E.language ?? "") === i);
|
|
237
|
+
f && (h && (c += " ".repeat(l)), c += f.content, l = 0, h = !0);
|
|
238
|
+
}
|
|
239
|
+
const o = new Y();
|
|
240
|
+
o.content = c, o.language = i || void 0, n.push(o);
|
|
241
|
+
}
|
|
242
|
+
return n;
|
|
76
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Aggregate unknown per-word items into line items, one per key.
|
|
246
|
+
*/
|
|
247
|
+
#o() {
|
|
248
|
+
const e = [];
|
|
249
|
+
for (let n = 0, i = this.#e.words.length; n < i; n++) {
|
|
250
|
+
const c = this.#e.words[n];
|
|
251
|
+
if (c.type === k.Space)
|
|
252
|
+
continue;
|
|
253
|
+
const l = c.annotation?.unknowns;
|
|
254
|
+
if (l)
|
|
255
|
+
for (const h of l)
|
|
256
|
+
e.includes(h.key) || e.push(h.key);
|
|
257
|
+
}
|
|
258
|
+
if (!e.length)
|
|
259
|
+
return;
|
|
260
|
+
const t = [];
|
|
261
|
+
for (const n of e) {
|
|
262
|
+
let i = "", c = 0, l, h = !1;
|
|
263
|
+
for (let a = 0, r = this.#e.words.length; a < r; a++) {
|
|
264
|
+
const u = this.#e.words[a];
|
|
265
|
+
if (u.type === k.Space) {
|
|
266
|
+
c += u.count;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const f = u.annotation?.unknowns?.find((E) => E.key === n);
|
|
270
|
+
f && (h && (i += " ".repeat(c)), i += f.content, l ??= f.language, c = 0, h = !0);
|
|
271
|
+
}
|
|
272
|
+
const o = new Zt();
|
|
273
|
+
o.key = n, o.content = i, o.language = l, t.push(o);
|
|
274
|
+
}
|
|
275
|
+
return t;
|
|
276
|
+
}
|
|
277
|
+
#t;
|
|
278
|
+
/**
|
|
279
|
+
* Ruby annotation: the explicit value, otherwise aggregated from words.
|
|
280
|
+
*/
|
|
281
|
+
get ruby() {
|
|
282
|
+
return this.#t ?? this.#i((e) => e.annotation?.ruby);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Override the words-derived ruby with an explicit value.
|
|
286
|
+
*/
|
|
287
|
+
set ruby(e) {
|
|
288
|
+
this.#t = e;
|
|
289
|
+
}
|
|
290
|
+
#r;
|
|
291
|
+
/**
|
|
292
|
+
* Romanized transliterations: the explicit value, otherwise aggregated from words grouped by language.
|
|
293
|
+
*/
|
|
294
|
+
get romans() {
|
|
295
|
+
return this.#r ?? this.#a((e) => e.annotation?.romans);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Override the words-derived romans with explicit values.
|
|
299
|
+
*/
|
|
300
|
+
set romans(e) {
|
|
301
|
+
this.#r = e;
|
|
302
|
+
}
|
|
303
|
+
#s;
|
|
304
|
+
/**
|
|
305
|
+
* Translations, explicit only since words carry no line-level translation.
|
|
306
|
+
*/
|
|
307
|
+
get translates() {
|
|
308
|
+
return this.#s;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Set the explicit translations.
|
|
312
|
+
*/
|
|
313
|
+
set translates(e) {
|
|
314
|
+
this.#s = e;
|
|
315
|
+
}
|
|
316
|
+
#n;
|
|
317
|
+
/**
|
|
318
|
+
* Unknown annotations: the explicit value, otherwise aggregated from words grouped by key.
|
|
319
|
+
*/
|
|
320
|
+
get unknowns() {
|
|
321
|
+
return this.#n ?? this.#o();
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Override the words-derived unknowns with explicit values.
|
|
325
|
+
*/
|
|
326
|
+
set unknowns(e) {
|
|
327
|
+
this.#n = e;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
var er = /* @__PURE__ */ ((s) => (s.Normal = "Normal", s.Interlude = "Interlude", s))(er || {});
|
|
331
|
+
class tr {
|
|
332
|
+
/**
|
|
333
|
+
* Unique identifier of the line.
|
|
334
|
+
*/
|
|
335
|
+
id = B(6).toUpperCase();
|
|
336
|
+
/**
|
|
337
|
+
* Time range of the line.
|
|
338
|
+
*/
|
|
339
|
+
time = new Kt();
|
|
77
340
|
}
|
|
78
|
-
class
|
|
341
|
+
class rr extends tr {
|
|
342
|
+
/**
|
|
343
|
+
* Discriminant marking this as a normal line.
|
|
344
|
+
*/
|
|
79
345
|
type = "Normal";
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Performing agent of this line.
|
|
348
|
+
*/
|
|
83
349
|
agent;
|
|
350
|
+
/**
|
|
351
|
+
* Words composing the line in order.
|
|
352
|
+
*/
|
|
353
|
+
words = [];
|
|
354
|
+
/**
|
|
355
|
+
* Plain text of the line joined from every word.
|
|
356
|
+
*/
|
|
357
|
+
get original() {
|
|
358
|
+
let e = "";
|
|
359
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
360
|
+
const i = this.words[t];
|
|
361
|
+
e += i.type === k.Normal ? i.content : " ".repeat(i.count);
|
|
362
|
+
}
|
|
363
|
+
return e;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Annotations applied to the whole line, derived from words unless set explicitly.
|
|
367
|
+
*/
|
|
368
|
+
annotation = new Qt(this);
|
|
369
|
+
#e;
|
|
370
|
+
/**
|
|
371
|
+
* Language tags of this line: the value set explicitly, otherwise collected from words.
|
|
372
|
+
*/
|
|
373
|
+
get languages() {
|
|
374
|
+
if (this.#e?.length)
|
|
375
|
+
return this.#e;
|
|
376
|
+
const e = /* @__PURE__ */ new Set();
|
|
377
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
378
|
+
const i = this.words[t];
|
|
379
|
+
i.type === k.Normal && i.language && e.add(i.language);
|
|
380
|
+
}
|
|
381
|
+
return [...e];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Override the words-derived languages with explicit tags.
|
|
385
|
+
*/
|
|
386
|
+
set languages(e) {
|
|
387
|
+
this.#e = e;
|
|
388
|
+
}
|
|
84
389
|
}
|
|
85
|
-
class
|
|
86
|
-
|
|
87
|
-
|
|
390
|
+
class $r extends rr {
|
|
391
|
+
/**
|
|
392
|
+
* Background lines attached to this line.
|
|
393
|
+
*/
|
|
88
394
|
background;
|
|
89
395
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
type = "Offset";
|
|
96
|
-
content = 0;
|
|
97
|
-
}
|
|
98
|
-
class Rr extends F {
|
|
99
|
-
type = "Duration";
|
|
100
|
-
content = 0;
|
|
101
|
-
}
|
|
102
|
-
class vr extends F {
|
|
103
|
-
type = "Title";
|
|
104
|
-
content = "";
|
|
105
|
-
}
|
|
106
|
-
class Ir extends F {
|
|
107
|
-
type = "Singer";
|
|
108
|
-
content = "";
|
|
109
|
-
}
|
|
110
|
-
class gr extends F {
|
|
111
|
-
type = "Album";
|
|
112
|
-
content = "";
|
|
113
|
-
}
|
|
114
|
-
class $r extends F {
|
|
115
|
-
type = "Creator";
|
|
116
|
-
content = {
|
|
117
|
-
role: "",
|
|
118
|
-
name: []
|
|
119
|
-
};
|
|
396
|
+
class Lr extends tr {
|
|
397
|
+
/**
|
|
398
|
+
* Discriminant marking this as an interlude line.
|
|
399
|
+
*/
|
|
400
|
+
type = "Interlude";
|
|
120
401
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
402
|
+
var _ = /* @__PURE__ */ ((s) => (s.Offset = "Offset", s.Duration = "Duration", s.Title = "Title", s.Singer = "Singer", s.Album = "Album", s.Creator = "Creator", s.Author = "Author", s.Isrc = "Isrc", s.Unknown = "Unknown", s))(_ || {});
|
|
403
|
+
const Tr = (s, e, t) => ({
|
|
404
|
+
id: B(6).toUpperCase(),
|
|
405
|
+
type: s,
|
|
406
|
+
key: e,
|
|
407
|
+
value: t
|
|
408
|
+
});
|
|
409
|
+
class sr {
|
|
410
|
+
/**
|
|
411
|
+
* All meta entries in order.
|
|
412
|
+
*/
|
|
413
|
+
list = [];
|
|
414
|
+
listOf(e) {
|
|
415
|
+
return this.list.filter((t) => t.type === e);
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* All offset meta entries.
|
|
419
|
+
*/
|
|
420
|
+
get offsets() {
|
|
421
|
+
return this.listOf(_.Offset);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* All duration meta entries.
|
|
425
|
+
*/
|
|
426
|
+
get durations() {
|
|
427
|
+
return this.listOf(_.Duration);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* All title meta entries.
|
|
431
|
+
*/
|
|
432
|
+
get titles() {
|
|
433
|
+
return this.listOf(_.Title);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* All singer meta entries.
|
|
437
|
+
*/
|
|
438
|
+
get singers() {
|
|
439
|
+
return this.listOf(_.Singer);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* All album meta entries.
|
|
443
|
+
*/
|
|
444
|
+
get albums() {
|
|
445
|
+
return this.listOf(_.Album);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* All creator meta entries.
|
|
449
|
+
*/
|
|
450
|
+
get creators() {
|
|
451
|
+
return this.listOf(_.Creator);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* All author meta entries.
|
|
455
|
+
*/
|
|
456
|
+
get authors() {
|
|
457
|
+
return this.listOf(_.Author);
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* All isrc meta entries.
|
|
461
|
+
*/
|
|
462
|
+
get isrcs() {
|
|
463
|
+
return this.listOf(_.Isrc);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* All unknown meta entries.
|
|
467
|
+
*/
|
|
468
|
+
get unknowns() {
|
|
469
|
+
return this.listOf(_.Unknown);
|
|
470
|
+
}
|
|
124
471
|
}
|
|
125
|
-
|
|
472
|
+
var nr = /* @__PURE__ */ ((s) => (s.Person = "Person", s.Group = "Group", s.Other = "Other", s.Unknown = "Unknown", s))(nr || {});
|
|
473
|
+
class Or {
|
|
474
|
+
/**
|
|
475
|
+
* Unique identifier of the agent.
|
|
476
|
+
*/
|
|
126
477
|
id = "";
|
|
127
|
-
|
|
478
|
+
/**
|
|
479
|
+
* Performing type of the agent.
|
|
480
|
+
*/
|
|
481
|
+
type = "Unknown";
|
|
482
|
+
/**
|
|
483
|
+
* Number of lines performed by this agent.
|
|
484
|
+
*/
|
|
128
485
|
count = 0;
|
|
486
|
+
/**
|
|
487
|
+
* Display names of the agent; a group may carry more than one.
|
|
488
|
+
*/
|
|
489
|
+
names = [];
|
|
129
490
|
}
|
|
130
|
-
class
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
block = 0;
|
|
135
|
-
}
|
|
136
|
-
class Nr {
|
|
491
|
+
class Sr {
|
|
492
|
+
/**
|
|
493
|
+
* Identifier of the referenced Agent.
|
|
494
|
+
*/
|
|
137
495
|
id = "";
|
|
138
|
-
|
|
496
|
+
/**
|
|
497
|
+
* Index of this agent occurrence among all lines.
|
|
498
|
+
*/
|
|
499
|
+
globalIndex = 0;
|
|
500
|
+
/**
|
|
501
|
+
* Index of this agent occurrence within its block.
|
|
502
|
+
*/
|
|
503
|
+
blockIndex = 0;
|
|
139
504
|
}
|
|
140
|
-
const
|
|
141
|
-
var
|
|
142
|
-
class
|
|
143
|
-
|
|
505
|
+
const ir = "0.8.0";
|
|
506
|
+
var ar = /* @__PURE__ */ ((s) => (s.Invalid = "Invalid", s.Empty = "Empty", s.Normal = "Normal", s))(ar || {}), or = /* @__PURE__ */ ((s) => (s.None = "None", s.Line = "Line", s.Syllable = "Syllable", s))(or || {});
|
|
507
|
+
class Nr {
|
|
508
|
+
/**
|
|
509
|
+
* Schema version of this data model.
|
|
510
|
+
*/
|
|
511
|
+
version = ir;
|
|
512
|
+
/**
|
|
513
|
+
* Overall classification of the lyric.
|
|
514
|
+
*/
|
|
144
515
|
type = "Invalid";
|
|
145
|
-
|
|
146
|
-
|
|
516
|
+
/**
|
|
517
|
+
* Timing precision of the lyric.
|
|
518
|
+
*/
|
|
519
|
+
timing = "None";
|
|
520
|
+
/**
|
|
521
|
+
* Metadata of the lyric.
|
|
522
|
+
*/
|
|
523
|
+
meta = new sr();
|
|
524
|
+
/**
|
|
525
|
+
* Language distribution of the lyric.
|
|
526
|
+
*/
|
|
527
|
+
language = new Yt();
|
|
528
|
+
/**
|
|
529
|
+
* Performing agents referenced by lines.
|
|
530
|
+
*/
|
|
147
531
|
agents = [];
|
|
532
|
+
/**
|
|
533
|
+
* Lyric lines in order.
|
|
534
|
+
*/
|
|
535
|
+
lines = [];
|
|
148
536
|
}
|
|
149
|
-
const
|
|
537
|
+
const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
150
538
|
__proto__: null,
|
|
151
|
-
Agent:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
InfoType:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
WordSpace:
|
|
176
|
-
WordType:
|
|
539
|
+
Agent: Or,
|
|
540
|
+
AgentType: nr,
|
|
541
|
+
Info: Nr,
|
|
542
|
+
InfoTiming: or,
|
|
543
|
+
InfoType: ar,
|
|
544
|
+
Language: Yt,
|
|
545
|
+
LanguageItem: dr,
|
|
546
|
+
LanguageType: zt,
|
|
547
|
+
LineAgent: Sr,
|
|
548
|
+
LineAnnotation: Qt,
|
|
549
|
+
LineAnnotationItem: Y,
|
|
550
|
+
LineInterlude: Lr,
|
|
551
|
+
LineNormal: $r,
|
|
552
|
+
LineNormalBase: rr,
|
|
553
|
+
LineType: er,
|
|
554
|
+
LineUnknownAnnotation: Zt,
|
|
555
|
+
Meta: sr,
|
|
556
|
+
MetaType: _,
|
|
557
|
+
Time: Kt,
|
|
558
|
+
Version: ir,
|
|
559
|
+
WordAnnotation: Rr,
|
|
560
|
+
WordAnnotationContent: Er,
|
|
561
|
+
WordAnnotationItem: Jt,
|
|
562
|
+
WordNormal: vr,
|
|
563
|
+
WordSpace: Ir,
|
|
564
|
+
WordType: k,
|
|
565
|
+
WordUnknownAnnotation: gr,
|
|
566
|
+
createMetaItem: Tr
|
|
177
567
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
568
|
+
class wr {
|
|
569
|
+
lines = [];
|
|
570
|
+
mergedEnd = [];
|
|
571
|
+
/**
|
|
572
|
+
* Raw deactivation time of a line: the later of its own end and the next line's start.
|
|
573
|
+
*
|
|
574
|
+
* The final line never deactivates, and out-of-range indices resolve to 0.
|
|
575
|
+
*/
|
|
576
|
+
getRawTime(e) {
|
|
577
|
+
const t = this.lines;
|
|
578
|
+
return e < 0 || e >= t.length ? 0 : e === t.length - 1 ? 1 / 0 : Math.max(t[e].time.end, t[e + 1].time.start);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Rebuild the merged end-time table from the given lines and merge settings.
|
|
582
|
+
*/
|
|
583
|
+
build(e, t, n) {
|
|
584
|
+
this.lines = e;
|
|
585
|
+
const i = e.length, c = new Array(i);
|
|
586
|
+
if (i === 0) {
|
|
587
|
+
this.mergedEnd = c;
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
const l = Math.max(0, t), h = n > 0 ? n : 1 / 0;
|
|
591
|
+
let o = this.getRawTime(i - 1);
|
|
592
|
+
c[i - 1] = o;
|
|
593
|
+
let a = 1;
|
|
594
|
+
for (let r = i - 2; r >= 0; r--) {
|
|
595
|
+
const u = this.getRawTime(r);
|
|
596
|
+
l > 0 && a < h && Math.abs(o - u) < l ? (c[r] = Math.max(u, c[r + 1]), a++) : (c[r] = u, a = 1), o = u;
|
|
597
|
+
}
|
|
598
|
+
this.mergedEnd = c;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Merged deactivation time of a line, falling back to the raw time when unbuilt.
|
|
602
|
+
*/
|
|
603
|
+
getMergedTime(e) {
|
|
604
|
+
const t = this.mergedEnd[e];
|
|
605
|
+
return t === void 0 ? this.getRawTime(e) : t;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
class Ar {
|
|
609
|
+
temp = 0;
|
|
610
|
+
meta = 0;
|
|
611
|
+
setTemp(e) {
|
|
612
|
+
this.temp = Number.isFinite(e) ? e : 0;
|
|
613
|
+
}
|
|
614
|
+
resetTemp() {
|
|
615
|
+
this.temp = 0;
|
|
616
|
+
}
|
|
617
|
+
refreshFromMeta(e, t) {
|
|
618
|
+
if (!t) {
|
|
619
|
+
this.meta = 0;
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
const n = e.meta.offsets[0]?.value;
|
|
623
|
+
this.meta = typeof n == "number" && Number.isFinite(n) ? n : 0;
|
|
624
|
+
}
|
|
625
|
+
resolve(e) {
|
|
626
|
+
const t = e + this.meta + this.temp;
|
|
627
|
+
return Number.isFinite(t) ? t : 0;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
class yr {
|
|
631
|
+
frameId = null;
|
|
632
|
+
timerId = null;
|
|
633
|
+
schedule(e, t) {
|
|
634
|
+
switch (e) {
|
|
635
|
+
case "animation":
|
|
636
|
+
this.frameId = globalThis.requestAnimationFrame(t);
|
|
637
|
+
break;
|
|
638
|
+
case "timer":
|
|
639
|
+
this.timerId = globalThis.setTimeout(t, 16);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
cancel() {
|
|
644
|
+
this.frameId !== null && (globalThis.cancelAnimationFrame(this.frameId), this.frameId = null), this.timerId !== null && (globalThis.clearTimeout(this.timerId), this.timerId = null);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
var H = { exports: {} }, ie, tt;
|
|
648
|
+
function K() {
|
|
649
|
+
if (tt) return ie;
|
|
181
650
|
tt = 1;
|
|
182
|
-
const
|
|
183
|
-
9007199254740991, n = 16, i =
|
|
184
|
-
return
|
|
185
|
-
MAX_LENGTH:
|
|
651
|
+
const s = "2.0.0", e = 256, t = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
652
|
+
9007199254740991, n = 16, i = e - 6;
|
|
653
|
+
return ie = {
|
|
654
|
+
MAX_LENGTH: e,
|
|
186
655
|
MAX_SAFE_COMPONENT_LENGTH: n,
|
|
187
656
|
MAX_SAFE_BUILD_LENGTH: i,
|
|
188
|
-
MAX_SAFE_INTEGER:
|
|
657
|
+
MAX_SAFE_INTEGER: t,
|
|
189
658
|
RELEASE_TYPES: [
|
|
190
659
|
"major",
|
|
191
660
|
"premajor",
|
|
@@ -195,96 +664,96 @@ function Y() {
|
|
|
195
664
|
"prepatch",
|
|
196
665
|
"prerelease"
|
|
197
666
|
],
|
|
198
|
-
SEMVER_SPEC_VERSION:
|
|
667
|
+
SEMVER_SPEC_VERSION: s,
|
|
199
668
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
200
669
|
FLAG_LOOSE: 2
|
|
201
|
-
},
|
|
670
|
+
}, ie;
|
|
202
671
|
}
|
|
203
|
-
var
|
|
204
|
-
function
|
|
205
|
-
return rt || (rt = 1,
|
|
206
|
-
}),
|
|
672
|
+
var ae, rt;
|
|
673
|
+
function J() {
|
|
674
|
+
return rt || (rt = 1, ae = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
|
|
675
|
+
}), ae;
|
|
207
676
|
}
|
|
208
677
|
var st;
|
|
209
|
-
function
|
|
210
|
-
return st || (st = 1, (function(
|
|
678
|
+
function W() {
|
|
679
|
+
return st || (st = 1, (function(s, e) {
|
|
211
680
|
const {
|
|
212
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
681
|
+
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
213
682
|
MAX_SAFE_BUILD_LENGTH: n,
|
|
214
683
|
MAX_LENGTH: i
|
|
215
|
-
} =
|
|
216
|
-
|
|
217
|
-
const l =
|
|
684
|
+
} = K(), c = J();
|
|
685
|
+
e = s.exports = {};
|
|
686
|
+
const l = e.re = [], h = e.safeRe = [], o = e.src = [], a = e.safeSrc = [], r = e.t = {};
|
|
218
687
|
let u = 0;
|
|
219
|
-
const f = "[a-zA-Z0-9-]",
|
|
688
|
+
const f = "[a-zA-Z0-9-]", E = [
|
|
220
689
|
["\\s", 1],
|
|
221
690
|
["\\d", i],
|
|
222
691
|
[f, n]
|
|
223
|
-
], S = (
|
|
224
|
-
for (const [
|
|
225
|
-
|
|
226
|
-
return
|
|
227
|
-
},
|
|
228
|
-
const
|
|
229
|
-
c(
|
|
692
|
+
], S = (O) => {
|
|
693
|
+
for (const [w, G] of E)
|
|
694
|
+
O = O.split(`${w}*`).join(`${w}{0,${G}}`).split(`${w}+`).join(`${w}{1,${G}}`);
|
|
695
|
+
return O;
|
|
696
|
+
}, p = (O, w, G) => {
|
|
697
|
+
const A = S(w), b = u++;
|
|
698
|
+
c(O, b, w), r[O] = b, o[b] = w, a[b] = A, l[b] = new RegExp(w, G ? "g" : void 0), h[b] = new RegExp(A, G ? "g" : void 0);
|
|
230
699
|
};
|
|
231
|
-
|
|
700
|
+
p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), p("MAINVERSION", `(${o[r.NUMERICIDENTIFIER]})\\.(${o[r.NUMERICIDENTIFIER]})\\.(${o[r.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${o[r.NUMERICIDENTIFIERLOOSE]})\\.(${o[r.NUMERICIDENTIFIERLOOSE]})\\.(${o[r.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${o[r.NONNUMERICIDENTIFIER]}|${o[r.NUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${o[r.NONNUMERICIDENTIFIER]}|${o[r.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASE", `(?:-(${o[r.PRERELEASEIDENTIFIER]}(?:\\.${o[r.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${o[r.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[r.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${f}+`), p("BUILD", `(?:\\+(${o[r.BUILDIDENTIFIER]}(?:\\.${o[r.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${o[r.MAINVERSION]}${o[r.PRERELEASE]}?${o[r.BUILD]}?`), p("FULL", `^${o[r.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${o[r.MAINVERSIONLOOSE]}${o[r.PRERELEASELOOSE]}?${o[r.BUILD]}?`), p("LOOSE", `^${o[r.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${o[r.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${o[r.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${o[r.XRANGEIDENTIFIER]})(?:\\.(${o[r.XRANGEIDENTIFIER]})(?:\\.(${o[r.XRANGEIDENTIFIER]})(?:${o[r.PRERELEASE]})?${o[r.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${o[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[r.XRANGEIDENTIFIERLOOSE]})(?:${o[r.PRERELEASELOOSE]})?${o[r.BUILD]}?)?)?`), p("XRANGE", `^${o[r.GTLT]}\\s*${o[r.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${o[r.GTLT]}\\s*${o[r.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), p("COERCE", `${o[r.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", o[r.COERCEPLAIN] + `(?:${o[r.PRERELEASE]})?(?:${o[r.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", o[r.COERCE], !0), p("COERCERTLFULL", o[r.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${o[r.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${o[r.LONETILDE]}${o[r.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${o[r.LONETILDE]}${o[r.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${o[r.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${o[r.LONECARET]}${o[r.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${o[r.LONECARET]}${o[r.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${o[r.GTLT]}\\s*(${o[r.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${o[r.GTLT]}\\s*(${o[r.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${o[r.GTLT]}\\s*(${o[r.LOOSEPLAIN]}|${o[r.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${o[r.XRANGEPLAIN]})\\s+-\\s+(${o[r.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${o[r.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[r.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
232
701
|
})(H, H.exports)), H.exports;
|
|
233
702
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
236
|
-
if (nt) return
|
|
703
|
+
var oe, nt;
|
|
704
|
+
function Ye() {
|
|
705
|
+
if (nt) return oe;
|
|
237
706
|
nt = 1;
|
|
238
|
-
const
|
|
239
|
-
return
|
|
707
|
+
const s = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
708
|
+
return oe = (n) => n ? typeof n != "object" ? s : n : e, oe;
|
|
240
709
|
}
|
|
241
|
-
var
|
|
242
|
-
function
|
|
243
|
-
if (it) return
|
|
710
|
+
var le, it;
|
|
711
|
+
function lr() {
|
|
712
|
+
if (it) return le;
|
|
244
713
|
it = 1;
|
|
245
|
-
const
|
|
714
|
+
const s = /^[0-9]+$/, e = (n, i) => {
|
|
246
715
|
if (typeof n == "number" && typeof i == "number")
|
|
247
716
|
return n === i ? 0 : n < i ? -1 : 1;
|
|
248
|
-
const c =
|
|
717
|
+
const c = s.test(n), l = s.test(i);
|
|
249
718
|
return c && l && (n = +n, i = +i), n === i ? 0 : c && !l ? -1 : l && !c ? 1 : n < i ? -1 : 1;
|
|
250
719
|
};
|
|
251
|
-
return
|
|
252
|
-
compareIdentifiers:
|
|
253
|
-
rcompareIdentifiers: (n, i) =>
|
|
254
|
-
},
|
|
255
|
-
}
|
|
256
|
-
var
|
|
257
|
-
function
|
|
258
|
-
if (at) return
|
|
720
|
+
return le = {
|
|
721
|
+
compareIdentifiers: e,
|
|
722
|
+
rcompareIdentifiers: (n, i) => e(i, n)
|
|
723
|
+
}, le;
|
|
724
|
+
}
|
|
725
|
+
var ce, at;
|
|
726
|
+
function x() {
|
|
727
|
+
if (at) return ce;
|
|
259
728
|
at = 1;
|
|
260
|
-
const
|
|
729
|
+
const s = J(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = K(), { safeRe: n, t: i } = W(), c = Ye(), { compareIdentifiers: l } = lr();
|
|
261
730
|
class h {
|
|
262
|
-
constructor(a,
|
|
263
|
-
if (
|
|
264
|
-
if (a.loose === !!
|
|
731
|
+
constructor(a, r) {
|
|
732
|
+
if (r = c(r), a instanceof h) {
|
|
733
|
+
if (a.loose === !!r.loose && a.includePrerelease === !!r.includePrerelease)
|
|
265
734
|
return a;
|
|
266
735
|
a = a.version;
|
|
267
736
|
} else if (typeof a != "string")
|
|
268
737
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);
|
|
269
|
-
if (a.length >
|
|
738
|
+
if (a.length > e)
|
|
270
739
|
throw new TypeError(
|
|
271
|
-
`version is longer than ${
|
|
740
|
+
`version is longer than ${e} characters`
|
|
272
741
|
);
|
|
273
|
-
|
|
274
|
-
const u = a.trim().match(
|
|
742
|
+
s("SemVer", a, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
743
|
+
const u = a.trim().match(r.loose ? n[i.LOOSE] : n[i.FULL]);
|
|
275
744
|
if (!u)
|
|
276
745
|
throw new TypeError(`Invalid Version: ${a}`);
|
|
277
|
-
if (this.raw = a, this.major = +u[1], this.minor = +u[2], this.patch = +u[3], this.major >
|
|
746
|
+
if (this.raw = a, this.major = +u[1], this.minor = +u[2], this.patch = +u[3], this.major > t || this.major < 0)
|
|
278
747
|
throw new TypeError("Invalid major version");
|
|
279
|
-
if (this.minor >
|
|
748
|
+
if (this.minor > t || this.minor < 0)
|
|
280
749
|
throw new TypeError("Invalid minor version");
|
|
281
|
-
if (this.patch >
|
|
750
|
+
if (this.patch > t || this.patch < 0)
|
|
282
751
|
throw new TypeError("Invalid patch version");
|
|
283
752
|
u[4] ? this.prerelease = u[4].split(".").map((f) => {
|
|
284
753
|
if (/^[0-9]+$/.test(f)) {
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
return
|
|
754
|
+
const E = +f;
|
|
755
|
+
if (E >= 0 && E < t)
|
|
756
|
+
return E;
|
|
288
757
|
}
|
|
289
758
|
return f;
|
|
290
759
|
}) : this.prerelease = [], this.build = u[5] ? u[5].split(".") : [], this.format();
|
|
@@ -296,7 +765,7 @@ function b() {
|
|
|
296
765
|
return this.version;
|
|
297
766
|
}
|
|
298
767
|
compare(a) {
|
|
299
|
-
if (
|
|
768
|
+
if (s("SemVer.compare", this.version, this.options, a), !(a instanceof h)) {
|
|
300
769
|
if (typeof a == "string" && a === this.version)
|
|
301
770
|
return 0;
|
|
302
771
|
a = new h(a, this.options);
|
|
@@ -313,10 +782,10 @@ function b() {
|
|
|
313
782
|
return 1;
|
|
314
783
|
if (!this.prerelease.length && !a.prerelease.length)
|
|
315
784
|
return 0;
|
|
316
|
-
let
|
|
785
|
+
let r = 0;
|
|
317
786
|
do {
|
|
318
|
-
const u = this.prerelease[
|
|
319
|
-
if (
|
|
787
|
+
const u = this.prerelease[r], f = a.prerelease[r];
|
|
788
|
+
if (s("prerelease compare", r, u, f), u === void 0 && f === void 0)
|
|
320
789
|
return 0;
|
|
321
790
|
if (f === void 0)
|
|
322
791
|
return 1;
|
|
@@ -325,14 +794,14 @@ function b() {
|
|
|
325
794
|
if (u === f)
|
|
326
795
|
continue;
|
|
327
796
|
return l(u, f);
|
|
328
|
-
} while (++
|
|
797
|
+
} while (++r);
|
|
329
798
|
}
|
|
330
799
|
compareBuild(a) {
|
|
331
800
|
a instanceof h || (a = new h(a, this.options));
|
|
332
|
-
let
|
|
801
|
+
let r = 0;
|
|
333
802
|
do {
|
|
334
|
-
const u = this.build[
|
|
335
|
-
if (
|
|
803
|
+
const u = this.build[r], f = a.build[r];
|
|
804
|
+
if (s("build compare", r, u, f), u === void 0 && f === void 0)
|
|
336
805
|
return 0;
|
|
337
806
|
if (f === void 0)
|
|
338
807
|
return 1;
|
|
@@ -341,34 +810,34 @@ function b() {
|
|
|
341
810
|
if (u === f)
|
|
342
811
|
continue;
|
|
343
812
|
return l(u, f);
|
|
344
|
-
} while (++
|
|
813
|
+
} while (++r);
|
|
345
814
|
}
|
|
346
815
|
// preminor will bump the version up to the next minor release, and immediately
|
|
347
816
|
// down to pre-release. premajor and prepatch work the same way.
|
|
348
|
-
inc(a,
|
|
817
|
+
inc(a, r, u) {
|
|
349
818
|
if (a.startsWith("pre")) {
|
|
350
|
-
if (!
|
|
819
|
+
if (!r && u === !1)
|
|
351
820
|
throw new Error("invalid increment argument: identifier is empty");
|
|
352
|
-
if (
|
|
353
|
-
const f = `-${
|
|
354
|
-
if (!f || f[1] !==
|
|
355
|
-
throw new Error(`invalid identifier: ${
|
|
821
|
+
if (r) {
|
|
822
|
+
const f = `-${r}`.match(this.options.loose ? n[i.PRERELEASELOOSE] : n[i.PRERELEASE]);
|
|
823
|
+
if (!f || f[1] !== r)
|
|
824
|
+
throw new Error(`invalid identifier: ${r}`);
|
|
356
825
|
}
|
|
357
826
|
}
|
|
358
827
|
switch (a) {
|
|
359
828
|
case "premajor":
|
|
360
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre",
|
|
829
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", r, u);
|
|
361
830
|
break;
|
|
362
831
|
case "preminor":
|
|
363
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre",
|
|
832
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", r, u);
|
|
364
833
|
break;
|
|
365
834
|
case "prepatch":
|
|
366
|
-
this.prerelease.length = 0, this.inc("patch",
|
|
835
|
+
this.prerelease.length = 0, this.inc("patch", r, u), this.inc("pre", r, u);
|
|
367
836
|
break;
|
|
368
837
|
// If the input is a non-prerelease version, this acts the same as
|
|
369
838
|
// prepatch.
|
|
370
839
|
case "prerelease":
|
|
371
|
-
this.prerelease.length === 0 && this.inc("patch",
|
|
840
|
+
this.prerelease.length === 0 && this.inc("patch", r, u), this.inc("pre", r, u);
|
|
372
841
|
break;
|
|
373
842
|
case "release":
|
|
374
843
|
if (this.prerelease.length === 0)
|
|
@@ -391,18 +860,18 @@ function b() {
|
|
|
391
860
|
if (this.prerelease.length === 0)
|
|
392
861
|
this.prerelease = [f];
|
|
393
862
|
else {
|
|
394
|
-
let
|
|
395
|
-
for (; --
|
|
396
|
-
typeof this.prerelease[
|
|
397
|
-
if (
|
|
398
|
-
if (
|
|
863
|
+
let E = this.prerelease.length;
|
|
864
|
+
for (; --E >= 0; )
|
|
865
|
+
typeof this.prerelease[E] == "number" && (this.prerelease[E]++, E = -2);
|
|
866
|
+
if (E === -1) {
|
|
867
|
+
if (r === this.prerelease.join(".") && u === !1)
|
|
399
868
|
throw new Error("invalid increment argument: identifier already exists");
|
|
400
869
|
this.prerelease.push(f);
|
|
401
870
|
}
|
|
402
871
|
}
|
|
403
|
-
if (
|
|
404
|
-
let
|
|
405
|
-
u === !1 && (
|
|
872
|
+
if (r) {
|
|
873
|
+
let E = [r, f];
|
|
874
|
+
u === !1 && (E = [r]), l(this.prerelease[0], r) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = E) : this.prerelease = E;
|
|
406
875
|
}
|
|
407
876
|
break;
|
|
408
877
|
}
|
|
@@ -412,206 +881,206 @@ function b() {
|
|
|
412
881
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
413
882
|
}
|
|
414
883
|
}
|
|
415
|
-
return
|
|
884
|
+
return ce = h, ce;
|
|
416
885
|
}
|
|
417
|
-
var
|
|
886
|
+
var ue, ot;
|
|
418
887
|
function M() {
|
|
419
|
-
if (ot) return
|
|
888
|
+
if (ot) return ue;
|
|
420
889
|
ot = 1;
|
|
421
|
-
const
|
|
422
|
-
return
|
|
423
|
-
if (
|
|
424
|
-
return
|
|
890
|
+
const s = x();
|
|
891
|
+
return ue = (t, n, i = !1) => {
|
|
892
|
+
if (t instanceof s)
|
|
893
|
+
return t;
|
|
425
894
|
try {
|
|
426
|
-
return new t
|
|
895
|
+
return new s(t, n);
|
|
427
896
|
} catch (c) {
|
|
428
897
|
if (!i)
|
|
429
898
|
return null;
|
|
430
899
|
throw c;
|
|
431
900
|
}
|
|
432
|
-
},
|
|
901
|
+
}, ue;
|
|
433
902
|
}
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
if (lt) return
|
|
903
|
+
var he, lt;
|
|
904
|
+
function Cr() {
|
|
905
|
+
if (lt) return he;
|
|
437
906
|
lt = 1;
|
|
438
|
-
const
|
|
439
|
-
return
|
|
440
|
-
const i = t
|
|
907
|
+
const s = M();
|
|
908
|
+
return he = (t, n) => {
|
|
909
|
+
const i = s(t, n);
|
|
441
910
|
return i ? i.version : null;
|
|
442
|
-
},
|
|
911
|
+
}, he;
|
|
443
912
|
}
|
|
444
|
-
var
|
|
445
|
-
function
|
|
446
|
-
if (ct) return
|
|
913
|
+
var fe, ct;
|
|
914
|
+
function Pr() {
|
|
915
|
+
if (ct) return fe;
|
|
447
916
|
ct = 1;
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
const i = t
|
|
917
|
+
const s = M();
|
|
918
|
+
return fe = (t, n) => {
|
|
919
|
+
const i = s(t.trim().replace(/^[=v]+/, ""), n);
|
|
451
920
|
return i ? i.version : null;
|
|
452
|
-
},
|
|
921
|
+
}, fe;
|
|
453
922
|
}
|
|
454
|
-
var
|
|
455
|
-
function
|
|
456
|
-
if (ut) return
|
|
923
|
+
var me, ut;
|
|
924
|
+
function qr() {
|
|
925
|
+
if (ut) return me;
|
|
457
926
|
ut = 1;
|
|
458
|
-
const
|
|
459
|
-
return
|
|
927
|
+
const s = x();
|
|
928
|
+
return me = (t, n, i, c, l) => {
|
|
460
929
|
typeof i == "string" && (l = c, c = i, i = void 0);
|
|
461
930
|
try {
|
|
462
|
-
return new
|
|
463
|
-
|
|
931
|
+
return new s(
|
|
932
|
+
t instanceof s ? t.version : t,
|
|
464
933
|
i
|
|
465
934
|
).inc(n, c, l).version;
|
|
466
935
|
} catch {
|
|
467
936
|
return null;
|
|
468
937
|
}
|
|
469
|
-
},
|
|
938
|
+
}, me;
|
|
470
939
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return
|
|
477
|
-
const i = t
|
|
940
|
+
var pe, ht;
|
|
941
|
+
function Gr() {
|
|
942
|
+
if (ht) return pe;
|
|
943
|
+
ht = 1;
|
|
944
|
+
const s = M();
|
|
945
|
+
return pe = (t, n) => {
|
|
946
|
+
const i = s(t, null, !0), c = s(n, null, !0), l = i.compare(c);
|
|
478
947
|
if (l === 0)
|
|
479
948
|
return null;
|
|
480
|
-
const h = l > 0, o = h ? i : c, a = h ? c : i,
|
|
481
|
-
if (!!a.prerelease.length && !
|
|
949
|
+
const h = l > 0, o = h ? i : c, a = h ? c : i, r = !!o.prerelease.length;
|
|
950
|
+
if (!!a.prerelease.length && !r) {
|
|
482
951
|
if (!a.patch && !a.minor)
|
|
483
952
|
return "major";
|
|
484
953
|
if (a.compareMain(o) === 0)
|
|
485
954
|
return a.minor && !a.patch ? "minor" : "patch";
|
|
486
955
|
}
|
|
487
|
-
const f =
|
|
956
|
+
const f = r ? "pre" : "";
|
|
488
957
|
return i.major !== c.major ? f + "major" : i.minor !== c.minor ? f + "minor" : i.patch !== c.patch ? f + "patch" : "prerelease";
|
|
489
|
-
},
|
|
490
|
-
}
|
|
491
|
-
var de, ht;
|
|
492
|
-
function Cr() {
|
|
493
|
-
if (ht) return de;
|
|
494
|
-
ht = 1;
|
|
495
|
-
const t = b();
|
|
496
|
-
return de = (r, n) => new t(r, n).major, de;
|
|
958
|
+
}, pe;
|
|
497
959
|
}
|
|
498
|
-
var
|
|
499
|
-
function
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
return
|
|
960
|
+
var de, ft;
|
|
961
|
+
function br() {
|
|
962
|
+
if (ft) return de;
|
|
963
|
+
ft = 1;
|
|
964
|
+
const s = x();
|
|
965
|
+
return de = (t, n) => new s(t, n).major, de;
|
|
504
966
|
}
|
|
505
967
|
var Ee, mt;
|
|
506
|
-
function
|
|
968
|
+
function Dr() {
|
|
507
969
|
if (mt) return Ee;
|
|
508
970
|
mt = 1;
|
|
509
|
-
const
|
|
510
|
-
return Ee = (
|
|
971
|
+
const s = x();
|
|
972
|
+
return Ee = (t, n) => new s(t, n).minor, Ee;
|
|
511
973
|
}
|
|
512
|
-
var
|
|
513
|
-
function
|
|
514
|
-
if (
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
return
|
|
518
|
-
|
|
974
|
+
var ge, pt;
|
|
975
|
+
function xr() {
|
|
976
|
+
if (pt) return ge;
|
|
977
|
+
pt = 1;
|
|
978
|
+
const s = x();
|
|
979
|
+
return ge = (t, n) => new s(t, n).patch, ge;
|
|
980
|
+
}
|
|
981
|
+
var Re, dt;
|
|
982
|
+
function Ur() {
|
|
983
|
+
if (dt) return Re;
|
|
984
|
+
dt = 1;
|
|
985
|
+
const s = M();
|
|
986
|
+
return Re = (t, n) => {
|
|
987
|
+
const i = s(t, n);
|
|
519
988
|
return i && i.prerelease.length ? i.prerelease : null;
|
|
520
|
-
},
|
|
989
|
+
}, Re;
|
|
521
990
|
}
|
|
522
|
-
var
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
return
|
|
991
|
+
var ve, Et;
|
|
992
|
+
function F() {
|
|
993
|
+
if (Et) return ve;
|
|
994
|
+
Et = 1;
|
|
995
|
+
const s = x();
|
|
996
|
+
return ve = (t, n, i) => new s(t, i).compare(new s(n, i)), ve;
|
|
528
997
|
}
|
|
529
|
-
var
|
|
530
|
-
function
|
|
531
|
-
if (
|
|
998
|
+
var Ie, gt;
|
|
999
|
+
function _r() {
|
|
1000
|
+
if (gt) return Ie;
|
|
1001
|
+
gt = 1;
|
|
1002
|
+
const s = F();
|
|
1003
|
+
return Ie = (t, n, i) => s(n, t, i), Ie;
|
|
1004
|
+
}
|
|
1005
|
+
var $e, Rt;
|
|
1006
|
+
function Fr() {
|
|
1007
|
+
if (Rt) return $e;
|
|
532
1008
|
Rt = 1;
|
|
533
|
-
const
|
|
534
|
-
return
|
|
1009
|
+
const s = F();
|
|
1010
|
+
return $e = (t, n) => s(t, n, !0), $e;
|
|
535
1011
|
}
|
|
536
|
-
var
|
|
537
|
-
function
|
|
538
|
-
if (vt) return
|
|
1012
|
+
var Le, vt;
|
|
1013
|
+
function Ke() {
|
|
1014
|
+
if (vt) return Le;
|
|
539
1015
|
vt = 1;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
542
|
-
|
|
543
|
-
var ge, It;
|
|
544
|
-
function Je() {
|
|
545
|
-
if (It) return ge;
|
|
546
|
-
It = 1;
|
|
547
|
-
const t = b();
|
|
548
|
-
return ge = (r, n, i) => {
|
|
549
|
-
const c = new t(r, i), l = new t(n, i);
|
|
1016
|
+
const s = x();
|
|
1017
|
+
return Le = (t, n, i) => {
|
|
1018
|
+
const c = new s(t, i), l = new s(n, i);
|
|
550
1019
|
return c.compare(l) || c.compareBuild(l);
|
|
551
|
-
},
|
|
1020
|
+
}, Le;
|
|
552
1021
|
}
|
|
553
|
-
var
|
|
554
|
-
function
|
|
555
|
-
if (
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
return
|
|
1022
|
+
var Te, It;
|
|
1023
|
+
function jr() {
|
|
1024
|
+
if (It) return Te;
|
|
1025
|
+
It = 1;
|
|
1026
|
+
const s = Ke();
|
|
1027
|
+
return Te = (t, n) => t.sort((i, c) => s(i, c, n)), Te;
|
|
559
1028
|
}
|
|
560
|
-
var
|
|
561
|
-
function
|
|
562
|
-
if ($t) return
|
|
1029
|
+
var Oe, $t;
|
|
1030
|
+
function kr() {
|
|
1031
|
+
if ($t) return Oe;
|
|
563
1032
|
$t = 1;
|
|
564
|
-
const
|
|
565
|
-
return
|
|
1033
|
+
const s = Ke();
|
|
1034
|
+
return Oe = (t, n) => t.sort((i, c) => s(c, i, n)), Oe;
|
|
566
1035
|
}
|
|
567
|
-
var
|
|
568
|
-
function
|
|
569
|
-
if (Lt) return
|
|
1036
|
+
var Se, Lt;
|
|
1037
|
+
function Z() {
|
|
1038
|
+
if (Lt) return Se;
|
|
570
1039
|
Lt = 1;
|
|
571
|
-
const
|
|
572
|
-
return
|
|
1040
|
+
const s = F();
|
|
1041
|
+
return Se = (t, n, i) => s(t, n, i) > 0, Se;
|
|
573
1042
|
}
|
|
574
1043
|
var Ne, Tt;
|
|
575
|
-
function
|
|
1044
|
+
function Je() {
|
|
576
1045
|
if (Tt) return Ne;
|
|
577
1046
|
Tt = 1;
|
|
578
|
-
const
|
|
579
|
-
return Ne = (
|
|
1047
|
+
const s = F();
|
|
1048
|
+
return Ne = (t, n, i) => s(t, n, i) < 0, Ne;
|
|
580
1049
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
583
|
-
if (
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
return
|
|
1050
|
+
var we, Ot;
|
|
1051
|
+
function cr() {
|
|
1052
|
+
if (Ot) return we;
|
|
1053
|
+
Ot = 1;
|
|
1054
|
+
const s = F();
|
|
1055
|
+
return we = (t, n, i) => s(t, n, i) === 0, we;
|
|
587
1056
|
}
|
|
588
|
-
var
|
|
589
|
-
function
|
|
590
|
-
if (St) return
|
|
1057
|
+
var Ae, St;
|
|
1058
|
+
function ur() {
|
|
1059
|
+
if (St) return Ae;
|
|
591
1060
|
St = 1;
|
|
592
|
-
const
|
|
593
|
-
return
|
|
1061
|
+
const s = F();
|
|
1062
|
+
return Ae = (t, n, i) => s(t, n, i) !== 0, Ae;
|
|
594
1063
|
}
|
|
595
|
-
var
|
|
1064
|
+
var ye, Nt;
|
|
596
1065
|
function Ze() {
|
|
597
|
-
if (
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
return
|
|
1066
|
+
if (Nt) return ye;
|
|
1067
|
+
Nt = 1;
|
|
1068
|
+
const s = F();
|
|
1069
|
+
return ye = (t, n, i) => s(t, n, i) >= 0, ye;
|
|
601
1070
|
}
|
|
602
|
-
var
|
|
1071
|
+
var Ce, wt;
|
|
603
1072
|
function Qe() {
|
|
604
|
-
if (
|
|
605
|
-
At = 1;
|
|
606
|
-
const t = U();
|
|
607
|
-
return we = (r, n, i) => t(r, n, i) <= 0, we;
|
|
608
|
-
}
|
|
609
|
-
var ye, wt;
|
|
610
|
-
function ar() {
|
|
611
|
-
if (wt) return ye;
|
|
1073
|
+
if (wt) return Ce;
|
|
612
1074
|
wt = 1;
|
|
613
|
-
const
|
|
614
|
-
return
|
|
1075
|
+
const s = F();
|
|
1076
|
+
return Ce = (t, n, i) => s(t, n, i) <= 0, Ce;
|
|
1077
|
+
}
|
|
1078
|
+
var Pe, At;
|
|
1079
|
+
function hr() {
|
|
1080
|
+
if (At) return Pe;
|
|
1081
|
+
At = 1;
|
|
1082
|
+
const s = cr(), e = ur(), t = Z(), n = Ze(), i = Je(), c = Qe();
|
|
1083
|
+
return Pe = (h, o, a, r) => {
|
|
615
1084
|
switch (o) {
|
|
616
1085
|
case "===":
|
|
617
1086
|
return typeof h == "object" && (h = h.version), typeof a == "object" && (a = a.version), h === a;
|
|
@@ -620,99 +1089,99 @@ function ar() {
|
|
|
620
1089
|
case "":
|
|
621
1090
|
case "=":
|
|
622
1091
|
case "==":
|
|
623
|
-
return
|
|
1092
|
+
return s(h, a, r);
|
|
624
1093
|
case "!=":
|
|
625
|
-
return
|
|
1094
|
+
return e(h, a, r);
|
|
626
1095
|
case ">":
|
|
627
|
-
return
|
|
1096
|
+
return t(h, a, r);
|
|
628
1097
|
case ">=":
|
|
629
|
-
return n(h, a,
|
|
1098
|
+
return n(h, a, r);
|
|
630
1099
|
case "<":
|
|
631
|
-
return i(h, a,
|
|
1100
|
+
return i(h, a, r);
|
|
632
1101
|
case "<=":
|
|
633
|
-
return c(h, a,
|
|
1102
|
+
return c(h, a, r);
|
|
634
1103
|
default:
|
|
635
1104
|
throw new TypeError(`Invalid operator: ${o}`);
|
|
636
1105
|
}
|
|
637
|
-
},
|
|
1106
|
+
}, Pe;
|
|
638
1107
|
}
|
|
639
|
-
var
|
|
640
|
-
function
|
|
641
|
-
if (yt) return
|
|
1108
|
+
var qe, yt;
|
|
1109
|
+
function Mr() {
|
|
1110
|
+
if (yt) return qe;
|
|
642
1111
|
yt = 1;
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
if (c instanceof
|
|
1112
|
+
const s = x(), e = M(), { safeRe: t, t: n } = W();
|
|
1113
|
+
return qe = (c, l) => {
|
|
1114
|
+
if (c instanceof s)
|
|
646
1115
|
return c;
|
|
647
1116
|
if (typeof c == "number" && (c = String(c)), typeof c != "string")
|
|
648
1117
|
return null;
|
|
649
1118
|
l = l || {};
|
|
650
1119
|
let h = null;
|
|
651
1120
|
if (!l.rtl)
|
|
652
|
-
h = c.match(l.includePrerelease ?
|
|
1121
|
+
h = c.match(l.includePrerelease ? t[n.COERCEFULL] : t[n.COERCE]);
|
|
653
1122
|
else {
|
|
654
|
-
const
|
|
1123
|
+
const E = l.includePrerelease ? t[n.COERCERTLFULL] : t[n.COERCERTL];
|
|
655
1124
|
let S;
|
|
656
|
-
for (; (S =
|
|
657
|
-
(!h || S.index + S[0].length !== h.index + h[0].length) && (h = S),
|
|
658
|
-
|
|
1125
|
+
for (; (S = E.exec(c)) && (!h || h.index + h[0].length !== c.length); )
|
|
1126
|
+
(!h || S.index + S[0].length !== h.index + h[0].length) && (h = S), E.lastIndex = S.index + S[1].length + S[2].length;
|
|
1127
|
+
E.lastIndex = -1;
|
|
659
1128
|
}
|
|
660
1129
|
if (h === null)
|
|
661
1130
|
return null;
|
|
662
|
-
const o = h[2], a = h[3] || "0",
|
|
663
|
-
return
|
|
664
|
-
},
|
|
1131
|
+
const o = h[2], a = h[3] || "0", r = h[4] || "0", u = l.includePrerelease && h[5] ? `-${h[5]}` : "", f = l.includePrerelease && h[6] ? `+${h[6]}` : "";
|
|
1132
|
+
return e(`${o}.${a}.${r}${u}${f}`, l);
|
|
1133
|
+
}, qe;
|
|
665
1134
|
}
|
|
666
|
-
var
|
|
667
|
-
function
|
|
668
|
-
if (Ct) return
|
|
1135
|
+
var Ge, Ct;
|
|
1136
|
+
function Vr() {
|
|
1137
|
+
if (Ct) return Ge;
|
|
669
1138
|
Ct = 1;
|
|
670
|
-
class
|
|
1139
|
+
class s {
|
|
671
1140
|
constructor() {
|
|
672
1141
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
673
1142
|
}
|
|
674
|
-
get(
|
|
675
|
-
const n = this.map.get(
|
|
1143
|
+
get(t) {
|
|
1144
|
+
const n = this.map.get(t);
|
|
676
1145
|
if (n !== void 0)
|
|
677
|
-
return this.map.delete(
|
|
1146
|
+
return this.map.delete(t), this.map.set(t, n), n;
|
|
678
1147
|
}
|
|
679
|
-
delete(
|
|
680
|
-
return this.map.delete(
|
|
1148
|
+
delete(t) {
|
|
1149
|
+
return this.map.delete(t);
|
|
681
1150
|
}
|
|
682
|
-
set(
|
|
683
|
-
if (!this.delete(
|
|
1151
|
+
set(t, n) {
|
|
1152
|
+
if (!this.delete(t) && n !== void 0) {
|
|
684
1153
|
if (this.map.size >= this.max) {
|
|
685
1154
|
const c = this.map.keys().next().value;
|
|
686
1155
|
this.delete(c);
|
|
687
1156
|
}
|
|
688
|
-
this.map.set(
|
|
1157
|
+
this.map.set(t, n);
|
|
689
1158
|
}
|
|
690
1159
|
return this;
|
|
691
1160
|
}
|
|
692
1161
|
}
|
|
693
|
-
return
|
|
1162
|
+
return Ge = s, Ge;
|
|
694
1163
|
}
|
|
695
|
-
var
|
|
1164
|
+
var be, Pt;
|
|
696
1165
|
function j() {
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
class
|
|
701
|
-
constructor(
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
704
|
-
if (
|
|
705
|
-
return this.raw =
|
|
706
|
-
if (this.options =
|
|
1166
|
+
if (Pt) return be;
|
|
1167
|
+
Pt = 1;
|
|
1168
|
+
const s = /\s+/g;
|
|
1169
|
+
class e {
|
|
1170
|
+
constructor(m, v) {
|
|
1171
|
+
if (v = i(v), m instanceof e)
|
|
1172
|
+
return m.loose === !!v.loose && m.includePrerelease === !!v.includePrerelease ? m : new e(m.raw, v);
|
|
1173
|
+
if (m instanceof c)
|
|
1174
|
+
return this.raw = m.value, this.set = [[m]], this.formatted = void 0, this;
|
|
1175
|
+
if (this.options = v, this.loose = !!v.loose, this.includePrerelease = !!v.includePrerelease, this.raw = m.trim().replace(s, " "), this.set = this.raw.split("||").map((g) => this.parseRange(g.trim())).filter((g) => g.length), !this.set.length)
|
|
707
1176
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
708
1177
|
if (this.set.length > 1) {
|
|
709
|
-
const
|
|
710
|
-
if (this.set = this.set.filter((
|
|
711
|
-
this.set = [
|
|
1178
|
+
const g = this.set[0];
|
|
1179
|
+
if (this.set = this.set.filter((I) => !p(I[0])), this.set.length === 0)
|
|
1180
|
+
this.set = [g];
|
|
712
1181
|
else if (this.set.length > 1) {
|
|
713
|
-
for (const
|
|
714
|
-
if (
|
|
715
|
-
this.set = [
|
|
1182
|
+
for (const I of this.set)
|
|
1183
|
+
if (I.length === 1 && O(I[0])) {
|
|
1184
|
+
this.set = [I];
|
|
716
1185
|
break;
|
|
717
1186
|
}
|
|
718
1187
|
}
|
|
@@ -722,11 +1191,11 @@ function j() {
|
|
|
722
1191
|
get range() {
|
|
723
1192
|
if (this.formatted === void 0) {
|
|
724
1193
|
this.formatted = "";
|
|
725
|
-
for (let
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
for (let
|
|
729
|
-
|
|
1194
|
+
for (let m = 0; m < this.set.length; m++) {
|
|
1195
|
+
m > 0 && (this.formatted += "||");
|
|
1196
|
+
const v = this.set[m];
|
|
1197
|
+
for (let g = 0; g < v.length; g++)
|
|
1198
|
+
g > 0 && (this.formatted += " "), this.formatted += v[g].toString().trim();
|
|
730
1199
|
}
|
|
731
1200
|
}
|
|
732
1201
|
return this.formatted;
|
|
@@ -737,479 +1206,478 @@ function j() {
|
|
|
737
1206
|
toString() {
|
|
738
1207
|
return this.range;
|
|
739
1208
|
}
|
|
740
|
-
parseRange(
|
|
741
|
-
const
|
|
742
|
-
if (
|
|
743
|
-
return
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
let
|
|
747
|
-
|
|
748
|
-
const T = /* @__PURE__ */ new Map(), y =
|
|
749
|
-
for (const
|
|
750
|
-
if (
|
|
751
|
-
return [
|
|
752
|
-
T.set(
|
|
1209
|
+
parseRange(m) {
|
|
1210
|
+
const g = ((this.options.includePrerelease && E) | (this.options.loose && S)) + ":" + m, I = n.get(g);
|
|
1211
|
+
if (I)
|
|
1212
|
+
return I;
|
|
1213
|
+
const R = this.options.loose, $ = R ? o[a.HYPHENRANGELOOSE] : o[a.HYPHENRANGE];
|
|
1214
|
+
m = m.replace($, se(this.options.includePrerelease)), l("hyphen replace", m), m = m.replace(o[a.COMPARATORTRIM], r), l("comparator trim", m), m = m.replace(o[a.TILDETRIM], u), l("tilde trim", m), m = m.replace(o[a.CARETTRIM], f), l("caret trim", m);
|
|
1215
|
+
let N = m.split(" ").map((P) => G(P, this.options)).join(" ").split(/\s+/).map((P) => re(P, this.options));
|
|
1216
|
+
R && (N = N.filter((P) => (l("loose invalid filter", P, this.options), !!P.match(o[a.COMPARATORLOOSE])))), l("range list", N);
|
|
1217
|
+
const T = /* @__PURE__ */ new Map(), y = N.map((P) => new c(P, this.options));
|
|
1218
|
+
for (const P of y) {
|
|
1219
|
+
if (p(P))
|
|
1220
|
+
return [P];
|
|
1221
|
+
T.set(P.value, P);
|
|
753
1222
|
}
|
|
754
1223
|
T.size > 1 && T.has("") && T.delete("");
|
|
755
1224
|
const D = [...T.values()];
|
|
756
|
-
return n.set(
|
|
1225
|
+
return n.set(g, D), D;
|
|
757
1226
|
}
|
|
758
|
-
intersects(
|
|
759
|
-
if (!(
|
|
1227
|
+
intersects(m, v) {
|
|
1228
|
+
if (!(m instanceof e))
|
|
760
1229
|
throw new TypeError("a Range is required");
|
|
761
|
-
return this.set.some((
|
|
1230
|
+
return this.set.some((g) => w(g, v) && m.set.some((I) => w(I, v) && g.every((R) => I.every(($) => R.intersects($, v)))));
|
|
762
1231
|
}
|
|
763
1232
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
764
|
-
test(
|
|
765
|
-
if (!
|
|
1233
|
+
test(m) {
|
|
1234
|
+
if (!m)
|
|
766
1235
|
return !1;
|
|
767
|
-
if (typeof
|
|
1236
|
+
if (typeof m == "string")
|
|
768
1237
|
try {
|
|
769
|
-
|
|
1238
|
+
m = new h(m, this.options);
|
|
770
1239
|
} catch {
|
|
771
1240
|
return !1;
|
|
772
1241
|
}
|
|
773
|
-
for (let
|
|
774
|
-
if (
|
|
1242
|
+
for (let v = 0; v < this.set.length; v++)
|
|
1243
|
+
if (ne(this.set[v], m, this.options))
|
|
775
1244
|
return !0;
|
|
776
1245
|
return !1;
|
|
777
1246
|
}
|
|
778
1247
|
}
|
|
779
|
-
|
|
780
|
-
const
|
|
1248
|
+
be = e;
|
|
1249
|
+
const t = Vr(), n = new t(), i = Ye(), c = Q(), l = J(), h = x(), {
|
|
781
1250
|
safeRe: o,
|
|
782
1251
|
t: a,
|
|
783
|
-
comparatorTrimReplace:
|
|
1252
|
+
comparatorTrimReplace: r,
|
|
784
1253
|
tildeTrimReplace: u,
|
|
785
1254
|
caretTrimReplace: f
|
|
786
|
-
} =
|
|
787
|
-
let
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
for (;
|
|
791
|
-
|
|
792
|
-
return
|
|
793
|
-
}, G = (
|
|
794
|
-
const
|
|
795
|
-
return
|
|
796
|
-
l("tilde",
|
|
1255
|
+
} = W(), { FLAG_INCLUDE_PRERELEASE: E, FLAG_LOOSE: S } = K(), p = (d) => d.value === "<0.0.0-0", O = (d) => d.value === "", w = (d, m) => {
|
|
1256
|
+
let v = !0;
|
|
1257
|
+
const g = d.slice();
|
|
1258
|
+
let I = g.pop();
|
|
1259
|
+
for (; v && g.length; )
|
|
1260
|
+
v = g.every((R) => I.intersects(R, m)), I = g.pop();
|
|
1261
|
+
return v;
|
|
1262
|
+
}, G = (d, m) => (d = d.replace(o[a.BUILD], ""), l("comp", d, m), d = C(d, m), l("caret", d), d = b(d, m), l("tildes", d), d = L(d, m), l("xrange", d), d = te(d, m), l("stars", d), d), A = (d) => !d || d.toLowerCase() === "x" || d === "*", b = (d, m) => d.trim().split(/\s+/).map((v) => U(v, m)).join(" "), U = (d, m) => {
|
|
1263
|
+
const v = m.loose ? o[a.TILDELOOSE] : o[a.TILDE];
|
|
1264
|
+
return d.replace(v, (g, I, R, $, N) => {
|
|
1265
|
+
l("tilde", d, g, I, R, $, N);
|
|
797
1266
|
let T;
|
|
798
|
-
return
|
|
1267
|
+
return A(I) ? T = "" : A(R) ? T = `>=${I}.0.0 <${+I + 1}.0.0-0` : A($) ? T = `>=${I}.${R}.0 <${I}.${+R + 1}.0-0` : N ? (l("replaceTilde pr", N), T = `>=${I}.${R}.${$}-${N} <${I}.${+R + 1}.0-0`) : T = `>=${I}.${R}.${$} <${I}.${+R + 1}.0-0`, l("tilde return", T), T;
|
|
799
1268
|
});
|
|
800
|
-
}, C = (
|
|
801
|
-
l("caret",
|
|
802
|
-
const
|
|
803
|
-
return
|
|
804
|
-
l("caret",
|
|
1269
|
+
}, C = (d, m) => d.trim().split(/\s+/).map((v) => q(v, m)).join(" "), q = (d, m) => {
|
|
1270
|
+
l("caret", d, m);
|
|
1271
|
+
const v = m.loose ? o[a.CARETLOOSE] : o[a.CARET], g = m.includePrerelease ? "-0" : "";
|
|
1272
|
+
return d.replace(v, (I, R, $, N, T) => {
|
|
1273
|
+
l("caret", d, I, R, $, N, T);
|
|
805
1274
|
let y;
|
|
806
|
-
return
|
|
1275
|
+
return A(R) ? y = "" : A($) ? y = `>=${R}.0.0${g} <${+R + 1}.0.0-0` : A(N) ? R === "0" ? y = `>=${R}.${$}.0${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.0${g} <${+R + 1}.0.0-0` : T ? (l("replaceCaret pr", T), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${N}-${T} <${R}.${$}.${+N + 1}-0` : y = `>=${R}.${$}.${N}-${T} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${N}-${T} <${+R + 1}.0.0-0`) : (l("no pr"), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${N}${g} <${R}.${$}.${+N + 1}-0` : y = `>=${R}.${$}.${N}${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${N} <${+R + 1}.0.0-0`), l("caret return", y), y;
|
|
807
1276
|
});
|
|
808
|
-
}, L = (
|
|
809
|
-
|
|
810
|
-
const
|
|
811
|
-
return
|
|
812
|
-
l("xRange",
|
|
813
|
-
const y =
|
|
814
|
-
return
|
|
1277
|
+
}, L = (d, m) => (l("replaceXRanges", d, m), d.split(/\s+/).map((v) => V(v, m)).join(" ")), V = (d, m) => {
|
|
1278
|
+
d = d.trim();
|
|
1279
|
+
const v = m.loose ? o[a.XRANGELOOSE] : o[a.XRANGE];
|
|
1280
|
+
return d.replace(v, (g, I, R, $, N, T) => {
|
|
1281
|
+
l("xRange", d, g, I, R, $, N, T);
|
|
1282
|
+
const y = A(R), D = y || A($), P = D || A(N), X = P;
|
|
1283
|
+
return I === "=" && X && (I = ""), T = m.includePrerelease ? "-0" : "", y ? I === ">" || I === "<" ? g = "<0.0.0-0" : g = "*" : I && X ? (D && ($ = 0), N = 0, I === ">" ? (I = ">=", D ? (R = +R + 1, $ = 0, N = 0) : ($ = +$ + 1, N = 0)) : I === "<=" && (I = "<", D ? R = +R + 1 : $ = +$ + 1), I === "<" && (T = "-0"), g = `${I + R}.${$}.${N}${T}`) : D ? g = `>=${R}.0.0${T} <${+R + 1}.0.0-0` : P && (g = `>=${R}.${$}.0${T} <${R}.${+$ + 1}.0-0`), l("xRange return", g), g;
|
|
815
1284
|
});
|
|
816
|
-
},
|
|
817
|
-
for (let
|
|
818
|
-
if (!
|
|
1285
|
+
}, te = (d, m) => (l("replaceStars", d, m), d.trim().replace(o[a.STAR], "")), re = (d, m) => (l("replaceGTE0", d, m), d.trim().replace(o[m.includePrerelease ? a.GTE0PRE : a.GTE0], "")), se = (d) => (m, v, g, I, R, $, N, T, y, D, P, X) => (A(g) ? v = "" : A(I) ? v = `>=${g}.0.0${d ? "-0" : ""}` : A(R) ? v = `>=${g}.${I}.0${d ? "-0" : ""}` : $ ? v = `>=${v}` : v = `>=${v}${d ? "-0" : ""}`, A(y) ? T = "" : A(D) ? T = `<${+y + 1}.0.0-0` : A(P) ? T = `<${y}.${+D + 1}.0-0` : X ? T = `<=${y}.${D}.${P}-${X}` : d ? T = `<${y}.${D}.${+P + 1}-0` : T = `<=${T}`, `${v} ${T}`.trim()), ne = (d, m, v) => {
|
|
1286
|
+
for (let g = 0; g < d.length; g++)
|
|
1287
|
+
if (!d[g].test(m))
|
|
819
1288
|
return !1;
|
|
820
|
-
if (
|
|
821
|
-
for (let
|
|
822
|
-
if (l(
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
1289
|
+
if (m.prerelease.length && !v.includePrerelease) {
|
|
1290
|
+
for (let g = 0; g < d.length; g++)
|
|
1291
|
+
if (l(d[g].semver), d[g].semver !== c.ANY && d[g].semver.prerelease.length > 0) {
|
|
1292
|
+
const I = d[g].semver;
|
|
1293
|
+
if (I.major === m.major && I.minor === m.minor && I.patch === m.patch)
|
|
825
1294
|
return !0;
|
|
826
1295
|
}
|
|
827
1296
|
return !1;
|
|
828
1297
|
}
|
|
829
1298
|
return !0;
|
|
830
1299
|
};
|
|
831
|
-
return
|
|
1300
|
+
return be;
|
|
832
1301
|
}
|
|
833
|
-
var
|
|
834
|
-
function
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
class
|
|
1302
|
+
var De, qt;
|
|
1303
|
+
function Q() {
|
|
1304
|
+
if (qt) return De;
|
|
1305
|
+
qt = 1;
|
|
1306
|
+
const s = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1307
|
+
class e {
|
|
839
1308
|
static get ANY() {
|
|
840
|
-
return
|
|
1309
|
+
return s;
|
|
841
1310
|
}
|
|
842
|
-
constructor(
|
|
843
|
-
if (u =
|
|
844
|
-
if (
|
|
845
|
-
return
|
|
846
|
-
|
|
1311
|
+
constructor(r, u) {
|
|
1312
|
+
if (u = t(u), r instanceof e) {
|
|
1313
|
+
if (r.loose === !!u.loose)
|
|
1314
|
+
return r;
|
|
1315
|
+
r = r.value;
|
|
847
1316
|
}
|
|
848
|
-
|
|
1317
|
+
r = r.trim().split(/\s+/).join(" "), l("comparator", r, u), this.options = u, this.loose = !!u.loose, this.parse(r), this.semver === s ? this.value = "" : this.value = this.operator + this.semver.version, l("comp", this);
|
|
849
1318
|
}
|
|
850
|
-
parse(
|
|
851
|
-
const u = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], f =
|
|
1319
|
+
parse(r) {
|
|
1320
|
+
const u = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], f = r.match(u);
|
|
852
1321
|
if (!f)
|
|
853
|
-
throw new TypeError(`Invalid comparator: ${
|
|
854
|
-
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver =
|
|
1322
|
+
throw new TypeError(`Invalid comparator: ${r}`);
|
|
1323
|
+
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver = s;
|
|
855
1324
|
}
|
|
856
1325
|
toString() {
|
|
857
1326
|
return this.value;
|
|
858
1327
|
}
|
|
859
|
-
test(
|
|
860
|
-
if (l("Comparator.test",
|
|
1328
|
+
test(r) {
|
|
1329
|
+
if (l("Comparator.test", r, this.options.loose), this.semver === s || r === s)
|
|
861
1330
|
return !0;
|
|
862
|
-
if (typeof
|
|
1331
|
+
if (typeof r == "string")
|
|
863
1332
|
try {
|
|
864
|
-
|
|
1333
|
+
r = new h(r, this.options);
|
|
865
1334
|
} catch {
|
|
866
1335
|
return !1;
|
|
867
1336
|
}
|
|
868
|
-
return c(
|
|
1337
|
+
return c(r, this.operator, this.semver, this.options);
|
|
869
1338
|
}
|
|
870
|
-
intersects(
|
|
871
|
-
if (!(
|
|
1339
|
+
intersects(r, u) {
|
|
1340
|
+
if (!(r instanceof e))
|
|
872
1341
|
throw new TypeError("a Comparator is required");
|
|
873
|
-
return this.operator === "" ? this.value === "" ? !0 : new o(
|
|
1342
|
+
return this.operator === "" ? this.value === "" ? !0 : new o(r.value, u).test(this.value) : r.operator === "" ? r.value === "" ? !0 : new o(this.value, u).test(r.semver) : (u = t(u), u.includePrerelease && (this.value === "<0.0.0-0" || r.value === "<0.0.0-0") || !u.includePrerelease && (this.value.startsWith("<0.0.0") || r.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && r.operator.startsWith(">") || this.operator.startsWith("<") && r.operator.startsWith("<") || this.semver.version === r.semver.version && this.operator.includes("=") && r.operator.includes("=") || c(this.semver, "<", r.semver, u) && this.operator.startsWith(">") && r.operator.startsWith("<") || c(this.semver, ">", r.semver, u) && this.operator.startsWith("<") && r.operator.startsWith(">")));
|
|
874
1343
|
}
|
|
875
1344
|
}
|
|
876
|
-
|
|
877
|
-
const
|
|
878
|
-
return
|
|
1345
|
+
De = e;
|
|
1346
|
+
const t = Ye(), { safeRe: n, t: i } = W(), c = hr(), l = J(), h = x(), o = j();
|
|
1347
|
+
return De;
|
|
879
1348
|
}
|
|
880
1349
|
var xe, Gt;
|
|
881
|
-
function
|
|
1350
|
+
function ee() {
|
|
882
1351
|
if (Gt) return xe;
|
|
883
1352
|
Gt = 1;
|
|
884
|
-
const
|
|
885
|
-
return xe = (
|
|
1353
|
+
const s = j();
|
|
1354
|
+
return xe = (t, n, i) => {
|
|
886
1355
|
try {
|
|
887
|
-
n = new
|
|
1356
|
+
n = new s(n, i);
|
|
888
1357
|
} catch {
|
|
889
1358
|
return !1;
|
|
890
1359
|
}
|
|
891
|
-
return n.test(
|
|
1360
|
+
return n.test(t);
|
|
892
1361
|
}, xe;
|
|
893
1362
|
}
|
|
894
|
-
var
|
|
895
|
-
function
|
|
896
|
-
if (
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
return
|
|
1363
|
+
var Ue, bt;
|
|
1364
|
+
function Xr() {
|
|
1365
|
+
if (bt) return Ue;
|
|
1366
|
+
bt = 1;
|
|
1367
|
+
const s = j();
|
|
1368
|
+
return Ue = (t, n) => new s(t, n).set.map((i) => i.map((c) => c.value).join(" ").trim().split(" ")), Ue;
|
|
900
1369
|
}
|
|
901
|
-
var
|
|
902
|
-
function
|
|
903
|
-
if (Dt) return
|
|
1370
|
+
var _e, Dt;
|
|
1371
|
+
function Br() {
|
|
1372
|
+
if (Dt) return _e;
|
|
904
1373
|
Dt = 1;
|
|
905
|
-
const
|
|
906
|
-
return
|
|
1374
|
+
const s = x(), e = j();
|
|
1375
|
+
return _e = (n, i, c) => {
|
|
907
1376
|
let l = null, h = null, o = null;
|
|
908
1377
|
try {
|
|
909
|
-
o = new
|
|
1378
|
+
o = new e(i, c);
|
|
910
1379
|
} catch {
|
|
911
1380
|
return null;
|
|
912
1381
|
}
|
|
913
1382
|
return n.forEach((a) => {
|
|
914
|
-
o.test(a) && (!l || h.compare(a) === -1) && (l = a, h = new
|
|
1383
|
+
o.test(a) && (!l || h.compare(a) === -1) && (l = a, h = new s(l, c));
|
|
915
1384
|
}), l;
|
|
916
|
-
},
|
|
1385
|
+
}, _e;
|
|
917
1386
|
}
|
|
918
|
-
var
|
|
919
|
-
function
|
|
920
|
-
if (
|
|
921
|
-
|
|
922
|
-
const
|
|
923
|
-
return
|
|
1387
|
+
var Fe, xt;
|
|
1388
|
+
function Wr() {
|
|
1389
|
+
if (xt) return Fe;
|
|
1390
|
+
xt = 1;
|
|
1391
|
+
const s = x(), e = j();
|
|
1392
|
+
return Fe = (n, i, c) => {
|
|
924
1393
|
let l = null, h = null, o = null;
|
|
925
1394
|
try {
|
|
926
|
-
o = new
|
|
1395
|
+
o = new e(i, c);
|
|
927
1396
|
} catch {
|
|
928
1397
|
return null;
|
|
929
1398
|
}
|
|
930
1399
|
return n.forEach((a) => {
|
|
931
|
-
o.test(a) && (!l || h.compare(a) === 1) && (l = a, h = new
|
|
1400
|
+
o.test(a) && (!l || h.compare(a) === 1) && (l = a, h = new s(l, c));
|
|
932
1401
|
}), l;
|
|
933
|
-
},
|
|
1402
|
+
}, Fe;
|
|
934
1403
|
}
|
|
935
|
-
var
|
|
936
|
-
function
|
|
937
|
-
if (
|
|
938
|
-
|
|
939
|
-
const
|
|
940
|
-
return
|
|
941
|
-
i = new
|
|
942
|
-
let l = new
|
|
943
|
-
if (i.test(l) || (l = new
|
|
1404
|
+
var je, Ut;
|
|
1405
|
+
function Hr() {
|
|
1406
|
+
if (Ut) return je;
|
|
1407
|
+
Ut = 1;
|
|
1408
|
+
const s = x(), e = j(), t = Z();
|
|
1409
|
+
return je = (i, c) => {
|
|
1410
|
+
i = new e(i, c);
|
|
1411
|
+
let l = new s("0.0.0");
|
|
1412
|
+
if (i.test(l) || (l = new s("0.0.0-0"), i.test(l)))
|
|
944
1413
|
return l;
|
|
945
1414
|
l = null;
|
|
946
1415
|
for (let h = 0; h < i.set.length; ++h) {
|
|
947
1416
|
const o = i.set[h];
|
|
948
1417
|
let a = null;
|
|
949
|
-
o.forEach((
|
|
950
|
-
const u = new
|
|
951
|
-
switch (
|
|
1418
|
+
o.forEach((r) => {
|
|
1419
|
+
const u = new s(r.semver.version);
|
|
1420
|
+
switch (r.operator) {
|
|
952
1421
|
case ">":
|
|
953
1422
|
u.prerelease.length === 0 ? u.patch++ : u.prerelease.push(0), u.raw = u.format();
|
|
954
1423
|
/* fallthrough */
|
|
955
1424
|
case "":
|
|
956
1425
|
case ">=":
|
|
957
|
-
(!a ||
|
|
1426
|
+
(!a || t(u, a)) && (a = u);
|
|
958
1427
|
break;
|
|
959
1428
|
case "<":
|
|
960
1429
|
case "<=":
|
|
961
1430
|
break;
|
|
962
1431
|
/* istanbul ignore next */
|
|
963
1432
|
default:
|
|
964
|
-
throw new Error(`Unexpected operation: ${
|
|
1433
|
+
throw new Error(`Unexpected operation: ${r.operator}`);
|
|
965
1434
|
}
|
|
966
|
-
}), a && (!l ||
|
|
1435
|
+
}), a && (!l || t(l, a)) && (l = a);
|
|
967
1436
|
}
|
|
968
1437
|
return l && i.test(l) ? l : null;
|
|
969
|
-
},
|
|
1438
|
+
}, je;
|
|
970
1439
|
}
|
|
971
|
-
var
|
|
972
|
-
function
|
|
973
|
-
if (
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
return
|
|
1440
|
+
var ke, _t;
|
|
1441
|
+
function zr() {
|
|
1442
|
+
if (_t) return ke;
|
|
1443
|
+
_t = 1;
|
|
1444
|
+
const s = j();
|
|
1445
|
+
return ke = (t, n) => {
|
|
977
1446
|
try {
|
|
978
|
-
return new t
|
|
1447
|
+
return new s(t, n).range || "*";
|
|
979
1448
|
} catch {
|
|
980
1449
|
return null;
|
|
981
1450
|
}
|
|
982
|
-
},
|
|
1451
|
+
}, ke;
|
|
983
1452
|
}
|
|
984
|
-
var
|
|
1453
|
+
var Me, Ft;
|
|
985
1454
|
function et() {
|
|
986
|
-
if (
|
|
987
|
-
|
|
988
|
-
const
|
|
989
|
-
return
|
|
990
|
-
|
|
991
|
-
let S,
|
|
1455
|
+
if (Ft) return Me;
|
|
1456
|
+
Ft = 1;
|
|
1457
|
+
const s = x(), e = Q(), { ANY: t } = e, n = j(), i = ee(), c = Z(), l = Je(), h = Qe(), o = Ze();
|
|
1458
|
+
return Me = (r, u, f, E) => {
|
|
1459
|
+
r = new s(r, E), u = new n(u, E);
|
|
1460
|
+
let S, p, O, w, G;
|
|
992
1461
|
switch (f) {
|
|
993
1462
|
case ">":
|
|
994
|
-
S = c,
|
|
1463
|
+
S = c, p = h, O = l, w = ">", G = ">=";
|
|
995
1464
|
break;
|
|
996
1465
|
case "<":
|
|
997
|
-
S = l,
|
|
1466
|
+
S = l, p = o, O = c, w = "<", G = "<=";
|
|
998
1467
|
break;
|
|
999
1468
|
default:
|
|
1000
1469
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1001
1470
|
}
|
|
1002
|
-
if (i(
|
|
1471
|
+
if (i(r, u, E))
|
|
1003
1472
|
return !1;
|
|
1004
|
-
for (let
|
|
1005
|
-
const
|
|
1006
|
-
let
|
|
1007
|
-
if (
|
|
1008
|
-
|
|
1009
|
-
}),
|
|
1473
|
+
for (let A = 0; A < u.set.length; ++A) {
|
|
1474
|
+
const b = u.set[A];
|
|
1475
|
+
let U = null, C = null;
|
|
1476
|
+
if (b.forEach((q) => {
|
|
1477
|
+
q.semver === t && (q = new e(">=0.0.0")), U = U || q, C = C || q, S(q.semver, U.semver, E) ? U = q : O(q.semver, C.semver, E) && (C = q);
|
|
1478
|
+
}), U.operator === w || U.operator === G || (!C.operator || C.operator === w) && p(r, C.semver))
|
|
1010
1479
|
return !1;
|
|
1011
|
-
if (C.operator === G &&
|
|
1480
|
+
if (C.operator === G && O(r, C.semver))
|
|
1012
1481
|
return !1;
|
|
1013
1482
|
}
|
|
1014
1483
|
return !0;
|
|
1015
|
-
},
|
|
1016
|
-
}
|
|
1017
|
-
var Me, Ft;
|
|
1018
|
-
function Br() {
|
|
1019
|
-
if (Ft) return Me;
|
|
1020
|
-
Ft = 1;
|
|
1021
|
-
const t = et();
|
|
1022
|
-
return Me = (r, n, i) => t(r, n, ">", i), Me;
|
|
1023
|
-
}
|
|
1024
|
-
var Ve, Mt;
|
|
1025
|
-
function Hr() {
|
|
1026
|
-
if (Mt) return Ve;
|
|
1027
|
-
Mt = 1;
|
|
1028
|
-
const t = et();
|
|
1029
|
-
return Ve = (r, n, i) => t(r, n, "<", i), Ve;
|
|
1484
|
+
}, Me;
|
|
1030
1485
|
}
|
|
1031
|
-
var
|
|
1032
|
-
function
|
|
1033
|
-
if (
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
return
|
|
1486
|
+
var Ve, jt;
|
|
1487
|
+
function Yr() {
|
|
1488
|
+
if (jt) return Ve;
|
|
1489
|
+
jt = 1;
|
|
1490
|
+
const s = et();
|
|
1491
|
+
return Ve = (t, n, i) => s(t, n, ">", i), Ve;
|
|
1037
1492
|
}
|
|
1038
1493
|
var Xe, kt;
|
|
1039
|
-
function
|
|
1494
|
+
function Kr() {
|
|
1040
1495
|
if (kt) return Xe;
|
|
1041
1496
|
kt = 1;
|
|
1042
|
-
const
|
|
1043
|
-
return Xe = (
|
|
1497
|
+
const s = et();
|
|
1498
|
+
return Xe = (t, n, i) => s(t, n, "<", i), Xe;
|
|
1499
|
+
}
|
|
1500
|
+
var Be, Mt;
|
|
1501
|
+
function Jr() {
|
|
1502
|
+
if (Mt) return Be;
|
|
1503
|
+
Mt = 1;
|
|
1504
|
+
const s = j();
|
|
1505
|
+
return Be = (t, n, i) => (t = new s(t, i), n = new s(n, i), t.intersects(n, i)), Be;
|
|
1506
|
+
}
|
|
1507
|
+
var We, Vt;
|
|
1508
|
+
function Zr() {
|
|
1509
|
+
if (Vt) return We;
|
|
1510
|
+
Vt = 1;
|
|
1511
|
+
const s = ee(), e = F();
|
|
1512
|
+
return We = (t, n, i) => {
|
|
1044
1513
|
const c = [];
|
|
1045
1514
|
let l = null, h = null;
|
|
1046
|
-
const o =
|
|
1515
|
+
const o = t.sort((f, E) => e(f, E, i));
|
|
1047
1516
|
for (const f of o)
|
|
1048
|
-
|
|
1517
|
+
s(f, n, i) ? (h = f, l || (l = f)) : (h && c.push([l, h]), h = null, l = null);
|
|
1049
1518
|
l && c.push([l, null]);
|
|
1050
1519
|
const a = [];
|
|
1051
|
-
for (const [f,
|
|
1052
|
-
f ===
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1055
|
-
},
|
|
1056
|
-
}
|
|
1057
|
-
var
|
|
1058
|
-
function
|
|
1059
|
-
if (Xt) return
|
|
1520
|
+
for (const [f, E] of c)
|
|
1521
|
+
f === E ? a.push(f) : !E && f === o[0] ? a.push("*") : E ? f === o[0] ? a.push(`<=${E}`) : a.push(`${f} - ${E}`) : a.push(`>=${f}`);
|
|
1522
|
+
const r = a.join(" || "), u = typeof n.raw == "string" ? n.raw : String(n);
|
|
1523
|
+
return r.length < u.length ? r : n;
|
|
1524
|
+
}, We;
|
|
1525
|
+
}
|
|
1526
|
+
var He, Xt;
|
|
1527
|
+
function Qr() {
|
|
1528
|
+
if (Xt) return He;
|
|
1060
1529
|
Xt = 1;
|
|
1061
|
-
const
|
|
1530
|
+
const s = j(), e = Q(), { ANY: t } = e, n = ee(), i = F(), c = (u, f, E = {}) => {
|
|
1062
1531
|
if (u === f)
|
|
1063
1532
|
return !0;
|
|
1064
|
-
u = new
|
|
1533
|
+
u = new s(u, E), f = new s(f, E);
|
|
1065
1534
|
let S = !1;
|
|
1066
|
-
e: for (const
|
|
1067
|
-
for (const
|
|
1068
|
-
const
|
|
1069
|
-
if (S = S ||
|
|
1535
|
+
e: for (const p of u.set) {
|
|
1536
|
+
for (const O of f.set) {
|
|
1537
|
+
const w = o(p, O, E);
|
|
1538
|
+
if (S = S || w !== null, w)
|
|
1070
1539
|
continue e;
|
|
1071
1540
|
}
|
|
1072
1541
|
if (S)
|
|
1073
1542
|
return !1;
|
|
1074
1543
|
}
|
|
1075
1544
|
return !0;
|
|
1076
|
-
}, l = [new
|
|
1545
|
+
}, l = [new e(">=0.0.0-0")], h = [new e(">=0.0.0")], o = (u, f, E) => {
|
|
1077
1546
|
if (u === f)
|
|
1078
1547
|
return !0;
|
|
1079
|
-
if (u.length === 1 && u[0].semver ===
|
|
1080
|
-
if (f.length === 1 && f[0].semver ===
|
|
1548
|
+
if (u.length === 1 && u[0].semver === t) {
|
|
1549
|
+
if (f.length === 1 && f[0].semver === t)
|
|
1081
1550
|
return !0;
|
|
1082
|
-
|
|
1551
|
+
E.includePrerelease ? u = l : u = h;
|
|
1083
1552
|
}
|
|
1084
|
-
if (f.length === 1 && f[0].semver ===
|
|
1085
|
-
if (
|
|
1553
|
+
if (f.length === 1 && f[0].semver === t) {
|
|
1554
|
+
if (E.includePrerelease)
|
|
1086
1555
|
return !0;
|
|
1087
1556
|
f = h;
|
|
1088
1557
|
}
|
|
1089
1558
|
const S = /* @__PURE__ */ new Set();
|
|
1090
|
-
let
|
|
1559
|
+
let p, O;
|
|
1091
1560
|
for (const L of u)
|
|
1092
|
-
L.operator === ">" || L.operator === ">=" ?
|
|
1561
|
+
L.operator === ">" || L.operator === ">=" ? p = a(p, L, E) : L.operator === "<" || L.operator === "<=" ? O = r(O, L, E) : S.add(L.semver);
|
|
1093
1562
|
if (S.size > 1)
|
|
1094
1563
|
return null;
|
|
1095
|
-
let
|
|
1096
|
-
if (
|
|
1097
|
-
if (
|
|
1564
|
+
let w;
|
|
1565
|
+
if (p && O) {
|
|
1566
|
+
if (w = i(p.semver, O.semver, E), w > 0)
|
|
1098
1567
|
return null;
|
|
1099
|
-
if (
|
|
1568
|
+
if (w === 0 && (p.operator !== ">=" || O.operator !== "<="))
|
|
1100
1569
|
return null;
|
|
1101
1570
|
}
|
|
1102
1571
|
for (const L of S) {
|
|
1103
|
-
if (
|
|
1572
|
+
if (p && !n(L, String(p), E) || O && !n(L, String(O), E))
|
|
1104
1573
|
return null;
|
|
1105
1574
|
for (const V of f)
|
|
1106
|
-
if (!n(L, String(V),
|
|
1575
|
+
if (!n(L, String(V), E))
|
|
1107
1576
|
return !1;
|
|
1108
1577
|
return !0;
|
|
1109
1578
|
}
|
|
1110
|
-
let G,
|
|
1111
|
-
C && C.prerelease.length === 1 &&
|
|
1579
|
+
let G, A, b, U, C = O && !E.includePrerelease && O.semver.prerelease.length ? O.semver : !1, q = p && !E.includePrerelease && p.semver.prerelease.length ? p.semver : !1;
|
|
1580
|
+
C && C.prerelease.length === 1 && O.operator === "<" && C.prerelease[0] === 0 && (C = !1);
|
|
1112
1581
|
for (const L of f) {
|
|
1113
|
-
if (
|
|
1114
|
-
if (
|
|
1115
|
-
if (G = a(
|
|
1582
|
+
if (U = U || L.operator === ">" || L.operator === ">=", b = b || L.operator === "<" || L.operator === "<=", p) {
|
|
1583
|
+
if (q && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === q.major && L.semver.minor === q.minor && L.semver.patch === q.patch && (q = !1), L.operator === ">" || L.operator === ">=") {
|
|
1584
|
+
if (G = a(p, L, E), G === L && G !== p)
|
|
1116
1585
|
return !1;
|
|
1117
|
-
} else if (
|
|
1586
|
+
} else if (p.operator === ">=" && !n(p.semver, String(L), E))
|
|
1118
1587
|
return !1;
|
|
1119
1588
|
}
|
|
1120
|
-
if (
|
|
1589
|
+
if (O) {
|
|
1121
1590
|
if (C && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === C.major && L.semver.minor === C.minor && L.semver.patch === C.patch && (C = !1), L.operator === "<" || L.operator === "<=") {
|
|
1122
|
-
if (
|
|
1591
|
+
if (A = r(O, L, E), A === L && A !== O)
|
|
1123
1592
|
return !1;
|
|
1124
|
-
} else if (
|
|
1593
|
+
} else if (O.operator === "<=" && !n(O.semver, String(L), E))
|
|
1125
1594
|
return !1;
|
|
1126
1595
|
}
|
|
1127
|
-
if (!L.operator && (
|
|
1596
|
+
if (!L.operator && (O || p) && w !== 0)
|
|
1128
1597
|
return !1;
|
|
1129
1598
|
}
|
|
1130
|
-
return !(
|
|
1131
|
-
}, a = (u, f,
|
|
1599
|
+
return !(p && b && !O && w !== 0 || O && U && !p && w !== 0 || q || C);
|
|
1600
|
+
}, a = (u, f, E) => {
|
|
1132
1601
|
if (!u)
|
|
1133
1602
|
return f;
|
|
1134
|
-
const S = i(u.semver, f.semver,
|
|
1603
|
+
const S = i(u.semver, f.semver, E);
|
|
1135
1604
|
return S > 0 ? u : S < 0 || f.operator === ">" && u.operator === ">=" ? f : u;
|
|
1136
|
-
},
|
|
1605
|
+
}, r = (u, f, E) => {
|
|
1137
1606
|
if (!u)
|
|
1138
1607
|
return f;
|
|
1139
|
-
const S = i(u.semver, f.semver,
|
|
1608
|
+
const S = i(u.semver, f.semver, E);
|
|
1140
1609
|
return S < 0 ? u : S > 0 || f.operator === "<" && u.operator === "<=" ? f : u;
|
|
1141
1610
|
};
|
|
1142
|
-
return
|
|
1611
|
+
return He = c, He;
|
|
1143
1612
|
}
|
|
1144
|
-
var
|
|
1145
|
-
function
|
|
1146
|
-
if (Bt) return
|
|
1613
|
+
var ze, Bt;
|
|
1614
|
+
function es() {
|
|
1615
|
+
if (Bt) return ze;
|
|
1147
1616
|
Bt = 1;
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1617
|
+
const s = W(), e = K(), t = x(), n = lr(), i = M(), c = Cr(), l = Pr(), h = qr(), o = Gr(), a = br(), r = Dr(), u = xr(), f = Ur(), E = F(), S = _r(), p = Fr(), O = Ke(), w = jr(), G = kr(), A = Z(), b = Je(), U = cr(), C = ur(), q = Ze(), L = Qe(), V = hr(), te = Mr(), re = Q(), se = j(), ne = ee(), d = Xr(), m = Br(), v = Wr(), g = Hr(), I = zr(), R = et(), $ = Yr(), N = Kr(), T = Jr(), y = Zr(), D = Qr();
|
|
1618
|
+
return ze = {
|
|
1150
1619
|
parse: i,
|
|
1151
1620
|
valid: c,
|
|
1152
1621
|
clean: l,
|
|
1153
1622
|
inc: h,
|
|
1154
1623
|
diff: o,
|
|
1155
1624
|
major: a,
|
|
1156
|
-
minor:
|
|
1625
|
+
minor: r,
|
|
1157
1626
|
patch: u,
|
|
1158
1627
|
prerelease: f,
|
|
1159
|
-
compare:
|
|
1628
|
+
compare: E,
|
|
1160
1629
|
rcompare: S,
|
|
1161
|
-
compareLoose:
|
|
1162
|
-
compareBuild:
|
|
1163
|
-
sort:
|
|
1630
|
+
compareLoose: p,
|
|
1631
|
+
compareBuild: O,
|
|
1632
|
+
sort: w,
|
|
1164
1633
|
rsort: G,
|
|
1165
|
-
gt:
|
|
1166
|
-
lt:
|
|
1167
|
-
eq:
|
|
1634
|
+
gt: A,
|
|
1635
|
+
lt: b,
|
|
1636
|
+
eq: U,
|
|
1168
1637
|
neq: C,
|
|
1169
|
-
gte:
|
|
1638
|
+
gte: q,
|
|
1170
1639
|
lte: L,
|
|
1171
1640
|
cmp: V,
|
|
1172
|
-
coerce:
|
|
1173
|
-
Comparator:
|
|
1174
|
-
Range:
|
|
1175
|
-
satisfies:
|
|
1176
|
-
toComparators:
|
|
1177
|
-
maxSatisfying:
|
|
1178
|
-
minSatisfying:
|
|
1179
|
-
minVersion:
|
|
1180
|
-
validRange:
|
|
1181
|
-
outside:
|
|
1641
|
+
coerce: te,
|
|
1642
|
+
Comparator: re,
|
|
1643
|
+
Range: se,
|
|
1644
|
+
satisfies: ne,
|
|
1645
|
+
toComparators: d,
|
|
1646
|
+
maxSatisfying: m,
|
|
1647
|
+
minSatisfying: v,
|
|
1648
|
+
minVersion: g,
|
|
1649
|
+
validRange: I,
|
|
1650
|
+
outside: R,
|
|
1182
1651
|
gtr: $,
|
|
1183
|
-
ltr:
|
|
1652
|
+
ltr: N,
|
|
1184
1653
|
intersects: T,
|
|
1185
1654
|
simplifyRange: y,
|
|
1186
1655
|
subset: D,
|
|
1187
|
-
SemVer:
|
|
1188
|
-
re:
|
|
1189
|
-
src:
|
|
1190
|
-
tokens:
|
|
1191
|
-
SEMVER_SPEC_VERSION:
|
|
1192
|
-
RELEASE_TYPES:
|
|
1656
|
+
SemVer: t,
|
|
1657
|
+
re: s.re,
|
|
1658
|
+
src: s.src,
|
|
1659
|
+
tokens: s.t,
|
|
1660
|
+
SEMVER_SPEC_VERSION: e.SEMVER_SPEC_VERSION,
|
|
1661
|
+
RELEASE_TYPES: e.RELEASE_TYPES,
|
|
1193
1662
|
compareIdentifiers: n.compareIdentifiers,
|
|
1194
1663
|
rcompareIdentifiers: n.rcompareIdentifiers
|
|
1195
|
-
},
|
|
1664
|
+
}, ze;
|
|
1196
1665
|
}
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1199
|
-
class
|
|
1200
|
-
config = new
|
|
1201
|
-
event = new
|
|
1666
|
+
var ts = es();
|
|
1667
|
+
const Wt = `^${z.Version}`;
|
|
1668
|
+
class is {
|
|
1669
|
+
config = new mr(Ht);
|
|
1670
|
+
event = new pr();
|
|
1202
1671
|
state;
|
|
1203
1672
|
active;
|
|
1204
1673
|
time;
|
|
1205
|
-
offset;
|
|
1206
1674
|
info;
|
|
1207
|
-
|
|
1675
|
+
merger = new wr();
|
|
1676
|
+
offset = new Ar();
|
|
1677
|
+
driver = new yr();
|
|
1208
1678
|
constructor() {
|
|
1209
1679
|
this.state = {
|
|
1210
1680
|
playing: !1,
|
|
1211
|
-
frameId: null,
|
|
1212
|
-
timerId: null,
|
|
1213
1681
|
scanIndex: 0
|
|
1214
1682
|
}, this.active = {
|
|
1215
1683
|
lines: [],
|
|
@@ -1217,14 +1685,11 @@ class ts {
|
|
|
1217
1685
|
}, this.time = {
|
|
1218
1686
|
start: 0,
|
|
1219
1687
|
seek: 0
|
|
1220
|
-
}, this.
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
onConfigUpdate = (s) => {
|
|
1226
|
-
const r = s.has("offset.useMeta");
|
|
1227
|
-
r && this.handleRefreshOffset(), (r || s.has("offset.global")) && this.handleSyncTime(), s.has("mergeWindow") && (this.handleBuildMergedLineEnd(), this.handleSyncTime());
|
|
1688
|
+
}, this.info = new z.Info(), this.config.event.add("update", this.onConfigUpdate);
|
|
1689
|
+
}
|
|
1690
|
+
onConfigUpdate = (e) => {
|
|
1691
|
+
const t = e.has("offset.useMeta");
|
|
1692
|
+
t && this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), (t || e.has("offset.global")) && this.handleSyncTime(), (e.has("mergeWindow") || e.has("mergeLimit")) && (this.handleBuildMergedLineEnd(), this.handleSyncTime());
|
|
1228
1693
|
};
|
|
1229
1694
|
// Get current playback time.
|
|
1230
1695
|
handleGetCurrentTime() {
|
|
@@ -1234,53 +1699,24 @@ class ts {
|
|
|
1234
1699
|
handleGetEffectiveTime() {
|
|
1235
1700
|
return this.handleGetCurrentTime() + this.currentOffset;
|
|
1236
1701
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
const r = this.info.metas.find((i) => i.type === X.MetaType.Offset)?.content, n = typeof r == "number" && Number.isFinite(r) ? r : 0;
|
|
1241
|
-
this.offset.meta = n;
|
|
1242
|
-
} else
|
|
1243
|
-
this.offset.meta = 0;
|
|
1244
|
-
}
|
|
1245
|
-
handleGetLineTime(s) {
|
|
1246
|
-
if (s < 0 || s >= this.info.lines.length)
|
|
1247
|
-
return 0;
|
|
1248
|
-
if (s === this.info.lines.length - 1)
|
|
1249
|
-
return 1 / 0;
|
|
1250
|
-
const r = this.info.lines[s], n = this.info.lines[s + 1];
|
|
1251
|
-
return Math.max(r.time.end, n.time.start);
|
|
1252
|
-
}
|
|
1702
|
+
/**
|
|
1703
|
+
* Rebuild the merged line-end table from the current lyric and merge config.
|
|
1704
|
+
*/
|
|
1253
1705
|
handleBuildMergedLineEnd() {
|
|
1254
|
-
|
|
1255
|
-
if (s === 0) {
|
|
1256
|
-
this.mergedLineEnd = r;
|
|
1257
|
-
return;
|
|
1258
|
-
}
|
|
1259
|
-
const n = Math.max(0, this.config.current.mergeWindow);
|
|
1260
|
-
let i = this.handleGetLineTime(s - 1);
|
|
1261
|
-
r[s - 1] = i;
|
|
1262
|
-
for (let c = s - 2; c >= 0; c--) {
|
|
1263
|
-
const l = this.handleGetLineTime(c);
|
|
1264
|
-
n > 0 && Math.abs(i - l) < n ? r[c] = Math.max(l, r[c + 1]) : r[c] = l, i = l;
|
|
1265
|
-
}
|
|
1266
|
-
this.mergedLineEnd = r;
|
|
1267
|
-
}
|
|
1268
|
-
handleGetMergedLineTime(s) {
|
|
1269
|
-
const r = this.mergedLineEnd[s];
|
|
1270
|
-
return r === void 0 ? this.handleGetLineTime(s) : r;
|
|
1706
|
+
this.merger.build(this.info.lines, this.config.current.mergeWindow, this.config.current.mergeLimit);
|
|
1271
1707
|
}
|
|
1272
1708
|
handleGetActiveIndex() {
|
|
1273
1709
|
return this.active.index.length > 0 ? this.active.index[0] : -1;
|
|
1274
1710
|
}
|
|
1275
|
-
handleBridgeActive(
|
|
1276
|
-
if (!this.config.current.bridgeActive ||
|
|
1277
|
-
return { lines:
|
|
1278
|
-
const n =
|
|
1279
|
-
if (i - n + 1 ===
|
|
1280
|
-
return { lines:
|
|
1711
|
+
handleBridgeActive(e, t) {
|
|
1712
|
+
if (!this.config.current.bridgeActive || t.length < 2)
|
|
1713
|
+
return { lines: e, index: t };
|
|
1714
|
+
const n = t[0], i = t[t.length - 1];
|
|
1715
|
+
if (i - n + 1 === t.length)
|
|
1716
|
+
return { lines: e, index: t };
|
|
1281
1717
|
const c = /* @__PURE__ */ new Map();
|
|
1282
|
-
for (let o = 0; o <
|
|
1283
|
-
c.set(
|
|
1718
|
+
for (let o = 0; o < t.length; o++)
|
|
1719
|
+
c.set(t[o], e[o]);
|
|
1284
1720
|
const l = [], h = [];
|
|
1285
1721
|
for (let o = n; o <= i; o++) {
|
|
1286
1722
|
const a = c.get(o) ?? this.info.lines[o];
|
|
@@ -1288,109 +1724,109 @@ class ts {
|
|
|
1288
1724
|
}
|
|
1289
1725
|
return { lines: l, index: h };
|
|
1290
1726
|
}
|
|
1291
|
-
handleEmitLinesUpdate(
|
|
1292
|
-
const
|
|
1293
|
-
this.event.emit("linesUpdate",
|
|
1727
|
+
handleEmitLinesUpdate(e) {
|
|
1728
|
+
const t = this.handleBridgeActive(this.active.lines, this.active.index);
|
|
1729
|
+
this.event.emit("linesUpdate", t.lines, t.index, this.handleGetActiveIndex(), e);
|
|
1294
1730
|
}
|
|
1295
|
-
handleSyncTime(
|
|
1296
|
-
if (!this.info.lines.length || (
|
|
1731
|
+
handleSyncTime(e) {
|
|
1732
|
+
if (!this.info.lines.length || (e === void 0 && (e = this.handleGetEffectiveTime()), !Number.isFinite(e)))
|
|
1297
1733
|
return;
|
|
1298
|
-
const
|
|
1734
|
+
const t = [], n = [];
|
|
1299
1735
|
let i = this.info.lines.length;
|
|
1300
1736
|
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1301
1737
|
const l = this.info.lines[c];
|
|
1302
|
-
if (l.time.start >
|
|
1738
|
+
if (l.time.start > e) {
|
|
1303
1739
|
i = c;
|
|
1304
1740
|
break;
|
|
1305
1741
|
}
|
|
1306
|
-
this.
|
|
1742
|
+
this.merger.getMergedTime(c) > e && (t.push(l), n.push(c));
|
|
1307
1743
|
}
|
|
1308
|
-
this.state.scanIndex = i, this.active.lines =
|
|
1744
|
+
this.state.scanIndex = i, this.active.lines = t, this.active.index = n, this.handleEmitLinesUpdate(!0);
|
|
1309
1745
|
}
|
|
1310
|
-
handleUpdateActiveLines(
|
|
1311
|
-
let
|
|
1746
|
+
handleUpdateActiveLines(e) {
|
|
1747
|
+
let t = !1;
|
|
1312
1748
|
const n = [], i = [];
|
|
1313
1749
|
for (let c = 0; c < this.active.lines.length; c++) {
|
|
1314
1750
|
const l = this.active.lines[c], h = this.active.index[c];
|
|
1315
|
-
|
|
1751
|
+
e >= this.merger.getMergedTime(h) ? t = !0 : (n.push(l), i.push(h));
|
|
1316
1752
|
}
|
|
1317
1753
|
for (; this.state.scanIndex < this.info.lines.length; ) {
|
|
1318
1754
|
const c = this.info.lines[this.state.scanIndex];
|
|
1319
|
-
if (
|
|
1320
|
-
|
|
1755
|
+
if (e >= c.time.start)
|
|
1756
|
+
e < this.merger.getMergedTime(this.state.scanIndex) && (n.push(c), i.push(this.state.scanIndex), t = !0), this.state.scanIndex++;
|
|
1321
1757
|
else
|
|
1322
1758
|
break;
|
|
1323
1759
|
}
|
|
1324
|
-
|
|
1760
|
+
t && (this.active.lines = n, this.active.index = i, this.handleEmitLinesUpdate(!1));
|
|
1325
1761
|
}
|
|
1326
1762
|
onTick = () => {
|
|
1327
1763
|
if (!this.state.playing)
|
|
1328
1764
|
return;
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
case "animation":
|
|
1332
|
-
this.state.frameId = globalThis.requestAnimationFrame(this.onTick);
|
|
1333
|
-
break;
|
|
1334
|
-
case "timer":
|
|
1335
|
-
this.state.timerId = globalThis.setTimeout(this.onTick, 16);
|
|
1336
|
-
break;
|
|
1337
|
-
}
|
|
1765
|
+
const e = this.handleGetEffectiveTime();
|
|
1766
|
+
this.handleUpdateActiveLines(e), this.driver.schedule(this.config.current.driver, this.onTick);
|
|
1338
1767
|
};
|
|
1339
|
-
updateLyric(
|
|
1340
|
-
if (!
|
|
1768
|
+
updateLyric(e) {
|
|
1769
|
+
if (!e)
|
|
1341
1770
|
return;
|
|
1342
|
-
let
|
|
1343
|
-
|
|
1771
|
+
let t = e;
|
|
1772
|
+
ts.satisfies(e.version, Wt) || (console.warn(`[music-lyric-player] ignored lyric with incompatible version "${e.version}", expected "${Wt}"`), t = new z.Info()), this.pause(), this.info = t, this.handleBuildMergedLineEnd(), this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), this.config.current.offset.resetTempOnLyricChange && this.offset.resetTemp(), this.active.lines = [], this.active.index = [], this.state.scanIndex = 0, this.time.seek = 0, this.event.emit("lyricUpdate", t), this.event.emit("linesUpdate", [], [], -1, !1);
|
|
1344
1773
|
}
|
|
1345
1774
|
/**
|
|
1346
1775
|
* Start playback
|
|
1776
|
+
*
|
|
1347
1777
|
* @param time Optional time in ms to seek to before starting playback. If not provided, playback will start from the current position.
|
|
1348
1778
|
*/
|
|
1349
|
-
play(
|
|
1350
|
-
this.pause(), typeof
|
|
1779
|
+
play(e) {
|
|
1780
|
+
this.pause(), typeof e == "number" && Number.isFinite(e) && (this.time.seek = e, this.handleSyncTime()), this.time.start = performance.now(), this.state.playing = !0, this.onTick(), this.event.emit("play", this.handleGetCurrentTime());
|
|
1351
1781
|
}
|
|
1352
1782
|
/**
|
|
1353
1783
|
* Pause playback
|
|
1354
1784
|
*/
|
|
1355
1785
|
pause() {
|
|
1356
|
-
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.
|
|
1786
|
+
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.driver.cancel();
|
|
1357
1787
|
}
|
|
1358
1788
|
/**
|
|
1359
1789
|
* Stop playback
|
|
1360
1790
|
*/
|
|
1361
1791
|
dispose() {
|
|
1362
|
-
this.pause(), this.event.clear(), this.config.event.remove("update", this.onConfigUpdate), this.active.lines = [], this.active.index = [], this.info = new
|
|
1792
|
+
this.pause(), this.event.clear(), this.config.event.remove("update", this.onConfigUpdate), this.active.lines = [], this.active.index = [], this.info = new z.Info();
|
|
1363
1793
|
}
|
|
1364
1794
|
/**
|
|
1365
1795
|
* Update the temp offset in ms (the user's temporary adjustment).
|
|
1796
|
+
*
|
|
1366
1797
|
* Stacked on top of the global config offset and the lyric's meta offset, then resyncs immediately.
|
|
1798
|
+
*
|
|
1367
1799
|
* @param value temp offset in ms; non-finite values are treated as 0.
|
|
1368
1800
|
*/
|
|
1369
|
-
updateTempOffset(
|
|
1370
|
-
this.offset.
|
|
1801
|
+
updateTempOffset(e) {
|
|
1802
|
+
this.offset.setTemp(e), this.handleSyncTime();
|
|
1371
1803
|
}
|
|
1372
1804
|
/**
|
|
1373
1805
|
* Find all active lines at the given time (ms). Does not mutate internal state.
|
|
1806
|
+
*
|
|
1374
1807
|
* Assumes `info.lines` is sorted by `time.start` ascending.
|
|
1808
|
+
*
|
|
1375
1809
|
* @param time time in ms to find active lines for.
|
|
1376
1810
|
*/
|
|
1377
|
-
matchLinesWithTime(
|
|
1378
|
-
const
|
|
1811
|
+
matchLinesWithTime(e) {
|
|
1812
|
+
const t = e + this.currentOffset, n = [], i = [];
|
|
1379
1813
|
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1380
1814
|
const l = this.info.lines[c];
|
|
1381
|
-
if (l.time.start >
|
|
1815
|
+
if (l.time.start > t)
|
|
1382
1816
|
break;
|
|
1383
|
-
this.
|
|
1817
|
+
this.merger.getMergedTime(c) > t && (n.push(l), i.push(c));
|
|
1384
1818
|
}
|
|
1385
1819
|
return this.handleBridgeActive(n, i);
|
|
1386
1820
|
}
|
|
1387
1821
|
/**
|
|
1388
1822
|
* Convert a content (lyric) time to the playback clock by removing the active offset.
|
|
1823
|
+
*
|
|
1389
1824
|
* Seeking playback to the returned time makes a line at `contentTime` become active.
|
|
1825
|
+
*
|
|
1390
1826
|
* @param contentTime content time in ms (e.g. a line's start).
|
|
1391
1827
|
*/
|
|
1392
|
-
convertContentTime(
|
|
1393
|
-
return
|
|
1828
|
+
convertContentTime(e) {
|
|
1829
|
+
return e - this.currentOffset;
|
|
1394
1830
|
}
|
|
1395
1831
|
/**
|
|
1396
1832
|
* Whether the player is currently playing.
|
|
@@ -1432,12 +1868,11 @@ class ts {
|
|
|
1432
1868
|
* The current effective lyric offset in ms (config offset + lyric meta offset + temp offset).
|
|
1433
1869
|
*/
|
|
1434
1870
|
get currentOffset() {
|
|
1435
|
-
|
|
1436
|
-
return Number.isFinite(s) ? s : 0;
|
|
1871
|
+
return this.offset.resolve(this.config.current.offset.global);
|
|
1437
1872
|
}
|
|
1438
1873
|
}
|
|
1439
1874
|
export {
|
|
1440
|
-
|
|
1441
|
-
|
|
1875
|
+
is as BaseLyricPlayer,
|
|
1876
|
+
ns as BaseLyricPlayerConfig
|
|
1442
1877
|
};
|
|
1443
1878
|
//# sourceMappingURL=index.ecma.js.map
|