@everymatrix/loyalty-rakeback 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4975 +0,0 @@
1
- var qn = Object.defineProperty;
2
- var vr = (e) => {
3
- throw TypeError(e);
4
- };
5
- var zn = (e, t, r) => t in e ? qn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
6
- var re = (e, t, r) => zn(e, typeof t != "symbol" ? t + "" : t, r), Ht = (e, t, r) => t.has(e) || vr("Cannot " + r);
7
- var p = (e, t, r) => (Ht(e, t, "read from private field"), r ? r.call(e) : t.get(e)), N = (e, t, r) => t.has(e) ? vr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), de = (e, t, r, n) => (Ht(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), me = (e, t, r) => (Ht(e, t, "access private method"), r);
8
- import "svelte";
9
- const Zn = "5";
10
- var Lr;
11
- typeof window < "u" && ((Lr = window.__svelte ?? (window.__svelte = {})).v ?? (Lr.v = /* @__PURE__ */ new Set())).add(Zn);
12
- const Qn = 2, A = Symbol(), Dt = !1;
13
- var Yn = Array.isArray, Jn = Array.prototype.indexOf, Kn = Object.defineProperty, At = Object.getOwnPropertyDescriptor, ei = Object.prototype, ti = Array.prototype, ri = Object.getPrototypeOf;
14
- const ae = () => {
15
- };
16
- function Dr(e) {
17
- for (var t = 0; t < e.length; t++)
18
- e[t]();
19
- }
20
- function Ur() {
21
- var e, t, r = new Promise((n, i) => {
22
- e = n, t = i;
23
- });
24
- return { promise: r, resolve: e, reject: t };
25
- }
26
- const P = 2, Ut = 4, rr = 8, Fr = 1 << 24, ne = 16, ie = 32, Ge = 64, Gr = 128, X = 512, O = 1024, D = 2048, ce = 4096, ee = 8192, oe = 16384, nr = 32768, qe = 65536, dr = 1 << 17, kr = 1 << 18, bt = 1 << 19, ni = 1 << 20, we = 32768, Ft = 1 << 21, ir = 1 << 22, ue = 1 << 23, Bt = Symbol("$state"), Pe = new class extends Error {
27
- constructor() {
28
- super(...arguments);
29
- re(this, "name", "StaleReactionError");
30
- re(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
31
- }
32
- }();
33
- function ii() {
34
- throw new Error("https://svelte.dev/e/async_derived_orphan");
35
- }
36
- function si(e) {
37
- throw new Error("https://svelte.dev/e/effect_in_teardown");
38
- }
39
- function ai() {
40
- throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
41
- }
42
- function oi(e) {
43
- throw new Error("https://svelte.dev/e/effect_orphan");
44
- }
45
- function ui() {
46
- throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
47
- }
48
- function li() {
49
- throw new Error("https://svelte.dev/e/state_descriptors_fixed");
50
- }
51
- function fi() {
52
- throw new Error("https://svelte.dev/e/state_prototype_fixed");
53
- }
54
- function hi() {
55
- throw new Error("https://svelte.dev/e/state_unsafe_mutation");
56
- }
57
- function jr(e) {
58
- return e === this.v;
59
- }
60
- function Vr(e, t) {
61
- return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
62
- }
63
- function ci(e) {
64
- return !Vr(e, this.v);
65
- }
66
- let pi = !1, te = null;
67
- function ot(e) {
68
- te = e;
69
- }
70
- function vi(e, t = !1, r) {
71
- te = {
72
- p: te,
73
- i: !1,
74
- c: null,
75
- e: null,
76
- s: e,
77
- x: null,
78
- l: null
79
- };
80
- }
81
- function di(e) {
82
- var t = (
83
- /** @type {ComponentContext} */
84
- te
85
- ), r = t.e;
86
- if (r !== null) {
87
- t.e = null;
88
- for (var n of r)
89
- sn(n);
90
- }
91
- return t.i = !0, te = t.p, /** @type {T} */
92
- {};
93
- }
94
- function Xr() {
95
- return !0;
96
- }
97
- let Ne = [];
98
- function mi() {
99
- var e = Ne;
100
- Ne = [], Dr(e);
101
- }
102
- function _i(e) {
103
- if (Ne.length === 0) {
104
- var t = Ne;
105
- queueMicrotask(() => {
106
- t === Ne && mi();
107
- });
108
- }
109
- Ne.push(e);
110
- }
111
- function bi(e) {
112
- var t = w;
113
- if (t === null)
114
- return b.f |= ue, e;
115
- if (t.f & nr)
116
- ut(e, t);
117
- else {
118
- if (!(t.f & Gr))
119
- throw e;
120
- t.b.error(e);
121
- }
122
- }
123
- function ut(e, t) {
124
- for (; t !== null; ) {
125
- if (t.f & Gr)
126
- try {
127
- t.b.error(e);
128
- return;
129
- } catch (r) {
130
- e = r;
131
- }
132
- t = t.parent;
133
- }
134
- throw e;
135
- }
136
- const gi = -7169;
137
- function I(e, t) {
138
- e.f = e.f & gi | t;
139
- }
140
- function sr(e) {
141
- e.f & X || e.deps === null ? I(e, O) : I(e, ce);
142
- }
143
- function Wr(e) {
144
- if (e !== null)
145
- for (const t of e)
146
- !(t.f & P) || !(t.f & we) || (t.f ^= we, Wr(
147
- /** @type {Derived} */
148
- t.deps
149
- ));
150
- }
151
- function Ei(e, t, r) {
152
- e.f & D ? t.add(e) : e.f & ce && r.add(e), Wr(e.deps), I(e, O);
153
- }
154
- const tt = /* @__PURE__ */ new Set();
155
- let y = null, B = null, Y = [], ar = null, Gt = !1;
156
- var Oe, Ie, be, ge, Ye, Ce, Re, W, kt, jt, $r, qr;
157
- const mt = class mt {
158
- constructor() {
159
- N(this, W);
160
- re(this, "committed", !1);
161
- /**
162
- * The current values of any sources that are updated in this batch
163
- * They keys of this map are identical to `this.#previous`
164
- * @type {Map<Source, any>}
165
- */
166
- re(this, "current", /* @__PURE__ */ new Map());
167
- /**
168
- * The values of any sources that are updated in this batch _before_ those updates took place.
169
- * They keys of this map are identical to `this.#current`
170
- * @type {Map<Source, any>}
171
- */
172
- re(this, "previous", /* @__PURE__ */ new Map());
173
- /**
174
- * When the batch is committed (and the DOM is updated), we need to remove old branches
175
- * and append new ones by calling the functions added inside (if/each/key/etc) blocks
176
- * @type {Set<() => void>}
177
- */
178
- N(this, Oe, /* @__PURE__ */ new Set());
179
- /**
180
- * If a fork is discarded, we need to destroy any effects that are no longer needed
181
- * @type {Set<(batch: Batch) => void>}
182
- */
183
- N(this, Ie, /* @__PURE__ */ new Set());
184
- /**
185
- * The number of async effects that are currently in flight
186
- */
187
- N(this, be, 0);
188
- /**
189
- * The number of async effects that are currently in flight, _not_ inside a pending boundary
190
- */
191
- N(this, ge, 0);
192
- /**
193
- * A deferred that resolves when the batch is committed, used with `settled()`
194
- * TODO replace with Promise.withResolvers once supported widely enough
195
- * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
196
- */
197
- N(this, Ye, null);
198
- /**
199
- * Deferred effects (which run after async work has completed) that are DIRTY
200
- * @type {Set<Effect>}
201
- */
202
- N(this, Ce, /* @__PURE__ */ new Set());
203
- /**
204
- * Deferred effects that are MAYBE_DIRTY
205
- * @type {Set<Effect>}
206
- */
207
- N(this, Re, /* @__PURE__ */ new Set());
208
- /**
209
- * A set of branches that still exist, but will be destroyed when this batch
210
- * is committed — we skip over these during `process`
211
- * @type {Set<Effect>}
212
- */
213
- re(this, "skipped_effects", /* @__PURE__ */ new Set());
214
- re(this, "is_fork", !1);
215
- }
216
- is_deferred() {
217
- return this.is_fork || p(this, ge) > 0;
218
- }
219
- /**
220
- *
221
- * @param {Effect[]} root_effects
222
- */
223
- process(t) {
224
- var i;
225
- Y = [], this.apply();
226
- var r = [], n = [];
227
- for (const s of t)
228
- me(this, W, kt).call(this, s, r, n);
229
- this.is_fork || me(this, W, $r).call(this), this.is_deferred() ? (me(this, W, jt).call(this, n), me(this, W, jt).call(this, r)) : (y = null, mr(n), mr(r), (i = p(this, Ye)) == null || i.resolve()), B = null;
230
- }
231
- /**
232
- * Associate a change to a given source with the current
233
- * batch, noting its previous and current values
234
- * @param {Source} source
235
- * @param {any} value
236
- */
237
- capture(t, r) {
238
- r !== A && !this.previous.has(t) && this.previous.set(t, r), t.f & ue || (this.current.set(t, t.v), B == null || B.set(t, t.v));
239
- }
240
- activate() {
241
- y = this, this.apply();
242
- }
243
- deactivate() {
244
- y === this && (y = null, B = null);
245
- }
246
- flush() {
247
- if (this.activate(), Y.length > 0) {
248
- if (yi(), y !== null && y !== this)
249
- return;
250
- } else p(this, be) === 0 && this.process([]);
251
- this.deactivate();
252
- }
253
- discard() {
254
- for (const t of p(this, Ie)) t(this);
255
- p(this, Ie).clear();
256
- }
257
- /**
258
- *
259
- * @param {boolean} blocking
260
- */
261
- increment(t) {
262
- de(this, be, p(this, be) + 1), t && de(this, ge, p(this, ge) + 1);
263
- }
264
- /**
265
- *
266
- * @param {boolean} blocking
267
- */
268
- decrement(t) {
269
- de(this, be, p(this, be) - 1), t && de(this, ge, p(this, ge) - 1), this.revive();
270
- }
271
- revive() {
272
- for (const t of p(this, Ce))
273
- p(this, Re).delete(t), I(t, D), Te(t);
274
- for (const t of p(this, Re))
275
- I(t, ce), Te(t);
276
- this.flush();
277
- }
278
- /** @param {() => void} fn */
279
- oncommit(t) {
280
- p(this, Oe).add(t);
281
- }
282
- /** @param {(batch: Batch) => void} fn */
283
- ondiscard(t) {
284
- p(this, Ie).add(t);
285
- }
286
- settled() {
287
- return (p(this, Ye) ?? de(this, Ye, Ur())).promise;
288
- }
289
- static ensure() {
290
- if (y === null) {
291
- const t = y = new mt();
292
- tt.add(y), mt.enqueue(() => {
293
- y === t && t.flush();
294
- });
295
- }
296
- return y;
297
- }
298
- /** @param {() => void} task */
299
- static enqueue(t) {
300
- _i(t);
301
- }
302
- apply() {
303
- }
304
- };
305
- Oe = new WeakMap(), Ie = new WeakMap(), be = new WeakMap(), ge = new WeakMap(), Ye = new WeakMap(), Ce = new WeakMap(), Re = new WeakMap(), W = new WeakSet(), /**
306
- * Traverse the effect tree, executing effects or stashing
307
- * them for later execution as appropriate
308
- * @param {Effect} root
309
- * @param {Effect[]} effects
310
- * @param {Effect[]} render_effects
311
- */
312
- kt = function(t, r, n) {
313
- t.f ^= O;
314
- for (var i = t.first, s = null; i !== null; ) {
315
- var a = i.f, o = (a & (ie | Ge)) !== 0, u = o && (a & O) !== 0, l = u || (a & ee) !== 0 || this.skipped_effects.has(i);
316
- if (!l && i.fn !== null) {
317
- o ? i.f ^= O : s !== null && a & (Ut | rr | Fr) ? s.b.defer_effect(i) : a & Ut ? r.push(i) : et(i) && (a & ne && p(this, Ce).add(i), ze(i));
318
- var f = i.first;
319
- if (f !== null) {
320
- i = f;
321
- continue;
322
- }
323
- }
324
- var c = i.parent;
325
- for (i = i.next; i === null && c !== null; )
326
- c === s && (s = null), i = c.next, c = c.parent;
327
- }
328
- }, /**
329
- * @param {Effect[]} effects
330
- */
331
- jt = function(t) {
332
- for (var r = 0; r < t.length; r += 1)
333
- Ei(t[r], p(this, Ce), p(this, Re));
334
- }, $r = function() {
335
- if (p(this, ge) === 0) {
336
- for (const t of p(this, Oe)) t();
337
- p(this, Oe).clear();
338
- }
339
- p(this, be) === 0 && me(this, W, qr).call(this);
340
- }, qr = function() {
341
- var i;
342
- if (tt.size > 1) {
343
- this.previous.clear();
344
- var t = B, r = !0;
345
- for (const s of tt) {
346
- if (s === this) {
347
- r = !1;
348
- continue;
349
- }
350
- const a = [];
351
- for (const [u, l] of this.current) {
352
- if (s.current.has(u))
353
- if (r && l !== s.current.get(u))
354
- s.current.set(u, l);
355
- else
356
- continue;
357
- a.push(u);
358
- }
359
- if (a.length === 0)
360
- continue;
361
- const o = [...s.current.keys()].filter((u) => !this.current.has(u));
362
- if (o.length > 0) {
363
- var n = Y;
364
- Y = [];
365
- const u = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
366
- for (const f of a)
367
- zr(f, o, u, l);
368
- if (Y.length > 0) {
369
- y = s, s.apply();
370
- for (const f of Y)
371
- me(i = s, W, kt).call(i, f, [], []);
372
- s.deactivate();
373
- }
374
- Y = n;
375
- }
376
- }
377
- y = null, B = t;
378
- }
379
- this.committed = !0, tt.delete(this);
380
- };
381
- let lt = mt;
382
- function yi() {
383
- var e = ye;
384
- Gt = !0;
385
- var t = null;
386
- try {
387
- var r = 0;
388
- for (ht(!0); Y.length > 0; ) {
389
- var n = lt.ensure();
390
- if (r++ > 1e3) {
391
- var i, s;
392
- xi();
393
- }
394
- n.process(Y), le.clear();
395
- }
396
- } finally {
397
- Gt = !1, ht(e), ar = null;
398
- }
399
- }
400
- function xi() {
401
- try {
402
- ui();
403
- } catch (e) {
404
- ut(e, ar);
405
- }
406
- }
407
- let q = null;
408
- function mr(e) {
409
- var t = e.length;
410
- if (t !== 0) {
411
- for (var r = 0; r < t; ) {
412
- var n = e[r++];
413
- if (!(n.f & (oe | ee)) && et(n) && (q = /* @__PURE__ */ new Set(), ze(n), n.deps === null && n.first === null && n.nodes === null && (n.teardown === null && n.ac === null ? un(n) : n.fn = null), (q == null ? void 0 : q.size) > 0)) {
414
- le.clear();
415
- for (const i of q) {
416
- if (i.f & (oe | ee)) continue;
417
- const s = [i];
418
- let a = i.parent;
419
- for (; a !== null; )
420
- q.has(a) && (q.delete(a), s.push(a)), a = a.parent;
421
- for (let o = s.length - 1; o >= 0; o--) {
422
- const u = s[o];
423
- u.f & (oe | ee) || ze(u);
424
- }
425
- }
426
- q.clear();
427
- }
428
- }
429
- q = null;
430
- }
431
- }
432
- function zr(e, t, r, n) {
433
- if (!r.has(e) && (r.add(e), e.reactions !== null))
434
- for (const i of e.reactions) {
435
- const s = i.f;
436
- s & P ? zr(
437
- /** @type {Derived} */
438
- i,
439
- t,
440
- r,
441
- n
442
- ) : s & (ir | ne) && !(s & D) && Zr(i, t, n) && (I(i, D), Te(
443
- /** @type {Effect} */
444
- i
445
- ));
446
- }
447
- }
448
- function Zr(e, t, r) {
449
- const n = r.get(e);
450
- if (n !== void 0) return n;
451
- if (e.deps !== null)
452
- for (const i of e.deps) {
453
- if (t.includes(i))
454
- return !0;
455
- if (i.f & P && Zr(
456
- /** @type {Derived} */
457
- i,
458
- t,
459
- r
460
- ))
461
- return r.set(
462
- /** @type {Derived} */
463
- i,
464
- !0
465
- ), !0;
466
- }
467
- return r.set(e, !1), !1;
468
- }
469
- function Te(e) {
470
- for (var t = ar = e; t.parent !== null; ) {
471
- t = t.parent;
472
- var r = t.f;
473
- if (Gt && t === w && r & ne && !(r & kr))
474
- return;
475
- if (r & (Ge | ie)) {
476
- if (!(r & O)) return;
477
- t.f ^= O;
478
- }
479
- }
480
- Y.push(t);
481
- }
482
- function wi(e, t, r, n) {
483
- const i = Qr;
484
- if (r.length === 0 && e.length === 0) {
485
- n(t.map(i));
486
- return;
487
- }
488
- var s = y, a = (
489
- /** @type {Effect} */
490
- w
491
- ), o = Ti();
492
- function u() {
493
- Promise.all(r.map((l) => /* @__PURE__ */ Si(l))).then((l) => {
494
- o();
495
- try {
496
- n([...t.map(i), ...l]);
497
- } catch (f) {
498
- a.f & oe || ut(f, a);
499
- }
500
- s == null || s.deactivate(), ft();
501
- }).catch((l) => {
502
- ut(l, a);
503
- });
504
- }
505
- e.length > 0 ? Promise.all(e).then(() => {
506
- o();
507
- try {
508
- return u();
509
- } finally {
510
- s == null || s.deactivate(), ft();
511
- }
512
- }) : u();
513
- }
514
- function Ti() {
515
- var e = w, t = b, r = te, n = y;
516
- return function(s = !0) {
517
- Me(e), he(t), ot(r), s && (n == null || n.activate());
518
- };
519
- }
520
- function ft() {
521
- Me(null), he(null), ot(null);
522
- }
523
- // @__NO_SIDE_EFFECTS__
524
- function Qr(e) {
525
- var t = P | D, r = b !== null && b.f & P ? (
526
- /** @type {Derived} */
527
- b
528
- ) : null;
529
- return w !== null && (w.f |= bt), {
530
- ctx: te,
531
- deps: null,
532
- effects: null,
533
- equals: jr,
534
- f: t,
535
- fn: e,
536
- reactions: null,
537
- rv: 0,
538
- v: (
539
- /** @type {V} */
540
- A
541
- ),
542
- wv: 0,
543
- parent: r ?? w,
544
- ac: null
545
- };
546
- }
547
- // @__NO_SIDE_EFFECTS__
548
- function Si(e, t, r) {
549
- let n = (
550
- /** @type {Effect | null} */
551
- w
552
- );
553
- n === null && ii();
554
- var i = (
555
- /** @type {Boundary} */
556
- n.b
557
- ), s = (
558
- /** @type {Promise<V>} */
559
- /** @type {unknown} */
560
- void 0
561
- ), a = ur(
562
- /** @type {V} */
563
- A
564
- ), o = !b, u = /* @__PURE__ */ new Map();
565
- return Di(() => {
566
- var v;
567
- var l = Ur();
568
- s = l.promise;
569
- try {
570
- Promise.resolve(e()).then(l.resolve, l.reject).then(() => {
571
- f === y && f.committed && f.deactivate(), ft();
572
- });
573
- } catch (d) {
574
- l.reject(d), ft();
575
- }
576
- var f = (
577
- /** @type {Batch} */
578
- y
579
- );
580
- if (o) {
581
- var c = i.is_rendered();
582
- i.update_pending_count(1), f.increment(c), (v = u.get(f)) == null || v.reject(Pe), u.delete(f), u.set(f, l);
583
- }
584
- const h = (d, g = void 0) => {
585
- if (f.activate(), g)
586
- g !== Pe && (a.f |= ue, Xt(a, g));
587
- else {
588
- a.f & ue && (a.f ^= ue), Xt(a, d);
589
- for (const [H, j] of u) {
590
- if (u.delete(H), H === f) break;
591
- j.reject(Pe);
592
- }
593
- }
594
- o && (i.update_pending_count(-1), f.decrement(c));
595
- };
596
- l.promise.then(h, (d) => h(null, d || "unknown"));
597
- }), nn(() => {
598
- for (const l of u.values())
599
- l.reject(Pe);
600
- }), new Promise((l) => {
601
- function f(c) {
602
- function h() {
603
- c === s ? l(a) : f(s);
604
- }
605
- c.then(h, h);
606
- }
607
- f(s);
608
- });
609
- }
610
- // @__NO_SIDE_EFFECTS__
611
- function rt(e) {
612
- const t = /* @__PURE__ */ Qr(e);
613
- return hn(t), t;
614
- }
615
- function Yr(e) {
616
- var t = e.effects;
617
- if (t !== null) {
618
- e.effects = null;
619
- for (var r = 0; r < t.length; r += 1)
620
- fe(
621
- /** @type {Effect} */
622
- t[r]
623
- );
624
- }
625
- }
626
- function Hi(e) {
627
- for (var t = e.parent; t !== null; ) {
628
- if (!(t.f & P))
629
- return t.f & oe ? null : (
630
- /** @type {Effect} */
631
- t
632
- );
633
- t = t.parent;
634
- }
635
- return null;
636
- }
637
- function or(e) {
638
- var t, r = w;
639
- Me(Hi(e));
640
- try {
641
- e.f &= ~we, Yr(e), t = dn(e);
642
- } finally {
643
- Me(r);
644
- }
645
- return t;
646
- }
647
- function Jr(e) {
648
- var t = or(e);
649
- if (!e.equals(t) && (e.wv = pn(), (!(y != null && y.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) {
650
- I(e, O);
651
- return;
652
- }
653
- Se || (B !== null ? (rn() || y != null && y.is_fork) && B.set(e, t) : sr(e));
654
- }
655
- let Vt = /* @__PURE__ */ new Set();
656
- const le = /* @__PURE__ */ new Map();
657
- let Kr = !1;
658
- function ur(e, t) {
659
- var r = {
660
- f: 0,
661
- // TODO ideally we could skip this altogether, but it causes type errors
662
- v: e,
663
- reactions: null,
664
- equals: jr,
665
- rv: 0,
666
- wv: 0
667
- };
668
- return r;
669
- }
670
- // @__NO_SIDE_EFFECTS__
671
- function z(e, t) {
672
- const r = ur(e);
673
- return hn(r), r;
674
- }
675
- // @__NO_SIDE_EFFECTS__
676
- function Ai(e, t = !1, r = !0) {
677
- const n = ur(e);
678
- return t || (n.equals = ci), n;
679
- }
680
- function k(e, t, r = !1) {
681
- b !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
682
- // to ensure we error if state is set inside an inspect effect
683
- (!Q || b.f & dr) && Xr() && b.f & (P | ne | ir | dr) && !(M != null && M.includes(e)) && hi();
684
- let n = r ? $e(t) : t;
685
- return Xt(e, n);
686
- }
687
- function Xt(e, t) {
688
- if (!e.equals(t)) {
689
- var r = e.v;
690
- Se ? le.set(e, t) : le.set(e, r), e.v = t;
691
- var n = lt.ensure();
692
- if (n.capture(e, r), e.f & P) {
693
- const i = (
694
- /** @type {Derived} */
695
- e
696
- );
697
- e.f & D && or(i), sr(i);
698
- }
699
- e.wv = pn(), en(e, D), w !== null && w.f & O && !(w.f & (ie | Ge)) && (V === null ? Wi([e]) : V.push(e)), !n.is_fork && Vt.size > 0 && !Kr && Bi();
700
- }
701
- return t;
702
- }
703
- function Bi() {
704
- Kr = !1;
705
- var e = ye;
706
- ht(!0);
707
- const t = Array.from(Vt);
708
- try {
709
- for (const r of t)
710
- r.f & O && I(r, ce), et(r) && ze(r);
711
- } finally {
712
- ht(e);
713
- }
714
- Vt.clear();
715
- }
716
- function Pt(e) {
717
- k(e, e.v + 1);
718
- }
719
- function en(e, t) {
720
- var r = e.reactions;
721
- if (r !== null)
722
- for (var n = r.length, i = 0; i < n; i++) {
723
- var s = r[i], a = s.f, o = (a & D) === 0;
724
- if (o && I(s, t), a & P) {
725
- var u = (
726
- /** @type {Derived} */
727
- s
728
- );
729
- B == null || B.delete(u), a & we || (a & X && (s.f |= we), en(u, ce));
730
- } else o && (a & ne && q !== null && q.add(
731
- /** @type {Effect} */
732
- s
733
- ), Te(
734
- /** @type {Effect} */
735
- s
736
- ));
737
- }
738
- }
739
- function $e(e) {
740
- if (typeof e != "object" || e === null || Bt in e)
741
- return e;
742
- const t = ri(e);
743
- if (t !== ei && t !== ti)
744
- return e;
745
- var r = /* @__PURE__ */ new Map(), n = Yn(e), i = /* @__PURE__ */ z(0), s = xe, a = (o) => {
746
- if (xe === s)
747
- return o();
748
- var u = b, l = xe;
749
- he(null), Er(s);
750
- var f = o();
751
- return he(u), Er(l), f;
752
- };
753
- return n && r.set("length", /* @__PURE__ */ z(
754
- /** @type {any[]} */
755
- e.length
756
- )), new Proxy(
757
- /** @type {any} */
758
- e,
759
- {
760
- defineProperty(o, u, l) {
761
- (!("value" in l) || l.configurable === !1 || l.enumerable === !1 || l.writable === !1) && li();
762
- var f = r.get(u);
763
- return f === void 0 ? f = a(() => {
764
- var c = /* @__PURE__ */ z(l.value);
765
- return r.set(u, c), c;
766
- }) : k(f, l.value, !0), !0;
767
- },
768
- deleteProperty(o, u) {
769
- var l = r.get(u);
770
- if (l === void 0) {
771
- if (u in o) {
772
- const f = a(() => /* @__PURE__ */ z(A));
773
- r.set(u, f), Pt(i);
774
- }
775
- } else
776
- k(l, A), Pt(i);
777
- return !0;
778
- },
779
- get(o, u, l) {
780
- var v;
781
- if (u === Bt)
782
- return e;
783
- var f = r.get(u), c = u in o;
784
- if (f === void 0 && (!c || (v = At(o, u)) != null && v.writable) && (f = a(() => {
785
- var d = $e(c ? o[u] : A), g = /* @__PURE__ */ z(d);
786
- return g;
787
- }), r.set(u, f)), f !== void 0) {
788
- var h = T(f);
789
- return h === A ? void 0 : h;
790
- }
791
- return Reflect.get(o, u, l);
792
- },
793
- getOwnPropertyDescriptor(o, u) {
794
- var l = Reflect.getOwnPropertyDescriptor(o, u);
795
- if (l && "value" in l) {
796
- var f = r.get(u);
797
- f && (l.value = T(f));
798
- } else if (l === void 0) {
799
- var c = r.get(u), h = c == null ? void 0 : c.v;
800
- if (c !== void 0 && h !== A)
801
- return {
802
- enumerable: !0,
803
- configurable: !0,
804
- value: h,
805
- writable: !0
806
- };
807
- }
808
- return l;
809
- },
810
- has(o, u) {
811
- var h;
812
- if (u === Bt)
813
- return !0;
814
- var l = r.get(u), f = l !== void 0 && l.v !== A || Reflect.has(o, u);
815
- if (l !== void 0 || w !== null && (!f || (h = At(o, u)) != null && h.writable)) {
816
- l === void 0 && (l = a(() => {
817
- var v = f ? $e(o[u]) : A, d = /* @__PURE__ */ z(v);
818
- return d;
819
- }), r.set(u, l));
820
- var c = T(l);
821
- if (c === A)
822
- return !1;
823
- }
824
- return f;
825
- },
826
- set(o, u, l, f) {
827
- var C;
828
- var c = r.get(u), h = u in o;
829
- if (n && u === "length")
830
- for (var v = l; v < /** @type {Source<number>} */
831
- c.v; v += 1) {
832
- var d = r.get(v + "");
833
- d !== void 0 ? k(d, A) : v in o && (d = a(() => /* @__PURE__ */ z(A)), r.set(v + "", d));
834
- }
835
- if (c === void 0)
836
- (!h || (C = At(o, u)) != null && C.writable) && (c = a(() => /* @__PURE__ */ z(void 0)), k(c, $e(l)), r.set(u, c));
837
- else {
838
- h = c.v !== A;
839
- var g = a(() => $e(l));
840
- k(c, g);
841
- }
842
- var H = Reflect.getOwnPropertyDescriptor(o, u);
843
- if (H != null && H.set && H.set.call(f, l), !h) {
844
- if (n && typeof u == "string") {
845
- var j = (
846
- /** @type {Source<number>} */
847
- r.get("length")
848
- ), U = Number(u);
849
- Number.isInteger(U) && U >= j.v && k(j, U + 1);
850
- }
851
- Pt(i);
852
- }
853
- return !0;
854
- },
855
- ownKeys(o) {
856
- T(i);
857
- var u = Reflect.ownKeys(o).filter((c) => {
858
- var h = r.get(c);
859
- return h === void 0 || h.v !== A;
860
- });
861
- for (var [l, f] of r)
862
- f.v !== A && !(l in o) && u.push(l);
863
- return u;
864
- },
865
- setPrototypeOf() {
866
- fi();
867
- }
868
- }
869
- );
870
- }
871
- var Pi, Ni, Oi;
872
- function Wt(e = "") {
873
- return document.createTextNode(e);
874
- }
875
- // @__NO_SIDE_EFFECTS__
876
- function lr(e) {
877
- return (
878
- /** @type {TemplateNode | null} */
879
- Ni.call(e)
880
- );
881
- }
882
- // @__NO_SIDE_EFFECTS__
883
- function gt(e) {
884
- return (
885
- /** @type {TemplateNode | null} */
886
- Oi.call(e)
887
- );
888
- }
889
- function nt(e, t) {
890
- return /* @__PURE__ */ lr(e);
891
- }
892
- function Ii(e, t = !1) {
893
- {
894
- var r = /* @__PURE__ */ lr(e);
895
- return r instanceof Comment && r.data === "" ? /* @__PURE__ */ gt(r) : r;
896
- }
897
- }
898
- function Ci(e, t = 1, r = !1) {
899
- let n = e;
900
- for (; t--; )
901
- n = /** @type {TemplateNode} */
902
- /* @__PURE__ */ gt(n);
903
- return n;
904
- }
905
- function Ri() {
906
- return !1;
907
- }
908
- function tn(e) {
909
- var t = b, r = w;
910
- he(null), Me(null);
911
- try {
912
- return e();
913
- } finally {
914
- he(t), Me(r);
915
- }
916
- }
917
- function Mi(e) {
918
- w === null && (b === null && oi(), ai()), Se && si();
919
- }
920
- function Li(e, t) {
921
- var r = t.last;
922
- r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
923
- }
924
- function ke(e, t, r) {
925
- var n = w;
926
- n !== null && n.f & ee && (e |= ee);
927
- var i = {
928
- ctx: te,
929
- deps: null,
930
- nodes: null,
931
- f: e | D | X,
932
- first: null,
933
- fn: t,
934
- last: null,
935
- next: null,
936
- parent: n,
937
- b: n && n.b,
938
- prev: null,
939
- teardown: null,
940
- wv: 0,
941
- ac: null
942
- };
943
- if (r)
944
- try {
945
- ze(i), i.f |= nr;
946
- } catch (o) {
947
- throw fe(i), o;
948
- }
949
- else t !== null && Te(i);
950
- var s = i;
951
- if (r && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
952
- !(s.f & bt) && (s = s.first, e & ne && e & qe && s !== null && (s.f |= qe)), s !== null && (s.parent = n, n !== null && Li(s, n), b !== null && b.f & P && !(e & Ge))) {
953
- var a = (
954
- /** @type {Derived} */
955
- b
956
- );
957
- (a.effects ?? (a.effects = [])).push(s);
958
- }
959
- return i;
960
- }
961
- function rn() {
962
- return b !== null && !Q;
963
- }
964
- function nn(e) {
965
- const t = ke(rr, null, !1);
966
- return I(t, O), t.teardown = e, t;
967
- }
968
- function _r(e) {
969
- Mi();
970
- var t = (
971
- /** @type {Effect} */
972
- w.f
973
- ), r = !b && (t & ie) !== 0 && (t & nr) === 0;
974
- if (r) {
975
- var n = (
976
- /** @type {ComponentContext} */
977
- te
978
- );
979
- (n.e ?? (n.e = [])).push(e);
980
- } else
981
- return sn(e);
982
- }
983
- function sn(e) {
984
- return ke(Ut | ni, e, !1);
985
- }
986
- function Di(e) {
987
- return ke(ir | bt, e, !0);
988
- }
989
- function Ui(e, t = [], r = [], n = []) {
990
- wi(n, t, r, (i) => {
991
- ke(rr, () => e(...i.map(T)), !0);
992
- });
993
- }
994
- function Fi(e, t = 0) {
995
- var r = ke(ne | t, e, !0);
996
- return r;
997
- }
998
- function br(e) {
999
- return ke(ie | bt, e, !0);
1000
- }
1001
- function an(e) {
1002
- var t = e.teardown;
1003
- if (t !== null) {
1004
- const r = Se, n = b;
1005
- gr(!0), he(null);
1006
- try {
1007
- t.call(null);
1008
- } finally {
1009
- gr(r), he(n);
1010
- }
1011
- }
1012
- }
1013
- function on(e, t = !1) {
1014
- var r = e.first;
1015
- for (e.first = e.last = null; r !== null; ) {
1016
- const i = r.ac;
1017
- i !== null && tn(() => {
1018
- i.abort(Pe);
1019
- });
1020
- var n = r.next;
1021
- r.f & Ge ? r.parent = null : fe(r, t), r = n;
1022
- }
1023
- }
1024
- function Gi(e) {
1025
- for (var t = e.first; t !== null; ) {
1026
- var r = t.next;
1027
- t.f & ie || fe(t), t = r;
1028
- }
1029
- }
1030
- function fe(e, t = !0) {
1031
- var r = !1;
1032
- (t || e.f & kr) && e.nodes !== null && e.nodes.end !== null && (ki(
1033
- e.nodes.start,
1034
- /** @type {TemplateNode} */
1035
- e.nodes.end
1036
- ), r = !0), on(e, t && !r), ct(e, 0), I(e, oe);
1037
- var n = e.nodes && e.nodes.t;
1038
- if (n !== null)
1039
- for (const s of n)
1040
- s.stop();
1041
- an(e);
1042
- var i = e.parent;
1043
- i !== null && i.first !== null && un(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1044
- }
1045
- function ki(e, t) {
1046
- for (; e !== null; ) {
1047
- var r = e === t ? null : /* @__PURE__ */ gt(e);
1048
- e.remove(), e = r;
1049
- }
1050
- }
1051
- function un(e) {
1052
- var t = e.parent, r = e.prev, n = e.next;
1053
- r !== null && (r.next = n), n !== null && (n.prev = r), t !== null && (t.first === e && (t.first = n), t.last === e && (t.last = r));
1054
- }
1055
- function ji(e, t, r = !0) {
1056
- var n = [];
1057
- ln(e, n, !0);
1058
- var i = () => {
1059
- r && fe(e), t && t();
1060
- }, s = n.length;
1061
- if (s > 0) {
1062
- var a = () => --s || i();
1063
- for (var o of n)
1064
- o.out(a);
1065
- } else
1066
- i();
1067
- }
1068
- function ln(e, t, r) {
1069
- if (!(e.f & ee)) {
1070
- e.f ^= ee;
1071
- var n = e.nodes && e.nodes.t;
1072
- if (n !== null)
1073
- for (const o of n)
1074
- (o.is_global || r) && t.push(o);
1075
- for (var i = e.first; i !== null; ) {
1076
- var s = i.next, a = (i.f & qe) !== 0 || // If this is a branch effect without a block effect parent,
1077
- // it means the parent block effect was pruned. In that case,
1078
- // transparency information was transferred to the branch effect.
1079
- (i.f & ie) !== 0 && (e.f & ne) !== 0;
1080
- ln(i, t, a ? r : !1), i = s;
1081
- }
1082
- }
1083
- }
1084
- function Vi(e) {
1085
- fn(e, !0);
1086
- }
1087
- function fn(e, t) {
1088
- if (e.f & ee) {
1089
- e.f ^= ee, e.f & O || (I(e, D), Te(e));
1090
- for (var r = e.first; r !== null; ) {
1091
- var n = r.next, i = (r.f & qe) !== 0 || (r.f & ie) !== 0;
1092
- fn(r, i ? t : !1), r = n;
1093
- }
1094
- var s = e.nodes && e.nodes.t;
1095
- if (s !== null)
1096
- for (const a of s)
1097
- (a.is_global || t) && a.in();
1098
- }
1099
- }
1100
- function Xi(e, t) {
1101
- if (e.nodes)
1102
- for (var r = e.nodes.start, n = e.nodes.end; r !== null; ) {
1103
- var i = r === n ? null : /* @__PURE__ */ gt(r);
1104
- t.append(r), r = i;
1105
- }
1106
- }
1107
- let ye = !1;
1108
- function ht(e) {
1109
- ye = e;
1110
- }
1111
- let Se = !1;
1112
- function gr(e) {
1113
- Se = e;
1114
- }
1115
- let b = null, Q = !1;
1116
- function he(e) {
1117
- b = e;
1118
- }
1119
- let w = null;
1120
- function Me(e) {
1121
- w = e;
1122
- }
1123
- let M = null;
1124
- function hn(e) {
1125
- b !== null && (M === null ? M = [e] : M.push(e));
1126
- }
1127
- let L = null, F = 0, V = null;
1128
- function Wi(e) {
1129
- V = e;
1130
- }
1131
- let cn = 1, _e = 0, xe = _e;
1132
- function Er(e) {
1133
- xe = e;
1134
- }
1135
- function pn() {
1136
- return ++cn;
1137
- }
1138
- function et(e) {
1139
- var t = e.f;
1140
- if (t & D)
1141
- return !0;
1142
- if (t & P && (e.f &= ~we), t & ce) {
1143
- for (var r = (
1144
- /** @type {Value[]} */
1145
- e.deps
1146
- ), n = r.length, i = 0; i < n; i++) {
1147
- var s = r[i];
1148
- if (et(
1149
- /** @type {Derived} */
1150
- s
1151
- ) && Jr(
1152
- /** @type {Derived} */
1153
- s
1154
- ), s.wv > e.wv)
1155
- return !0;
1156
- }
1157
- t & X && // During time traveling we don't want to reset the status so that
1158
- // traversal of the graph in the other batches still happens
1159
- B === null && I(e, O);
1160
- }
1161
- return !1;
1162
- }
1163
- function vn(e, t, r = !0) {
1164
- var n = e.reactions;
1165
- if (n !== null && !(M != null && M.includes(e)))
1166
- for (var i = 0; i < n.length; i++) {
1167
- var s = n[i];
1168
- s.f & P ? vn(
1169
- /** @type {Derived} */
1170
- s,
1171
- t,
1172
- !1
1173
- ) : t === s && (r ? I(s, D) : s.f & O && I(s, ce), Te(
1174
- /** @type {Effect} */
1175
- s
1176
- ));
1177
- }
1178
- }
1179
- function dn(e) {
1180
- var d;
1181
- var t = L, r = F, n = V, i = b, s = M, a = te, o = Q, u = xe, l = e.f;
1182
- L = /** @type {null | Value[]} */
1183
- null, F = 0, V = null, b = l & (ie | Ge) ? null : e, M = null, ot(e.ctx), Q = !1, xe = ++_e, e.ac !== null && (tn(() => {
1184
- e.ac.abort(Pe);
1185
- }), e.ac = null);
1186
- try {
1187
- e.f |= Ft;
1188
- var f = (
1189
- /** @type {Function} */
1190
- e.fn
1191
- ), c = f(), h = e.deps;
1192
- if (L !== null) {
1193
- var v;
1194
- if (ct(e, F), h !== null && F > 0)
1195
- for (h.length = F + L.length, v = 0; v < L.length; v++)
1196
- h[F + v] = L[v];
1197
- else
1198
- e.deps = h = L;
1199
- if (rn() && e.f & X)
1200
- for (v = F; v < h.length; v++)
1201
- ((d = h[v]).reactions ?? (d.reactions = [])).push(e);
1202
- } else h !== null && F < h.length && (ct(e, F), h.length = F);
1203
- if (Xr() && V !== null && !Q && h !== null && !(e.f & (P | ce | D)))
1204
- for (v = 0; v < /** @type {Source[]} */
1205
- V.length; v++)
1206
- vn(
1207
- V[v],
1208
- /** @type {Effect} */
1209
- e
1210
- );
1211
- if (i !== null && i !== e) {
1212
- if (_e++, i.deps !== null)
1213
- for (let g = 0; g < r; g += 1)
1214
- i.deps[g].rv = _e;
1215
- if (t !== null)
1216
- for (const g of t)
1217
- g.rv = _e;
1218
- V !== null && (n === null ? n = V : n.push(.../** @type {Source[]} */
1219
- V));
1220
- }
1221
- return e.f & ue && (e.f ^= ue), c;
1222
- } catch (g) {
1223
- return bi(g);
1224
- } finally {
1225
- e.f ^= Ft, L = t, F = r, V = n, b = i, M = s, ot(a), Q = o, xe = u;
1226
- }
1227
- }
1228
- function $i(e, t) {
1229
- let r = t.reactions;
1230
- if (r !== null) {
1231
- var n = Jn.call(r, e);
1232
- if (n !== -1) {
1233
- var i = r.length - 1;
1234
- i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
1235
- }
1236
- }
1237
- if (r === null && t.f & P && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1238
- // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1239
- // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1240
- (L === null || !L.includes(t))) {
1241
- var s = (
1242
- /** @type {Derived} */
1243
- t
1244
- );
1245
- s.f & X && (s.f ^= X, s.f &= ~we), sr(s), Yr(s), ct(s, 0);
1246
- }
1247
- }
1248
- function ct(e, t) {
1249
- var r = e.deps;
1250
- if (r !== null)
1251
- for (var n = t; n < r.length; n++)
1252
- $i(e, r[n]);
1253
- }
1254
- function ze(e) {
1255
- var t = e.f;
1256
- if (!(t & oe)) {
1257
- I(e, O);
1258
- var r = w, n = ye;
1259
- w = e, ye = !0;
1260
- try {
1261
- t & (ne | Fr) ? Gi(e) : on(e), an(e);
1262
- var i = dn(e);
1263
- e.teardown = typeof i == "function" ? i : null, e.wv = cn;
1264
- var s;
1265
- Dt && pi && e.f & D && e.deps;
1266
- } finally {
1267
- ye = n, w = r;
1268
- }
1269
- }
1270
- }
1271
- function T(e) {
1272
- var t = e.f, r = (t & P) !== 0;
1273
- if (b !== null && !Q) {
1274
- var n = w !== null && (w.f & oe) !== 0;
1275
- if (!n && !(M != null && M.includes(e))) {
1276
- var i = b.deps;
1277
- if (b.f & Ft)
1278
- e.rv < _e && (e.rv = _e, L === null && i !== null && i[F] === e ? F++ : L === null ? L = [e] : L.push(e));
1279
- else {
1280
- (b.deps ?? (b.deps = [])).push(e);
1281
- var s = e.reactions;
1282
- s === null ? e.reactions = [b] : s.includes(b) || s.push(b);
1283
- }
1284
- }
1285
- }
1286
- if (Se && le.has(e))
1287
- return le.get(e);
1288
- if (r) {
1289
- var a = (
1290
- /** @type {Derived} */
1291
- e
1292
- );
1293
- if (Se) {
1294
- var o = a.v;
1295
- return (!(a.f & O) && a.reactions !== null || _n(a)) && (o = or(a)), le.set(a, o), o;
1296
- }
1297
- var u = (a.f & X) === 0 && !Q && b !== null && (ye || (b.f & X) !== 0), l = a.deps === null;
1298
- et(a) && (u && (a.f |= X), Jr(a)), u && !l && mn(a);
1299
- }
1300
- if (B != null && B.has(e))
1301
- return B.get(e);
1302
- if (e.f & ue)
1303
- throw e.v;
1304
- return e.v;
1305
- }
1306
- function mn(e) {
1307
- if (e.deps !== null) {
1308
- e.f |= X;
1309
- for (const t of e.deps)
1310
- (t.reactions ?? (t.reactions = [])).push(e), t.f & P && !(t.f & X) && mn(
1311
- /** @type {Derived} */
1312
- t
1313
- );
1314
- }
1315
- }
1316
- function _n(e) {
1317
- if (e.v === A) return !0;
1318
- if (e.deps === null) return !1;
1319
- for (const t of e.deps)
1320
- if (le.has(t) || t.f & P && _n(
1321
- /** @type {Derived} */
1322
- t
1323
- ))
1324
- return !0;
1325
- return !1;
1326
- }
1327
- function qi(e) {
1328
- var t = Q;
1329
- try {
1330
- return Q = !0, e();
1331
- } finally {
1332
- Q = t;
1333
- }
1334
- }
1335
- const zi = /* @__PURE__ */ new Set(), Zi = /* @__PURE__ */ new Set();
1336
- function Qi(e) {
1337
- for (var t = 0; t < e.length; t++)
1338
- zi.add(e[t]);
1339
- for (var r of Zi)
1340
- r(e);
1341
- }
1342
- function Yi(e) {
1343
- var t = document.createElement("template");
1344
- return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1345
- }
1346
- function bn(e, t) {
1347
- var r = (
1348
- /** @type {Effect} */
1349
- w
1350
- );
1351
- r.nodes === null && (r.nodes = { start: e, end: t, a: null, t: null });
1352
- }
1353
- // @__NO_SIDE_EFFECTS__
1354
- function Ji(e, t) {
1355
- var r = (t & Qn) !== 0, n, i = !e.startsWith("<!>");
1356
- return () => {
1357
- n === void 0 && (n = Yi(i ? e : "<!>" + e), n = /** @type {TemplateNode} */
1358
- /* @__PURE__ */ lr(n));
1359
- var s = (
1360
- /** @type {TemplateNode} */
1361
- r || Pi ? document.importNode(n, !0) : n.cloneNode(!0)
1362
- );
1363
- return bn(s, s), s;
1364
- };
1365
- }
1366
- function Ki() {
1367
- var e = document.createDocumentFragment(), t = document.createComment(""), r = Wt();
1368
- return e.append(t, r), bn(t, r), e;
1369
- }
1370
- function yr(e, t) {
1371
- e !== null && e.before(
1372
- /** @type {Node} */
1373
- t
1374
- );
1375
- }
1376
- function xr(e, t) {
1377
- var r = t == null ? "" : typeof t == "object" ? t + "" : t;
1378
- r !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = r, e.nodeValue = r + "");
1379
- }
1380
- var Z, J, G, Ee, Je, Ke, _t;
1381
- class es {
1382
- /**
1383
- * @param {TemplateNode} anchor
1384
- * @param {boolean} transition
1385
- */
1386
- constructor(t, r = !0) {
1387
- /** @type {TemplateNode} */
1388
- re(this, "anchor");
1389
- /** @type {Map<Batch, Key>} */
1390
- N(this, Z, /* @__PURE__ */ new Map());
1391
- /**
1392
- * Map of keys to effects that are currently rendered in the DOM.
1393
- * These effects are visible and actively part of the document tree.
1394
- * Example:
1395
- * ```
1396
- * {#if condition}
1397
- * foo
1398
- * {:else}
1399
- * bar
1400
- * {/if}
1401
- * ```
1402
- * Can result in the entries `true->Effect` and `false->Effect`
1403
- * @type {Map<Key, Effect>}
1404
- */
1405
- N(this, J, /* @__PURE__ */ new Map());
1406
- /**
1407
- * Similar to #onscreen with respect to the keys, but contains branches that are not yet
1408
- * in the DOM, because their insertion is deferred.
1409
- * @type {Map<Key, Branch>}
1410
- */
1411
- N(this, G, /* @__PURE__ */ new Map());
1412
- /**
1413
- * Keys of effects that are currently outroing
1414
- * @type {Set<Key>}
1415
- */
1416
- N(this, Ee, /* @__PURE__ */ new Set());
1417
- /**
1418
- * Whether to pause (i.e. outro) on change, or destroy immediately.
1419
- * This is necessary for `<svelte:element>`
1420
- */
1421
- N(this, Je, !0);
1422
- N(this, Ke, () => {
1423
- var t = (
1424
- /** @type {Batch} */
1425
- y
1426
- );
1427
- if (p(this, Z).has(t)) {
1428
- var r = (
1429
- /** @type {Key} */
1430
- p(this, Z).get(t)
1431
- ), n = p(this, J).get(r);
1432
- if (n)
1433
- Vi(n), p(this, Ee).delete(r);
1434
- else {
1435
- var i = p(this, G).get(r);
1436
- i && (p(this, J).set(r, i.effect), p(this, G).delete(r), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), n = i.effect);
1437
- }
1438
- for (const [s, a] of p(this, Z)) {
1439
- if (p(this, Z).delete(s), s === t)
1440
- break;
1441
- const o = p(this, G).get(a);
1442
- o && (fe(o.effect), p(this, G).delete(a));
1443
- }
1444
- for (const [s, a] of p(this, J)) {
1445
- if (s === r || p(this, Ee).has(s)) continue;
1446
- const o = () => {
1447
- if (Array.from(p(this, Z).values()).includes(s)) {
1448
- var l = document.createDocumentFragment();
1449
- Xi(a, l), l.append(Wt()), p(this, G).set(s, { effect: a, fragment: l });
1450
- } else
1451
- fe(a);
1452
- p(this, Ee).delete(s), p(this, J).delete(s);
1453
- };
1454
- p(this, Je) || !n ? (p(this, Ee).add(s), ji(a, o, !1)) : o();
1455
- }
1456
- }
1457
- });
1458
- /**
1459
- * @param {Batch} batch
1460
- */
1461
- N(this, _t, (t) => {
1462
- p(this, Z).delete(t);
1463
- const r = Array.from(p(this, Z).values());
1464
- for (const [n, i] of p(this, G))
1465
- r.includes(n) || (fe(i.effect), p(this, G).delete(n));
1466
- });
1467
- this.anchor = t, de(this, Je, r);
1468
- }
1469
- /**
1470
- *
1471
- * @param {any} key
1472
- * @param {null | ((target: TemplateNode) => void)} fn
1473
- */
1474
- ensure(t, r) {
1475
- var n = (
1476
- /** @type {Batch} */
1477
- y
1478
- ), i = Ri();
1479
- if (r && !p(this, J).has(t) && !p(this, G).has(t))
1480
- if (i) {
1481
- var s = document.createDocumentFragment(), a = Wt();
1482
- s.append(a), p(this, G).set(t, {
1483
- effect: br(() => r(a)),
1484
- fragment: s
1485
- });
1486
- } else
1487
- p(this, J).set(
1488
- t,
1489
- br(() => r(this.anchor))
1490
- );
1491
- if (p(this, Z).set(n, t), i) {
1492
- for (const [o, u] of p(this, J))
1493
- o === t ? n.skipped_effects.delete(u) : n.skipped_effects.add(u);
1494
- for (const [o, u] of p(this, G))
1495
- o === t ? n.skipped_effects.delete(u.effect) : n.skipped_effects.add(u.effect);
1496
- n.oncommit(p(this, Ke)), n.ondiscard(p(this, _t));
1497
- } else
1498
- p(this, Ke).call(this);
1499
- }
1500
- }
1501
- Z = new WeakMap(), J = new WeakMap(), G = new WeakMap(), Ee = new WeakMap(), Je = new WeakMap(), Ke = new WeakMap(), _t = new WeakMap();
1502
- function ts(e, t, r = !1) {
1503
- var n = new es(e), i = r ? qe : 0;
1504
- function s(a, o) {
1505
- n.ensure(a, o);
1506
- }
1507
- Fi(() => {
1508
- var a = !1;
1509
- t((o, u = !0) => {
1510
- a = !0, s(u, o);
1511
- }), a || s(!1, null);
1512
- }, i);
1513
- }
1514
- function fr(e, t, r) {
1515
- if (e == null)
1516
- return t(void 0), r && r(void 0), ae;
1517
- const n = qi(
1518
- () => e.subscribe(
1519
- t,
1520
- // @ts-expect-error
1521
- r
1522
- )
1523
- );
1524
- return n.unsubscribe ? () => n.unsubscribe() : n;
1525
- }
1526
- const Be = [];
1527
- function rs(e, t) {
1528
- return {
1529
- subscribe: Et(e, t).subscribe
1530
- };
1531
- }
1532
- function Et(e, t = ae) {
1533
- let r = null;
1534
- const n = /* @__PURE__ */ new Set();
1535
- function i(o) {
1536
- if (Vr(e, o) && (e = o, r)) {
1537
- const u = !Be.length;
1538
- for (const l of n)
1539
- l[1](), Be.push(l, e);
1540
- if (u) {
1541
- for (let l = 0; l < Be.length; l += 2)
1542
- Be[l][0](Be[l + 1]);
1543
- Be.length = 0;
1544
- }
1545
- }
1546
- }
1547
- function s(o) {
1548
- i(o(
1549
- /** @type {T} */
1550
- e
1551
- ));
1552
- }
1553
- function a(o, u = ae) {
1554
- const l = [o, u];
1555
- return n.add(l), n.size === 1 && (r = t(i, s) || ae), o(
1556
- /** @type {T} */
1557
- e
1558
- ), () => {
1559
- n.delete(l), n.size === 0 && r && (r(), r = null);
1560
- };
1561
- }
1562
- return { set: i, update: s, subscribe: a };
1563
- }
1564
- function je(e, t, r) {
1565
- const n = !Array.isArray(e), i = n ? [e] : e;
1566
- if (!i.every(Boolean))
1567
- throw new Error("derived() expects stores as input, got a falsy value");
1568
- const s = t.length < 2;
1569
- return rs(r, (a, o) => {
1570
- let u = !1;
1571
- const l = [];
1572
- let f = 0, c = ae;
1573
- const h = () => {
1574
- if (f)
1575
- return;
1576
- c();
1577
- const d = t(n ? l[0] : l, a, o);
1578
- s ? a(d) : c = typeof d == "function" ? d : ae;
1579
- }, v = i.map(
1580
- (d, g) => fr(
1581
- d,
1582
- (H) => {
1583
- l[g] = H, f &= ~(1 << g), u && h();
1584
- },
1585
- () => {
1586
- f |= 1 << g;
1587
- }
1588
- )
1589
- );
1590
- return u = !0, h(), function() {
1591
- Dr(v), c(), u = !1;
1592
- };
1593
- });
1594
- }
1595
- function ns(e) {
1596
- let t;
1597
- return fr(e, (r) => t = r)(), t;
1598
- }
1599
- let $t = Symbol();
1600
- function is(e, t, r) {
1601
- const n = r[t] ?? (r[t] = {
1602
- store: null,
1603
- source: /* @__PURE__ */ Ai(void 0),
1604
- unsubscribe: ae
1605
- });
1606
- if (n.store !== e && !($t in r))
1607
- if (n.unsubscribe(), n.store = e ?? null, e == null)
1608
- n.source.v = void 0, n.unsubscribe = ae;
1609
- else {
1610
- var i = !0;
1611
- n.unsubscribe = fr(e, (s) => {
1612
- i ? n.source.v = s : k(n.source, s);
1613
- }), i = !1;
1614
- }
1615
- return e && $t in r ? ns(e) : T(n.source);
1616
- }
1617
- function ss() {
1618
- const e = {};
1619
- function t() {
1620
- nn(() => {
1621
- for (var r in e)
1622
- e[r].unsubscribe();
1623
- Kn(e, $t, {
1624
- enumerable: !1,
1625
- value: !0
1626
- });
1627
- });
1628
- }
1629
- return [e, t];
1630
- }
1631
- function Nt(e, t, r, n) {
1632
- var i = (
1633
- /** @type {V} */
1634
- n
1635
- ), s = !0, a = () => (s && (s = !1, i = /** @type {V} */
1636
- n), i), o;
1637
- o = /** @type {V} */
1638
- e[t], o === void 0 && n !== void 0 && (o = a());
1639
- var u;
1640
- return u = () => {
1641
- var l = (
1642
- /** @type {V} */
1643
- e[t]
1644
- );
1645
- return l === void 0 ? a() : (s = !0, l);
1646
- }, u;
1647
- }
1648
- class gn extends Error {
1649
- constructor(t, r) {
1650
- super(r), this.code = t, this.name = "ElevateApiError";
1651
- }
1652
- }
1653
- const as = async (e) => {
1654
- const t = new URL(`${e.apiEndpoint}/elevate/playerInfo?language=${e.locale ?? ""}`), r = new Headers({ "Content-Type": "application/json" });
1655
- e.userSession && r.append("X-SessionId", e.userSession);
1656
- const i = await (await fetch(t.href, { method: "GET", headers: r })).json();
1657
- if (!i.success)
1658
- throw new gn(i.errorCode, i.errorMessage);
1659
- return i.data;
1660
- }, os = async (e) => {
1661
- const t = new URL(`${e.apiEndpoint}/elevate/rakeback/claim`), r = new Headers({ "Content-Type": "application/json" });
1662
- e.userSession && r.append("X-Sessionid", e.userSession);
1663
- const i = await (await fetch(t.href, { method: "PUT", headers: r, body: JSON.stringify({}) })).json();
1664
- if (!i.success)
1665
- throw new gn(i.errorCode, i.errorMessage);
1666
- }, us = (e, t = 2) => {
1667
- const [r, n = ""] = e.toString().split(".");
1668
- return t <= 0 ? r : `${r}.${n ? n.slice(0, t).padEnd(t, "0") : "0".repeat(t)}`;
1669
- }, ls = (e, t = "en") => {
1670
- var r;
1671
- if (!e)
1672
- return "";
1673
- try {
1674
- return ((r = new Intl.NumberFormat(t, {
1675
- style: "currency",
1676
- currency: e,
1677
- currencyDisplay: "narrowSymbol"
1678
- }).formatToParts(0).find((i) => i.type === "currency")) == null ? void 0 : r.value) ?? e;
1679
- } catch {
1680
- return e;
1681
- }
1682
- }, fs = (e) => {
1683
- window.postMessage({ type: "RakebackClaimTrigger", points: e }, window.location.href);
1684
- }, hs = (e) => {
1685
- window.postMessage({ type: "RakebackClaimSuccess", points: e }, window.location.href);
1686
- }, cs = (e) => {
1687
- window.postMessage({ type: "RakebackClaimFailed", message: e }, window.location.href);
1688
- }, ps = () => {
1689
- window.postMessage({ type: "RakebackWalletMissing" }, window.location.href);
1690
- };
1691
- function vs(e) {
1692
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1693
- }
1694
- var ds = function(t) {
1695
- return ms(t) && !_s(t);
1696
- };
1697
- function ms(e) {
1698
- return !!e && typeof e == "object";
1699
- }
1700
- function _s(e) {
1701
- var t = Object.prototype.toString.call(e);
1702
- return t === "[object RegExp]" || t === "[object Date]" || Es(e);
1703
- }
1704
- var bs = typeof Symbol == "function" && Symbol.for, gs = bs ? Symbol.for("react.element") : 60103;
1705
- function Es(e) {
1706
- return e.$$typeof === gs;
1707
- }
1708
- function ys(e) {
1709
- return Array.isArray(e) ? [] : {};
1710
- }
1711
- function Ze(e, t) {
1712
- return t.clone !== !1 && t.isMergeableObject(e) ? Le(ys(e), e, t) : e;
1713
- }
1714
- function xs(e, t, r) {
1715
- return e.concat(t).map(function(n) {
1716
- return Ze(n, r);
1717
- });
1718
- }
1719
- function ws(e, t) {
1720
- if (!t.customMerge)
1721
- return Le;
1722
- var r = t.customMerge(e);
1723
- return typeof r == "function" ? r : Le;
1724
- }
1725
- function Ts(e) {
1726
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
1727
- return Object.propertyIsEnumerable.call(e, t);
1728
- }) : [];
1729
- }
1730
- function wr(e) {
1731
- return Object.keys(e).concat(Ts(e));
1732
- }
1733
- function En(e, t) {
1734
- try {
1735
- return t in e;
1736
- } catch {
1737
- return !1;
1738
- }
1739
- }
1740
- function Ss(e, t) {
1741
- return En(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
1742
- }
1743
- function Hs(e, t, r) {
1744
- var n = {};
1745
- return r.isMergeableObject(e) && wr(e).forEach(function(i) {
1746
- n[i] = Ze(e[i], r);
1747
- }), wr(t).forEach(function(i) {
1748
- Ss(e, i) || (En(e, i) && r.isMergeableObject(t[i]) ? n[i] = ws(i, r)(e[i], t[i], r) : n[i] = Ze(t[i], r));
1749
- }), n;
1750
- }
1751
- function Le(e, t, r) {
1752
- r = r || {}, r.arrayMerge = r.arrayMerge || xs, r.isMergeableObject = r.isMergeableObject || ds, r.cloneUnlessOtherwiseSpecified = Ze;
1753
- var n = Array.isArray(t), i = Array.isArray(e), s = n === i;
1754
- return s ? n ? r.arrayMerge(e, t, r) : Hs(e, t, r) : Ze(t, r);
1755
- }
1756
- Le.all = function(t, r) {
1757
- if (!Array.isArray(t))
1758
- throw new Error("first argument should be an array");
1759
- return t.reduce(function(n, i) {
1760
- return Le(n, i, r);
1761
- }, {});
1762
- };
1763
- var As = Le, Bs = As;
1764
- const Ps = /* @__PURE__ */ vs(Bs);
1765
- var qt = function(e, t) {
1766
- return qt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
1767
- r.__proto__ = n;
1768
- } || function(r, n) {
1769
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
1770
- }, qt(e, t);
1771
- };
1772
- function yt(e, t) {
1773
- if (typeof t != "function" && t !== null)
1774
- throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1775
- qt(e, t);
1776
- function r() {
1777
- this.constructor = e;
1778
- }
1779
- e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1780
- }
1781
- var K = function() {
1782
- return K = Object.assign || function(t) {
1783
- for (var r, n = 1, i = arguments.length; n < i; n++) {
1784
- r = arguments[n];
1785
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
1786
- }
1787
- return t;
1788
- }, K.apply(this, arguments);
1789
- };
1790
- function Ns(e, t) {
1791
- var r = {};
1792
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
1793
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1794
- for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
1795
- t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
1796
- return r;
1797
- }
1798
- function Ot(e, t, r) {
1799
- if (r || arguments.length === 2) for (var n = 0, i = t.length, s; n < i; n++)
1800
- (s || !(n in t)) && (s || (s = Array.prototype.slice.call(t, 0, n)), s[n] = t[n]);
1801
- return e.concat(s || Array.prototype.slice.call(t));
1802
- }
1803
- function It(e, t) {
1804
- var r = t && t.cache ? t.cache : Ds, n = t && t.serializer ? t.serializer : Ms, i = t && t.strategy ? t.strategy : Cs;
1805
- return i(e, {
1806
- cache: r,
1807
- serializer: n
1808
- });
1809
- }
1810
- function Os(e) {
1811
- return e == null || typeof e == "number" || typeof e == "boolean";
1812
- }
1813
- function Is(e, t, r, n) {
1814
- var i = Os(n) ? n : r(n), s = t.get(i);
1815
- return typeof s > "u" && (s = e.call(this, n), t.set(i, s)), s;
1816
- }
1817
- function yn(e, t, r) {
1818
- var n = Array.prototype.slice.call(arguments, 3), i = r(n), s = t.get(i);
1819
- return typeof s > "u" && (s = e.apply(this, n), t.set(i, s)), s;
1820
- }
1821
- function xn(e, t, r, n, i) {
1822
- return r.bind(t, e, n, i);
1823
- }
1824
- function Cs(e, t) {
1825
- var r = e.length === 1 ? Is : yn;
1826
- return xn(e, this, r, t.cache.create(), t.serializer);
1827
- }
1828
- function Rs(e, t) {
1829
- return xn(e, this, yn, t.cache.create(), t.serializer);
1830
- }
1831
- var Ms = function() {
1832
- return JSON.stringify(arguments);
1833
- }, Ls = (
1834
- /** @class */
1835
- function() {
1836
- function e() {
1837
- this.cache = /* @__PURE__ */ Object.create(null);
1838
- }
1839
- return e.prototype.get = function(t) {
1840
- return this.cache[t];
1841
- }, e.prototype.set = function(t, r) {
1842
- this.cache[t] = r;
1843
- }, e;
1844
- }()
1845
- ), Ds = {
1846
- create: function() {
1847
- return new Ls();
1848
- }
1849
- }, Ct = {
1850
- variadic: Rs
1851
- }, pt = function() {
1852
- return pt = Object.assign || function(t) {
1853
- for (var r, n = 1, i = arguments.length; n < i; n++) {
1854
- r = arguments[n];
1855
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
1856
- }
1857
- return t;
1858
- }, pt.apply(this, arguments);
1859
- };
1860
- var m;
1861
- (function(e) {
1862
- e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
1863
- })(m || (m = {}));
1864
- var x;
1865
- (function(e) {
1866
- e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
1867
- })(x || (x = {}));
1868
- var De;
1869
- (function(e) {
1870
- e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
1871
- })(De || (De = {}));
1872
- function Tr(e) {
1873
- return e.type === x.literal;
1874
- }
1875
- function Us(e) {
1876
- return e.type === x.argument;
1877
- }
1878
- function wn(e) {
1879
- return e.type === x.number;
1880
- }
1881
- function Tn(e) {
1882
- return e.type === x.date;
1883
- }
1884
- function Sn(e) {
1885
- return e.type === x.time;
1886
- }
1887
- function Hn(e) {
1888
- return e.type === x.select;
1889
- }
1890
- function An(e) {
1891
- return e.type === x.plural;
1892
- }
1893
- function Fs(e) {
1894
- return e.type === x.pound;
1895
- }
1896
- function Bn(e) {
1897
- return e.type === x.tag;
1898
- }
1899
- function Pn(e) {
1900
- return !!(e && typeof e == "object" && e.type === De.number);
1901
- }
1902
- function zt(e) {
1903
- return !!(e && typeof e == "object" && e.type === De.dateTime);
1904
- }
1905
- var Nn = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Gs = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
1906
- function ks(e) {
1907
- var t = {};
1908
- return e.replace(Gs, function(r) {
1909
- var n = r.length;
1910
- switch (r[0]) {
1911
- case "G":
1912
- t.era = n === 4 ? "long" : n === 5 ? "narrow" : "short";
1913
- break;
1914
- case "y":
1915
- t.year = n === 2 ? "2-digit" : "numeric";
1916
- break;
1917
- case "Y":
1918
- case "u":
1919
- case "U":
1920
- case "r":
1921
- throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
1922
- case "q":
1923
- case "Q":
1924
- throw new RangeError("`q/Q` (quarter) patterns are not supported");
1925
- case "M":
1926
- case "L":
1927
- t.month = ["numeric", "2-digit", "short", "long", "narrow"][n - 1];
1928
- break;
1929
- case "w":
1930
- case "W":
1931
- throw new RangeError("`w/W` (week) patterns are not supported");
1932
- case "d":
1933
- t.day = ["numeric", "2-digit"][n - 1];
1934
- break;
1935
- case "D":
1936
- case "F":
1937
- case "g":
1938
- throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
1939
- case "E":
1940
- t.weekday = n === 4 ? "long" : n === 5 ? "narrow" : "short";
1941
- break;
1942
- case "e":
1943
- if (n < 4)
1944
- throw new RangeError("`e..eee` (weekday) patterns are not supported");
1945
- t.weekday = ["short", "long", "narrow", "short"][n - 4];
1946
- break;
1947
- case "c":
1948
- if (n < 4)
1949
- throw new RangeError("`c..ccc` (weekday) patterns are not supported");
1950
- t.weekday = ["short", "long", "narrow", "short"][n - 4];
1951
- break;
1952
- case "a":
1953
- t.hour12 = !0;
1954
- break;
1955
- case "b":
1956
- case "B":
1957
- throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
1958
- case "h":
1959
- t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][n - 1];
1960
- break;
1961
- case "H":
1962
- t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][n - 1];
1963
- break;
1964
- case "K":
1965
- t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][n - 1];
1966
- break;
1967
- case "k":
1968
- t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][n - 1];
1969
- break;
1970
- case "j":
1971
- case "J":
1972
- case "C":
1973
- throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
1974
- case "m":
1975
- t.minute = ["numeric", "2-digit"][n - 1];
1976
- break;
1977
- case "s":
1978
- t.second = ["numeric", "2-digit"][n - 1];
1979
- break;
1980
- case "S":
1981
- case "A":
1982
- throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
1983
- case "z":
1984
- t.timeZoneName = n < 4 ? "short" : "long";
1985
- break;
1986
- case "Z":
1987
- case "O":
1988
- case "v":
1989
- case "V":
1990
- case "X":
1991
- case "x":
1992
- throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
1993
- }
1994
- return "";
1995
- }), t;
1996
- }
1997
- var S = function() {
1998
- return S = Object.assign || function(t) {
1999
- for (var r, n = 1, i = arguments.length; n < i; n++) {
2000
- r = arguments[n];
2001
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
2002
- }
2003
- return t;
2004
- }, S.apply(this, arguments);
2005
- };
2006
- var js = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
2007
- function Vs(e) {
2008
- if (e.length === 0)
2009
- throw new Error("Number skeleton cannot be empty");
2010
- for (var t = e.split(js).filter(function(h) {
2011
- return h.length > 0;
2012
- }), r = [], n = 0, i = t; n < i.length; n++) {
2013
- var s = i[n], a = s.split("/");
2014
- if (a.length === 0)
2015
- throw new Error("Invalid number skeleton");
2016
- for (var o = a[0], u = a.slice(1), l = 0, f = u; l < f.length; l++) {
2017
- var c = f[l];
2018
- if (c.length === 0)
2019
- throw new Error("Invalid number skeleton");
2020
- }
2021
- r.push({ stem: o, options: u });
2022
- }
2023
- return r;
2024
- }
2025
- function Xs(e) {
2026
- return e.replace(/^(.*?)-/, "");
2027
- }
2028
- var Sr = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, On = /^(@+)?(\+|#+)?[rs]?$/g, Ws = /(\*)(0+)|(#+)(0+)|(0+)/g, In = /^(0+)$/;
2029
- function Hr(e) {
2030
- var t = {};
2031
- return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(On, function(r, n, i) {
2032
- return typeof i != "string" ? (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length) : i === "+" ? t.minimumSignificantDigits = n.length : n[0] === "#" ? t.maximumSignificantDigits = n.length : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length + (typeof i == "string" ? i.length : 0)), "";
2033
- }), t;
2034
- }
2035
- function Cn(e) {
2036
- switch (e) {
2037
- case "sign-auto":
2038
- return {
2039
- signDisplay: "auto"
2040
- };
2041
- case "sign-accounting":
2042
- case "()":
2043
- return {
2044
- currencySign: "accounting"
2045
- };
2046
- case "sign-always":
2047
- case "+!":
2048
- return {
2049
- signDisplay: "always"
2050
- };
2051
- case "sign-accounting-always":
2052
- case "()!":
2053
- return {
2054
- signDisplay: "always",
2055
- currencySign: "accounting"
2056
- };
2057
- case "sign-except-zero":
2058
- case "+?":
2059
- return {
2060
- signDisplay: "exceptZero"
2061
- };
2062
- case "sign-accounting-except-zero":
2063
- case "()?":
2064
- return {
2065
- signDisplay: "exceptZero",
2066
- currencySign: "accounting"
2067
- };
2068
- case "sign-never":
2069
- case "+_":
2070
- return {
2071
- signDisplay: "never"
2072
- };
2073
- }
2074
- }
2075
- function $s(e) {
2076
- var t;
2077
- if (e[0] === "E" && e[1] === "E" ? (t = {
2078
- notation: "engineering"
2079
- }, e = e.slice(2)) : e[0] === "E" && (t = {
2080
- notation: "scientific"
2081
- }, e = e.slice(1)), t) {
2082
- var r = e.slice(0, 2);
2083
- if (r === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : r === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !In.test(e))
2084
- throw new Error("Malformed concise eng/scientific notation");
2085
- t.minimumIntegerDigits = e.length;
2086
- }
2087
- return t;
2088
- }
2089
- function Ar(e) {
2090
- var t = {}, r = Cn(e);
2091
- return r || t;
2092
- }
2093
- function qs(e) {
2094
- for (var t = {}, r = 0, n = e; r < n.length; r++) {
2095
- var i = n[r];
2096
- switch (i.stem) {
2097
- case "percent":
2098
- case "%":
2099
- t.style = "percent";
2100
- continue;
2101
- case "%x100":
2102
- t.style = "percent", t.scale = 100;
2103
- continue;
2104
- case "currency":
2105
- t.style = "currency", t.currency = i.options[0];
2106
- continue;
2107
- case "group-off":
2108
- case ",_":
2109
- t.useGrouping = !1;
2110
- continue;
2111
- case "precision-integer":
2112
- case ".":
2113
- t.maximumFractionDigits = 0;
2114
- continue;
2115
- case "measure-unit":
2116
- case "unit":
2117
- t.style = "unit", t.unit = Xs(i.options[0]);
2118
- continue;
2119
- case "compact-short":
2120
- case "K":
2121
- t.notation = "compact", t.compactDisplay = "short";
2122
- continue;
2123
- case "compact-long":
2124
- case "KK":
2125
- t.notation = "compact", t.compactDisplay = "long";
2126
- continue;
2127
- case "scientific":
2128
- t = S(S(S({}, t), { notation: "scientific" }), i.options.reduce(function(u, l) {
2129
- return S(S({}, u), Ar(l));
2130
- }, {}));
2131
- continue;
2132
- case "engineering":
2133
- t = S(S(S({}, t), { notation: "engineering" }), i.options.reduce(function(u, l) {
2134
- return S(S({}, u), Ar(l));
2135
- }, {}));
2136
- continue;
2137
- case "notation-simple":
2138
- t.notation = "standard";
2139
- continue;
2140
- case "unit-width-narrow":
2141
- t.currencyDisplay = "narrowSymbol", t.unitDisplay = "narrow";
2142
- continue;
2143
- case "unit-width-short":
2144
- t.currencyDisplay = "code", t.unitDisplay = "short";
2145
- continue;
2146
- case "unit-width-full-name":
2147
- t.currencyDisplay = "name", t.unitDisplay = "long";
2148
- continue;
2149
- case "unit-width-iso-code":
2150
- t.currencyDisplay = "symbol";
2151
- continue;
2152
- case "scale":
2153
- t.scale = parseFloat(i.options[0]);
2154
- continue;
2155
- case "rounding-mode-floor":
2156
- t.roundingMode = "floor";
2157
- continue;
2158
- case "rounding-mode-ceiling":
2159
- t.roundingMode = "ceil";
2160
- continue;
2161
- case "rounding-mode-down":
2162
- t.roundingMode = "trunc";
2163
- continue;
2164
- case "rounding-mode-up":
2165
- t.roundingMode = "expand";
2166
- continue;
2167
- case "rounding-mode-half-even":
2168
- t.roundingMode = "halfEven";
2169
- continue;
2170
- case "rounding-mode-half-down":
2171
- t.roundingMode = "halfTrunc";
2172
- continue;
2173
- case "rounding-mode-half-up":
2174
- t.roundingMode = "halfExpand";
2175
- continue;
2176
- case "integer-width":
2177
- if (i.options.length > 1)
2178
- throw new RangeError("integer-width stems only accept a single optional option");
2179
- i.options[0].replace(Ws, function(u, l, f, c, h, v) {
2180
- if (l)
2181
- t.minimumIntegerDigits = f.length;
2182
- else {
2183
- if (c && h)
2184
- throw new Error("We currently do not support maximum integer digits");
2185
- if (v)
2186
- throw new Error("We currently do not support exact integer digits");
2187
- }
2188
- return "";
2189
- });
2190
- continue;
2191
- }
2192
- if (In.test(i.stem)) {
2193
- t.minimumIntegerDigits = i.stem.length;
2194
- continue;
2195
- }
2196
- if (Sr.test(i.stem)) {
2197
- if (i.options.length > 1)
2198
- throw new RangeError("Fraction-precision stems only accept a single optional option");
2199
- i.stem.replace(Sr, function(u, l, f, c, h, v) {
2200
- return f === "*" ? t.minimumFractionDigits = l.length : c && c[0] === "#" ? t.maximumFractionDigits = c.length : h && v ? (t.minimumFractionDigits = h.length, t.maximumFractionDigits = h.length + v.length) : (t.minimumFractionDigits = l.length, t.maximumFractionDigits = l.length), "";
2201
- });
2202
- var s = i.options[0];
2203
- s === "w" ? t = S(S({}, t), { trailingZeroDisplay: "stripIfInteger" }) : s && (t = S(S({}, t), Hr(s)));
2204
- continue;
2205
- }
2206
- if (On.test(i.stem)) {
2207
- t = S(S({}, t), Hr(i.stem));
2208
- continue;
2209
- }
2210
- var a = Cn(i.stem);
2211
- a && (t = S(S({}, t), a));
2212
- var o = $s(i.stem);
2213
- o && (t = S(S({}, t), o));
2214
- }
2215
- return t;
2216
- }
2217
- var it = {
2218
- "001": [
2219
- "H",
2220
- "h"
2221
- ],
2222
- 419: [
2223
- "h",
2224
- "H",
2225
- "hB",
2226
- "hb"
2227
- ],
2228
- AC: [
2229
- "H",
2230
- "h",
2231
- "hb",
2232
- "hB"
2233
- ],
2234
- AD: [
2235
- "H",
2236
- "hB"
2237
- ],
2238
- AE: [
2239
- "h",
2240
- "hB",
2241
- "hb",
2242
- "H"
2243
- ],
2244
- AF: [
2245
- "H",
2246
- "hb",
2247
- "hB",
2248
- "h"
2249
- ],
2250
- AG: [
2251
- "h",
2252
- "hb",
2253
- "H",
2254
- "hB"
2255
- ],
2256
- AI: [
2257
- "H",
2258
- "h",
2259
- "hb",
2260
- "hB"
2261
- ],
2262
- AL: [
2263
- "h",
2264
- "H",
2265
- "hB"
2266
- ],
2267
- AM: [
2268
- "H",
2269
- "hB"
2270
- ],
2271
- AO: [
2272
- "H",
2273
- "hB"
2274
- ],
2275
- AR: [
2276
- "h",
2277
- "H",
2278
- "hB",
2279
- "hb"
2280
- ],
2281
- AS: [
2282
- "h",
2283
- "H"
2284
- ],
2285
- AT: [
2286
- "H",
2287
- "hB"
2288
- ],
2289
- AU: [
2290
- "h",
2291
- "hb",
2292
- "H",
2293
- "hB"
2294
- ],
2295
- AW: [
2296
- "H",
2297
- "hB"
2298
- ],
2299
- AX: [
2300
- "H"
2301
- ],
2302
- AZ: [
2303
- "H",
2304
- "hB",
2305
- "h"
2306
- ],
2307
- BA: [
2308
- "H",
2309
- "hB",
2310
- "h"
2311
- ],
2312
- BB: [
2313
- "h",
2314
- "hb",
2315
- "H",
2316
- "hB"
2317
- ],
2318
- BD: [
2319
- "h",
2320
- "hB",
2321
- "H"
2322
- ],
2323
- BE: [
2324
- "H",
2325
- "hB"
2326
- ],
2327
- BF: [
2328
- "H",
2329
- "hB"
2330
- ],
2331
- BG: [
2332
- "H",
2333
- "hB",
2334
- "h"
2335
- ],
2336
- BH: [
2337
- "h",
2338
- "hB",
2339
- "hb",
2340
- "H"
2341
- ],
2342
- BI: [
2343
- "H",
2344
- "h"
2345
- ],
2346
- BJ: [
2347
- "H",
2348
- "hB"
2349
- ],
2350
- BL: [
2351
- "H",
2352
- "hB"
2353
- ],
2354
- BM: [
2355
- "h",
2356
- "hb",
2357
- "H",
2358
- "hB"
2359
- ],
2360
- BN: [
2361
- "hb",
2362
- "hB",
2363
- "h",
2364
- "H"
2365
- ],
2366
- BO: [
2367
- "h",
2368
- "H",
2369
- "hB",
2370
- "hb"
2371
- ],
2372
- BQ: [
2373
- "H"
2374
- ],
2375
- BR: [
2376
- "H",
2377
- "hB"
2378
- ],
2379
- BS: [
2380
- "h",
2381
- "hb",
2382
- "H",
2383
- "hB"
2384
- ],
2385
- BT: [
2386
- "h",
2387
- "H"
2388
- ],
2389
- BW: [
2390
- "H",
2391
- "h",
2392
- "hb",
2393
- "hB"
2394
- ],
2395
- BY: [
2396
- "H",
2397
- "h"
2398
- ],
2399
- BZ: [
2400
- "H",
2401
- "h",
2402
- "hb",
2403
- "hB"
2404
- ],
2405
- CA: [
2406
- "h",
2407
- "hb",
2408
- "H",
2409
- "hB"
2410
- ],
2411
- CC: [
2412
- "H",
2413
- "h",
2414
- "hb",
2415
- "hB"
2416
- ],
2417
- CD: [
2418
- "hB",
2419
- "H"
2420
- ],
2421
- CF: [
2422
- "H",
2423
- "h",
2424
- "hB"
2425
- ],
2426
- CG: [
2427
- "H",
2428
- "hB"
2429
- ],
2430
- CH: [
2431
- "H",
2432
- "hB",
2433
- "h"
2434
- ],
2435
- CI: [
2436
- "H",
2437
- "hB"
2438
- ],
2439
- CK: [
2440
- "H",
2441
- "h",
2442
- "hb",
2443
- "hB"
2444
- ],
2445
- CL: [
2446
- "h",
2447
- "H",
2448
- "hB",
2449
- "hb"
2450
- ],
2451
- CM: [
2452
- "H",
2453
- "h",
2454
- "hB"
2455
- ],
2456
- CN: [
2457
- "H",
2458
- "hB",
2459
- "hb",
2460
- "h"
2461
- ],
2462
- CO: [
2463
- "h",
2464
- "H",
2465
- "hB",
2466
- "hb"
2467
- ],
2468
- CP: [
2469
- "H"
2470
- ],
2471
- CR: [
2472
- "h",
2473
- "H",
2474
- "hB",
2475
- "hb"
2476
- ],
2477
- CU: [
2478
- "h",
2479
- "H",
2480
- "hB",
2481
- "hb"
2482
- ],
2483
- CV: [
2484
- "H",
2485
- "hB"
2486
- ],
2487
- CW: [
2488
- "H",
2489
- "hB"
2490
- ],
2491
- CX: [
2492
- "H",
2493
- "h",
2494
- "hb",
2495
- "hB"
2496
- ],
2497
- CY: [
2498
- "h",
2499
- "H",
2500
- "hb",
2501
- "hB"
2502
- ],
2503
- CZ: [
2504
- "H"
2505
- ],
2506
- DE: [
2507
- "H",
2508
- "hB"
2509
- ],
2510
- DG: [
2511
- "H",
2512
- "h",
2513
- "hb",
2514
- "hB"
2515
- ],
2516
- DJ: [
2517
- "h",
2518
- "H"
2519
- ],
2520
- DK: [
2521
- "H"
2522
- ],
2523
- DM: [
2524
- "h",
2525
- "hb",
2526
- "H",
2527
- "hB"
2528
- ],
2529
- DO: [
2530
- "h",
2531
- "H",
2532
- "hB",
2533
- "hb"
2534
- ],
2535
- DZ: [
2536
- "h",
2537
- "hB",
2538
- "hb",
2539
- "H"
2540
- ],
2541
- EA: [
2542
- "H",
2543
- "h",
2544
- "hB",
2545
- "hb"
2546
- ],
2547
- EC: [
2548
- "h",
2549
- "H",
2550
- "hB",
2551
- "hb"
2552
- ],
2553
- EE: [
2554
- "H",
2555
- "hB"
2556
- ],
2557
- EG: [
2558
- "h",
2559
- "hB",
2560
- "hb",
2561
- "H"
2562
- ],
2563
- EH: [
2564
- "h",
2565
- "hB",
2566
- "hb",
2567
- "H"
2568
- ],
2569
- ER: [
2570
- "h",
2571
- "H"
2572
- ],
2573
- ES: [
2574
- "H",
2575
- "hB",
2576
- "h",
2577
- "hb"
2578
- ],
2579
- ET: [
2580
- "hB",
2581
- "hb",
2582
- "h",
2583
- "H"
2584
- ],
2585
- FI: [
2586
- "H"
2587
- ],
2588
- FJ: [
2589
- "h",
2590
- "hb",
2591
- "H",
2592
- "hB"
2593
- ],
2594
- FK: [
2595
- "H",
2596
- "h",
2597
- "hb",
2598
- "hB"
2599
- ],
2600
- FM: [
2601
- "h",
2602
- "hb",
2603
- "H",
2604
- "hB"
2605
- ],
2606
- FO: [
2607
- "H",
2608
- "h"
2609
- ],
2610
- FR: [
2611
- "H",
2612
- "hB"
2613
- ],
2614
- GA: [
2615
- "H",
2616
- "hB"
2617
- ],
2618
- GB: [
2619
- "H",
2620
- "h",
2621
- "hb",
2622
- "hB"
2623
- ],
2624
- GD: [
2625
- "h",
2626
- "hb",
2627
- "H",
2628
- "hB"
2629
- ],
2630
- GE: [
2631
- "H",
2632
- "hB",
2633
- "h"
2634
- ],
2635
- GF: [
2636
- "H",
2637
- "hB"
2638
- ],
2639
- GG: [
2640
- "H",
2641
- "h",
2642
- "hb",
2643
- "hB"
2644
- ],
2645
- GH: [
2646
- "h",
2647
- "H"
2648
- ],
2649
- GI: [
2650
- "H",
2651
- "h",
2652
- "hb",
2653
- "hB"
2654
- ],
2655
- GL: [
2656
- "H",
2657
- "h"
2658
- ],
2659
- GM: [
2660
- "h",
2661
- "hb",
2662
- "H",
2663
- "hB"
2664
- ],
2665
- GN: [
2666
- "H",
2667
- "hB"
2668
- ],
2669
- GP: [
2670
- "H",
2671
- "hB"
2672
- ],
2673
- GQ: [
2674
- "H",
2675
- "hB",
2676
- "h",
2677
- "hb"
2678
- ],
2679
- GR: [
2680
- "h",
2681
- "H",
2682
- "hb",
2683
- "hB"
2684
- ],
2685
- GT: [
2686
- "h",
2687
- "H",
2688
- "hB",
2689
- "hb"
2690
- ],
2691
- GU: [
2692
- "h",
2693
- "hb",
2694
- "H",
2695
- "hB"
2696
- ],
2697
- GW: [
2698
- "H",
2699
- "hB"
2700
- ],
2701
- GY: [
2702
- "h",
2703
- "hb",
2704
- "H",
2705
- "hB"
2706
- ],
2707
- HK: [
2708
- "h",
2709
- "hB",
2710
- "hb",
2711
- "H"
2712
- ],
2713
- HN: [
2714
- "h",
2715
- "H",
2716
- "hB",
2717
- "hb"
2718
- ],
2719
- HR: [
2720
- "H",
2721
- "hB"
2722
- ],
2723
- HU: [
2724
- "H",
2725
- "h"
2726
- ],
2727
- IC: [
2728
- "H",
2729
- "h",
2730
- "hB",
2731
- "hb"
2732
- ],
2733
- ID: [
2734
- "H"
2735
- ],
2736
- IE: [
2737
- "H",
2738
- "h",
2739
- "hb",
2740
- "hB"
2741
- ],
2742
- IL: [
2743
- "H",
2744
- "hB"
2745
- ],
2746
- IM: [
2747
- "H",
2748
- "h",
2749
- "hb",
2750
- "hB"
2751
- ],
2752
- IN: [
2753
- "h",
2754
- "H"
2755
- ],
2756
- IO: [
2757
- "H",
2758
- "h",
2759
- "hb",
2760
- "hB"
2761
- ],
2762
- IQ: [
2763
- "h",
2764
- "hB",
2765
- "hb",
2766
- "H"
2767
- ],
2768
- IR: [
2769
- "hB",
2770
- "H"
2771
- ],
2772
- IS: [
2773
- "H"
2774
- ],
2775
- IT: [
2776
- "H",
2777
- "hB"
2778
- ],
2779
- JE: [
2780
- "H",
2781
- "h",
2782
- "hb",
2783
- "hB"
2784
- ],
2785
- JM: [
2786
- "h",
2787
- "hb",
2788
- "H",
2789
- "hB"
2790
- ],
2791
- JO: [
2792
- "h",
2793
- "hB",
2794
- "hb",
2795
- "H"
2796
- ],
2797
- JP: [
2798
- "H",
2799
- "K",
2800
- "h"
2801
- ],
2802
- KE: [
2803
- "hB",
2804
- "hb",
2805
- "H",
2806
- "h"
2807
- ],
2808
- KG: [
2809
- "H",
2810
- "h",
2811
- "hB",
2812
- "hb"
2813
- ],
2814
- KH: [
2815
- "hB",
2816
- "h",
2817
- "H",
2818
- "hb"
2819
- ],
2820
- KI: [
2821
- "h",
2822
- "hb",
2823
- "H",
2824
- "hB"
2825
- ],
2826
- KM: [
2827
- "H",
2828
- "h",
2829
- "hB",
2830
- "hb"
2831
- ],
2832
- KN: [
2833
- "h",
2834
- "hb",
2835
- "H",
2836
- "hB"
2837
- ],
2838
- KP: [
2839
- "h",
2840
- "H",
2841
- "hB",
2842
- "hb"
2843
- ],
2844
- KR: [
2845
- "h",
2846
- "H",
2847
- "hB",
2848
- "hb"
2849
- ],
2850
- KW: [
2851
- "h",
2852
- "hB",
2853
- "hb",
2854
- "H"
2855
- ],
2856
- KY: [
2857
- "h",
2858
- "hb",
2859
- "H",
2860
- "hB"
2861
- ],
2862
- KZ: [
2863
- "H",
2864
- "hB"
2865
- ],
2866
- LA: [
2867
- "H",
2868
- "hb",
2869
- "hB",
2870
- "h"
2871
- ],
2872
- LB: [
2873
- "h",
2874
- "hB",
2875
- "hb",
2876
- "H"
2877
- ],
2878
- LC: [
2879
- "h",
2880
- "hb",
2881
- "H",
2882
- "hB"
2883
- ],
2884
- LI: [
2885
- "H",
2886
- "hB",
2887
- "h"
2888
- ],
2889
- LK: [
2890
- "H",
2891
- "h",
2892
- "hB",
2893
- "hb"
2894
- ],
2895
- LR: [
2896
- "h",
2897
- "hb",
2898
- "H",
2899
- "hB"
2900
- ],
2901
- LS: [
2902
- "h",
2903
- "H"
2904
- ],
2905
- LT: [
2906
- "H",
2907
- "h",
2908
- "hb",
2909
- "hB"
2910
- ],
2911
- LU: [
2912
- "H",
2913
- "h",
2914
- "hB"
2915
- ],
2916
- LV: [
2917
- "H",
2918
- "hB",
2919
- "hb",
2920
- "h"
2921
- ],
2922
- LY: [
2923
- "h",
2924
- "hB",
2925
- "hb",
2926
- "H"
2927
- ],
2928
- MA: [
2929
- "H",
2930
- "h",
2931
- "hB",
2932
- "hb"
2933
- ],
2934
- MC: [
2935
- "H",
2936
- "hB"
2937
- ],
2938
- MD: [
2939
- "H",
2940
- "hB"
2941
- ],
2942
- ME: [
2943
- "H",
2944
- "hB",
2945
- "h"
2946
- ],
2947
- MF: [
2948
- "H",
2949
- "hB"
2950
- ],
2951
- MG: [
2952
- "H",
2953
- "h"
2954
- ],
2955
- MH: [
2956
- "h",
2957
- "hb",
2958
- "H",
2959
- "hB"
2960
- ],
2961
- MK: [
2962
- "H",
2963
- "h",
2964
- "hb",
2965
- "hB"
2966
- ],
2967
- ML: [
2968
- "H"
2969
- ],
2970
- MM: [
2971
- "hB",
2972
- "hb",
2973
- "H",
2974
- "h"
2975
- ],
2976
- MN: [
2977
- "H",
2978
- "h",
2979
- "hb",
2980
- "hB"
2981
- ],
2982
- MO: [
2983
- "h",
2984
- "hB",
2985
- "hb",
2986
- "H"
2987
- ],
2988
- MP: [
2989
- "h",
2990
- "hb",
2991
- "H",
2992
- "hB"
2993
- ],
2994
- MQ: [
2995
- "H",
2996
- "hB"
2997
- ],
2998
- MR: [
2999
- "h",
3000
- "hB",
3001
- "hb",
3002
- "H"
3003
- ],
3004
- MS: [
3005
- "H",
3006
- "h",
3007
- "hb",
3008
- "hB"
3009
- ],
3010
- MT: [
3011
- "H",
3012
- "h"
3013
- ],
3014
- MU: [
3015
- "H",
3016
- "h"
3017
- ],
3018
- MV: [
3019
- "H",
3020
- "h"
3021
- ],
3022
- MW: [
3023
- "h",
3024
- "hb",
3025
- "H",
3026
- "hB"
3027
- ],
3028
- MX: [
3029
- "h",
3030
- "H",
3031
- "hB",
3032
- "hb"
3033
- ],
3034
- MY: [
3035
- "hb",
3036
- "hB",
3037
- "h",
3038
- "H"
3039
- ],
3040
- MZ: [
3041
- "H",
3042
- "hB"
3043
- ],
3044
- NA: [
3045
- "h",
3046
- "H",
3047
- "hB",
3048
- "hb"
3049
- ],
3050
- NC: [
3051
- "H",
3052
- "hB"
3053
- ],
3054
- NE: [
3055
- "H"
3056
- ],
3057
- NF: [
3058
- "H",
3059
- "h",
3060
- "hb",
3061
- "hB"
3062
- ],
3063
- NG: [
3064
- "H",
3065
- "h",
3066
- "hb",
3067
- "hB"
3068
- ],
3069
- NI: [
3070
- "h",
3071
- "H",
3072
- "hB",
3073
- "hb"
3074
- ],
3075
- NL: [
3076
- "H",
3077
- "hB"
3078
- ],
3079
- NO: [
3080
- "H",
3081
- "h"
3082
- ],
3083
- NP: [
3084
- "H",
3085
- "h",
3086
- "hB"
3087
- ],
3088
- NR: [
3089
- "H",
3090
- "h",
3091
- "hb",
3092
- "hB"
3093
- ],
3094
- NU: [
3095
- "H",
3096
- "h",
3097
- "hb",
3098
- "hB"
3099
- ],
3100
- NZ: [
3101
- "h",
3102
- "hb",
3103
- "H",
3104
- "hB"
3105
- ],
3106
- OM: [
3107
- "h",
3108
- "hB",
3109
- "hb",
3110
- "H"
3111
- ],
3112
- PA: [
3113
- "h",
3114
- "H",
3115
- "hB",
3116
- "hb"
3117
- ],
3118
- PE: [
3119
- "h",
3120
- "H",
3121
- "hB",
3122
- "hb"
3123
- ],
3124
- PF: [
3125
- "H",
3126
- "h",
3127
- "hB"
3128
- ],
3129
- PG: [
3130
- "h",
3131
- "H"
3132
- ],
3133
- PH: [
3134
- "h",
3135
- "hB",
3136
- "hb",
3137
- "H"
3138
- ],
3139
- PK: [
3140
- "h",
3141
- "hB",
3142
- "H"
3143
- ],
3144
- PL: [
3145
- "H",
3146
- "h"
3147
- ],
3148
- PM: [
3149
- "H",
3150
- "hB"
3151
- ],
3152
- PN: [
3153
- "H",
3154
- "h",
3155
- "hb",
3156
- "hB"
3157
- ],
3158
- PR: [
3159
- "h",
3160
- "H",
3161
- "hB",
3162
- "hb"
3163
- ],
3164
- PS: [
3165
- "h",
3166
- "hB",
3167
- "hb",
3168
- "H"
3169
- ],
3170
- PT: [
3171
- "H",
3172
- "hB"
3173
- ],
3174
- PW: [
3175
- "h",
3176
- "H"
3177
- ],
3178
- PY: [
3179
- "h",
3180
- "H",
3181
- "hB",
3182
- "hb"
3183
- ],
3184
- QA: [
3185
- "h",
3186
- "hB",
3187
- "hb",
3188
- "H"
3189
- ],
3190
- RE: [
3191
- "H",
3192
- "hB"
3193
- ],
3194
- RO: [
3195
- "H",
3196
- "hB"
3197
- ],
3198
- RS: [
3199
- "H",
3200
- "hB",
3201
- "h"
3202
- ],
3203
- RU: [
3204
- "H"
3205
- ],
3206
- RW: [
3207
- "H",
3208
- "h"
3209
- ],
3210
- SA: [
3211
- "h",
3212
- "hB",
3213
- "hb",
3214
- "H"
3215
- ],
3216
- SB: [
3217
- "h",
3218
- "hb",
3219
- "H",
3220
- "hB"
3221
- ],
3222
- SC: [
3223
- "H",
3224
- "h",
3225
- "hB"
3226
- ],
3227
- SD: [
3228
- "h",
3229
- "hB",
3230
- "hb",
3231
- "H"
3232
- ],
3233
- SE: [
3234
- "H"
3235
- ],
3236
- SG: [
3237
- "h",
3238
- "hb",
3239
- "H",
3240
- "hB"
3241
- ],
3242
- SH: [
3243
- "H",
3244
- "h",
3245
- "hb",
3246
- "hB"
3247
- ],
3248
- SI: [
3249
- "H",
3250
- "hB"
3251
- ],
3252
- SJ: [
3253
- "H"
3254
- ],
3255
- SK: [
3256
- "H"
3257
- ],
3258
- SL: [
3259
- "h",
3260
- "hb",
3261
- "H",
3262
- "hB"
3263
- ],
3264
- SM: [
3265
- "H",
3266
- "h",
3267
- "hB"
3268
- ],
3269
- SN: [
3270
- "H",
3271
- "h",
3272
- "hB"
3273
- ],
3274
- SO: [
3275
- "h",
3276
- "H"
3277
- ],
3278
- SR: [
3279
- "H",
3280
- "hB"
3281
- ],
3282
- SS: [
3283
- "h",
3284
- "hb",
3285
- "H",
3286
- "hB"
3287
- ],
3288
- ST: [
3289
- "H",
3290
- "hB"
3291
- ],
3292
- SV: [
3293
- "h",
3294
- "H",
3295
- "hB",
3296
- "hb"
3297
- ],
3298
- SX: [
3299
- "H",
3300
- "h",
3301
- "hb",
3302
- "hB"
3303
- ],
3304
- SY: [
3305
- "h",
3306
- "hB",
3307
- "hb",
3308
- "H"
3309
- ],
3310
- SZ: [
3311
- "h",
3312
- "hb",
3313
- "H",
3314
- "hB"
3315
- ],
3316
- TA: [
3317
- "H",
3318
- "h",
3319
- "hb",
3320
- "hB"
3321
- ],
3322
- TC: [
3323
- "h",
3324
- "hb",
3325
- "H",
3326
- "hB"
3327
- ],
3328
- TD: [
3329
- "h",
3330
- "H",
3331
- "hB"
3332
- ],
3333
- TF: [
3334
- "H",
3335
- "h",
3336
- "hB"
3337
- ],
3338
- TG: [
3339
- "H",
3340
- "hB"
3341
- ],
3342
- TH: [
3343
- "H",
3344
- "h"
3345
- ],
3346
- TJ: [
3347
- "H",
3348
- "h"
3349
- ],
3350
- TL: [
3351
- "H",
3352
- "hB",
3353
- "hb",
3354
- "h"
3355
- ],
3356
- TM: [
3357
- "H",
3358
- "h"
3359
- ],
3360
- TN: [
3361
- "h",
3362
- "hB",
3363
- "hb",
3364
- "H"
3365
- ],
3366
- TO: [
3367
- "h",
3368
- "H"
3369
- ],
3370
- TR: [
3371
- "H",
3372
- "hB"
3373
- ],
3374
- TT: [
3375
- "h",
3376
- "hb",
3377
- "H",
3378
- "hB"
3379
- ],
3380
- TW: [
3381
- "hB",
3382
- "hb",
3383
- "h",
3384
- "H"
3385
- ],
3386
- TZ: [
3387
- "hB",
3388
- "hb",
3389
- "H",
3390
- "h"
3391
- ],
3392
- UA: [
3393
- "H",
3394
- "hB",
3395
- "h"
3396
- ],
3397
- UG: [
3398
- "hB",
3399
- "hb",
3400
- "H",
3401
- "h"
3402
- ],
3403
- UM: [
3404
- "h",
3405
- "hb",
3406
- "H",
3407
- "hB"
3408
- ],
3409
- US: [
3410
- "h",
3411
- "hb",
3412
- "H",
3413
- "hB"
3414
- ],
3415
- UY: [
3416
- "h",
3417
- "H",
3418
- "hB",
3419
- "hb"
3420
- ],
3421
- UZ: [
3422
- "H",
3423
- "hB",
3424
- "h"
3425
- ],
3426
- VA: [
3427
- "H",
3428
- "h",
3429
- "hB"
3430
- ],
3431
- VC: [
3432
- "h",
3433
- "hb",
3434
- "H",
3435
- "hB"
3436
- ],
3437
- VE: [
3438
- "h",
3439
- "H",
3440
- "hB",
3441
- "hb"
3442
- ],
3443
- VG: [
3444
- "h",
3445
- "hb",
3446
- "H",
3447
- "hB"
3448
- ],
3449
- VI: [
3450
- "h",
3451
- "hb",
3452
- "H",
3453
- "hB"
3454
- ],
3455
- VN: [
3456
- "H",
3457
- "h"
3458
- ],
3459
- VU: [
3460
- "h",
3461
- "H"
3462
- ],
3463
- WF: [
3464
- "H",
3465
- "hB"
3466
- ],
3467
- WS: [
3468
- "h",
3469
- "H"
3470
- ],
3471
- XK: [
3472
- "H",
3473
- "hB",
3474
- "h"
3475
- ],
3476
- YE: [
3477
- "h",
3478
- "hB",
3479
- "hb",
3480
- "H"
3481
- ],
3482
- YT: [
3483
- "H",
3484
- "hB"
3485
- ],
3486
- ZA: [
3487
- "H",
3488
- "h",
3489
- "hb",
3490
- "hB"
3491
- ],
3492
- ZM: [
3493
- "h",
3494
- "hb",
3495
- "H",
3496
- "hB"
3497
- ],
3498
- ZW: [
3499
- "H",
3500
- "h"
3501
- ],
3502
- "af-ZA": [
3503
- "H",
3504
- "h",
3505
- "hB",
3506
- "hb"
3507
- ],
3508
- "ar-001": [
3509
- "h",
3510
- "hB",
3511
- "hb",
3512
- "H"
3513
- ],
3514
- "ca-ES": [
3515
- "H",
3516
- "h",
3517
- "hB"
3518
- ],
3519
- "en-001": [
3520
- "h",
3521
- "hb",
3522
- "H",
3523
- "hB"
3524
- ],
3525
- "en-HK": [
3526
- "h",
3527
- "hb",
3528
- "H",
3529
- "hB"
3530
- ],
3531
- "en-IL": [
3532
- "H",
3533
- "h",
3534
- "hb",
3535
- "hB"
3536
- ],
3537
- "en-MY": [
3538
- "h",
3539
- "hb",
3540
- "H",
3541
- "hB"
3542
- ],
3543
- "es-BR": [
3544
- "H",
3545
- "h",
3546
- "hB",
3547
- "hb"
3548
- ],
3549
- "es-ES": [
3550
- "H",
3551
- "h",
3552
- "hB",
3553
- "hb"
3554
- ],
3555
- "es-GQ": [
3556
- "H",
3557
- "h",
3558
- "hB",
3559
- "hb"
3560
- ],
3561
- "fr-CA": [
3562
- "H",
3563
- "h",
3564
- "hB"
3565
- ],
3566
- "gl-ES": [
3567
- "H",
3568
- "h",
3569
- "hB"
3570
- ],
3571
- "gu-IN": [
3572
- "hB",
3573
- "hb",
3574
- "h",
3575
- "H"
3576
- ],
3577
- "hi-IN": [
3578
- "hB",
3579
- "h",
3580
- "H"
3581
- ],
3582
- "it-CH": [
3583
- "H",
3584
- "h",
3585
- "hB"
3586
- ],
3587
- "it-IT": [
3588
- "H",
3589
- "h",
3590
- "hB"
3591
- ],
3592
- "kn-IN": [
3593
- "hB",
3594
- "h",
3595
- "H"
3596
- ],
3597
- "ml-IN": [
3598
- "hB",
3599
- "h",
3600
- "H"
3601
- ],
3602
- "mr-IN": [
3603
- "hB",
3604
- "hb",
3605
- "h",
3606
- "H"
3607
- ],
3608
- "pa-IN": [
3609
- "hB",
3610
- "hb",
3611
- "h",
3612
- "H"
3613
- ],
3614
- "ta-IN": [
3615
- "hB",
3616
- "h",
3617
- "hb",
3618
- "H"
3619
- ],
3620
- "te-IN": [
3621
- "hB",
3622
- "h",
3623
- "H"
3624
- ],
3625
- "zu-ZA": [
3626
- "H",
3627
- "hB",
3628
- "hb",
3629
- "h"
3630
- ]
3631
- };
3632
- function zs(e, t) {
3633
- for (var r = "", n = 0; n < e.length; n++) {
3634
- var i = e.charAt(n);
3635
- if (i === "j") {
3636
- for (var s = 0; n + 1 < e.length && e.charAt(n + 1) === i; )
3637
- s++, n++;
3638
- var a = 1 + (s & 1), o = s < 2 ? 1 : 3 + (s >> 1), u = "a", l = Zs(t);
3639
- for ((l == "H" || l == "k") && (o = 0); o-- > 0; )
3640
- r += u;
3641
- for (; a-- > 0; )
3642
- r = l + r;
3643
- } else i === "J" ? r += "H" : r += i;
3644
- }
3645
- return r;
3646
- }
3647
- function Zs(e) {
3648
- var t = e.hourCycle;
3649
- if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
3650
- e.hourCycles && // @ts-ignore
3651
- e.hourCycles.length && (t = e.hourCycles[0]), t)
3652
- switch (t) {
3653
- case "h24":
3654
- return "k";
3655
- case "h23":
3656
- return "H";
3657
- case "h12":
3658
- return "h";
3659
- case "h11":
3660
- return "K";
3661
- default:
3662
- throw new Error("Invalid hourCycle");
3663
- }
3664
- var r = e.language, n;
3665
- r !== "root" && (n = e.maximize().region);
3666
- var i = it[n || ""] || it[r || ""] || it["".concat(r, "-001")] || it["001"];
3667
- return i[0];
3668
- }
3669
- var Rt, Qs = new RegExp("^".concat(Nn.source, "*")), Ys = new RegExp("".concat(Nn.source, "*$"));
3670
- function _(e, t) {
3671
- return { start: e, end: t };
3672
- }
3673
- var Js = !!String.prototype.startsWith && "_a".startsWith("a", 1), Ks = !!String.fromCodePoint, ea = !!Object.fromEntries, ta = !!String.prototype.codePointAt, ra = !!String.prototype.trimStart, na = !!String.prototype.trimEnd, ia = !!Number.isSafeInteger, sa = ia ? Number.isSafeInteger : function(e) {
3674
- return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
3675
- }, Zt = !0;
3676
- try {
3677
- var aa = Mn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
3678
- Zt = ((Rt = aa.exec("a")) === null || Rt === void 0 ? void 0 : Rt[0]) === "a";
3679
- } catch {
3680
- Zt = !1;
3681
- }
3682
- var Br = Js ? (
3683
- // Native
3684
- function(t, r, n) {
3685
- return t.startsWith(r, n);
3686
- }
3687
- ) : (
3688
- // For IE11
3689
- function(t, r, n) {
3690
- return t.slice(n, n + r.length) === r;
3691
- }
3692
- ), Qt = Ks ? String.fromCodePoint : (
3693
- // IE11
3694
- function() {
3695
- for (var t = [], r = 0; r < arguments.length; r++)
3696
- t[r] = arguments[r];
3697
- for (var n = "", i = t.length, s = 0, a; i > s; ) {
3698
- if (a = t[s++], a > 1114111)
3699
- throw RangeError(a + " is not a valid code point");
3700
- n += a < 65536 ? String.fromCharCode(a) : String.fromCharCode(((a -= 65536) >> 10) + 55296, a % 1024 + 56320);
3701
- }
3702
- return n;
3703
- }
3704
- ), Pr = (
3705
- // native
3706
- ea ? Object.fromEntries : (
3707
- // Ponyfill
3708
- function(t) {
3709
- for (var r = {}, n = 0, i = t; n < i.length; n++) {
3710
- var s = i[n], a = s[0], o = s[1];
3711
- r[a] = o;
3712
- }
3713
- return r;
3714
- }
3715
- )
3716
- ), Rn = ta ? (
3717
- // Native
3718
- function(t, r) {
3719
- return t.codePointAt(r);
3720
- }
3721
- ) : (
3722
- // IE 11
3723
- function(t, r) {
3724
- var n = t.length;
3725
- if (!(r < 0 || r >= n)) {
3726
- var i = t.charCodeAt(r), s;
3727
- return i < 55296 || i > 56319 || r + 1 === n || (s = t.charCodeAt(r + 1)) < 56320 || s > 57343 ? i : (i - 55296 << 10) + (s - 56320) + 65536;
3728
- }
3729
- }
3730
- ), oa = ra ? (
3731
- // Native
3732
- function(t) {
3733
- return t.trimStart();
3734
- }
3735
- ) : (
3736
- // Ponyfill
3737
- function(t) {
3738
- return t.replace(Qs, "");
3739
- }
3740
- ), ua = na ? (
3741
- // Native
3742
- function(t) {
3743
- return t.trimEnd();
3744
- }
3745
- ) : (
3746
- // Ponyfill
3747
- function(t) {
3748
- return t.replace(Ys, "");
3749
- }
3750
- );
3751
- function Mn(e, t) {
3752
- return new RegExp(e, t);
3753
- }
3754
- var Yt;
3755
- if (Zt) {
3756
- var Nr = Mn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
3757
- Yt = function(t, r) {
3758
- var n;
3759
- Nr.lastIndex = r;
3760
- var i = Nr.exec(t);
3761
- return (n = i[1]) !== null && n !== void 0 ? n : "";
3762
- };
3763
- } else
3764
- Yt = function(t, r) {
3765
- for (var n = []; ; ) {
3766
- var i = Rn(t, r);
3767
- if (i === void 0 || Ln(i) || ca(i))
3768
- break;
3769
- n.push(i), r += i >= 65536 ? 2 : 1;
3770
- }
3771
- return Qt.apply(void 0, n);
3772
- };
3773
- var la = (
3774
- /** @class */
3775
- function() {
3776
- function e(t, r) {
3777
- r === void 0 && (r = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!r.ignoreTag, this.locale = r.locale, this.requiresOtherClause = !!r.requiresOtherClause, this.shouldParseSkeletons = !!r.shouldParseSkeletons;
3778
- }
3779
- return e.prototype.parse = function() {
3780
- if (this.offset() !== 0)
3781
- throw Error("parser can only be used once");
3782
- return this.parseMessage(0, "", !1);
3783
- }, e.prototype.parseMessage = function(t, r, n) {
3784
- for (var i = []; !this.isEOF(); ) {
3785
- var s = this.char();
3786
- if (s === 123) {
3787
- var a = this.parseArgument(t, n);
3788
- if (a.err)
3789
- return a;
3790
- i.push(a.val);
3791
- } else {
3792
- if (s === 125 && t > 0)
3793
- break;
3794
- if (s === 35 && (r === "plural" || r === "selectordinal")) {
3795
- var o = this.clonePosition();
3796
- this.bump(), i.push({
3797
- type: x.pound,
3798
- location: _(o, this.clonePosition())
3799
- });
3800
- } else if (s === 60 && !this.ignoreTag && this.peek() === 47) {
3801
- if (n)
3802
- break;
3803
- return this.error(m.UNMATCHED_CLOSING_TAG, _(this.clonePosition(), this.clonePosition()));
3804
- } else if (s === 60 && !this.ignoreTag && Jt(this.peek() || 0)) {
3805
- var a = this.parseTag(t, r);
3806
- if (a.err)
3807
- return a;
3808
- i.push(a.val);
3809
- } else {
3810
- var a = this.parseLiteral(t, r);
3811
- if (a.err)
3812
- return a;
3813
- i.push(a.val);
3814
- }
3815
- }
3816
- }
3817
- return { val: i, err: null };
3818
- }, e.prototype.parseTag = function(t, r) {
3819
- var n = this.clonePosition();
3820
- this.bump();
3821
- var i = this.parseTagName();
3822
- if (this.bumpSpace(), this.bumpIf("/>"))
3823
- return {
3824
- val: {
3825
- type: x.literal,
3826
- value: "<".concat(i, "/>"),
3827
- location: _(n, this.clonePosition())
3828
- },
3829
- err: null
3830
- };
3831
- if (this.bumpIf(">")) {
3832
- var s = this.parseMessage(t + 1, r, !0);
3833
- if (s.err)
3834
- return s;
3835
- var a = s.val, o = this.clonePosition();
3836
- if (this.bumpIf("</")) {
3837
- if (this.isEOF() || !Jt(this.char()))
3838
- return this.error(m.INVALID_TAG, _(o, this.clonePosition()));
3839
- var u = this.clonePosition(), l = this.parseTagName();
3840
- return i !== l ? this.error(m.UNMATCHED_CLOSING_TAG, _(u, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
3841
- val: {
3842
- type: x.tag,
3843
- value: i,
3844
- children: a,
3845
- location: _(n, this.clonePosition())
3846
- },
3847
- err: null
3848
- } : this.error(m.INVALID_TAG, _(o, this.clonePosition())));
3849
- } else
3850
- return this.error(m.UNCLOSED_TAG, _(n, this.clonePosition()));
3851
- } else
3852
- return this.error(m.INVALID_TAG, _(n, this.clonePosition()));
3853
- }, e.prototype.parseTagName = function() {
3854
- var t = this.offset();
3855
- for (this.bump(); !this.isEOF() && ha(this.char()); )
3856
- this.bump();
3857
- return this.message.slice(t, this.offset());
3858
- }, e.prototype.parseLiteral = function(t, r) {
3859
- for (var n = this.clonePosition(), i = ""; ; ) {
3860
- var s = this.tryParseQuote(r);
3861
- if (s) {
3862
- i += s;
3863
- continue;
3864
- }
3865
- var a = this.tryParseUnquoted(t, r);
3866
- if (a) {
3867
- i += a;
3868
- continue;
3869
- }
3870
- var o = this.tryParseLeftAngleBracket();
3871
- if (o) {
3872
- i += o;
3873
- continue;
3874
- }
3875
- break;
3876
- }
3877
- var u = _(n, this.clonePosition());
3878
- return {
3879
- val: { type: x.literal, value: i, location: u },
3880
- err: null
3881
- };
3882
- }, e.prototype.tryParseLeftAngleBracket = function() {
3883
- return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
3884
- !fa(this.peek() || 0)) ? (this.bump(), "<") : null;
3885
- }, e.prototype.tryParseQuote = function(t) {
3886
- if (this.isEOF() || this.char() !== 39)
3887
- return null;
3888
- switch (this.peek()) {
3889
- case 39:
3890
- return this.bump(), this.bump(), "'";
3891
- case 123:
3892
- case 60:
3893
- case 62:
3894
- case 125:
3895
- break;
3896
- case 35:
3897
- if (t === "plural" || t === "selectordinal")
3898
- break;
3899
- return null;
3900
- default:
3901
- return null;
3902
- }
3903
- this.bump();
3904
- var r = [this.char()];
3905
- for (this.bump(); !this.isEOF(); ) {
3906
- var n = this.char();
3907
- if (n === 39)
3908
- if (this.peek() === 39)
3909
- r.push(39), this.bump();
3910
- else {
3911
- this.bump();
3912
- break;
3913
- }
3914
- else
3915
- r.push(n);
3916
- this.bump();
3917
- }
3918
- return Qt.apply(void 0, r);
3919
- }, e.prototype.tryParseUnquoted = function(t, r) {
3920
- if (this.isEOF())
3921
- return null;
3922
- var n = this.char();
3923
- return n === 60 || n === 123 || n === 35 && (r === "plural" || r === "selectordinal") || n === 125 && t > 0 ? null : (this.bump(), Qt(n));
3924
- }, e.prototype.parseArgument = function(t, r) {
3925
- var n = this.clonePosition();
3926
- if (this.bump(), this.bumpSpace(), this.isEOF())
3927
- return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, _(n, this.clonePosition()));
3928
- if (this.char() === 125)
3929
- return this.bump(), this.error(m.EMPTY_ARGUMENT, _(n, this.clonePosition()));
3930
- var i = this.parseIdentifierIfPossible().value;
3931
- if (!i)
3932
- return this.error(m.MALFORMED_ARGUMENT, _(n, this.clonePosition()));
3933
- if (this.bumpSpace(), this.isEOF())
3934
- return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, _(n, this.clonePosition()));
3935
- switch (this.char()) {
3936
- case 125:
3937
- return this.bump(), {
3938
- val: {
3939
- type: x.argument,
3940
- // value does not include the opening and closing braces.
3941
- value: i,
3942
- location: _(n, this.clonePosition())
3943
- },
3944
- err: null
3945
- };
3946
- case 44:
3947
- return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, _(n, this.clonePosition())) : this.parseArgumentOptions(t, r, i, n);
3948
- default:
3949
- return this.error(m.MALFORMED_ARGUMENT, _(n, this.clonePosition()));
3950
- }
3951
- }, e.prototype.parseIdentifierIfPossible = function() {
3952
- var t = this.clonePosition(), r = this.offset(), n = Yt(this.message, r), i = r + n.length;
3953
- this.bumpTo(i);
3954
- var s = this.clonePosition(), a = _(t, s);
3955
- return { value: n, location: a };
3956
- }, e.prototype.parseArgumentOptions = function(t, r, n, i) {
3957
- var s, a = this.clonePosition(), o = this.parseIdentifierIfPossible().value, u = this.clonePosition();
3958
- switch (o) {
3959
- case "":
3960
- return this.error(m.EXPECT_ARGUMENT_TYPE, _(a, u));
3961
- case "number":
3962
- case "date":
3963
- case "time": {
3964
- this.bumpSpace();
3965
- var l = null;
3966
- if (this.bumpIf(",")) {
3967
- this.bumpSpace();
3968
- var f = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();
3969
- if (c.err)
3970
- return c;
3971
- var h = ua(c.val);
3972
- if (h.length === 0)
3973
- return this.error(m.EXPECT_ARGUMENT_STYLE, _(this.clonePosition(), this.clonePosition()));
3974
- var v = _(f, this.clonePosition());
3975
- l = { style: h, styleLocation: v };
3976
- }
3977
- var d = this.tryParseArgumentClose(i);
3978
- if (d.err)
3979
- return d;
3980
- var g = _(i, this.clonePosition());
3981
- if (l && Br(l == null ? void 0 : l.style, "::", 0)) {
3982
- var H = oa(l.style.slice(2));
3983
- if (o === "number") {
3984
- var c = this.parseNumberSkeletonFromString(H, l.styleLocation);
3985
- return c.err ? c : {
3986
- val: { type: x.number, value: n, location: g, style: c.val },
3987
- err: null
3988
- };
3989
- } else {
3990
- if (H.length === 0)
3991
- return this.error(m.EXPECT_DATE_TIME_SKELETON, g);
3992
- var j = H;
3993
- this.locale && (j = zs(H, this.locale));
3994
- var h = {
3995
- type: De.dateTime,
3996
- pattern: j,
3997
- location: l.styleLocation,
3998
- parsedOptions: this.shouldParseSkeletons ? ks(j) : {}
3999
- }, U = o === "date" ? x.date : x.time;
4000
- return {
4001
- val: { type: U, value: n, location: g, style: h },
4002
- err: null
4003
- };
4004
- }
4005
- }
4006
- return {
4007
- val: {
4008
- type: o === "number" ? x.number : o === "date" ? x.date : x.time,
4009
- value: n,
4010
- location: g,
4011
- style: (s = l == null ? void 0 : l.style) !== null && s !== void 0 ? s : null
4012
- },
4013
- err: null
4014
- };
4015
- }
4016
- case "plural":
4017
- case "selectordinal":
4018
- case "select": {
4019
- var C = this.clonePosition();
4020
- if (this.bumpSpace(), !this.bumpIf(","))
4021
- return this.error(m.EXPECT_SELECT_ARGUMENT_OPTIONS, _(C, pt({}, C)));
4022
- this.bumpSpace();
4023
- var pe = this.parseIdentifierIfPossible(), E = 0;
4024
- if (o !== "select" && pe.value === "offset") {
4025
- if (!this.bumpIf(":"))
4026
- return this.error(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, _(this.clonePosition(), this.clonePosition()));
4027
- this.bumpSpace();
4028
- var c = this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, m.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
4029
- if (c.err)
4030
- return c;
4031
- this.bumpSpace(), pe = this.parseIdentifierIfPossible(), E = c.val;
4032
- }
4033
- var $ = this.tryParsePluralOrSelectOptions(t, o, r, pe);
4034
- if ($.err)
4035
- return $;
4036
- var d = this.tryParseArgumentClose(i);
4037
- if (d.err)
4038
- return d;
4039
- var ve = _(i, this.clonePosition());
4040
- return o === "select" ? {
4041
- val: {
4042
- type: x.select,
4043
- value: n,
4044
- options: Pr($.val),
4045
- location: ve
4046
- },
4047
- err: null
4048
- } : {
4049
- val: {
4050
- type: x.plural,
4051
- value: n,
4052
- options: Pr($.val),
4053
- offset: E,
4054
- pluralType: o === "plural" ? "cardinal" : "ordinal",
4055
- location: ve
4056
- },
4057
- err: null
4058
- };
4059
- }
4060
- default:
4061
- return this.error(m.INVALID_ARGUMENT_TYPE, _(a, u));
4062
- }
4063
- }, e.prototype.tryParseArgumentClose = function(t) {
4064
- return this.isEOF() || this.char() !== 125 ? this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, _(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
4065
- }, e.prototype.parseSimpleArgStyleIfPossible = function() {
4066
- for (var t = 0, r = this.clonePosition(); !this.isEOF(); ) {
4067
- var n = this.char();
4068
- switch (n) {
4069
- case 39: {
4070
- this.bump();
4071
- var i = this.clonePosition();
4072
- if (!this.bumpUntil("'"))
4073
- return this.error(m.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, _(i, this.clonePosition()));
4074
- this.bump();
4075
- break;
4076
- }
4077
- case 123: {
4078
- t += 1, this.bump();
4079
- break;
4080
- }
4081
- case 125: {
4082
- if (t > 0)
4083
- t -= 1;
4084
- else
4085
- return {
4086
- val: this.message.slice(r.offset, this.offset()),
4087
- err: null
4088
- };
4089
- break;
4090
- }
4091
- default:
4092
- this.bump();
4093
- break;
4094
- }
4095
- }
4096
- return {
4097
- val: this.message.slice(r.offset, this.offset()),
4098
- err: null
4099
- };
4100
- }, e.prototype.parseNumberSkeletonFromString = function(t, r) {
4101
- var n = [];
4102
- try {
4103
- n = Vs(t);
4104
- } catch {
4105
- return this.error(m.INVALID_NUMBER_SKELETON, r);
4106
- }
4107
- return {
4108
- val: {
4109
- type: De.number,
4110
- tokens: n,
4111
- location: r,
4112
- parsedOptions: this.shouldParseSkeletons ? qs(n) : {}
4113
- },
4114
- err: null
4115
- };
4116
- }, e.prototype.tryParsePluralOrSelectOptions = function(t, r, n, i) {
4117
- for (var s, a = !1, o = [], u = /* @__PURE__ */ new Set(), l = i.value, f = i.location; ; ) {
4118
- if (l.length === 0) {
4119
- var c = this.clonePosition();
4120
- if (r !== "select" && this.bumpIf("=")) {
4121
- var h = this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_SELECTOR, m.INVALID_PLURAL_ARGUMENT_SELECTOR);
4122
- if (h.err)
4123
- return h;
4124
- f = _(c, this.clonePosition()), l = this.message.slice(c.offset, this.offset());
4125
- } else
4126
- break;
4127
- }
4128
- if (u.has(l))
4129
- return this.error(r === "select" ? m.DUPLICATE_SELECT_ARGUMENT_SELECTOR : m.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f);
4130
- l === "other" && (a = !0), this.bumpSpace();
4131
- var v = this.clonePosition();
4132
- if (!this.bumpIf("{"))
4133
- return this.error(r === "select" ? m.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : m.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, _(this.clonePosition(), this.clonePosition()));
4134
- var d = this.parseMessage(t + 1, r, n);
4135
- if (d.err)
4136
- return d;
4137
- var g = this.tryParseArgumentClose(v);
4138
- if (g.err)
4139
- return g;
4140
- o.push([
4141
- l,
4142
- {
4143
- value: d.val,
4144
- location: _(v, this.clonePosition())
4145
- }
4146
- ]), u.add(l), this.bumpSpace(), s = this.parseIdentifierIfPossible(), l = s.value, f = s.location;
4147
- }
4148
- return o.length === 0 ? this.error(r === "select" ? m.EXPECT_SELECT_ARGUMENT_SELECTOR : m.EXPECT_PLURAL_ARGUMENT_SELECTOR, _(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !a ? this.error(m.MISSING_OTHER_CLAUSE, _(this.clonePosition(), this.clonePosition())) : { val: o, err: null };
4149
- }, e.prototype.tryParseDecimalInteger = function(t, r) {
4150
- var n = 1, i = this.clonePosition();
4151
- this.bumpIf("+") || this.bumpIf("-") && (n = -1);
4152
- for (var s = !1, a = 0; !this.isEOF(); ) {
4153
- var o = this.char();
4154
- if (o >= 48 && o <= 57)
4155
- s = !0, a = a * 10 + (o - 48), this.bump();
4156
- else
4157
- break;
4158
- }
4159
- var u = _(i, this.clonePosition());
4160
- return s ? (a *= n, sa(a) ? { val: a, err: null } : this.error(r, u)) : this.error(t, u);
4161
- }, e.prototype.offset = function() {
4162
- return this.position.offset;
4163
- }, e.prototype.isEOF = function() {
4164
- return this.offset() === this.message.length;
4165
- }, e.prototype.clonePosition = function() {
4166
- return {
4167
- offset: this.position.offset,
4168
- line: this.position.line,
4169
- column: this.position.column
4170
- };
4171
- }, e.prototype.char = function() {
4172
- var t = this.position.offset;
4173
- if (t >= this.message.length)
4174
- throw Error("out of bound");
4175
- var r = Rn(this.message, t);
4176
- if (r === void 0)
4177
- throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
4178
- return r;
4179
- }, e.prototype.error = function(t, r) {
4180
- return {
4181
- val: null,
4182
- err: {
4183
- kind: t,
4184
- message: this.message,
4185
- location: r
4186
- }
4187
- };
4188
- }, e.prototype.bump = function() {
4189
- if (!this.isEOF()) {
4190
- var t = this.char();
4191
- t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);
4192
- }
4193
- }, e.prototype.bumpIf = function(t) {
4194
- if (Br(this.message, t, this.offset())) {
4195
- for (var r = 0; r < t.length; r++)
4196
- this.bump();
4197
- return !0;
4198
- }
4199
- return !1;
4200
- }, e.prototype.bumpUntil = function(t) {
4201
- var r = this.offset(), n = this.message.indexOf(t, r);
4202
- return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1);
4203
- }, e.prototype.bumpTo = function(t) {
4204
- if (this.offset() > t)
4205
- throw Error("targetOffset ".concat(t, " must be greater than or equal to the current offset ").concat(this.offset()));
4206
- for (t = Math.min(t, this.message.length); ; ) {
4207
- var r = this.offset();
4208
- if (r === t)
4209
- break;
4210
- if (r > t)
4211
- throw Error("targetOffset ".concat(t, " is at invalid UTF-16 code unit boundary"));
4212
- if (this.bump(), this.isEOF())
4213
- break;
4214
- }
4215
- }, e.prototype.bumpSpace = function() {
4216
- for (; !this.isEOF() && Ln(this.char()); )
4217
- this.bump();
4218
- }, e.prototype.peek = function() {
4219
- if (this.isEOF())
4220
- return null;
4221
- var t = this.char(), r = this.offset(), n = this.message.charCodeAt(r + (t >= 65536 ? 2 : 1));
4222
- return n ?? null;
4223
- }, e;
4224
- }()
4225
- );
4226
- function Jt(e) {
4227
- return e >= 97 && e <= 122 || e >= 65 && e <= 90;
4228
- }
4229
- function fa(e) {
4230
- return Jt(e) || e === 47;
4231
- }
4232
- function ha(e) {
4233
- return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
4234
- }
4235
- function Ln(e) {
4236
- return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
4237
- }
4238
- function ca(e) {
4239
- return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
4240
- }
4241
- function Kt(e) {
4242
- e.forEach(function(t) {
4243
- if (delete t.location, Hn(t) || An(t))
4244
- for (var r in t.options)
4245
- delete t.options[r].location, Kt(t.options[r].value);
4246
- else wn(t) && Pn(t.style) || (Tn(t) || Sn(t)) && zt(t.style) ? delete t.style.location : Bn(t) && Kt(t.children);
4247
- });
4248
- }
4249
- function pa(e, t) {
4250
- t === void 0 && (t = {}), t = pt({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
4251
- var r = new la(e, t).parse();
4252
- if (r.err) {
4253
- var n = SyntaxError(m[r.err.kind]);
4254
- throw n.location = r.err.location, n.originalMessage = r.err.message, n;
4255
- }
4256
- return t != null && t.captureLocation || Kt(r.val), r.val;
4257
- }
4258
- var Ue;
4259
- (function(e) {
4260
- e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
4261
- })(Ue || (Ue = {}));
4262
- var xt = (
4263
- /** @class */
4264
- function(e) {
4265
- yt(t, e);
4266
- function t(r, n, i) {
4267
- var s = e.call(this, r) || this;
4268
- return s.code = n, s.originalMessage = i, s;
4269
- }
4270
- return t.prototype.toString = function() {
4271
- return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
4272
- }, t;
4273
- }(Error)
4274
- ), Or = (
4275
- /** @class */
4276
- function(e) {
4277
- yt(t, e);
4278
- function t(r, n, i, s) {
4279
- return e.call(this, 'Invalid values for "'.concat(r, '": "').concat(n, '". Options are "').concat(Object.keys(i).join('", "'), '"'), Ue.INVALID_VALUE, s) || this;
4280
- }
4281
- return t;
4282
- }(xt)
4283
- ), va = (
4284
- /** @class */
4285
- function(e) {
4286
- yt(t, e);
4287
- function t(r, n, i) {
4288
- return e.call(this, 'Value for "'.concat(r, '" must be of type ').concat(n), Ue.INVALID_VALUE, i) || this;
4289
- }
4290
- return t;
4291
- }(xt)
4292
- ), da = (
4293
- /** @class */
4294
- function(e) {
4295
- yt(t, e);
4296
- function t(r, n) {
4297
- return e.call(this, 'The intl string context variable "'.concat(r, '" was not provided to the string "').concat(n, '"'), Ue.MISSING_VALUE, n) || this;
4298
- }
4299
- return t;
4300
- }(xt)
4301
- ), R;
4302
- (function(e) {
4303
- e[e.literal = 0] = "literal", e[e.object = 1] = "object";
4304
- })(R || (R = {}));
4305
- function ma(e) {
4306
- return e.length < 2 ? e : e.reduce(function(t, r) {
4307
- var n = t[t.length - 1];
4308
- return !n || n.type !== R.literal || r.type !== R.literal ? t.push(r) : n.value += r.value, t;
4309
- }, []);
4310
- }
4311
- function _a(e) {
4312
- return typeof e == "function";
4313
- }
4314
- function st(e, t, r, n, i, s, a) {
4315
- if (e.length === 1 && Tr(e[0]))
4316
- return [
4317
- {
4318
- type: R.literal,
4319
- value: e[0].value
4320
- }
4321
- ];
4322
- for (var o = [], u = 0, l = e; u < l.length; u++) {
4323
- var f = l[u];
4324
- if (Tr(f)) {
4325
- o.push({
4326
- type: R.literal,
4327
- value: f.value
4328
- });
4329
- continue;
4330
- }
4331
- if (Fs(f)) {
4332
- typeof s == "number" && o.push({
4333
- type: R.literal,
4334
- value: r.getNumberFormat(t).format(s)
4335
- });
4336
- continue;
4337
- }
4338
- var c = f.value;
4339
- if (!(i && c in i))
4340
- throw new da(c, a);
4341
- var h = i[c];
4342
- if (Us(f)) {
4343
- (!h || typeof h == "string" || typeof h == "number") && (h = typeof h == "string" || typeof h == "number" ? String(h) : ""), o.push({
4344
- type: typeof h == "string" ? R.literal : R.object,
4345
- value: h
4346
- });
4347
- continue;
4348
- }
4349
- if (Tn(f)) {
4350
- var v = typeof f.style == "string" ? n.date[f.style] : zt(f.style) ? f.style.parsedOptions : void 0;
4351
- o.push({
4352
- type: R.literal,
4353
- value: r.getDateTimeFormat(t, v).format(h)
4354
- });
4355
- continue;
4356
- }
4357
- if (Sn(f)) {
4358
- var v = typeof f.style == "string" ? n.time[f.style] : zt(f.style) ? f.style.parsedOptions : n.time.medium;
4359
- o.push({
4360
- type: R.literal,
4361
- value: r.getDateTimeFormat(t, v).format(h)
4362
- });
4363
- continue;
4364
- }
4365
- if (wn(f)) {
4366
- var v = typeof f.style == "string" ? n.number[f.style] : Pn(f.style) ? f.style.parsedOptions : void 0;
4367
- v && v.scale && (h = h * (v.scale || 1)), o.push({
4368
- type: R.literal,
4369
- value: r.getNumberFormat(t, v).format(h)
4370
- });
4371
- continue;
4372
- }
4373
- if (Bn(f)) {
4374
- var d = f.children, g = f.value, H = i[g];
4375
- if (!_a(H))
4376
- throw new va(g, "function", a);
4377
- var j = st(d, t, r, n, i, s), U = H(j.map(function(E) {
4378
- return E.value;
4379
- }));
4380
- Array.isArray(U) || (U = [U]), o.push.apply(o, U.map(function(E) {
4381
- return {
4382
- type: typeof E == "string" ? R.literal : R.object,
4383
- value: E
4384
- };
4385
- }));
4386
- }
4387
- if (Hn(f)) {
4388
- var C = f.options[h] || f.options.other;
4389
- if (!C)
4390
- throw new Or(f.value, h, Object.keys(f.options), a);
4391
- o.push.apply(o, st(C.value, t, r, n, i));
4392
- continue;
4393
- }
4394
- if (An(f)) {
4395
- var C = f.options["=".concat(h)];
4396
- if (!C) {
4397
- if (!Intl.PluralRules)
4398
- throw new xt(`Intl.PluralRules is not available in this environment.
4399
- Try polyfilling it using "@formatjs/intl-pluralrules"
4400
- `, Ue.MISSING_INTL_API, a);
4401
- var pe = r.getPluralRules(t, { type: f.pluralType }).select(h - (f.offset || 0));
4402
- C = f.options[pe] || f.options.other;
4403
- }
4404
- if (!C)
4405
- throw new Or(f.value, h, Object.keys(f.options), a);
4406
- o.push.apply(o, st(C.value, t, r, n, i, h - (f.offset || 0)));
4407
- continue;
4408
- }
4409
- }
4410
- return ma(o);
4411
- }
4412
- function ba(e, t) {
4413
- return t ? K(K(K({}, e || {}), t || {}), Object.keys(e).reduce(function(r, n) {
4414
- return r[n] = K(K({}, e[n]), t[n] || {}), r;
4415
- }, {})) : e;
4416
- }
4417
- function ga(e, t) {
4418
- return t ? Object.keys(e).reduce(function(r, n) {
4419
- return r[n] = ba(e[n], t[n]), r;
4420
- }, K({}, e)) : e;
4421
- }
4422
- function Mt(e) {
4423
- return {
4424
- create: function() {
4425
- return {
4426
- get: function(t) {
4427
- return e[t];
4428
- },
4429
- set: function(t, r) {
4430
- e[t] = r;
4431
- }
4432
- };
4433
- }
4434
- };
4435
- }
4436
- function Ea(e) {
4437
- return e === void 0 && (e = {
4438
- number: {},
4439
- dateTime: {},
4440
- pluralRules: {}
4441
- }), {
4442
- getNumberFormat: It(function() {
4443
- for (var t, r = [], n = 0; n < arguments.length; n++)
4444
- r[n] = arguments[n];
4445
- return new ((t = Intl.NumberFormat).bind.apply(t, Ot([void 0], r, !1)))();
4446
- }, {
4447
- cache: Mt(e.number),
4448
- strategy: Ct.variadic
4449
- }),
4450
- getDateTimeFormat: It(function() {
4451
- for (var t, r = [], n = 0; n < arguments.length; n++)
4452
- r[n] = arguments[n];
4453
- return new ((t = Intl.DateTimeFormat).bind.apply(t, Ot([void 0], r, !1)))();
4454
- }, {
4455
- cache: Mt(e.dateTime),
4456
- strategy: Ct.variadic
4457
- }),
4458
- getPluralRules: It(function() {
4459
- for (var t, r = [], n = 0; n < arguments.length; n++)
4460
- r[n] = arguments[n];
4461
- return new ((t = Intl.PluralRules).bind.apply(t, Ot([void 0], r, !1)))();
4462
- }, {
4463
- cache: Mt(e.pluralRules),
4464
- strategy: Ct.variadic
4465
- })
4466
- };
4467
- }
4468
- var ya = (
4469
- /** @class */
4470
- function() {
4471
- function e(t, r, n, i) {
4472
- r === void 0 && (r = e.defaultLocale);
4473
- var s = this;
4474
- if (this.formatterCache = {
4475
- number: {},
4476
- dateTime: {},
4477
- pluralRules: {}
4478
- }, this.format = function(u) {
4479
- var l = s.formatToParts(u);
4480
- if (l.length === 1)
4481
- return l[0].value;
4482
- var f = l.reduce(function(c, h) {
4483
- return !c.length || h.type !== R.literal || typeof c[c.length - 1] != "string" ? c.push(h.value) : c[c.length - 1] += h.value, c;
4484
- }, []);
4485
- return f.length <= 1 ? f[0] || "" : f;
4486
- }, this.formatToParts = function(u) {
4487
- return st(s.ast, s.locales, s.formatters, s.formats, u, void 0, s.message);
4488
- }, this.resolvedOptions = function() {
4489
- var u;
4490
- return {
4491
- locale: ((u = s.resolvedLocale) === null || u === void 0 ? void 0 : u.toString()) || Intl.NumberFormat.supportedLocalesOf(s.locales)[0]
4492
- };
4493
- }, this.getAst = function() {
4494
- return s.ast;
4495
- }, this.locales = r, this.resolvedLocale = e.resolveLocale(r), typeof t == "string") {
4496
- if (this.message = t, !e.__parse)
4497
- throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
4498
- var a = i || {};
4499
- a.formatters;
4500
- var o = Ns(a, ["formatters"]);
4501
- this.ast = e.__parse(t, K(K({}, o), { locale: this.resolvedLocale }));
4502
- } else
4503
- this.ast = t;
4504
- if (!Array.isArray(this.ast))
4505
- throw new TypeError("A message must be provided as a String or AST.");
4506
- this.formats = ga(e.formats, n), this.formatters = i && i.formatters || Ea(this.formatterCache);
4507
- }
4508
- return Object.defineProperty(e, "defaultLocale", {
4509
- get: function() {
4510
- return e.memoizedDefaultLocale || (e.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), e.memoizedDefaultLocale;
4511
- },
4512
- enumerable: !1,
4513
- configurable: !0
4514
- }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {
4515
- if (!(typeof Intl.Locale > "u")) {
4516
- var r = Intl.NumberFormat.supportedLocalesOf(t);
4517
- return r.length > 0 ? new Intl.Locale(r[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
4518
- }
4519
- }, e.__parse = pa, e.formats = {
4520
- number: {
4521
- integer: {
4522
- maximumFractionDigits: 0
4523
- },
4524
- currency: {
4525
- style: "currency"
4526
- },
4527
- percent: {
4528
- style: "percent"
4529
- }
4530
- },
4531
- date: {
4532
- short: {
4533
- month: "numeric",
4534
- day: "numeric",
4535
- year: "2-digit"
4536
- },
4537
- medium: {
4538
- month: "short",
4539
- day: "numeric",
4540
- year: "numeric"
4541
- },
4542
- long: {
4543
- month: "long",
4544
- day: "numeric",
4545
- year: "numeric"
4546
- },
4547
- full: {
4548
- weekday: "long",
4549
- month: "long",
4550
- day: "numeric",
4551
- year: "numeric"
4552
- }
4553
- },
4554
- time: {
4555
- short: {
4556
- hour: "numeric",
4557
- minute: "numeric"
4558
- },
4559
- medium: {
4560
- hour: "numeric",
4561
- minute: "numeric",
4562
- second: "numeric"
4563
- },
4564
- long: {
4565
- hour: "numeric",
4566
- minute: "numeric",
4567
- second: "numeric",
4568
- timeZoneName: "short"
4569
- },
4570
- full: {
4571
- hour: "numeric",
4572
- minute: "numeric",
4573
- second: "numeric",
4574
- timeZoneName: "short"
4575
- }
4576
- }
4577
- }, e;
4578
- }()
4579
- );
4580
- function xa(e, t) {
4581
- if (t == null)
4582
- return;
4583
- if (t in e)
4584
- return e[t];
4585
- const r = t.split(".");
4586
- let n = e;
4587
- for (let i = 0; i < r.length; i++)
4588
- if (typeof n == "object") {
4589
- if (i > 0) {
4590
- const s = r.slice(i, r.length).join(".");
4591
- if (s in n) {
4592
- n = n[s];
4593
- break;
4594
- }
4595
- }
4596
- n = n[r[i]];
4597
- } else
4598
- n = void 0;
4599
- return n;
4600
- }
4601
- const se = {}, wa = (e, t, r) => r && (t in se || (se[t] = {}), e in se[t] || (se[t][e] = r), r), Dn = (e, t) => {
4602
- if (t == null)
4603
- return;
4604
- if (t in se && e in se[t])
4605
- return se[t][e];
4606
- const r = wt(t);
4607
- for (let n = 0; n < r.length; n++) {
4608
- const i = r[n], s = Sa(i, e);
4609
- if (s)
4610
- return wa(e, t, s);
4611
- }
4612
- };
4613
- let hr;
4614
- const Ve = Et({});
4615
- function Ta(e) {
4616
- return hr[e] || null;
4617
- }
4618
- function Un(e) {
4619
- return e in hr;
4620
- }
4621
- function Sa(e, t) {
4622
- if (!Un(e))
4623
- return null;
4624
- const r = Ta(e);
4625
- return xa(r, t);
4626
- }
4627
- function Ha(e) {
4628
- if (e == null)
4629
- return;
4630
- const t = wt(e);
4631
- for (let r = 0; r < t.length; r++) {
4632
- const n = t[r];
4633
- if (Un(n))
4634
- return n;
4635
- }
4636
- }
4637
- function Fn(e, ...t) {
4638
- delete se[e], Ve.update((r) => (r[e] = Ps.all([r[e] || {}, ...t]), r));
4639
- }
4640
- je(
4641
- [Ve],
4642
- ([e]) => Object.keys(e)
4643
- );
4644
- Ve.subscribe((e) => hr = e);
4645
- const at = {};
4646
- function Aa(e, t) {
4647
- at[e].delete(t), at[e].size === 0 && delete at[e];
4648
- }
4649
- function Gn(e) {
4650
- return at[e];
4651
- }
4652
- function Ba(e) {
4653
- return wt(e).map((t) => {
4654
- const r = Gn(t);
4655
- return [t, r ? [...r] : []];
4656
- }).filter(([, t]) => t.length > 0);
4657
- }
4658
- function er(e) {
4659
- return e == null ? !1 : wt(e).some(
4660
- (t) => {
4661
- var r;
4662
- return (r = Gn(t)) == null ? void 0 : r.size;
4663
- }
4664
- );
4665
- }
4666
- function Pa(e, t) {
4667
- return Promise.all(
4668
- t.map((n) => (Aa(e, n), n().then((i) => i.default || i)))
4669
- ).then((n) => Fn(e, ...n));
4670
- }
4671
- const We = {};
4672
- function kn(e) {
4673
- if (!er(e))
4674
- return e in We ? We[e] : Promise.resolve();
4675
- const t = Ba(e);
4676
- return We[e] = Promise.all(
4677
- t.map(
4678
- ([r, n]) => Pa(r, n)
4679
- )
4680
- ).then(() => {
4681
- if (er(e))
4682
- return kn(e);
4683
- delete We[e];
4684
- }), We[e];
4685
- }
4686
- const Na = {
4687
- number: {
4688
- scientific: { notation: "scientific" },
4689
- engineering: { notation: "engineering" },
4690
- compactLong: { notation: "compact", compactDisplay: "long" },
4691
- compactShort: { notation: "compact", compactDisplay: "short" }
4692
- },
4693
- date: {
4694
- short: { month: "numeric", day: "numeric", year: "2-digit" },
4695
- medium: { month: "short", day: "numeric", year: "numeric" },
4696
- long: { month: "long", day: "numeric", year: "numeric" },
4697
- full: { weekday: "long", month: "long", day: "numeric", year: "numeric" }
4698
- },
4699
- time: {
4700
- short: { hour: "numeric", minute: "numeric" },
4701
- medium: { hour: "numeric", minute: "numeric", second: "numeric" },
4702
- long: {
4703
- hour: "numeric",
4704
- minute: "numeric",
4705
- second: "numeric",
4706
- timeZoneName: "short"
4707
- },
4708
- full: {
4709
- hour: "numeric",
4710
- minute: "numeric",
4711
- second: "numeric",
4712
- timeZoneName: "short"
4713
- }
4714
- }
4715
- }, Oa = {
4716
- fallbackLocale: null,
4717
- loadingDelay: 200,
4718
- formats: Na,
4719
- warnOnMissingMessages: !0,
4720
- handleMissingMessage: void 0,
4721
- ignoreTag: !0
4722
- }, Ia = Oa;
4723
- function Fe() {
4724
- return Ia;
4725
- }
4726
- const Lt = Et(!1);
4727
- var Ca = Object.defineProperty, Ra = Object.defineProperties, Ma = Object.getOwnPropertyDescriptors, Ir = Object.getOwnPropertySymbols, La = Object.prototype.hasOwnProperty, Da = Object.prototype.propertyIsEnumerable, Cr = (e, t, r) => t in e ? Ca(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ua = (e, t) => {
4728
- for (var r in t || (t = {}))
4729
- La.call(t, r) && Cr(e, r, t[r]);
4730
- if (Ir)
4731
- for (var r of Ir(t))
4732
- Da.call(t, r) && Cr(e, r, t[r]);
4733
- return e;
4734
- }, Fa = (e, t) => Ra(e, Ma(t));
4735
- let tr;
4736
- const vt = Et(null);
4737
- function Rr(e) {
4738
- return e.split("-").map((t, r, n) => n.slice(0, r + 1).join("-")).reverse();
4739
- }
4740
- function wt(e, t = Fe().fallbackLocale) {
4741
- const r = Rr(e);
4742
- return t ? [.../* @__PURE__ */ new Set([...r, ...Rr(t)])] : r;
4743
- }
4744
- function Ae() {
4745
- return tr ?? void 0;
4746
- }
4747
- vt.subscribe((e) => {
4748
- tr = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e);
4749
- });
4750
- const Ga = (e) => {
4751
- if (e && Ha(e) && er(e)) {
4752
- const { loadingDelay: t } = Fe();
4753
- let r;
4754
- return typeof window < "u" && Ae() != null && t ? r = window.setTimeout(
4755
- () => Lt.set(!0),
4756
- t
4757
- ) : Lt.set(!0), kn(e).then(() => {
4758
- vt.set(e);
4759
- }).finally(() => {
4760
- clearTimeout(r), Lt.set(!1);
4761
- });
4762
- }
4763
- return vt.set(e);
4764
- }, He = Fa(Ua({}, vt), {
4765
- set: Ga
4766
- }), Tt = (e) => {
4767
- const t = /* @__PURE__ */ Object.create(null);
4768
- return (n) => {
4769
- const i = JSON.stringify(n);
4770
- return i in t ? t[i] : t[i] = e(n);
4771
- };
4772
- };
4773
- var ka = Object.defineProperty, dt = Object.getOwnPropertySymbols, jn = Object.prototype.hasOwnProperty, Vn = Object.prototype.propertyIsEnumerable, Mr = (e, t, r) => t in e ? ka(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, cr = (e, t) => {
4774
- for (var r in t || (t = {}))
4775
- jn.call(t, r) && Mr(e, r, t[r]);
4776
- if (dt)
4777
- for (var r of dt(t))
4778
- Vn.call(t, r) && Mr(e, r, t[r]);
4779
- return e;
4780
- }, Xe = (e, t) => {
4781
- var r = {};
4782
- for (var n in e)
4783
- jn.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
4784
- if (e != null && dt)
4785
- for (var n of dt(e))
4786
- t.indexOf(n) < 0 && Vn.call(e, n) && (r[n] = e[n]);
4787
- return r;
4788
- };
4789
- const Qe = (e, t) => {
4790
- const { formats: r } = Fe();
4791
- if (e in r && t in r[e])
4792
- return r[e][t];
4793
- throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`);
4794
- }, ja = Tt(
4795
- (e) => {
4796
- var t = e, { locale: r, format: n } = t, i = Xe(t, ["locale", "format"]);
4797
- if (r == null)
4798
- throw new Error('[svelte-i18n] A "locale" must be set to format numbers');
4799
- return n && (i = Qe("number", n)), new Intl.NumberFormat(r, i);
4800
- }
4801
- ), Va = Tt(
4802
- (e) => {
4803
- var t = e, { locale: r, format: n } = t, i = Xe(t, ["locale", "format"]);
4804
- if (r == null)
4805
- throw new Error('[svelte-i18n] A "locale" must be set to format dates');
4806
- return n ? i = Qe("date", n) : Object.keys(i).length === 0 && (i = Qe("date", "short")), new Intl.DateTimeFormat(r, i);
4807
- }
4808
- ), Xa = Tt(
4809
- (e) => {
4810
- var t = e, { locale: r, format: n } = t, i = Xe(t, ["locale", "format"]);
4811
- if (r == null)
4812
- throw new Error(
4813
- '[svelte-i18n] A "locale" must be set to format time values'
4814
- );
4815
- return n ? i = Qe("time", n) : Object.keys(i).length === 0 && (i = Qe("time", "short")), new Intl.DateTimeFormat(r, i);
4816
- }
4817
- ), Wa = (e = {}) => {
4818
- var t = e, {
4819
- locale: r = Ae()
4820
- } = t, n = Xe(t, [
4821
- "locale"
4822
- ]);
4823
- return ja(cr({ locale: r }, n));
4824
- }, $a = (e = {}) => {
4825
- var t = e, {
4826
- locale: r = Ae()
4827
- } = t, n = Xe(t, [
4828
- "locale"
4829
- ]);
4830
- return Va(cr({ locale: r }, n));
4831
- }, qa = (e = {}) => {
4832
- var t = e, {
4833
- locale: r = Ae()
4834
- } = t, n = Xe(t, [
4835
- "locale"
4836
- ]);
4837
- return Xa(cr({ locale: r }, n));
4838
- }, za = Tt(
4839
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
4840
- (e, t = Ae()) => new ya(e, t, Fe().formats, {
4841
- ignoreTag: Fe().ignoreTag
4842
- })
4843
- ), Za = (e, t = {}) => {
4844
- var r, n, i, s;
4845
- let a = t;
4846
- typeof e == "object" && (a = e, e = a.id);
4847
- const {
4848
- values: o,
4849
- locale: u = Ae(),
4850
- default: l
4851
- } = a;
4852
- if (u == null)
4853
- throw new Error(
4854
- "[svelte-i18n] Cannot format a message without first setting the initial locale."
4855
- );
4856
- let f = Dn(e, u);
4857
- if (!f)
4858
- f = (s = (i = (n = (r = Fe()).handleMissingMessage) == null ? void 0 : n.call(r, { locale: u, id: e, defaultValue: l })) != null ? i : l) != null ? s : e;
4859
- else if (typeof f != "string")
4860
- return console.warn(
4861
- `[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`
4862
- ), f;
4863
- if (!o)
4864
- return f;
4865
- let c = f;
4866
- try {
4867
- c = za(f, u).format(o);
4868
- } catch (h) {
4869
- h instanceof Error && console.warn(
4870
- `[svelte-i18n] Message "${e}" has syntax error:`,
4871
- h.message
4872
- );
4873
- }
4874
- return c;
4875
- }, Qa = (e, t) => qa(t).format(e), Ya = (e, t) => $a(t).format(e), Ja = (e, t) => Wa(t).format(e), Ka = (e, t = Ae()) => Dn(e, t), eo = je([He, Ve], () => Za);
4876
- je([He], () => Qa);
4877
- je([He], () => Ya);
4878
- je([He], () => Ja);
4879
- je([He, Ve], () => Ka);
4880
- function to({ withLocale: e, translations: t }) {
4881
- He.subscribe((r) => {
4882
- r == null && (Ve.set(t), He.set(e));
4883
- });
4884
- }
4885
- function ro(e, t) {
4886
- Fn(e, t);
4887
- }
4888
- const no = {
4889
- en: {
4890
- requestRackBack: "Request Rackeback"
4891
- },
4892
- tr: {
4893
- requestRackBack: "Request Rackeback"
4894
- }
4895
- }, io = "RakebackClaimConfirmed";
4896
- var so = /* @__PURE__ */ Ji('<div class="loyalty-rakeback-card svelte-1jfnm2j"><div class="loyalty-rakeback-card__content svelte-1jfnm2j"><span class="loyalty-rakeback-card__amount svelte-1jfnm2j"> </span> <button class="loyalty-rakeback-card__button svelte-1jfnm2j" type="button"> </button></div></div>');
4897
- function lo(e, t) {
4898
- vi(t, !0);
4899
- const r = () => is(eo, "$_", n), [n, i] = ss(), s = Nt(t, "apiEndpoint", 3, ""), a = Nt(t, "userSession", 3, ""), o = Nt(t, "locale", 3, "");
4900
- to({ withLocale: o(), translations: {} }), Object.entries(no).forEach(([E, $]) => {
4901
- ro(E, $);
4902
- });
4903
- let u = /* @__PURE__ */ z(void 0), l = /* @__PURE__ */ z(!1), f = /* @__PURE__ */ z(!1);
4904
- const c = /* @__PURE__ */ rt(() => T(u) ? us(T(u).total.points <= 0 ? 0 : T(u).total.points, 2) : "0.00"), h = /* @__PURE__ */ rt(() => {
4905
- var E;
4906
- return ls(((E = T(u)) == null ? void 0 : E.currency) ?? "", o());
4907
- }), v = /* @__PURE__ */ rt(() => {
4908
- var E;
4909
- return !!((E = T(u)) != null && E.claimable);
4910
- }), d = /* @__PURE__ */ rt(() => T(l)), g = async () => {
4911
- if (!(!s() || !a()))
4912
- try {
4913
- const E = await as({
4914
- apiEndpoint: s(),
4915
- userSession: a(),
4916
- locale: o()
4917
- });
4918
- if (!E.rakebackWallet) {
4919
- k(l, !1), ps();
4920
- return;
4921
- }
4922
- k(u, E.rakebackWallet, !0), k(l, !0);
4923
- } catch (E) {
4924
- console.error("Failed to load rakeback info:", E);
4925
- }
4926
- }, H = () => {
4927
- !T(v) || T(f) || !T(u) || fs(T(u).total.points);
4928
- }, j = async () => {
4929
- if (!(!s() || !a() || !T(u))) {
4930
- k(f, !0);
4931
- try {
4932
- await os({
4933
- apiEndpoint: s(),
4934
- userSession: a(),
4935
- locale: o()
4936
- }), await g(), hs(T(u).total.points);
4937
- } catch (E) {
4938
- console.error("Claim rakeback: ", E), cs(E.message);
4939
- } finally {
4940
- k(f, !1);
4941
- }
4942
- }
4943
- };
4944
- _r(() => {
4945
- s(), a(), o(), g();
4946
- }), _r(() => {
4947
- const E = ($) => {
4948
- var ve;
4949
- ((ve = $.data) == null ? void 0 : ve.type) === io && j();
4950
- };
4951
- return window.addEventListener("message", E), () => window.removeEventListener("message", E);
4952
- });
4953
- var U = Ki(), C = Ii(U);
4954
- {
4955
- var pe = (E) => {
4956
- var $ = so(), ve = nt($), pr = nt(ve), Xn = nt(pr), St = Ci(pr, 2);
4957
- St.__click = H;
4958
- var Wn = nt(St);
4959
- Ui(
4960
- ($n) => {
4961
- xr(Xn, `${T(c) ?? ""} ${T(h) ?? ""}`), St.disabled = T(f) || !T(v), xr(Wn, $n);
4962
- },
4963
- [() => r()("requestRackBack")]
4964
- ), yr(E, $);
4965
- };
4966
- ts(C, (E) => {
4967
- T(d) && E(pe);
4968
- });
4969
- }
4970
- yr(e, U), di(), i();
4971
- }
4972
- Qi(["click"]);
4973
- export {
4974
- lo as default
4975
- };