@myxtra/authentication-green 2.18.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var At = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var a = (e, t, s) => (
|
|
6
|
-
var
|
|
4
|
+
var nt = (e, t, s) => t.has(e) || At("Cannot " + s);
|
|
5
|
+
var a = (e, t, s) => (nt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), y = (e, t, s) => t.has(e) ? At("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), p = (e, t, s, r) => (nt(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), w = (e, t, s) => (nt(e, t, "access private method"), s);
|
|
6
|
+
var Je = (e, t, s, r) => ({
|
|
7
7
|
set _(n) {
|
|
8
8
|
p(e, t, n, s);
|
|
9
9
|
},
|
|
@@ -11,8 +11,8 @@ var Ye = (e, t, s, r) => ({
|
|
|
11
11
|
return a(e, t, r);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import { r as f, j as i, u as
|
|
15
|
-
var
|
|
14
|
+
import { r as f, j as i, u as Hs, a as Ks, b as pe, g as jt, P as Nt, c as ss, d as Gs, e as qs, E as Ws, C as Vs } from "./index-X1PCnU9t.js";
|
|
15
|
+
var Ke = class {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
18
18
|
}
|
|
@@ -28,25 +28,25 @@ var He = class {
|
|
|
28
28
|
}
|
|
29
29
|
onUnsubscribe() {
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, He = typeof window > "u" || "Deno" in globalThis;
|
|
32
32
|
function $() {
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function $s(e, t) {
|
|
35
35
|
return typeof e == "function" ? e(t) : e;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ot(e) {
|
|
38
38
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function rs(e, t) {
|
|
41
41
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Ee(e, t) {
|
|
44
44
|
return typeof e == "function" ? e(t) : e;
|
|
45
45
|
}
|
|
46
46
|
function Y(e, t) {
|
|
47
47
|
return typeof e == "function" ? e(t) : e;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Mt(e, t) {
|
|
50
50
|
const {
|
|
51
51
|
type: s = "all",
|
|
52
52
|
exact: r,
|
|
@@ -57,59 +57,59 @@ function Nt(e, t) {
|
|
|
57
57
|
} = e;
|
|
58
58
|
if (o) {
|
|
59
59
|
if (r) {
|
|
60
|
-
if (t.queryHash !==
|
|
60
|
+
if (t.queryHash !== _t(o, t.options))
|
|
61
61
|
return !1;
|
|
62
|
-
} else if (!
|
|
62
|
+
} else if (!qe(t.queryKey, o))
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
65
|
if (s !== "all") {
|
|
66
|
-
const
|
|
67
|
-
if (s === "active" && !
|
|
66
|
+
const h = t.isActive();
|
|
67
|
+
if (s === "active" && !h || s === "inactive" && h)
|
|
68
68
|
return !1;
|
|
69
69
|
}
|
|
70
70
|
return !(typeof c == "boolean" && t.isStale() !== c || n && n !== t.state.fetchStatus || l && !l(t));
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Lt(e, t) {
|
|
73
73
|
const { exact: s, status: r, predicate: n, mutationKey: l } = e;
|
|
74
74
|
if (l) {
|
|
75
75
|
if (!t.options.mutationKey)
|
|
76
76
|
return !1;
|
|
77
77
|
if (s) {
|
|
78
|
-
if (
|
|
78
|
+
if (we(t.options.mutationKey) !== we(l))
|
|
79
79
|
return !1;
|
|
80
|
-
} else if (!
|
|
80
|
+
} else if (!qe(t.options.mutationKey, l))
|
|
81
81
|
return !1;
|
|
82
82
|
}
|
|
83
83
|
return !(r && t.state.status !== r || n && !n(t));
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return ((t == null ? void 0 : t.queryKeyHashFn) ||
|
|
85
|
+
function _t(e, t) {
|
|
86
|
+
return ((t == null ? void 0 : t.queryKeyHashFn) || we)(e);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function we(e) {
|
|
89
89
|
return JSON.stringify(
|
|
90
90
|
e,
|
|
91
|
-
(t, s) =>
|
|
91
|
+
(t, s) => lt(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !
|
|
94
|
+
function qe(e, t) {
|
|
95
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !qe(e[s], t[s])) : !1;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function is(e, t) {
|
|
98
98
|
if (e === t)
|
|
99
99
|
return e;
|
|
100
100
|
const s = Rt(e) && Rt(t);
|
|
101
|
-
if (s ||
|
|
101
|
+
if (s || lt(e) && lt(t)) {
|
|
102
102
|
const r = s ? e : Object.keys(e), n = r.length, l = s ? t : Object.keys(t), o = l.length, c = s ? [] : {};
|
|
103
|
-
let
|
|
103
|
+
let h = 0;
|
|
104
104
|
for (let m = 0; m < o; m++) {
|
|
105
|
-
const
|
|
106
|
-
(!s && r.includes(
|
|
105
|
+
const d = s ? m : l[m];
|
|
106
|
+
(!s && r.includes(d) || s) && e[d] === void 0 && t[d] === void 0 ? (c[d] = void 0, h++) : (c[d] = is(e[d], t[d]), c[d] === e[d] && e[d] !== void 0 && h++);
|
|
107
107
|
}
|
|
108
|
-
return n === o &&
|
|
108
|
+
return n === o && h === n ? e : c;
|
|
109
109
|
}
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function et(e, t) {
|
|
113
113
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
114
114
|
return !1;
|
|
115
115
|
for (const s in e)
|
|
@@ -120,7 +120,7 @@ function Be(e, t) {
|
|
|
120
120
|
function Rt(e) {
|
|
121
121
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function lt(e) {
|
|
124
124
|
if (!Ot(e))
|
|
125
125
|
return !1;
|
|
126
126
|
const t = e.constructor;
|
|
@@ -132,34 +132,34 @@ function ot(e) {
|
|
|
132
132
|
function Ot(e) {
|
|
133
133
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Zs(e) {
|
|
136
136
|
return new Promise((t) => {
|
|
137
137
|
setTimeout(t, e);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ?
|
|
140
|
+
function ct(e, t, s) {
|
|
141
|
+
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ? is(e, t) : t;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function zs(e, t, s = 0) {
|
|
144
144
|
const r = [...e, t];
|
|
145
145
|
return s && r.length > s ? r.slice(1) : r;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Ys(e, t, s = 0) {
|
|
148
148
|
const r = [t, ...e];
|
|
149
149
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function
|
|
153
|
-
return !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn ===
|
|
151
|
+
var ns = Symbol();
|
|
152
|
+
function as(e, t) {
|
|
153
|
+
return !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === ns ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
155
|
+
var me, ae, Pe, $t, Js = ($t = class extends Ke {
|
|
156
156
|
constructor() {
|
|
157
157
|
super();
|
|
158
|
-
y(this,
|
|
158
|
+
y(this, me);
|
|
159
159
|
y(this, ae);
|
|
160
|
-
y(this,
|
|
161
|
-
p(this,
|
|
162
|
-
if (!
|
|
160
|
+
y(this, Pe);
|
|
161
|
+
p(this, Pe, (t) => {
|
|
162
|
+
if (!He && window.addEventListener) {
|
|
163
163
|
const s = () => t();
|
|
164
164
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
165
165
|
window.removeEventListener("visibilitychange", s);
|
|
@@ -168,7 +168,7 @@ var pe, ae, Ee, Vt, Ys = (Vt = class extends He {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
onSubscribe() {
|
|
171
|
-
a(this, ae) || this.setEventListener(a(this,
|
|
171
|
+
a(this, ae) || this.setEventListener(a(this, Pe));
|
|
172
172
|
}
|
|
173
173
|
onUnsubscribe() {
|
|
174
174
|
var t;
|
|
@@ -176,12 +176,12 @@ var pe, ae, Ee, Vt, Ys = (Vt = class extends He {
|
|
|
176
176
|
}
|
|
177
177
|
setEventListener(t) {
|
|
178
178
|
var s;
|
|
179
|
-
p(this,
|
|
179
|
+
p(this, Pe, t), (s = a(this, ae)) == null || s.call(this), p(this, ae, t((r) => {
|
|
180
180
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
181
181
|
}));
|
|
182
182
|
}
|
|
183
183
|
setFocused(t) {
|
|
184
|
-
a(this,
|
|
184
|
+
a(this, me) !== t && (p(this, me, t), this.onFocus());
|
|
185
185
|
}
|
|
186
186
|
onFocus() {
|
|
187
187
|
const t = this.isFocused();
|
|
@@ -191,16 +191,16 @@ var pe, ae, Ee, Vt, Ys = (Vt = class extends He {
|
|
|
191
191
|
}
|
|
192
192
|
isFocused() {
|
|
193
193
|
var t;
|
|
194
|
-
return typeof a(this,
|
|
194
|
+
return typeof a(this, me) == "boolean" ? a(this, me) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
195
195
|
}
|
|
196
|
-
},
|
|
196
|
+
}, me = new WeakMap(), ae = new WeakMap(), Pe = new WeakMap(), $t), St = new Js(), ke, oe, Ae, Zt, Xs = (Zt = class extends Ke {
|
|
197
197
|
constructor() {
|
|
198
198
|
super();
|
|
199
|
-
y(this,
|
|
199
|
+
y(this, ke, !0);
|
|
200
200
|
y(this, oe);
|
|
201
|
-
y(this,
|
|
202
|
-
p(this,
|
|
203
|
-
if (!
|
|
201
|
+
y(this, Ae);
|
|
202
|
+
p(this, Ae, (t) => {
|
|
203
|
+
if (!He && window.addEventListener) {
|
|
204
204
|
const s = () => t(!0), r = () => t(!1);
|
|
205
205
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
206
206
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
@@ -209,7 +209,7 @@ var pe, ae, Ee, Vt, Ys = (Vt = class extends He {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
onSubscribe() {
|
|
212
|
-
a(this, oe) || this.setEventListener(a(this,
|
|
212
|
+
a(this, oe) || this.setEventListener(a(this, Ae));
|
|
213
213
|
}
|
|
214
214
|
onUnsubscribe() {
|
|
215
215
|
var t;
|
|
@@ -217,43 +217,43 @@ var pe, ae, Ee, Vt, Ys = (Vt = class extends He {
|
|
|
217
217
|
}
|
|
218
218
|
setEventListener(t) {
|
|
219
219
|
var s;
|
|
220
|
-
p(this,
|
|
220
|
+
p(this, Ae, t), (s = a(this, oe)) == null || s.call(this), p(this, oe, t(this.setOnline.bind(this)));
|
|
221
221
|
}
|
|
222
222
|
setOnline(t) {
|
|
223
|
-
a(this,
|
|
223
|
+
a(this, ke) !== t && (p(this, ke, t), this.listeners.forEach((r) => {
|
|
224
224
|
r(t);
|
|
225
225
|
}));
|
|
226
226
|
}
|
|
227
227
|
isOnline() {
|
|
228
|
-
return a(this,
|
|
228
|
+
return a(this, ke);
|
|
229
229
|
}
|
|
230
|
-
},
|
|
231
|
-
function
|
|
230
|
+
}, ke = new WeakMap(), oe = new WeakMap(), Ae = new WeakMap(), Zt), tt = new Xs();
|
|
231
|
+
function Is(e) {
|
|
232
232
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return (e ?? "online") === "online" ?
|
|
234
|
+
function os(e) {
|
|
235
|
+
return (e ?? "online") === "online" ? tt.isOnline() : !0;
|
|
236
236
|
}
|
|
237
|
-
var
|
|
237
|
+
var ls = class extends Error {
|
|
238
238
|
constructor(e) {
|
|
239
239
|
super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
|
-
function
|
|
243
|
-
return e instanceof
|
|
242
|
+
function at(e) {
|
|
243
|
+
return e instanceof ls;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function cs(e) {
|
|
246
246
|
let t = !1, s = 0, r = !1, n, l, o;
|
|
247
247
|
const c = new Promise((C, j) => {
|
|
248
248
|
l = C, o = j;
|
|
249
|
-
}),
|
|
249
|
+
}), h = (C) => {
|
|
250
250
|
var j;
|
|
251
|
-
r || (S(new
|
|
251
|
+
r || (S(new ls(C)), (j = e.abort) == null || j.call(e));
|
|
252
252
|
}, m = () => {
|
|
253
253
|
t = !0;
|
|
254
|
-
},
|
|
254
|
+
}, d = () => {
|
|
255
255
|
t = !1;
|
|
256
|
-
}, u = () =>
|
|
256
|
+
}, u = () => St.isFocused() && (e.networkMode === "always" || tt.isOnline()) && e.canRun(), v = () => os(e.networkMode) && e.canRun(), g = (C) => {
|
|
257
257
|
var j;
|
|
258
258
|
r || (r = !0, (j = e.onSuccess) == null || j.call(e, C), n == null || n(), l(C));
|
|
259
259
|
}, S = (C) => {
|
|
@@ -281,27 +281,27 @@ function ls(e) {
|
|
|
281
281
|
var k;
|
|
282
282
|
if (r)
|
|
283
283
|
return;
|
|
284
|
-
const M = e.retry ?? (
|
|
284
|
+
const M = e.retry ?? (He ? 0 : 3), F = e.retryDelay ?? Is, J = typeof F == "function" ? F(s, b) : F, te = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, b);
|
|
285
285
|
if (t || !te) {
|
|
286
286
|
S(b);
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
s++, (k = e.onFail) == null || k.call(e, s, b),
|
|
289
|
+
s++, (k = e.onFail) == null || k.call(e, s, b), Zs(J).then(() => u() ? void 0 : _()).then(() => {
|
|
290
290
|
t ? S(b) : P();
|
|
291
291
|
});
|
|
292
292
|
});
|
|
293
293
|
};
|
|
294
294
|
return {
|
|
295
295
|
promise: c,
|
|
296
|
-
cancel:
|
|
296
|
+
cancel: h,
|
|
297
297
|
continue: () => (n == null || n(), c),
|
|
298
298
|
cancelRetry: m,
|
|
299
|
-
continueRetry:
|
|
299
|
+
continueRetry: d,
|
|
300
300
|
canStart: v,
|
|
301
301
|
start: () => (v() ? P() : _().then(P), c)
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Bs() {
|
|
305
305
|
let e = [], t = 0, s = (c) => {
|
|
306
306
|
c();
|
|
307
307
|
}, r = (c) => {
|
|
@@ -315,29 +315,29 @@ function Is() {
|
|
|
315
315
|
const c = e;
|
|
316
316
|
e = [], c.length && n(() => {
|
|
317
317
|
r(() => {
|
|
318
|
-
c.forEach((
|
|
319
|
-
s(
|
|
318
|
+
c.forEach((h) => {
|
|
319
|
+
s(h);
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
324
|
return {
|
|
325
325
|
batch: (c) => {
|
|
326
|
-
let
|
|
326
|
+
let h;
|
|
327
327
|
t++;
|
|
328
328
|
try {
|
|
329
|
-
|
|
329
|
+
h = c();
|
|
330
330
|
} finally {
|
|
331
331
|
t--, t || o();
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return h;
|
|
334
334
|
},
|
|
335
335
|
/**
|
|
336
336
|
* All calls to the wrapped function will be batched.
|
|
337
337
|
*/
|
|
338
|
-
batchCalls: (c) => (...
|
|
338
|
+
batchCalls: (c) => (...h) => {
|
|
339
339
|
l(() => {
|
|
340
|
-
c(...
|
|
340
|
+
c(...h);
|
|
341
341
|
});
|
|
342
342
|
},
|
|
343
343
|
schedule: l,
|
|
@@ -360,38 +360,38 @@ function Is() {
|
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
var D =
|
|
363
|
+
var D = Bs(), ve, zt, us = (zt = class {
|
|
364
364
|
constructor() {
|
|
365
|
-
y(this,
|
|
365
|
+
y(this, ve);
|
|
366
366
|
}
|
|
367
367
|
destroy() {
|
|
368
368
|
this.clearGcTimeout();
|
|
369
369
|
}
|
|
370
370
|
scheduleGc() {
|
|
371
|
-
this.clearGcTimeout(),
|
|
371
|
+
this.clearGcTimeout(), ot(this.gcTime) && p(this, ve, setTimeout(() => {
|
|
372
372
|
this.optionalRemove();
|
|
373
373
|
}, this.gcTime));
|
|
374
374
|
}
|
|
375
375
|
updateGcTime(e) {
|
|
376
376
|
this.gcTime = Math.max(
|
|
377
377
|
this.gcTime || 0,
|
|
378
|
-
e ?? (
|
|
378
|
+
e ?? (He ? 1 / 0 : 5 * 60 * 1e3)
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
381
|
clearGcTimeout() {
|
|
382
|
-
a(this,
|
|
382
|
+
a(this, ve) && (clearTimeout(a(this, ve)), p(this, ve, void 0));
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, ve = new WeakMap(), zt), Ne, Me, V, T, We, ge, z, se, Yt, er = (Yt = class extends us {
|
|
385
385
|
constructor(t) {
|
|
386
386
|
super();
|
|
387
387
|
y(this, z);
|
|
388
|
-
y(this, Ae);
|
|
389
388
|
y(this, Ne);
|
|
389
|
+
y(this, Me);
|
|
390
390
|
y(this, V);
|
|
391
391
|
y(this, T);
|
|
392
|
-
y(this,
|
|
393
|
-
y(this,
|
|
394
|
-
p(this,
|
|
392
|
+
y(this, We);
|
|
393
|
+
y(this, ge);
|
|
394
|
+
p(this, ge, !1), p(this, We, t.defaultOptions), this.setOptions(t.options), this.observers = [], p(this, V, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, p(this, Ne, tr(this.options)), this.state = t.state ?? a(this, Ne), this.scheduleGc();
|
|
395
395
|
}
|
|
396
396
|
get meta() {
|
|
397
397
|
return this.options.meta;
|
|
@@ -401,13 +401,13 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
401
401
|
return (t = a(this, T)) == null ? void 0 : t.promise;
|
|
402
402
|
}
|
|
403
403
|
setOptions(t) {
|
|
404
|
-
this.options = { ...a(this,
|
|
404
|
+
this.options = { ...a(this, We), ...t }, this.updateGcTime(this.options.gcTime);
|
|
405
405
|
}
|
|
406
406
|
optionalRemove() {
|
|
407
407
|
!this.observers.length && this.state.fetchStatus === "idle" && a(this, V).remove(this);
|
|
408
408
|
}
|
|
409
409
|
setData(t, s) {
|
|
410
|
-
const r =
|
|
410
|
+
const r = ct(this.state.data, t, this.options);
|
|
411
411
|
return w(this, z, se).call(this, {
|
|
412
412
|
data: r,
|
|
413
413
|
type: "success",
|
|
@@ -427,7 +427,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
427
427
|
super.destroy(), this.cancel({ silent: !0 });
|
|
428
428
|
}
|
|
429
429
|
reset() {
|
|
430
|
-
this.destroy(), this.setState(a(this,
|
|
430
|
+
this.destroy(), this.setState(a(this, Ne));
|
|
431
431
|
}
|
|
432
432
|
isActive() {
|
|
433
433
|
return this.observers.some(
|
|
@@ -443,7 +443,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
443
443
|
) : this.state.data === void 0;
|
|
444
444
|
}
|
|
445
445
|
isStaleByTime(t = 0) {
|
|
446
|
-
return this.state.isInvalidated || this.state.data === void 0 || !
|
|
446
|
+
return this.state.isInvalidated || this.state.data === void 0 || !rs(this.state.dataUpdatedAt, t);
|
|
447
447
|
}
|
|
448
448
|
onFocus() {
|
|
449
449
|
var s;
|
|
@@ -459,7 +459,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
459
459
|
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), a(this, V).notify({ type: "observerAdded", query: this, observer: t }));
|
|
460
460
|
}
|
|
461
461
|
removeObserver(t) {
|
|
462
|
-
this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (a(this, T) && (a(this,
|
|
462
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (a(this, T) && (a(this, ge) ? a(this, T).cancel({ revert: !0 }) : a(this, T).cancelRetry()), this.scheduleGc()), a(this, V).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
463
463
|
}
|
|
464
464
|
getObserversCount() {
|
|
465
465
|
return this.observers.length;
|
|
@@ -468,7 +468,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
468
468
|
this.state.isInvalidated || w(this, z, se).call(this, { type: "invalidate" });
|
|
469
469
|
}
|
|
470
470
|
fetch(t, s) {
|
|
471
|
-
var
|
|
471
|
+
var h, m, d;
|
|
472
472
|
if (this.state.fetchStatus !== "idle") {
|
|
473
473
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
474
474
|
this.cancel({ silent: !0 });
|
|
@@ -482,14 +482,14 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
482
482
|
const r = new AbortController(), n = (u) => {
|
|
483
483
|
Object.defineProperty(u, "signal", {
|
|
484
484
|
enumerable: !0,
|
|
485
|
-
get: () => (p(this,
|
|
485
|
+
get: () => (p(this, ge, !0), r.signal)
|
|
486
486
|
});
|
|
487
487
|
}, l = () => {
|
|
488
|
-
const u =
|
|
488
|
+
const u = as(this.options, s), v = {
|
|
489
489
|
queryKey: this.queryKey,
|
|
490
490
|
meta: this.meta
|
|
491
491
|
};
|
|
492
|
-
return n(v), p(this,
|
|
492
|
+
return n(v), p(this, ge, !1), this.options.persister ? this.options.persister(
|
|
493
493
|
u,
|
|
494
494
|
v,
|
|
495
495
|
this
|
|
@@ -501,16 +501,16 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
501
501
|
state: this.state,
|
|
502
502
|
fetchFn: l
|
|
503
503
|
};
|
|
504
|
-
n(o), (
|
|
504
|
+
n(o), (h = this.options.behavior) == null || h.onFetch(
|
|
505
505
|
o,
|
|
506
506
|
this
|
|
507
|
-
), p(this,
|
|
507
|
+
), p(this, Me, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((m = o.fetchOptions) == null ? void 0 : m.meta)) && w(this, z, se).call(this, { type: "fetch", meta: (d = o.fetchOptions) == null ? void 0 : d.meta });
|
|
508
508
|
const c = (u) => {
|
|
509
509
|
var v, g, S, _;
|
|
510
|
-
|
|
510
|
+
at(u) && u.silent || w(this, z, se).call(this, {
|
|
511
511
|
type: "error",
|
|
512
512
|
error: u
|
|
513
|
-
}),
|
|
513
|
+
}), at(u) || ((g = (v = a(this, V).config).onError) == null || g.call(
|
|
514
514
|
v,
|
|
515
515
|
u,
|
|
516
516
|
this
|
|
@@ -521,7 +521,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
521
521
|
this
|
|
522
522
|
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
523
523
|
};
|
|
524
|
-
return p(this, T,
|
|
524
|
+
return p(this, T, cs({
|
|
525
525
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
526
526
|
fn: o.fetchFn,
|
|
527
527
|
abort: r.abort.bind(r),
|
|
@@ -560,7 +560,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
560
560
|
canRun: () => !0
|
|
561
561
|
})), a(this, T).start();
|
|
562
562
|
}
|
|
563
|
-
},
|
|
563
|
+
}, Ne = new WeakMap(), Me = new WeakMap(), V = new WeakMap(), T = new WeakMap(), We = new WeakMap(), ge = new WeakMap(), z = new WeakSet(), se = function(t) {
|
|
564
564
|
const s = (r) => {
|
|
565
565
|
switch (t.type) {
|
|
566
566
|
case "failed":
|
|
@@ -582,7 +582,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
582
582
|
case "fetch":
|
|
583
583
|
return {
|
|
584
584
|
...r,
|
|
585
|
-
...
|
|
585
|
+
...hs(r.data, this.options),
|
|
586
586
|
fetchMeta: t.meta ?? null
|
|
587
587
|
};
|
|
588
588
|
case "success":
|
|
@@ -602,7 +602,7 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
602
602
|
};
|
|
603
603
|
case "error":
|
|
604
604
|
const n = t.error;
|
|
605
|
-
return
|
|
605
|
+
return at(n) && n.revert && a(this, Me) ? { ...a(this, Me), fetchStatus: "idle" } : {
|
|
606
606
|
...r,
|
|
607
607
|
error: n,
|
|
608
608
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
@@ -629,19 +629,19 @@ var D = Is(), me, Zt, cs = (Zt = class {
|
|
|
629
629
|
r.onQueryUpdate();
|
|
630
630
|
}), a(this, V).notify({ query: this, type: "updated", action: t });
|
|
631
631
|
});
|
|
632
|
-
},
|
|
633
|
-
function
|
|
632
|
+
}, Yt);
|
|
633
|
+
function hs(e, t) {
|
|
634
634
|
return {
|
|
635
635
|
fetchFailureCount: 0,
|
|
636
636
|
fetchFailureReason: null,
|
|
637
|
-
fetchStatus:
|
|
637
|
+
fetchStatus: os(t.networkMode) ? "fetching" : "paused",
|
|
638
638
|
...e === void 0 && {
|
|
639
639
|
error: null,
|
|
640
640
|
status: "pending"
|
|
641
641
|
}
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function tr(e) {
|
|
645
645
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
646
646
|
return {
|
|
647
647
|
data: t,
|
|
@@ -658,16 +658,16 @@ function er(e) {
|
|
|
658
658
|
fetchStatus: "idle"
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
var X,
|
|
661
|
+
var X, Jt, sr = (Jt = class extends Ke {
|
|
662
662
|
constructor(t = {}) {
|
|
663
663
|
super();
|
|
664
664
|
y(this, X);
|
|
665
665
|
this.config = t, p(this, X, /* @__PURE__ */ new Map());
|
|
666
666
|
}
|
|
667
667
|
build(t, s, r) {
|
|
668
|
-
const n = s.queryKey, l = s.queryHash ??
|
|
668
|
+
const n = s.queryKey, l = s.queryHash ?? _t(n, s);
|
|
669
669
|
let o = this.get(l);
|
|
670
|
-
return o || (o = new
|
|
670
|
+
return o || (o = new er({
|
|
671
671
|
cache: this,
|
|
672
672
|
queryKey: n,
|
|
673
673
|
queryHash: l,
|
|
@@ -702,12 +702,12 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
702
702
|
find(t) {
|
|
703
703
|
const s = { exact: !0, ...t };
|
|
704
704
|
return this.getAll().find(
|
|
705
|
-
(r) =>
|
|
705
|
+
(r) => Mt(s, r)
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
708
|
findAll(t = {}) {
|
|
709
709
|
const s = this.getAll();
|
|
710
|
-
return Object.keys(t).length > 0 ? s.filter((r) =>
|
|
710
|
+
return Object.keys(t).length > 0 ? s.filter((r) => Mt(t, r)) : s;
|
|
711
711
|
}
|
|
712
712
|
notify(t) {
|
|
713
713
|
D.batch(() => {
|
|
@@ -730,14 +730,14 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
730
730
|
});
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
}, X = new WeakMap(),
|
|
733
|
+
}, X = new WeakMap(), Jt), I, U, ye, B, ne, Xt, rr = (Xt = class extends us {
|
|
734
734
|
constructor(t) {
|
|
735
735
|
super();
|
|
736
736
|
y(this, B);
|
|
737
737
|
y(this, I);
|
|
738
738
|
y(this, U);
|
|
739
|
-
y(this,
|
|
740
|
-
this.mutationId = t.mutationId, p(this, U, t.mutationCache), p(this, I, []), this.state = t.state ||
|
|
739
|
+
y(this, ye);
|
|
740
|
+
this.mutationId = t.mutationId, p(this, U, t.mutationCache), p(this, I, []), this.state = t.state || ds(), this.setOptions(t.options), this.scheduleGc();
|
|
741
741
|
}
|
|
742
742
|
setOptions(t) {
|
|
743
743
|
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
@@ -764,12 +764,12 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
764
764
|
}
|
|
765
765
|
continue() {
|
|
766
766
|
var t;
|
|
767
|
-
return ((t = a(this,
|
|
767
|
+
return ((t = a(this, ye)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
768
768
|
this.execute(this.state.variables);
|
|
769
769
|
}
|
|
770
770
|
async execute(t) {
|
|
771
|
-
var n, l, o, c,
|
|
772
|
-
p(this,
|
|
771
|
+
var n, l, o, c, h, m, d, u, v, g, S, _, P, C, j, b, M, F, J, te;
|
|
772
|
+
p(this, ye, cs({
|
|
773
773
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
774
774
|
onFail: (k, Z) => {
|
|
775
775
|
w(this, B, ne).call(this, { type: "failed", failureCount: k, error: Z });
|
|
@@ -785,7 +785,7 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
785
785
|
networkMode: this.options.networkMode,
|
|
786
786
|
canRun: () => a(this, U).canRun(this)
|
|
787
787
|
}));
|
|
788
|
-
const s = this.state.status === "pending", r = !a(this,
|
|
788
|
+
const s = this.state.status === "pending", r = !a(this, ye).canStart();
|
|
789
789
|
try {
|
|
790
790
|
if (!s) {
|
|
791
791
|
w(this, B, ne).call(this, { type: "pending", variables: t, isPaused: r }), await ((l = (n = a(this, U).config).onMutate) == null ? void 0 : l.call(
|
|
@@ -801,14 +801,14 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
801
801
|
isPaused: r
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
|
-
const k = await a(this,
|
|
805
|
-
return await ((m = (
|
|
806
|
-
|
|
804
|
+
const k = await a(this, ye).start();
|
|
805
|
+
return await ((m = (h = a(this, U).config).onSuccess) == null ? void 0 : m.call(
|
|
806
|
+
h,
|
|
807
807
|
k,
|
|
808
808
|
t,
|
|
809
809
|
this.state.context,
|
|
810
810
|
this
|
|
811
|
-
)), await ((u = (
|
|
811
|
+
)), await ((u = (d = this.options).onSuccess) == null ? void 0 : u.call(d, k, t, this.state.context)), await ((g = (v = a(this, U).config).onSettled) == null ? void 0 : g.call(
|
|
812
812
|
v,
|
|
813
813
|
k,
|
|
814
814
|
null,
|
|
@@ -850,7 +850,7 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
850
850
|
a(this, U).runNext(this);
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
|
-
}, I = new WeakMap(), U = new WeakMap(),
|
|
853
|
+
}, I = new WeakMap(), U = new WeakMap(), ye = new WeakMap(), B = new WeakSet(), ne = function(t) {
|
|
854
854
|
const s = (r) => {
|
|
855
855
|
switch (t.type) {
|
|
856
856
|
case "failed":
|
|
@@ -913,8 +913,8 @@ var X, Yt, tr = (Yt = class extends He {
|
|
|
913
913
|
action: t
|
|
914
914
|
});
|
|
915
915
|
});
|
|
916
|
-
},
|
|
917
|
-
function
|
|
916
|
+
}, Xt);
|
|
917
|
+
function ds() {
|
|
918
918
|
return {
|
|
919
919
|
context: void 0,
|
|
920
920
|
data: void 0,
|
|
@@ -927,29 +927,29 @@ function hs() {
|
|
|
927
927
|
submittedAt: 0
|
|
928
928
|
};
|
|
929
929
|
}
|
|
930
|
-
var q,
|
|
930
|
+
var q, Ve, It, ir = (It = class extends Ke {
|
|
931
931
|
constructor(t = {}) {
|
|
932
932
|
super();
|
|
933
933
|
y(this, q);
|
|
934
|
-
y(this,
|
|
935
|
-
this.config = t, p(this, q, /* @__PURE__ */ new Map()), p(this,
|
|
934
|
+
y(this, Ve);
|
|
935
|
+
this.config = t, p(this, q, /* @__PURE__ */ new Map()), p(this, Ve, Date.now());
|
|
936
936
|
}
|
|
937
937
|
build(t, s, r) {
|
|
938
|
-
const n = new
|
|
938
|
+
const n = new rr({
|
|
939
939
|
mutationCache: this,
|
|
940
|
-
mutationId: ++
|
|
940
|
+
mutationId: ++Je(this, Ve)._,
|
|
941
941
|
options: t.defaultMutationOptions(s),
|
|
942
942
|
state: r
|
|
943
943
|
});
|
|
944
944
|
return this.add(n), n;
|
|
945
945
|
}
|
|
946
946
|
add(t) {
|
|
947
|
-
const s =
|
|
947
|
+
const s = Xe(t), r = a(this, q).get(s) ?? [];
|
|
948
948
|
r.push(t), a(this, q).set(s, r), this.notify({ type: "added", mutation: t });
|
|
949
949
|
}
|
|
950
950
|
remove(t) {
|
|
951
951
|
var r;
|
|
952
|
-
const s =
|
|
952
|
+
const s = Xe(t);
|
|
953
953
|
if (a(this, q).has(s)) {
|
|
954
954
|
const n = (r = a(this, q).get(s)) == null ? void 0 : r.filter((l) => l !== t);
|
|
955
955
|
n && (n.length === 0 ? a(this, q).delete(s) : a(this, q).set(s, n));
|
|
@@ -958,12 +958,12 @@ var q, We, Xt, rr = (Xt = class extends He {
|
|
|
958
958
|
}
|
|
959
959
|
canRun(t) {
|
|
960
960
|
var r;
|
|
961
|
-
const s = (r = a(this, q).get(
|
|
961
|
+
const s = (r = a(this, q).get(Xe(t))) == null ? void 0 : r.find((n) => n.state.status === "pending");
|
|
962
962
|
return !s || s === t;
|
|
963
963
|
}
|
|
964
964
|
runNext(t) {
|
|
965
965
|
var r;
|
|
966
|
-
const s = (r = a(this, q).get(
|
|
966
|
+
const s = (r = a(this, q).get(Xe(t))) == null ? void 0 : r.find((n) => n !== t && n.state.isPaused);
|
|
967
967
|
return (s == null ? void 0 : s.continue()) ?? Promise.resolve();
|
|
968
968
|
}
|
|
969
969
|
clear() {
|
|
@@ -979,11 +979,11 @@ var q, We, Xt, rr = (Xt = class extends He {
|
|
|
979
979
|
find(t) {
|
|
980
980
|
const s = { exact: !0, ...t };
|
|
981
981
|
return this.getAll().find(
|
|
982
|
-
(r) =>
|
|
982
|
+
(r) => Lt(s, r)
|
|
983
983
|
);
|
|
984
984
|
}
|
|
985
985
|
findAll(t = {}) {
|
|
986
|
-
return this.getAll().filter((s) =>
|
|
986
|
+
return this.getAll().filter((s) => Lt(t, s));
|
|
987
987
|
}
|
|
988
988
|
notify(t) {
|
|
989
989
|
D.batch(() => {
|
|
@@ -1000,17 +1000,17 @@ var q, We, Xt, rr = (Xt = class extends He {
|
|
|
1000
1000
|
)
|
|
1001
1001
|
);
|
|
1002
1002
|
}
|
|
1003
|
-
}, q = new WeakMap(),
|
|
1004
|
-
function
|
|
1003
|
+
}, q = new WeakMap(), Ve = new WeakMap(), It);
|
|
1004
|
+
function Xe(e) {
|
|
1005
1005
|
var t;
|
|
1006
1006
|
return ((t = e.options.scope) == null ? void 0 : t.id) ?? String(e.mutationId);
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function Ft(e) {
|
|
1009
1009
|
return {
|
|
1010
1010
|
onFetch: (t, s) => {
|
|
1011
|
-
var
|
|
1012
|
-
const r = t.options, n = (v = (u = (
|
|
1013
|
-
let c = { pages: [], pageParams: [] },
|
|
1011
|
+
var d, u, v, g, S;
|
|
1012
|
+
const r = t.options, n = (v = (u = (d = t.fetchOptions) == null ? void 0 : d.meta) == null ? void 0 : u.fetchMore) == null ? void 0 : v.direction, l = ((g = t.state.data) == null ? void 0 : g.pages) || [], o = ((S = t.state.data) == null ? void 0 : S.pageParams) || [];
|
|
1013
|
+
let c = { pages: [], pageParams: [] }, h = 0;
|
|
1014
1014
|
const m = async () => {
|
|
1015
1015
|
let _ = !1;
|
|
1016
1016
|
const P = (b) => {
|
|
@@ -1020,7 +1020,7 @@ function Lt(e) {
|
|
|
1020
1020
|
_ = !0;
|
|
1021
1021
|
}), t.signal)
|
|
1022
1022
|
});
|
|
1023
|
-
}, C =
|
|
1023
|
+
}, C = as(t.options, t.fetchOptions), j = async (b, M, F) => {
|
|
1024
1024
|
if (_)
|
|
1025
1025
|
return Promise.reject();
|
|
1026
1026
|
if (M == null && b.pages.length)
|
|
@@ -1034,14 +1034,14 @@ function Lt(e) {
|
|
|
1034
1034
|
P(J);
|
|
1035
1035
|
const te = await C(
|
|
1036
1036
|
J
|
|
1037
|
-
), { maxPages: k } = t.options, Z = F ?
|
|
1037
|
+
), { maxPages: k } = t.options, Z = F ? Ys : zs;
|
|
1038
1038
|
return {
|
|
1039
1039
|
pages: Z(b.pages, te, k),
|
|
1040
1040
|
pageParams: Z(b.pageParams, M, k)
|
|
1041
1041
|
};
|
|
1042
1042
|
};
|
|
1043
1043
|
if (n && l.length) {
|
|
1044
|
-
const b = n === "backward", M = b ?
|
|
1044
|
+
const b = n === "backward", M = b ? nr : Dt, F = {
|
|
1045
1045
|
pages: l,
|
|
1046
1046
|
pageParams: o
|
|
1047
1047
|
}, J = M(r, F);
|
|
@@ -1049,11 +1049,11 @@ function Lt(e) {
|
|
|
1049
1049
|
} else {
|
|
1050
1050
|
const b = e ?? l.length;
|
|
1051
1051
|
do {
|
|
1052
|
-
const M =
|
|
1053
|
-
if (
|
|
1052
|
+
const M = h === 0 ? o[0] ?? r.initialPageParam : Dt(r, c);
|
|
1053
|
+
if (h > 0 && M == null)
|
|
1054
1054
|
break;
|
|
1055
|
-
c = await j(c, M),
|
|
1056
|
-
} while (
|
|
1055
|
+
c = await j(c, M), h++;
|
|
1056
|
+
} while (h < b);
|
|
1057
1057
|
}
|
|
1058
1058
|
return c;
|
|
1059
1059
|
};
|
|
@@ -1073,7 +1073,7 @@ function Lt(e) {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function Dt(e, { pages: t, pageParams: s }) {
|
|
1077
1077
|
const r = t.length - 1;
|
|
1078
1078
|
return t.length > 0 ? e.getNextPageParam(
|
|
1079
1079
|
t[r],
|
|
@@ -1082,35 +1082,35 @@ function Ft(e, { pages: t, pageParams: s }) {
|
|
|
1082
1082
|
s
|
|
1083
1083
|
) : void 0;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function nr(e, { pages: t, pageParams: s }) {
|
|
1086
1086
|
var r;
|
|
1087
1087
|
return t.length > 0 ? (r = e.getPreviousPageParam) == null ? void 0 : r.call(e, t[0], t, s[0], s) : void 0;
|
|
1088
1088
|
}
|
|
1089
|
-
var
|
|
1089
|
+
var R, le, ce, Le, Re, ue, Oe, Fe, Bt, fs = (Bt = class {
|
|
1090
1090
|
constructor(e = {}) {
|
|
1091
|
-
y(this,
|
|
1091
|
+
y(this, R);
|
|
1092
1092
|
y(this, le);
|
|
1093
1093
|
y(this, ce);
|
|
1094
|
-
y(this,
|
|
1094
|
+
y(this, Le);
|
|
1095
1095
|
y(this, Re);
|
|
1096
1096
|
y(this, ue);
|
|
1097
1097
|
y(this, Oe);
|
|
1098
|
-
y(this,
|
|
1099
|
-
p(this,
|
|
1098
|
+
y(this, Fe);
|
|
1099
|
+
p(this, R, e.queryCache || new sr()), p(this, le, e.mutationCache || new ir()), p(this, ce, e.defaultOptions || {}), p(this, Le, /* @__PURE__ */ new Map()), p(this, Re, /* @__PURE__ */ new Map()), p(this, ue, 0);
|
|
1100
1100
|
}
|
|
1101
1101
|
mount() {
|
|
1102
|
-
|
|
1103
|
-
e && (await this.resumePausedMutations(), a(this,
|
|
1104
|
-
})), p(this,
|
|
1105
|
-
e && (await this.resumePausedMutations(), a(this,
|
|
1102
|
+
Je(this, ue)._++, a(this, ue) === 1 && (p(this, Oe, St.subscribe(async (e) => {
|
|
1103
|
+
e && (await this.resumePausedMutations(), a(this, R).onFocus());
|
|
1104
|
+
})), p(this, Fe, tt.subscribe(async (e) => {
|
|
1105
|
+
e && (await this.resumePausedMutations(), a(this, R).onOnline());
|
|
1106
1106
|
})));
|
|
1107
1107
|
}
|
|
1108
1108
|
unmount() {
|
|
1109
1109
|
var e, t;
|
|
1110
|
-
|
|
1110
|
+
Je(this, ue)._--, a(this, ue) === 0 && ((e = a(this, Oe)) == null || e.call(this), p(this, Oe, void 0), (t = a(this, Fe)) == null || t.call(this), p(this, Fe, void 0));
|
|
1111
1111
|
}
|
|
1112
1112
|
isFetching(e) {
|
|
1113
|
-
return a(this,
|
|
1113
|
+
return a(this, R).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
1114
1114
|
}
|
|
1115
1115
|
isMutating(e) {
|
|
1116
1116
|
return a(this, le).findAll({ ...e, status: "pending" }).length;
|
|
@@ -1118,33 +1118,33 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1118
1118
|
getQueryData(e) {
|
|
1119
1119
|
var s;
|
|
1120
1120
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
1121
|
-
return (s = a(this,
|
|
1121
|
+
return (s = a(this, R).get(t.queryHash)) == null ? void 0 : s.state.data;
|
|
1122
1122
|
}
|
|
1123
1123
|
ensureQueryData(e) {
|
|
1124
1124
|
const t = this.getQueryData(e.queryKey);
|
|
1125
1125
|
if (t === void 0)
|
|
1126
1126
|
return this.fetchQuery(e);
|
|
1127
1127
|
{
|
|
1128
|
-
const s = this.defaultQueryOptions(e), r = a(this,
|
|
1129
|
-
return e.revalidateIfStale && r.isStaleByTime(
|
|
1128
|
+
const s = this.defaultQueryOptions(e), r = a(this, R).build(this, s);
|
|
1129
|
+
return e.revalidateIfStale && r.isStaleByTime(Ee(s.staleTime, r)) && this.prefetchQuery(s), Promise.resolve(t);
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
1132
|
getQueriesData(e) {
|
|
1133
|
-
return a(this,
|
|
1133
|
+
return a(this, R).findAll(e).map(({ queryKey: t, state: s }) => {
|
|
1134
1134
|
const r = s.data;
|
|
1135
1135
|
return [t, r];
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
1138
|
setQueryData(e, t, s) {
|
|
1139
|
-
const r = this.defaultQueryOptions({ queryKey: e }), n = a(this,
|
|
1139
|
+
const r = this.defaultQueryOptions({ queryKey: e }), n = a(this, R).get(
|
|
1140
1140
|
r.queryHash
|
|
1141
|
-
), l = n == null ? void 0 : n.state.data, o =
|
|
1141
|
+
), l = n == null ? void 0 : n.state.data, o = $s(t, l);
|
|
1142
1142
|
if (o !== void 0)
|
|
1143
|
-
return a(this,
|
|
1143
|
+
return a(this, R).build(this, r).setData(o, { ...s, manual: !0 });
|
|
1144
1144
|
}
|
|
1145
1145
|
setQueriesData(e, t, s) {
|
|
1146
1146
|
return D.batch(
|
|
1147
|
-
() => a(this,
|
|
1147
|
+
() => a(this, R).findAll(e).map(({ queryKey: r }) => [
|
|
1148
1148
|
r,
|
|
1149
1149
|
this.setQueryData(r, t, s)
|
|
1150
1150
|
])
|
|
@@ -1153,10 +1153,10 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1153
1153
|
getQueryState(e) {
|
|
1154
1154
|
var s;
|
|
1155
1155
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
1156
|
-
return (s = a(this,
|
|
1156
|
+
return (s = a(this, R).get(t.queryHash)) == null ? void 0 : s.state;
|
|
1157
1157
|
}
|
|
1158
1158
|
removeQueries(e) {
|
|
1159
|
-
const t = a(this,
|
|
1159
|
+
const t = a(this, R);
|
|
1160
1160
|
D.batch(() => {
|
|
1161
1161
|
t.findAll(e).forEach((s) => {
|
|
1162
1162
|
t.remove(s);
|
|
@@ -1164,7 +1164,7 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1164
1164
|
});
|
|
1165
1165
|
}
|
|
1166
1166
|
resetQueries(e, t) {
|
|
1167
|
-
const s = a(this,
|
|
1167
|
+
const s = a(this, R), r = {
|
|
1168
1168
|
type: "active",
|
|
1169
1169
|
...e
|
|
1170
1170
|
};
|
|
@@ -1174,13 +1174,13 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
cancelQueries(e = {}, t = {}) {
|
|
1176
1176
|
const s = { revert: !0, ...t }, r = D.batch(
|
|
1177
|
-
() => a(this,
|
|
1177
|
+
() => a(this, R).findAll(e).map((n) => n.cancel(s))
|
|
1178
1178
|
);
|
|
1179
1179
|
return Promise.all(r).then($).catch($);
|
|
1180
1180
|
}
|
|
1181
1181
|
invalidateQueries(e = {}, t = {}) {
|
|
1182
1182
|
return D.batch(() => {
|
|
1183
|
-
if (a(this,
|
|
1183
|
+
if (a(this, R).findAll(e).forEach((r) => {
|
|
1184
1184
|
r.invalidate();
|
|
1185
1185
|
}), e.refetchType === "none")
|
|
1186
1186
|
return Promise.resolve();
|
|
@@ -1196,7 +1196,7 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1196
1196
|
...t,
|
|
1197
1197
|
cancelRefetch: (t == null ? void 0 : t.cancelRefetch) ?? !0
|
|
1198
1198
|
}, r = D.batch(
|
|
1199
|
-
() => a(this,
|
|
1199
|
+
() => a(this, R).findAll(e).filter((n) => !n.isDisabled()).map((n) => {
|
|
1200
1200
|
let l = n.fetch(void 0, s);
|
|
1201
1201
|
return s.throwOnError || (l = l.catch($)), n.state.fetchStatus === "paused" ? Promise.resolve() : l;
|
|
1202
1202
|
})
|
|
@@ -1206,28 +1206,28 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1206
1206
|
fetchQuery(e) {
|
|
1207
1207
|
const t = this.defaultQueryOptions(e);
|
|
1208
1208
|
t.retry === void 0 && (t.retry = !1);
|
|
1209
|
-
const s = a(this,
|
|
1209
|
+
const s = a(this, R).build(this, t);
|
|
1210
1210
|
return s.isStaleByTime(
|
|
1211
|
-
|
|
1211
|
+
Ee(t.staleTime, s)
|
|
1212
1212
|
) ? s.fetch(t) : Promise.resolve(s.state.data);
|
|
1213
1213
|
}
|
|
1214
1214
|
prefetchQuery(e) {
|
|
1215
1215
|
return this.fetchQuery(e).then($).catch($);
|
|
1216
1216
|
}
|
|
1217
1217
|
fetchInfiniteQuery(e) {
|
|
1218
|
-
return e.behavior =
|
|
1218
|
+
return e.behavior = Ft(e.pages), this.fetchQuery(e);
|
|
1219
1219
|
}
|
|
1220
1220
|
prefetchInfiniteQuery(e) {
|
|
1221
1221
|
return this.fetchInfiniteQuery(e).then($).catch($);
|
|
1222
1222
|
}
|
|
1223
1223
|
ensureInfiniteQueryData(e) {
|
|
1224
|
-
return e.behavior =
|
|
1224
|
+
return e.behavior = Ft(e.pages), this.ensureQueryData(e);
|
|
1225
1225
|
}
|
|
1226
1226
|
resumePausedMutations() {
|
|
1227
|
-
return
|
|
1227
|
+
return tt.isOnline() ? a(this, le).resumePausedMutations() : Promise.resolve();
|
|
1228
1228
|
}
|
|
1229
1229
|
getQueryCache() {
|
|
1230
|
-
return a(this,
|
|
1230
|
+
return a(this, R);
|
|
1231
1231
|
}
|
|
1232
1232
|
getMutationCache() {
|
|
1233
1233
|
return a(this, le);
|
|
@@ -1239,20 +1239,20 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1239
1239
|
p(this, ce, e);
|
|
1240
1240
|
}
|
|
1241
1241
|
setQueryDefaults(e, t) {
|
|
1242
|
-
a(this,
|
|
1242
|
+
a(this, Le).set(we(e), {
|
|
1243
1243
|
queryKey: e,
|
|
1244
1244
|
defaultOptions: t
|
|
1245
1245
|
});
|
|
1246
1246
|
}
|
|
1247
1247
|
getQueryDefaults(e) {
|
|
1248
|
-
const t = [...a(this,
|
|
1248
|
+
const t = [...a(this, Le).values()];
|
|
1249
1249
|
let s = {};
|
|
1250
1250
|
return t.forEach((r) => {
|
|
1251
|
-
|
|
1251
|
+
qe(e, r.queryKey) && (s = { ...s, ...r.defaultOptions });
|
|
1252
1252
|
}), s;
|
|
1253
1253
|
}
|
|
1254
1254
|
setMutationDefaults(e, t) {
|
|
1255
|
-
a(this, Re).set(
|
|
1255
|
+
a(this, Re).set(we(e), {
|
|
1256
1256
|
mutationKey: e,
|
|
1257
1257
|
defaultOptions: t
|
|
1258
1258
|
});
|
|
@@ -1261,7 +1261,7 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1261
1261
|
const t = [...a(this, Re).values()];
|
|
1262
1262
|
let s = {};
|
|
1263
1263
|
return t.forEach((r) => {
|
|
1264
|
-
|
|
1264
|
+
qe(e, r.mutationKey) && (s = { ...s, ...r.defaultOptions });
|
|
1265
1265
|
}), s;
|
|
1266
1266
|
}
|
|
1267
1267
|
defaultQueryOptions(e) {
|
|
@@ -1273,10 +1273,10 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1273
1273
|
...e,
|
|
1274
1274
|
_defaulted: !0
|
|
1275
1275
|
};
|
|
1276
|
-
return t.queryHash || (t.queryHash =
|
|
1276
|
+
return t.queryHash || (t.queryHash = _t(
|
|
1277
1277
|
t.queryKey,
|
|
1278
1278
|
t
|
|
1279
|
-
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn ===
|
|
1279
|
+
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn === ns && (t.enabled = !1), t;
|
|
1280
1280
|
}
|
|
1281
1281
|
defaultMutationOptions(e) {
|
|
1282
1282
|
return e != null && e._defaulted ? e : {
|
|
@@ -1287,55 +1287,55 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1287
1287
|
};
|
|
1288
1288
|
}
|
|
1289
1289
|
clear() {
|
|
1290
|
-
a(this,
|
|
1290
|
+
a(this, R).clear(), a(this, le).clear();
|
|
1291
1291
|
}
|
|
1292
|
-
},
|
|
1292
|
+
}, R = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), Le = new WeakMap(), Re = new WeakMap(), ue = new WeakMap(), Oe = new WeakMap(), Fe = new WeakMap(), Bt), H, E, $e, Q, Ce, De, ee, Ze, Te, Ue, xe, be, he, Qe, N, Ge, ut, ht, dt, ft, pt, mt, vt, ps, es, ar = (es = class extends Ke {
|
|
1293
1293
|
constructor(t, s) {
|
|
1294
1294
|
super();
|
|
1295
1295
|
y(this, N);
|
|
1296
1296
|
y(this, H);
|
|
1297
1297
|
y(this, E);
|
|
1298
|
-
y(this, Ve);
|
|
1299
|
-
y(this, Q);
|
|
1300
|
-
y(this, ye);
|
|
1301
|
-
y(this, Fe);
|
|
1302
|
-
y(this, ee);
|
|
1303
1298
|
y(this, $e);
|
|
1299
|
+
y(this, Q);
|
|
1300
|
+
y(this, Ce);
|
|
1304
1301
|
y(this, De);
|
|
1302
|
+
y(this, ee);
|
|
1303
|
+
y(this, Ze);
|
|
1304
|
+
y(this, Te);
|
|
1305
1305
|
// This property keeps track of the last query with defined data.
|
|
1306
1306
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1307
|
-
y(this,
|
|
1308
|
-
y(this, Ce);
|
|
1307
|
+
y(this, Ue);
|
|
1309
1308
|
y(this, xe);
|
|
1309
|
+
y(this, be);
|
|
1310
1310
|
y(this, he);
|
|
1311
|
-
y(this,
|
|
1311
|
+
y(this, Qe, /* @__PURE__ */ new Set());
|
|
1312
1312
|
this.options = s, p(this, H, t), p(this, ee, null), this.bindMethods(), this.setOptions(s);
|
|
1313
1313
|
}
|
|
1314
1314
|
bindMethods() {
|
|
1315
1315
|
this.refetch = this.refetch.bind(this);
|
|
1316
1316
|
}
|
|
1317
1317
|
onSubscribe() {
|
|
1318
|
-
this.listeners.size === 1 && (a(this, E).addObserver(this),
|
|
1318
|
+
this.listeners.size === 1 && (a(this, E).addObserver(this), Tt(a(this, E), this.options) ? w(this, N, Ge).call(this) : this.updateResult(), w(this, N, ft).call(this));
|
|
1319
1319
|
}
|
|
1320
1320
|
onUnsubscribe() {
|
|
1321
1321
|
this.hasListeners() || this.destroy();
|
|
1322
1322
|
}
|
|
1323
1323
|
shouldFetchOnReconnect() {
|
|
1324
|
-
return
|
|
1324
|
+
return gt(
|
|
1325
1325
|
a(this, E),
|
|
1326
1326
|
this.options,
|
|
1327
1327
|
this.options.refetchOnReconnect
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
1330
|
shouldFetchOnWindowFocus() {
|
|
1331
|
-
return
|
|
1331
|
+
return gt(
|
|
1332
1332
|
a(this, E),
|
|
1333
1333
|
this.options,
|
|
1334
1334
|
this.options.refetchOnWindowFocus
|
|
1335
1335
|
);
|
|
1336
1336
|
}
|
|
1337
1337
|
destroy() {
|
|
1338
|
-
this.listeners = /* @__PURE__ */ new Set(), w(this, N,
|
|
1338
|
+
this.listeners = /* @__PURE__ */ new Set(), w(this, N, pt).call(this), w(this, N, mt).call(this), a(this, E).removeObserver(this);
|
|
1339
1339
|
}
|
|
1340
1340
|
setOptions(t, s) {
|
|
1341
1341
|
const r = this.options, n = a(this, E);
|
|
@@ -1343,24 +1343,24 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1343
1343
|
throw new Error(
|
|
1344
1344
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1345
1345
|
);
|
|
1346
|
-
w(this, N,
|
|
1346
|
+
w(this, N, vt).call(this), a(this, E).setOptions(this.options), r._defaulted && !et(this.options, r) && a(this, H).getQueryCache().notify({
|
|
1347
1347
|
type: "observerOptionsUpdated",
|
|
1348
1348
|
query: a(this, E),
|
|
1349
1349
|
observer: this
|
|
1350
1350
|
});
|
|
1351
1351
|
const l = this.hasListeners();
|
|
1352
|
-
l &&
|
|
1352
|
+
l && Ut(
|
|
1353
1353
|
a(this, E),
|
|
1354
1354
|
n,
|
|
1355
1355
|
this.options,
|
|
1356
1356
|
r
|
|
1357
|
-
) && w(this, N,
|
|
1358
|
-
const o = w(this, N,
|
|
1359
|
-
l && (a(this, E) !== n || Y(this.options.enabled, a(this, E)) !== Y(r.enabled, a(this, E)) || o !== a(this, he)) && w(this, N,
|
|
1357
|
+
) && w(this, N, Ge).call(this), this.updateResult(s), l && (a(this, E) !== n || Y(this.options.enabled, a(this, E)) !== Y(r.enabled, a(this, E)) || Ee(this.options.staleTime, a(this, E)) !== Ee(r.staleTime, a(this, E))) && w(this, N, ut).call(this);
|
|
1358
|
+
const o = w(this, N, ht).call(this);
|
|
1359
|
+
l && (a(this, E) !== n || Y(this.options.enabled, a(this, E)) !== Y(r.enabled, a(this, E)) || o !== a(this, he)) && w(this, N, dt).call(this, o);
|
|
1360
1360
|
}
|
|
1361
1361
|
getOptimisticResult(t) {
|
|
1362
1362
|
const s = a(this, H).getQueryCache().build(a(this, H), t), r = this.createResult(s, t);
|
|
1363
|
-
return
|
|
1363
|
+
return lr(this, r) && (p(this, Q, r), p(this, De, this.options), p(this, Ce, a(this, E).state)), r;
|
|
1364
1364
|
}
|
|
1365
1365
|
getCurrentResult() {
|
|
1366
1366
|
return a(this, Q);
|
|
@@ -1376,7 +1376,7 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1376
1376
|
}), r;
|
|
1377
1377
|
}
|
|
1378
1378
|
trackProp(t) {
|
|
1379
|
-
a(this,
|
|
1379
|
+
a(this, Qe).add(t);
|
|
1380
1380
|
}
|
|
1381
1381
|
getCurrentQuery() {
|
|
1382
1382
|
return a(this, E);
|
|
@@ -1391,29 +1391,29 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1391
1391
|
return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, s));
|
|
1392
1392
|
}
|
|
1393
1393
|
fetch(t) {
|
|
1394
|
-
return w(this, N,
|
|
1394
|
+
return w(this, N, Ge).call(this, {
|
|
1395
1395
|
...t,
|
|
1396
1396
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
1397
1397
|
}).then(() => (this.updateResult(), a(this, Q)));
|
|
1398
1398
|
}
|
|
1399
1399
|
createResult(t, s) {
|
|
1400
1400
|
var te;
|
|
1401
|
-
const r = a(this, E), n = this.options, l = a(this, Q), o = a(this,
|
|
1402
|
-
let u = { ...
|
|
1401
|
+
const r = a(this, E), n = this.options, l = a(this, Q), o = a(this, Ce), c = a(this, De), m = t !== r ? t.state : a(this, $e), { state: d } = t;
|
|
1402
|
+
let u = { ...d }, v = !1, g;
|
|
1403
1403
|
if (s._optimisticResults) {
|
|
1404
|
-
const k = this.hasListeners(), Z = !k &&
|
|
1405
|
-
(Z ||
|
|
1404
|
+
const k = this.hasListeners(), Z = !k && Tt(t, s), Qs = k && Ut(t, r, s, n);
|
|
1405
|
+
(Z || Qs) && (u = {
|
|
1406
1406
|
...u,
|
|
1407
|
-
...
|
|
1407
|
+
...hs(d.data, t.options)
|
|
1408
1408
|
}), s._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
|
|
1409
1409
|
}
|
|
1410
1410
|
let { error: S, errorUpdatedAt: _, status: P } = u;
|
|
1411
1411
|
if (s.select && u.data !== void 0)
|
|
1412
|
-
if (l && u.data === (o == null ? void 0 : o.data) && s.select === a(this,
|
|
1413
|
-
g = a(this,
|
|
1412
|
+
if (l && u.data === (o == null ? void 0 : o.data) && s.select === a(this, Ze))
|
|
1413
|
+
g = a(this, Te);
|
|
1414
1414
|
else
|
|
1415
1415
|
try {
|
|
1416
|
-
p(this,
|
|
1416
|
+
p(this, Ze, s.select), g = s.select(u.data), g = ct(l == null ? void 0 : l.data, g, s), p(this, Te, g), p(this, ee, null);
|
|
1417
1417
|
} catch (k) {
|
|
1418
1418
|
p(this, ee, k);
|
|
1419
1419
|
}
|
|
@@ -1424,21 +1424,21 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1424
1424
|
if (l != null && l.isPlaceholderData && s.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
1425
1425
|
k = l.data;
|
|
1426
1426
|
else if (k = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
1427
|
-
(te = a(this,
|
|
1428
|
-
a(this,
|
|
1427
|
+
(te = a(this, Ue)) == null ? void 0 : te.state.data,
|
|
1428
|
+
a(this, Ue)
|
|
1429
1429
|
) : s.placeholderData, s.select && k !== void 0)
|
|
1430
1430
|
try {
|
|
1431
1431
|
k = s.select(k), p(this, ee, null);
|
|
1432
1432
|
} catch (Z) {
|
|
1433
1433
|
p(this, ee, Z);
|
|
1434
1434
|
}
|
|
1435
|
-
k !== void 0 && (P = "success", g =
|
|
1435
|
+
k !== void 0 && (P = "success", g = ct(
|
|
1436
1436
|
l == null ? void 0 : l.data,
|
|
1437
1437
|
k,
|
|
1438
1438
|
s
|
|
1439
1439
|
), v = !0);
|
|
1440
1440
|
}
|
|
1441
|
-
a(this, ee) && (S = a(this, ee), g = a(this,
|
|
1441
|
+
a(this, ee) && (S = a(this, ee), g = a(this, Te), _ = Date.now(), P = "error");
|
|
1442
1442
|
const C = u.fetchStatus === "fetching", j = P === "pending", b = P === "error", M = j && C, F = g !== void 0;
|
|
1443
1443
|
return {
|
|
1444
1444
|
status: P,
|
|
@@ -1463,72 +1463,72 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1463
1463
|
isPaused: u.fetchStatus === "paused",
|
|
1464
1464
|
isPlaceholderData: v,
|
|
1465
1465
|
isRefetchError: b && F,
|
|
1466
|
-
isStale:
|
|
1466
|
+
isStale: Et(t, s),
|
|
1467
1467
|
refetch: this.refetch
|
|
1468
1468
|
};
|
|
1469
1469
|
}
|
|
1470
1470
|
updateResult(t) {
|
|
1471
1471
|
const s = a(this, Q), r = this.createResult(a(this, E), this.options);
|
|
1472
|
-
if (p(this,
|
|
1472
|
+
if (p(this, Ce, a(this, E).state), p(this, De, this.options), a(this, Ce).data !== void 0 && p(this, Ue, a(this, E)), et(r, s))
|
|
1473
1473
|
return;
|
|
1474
1474
|
p(this, Q, r);
|
|
1475
1475
|
const n = {}, l = () => {
|
|
1476
1476
|
if (!s)
|
|
1477
1477
|
return !0;
|
|
1478
1478
|
const { notifyOnChangeProps: o } = this.options, c = typeof o == "function" ? o() : o;
|
|
1479
|
-
if (c === "all" || !c && !a(this,
|
|
1479
|
+
if (c === "all" || !c && !a(this, Qe).size)
|
|
1480
1480
|
return !0;
|
|
1481
|
-
const
|
|
1482
|
-
c ?? a(this,
|
|
1481
|
+
const h = new Set(
|
|
1482
|
+
c ?? a(this, Qe)
|
|
1483
1483
|
);
|
|
1484
|
-
return this.options.throwOnError &&
|
|
1485
|
-
const
|
|
1486
|
-
return a(this, Q)[
|
|
1484
|
+
return this.options.throwOnError && h.add("error"), Object.keys(a(this, Q)).some((m) => {
|
|
1485
|
+
const d = m;
|
|
1486
|
+
return a(this, Q)[d] !== s[d] && h.has(d);
|
|
1487
1487
|
});
|
|
1488
1488
|
};
|
|
1489
|
-
(t == null ? void 0 : t.listeners) !== !1 && l() && (n.listeners = !0), w(this, N,
|
|
1489
|
+
(t == null ? void 0 : t.listeners) !== !1 && l() && (n.listeners = !0), w(this, N, ps).call(this, { ...n, ...t });
|
|
1490
1490
|
}
|
|
1491
1491
|
onQueryUpdate() {
|
|
1492
|
-
this.updateResult(), this.hasListeners() && w(this, N,
|
|
1492
|
+
this.updateResult(), this.hasListeners() && w(this, N, ft).call(this);
|
|
1493
1493
|
}
|
|
1494
|
-
}, H = new WeakMap(), E = new WeakMap(),
|
|
1495
|
-
w(this, N,
|
|
1494
|
+
}, H = new WeakMap(), E = new WeakMap(), $e = new WeakMap(), Q = new WeakMap(), Ce = new WeakMap(), De = new WeakMap(), ee = new WeakMap(), Ze = new WeakMap(), Te = new WeakMap(), Ue = new WeakMap(), xe = new WeakMap(), be = new WeakMap(), he = new WeakMap(), Qe = new WeakMap(), N = new WeakSet(), Ge = function(t) {
|
|
1495
|
+
w(this, N, vt).call(this);
|
|
1496
1496
|
let s = a(this, E).fetch(
|
|
1497
1497
|
this.options,
|
|
1498
1498
|
t
|
|
1499
1499
|
);
|
|
1500
1500
|
return t != null && t.throwOnError || (s = s.catch($)), s;
|
|
1501
|
-
},
|
|
1502
|
-
w(this, N,
|
|
1503
|
-
const t =
|
|
1501
|
+
}, ut = function() {
|
|
1502
|
+
w(this, N, pt).call(this);
|
|
1503
|
+
const t = Ee(
|
|
1504
1504
|
this.options.staleTime,
|
|
1505
1505
|
a(this, E)
|
|
1506
1506
|
);
|
|
1507
|
-
if (
|
|
1507
|
+
if (He || a(this, Q).isStale || !ot(t))
|
|
1508
1508
|
return;
|
|
1509
|
-
const r =
|
|
1510
|
-
p(this,
|
|
1509
|
+
const r = rs(a(this, Q).dataUpdatedAt, t) + 1;
|
|
1510
|
+
p(this, xe, setTimeout(() => {
|
|
1511
1511
|
a(this, Q).isStale || this.updateResult();
|
|
1512
1512
|
}, r));
|
|
1513
|
-
},
|
|
1513
|
+
}, ht = function() {
|
|
1514
1514
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this, E)) : this.options.refetchInterval) ?? !1;
|
|
1515
|
-
},
|
|
1516
|
-
w(this, N,
|
|
1517
|
-
(this.options.refetchIntervalInBackground ||
|
|
1515
|
+
}, dt = function(t) {
|
|
1516
|
+
w(this, N, mt).call(this), p(this, he, t), !(He || Y(this.options.enabled, a(this, E)) === !1 || !ot(a(this, he)) || a(this, he) === 0) && p(this, be, setInterval(() => {
|
|
1517
|
+
(this.options.refetchIntervalInBackground || St.isFocused()) && w(this, N, Ge).call(this);
|
|
1518
1518
|
}, a(this, he)));
|
|
1519
|
-
}, dt = function() {
|
|
1520
|
-
w(this, N, ct).call(this), w(this, N, ht).call(this, w(this, N, ut).call(this));
|
|
1521
1519
|
}, ft = function() {
|
|
1522
|
-
|
|
1520
|
+
w(this, N, ut).call(this), w(this, N, dt).call(this, w(this, N, ht).call(this));
|
|
1523
1521
|
}, pt = function() {
|
|
1524
|
-
a(this, xe) && (
|
|
1522
|
+
a(this, xe) && (clearTimeout(a(this, xe)), p(this, xe, void 0));
|
|
1525
1523
|
}, mt = function() {
|
|
1524
|
+
a(this, be) && (clearInterval(a(this, be)), p(this, be, void 0));
|
|
1525
|
+
}, vt = function() {
|
|
1526
1526
|
const t = a(this, H).getQueryCache().build(a(this, H), this.options);
|
|
1527
1527
|
if (t === a(this, E))
|
|
1528
1528
|
return;
|
|
1529
1529
|
const s = a(this, E);
|
|
1530
|
-
p(this, E, t), p(this,
|
|
1531
|
-
},
|
|
1530
|
+
p(this, E, t), p(this, $e, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
|
|
1531
|
+
}, ps = function(t) {
|
|
1532
1532
|
D.batch(() => {
|
|
1533
1533
|
t.listeners && this.listeners.forEach((s) => {
|
|
1534
1534
|
s(a(this, Q));
|
|
@@ -1537,30 +1537,30 @@ var O, le, ce, Me, Re, ue, Oe, Le, It, ds = (It = class {
|
|
|
1537
1537
|
type: "observerResultsUpdated"
|
|
1538
1538
|
});
|
|
1539
1539
|
});
|
|
1540
|
-
},
|
|
1541
|
-
function
|
|
1540
|
+
}, es);
|
|
1541
|
+
function or(e, t) {
|
|
1542
1542
|
return Y(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1545
|
-
return
|
|
1544
|
+
function Tt(e, t) {
|
|
1545
|
+
return or(e, t) || e.state.data !== void 0 && gt(e, t, t.refetchOnMount);
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function gt(e, t, s) {
|
|
1548
1548
|
if (Y(t.enabled, e) !== !1) {
|
|
1549
1549
|
const r = typeof s == "function" ? s(e) : s;
|
|
1550
|
-
return r === "always" || r !== !1 &&
|
|
1550
|
+
return r === "always" || r !== !1 && Et(e, t);
|
|
1551
1551
|
}
|
|
1552
1552
|
return !1;
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return (e !== t || Y(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") &&
|
|
1554
|
+
function Ut(e, t, s, r) {
|
|
1555
|
+
return (e !== t || Y(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && Et(e, s);
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return Y(t.enabled, e) !== !1 && e.isStaleByTime(
|
|
1557
|
+
function Et(e, t) {
|
|
1558
|
+
return Y(t.enabled, e) !== !1 && e.isStaleByTime(Ee(t.staleTime, e));
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1561
|
-
return !
|
|
1560
|
+
function lr(e, t) {
|
|
1561
|
+
return !et(e.getCurrentResult(), t);
|
|
1562
1562
|
}
|
|
1563
|
-
var de, fe, K, re, ie,
|
|
1563
|
+
var de, fe, K, re, ie, Be, yt, ts, cr = (ts = class extends Ke {
|
|
1564
1564
|
constructor(t, s) {
|
|
1565
1565
|
super();
|
|
1566
1566
|
y(this, ie);
|
|
@@ -1568,7 +1568,7 @@ var de, fe, K, re, ie, Ie, gt, es, lr = (es = class extends He {
|
|
|
1568
1568
|
y(this, fe);
|
|
1569
1569
|
y(this, K);
|
|
1570
1570
|
y(this, re);
|
|
1571
|
-
p(this, de, t), this.setOptions(s), this.bindMethods(), w(this, ie,
|
|
1571
|
+
p(this, de, t), this.setOptions(s), this.bindMethods(), w(this, ie, Be).call(this);
|
|
1572
1572
|
}
|
|
1573
1573
|
bindMethods() {
|
|
1574
1574
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -1576,33 +1576,33 @@ var de, fe, K, re, ie, Ie, gt, es, lr = (es = class extends He {
|
|
|
1576
1576
|
setOptions(t) {
|
|
1577
1577
|
var r;
|
|
1578
1578
|
const s = this.options;
|
|
1579
|
-
this.options = a(this, de).defaultMutationOptions(t),
|
|
1579
|
+
this.options = a(this, de).defaultMutationOptions(t), et(this.options, s) || a(this, de).getMutationCache().notify({
|
|
1580
1580
|
type: "observerOptionsUpdated",
|
|
1581
1581
|
mutation: a(this, K),
|
|
1582
1582
|
observer: this
|
|
1583
|
-
}), s != null && s.mutationKey && this.options.mutationKey &&
|
|
1583
|
+
}), s != null && s.mutationKey && this.options.mutationKey && we(s.mutationKey) !== we(this.options.mutationKey) ? this.reset() : ((r = a(this, K)) == null ? void 0 : r.state.status) === "pending" && a(this, K).setOptions(this.options);
|
|
1584
1584
|
}
|
|
1585
1585
|
onUnsubscribe() {
|
|
1586
1586
|
var t;
|
|
1587
1587
|
this.hasListeners() || (t = a(this, K)) == null || t.removeObserver(this);
|
|
1588
1588
|
}
|
|
1589
1589
|
onMutationUpdate(t) {
|
|
1590
|
-
w(this, ie,
|
|
1590
|
+
w(this, ie, Be).call(this), w(this, ie, yt).call(this, t);
|
|
1591
1591
|
}
|
|
1592
1592
|
getCurrentResult() {
|
|
1593
1593
|
return a(this, fe);
|
|
1594
1594
|
}
|
|
1595
1595
|
reset() {
|
|
1596
1596
|
var t;
|
|
1597
|
-
(t = a(this, K)) == null || t.removeObserver(this), p(this, K, void 0), w(this, ie,
|
|
1597
|
+
(t = a(this, K)) == null || t.removeObserver(this), p(this, K, void 0), w(this, ie, Be).call(this), w(this, ie, yt).call(this);
|
|
1598
1598
|
}
|
|
1599
1599
|
mutate(t, s) {
|
|
1600
1600
|
var r;
|
|
1601
1601
|
return p(this, re, s), (r = a(this, K)) == null || r.removeObserver(this), p(this, K, a(this, de).getMutationCache().build(a(this, de), this.options)), a(this, K).addObserver(this), a(this, K).execute(t);
|
|
1602
1602
|
}
|
|
1603
|
-
}, de = new WeakMap(), fe = new WeakMap(), K = new WeakMap(), re = new WeakMap(), ie = new WeakSet(),
|
|
1603
|
+
}, de = new WeakMap(), fe = new WeakMap(), K = new WeakMap(), re = new WeakMap(), ie = new WeakSet(), Be = function() {
|
|
1604
1604
|
var s;
|
|
1605
|
-
const t = ((s = a(this, K)) == null ? void 0 : s.state) ??
|
|
1605
|
+
const t = ((s = a(this, K)) == null ? void 0 : s.state) ?? ds();
|
|
1606
1606
|
p(this, fe, {
|
|
1607
1607
|
...t,
|
|
1608
1608
|
isPending: t.status === "pending",
|
|
@@ -1612,38 +1612,38 @@ var de, fe, K, re, ie, Ie, gt, es, lr = (es = class extends He {
|
|
|
1612
1612
|
mutate: this.mutate,
|
|
1613
1613
|
reset: this.reset
|
|
1614
1614
|
});
|
|
1615
|
-
},
|
|
1615
|
+
}, yt = function(t) {
|
|
1616
1616
|
D.batch(() => {
|
|
1617
|
-
var s, r, n, l, o, c,
|
|
1617
|
+
var s, r, n, l, o, c, h, m;
|
|
1618
1618
|
if (a(this, re) && this.hasListeners()) {
|
|
1619
|
-
const
|
|
1620
|
-
(t == null ? void 0 : t.type) === "success" ? ((r = (s = a(this, re)).onSuccess) == null || r.call(s, t.data,
|
|
1621
|
-
|
|
1619
|
+
const d = a(this, fe).variables, u = a(this, fe).context;
|
|
1620
|
+
(t == null ? void 0 : t.type) === "success" ? ((r = (s = a(this, re)).onSuccess) == null || r.call(s, t.data, d, u), (l = (n = a(this, re)).onSettled) == null || l.call(n, t.data, null, d, u)) : (t == null ? void 0 : t.type) === "error" && ((c = (o = a(this, re)).onError) == null || c.call(o, t.error, d, u), (m = (h = a(this, re)).onSettled) == null || m.call(
|
|
1621
|
+
h,
|
|
1622
1622
|
void 0,
|
|
1623
1623
|
t.error,
|
|
1624
|
-
|
|
1624
|
+
d,
|
|
1625
1625
|
u
|
|
1626
1626
|
));
|
|
1627
1627
|
}
|
|
1628
|
-
this.listeners.forEach((
|
|
1629
|
-
|
|
1628
|
+
this.listeners.forEach((d) => {
|
|
1629
|
+
d(a(this, fe));
|
|
1630
1630
|
});
|
|
1631
1631
|
});
|
|
1632
|
-
},
|
|
1632
|
+
}, ts), ms = f.createContext(
|
|
1633
1633
|
void 0
|
|
1634
|
-
),
|
|
1635
|
-
const t = f.useContext(
|
|
1634
|
+
), Pt = (e) => {
|
|
1635
|
+
const t = f.useContext(ms);
|
|
1636
1636
|
if (!t)
|
|
1637
1637
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1638
1638
|
return t;
|
|
1639
|
-
},
|
|
1639
|
+
}, ur = ({
|
|
1640
1640
|
client: e,
|
|
1641
1641
|
children: t
|
|
1642
1642
|
}) => (f.useEffect(() => (e.mount(), () => {
|
|
1643
1643
|
e.unmount();
|
|
1644
|
-
}), [e]), /* @__PURE__ */ i.jsx(
|
|
1645
|
-
|
|
1646
|
-
function
|
|
1644
|
+
}), [e]), /* @__PURE__ */ i.jsx(ms.Provider, { value: e, children: t })), vs = f.createContext(!1), hr = () => f.useContext(vs);
|
|
1645
|
+
vs.Provider;
|
|
1646
|
+
function dr() {
|
|
1647
1647
|
let e = !1;
|
|
1648
1648
|
return {
|
|
1649
1649
|
clearReset: () => {
|
|
@@ -1655,41 +1655,41 @@ function hr() {
|
|
|
1655
1655
|
isReset: () => e
|
|
1656
1656
|
};
|
|
1657
1657
|
}
|
|
1658
|
-
var
|
|
1659
|
-
function
|
|
1658
|
+
var fr = f.createContext(dr()), pr = () => f.useContext(fr);
|
|
1659
|
+
function gs(e, t) {
|
|
1660
1660
|
return typeof e == "function" ? e(...t) : !!e;
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function mr() {
|
|
1663
1663
|
}
|
|
1664
|
-
var
|
|
1664
|
+
var vr = (e, t) => {
|
|
1665
1665
|
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
1666
|
-
},
|
|
1666
|
+
}, gr = (e) => {
|
|
1667
1667
|
f.useEffect(() => {
|
|
1668
1668
|
e.clearReset();
|
|
1669
1669
|
}, [e]);
|
|
1670
|
-
},
|
|
1670
|
+
}, yr = ({
|
|
1671
1671
|
result: e,
|
|
1672
1672
|
errorResetBoundary: t,
|
|
1673
1673
|
throwOnError: s,
|
|
1674
1674
|
query: r
|
|
1675
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r &&
|
|
1675
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && gs(s, [e.error, r]), Cr = (e) => {
|
|
1676
1676
|
e.suspense && (typeof e.staleTime != "number" && (e.staleTime = 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
|
|
1677
|
-
},
|
|
1677
|
+
}, xr = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, br = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1678
1678
|
s.clearReset();
|
|
1679
1679
|
});
|
|
1680
|
-
function
|
|
1681
|
-
var m,
|
|
1682
|
-
const r =
|
|
1683
|
-
(
|
|
1680
|
+
function wr(e, t, s) {
|
|
1681
|
+
var m, d, u, v;
|
|
1682
|
+
const r = Pt(), n = hr(), l = pr(), o = r.defaultQueryOptions(e);
|
|
1683
|
+
(d = (m = r.getDefaultOptions().queries) == null ? void 0 : m._experimental_beforeQuery) == null || d.call(
|
|
1684
1684
|
m,
|
|
1685
1685
|
o
|
|
1686
|
-
), o._optimisticResults = n ? "isRestoring" : "optimistic",
|
|
1686
|
+
), o._optimisticResults = n ? "isRestoring" : "optimistic", Cr(o), vr(o, l), gr(l);
|
|
1687
1687
|
const [c] = f.useState(
|
|
1688
1688
|
() => new t(
|
|
1689
1689
|
r,
|
|
1690
1690
|
o
|
|
1691
1691
|
)
|
|
1692
|
-
),
|
|
1692
|
+
), h = c.getOptimisticResult(o);
|
|
1693
1693
|
if (f.useSyncExternalStore(
|
|
1694
1694
|
f.useCallback(
|
|
1695
1695
|
(g) => {
|
|
@@ -1703,27 +1703,27 @@ function br(e, t, s) {
|
|
|
1703
1703
|
() => c.getCurrentResult()
|
|
1704
1704
|
), f.useEffect(() => {
|
|
1705
1705
|
c.setOptions(o, { listeners: !1 });
|
|
1706
|
-
}, [o, c]),
|
|
1707
|
-
throw
|
|
1708
|
-
if (
|
|
1709
|
-
result:
|
|
1706
|
+
}, [o, c]), xr(o, h))
|
|
1707
|
+
throw br(o, c, l);
|
|
1708
|
+
if (yr({
|
|
1709
|
+
result: h,
|
|
1710
1710
|
errorResetBoundary: l,
|
|
1711
1711
|
throwOnError: o.throwOnError,
|
|
1712
1712
|
query: r.getQueryCache().get(o.queryHash)
|
|
1713
1713
|
}))
|
|
1714
|
-
throw
|
|
1714
|
+
throw h.error;
|
|
1715
1715
|
return (v = (u = r.getDefaultOptions().queries) == null ? void 0 : u._experimental_afterQuery) == null || v.call(
|
|
1716
1716
|
u,
|
|
1717
1717
|
o,
|
|
1718
|
-
|
|
1719
|
-
), o.notifyOnChangeProps ?
|
|
1718
|
+
h
|
|
1719
|
+
), o.notifyOnChangeProps ? h : c.trackResult(h);
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return
|
|
1721
|
+
function ys(e, t) {
|
|
1722
|
+
return wr(e, ar);
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const s =
|
|
1726
|
-
() => new
|
|
1724
|
+
function jr(e, t) {
|
|
1725
|
+
const s = Pt(), [r] = f.useState(
|
|
1726
|
+
() => new cr(
|
|
1727
1727
|
s,
|
|
1728
1728
|
e
|
|
1729
1729
|
)
|
|
@@ -1740,75 +1740,75 @@ function wr(e, t) {
|
|
|
1740
1740
|
() => r.getCurrentResult()
|
|
1741
1741
|
), l = f.useCallback(
|
|
1742
1742
|
(o, c) => {
|
|
1743
|
-
r.mutate(o, c).catch(
|
|
1743
|
+
r.mutate(o, c).catch(mr);
|
|
1744
1744
|
},
|
|
1745
1745
|
[r]
|
|
1746
1746
|
);
|
|
1747
|
-
if (n.error &&
|
|
1747
|
+
if (n.error && gs(r.options.throwOnError, [n.error]))
|
|
1748
1748
|
throw n.error;
|
|
1749
1749
|
return { ...n, mutate: l, mutateAsync: n.mutate };
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function Cs(e) {
|
|
1752
1752
|
var t, s, r = "";
|
|
1753
1753
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1754
1754
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1755
1755
|
var n = e.length;
|
|
1756
|
-
for (t = 0; t < n; t++) e[t] && (s =
|
|
1756
|
+
for (t = 0; t < n; t++) e[t] && (s = Cs(e[t])) && (r && (r += " "), r += s);
|
|
1757
1757
|
} else for (s in e) e[s] && (r && (r += " "), r += s);
|
|
1758
1758
|
return r;
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1761
|
-
for (var e, t, s = 0, r = "", n = arguments.length; s < n; s++) (e = arguments[s]) && (t =
|
|
1760
|
+
function L() {
|
|
1761
|
+
for (var e, t, s = 0, r = "", n = arguments.length; s < n; s++) (e = arguments[s]) && (t = Cs(e)) && (r && (r += " "), r += t);
|
|
1762
1762
|
return r;
|
|
1763
1763
|
}
|
|
1764
|
-
var
|
|
1764
|
+
var _r = Object.defineProperty, Sr = Object.defineProperties, Er = Object.getOwnPropertyDescriptors, st = Object.getOwnPropertySymbols, xs = Object.prototype.hasOwnProperty, bs = Object.prototype.propertyIsEnumerable, Qt = (e, t, s) => t in e ? _r(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, x = (e, t) => {
|
|
1765
1765
|
for (var s in t || (t = {}))
|
|
1766
|
-
|
|
1767
|
-
if (
|
|
1768
|
-
for (var s of
|
|
1769
|
-
|
|
1766
|
+
xs.call(t, s) && Qt(e, s, t[s]);
|
|
1767
|
+
if (st)
|
|
1768
|
+
for (var s of st(t))
|
|
1769
|
+
bs.call(t, s) && Qt(e, s, t[s]);
|
|
1770
1770
|
return e;
|
|
1771
|
-
}, A = (e, t) =>
|
|
1771
|
+
}, A = (e, t) => Sr(e, Er(t)), O = (e, t) => {
|
|
1772
1772
|
var s = {};
|
|
1773
1773
|
for (var r in e)
|
|
1774
|
-
|
|
1775
|
-
if (e != null &&
|
|
1776
|
-
for (var r of
|
|
1777
|
-
t.indexOf(r) < 0 &&
|
|
1774
|
+
xs.call(e, r) && t.indexOf(r) < 0 && (s[r] = e[r]);
|
|
1775
|
+
if (e != null && st)
|
|
1776
|
+
for (var r of st(e))
|
|
1777
|
+
t.indexOf(r) < 0 && bs.call(e, r) && (s[r] = e[r]);
|
|
1778
1778
|
return s;
|
|
1779
1779
|
};
|
|
1780
|
-
function
|
|
1780
|
+
function Pr(e, t) {
|
|
1781
1781
|
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1784
|
-
return (t) => e.forEach((s) =>
|
|
1783
|
+
function kr(...e) {
|
|
1784
|
+
return (t) => e.forEach((s) => Pr(s, t));
|
|
1785
1785
|
}
|
|
1786
|
-
var
|
|
1787
|
-
const s = e, { children: r } = s, n =
|
|
1786
|
+
var Ar = f.forwardRef((e, t) => {
|
|
1787
|
+
const s = e, { children: r } = s, n = O(s, ["children"]), l = f.Children.toArray(r), o = l.find(Mr);
|
|
1788
1788
|
if (o) {
|
|
1789
|
-
const c = o.props.children,
|
|
1790
|
-
return /* @__PURE__ */ i.jsx(
|
|
1789
|
+
const c = o.props.children, h = l.map((m) => m === o ? f.Children.count(c) > 1 ? f.Children.only(null) : f.isValidElement(c) ? c.props.children : null : m);
|
|
1790
|
+
return /* @__PURE__ */ i.jsx(Ct, A(x({}, n), { ref: t, children: f.isValidElement(c) ? f.cloneElement(c, void 0, h) : null }));
|
|
1791
1791
|
}
|
|
1792
|
-
return /* @__PURE__ */ i.jsx(
|
|
1792
|
+
return /* @__PURE__ */ i.jsx(Ct, A(x({}, n), { ref: t, children: r }));
|
|
1793
1793
|
});
|
|
1794
|
-
|
|
1795
|
-
var
|
|
1796
|
-
const s = e, { children: r } = s, n =
|
|
1794
|
+
Ar.displayName = "Slot";
|
|
1795
|
+
var Ct = f.forwardRef((e, t) => {
|
|
1796
|
+
const s = e, { children: r } = s, n = O(s, ["children"]);
|
|
1797
1797
|
if (f.isValidElement(r)) {
|
|
1798
1798
|
const l = Rr(r);
|
|
1799
|
-
return f.cloneElement(r, A(x({},
|
|
1799
|
+
return f.cloneElement(r, A(x({}, Lr(n, r.props)), {
|
|
1800
1800
|
// @ts-ignore
|
|
1801
|
-
ref: t ?
|
|
1801
|
+
ref: t ? kr(t, l) : l
|
|
1802
1802
|
}));
|
|
1803
1803
|
}
|
|
1804
1804
|
return f.Children.count(r) > 1 ? f.Children.only(null) : null;
|
|
1805
1805
|
});
|
|
1806
|
-
|
|
1807
|
-
var
|
|
1808
|
-
function
|
|
1809
|
-
return f.isValidElement(e) && e.type ===
|
|
1806
|
+
Ct.displayName = "SlotClone";
|
|
1807
|
+
var Nr = ({ children: e }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: e });
|
|
1808
|
+
function Mr(e) {
|
|
1809
|
+
return f.isValidElement(e) && e.type === Nr;
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1811
|
+
function Lr(e, t) {
|
|
1812
1812
|
const s = x({}, t);
|
|
1813
1813
|
for (const r in t) {
|
|
1814
1814
|
const n = e[r], l = t[r];
|
|
@@ -1834,7 +1834,7 @@ var Or = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1834
1834
|
children: /* @__PURE__ */ i.jsx("span", { className: "avatar__initials", children: r })
|
|
1835
1835
|
}
|
|
1836
1836
|
);
|
|
1837
|
-
},
|
|
1837
|
+
}, ze = f.forwardRef(
|
|
1838
1838
|
(e, t) => {
|
|
1839
1839
|
var s = e, {
|
|
1840
1840
|
iconLeft: r,
|
|
@@ -1842,9 +1842,9 @@ var Or = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1842
1842
|
isPending: l = !1,
|
|
1843
1843
|
isFilled: o = !1,
|
|
1844
1844
|
variant: c,
|
|
1845
|
-
className:
|
|
1845
|
+
className: h,
|
|
1846
1846
|
children: m
|
|
1847
|
-
} = s,
|
|
1847
|
+
} = s, d = O(s, [
|
|
1848
1848
|
"iconLeft",
|
|
1849
1849
|
"iconRight",
|
|
1850
1850
|
"isPending",
|
|
@@ -1858,14 +1858,14 @@ var Or = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1858
1858
|
"button",
|
|
1859
1859
|
A(x({
|
|
1860
1860
|
ref: t
|
|
1861
|
-
},
|
|
1862
|
-
className:
|
|
1861
|
+
}, d), {
|
|
1862
|
+
className: L(
|
|
1863
1863
|
"button",
|
|
1864
1864
|
c && `button--${c}`,
|
|
1865
1865
|
c && o && `button--${c}--filled`,
|
|
1866
1866
|
u && "button--with-icon",
|
|
1867
1867
|
l && "button--pending",
|
|
1868
|
-
|
|
1868
|
+
h
|
|
1869
1869
|
),
|
|
1870
1870
|
children: [
|
|
1871
1871
|
r && /* @__PURE__ */ i.jsx("div", { className: "button__icon", children: r }),
|
|
@@ -1876,18 +1876,18 @@ var Or = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1876
1876
|
);
|
|
1877
1877
|
}
|
|
1878
1878
|
);
|
|
1879
|
-
|
|
1879
|
+
ze.displayName = "Button";
|
|
1880
1880
|
f.createContext(void 0);
|
|
1881
|
-
var
|
|
1881
|
+
var Fr = f.forwardRef(
|
|
1882
1882
|
(e, t) => {
|
|
1883
|
-
var s = e, { prefix: r, suffix: n, className: l } = s, o =
|
|
1883
|
+
var s = e, { prefix: r, suffix: n, className: l } = s, o = O(s, ["prefix", "suffix", "className"]);
|
|
1884
1884
|
return /* @__PURE__ */ i.jsxs("div", { className: "input__wrapper", children: [
|
|
1885
1885
|
r && /* @__PURE__ */ i.jsx("span", { className: "input__prefix", children: r }),
|
|
1886
1886
|
/* @__PURE__ */ i.jsx(
|
|
1887
1887
|
"input",
|
|
1888
1888
|
x({
|
|
1889
1889
|
ref: t,
|
|
1890
|
-
className:
|
|
1890
|
+
className: L(
|
|
1891
1891
|
"input",
|
|
1892
1892
|
r && "input--with-prefix",
|
|
1893
1893
|
n && "input--with-suffix",
|
|
@@ -1899,12 +1899,12 @@ var Lr = f.forwardRef(
|
|
|
1899
1899
|
] });
|
|
1900
1900
|
}
|
|
1901
1901
|
);
|
|
1902
|
-
|
|
1902
|
+
Fr.displayName = "TextField";
|
|
1903
1903
|
f.createContext(void 0);
|
|
1904
|
-
var
|
|
1905
|
-
var t = e, { children: s, className: r } = t, n =
|
|
1906
|
-
return /* @__PURE__ */ i.jsx("div", A(x({ className:
|
|
1907
|
-
},
|
|
1904
|
+
var Dr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__header__action", children: e }), Tr = (e) => {
|
|
1905
|
+
var t = e, { children: s, className: r } = t, n = O(t, ["children", "className"]);
|
|
1906
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: L("card__body", r) }, n), { children: s }));
|
|
1907
|
+
}, Ur = (e) => /* @__PURE__ */ i.jsx(
|
|
1908
1908
|
"svg",
|
|
1909
1909
|
A(x({
|
|
1910
1910
|
width: "24",
|
|
@@ -1924,7 +1924,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1924
1924
|
}
|
|
1925
1925
|
)
|
|
1926
1926
|
})
|
|
1927
|
-
),
|
|
1927
|
+
), kt = Ur, Qr = (e) => /* @__PURE__ */ i.jsx(
|
|
1928
1928
|
"svg",
|
|
1929
1929
|
A(x({
|
|
1930
1930
|
width: "24",
|
|
@@ -1944,7 +1944,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1944
1944
|
}
|
|
1945
1945
|
)
|
|
1946
1946
|
})
|
|
1947
|
-
),
|
|
1947
|
+
), Hr = Qr, Kr = (e) => /* @__PURE__ */ i.jsx(
|
|
1948
1948
|
"svg",
|
|
1949
1949
|
A(x({
|
|
1950
1950
|
width: "24",
|
|
@@ -1963,7 +1963,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1963
1963
|
}
|
|
1964
1964
|
)
|
|
1965
1965
|
})
|
|
1966
|
-
),
|
|
1966
|
+
), Gr = Kr, qr = (e) => /* @__PURE__ */ i.jsx(
|
|
1967
1967
|
"svg",
|
|
1968
1968
|
A(x({
|
|
1969
1969
|
width: "24",
|
|
@@ -1982,7 +1982,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1982
1982
|
}
|
|
1983
1983
|
)
|
|
1984
1984
|
})
|
|
1985
|
-
),
|
|
1985
|
+
), Wr = qr, Vr = (e) => /* @__PURE__ */ i.jsx(
|
|
1986
1986
|
"svg",
|
|
1987
1987
|
A(x({
|
|
1988
1988
|
width: "24",
|
|
@@ -2001,7 +2001,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2001
2001
|
}
|
|
2002
2002
|
)
|
|
2003
2003
|
})
|
|
2004
|
-
),
|
|
2004
|
+
), $r = Vr, Zr = (e) => /* @__PURE__ */ i.jsxs(
|
|
2005
2005
|
"svg",
|
|
2006
2006
|
A(x({
|
|
2007
2007
|
width: "24",
|
|
@@ -2038,7 +2038,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2038
2038
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_19_444", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2039
2039
|
]
|
|
2040
2040
|
})
|
|
2041
|
-
),
|
|
2041
|
+
), zr = Zr, Yr = (e) => /* @__PURE__ */ i.jsxs(
|
|
2042
2042
|
"svg",
|
|
2043
2043
|
A(x({
|
|
2044
2044
|
width: "24",
|
|
@@ -2070,7 +2070,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2070
2070
|
)
|
|
2071
2071
|
]
|
|
2072
2072
|
})
|
|
2073
|
-
),
|
|
2073
|
+
), Jr = Yr, Xr = (e) => /* @__PURE__ */ i.jsxs(
|
|
2074
2074
|
"svg",
|
|
2075
2075
|
A(x({
|
|
2076
2076
|
width: "24",
|
|
@@ -2122,8 +2122,8 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2122
2122
|
)
|
|
2123
2123
|
]
|
|
2124
2124
|
})
|
|
2125
|
-
),
|
|
2126
|
-
var t = e, { className: s } = t, r =
|
|
2125
|
+
), Ir = Xr, Br = (e) => {
|
|
2126
|
+
var t = e, { className: s } = t, r = O(t, ["className"]);
|
|
2127
2127
|
return /* @__PURE__ */ i.jsxs(
|
|
2128
2128
|
"svg",
|
|
2129
2129
|
A(x({
|
|
@@ -2132,7 +2132,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2132
2132
|
viewBox: "0 0 20 20",
|
|
2133
2133
|
fill: "none",
|
|
2134
2134
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2135
|
-
className:
|
|
2135
|
+
className: L("spinner", s)
|
|
2136
2136
|
}, r), {
|
|
2137
2137
|
children: [
|
|
2138
2138
|
/* @__PURE__ */ i.jsx("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "1.5" }),
|
|
@@ -2151,7 +2151,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2151
2151
|
]
|
|
2152
2152
|
})
|
|
2153
2153
|
);
|
|
2154
|
-
},
|
|
2154
|
+
}, ei = Br, ti = (e) => /* @__PURE__ */ i.jsxs(
|
|
2155
2155
|
"svg",
|
|
2156
2156
|
A(x({
|
|
2157
2157
|
width: "24",
|
|
@@ -2185,7 +2185,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2185
2185
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_762_2934", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2186
2186
|
]
|
|
2187
2187
|
})
|
|
2188
|
-
),
|
|
2188
|
+
), si = ti, ri = (e) => {
|
|
2189
2189
|
const t = (s) => `${s}${e.suffix ? `_${e.suffix}` : ""}`;
|
|
2190
2190
|
return /* @__PURE__ */ i.jsxs(
|
|
2191
2191
|
"svg",
|
|
@@ -2273,7 +2273,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2273
2273
|
y2: "1.60772",
|
|
2274
2274
|
gradientUnits: "userSpaceOnUse",
|
|
2275
2275
|
children: [
|
|
2276
|
-
/* @__PURE__ */ i.jsx("stop", { stopColor: "#36BCEE" }),
|
|
2276
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0", stopColor: "#36BCEE" }),
|
|
2277
2277
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.201", stopColor: "#31ACE3" }),
|
|
2278
2278
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.59", stopColor: "#2583C5" }),
|
|
2279
2279
|
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#1652A1" })
|
|
@@ -2290,7 +2290,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2290
2290
|
y2: "8.0336",
|
|
2291
2291
|
gradientUnits: "userSpaceOnUse",
|
|
2292
2292
|
children: [
|
|
2293
|
-
/* @__PURE__ */ i.jsx("stop", { stopColor: "#E42313" }),
|
|
2293
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0", stopColor: "#E42313" }),
|
|
2294
2294
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.071", stopColor: "#E73611" }),
|
|
2295
2295
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.312", stopColor: "#F0710B" }),
|
|
2296
2296
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.534", stopColor: "#F6A006" }),
|
|
@@ -2310,7 +2310,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2310
2310
|
y2: "18.1127",
|
|
2311
2311
|
gradientUnits: "userSpaceOnUse",
|
|
2312
2312
|
children: [
|
|
2313
|
-
/* @__PURE__ */ i.jsx("stop", { stopColor: "#FFC832" }),
|
|
2313
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0", stopColor: "#FFC832" }),
|
|
2314
2314
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.354", stopColor: "#F8A220" }),
|
|
2315
2315
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.779", stopColor: "#F07A0D" }),
|
|
2316
2316
|
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#ED6B06" })
|
|
@@ -2344,7 +2344,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2344
2344
|
gradientUnits: "userSpaceOnUse",
|
|
2345
2345
|
gradientTransform: "translate(11.9404 22.4736) scale(7.73227 0.851796)",
|
|
2346
2346
|
children: [
|
|
2347
|
-
/* @__PURE__ */ i.jsx("stop", { stopColor: "#C9C9C9" }),
|
|
2347
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0", stopColor: "#C9C9C9" }),
|
|
2348
2348
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.302", stopColor: "#CCCCCC", stopOpacity: "0.698" }),
|
|
2349
2349
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.554", stopColor: "#D7D7D7", stopOpacity: "0.447" }),
|
|
2350
2350
|
/* @__PURE__ */ i.jsx("stop", { offset: "0.787", stopColor: "#E8E8E8", stopOpacity: "0.212" }),
|
|
@@ -2356,7 +2356,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2356
2356
|
]
|
|
2357
2357
|
})
|
|
2358
2358
|
);
|
|
2359
|
-
},
|
|
2359
|
+
}, ws = ri, ii = (e) => /* @__PURE__ */ i.jsxs(
|
|
2360
2360
|
"svg",
|
|
2361
2361
|
A(x({
|
|
2362
2362
|
fill: "none",
|
|
@@ -2418,7 +2418,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2418
2418
|
)
|
|
2419
2419
|
]
|
|
2420
2420
|
})
|
|
2421
|
-
),
|
|
2421
|
+
), ni = ii, ai = (e) => /* @__PURE__ */ i.jsx(
|
|
2422
2422
|
"svg",
|
|
2423
2423
|
A(x({
|
|
2424
2424
|
fill: "none",
|
|
@@ -2438,7 +2438,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2438
2438
|
}
|
|
2439
2439
|
)
|
|
2440
2440
|
})
|
|
2441
|
-
),
|
|
2441
|
+
), oi = ai, li = (e) => /* @__PURE__ */ i.jsxs(
|
|
2442
2442
|
"svg",
|
|
2443
2443
|
A(x({
|
|
2444
2444
|
width: "24",
|
|
@@ -2465,7 +2465,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2465
2465
|
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 20.7)", fill: "currentColor" })
|
|
2466
2466
|
]
|
|
2467
2467
|
})
|
|
2468
|
-
),
|
|
2468
|
+
), ci = li, ui = (e) => {
|
|
2469
2469
|
var t = e, {
|
|
2470
2470
|
variant: s,
|
|
2471
2471
|
icon: r,
|
|
@@ -2473,7 +2473,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2473
2473
|
title: l,
|
|
2474
2474
|
description: o,
|
|
2475
2475
|
className: c
|
|
2476
|
-
} = t,
|
|
2476
|
+
} = t, h = O(t, [
|
|
2477
2477
|
"variant",
|
|
2478
2478
|
"icon",
|
|
2479
2479
|
"isStandalone",
|
|
@@ -2483,15 +2483,15 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2483
2483
|
]);
|
|
2484
2484
|
return /* @__PURE__ */ i.jsx(
|
|
2485
2485
|
"div",
|
|
2486
|
-
A(x({},
|
|
2487
|
-
className:
|
|
2486
|
+
A(x({}, h), {
|
|
2487
|
+
className: L(
|
|
2488
2488
|
"card__empty-state",
|
|
2489
2489
|
s === "error" && "card__empty-state--error",
|
|
2490
2490
|
n && "card__empty-state--standalone",
|
|
2491
2491
|
c
|
|
2492
2492
|
),
|
|
2493
2493
|
children: /* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__wrapper", children: [
|
|
2494
|
-
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(
|
|
2494
|
+
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(si, {}) : r }),
|
|
2495
2495
|
/* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__content", children: [
|
|
2496
2496
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__title", children: l }),
|
|
2497
2497
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__description", children: o })
|
|
@@ -2499,13 +2499,13 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2499
2499
|
] })
|
|
2500
2500
|
})
|
|
2501
2501
|
);
|
|
2502
|
-
},
|
|
2502
|
+
}, hi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__footer", children: e }), di = (e) => {
|
|
2503
2503
|
var t = e, {
|
|
2504
2504
|
variant: s = "default",
|
|
2505
2505
|
sticky: r,
|
|
2506
2506
|
className: n,
|
|
2507
2507
|
children: l
|
|
2508
|
-
} = t, o =
|
|
2508
|
+
} = t, o = O(t, [
|
|
2509
2509
|
"variant",
|
|
2510
2510
|
"sticky",
|
|
2511
2511
|
"className",
|
|
@@ -2514,7 +2514,7 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2514
2514
|
return /* @__PURE__ */ i.jsx(
|
|
2515
2515
|
"div",
|
|
2516
2516
|
A(x({}, o), {
|
|
2517
|
-
className:
|
|
2517
|
+
className: L(
|
|
2518
2518
|
"card__header",
|
|
2519
2519
|
s && `card__header--${s}`,
|
|
2520
2520
|
r && "card__header--sticky",
|
|
@@ -2523,55 +2523,55 @@ var Fr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2523
2523
|
children: l
|
|
2524
2524
|
})
|
|
2525
2525
|
);
|
|
2526
|
-
},
|
|
2526
|
+
}, fi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__image", children: e }), pi = ({ children: e, className: t }) => /* @__PURE__ */ i.jsx("div", { className: L("card__body__item", t), children: e }), mi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__body__subtitle", children: e }), vi = ({ icon: e, children: t }) => /* @__PURE__ */ i.jsxs("div", { className: "card__header__title", children: [
|
|
2527
2527
|
e && /* @__PURE__ */ i.jsx("span", { className: "card__header__title__icon", children: e }),
|
|
2528
2528
|
t
|
|
2529
|
-
] }),
|
|
2529
|
+
] }), js = f.forwardRef(
|
|
2530
2530
|
(e, t) => {
|
|
2531
|
-
var s = e, { type: r, children: n, className: l, variant: o = "default", disabled: c = !1 } = s,
|
|
2531
|
+
var s = e, { type: r, children: n, className: l, variant: o = "default", disabled: c = !1 } = s, h = O(s, ["type", "children", "className", "variant", "disabled"]);
|
|
2532
2532
|
return f.createElement(
|
|
2533
2533
|
r,
|
|
2534
2534
|
x({
|
|
2535
|
-
className:
|
|
2535
|
+
className: L(
|
|
2536
2536
|
"card",
|
|
2537
2537
|
c && "card--disabled",
|
|
2538
2538
|
o && `card--${o}`,
|
|
2539
2539
|
l
|
|
2540
2540
|
),
|
|
2541
2541
|
ref: t
|
|
2542
|
-
},
|
|
2542
|
+
}, h),
|
|
2543
2543
|
n
|
|
2544
2544
|
);
|
|
2545
2545
|
}
|
|
2546
2546
|
);
|
|
2547
|
-
|
|
2548
|
-
Object.assign(
|
|
2549
|
-
Header:
|
|
2550
|
-
Action:
|
|
2551
|
-
Title:
|
|
2552
|
-
Subtitle:
|
|
2553
|
-
Body:
|
|
2554
|
-
Image:
|
|
2555
|
-
Item:
|
|
2556
|
-
Footer:
|
|
2557
|
-
EmptyState:
|
|
2547
|
+
js.displayName = "Card";
|
|
2548
|
+
Object.assign(js, {
|
|
2549
|
+
Header: di,
|
|
2550
|
+
Action: Dr,
|
|
2551
|
+
Title: vi,
|
|
2552
|
+
Subtitle: mi,
|
|
2553
|
+
Body: Tr,
|
|
2554
|
+
Image: fi,
|
|
2555
|
+
Item: pi,
|
|
2556
|
+
Footer: hi,
|
|
2557
|
+
EmptyState: ui
|
|
2558
2558
|
});
|
|
2559
|
-
var
|
|
2560
|
-
var t = e, { className: s, children: r } = t, n =
|
|
2561
|
-
return /* @__PURE__ */ i.jsx("div", A(x({ className:
|
|
2562
|
-
},
|
|
2563
|
-
var t = e, { className: s, children: r } = t, n =
|
|
2564
|
-
return /* @__PURE__ */ i.jsx("span", A(x({ className:
|
|
2565
|
-
},
|
|
2566
|
-
const e = f.useContext(
|
|
2559
|
+
var gi = (e) => {
|
|
2560
|
+
var t = e, { className: s, children: r } = t, n = O(t, ["className", "children"]);
|
|
2561
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: L("checkbox__content", s) }, n), { children: r }));
|
|
2562
|
+
}, yi = (e) => {
|
|
2563
|
+
var t = e, { className: s, children: r } = t, n = O(t, ["className", "children"]);
|
|
2564
|
+
return /* @__PURE__ */ i.jsx("span", A(x({ className: L("checkbox__hint", s) }, n), { children: r }));
|
|
2565
|
+
}, _s = f.createContext(void 0), Ci = ({ id: e, name: t, children: s }) => /* @__PURE__ */ i.jsx(_s.Provider, { value: { id: e, name: t }, children: s }), xi = () => {
|
|
2566
|
+
const e = f.useContext(_s);
|
|
2567
2567
|
if (!e)
|
|
2568
2568
|
throw new Error("Checkbox compound components can not be rendered outside of Checkbox");
|
|
2569
2569
|
return e;
|
|
2570
|
-
},
|
|
2571
|
-
var t = e, { className: s, children: r } = t, n =
|
|
2572
|
-
const { id: l } =
|
|
2573
|
-
return /* @__PURE__ */ i.jsx("label", A(x({ htmlFor: l, className:
|
|
2574
|
-
},
|
|
2570
|
+
}, bi = (e) => {
|
|
2571
|
+
var t = e, { className: s, children: r } = t, n = O(t, ["className", "children"]);
|
|
2572
|
+
const { id: l } = xi();
|
|
2573
|
+
return /* @__PURE__ */ i.jsx("label", A(x({ htmlFor: l, className: L("checkbox__label", s) }, n), { children: r }));
|
|
2574
|
+
}, je = (e) => {
|
|
2575
2575
|
var t = e, {
|
|
2576
2576
|
id: s,
|
|
2577
2577
|
name: r,
|
|
@@ -2579,9 +2579,9 @@ var vi = (e) => {
|
|
|
2579
2579
|
variant: l = "neutral",
|
|
2580
2580
|
hasError: o = !1,
|
|
2581
2581
|
single: c,
|
|
2582
|
-
className:
|
|
2582
|
+
className: h,
|
|
2583
2583
|
children: m
|
|
2584
|
-
} = t,
|
|
2584
|
+
} = t, d = O(t, [
|
|
2585
2585
|
"id",
|
|
2586
2586
|
"name",
|
|
2587
2587
|
"isPending",
|
|
@@ -2597,7 +2597,7 @@ var vi = (e) => {
|
|
|
2597
2597
|
}, [n]), /* @__PURE__ */ i.jsxs(
|
|
2598
2598
|
"div",
|
|
2599
2599
|
{
|
|
2600
|
-
className:
|
|
2600
|
+
className: L("checkbox", l && `checkbox--${l}`, o && "checkbox--error"),
|
|
2601
2601
|
children: [
|
|
2602
2602
|
/* @__PURE__ */ i.jsx(
|
|
2603
2603
|
"input",
|
|
@@ -2606,101 +2606,101 @@ var vi = (e) => {
|
|
|
2606
2606
|
name: r,
|
|
2607
2607
|
type: "checkbox",
|
|
2608
2608
|
ref: u,
|
|
2609
|
-
className:
|
|
2609
|
+
className: L("checkbox__input", h),
|
|
2610
2610
|
value: c ? "true" : ""
|
|
2611
|
-
},
|
|
2611
|
+
}, d)
|
|
2612
2612
|
),
|
|
2613
|
-
n ? /* @__PURE__ */ i.jsx(
|
|
2614
|
-
/* @__PURE__ */ i.jsx(
|
|
2613
|
+
n ? /* @__PURE__ */ i.jsx(ei, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ i.jsx(Hr, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
|
|
2614
|
+
/* @__PURE__ */ i.jsx(Ci, { id: s, name: r, children: m })
|
|
2615
2615
|
]
|
|
2616
2616
|
}
|
|
2617
2617
|
);
|
|
2618
2618
|
};
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
var
|
|
2624
|
-
var t = e, { type: s = "div", className: r, children: n } = t, l =
|
|
2625
|
-
return f.createElement(s, x({ className:
|
|
2626
|
-
},
|
|
2627
|
-
var t = e, { className: s, children: r, shouldAnimate: n = !0 } = t, l =
|
|
2628
|
-
const { ref: o, defaultOpen: c, isModal:
|
|
2619
|
+
je.Content = gi;
|
|
2620
|
+
je.Label = bi;
|
|
2621
|
+
je.Hint = yi;
|
|
2622
|
+
je.Error = Error;
|
|
2623
|
+
var wi = (e) => {
|
|
2624
|
+
var t = e, { type: s = "div", className: r, children: n } = t, l = O(t, ["type", "className", "children"]);
|
|
2625
|
+
return f.createElement(s, x({ className: L("dialog__body", r) }, l), n);
|
|
2626
|
+
}, xt = () => document.body.style.removeProperty("overflow"), Ht = (e) => e.preventDefault(), ji = '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])', _i = (e) => {
|
|
2627
|
+
var t = e, { className: s, children: r, shouldAnimate: n = !0 } = t, l = O(t, ["className", "children", "shouldAnimate"]);
|
|
2628
|
+
const { ref: o, defaultOpen: c, isModal: h, onClose: m } = Ye();
|
|
2629
2629
|
return f.useEffect(() => {
|
|
2630
|
-
const
|
|
2631
|
-
if (
|
|
2632
|
-
const u =
|
|
2630
|
+
const d = o == null ? void 0 : o.current;
|
|
2631
|
+
if (d != null && d.open) {
|
|
2632
|
+
const u = d.querySelectorAll(ji), v = u[0], g = u[u.length - 1], S = (_) => {
|
|
2633
2633
|
if (!(_.key === "Tab"))
|
|
2634
2634
|
return;
|
|
2635
2635
|
_.shiftKey ? document.activeElement === v && (g.focus(), _.preventDefault()) : document.activeElement === g && (v.focus(), _.preventDefault());
|
|
2636
2636
|
};
|
|
2637
|
-
return document.body.style.overflow = "hidden",
|
|
2638
|
-
|
|
2637
|
+
return document.body.style.overflow = "hidden", d.addEventListener("keydown", S), window.addEventListener("popstate", () => xt()), () => {
|
|
2638
|
+
d.removeEventListener("keydown", S), window.removeEventListener("popstate", () => xt());
|
|
2639
2639
|
};
|
|
2640
2640
|
}
|
|
2641
2641
|
}, [o]), f.useEffect(() => {
|
|
2642
|
-
const
|
|
2643
|
-
if (!
|
|
2642
|
+
const d = o == null ? void 0 : o.current;
|
|
2643
|
+
if (!d)
|
|
2644
2644
|
return;
|
|
2645
|
-
if (c && (
|
|
2646
|
-
return
|
|
2645
|
+
if (c && (d.removeAttribute("open"), d.showModal(), d.focus()), h)
|
|
2646
|
+
return d.addEventListener("cancel", Ht), () => d.removeEventListener("cancel", Ht);
|
|
2647
2647
|
const u = ({ clientX: v, clientY: g }) => {
|
|
2648
|
-
const { top: S, right: _, bottom: P, left: C } =
|
|
2648
|
+
const { top: S, right: _, bottom: P, left: C } = d.getBoundingClientRect(), j = 0 < g && 0 < v, b = S < g && g < P, M = C < v && v < _;
|
|
2649
2649
|
j && !(b && M) && m();
|
|
2650
2650
|
};
|
|
2651
|
-
return
|
|
2652
|
-
|
|
2651
|
+
return d.addEventListener("cancel", m), d.addEventListener("mousedown", u), () => {
|
|
2652
|
+
d.removeEventListener("cancel", m), d.removeEventListener("mousedown", u);
|
|
2653
2653
|
};
|
|
2654
|
-
}, [o,
|
|
2654
|
+
}, [o, h, m, c]), /* @__PURE__ */ i.jsx(
|
|
2655
2655
|
"dialog",
|
|
2656
2656
|
A(x({
|
|
2657
2657
|
ref: o,
|
|
2658
2658
|
open: c,
|
|
2659
|
-
"aria-modal": !!
|
|
2659
|
+
"aria-modal": !!h,
|
|
2660
2660
|
"aria-labelledby": "dialogTitle",
|
|
2661
|
-
className:
|
|
2661
|
+
className: L("dialog", n && "dialog--animated", s)
|
|
2662
2662
|
}, l), {
|
|
2663
2663
|
children: r
|
|
2664
2664
|
})
|
|
2665
2665
|
);
|
|
2666
|
-
},
|
|
2666
|
+
}, Ss = f.createContext(void 0), Si = ({ defaultOpen: e, onClose: t, isModal: s, children: r }) => {
|
|
2667
2667
|
const n = f.useRef(null), l = f.useRef(t), o = f.useCallback(() => {
|
|
2668
2668
|
var c;
|
|
2669
|
-
|
|
2669
|
+
xt(), (c = n.current) == null || c.close(), l.current && (l == null || l.current());
|
|
2670
2670
|
}, [n]);
|
|
2671
|
-
return /* @__PURE__ */ i.jsx(
|
|
2672
|
-
},
|
|
2673
|
-
const e = f.useContext(
|
|
2671
|
+
return /* @__PURE__ */ i.jsx(Ss.Provider, { value: { ref: n, defaultOpen: e, isModal: s, onClose: o }, children: r });
|
|
2672
|
+
}, Ye = () => {
|
|
2673
|
+
const e = f.useContext(Ss);
|
|
2674
2674
|
if (!e)
|
|
2675
2675
|
throw new Error("Dialog compound components can not be rendered outside of Dialog");
|
|
2676
2676
|
return e;
|
|
2677
|
-
},
|
|
2678
|
-
var t = e, { children: s } = t, r =
|
|
2679
|
-
const { onClose: n } =
|
|
2680
|
-
return /* @__PURE__ */ i.jsx(
|
|
2681
|
-
},
|
|
2682
|
-
var s = e, { className: r } = s, n =
|
|
2683
|
-
const { onClose: l } =
|
|
2677
|
+
}, Ei = (e) => {
|
|
2678
|
+
var t = e, { children: s } = t, r = O(t, ["children"]);
|
|
2679
|
+
const { onClose: n } = Ye();
|
|
2680
|
+
return /* @__PURE__ */ i.jsx(ze, A(x({ onClick: n }, r), { children: s }));
|
|
2681
|
+
}, Es = f.forwardRef((e, t) => {
|
|
2682
|
+
var s = e, { className: r } = s, n = O(s, ["className"]);
|
|
2683
|
+
const { onClose: l } = Ye();
|
|
2684
2684
|
return /* @__PURE__ */ i.jsx(
|
|
2685
|
-
|
|
2685
|
+
ze,
|
|
2686
2686
|
x({
|
|
2687
2687
|
type: "submit",
|
|
2688
2688
|
ref: t,
|
|
2689
2689
|
formMethod: "dialog",
|
|
2690
2690
|
onClick: l,
|
|
2691
|
-
iconLeft: /* @__PURE__ */ i.jsx(
|
|
2691
|
+
iconLeft: /* @__PURE__ */ i.jsx(Gr, {}),
|
|
2692
2692
|
variant: "icon--secondary",
|
|
2693
|
-
className:
|
|
2693
|
+
className: L("dialog__close button--icon", r)
|
|
2694
2694
|
}, n)
|
|
2695
2695
|
);
|
|
2696
2696
|
});
|
|
2697
|
-
|
|
2698
|
-
var
|
|
2699
|
-
var t = e, { className: s, children: r } = t, n =
|
|
2700
|
-
return /* @__PURE__ */ i.jsx("div", A(x({ className:
|
|
2701
|
-
},
|
|
2702
|
-
var t = e, { icon: s, children: r, className: n } = t, l =
|
|
2703
|
-
const { ref: o } =
|
|
2697
|
+
Es.displayName = "Close";
|
|
2698
|
+
var Pi = (e) => {
|
|
2699
|
+
var t = e, { className: s, children: r } = t, n = O(t, ["className", "children"]);
|
|
2700
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: L("dialog__footer", s) }, n), { children: r }));
|
|
2701
|
+
}, ki = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "dialog__header", children: e }), Ai = (e) => {
|
|
2702
|
+
var t = e, { icon: s, children: r, className: n } = t, l = O(t, ["icon", "children", "className"]);
|
|
2703
|
+
const { ref: o } = Ye(), c = f.useRef(null);
|
|
2704
2704
|
return f.useEffect(() => {
|
|
2705
2705
|
o != null && o.current && o.current.focus();
|
|
2706
2706
|
}, [o]), /* @__PURE__ */ i.jsxs(
|
|
@@ -2709,7 +2709,7 @@ var Ei = (e) => {
|
|
|
2709
2709
|
tabIndex: 0,
|
|
2710
2710
|
ref: c,
|
|
2711
2711
|
id: "dialogTitle",
|
|
2712
|
-
className:
|
|
2712
|
+
className: L("dialog__header__title", n)
|
|
2713
2713
|
}, l), {
|
|
2714
2714
|
children: [
|
|
2715
2715
|
s && /* @__PURE__ */ i.jsx("span", { className: "dialog__header__icon", children: s }),
|
|
@@ -2717,23 +2717,23 @@ var Ei = (e) => {
|
|
|
2717
2717
|
]
|
|
2718
2718
|
})
|
|
2719
2719
|
);
|
|
2720
|
-
},
|
|
2721
|
-
var t = e, { children: s } = t, r =
|
|
2722
|
-
const { ref: n } =
|
|
2723
|
-
return /* @__PURE__ */ i.jsx(
|
|
2720
|
+
}, Ni = (e) => {
|
|
2721
|
+
var t = e, { children: s } = t, r = O(t, ["children"]);
|
|
2722
|
+
const { ref: n } = Ye();
|
|
2723
|
+
return /* @__PURE__ */ i.jsx(ze, A(x({ onClick: () => {
|
|
2724
2724
|
var l;
|
|
2725
2725
|
return (l = n == null ? void 0 : n.current) == null ? void 0 : l.showModal();
|
|
2726
2726
|
} }, r), { children: s }));
|
|
2727
|
-
}, G = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(
|
|
2728
|
-
G.Trigger =
|
|
2729
|
-
G.Root =
|
|
2730
|
-
G.Title =
|
|
2731
|
-
G.Header =
|
|
2732
|
-
G.Body =
|
|
2733
|
-
G.Footer =
|
|
2734
|
-
G.Button =
|
|
2735
|
-
G.Close =
|
|
2736
|
-
var
|
|
2727
|
+
}, G = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(Si, { defaultOpen: !!e, isModal: t, onClose: r, children: s });
|
|
2728
|
+
G.Trigger = Ni;
|
|
2729
|
+
G.Root = _i;
|
|
2730
|
+
G.Title = Ai;
|
|
2731
|
+
G.Header = ki;
|
|
2732
|
+
G.Body = wi;
|
|
2733
|
+
G.Footer = Pi;
|
|
2734
|
+
G.Button = Ei;
|
|
2735
|
+
G.Close = Es;
|
|
2736
|
+
var Ps = f.createContext(void 0), Mi = ({
|
|
2737
2737
|
id: e,
|
|
2738
2738
|
position: t,
|
|
2739
2739
|
isOpen: s,
|
|
@@ -2742,10 +2742,10 @@ var Es = f.createContext(void 0), Ni = ({
|
|
|
2742
2742
|
setActiveItemIndex: l,
|
|
2743
2743
|
clearActiveItemIndex: o,
|
|
2744
2744
|
triggerRef: c,
|
|
2745
|
-
contentRef:
|
|
2745
|
+
contentRef: h,
|
|
2746
2746
|
children: m
|
|
2747
2747
|
}) => /* @__PURE__ */ i.jsx(
|
|
2748
|
-
|
|
2748
|
+
Ps.Provider,
|
|
2749
2749
|
{
|
|
2750
2750
|
value: {
|
|
2751
2751
|
id: e,
|
|
@@ -2756,16 +2756,16 @@ var Es = f.createContext(void 0), Ni = ({
|
|
|
2756
2756
|
setActiveItemIndex: l,
|
|
2757
2757
|
clearActiveItemIndex: o,
|
|
2758
2758
|
triggerRef: c,
|
|
2759
|
-
contentRef:
|
|
2759
|
+
contentRef: h
|
|
2760
2760
|
},
|
|
2761
2761
|
children: m
|
|
2762
2762
|
}
|
|
2763
|
-
),
|
|
2764
|
-
const e = f.useContext(
|
|
2763
|
+
), ks = () => {
|
|
2764
|
+
const e = f.useContext(Ps);
|
|
2765
2765
|
if (e === void 0)
|
|
2766
2766
|
throw new Error("useMenu must be used within a MenuProvider");
|
|
2767
2767
|
return e;
|
|
2768
|
-
},
|
|
2768
|
+
}, Li = ({ as: e, children: t }) => {
|
|
2769
2769
|
const {
|
|
2770
2770
|
id: s,
|
|
2771
2771
|
position: r,
|
|
@@ -2773,16 +2773,16 @@ var Es = f.createContext(void 0), Ni = ({
|
|
|
2773
2773
|
setIsOpen: l,
|
|
2774
2774
|
activeItemIndex: o,
|
|
2775
2775
|
setActiveItemIndex: c,
|
|
2776
|
-
clearActiveItemIndex:
|
|
2776
|
+
clearActiveItemIndex: h,
|
|
2777
2777
|
triggerRef: m,
|
|
2778
|
-
contentRef:
|
|
2779
|
-
} =
|
|
2778
|
+
contentRef: d
|
|
2779
|
+
} = ks(), u = (v) => {
|
|
2780
2780
|
var g;
|
|
2781
2781
|
if (!n)
|
|
2782
2782
|
return;
|
|
2783
2783
|
if (v.key === "Escape")
|
|
2784
|
-
return
|
|
2785
|
-
const S = v.shiftKey, _ =
|
|
2784
|
+
return h(), l(!1), (g = m.current) == null ? void 0 : g.focus();
|
|
2785
|
+
const S = v.shiftKey, _ = Ns(d.current).length - 1;
|
|
2786
2786
|
switch (v.key) {
|
|
2787
2787
|
case "Tab": {
|
|
2788
2788
|
if (S && o !== 0)
|
|
@@ -2813,8 +2813,8 @@ var Es = f.createContext(void 0), Ni = ({
|
|
|
2813
2813
|
e,
|
|
2814
2814
|
{
|
|
2815
2815
|
id: `${s}-content`,
|
|
2816
|
-
ref:
|
|
2817
|
-
className:
|
|
2816
|
+
ref: d,
|
|
2817
|
+
className: L("menu__list", `menu__list--${r}`, n && "menu__list--active"),
|
|
2818
2818
|
onKeyDown: u
|
|
2819
2819
|
},
|
|
2820
2820
|
t
|
|
@@ -2824,49 +2824,49 @@ var Es = f.createContext(void 0), Ni = ({
|
|
|
2824
2824
|
"ul",
|
|
2825
2825
|
{
|
|
2826
2826
|
id: `${s}-content`,
|
|
2827
|
-
ref:
|
|
2828
|
-
className:
|
|
2827
|
+
ref: d,
|
|
2828
|
+
className: L("menu__list", `menu__list--${r}`, n && "menu__list--active"),
|
|
2829
2829
|
onKeyDown: u,
|
|
2830
2830
|
children: t
|
|
2831
2831
|
}
|
|
2832
2832
|
)
|
|
2833
2833
|
);
|
|
2834
2834
|
}, Ri = (e) => {
|
|
2835
|
-
var t = e, { children: s, className: r } = t, n =
|
|
2836
|
-
return /* @__PURE__ */ i.jsx("li", A(x({}, n), { className:
|
|
2837
|
-
},
|
|
2838
|
-
const { id: s, isOpen: r, setIsOpen: n, clearActiveItemIndex: l, setActiveItemIndex: o, triggerRef: c } =
|
|
2839
|
-
l(), n((
|
|
2840
|
-
}, m = (
|
|
2835
|
+
var t = e, { children: s, className: r } = t, n = O(t, ["children", "className"]);
|
|
2836
|
+
return /* @__PURE__ */ i.jsx("li", A(x({}, n), { className: L("menu__list-item", r), children: s }));
|
|
2837
|
+
}, As = ({ children: e, className: t }) => {
|
|
2838
|
+
const { id: s, isOpen: r, setIsOpen: n, clearActiveItemIndex: l, setActiveItemIndex: o, triggerRef: c } = ks(), h = () => {
|
|
2839
|
+
l(), n((d) => !d), r || o(0);
|
|
2840
|
+
}, m = (d) => {
|
|
2841
2841
|
if (r) {
|
|
2842
|
-
if (
|
|
2842
|
+
if (d.key === "Escape")
|
|
2843
2843
|
return l(), n(!1);
|
|
2844
|
-
|
|
2844
|
+
d.key === "ArrowDown" && (d.preventDefault(), o(0));
|
|
2845
2845
|
}
|
|
2846
2846
|
};
|
|
2847
2847
|
return f.cloneElement(e, {
|
|
2848
2848
|
id: `${s}-trigger`,
|
|
2849
2849
|
ref: c,
|
|
2850
|
-
className:
|
|
2851
|
-
onClick:
|
|
2850
|
+
className: L("menu__trigger", t),
|
|
2851
|
+
onClick: h,
|
|
2852
2852
|
onKeyDown: m,
|
|
2853
2853
|
"aria-expanded": r,
|
|
2854
2854
|
"aria-controls": `${s}-content`
|
|
2855
2855
|
});
|
|
2856
2856
|
};
|
|
2857
|
-
|
|
2858
|
-
var
|
|
2859
|
-
var t = e, { type: s, id: r, position: n = "bottom-end", children: l, className: o } = t, c =
|
|
2860
|
-
const
|
|
2861
|
-
g !== _ && g !== void 0 &&
|
|
2857
|
+
As.displayName = "Trigger";
|
|
2858
|
+
var Ns = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsByTagName("ul")).reduce((s, r) => [...s, ...Array.from(r.getElementsByTagName("li"))], []) : [], W = (e) => {
|
|
2859
|
+
var t = e, { type: s, id: r, position: n = "bottom-end", children: l, className: o } = t, c = O(t, ["type", "id", "position", "children", "className"]);
|
|
2860
|
+
const h = f.useRef(null), m = f.useRef(null), d = f.useRef(null), [u, v] = f.useState(!1), [g, S] = f.useState(), [_, P] = f.useState(g);
|
|
2861
|
+
g !== _ && g !== void 0 && d.current && (Ns(d.current)[g].firstChild.focus(), P(g));
|
|
2862
2862
|
const C = () => {
|
|
2863
2863
|
S(void 0), P(void 0);
|
|
2864
2864
|
}, j = (b) => {
|
|
2865
2865
|
var M;
|
|
2866
|
-
((M =
|
|
2866
|
+
((M = h.current) == null ? void 0 : M.contains(b.relatedTarget)) || (C(), v(!1));
|
|
2867
2867
|
};
|
|
2868
2868
|
return /* @__PURE__ */ i.jsx(
|
|
2869
|
-
|
|
2869
|
+
Mi,
|
|
2870
2870
|
{
|
|
2871
2871
|
id: r,
|
|
2872
2872
|
position: n,
|
|
@@ -2876,12 +2876,12 @@ var As = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsBy
|
|
|
2876
2876
|
setActiveItemIndex: S,
|
|
2877
2877
|
clearActiveItemIndex: C,
|
|
2878
2878
|
triggerRef: m,
|
|
2879
|
-
contentRef:
|
|
2879
|
+
contentRef: d,
|
|
2880
2880
|
children: f.createElement(
|
|
2881
2881
|
s,
|
|
2882
2882
|
A(x({}, c), {
|
|
2883
2883
|
id: r,
|
|
2884
|
-
ref:
|
|
2884
|
+
ref: h,
|
|
2885
2885
|
className: `menu ${o || ""}`,
|
|
2886
2886
|
onBlur: j
|
|
2887
2887
|
}),
|
|
@@ -2890,8 +2890,8 @@ var As = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsBy
|
|
|
2890
2890
|
}
|
|
2891
2891
|
);
|
|
2892
2892
|
};
|
|
2893
|
-
W.Trigger =
|
|
2894
|
-
W.Content =
|
|
2893
|
+
W.Trigger = As;
|
|
2894
|
+
W.Content = Li;
|
|
2895
2895
|
W.Item = Ri;
|
|
2896
2896
|
f.createContext(void 0);
|
|
2897
2897
|
var Oi = (/* @__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");
|
|
@@ -2901,59 +2901,66 @@ var Oi = (/* @__PURE__ */ new Map()).set("BE", "32").set("FR", "33").set("NL", "
|
|
|
2901
2901
|
}));
|
|
2902
2902
|
f.createContext(void 0);
|
|
2903
2903
|
f.createContext(void 0);
|
|
2904
|
-
var
|
|
2905
|
-
const
|
|
2904
|
+
var rt = /* @__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))(rt || {});
|
|
2905
|
+
const Fi = ({
|
|
2906
2906
|
bouIconId: e,
|
|
2907
2907
|
...t
|
|
2908
|
-
}) =>
|
|
2908
|
+
}) => {
|
|
2909
|
+
const s = new URL(
|
|
2910
|
+
/* @vite-ignore */
|
|
2911
|
+
"../public/icons/bouMenuIcons.svg",
|
|
2912
|
+
import.meta.url
|
|
2913
|
+
).href;
|
|
2914
|
+
return /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i.jsx("use", { href: `${s}#${rt[e]}` }) });
|
|
2915
|
+
}, bt = (e) => typeof e.icon == "string" && e.icon in rt ? /* @__PURE__ */ i.jsx(Fi, { bouIconId: rt[e.icon] }) : e.icon, Di = ({
|
|
2909
2916
|
label: e,
|
|
2910
2917
|
className: t,
|
|
2911
2918
|
onClick: s,
|
|
2912
2919
|
icon: r
|
|
2913
2920
|
}) => /* @__PURE__ */ i.jsx(W.Item, { className: t, children: /* @__PURE__ */ i.jsxs("button", { onClick: s, children: [
|
|
2914
|
-
/* @__PURE__ */ i.jsx(
|
|
2921
|
+
/* @__PURE__ */ i.jsx(bt, { icon: r }),
|
|
2915
2922
|
e
|
|
2916
|
-
] }) }),
|
|
2917
|
-
const t =
|
|
2923
|
+
] }) }), Se = (e) => {
|
|
2924
|
+
const t = Hs(), { className: s, label: r, mobileUrl: n, desktopUrl: l, icon: o } = e;
|
|
2918
2925
|
return /* @__PURE__ */ i.jsxs(W.Item, { className: s, children: [
|
|
2919
2926
|
(!t || t && !l) && /* @__PURE__ */ i.jsxs("a", { href: n, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2920
|
-
/* @__PURE__ */ i.jsx(
|
|
2927
|
+
/* @__PURE__ */ i.jsx(bt, { icon: o }),
|
|
2921
2928
|
r
|
|
2922
2929
|
] }),
|
|
2923
2930
|
!!l && /* @__PURE__ */ i.jsxs("a", { href: l, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2924
|
-
/* @__PURE__ */ i.jsx(
|
|
2931
|
+
/* @__PURE__ */ i.jsx(bt, { icon: o }),
|
|
2925
2932
|
r
|
|
2926
2933
|
] })
|
|
2927
2934
|
] });
|
|
2928
|
-
},
|
|
2929
|
-
const e = f.useContext(
|
|
2935
|
+
}, Ms = f.createContext(void 0), Ti = ({ apiUrl: e, authUrl: t, country: s, redirectUrl: r, bouHeaders: n, children: l }) => /* @__PURE__ */ i.jsx(Ms.Provider, { value: { apiUrl: e, authUrl: t, country: s, redirectUrl: r, bouHeaders: n }, children: l }), _e = () => {
|
|
2936
|
+
const e = f.useContext(Ms);
|
|
2930
2937
|
if (!e)
|
|
2931
|
-
throw new Error("
|
|
2938
|
+
throw new Error("Api context can not be rendered outside of Api");
|
|
2932
2939
|
return e;
|
|
2933
|
-
},
|
|
2934
|
-
const e = f.useContext(
|
|
2940
|
+
}, Ls = f.createContext(void 0), Ui = ({ position: e, bouMenuItems: t, children: s }) => /* @__PURE__ */ i.jsx(Ls.Provider, { value: { position: e, bouMenuItems: t }, children: s }), Rs = () => {
|
|
2941
|
+
const e = f.useContext(Ls);
|
|
2935
2942
|
if (!e)
|
|
2936
|
-
throw new Error("
|
|
2943
|
+
throw new Error("Authentication context can not be rendered outside of Authentication");
|
|
2937
2944
|
return e;
|
|
2938
2945
|
}, Os = ({ authUrl: e, redirectUrl: t, trackingInfo: s }) => {
|
|
2939
2946
|
const r = new URLSearchParams({ redirectUrl: t });
|
|
2940
2947
|
s && r.append("trackingInfo", s);
|
|
2941
2948
|
const n = `${e}/login?${r.toString()}`, l = `${e}/logout?${r.toString()}`;
|
|
2942
2949
|
return { loginUrl: n, logoutUrl: l };
|
|
2943
|
-
},
|
|
2944
|
-
const { authUrl: e, redirectUrl: t } =
|
|
2950
|
+
}, it = () => {
|
|
2951
|
+
const { authUrl: e, redirectUrl: t } = _e(), s = Ks();
|
|
2945
2952
|
return Os({ authUrl: e, redirectUrl: t, trackingInfo: s });
|
|
2946
2953
|
}, Qi = () => {
|
|
2947
|
-
const { apiUrl: e } =
|
|
2954
|
+
const { apiUrl: e } = _e();
|
|
2948
2955
|
return `${`${e}/xtra`}/authentication/v1/user/profile`;
|
|
2949
|
-
},
|
|
2956
|
+
}, Kt = (e) => e ? `+${e.countryCode} ${e.number}` : "", Gt = (e, t) => t == null ? void 0 : t.find((s) => s.type === e), qt = ({ apiUrl: e, redirectUrl: t }) => {
|
|
2950
2957
|
const { loginUrl: s } = Os({ authUrl: e, redirectUrl: t });
|
|
2951
2958
|
window.location.replace(s);
|
|
2952
|
-
},
|
|
2959
|
+
}, Wt = (e) => {
|
|
2953
2960
|
var l;
|
|
2954
2961
|
if (!e)
|
|
2955
|
-
return { user: { state: () => "NotAuthenticated" }, tryToLogon:
|
|
2956
|
-
const t = new Date(e.dateOfBirth), s =
|
|
2962
|
+
return { user: { state: () => "NotAuthenticated" }, tryToLogon: qt };
|
|
2963
|
+
const t = new Date(e.dateOfBirth), s = Gt(Nt.Mobile, e.phone), r = Gt(Nt.Fixed, e.phone), n = Kt(s) ?? Kt(r) ?? "";
|
|
2957
2964
|
return {
|
|
2958
2965
|
user: {
|
|
2959
2966
|
...(l = window.XTRA) == null ? void 0 : l.user,
|
|
@@ -2992,68 +2999,68 @@ const Li = "/icons/bouMenuIcons.svg", Fi = ({
|
|
|
2992
2999
|
cbh: () => e.customerIdentifier,
|
|
2993
3000
|
state: () => "Authenticated"
|
|
2994
3001
|
},
|
|
2995
|
-
tryToLogon:
|
|
3002
|
+
tryToLogon: qt
|
|
2996
3003
|
};
|
|
2997
|
-
},
|
|
2998
|
-
const { i18n: e } =
|
|
2999
|
-
return
|
|
3000
|
-
queryKey:
|
|
3004
|
+
}, Fs = ["profile"], Ds = () => {
|
|
3005
|
+
const { i18n: e } = pe(), { country: t, bouHeaders: s } = _e(), r = Qi(), n = sessionStorage.getItem("profile"), l = !!n;
|
|
3006
|
+
return ys({
|
|
3007
|
+
queryKey: Fs,
|
|
3001
3008
|
queryFn: async () => {
|
|
3002
|
-
const
|
|
3009
|
+
const c = jt(e.language, t), h = await fetch(r, {
|
|
3003
3010
|
credentials: "include",
|
|
3004
3011
|
mode: "cors",
|
|
3005
|
-
headers: { "Accept-Language":
|
|
3012
|
+
headers: { "Accept-Language": c, ...s }
|
|
3006
3013
|
});
|
|
3007
|
-
if (!
|
|
3008
|
-
if (
|
|
3009
|
-
return window.XTRA = { ...window.XTRA, ...
|
|
3014
|
+
if (!h.ok) {
|
|
3015
|
+
if (h.status === 401)
|
|
3016
|
+
return window.XTRA = { ...window.XTRA, ...Wt() }, window.postMessage(
|
|
3010
3017
|
{ source: "xtra-authentication", isAuthenticated: !1 },
|
|
3011
3018
|
new URL(window.location.href).origin
|
|
3012
3019
|
), sessionStorage.removeItem("profile"), { authenticationStatus: "NotAuthenticated" };
|
|
3013
|
-
if (
|
|
3014
|
-
return { authenticationStatus: "Authenticated", profile: JSON.parse(
|
|
3020
|
+
if (l)
|
|
3021
|
+
return { authenticationStatus: "Authenticated", profile: JSON.parse(n) };
|
|
3015
3022
|
throw new Error("Failed to retrieve profile");
|
|
3016
3023
|
}
|
|
3017
|
-
const
|
|
3018
|
-
return sessionStorage.setItem("profile", JSON.stringify({ firstName:
|
|
3024
|
+
const m = await h.json(), { firstName: d, lastName: u } = m;
|
|
3025
|
+
return sessionStorage.setItem("profile", JSON.stringify({ firstName: d, lastName: u })), window.postMessage(
|
|
3019
3026
|
{ source: "xtra-authentication", isAuthenticated: !0 },
|
|
3020
3027
|
new URL(window.location.href).origin
|
|
3021
|
-
), window.XTRA = { ...window.XTRA, ...
|
|
3028
|
+
), window.XTRA = { ...window.XTRA, ...Wt(m) }, {
|
|
3022
3029
|
authenticationStatus: "Authenticated",
|
|
3023
|
-
profile: { firstName:
|
|
3030
|
+
profile: { firstName: m.firstName, lastName: m.lastName }
|
|
3024
3031
|
};
|
|
3025
3032
|
},
|
|
3026
|
-
initialData:
|
|
3033
|
+
initialData: l ? {
|
|
3027
3034
|
authenticationStatus: "Authenticated",
|
|
3028
|
-
profile: JSON.parse(
|
|
3035
|
+
profile: JSON.parse(n)
|
|
3029
3036
|
} : void 0,
|
|
3030
3037
|
placeholderData: { authenticationStatus: "Pending" },
|
|
3031
3038
|
refetchOnWindowFocus: !1
|
|
3032
3039
|
});
|
|
3033
3040
|
}, Hi = () => {
|
|
3034
|
-
const { t: e } =
|
|
3041
|
+
const { t: e } = pe(), { position: t, bouMenuItems: s } = Rs(), { country: r } = _e(), n = ss({ country: r }), { logoutUrl: l } = it(), c = Pt().getQueryData(Fs), h = (c == null ? void 0 : c.profile.firstName) ?? "", m = (c == null ? void 0 : c.profile.lastName) ?? "", d = () => {
|
|
3035
3042
|
sessionStorage.removeItem("profile"), window.location.href = l;
|
|
3036
3043
|
};
|
|
3037
3044
|
return /* @__PURE__ */ i.jsxs(W, { type: "nav", id: "xtra-menu", position: t, children: [
|
|
3038
3045
|
/* @__PURE__ */ i.jsx(
|
|
3039
3046
|
W.Trigger,
|
|
3040
3047
|
{
|
|
3041
|
-
className:
|
|
3048
|
+
className: L(
|
|
3042
3049
|
"button",
|
|
3043
3050
|
"button--neutral",
|
|
3044
3051
|
"button--authentication",
|
|
3045
3052
|
"button--authentication--authenticated"
|
|
3046
3053
|
),
|
|
3047
3054
|
children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3048
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Or, { variant: "small", firstName:
|
|
3049
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__label", children:
|
|
3050
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3055
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Or, { variant: "small", firstName: h, lastName: m }) }),
|
|
3056
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: h }),
|
|
3057
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(kt, {}) })
|
|
3051
3058
|
] })
|
|
3052
3059
|
}
|
|
3053
3060
|
),
|
|
3054
3061
|
/* @__PURE__ */ i.jsxs(W.Content, { as: "div", children: [
|
|
3055
3062
|
!!s && s.length > 0 && /* @__PURE__ */ i.jsx("ul", { className: "bou-menu__list", children: s.map(({ label: u, icon: v, url: g }, S) => /* @__PURE__ */ i.jsx(
|
|
3056
|
-
|
|
3063
|
+
Se,
|
|
3057
3064
|
{
|
|
3058
3065
|
className: "bou-menu-item",
|
|
3059
3066
|
mobileUrl: g,
|
|
@@ -3064,58 +3071,58 @@ const Li = "/icons/bouMenuIcons.svg", Fi = ({
|
|
|
3064
3071
|
)) }),
|
|
3065
3072
|
/* @__PURE__ */ i.jsxs("ul", { children: [
|
|
3066
3073
|
/* @__PURE__ */ i.jsx(
|
|
3067
|
-
|
|
3074
|
+
Se,
|
|
3068
3075
|
{
|
|
3069
3076
|
className: "manage-profile",
|
|
3070
3077
|
mobileUrl: `${n}/manage-profile`,
|
|
3071
3078
|
desktopUrl: `${n}/manage-profile/personal-data`,
|
|
3072
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3079
|
+
icon: /* @__PURE__ */ i.jsx(Jr, {}),
|
|
3073
3080
|
label: e("manageProfile")
|
|
3074
3081
|
}
|
|
3075
3082
|
),
|
|
3076
3083
|
r === "BE" && /* @__PURE__ */ i.jsx(
|
|
3077
|
-
|
|
3084
|
+
Se,
|
|
3078
3085
|
{
|
|
3079
3086
|
className: "payment",
|
|
3080
3087
|
mobileUrl: `${n}/payment`,
|
|
3081
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3088
|
+
icon: /* @__PURE__ */ i.jsx(oi, {}),
|
|
3082
3089
|
label: e("payment")
|
|
3083
3090
|
}
|
|
3084
3091
|
),
|
|
3085
3092
|
/* @__PURE__ */ i.jsx(
|
|
3086
|
-
|
|
3093
|
+
Se,
|
|
3087
3094
|
{
|
|
3088
3095
|
className: "gift-cards",
|
|
3089
3096
|
mobileUrl: `${n}/gift-cards`,
|
|
3090
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3097
|
+
icon: /* @__PURE__ */ i.jsx(ni, {}),
|
|
3091
3098
|
label: e("giftCards")
|
|
3092
3099
|
}
|
|
3093
3100
|
),
|
|
3094
3101
|
/* @__PURE__ */ i.jsx(
|
|
3095
|
-
|
|
3102
|
+
Se,
|
|
3096
3103
|
{
|
|
3097
3104
|
mobileUrl: `${n}/identifiers`,
|
|
3098
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3105
|
+
icon: /* @__PURE__ */ i.jsx(ci, {}),
|
|
3099
3106
|
label: e("qrCode")
|
|
3100
3107
|
}
|
|
3101
3108
|
),
|
|
3102
3109
|
/* @__PURE__ */ i.jsx(
|
|
3103
|
-
|
|
3110
|
+
Se,
|
|
3104
3111
|
{
|
|
3105
3112
|
className: "manage-privacy",
|
|
3106
3113
|
mobileUrl: `${n}/manage-privacy`,
|
|
3107
3114
|
desktopUrl: `${n}/manage-privacy/permissions`,
|
|
3108
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3115
|
+
icon: /* @__PURE__ */ i.jsx(zr, {}),
|
|
3109
3116
|
label: e("privacy")
|
|
3110
3117
|
}
|
|
3111
3118
|
),
|
|
3112
|
-
/* @__PURE__ */ i.jsx(Di, { onClick:
|
|
3119
|
+
/* @__PURE__ */ i.jsx(Di, { onClick: d, icon: /* @__PURE__ */ i.jsx($r, {}), label: e("logout") })
|
|
3113
3120
|
] })
|
|
3114
3121
|
] })
|
|
3115
3122
|
] });
|
|
3116
3123
|
}, Ki = () => {
|
|
3117
|
-
const { t: e } =
|
|
3118
|
-
return /* @__PURE__ */ i.jsxs("button", { className:
|
|
3124
|
+
const { t: e } = pe();
|
|
3125
|
+
return /* @__PURE__ */ i.jsxs("button", { className: L("button", "button--neutral", "button--authentication"), children: [
|
|
3119
3126
|
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx("i", { className: "spinner" }) }),
|
|
3120
3127
|
/* @__PURE__ */ i.jsxs("span", { className: "button__label", children: [
|
|
3121
3128
|
e("loading"),
|
|
@@ -3124,7 +3131,7 @@ const Li = "/icons/bouMenuIcons.svg", Fi = ({
|
|
|
3124
3131
|
] });
|
|
3125
3132
|
};
|
|
3126
3133
|
/*! js-cookie v3.0.5 | MIT */
|
|
3127
|
-
function
|
|
3134
|
+
function Ie(e) {
|
|
3128
3135
|
for (var t = 1; t < arguments.length; t++) {
|
|
3129
3136
|
var s = arguments[t];
|
|
3130
3137
|
for (var r in s)
|
|
@@ -3143,23 +3150,23 @@ var Gi = {
|
|
|
3143
3150
|
);
|
|
3144
3151
|
}
|
|
3145
3152
|
};
|
|
3146
|
-
function
|
|
3153
|
+
function wt(e, t) {
|
|
3147
3154
|
function s(n, l, o) {
|
|
3148
3155
|
if (!(typeof document > "u")) {
|
|
3149
|
-
o =
|
|
3156
|
+
o = Ie({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3150
3157
|
var c = "";
|
|
3151
|
-
for (var
|
|
3152
|
-
o[
|
|
3158
|
+
for (var h in o)
|
|
3159
|
+
o[h] && (c += "; " + h, o[h] !== !0 && (c += "=" + o[h].split(";")[0]));
|
|
3153
3160
|
return document.cookie = n + "=" + e.write(l, n) + c;
|
|
3154
3161
|
}
|
|
3155
3162
|
}
|
|
3156
3163
|
function r(n) {
|
|
3157
3164
|
if (!(typeof document > "u" || arguments.length && !n)) {
|
|
3158
3165
|
for (var l = document.cookie ? document.cookie.split("; ") : [], o = {}, c = 0; c < l.length; c++) {
|
|
3159
|
-
var
|
|
3166
|
+
var h = l[c].split("="), m = h.slice(1).join("=");
|
|
3160
3167
|
try {
|
|
3161
|
-
var
|
|
3162
|
-
if (o[
|
|
3168
|
+
var d = decodeURIComponent(h[0]);
|
|
3169
|
+
if (o[d] = e.read(m, d), n === d)
|
|
3163
3170
|
break;
|
|
3164
3171
|
} catch {
|
|
3165
3172
|
}
|
|
@@ -3175,16 +3182,16 @@ function bt(e, t) {
|
|
|
3175
3182
|
s(
|
|
3176
3183
|
n,
|
|
3177
3184
|
"",
|
|
3178
|
-
|
|
3185
|
+
Ie({}, l, {
|
|
3179
3186
|
expires: -1
|
|
3180
3187
|
})
|
|
3181
3188
|
);
|
|
3182
3189
|
},
|
|
3183
3190
|
withAttributes: function(n) {
|
|
3184
|
-
return
|
|
3191
|
+
return wt(this.converter, Ie({}, this.attributes, n));
|
|
3185
3192
|
},
|
|
3186
3193
|
withConverter: function(n) {
|
|
3187
|
-
return
|
|
3194
|
+
return wt(Ie({}, this.converter, n), this.attributes);
|
|
3188
3195
|
}
|
|
3189
3196
|
},
|
|
3190
3197
|
{
|
|
@@ -3193,18 +3200,18 @@ function bt(e, t) {
|
|
|
3193
3200
|
}
|
|
3194
3201
|
);
|
|
3195
3202
|
}
|
|
3196
|
-
var
|
|
3203
|
+
var Vt = wt(Gi, { path: "/" });
|
|
3197
3204
|
const qi = ({ className: e }) => {
|
|
3198
|
-
const { t } =
|
|
3205
|
+
const { t } = pe(), { loginUrl: s } = it(), r = f.useRef(null);
|
|
3199
3206
|
return f.useEffect(() => {
|
|
3200
|
-
const n =
|
|
3201
|
-
r != null && r.current && l && (
|
|
3207
|
+
const n = Vt.get("shouldLogin"), l = !!n && !!atob(n);
|
|
3208
|
+
r != null && r.current && l && (Vt.remove("shouldLogin"), r.current.click());
|
|
3202
3209
|
}, [r]), /* @__PURE__ */ i.jsxs(
|
|
3203
3210
|
"a",
|
|
3204
3211
|
{
|
|
3205
3212
|
ref: r,
|
|
3206
3213
|
href: s,
|
|
3207
|
-
className:
|
|
3214
|
+
className: L(
|
|
3208
3215
|
"button",
|
|
3209
3216
|
"button--neutral",
|
|
3210
3217
|
"button--authentication",
|
|
@@ -3212,14 +3219,14 @@ const qi = ({ className: e }) => {
|
|
|
3212
3219
|
e
|
|
3213
3220
|
),
|
|
3214
3221
|
children: [
|
|
3215
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3222
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(ws, { width: 24, height: 24, suffix: "desktop" }) }),
|
|
3216
3223
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: t("login") }),
|
|
3217
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3224
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(kt, {}) })
|
|
3218
3225
|
]
|
|
3219
3226
|
}
|
|
3220
3227
|
);
|
|
3221
3228
|
}, Wi = () => {
|
|
3222
|
-
const { t: e } =
|
|
3229
|
+
const { t: e } = pe(), { loginUrl: t } = it(), s = ss(), { position: r } = Rs();
|
|
3223
3230
|
return /* @__PURE__ */ i.jsxs(
|
|
3224
3231
|
W,
|
|
3225
3232
|
{
|
|
@@ -3229,17 +3236,17 @@ const qi = ({ className: e }) => {
|
|
|
3229
3236
|
className: "menu--unauthenticated",
|
|
3230
3237
|
"aria-label": e("xtraMenuAriaLabel"),
|
|
3231
3238
|
children: [
|
|
3232
|
-
/* @__PURE__ */ i.jsx(W.Trigger, { className:
|
|
3233
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3234
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3239
|
+
/* @__PURE__ */ i.jsx(W.Trigger, { className: L("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3240
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(ws, { width: 24, height: 24, suffix: "mobile" }) }),
|
|
3241
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(kt, {}) })
|
|
3235
3242
|
] }) }),
|
|
3236
3243
|
/* @__PURE__ */ i.jsxs(W.Content, { children: [
|
|
3237
3244
|
/* @__PURE__ */ i.jsx(W.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: t, className: "button button--with-icon", children: [
|
|
3238
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3245
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Wr, {}) }),
|
|
3239
3246
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("login") })
|
|
3240
3247
|
] }) }),
|
|
3241
3248
|
/* @__PURE__ */ i.jsx(W.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: `${s}/onboarding/register`, className: "button button--with-icon", children: [
|
|
3242
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3249
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Ir, {}) }),
|
|
3243
3250
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("register") })
|
|
3244
3251
|
] }) })
|
|
3245
3252
|
] })
|
|
@@ -3248,61 +3255,65 @@ const qi = ({ className: e }) => {
|
|
|
3248
3255
|
);
|
|
3249
3256
|
}, Vi = () => {
|
|
3250
3257
|
var t, s;
|
|
3251
|
-
const e =
|
|
3258
|
+
const e = Ds();
|
|
3252
3259
|
return ((t = e.data) == null ? void 0 : t.authenticationStatus) === "Authenticated" ? /* @__PURE__ */ i.jsx(Hi, {}) : ((s = e.data) == null ? void 0 : s.authenticationStatus) === "NotAuthenticated" || e.isError ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
3253
3260
|
/* @__PURE__ */ i.jsx(qi, {}),
|
|
3254
3261
|
/* @__PURE__ */ i.jsx(Wi, {})
|
|
3255
3262
|
] }) : /* @__PURE__ */ i.jsx(Ki, {});
|
|
3256
|
-
},
|
|
3257
|
-
const { apiUrl: e } =
|
|
3263
|
+
}, Ts = () => {
|
|
3264
|
+
const { apiUrl: e } = _e();
|
|
3258
3265
|
return `${`${e}/xtra`}/authentication/v1/gdpr`;
|
|
3259
3266
|
}, $i = () => {
|
|
3260
|
-
const e =
|
|
3261
|
-
return
|
|
3262
|
-
mutationFn: async (
|
|
3263
|
-
const
|
|
3264
|
-
body: JSON.stringify({ acceptedTC:
|
|
3267
|
+
const { i18n: e } = pe(), t = Ts(), { country: s, bouHeaders: r } = _e(), n = new fs();
|
|
3268
|
+
return jr({
|
|
3269
|
+
mutationFn: async (o) => {
|
|
3270
|
+
const c = jt(e.language, s), h = await fetch(`${t}/tc`, {
|
|
3271
|
+
body: JSON.stringify({ acceptedTC: o }),
|
|
3265
3272
|
credentials: "include",
|
|
3266
|
-
headers: {
|
|
3273
|
+
headers: {
|
|
3274
|
+
"Content-Type": "application/json",
|
|
3275
|
+
"Accept-Language": c,
|
|
3276
|
+
...r
|
|
3277
|
+
},
|
|
3267
3278
|
method: "POST",
|
|
3268
3279
|
mode: "cors"
|
|
3269
3280
|
});
|
|
3270
|
-
if (!
|
|
3281
|
+
if (!h.ok)
|
|
3271
3282
|
throw new Error("Network response was not ok");
|
|
3272
|
-
return
|
|
3283
|
+
return h;
|
|
3273
3284
|
},
|
|
3274
3285
|
onSuccess: async () => {
|
|
3275
|
-
await
|
|
3286
|
+
await n.invalidateQueries({ queryKey: ["gdpr"] });
|
|
3276
3287
|
}
|
|
3277
3288
|
});
|
|
3278
3289
|
}, Zi = () => {
|
|
3279
|
-
var
|
|
3280
|
-
const { i18n: e } =
|
|
3281
|
-
return
|
|
3290
|
+
var c;
|
|
3291
|
+
const { i18n: e } = pe(), t = Ts(), { country: s, bouHeaders: r } = _e(), l = ((c = Ds().data) == null ? void 0 : c.authenticationStatus) === "Authenticated";
|
|
3292
|
+
return ys({
|
|
3282
3293
|
queryKey: ["gdpr"],
|
|
3283
3294
|
queryFn: async () => {
|
|
3284
|
-
const
|
|
3295
|
+
const h = jt(e.language, s), m = await fetch(`${t}/tc/check`, {
|
|
3285
3296
|
credentials: "include",
|
|
3286
3297
|
mode: "cors",
|
|
3287
|
-
headers: { "Accept-Language":
|
|
3298
|
+
headers: { "Accept-Language": h, ...r }
|
|
3288
3299
|
});
|
|
3289
|
-
if (!
|
|
3300
|
+
if (!m.ok)
|
|
3290
3301
|
throw new Error("Network response was not ok");
|
|
3291
|
-
return
|
|
3302
|
+
return m.status === 204 ? [] : await m.json();
|
|
3292
3303
|
},
|
|
3293
|
-
enabled:
|
|
3304
|
+
enabled: l
|
|
3294
3305
|
});
|
|
3295
3306
|
}, zi = () => {
|
|
3296
3307
|
var P;
|
|
3297
|
-
const { t: e } =
|
|
3298
|
-
|
|
3308
|
+
const { t: e } = pe(), { logoutUrl: t } = it(), [s, r] = f.useState(0), [n, l] = f.useState({}), { AccessibleFormMessage: o, formRef: c } = Gs({ submitCount: s, errors: n }), { mutate: h, isError: m } = $i(), d = Zi(), [u, v] = f.useState(!1);
|
|
3309
|
+
qs({ element: "xtra-authentication" });
|
|
3299
3310
|
const g = e("termsAndConditions.error.required"), S = () => {
|
|
3300
3311
|
v(!1), document.body.style.removeProperty("overflow");
|
|
3301
3312
|
};
|
|
3302
3313
|
f.useEffect(() => {
|
|
3303
3314
|
var C;
|
|
3304
|
-
(C =
|
|
3305
|
-
}, [(P =
|
|
3315
|
+
(C = d.data) != null && C.length && !window.showTnCPopup && (v(!0), window.showTnCPopup = !0);
|
|
3316
|
+
}, [(P = d.data) == null ? void 0 : P.length]), f.useEffect(() => {
|
|
3306
3317
|
u && document.body.style.setProperty("overflow", "hidden");
|
|
3307
3318
|
}, [u]), f.useEffect(() => {
|
|
3308
3319
|
m && l({ acceptedTC: g });
|
|
@@ -3312,27 +3323,27 @@ const qi = ({ className: e }) => {
|
|
|
3312
3323
|
const { acceptedTC: j } = C.target;
|
|
3313
3324
|
if (j instanceof RadioNodeList) {
|
|
3314
3325
|
const b = Object.values(j);
|
|
3315
|
-
b.every((F) => F.checked) ? (l({}),
|
|
3326
|
+
b.every((F) => F.checked) ? (l({}), h(b.map((F) => F.value)), S()) : l({ acceptedTC: g });
|
|
3316
3327
|
} else
|
|
3317
|
-
j != null && j.checked ? (l({}),
|
|
3328
|
+
j != null && j.checked ? (l({}), h([j.value]), S()) : l({ acceptedTC: g });
|
|
3318
3329
|
};
|
|
3319
3330
|
return u ? /* @__PURE__ */ i.jsxs(G, { defaultOpen: u, isModal: !0, children: [
|
|
3320
3331
|
o,
|
|
3321
3332
|
/* @__PURE__ */ i.jsxs(G.Root, { children: [
|
|
3322
3333
|
/* @__PURE__ */ i.jsx(G.Header, { children: /* @__PURE__ */ i.jsx(G.Title, { icon: /* @__PURE__ */ i.jsx("i", { className: "commerce__icon" }), children: /* @__PURE__ */ i.jsx(Ii, { children: e("termsAndConditions.title") }) }) }),
|
|
3323
|
-
/* @__PURE__ */ i.jsx(G.Body, { children: /* @__PURE__ */ i.jsxs(
|
|
3334
|
+
/* @__PURE__ */ i.jsx(G.Body, { children: /* @__PURE__ */ i.jsxs(Us, { ref: c, id: "tc-form", onSubmit: _, children: [
|
|
3324
3335
|
/* @__PURE__ */ i.jsxs(Ji, { children: [
|
|
3325
3336
|
e("termsAndConditions.description"),
|
|
3326
3337
|
n.acceptedTC && /* @__PURE__ */ i.jsx(Bi, { children: g })
|
|
3327
3338
|
] }),
|
|
3328
|
-
|
|
3329
|
-
|
|
3339
|
+
d.data.map(({ tcCode: C, title: j, URL: b }) => /* @__PURE__ */ i.jsx(
|
|
3340
|
+
je,
|
|
3330
3341
|
{
|
|
3331
3342
|
id: C,
|
|
3332
3343
|
value: C,
|
|
3333
3344
|
name: "acceptedTC",
|
|
3334
3345
|
variant: "primary",
|
|
3335
|
-
children: /* @__PURE__ */ i.jsxs(
|
|
3346
|
+
children: /* @__PURE__ */ i.jsxs(je.Content, { children: [
|
|
3336
3347
|
/* @__PURE__ */ i.jsx(Yi, { children: j }),
|
|
3337
3348
|
/* @__PURE__ */ i.jsx(Xi, { href: b, children: e("termsAndConditions.action", { title: j }) })
|
|
3338
3349
|
] })
|
|
@@ -3344,20 +3355,20 @@ const qi = ({ className: e }) => {
|
|
|
3344
3355
|
/* @__PURE__ */ i.jsx(
|
|
3345
3356
|
"a",
|
|
3346
3357
|
{
|
|
3347
|
-
className:
|
|
3358
|
+
className: L("button", "button--secondary", "button--terms-and-conditions"),
|
|
3348
3359
|
href: t,
|
|
3349
3360
|
children: e("logout")
|
|
3350
3361
|
}
|
|
3351
3362
|
),
|
|
3352
|
-
/* @__PURE__ */ i.jsx(
|
|
3363
|
+
/* @__PURE__ */ i.jsx(ze, { form: "tc-form", type: "submit", variant: "primary", children: e("confirm") })
|
|
3353
3364
|
] })
|
|
3354
3365
|
] })
|
|
3355
3366
|
] }) : null;
|
|
3356
3367
|
}, Yi = ({
|
|
3357
3368
|
children: e,
|
|
3358
3369
|
...t
|
|
3359
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
3360
|
-
|
|
3370
|
+
}) => /* @__PURE__ */ i.jsx(je.Label, { className: "form--tc__label", ...t, children: e }), Us = f.forwardRef(({ children: e, ...t }, s) => /* @__PURE__ */ i.jsx("form", { className: "form--tc", ref: s, ...t, children: e }));
|
|
3371
|
+
Us.displayName = "TermsAndConditionsForm";
|
|
3361
3372
|
const Ji = ({
|
|
3362
3373
|
children: e,
|
|
3363
3374
|
...t
|
|
@@ -3372,7 +3383,7 @@ const Ji = ({
|
|
|
3372
3383
|
...t,
|
|
3373
3384
|
children: e
|
|
3374
3385
|
}
|
|
3375
|
-
), Ii = ({ children: e }) => /* @__PURE__ */ i.jsx("h1", { className: "form--tc__title", children: e }), Bi = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx("span", { className: "form--tc__error", role: "alert", ...t, children: e }), en = new
|
|
3386
|
+
), Ii = ({ children: e }) => /* @__PURE__ */ i.jsx("h1", { className: "form--tc__title", children: e }), Bi = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx("span", { className: "form--tc__error", role: "alert", ...t, children: e }), en = new fs(), rn = ({
|
|
3376
3387
|
environment: e,
|
|
3377
3388
|
redirectUrl: t,
|
|
3378
3389
|
apiUrl: s,
|
|
@@ -3380,19 +3391,22 @@ const Ji = ({
|
|
|
3380
3391
|
position: n,
|
|
3381
3392
|
commerceId: l,
|
|
3382
3393
|
bouMenuItems: o,
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3394
|
+
bouHeaders: c,
|
|
3395
|
+
country: h
|
|
3396
|
+
}) => /* @__PURE__ */ i.jsx(Ws, { environment: e, children: /* @__PURE__ */ i.jsx(Vs, { commerceId: l, children: /* @__PURE__ */ i.jsx(
|
|
3397
|
+
Ti,
|
|
3398
|
+
{
|
|
3399
|
+
apiUrl: s,
|
|
3400
|
+
authUrl: r,
|
|
3401
|
+
country: h,
|
|
3402
|
+
redirectUrl: t,
|
|
3403
|
+
bouHeaders: c,
|
|
3404
|
+
children: /* @__PURE__ */ i.jsxs(ur, { client: en, children: [
|
|
3405
|
+
/* @__PURE__ */ i.jsx(Ui, { position: n, bouMenuItems: o, children: /* @__PURE__ */ i.jsx(Vi, {}) }),
|
|
3406
|
+
/* @__PURE__ */ i.jsx(zi, {})
|
|
3407
|
+
] })
|
|
3408
|
+
}
|
|
3409
|
+
) }) });
|
|
3396
3410
|
export {
|
|
3397
3411
|
rn as default
|
|
3398
3412
|
};
|