@extable/sequence 0.1.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,52 +1,52 @@
1
- const m = (e) => e.trim().normalize("NFKC").toLowerCase().replace(/\s+/g, " "), j = (e) => {
1
+ const g = (e) => e.trim().normalize("NFKC").toLowerCase().replace(/\s+/g, " "), V = (e) => {
2
2
  const t = [];
3
3
  if (e)
4
4
  for (const n of e) {
5
- const r = n.trim();
6
- !r || t.includes(r) || t.push(r);
5
+ const s = n.trim();
6
+ !s || t.includes(s) || t.push(s);
7
7
  }
8
8
  return t.length === 0 ? t.push("en") : t.includes("en") || t.push("en"), t;
9
- }, T = (e, t) => {
9
+ }, J = (e, t) => {
10
10
  const n = e.items.indexOf(t);
11
11
  if (n !== -1)
12
12
  return n;
13
13
  if (!e.aliases)
14
14
  return null;
15
- const r = e.aliases[t];
16
- if (!r)
15
+ const s = e.aliases[t];
16
+ if (!s)
17
17
  return null;
18
- const s = e.items.indexOf(r);
19
- return s === -1 ? null : s;
20
- }, M = (e, t) => {
21
- const n = m(t);
22
- if (m(e.id).includes(n))
18
+ const r = e.items.indexOf(s);
19
+ return r === -1 ? null : r;
20
+ }, R = (e, t) => {
21
+ const n = g(t);
22
+ if (g(e.id).includes(n))
23
23
  return !0;
24
- for (const r of e.items)
25
- if (m(r).includes(n))
24
+ for (const s of e.items)
25
+ if (g(s).includes(n))
26
26
  return !0;
27
27
  return e.aliases ? Object.keys(e.aliases).some(
28
- (r) => m(r).includes(n)
28
+ (s) => g(s).includes(n)
29
29
  ) : !1;
30
- }, w = (e, t) => {
30
+ }, D = (e, t) => {
31
31
  if (e.langs.length === 0)
32
32
  return 0;
33
33
  let n = Number.POSITIVE_INFINITY;
34
- for (const r of e.langs) {
35
- const s = t.indexOf(r);
36
- s !== -1 && s < n && (n = s);
34
+ for (const s of e.langs) {
35
+ const r = t.indexOf(s);
36
+ r !== -1 && r < n && (n = r);
37
37
  }
38
38
  return n;
39
- }, E = (e, t) => !e.langs || e.langs.length === 0 ? !0 : e.langs.some((n) => t.includes(n));
40
- class J {
39
+ }, K = (e, t) => !e.langs || e.langs.length === 0 ? !0 : e.langs.some((n) => t.includes(n));
40
+ class z {
41
41
  constructor(t) {
42
- this.lists = [], this.matchers = [], this.langs = j(t?.langs);
42
+ this.lists = [], this.matchers = [], this.langs = V(t?.langs);
43
43
  }
44
44
  register(t) {
45
- const n = this.lists.findIndex((r) => r.id === t.id);
45
+ const n = this.lists.findIndex((s) => s.id === t.id);
46
46
  n === -1 ? this.lists.push(t) : this.lists[n] = t;
47
47
  }
48
48
  registerMatch(t) {
49
- const n = this.matchers.findIndex((r) => r.id === t.id);
49
+ const n = this.matchers.findIndex((s) => s.id === t.id);
50
50
  n === -1 ? this.matchers.push(t) : this.matchers[n] = t;
51
51
  }
52
52
  unregister(t) {
@@ -55,124 +55,116 @@ class J {
55
55
  list(t) {
56
56
  let n = [...this.lists];
57
57
  if (t?.enabledIds && t.enabledIds.length > 0) {
58
- const s = new Set(t.enabledIds);
59
- n = n.filter((i) => s.has(i.id));
58
+ const r = new Set(t.enabledIds);
59
+ n = n.filter((o) => r.has(o.id));
60
60
  }
61
- const r = t?.queryText;
62
- return r && (n = n.filter((s) => M(s, r))), n;
61
+ const s = t?.queryText;
62
+ return s && (n = n.filter((r) => R(r, s))), n;
63
63
  }
64
64
  match(t, n) {
65
65
  if (t.length === 0)
66
66
  return null;
67
- let r = null, s = Number.NEGATIVE_INFINITY;
68
- const i = n?.enabledIds ? new Set(n.enabledIds) : null;
69
- for (const o of this.matchers) {
70
- if (i && !i.has(o.id) || !E(o, this.langs))
67
+ let s = null, r = Number.NEGATIVE_INFINITY;
68
+ const o = n?.enabledIds ? new Set(n.enabledIds) : null;
69
+ for (const i of this.matchers) {
70
+ if (o && !o.has(i.id) || !K(i, this.langs))
71
71
  continue;
72
- const l = o.match(t);
73
- if (!l)
72
+ const a = i.match(t);
73
+ if (!a)
74
74
  continue;
75
- const u = l.score;
76
- Number.isFinite(u) && u > s && (s = u, r = {
75
+ const l = a.score;
76
+ Number.isFinite(l) && l > r && (r = l, s = {
77
77
  kind: "matcher",
78
- matcher: o,
79
- step: l.step ?? 1,
80
- state: l.state
78
+ matcher: i,
79
+ step: a.step ?? 1,
80
+ state: a.state
81
81
  });
82
82
  }
83
- const a = this.list(n).map((o) => ({ list: o, rank: w(o, this.langs) })).filter((o) => Number.isFinite(o.rank)).sort((o, l) => o.rank - l.rank);
84
- for (const { list: o, rank: l } of a) {
85
- const u = [];
86
- let f = !1;
87
- for (const N of t) {
88
- const p = T(o, N);
89
- if (p === null) {
90
- f = !0;
83
+ const u = this.list(n).map((i) => ({ list: i, rank: D(i, this.langs) })).filter((i) => Number.isFinite(i.rank)).sort((i, a) => i.rank - a.rank);
84
+ for (const { list: i, rank: a } of u) {
85
+ const l = [];
86
+ let c = !1;
87
+ for (const P of t) {
88
+ const k = J(i, P);
89
+ if (k === null) {
90
+ c = !0;
91
91
  break;
92
92
  }
93
- u.push(p);
93
+ l.push(k);
94
94
  }
95
- if (f)
95
+ if (c)
96
96
  continue;
97
- const h = this.inferStep(o, u);
98
- if (h === null)
97
+ const f = this.inferStep(i, l);
98
+ if (f === null)
99
99
  continue;
100
- const g = 10 - l;
101
- g > s && (s = g, r = {
100
+ const d = 10 - a;
101
+ d > r && (r = d, s = {
102
102
  kind: "list",
103
- list: o,
104
- startIndex: u[u.length - 1] ?? 0,
105
- step: h
103
+ list: i,
104
+ startIndex: l[l.length - 1] ?? 0,
105
+ step: f
106
106
  });
107
107
  }
108
- return r;
108
+ return s;
109
109
  }
110
110
  inferStep(t, n) {
111
111
  if (n.length < 2)
112
112
  return 1;
113
- const r = t.items.length, s = this.stepBetween(t.mode, r, n[0], n[1]);
114
- if (s === null)
113
+ const s = t.items.length, r = this.stepBetween(t.mode, s, n[0], n[1]);
114
+ if (r === null)
115
115
  return null;
116
- for (let i = 2; i < n.length; i += 1) {
117
- const a = this.nextIndex(t.mode, r, n[i - 1], s);
118
- if (a === null || a !== n[i])
116
+ for (let o = 2; o < n.length; o += 1) {
117
+ const u = this.nextIndex(t.mode, s, n[o - 1], r);
118
+ if (u === null || u !== n[o])
119
119
  return null;
120
120
  }
121
- return s;
121
+ return r;
122
122
  }
123
- stepBetween(t, n, r, s) {
123
+ stepBetween(t, n, s, r) {
124
124
  if (t === "cycle")
125
- return (s - r + n) % n;
126
- const i = s - r;
127
- return i < 0 ? null : i;
125
+ return (r - s + n) % n;
126
+ const o = r - s;
127
+ return o < 0 ? null : o;
128
128
  }
129
- nextIndex(t, n, r, s) {
129
+ nextIndex(t, n, s, r) {
130
130
  if (t === "cycle")
131
- return (r + s) % n;
132
- const i = r + s;
133
- return i >= n ? null : i;
131
+ return (s + r) % n;
132
+ const o = s + r;
133
+ return o >= n ? null : o;
134
134
  }
135
135
  }
136
- const A = {
137
- id: "weekdays-en",
136
+ const B = {
137
+ id: "weekdays-en-long",
138
+ mode: "cycle",
139
+ langs: ["en"],
140
+ items: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
141
+ }, G = {
142
+ id: "weekdays-en-short",
138
143
  mode: "cycle",
139
144
  langs: ["en"],
140
- items: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
145
+ items: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
141
146
  aliases: {
142
- Mon: "Monday",
143
- Tue: "Tuesday",
144
- Tues: "Tuesday",
145
- Wed: "Wednesday",
146
- Thu: "Thursday",
147
- Thur: "Thursday",
148
- Thurs: "Thursday",
149
- Fri: "Friday",
150
- Sat: "Saturday",
151
- Sun: "Sunday"
152
- }
153
- }, L = {
154
- id: "weekdays-ja",
147
+ Tues: "Tue",
148
+ Thur: "Thu",
149
+ Thurs: "Thu"
150
+ }
151
+ }, H = {
152
+ id: "weekdays-ja-long",
155
153
  mode: "cycle",
156
154
  langs: ["ja"],
157
- items: ["月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日", "日曜日"],
158
- aliases: {
159
- 月曜: "月曜日",
160
- 月: "月曜日",
161
- 火曜: "火曜日",
162
- 火: "火曜日",
163
- 水曜: "水曜日",
164
- 水: "水曜日",
165
- 木曜: "木曜日",
166
- 木: "木曜日",
167
- 金曜: "金曜日",
168
- 金: "金曜日",
169
- 土曜: "土曜日",
170
- 土: "土曜日",
171
- 日曜: "日曜日",
172
- 日: "日曜日"
173
- }
174
- }, F = {
175
- id: "months-en",
155
+ items: ["月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日", "日曜日"]
156
+ }, U = {
157
+ id: "weekdays-ja-short",
158
+ mode: "cycle",
159
+ langs: ["ja"],
160
+ items: ["月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"]
161
+ }, Y = {
162
+ id: "weekdays-ja-single",
163
+ mode: "cycle",
164
+ langs: ["ja"],
165
+ items: ["", "火", "水", "木", "金", "土", "日"]
166
+ }, q = {
167
+ id: "months-en-long",
176
168
  mode: "cycle",
177
169
  langs: ["en"],
178
170
  items: [
@@ -188,47 +180,41 @@ const A = {
188
180
  "October",
189
181
  "November",
190
182
  "December"
191
- ],
183
+ ]
184
+ }, X = {
185
+ id: "months-en-short",
186
+ mode: "cycle",
187
+ langs: ["en"],
188
+ items: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
192
189
  aliases: {
193
- Jan: "January",
194
- Feb: "February",
195
- Mar: "March",
196
- Apr: "April",
197
- Jun: "June",
198
- Jul: "July",
199
- Aug: "August",
200
- Sep: "September",
201
- Sept: "September",
202
- Oct: "October",
203
- Nov: "November",
204
- Dec: "December"
205
- }
206
- }, v = {
190
+ Sept: "Sep"
191
+ }
192
+ }, Q = {
207
193
  id: "months-ja",
208
194
  mode: "cycle",
209
195
  langs: ["ja"],
210
196
  items: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]
211
- }, z = {
197
+ }, Z = {
212
198
  id: "months-ja-traditional",
213
199
  mode: "cycle",
214
200
  langs: ["ja"],
215
201
  items: ["睦月", "如月", "弥生", "卯月", "皐月", "水無月", "文月", "葉月", "長月", "神無月", "霜月", "師走"]
216
- }, O = {
202
+ }, _ = {
217
203
  id: "quarters-en",
218
204
  mode: "cycle",
219
205
  langs: ["en"],
220
206
  items: ["Q1", "Q2", "Q3", "Q4"]
221
- }, P = {
207
+ }, ee = {
222
208
  id: "quarters-ja",
223
209
  mode: "cycle",
224
210
  langs: ["ja"],
225
211
  items: ["第1四半期", "第2四半期", "第3四半期", "第4四半期"]
226
- }, R = {
212
+ }, te = {
227
213
  id: "zodiac-animals-ja",
228
214
  mode: "cycle",
229
215
  langs: ["ja"],
230
216
  items: ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]
231
- }, C = {
217
+ }, ne = {
232
218
  id: "zodiac-signs-en",
233
219
  mode: "cycle",
234
220
  langs: ["en"],
@@ -246,7 +232,7 @@ const A = {
246
232
  "Aquarius",
247
233
  "Pisces"
248
234
  ]
249
- }, D = {
235
+ }, se = {
250
236
  id: "zodiac-signs-ja",
251
237
  mode: "cycle",
252
238
  langs: ["ja"],
@@ -254,7 +240,7 @@ const A = {
254
240
  aliases: {
255
241
  さそり座: "蠍座"
256
242
  }
257
- }, $ = {
243
+ }, re = {
258
244
  id: "directions-16-en",
259
245
  mode: "cycle",
260
246
  langs: ["en"],
@@ -276,7 +262,7 @@ const A = {
276
262
  "Northwest",
277
263
  "North-Northwest"
278
264
  ]
279
- }, V = {
265
+ }, ie = {
280
266
  id: "directions-16-ja",
281
267
  mode: "cycle",
282
268
  langs: ["ja"],
@@ -298,7 +284,7 @@ const A = {
298
284
  "北西",
299
285
  "北北西"
300
286
  ]
301
- }, W = {
287
+ }, oe = {
302
288
  id: "ampm-en",
303
289
  mode: "cycle",
304
290
  langs: ["en"],
@@ -307,12 +293,12 @@ const A = {
307
293
  "A.M.": "AM",
308
294
  "P.M.": "PM"
309
295
  }
310
- }, B = {
296
+ }, ae = {
311
297
  id: "ampm-ja",
312
298
  mode: "cycle",
313
299
  langs: ["ja"],
314
300
  items: ["午前", "午後"]
315
- }, Q = {
301
+ }, ue = {
316
302
  id: "seasons-en",
317
303
  mode: "cycle",
318
304
  langs: ["en"],
@@ -320,17 +306,17 @@ const A = {
320
306
  aliases: {
321
307
  Fall: "Autumn"
322
308
  }
323
- }, q = {
309
+ }, le = {
324
310
  id: "seasons-ja",
325
311
  mode: "cycle",
326
312
  langs: ["ja"],
327
313
  items: ["春", "夏", "秋", "冬"]
328
- }, G = {
314
+ }, ce = {
329
315
  id: "solfege-ja",
330
316
  mode: "cycle",
331
317
  langs: ["ja"],
332
318
  items: ["ド", "レ", "ミ", "ファ", "ソ", "ラ", "シ"]
333
- }, X = {
319
+ }, fe = {
334
320
  id: "solfege-en",
335
321
  mode: "cycle",
336
322
  langs: ["en"],
@@ -339,7 +325,7 @@ const A = {
339
325
  So: "Sol",
340
326
  Si: "Ti"
341
327
  }
342
- }, U = {
328
+ }, de = {
343
329
  id: "greek-letters-en",
344
330
  mode: "cycle",
345
331
  langs: ["en"],
@@ -369,7 +355,7 @@ const A = {
369
355
  "Psi",
370
356
  "Omega"
371
357
  ]
372
- }, K = {
358
+ }, me = {
373
359
  id: "greek-letters-ja",
374
360
  mode: "cycle",
375
361
  langs: ["ja"],
@@ -399,7 +385,7 @@ const A = {
399
385
  "プサイ",
400
386
  "オメガ"
401
387
  ]
402
- }, Y = {
388
+ }, he = {
403
389
  id: "greek-letters-symbols",
404
390
  mode: "cycle",
405
391
  langs: ["en", "ja"],
@@ -432,105 +418,795 @@ const A = {
432
418
  aliases: {
433
419
  ς: "σ"
434
420
  }
435
- }, H = {
421
+ }, ge = {
436
422
  id: "rokuyo-ja",
437
423
  mode: "cycle",
438
424
  langs: ["ja"],
439
425
  items: ["先勝", "友引", "先負", "仏滅", "大安", "赤口"]
440
- }, Z = {
426
+ }, pe = {
441
427
  id: "heavenly-stems-ja",
442
428
  mode: "finite",
443
429
  langs: ["ja"],
444
430
  items: ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"]
445
- }, _ = {
431
+ }, xe = {
446
432
  id: "planets-en",
447
433
  mode: "finite",
448
434
  langs: ["en"],
449
435
  items: ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"]
450
- }, ee = {
436
+ }, ye = {
451
437
  id: "planets-ja",
452
438
  mode: "finite",
453
439
  langs: ["ja"],
454
440
  items: ["水星", "金星", "地球", "火星", "木星", "土星", "天王星", "海王星"]
455
- }, te = {
441
+ }, be = {
456
442
  id: "kuji-in-ja",
457
443
  mode: "finite",
458
444
  langs: ["ja"],
459
445
  items: ["臨", "兵", "闘", "者", "皆", "陣", "烈", "在", "前"]
460
- }, ne = {
446
+ }, Se = {
461
447
  id: "eight-virtues-ja",
462
448
  mode: "finite",
463
449
  langs: ["ja"],
464
450
  items: ["仁", "義", "礼", "智", "忠", "信", "孝", "悌"]
465
- }, re = [
466
- A,
467
- L,
468
- F,
469
- v,
470
- z,
471
- O,
472
- P,
473
- R,
474
- C,
475
- D,
476
- $,
477
- V,
478
- W,
451
+ }, je = {
452
+ id: "element-symbols",
453
+ mode: "finite",
454
+ langs: ["ja", "en"],
455
+ items: [
456
+ "H",
457
+ "He",
458
+ "Li",
459
+ "Be",
460
+ "B",
461
+ "C",
462
+ "N",
463
+ "O",
464
+ "F",
465
+ "Ne",
466
+ "Na",
467
+ "Mg",
468
+ "Al",
469
+ "Si",
470
+ "P",
471
+ "S",
472
+ "Cl",
473
+ "Ar",
474
+ "K",
475
+ "Ca",
476
+ "Sc",
477
+ "Ti",
478
+ "V",
479
+ "Cr",
480
+ "Mn",
481
+ "Fe",
482
+ "Co",
483
+ "Ni",
484
+ "Cu",
485
+ "Zn",
486
+ "Ga",
487
+ "Ge",
488
+ "As",
489
+ "Se",
490
+ "Br",
491
+ "Kr",
492
+ "Rb",
493
+ "Sr",
494
+ "Y",
495
+ "Zr",
496
+ "Nb",
497
+ "Mo",
498
+ "Tc",
499
+ "Ru",
500
+ "Rh",
501
+ "Pd",
502
+ "Ag",
503
+ "Cd",
504
+ "In",
505
+ "Sn",
506
+ "Sb",
507
+ "Te",
508
+ "I",
509
+ "Xe",
510
+ "Cs",
511
+ "Ba",
512
+ "La",
513
+ "Ce",
514
+ "Pr",
515
+ "Nd",
516
+ "Pm",
517
+ "Sm",
518
+ "Eu",
519
+ "Gd",
520
+ "Tb",
521
+ "Dy",
522
+ "Ho",
523
+ "Er",
524
+ "Tm",
525
+ "Yb",
526
+ "Lu",
527
+ "Hf",
528
+ "Ta",
529
+ "W",
530
+ "Re",
531
+ "Os",
532
+ "Ir",
533
+ "Pt",
534
+ "Au",
535
+ "Hg",
536
+ "Tl",
537
+ "Pb",
538
+ "Bi",
539
+ "Po",
540
+ "At",
541
+ "Rn",
542
+ "Fr",
543
+ "Ra",
544
+ "Ac",
545
+ "Th",
546
+ "Pa",
547
+ "U",
548
+ "Np",
549
+ "Pu",
550
+ "Am",
551
+ "Cm",
552
+ "Bk",
553
+ "Cf",
554
+ "Es",
555
+ "Fm",
556
+ "Md",
557
+ "No",
558
+ "Lr",
559
+ "Rf",
560
+ "Db",
561
+ "Sg",
562
+ "Bh",
563
+ "Hs",
564
+ "Mt",
565
+ "Ds",
566
+ "Rg",
567
+ "Cn",
568
+ "Nh",
569
+ "Fl",
570
+ "Mc",
571
+ "Lv",
572
+ "Ts",
573
+ "Og"
574
+ ]
575
+ }, ke = {
576
+ id: "element-names-ja",
577
+ mode: "finite",
578
+ langs: ["ja"],
579
+ items: [
580
+ "水素",
581
+ "ヘリウム",
582
+ "リチウム",
583
+ "ベリリウム",
584
+ "ホウ素",
585
+ "炭素",
586
+ "窒素",
587
+ "酸素",
588
+ "フッ素",
589
+ "ネオン",
590
+ "ナトリウム",
591
+ "マグネシウム",
592
+ "アルミニウム",
593
+ "ケイ素",
594
+ "リン",
595
+ "硫黄",
596
+ "塩素",
597
+ "アルゴン",
598
+ "カリウム",
599
+ "カルシウム",
600
+ "スカンジウム",
601
+ "チタン",
602
+ "バナジウム",
603
+ "クロム",
604
+ "マンガン",
605
+ "鉄",
606
+ "コバルト",
607
+ "ニッケル",
608
+ "銅",
609
+ "亜鉛",
610
+ "ガリウム",
611
+ "ゲルマニウム",
612
+ "ヒ素",
613
+ "セレン",
614
+ "臭素",
615
+ "クリプトン",
616
+ "ルビジウム",
617
+ "ストロンチウム",
618
+ "イットリウム",
619
+ "ジルコニウム",
620
+ "ニオブ",
621
+ "モリブデン",
622
+ "テクネチウム",
623
+ "ルテニウム",
624
+ "ロジウム",
625
+ "パラジウム",
626
+ "銀",
627
+ "カドミウム",
628
+ "インジウム",
629
+ "スズ",
630
+ "アンチモン",
631
+ "テルル",
632
+ "ヨウ素",
633
+ "キセノン",
634
+ "セシウム",
635
+ "バリウム",
636
+ "ランタン",
637
+ "セリウム",
638
+ "プラセオジム",
639
+ "ネオジム",
640
+ "プロメチウム",
641
+ "サマリウム",
642
+ "ユウロピウム",
643
+ "ガドリニウム",
644
+ "テルビウム",
645
+ "ジスプロシウム",
646
+ "ホルミウム",
647
+ "エルビウム",
648
+ "ツリウム",
649
+ "イッテルビウム",
650
+ "ルテチウム",
651
+ "ハフニウム",
652
+ "タンタル",
653
+ "タングステン",
654
+ "レニウム",
655
+ "オスミウム",
656
+ "イリジウム",
657
+ "白金",
658
+ "金",
659
+ "水銀",
660
+ "タリウム",
661
+ "鉛",
662
+ "ビスマス",
663
+ "ポロニウム",
664
+ "アスタチン",
665
+ "ラドン",
666
+ "フランシウム",
667
+ "ラジウム",
668
+ "アクチニウム",
669
+ "トリウム",
670
+ "プロトアクチニウム",
671
+ "ウラン",
672
+ "ネプツニウム",
673
+ "プルトニウム",
674
+ "アメリシウム",
675
+ "キュリウム",
676
+ "バークリウム",
677
+ "カリホルニウム",
678
+ "アインスタイニウム",
679
+ "フェルミウム",
680
+ "メンデレビウム",
681
+ "ノーベリウム",
682
+ "ローレンシウム",
683
+ "ラザホージウム",
684
+ "ドブニウム",
685
+ "シーボーギウム",
686
+ "ボーリウム",
687
+ "ハッシウム",
688
+ "マイトネリウム",
689
+ "ダームスタチウム",
690
+ "レントゲニウム",
691
+ "コペルニシウム",
692
+ "ニホニウム",
693
+ "フレロビウム",
694
+ "モスコビウム",
695
+ "リバモリウム",
696
+ "テネシン",
697
+ "オガネソン"
698
+ ]
699
+ }, we = {
700
+ id: "shoguns-kamakura-ja",
701
+ mode: "finite",
702
+ langs: ["ja"],
703
+ items: [
704
+ "源頼朝",
705
+ "源頼家",
706
+ "源実朝",
707
+ "九条頼経",
708
+ "九条頼嗣",
709
+ "宗尊親王",
710
+ "惟康親王",
711
+ "久明親王",
712
+ "守邦親王"
713
+ ]
714
+ }, Ne = {
715
+ id: "shoguns-ashikaga-ja",
716
+ mode: "finite",
717
+ langs: ["ja"],
718
+ items: [
719
+ "足利尊氏",
720
+ "足利義詮",
721
+ "足利義満",
722
+ "足利義持",
723
+ "足利義量",
724
+ "足利義教",
725
+ "足利義勝",
726
+ "足利義政",
727
+ "足利義尚",
728
+ "足利義稙",
729
+ "足利義澄",
730
+ "足利義晴",
731
+ "足利義輝",
732
+ "足利義栄",
733
+ "足利義昭"
734
+ ]
735
+ }, Ie = {
736
+ id: "shoguns-ashikaga-given-ja",
737
+ mode: "finite",
738
+ langs: ["ja"],
739
+ items: [
740
+ "尊氏",
741
+ "義詮",
742
+ "義満",
743
+ "義持",
744
+ "義量",
745
+ "義教",
746
+ "義勝",
747
+ "義政",
748
+ "義尚",
749
+ "義稙",
750
+ "義澄",
751
+ "義晴",
752
+ "義輝",
753
+ "義栄",
754
+ "義昭"
755
+ ]
756
+ }, Te = {
757
+ id: "shoguns-tokugawa-ja",
758
+ mode: "finite",
759
+ langs: ["ja"],
760
+ items: [
761
+ "徳川家康",
762
+ "徳川秀忠",
763
+ "徳川家光",
764
+ "徳川家綱",
765
+ "徳川綱吉",
766
+ "徳川家宣",
767
+ "徳川家継",
768
+ "徳川吉宗",
769
+ "徳川家重",
770
+ "徳川家治",
771
+ "徳川家斉",
772
+ "徳川家慶",
773
+ "徳川家定",
774
+ "徳川家茂",
775
+ "徳川慶喜"
776
+ ]
777
+ }, Me = {
778
+ id: "shoguns-tokugawa-given-ja",
779
+ mode: "finite",
780
+ langs: ["ja"],
781
+ items: [
782
+ "家康",
783
+ "秀忠",
784
+ "家光",
785
+ "家綱",
786
+ "綱吉",
787
+ "家宣",
788
+ "家継",
789
+ "吉宗",
790
+ "家重",
791
+ "家治",
792
+ "家斉",
793
+ "家慶",
794
+ "家定",
795
+ "家茂",
796
+ "慶喜"
797
+ ]
798
+ }, T = [
799
+ "北海道",
800
+ "青森県",
801
+ "岩手県",
802
+ "宮城県",
803
+ "秋田県",
804
+ "山形県",
805
+ "福島県",
806
+ "茨城県",
807
+ "栃木県",
808
+ "群馬県",
809
+ "埼玉県",
810
+ "千葉県",
811
+ "東京都",
812
+ "神奈川県",
813
+ "新潟県",
814
+ "富山県",
815
+ "石川県",
816
+ "福井県",
817
+ "山梨県",
818
+ "長野県",
819
+ "岐阜県",
820
+ "静岡県",
821
+ "愛知県",
822
+ "三重県",
823
+ "滋賀県",
824
+ "京都府",
825
+ "大阪府",
826
+ "兵庫県",
827
+ "奈良県",
828
+ "和歌山県",
829
+ "鳥取県",
830
+ "島根県",
831
+ "岡山県",
832
+ "広島県",
833
+ "山口県",
834
+ "徳島県",
835
+ "香川県",
836
+ "愛媛県",
837
+ "高知県",
838
+ "福岡県",
839
+ "佐賀県",
840
+ "長崎県",
841
+ "熊本県",
842
+ "大分県",
843
+ "宮崎県",
844
+ "鹿児島県",
845
+ "沖縄県"
846
+ ], Ae = T.reduce(
847
+ (e, t) => {
848
+ if (t === "北海道")
849
+ return e;
850
+ if (/[都府県]$/.test(t)) {
851
+ const n = t.slice(0, -1);
852
+ e[n] = t;
853
+ }
854
+ return e;
855
+ },
856
+ {}
857
+ ), ve = {
858
+ id: "prefectures-ja",
859
+ mode: "finite",
860
+ langs: ["ja"],
861
+ items: T,
862
+ aliases: Ae
863
+ }, Le = {
864
+ id: "us-states-en",
865
+ mode: "finite",
866
+ langs: ["en"],
867
+ items: [
868
+ "Alabama",
869
+ "Alaska",
870
+ "Arizona",
871
+ "Arkansas",
872
+ "California",
873
+ "Colorado",
874
+ "Connecticut",
875
+ "Delaware",
876
+ "Florida",
877
+ "Georgia",
878
+ "Hawaii",
879
+ "Idaho",
880
+ "Illinois",
881
+ "Indiana",
882
+ "Iowa",
883
+ "Kansas",
884
+ "Kentucky",
885
+ "Louisiana",
886
+ "Maine",
887
+ "Maryland",
888
+ "Massachusetts",
889
+ "Michigan",
890
+ "Minnesota",
891
+ "Mississippi",
892
+ "Missouri",
893
+ "Montana",
894
+ "Nebraska",
895
+ "Nevada",
896
+ "New Hampshire",
897
+ "New Jersey",
898
+ "New Mexico",
899
+ "New York",
900
+ "North Carolina",
901
+ "North Dakota",
902
+ "Ohio",
903
+ "Oklahoma",
904
+ "Oregon",
905
+ "Pennsylvania",
906
+ "Rhode Island",
907
+ "South Carolina",
908
+ "South Dakota",
909
+ "Tennessee",
910
+ "Texas",
911
+ "Utah",
912
+ "Vermont",
913
+ "Virginia",
914
+ "Washington",
915
+ "West Virginia",
916
+ "Wisconsin",
917
+ "Wyoming"
918
+ ]
919
+ }, Ee = {
920
+ id: "us-states-abbrev-en",
921
+ mode: "finite",
922
+ langs: ["en"],
923
+ items: [
924
+ "AL",
925
+ "AK",
926
+ "AZ",
927
+ "AR",
928
+ "CA",
929
+ "CO",
930
+ "CT",
931
+ "DE",
932
+ "FL",
933
+ "GA",
934
+ "HI",
935
+ "ID",
936
+ "IL",
937
+ "IN",
938
+ "IA",
939
+ "KS",
940
+ "KY",
941
+ "LA",
942
+ "ME",
943
+ "MD",
944
+ "MA",
945
+ "MI",
946
+ "MN",
947
+ "MS",
948
+ "MO",
949
+ "MT",
950
+ "NE",
951
+ "NV",
952
+ "NH",
953
+ "NJ",
954
+ "NM",
955
+ "NY",
956
+ "NC",
957
+ "ND",
958
+ "OH",
959
+ "OK",
960
+ "OR",
961
+ "PA",
962
+ "RI",
963
+ "SC",
964
+ "SD",
965
+ "TN",
966
+ "TX",
967
+ "UT",
968
+ "VT",
969
+ "VA",
970
+ "WA",
971
+ "WV",
972
+ "WI",
973
+ "WY"
974
+ ]
975
+ }, We = {
976
+ id: "windows-versions",
977
+ mode: "finite",
978
+ langs: ["ja", "en"],
979
+ items: [
980
+ "Windows 1.0",
981
+ "Windows 2.0",
982
+ "Windows 2.1",
983
+ "Windows 3.0",
984
+ "Windows 3.1",
985
+ "Windows 3.11",
986
+ "Windows 95",
987
+ "Windows 98",
988
+ "Windows 98 SE",
989
+ "Windows Me",
990
+ "Windows XP",
991
+ "Windows Vista",
992
+ "Windows 7",
993
+ "Windows 8",
994
+ "Windows 8.1",
995
+ "Windows 10",
996
+ "Windows 11"
997
+ ]
998
+ }, Ce = {
999
+ id: "macos-versions",
1000
+ mode: "finite",
1001
+ langs: ["ja", "en"],
1002
+ items: [
1003
+ "Cheetah",
1004
+ "Puma",
1005
+ "Jaguar",
1006
+ "Panther",
1007
+ "Tiger",
1008
+ "Leopard",
1009
+ "Snow Leopard",
1010
+ "Lion",
1011
+ "Mountain Lion",
1012
+ "Mavericks",
1013
+ "Yosemite",
1014
+ "El Capitan",
1015
+ "Sierra",
1016
+ "High Sierra",
1017
+ "Mojave",
1018
+ "Catalina",
1019
+ "Big Sur",
1020
+ "Monterey",
1021
+ "Ventura",
1022
+ "Sonoma",
1023
+ "Sequoia",
1024
+ "Tahoe"
1025
+ ]
1026
+ }, Oe = {
1027
+ id: "debian-codenames",
1028
+ mode: "finite",
1029
+ langs: ["ja", "en"],
1030
+ items: [
1031
+ "buzz",
1032
+ "rex",
1033
+ "bo",
1034
+ "hamm",
1035
+ "slink",
1036
+ "potato",
1037
+ "woody",
1038
+ "sarge",
1039
+ "etch",
1040
+ "lenny",
1041
+ "squeeze",
1042
+ "wheezy",
1043
+ "jessie",
1044
+ "stretch",
1045
+ "buster",
1046
+ "bullseye",
1047
+ "bookworm",
1048
+ "trixie"
1049
+ ]
1050
+ }, $e = [
479
1051
  B,
480
- Q,
481
- q,
482
1052
  G,
483
- X,
1053
+ H,
484
1054
  U,
485
- K,
486
1055
  Y,
487
- H,
1056
+ q,
1057
+ X,
1058
+ Q,
488
1059
  Z,
489
1060
  _,
490
1061
  ee,
491
1062
  te,
492
- ne
493
- ], b = (e) => {
1063
+ ne,
1064
+ se,
1065
+ re,
1066
+ ie,
1067
+ oe,
1068
+ ae,
1069
+ ue,
1070
+ le,
1071
+ ce,
1072
+ fe,
1073
+ de,
1074
+ me,
1075
+ he,
1076
+ ge,
1077
+ pe,
1078
+ xe,
1079
+ ye,
1080
+ be,
1081
+ Se,
1082
+ je,
1083
+ ke,
1084
+ we,
1085
+ Ne,
1086
+ Ie,
1087
+ Te,
1088
+ Me,
1089
+ ve,
1090
+ Le,
1091
+ Ee,
1092
+ We,
1093
+ Ce,
1094
+ Oe
1095
+ ], p = (e) => {
494
1096
  const t = e % 100;
495
1097
  if (t >= 11 && t <= 13) return "th";
496
1098
  const n = e % 10;
497
1099
  return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th";
498
- }, y = (e) => {
499
- const t = /^(\d+)(st|nd|rd|th)$/.exec(e);
1100
+ }, x = {
1101
+ 1: "first",
1102
+ 2: "second",
1103
+ 3: "third",
1104
+ 4: "fourth",
1105
+ 5: "fifth",
1106
+ 6: "sixth",
1107
+ 7: "seventh",
1108
+ 8: "eighth",
1109
+ 9: "ninth",
1110
+ 10: "tenth",
1111
+ 11: "eleventh",
1112
+ 12: "twelfth",
1113
+ 13: "thirteenth",
1114
+ 14: "fourteenth",
1115
+ 15: "fifteenth",
1116
+ 16: "sixteenth",
1117
+ 17: "seventeenth",
1118
+ 18: "eighteenth",
1119
+ 19: "nineteenth"
1120
+ }, y = {
1121
+ 20: "twentieth",
1122
+ 30: "thirtieth",
1123
+ 40: "fortieth",
1124
+ 50: "fiftieth",
1125
+ 60: "sixtieth",
1126
+ 70: "seventieth",
1127
+ 80: "eightieth",
1128
+ 90: "ninetieth"
1129
+ }, M = {
1130
+ 20: "twenty",
1131
+ 30: "thirty",
1132
+ 40: "forty",
1133
+ 50: "fifty",
1134
+ 60: "sixty",
1135
+ 70: "seventy",
1136
+ 80: "eighty",
1137
+ 90: "ninety"
1138
+ }, w = Object.fromEntries(
1139
+ Object.entries(x).map(([e, t]) => [t, Number(e)])
1140
+ ), Fe = Object.fromEntries(
1141
+ Object.entries(y).map(([e, t]) => [t, Number(e)])
1142
+ ), Pe = Object.fromEntries(
1143
+ Object.entries(M).map(([e, t]) => [t, Number(e)])
1144
+ ), A = (e) => {
1145
+ const t = e.trim().toLowerCase();
500
1146
  if (!t) return null;
501
- const n = Number(t[1]);
502
- if (!Number.isFinite(n) || n <= 0) return null;
503
- const r = t[2];
504
- return b(n) !== r ? null : n;
505
- }, se = {
1147
+ const n = w[t] ?? Fe[t];
1148
+ if (n) return n;
1149
+ const s = t.split(/[-\s]+/);
1150
+ if (s.length !== 2) return null;
1151
+ const r = Pe[s[0] ?? ""], o = w[s[1] ?? ""];
1152
+ return !r || !o ? null : r + o;
1153
+ }, v = (e) => {
1154
+ if (!Number.isFinite(e) || e <= 0 || Math.floor(e) !== e) return null;
1155
+ if (e <= 19) return x[e] ?? null;
1156
+ if (e < 100) {
1157
+ if (y[e]) return y[e] ?? null;
1158
+ const t = Math.floor(e / 10) * 10, n = e % 10, s = M[t], r = x[n];
1159
+ return !s || !r ? null : `${s}-${r}`;
1160
+ }
1161
+ return null;
1162
+ }, N = (e) => {
1163
+ const t = /^(\d+)(st|nd|rd|th)$/i.exec(e);
1164
+ if (t) {
1165
+ const s = Number(t[1]);
1166
+ if (!Number.isFinite(s) || s <= 0) return null;
1167
+ const r = t[2]?.toLowerCase();
1168
+ return p(s) !== r ? null : { value: s, format: "numeric" };
1169
+ }
1170
+ const n = A(e);
1171
+ return n !== null ? { value: n, format: "word" } : null;
1172
+ }, Ve = {
506
1173
  id: "ordinal-en",
507
1174
  langs: ["en"],
508
1175
  match(e) {
509
1176
  if (e.length < 2) return null;
510
- const t = e.map((s) => y(s));
511
- if (t.some((s) => s === null)) return null;
512
- const n = t, r = n[1] - n[0];
513
- for (let s = 2; s < n.length; s += 1)
514
- if (n[s] - n[s - 1] !== r) return null;
515
- return { score: 80, step: r };
1177
+ const t = e.map((o) => N(o));
1178
+ if (t.some((o) => o === null)) return null;
1179
+ const n = t[0].format;
1180
+ if (t.some((o) => o?.format !== n)) return null;
1181
+ const s = t.map((o) => o.value), r = s[1] - s[0];
1182
+ for (let o = 2; o < s.length; o += 1)
1183
+ if (s[o] - s[o - 1] !== r) return null;
1184
+ return { score: 80, step: r, state: { format: n } };
516
1185
  },
517
1186
  createIterator(e, t) {
518
- let r = y(e[e.length - 1] ?? "") ?? 0;
1187
+ const n = N(e[e.length - 1] ?? ""), s = t.state?.format ?? "numeric";
1188
+ let r = n?.value ?? 0;
519
1189
  return {
520
1190
  next() {
521
- return r += t.step, r <= 0 || !Number.isFinite(r) ? { value: void 0, done: !0 } : { value: `${r}${b(r)}`, done: !1 };
1191
+ if (r += t.step, r <= 0 || !Number.isFinite(r))
1192
+ return { value: void 0, done: !0 };
1193
+ if (s === "word") {
1194
+ const o = v(r);
1195
+ return o ? { value: o, done: !1 } : { value: void 0, done: !0 };
1196
+ }
1197
+ return { value: `${r}${p(r)}`, done: !1 };
522
1198
  }
523
1199
  };
524
1200
  }
525
- }, ie = (e) => {
526
- for (const t of re)
1201
+ }, Je = (e) => {
1202
+ for (const t of $e)
527
1203
  e.register(t);
528
- }, ae = (e) => {
529
- e.registerMatch(se);
530
- }, oe = (e) => {
531
- const t = new J({ langs: e });
532
- return ie(t), ae(t), t;
533
- }, le = (e) => {
1204
+ }, Re = (e) => {
1205
+ e.registerMatch(Ve);
1206
+ }, De = (e) => {
1207
+ const t = e ?? ["en", "ja"], n = new z({ langs: t });
1208
+ return Je(n), Re(n), n;
1209
+ }, Ke = (e) => {
534
1210
  let t = 0;
535
1211
  return {
536
1212
  next() {
@@ -541,14 +1217,14 @@ const A = {
541
1217
  }
542
1218
  };
543
1219
  };
544
- class c {
1220
+ class m {
545
1221
  constructor(...t) {
546
1222
  const n = t;
547
- this.seed = n, this.kind = n.length === 1 ? "copy" : "seed-repeat", this.iterator = le(n);
1223
+ this.seed = n, this.kind = n.length === 1 ? "copy" : "seed-repeat", this.iterator = Ke(n);
548
1224
  }
549
- static fromSeed(t, n, r) {
550
- const s = new c(...t);
551
- return s.kind = n, s.iterator = r, s;
1225
+ static fromSeed(t, n, s) {
1226
+ const r = new m(...t);
1227
+ return r.kind = n, r.iterator = s, r;
552
1228
  }
553
1229
  next() {
554
1230
  return this.iterator.next();
@@ -557,11 +1233,11 @@ class c {
557
1233
  return this;
558
1234
  }
559
1235
  }
560
- const x = 1e-9, ce = 100, ue = (e) => ({
1236
+ const L = 1e-9, ze = 100, Be = (e) => ({
561
1237
  next() {
562
1238
  return { value: e, done: !1 };
563
1239
  }
564
- }), S = (e) => {
1240
+ }), I = (e) => {
565
1241
  let t = 0;
566
1242
  return {
567
1243
  next() {
@@ -571,60 +1247,100 @@ const x = 1e-9, ce = 100, ue = (e) => ({
571
1247
  return t += 1, { value: n, done: !1 };
572
1248
  }
573
1249
  };
574
- }, me = (e, t) => {
1250
+ }, Ge = (e, t) => {
575
1251
  let n = 0;
576
1252
  return {
577
1253
  next() {
578
1254
  return n += 1, { value: e + t * n, done: !1 };
579
1255
  }
580
1256
  };
581
- }, de = (e, t) => {
1257
+ }, He = (e, t) => {
582
1258
  let n = 0;
583
1259
  return {
584
1260
  next() {
585
1261
  return n += 1, { value: new Date(e.getTime() + t * n), done: !1 };
586
1262
  }
587
1263
  };
588
- }, fe = (e, t) => {
1264
+ }, Ue = (e, t) => {
589
1265
  let n = 0;
590
1266
  return {
591
1267
  next() {
592
1268
  return n += 1, { value: e * t ** n, done: !1 };
593
1269
  }
594
1270
  };
595
- }, he = (e, t) => {
1271
+ }, Ye = (e, t) => {
596
1272
  if (e.kind === "matcher")
597
1273
  return e.matcher.createIterator(t, { step: e.step, state: e.state });
598
- const { list: n, startIndex: r, step: s } = e, i = n.items.length;
599
- let a = r;
1274
+ const { list: n, startIndex: s, step: r } = e, o = n.items.length;
1275
+ let u = s;
600
1276
  return {
601
1277
  next() {
602
1278
  if (n.mode === "finite") {
603
- const o = a + s;
604
- return o >= i ? { value: void 0, done: !0 } : (a = o, { value: n.items[a], done: !1 });
1279
+ const i = u + r;
1280
+ return i >= o ? { value: void 0, done: !0 } : (u = i, { value: n.items[u], done: !1 });
605
1281
  }
606
- return a = (a + s) % i, { value: n.items[a], done: !1 };
1282
+ return u = (u + r) % o, { value: n.items[u], done: !1 };
607
1283
  }
608
1284
  };
609
- }, ge = (e) => e.every((t) => typeof t == "number" && Number.isFinite(t)), pe = (e) => e.every((t) => t instanceof Date && !Number.isNaN(t.getTime())), ye = (e) => e.every((t) => typeof t == "string"), Se = (e) => {
1285
+ }, qe = (e) => e.every((t) => typeof t == "number" && Number.isFinite(t)), Xe = (e) => e.every((t) => t instanceof Date && !Number.isNaN(t.getTime())), Qe = (e) => e.every((t) => typeof t == "string"), Ze = (e) => {
610
1286
  const t = /^(.*?)(-?\d+)([^0-9]*)$/.exec(e);
611
1287
  if (!t)
612
1288
  return null;
613
- const n = t[1] ?? "", r = t[2] ?? "", s = t[3] ?? "", i = Number(r);
614
- if (!Number.isFinite(i))
1289
+ const n = t[1] ?? "", s = t[2] ?? "", r = t[3] ?? "", o = Number(s);
1290
+ if (!Number.isFinite(o))
615
1291
  return null;
616
- const a = r.replace("-", "").length;
617
- return { prefix: n, num: i, width: a, suffix: s };
618
- }, be = (e, t, n) => {
619
- let r = 0;
1292
+ const u = s.replace("-", "").length;
1293
+ return { prefix: n, num: o, width: u, suffix: r };
1294
+ }, _e = (e) => {
1295
+ const t = /^(.*?)(\d+)(st|nd|rd|th)([^0-9]*)$/i.exec(e);
1296
+ if (t) {
1297
+ const r = Number(t[2]);
1298
+ if (!Number.isFinite(r) || r <= 0) return null;
1299
+ const o = t[3]?.toLowerCase();
1300
+ return p(r) !== o ? null : {
1301
+ prefix: t[1] ?? "",
1302
+ num: r,
1303
+ suffix: t[4] ?? "",
1304
+ format: "numeric"
1305
+ };
1306
+ }
1307
+ const n = /^(.*?)([A-Za-z-]+)([^A-Za-z]*)$/.exec(e);
1308
+ if (!n) return null;
1309
+ const s = A(n[2] ?? "");
1310
+ return s === null ? null : {
1311
+ prefix: n[1] ?? "",
1312
+ num: s,
1313
+ suffix: n[3] ?? "",
1314
+ format: "word"
1315
+ };
1316
+ }, et = (e, t, n) => {
1317
+ let s = 0;
1318
+ return {
1319
+ next() {
1320
+ s += 1;
1321
+ const r = t + n * s;
1322
+ if (r <= 0 || !Number.isFinite(r))
1323
+ return { value: void 0, done: !0 };
1324
+ if (e.format === "word") {
1325
+ const o = v(r);
1326
+ return o ? { value: `${e.prefix}${o}${e.suffix}`, done: !1 } : { value: void 0, done: !0 };
1327
+ }
1328
+ return {
1329
+ value: `${e.prefix}${r}${p(r)}${e.suffix}`,
1330
+ done: !1
1331
+ };
1332
+ }
1333
+ };
1334
+ }, tt = (e, t, n) => {
1335
+ let s = 0;
620
1336
  return {
621
1337
  next() {
622
- r += 1;
623
- const s = t + n * r, i = s < 0 ? "-" : "", a = Math.abs(s).toString().padStart(e.width, "0");
624
- return { value: `${e.prefix}${i}${a}${e.suffix}`, done: !1 };
1338
+ s += 1;
1339
+ const r = t + n * s, o = r < 0 ? "-" : "", u = Math.abs(r).toString().padStart(e.width, "0");
1340
+ return { value: `${e.prefix}${o}${u}${e.suffix}`, done: !1 };
625
1341
  }
626
1342
  };
627
- }, I = [
1343
+ }, E = [
628
1344
  ["C", 100],
629
1345
  ["XC", 90],
630
1346
  ["L", 50],
@@ -634,135 +1350,351 @@ const x = 1e-9, ce = 100, ue = (e) => ({
634
1350
  ["V", 5],
635
1351
  ["IV", 4],
636
1352
  ["I", 1]
637
- ], k = (e) => {
638
- if (e < 1 || e > ce)
1353
+ ], j = (e) => {
1354
+ if (e < 1 || e > ze)
639
1355
  return null;
640
1356
  let t = e, n = "";
641
- for (const [r, s] of I)
642
- for (; t >= s; )
643
- n += r, t -= s;
1357
+ for (const [s, r] of E)
1358
+ for (; t >= r; )
1359
+ n += s, t -= r;
644
1360
  return n;
645
- }, xe = (e) => {
1361
+ }, W = (e) => {
646
1362
  if (e.length === 0 || e !== e.toUpperCase())
647
1363
  return null;
648
1364
  let t = e, n = 0;
649
- for (const [s, i] of I)
650
- for (; t.startsWith(s); )
651
- n += i, t = t.slice(s.length);
1365
+ for (const [r, o] of E)
1366
+ for (; t.startsWith(r); )
1367
+ n += o, t = t.slice(r.length);
652
1368
  if (t.length > 0)
653
1369
  return null;
654
- const r = k(n);
655
- return !r || r !== e ? null : n;
656
- }, Ie = (e, t) => {
1370
+ const s = j(n);
1371
+ return !s || s !== e ? null : n;
1372
+ }, nt = (e, t) => {
657
1373
  let n = 0;
658
1374
  return {
659
1375
  next() {
660
1376
  n += 1;
661
- const r = e + t * n, s = k(r);
662
- return s ? { value: s, done: !1 } : { value: void 0, done: !0 };
1377
+ const s = e + t * n, r = j(s);
1378
+ return r ? { value: r, done: !1 } : { value: void 0, done: !0 };
1379
+ }
1380
+ };
1381
+ }, st = (e) => new RegExp("\\p{White_Space}", "u").test(e) ? "space" : new RegExp("\\p{P}", "u").test(e) ? "punct" : new RegExp("\\p{S}", "u").test(e) ? "symbol" : new RegExp("\\p{Script=Latin}", "u").test(e) ? "latin" : new RegExp("\\p{Script=Han}", "u").test(e) ? "han" : new RegExp("\\p{Script=Hiragana}", "u").test(e) ? "hiragana" : new RegExp("\\p{Script=Katakana}", "u").test(e) ? "katakana" : new RegExp("\\p{N}", "u").test(e) ? "number" : "other", rt = (e) => {
1382
+ const t = [];
1383
+ let n = "", s = null;
1384
+ for (const r of e) {
1385
+ const o = st(r);
1386
+ if (s === o) {
1387
+ n += r;
1388
+ continue;
1389
+ }
1390
+ s !== null && t.push({ value: n, group: s }), n = r, s = o;
1391
+ }
1392
+ return s !== null && t.push({ value: n, group: s }), t;
1393
+ }, it = (e) => {
1394
+ const t = rt(e), n = t.map((i, a) => ({ index: a, num: W(i.value) })).filter((i) => i.num !== null);
1395
+ if (n.length !== 1)
1396
+ return null;
1397
+ const s = n[0].index, r = n[0].num, o = t.slice(0, s).map((i) => i.value).join(""), u = t.slice(s + 1).map((i) => i.value).join("");
1398
+ return { prefix: o, num: r, suffix: u };
1399
+ }, ot = (e, t, n) => {
1400
+ let s = 0;
1401
+ return {
1402
+ next() {
1403
+ s += 1;
1404
+ const r = t + n * s, o = j(r);
1405
+ return o ? { value: `${e.prefix}${o}${e.suffix}`, done: !1 } : { value: void 0, done: !0 };
1406
+ }
1407
+ };
1408
+ }, b = {
1409
+ 一: 1,
1410
+ 二: 2,
1411
+ 三: 3,
1412
+ 四: 4,
1413
+ 五: 5,
1414
+ 六: 6,
1415
+ 七: 7,
1416
+ 八: 8,
1417
+ 九: 9
1418
+ }, S = {
1419
+ 壱: 1,
1420
+ 弐: 2,
1421
+ 参: 3,
1422
+ 肆: 4,
1423
+ 伍: 5,
1424
+ 陸: 6,
1425
+ 柒: 7,
1426
+ 捌: 8,
1427
+ 玖: 9
1428
+ }, C = {
1429
+ 十: 10,
1430
+ 拾: 10,
1431
+ 百: 100,
1432
+ 佰: 100,
1433
+ 千: 1e3,
1434
+ 仟: 1e3
1435
+ }, O = {
1436
+ 万: 1e4,
1437
+ 萬: 1e4
1438
+ }, at = /* @__PURE__ */ new Set([
1439
+ ...Object.keys(b),
1440
+ ...Object.keys(S),
1441
+ ...Object.keys(C),
1442
+ ...Object.keys(O)
1443
+ ]), ut = (e) => at.has(e), lt = (e) => /[壱弐参肆伍陸柒捌玖拾萬佰仟]/.test(e) ? "traditional" : "modern", $ = (e) => {
1444
+ if (!e)
1445
+ return null;
1446
+ const t = lt(e);
1447
+ if (e.includes("万") || e.includes("萬")) {
1448
+ const i = /^([一二三四五六七八九壱弐参肆伍陸柒捌玖])?(万|萬)$/.exec(e);
1449
+ if (!i)
1450
+ return null;
1451
+ const a = i[1];
1452
+ return a ? (b[a] ?? S[a]) !== 1 ? null : { num: 1e4, style: t } : { num: 1e4, style: t };
1453
+ }
1454
+ let s = 0, r = 0, o = Number.POSITIVE_INFINITY, u = !1;
1455
+ for (const i of e) {
1456
+ const a = b[i] ?? S[i];
1457
+ if (a) {
1458
+ if (u)
1459
+ return null;
1460
+ r = a, u = !0;
1461
+ continue;
1462
+ }
1463
+ const l = C[i];
1464
+ if (l) {
1465
+ if (l >= o)
1466
+ return null;
1467
+ r === 0 && (r = 1), s += r * l, r = 0, o = l, u = !1;
1468
+ continue;
1469
+ }
1470
+ return O[i], null;
1471
+ }
1472
+ return s += r, s <= 0 || s > 1e4 ? null : { num: s, style: t };
1473
+ }, ct = (e) => {
1474
+ const t = [];
1475
+ let n = "", s = 0, r = 0;
1476
+ for (const l of e)
1477
+ ut(l) ? (n || (s = r), n += l) : n && (t.push({ start: s, end: r, text: n }), n = ""), r += l.length;
1478
+ n && t.push({ start: s, end: r, text: n });
1479
+ const o = t.map((l) => ({ run: l, parsed: $(l.text) })).filter((l) => l.parsed !== null);
1480
+ if (o.length !== 1)
1481
+ return null;
1482
+ const u = o[0], i = e.slice(0, u.run.start), a = e.slice(u.run.end);
1483
+ return {
1484
+ prefix: i,
1485
+ num: u.parsed.num,
1486
+ suffix: a,
1487
+ style: u.parsed.style
1488
+ };
1489
+ }, F = (e, t) => {
1490
+ if (!Number.isFinite(e) || e <= 0 || e > 1e4)
1491
+ return null;
1492
+ const n = t === "traditional" ? ["", "壱", "弐", "参", "肆", "伍", "陸", "柒", "捌", "玖"] : ["", "一", "二", "三", "四", "五", "六", "七", "八", "九"], s = t === "traditional" ? "拾" : "十", r = t === "traditional" ? "萬" : "万";
1493
+ if (e === 1e4)
1494
+ return `${n[1]}${r}`;
1495
+ let o = e, u = "";
1496
+ const i = Math.floor(o / 1e3);
1497
+ i > 0 && (i > 1 && (u += n[i]), u += "千", o %= 1e3);
1498
+ const a = Math.floor(o / 100);
1499
+ a > 0 && (a > 1 && (u += n[a]), u += "百", o %= 100);
1500
+ const l = Math.floor(o / 10);
1501
+ return l > 0 && (l > 1 && (u += n[l]), u += s, o %= 10), o > 0 && (u += n[o]), u || null;
1502
+ }, ft = (e, t, n) => {
1503
+ let s = 0;
1504
+ return {
1505
+ next() {
1506
+ s += 1;
1507
+ const r = e + t * s, o = F(r, n);
1508
+ return o ? { value: o, done: !1 } : { value: void 0, done: !0 };
1509
+ }
1510
+ };
1511
+ }, dt = (e, t, n) => {
1512
+ let s = 0;
1513
+ return {
1514
+ next() {
1515
+ s += 1;
1516
+ const r = t + n * s, o = F(r, e.style);
1517
+ return o ? { value: `${e.prefix}${o}${e.suffix}`, done: !1 } : { value: void 0, done: !0 };
663
1518
  }
664
1519
  };
665
- }, d = (e) => {
1520
+ }, h = (e) => {
666
1521
  if (e.length < 2)
667
1522
  return null;
668
1523
  const t = e[1] - e[0];
669
1524
  for (let n = 2; n < e.length; n += 1)
670
- if (Math.abs(e[n] - e[n - 1] - t) > x)
1525
+ if (Math.abs(e[n] - e[n - 1] - t) > L)
671
1526
  return null;
672
1527
  return t;
673
- }, ke = (e) => {
1528
+ }, mt = (e) => {
674
1529
  if (e.length < 2 || e[0] === 0)
675
1530
  return null;
676
1531
  const t = e[1] / e[0];
677
1532
  for (let n = 2; n < e.length; n += 1)
678
- if (e[n - 1] === 0 || Math.abs(e[n] / e[n - 1] - t) > x)
1533
+ if (e[n - 1] === 0 || Math.abs(e[n] / e[n - 1] - t) > L)
679
1534
  return null;
680
1535
  return t;
681
- }, Ne = (e) => {
682
- const t = e.map((r) => Se(r));
683
- if (t.every(Boolean)) {
684
- const r = t[0], s = t[t.length - 1];
685
- if (t.every(
686
- (a) => a?.prefix === r.prefix && a?.suffix === r.suffix
1536
+ }, ht = (e) => {
1537
+ const t = e.map((i) => _e(i));
1538
+ if (t.every((i) => i !== null)) {
1539
+ const i = t, a = i[0];
1540
+ if (i.every(
1541
+ (c) => c.prefix === a.prefix && c.suffix === a.suffix && c.format === a.format
687
1542
  )) {
688
- const a = t.map((l) => l?.num ?? 0), o = d(a);
689
- if (o !== null)
1543
+ const c = i.map((d) => d.num), f = h(c);
1544
+ if (f !== null) {
1545
+ const d = i[i.length - 1];
690
1546
  return {
691
1547
  kind: "arithmetic",
692
- iterator: be(
693
- { prefix: s.prefix, suffix: s.suffix, width: s.width },
694
- s.num,
695
- o
1548
+ iterator: et(
1549
+ { prefix: a.prefix, suffix: a.suffix, format: a.format },
1550
+ d.num,
1551
+ f
696
1552
  )
697
1553
  };
1554
+ }
698
1555
  }
699
1556
  }
700
- const n = e.map((r) => xe(r));
701
- if (n.every((r) => r !== null)) {
702
- const r = n, s = d(r);
703
- if (s !== null) {
704
- const i = r[r.length - 1];
1557
+ const n = e.map((i) => Ze(i));
1558
+ if (n.every(Boolean)) {
1559
+ const i = n[0], a = n[n.length - 1];
1560
+ if (n.every(
1561
+ (c) => c?.prefix === i.prefix && c?.suffix === i.suffix
1562
+ )) {
1563
+ const c = n.map((d) => d?.num ?? 0), f = h(c);
1564
+ if (f !== null)
1565
+ return {
1566
+ kind: "arithmetic",
1567
+ iterator: tt(
1568
+ { prefix: a.prefix, suffix: a.suffix, width: a.width },
1569
+ a.num,
1570
+ f
1571
+ )
1572
+ };
1573
+ }
1574
+ }
1575
+ const s = e.map((i) => W(i));
1576
+ if (s.every((i) => i !== null)) {
1577
+ const i = s, a = h(i);
1578
+ if (a !== null) {
1579
+ const l = i[i.length - 1];
705
1580
  return {
706
1581
  kind: "arithmetic",
707
- iterator: Ie(i, s)
1582
+ iterator: nt(l, a)
708
1583
  };
709
1584
  }
710
1585
  }
1586
+ const r = e.map((i) => $(i));
1587
+ if (r.every((i) => i !== null)) {
1588
+ const i = r, a = i[0].style;
1589
+ if (i.every((l) => l.style === a)) {
1590
+ const l = i.map((f) => f.num), c = h(l);
1591
+ if (c !== null) {
1592
+ const f = i[i.length - 1];
1593
+ return {
1594
+ kind: "arithmetic",
1595
+ iterator: ft(f.num, c, f.style)
1596
+ };
1597
+ }
1598
+ }
1599
+ }
1600
+ const o = e.map((i) => it(i));
1601
+ if (o.every((i) => i !== null)) {
1602
+ const i = o, a = i[0];
1603
+ if (i.every(
1604
+ (c) => c.prefix === a.prefix && c.suffix === a.suffix
1605
+ )) {
1606
+ const c = i.map((d) => d.num), f = h(c);
1607
+ if (f !== null) {
1608
+ const d = c[c.length - 1];
1609
+ return {
1610
+ kind: "arithmetic",
1611
+ iterator: ot(
1612
+ { prefix: a.prefix, suffix: a.suffix },
1613
+ d,
1614
+ f
1615
+ )
1616
+ };
1617
+ }
1618
+ }
1619
+ }
1620
+ const u = e.map((i) => ct(i));
1621
+ if (u.every((i) => i !== null)) {
1622
+ const i = u, a = i[0];
1623
+ if (i.every(
1624
+ (c) => c.prefix === a.prefix && c.suffix === a.suffix && c.style === a.style
1625
+ )) {
1626
+ const c = i.map((d) => d.num), f = h(c);
1627
+ if (f !== null) {
1628
+ const d = i[i.length - 1];
1629
+ return {
1630
+ kind: "arithmetic",
1631
+ iterator: dt(
1632
+ { prefix: a.prefix, suffix: a.suffix, style: a.style },
1633
+ d.num,
1634
+ f
1635
+ )
1636
+ };
1637
+ }
1638
+ }
1639
+ }
711
1640
  return null;
712
- }, je = (e, t) => {
1641
+ }, gt = (e, t) => {
713
1642
  const n = t.match(e);
714
1643
  return n ? {
715
1644
  kind: "list",
716
- iterator: he(n, e)
1645
+ iterator: Ye(n, e)
717
1646
  } : null;
718
1647
  };
719
- function Te(e, t) {
720
- const n = t?.registry ?? oe();
1648
+ function pt(e, t) {
1649
+ const n = t?.registry ?? De();
721
1650
  if (e.length === 0)
722
- return c.fromSeed(e, "seed-repeat", S(e));
1651
+ return m.fromSeed(e, "seed-repeat", I(e));
723
1652
  if (e.length === 1)
724
- return c.fromSeed(e, "copy", ue(e[0]));
725
- if (ye(e)) {
726
- const r = je(e, n);
727
- if (r)
728
- return c.fromSeed(e, r.kind, r.iterator);
729
- const s = Ne(e);
1653
+ return m.fromSeed(e, "copy", Be(e[0]));
1654
+ if (Qe(e)) {
1655
+ const s = gt(e, n);
730
1656
  if (s)
731
- return c.fromSeed(e, s.kind, s.iterator);
1657
+ return m.fromSeed(e, s.kind, s.iterator);
1658
+ const r = ht(e);
1659
+ if (r)
1660
+ return m.fromSeed(e, r.kind, r.iterator);
732
1661
  }
733
- if (ge(e)) {
734
- const r = d(e);
735
- if (r !== null)
736
- return c.fromSeed(
1662
+ if (qe(e)) {
1663
+ const s = h(e);
1664
+ if (s !== null)
1665
+ return m.fromSeed(
737
1666
  e,
738
1667
  "arithmetic",
739
- me(e[e.length - 1], r)
1668
+ Ge(e[e.length - 1], s)
740
1669
  );
741
- const s = ke(e);
742
- if (s !== null)
743
- return c.fromSeed(
1670
+ const r = mt(e);
1671
+ if (r !== null)
1672
+ return m.fromSeed(
744
1673
  e,
745
1674
  "geometric",
746
- fe(e[e.length - 1], s)
1675
+ Ue(e[e.length - 1], r)
747
1676
  );
748
1677
  }
749
- if (pe(e)) {
750
- const r = e.map((i) => i.getTime()), s = d(r);
751
- if (s !== null)
752
- return c.fromSeed(
1678
+ if (Xe(e)) {
1679
+ const s = e.map((o) => o.getTime()), r = h(s);
1680
+ if (r !== null)
1681
+ return m.fromSeed(
753
1682
  e,
754
1683
  "arithmetic",
755
- de(e[e.length - 1], s)
1684
+ He(e[e.length - 1], r)
756
1685
  );
757
1686
  }
758
- return c.fromSeed(e, "seed-repeat", S(e));
1687
+ return m.fromSeed(e, "seed-repeat", I(e));
759
1688
  }
760
1689
  export {
761
- c as Sequence,
762
- J as SequenceRegistry,
763
- oe as createBuiltInRegistry,
764
- Te as inferSequence,
765
- ie as registerBuiltInLists,
766
- ae as registerBuiltInMatchers
1690
+ m as Sequence,
1691
+ z as SequenceRegistry,
1692
+ De as createBuiltInRegistry,
1693
+ v as formatEnglishOrdinalWord,
1694
+ pt as inferSequence,
1695
+ p as ordinalSuffix,
1696
+ A as parseEnglishOrdinalWord,
1697
+ Je as registerBuiltInLists,
1698
+ Re as registerBuiltInMatchers
767
1699
  };
768
1700
  //# sourceMappingURL=index.js.map