@myxtra/authentication-green 1.7.7-alpha.0 → 1.7.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3336 @@
1
+ import { r as d, j as n, g as _t, u as q, a as Ke, b as St, E as Et } from "./index-cff84219.mjs";
2
+ class V {
3
+ constructor() {
4
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
5
+ }
6
+ subscribe(t) {
7
+ const s = {
8
+ listener: t
9
+ };
10
+ return this.listeners.add(s), this.onSubscribe(), () => {
11
+ this.listeners.delete(s), this.onUnsubscribe();
12
+ };
13
+ }
14
+ hasListeners() {
15
+ return this.listeners.size > 0;
16
+ }
17
+ onSubscribe() {
18
+ }
19
+ onUnsubscribe() {
20
+ }
21
+ }
22
+ const X = typeof window > "u" || "Deno" in window;
23
+ function M() {
24
+ }
25
+ function Pt(e, t) {
26
+ return typeof e == "function" ? e(t) : e;
27
+ }
28
+ function fe(e) {
29
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
30
+ }
31
+ function He(e, t) {
32
+ return Math.max(e + (t || 0) - Date.now(), 0);
33
+ }
34
+ function J(e, t, s) {
35
+ return I(e) ? typeof t == "function" ? {
36
+ ...s,
37
+ queryKey: e,
38
+ queryFn: t
39
+ } : {
40
+ ...t,
41
+ queryKey: e
42
+ } : e;
43
+ }
44
+ function Rt(e, t, s) {
45
+ return I(e) ? typeof t == "function" ? {
46
+ ...s,
47
+ mutationKey: e,
48
+ mutationFn: t
49
+ } : {
50
+ ...t,
51
+ mutationKey: e
52
+ } : typeof e == "function" ? {
53
+ ...t,
54
+ mutationFn: e
55
+ } : {
56
+ ...e
57
+ };
58
+ }
59
+ function T(e, t, s) {
60
+ return I(e) ? [{
61
+ ...t,
62
+ queryKey: e
63
+ }, s] : [e || {}, t];
64
+ }
65
+ function Re(e, t) {
66
+ const {
67
+ type: s = "all",
68
+ exact: r,
69
+ fetchStatus: i,
70
+ predicate: a,
71
+ queryKey: o,
72
+ stale: l
73
+ } = e;
74
+ if (I(o)) {
75
+ if (r) {
76
+ if (t.queryHash !== we(o, t.options))
77
+ return !1;
78
+ } else if (!se(t.queryKey, o))
79
+ return !1;
80
+ }
81
+ if (s !== "all") {
82
+ const c = t.isActive();
83
+ if (s === "active" && !c || s === "inactive" && c)
84
+ return !1;
85
+ }
86
+ return !(typeof l == "boolean" && t.isStale() !== l || typeof i < "u" && i !== t.state.fetchStatus || a && !a(t));
87
+ }
88
+ function Ae(e, t) {
89
+ const {
90
+ exact: s,
91
+ fetching: r,
92
+ predicate: i,
93
+ mutationKey: a
94
+ } = e;
95
+ if (I(a)) {
96
+ if (!t.options.mutationKey)
97
+ return !1;
98
+ if (s) {
99
+ if (U(t.options.mutationKey) !== U(a))
100
+ return !1;
101
+ } else if (!se(t.options.mutationKey, a))
102
+ return !1;
103
+ }
104
+ return !(typeof r == "boolean" && t.state.status === "loading" !== r || i && !i(t));
105
+ }
106
+ function we(e, t) {
107
+ return ((t == null ? void 0 : t.queryKeyHashFn) || U)(e);
108
+ }
109
+ function U(e) {
110
+ return JSON.stringify(e, (t, s) => pe(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s);
111
+ }
112
+ function se(e, t) {
113
+ return Ge(e, t);
114
+ }
115
+ function Ge(e, t) {
116
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !Ge(e[s], t[s])) : !1;
117
+ }
118
+ function Ve(e, t) {
119
+ if (e === t)
120
+ return e;
121
+ const s = Oe(e) && Oe(t);
122
+ if (s || pe(e) && pe(t)) {
123
+ const r = s ? e.length : Object.keys(e).length, i = s ? t : Object.keys(t), a = i.length, o = s ? [] : {};
124
+ let l = 0;
125
+ for (let c = 0; c < a; c++) {
126
+ const h = s ? c : i[c];
127
+ o[h] = Ve(e[h], t[h]), o[h] === e[h] && l++;
128
+ }
129
+ return r === a && l === r ? e : o;
130
+ }
131
+ return t;
132
+ }
133
+ function re(e, t) {
134
+ if (e && !t || t && !e)
135
+ return !1;
136
+ for (const s in e)
137
+ if (e[s] !== t[s])
138
+ return !1;
139
+ return !0;
140
+ }
141
+ function Oe(e) {
142
+ return Array.isArray(e) && e.length === Object.keys(e).length;
143
+ }
144
+ function pe(e) {
145
+ if (!Ne(e))
146
+ return !1;
147
+ const t = e.constructor;
148
+ if (typeof t > "u")
149
+ return !0;
150
+ const s = t.prototype;
151
+ return !(!Ne(s) || !s.hasOwnProperty("isPrototypeOf"));
152
+ }
153
+ function Ne(e) {
154
+ return Object.prototype.toString.call(e) === "[object Object]";
155
+ }
156
+ function I(e) {
157
+ return Array.isArray(e);
158
+ }
159
+ function $e(e) {
160
+ return new Promise((t) => {
161
+ setTimeout(t, e);
162
+ });
163
+ }
164
+ function Fe(e) {
165
+ $e(0).then(e);
166
+ }
167
+ function At() {
168
+ if (typeof AbortController == "function")
169
+ return new AbortController();
170
+ }
171
+ function ve(e, t, s) {
172
+ return s.isDataEqual != null && s.isDataEqual(e, t) ? e : typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ? Ve(e, t) : t;
173
+ }
174
+ class Ot extends V {
175
+ constructor() {
176
+ super(), this.setup = (t) => {
177
+ if (!X && window.addEventListener) {
178
+ const s = () => t();
179
+ return window.addEventListener("visibilitychange", s, !1), window.addEventListener("focus", s, !1), () => {
180
+ window.removeEventListener("visibilitychange", s), window.removeEventListener("focus", s);
181
+ };
182
+ }
183
+ };
184
+ }
185
+ onSubscribe() {
186
+ this.cleanup || this.setEventListener(this.setup);
187
+ }
188
+ onUnsubscribe() {
189
+ if (!this.hasListeners()) {
190
+ var t;
191
+ (t = this.cleanup) == null || t.call(this), this.cleanup = void 0;
192
+ }
193
+ }
194
+ setEventListener(t) {
195
+ var s;
196
+ this.setup = t, (s = this.cleanup) == null || s.call(this), this.cleanup = t((r) => {
197
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
198
+ });
199
+ }
200
+ setFocused(t) {
201
+ this.focused !== t && (this.focused = t, this.onFocus());
202
+ }
203
+ onFocus() {
204
+ this.listeners.forEach(({
205
+ listener: t
206
+ }) => {
207
+ t();
208
+ });
209
+ }
210
+ isFocused() {
211
+ return typeof this.focused == "boolean" ? this.focused : typeof document > "u" ? !0 : [void 0, "visible", "prerender"].includes(document.visibilityState);
212
+ }
213
+ }
214
+ const ne = new Ot(), ke = ["online", "offline"];
215
+ class Nt extends V {
216
+ constructor() {
217
+ super(), this.setup = (t) => {
218
+ if (!X && window.addEventListener) {
219
+ const s = () => t();
220
+ return ke.forEach((r) => {
221
+ window.addEventListener(r, s, !1);
222
+ }), () => {
223
+ ke.forEach((r) => {
224
+ window.removeEventListener(r, s);
225
+ });
226
+ };
227
+ }
228
+ };
229
+ }
230
+ onSubscribe() {
231
+ this.cleanup || this.setEventListener(this.setup);
232
+ }
233
+ onUnsubscribe() {
234
+ if (!this.hasListeners()) {
235
+ var t;
236
+ (t = this.cleanup) == null || t.call(this), this.cleanup = void 0;
237
+ }
238
+ }
239
+ setEventListener(t) {
240
+ var s;
241
+ this.setup = t, (s = this.cleanup) == null || s.call(this), this.cleanup = t((r) => {
242
+ typeof r == "boolean" ? this.setOnline(r) : this.onOnline();
243
+ });
244
+ }
245
+ setOnline(t) {
246
+ this.online !== t && (this.online = t, this.onOnline());
247
+ }
248
+ onOnline() {
249
+ this.listeners.forEach(({
250
+ listener: t
251
+ }) => {
252
+ t();
253
+ });
254
+ }
255
+ isOnline() {
256
+ return typeof this.online == "boolean" ? this.online : typeof navigator > "u" || typeof navigator.onLine > "u" ? !0 : navigator.onLine;
257
+ }
258
+ }
259
+ const ie = new Nt();
260
+ function Ft(e) {
261
+ return Math.min(1e3 * 2 ** e, 3e4);
262
+ }
263
+ function ue(e) {
264
+ return (e ?? "online") === "online" ? ie.isOnline() : !0;
265
+ }
266
+ class We {
267
+ constructor(t) {
268
+ this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
269
+ }
270
+ }
271
+ function te(e) {
272
+ return e instanceof We;
273
+ }
274
+ function Ze(e) {
275
+ let t = !1, s = 0, r = !1, i, a, o;
276
+ const l = new Promise((m, C) => {
277
+ a = m, o = C;
278
+ }), c = (m) => {
279
+ r || (f(new We(m)), e.abort == null || e.abort());
280
+ }, h = () => {
281
+ t = !0;
282
+ }, u = () => {
283
+ t = !1;
284
+ }, p = () => !ne.isFocused() || e.networkMode !== "always" && !ie.isOnline(), v = (m) => {
285
+ r || (r = !0, e.onSuccess == null || e.onSuccess(m), i == null || i(), a(m));
286
+ }, f = (m) => {
287
+ r || (r = !0, e.onError == null || e.onError(m), i == null || i(), o(m));
288
+ }, y = () => new Promise((m) => {
289
+ i = (C) => {
290
+ const _ = r || !p();
291
+ return _ && m(C), _;
292
+ }, e.onPause == null || e.onPause();
293
+ }).then(() => {
294
+ i = void 0, r || e.onContinue == null || e.onContinue();
295
+ }), x = () => {
296
+ if (r)
297
+ return;
298
+ let m;
299
+ try {
300
+ m = e.fn();
301
+ } catch (C) {
302
+ m = Promise.reject(C);
303
+ }
304
+ Promise.resolve(m).then(v).catch((C) => {
305
+ var _, w;
306
+ if (r)
307
+ return;
308
+ const R = (_ = e.retry) != null ? _ : 3, N = (w = e.retryDelay) != null ? w : Ft, S = typeof N == "function" ? N(s, C) : N, j = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, C);
309
+ if (t || !j) {
310
+ f(C);
311
+ return;
312
+ }
313
+ s++, e.onFail == null || e.onFail(s, C), $e(S).then(() => {
314
+ if (p())
315
+ return y();
316
+ }).then(() => {
317
+ t ? f(C) : x();
318
+ });
319
+ });
320
+ };
321
+ return ue(e.networkMode) ? x() : y().then(x), {
322
+ promise: l,
323
+ cancel: c,
324
+ continue: () => (i == null ? void 0 : i()) ? l : Promise.resolve(),
325
+ cancelRetry: h,
326
+ continueRetry: u
327
+ };
328
+ }
329
+ const je = console;
330
+ function kt() {
331
+ let e = [], t = 0, s = (u) => {
332
+ u();
333
+ }, r = (u) => {
334
+ u();
335
+ };
336
+ const i = (u) => {
337
+ let p;
338
+ t++;
339
+ try {
340
+ p = u();
341
+ } finally {
342
+ t--, t || l();
343
+ }
344
+ return p;
345
+ }, a = (u) => {
346
+ t ? e.push(u) : Fe(() => {
347
+ s(u);
348
+ });
349
+ }, o = (u) => (...p) => {
350
+ a(() => {
351
+ u(...p);
352
+ });
353
+ }, l = () => {
354
+ const u = e;
355
+ e = [], u.length && Fe(() => {
356
+ r(() => {
357
+ u.forEach((p) => {
358
+ s(p);
359
+ });
360
+ });
361
+ });
362
+ };
363
+ return {
364
+ batch: i,
365
+ batchCalls: o,
366
+ schedule: a,
367
+ setNotifyFunction: (u) => {
368
+ s = u;
369
+ },
370
+ setBatchNotifyFunction: (u) => {
371
+ r = u;
372
+ }
373
+ };
374
+ }
375
+ const A = kt();
376
+ class ze {
377
+ destroy() {
378
+ this.clearGcTimeout();
379
+ }
380
+ scheduleGc() {
381
+ this.clearGcTimeout(), fe(this.cacheTime) && (this.gcTimeout = setTimeout(() => {
382
+ this.optionalRemove();
383
+ }, this.cacheTime));
384
+ }
385
+ updateCacheTime(t) {
386
+ this.cacheTime = Math.max(this.cacheTime || 0, t ?? (X ? 1 / 0 : 5 * 60 * 1e3));
387
+ }
388
+ clearGcTimeout() {
389
+ this.gcTimeout && (clearTimeout(this.gcTimeout), this.gcTimeout = void 0);
390
+ }
391
+ }
392
+ class Mt extends ze {
393
+ constructor(t) {
394
+ super(), this.abortSignalConsumed = !1, this.defaultOptions = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.cache = t.cache, this.logger = t.logger || je, this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.initialState = t.state || Lt(this.options), this.state = this.initialState, this.scheduleGc();
395
+ }
396
+ get meta() {
397
+ return this.options.meta;
398
+ }
399
+ setOptions(t) {
400
+ this.options = {
401
+ ...this.defaultOptions,
402
+ ...t
403
+ }, this.updateCacheTime(this.options.cacheTime);
404
+ }
405
+ optionalRemove() {
406
+ !this.observers.length && this.state.fetchStatus === "idle" && this.cache.remove(this);
407
+ }
408
+ setData(t, s) {
409
+ const r = ve(this.state.data, t, this.options);
410
+ return this.dispatch({
411
+ data: r,
412
+ type: "success",
413
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
414
+ manual: s == null ? void 0 : s.manual
415
+ }), r;
416
+ }
417
+ setState(t, s) {
418
+ this.dispatch({
419
+ type: "setState",
420
+ state: t,
421
+ setStateOptions: s
422
+ });
423
+ }
424
+ cancel(t) {
425
+ var s;
426
+ const r = this.promise;
427
+ return (s = this.retryer) == null || s.cancel(t), r ? r.then(M).catch(M) : Promise.resolve();
428
+ }
429
+ destroy() {
430
+ super.destroy(), this.cancel({
431
+ silent: !0
432
+ });
433
+ }
434
+ reset() {
435
+ this.destroy(), this.setState(this.initialState);
436
+ }
437
+ isActive() {
438
+ return this.observers.some((t) => t.options.enabled !== !1);
439
+ }
440
+ isDisabled() {
441
+ return this.getObserversCount() > 0 && !this.isActive();
442
+ }
443
+ isStale() {
444
+ return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some((t) => t.getCurrentResult().isStale);
445
+ }
446
+ isStaleByTime(t = 0) {
447
+ return this.state.isInvalidated || !this.state.dataUpdatedAt || !He(this.state.dataUpdatedAt, t);
448
+ }
449
+ onFocus() {
450
+ var t;
451
+ const s = this.observers.find((r) => r.shouldFetchOnWindowFocus());
452
+ s && s.refetch({
453
+ cancelRefetch: !1
454
+ }), (t = this.retryer) == null || t.continue();
455
+ }
456
+ onOnline() {
457
+ var t;
458
+ const s = this.observers.find((r) => r.shouldFetchOnReconnect());
459
+ s && s.refetch({
460
+ cancelRefetch: !1
461
+ }), (t = this.retryer) == null || t.continue();
462
+ }
463
+ addObserver(t) {
464
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.cache.notify({
465
+ type: "observerAdded",
466
+ query: this,
467
+ observer: t
468
+ }));
469
+ }
470
+ removeObserver(t) {
471
+ this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (this.retryer && (this.abortSignalConsumed ? this.retryer.cancel({
472
+ revert: !0
473
+ }) : this.retryer.cancelRetry()), this.scheduleGc()), this.cache.notify({
474
+ type: "observerRemoved",
475
+ query: this,
476
+ observer: t
477
+ }));
478
+ }
479
+ getObserversCount() {
480
+ return this.observers.length;
481
+ }
482
+ invalidate() {
483
+ this.state.isInvalidated || this.dispatch({
484
+ type: "invalidate"
485
+ });
486
+ }
487
+ fetch(t, s) {
488
+ var r, i;
489
+ if (this.state.fetchStatus !== "idle") {
490
+ if (this.state.dataUpdatedAt && s != null && s.cancelRefetch)
491
+ this.cancel({
492
+ silent: !0
493
+ });
494
+ else if (this.promise) {
495
+ var a;
496
+ return (a = this.retryer) == null || a.continueRetry(), this.promise;
497
+ }
498
+ }
499
+ if (t && this.setOptions(t), !this.options.queryFn) {
500
+ const f = this.observers.find((y) => y.options.queryFn);
501
+ f && this.setOptions(f.options);
502
+ }
503
+ Array.isArray(this.options.queryKey);
504
+ const o = At(), l = {
505
+ queryKey: this.queryKey,
506
+ pageParam: void 0,
507
+ meta: this.meta
508
+ }, c = (f) => {
509
+ Object.defineProperty(f, "signal", {
510
+ enumerable: !0,
511
+ get: () => {
512
+ if (o)
513
+ return this.abortSignalConsumed = !0, o.signal;
514
+ }
515
+ });
516
+ };
517
+ c(l);
518
+ const h = () => this.options.queryFn ? (this.abortSignalConsumed = !1, this.options.queryFn(l)) : Promise.reject("Missing queryFn for queryKey '" + this.options.queryHash + "'"), u = {
519
+ fetchOptions: s,
520
+ options: this.options,
521
+ queryKey: this.queryKey,
522
+ state: this.state,
523
+ fetchFn: h
524
+ };
525
+ if (c(u), (r = this.options.behavior) == null || r.onFetch(u), this.revertState = this.state, this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((i = u.fetchOptions) == null ? void 0 : i.meta)) {
526
+ var p;
527
+ this.dispatch({
528
+ type: "fetch",
529
+ meta: (p = u.fetchOptions) == null ? void 0 : p.meta
530
+ });
531
+ }
532
+ const v = (f) => {
533
+ if (te(f) && f.silent || this.dispatch({
534
+ type: "error",
535
+ error: f
536
+ }), !te(f)) {
537
+ var y, x, m, C;
538
+ (y = (x = this.cache.config).onError) == null || y.call(x, f, this), (m = (C = this.cache.config).onSettled) == null || m.call(C, this.state.data, f, this);
539
+ }
540
+ this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
541
+ };
542
+ return this.retryer = Ze({
543
+ fn: u.fetchFn,
544
+ abort: o == null ? void 0 : o.abort.bind(o),
545
+ onSuccess: (f) => {
546
+ var y, x, m, C;
547
+ if (typeof f > "u") {
548
+ v(new Error(this.queryHash + " data is undefined"));
549
+ return;
550
+ }
551
+ this.setData(f), (y = (x = this.cache.config).onSuccess) == null || y.call(x, f, this), (m = (C = this.cache.config).onSettled) == null || m.call(C, f, this.state.error, this), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
552
+ },
553
+ onError: v,
554
+ onFail: (f, y) => {
555
+ this.dispatch({
556
+ type: "failed",
557
+ failureCount: f,
558
+ error: y
559
+ });
560
+ },
561
+ onPause: () => {
562
+ this.dispatch({
563
+ type: "pause"
564
+ });
565
+ },
566
+ onContinue: () => {
567
+ this.dispatch({
568
+ type: "continue"
569
+ });
570
+ },
571
+ retry: u.options.retry,
572
+ retryDelay: u.options.retryDelay,
573
+ networkMode: u.options.networkMode
574
+ }), this.promise = this.retryer.promise, this.promise;
575
+ }
576
+ dispatch(t) {
577
+ const s = (r) => {
578
+ var i, a;
579
+ switch (t.type) {
580
+ case "failed":
581
+ return {
582
+ ...r,
583
+ fetchFailureCount: t.failureCount,
584
+ fetchFailureReason: t.error
585
+ };
586
+ case "pause":
587
+ return {
588
+ ...r,
589
+ fetchStatus: "paused"
590
+ };
591
+ case "continue":
592
+ return {
593
+ ...r,
594
+ fetchStatus: "fetching"
595
+ };
596
+ case "fetch":
597
+ return {
598
+ ...r,
599
+ fetchFailureCount: 0,
600
+ fetchFailureReason: null,
601
+ fetchMeta: (i = t.meta) != null ? i : null,
602
+ fetchStatus: ue(this.options.networkMode) ? "fetching" : "paused",
603
+ ...!r.dataUpdatedAt && {
604
+ error: null,
605
+ status: "loading"
606
+ }
607
+ };
608
+ case "success":
609
+ return {
610
+ ...r,
611
+ data: t.data,
612
+ dataUpdateCount: r.dataUpdateCount + 1,
613
+ dataUpdatedAt: (a = t.dataUpdatedAt) != null ? a : Date.now(),
614
+ error: null,
615
+ isInvalidated: !1,
616
+ status: "success",
617
+ ...!t.manual && {
618
+ fetchStatus: "idle",
619
+ fetchFailureCount: 0,
620
+ fetchFailureReason: null
621
+ }
622
+ };
623
+ case "error":
624
+ const o = t.error;
625
+ return te(o) && o.revert && this.revertState ? {
626
+ ...this.revertState
627
+ } : {
628
+ ...r,
629
+ error: o,
630
+ errorUpdateCount: r.errorUpdateCount + 1,
631
+ errorUpdatedAt: Date.now(),
632
+ fetchFailureCount: r.fetchFailureCount + 1,
633
+ fetchFailureReason: o,
634
+ fetchStatus: "idle",
635
+ status: "error"
636
+ };
637
+ case "invalidate":
638
+ return {
639
+ ...r,
640
+ isInvalidated: !0
641
+ };
642
+ case "setState":
643
+ return {
644
+ ...r,
645
+ ...t.state
646
+ };
647
+ }
648
+ };
649
+ this.state = s(this.state), A.batch(() => {
650
+ this.observers.forEach((r) => {
651
+ r.onQueryUpdate(t);
652
+ }), this.cache.notify({
653
+ query: this,
654
+ type: "updated",
655
+ action: t
656
+ });
657
+ });
658
+ }
659
+ }
660
+ function Lt(e) {
661
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = typeof t < "u", r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
662
+ return {
663
+ data: t,
664
+ dataUpdateCount: 0,
665
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
666
+ error: null,
667
+ errorUpdateCount: 0,
668
+ errorUpdatedAt: 0,
669
+ fetchFailureCount: 0,
670
+ fetchFailureReason: null,
671
+ fetchMeta: null,
672
+ isInvalidated: !1,
673
+ status: s ? "success" : "loading",
674
+ fetchStatus: "idle"
675
+ };
676
+ }
677
+ class Dt extends V {
678
+ constructor(t) {
679
+ super(), this.config = t || {}, this.queries = [], this.queriesMap = {};
680
+ }
681
+ build(t, s, r) {
682
+ var i;
683
+ const a = s.queryKey, o = (i = s.queryHash) != null ? i : we(a, s);
684
+ let l = this.get(o);
685
+ return l || (l = new Mt({
686
+ cache: this,
687
+ logger: t.getLogger(),
688
+ queryKey: a,
689
+ queryHash: o,
690
+ options: t.defaultQueryOptions(s),
691
+ state: r,
692
+ defaultOptions: t.getQueryDefaults(a)
693
+ }), this.add(l)), l;
694
+ }
695
+ add(t) {
696
+ this.queriesMap[t.queryHash] || (this.queriesMap[t.queryHash] = t, this.queries.push(t), this.notify({
697
+ type: "added",
698
+ query: t
699
+ }));
700
+ }
701
+ remove(t) {
702
+ const s = this.queriesMap[t.queryHash];
703
+ s && (t.destroy(), this.queries = this.queries.filter((r) => r !== t), s === t && delete this.queriesMap[t.queryHash], this.notify({
704
+ type: "removed",
705
+ query: t
706
+ }));
707
+ }
708
+ clear() {
709
+ A.batch(() => {
710
+ this.queries.forEach((t) => {
711
+ this.remove(t);
712
+ });
713
+ });
714
+ }
715
+ get(t) {
716
+ return this.queriesMap[t];
717
+ }
718
+ getAll() {
719
+ return this.queries;
720
+ }
721
+ find(t, s) {
722
+ const [r] = T(t, s);
723
+ return typeof r.exact > "u" && (r.exact = !0), this.queries.find((i) => Re(r, i));
724
+ }
725
+ findAll(t, s) {
726
+ const [r] = T(t, s);
727
+ return Object.keys(r).length > 0 ? this.queries.filter((i) => Re(r, i)) : this.queries;
728
+ }
729
+ notify(t) {
730
+ A.batch(() => {
731
+ this.listeners.forEach(({
732
+ listener: s
733
+ }) => {
734
+ s(t);
735
+ });
736
+ });
737
+ }
738
+ onFocus() {
739
+ A.batch(() => {
740
+ this.queries.forEach((t) => {
741
+ t.onFocus();
742
+ });
743
+ });
744
+ }
745
+ onOnline() {
746
+ A.batch(() => {
747
+ this.queries.forEach((t) => {
748
+ t.onOnline();
749
+ });
750
+ });
751
+ }
752
+ }
753
+ class Tt extends ze {
754
+ constructor(t) {
755
+ super(), this.defaultOptions = t.defaultOptions, this.mutationId = t.mutationId, this.mutationCache = t.mutationCache, this.logger = t.logger || je, this.observers = [], this.state = t.state || Ye(), this.setOptions(t.options), this.scheduleGc();
756
+ }
757
+ setOptions(t) {
758
+ this.options = {
759
+ ...this.defaultOptions,
760
+ ...t
761
+ }, this.updateCacheTime(this.options.cacheTime);
762
+ }
763
+ get meta() {
764
+ return this.options.meta;
765
+ }
766
+ setState(t) {
767
+ this.dispatch({
768
+ type: "setState",
769
+ state: t
770
+ });
771
+ }
772
+ addObserver(t) {
773
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.mutationCache.notify({
774
+ type: "observerAdded",
775
+ mutation: this,
776
+ observer: t
777
+ }));
778
+ }
779
+ removeObserver(t) {
780
+ this.observers = this.observers.filter((s) => s !== t), this.scheduleGc(), this.mutationCache.notify({
781
+ type: "observerRemoved",
782
+ mutation: this,
783
+ observer: t
784
+ });
785
+ }
786
+ optionalRemove() {
787
+ this.observers.length || (this.state.status === "loading" ? this.scheduleGc() : this.mutationCache.remove(this));
788
+ }
789
+ continue() {
790
+ var t, s;
791
+ return (t = (s = this.retryer) == null ? void 0 : s.continue()) != null ? t : this.execute();
792
+ }
793
+ async execute() {
794
+ const t = () => {
795
+ var j;
796
+ return this.retryer = Ze({
797
+ fn: () => this.options.mutationFn ? this.options.mutationFn(this.state.variables) : Promise.reject("No mutationFn found"),
798
+ onFail: (b, k) => {
799
+ this.dispatch({
800
+ type: "failed",
801
+ failureCount: b,
802
+ error: k
803
+ });
804
+ },
805
+ onPause: () => {
806
+ this.dispatch({
807
+ type: "pause"
808
+ });
809
+ },
810
+ onContinue: () => {
811
+ this.dispatch({
812
+ type: "continue"
813
+ });
814
+ },
815
+ retry: (j = this.options.retry) != null ? j : 0,
816
+ retryDelay: this.options.retryDelay,
817
+ networkMode: this.options.networkMode
818
+ }), this.retryer.promise;
819
+ }, s = this.state.status === "loading";
820
+ try {
821
+ var r, i, a, o, l, c, h, u;
822
+ if (!s) {
823
+ var p, v, f, y;
824
+ this.dispatch({
825
+ type: "loading",
826
+ variables: this.options.variables
827
+ }), await ((p = (v = this.mutationCache.config).onMutate) == null ? void 0 : p.call(v, this.state.variables, this));
828
+ const b = await ((f = (y = this.options).onMutate) == null ? void 0 : f.call(y, this.state.variables));
829
+ b !== this.state.context && this.dispatch({
830
+ type: "loading",
831
+ context: b,
832
+ variables: this.state.variables
833
+ });
834
+ }
835
+ const j = await t();
836
+ return await ((r = (i = this.mutationCache.config).onSuccess) == null ? void 0 : r.call(i, j, this.state.variables, this.state.context, this)), await ((a = (o = this.options).onSuccess) == null ? void 0 : a.call(o, j, this.state.variables, this.state.context)), await ((l = (c = this.mutationCache.config).onSettled) == null ? void 0 : l.call(c, j, null, this.state.variables, this.state.context, this)), await ((h = (u = this.options).onSettled) == null ? void 0 : h.call(u, j, null, this.state.variables, this.state.context)), this.dispatch({
837
+ type: "success",
838
+ data: j
839
+ }), j;
840
+ } catch (j) {
841
+ try {
842
+ var x, m, C, _, w, R, N, S;
843
+ throw await ((x = (m = this.mutationCache.config).onError) == null ? void 0 : x.call(m, j, this.state.variables, this.state.context, this)), await ((C = (_ = this.options).onError) == null ? void 0 : C.call(_, j, this.state.variables, this.state.context)), await ((w = (R = this.mutationCache.config).onSettled) == null ? void 0 : w.call(R, void 0, j, this.state.variables, this.state.context, this)), await ((N = (S = this.options).onSettled) == null ? void 0 : N.call(S, void 0, j, this.state.variables, this.state.context)), j;
844
+ } finally {
845
+ this.dispatch({
846
+ type: "error",
847
+ error: j
848
+ });
849
+ }
850
+ }
851
+ }
852
+ dispatch(t) {
853
+ const s = (r) => {
854
+ switch (t.type) {
855
+ case "failed":
856
+ return {
857
+ ...r,
858
+ failureCount: t.failureCount,
859
+ failureReason: t.error
860
+ };
861
+ case "pause":
862
+ return {
863
+ ...r,
864
+ isPaused: !0
865
+ };
866
+ case "continue":
867
+ return {
868
+ ...r,
869
+ isPaused: !1
870
+ };
871
+ case "loading":
872
+ return {
873
+ ...r,
874
+ context: t.context,
875
+ data: void 0,
876
+ failureCount: 0,
877
+ failureReason: null,
878
+ error: null,
879
+ isPaused: !ue(this.options.networkMode),
880
+ status: "loading",
881
+ variables: t.variables
882
+ };
883
+ case "success":
884
+ return {
885
+ ...r,
886
+ data: t.data,
887
+ failureCount: 0,
888
+ failureReason: null,
889
+ error: null,
890
+ status: "success",
891
+ isPaused: !1
892
+ };
893
+ case "error":
894
+ return {
895
+ ...r,
896
+ data: void 0,
897
+ error: t.error,
898
+ failureCount: r.failureCount + 1,
899
+ failureReason: t.error,
900
+ isPaused: !1,
901
+ status: "error"
902
+ };
903
+ case "setState":
904
+ return {
905
+ ...r,
906
+ ...t.state
907
+ };
908
+ }
909
+ };
910
+ this.state = s(this.state), A.batch(() => {
911
+ this.observers.forEach((r) => {
912
+ r.onMutationUpdate(t);
913
+ }), this.mutationCache.notify({
914
+ mutation: this,
915
+ type: "updated",
916
+ action: t
917
+ });
918
+ });
919
+ }
920
+ }
921
+ function Ye() {
922
+ return {
923
+ context: void 0,
924
+ data: void 0,
925
+ error: null,
926
+ failureCount: 0,
927
+ failureReason: null,
928
+ isPaused: !1,
929
+ status: "idle",
930
+ variables: void 0
931
+ };
932
+ }
933
+ class Ut extends V {
934
+ constructor(t) {
935
+ super(), this.config = t || {}, this.mutations = [], this.mutationId = 0;
936
+ }
937
+ build(t, s, r) {
938
+ const i = new Tt({
939
+ mutationCache: this,
940
+ logger: t.getLogger(),
941
+ mutationId: ++this.mutationId,
942
+ options: t.defaultMutationOptions(s),
943
+ state: r,
944
+ defaultOptions: s.mutationKey ? t.getMutationDefaults(s.mutationKey) : void 0
945
+ });
946
+ return this.add(i), i;
947
+ }
948
+ add(t) {
949
+ this.mutations.push(t), this.notify({
950
+ type: "added",
951
+ mutation: t
952
+ });
953
+ }
954
+ remove(t) {
955
+ this.mutations = this.mutations.filter((s) => s !== t), this.notify({
956
+ type: "removed",
957
+ mutation: t
958
+ });
959
+ }
960
+ clear() {
961
+ A.batch(() => {
962
+ this.mutations.forEach((t) => {
963
+ this.remove(t);
964
+ });
965
+ });
966
+ }
967
+ getAll() {
968
+ return this.mutations;
969
+ }
970
+ find(t) {
971
+ return typeof t.exact > "u" && (t.exact = !0), this.mutations.find((s) => Ae(t, s));
972
+ }
973
+ findAll(t) {
974
+ return this.mutations.filter((s) => Ae(t, s));
975
+ }
976
+ notify(t) {
977
+ A.batch(() => {
978
+ this.listeners.forEach(({
979
+ listener: s
980
+ }) => {
981
+ s(t);
982
+ });
983
+ });
984
+ }
985
+ resumePausedMutations() {
986
+ var t;
987
+ return this.resuming = ((t = this.resuming) != null ? t : Promise.resolve()).then(() => {
988
+ const s = this.mutations.filter((r) => r.state.isPaused);
989
+ return A.batch(() => s.reduce((r, i) => r.then(() => i.continue().catch(M)), Promise.resolve()));
990
+ }).then(() => {
991
+ this.resuming = void 0;
992
+ }), this.resuming;
993
+ }
994
+ }
995
+ function Qt() {
996
+ return {
997
+ onFetch: (e) => {
998
+ e.fetchFn = () => {
999
+ var t, s, r, i, a, o;
1000
+ const l = (t = e.fetchOptions) == null || (s = t.meta) == null ? void 0 : s.refetchPage, c = (r = e.fetchOptions) == null || (i = r.meta) == null ? void 0 : i.fetchMore, h = c == null ? void 0 : c.pageParam, u = (c == null ? void 0 : c.direction) === "forward", p = (c == null ? void 0 : c.direction) === "backward", v = ((a = e.state.data) == null ? void 0 : a.pages) || [], f = ((o = e.state.data) == null ? void 0 : o.pageParams) || [];
1001
+ let y = f, x = !1;
1002
+ const m = (S) => {
1003
+ Object.defineProperty(S, "signal", {
1004
+ enumerable: !0,
1005
+ get: () => {
1006
+ var j;
1007
+ if ((j = e.signal) != null && j.aborted)
1008
+ x = !0;
1009
+ else {
1010
+ var b;
1011
+ (b = e.signal) == null || b.addEventListener("abort", () => {
1012
+ x = !0;
1013
+ });
1014
+ }
1015
+ return e.signal;
1016
+ }
1017
+ });
1018
+ }, C = e.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + e.options.queryHash + "'")), _ = (S, j, b, k) => (y = k ? [j, ...y] : [...y, j], k ? [b, ...S] : [...S, b]), w = (S, j, b, k) => {
1019
+ if (x)
1020
+ return Promise.reject("Cancelled");
1021
+ if (typeof b > "u" && !j && S.length)
1022
+ return Promise.resolve(S);
1023
+ const Y = {
1024
+ queryKey: e.queryKey,
1025
+ pageParam: b,
1026
+ meta: e.options.meta
1027
+ };
1028
+ m(Y);
1029
+ const de = C(Y);
1030
+ return Promise.resolve(de).then((jt) => _(S, b, jt, k));
1031
+ };
1032
+ let R;
1033
+ if (!v.length)
1034
+ R = w([]);
1035
+ else if (u) {
1036
+ const S = typeof h < "u", j = S ? h : Me(e.options, v);
1037
+ R = w(v, S, j);
1038
+ } else if (p) {
1039
+ const S = typeof h < "u", j = S ? h : qt(e.options, v);
1040
+ R = w(v, S, j, !0);
1041
+ } else {
1042
+ y = [];
1043
+ const S = typeof e.options.getNextPageParam > "u";
1044
+ R = (l && v[0] ? l(v[0], 0, v) : !0) ? w([], S, f[0]) : Promise.resolve(_([], f[0], v[0]));
1045
+ for (let b = 1; b < v.length; b++)
1046
+ R = R.then((k) => {
1047
+ if (l && v[b] ? l(v[b], b, v) : !0) {
1048
+ const de = S ? f[b] : Me(e.options, k);
1049
+ return w(k, S, de);
1050
+ }
1051
+ return Promise.resolve(_(k, f[b], v[b]));
1052
+ });
1053
+ }
1054
+ return R.then((S) => ({
1055
+ pages: S,
1056
+ pageParams: y
1057
+ }));
1058
+ };
1059
+ }
1060
+ };
1061
+ }
1062
+ function Me(e, t) {
1063
+ return e.getNextPageParam == null ? void 0 : e.getNextPageParam(t[t.length - 1], t);
1064
+ }
1065
+ function qt(e, t) {
1066
+ return e.getPreviousPageParam == null ? void 0 : e.getPreviousPageParam(t[0], t);
1067
+ }
1068
+ class Je {
1069
+ constructor(t = {}) {
1070
+ this.queryCache = t.queryCache || new Dt(), this.mutationCache = t.mutationCache || new Ut(), this.logger = t.logger || je, this.defaultOptions = t.defaultOptions || {}, this.queryDefaults = [], this.mutationDefaults = [], this.mountCount = 0;
1071
+ }
1072
+ mount() {
1073
+ this.mountCount++, this.mountCount === 1 && (this.unsubscribeFocus = ne.subscribe(() => {
1074
+ ne.isFocused() && (this.resumePausedMutations(), this.queryCache.onFocus());
1075
+ }), this.unsubscribeOnline = ie.subscribe(() => {
1076
+ ie.isOnline() && (this.resumePausedMutations(), this.queryCache.onOnline());
1077
+ }));
1078
+ }
1079
+ unmount() {
1080
+ var t, s;
1081
+ this.mountCount--, this.mountCount === 0 && ((t = this.unsubscribeFocus) == null || t.call(this), this.unsubscribeFocus = void 0, (s = this.unsubscribeOnline) == null || s.call(this), this.unsubscribeOnline = void 0);
1082
+ }
1083
+ isFetching(t, s) {
1084
+ const [r] = T(t, s);
1085
+ return r.fetchStatus = "fetching", this.queryCache.findAll(r).length;
1086
+ }
1087
+ isMutating(t) {
1088
+ return this.mutationCache.findAll({
1089
+ ...t,
1090
+ fetching: !0
1091
+ }).length;
1092
+ }
1093
+ getQueryData(t, s) {
1094
+ var r;
1095
+ return (r = this.queryCache.find(t, s)) == null ? void 0 : r.state.data;
1096
+ }
1097
+ ensureQueryData(t, s, r) {
1098
+ const i = J(t, s, r), a = this.getQueryData(i.queryKey);
1099
+ return a ? Promise.resolve(a) : this.fetchQuery(i);
1100
+ }
1101
+ getQueriesData(t) {
1102
+ return this.getQueryCache().findAll(t).map(({
1103
+ queryKey: s,
1104
+ state: r
1105
+ }) => {
1106
+ const i = r.data;
1107
+ return [s, i];
1108
+ });
1109
+ }
1110
+ setQueryData(t, s, r) {
1111
+ const i = this.queryCache.find(t), a = i == null ? void 0 : i.state.data, o = Pt(s, a);
1112
+ if (typeof o > "u")
1113
+ return;
1114
+ const l = J(t), c = this.defaultQueryOptions(l);
1115
+ return this.queryCache.build(this, c).setData(o, {
1116
+ ...r,
1117
+ manual: !0
1118
+ });
1119
+ }
1120
+ setQueriesData(t, s, r) {
1121
+ return A.batch(() => this.getQueryCache().findAll(t).map(({
1122
+ queryKey: i
1123
+ }) => [i, this.setQueryData(i, s, r)]));
1124
+ }
1125
+ getQueryState(t, s) {
1126
+ var r;
1127
+ return (r = this.queryCache.find(t, s)) == null ? void 0 : r.state;
1128
+ }
1129
+ removeQueries(t, s) {
1130
+ const [r] = T(t, s), i = this.queryCache;
1131
+ A.batch(() => {
1132
+ i.findAll(r).forEach((a) => {
1133
+ i.remove(a);
1134
+ });
1135
+ });
1136
+ }
1137
+ resetQueries(t, s, r) {
1138
+ const [i, a] = T(t, s, r), o = this.queryCache, l = {
1139
+ type: "active",
1140
+ ...i
1141
+ };
1142
+ return A.batch(() => (o.findAll(i).forEach((c) => {
1143
+ c.reset();
1144
+ }), this.refetchQueries(l, a)));
1145
+ }
1146
+ cancelQueries(t, s, r) {
1147
+ const [i, a = {}] = T(t, s, r);
1148
+ typeof a.revert > "u" && (a.revert = !0);
1149
+ const o = A.batch(() => this.queryCache.findAll(i).map((l) => l.cancel(a)));
1150
+ return Promise.all(o).then(M).catch(M);
1151
+ }
1152
+ invalidateQueries(t, s, r) {
1153
+ const [i, a] = T(t, s, r);
1154
+ return A.batch(() => {
1155
+ var o, l;
1156
+ if (this.queryCache.findAll(i).forEach((h) => {
1157
+ h.invalidate();
1158
+ }), i.refetchType === "none")
1159
+ return Promise.resolve();
1160
+ const c = {
1161
+ ...i,
1162
+ type: (o = (l = i.refetchType) != null ? l : i.type) != null ? o : "active"
1163
+ };
1164
+ return this.refetchQueries(c, a);
1165
+ });
1166
+ }
1167
+ refetchQueries(t, s, r) {
1168
+ const [i, a] = T(t, s, r), o = A.batch(() => this.queryCache.findAll(i).filter((c) => !c.isDisabled()).map((c) => {
1169
+ var h;
1170
+ return c.fetch(void 0, {
1171
+ ...a,
1172
+ cancelRefetch: (h = a == null ? void 0 : a.cancelRefetch) != null ? h : !0,
1173
+ meta: {
1174
+ refetchPage: i.refetchPage
1175
+ }
1176
+ });
1177
+ }));
1178
+ let l = Promise.all(o).then(M);
1179
+ return a != null && a.throwOnError || (l = l.catch(M)), l;
1180
+ }
1181
+ fetchQuery(t, s, r) {
1182
+ const i = J(t, s, r), a = this.defaultQueryOptions(i);
1183
+ typeof a.retry > "u" && (a.retry = !1);
1184
+ const o = this.queryCache.build(this, a);
1185
+ return o.isStaleByTime(a.staleTime) ? o.fetch(a) : Promise.resolve(o.state.data);
1186
+ }
1187
+ prefetchQuery(t, s, r) {
1188
+ return this.fetchQuery(t, s, r).then(M).catch(M);
1189
+ }
1190
+ fetchInfiniteQuery(t, s, r) {
1191
+ const i = J(t, s, r);
1192
+ return i.behavior = Qt(), this.fetchQuery(i);
1193
+ }
1194
+ prefetchInfiniteQuery(t, s, r) {
1195
+ return this.fetchInfiniteQuery(t, s, r).then(M).catch(M);
1196
+ }
1197
+ resumePausedMutations() {
1198
+ return this.mutationCache.resumePausedMutations();
1199
+ }
1200
+ getQueryCache() {
1201
+ return this.queryCache;
1202
+ }
1203
+ getMutationCache() {
1204
+ return this.mutationCache;
1205
+ }
1206
+ getLogger() {
1207
+ return this.logger;
1208
+ }
1209
+ getDefaultOptions() {
1210
+ return this.defaultOptions;
1211
+ }
1212
+ setDefaultOptions(t) {
1213
+ this.defaultOptions = t;
1214
+ }
1215
+ setQueryDefaults(t, s) {
1216
+ const r = this.queryDefaults.find((i) => U(t) === U(i.queryKey));
1217
+ r ? r.defaultOptions = s : this.queryDefaults.push({
1218
+ queryKey: t,
1219
+ defaultOptions: s
1220
+ });
1221
+ }
1222
+ getQueryDefaults(t) {
1223
+ if (!t)
1224
+ return;
1225
+ const s = this.queryDefaults.find((r) => se(t, r.queryKey));
1226
+ return s == null ? void 0 : s.defaultOptions;
1227
+ }
1228
+ setMutationDefaults(t, s) {
1229
+ const r = this.mutationDefaults.find((i) => U(t) === U(i.mutationKey));
1230
+ r ? r.defaultOptions = s : this.mutationDefaults.push({
1231
+ mutationKey: t,
1232
+ defaultOptions: s
1233
+ });
1234
+ }
1235
+ getMutationDefaults(t) {
1236
+ if (!t)
1237
+ return;
1238
+ const s = this.mutationDefaults.find((r) => se(t, r.mutationKey));
1239
+ return s == null ? void 0 : s.defaultOptions;
1240
+ }
1241
+ defaultQueryOptions(t) {
1242
+ if (t != null && t._defaulted)
1243
+ return t;
1244
+ const s = {
1245
+ ...this.defaultOptions.queries,
1246
+ ...this.getQueryDefaults(t == null ? void 0 : t.queryKey),
1247
+ ...t,
1248
+ _defaulted: !0
1249
+ };
1250
+ return !s.queryHash && s.queryKey && (s.queryHash = we(s.queryKey, s)), typeof s.refetchOnReconnect > "u" && (s.refetchOnReconnect = s.networkMode !== "always"), typeof s.useErrorBoundary > "u" && (s.useErrorBoundary = !!s.suspense), s;
1251
+ }
1252
+ defaultMutationOptions(t) {
1253
+ return t != null && t._defaulted ? t : {
1254
+ ...this.defaultOptions.mutations,
1255
+ ...this.getMutationDefaults(t == null ? void 0 : t.mutationKey),
1256
+ ...t,
1257
+ _defaulted: !0
1258
+ };
1259
+ }
1260
+ clear() {
1261
+ this.queryCache.clear(), this.mutationCache.clear();
1262
+ }
1263
+ }
1264
+ class Kt extends V {
1265
+ constructor(t, s) {
1266
+ super(), this.client = t, this.options = s, this.trackedProps = /* @__PURE__ */ new Set(), this.selectError = null, this.bindMethods(), this.setOptions(s);
1267
+ }
1268
+ bindMethods() {
1269
+ this.remove = this.remove.bind(this), this.refetch = this.refetch.bind(this);
1270
+ }
1271
+ onSubscribe() {
1272
+ this.listeners.size === 1 && (this.currentQuery.addObserver(this), Le(this.currentQuery, this.options) && this.executeFetch(), this.updateTimers());
1273
+ }
1274
+ onUnsubscribe() {
1275
+ this.hasListeners() || this.destroy();
1276
+ }
1277
+ shouldFetchOnReconnect() {
1278
+ return me(this.currentQuery, this.options, this.options.refetchOnReconnect);
1279
+ }
1280
+ shouldFetchOnWindowFocus() {
1281
+ return me(this.currentQuery, this.options, this.options.refetchOnWindowFocus);
1282
+ }
1283
+ destroy() {
1284
+ this.listeners = /* @__PURE__ */ new Set(), this.clearStaleTimeout(), this.clearRefetchInterval(), this.currentQuery.removeObserver(this);
1285
+ }
1286
+ setOptions(t, s) {
1287
+ const r = this.options, i = this.currentQuery;
1288
+ if (this.options = this.client.defaultQueryOptions(t), re(r, this.options) || this.client.getQueryCache().notify({
1289
+ type: "observerOptionsUpdated",
1290
+ query: this.currentQuery,
1291
+ observer: this
1292
+ }), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
1293
+ throw new Error("Expected enabled to be a boolean");
1294
+ this.options.queryKey || (this.options.queryKey = r.queryKey), this.updateQuery();
1295
+ const a = this.hasListeners();
1296
+ a && De(this.currentQuery, i, this.options, r) && this.executeFetch(), this.updateResult(s), a && (this.currentQuery !== i || this.options.enabled !== r.enabled || this.options.staleTime !== r.staleTime) && this.updateStaleTimeout();
1297
+ const o = this.computeRefetchInterval();
1298
+ a && (this.currentQuery !== i || this.options.enabled !== r.enabled || o !== this.currentRefetchInterval) && this.updateRefetchInterval(o);
1299
+ }
1300
+ getOptimisticResult(t) {
1301
+ const s = this.client.getQueryCache().build(this.client, t), r = this.createResult(s, t);
1302
+ return Gt(this, r, t) && (this.currentResult = r, this.currentResultOptions = this.options, this.currentResultState = this.currentQuery.state), r;
1303
+ }
1304
+ getCurrentResult() {
1305
+ return this.currentResult;
1306
+ }
1307
+ trackResult(t) {
1308
+ const s = {};
1309
+ return Object.keys(t).forEach((r) => {
1310
+ Object.defineProperty(s, r, {
1311
+ configurable: !1,
1312
+ enumerable: !0,
1313
+ get: () => (this.trackedProps.add(r), t[r])
1314
+ });
1315
+ }), s;
1316
+ }
1317
+ getCurrentQuery() {
1318
+ return this.currentQuery;
1319
+ }
1320
+ remove() {
1321
+ this.client.getQueryCache().remove(this.currentQuery);
1322
+ }
1323
+ refetch({
1324
+ refetchPage: t,
1325
+ ...s
1326
+ } = {}) {
1327
+ return this.fetch({
1328
+ ...s,
1329
+ meta: {
1330
+ refetchPage: t
1331
+ }
1332
+ });
1333
+ }
1334
+ fetchOptimistic(t) {
1335
+ const s = this.client.defaultQueryOptions(t), r = this.client.getQueryCache().build(this.client, s);
1336
+ return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, s));
1337
+ }
1338
+ fetch(t) {
1339
+ var s;
1340
+ return this.executeFetch({
1341
+ ...t,
1342
+ cancelRefetch: (s = t.cancelRefetch) != null ? s : !0
1343
+ }).then(() => (this.updateResult(), this.currentResult));
1344
+ }
1345
+ executeFetch(t) {
1346
+ this.updateQuery();
1347
+ let s = this.currentQuery.fetch(this.options, t);
1348
+ return t != null && t.throwOnError || (s = s.catch(M)), s;
1349
+ }
1350
+ updateStaleTimeout() {
1351
+ if (this.clearStaleTimeout(), X || this.currentResult.isStale || !fe(this.options.staleTime))
1352
+ return;
1353
+ const s = He(this.currentResult.dataUpdatedAt, this.options.staleTime) + 1;
1354
+ this.staleTimeoutId = setTimeout(() => {
1355
+ this.currentResult.isStale || this.updateResult();
1356
+ }, s);
1357
+ }
1358
+ computeRefetchInterval() {
1359
+ var t;
1360
+ return typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (t = this.options.refetchInterval) != null ? t : !1;
1361
+ }
1362
+ updateRefetchInterval(t) {
1363
+ this.clearRefetchInterval(), this.currentRefetchInterval = t, !(X || this.options.enabled === !1 || !fe(this.currentRefetchInterval) || this.currentRefetchInterval === 0) && (this.refetchIntervalId = setInterval(() => {
1364
+ (this.options.refetchIntervalInBackground || ne.isFocused()) && this.executeFetch();
1365
+ }, this.currentRefetchInterval));
1366
+ }
1367
+ updateTimers() {
1368
+ this.updateStaleTimeout(), this.updateRefetchInterval(this.computeRefetchInterval());
1369
+ }
1370
+ clearStaleTimeout() {
1371
+ this.staleTimeoutId && (clearTimeout(this.staleTimeoutId), this.staleTimeoutId = void 0);
1372
+ }
1373
+ clearRefetchInterval() {
1374
+ this.refetchIntervalId && (clearInterval(this.refetchIntervalId), this.refetchIntervalId = void 0);
1375
+ }
1376
+ createResult(t, s) {
1377
+ const r = this.currentQuery, i = this.options, a = this.currentResult, o = this.currentResultState, l = this.currentResultOptions, c = t !== r, h = c ? t.state : this.currentQueryInitialState, u = c ? this.currentResult : this.previousQueryResult, {
1378
+ state: p
1379
+ } = t;
1380
+ let {
1381
+ dataUpdatedAt: v,
1382
+ error: f,
1383
+ errorUpdatedAt: y,
1384
+ fetchStatus: x,
1385
+ status: m
1386
+ } = p, C = !1, _ = !1, w;
1387
+ if (s._optimisticResults) {
1388
+ const b = this.hasListeners(), k = !b && Le(t, s), Y = b && De(t, r, s, i);
1389
+ (k || Y) && (x = ue(t.options.networkMode) ? "fetching" : "paused", v || (m = "loading")), s._optimisticResults === "isRestoring" && (x = "idle");
1390
+ }
1391
+ if (s.keepPreviousData && !p.dataUpdatedAt && u != null && u.isSuccess && m !== "error")
1392
+ w = u.data, v = u.dataUpdatedAt, m = u.status, C = !0;
1393
+ else if (s.select && typeof p.data < "u")
1394
+ if (a && p.data === (o == null ? void 0 : o.data) && s.select === this.selectFn)
1395
+ w = this.selectResult;
1396
+ else
1397
+ try {
1398
+ this.selectFn = s.select, w = s.select(p.data), w = ve(a == null ? void 0 : a.data, w, s), this.selectResult = w, this.selectError = null;
1399
+ } catch (b) {
1400
+ this.selectError = b;
1401
+ }
1402
+ else
1403
+ w = p.data;
1404
+ if (typeof s.placeholderData < "u" && typeof w > "u" && m === "loading") {
1405
+ let b;
1406
+ if (a != null && a.isPlaceholderData && s.placeholderData === (l == null ? void 0 : l.placeholderData))
1407
+ b = a.data;
1408
+ else if (b = typeof s.placeholderData == "function" ? s.placeholderData() : s.placeholderData, s.select && typeof b < "u")
1409
+ try {
1410
+ b = s.select(b), this.selectError = null;
1411
+ } catch (k) {
1412
+ this.selectError = k;
1413
+ }
1414
+ typeof b < "u" && (m = "success", w = ve(a == null ? void 0 : a.data, b, s), _ = !0);
1415
+ }
1416
+ this.selectError && (f = this.selectError, w = this.selectResult, y = Date.now(), m = "error");
1417
+ const R = x === "fetching", N = m === "loading", S = m === "error";
1418
+ return {
1419
+ status: m,
1420
+ fetchStatus: x,
1421
+ isLoading: N,
1422
+ isSuccess: m === "success",
1423
+ isError: S,
1424
+ isInitialLoading: N && R,
1425
+ data: w,
1426
+ dataUpdatedAt: v,
1427
+ error: f,
1428
+ errorUpdatedAt: y,
1429
+ failureCount: p.fetchFailureCount,
1430
+ failureReason: p.fetchFailureReason,
1431
+ errorUpdateCount: p.errorUpdateCount,
1432
+ isFetched: p.dataUpdateCount > 0 || p.errorUpdateCount > 0,
1433
+ isFetchedAfterMount: p.dataUpdateCount > h.dataUpdateCount || p.errorUpdateCount > h.errorUpdateCount,
1434
+ isFetching: R,
1435
+ isRefetching: R && !N,
1436
+ isLoadingError: S && p.dataUpdatedAt === 0,
1437
+ isPaused: x === "paused",
1438
+ isPlaceholderData: _,
1439
+ isPreviousData: C,
1440
+ isRefetchError: S && p.dataUpdatedAt !== 0,
1441
+ isStale: _e(t, s),
1442
+ refetch: this.refetch,
1443
+ remove: this.remove
1444
+ };
1445
+ }
1446
+ updateResult(t) {
1447
+ const s = this.currentResult, r = this.createResult(this.currentQuery, this.options);
1448
+ if (this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options, re(r, s))
1449
+ return;
1450
+ this.currentResult = r;
1451
+ const i = {
1452
+ cache: !0
1453
+ }, a = () => {
1454
+ if (!s)
1455
+ return !0;
1456
+ const {
1457
+ notifyOnChangeProps: o
1458
+ } = this.options, l = typeof o == "function" ? o() : o;
1459
+ if (l === "all" || !l && !this.trackedProps.size)
1460
+ return !0;
1461
+ const c = new Set(l ?? this.trackedProps);
1462
+ return this.options.useErrorBoundary && c.add("error"), Object.keys(this.currentResult).some((h) => {
1463
+ const u = h;
1464
+ return this.currentResult[u] !== s[u] && c.has(u);
1465
+ });
1466
+ };
1467
+ (t == null ? void 0 : t.listeners) !== !1 && a() && (i.listeners = !0), this.notify({
1468
+ ...i,
1469
+ ...t
1470
+ });
1471
+ }
1472
+ updateQuery() {
1473
+ const t = this.client.getQueryCache().build(this.client, this.options);
1474
+ if (t === this.currentQuery)
1475
+ return;
1476
+ const s = this.currentQuery;
1477
+ this.currentQuery = t, this.currentQueryInitialState = t.state, this.previousQueryResult = this.currentResult, this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1478
+ }
1479
+ onQueryUpdate(t) {
1480
+ const s = {};
1481
+ t.type === "success" ? s.onSuccess = !t.manual : t.type === "error" && !te(t.error) && (s.onError = !0), this.updateResult(s), this.hasListeners() && this.updateTimers();
1482
+ }
1483
+ notify(t) {
1484
+ A.batch(() => {
1485
+ if (t.onSuccess) {
1486
+ var s, r, i, a;
1487
+ (s = (r = this.options).onSuccess) == null || s.call(r, this.currentResult.data), (i = (a = this.options).onSettled) == null || i.call(a, this.currentResult.data, null);
1488
+ } else if (t.onError) {
1489
+ var o, l, c, h;
1490
+ (o = (l = this.options).onError) == null || o.call(l, this.currentResult.error), (c = (h = this.options).onSettled) == null || c.call(h, void 0, this.currentResult.error);
1491
+ }
1492
+ t.listeners && this.listeners.forEach(({
1493
+ listener: u
1494
+ }) => {
1495
+ u(this.currentResult);
1496
+ }), t.cache && this.client.getQueryCache().notify({
1497
+ query: this.currentQuery,
1498
+ type: "observerResultsUpdated"
1499
+ });
1500
+ });
1501
+ }
1502
+ }
1503
+ function Ht(e, t) {
1504
+ return t.enabled !== !1 && !e.state.dataUpdatedAt && !(e.state.status === "error" && t.retryOnMount === !1);
1505
+ }
1506
+ function Le(e, t) {
1507
+ return Ht(e, t) || e.state.dataUpdatedAt > 0 && me(e, t, t.refetchOnMount);
1508
+ }
1509
+ function me(e, t, s) {
1510
+ if (t.enabled !== !1) {
1511
+ const r = typeof s == "function" ? s(e) : s;
1512
+ return r === "always" || r !== !1 && _e(e, t);
1513
+ }
1514
+ return !1;
1515
+ }
1516
+ function De(e, t, s, r) {
1517
+ return s.enabled !== !1 && (e !== t || r.enabled === !1) && (!s.suspense || e.state.status !== "error") && _e(e, s);
1518
+ }
1519
+ function _e(e, t) {
1520
+ return e.isStaleByTime(t.staleTime);
1521
+ }
1522
+ function Gt(e, t, s) {
1523
+ return s.keepPreviousData ? !1 : s.placeholderData !== void 0 ? t.isPlaceholderData : !re(e.getCurrentResult(), t);
1524
+ }
1525
+ class Vt extends V {
1526
+ constructor(t, s) {
1527
+ super(), this.client = t, this.setOptions(s), this.bindMethods(), this.updateResult();
1528
+ }
1529
+ bindMethods() {
1530
+ this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
1531
+ }
1532
+ setOptions(t) {
1533
+ var s;
1534
+ const r = this.options;
1535
+ this.options = this.client.defaultMutationOptions(t), re(r, this.options) || this.client.getMutationCache().notify({
1536
+ type: "observerOptionsUpdated",
1537
+ mutation: this.currentMutation,
1538
+ observer: this
1539
+ }), (s = this.currentMutation) == null || s.setOptions(this.options);
1540
+ }
1541
+ onUnsubscribe() {
1542
+ if (!this.hasListeners()) {
1543
+ var t;
1544
+ (t = this.currentMutation) == null || t.removeObserver(this);
1545
+ }
1546
+ }
1547
+ onMutationUpdate(t) {
1548
+ this.updateResult();
1549
+ const s = {
1550
+ listeners: !0
1551
+ };
1552
+ t.type === "success" ? s.onSuccess = !0 : t.type === "error" && (s.onError = !0), this.notify(s);
1553
+ }
1554
+ getCurrentResult() {
1555
+ return this.currentResult;
1556
+ }
1557
+ reset() {
1558
+ this.currentMutation = void 0, this.updateResult(), this.notify({
1559
+ listeners: !0
1560
+ });
1561
+ }
1562
+ mutate(t, s) {
1563
+ return this.mutateOptions = s, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, {
1564
+ ...this.options,
1565
+ variables: typeof t < "u" ? t : this.options.variables
1566
+ }), this.currentMutation.addObserver(this), this.currentMutation.execute();
1567
+ }
1568
+ updateResult() {
1569
+ const t = this.currentMutation ? this.currentMutation.state : Ye(), s = {
1570
+ ...t,
1571
+ isLoading: t.status === "loading",
1572
+ isSuccess: t.status === "success",
1573
+ isError: t.status === "error",
1574
+ isIdle: t.status === "idle",
1575
+ mutate: this.mutate,
1576
+ reset: this.reset
1577
+ };
1578
+ this.currentResult = s;
1579
+ }
1580
+ notify(t) {
1581
+ A.batch(() => {
1582
+ if (this.mutateOptions && this.hasListeners()) {
1583
+ if (t.onSuccess) {
1584
+ var s, r, i, a;
1585
+ (s = (r = this.mutateOptions).onSuccess) == null || s.call(r, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (i = (a = this.mutateOptions).onSettled) == null || i.call(a, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
1586
+ } else if (t.onError) {
1587
+ var o, l, c, h;
1588
+ (o = (l = this.mutateOptions).onError) == null || o.call(l, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (c = (h = this.mutateOptions).onSettled) == null || c.call(h, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
1589
+ }
1590
+ }
1591
+ t.listeners && this.listeners.forEach(({
1592
+ listener: u
1593
+ }) => {
1594
+ u(this.currentResult);
1595
+ });
1596
+ });
1597
+ }
1598
+ }
1599
+ var Xe = { exports: {} }, Ie = {};
1600
+ /**
1601
+ * @license React
1602
+ * use-sync-external-store-shim.production.min.js
1603
+ *
1604
+ * Copyright (c) Facebook, Inc. and its affiliates.
1605
+ *
1606
+ * This source code is licensed under the MIT license found in the
1607
+ * LICENSE file in the root directory of this source tree.
1608
+ */
1609
+ var G = d;
1610
+ function $t(e, t) {
1611
+ return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
1612
+ }
1613
+ var Wt = typeof Object.is == "function" ? Object.is : $t, Zt = G.useState, zt = G.useEffect, Yt = G.useLayoutEffect, Jt = G.useDebugValue;
1614
+ function Xt(e, t) {
1615
+ var s = t(), r = Zt({ inst: { value: s, getSnapshot: t } }), i = r[0].inst, a = r[1];
1616
+ return Yt(function() {
1617
+ i.value = s, i.getSnapshot = t, he(i) && a({ inst: i });
1618
+ }, [e, s, t]), zt(function() {
1619
+ return he(i) && a({ inst: i }), e(function() {
1620
+ he(i) && a({ inst: i });
1621
+ });
1622
+ }, [e]), Jt(s), s;
1623
+ }
1624
+ function he(e) {
1625
+ var t = e.getSnapshot;
1626
+ e = e.value;
1627
+ try {
1628
+ var s = t();
1629
+ return !Wt(e, s);
1630
+ } catch {
1631
+ return !0;
1632
+ }
1633
+ }
1634
+ function It(e, t) {
1635
+ return t();
1636
+ }
1637
+ var Bt = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? It : Xt;
1638
+ Ie.useSyncExternalStore = G.useSyncExternalStore !== void 0 ? G.useSyncExternalStore : Bt;
1639
+ Xe.exports = Ie;
1640
+ var es = Xe.exports;
1641
+ const Be = es.useSyncExternalStore, Te = /* @__PURE__ */ d.createContext(void 0), et = /* @__PURE__ */ d.createContext(!1);
1642
+ function tt(e, t) {
1643
+ return e || (t && typeof window < "u" ? (window.ReactQueryClientContext || (window.ReactQueryClientContext = Te), window.ReactQueryClientContext) : Te);
1644
+ }
1645
+ const st = ({
1646
+ context: e
1647
+ } = {}) => {
1648
+ const t = d.useContext(tt(e, d.useContext(et)));
1649
+ if (!t)
1650
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1651
+ return t;
1652
+ }, ts = ({
1653
+ client: e,
1654
+ children: t,
1655
+ context: s,
1656
+ contextSharing: r = !1
1657
+ }) => {
1658
+ d.useEffect(() => (e.mount(), () => {
1659
+ e.unmount();
1660
+ }), [e]);
1661
+ const i = tt(s, r);
1662
+ return /* @__PURE__ */ d.createElement(et.Provider, {
1663
+ value: !s && r
1664
+ }, /* @__PURE__ */ d.createElement(i.Provider, {
1665
+ value: e
1666
+ }, t));
1667
+ }, rt = /* @__PURE__ */ d.createContext(!1), ss = () => d.useContext(rt);
1668
+ rt.Provider;
1669
+ function rs() {
1670
+ let e = !1;
1671
+ return {
1672
+ clearReset: () => {
1673
+ e = !1;
1674
+ },
1675
+ reset: () => {
1676
+ e = !0;
1677
+ },
1678
+ isReset: () => e
1679
+ };
1680
+ }
1681
+ const ns = /* @__PURE__ */ d.createContext(rs()), is = () => d.useContext(ns);
1682
+ function nt(e, t) {
1683
+ return typeof e == "function" ? e(...t) : !!e;
1684
+ }
1685
+ const as = (e, t) => {
1686
+ (e.suspense || e.useErrorBoundary) && (t.isReset() || (e.retryOnMount = !1));
1687
+ }, os = (e) => {
1688
+ d.useEffect(() => {
1689
+ e.clearReset();
1690
+ }, [e]);
1691
+ }, ls = ({
1692
+ result: e,
1693
+ errorResetBoundary: t,
1694
+ useErrorBoundary: s,
1695
+ query: r
1696
+ }) => e.isError && !t.isReset() && !e.isFetching && nt(s, [e.error, r]), cs = (e) => {
1697
+ e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
1698
+ }, us = (e, t) => e.isLoading && e.isFetching && !t, ds = (e, t, s) => (e == null ? void 0 : e.suspense) && us(t, s), hs = (e, t, s) => t.fetchOptimistic(e).then(({
1699
+ data: r
1700
+ }) => {
1701
+ e.onSuccess == null || e.onSuccess(r), e.onSettled == null || e.onSettled(r, null);
1702
+ }).catch((r) => {
1703
+ s.clearReset(), e.onError == null || e.onError(r), e.onSettled == null || e.onSettled(void 0, r);
1704
+ });
1705
+ function fs(e, t) {
1706
+ const s = st({
1707
+ context: e.context
1708
+ }), r = ss(), i = is(), a = s.defaultQueryOptions(e);
1709
+ a._optimisticResults = r ? "isRestoring" : "optimistic", a.onError && (a.onError = A.batchCalls(a.onError)), a.onSuccess && (a.onSuccess = A.batchCalls(a.onSuccess)), a.onSettled && (a.onSettled = A.batchCalls(a.onSettled)), cs(a), as(a, i), os(i);
1710
+ const [o] = d.useState(() => new t(s, a)), l = o.getOptimisticResult(a);
1711
+ if (Be(d.useCallback((c) => {
1712
+ const h = r ? () => {
1713
+ } : o.subscribe(A.batchCalls(c));
1714
+ return o.updateResult(), h;
1715
+ }, [o, r]), () => o.getCurrentResult(), () => o.getCurrentResult()), d.useEffect(() => {
1716
+ o.setOptions(a, {
1717
+ listeners: !1
1718
+ });
1719
+ }, [a, o]), ds(a, l, r))
1720
+ throw hs(a, o, i);
1721
+ if (ls({
1722
+ result: l,
1723
+ errorResetBoundary: i,
1724
+ useErrorBoundary: a.useErrorBoundary,
1725
+ query: o.getCurrentQuery()
1726
+ }))
1727
+ throw l.error;
1728
+ return a.notifyOnChangeProps ? l : o.trackResult(l);
1729
+ }
1730
+ function it(e, t, s) {
1731
+ const r = J(e, t, s);
1732
+ return fs(r, Kt);
1733
+ }
1734
+ function ps(e, t, s) {
1735
+ const r = Rt(e, t, s), i = st({
1736
+ context: r.context
1737
+ }), [a] = d.useState(() => new Vt(i, r));
1738
+ d.useEffect(() => {
1739
+ a.setOptions(r);
1740
+ }, [a, r]);
1741
+ const o = Be(d.useCallback((c) => a.subscribe(A.batchCalls(c)), [a]), () => a.getCurrentResult(), () => a.getCurrentResult()), l = d.useCallback((c, h) => {
1742
+ a.mutate(c, h).catch(vs);
1743
+ }, [a]);
1744
+ if (o.error && nt(a.options.useErrorBoundary, [o.error]))
1745
+ throw o.error;
1746
+ return {
1747
+ ...o,
1748
+ mutate: l,
1749
+ mutateAsync: o.mutate
1750
+ };
1751
+ }
1752
+ function vs() {
1753
+ }
1754
+ function at(e) {
1755
+ var t, s, r = "";
1756
+ if (typeof e == "string" || typeof e == "number")
1757
+ r += e;
1758
+ else if (typeof e == "object")
1759
+ if (Array.isArray(e))
1760
+ for (t = 0; t < e.length; t++)
1761
+ e[t] && (s = at(e[t])) && (r && (r += " "), r += s);
1762
+ else
1763
+ for (t in e)
1764
+ e[t] && (r && (r += " "), r += t);
1765
+ return r;
1766
+ }
1767
+ function P() {
1768
+ for (var e, t, s = 0, r = ""; s < arguments.length; )
1769
+ (e = arguments[s++]) && (t = at(e)) && (r && (r += " "), r += t);
1770
+ return r;
1771
+ }
1772
+ var ms = Object.defineProperty, ys = Object.defineProperties, Cs = Object.getOwnPropertyDescriptors, ae = Object.getOwnPropertySymbols, ot = Object.prototype.hasOwnProperty, lt = Object.prototype.propertyIsEnumerable, Ue = (e, t, s) => t in e ? ms(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, g = (e, t) => {
1773
+ for (var s in t || (t = {}))
1774
+ ot.call(t, s) && Ue(e, s, t[s]);
1775
+ if (ae)
1776
+ for (var s of ae(t))
1777
+ lt.call(t, s) && Ue(e, s, t[s]);
1778
+ return e;
1779
+ }, E = (e, t) => ys(e, Cs(t)), O = (e, t) => {
1780
+ var s = {};
1781
+ for (var r in e)
1782
+ ot.call(e, r) && t.indexOf(r) < 0 && (s[r] = e[r]);
1783
+ if (e != null && ae)
1784
+ for (var r of ae(e))
1785
+ t.indexOf(r) < 0 && lt.call(e, r) && (s[r] = e[r]);
1786
+ return s;
1787
+ };
1788
+ function oe() {
1789
+ return oe = Object.assign ? Object.assign.bind() : function(e) {
1790
+ for (var t = 1; t < arguments.length; t++) {
1791
+ var s = arguments[t];
1792
+ for (var r in s)
1793
+ Object.prototype.hasOwnProperty.call(s, r) && (e[r] = s[r]);
1794
+ }
1795
+ return e;
1796
+ }, oe.apply(this, arguments);
1797
+ }
1798
+ function gs(e, t) {
1799
+ typeof e == "function" ? e(t) : e != null && (e.current = t);
1800
+ }
1801
+ function xs(...e) {
1802
+ return (t) => e.forEach(
1803
+ (s) => gs(s, t)
1804
+ );
1805
+ }
1806
+ var bs = /* @__PURE__ */ d.forwardRef((e, t) => {
1807
+ const s = e, { children: r } = s, i = O(s, ["children"]), a = d.Children.toArray(r), o = a.find(js);
1808
+ if (o) {
1809
+ const l = o.props.children, c = a.map((h) => h === o ? d.Children.count(l) > 1 ? d.Children.only(null) : /* @__PURE__ */ d.isValidElement(l) ? l.props.children : null : h);
1810
+ return /* @__PURE__ */ d.createElement(ye, oe({}, i, {
1811
+ ref: t
1812
+ }), /* @__PURE__ */ d.isValidElement(l) ? /* @__PURE__ */ d.cloneElement(l, void 0, c) : null);
1813
+ }
1814
+ return /* @__PURE__ */ d.createElement(ye, oe({}, i, {
1815
+ ref: t
1816
+ }), r);
1817
+ });
1818
+ bs.displayName = "Slot";
1819
+ var ye = /* @__PURE__ */ d.forwardRef((e, t) => {
1820
+ const s = e, { children: r } = s, i = O(s, ["children"]);
1821
+ return /* @__PURE__ */ d.isValidElement(r) ? /* @__PURE__ */ d.cloneElement(r, E(g({}, _s(i, r.props)), {
1822
+ ref: t ? xs(t, r.ref) : r.ref
1823
+ })) : d.Children.count(r) > 1 ? d.Children.only(null) : null;
1824
+ });
1825
+ ye.displayName = "SlotClone";
1826
+ var ws = ({ children: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, e);
1827
+ function js(e) {
1828
+ return /* @__PURE__ */ d.isValidElement(e) && e.type === ws;
1829
+ }
1830
+ function _s(e, t) {
1831
+ const s = g({}, t);
1832
+ for (const r in t) {
1833
+ const i = e[r], a = t[r];
1834
+ /^on[A-Z]/.test(r) ? i && a ? s[r] = (...l) => {
1835
+ a(...l), i(...l);
1836
+ } : i && (s[r] = i) : r === "style" ? s[r] = g(g({}, i), a) : r === "className" && (s[r] = [
1837
+ i,
1838
+ a
1839
+ ].filter(Boolean).join(" "));
1840
+ }
1841
+ return g(g({}, e), s);
1842
+ }
1843
+ var Ss = ({ firstName: e, lastName: t, variant: s = "small" }) => {
1844
+ const r = `${e.charAt(0)}${t.charAt(0)}`;
1845
+ return /* @__PURE__ */ n.jsx(
1846
+ "span",
1847
+ {
1848
+ className: `avatar avatar--${s}`,
1849
+ "aria-label": `${e} ${t}`,
1850
+ role: "img",
1851
+ children: /* @__PURE__ */ n.jsx("span", { className: "avatar__initials", children: r })
1852
+ }
1853
+ );
1854
+ }, $ = d.forwardRef(
1855
+ (e, t) => {
1856
+ var s = e, {
1857
+ iconLeft: r,
1858
+ iconRight: i,
1859
+ isPending: a = !1,
1860
+ isFilled: o = !1,
1861
+ variant: l,
1862
+ className: c,
1863
+ children: h
1864
+ } = s, u = O(s, [
1865
+ "iconLeft",
1866
+ "iconRight",
1867
+ "isPending",
1868
+ "isFilled",
1869
+ "variant",
1870
+ "className",
1871
+ "children"
1872
+ ]);
1873
+ const p = !!r || !!i;
1874
+ return /* @__PURE__ */ n.jsxs(
1875
+ "button",
1876
+ E(g({
1877
+ ref: t
1878
+ }, u), {
1879
+ className: P(
1880
+ "button",
1881
+ l && `button--${l}`,
1882
+ l && o && `button--${l}--filled`,
1883
+ p && "button--with-icon",
1884
+ a && "button--pending",
1885
+ c
1886
+ ),
1887
+ children: [
1888
+ r && /* @__PURE__ */ n.jsx("div", { className: "button__icon", children: r }),
1889
+ !!h && /* @__PURE__ */ n.jsx("span", { className: "button__label", children: h }),
1890
+ i && /* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: i })
1891
+ ]
1892
+ })
1893
+ );
1894
+ }
1895
+ );
1896
+ $.displayName = "Button";
1897
+ d.createContext(void 0);
1898
+ var Es = d.forwardRef(
1899
+ (e, t) => {
1900
+ var s = e, { prefix: r, suffix: i, className: a } = s, o = O(s, ["prefix", "suffix", "className"]);
1901
+ return /* @__PURE__ */ n.jsxs("div", { className: "input__wrapper", children: [
1902
+ r && /* @__PURE__ */ n.jsx("span", { className: "input__prefix", children: r }),
1903
+ /* @__PURE__ */ n.jsx(
1904
+ "input",
1905
+ g({
1906
+ ref: t,
1907
+ className: P(
1908
+ "input",
1909
+ r && "input--with-prefix",
1910
+ i && "input--with-suffix",
1911
+ a
1912
+ )
1913
+ }, o)
1914
+ ),
1915
+ i && /* @__PURE__ */ n.jsx("span", { className: "input__suffix", children: i })
1916
+ ] });
1917
+ }
1918
+ );
1919
+ Es.displayName = "TextField";
1920
+ d.createContext(void 0);
1921
+ var Ps = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: "card__header__action", children: e }), Rs = (e) => {
1922
+ var t = e, { children: s } = t, r = O(t, ["children"]);
1923
+ return /* @__PURE__ */ n.jsx("div", E(g({ className: "card__body" }, r), { children: s }));
1924
+ }, As = (e) => /* @__PURE__ */ n.jsx(
1925
+ "svg",
1926
+ E(g({
1927
+ width: "24",
1928
+ height: "24",
1929
+ viewBox: "0 0 24 24",
1930
+ fill: "none",
1931
+ xmlns: "http://www.w3.org/2000/svg"
1932
+ }, e), {
1933
+ children: /* @__PURE__ */ n.jsx(
1934
+ "path",
1935
+ {
1936
+ d: "M8 10L12 14L16 10",
1937
+ stroke: "currentColor",
1938
+ strokeWidth: "1.5",
1939
+ strokeLinecap: "round",
1940
+ strokeLinejoin: "round"
1941
+ }
1942
+ )
1943
+ })
1944
+ ), Se = As, Os = (e) => /* @__PURE__ */ n.jsx(
1945
+ "svg",
1946
+ E(g({
1947
+ width: "24",
1948
+ height: "24",
1949
+ viewBox: "0 0 24 24",
1950
+ fill: "none",
1951
+ xmlns: "http://www.w3.org/2000/svg"
1952
+ }, e), {
1953
+ children: /* @__PURE__ */ n.jsx(
1954
+ "path",
1955
+ {
1956
+ d: "M20 6.5L9 17.5L4 12.5",
1957
+ stroke: "currentColor",
1958
+ strokeWidth: "1.5",
1959
+ strokeLinecap: "round",
1960
+ strokeLinejoin: "round"
1961
+ }
1962
+ )
1963
+ })
1964
+ ), Ns = Os, Fs = (e) => /* @__PURE__ */ n.jsx(
1965
+ "svg",
1966
+ E(g({
1967
+ width: "24",
1968
+ height: "24",
1969
+ viewBox: "0 0 24 24",
1970
+ fill: "none",
1971
+ xmlns: "http://www.w3.org/2000/svg"
1972
+ }, e), {
1973
+ children: /* @__PURE__ */ n.jsx(
1974
+ "path",
1975
+ {
1976
+ fillRule: "evenodd",
1977
+ clipRule: "evenodd",
1978
+ fill: "currentColor",
1979
+ d: "M5.53033 4.46967C5.23744 4.17678 4.76256 4.17678 4.46967 4.46967C4.17678 4.76256 4.17678 5.23744 4.46967 5.53033L10.9393 12L4.46967 18.4697C4.17678 18.7626 4.17678 19.2374 4.46967 19.5303C4.76256 19.8232 5.23744 19.8232 5.53033 19.5303L12 13.0607L18.4697 19.5303C18.7626 19.8232 19.2374 19.8232 19.5303 19.5303C19.8232 19.2374 19.8232 18.7626 19.5303 18.4697L13.0607 12L19.5303 5.53033C19.8232 5.23744 19.8232 4.76256 19.5303 4.46967C19.2374 4.17678 18.7626 4.17678 18.4697 4.46967L12 10.9393L5.53033 4.46967Z"
1980
+ }
1981
+ )
1982
+ })
1983
+ ), ks = Fs, Ms = (e) => /* @__PURE__ */ n.jsx(
1984
+ "svg",
1985
+ E(g({
1986
+ width: "24",
1987
+ height: "24",
1988
+ viewBox: "0 0 24 24",
1989
+ fill: "none",
1990
+ xmlns: "http://www.w3.org/2000/svg"
1991
+ }, e), {
1992
+ children: /* @__PURE__ */ n.jsx(
1993
+ "path",
1994
+ {
1995
+ fillRule: "evenodd",
1996
+ clipRule: "evenodd",
1997
+ d: "M10.25 2.25C9.83579 2.25 9.5 2.58579 9.5 3C9.5 3.41421 9.83579 3.75 10.25 3.75H15.25C16.112 3.75 16.9386 4.09241 17.5481 4.7019C18.1576 5.3114 18.5 6.13805 18.5 7V17C18.5 17.862 18.1576 18.6886 17.5481 19.2981C16.9386 19.9076 16.112 20.25 15.25 20.25H10.25C9.83579 20.25 9.5 20.5858 9.5 21C9.5 21.4142 9.83579 21.75 10.25 21.75H15.25C16.5098 21.75 17.718 21.2496 18.6088 20.3588C19.4996 19.468 20 18.2598 20 17V7C20 5.74022 19.4996 4.53204 18.6088 3.64124C17.718 2.75044 16.5098 2.25 15.25 2.25H10.25ZM9.71967 9.53033C9.42678 9.23744 9.42678 8.76256 9.71967 8.46967C10.0126 8.17678 10.4874 8.17678 10.7803 8.46967L13.7803 11.4697C14.0732 11.7626 14.0732 12.2374 13.7803 12.5303L10.7803 15.5303C10.4874 15.8232 10.0126 15.8232 9.71967 15.5303C9.42678 15.2374 9.42678 14.7626 9.71967 14.4697L11.4393 12.75L4.25 12.75C3.83579 12.75 3.5 12.4142 3.5 12C3.5 11.5858 3.83579 11.25 4.25 11.25L11.4393 11.25L9.71967 9.53033Z",
1998
+ fill: "#323232"
1999
+ }
2000
+ )
2001
+ })
2002
+ ), Ls = Ms, Ds = (e) => /* @__PURE__ */ n.jsx(
2003
+ "svg",
2004
+ E(g({
2005
+ width: "24",
2006
+ height: "24",
2007
+ viewBox: "0 0 24 24",
2008
+ fill: "none",
2009
+ xmlns: "http://www.w3.org/2000/svg"
2010
+ }, e), {
2011
+ children: /* @__PURE__ */ n.jsx(
2012
+ "path",
2013
+ {
2014
+ fillRule: "evenodd",
2015
+ clipRule: "evenodd",
2016
+ d: "M13.25 2.25C13.6642 2.25 14 2.58579 14 3C14 3.41421 13.6642 3.75 13.25 3.75H8.25C7.38805 3.75 6.5614 4.09241 5.9519 4.7019C5.34241 5.3114 5 6.13805 5 7V17C5 17.862 5.34241 18.6886 5.9519 19.2981C6.5614 19.9076 7.38805 20.25 8.25 20.25H13.25C13.6642 20.25 14 20.5858 14 21C14 21.4142 13.6642 21.75 13.25 21.75H8.25C6.99022 21.75 5.78204 21.2496 4.89124 20.3588C4.00045 19.468 3.5 18.2598 3.5 17V7C3.5 5.74022 4.00045 4.53204 4.89124 3.64124C5.78204 2.75044 6.99022 2.25 8.25 2.25H13.25ZM15.7197 8.46967C16.0126 8.17678 16.4874 8.17678 16.7803 8.46967L19.7803 11.4697C20.0732 11.7626 20.0732 12.2374 19.7803 12.5303L16.7803 15.5303C16.4874 15.8232 16.0126 15.8232 15.7197 15.5303C15.4268 15.2374 15.4268 14.7626 15.7197 14.4697L17.4393 12.75L10.25 12.75C9.83579 12.75 9.5 12.4142 9.5 12C9.5 11.5858 9.83579 11.25 10.25 11.25L17.4393 11.25L15.7197 9.53033C15.4268 9.23744 15.4268 8.76256 15.7197 8.46967Z",
2017
+ fill: "currentColor"
2018
+ }
2019
+ )
2020
+ })
2021
+ ), Ts = Ds, Us = (e) => /* @__PURE__ */ n.jsxs(
2022
+ "svg",
2023
+ E(g({
2024
+ width: "24",
2025
+ height: "24",
2026
+ fill: "none",
2027
+ viewBox: "0 0 24 24",
2028
+ xmlns: "http://www.w3.org/2000/svg"
2029
+ }, e), {
2030
+ children: [
2031
+ /* @__PURE__ */ n.jsxs("g", { clipPath: "url(#clip0_19_444)", children: [
2032
+ /* @__PURE__ */ n.jsx(
2033
+ "path",
2034
+ {
2035
+ d: "M17 21H7V21C5.89543 21 5 20.1046 5 19V12V12C5 10.8954 5.89543 10 7 10H17V10C18.1046 10 19 10.8954 19 12V19V19C19 20.1046 18.1046 21 17 21C17 21 17 21 17 21V21Z",
2036
+ stroke: "currentColor",
2037
+ strokeWidth: "1.5",
2038
+ strokeLinecap: "round",
2039
+ strokeLinejoin: "round"
2040
+ }
2041
+ ),
2042
+ /* @__PURE__ */ n.jsx("circle", { cx: "10.3", cy: "15.5", r: "0.8", fill: "currentColor" }),
2043
+ /* @__PURE__ */ n.jsx("circle", { cx: "13.7", cy: "15.5", r: "0.8", fill: "currentColor" }),
2044
+ /* @__PURE__ */ n.jsx(
2045
+ "path",
2046
+ {
2047
+ d: "M8 10V7V7C8 4.79086 9.79086 3 12 3V3C14.2091 3 16 4.79086 16 7V10",
2048
+ stroke: "currentColor",
2049
+ strokeWidth: "1.5",
2050
+ strokeLinecap: "round",
2051
+ strokeLinejoin: "round"
2052
+ }
2053
+ )
2054
+ ] }),
2055
+ /* @__PURE__ */ n.jsx("defs", { children: /* @__PURE__ */ n.jsx("clipPath", { id: "clip0_19_444", children: /* @__PURE__ */ n.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
2056
+ ]
2057
+ })
2058
+ ), Qs = Us, qs = (e) => /* @__PURE__ */ n.jsxs(
2059
+ "svg",
2060
+ E(g({
2061
+ width: "24",
2062
+ height: "24",
2063
+ viewBox: "0 0 24 24",
2064
+ fill: "none",
2065
+ xmlns: "http://www.w3.org/2000/svg"
2066
+ }, e), {
2067
+ children: [
2068
+ /* @__PURE__ */ n.jsx(
2069
+ "path",
2070
+ {
2071
+ d: "M14.4749 4.52513C15.8418 5.89197 15.8418 8.10804 14.4749 9.47488C13.1081 10.8417 10.892 10.8417 9.52516 9.47488C8.15832 8.10804 8.15832 5.89197 9.52516 4.52513C10.892 3.15829 13.1081 3.15829 14.4749 4.52513",
2072
+ stroke: "currentColor",
2073
+ strokeWidth: "1.5",
2074
+ strokeLinecap: "round",
2075
+ strokeLinejoin: "round"
2076
+ }
2077
+ ),
2078
+ /* @__PURE__ */ n.jsx(
2079
+ "path",
2080
+ {
2081
+ d: "M4 18.5V19.5C4 20.052 4.448 20.5 5 20.5H19C19.552 20.5 20 20.052 20 19.5V18.5C20 15.474 16.048 13.508 12 13.508C7.952 13.508 4 15.474 4 18.5Z",
2082
+ stroke: "currentColor",
2083
+ strokeWidth: "1.5",
2084
+ strokeLinecap: "round",
2085
+ strokeLinejoin: "round"
2086
+ }
2087
+ )
2088
+ ]
2089
+ })
2090
+ ), Ks = qs, Hs = (e) => /* @__PURE__ */ n.jsxs(
2091
+ "svg",
2092
+ E(g({
2093
+ width: "24",
2094
+ height: "24",
2095
+ viewBox: "0 0 24 24",
2096
+ fill: "none",
2097
+ xmlns: "http://www.w3.org/2000/svg"
2098
+ }, e), {
2099
+ children: [
2100
+ /* @__PURE__ */ n.jsx(
2101
+ "path",
2102
+ {
2103
+ d: "M14.4749 4.52513C15.8418 5.89197 15.8418 8.10804 14.4749 9.47488C13.1081 10.8417 10.892 10.8417 9.52516 9.47488C8.15832 8.10804 8.15832 5.89197 9.52516 4.52513C10.892 3.15829 13.1081 3.15829 14.4749 4.52513",
2104
+ stroke: "currentColor",
2105
+ strokeWidth: "1.5",
2106
+ strokeLinecap: "round",
2107
+ strokeLinejoin: "round"
2108
+ }
2109
+ ),
2110
+ /* @__PURE__ */ n.jsx(
2111
+ "path",
2112
+ {
2113
+ d: "M13.5 20.5H10H5C4.448 20.5 4 20.052 4 19.5V18.5C4 15.9788 6.7434 14.1935 10 13.6679C10.6521 13.5627 11.3247 13.508 12 13.508C13.0272 13.508 14.0482 13.6346 15 13.873",
2114
+ stroke: "currentColor",
2115
+ strokeWidth: "1.5",
2116
+ strokeLinecap: "round",
2117
+ strokeLinejoin: "round"
2118
+ }
2119
+ ),
2120
+ /* @__PURE__ */ n.jsx(
2121
+ "path",
2122
+ {
2123
+ d: "M17.5 16V18.0164V20",
2124
+ stroke: "currentColor",
2125
+ strokeWidth: "1.5",
2126
+ strokeLinecap: "round",
2127
+ strokeLinejoin: "round"
2128
+ }
2129
+ ),
2130
+ /* @__PURE__ */ n.jsx(
2131
+ "path",
2132
+ {
2133
+ d: "M19.5 18L17.4836 18L15.5 18",
2134
+ stroke: "currentColor",
2135
+ strokeWidth: "1.5",
2136
+ strokeLinecap: "round",
2137
+ strokeLinejoin: "round"
2138
+ }
2139
+ )
2140
+ ]
2141
+ })
2142
+ ), Gs = Hs, Vs = (e) => /* @__PURE__ */ n.jsxs(
2143
+ "svg",
2144
+ E(g({
2145
+ width: "20",
2146
+ height: "21",
2147
+ fill: "none",
2148
+ viewBox: "0 0 20 21",
2149
+ xmlns: "http://www.w3.org/2000/svg"
2150
+ }, e), {
2151
+ children: [
2152
+ /* @__PURE__ */ n.jsx("circle", { cx: "10", cy: "10.0996", r: "7.5", stroke: "#00ab9e", strokeWidth: "1.25" }),
2153
+ /* @__PURE__ */ n.jsx(
2154
+ "circle",
2155
+ {
2156
+ cx: "10",
2157
+ cy: "10.0996",
2158
+ r: "7.5",
2159
+ stroke: "white",
2160
+ strokeDasharray: "15 30",
2161
+ strokeWidth: "1.25"
2162
+ }
2163
+ )
2164
+ ]
2165
+ })
2166
+ ), $s = Vs, Ws = (e) => /* @__PURE__ */ n.jsxs(
2167
+ "svg",
2168
+ E(g({
2169
+ width: "24",
2170
+ height: "24",
2171
+ fill: "none",
2172
+ viewBox: "0 0 24 24",
2173
+ xmlns: "http://www.w3.org/2000/svg"
2174
+ }, e), {
2175
+ children: [
2176
+ /* @__PURE__ */ n.jsxs("g", { clipPath: "url(#clip0_762_2934)", children: [
2177
+ /* @__PURE__ */ n.jsx(
2178
+ "path",
2179
+ {
2180
+ fillRule: "evenodd",
2181
+ clipRule: "evenodd",
2182
+ d: "M12.75 8.39996C12.75 7.98575 12.4142 7.64996 12 7.64996C11.5858 7.64996 11.25 7.98575 11.25 8.39996V11.669C11.25 12.0832 11.5858 12.419 12 12.419C12.4142 12.419 12.75 12.0832 12.75 11.669V8.39996ZM12.005 16.35C12.5159 16.35 12.93 15.9359 12.93 15.425C12.93 14.9141 12.5159 14.5 12.005 14.5C11.4942 14.5 11.08 14.9141 11.08 15.425C11.08 15.9359 11.4942 16.35 12.005 16.35Z",
2183
+ fill: "currentColor"
2184
+ }
2185
+ ),
2186
+ /* @__PURE__ */ n.jsx(
2187
+ "path",
2188
+ {
2189
+ d: "M12 21C7.029 21 3 16.971 3 12C3 7.029 7.029 3 12 3C16.971 3 21 7.029 21 12C21 16.971 16.971 21 12 21Z",
2190
+ stroke: "currentColor",
2191
+ strokeWidth: "1.5",
2192
+ strokeLinecap: "round",
2193
+ strokeLinejoin: "round"
2194
+ }
2195
+ )
2196
+ ] }),
2197
+ /* @__PURE__ */ n.jsx("defs", { children: /* @__PURE__ */ n.jsx("clipPath", { id: "clip0_762_2934", children: /* @__PURE__ */ n.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
2198
+ ]
2199
+ })
2200
+ ), Zs = Ws, zs = (e) => {
2201
+ const t = (s) => `${s}${e.suffix ? `_${e.suffix}` : ""}`;
2202
+ return /* @__PURE__ */ n.jsxs(
2203
+ "svg",
2204
+ E(g({
2205
+ width: "24",
2206
+ height: "24",
2207
+ viewBox: "0 0 24 24",
2208
+ fill: "none",
2209
+ xmlns: "http://www.w3.org/2000/svg"
2210
+ }, e), {
2211
+ children: [
2212
+ /* @__PURE__ */ n.jsx(
2213
+ "path",
2214
+ {
2215
+ d: "M17.6214 11.1549C20.4161 8.33951 21.712 5.41047 20.6067 3.876C19.1586 1.85988 14.1278 2.98841 9.3766 6.39936C8.31103 7.15864 7.31229 8.00725 6.39122 8.93598L17.6214 11.1549Z",
2216
+ fill: t("url(#paint0")
2217
+ }
2218
+ ),
2219
+ /* @__PURE__ */ n.jsx(
2220
+ "path",
2221
+ {
2222
+ opacity: "0.9",
2223
+ d: "M17.6214 11.1548C17.1178 9.955 16.5189 8.79735 15.8301 7.693C12.6925 2.58286 8.41126 -0.498612 6.30132 0.794902C4.66377 1.79657 4.80319 5.119 6.39145 8.93562L17.6214 11.1548Z",
2224
+ fill: t("url(#paint1")
2225
+ }
2226
+ ),
2227
+ /* @__PURE__ */ n.jsx(
2228
+ "path",
2229
+ {
2230
+ d: "M6.39122 8.93591C6.89474 10.1357 7.49373 11.2934 8.18245 12.3977C11.3329 17.5079 15.6006 20.5894 17.7229 19.2958C19.3616 18.2942 19.221 14.9718 17.6339 11.1549L6.39122 8.93591Z",
2231
+ fill: t("url(#paint2")
2232
+ }
2233
+ ),
2234
+ /* @__PURE__ */ n.jsx(
2235
+ "path",
2236
+ {
2237
+ opacity: "0.85",
2238
+ d: "M6.39113 8.93591C3.5836 11.7637 2.28796 14.6927 3.39319 16.2272C4.8413 18.2433 9.87186 17.1147 14.6224 13.7038C15.6888 12.9404 16.6916 12.0922 17.6213 11.1677L6.39113 8.93591Z",
2239
+ fill: t("url(#paint3")
2240
+ }
2241
+ ),
2242
+ /* @__PURE__ */ n.jsx(
2243
+ "path",
2244
+ {
2245
+ opacity: "0.87",
2246
+ d: "M6.39113 8.93591C3.5836 11.7509 2.28796 14.6801 3.39319 16.2272C4.8413 18.2433 9.87186 17.1147 14.6224 13.7038C15.6888 12.9404 16.6916 12.0922 17.6213 11.1677L6.39113 8.93591Z",
2247
+ fill: t("url(#paint4")
2248
+ }
2249
+ ),
2250
+ /* @__PURE__ */ n.jsx(
2251
+ "path",
2252
+ {
2253
+ d: "M12.0064 23.2897C16.2652 23.2897 19.7177 22.9093 19.7177 22.4402C19.7177 21.971 16.2652 21.5907 12.0064 21.5907C7.74761 21.5907 4.29517 21.971 4.29517 22.4402C4.29517 22.9093 7.74761 23.2897 12.0064 23.2897Z",
2254
+ fill: t("url(#paint5")
2255
+ }
2256
+ ),
2257
+ /* @__PURE__ */ n.jsxs("defs", { children: [
2258
+ /* @__PURE__ */ n.jsxs(
2259
+ "linearGradient",
2260
+ {
2261
+ id: t("paint0"),
2262
+ x1: "10.6862",
2263
+ y1: "11.0225",
2264
+ x2: "14.9751",
2265
+ y2: "0.707188",
2266
+ gradientUnits: "userSpaceOnUse",
2267
+ children: [
2268
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.413", stopColor: "#90B117" }),
2269
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.501", stopColor: "#8BAF19" }),
2270
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.601", stopColor: "#7DAB1E" }),
2271
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.706", stopColor: "#67A325" }),
2272
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.815", stopColor: "#479830" }),
2273
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.925", stopColor: "#1F8A3E" }),
2274
+ /* @__PURE__ */ n.jsx("stop", { offset: "1", stopColor: "#007F48" })
2275
+ ]
2276
+ }
2277
+ ),
2278
+ /* @__PURE__ */ n.jsxs(
2279
+ "linearGradient",
2280
+ {
2281
+ id: t("paint1"),
2282
+ x1: "11.5281",
2283
+ y1: "8.85339",
2284
+ x2: "12.4519",
2285
+ y2: "1.60772",
2286
+ gradientUnits: "userSpaceOnUse",
2287
+ children: [
2288
+ /* @__PURE__ */ n.jsx("stop", { stopColor: "#36BCEE" }),
2289
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.201", stopColor: "#31ACE3" }),
2290
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.59", stopColor: "#2583C5" }),
2291
+ /* @__PURE__ */ n.jsx("stop", { offset: "1", stopColor: "#1652A1" })
2292
+ ]
2293
+ }
2294
+ ),
2295
+ /* @__PURE__ */ n.jsxs(
2296
+ "linearGradient",
2297
+ {
2298
+ id: t("paint2"),
2299
+ x1: "15.0651",
2300
+ y1: "18.7384",
2301
+ x2: "12.9747",
2302
+ y2: "8.0336",
2303
+ gradientUnits: "userSpaceOnUse",
2304
+ children: [
2305
+ /* @__PURE__ */ n.jsx("stop", { stopColor: "#E42313" }),
2306
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.071", stopColor: "#E73611" }),
2307
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.312", stopColor: "#F0710B" }),
2308
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.534", stopColor: "#F6A006" }),
2309
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.73", stopColor: "#FBC103" }),
2310
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.891", stopColor: "#FED601" }),
2311
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.999", stopColor: "#FFDD00" })
2312
+ ]
2313
+ }
2314
+ ),
2315
+ /* @__PURE__ */ n.jsxs(
2316
+ "linearGradient",
2317
+ {
2318
+ id: t("paint3"),
2319
+ x1: "13.9806",
2320
+ y1: "8.29749",
2321
+ x2: "10.8203",
2322
+ y2: "18.1127",
2323
+ gradientUnits: "userSpaceOnUse",
2324
+ children: [
2325
+ /* @__PURE__ */ n.jsx("stop", { stopColor: "#FFC832" }),
2326
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.354", stopColor: "#F8A220" }),
2327
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.779", stopColor: "#F07A0D" }),
2328
+ /* @__PURE__ */ n.jsx("stop", { offset: "1", stopColor: "#ED6B06" })
2329
+ ]
2330
+ }
2331
+ ),
2332
+ /* @__PURE__ */ n.jsxs(
2333
+ "linearGradient",
2334
+ {
2335
+ id: t("paint4"),
2336
+ x1: "13.9806",
2337
+ y1: "8.2892",
2338
+ x2: "10.8212",
2339
+ y2: "18.1113",
2340
+ gradientUnits: "userSpaceOnUse",
2341
+ children: [
2342
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.461", stopColor: "#F3C636", stopOpacity: "0" }),
2343
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.645", stopColor: "#F1A223", stopOpacity: "0.341" }),
2344
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.879", stopColor: "#EE7A0E", stopOpacity: "0.776" }),
2345
+ /* @__PURE__ */ n.jsx("stop", { offset: "1", stopColor: "#ED6B06" })
2346
+ ]
2347
+ }
2348
+ ),
2349
+ /* @__PURE__ */ n.jsxs(
2350
+ "radialGradient",
2351
+ {
2352
+ id: t("paint5"),
2353
+ cx: "0",
2354
+ cy: "0",
2355
+ r: "1",
2356
+ gradientUnits: "userSpaceOnUse",
2357
+ gradientTransform: "translate(11.9404 22.4736) scale(7.73227 0.851796)",
2358
+ children: [
2359
+ /* @__PURE__ */ n.jsx("stop", { stopColor: "#C9C9C9" }),
2360
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.302", stopColor: "#CCCCCC", stopOpacity: "0.698" }),
2361
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.554", stopColor: "#D7D7D7", stopOpacity: "0.447" }),
2362
+ /* @__PURE__ */ n.jsx("stop", { offset: "0.787", stopColor: "#E8E8E8", stopOpacity: "0.212" }),
2363
+ /* @__PURE__ */ n.jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0" })
2364
+ ]
2365
+ }
2366
+ )
2367
+ ] })
2368
+ ]
2369
+ })
2370
+ );
2371
+ }, Ee = zs, Ys = (e) => /* @__PURE__ */ n.jsx(
2372
+ "svg",
2373
+ E(g({
2374
+ fill: "none",
2375
+ xmlns: "http://www.w3.org/2000/svg",
2376
+ viewBox: "0 0 21 16",
2377
+ width: "21",
2378
+ height: "16"
2379
+ }, e), {
2380
+ children: /* @__PURE__ */ n.jsx(
2381
+ "path",
2382
+ {
2383
+ d: "M1.5 5h18M8.07 9H5.5M16.5 15h-12a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3Z",
2384
+ stroke: "currentcolor",
2385
+ strokeWidth: "1.5",
2386
+ strokeLinecap: "round",
2387
+ strokeLinejoin: "round"
2388
+ }
2389
+ )
2390
+ })
2391
+ ), Js = Ys, Xs = (e) => /* @__PURE__ */ n.jsxs(
2392
+ "svg",
2393
+ E(g({
2394
+ width: "24",
2395
+ height: "24",
2396
+ fill: "none",
2397
+ xmlns: "http://www.w3.org/2000/svg",
2398
+ viewBox: "0 0 24 24"
2399
+ }, e), {
2400
+ children: [
2401
+ /* @__PURE__ */ n.jsx(
2402
+ "path",
2403
+ {
2404
+ d: "M3 3h6v6H3V3ZM2.8 14.8h6v6h-6v-6ZM20.8 8.8h-6v-6h6v6Z",
2405
+ strokeWidth: "1.5",
2406
+ strokeLinecap: "round",
2407
+ strokeLinejoin: "round",
2408
+ stroke: "currentColor"
2409
+ }
2410
+ ),
2411
+ /* @__PURE__ */ n.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 14.8 14.7)", fill: "currentColor" }),
2412
+ /* @__PURE__ */ n.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 14.7)", fill: "currentColor" }),
2413
+ /* @__PURE__ */ n.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 17.8 17.7)", fill: "currentColor" }),
2414
+ /* @__PURE__ */ n.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 14.8 20.7)", fill: "currentColor" }),
2415
+ /* @__PURE__ */ n.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 20.7)", fill: "currentColor" })
2416
+ ]
2417
+ })
2418
+ ), Is = Xs, Bs = (e) => {
2419
+ var t = e, {
2420
+ variant: s,
2421
+ icon: r,
2422
+ isStandalone: i,
2423
+ title: a,
2424
+ description: o,
2425
+ className: l
2426
+ } = t, c = O(t, [
2427
+ "variant",
2428
+ "icon",
2429
+ "isStandalone",
2430
+ "title",
2431
+ "description",
2432
+ "className"
2433
+ ]);
2434
+ return /* @__PURE__ */ n.jsx(
2435
+ "div",
2436
+ E(g({}, c), {
2437
+ className: P(
2438
+ "card__empty-state",
2439
+ s === "error" && "card__empty-state--error",
2440
+ i && "card__empty-state--standalone",
2441
+ l
2442
+ ),
2443
+ children: /* @__PURE__ */ n.jsxs("div", { className: "card__empty-state__wrapper", children: [
2444
+ /* @__PURE__ */ n.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ n.jsx(Zs, {}) : r }),
2445
+ /* @__PURE__ */ n.jsxs("div", { className: "card__empty-state__content", children: [
2446
+ /* @__PURE__ */ n.jsx("p", { className: "card__empty-state__title", children: a }),
2447
+ /* @__PURE__ */ n.jsx("p", { className: "card__empty-state__description", children: o })
2448
+ ] })
2449
+ ] })
2450
+ })
2451
+ );
2452
+ }, er = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: "card__footer", children: e }), tr = (e) => {
2453
+ var t = e, {
2454
+ variant: s = "default",
2455
+ sticky: r,
2456
+ className: i,
2457
+ children: a
2458
+ } = t, o = O(t, [
2459
+ "variant",
2460
+ "sticky",
2461
+ "className",
2462
+ "children"
2463
+ ]);
2464
+ return /* @__PURE__ */ n.jsx(
2465
+ "div",
2466
+ E(g({}, o), {
2467
+ className: P(
2468
+ "card__header",
2469
+ s && `card__header--${s}`,
2470
+ r && "card__header--sticky",
2471
+ i
2472
+ ),
2473
+ children: a
2474
+ })
2475
+ );
2476
+ }, sr = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: "card__image", children: e }), rr = ({ children: e, className: t }) => /* @__PURE__ */ n.jsx("div", { className: P("card__body__item", t), children: e }), nr = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: "card__body__subtitle", children: e }), ir = ({ icon: e, children: t }) => /* @__PURE__ */ n.jsxs("div", { className: "card__header__title", children: [
2477
+ e && /* @__PURE__ */ n.jsx("span", { className: "card__header__title__icon", children: e }),
2478
+ t
2479
+ ] }), ct = d.forwardRef(
2480
+ (e, t) => {
2481
+ var s = e, { type: r, children: i, className: a, variant: o = "default", disabled: l = !1 } = s, c = O(s, ["type", "children", "className", "variant", "disabled"]);
2482
+ return d.createElement(
2483
+ r,
2484
+ g({
2485
+ className: P(
2486
+ "card",
2487
+ l && "card--disabled",
2488
+ o && `card--${o}`,
2489
+ a
2490
+ ),
2491
+ ref: t
2492
+ }, c),
2493
+ i
2494
+ );
2495
+ }
2496
+ );
2497
+ ct.displayName = "Card";
2498
+ Object.assign(ct, {
2499
+ Header: tr,
2500
+ Action: Ps,
2501
+ Title: ir,
2502
+ Subtitle: nr,
2503
+ Body: Rs,
2504
+ Image: sr,
2505
+ Item: rr,
2506
+ Footer: er,
2507
+ EmptyState: Bs
2508
+ });
2509
+ var ar = (e) => {
2510
+ var t = e, { className: s, children: r } = t, i = O(t, ["className", "children"]);
2511
+ return /* @__PURE__ */ n.jsx("div", E(g({ className: P("checkbox__content", s) }, i), { children: r }));
2512
+ }, or = (e) => {
2513
+ var t = e, { className: s, children: r } = t, i = O(t, ["className", "children"]);
2514
+ return /* @__PURE__ */ n.jsx("span", E(g({ className: P("checkbox__error", s) }, i), { children: r }));
2515
+ }, lr = (e) => {
2516
+ var t = e, { className: s, children: r } = t, i = O(t, ["className", "children"]);
2517
+ return /* @__PURE__ */ n.jsx("span", E(g({ className: P("checkbox__hint", s) }, i), { children: r }));
2518
+ }, ut = d.createContext(void 0), cr = ({ id: e, name: t, children: s }) => /* @__PURE__ */ n.jsx(ut.Provider, { value: { id: e, name: t }, children: s }), ur = () => {
2519
+ const e = d.useContext(ut);
2520
+ if (!e)
2521
+ throw new Error("Checkbox compound components can not be rendered outside of Checkbox");
2522
+ return e;
2523
+ }, dr = (e) => {
2524
+ var t = e, { className: s, children: r } = t, i = O(t, ["className", "children"]);
2525
+ const { id: a } = ur();
2526
+ return /* @__PURE__ */ n.jsx("label", E(g({ htmlFor: a, className: P("checkbox__label", s) }, i), { children: r }));
2527
+ }, Q = (e) => {
2528
+ var t = e, {
2529
+ id: s,
2530
+ name: r,
2531
+ isPending: i = !1,
2532
+ variant: a = "neutral",
2533
+ hasError: o = !1,
2534
+ className: l,
2535
+ children: c
2536
+ } = t, h = O(t, [
2537
+ "id",
2538
+ "name",
2539
+ "isPending",
2540
+ "variant",
2541
+ "hasError",
2542
+ "className",
2543
+ "children"
2544
+ ]);
2545
+ const u = d.useRef(null);
2546
+ return d.useEffect(() => {
2547
+ u.current && (i ? u.current.indeterminate = !0 : u.current.indeterminate = !1);
2548
+ }, [i]), /* @__PURE__ */ n.jsxs(
2549
+ "div",
2550
+ {
2551
+ className: P("checkbox", a && `checkbox--${a}`, o && "checkbox--error"),
2552
+ children: [
2553
+ /* @__PURE__ */ n.jsx(
2554
+ "input",
2555
+ g({
2556
+ id: s,
2557
+ name: r,
2558
+ type: "checkbox",
2559
+ ref: u,
2560
+ className: P("checkbox__input", l)
2561
+ }, h)
2562
+ ),
2563
+ i ? /* @__PURE__ */ n.jsx($s, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ n.jsx(Ns, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
2564
+ /* @__PURE__ */ n.jsx(cr, { id: s, name: r, children: c })
2565
+ ]
2566
+ }
2567
+ );
2568
+ };
2569
+ Q.Content = ar;
2570
+ Q.Label = dr;
2571
+ Q.Hint = lr;
2572
+ Q.Error = or;
2573
+ var hr = (e) => {
2574
+ var t = e, { type: s = "div", className: r, children: i } = t, a = O(t, ["type", "className", "children"]);
2575
+ return d.createElement(s, g({ className: P("dialog__body", r) }, a), i);
2576
+ }, Ce = () => document.body.style.removeProperty("overflow"), Qe = (e) => e.preventDefault(), fr = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])', pr = (e) => {
2577
+ var t = e, { className: s, children: r, shouldAnimate: i = !0 } = t, a = O(t, ["className", "children", "shouldAnimate"]);
2578
+ const { ref: o, defaultOpen: l, isModal: c, onClose: h } = B();
2579
+ return d.useEffect(() => {
2580
+ const u = o == null ? void 0 : o.current;
2581
+ if (u != null && u.open) {
2582
+ const p = u.querySelectorAll(fr), v = p[0], f = p[p.length - 1], y = (x) => {
2583
+ if (!(x.key === "Tab"))
2584
+ return;
2585
+ x.shiftKey ? document.activeElement === v && (f.focus(), x.preventDefault()) : document.activeElement === f && (v.focus(), x.preventDefault());
2586
+ };
2587
+ return document.body.style.overflow = "hidden", u.addEventListener("keydown", y), window.addEventListener("popstate", () => Ce()), () => {
2588
+ u.removeEventListener("keydown", y), window.removeEventListener("popstate", () => Ce());
2589
+ };
2590
+ }
2591
+ }, [o]), d.useEffect(() => {
2592
+ const u = o == null ? void 0 : o.current;
2593
+ if (!u)
2594
+ return;
2595
+ if (l && (u.removeAttribute("open"), u.showModal(), u.focus()), c)
2596
+ return u.addEventListener("cancel", Qe), () => u.removeEventListener("cancel", Qe);
2597
+ const p = ({ clientX: v, clientY: f }) => {
2598
+ const { top: y, right: x, bottom: m, left: C } = u.getBoundingClientRect(), _ = 0 < f && 0 < v, w = y < f && f < m, R = C < v && v < x;
2599
+ _ && !(w && R) && h();
2600
+ };
2601
+ return u.addEventListener("cancel", h), u.addEventListener("mousedown", p), () => {
2602
+ u.removeEventListener("cancel", h), u.removeEventListener("mousedown", p);
2603
+ };
2604
+ }, [o, c, h, l]), /* @__PURE__ */ n.jsx(
2605
+ "dialog",
2606
+ E(g({
2607
+ ref: o,
2608
+ tabIndex: -1,
2609
+ open: l,
2610
+ "aria-modal": !!c,
2611
+ className: P("dialog", i && "dialog--animated", s)
2612
+ }, a), {
2613
+ children: r
2614
+ })
2615
+ );
2616
+ }, dt = d.createContext(void 0), vr = ({ defaultOpen: e, onClose: t, isModal: s, children: r }) => {
2617
+ const i = d.useRef(null), a = d.useRef(t), o = d.useCallback(() => {
2618
+ var l;
2619
+ Ce(), (l = i.current) == null || l.close(), a.current && (a == null || a.current());
2620
+ }, [i]);
2621
+ return /* @__PURE__ */ n.jsx(dt.Provider, { value: { ref: i, defaultOpen: e, isModal: s, onClose: o }, children: r });
2622
+ }, B = () => {
2623
+ const e = d.useContext(dt);
2624
+ if (!e)
2625
+ throw new Error("Dialog compound components can not be rendered outside of Dialog");
2626
+ return e;
2627
+ }, mr = (e) => {
2628
+ var t = e, { children: s } = t, r = O(t, ["children"]);
2629
+ const { onClose: i } = B();
2630
+ return /* @__PURE__ */ n.jsx($, E(g({ onClick: i }, r), { children: s }));
2631
+ }, ht = d.forwardRef((e, t) => {
2632
+ var s = e, { className: r } = s, i = O(s, ["className"]);
2633
+ const { onClose: a } = B();
2634
+ return /* @__PURE__ */ n.jsx(
2635
+ $,
2636
+ g({
2637
+ type: "submit",
2638
+ ref: t,
2639
+ formMethod: "dialog",
2640
+ onClick: a,
2641
+ iconLeft: /* @__PURE__ */ n.jsx(ks, {}),
2642
+ variant: "icon--secondary",
2643
+ className: P("dialog__close button--icon", r)
2644
+ }, i)
2645
+ );
2646
+ });
2647
+ ht.displayName = "Close";
2648
+ var yr = (e) => {
2649
+ var t = e, { className: s, children: r } = t, i = O(t, ["className", "children"]);
2650
+ return /* @__PURE__ */ n.jsx("div", E(g({ className: P("dialog__footer", s) }, i), { children: r }));
2651
+ }, Cr = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: "dialog__header", children: e }), gr = (e) => {
2652
+ var t = e, { icon: s, children: r, className: i } = t, a = O(t, ["icon", "children", "className"]);
2653
+ const { ref: o } = B(), l = d.useRef(null);
2654
+ return d.useEffect(() => {
2655
+ o != null && o.current && o.current.focus();
2656
+ }, [o]), /* @__PURE__ */ n.jsxs(
2657
+ "div",
2658
+ E(g({
2659
+ tabIndex: 0,
2660
+ ref: l,
2661
+ className: P("dialog__header__title", i)
2662
+ }, a), {
2663
+ children: [
2664
+ s && /* @__PURE__ */ n.jsx("span", { className: "dialog__header__icon", children: s }),
2665
+ r
2666
+ ]
2667
+ })
2668
+ );
2669
+ }, xr = (e) => {
2670
+ var t = e, { children: s } = t, r = O(t, ["children"]);
2671
+ const { ref: i } = B();
2672
+ return /* @__PURE__ */ n.jsx($, E(g({ onClick: () => {
2673
+ var a;
2674
+ return (a = i == null ? void 0 : i.current) == null ? void 0 : a.showModal();
2675
+ } }, r), { children: s }));
2676
+ }, F = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ n.jsx(vr, { defaultOpen: !!e, isModal: t, onClose: r, children: s });
2677
+ F.Trigger = xr;
2678
+ F.Root = pr;
2679
+ F.Title = gr;
2680
+ F.Header = Cr;
2681
+ F.Body = hr;
2682
+ F.Footer = yr;
2683
+ F.Button = mr;
2684
+ F.Close = ht;
2685
+ var ft = d.createContext(void 0), br = ({
2686
+ id: e,
2687
+ position: t,
2688
+ isOpen: s,
2689
+ setIsOpen: r,
2690
+ activeItemIndex: i,
2691
+ setActiveItemIndex: a,
2692
+ clearActiveItemIndex: o,
2693
+ triggerRef: l,
2694
+ contentRef: c,
2695
+ children: h
2696
+ }) => /* @__PURE__ */ n.jsx(
2697
+ ft.Provider,
2698
+ {
2699
+ value: {
2700
+ id: e,
2701
+ position: t,
2702
+ isOpen: s,
2703
+ setIsOpen: r,
2704
+ activeItemIndex: i,
2705
+ setActiveItemIndex: a,
2706
+ clearActiveItemIndex: o,
2707
+ triggerRef: l,
2708
+ contentRef: c
2709
+ },
2710
+ children: h
2711
+ }
2712
+ ), pt = () => {
2713
+ const e = d.useContext(ft);
2714
+ if (e === void 0)
2715
+ throw new Error("useMenu must be used within a MenuProvider");
2716
+ return e;
2717
+ }, wr = ({ as: e, children: t }) => {
2718
+ const {
2719
+ id: s,
2720
+ position: r,
2721
+ isOpen: i,
2722
+ setIsOpen: a,
2723
+ activeItemIndex: o,
2724
+ setActiveItemIndex: l,
2725
+ clearActiveItemIndex: c,
2726
+ triggerRef: h,
2727
+ contentRef: u
2728
+ } = pt(), p = (v) => {
2729
+ var f;
2730
+ if (!i)
2731
+ return;
2732
+ if (v.key === "Escape")
2733
+ return c(), a(!1), (f = h.current) == null ? void 0 : f.focus();
2734
+ const y = u.current.childElementCount - 1;
2735
+ switch (v.key) {
2736
+ case "ArrowUp":
2737
+ case "ArrowLeft":
2738
+ return v.preventDefault(), l(o ? Math.max(0, o - 1) : 0);
2739
+ case "ArrowDown":
2740
+ case "ArrowRight":
2741
+ v.preventDefault();
2742
+ const x = o !== void 0 ? o + 1 : 0;
2743
+ return l(Math.min(y, x));
2744
+ case "Home":
2745
+ return v.preventDefault(), l(0);
2746
+ case "End":
2747
+ return v.preventDefault(), l(y);
2748
+ }
2749
+ };
2750
+ return e ? d.createElement(
2751
+ e,
2752
+ {
2753
+ id: `${s}-content`,
2754
+ ref: u,
2755
+ className: P("menu__list", `menu__list--${r}`, i && "menu__list--active"),
2756
+ onKeyDown: p
2757
+ },
2758
+ t
2759
+ ) : (
2760
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
2761
+ /* @__PURE__ */ n.jsx(
2762
+ "ul",
2763
+ {
2764
+ id: `${s}-content`,
2765
+ ref: u,
2766
+ className: P("menu__list", `menu__list--${r}`, i && "menu__list--active"),
2767
+ onKeyDown: p,
2768
+ children: t
2769
+ }
2770
+ )
2771
+ );
2772
+ }, jr = (e) => {
2773
+ var t = e, { children: s, className: r } = t, i = O(t, ["children", "className"]);
2774
+ return /* @__PURE__ */ n.jsx("li", E(g({}, i), { className: P("menu__list-item", r), children: s }));
2775
+ }, vt = ({ children: e, className: t }) => {
2776
+ const { id: s, isOpen: r, setIsOpen: i, clearActiveItemIndex: a, setActiveItemIndex: o, triggerRef: l } = pt(), c = () => {
2777
+ a(), i((u) => !u);
2778
+ }, h = (u) => {
2779
+ if (r) {
2780
+ if (u.key === "Escape")
2781
+ return a(), i(!1);
2782
+ u.key === "ArrowDown" && (u.preventDefault(), o(0));
2783
+ }
2784
+ };
2785
+ return d.cloneElement(e, {
2786
+ id: `${s}-trigger`,
2787
+ ref: l,
2788
+ className: P("menu__trigger", t),
2789
+ onClick: c,
2790
+ onKeyDown: h,
2791
+ "aria-expanded": r,
2792
+ "aria-controls": `${s}-content`
2793
+ });
2794
+ };
2795
+ vt.displayName = "Trigger";
2796
+ var L = (e) => {
2797
+ var t = e, { type: s, id: r, position: i = "right", children: a, className: o } = t, l = O(t, ["type", "id", "position", "children", "className"]);
2798
+ const c = d.useRef(null), h = d.useRef(null), u = d.useRef(null), [p, v] = d.useState(!1), [f, y] = d.useState(), [x, m] = d.useState(f);
2799
+ f !== x && f !== void 0 && (u.current.children[f].firstChild.focus(), m(f));
2800
+ const C = () => {
2801
+ y(void 0), m(void 0);
2802
+ }, _ = (w) => {
2803
+ var R;
2804
+ ((R = c.current) == null ? void 0 : R.contains(w.relatedTarget)) || (C(), v(!1));
2805
+ };
2806
+ return /* @__PURE__ */ n.jsx(
2807
+ br,
2808
+ {
2809
+ id: r,
2810
+ position: i,
2811
+ isOpen: p,
2812
+ setIsOpen: v,
2813
+ activeItemIndex: f,
2814
+ setActiveItemIndex: y,
2815
+ clearActiveItemIndex: C,
2816
+ triggerRef: h,
2817
+ contentRef: u,
2818
+ children: d.createElement(
2819
+ s,
2820
+ E(g({}, l), {
2821
+ id: r,
2822
+ ref: c,
2823
+ className: `menu ${o || ""}`,
2824
+ onBlur: _
2825
+ }),
2826
+ a
2827
+ )
2828
+ }
2829
+ );
2830
+ };
2831
+ L.Trigger = vt;
2832
+ L.Content = wr;
2833
+ L.Item = jr;
2834
+ d.createContext(void 0);
2835
+ var _r = (/* @__PURE__ */ new Map()).set("BE", "32").set("FR", "33").set("NL", "31").set("LU", "352").set("DE", "49").set("CA", "1").set("PR", "1").set("TC", "1").set("US", "1").set("BS", "1242").set("BB", "1246").set("AI", "1264").set("AG", "1268").set("KY", "1345").set("BM", "1441").set("GD", "1473").set("MS", "1664").set("GU", "1671").set("LC", "1758").set("DM", "1767").set("VC", "1784").set("DO", "1809").set("TT", "1868").set("KN", "1869").set("JM", "1876").set("EG", "20").set("SS", "211").set("MA", "212").set("DZ", "213").set("TN", "216").set("LY", "218").set("GM", "220").set("SN", "221").set("MR", "222").set("ML", "223").set("GN", "224").set("CI", "225").set("BF", "226").set("NE", "227").set("TG", "228").set("BJ", "229").set("MU", "230").set("LR", "231").set("SL", "232").set("GH", "233").set("NG", "234").set("TD", "235").set("CF", "236").set("CM", "237").set("CV", "238").set("ST", "239").set("GQ", "240").set("GA", "241").set("CG", "242").set("CD", "243").set("AO", "244").set("GW", "245").set("SC", "248").set("SD", "249").set("RW", "250").set("ET", "251").set("SO", "252").set("DJ", "253").set("KE", "254").set("TZ", "255").set("UG", "256").set("BI", "257").set("MZ", "258").set("ZM", "260").set("MG", "261").set("RE", "262").set("ZW", "263").set("NA", "264").set("MW", "265").set("LS", "266").set("BW", "267").set("SZ", "268").set("KM", "269").set("ZA", "27").set("VG", "284").set("ER", "291").set("AW", "297").set("FO", "298").set("GL", "299").set("GR", "30").set("ES", "34").set("GI", "350").set("PT", "351").set("IE", "353").set("IS", "354").set("AL", "355").set("MT", "356").set("CY", "357").set("FI", "358").set("BG", "359").set("HU", "36").set("LT", "370").set("LV", "371").set("EE", "372").set("MD", "373").set("AM", "374").set("BY", "375").set("AD", "376").set("MC", "377").set("SM", "378").set("UA", "380").set("RS", "381").set("ME", "382").set("HR", "385").set("SI", "386").set("BA", "387").set("MK", "389").set("IT", "39").set("RO", "40").set("CH", "41").set("CZ", "420").set("SK", "421").set("LI", "423").set("AT", "43").set("GB", "44").set("DK", "45").set("SE", "46").set("NO", "47").set("PL", "48").set("FK", "500").set("BZ", "501").set("GT", "502").set("SV", "503").set("HN", "504").set("NI", "505").set("CR", "506").set("PA", "507").set("PM", "508").set("HT", "509").set("PE", "51").set("MX", "52").set("CU", "53").set("AR", "54").set("BR", "55").set("CL", "56").set("CO", "57").set("VE", "58").set("GP", "590").set("BO", "591").set("GY", "592").set("EC", "593").set("FG", "594").set("PY", "595").set("MQ", "596").set("SR", "597").set("UY", "598").set("CW", "599").set("AN", "599").set("MY", "60").set("AU", "61").set("ID", "62").set("PH", "63").set("NZ", "64").set("SG", "65").set("TH", "66").set("TP", "670").set("BN", "673").set("PG", "675").set("TO", "676").set("SB", "677").set("VU", "678").set("FJ", "679").set("PW", "680").set("CK", "682").set("NU", "683").set("AS", "684").set("WS", "685").set("KI", "686").set("NC", "687").set("TV", "688").set("PF", "689").set("FM", "691").set("KZ", "7").set("RU", "7").set("JP", "81").set("KR", "82").set("VN", "84").set("KP", "850").set("HK", "852").set("MO", "853").set("KH", "855").set("LA", "856").set("CN", "86").set("BD", "880").set("TW", "886").set("TR", "90").set("IN", "91").set("PK", "92").set("AF", "93").set("LK", "94").set("MM", "95").set("MV", "960").set("LB", "961").set("JO", "962").set("SY", "963").set("IQ", "964").set("KW", "965").set("SA", "966").set("YE", "967").set("OM", "968").set("PS", "970").set("AE", "971").set("IL", "972").set("BH", "973").set("QA", "974").set("BT", "975").set("MN", "976").set("NP", "977").set("IR", "98").set("TK", "992").set("TM", "993").set("AZ", "994").set("GE", "995").set("KG", "996").set("UZ", "998");
2836
+ [...new Set(_r.values())].map((e) => ({
2837
+ label: `+${e}`,
2838
+ value: e
2839
+ }));
2840
+ d.createContext(void 0);
2841
+ d.createContext(void 0);
2842
+ var le = /* @__PURE__ */ ((e) => (e[e.categoriesVegetables = 0] = "categoriesVegetables", e[e.categoriesMeat = 1] = "categoriesMeat", e[e.categoriesFish = 2] = "categoriesFish", e[e.categoriesDairy = 3] = "categoriesDairy", e[e.categoriesBreakfast = 4] = "categoriesBreakfast", e[e.categoriesSnacks = 5] = "categoriesSnacks", e[e.categoriesCandy = 6] = "categoriesCandy", e[e.categoriesNonFood = 7] = "categoriesNonFood", e[e.categoriesDryFood = 8] = "categoriesDryFood", e[e.categoriesTins = 9] = "categoriesTins", e[e.categoriesGrid = 10] = "categoriesGrid", e[e.categoriesSoda = 11] = "categoriesSoda", e[e.categoriesBakery = 12] = "categoriesBakery", e[e.categoriesWine = 13] = "categoriesWine", e[e.categoriesBaby = 14] = "categoriesBaby", e[e.categoriesDiet = 15] = "categoriesDiet", e[e.categoriesHygiene = 16] = "categoriesHygiene", e[e.categoriesCleaning = 17] = "categoriesCleaning", e[e.categoriesPets = 18] = "categoriesPets", e[e.categoriesFreezer = 19] = "categoriesFreezer", e[e.categoriesBbq = 20] = "categoriesBbq", e[e.categoriesMealbox = 21] = "categoriesMealbox", e[e.categoriesBrik = 22] = "categoriesBrik", e[e.categoriesGranen = 23] = "categoriesGranen", e[e.categoriesConserve = 24] = "categoriesConserve", e[e.categoriesHome = 25] = "categoriesHome", e[e.categoriesEaster = 26] = "categoriesEaster", e[e.categoriesOnlinePromo = 27] = "categoriesOnlinePromo", e[e.categoriesSportFood = 28] = "categoriesSportFood", e[e.categoriesClothing = 29] = "categoriesClothing", e[e.categoriesEnergy = 30] = "categoriesEnergy", e[e.categoriesDeskAndTravel = 31] = "categoriesDeskAndTravel", e[e.categoriesCigarette = 32] = "categoriesCigarette", e[e.categoriesFood = 33] = "categoriesFood", e[e.categoriesChild = 34] = "categoriesChild", e[e.categoriesPuzzle = 35] = "categoriesPuzzle", e[e.categoriesToys = 36] = "categoriesToys", e[e.categoriesCar = 37] = "categoriesCar", e[e.categoriesPlaceholder = 38] = "categoriesPlaceholder", e[e.categoriesFuel = 39] = "categoriesFuel", e[e.categoriesCarAndBike = 40] = "categoriesCarAndBike", e[e.categoriesToyAndHobby = 41] = "categoriesToyAndHobby", e[e.categoriesMultimedia = 42] = "categoriesMultimedia", e[e.categoriesParty = 43] = "categoriesParty", e[e.toolsPay = 44] = "toolsPay", e[e.toolsReceipt = 45] = "toolsReceipt", e[e.toolsFuel = 46] = "toolsFuel", e[e.toolsStoreLocator = 47] = "toolsStoreLocator", e[e.toolsStats = 48] = "toolsStats", e[e.toolsShowXtraOld = 49] = "toolsShowXtraOld", e[e.toolsShowXtraNew = 50] = "toolsShowXtraNew", e[e.toolsScan2 = 51] = "toolsScan2", e[e.toolsRecipes2 = 52] = "toolsRecipes2", e[e.toolsWarranty = 53] = "toolsWarranty", e[e.toolsCoupons = 54] = "toolsCoupons", e[e.toolsFavoriteInactive = 55] = "toolsFavoriteInactive", e[e.toolsFavoriteActive = 56] = "toolsFavoriteActive", e[e.toolsAssortment = 57] = "toolsAssortment", e[e.toolsPromo = 58] = "toolsPromo", e[e.fuelCng = 59] = "fuelCng", e[e.fuelE5 = 60] = "fuelE5", e[e.fuelAdblue = 61] = "fuelAdblue", e[e.fuelB7 = 62] = "fuelB7", e[e.fuelH2 = 63] = "fuelH2", e[e.fuelE10 = 64] = "fuelE10", e[e.fuelFreeTireInflation = 65] = "fuelFreeTireInflation", e[e.functionalClose = 66] = "functionalClose", e[e.functionalBack = 67] = "functionalBack", e[e.functionalSearch = 68] = "functionalSearch", e[e.functionalEdit = 69] = "functionalEdit", e[e.functionalShare = 70] = "functionalShare", e[e.functionalLocation = 71] = "functionalLocation", e[e.functionalTrash = 72] = "functionalTrash", e[e.functionalCamera = 73] = "functionalCamera", e[e.functionalPhone = 74] = "functionalPhone", e[e.functionalPushNotifications = 75] = "functionalPushNotifications", e[e.functionalMail = 76] = "functionalMail", e[e.functionalGift = 77] = "functionalGift", e[e.functionalPresent = 78] = "functionalPresent", e[e.functionalLoading = 79] = "functionalLoading", e[e.functionalChevronRight = 80] = "functionalChevronRight", e[e.functionalCheck = 81] = "functionalCheck", e[e.functionalChevronDown = 82] = "functionalChevronDown", e[e.functionalChevronUp = 83] = "functionalChevronUp", e[e.functionalPlus = 84] = "functionalPlus", e[e.functionalReset = 85] = "functionalReset", e[e.functionalDownload = 86] = "functionalDownload", e[e.functionalExport = 87] = "functionalExport", e[e.functionalCustomerService = 88] = "functionalCustomerService", e[e.functionalTruck = 89] = "functionalTruck", e[e.functionalBox = 90] = "functionalBox", e[e.functionalEllipsis = 91] = "functionalEllipsis", e[e.functionalLocationHome = 92] = "functionalLocationHome", e[e.functionalLocationPickup = 93] = "functionalLocationPickup", e[e.functionalAccount = 94] = "functionalAccount", e[e.functionalPrivacy = 95] = "functionalPrivacy", e[e.functionalSettings = 96] = "functionalSettings", e[e.functionalUserInfo = 97] = "functionalUserInfo", e[e.functionalPinOutlines = 98] = "functionalPinOutlines", e[e.functionalCalendar = 99] = "functionalCalendar", e[e.functionalMinus = 100] = "functionalMinus", e[e.functionalLifestyle = 101] = "functionalLifestyle", e[e.functionalSms = 102] = "functionalSms", e[e.functionalSwitch = 103] = "functionalSwitch", e[e.functionalSorting = 104] = "functionalSorting", e[e.functionalWarningCircle = 105] = "functionalWarningCircle", e[e.functionalQuestionCircle = 106] = "functionalQuestionCircle", e[e.functionalErrorCircle = 107] = "functionalErrorCircle", e[e.functionalSuccessCircle = 108] = "functionalSuccessCircle", e[e.functionalMessage = 109] = "functionalMessage", e[e.functionalExternalLink = 110] = "functionalExternalLink", e[e.functionalAddToList = 111] = "functionalAddToList", e[e.functionalShoppingcart = 112] = "functionalShoppingcart", e[e.functionalFilter = 113] = "functionalFilter", e[e.functionalLocate = 114] = "functionalLocate", e[e.functionalBarcode = 115] = "functionalBarcode", e[e.functionalClock = 116] = "functionalClock", e[e.functionalHistory = 117] = "functionalHistory", e[e.functionalShops = 118] = "functionalShops", e[e.functionalAddUser = 119] = "functionalAddUser", e[e.functionalOther = 120] = "functionalOther", e[e.functionalInAppNotifications = 121] = "functionalInAppNotifications", e[e.functionalExit = 122] = "functionalExit", e[e.functionalShared = 123] = "functionalShared", e[e.functionalThumbsup = 124] = "functionalThumbsup", e[e.functionalDiscount = 125] = "functionalDiscount", e[e.functionalPercentage = 126] = "functionalPercentage", e[e.functionalList = 127] = "functionalList", e[e.functionalMapLocation = 128] = "functionalMapLocation", e[e.functionalNoConnection = 129] = "functionalNoConnection", e[e.functionalSwap = 130] = "functionalSwap", e[e.functionalPiece = 131] = "functionalPiece", e[e.functionalWeight = 132] = "functionalWeight", e[e.functionalPack = 133] = "functionalPack", e[e.functionalCommunications = 134] = "functionalCommunications", e[e.functionalDeliveryAddresses = 135] = "functionalDeliveryAddresses", e[e["functional18+"] = 136] = "functional18+", e[e.functionalReadtime = 137] = "functionalReadtime", e[e.functionalCopy = 138] = "functionalCopy", e[e.functionalMessageField = 139] = "functionalMessageField", e[e.functionalNext = 140] = "functionalNext", e[e.functionalSave = 141] = "functionalSave", e[e.functionalLogin = 142] = "functionalLogin", e[e.functionalLogout = 143] = "functionalLogout", e[e.functionalWebsite = 144] = "functionalWebsite", e[e.functionalMenu = 145] = "functionalMenu", e[e.functionalRegister = 146] = "functionalRegister", e[e.functionalNews = 147] = "functionalNews", e[e.functionalTimer = 148] = "functionalTimer", e[e.functionalEyeShow = 149] = "functionalEyeShow", e[e.functionalMobilePay = 150] = "functionalMobilePay", e[e.functionalConnectionCable = 151] = "functionalConnectionCable", e[e.functionalDryCleaning = 152] = "functionalDryCleaning", e[e.functionalKiosk = 153] = "functionalKiosk", e[e.functionalConnectedDevice = 154] = "functionalConnectedDevice", e[e.functionalCookies = 155] = "functionalCookies", e[e.functionalViewFile = 156] = "functionalViewFile", e[e.functionalLastAdded = 157] = "functionalLastAdded", e[e.functionalFirstAdded = 158] = "functionalFirstAdded", e[e.functionalStoreLayout = 159] = "functionalStoreLayout", e[e.functionalBlock = 160] = "functionalBlock", e[e.functionalChecklist = 161] = "functionalChecklist", e[e.functionalCartCheckout = 162] = "functionalCartCheckout", e[e.functionalCartEdit = 163] = "functionalCartEdit", e[e.functionalEyeHidden = 164] = "functionalEyeHidden", e[e.functionalWarningCircleFilled = 165] = "functionalWarningCircleFilled", e[e.functionalErrorCircleFilled = 166] = "functionalErrorCircleFilled", e[e.functionalSuccessCircleFilled = 167] = "functionalSuccessCircleFilled", e[e.functionalPlusCircle = 168] = "functionalPlusCircle", e[e.functionalSpinner = 169] = "functionalSpinner", e[e.functionalEcoEarth = 170] = "functionalEcoEarth", e[e.functionalAlphaBeta = 171] = "functionalAlphaBeta", e[e.functionalEuro = 172] = "functionalEuro", e[e.functionalNumber = 173] = "functionalNumber", e[e.functionalIdea = 174] = "functionalIdea", e[e.functionalMultifactorAuthenticator = 175] = "functionalMultifactorAuthenticator", e[e.functionalPassword = 176] = "functionalPassword", e[e.functionalDiscountCode = 177] = "functionalDiscountCode", e))(le || {});
2843
+ const Sr = "/icons/bouMenuIcons.svg", Er = ({
2844
+ bouIconId: e,
2845
+ ...t
2846
+ }) => /* @__PURE__ */ n.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ n.jsx("use", { href: `${Sr}#${le[e]}` }) }), H = ({
2847
+ className: e,
2848
+ label: t,
2849
+ mobileUrl: s,
2850
+ desktopUrl: r,
2851
+ icon: i
2852
+ }) => {
2853
+ const a = () => typeof i == "string" && i in le ? /* @__PURE__ */ n.jsx(Er, { bouIconId: le[i] }) : i;
2854
+ return /* @__PURE__ */ n.jsxs(L.Item, { className: e, children: [
2855
+ /* @__PURE__ */ n.jsxs("a", { href: s, referrerPolicy: "no-referrer-when-downgrade", children: [
2856
+ a(),
2857
+ t
2858
+ ] }),
2859
+ r && /* @__PURE__ */ n.jsxs("a", { href: r, referrerPolicy: "no-referrer-when-downgrade", children: [
2860
+ a(),
2861
+ t
2862
+ ] })
2863
+ ] });
2864
+ }, mt = d.createContext(void 0), Pr = ({
2865
+ position: e,
2866
+ bouMenuItems: t,
2867
+ authenticationStatus: s,
2868
+ profile: r,
2869
+ children: i
2870
+ }) => /* @__PURE__ */ n.jsx(mt.Provider, { value: { position: e, bouMenuItems: t, authenticationStatus: s, profile: r }, children: i }), Pe = () => {
2871
+ const e = d.useContext(mt);
2872
+ if (!e)
2873
+ throw new Error("Authentication context can not be rendered outside of Authentication");
2874
+ return e;
2875
+ }, yt = d.createContext(void 0), Rr = ({ apiUrl: e, redirectUrl: t, children: s }) => /* @__PURE__ */ n.jsx(yt.Provider, { value: { apiUrl: e, redirectUrl: t }, children: s }), Ct = () => {
2876
+ const e = d.useContext(yt);
2877
+ if (!e)
2878
+ throw new Error("Api context can not be rendered outside of Api");
2879
+ return e;
2880
+ }, W = () => {
2881
+ const { apiUrl: e, redirectUrl: t } = Ct(), s = _t({ apiUrl: e, redirectUrl: t }), r = `${e}/logout?redirectUrl=${t}`, i = `${e}/user/profile`, a = `${e}/gdpr/tc/check`, o = `${e}/gdpr/tc`;
2882
+ return {
2883
+ loginUrl: s,
2884
+ logoutUrl: r,
2885
+ profileEndpoint: i,
2886
+ getTermsAndConditionsEndpoint: a,
2887
+ postTermsAndConditionsEndpoint: o
2888
+ };
2889
+ }, Ar = (e) => e != null && e.length ? /* @__PURE__ */ n.jsx("ul", { className: "bou-menu__list", children: e == null ? void 0 : e.map(({ label: t, icon: s, url: r }, i) => /* @__PURE__ */ n.jsx(
2890
+ H,
2891
+ {
2892
+ className: "bou-menu-item",
2893
+ mobileUrl: r,
2894
+ desktopUrl: r,
2895
+ icon: s,
2896
+ label: t
2897
+ },
2898
+ i
2899
+ )) }) : null, Or = () => {
2900
+ const { t: e } = q(), t = Ke(), { position: s, profile: r, bouMenuItems: i } = Pe(), { logoutUrl: a } = W(), o = (r == null ? void 0 : r.firstName) ?? "", l = (r == null ? void 0 : r.lastName) ?? "";
2901
+ return /* @__PURE__ */ n.jsxs(L, { type: "nav", id: "xtra-menu", position: s, children: [
2902
+ /* @__PURE__ */ n.jsx(
2903
+ L.Trigger,
2904
+ {
2905
+ className: P(
2906
+ "button",
2907
+ "button--neutral",
2908
+ "button--authentication",
2909
+ "button--authentication--authenticated"
2910
+ ),
2911
+ children: /* @__PURE__ */ n.jsxs("button", { children: [
2912
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(Ss, { variant: "small", firstName: o, lastName: l }) }),
2913
+ /* @__PURE__ */ n.jsx("span", { className: "button__label", children: o }),
2914
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ n.jsx(Se, {}) })
2915
+ ] })
2916
+ }
2917
+ ),
2918
+ /* @__PURE__ */ n.jsxs(L.Content, { as: "div", children: [
2919
+ Ar(i),
2920
+ /* @__PURE__ */ n.jsxs("ul", { children: [
2921
+ /* @__PURE__ */ n.jsx(
2922
+ H,
2923
+ {
2924
+ className: "manage-profile",
2925
+ mobileUrl: `${t}/manage-profile`,
2926
+ desktopUrl: `${t}/manage-profile/personal-data`,
2927
+ icon: /* @__PURE__ */ n.jsx(Ks, {}),
2928
+ label: e("manageProfile")
2929
+ }
2930
+ ),
2931
+ /* @__PURE__ */ n.jsx(
2932
+ H,
2933
+ {
2934
+ className: "payment",
2935
+ mobileUrl: `${t}/payment`,
2936
+ desktopUrl: `${t}/payment/pay-with-xtra`,
2937
+ icon: /* @__PURE__ */ n.jsx(Js, {}),
2938
+ label: e("payment")
2939
+ }
2940
+ ),
2941
+ /* @__PURE__ */ n.jsx(
2942
+ H,
2943
+ {
2944
+ mobileUrl: `${t}/identifiers`,
2945
+ icon: /* @__PURE__ */ n.jsx(Is, {}),
2946
+ label: e("qrCode")
2947
+ }
2948
+ ),
2949
+ /* @__PURE__ */ n.jsx(
2950
+ H,
2951
+ {
2952
+ className: "manage-privacy",
2953
+ mobileUrl: `${t}/manage-privacy`,
2954
+ desktopUrl: `${t}/manage-privacy/permissions`,
2955
+ icon: /* @__PURE__ */ n.jsx(Qs, {}),
2956
+ label: e("privacy")
2957
+ }
2958
+ ),
2959
+ /* @__PURE__ */ n.jsx(H, { mobileUrl: a, icon: /* @__PURE__ */ n.jsx(Ts, {}), label: e("logout") })
2960
+ ] })
2961
+ ] })
2962
+ ] });
2963
+ }, Nr = () => {
2964
+ const { t: e } = q();
2965
+ return /* @__PURE__ */ n.jsxs("button", { className: P("button", "button--neutral", "button--authentication"), children: [
2966
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx("i", { className: "spinner" }) }),
2967
+ /* @__PURE__ */ n.jsxs("span", { className: "button__label", children: [
2968
+ e("loading"),
2969
+ "..."
2970
+ ] })
2971
+ ] });
2972
+ }, Fr = ({ className: e }) => {
2973
+ const { t } = q(), { loginUrl: s } = W();
2974
+ return /* @__PURE__ */ n.jsxs(
2975
+ "a",
2976
+ {
2977
+ href: s,
2978
+ className: P(
2979
+ "button",
2980
+ "button--neutral",
2981
+ "button--authentication",
2982
+ "button--authentication--unauthenticated",
2983
+ e
2984
+ ),
2985
+ children: [
2986
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(Ee, { width: 24, height: 24, suffix: "desktop" }) }),
2987
+ /* @__PURE__ */ n.jsx("span", { className: "button__label", children: t("login") }),
2988
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ n.jsx(Se, {}) })
2989
+ ]
2990
+ }
2991
+ );
2992
+ };
2993
+ const kr = () => {
2994
+ const { t: e } = q(), { loginUrl: t } = W(), s = Ke(), { position: r } = Pe();
2995
+ return /* @__PURE__ */ n.jsxs(
2996
+ L,
2997
+ {
2998
+ type: "nav",
2999
+ id: "xtra-menu",
3000
+ position: r,
3001
+ className: "menu--unauthenticated",
3002
+ "aria-label": e("xtraMenuAriaLabel"),
3003
+ children: [
3004
+ /* @__PURE__ */ n.jsx(L.Trigger, { className: P("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ n.jsxs("button", { children: [
3005
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(Ee, { width: 24, height: 24, suffix: "mobile" }) }),
3006
+ /* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ n.jsx(Se, {}) })
3007
+ ] }) }),
3008
+ /* @__PURE__ */ n.jsxs(L.Content, { children: [
3009
+ /* @__PURE__ */ n.jsx(L.Item, { children: /* @__PURE__ */ n.jsxs("a", { href: t, className: "button button--with-icon", children: [
3010
+ /* @__PURE__ */ n.jsx("span", { className: "button__icon", children: /* @__PURE__ */ n.jsx(Ls, {}) }),
3011
+ /* @__PURE__ */ n.jsx("span", { className: "button__label", children: e("login") })
3012
+ ] }) }),
3013
+ /* @__PURE__ */ n.jsx(L.Item, { children: /* @__PURE__ */ n.jsxs("a", { href: `${s}/onboarding/register`, className: "button button--with-icon", children: [
3014
+ /* @__PURE__ */ n.jsx("span", { className: "button__icon", children: /* @__PURE__ */ n.jsx(Gs, {}) }),
3015
+ /* @__PURE__ */ n.jsx("span", { className: "button__label", children: e("register") })
3016
+ ] }) })
3017
+ ] })
3018
+ ]
3019
+ }
3020
+ );
3021
+ };
3022
+ var D = /* @__PURE__ */ ((e) => (e.Authenticated = "authenticated", e.NotAuthenticated = "notAuthenticated", e.Pending = "pending", e))(D || {});
3023
+ const Mr = () => {
3024
+ const { authenticationStatus: e } = Pe();
3025
+ return e === D.NotAuthenticated ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
3026
+ /* @__PURE__ */ n.jsx(Fr, {}),
3027
+ /* @__PURE__ */ n.jsx(kr, {})
3028
+ ] }) : e === D.Pending ? /* @__PURE__ */ n.jsx(Nr, {}) : /* @__PURE__ */ n.jsx(Or, {});
3029
+ };
3030
+ /*! js-cookie v3.0.5 | MIT */
3031
+ function ee(e) {
3032
+ for (var t = 1; t < arguments.length; t++) {
3033
+ var s = arguments[t];
3034
+ for (var r in s)
3035
+ e[r] = s[r];
3036
+ }
3037
+ return e;
3038
+ }
3039
+ var Lr = {
3040
+ read: function(e) {
3041
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
3042
+ },
3043
+ write: function(e) {
3044
+ return encodeURIComponent(e).replace(
3045
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
3046
+ decodeURIComponent
3047
+ );
3048
+ }
3049
+ };
3050
+ function ge(e, t) {
3051
+ function s(i, a, o) {
3052
+ if (!(typeof document > "u")) {
3053
+ o = ee({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
3054
+ var l = "";
3055
+ for (var c in o)
3056
+ o[c] && (l += "; " + c, o[c] !== !0 && (l += "=" + o[c].split(";")[0]));
3057
+ return document.cookie = i + "=" + e.write(a, i) + l;
3058
+ }
3059
+ }
3060
+ function r(i) {
3061
+ if (!(typeof document > "u" || arguments.length && !i)) {
3062
+ for (var a = document.cookie ? document.cookie.split("; ") : [], o = {}, l = 0; l < a.length; l++) {
3063
+ var c = a[l].split("="), h = c.slice(1).join("=");
3064
+ try {
3065
+ var u = decodeURIComponent(c[0]);
3066
+ if (o[u] = e.read(h, u), i === u)
3067
+ break;
3068
+ } catch {
3069
+ }
3070
+ }
3071
+ return i ? o[i] : o;
3072
+ }
3073
+ }
3074
+ return Object.create(
3075
+ {
3076
+ set: s,
3077
+ get: r,
3078
+ remove: function(i, a) {
3079
+ s(
3080
+ i,
3081
+ "",
3082
+ ee({}, a, {
3083
+ expires: -1
3084
+ })
3085
+ );
3086
+ },
3087
+ withAttributes: function(i) {
3088
+ return ge(this.converter, ee({}, this.attributes, i));
3089
+ },
3090
+ withConverter: function(i) {
3091
+ return ge(ee({}, this.converter, i), this.attributes);
3092
+ }
3093
+ },
3094
+ {
3095
+ attributes: { value: Object.freeze(t) },
3096
+ converter: { value: Object.freeze(e) }
3097
+ }
3098
+ );
3099
+ }
3100
+ var xe = ge(Lr, { path: "/" });
3101
+ class be extends Error {
3102
+ constructor(t) {
3103
+ super(t), this.name = "UnauthorizedError";
3104
+ }
3105
+ }
3106
+ const Dr = () => {
3107
+ const { i18n: e } = q(), { profileEndpoint: t } = W();
3108
+ return it({
3109
+ queryKey: ["profile"],
3110
+ queryFn: async () => {
3111
+ const r = await fetch(t, {
3112
+ credentials: "include",
3113
+ mode: "cors",
3114
+ headers: { "Accept-Language": e.language }
3115
+ });
3116
+ if (!r.ok)
3117
+ throw r.status === 401 ? new be(`${r.status} - ${r.statusText}`) : new Error("Network response was not ok");
3118
+ return await r.json();
3119
+ },
3120
+ retry: (r, i) => i instanceof be ? !1 : r < 2,
3121
+ refetchOnWindowFocus: !1
3122
+ });
3123
+ }, gt = () => {
3124
+ var l, c;
3125
+ const e = xe.get("profile"), t = !!e, [s, r] = d.useState(
3126
+ t ? D.Authenticated : D.Pending
3127
+ ), [i, a] = d.useState(
3128
+ t ? JSON.parse(e) : void 0
3129
+ ), o = Dr();
3130
+ return d.useEffect(() => {
3131
+ if (o.isError && o.error instanceof be && (xe.remove("profile"), r(D.NotAuthenticated)), o.isError && r(
3132
+ t ? D.Authenticated : D.NotAuthenticated
3133
+ ), o.isSuccess) {
3134
+ r(D.Authenticated);
3135
+ const h = {
3136
+ firstName: o.data.firstName,
3137
+ lastName: o.data.lastName
3138
+ };
3139
+ a(h);
3140
+ }
3141
+ }, [
3142
+ t,
3143
+ (l = o.data) == null ? void 0 : l.firstName,
3144
+ (c = o.data) == null ? void 0 : c.lastName,
3145
+ o.error,
3146
+ o.isError,
3147
+ o.isSuccess
3148
+ ]), { authenticationStatus: s, profile: i };
3149
+ }, Tr = ({ position: e, bouMenuItems: t }) => {
3150
+ const { authenticationStatus: s, profile: r } = gt();
3151
+ return /* @__PURE__ */ n.jsx(
3152
+ Pr,
3153
+ {
3154
+ bouMenuItems: t,
3155
+ authenticationStatus: s,
3156
+ position: e,
3157
+ profile: r,
3158
+ children: /* @__PURE__ */ n.jsx(Mr, {})
3159
+ }
3160
+ );
3161
+ };
3162
+ var Ur = Object.defineProperty, Qr = Object.defineProperties, qr = Object.getOwnPropertyDescriptors, ce = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty, bt = Object.prototype.propertyIsEnumerable, qe = (e, t, s) => t in e ? Ur(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, K = (e, t) => {
3163
+ for (var s in t || (t = {}))
3164
+ xt.call(t, s) && qe(e, s, t[s]);
3165
+ if (ce)
3166
+ for (var s of ce(t))
3167
+ bt.call(t, s) && qe(e, s, t[s]);
3168
+ return e;
3169
+ }, Z = (e, t) => Qr(e, qr(t)), z = (e, t) => {
3170
+ var s = {};
3171
+ for (var r in e)
3172
+ xt.call(e, r) && t.indexOf(r) < 0 && (s[r] = e[r]);
3173
+ if (e != null && ce)
3174
+ for (var r of ce(e))
3175
+ t.indexOf(r) < 0 && bt.call(e, r) && (s[r] = e[r]);
3176
+ return s;
3177
+ }, Kr = d.forwardRef((e, t) => {
3178
+ const s = e, { isAuthenticated: r, className: i } = s, a = z(s, ["isAuthenticated", "className"]);
3179
+ return /* @__PURE__ */ n.jsx(
3180
+ $,
3181
+ K({
3182
+ type: "button",
3183
+ ref: t,
3184
+ className: P(
3185
+ "button--neutral",
3186
+ "button--authentication",
3187
+ r && "button--authentication--authenticated",
3188
+ i
3189
+ )
3190
+ }, a)
3191
+ );
3192
+ });
3193
+ Kr.displayName = "AuthenticationButton";
3194
+ var Hr = (e) => {
3195
+ var t = e, {
3196
+ children: s
3197
+ } = t, r = z(t, [
3198
+ "children"
3199
+ ]);
3200
+ return /* @__PURE__ */ n.jsx(Q.Label, Z(K({ className: "form--tc__label" }, r), { children: s }));
3201
+ }, wt = d.forwardRef(
3202
+ (e, t) => {
3203
+ var s = e, { children: r } = s, i = z(s, ["children"]);
3204
+ return /* @__PURE__ */ n.jsx("form", Z(K({ className: "form--tc", ref: t }, i), { children: r }));
3205
+ }
3206
+ );
3207
+ wt.displayName = "TermsAndConditionsForm";
3208
+ var Gr = (e) => {
3209
+ var t = e, {
3210
+ children: s
3211
+ } = t, r = z(t, [
3212
+ "children"
3213
+ ]);
3214
+ return /* @__PURE__ */ n.jsx("p", Z(K({ className: "form--tc__description" }, r), { children: s }));
3215
+ }, Vr = (e) => {
3216
+ var t = e, { children: s } = t, r = z(t, ["children"]);
3217
+ return /* @__PURE__ */ n.jsx(
3218
+ "a",
3219
+ Z(K({
3220
+ className: "form--tc__link",
3221
+ target: "_blank",
3222
+ rel: "noreferrer",
3223
+ role: "button",
3224
+ download: !0
3225
+ }, r), {
3226
+ children: s
3227
+ })
3228
+ );
3229
+ }, $r = ({ children: e }) => /* @__PURE__ */ n.jsx("h1", { className: "form--tc__title", children: e }), Wr = d.forwardRef(
3230
+ (e, t) => /* @__PURE__ */ n.jsx(F.Close, Z(K({ className: "hidden" }, e), { ref: t }))
3231
+ );
3232
+ Wr.displayName = "TermsAndConditionsClose";
3233
+ var Zr = (e) => {
3234
+ var t = e, { children: s } = t, r = z(t, ["children"]);
3235
+ return /* @__PURE__ */ n.jsx("span", Z(K({ className: "form--tc__error", role: "alert" }, r), { children: s }));
3236
+ };
3237
+ const zr = () => {
3238
+ const { postTermsAndConditionsEndpoint: e } = W(), t = new Je();
3239
+ return ps({
3240
+ mutationFn: async (r) => {
3241
+ const i = await fetch(e, {
3242
+ method: "post",
3243
+ body: JSON.stringify({ acceptedTC: r }),
3244
+ credentials: "include",
3245
+ mode: "cors"
3246
+ });
3247
+ if (!i.ok)
3248
+ throw new Error("Network response was not ok");
3249
+ return i;
3250
+ },
3251
+ onSuccess: async () => {
3252
+ await t.invalidateQueries({ queryKey: ["gdpr"] });
3253
+ }
3254
+ });
3255
+ }, Yr = () => {
3256
+ const { i18n: e } = q(), { getTermsAndConditionsEndpoint: t } = W(), { authenticationStatus: s } = gt(), r = xe.get("hasAcceptedLatestTermsAndConditions"), i = [], a = r === "true", o = s === D.Authenticated;
3257
+ return it({
3258
+ queryKey: ["gdpr"],
3259
+ queryFn: async () => {
3260
+ const c = await fetch(t, {
3261
+ credentials: "include",
3262
+ mode: "cors",
3263
+ headers: { "Accept-Language": e.language }
3264
+ });
3265
+ if (!c.ok)
3266
+ throw new Error("Network response was not ok");
3267
+ return await c.json();
3268
+ },
3269
+ enabled: o && !a,
3270
+ initialData: i
3271
+ });
3272
+ }, Jr = ({ redirectUrl: e }) => {
3273
+ const { t } = q(), { apiUrl: s } = Ct(), r = d.useRef(null), [i, a] = d.useState(0), [o, l] = d.useState({}), { mutate: c, isError: h } = zr(), { AccessibleFormMessage: u, formRef: p } = St({ submitCount: i, errors: o }), { data: v } = Yr(), f = !!(v != null && v.length), y = t("termsAndConditions.error.required"), x = () => {
3274
+ var C;
3275
+ (C = r == null ? void 0 : r.current) == null || C.click(), document.body.style.removeProperty("overflow");
3276
+ };
3277
+ d.useEffect(() => {
3278
+ f && document.body.style.setProperty("overflow", "hidden");
3279
+ }, [f]), d.useEffect(() => {
3280
+ h && l({ acceptedTC: y });
3281
+ }, [y, h]);
3282
+ const m = (C) => {
3283
+ C.preventDefault(), a(i + 1);
3284
+ const { acceptedTC: _ } = C.target;
3285
+ if (_ instanceof RadioNodeList) {
3286
+ const w = Object.values(_);
3287
+ w.every((N) => N.checked) ? (l({}), c(w.map((N) => N.value)), x()) : l({ acceptedTC: y });
3288
+ } else
3289
+ _ != null && _.checked ? (l({}), c([_.value]), x()) : l({ acceptedTC: y });
3290
+ };
3291
+ return f ? /* @__PURE__ */ n.jsxs(F, { defaultOpen: f, isModal: !0, children: [
3292
+ u,
3293
+ /* @__PURE__ */ n.jsxs(F.Root, { children: [
3294
+ /* @__PURE__ */ n.jsx(F.Header, { children: /* @__PURE__ */ n.jsx(F.Title, { icon: /* @__PURE__ */ n.jsx(Ee, { role: "presentation" }), children: /* @__PURE__ */ n.jsx($r, { children: t("termsAndConditions.title") }) }) }),
3295
+ /* @__PURE__ */ n.jsx(F.Body, { children: /* @__PURE__ */ n.jsxs(wt, { ref: p, id: "tc-form", onSubmit: m, children: [
3296
+ /* @__PURE__ */ n.jsxs(Gr, { children: [
3297
+ t("termsAndConditions.description"),
3298
+ o.acceptedTC && /* @__PURE__ */ n.jsx(Zr, { children: y })
3299
+ ] }),
3300
+ v.map(({ tcCode: C, title: _, URL: w }) => /* @__PURE__ */ n.jsx(
3301
+ Q,
3302
+ {
3303
+ id: C,
3304
+ value: C,
3305
+ name: "acceptedTC",
3306
+ variant: "primary",
3307
+ children: /* @__PURE__ */ n.jsxs(Q.Content, { children: [
3308
+ /* @__PURE__ */ n.jsx(Hr, { children: _ }),
3309
+ /* @__PURE__ */ n.jsx(Vr, { href: w, children: t("termsAndConditions.action", { title: _ }) })
3310
+ ] })
3311
+ },
3312
+ C
3313
+ ))
3314
+ ] }) }),
3315
+ /* @__PURE__ */ n.jsxs(F.Footer, { children: [
3316
+ /* @__PURE__ */ n.jsx(
3317
+ "a",
3318
+ {
3319
+ className: P("button", "button--secondary", "button--terms-and-conditions"),
3320
+ href: `${s}/logout?redirectUrl=${e}`,
3321
+ children: t("logout")
3322
+ }
3323
+ ),
3324
+ /* @__PURE__ */ n.jsx($, { form: "tc-form", type: "submit", variant: "primary", children: t("confirm") })
3325
+ ] })
3326
+ ] })
3327
+ ] }) : /* @__PURE__ */ n.jsx(n.Fragment, {});
3328
+ }, Xr = d.forwardRef(({ children: e, ...t }, s) => /* @__PURE__ */ n.jsx("form", { className: "form--tc", ref: s, ...t, children: e }));
3329
+ Xr.displayName = "TermsAndConditionsForm";
3330
+ const Ir = new Je(), tn = ({ environment: e, redirectUrl: t, apiUrl: s, position: r, bouMenuItems: i }) => /* @__PURE__ */ n.jsx(Et, { environment: e, children: /* @__PURE__ */ n.jsx(Rr, { apiUrl: s, redirectUrl: t, children: /* @__PURE__ */ n.jsxs(ts, { client: Ir, children: [
3331
+ /* @__PURE__ */ n.jsx(Tr, { position: r, bouMenuItems: i }),
3332
+ /* @__PURE__ */ n.jsx(Jr, { redirectUrl: t })
3333
+ ] }) }) });
3334
+ export {
3335
+ tn as default
3336
+ };