@shiftengineering/folio 0.1.8 → 0.1.10
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.
|
@@ -2,17 +2,17 @@ var Jr = (t) => {
|
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
4
|
var Yt = (t, e, r) => e.has(t) || Jr("Cannot " + r);
|
|
5
|
-
var o = (t, e, r) => (Yt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), w = (t, e, r) => e.has(t) ? Jr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r),
|
|
6
|
-
var
|
|
5
|
+
var o = (t, e, r) => (Yt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), w = (t, e, r) => e.has(t) ? Jr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), b = (t, e, r, n) => (Yt(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), P = (t, e, r) => (Yt(t, e, "access private method"), r);
|
|
6
|
+
var kt = (t, e, r, n) => ({
|
|
7
7
|
set _(s) {
|
|
8
|
-
|
|
8
|
+
b(t, e, s, r);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
11
|
return o(t, e, n);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
14
|
+
import * as z from "react";
|
|
15
|
+
import Un, { createContext as zs, useState as Ws, useMemo as Hs, useEffect as Bs, useContext as Gs } from "react";
|
|
16
16
|
var rr = { exports: {} }, ht = {};
|
|
17
17
|
/**
|
|
18
18
|
* @license React
|
|
@@ -24,16 +24,16 @@ var rr = { exports: {} }, ht = {};
|
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
25
|
*/
|
|
26
26
|
var Xr;
|
|
27
|
-
function
|
|
27
|
+
function Ys() {
|
|
28
28
|
if (Xr) return ht;
|
|
29
29
|
Xr = 1;
|
|
30
|
-
var t =
|
|
30
|
+
var t = Un, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
31
31
|
function u(l, c, d) {
|
|
32
|
-
var
|
|
33
|
-
d !== void 0 && (
|
|
34
|
-
for (
|
|
35
|
-
if (l && l.defaultProps) for (
|
|
36
|
-
return { $$typeof: e, type: l, key:
|
|
32
|
+
var f, h = {}, y = null, m = null;
|
|
33
|
+
d !== void 0 && (y = "" + d), c.key !== void 0 && (y = "" + c.key), c.ref !== void 0 && (m = c.ref);
|
|
34
|
+
for (f in c) n.call(c, f) && !a.hasOwnProperty(f) && (h[f] = c[f]);
|
|
35
|
+
if (l && l.defaultProps) for (f in c = l.defaultProps, c) h[f] === void 0 && (h[f] = c[f]);
|
|
36
|
+
return { $$typeof: e, type: l, key: y, ref: m, props: h, _owner: s.current };
|
|
37
37
|
}
|
|
38
38
|
return ht.Fragment = r, ht.jsx = u, ht.jsxs = u, ht;
|
|
39
39
|
}
|
|
@@ -48,48 +48,48 @@ var dt = {};
|
|
|
48
48
|
* LICENSE file in the root directory of this source tree.
|
|
49
49
|
*/
|
|
50
50
|
var Zr;
|
|
51
|
-
function
|
|
51
|
+
function Js() {
|
|
52
52
|
return Zr || (Zr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
53
|
-
var t =
|
|
54
|
-
function
|
|
53
|
+
var t = Un, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), R = Symbol.iterator, g = "@@iterator";
|
|
54
|
+
function E(i) {
|
|
55
55
|
if (i === null || typeof i != "object")
|
|
56
56
|
return null;
|
|
57
|
-
var
|
|
58
|
-
return typeof
|
|
57
|
+
var p = R && i[R] || i[g];
|
|
58
|
+
return typeof p == "function" ? p : null;
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
60
|
+
var T = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
61
|
+
function S(i) {
|
|
62
62
|
{
|
|
63
|
-
for (var
|
|
64
|
-
|
|
65
|
-
j("error", i,
|
|
63
|
+
for (var p = arguments.length, v = new Array(p > 1 ? p - 1 : 0), O = 1; O < p; O++)
|
|
64
|
+
v[O - 1] = arguments[O];
|
|
65
|
+
j("error", i, v);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function j(i,
|
|
68
|
+
function j(i, p, v) {
|
|
69
69
|
{
|
|
70
|
-
var
|
|
71
|
-
D !== "" && (
|
|
72
|
-
var
|
|
73
|
-
return String(
|
|
70
|
+
var O = T.ReactDebugCurrentFrame, D = O.getStackAddendum();
|
|
71
|
+
D !== "" && (p += "%s", v = v.concat([D]));
|
|
72
|
+
var q = v.map(function(A) {
|
|
73
|
+
return String(A);
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
q.unshift("Warning: " + p), Function.prototype.apply.call(console[i], console, q);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
function
|
|
81
|
-
return !!(typeof i == "string" || typeof i == "function" || i === n || i === a ||
|
|
78
|
+
var L = !1, M = !1, K = !1, U = !1, _ = !1, I;
|
|
79
|
+
I = Symbol.for("react.module.reference");
|
|
80
|
+
function ie(i) {
|
|
81
|
+
return !!(typeof i == "string" || typeof i == "function" || i === n || i === a || _ || i === s || i === d || i === f || U || i === m || L || M || K || typeof i == "object" && i !== null && (i.$$typeof === y || i.$$typeof === h || i.$$typeof === u || i.$$typeof === l || i.$$typeof === c || // This needs to include all possible module reference object
|
|
82
82
|
// types supported by any Flight configuration anywhere since
|
|
83
83
|
// we don't know which Flight build this will end up being used
|
|
84
84
|
// with.
|
|
85
|
-
i.$$typeof ===
|
|
85
|
+
i.$$typeof === I || i.getModuleId !== void 0));
|
|
86
86
|
}
|
|
87
|
-
function pe(i,
|
|
88
|
-
var
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
91
|
-
var D =
|
|
92
|
-
return D !== "" ?
|
|
87
|
+
function pe(i, p, v) {
|
|
88
|
+
var O = i.displayName;
|
|
89
|
+
if (O)
|
|
90
|
+
return O;
|
|
91
|
+
var D = p.displayName || p.name || "";
|
|
92
|
+
return D !== "" ? v + "(" + D + ")" : v;
|
|
93
93
|
}
|
|
94
94
|
function Fe(i) {
|
|
95
95
|
return i.displayName || "Context";
|
|
@@ -97,7 +97,7 @@ function Gs() {
|
|
|
97
97
|
function me(i) {
|
|
98
98
|
if (i == null)
|
|
99
99
|
return null;
|
|
100
|
-
if (typeof i.tag == "number" &&
|
|
100
|
+
if (typeof i.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
101
101
|
return i.displayName || i.name || null;
|
|
102
102
|
if (typeof i == "string")
|
|
103
103
|
return i;
|
|
@@ -112,26 +112,26 @@ function Gs() {
|
|
|
112
112
|
return "StrictMode";
|
|
113
113
|
case d:
|
|
114
114
|
return "Suspense";
|
|
115
|
-
case
|
|
115
|
+
case f:
|
|
116
116
|
return "SuspenseList";
|
|
117
117
|
}
|
|
118
118
|
if (typeof i == "object")
|
|
119
119
|
switch (i.$$typeof) {
|
|
120
120
|
case l:
|
|
121
|
-
var
|
|
122
|
-
return Fe(
|
|
121
|
+
var p = i;
|
|
122
|
+
return Fe(p) + ".Consumer";
|
|
123
123
|
case u:
|
|
124
|
-
var
|
|
125
|
-
return Fe(
|
|
124
|
+
var v = i;
|
|
125
|
+
return Fe(v._context) + ".Provider";
|
|
126
126
|
case c:
|
|
127
127
|
return pe(i, i.render, "ForwardRef");
|
|
128
|
-
case
|
|
129
|
-
var
|
|
130
|
-
return
|
|
131
|
-
case
|
|
132
|
-
var D = i,
|
|
128
|
+
case h:
|
|
129
|
+
var O = i.displayName || null;
|
|
130
|
+
return O !== null ? O : me(i.type) || "Memo";
|
|
131
|
+
case y: {
|
|
132
|
+
var D = i, q = D._payload, A = D._init;
|
|
133
133
|
try {
|
|
134
|
-
return me(
|
|
134
|
+
return me(A(q));
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
@@ -139,14 +139,14 @@ function Gs() {
|
|
|
139
139
|
}
|
|
140
140
|
return null;
|
|
141
141
|
}
|
|
142
|
-
var Ae = Object.assign, lt = 0, xr, Fr, Ar, Dr, _r, Ir
|
|
142
|
+
var Ae = Object.assign, lt = 0, xr, Fr, Ar, Dr, kr, _r, Ir;
|
|
143
143
|
function jr() {
|
|
144
144
|
}
|
|
145
145
|
jr.__reactDisabledLog = !0;
|
|
146
|
-
function
|
|
146
|
+
function bs() {
|
|
147
147
|
{
|
|
148
148
|
if (lt === 0) {
|
|
149
|
-
xr = console.log, Fr = console.info, Ar = console.warn, Dr = console.error,
|
|
149
|
+
xr = console.log, Fr = console.info, Ar = console.warn, Dr = console.error, kr = console.group, _r = console.groupCollapsed, Ir = console.groupEnd;
|
|
150
150
|
var i = {
|
|
151
151
|
configurable: !0,
|
|
152
152
|
enumerable: !0,
|
|
@@ -166,7 +166,7 @@ function Gs() {
|
|
|
166
166
|
lt++;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function vs() {
|
|
170
170
|
{
|
|
171
171
|
if (lt--, lt === 0) {
|
|
172
172
|
var i = {
|
|
@@ -188,28 +188,28 @@ function Gs() {
|
|
|
188
188
|
value: Dr
|
|
189
189
|
}),
|
|
190
190
|
group: Ae({}, i, {
|
|
191
|
-
value:
|
|
191
|
+
value: kr
|
|
192
192
|
}),
|
|
193
193
|
groupCollapsed: Ae({}, i, {
|
|
194
|
-
value:
|
|
194
|
+
value: _r
|
|
195
195
|
}),
|
|
196
196
|
groupEnd: Ae({}, i, {
|
|
197
|
-
value:
|
|
197
|
+
value: Ir
|
|
198
198
|
})
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
lt < 0 &&
|
|
201
|
+
lt < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var $t =
|
|
205
|
-
function xt(i,
|
|
204
|
+
var $t = T.ReactCurrentDispatcher, Kt;
|
|
205
|
+
function xt(i, p, v) {
|
|
206
206
|
{
|
|
207
207
|
if (Kt === void 0)
|
|
208
208
|
try {
|
|
209
209
|
throw Error();
|
|
210
210
|
} catch (D) {
|
|
211
|
-
var
|
|
212
|
-
Kt =
|
|
211
|
+
var O = D.stack.trim().match(/\n( *(at )?)/);
|
|
212
|
+
Kt = O && O[1] || "";
|
|
213
213
|
}
|
|
214
214
|
return `
|
|
215
215
|
` + Kt + i;
|
|
@@ -217,154 +217,154 @@ function Gs() {
|
|
|
217
217
|
}
|
|
218
218
|
var Vt = !1, Ft;
|
|
219
219
|
{
|
|
220
|
-
var
|
|
221
|
-
Ft = new
|
|
220
|
+
var ws = typeof WeakMap == "function" ? WeakMap : Map;
|
|
221
|
+
Ft = new ws();
|
|
222
222
|
}
|
|
223
|
-
function qr(i,
|
|
223
|
+
function qr(i, p) {
|
|
224
224
|
if (!i || Vt)
|
|
225
225
|
return "";
|
|
226
226
|
{
|
|
227
|
-
var
|
|
228
|
-
if (
|
|
229
|
-
return
|
|
227
|
+
var v = Ft.get(i);
|
|
228
|
+
if (v !== void 0)
|
|
229
|
+
return v;
|
|
230
230
|
}
|
|
231
|
-
var
|
|
231
|
+
var O;
|
|
232
232
|
Vt = !0;
|
|
233
233
|
var D = Error.prepareStackTrace;
|
|
234
234
|
Error.prepareStackTrace = void 0;
|
|
235
|
-
var
|
|
236
|
-
|
|
235
|
+
var q;
|
|
236
|
+
q = $t.current, $t.current = null, bs();
|
|
237
237
|
try {
|
|
238
|
-
if (
|
|
239
|
-
var
|
|
238
|
+
if (p) {
|
|
239
|
+
var A = function() {
|
|
240
240
|
throw Error();
|
|
241
241
|
};
|
|
242
|
-
if (Object.defineProperty(
|
|
242
|
+
if (Object.defineProperty(A.prototype, "props", {
|
|
243
243
|
set: function() {
|
|
244
244
|
throw Error();
|
|
245
245
|
}
|
|
246
246
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
247
247
|
try {
|
|
248
|
-
Reflect.construct(
|
|
249
|
-
} catch (
|
|
250
|
-
|
|
248
|
+
Reflect.construct(A, []);
|
|
249
|
+
} catch (Y) {
|
|
250
|
+
O = Y;
|
|
251
251
|
}
|
|
252
|
-
Reflect.construct(i, [],
|
|
252
|
+
Reflect.construct(i, [], A);
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
|
-
|
|
256
|
-
} catch (
|
|
257
|
-
|
|
255
|
+
A.call();
|
|
256
|
+
} catch (Y) {
|
|
257
|
+
O = Y;
|
|
258
258
|
}
|
|
259
|
-
i.call(
|
|
259
|
+
i.call(A.prototype);
|
|
260
260
|
}
|
|
261
261
|
} else {
|
|
262
262
|
try {
|
|
263
263
|
throw Error();
|
|
264
|
-
} catch (
|
|
265
|
-
|
|
264
|
+
} catch (Y) {
|
|
265
|
+
O = Y;
|
|
266
266
|
}
|
|
267
267
|
i();
|
|
268
268
|
}
|
|
269
|
-
} catch (
|
|
270
|
-
if (
|
|
271
|
-
for (var
|
|
272
|
-
`), H =
|
|
273
|
-
`),
|
|
274
|
-
|
|
275
|
-
for (;
|
|
276
|
-
if (
|
|
277
|
-
if (
|
|
269
|
+
} catch (Y) {
|
|
270
|
+
if (Y && O && typeof Y.stack == "string") {
|
|
271
|
+
for (var C = Y.stack.split(`
|
|
272
|
+
`), H = O.stack.split(`
|
|
273
|
+
`), Q = C.length - 1, $ = H.length - 1; Q >= 1 && $ >= 0 && C[Q] !== H[$]; )
|
|
274
|
+
$--;
|
|
275
|
+
for (; Q >= 1 && $ >= 0; Q--, $--)
|
|
276
|
+
if (C[Q] !== H[$]) {
|
|
277
|
+
if (Q !== 1 || $ !== 1)
|
|
278
278
|
do
|
|
279
|
-
if (
|
|
279
|
+
if (Q--, $--, $ < 0 || C[Q] !== H[$]) {
|
|
280
280
|
var Z = `
|
|
281
|
-
` +
|
|
281
|
+
` + C[Q].replace(" at new ", " at ");
|
|
282
282
|
return i.displayName && Z.includes("<anonymous>") && (Z = Z.replace("<anonymous>", i.displayName)), typeof i == "function" && Ft.set(i, Z), Z;
|
|
283
283
|
}
|
|
284
|
-
while (
|
|
284
|
+
while (Q >= 1 && $ >= 0);
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
} finally {
|
|
289
|
-
Vt = !1, $t.current =
|
|
289
|
+
Vt = !1, $t.current = q, vs(), Error.prepareStackTrace = D;
|
|
290
290
|
}
|
|
291
291
|
var Ve = i ? i.displayName || i.name : "", De = Ve ? xt(Ve) : "";
|
|
292
292
|
return typeof i == "function" && Ft.set(i, De), De;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Es(i, p, v) {
|
|
295
295
|
return qr(i, !1);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
var
|
|
299
|
-
return !!(
|
|
297
|
+
function Rs(i) {
|
|
298
|
+
var p = i.prototype;
|
|
299
|
+
return !!(p && p.isReactComponent);
|
|
300
300
|
}
|
|
301
|
-
function At(i,
|
|
301
|
+
function At(i, p, v) {
|
|
302
302
|
if (i == null)
|
|
303
303
|
return "";
|
|
304
304
|
if (typeof i == "function")
|
|
305
|
-
return qr(i,
|
|
305
|
+
return qr(i, Rs(i));
|
|
306
306
|
if (typeof i == "string")
|
|
307
307
|
return xt(i);
|
|
308
308
|
switch (i) {
|
|
309
309
|
case d:
|
|
310
310
|
return xt("Suspense");
|
|
311
|
-
case
|
|
311
|
+
case f:
|
|
312
312
|
return xt("SuspenseList");
|
|
313
313
|
}
|
|
314
314
|
if (typeof i == "object")
|
|
315
315
|
switch (i.$$typeof) {
|
|
316
316
|
case c:
|
|
317
|
-
return
|
|
318
|
-
case
|
|
319
|
-
return At(i.type,
|
|
320
|
-
case
|
|
321
|
-
var
|
|
317
|
+
return Es(i.render);
|
|
318
|
+
case h:
|
|
319
|
+
return At(i.type, p, v);
|
|
320
|
+
case y: {
|
|
321
|
+
var O = i, D = O._payload, q = O._init;
|
|
322
322
|
try {
|
|
323
|
-
return At(
|
|
323
|
+
return At(q(D), p, v);
|
|
324
324
|
} catch {
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
return "";
|
|
329
329
|
}
|
|
330
|
-
var ft = Object.prototype.hasOwnProperty,
|
|
330
|
+
var ft = Object.prototype.hasOwnProperty, Mr = {}, Ur = T.ReactDebugCurrentFrame;
|
|
331
331
|
function Dt(i) {
|
|
332
332
|
if (i) {
|
|
333
|
-
var
|
|
334
|
-
|
|
333
|
+
var p = i._owner, v = At(i.type, i._source, p ? p.type : null);
|
|
334
|
+
Ur.setExtraStackFrame(v);
|
|
335
335
|
} else
|
|
336
|
-
|
|
336
|
+
Ur.setExtraStackFrame(null);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Os(i, p, v, O, D) {
|
|
339
339
|
{
|
|
340
|
-
var
|
|
341
|
-
for (var
|
|
342
|
-
if (
|
|
343
|
-
var
|
|
340
|
+
var q = Function.call.bind(ft);
|
|
341
|
+
for (var A in i)
|
|
342
|
+
if (q(i, A)) {
|
|
343
|
+
var C = void 0;
|
|
344
344
|
try {
|
|
345
|
-
if (typeof i[
|
|
346
|
-
var H = Error((
|
|
345
|
+
if (typeof i[A] != "function") {
|
|
346
|
+
var H = Error((O || "React class") + ": " + v + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
347
347
|
throw H.name = "Invariant Violation", H;
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
} catch (
|
|
351
|
-
|
|
349
|
+
C = i[A](p, A, O, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
350
|
+
} catch (Q) {
|
|
351
|
+
C = Q;
|
|
352
352
|
}
|
|
353
|
-
|
|
353
|
+
C && !(C instanceof Error) && (Dt(D), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", O || "React class", v, A, typeof C), Dt(null)), C instanceof Error && !(C.message in Mr) && (Mr[C.message] = !0, Dt(D), S("Failed %s type: %s", v, C.message), Dt(null));
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
var
|
|
357
|
+
var Ps = Array.isArray;
|
|
358
358
|
function zt(i) {
|
|
359
|
-
return
|
|
359
|
+
return Ps(i);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ss(i) {
|
|
362
362
|
{
|
|
363
|
-
var
|
|
364
|
-
return
|
|
363
|
+
var p = typeof Symbol == "function" && Symbol.toStringTag, v = p && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
364
|
+
return v;
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Cs(i) {
|
|
368
368
|
try {
|
|
369
369
|
return Nr(i), !1;
|
|
370
370
|
} catch {
|
|
@@ -375,120 +375,120 @@ function Gs() {
|
|
|
375
375
|
return "" + i;
|
|
376
376
|
}
|
|
377
377
|
function Lr(i) {
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
378
|
+
if (Cs(i))
|
|
379
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ss(i)), Nr(i);
|
|
380
380
|
}
|
|
381
|
-
var Qr =
|
|
381
|
+
var Qr = T.ReactCurrentOwner, Ts = {
|
|
382
382
|
key: !0,
|
|
383
383
|
ref: !0,
|
|
384
384
|
__self: !0,
|
|
385
385
|
__source: !0
|
|
386
386
|
}, $r, Kr;
|
|
387
|
-
function
|
|
387
|
+
function xs(i) {
|
|
388
388
|
if (ft.call(i, "ref")) {
|
|
389
|
-
var
|
|
390
|
-
if (
|
|
389
|
+
var p = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
390
|
+
if (p && p.isReactWarning)
|
|
391
391
|
return !1;
|
|
392
392
|
}
|
|
393
393
|
return i.ref !== void 0;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Fs(i) {
|
|
396
396
|
if (ft.call(i, "key")) {
|
|
397
|
-
var
|
|
398
|
-
if (
|
|
397
|
+
var p = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
398
|
+
if (p && p.isReactWarning)
|
|
399
399
|
return !1;
|
|
400
400
|
}
|
|
401
401
|
return i.key !== void 0;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function As(i, p) {
|
|
404
404
|
typeof i.ref == "string" && Qr.current;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Ds(i, p) {
|
|
407
407
|
{
|
|
408
|
-
var
|
|
409
|
-
$r || ($r = !0,
|
|
408
|
+
var v = function() {
|
|
409
|
+
$r || ($r = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
410
410
|
};
|
|
411
|
-
|
|
412
|
-
get:
|
|
411
|
+
v.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
412
|
+
get: v,
|
|
413
413
|
configurable: !0
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ks(i, p) {
|
|
418
418
|
{
|
|
419
|
-
var
|
|
420
|
-
Kr || (Kr = !0,
|
|
419
|
+
var v = function() {
|
|
420
|
+
Kr || (Kr = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
421
421
|
};
|
|
422
|
-
|
|
423
|
-
get:
|
|
422
|
+
v.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
423
|
+
get: v,
|
|
424
424
|
configurable: !0
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
var
|
|
429
|
-
var
|
|
428
|
+
var _s = function(i, p, v, O, D, q, A) {
|
|
429
|
+
var C = {
|
|
430
430
|
// This tag allows us to uniquely identify this as a React Element
|
|
431
431
|
$$typeof: e,
|
|
432
432
|
// Built-in properties that belong on the element
|
|
433
433
|
type: i,
|
|
434
|
-
key:
|
|
435
|
-
ref:
|
|
436
|
-
props:
|
|
434
|
+
key: p,
|
|
435
|
+
ref: v,
|
|
436
|
+
props: A,
|
|
437
437
|
// Record the component responsible for creating this element.
|
|
438
|
-
_owner:
|
|
438
|
+
_owner: q
|
|
439
439
|
};
|
|
440
|
-
return
|
|
440
|
+
return C._store = {}, Object.defineProperty(C._store, "validated", {
|
|
441
441
|
configurable: !1,
|
|
442
442
|
enumerable: !1,
|
|
443
443
|
writable: !0,
|
|
444
444
|
value: !1
|
|
445
|
-
}), Object.defineProperty(
|
|
445
|
+
}), Object.defineProperty(C, "_self", {
|
|
446
446
|
configurable: !1,
|
|
447
447
|
enumerable: !1,
|
|
448
448
|
writable: !1,
|
|
449
|
-
value:
|
|
450
|
-
}), Object.defineProperty(
|
|
449
|
+
value: O
|
|
450
|
+
}), Object.defineProperty(C, "_source", {
|
|
451
451
|
configurable: !1,
|
|
452
452
|
enumerable: !1,
|
|
453
453
|
writable: !1,
|
|
454
454
|
value: D
|
|
455
|
-
}), Object.freeze && (Object.freeze(
|
|
455
|
+
}), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
|
|
456
456
|
};
|
|
457
|
-
function
|
|
457
|
+
function Is(i, p, v, O, D) {
|
|
458
458
|
{
|
|
459
|
-
var
|
|
460
|
-
|
|
461
|
-
for (
|
|
462
|
-
ft.call(
|
|
459
|
+
var q, A = {}, C = null, H = null;
|
|
460
|
+
v !== void 0 && (Lr(v), C = "" + v), Fs(p) && (Lr(p.key), C = "" + p.key), xs(p) && (H = p.ref, As(p, D));
|
|
461
|
+
for (q in p)
|
|
462
|
+
ft.call(p, q) && !Ts.hasOwnProperty(q) && (A[q] = p[q]);
|
|
463
463
|
if (i && i.defaultProps) {
|
|
464
|
-
var
|
|
465
|
-
for (
|
|
466
|
-
|
|
464
|
+
var Q = i.defaultProps;
|
|
465
|
+
for (q in Q)
|
|
466
|
+
A[q] === void 0 && (A[q] = Q[q]);
|
|
467
467
|
}
|
|
468
|
-
if (
|
|
469
|
-
var
|
|
470
|
-
|
|
468
|
+
if (C || H) {
|
|
469
|
+
var $ = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
470
|
+
C && Ds(A, $), H && ks(A, $);
|
|
471
471
|
}
|
|
472
|
-
return
|
|
472
|
+
return _s(i, C, H, D, O, Qr.current, A);
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
var
|
|
475
|
+
var Wt = T.ReactCurrentOwner, Vr = T.ReactDebugCurrentFrame;
|
|
476
476
|
function Ke(i) {
|
|
477
477
|
if (i) {
|
|
478
|
-
var
|
|
479
|
-
Vr.setExtraStackFrame(
|
|
478
|
+
var p = i._owner, v = At(i.type, i._source, p ? p.type : null);
|
|
479
|
+
Vr.setExtraStackFrame(v);
|
|
480
480
|
} else
|
|
481
481
|
Vr.setExtraStackFrame(null);
|
|
482
482
|
}
|
|
483
|
-
var
|
|
484
|
-
|
|
483
|
+
var Ht;
|
|
484
|
+
Ht = !1;
|
|
485
485
|
function Bt(i) {
|
|
486
486
|
return typeof i == "object" && i !== null && i.$$typeof === e;
|
|
487
487
|
}
|
|
488
488
|
function zr() {
|
|
489
489
|
{
|
|
490
|
-
if (
|
|
491
|
-
var i = me(
|
|
490
|
+
if (Wt.current) {
|
|
491
|
+
var i = me(Wt.current.type);
|
|
492
492
|
if (i)
|
|
493
493
|
return `
|
|
494
494
|
|
|
@@ -497,161 +497,161 @@ Check the render method of \`` + i + "`.";
|
|
|
497
497
|
return "";
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function js(i) {
|
|
501
501
|
return "";
|
|
502
502
|
}
|
|
503
|
-
var
|
|
504
|
-
function
|
|
503
|
+
var Wr = {};
|
|
504
|
+
function qs(i) {
|
|
505
505
|
{
|
|
506
|
-
var
|
|
507
|
-
if (!
|
|
508
|
-
var
|
|
509
|
-
|
|
506
|
+
var p = zr();
|
|
507
|
+
if (!p) {
|
|
508
|
+
var v = typeof i == "string" ? i : i.displayName || i.name;
|
|
509
|
+
v && (p = `
|
|
510
510
|
|
|
511
|
-
Check the top-level render call using <` +
|
|
511
|
+
Check the top-level render call using <` + v + ">.");
|
|
512
512
|
}
|
|
513
|
-
return
|
|
513
|
+
return p;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Hr(i, p) {
|
|
517
517
|
{
|
|
518
518
|
if (!i._store || i._store.validated || i.key != null)
|
|
519
519
|
return;
|
|
520
520
|
i._store.validated = !0;
|
|
521
|
-
var
|
|
522
|
-
if (
|
|
521
|
+
var v = qs(p);
|
|
522
|
+
if (Wr[v])
|
|
523
523
|
return;
|
|
524
|
-
|
|
525
|
-
var
|
|
526
|
-
i && i._owner && i._owner !==
|
|
524
|
+
Wr[v] = !0;
|
|
525
|
+
var O = "";
|
|
526
|
+
i && i._owner && i._owner !== Wt.current && (O = " It was passed a child from " + me(i._owner.type) + "."), Ke(i), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, O), Ke(null);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function Br(i,
|
|
529
|
+
function Br(i, p) {
|
|
530
530
|
{
|
|
531
531
|
if (typeof i != "object")
|
|
532
532
|
return;
|
|
533
533
|
if (zt(i))
|
|
534
|
-
for (var
|
|
535
|
-
var
|
|
536
|
-
Bt(
|
|
534
|
+
for (var v = 0; v < i.length; v++) {
|
|
535
|
+
var O = i[v];
|
|
536
|
+
Bt(O) && Hr(O, p);
|
|
537
537
|
}
|
|
538
538
|
else if (Bt(i))
|
|
539
539
|
i._store && (i._store.validated = !0);
|
|
540
540
|
else if (i) {
|
|
541
|
-
var D =
|
|
541
|
+
var D = E(i);
|
|
542
542
|
if (typeof D == "function" && D !== i.entries)
|
|
543
|
-
for (var
|
|
544
|
-
Bt(
|
|
543
|
+
for (var q = D.call(i), A; !(A = q.next()).done; )
|
|
544
|
+
Bt(A.value) && Hr(A.value, p);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Ms(i) {
|
|
549
549
|
{
|
|
550
|
-
var
|
|
551
|
-
if (
|
|
550
|
+
var p = i.type;
|
|
551
|
+
if (p == null || typeof p == "string")
|
|
552
552
|
return;
|
|
553
|
-
var
|
|
554
|
-
if (typeof
|
|
555
|
-
|
|
556
|
-
else if (typeof
|
|
553
|
+
var v;
|
|
554
|
+
if (typeof p == "function")
|
|
555
|
+
v = p.propTypes;
|
|
556
|
+
else if (typeof p == "object" && (p.$$typeof === c || // Note: Memo only checks outer props here.
|
|
557
557
|
// Inner props are checked in the reconciler.
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
p.$$typeof === h))
|
|
559
|
+
v = p.propTypes;
|
|
560
560
|
else
|
|
561
561
|
return;
|
|
562
|
-
if (
|
|
563
|
-
var
|
|
564
|
-
|
|
565
|
-
} else if (
|
|
566
|
-
|
|
567
|
-
var D = me(
|
|
568
|
-
|
|
562
|
+
if (v) {
|
|
563
|
+
var O = me(p);
|
|
564
|
+
Os(v, i.props, "prop", O, i);
|
|
565
|
+
} else if (p.PropTypes !== void 0 && !Ht) {
|
|
566
|
+
Ht = !0;
|
|
567
|
+
var D = me(p);
|
|
568
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
|
|
569
569
|
}
|
|
570
|
-
typeof
|
|
570
|
+
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Us(i) {
|
|
574
574
|
{
|
|
575
|
-
for (var
|
|
576
|
-
var
|
|
577
|
-
if (
|
|
578
|
-
Ke(i),
|
|
575
|
+
for (var p = Object.keys(i.props), v = 0; v < p.length; v++) {
|
|
576
|
+
var O = p[v];
|
|
577
|
+
if (O !== "children" && O !== "key") {
|
|
578
|
+
Ke(i), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), Ke(null);
|
|
579
579
|
break;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
i.ref !== null && (Ke(i),
|
|
582
|
+
i.ref !== null && (Ke(i), S("Invalid attribute `ref` supplied to `React.Fragment`."), Ke(null));
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
var Gr = {};
|
|
586
|
-
function Yr(i,
|
|
586
|
+
function Yr(i, p, v, O, D, q) {
|
|
587
587
|
{
|
|
588
|
-
var
|
|
589
|
-
if (!
|
|
590
|
-
var
|
|
591
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (
|
|
592
|
-
var H =
|
|
593
|
-
H ?
|
|
594
|
-
var
|
|
595
|
-
i === null ?
|
|
588
|
+
var A = ie(i);
|
|
589
|
+
if (!A) {
|
|
590
|
+
var C = "";
|
|
591
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
592
|
+
var H = js();
|
|
593
|
+
H ? C += H : C += zr();
|
|
594
|
+
var Q;
|
|
595
|
+
i === null ? Q = "null" : zt(i) ? Q = "array" : i !== void 0 && i.$$typeof === e ? (Q = "<" + (me(i.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : Q = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Q, C);
|
|
596
596
|
}
|
|
597
|
-
var
|
|
598
|
-
if (
|
|
599
|
-
return
|
|
600
|
-
if (
|
|
601
|
-
var Z =
|
|
597
|
+
var $ = Is(i, p, v, D, q);
|
|
598
|
+
if ($ == null)
|
|
599
|
+
return $;
|
|
600
|
+
if (A) {
|
|
601
|
+
var Z = p.children;
|
|
602
602
|
if (Z !== void 0)
|
|
603
|
-
if (
|
|
603
|
+
if (O)
|
|
604
604
|
if (zt(Z)) {
|
|
605
605
|
for (var Ve = 0; Ve < Z.length; Ve++)
|
|
606
606
|
Br(Z[Ve], i);
|
|
607
607
|
Object.freeze && Object.freeze(Z);
|
|
608
608
|
} else
|
|
609
|
-
|
|
609
|
+
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
610
610
|
else
|
|
611
611
|
Br(Z, i);
|
|
612
612
|
}
|
|
613
|
-
if (ft.call(
|
|
614
|
-
var De = me(i),
|
|
615
|
-
return
|
|
616
|
-
}), Gt =
|
|
613
|
+
if (ft.call(p, "key")) {
|
|
614
|
+
var De = me(i), Y = Object.keys(p).filter(function(Vs) {
|
|
615
|
+
return Vs !== "key";
|
|
616
|
+
}), Gt = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
617
617
|
if (!Gr[De + Gt]) {
|
|
618
|
-
var
|
|
619
|
-
|
|
618
|
+
var Ks = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
619
|
+
S(`A props object containing a "key" prop is being spread into JSX:
|
|
620
620
|
let props = %s;
|
|
621
621
|
<%s {...props} />
|
|
622
622
|
React keys must be passed directly to JSX without using spread:
|
|
623
623
|
let props = %s;
|
|
624
|
-
<%s key={someKey} {...props} />`, Gt, De,
|
|
624
|
+
<%s key={someKey} {...props} />`, Gt, De, Ks, De), Gr[De + Gt] = !0;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
return i === n ?
|
|
627
|
+
return i === n ? Us($) : Ms($), $;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
return Yr(i,
|
|
630
|
+
function Ns(i, p, v) {
|
|
631
|
+
return Yr(i, p, v, !0);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
return Yr(i,
|
|
633
|
+
function Ls(i, p, v) {
|
|
634
|
+
return Yr(i, p, v, !1);
|
|
635
635
|
}
|
|
636
|
-
var
|
|
637
|
-
dt.Fragment = n, dt.jsx =
|
|
636
|
+
var Qs = Ls, $s = Ns;
|
|
637
|
+
dt.Fragment = n, dt.jsx = Qs, dt.jsxs = $s;
|
|
638
638
|
}()), dt;
|
|
639
639
|
}
|
|
640
|
-
process.env.NODE_ENV === "production" ? rr.exports =
|
|
640
|
+
process.env.NODE_ENV === "production" ? rr.exports = Ys() : rr.exports = Js();
|
|
641
641
|
var gt = rr.exports, nr = /* @__PURE__ */ ((t) => (t.NOT_CHUNKED = "NOT_CHUNKED", t.PROCESSING = "PROCESSING", t.CHUNKED = "CHUNKED", t.ERROR_CHUNKING = "ERROR_CHUNKING", t))(nr || {}), Or = /* @__PURE__ */ ((t) => (t.PDF = "application/pdf", t.TXT = "text/plain", t.CSV = "text/csv", t.DIRECTORY = "inode/directory", t.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", t))(Or || {});
|
|
642
|
-
const yt = 4e3 * 1024 * 1024,
|
|
642
|
+
const yt = 4e3 * 1024 * 1024, Xs = [
|
|
643
643
|
".txt",
|
|
644
644
|
".json",
|
|
645
645
|
".py",
|
|
646
646
|
".ts",
|
|
647
647
|
".tsx"
|
|
648
|
-
],
|
|
648
|
+
], Nn = {
|
|
649
649
|
"application/pdf": {
|
|
650
650
|
extensions: [".pdf"],
|
|
651
651
|
maxSize: yt
|
|
652
652
|
},
|
|
653
653
|
"text/plain": {
|
|
654
|
-
extensions:
|
|
654
|
+
extensions: Xs,
|
|
655
655
|
maxSize: yt
|
|
656
656
|
},
|
|
657
657
|
"text/csv": {
|
|
@@ -667,21 +667,14 @@ const yt = 4e3 * 1024 * 1024, Ys = [
|
|
|
667
667
|
maxSize: yt
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
|
-
Object.entries(
|
|
670
|
+
Object.entries(Nn).reduce(
|
|
671
671
|
(t, [e, r]) => ({
|
|
672
672
|
...t,
|
|
673
673
|
[e]: r.extensions
|
|
674
674
|
}),
|
|
675
675
|
{}
|
|
676
676
|
);
|
|
677
|
-
new Set(Object.values(Or));
|
|
678
|
-
function Js(t) {
|
|
679
|
-
const e = t.toLowerCase().startsWith(".") ? t.toLowerCase() : `.${t.toLowerCase()}`;
|
|
680
|
-
for (const [r, n] of Object.entries(Un))
|
|
681
|
-
if (n.extensions.includes(e))
|
|
682
|
-
return r;
|
|
683
|
-
return null;
|
|
684
|
-
}
|
|
677
|
+
const Zs = new Set(Object.values(Or));
|
|
685
678
|
var at = class {
|
|
686
679
|
constructor() {
|
|
687
680
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -701,16 +694,16 @@ var at = class {
|
|
|
701
694
|
}, Qe = typeof window > "u" || "Deno" in globalThis;
|
|
702
695
|
function te() {
|
|
703
696
|
}
|
|
704
|
-
function
|
|
697
|
+
function ei(t, e) {
|
|
705
698
|
return typeof t == "function" ? t(e) : t;
|
|
706
699
|
}
|
|
707
700
|
function sr(t) {
|
|
708
701
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
709
702
|
}
|
|
710
|
-
function
|
|
703
|
+
function Ln(t, e) {
|
|
711
704
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
712
705
|
}
|
|
713
|
-
function
|
|
706
|
+
function We(t, e) {
|
|
714
707
|
return typeof t == "function" ? t(e) : t;
|
|
715
708
|
}
|
|
716
709
|
function se(t, e) {
|
|
@@ -772,14 +765,14 @@ function ir(t, e) {
|
|
|
772
765
|
const n = r ? t : Object.keys(t), s = n.length, a = r ? e : Object.keys(e), u = a.length, l = r ? [] : {};
|
|
773
766
|
let c = 0;
|
|
774
767
|
for (let d = 0; d < u; d++) {
|
|
775
|
-
const
|
|
776
|
-
(!r && n.includes(
|
|
768
|
+
const f = r ? d : a[d];
|
|
769
|
+
(!r && n.includes(f) || r) && t[f] === void 0 && e[f] === void 0 ? (l[f] = void 0, c++) : (l[f] = ir(t[f], e[f]), l[f] === t[f] && t[f] !== void 0 && c++);
|
|
777
770
|
}
|
|
778
771
|
return s === u && c === s ? t : l;
|
|
779
772
|
}
|
|
780
773
|
return e;
|
|
781
774
|
}
|
|
782
|
-
function
|
|
775
|
+
function Mt(t, e) {
|
|
783
776
|
if (!e || Object.keys(t).length !== Object.keys(e).length)
|
|
784
777
|
return !1;
|
|
785
778
|
for (const r in t)
|
|
@@ -802,7 +795,7 @@ function or(t) {
|
|
|
802
795
|
function nn(t) {
|
|
803
796
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
804
797
|
}
|
|
805
|
-
function
|
|
798
|
+
function ti(t) {
|
|
806
799
|
return new Promise((e) => {
|
|
807
800
|
setTimeout(e, t);
|
|
808
801
|
});
|
|
@@ -823,27 +816,27 @@ function ar(t, e, r) {
|
|
|
823
816
|
}
|
|
824
817
|
return e;
|
|
825
818
|
}
|
|
826
|
-
function
|
|
819
|
+
function ri(t, e, r = 0) {
|
|
827
820
|
const n = [...t, e];
|
|
828
821
|
return r && n.length > r ? n.slice(1) : n;
|
|
829
822
|
}
|
|
830
|
-
function
|
|
823
|
+
function ni(t, e, r = 0) {
|
|
831
824
|
const n = [e, ...t];
|
|
832
825
|
return r && n.length > r ? n.slice(0, -1) : n;
|
|
833
826
|
}
|
|
834
|
-
var
|
|
835
|
-
function
|
|
836
|
-
return process.env.NODE_ENV !== "production" && t.queryFn ===
|
|
827
|
+
var Ut = Symbol();
|
|
828
|
+
function Qn(t, e) {
|
|
829
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === Ut && console.error(
|
|
837
830
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
838
|
-
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn ===
|
|
831
|
+
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === Ut ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
839
832
|
}
|
|
840
|
-
var
|
|
833
|
+
var _e, be, He, Rn, si = (Rn = class extends at {
|
|
841
834
|
constructor() {
|
|
842
835
|
super();
|
|
843
|
-
w(this,
|
|
836
|
+
w(this, _e);
|
|
844
837
|
w(this, be);
|
|
845
|
-
w(this,
|
|
846
|
-
|
|
838
|
+
w(this, He);
|
|
839
|
+
b(this, He, (e) => {
|
|
847
840
|
if (!Qe && window.addEventListener) {
|
|
848
841
|
const r = () => e();
|
|
849
842
|
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
@@ -853,20 +846,20 @@ var Ie, be, We, wn, ri = (wn = class extends at {
|
|
|
853
846
|
});
|
|
854
847
|
}
|
|
855
848
|
onSubscribe() {
|
|
856
|
-
o(this, be) || this.setEventListener(o(this,
|
|
849
|
+
o(this, be) || this.setEventListener(o(this, He));
|
|
857
850
|
}
|
|
858
851
|
onUnsubscribe() {
|
|
859
852
|
var e;
|
|
860
|
-
this.hasListeners() || ((e = o(this, be)) == null || e.call(this),
|
|
853
|
+
this.hasListeners() || ((e = o(this, be)) == null || e.call(this), b(this, be, void 0));
|
|
861
854
|
}
|
|
862
855
|
setEventListener(e) {
|
|
863
856
|
var r;
|
|
864
|
-
|
|
857
|
+
b(this, He, e), (r = o(this, be)) == null || r.call(this), b(this, be, e((n) => {
|
|
865
858
|
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
866
859
|
}));
|
|
867
860
|
}
|
|
868
861
|
setFocused(e) {
|
|
869
|
-
o(this,
|
|
862
|
+
o(this, _e) !== e && (b(this, _e, e), this.onFocus());
|
|
870
863
|
}
|
|
871
864
|
onFocus() {
|
|
872
865
|
const e = this.isFocused();
|
|
@@ -876,15 +869,15 @@ var Ie, be, We, wn, ri = (wn = class extends at {
|
|
|
876
869
|
}
|
|
877
870
|
isFocused() {
|
|
878
871
|
var e;
|
|
879
|
-
return typeof o(this,
|
|
872
|
+
return typeof o(this, _e) == "boolean" ? o(this, _e) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
880
873
|
}
|
|
881
|
-
},
|
|
874
|
+
}, _e = new WeakMap(), be = new WeakMap(), He = new WeakMap(), Rn), Sr = new si(), Be, ve, Ge, On, ii = (On = class extends at {
|
|
882
875
|
constructor() {
|
|
883
876
|
super();
|
|
884
877
|
w(this, Be, !0);
|
|
885
878
|
w(this, ve);
|
|
886
879
|
w(this, Ge);
|
|
887
|
-
|
|
880
|
+
b(this, Ge, (e) => {
|
|
888
881
|
if (!Qe && window.addEventListener) {
|
|
889
882
|
const r = () => e(!0), n = () => e(!1);
|
|
890
883
|
return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => {
|
|
@@ -898,21 +891,21 @@ var Ie, be, We, wn, ri = (wn = class extends at {
|
|
|
898
891
|
}
|
|
899
892
|
onUnsubscribe() {
|
|
900
893
|
var e;
|
|
901
|
-
this.hasListeners() || ((e = o(this, ve)) == null || e.call(this),
|
|
894
|
+
this.hasListeners() || ((e = o(this, ve)) == null || e.call(this), b(this, ve, void 0));
|
|
902
895
|
}
|
|
903
896
|
setEventListener(e) {
|
|
904
897
|
var r;
|
|
905
|
-
|
|
898
|
+
b(this, Ge, e), (r = o(this, ve)) == null || r.call(this), b(this, ve, e(this.setOnline.bind(this)));
|
|
906
899
|
}
|
|
907
900
|
setOnline(e) {
|
|
908
|
-
o(this, Be) !== e && (
|
|
901
|
+
o(this, Be) !== e && (b(this, Be, e), this.listeners.forEach((n) => {
|
|
909
902
|
n(e);
|
|
910
903
|
}));
|
|
911
904
|
}
|
|
912
905
|
isOnline() {
|
|
913
906
|
return o(this, Be);
|
|
914
907
|
}
|
|
915
|
-
}, Be = new WeakMap(), ve = new WeakMap(), Ge = new WeakMap(),
|
|
908
|
+
}, Be = new WeakMap(), ve = new WeakMap(), Ge = new WeakMap(), On), Nt = new ii();
|
|
916
909
|
function ur() {
|
|
917
910
|
let t, e;
|
|
918
911
|
const r = new Promise((s, a) => {
|
|
@@ -935,64 +928,64 @@ function ur() {
|
|
|
935
928
|
}), e(s);
|
|
936
929
|
}, r;
|
|
937
930
|
}
|
|
938
|
-
function
|
|
931
|
+
function oi(t) {
|
|
939
932
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
940
933
|
}
|
|
941
|
-
function
|
|
934
|
+
function $n(t) {
|
|
942
935
|
return (t ?? "online") === "online" ? Nt.isOnline() : !0;
|
|
943
936
|
}
|
|
944
|
-
var
|
|
937
|
+
var Kn = class extends Error {
|
|
945
938
|
constructor(t) {
|
|
946
939
|
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
947
940
|
}
|
|
948
941
|
};
|
|
949
942
|
function Jt(t) {
|
|
950
|
-
return t instanceof
|
|
943
|
+
return t instanceof Kn;
|
|
951
944
|
}
|
|
952
|
-
function
|
|
945
|
+
function Vn(t) {
|
|
953
946
|
let e = !1, r = 0, n = !1, s;
|
|
954
|
-
const a = ur(), u = (
|
|
955
|
-
var
|
|
956
|
-
n || (
|
|
947
|
+
const a = ur(), u = (g) => {
|
|
948
|
+
var E;
|
|
949
|
+
n || (y(new Kn(g)), (E = t.abort) == null || E.call(t));
|
|
957
950
|
}, l = () => {
|
|
958
951
|
e = !0;
|
|
959
952
|
}, c = () => {
|
|
960
953
|
e = !1;
|
|
961
|
-
}, d = () => Sr.isFocused() && (t.networkMode === "always" || Nt.isOnline()) && t.canRun(),
|
|
962
|
-
var
|
|
963
|
-
n || (n = !0, (
|
|
964
|
-
},
|
|
965
|
-
var
|
|
966
|
-
n || (n = !0, (
|
|
967
|
-
}, m = () => new Promise((
|
|
968
|
-
var
|
|
969
|
-
s = (
|
|
970
|
-
(n || d()) &&
|
|
971
|
-
}, (
|
|
954
|
+
}, d = () => Sr.isFocused() && (t.networkMode === "always" || Nt.isOnline()) && t.canRun(), f = () => $n(t.networkMode) && t.canRun(), h = (g) => {
|
|
955
|
+
var E;
|
|
956
|
+
n || (n = !0, (E = t.onSuccess) == null || E.call(t, g), s == null || s(), a.resolve(g));
|
|
957
|
+
}, y = (g) => {
|
|
958
|
+
var E;
|
|
959
|
+
n || (n = !0, (E = t.onError) == null || E.call(t, g), s == null || s(), a.reject(g));
|
|
960
|
+
}, m = () => new Promise((g) => {
|
|
961
|
+
var E;
|
|
962
|
+
s = (T) => {
|
|
963
|
+
(n || d()) && g(T);
|
|
964
|
+
}, (E = t.onPause) == null || E.call(t);
|
|
972
965
|
}).then(() => {
|
|
973
|
-
var
|
|
974
|
-
s = void 0, n || (
|
|
966
|
+
var g;
|
|
967
|
+
s = void 0, n || (g = t.onContinue) == null || g.call(t);
|
|
975
968
|
}), R = () => {
|
|
976
969
|
if (n)
|
|
977
970
|
return;
|
|
978
|
-
let
|
|
979
|
-
const
|
|
971
|
+
let g;
|
|
972
|
+
const E = r === 0 ? t.initialPromise : void 0;
|
|
980
973
|
try {
|
|
981
|
-
|
|
982
|
-
} catch (
|
|
983
|
-
|
|
974
|
+
g = E ?? t.fn();
|
|
975
|
+
} catch (T) {
|
|
976
|
+
g = Promise.reject(T);
|
|
984
977
|
}
|
|
985
|
-
Promise.resolve(
|
|
986
|
-
var
|
|
978
|
+
Promise.resolve(g).then(h).catch((T) => {
|
|
979
|
+
var K;
|
|
987
980
|
if (n)
|
|
988
981
|
return;
|
|
989
|
-
const
|
|
990
|
-
if (e || !
|
|
991
|
-
|
|
982
|
+
const S = t.retry ?? (Qe ? 0 : 3), j = t.retryDelay ?? oi, L = typeof j == "function" ? j(r, T) : j, M = S === !0 || typeof S == "number" && r < S || typeof S == "function" && S(r, T);
|
|
983
|
+
if (e || !M) {
|
|
984
|
+
y(T);
|
|
992
985
|
return;
|
|
993
986
|
}
|
|
994
|
-
r++, (
|
|
995
|
-
e ?
|
|
987
|
+
r++, (K = t.onFail) == null || K.call(t, r, T), ti(L).then(() => d() ? void 0 : m()).then(() => {
|
|
988
|
+
e ? y(T) : R();
|
|
996
989
|
});
|
|
997
990
|
});
|
|
998
991
|
};
|
|
@@ -1002,11 +995,11 @@ function $n(t) {
|
|
|
1002
995
|
continue: () => (s == null || s(), a),
|
|
1003
996
|
cancelRetry: l,
|
|
1004
997
|
continueRetry: c,
|
|
1005
|
-
canStart:
|
|
1006
|
-
start: () => (
|
|
998
|
+
canStart: f,
|
|
999
|
+
start: () => (f() ? R() : m().then(R), a)
|
|
1007
1000
|
};
|
|
1008
1001
|
}
|
|
1009
|
-
function
|
|
1002
|
+
function ai() {
|
|
1010
1003
|
let t = [], e = 0, r = (l) => {
|
|
1011
1004
|
l();
|
|
1012
1005
|
}, n = (l) => {
|
|
@@ -1065,15 +1058,15 @@ function ii() {
|
|
|
1065
1058
|
}
|
|
1066
1059
|
};
|
|
1067
1060
|
}
|
|
1068
|
-
var
|
|
1061
|
+
var V = ai(), Ie, Pn, zn = (Pn = class {
|
|
1069
1062
|
constructor() {
|
|
1070
|
-
w(this,
|
|
1063
|
+
w(this, Ie);
|
|
1071
1064
|
}
|
|
1072
1065
|
destroy() {
|
|
1073
1066
|
this.clearGcTimeout();
|
|
1074
1067
|
}
|
|
1075
1068
|
scheduleGc() {
|
|
1076
|
-
this.clearGcTimeout(), sr(this.gcTime) &&
|
|
1069
|
+
this.clearGcTimeout(), sr(this.gcTime) && b(this, Ie, setTimeout(() => {
|
|
1077
1070
|
this.optionalRemove();
|
|
1078
1071
|
}, this.gcTime));
|
|
1079
1072
|
}
|
|
@@ -1084,9 +1077,9 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1084
1077
|
);
|
|
1085
1078
|
}
|
|
1086
1079
|
clearGcTimeout() {
|
|
1087
|
-
o(this,
|
|
1080
|
+
o(this, Ie) && (clearTimeout(o(this, Ie)), b(this, Ie, void 0));
|
|
1088
1081
|
}
|
|
1089
|
-
},
|
|
1082
|
+
}, Ie = new WeakMap(), Pn), Ye, Je, ee, je, W, Ot, qe, re, fe, Sn, ui = (Sn = class extends zn {
|
|
1090
1083
|
constructor(e) {
|
|
1091
1084
|
super();
|
|
1092
1085
|
w(this, re);
|
|
@@ -1094,17 +1087,17 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1094
1087
|
w(this, Je);
|
|
1095
1088
|
w(this, ee);
|
|
1096
1089
|
w(this, je);
|
|
1097
|
-
w(this,
|
|
1090
|
+
w(this, W);
|
|
1098
1091
|
w(this, Ot);
|
|
1099
1092
|
w(this, qe);
|
|
1100
|
-
|
|
1093
|
+
b(this, qe, !1), b(this, Ot, e.defaultOptions), this.setOptions(e.options), this.observers = [], b(this, je, e.client), b(this, ee, o(this, je).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, b(this, Ye, ci(this.options)), this.state = e.state ?? o(this, Ye), this.scheduleGc();
|
|
1101
1094
|
}
|
|
1102
1095
|
get meta() {
|
|
1103
1096
|
return this.options.meta;
|
|
1104
1097
|
}
|
|
1105
1098
|
get promise() {
|
|
1106
1099
|
var e;
|
|
1107
|
-
return (e = o(this,
|
|
1100
|
+
return (e = o(this, W)) == null ? void 0 : e.promise;
|
|
1108
1101
|
}
|
|
1109
1102
|
setOptions(e) {
|
|
1110
1103
|
this.options = { ...o(this, Ot), ...e }, this.updateGcTime(this.options.gcTime);
|
|
@@ -1114,7 +1107,7 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1114
1107
|
}
|
|
1115
1108
|
setData(e, r) {
|
|
1116
1109
|
const n = ar(this.state.data, e, this.options);
|
|
1117
|
-
return P(this, re,
|
|
1110
|
+
return P(this, re, fe).call(this, {
|
|
1118
1111
|
data: n,
|
|
1119
1112
|
type: "success",
|
|
1120
1113
|
dataUpdatedAt: r == null ? void 0 : r.updatedAt,
|
|
@@ -1122,12 +1115,12 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1122
1115
|
}), n;
|
|
1123
1116
|
}
|
|
1124
1117
|
setState(e, r) {
|
|
1125
|
-
P(this, re,
|
|
1118
|
+
P(this, re, fe).call(this, { type: "setState", state: e, setStateOptions: r });
|
|
1126
1119
|
}
|
|
1127
1120
|
cancel(e) {
|
|
1128
1121
|
var n, s;
|
|
1129
|
-
const r = (n = o(this,
|
|
1130
|
-
return (s = o(this,
|
|
1122
|
+
const r = (n = o(this, W)) == null ? void 0 : n.promise;
|
|
1123
|
+
return (s = o(this, W)) == null || s.cancel(e), r ? r.then(te).catch(te) : Promise.resolve();
|
|
1131
1124
|
}
|
|
1132
1125
|
destroy() {
|
|
1133
1126
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1141,7 +1134,7 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1141
1134
|
);
|
|
1142
1135
|
}
|
|
1143
1136
|
isDisabled() {
|
|
1144
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
1137
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Ut || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
1145
1138
|
}
|
|
1146
1139
|
isStale() {
|
|
1147
1140
|
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -1149,61 +1142,61 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1149
1142
|
) : this.state.data === void 0;
|
|
1150
1143
|
}
|
|
1151
1144
|
isStaleByTime(e = 0) {
|
|
1152
|
-
return this.state.isInvalidated || this.state.data === void 0 || !
|
|
1145
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Ln(this.state.dataUpdatedAt, e);
|
|
1153
1146
|
}
|
|
1154
1147
|
onFocus() {
|
|
1155
1148
|
var r;
|
|
1156
1149
|
const e = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1157
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = o(this,
|
|
1150
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = o(this, W)) == null || r.continue();
|
|
1158
1151
|
}
|
|
1159
1152
|
onOnline() {
|
|
1160
1153
|
var r;
|
|
1161
1154
|
const e = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1162
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = o(this,
|
|
1155
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = o(this, W)) == null || r.continue();
|
|
1163
1156
|
}
|
|
1164
1157
|
addObserver(e) {
|
|
1165
1158
|
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), o(this, ee).notify({ type: "observerAdded", query: this, observer: e }));
|
|
1166
1159
|
}
|
|
1167
1160
|
removeObserver(e) {
|
|
1168
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (o(this,
|
|
1161
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (o(this, W) && (o(this, qe) ? o(this, W).cancel({ revert: !0 }) : o(this, W).cancelRetry()), this.scheduleGc()), o(this, ee).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
1169
1162
|
}
|
|
1170
1163
|
getObserversCount() {
|
|
1171
1164
|
return this.observers.length;
|
|
1172
1165
|
}
|
|
1173
1166
|
invalidate() {
|
|
1174
|
-
this.state.isInvalidated || P(this, re,
|
|
1167
|
+
this.state.isInvalidated || P(this, re, fe).call(this, { type: "invalidate" });
|
|
1175
1168
|
}
|
|
1176
1169
|
fetch(e, r) {
|
|
1177
|
-
var c, d,
|
|
1170
|
+
var c, d, f;
|
|
1178
1171
|
if (this.state.fetchStatus !== "idle") {
|
|
1179
1172
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1180
1173
|
this.cancel({ silent: !0 });
|
|
1181
|
-
else if (o(this,
|
|
1182
|
-
return o(this,
|
|
1174
|
+
else if (o(this, W))
|
|
1175
|
+
return o(this, W).continueRetry(), o(this, W).promise;
|
|
1183
1176
|
}
|
|
1184
1177
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1178
|
+
const h = this.observers.find((y) => y.options.queryFn);
|
|
1179
|
+
h && this.setOptions(h.options);
|
|
1187
1180
|
}
|
|
1188
1181
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
1189
1182
|
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
|
|
1190
1183
|
));
|
|
1191
|
-
const n = new AbortController(), s = (
|
|
1192
|
-
Object.defineProperty(
|
|
1184
|
+
const n = new AbortController(), s = (h) => {
|
|
1185
|
+
Object.defineProperty(h, "signal", {
|
|
1193
1186
|
enumerable: !0,
|
|
1194
|
-
get: () => (
|
|
1187
|
+
get: () => (b(this, qe, !0), n.signal)
|
|
1195
1188
|
});
|
|
1196
1189
|
}, a = () => {
|
|
1197
|
-
const
|
|
1190
|
+
const h = Qn(this.options, r), y = {
|
|
1198
1191
|
client: o(this, je),
|
|
1199
1192
|
queryKey: this.queryKey,
|
|
1200
1193
|
meta: this.meta
|
|
1201
1194
|
};
|
|
1202
|
-
return s(
|
|
1203
|
-
|
|
1204
|
-
|
|
1195
|
+
return s(y), b(this, qe, !1), this.options.persister ? this.options.persister(
|
|
1196
|
+
h,
|
|
1197
|
+
y,
|
|
1205
1198
|
this
|
|
1206
|
-
) :
|
|
1199
|
+
) : h(y);
|
|
1207
1200
|
}, u = {
|
|
1208
1201
|
fetchOptions: r,
|
|
1209
1202
|
options: this.options,
|
|
@@ -1215,65 +1208,65 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1215
1208
|
s(u), (c = this.options.behavior) == null || c.onFetch(
|
|
1216
1209
|
u,
|
|
1217
1210
|
this
|
|
1218
|
-
),
|
|
1219
|
-
const l = (
|
|
1220
|
-
var
|
|
1221
|
-
Jt(
|
|
1211
|
+
), b(this, Je, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = u.fetchOptions) == null ? void 0 : d.meta)) && P(this, re, fe).call(this, { type: "fetch", meta: (f = u.fetchOptions) == null ? void 0 : f.meta });
|
|
1212
|
+
const l = (h) => {
|
|
1213
|
+
var y, m, R, g;
|
|
1214
|
+
Jt(h) && h.silent || P(this, re, fe).call(this, {
|
|
1222
1215
|
type: "error",
|
|
1223
|
-
error:
|
|
1224
|
-
}), Jt(
|
|
1225
|
-
|
|
1226
|
-
|
|
1216
|
+
error: h
|
|
1217
|
+
}), Jt(h) || ((m = (y = o(this, ee).config).onError) == null || m.call(
|
|
1218
|
+
y,
|
|
1219
|
+
h,
|
|
1227
1220
|
this
|
|
1228
|
-
), (
|
|
1221
|
+
), (g = (R = o(this, ee).config).onSettled) == null || g.call(
|
|
1229
1222
|
R,
|
|
1230
1223
|
this.state.data,
|
|
1231
|
-
|
|
1224
|
+
h,
|
|
1232
1225
|
this
|
|
1233
1226
|
)), this.scheduleGc();
|
|
1234
1227
|
};
|
|
1235
|
-
return
|
|
1228
|
+
return b(this, W, Vn({
|
|
1236
1229
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1237
1230
|
fn: u.fetchFn,
|
|
1238
1231
|
abort: n.abort.bind(n),
|
|
1239
|
-
onSuccess: (
|
|
1240
|
-
var
|
|
1241
|
-
if (
|
|
1232
|
+
onSuccess: (h) => {
|
|
1233
|
+
var y, m, R, g;
|
|
1234
|
+
if (h === void 0) {
|
|
1242
1235
|
process.env.NODE_ENV !== "production" && console.error(
|
|
1243
1236
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
1244
1237
|
), l(new Error(`${this.queryHash} data is undefined`));
|
|
1245
1238
|
return;
|
|
1246
1239
|
}
|
|
1247
1240
|
try {
|
|
1248
|
-
this.setData(
|
|
1249
|
-
} catch (
|
|
1250
|
-
l(
|
|
1241
|
+
this.setData(h);
|
|
1242
|
+
} catch (E) {
|
|
1243
|
+
l(E);
|
|
1251
1244
|
return;
|
|
1252
1245
|
}
|
|
1253
|
-
(m = (
|
|
1246
|
+
(m = (y = o(this, ee).config).onSuccess) == null || m.call(y, h, this), (g = (R = o(this, ee).config).onSettled) == null || g.call(
|
|
1254
1247
|
R,
|
|
1255
|
-
|
|
1248
|
+
h,
|
|
1256
1249
|
this.state.error,
|
|
1257
1250
|
this
|
|
1258
1251
|
), this.scheduleGc();
|
|
1259
1252
|
},
|
|
1260
1253
|
onError: l,
|
|
1261
|
-
onFail: (
|
|
1262
|
-
P(this, re,
|
|
1254
|
+
onFail: (h, y) => {
|
|
1255
|
+
P(this, re, fe).call(this, { type: "failed", failureCount: h, error: y });
|
|
1263
1256
|
},
|
|
1264
1257
|
onPause: () => {
|
|
1265
|
-
P(this, re,
|
|
1258
|
+
P(this, re, fe).call(this, { type: "pause" });
|
|
1266
1259
|
},
|
|
1267
1260
|
onContinue: () => {
|
|
1268
|
-
P(this, re,
|
|
1261
|
+
P(this, re, fe).call(this, { type: "continue" });
|
|
1269
1262
|
},
|
|
1270
1263
|
retry: u.options.retry,
|
|
1271
1264
|
retryDelay: u.options.retryDelay,
|
|
1272
1265
|
networkMode: u.options.networkMode,
|
|
1273
1266
|
canRun: () => !0
|
|
1274
|
-
})), o(this,
|
|
1267
|
+
})), o(this, W).start();
|
|
1275
1268
|
}
|
|
1276
|
-
}, Ye = new WeakMap(), Je = new WeakMap(), ee = new WeakMap(), je = new WeakMap(),
|
|
1269
|
+
}, Ye = new WeakMap(), Je = new WeakMap(), ee = new WeakMap(), je = new WeakMap(), W = new WeakMap(), Ot = new WeakMap(), qe = new WeakMap(), re = new WeakSet(), fe = function(e) {
|
|
1277
1270
|
const r = (n) => {
|
|
1278
1271
|
switch (e.type) {
|
|
1279
1272
|
case "failed":
|
|
@@ -1295,7 +1288,7 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1295
1288
|
case "fetch":
|
|
1296
1289
|
return {
|
|
1297
1290
|
...n,
|
|
1298
|
-
...
|
|
1291
|
+
...Wn(n.data, this.options),
|
|
1299
1292
|
fetchMeta: e.meta ?? null
|
|
1300
1293
|
};
|
|
1301
1294
|
case "success":
|
|
@@ -1337,24 +1330,24 @@ var L = ii(), ke, Rn, Kn = (Rn = class {
|
|
|
1337
1330
|
};
|
|
1338
1331
|
}
|
|
1339
1332
|
};
|
|
1340
|
-
this.state = r(this.state),
|
|
1333
|
+
this.state = r(this.state), V.batch(() => {
|
|
1341
1334
|
this.observers.forEach((n) => {
|
|
1342
1335
|
n.onQueryUpdate();
|
|
1343
1336
|
}), o(this, ee).notify({ query: this, type: "updated", action: e });
|
|
1344
1337
|
});
|
|
1345
|
-
},
|
|
1346
|
-
function
|
|
1338
|
+
}, Sn);
|
|
1339
|
+
function Wn(t, e) {
|
|
1347
1340
|
return {
|
|
1348
1341
|
fetchFailureCount: 0,
|
|
1349
1342
|
fetchFailureReason: null,
|
|
1350
|
-
fetchStatus:
|
|
1343
|
+
fetchStatus: $n(e.networkMode) ? "fetching" : "paused",
|
|
1351
1344
|
...t === void 0 && {
|
|
1352
1345
|
error: null,
|
|
1353
1346
|
status: "pending"
|
|
1354
1347
|
}
|
|
1355
1348
|
};
|
|
1356
1349
|
}
|
|
1357
|
-
function
|
|
1350
|
+
function ci(t) {
|
|
1358
1351
|
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, r = e !== void 0, n = r ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
|
|
1359
1352
|
return {
|
|
1360
1353
|
data: e,
|
|
@@ -1371,16 +1364,16 @@ function ai(t) {
|
|
|
1371
1364
|
fetchStatus: "idle"
|
|
1372
1365
|
};
|
|
1373
1366
|
}
|
|
1374
|
-
var
|
|
1367
|
+
var ae, Cn, li = (Cn = class extends at {
|
|
1375
1368
|
constructor(e = {}) {
|
|
1376
1369
|
super();
|
|
1377
|
-
w(this,
|
|
1378
|
-
this.config = e,
|
|
1370
|
+
w(this, ae);
|
|
1371
|
+
this.config = e, b(this, ae, /* @__PURE__ */ new Map());
|
|
1379
1372
|
}
|
|
1380
1373
|
build(e, r, n) {
|
|
1381
1374
|
const s = r.queryKey, a = r.queryHash ?? Pr(s, r);
|
|
1382
1375
|
let u = this.get(a);
|
|
1383
|
-
return u || (u = new
|
|
1376
|
+
return u || (u = new ui({
|
|
1384
1377
|
client: e,
|
|
1385
1378
|
queryKey: s,
|
|
1386
1379
|
queryHash: a,
|
|
@@ -1390,27 +1383,27 @@ var oe, Pn, ui = (Pn = class extends at {
|
|
|
1390
1383
|
}), this.add(u)), u;
|
|
1391
1384
|
}
|
|
1392
1385
|
add(e) {
|
|
1393
|
-
o(this,
|
|
1386
|
+
o(this, ae).has(e.queryHash) || (o(this, ae).set(e.queryHash, e), this.notify({
|
|
1394
1387
|
type: "added",
|
|
1395
1388
|
query: e
|
|
1396
1389
|
}));
|
|
1397
1390
|
}
|
|
1398
1391
|
remove(e) {
|
|
1399
|
-
const r = o(this,
|
|
1400
|
-
r && (e.destroy(), r === e && o(this,
|
|
1392
|
+
const r = o(this, ae).get(e.queryHash);
|
|
1393
|
+
r && (e.destroy(), r === e && o(this, ae).delete(e.queryHash), this.notify({ type: "removed", query: e }));
|
|
1401
1394
|
}
|
|
1402
1395
|
clear() {
|
|
1403
|
-
|
|
1396
|
+
V.batch(() => {
|
|
1404
1397
|
this.getAll().forEach((e) => {
|
|
1405
1398
|
this.remove(e);
|
|
1406
1399
|
});
|
|
1407
1400
|
});
|
|
1408
1401
|
}
|
|
1409
1402
|
get(e) {
|
|
1410
|
-
return o(this,
|
|
1403
|
+
return o(this, ae).get(e);
|
|
1411
1404
|
}
|
|
1412
1405
|
getAll() {
|
|
1413
|
-
return [...o(this,
|
|
1406
|
+
return [...o(this, ae).values()];
|
|
1414
1407
|
}
|
|
1415
1408
|
find(e) {
|
|
1416
1409
|
const r = { exact: !0, ...e };
|
|
@@ -1423,34 +1416,34 @@ var oe, Pn, ui = (Pn = class extends at {
|
|
|
1423
1416
|
return Object.keys(e).length > 0 ? r.filter((n) => en(e, n)) : r;
|
|
1424
1417
|
}
|
|
1425
1418
|
notify(e) {
|
|
1426
|
-
|
|
1419
|
+
V.batch(() => {
|
|
1427
1420
|
this.listeners.forEach((r) => {
|
|
1428
1421
|
r(e);
|
|
1429
1422
|
});
|
|
1430
1423
|
});
|
|
1431
1424
|
}
|
|
1432
1425
|
onFocus() {
|
|
1433
|
-
|
|
1426
|
+
V.batch(() => {
|
|
1434
1427
|
this.getAll().forEach((e) => {
|
|
1435
1428
|
e.onFocus();
|
|
1436
1429
|
});
|
|
1437
1430
|
});
|
|
1438
1431
|
}
|
|
1439
1432
|
onOnline() {
|
|
1440
|
-
|
|
1433
|
+
V.batch(() => {
|
|
1441
1434
|
this.getAll().forEach((e) => {
|
|
1442
1435
|
e.onOnline();
|
|
1443
1436
|
});
|
|
1444
1437
|
});
|
|
1445
1438
|
}
|
|
1446
|
-
},
|
|
1439
|
+
}, ae = new WeakMap(), Cn), ue, B, Me, ce, ge, Tn, fi = (Tn = class extends zn {
|
|
1447
1440
|
constructor(e) {
|
|
1448
1441
|
super();
|
|
1442
|
+
w(this, ce);
|
|
1449
1443
|
w(this, ue);
|
|
1450
|
-
w(this,
|
|
1451
|
-
w(this,
|
|
1452
|
-
|
|
1453
|
-
this.mutationId = e.mutationId, g(this, W, e.mutationCache), g(this, ae, []), this.state = e.state || zn(), this.setOptions(e.options), this.scheduleGc();
|
|
1444
|
+
w(this, B);
|
|
1445
|
+
w(this, Me);
|
|
1446
|
+
this.mutationId = e.mutationId, b(this, B, e.mutationCache), b(this, ue, []), this.state = e.state || Hn(), this.setOptions(e.options), this.scheduleGc();
|
|
1454
1447
|
}
|
|
1455
1448
|
setOptions(e) {
|
|
1456
1449
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -1459,111 +1452,111 @@ var oe, Pn, ui = (Pn = class extends at {
|
|
|
1459
1452
|
return this.options.meta;
|
|
1460
1453
|
}
|
|
1461
1454
|
addObserver(e) {
|
|
1462
|
-
o(this,
|
|
1455
|
+
o(this, ue).includes(e) || (o(this, ue).push(e), this.clearGcTimeout(), o(this, B).notify({
|
|
1463
1456
|
type: "observerAdded",
|
|
1464
1457
|
mutation: this,
|
|
1465
1458
|
observer: e
|
|
1466
1459
|
}));
|
|
1467
1460
|
}
|
|
1468
1461
|
removeObserver(e) {
|
|
1469
|
-
|
|
1462
|
+
b(this, ue, o(this, ue).filter((r) => r !== e)), this.scheduleGc(), o(this, B).notify({
|
|
1470
1463
|
type: "observerRemoved",
|
|
1471
1464
|
mutation: this,
|
|
1472
1465
|
observer: e
|
|
1473
1466
|
});
|
|
1474
1467
|
}
|
|
1475
1468
|
optionalRemove() {
|
|
1476
|
-
o(this,
|
|
1469
|
+
o(this, ue).length || (this.state.status === "pending" ? this.scheduleGc() : o(this, B).remove(this));
|
|
1477
1470
|
}
|
|
1478
1471
|
continue() {
|
|
1479
1472
|
var e;
|
|
1480
|
-
return ((e = o(this,
|
|
1473
|
+
return ((e = o(this, Me)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
1481
1474
|
this.execute(this.state.variables);
|
|
1482
1475
|
}
|
|
1483
1476
|
async execute(e) {
|
|
1484
|
-
var s, a, u, l, c, d,
|
|
1485
|
-
|
|
1477
|
+
var s, a, u, l, c, d, f, h, y, m, R, g, E, T, S, j, L, M, K, U;
|
|
1478
|
+
b(this, Me, Vn({
|
|
1486
1479
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
|
|
1487
|
-
onFail: (
|
|
1488
|
-
P(this,
|
|
1480
|
+
onFail: (_, I) => {
|
|
1481
|
+
P(this, ce, ge).call(this, { type: "failed", failureCount: _, error: I });
|
|
1489
1482
|
},
|
|
1490
1483
|
onPause: () => {
|
|
1491
|
-
P(this,
|
|
1484
|
+
P(this, ce, ge).call(this, { type: "pause" });
|
|
1492
1485
|
},
|
|
1493
1486
|
onContinue: () => {
|
|
1494
|
-
P(this,
|
|
1487
|
+
P(this, ce, ge).call(this, { type: "continue" });
|
|
1495
1488
|
},
|
|
1496
1489
|
retry: this.options.retry ?? 0,
|
|
1497
1490
|
retryDelay: this.options.retryDelay,
|
|
1498
1491
|
networkMode: this.options.networkMode,
|
|
1499
|
-
canRun: () => o(this,
|
|
1492
|
+
canRun: () => o(this, B).canRun(this)
|
|
1500
1493
|
}));
|
|
1501
|
-
const r = this.state.status === "pending", n = !o(this,
|
|
1494
|
+
const r = this.state.status === "pending", n = !o(this, Me).canStart();
|
|
1502
1495
|
try {
|
|
1503
1496
|
if (!r) {
|
|
1504
|
-
P(this,
|
|
1497
|
+
P(this, ce, ge).call(this, { type: "pending", variables: e, isPaused: n }), await ((a = (s = o(this, B).config).onMutate) == null ? void 0 : a.call(
|
|
1505
1498
|
s,
|
|
1506
1499
|
e,
|
|
1507
1500
|
this
|
|
1508
1501
|
));
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1502
|
+
const I = await ((l = (u = this.options).onMutate) == null ? void 0 : l.call(u, e));
|
|
1503
|
+
I !== this.state.context && P(this, ce, ge).call(this, {
|
|
1511
1504
|
type: "pending",
|
|
1512
|
-
context:
|
|
1505
|
+
context: I,
|
|
1513
1506
|
variables: e,
|
|
1514
1507
|
isPaused: n
|
|
1515
1508
|
});
|
|
1516
1509
|
}
|
|
1517
|
-
const
|
|
1518
|
-
return await ((d = (c = o(this,
|
|
1510
|
+
const _ = await o(this, Me).start();
|
|
1511
|
+
return await ((d = (c = o(this, B).config).onSuccess) == null ? void 0 : d.call(
|
|
1519
1512
|
c,
|
|
1520
|
-
|
|
1513
|
+
_,
|
|
1521
1514
|
e,
|
|
1522
1515
|
this.state.context,
|
|
1523
1516
|
this
|
|
1524
|
-
)), await ((
|
|
1525
|
-
|
|
1526
|
-
|
|
1517
|
+
)), await ((h = (f = this.options).onSuccess) == null ? void 0 : h.call(f, _, e, this.state.context)), await ((m = (y = o(this, B).config).onSettled) == null ? void 0 : m.call(
|
|
1518
|
+
y,
|
|
1519
|
+
_,
|
|
1527
1520
|
null,
|
|
1528
1521
|
this.state.variables,
|
|
1529
1522
|
this.state.context,
|
|
1530
1523
|
this
|
|
1531
|
-
)), await ((
|
|
1532
|
-
} catch (
|
|
1524
|
+
)), await ((g = (R = this.options).onSettled) == null ? void 0 : g.call(R, _, null, e, this.state.context)), P(this, ce, ge).call(this, { type: "success", data: _ }), _;
|
|
1525
|
+
} catch (_) {
|
|
1533
1526
|
try {
|
|
1534
|
-
throw await ((
|
|
1535
|
-
|
|
1536
|
-
|
|
1527
|
+
throw await ((T = (E = o(this, B).config).onError) == null ? void 0 : T.call(
|
|
1528
|
+
E,
|
|
1529
|
+
_,
|
|
1537
1530
|
e,
|
|
1538
1531
|
this.state.context,
|
|
1539
1532
|
this
|
|
1540
|
-
)), await ((j = (
|
|
1541
|
-
|
|
1542
|
-
|
|
1533
|
+
)), await ((j = (S = this.options).onError) == null ? void 0 : j.call(
|
|
1534
|
+
S,
|
|
1535
|
+
_,
|
|
1543
1536
|
e,
|
|
1544
1537
|
this.state.context
|
|
1545
|
-
)), await ((
|
|
1546
|
-
|
|
1538
|
+
)), await ((M = (L = o(this, B).config).onSettled) == null ? void 0 : M.call(
|
|
1539
|
+
L,
|
|
1547
1540
|
void 0,
|
|
1548
|
-
|
|
1541
|
+
_,
|
|
1549
1542
|
this.state.variables,
|
|
1550
1543
|
this.state.context,
|
|
1551
1544
|
this
|
|
1552
|
-
)), await ((
|
|
1553
|
-
|
|
1545
|
+
)), await ((U = (K = this.options).onSettled) == null ? void 0 : U.call(
|
|
1546
|
+
K,
|
|
1554
1547
|
void 0,
|
|
1555
|
-
|
|
1548
|
+
_,
|
|
1556
1549
|
e,
|
|
1557
1550
|
this.state.context
|
|
1558
|
-
)),
|
|
1551
|
+
)), _;
|
|
1559
1552
|
} finally {
|
|
1560
|
-
P(this,
|
|
1553
|
+
P(this, ce, ge).call(this, { type: "error", error: _ });
|
|
1561
1554
|
}
|
|
1562
1555
|
} finally {
|
|
1563
|
-
o(this,
|
|
1556
|
+
o(this, B).runNext(this);
|
|
1564
1557
|
}
|
|
1565
1558
|
}
|
|
1566
|
-
},
|
|
1559
|
+
}, ue = new WeakMap(), B = new WeakMap(), Me = new WeakMap(), ce = new WeakSet(), ge = function(e) {
|
|
1567
1560
|
const r = (n) => {
|
|
1568
1561
|
switch (e.type) {
|
|
1569
1562
|
case "failed":
|
|
@@ -1617,17 +1610,17 @@ var oe, Pn, ui = (Pn = class extends at {
|
|
|
1617
1610
|
};
|
|
1618
1611
|
}
|
|
1619
1612
|
};
|
|
1620
|
-
this.state = r(this.state),
|
|
1621
|
-
o(this,
|
|
1613
|
+
this.state = r(this.state), V.batch(() => {
|
|
1614
|
+
o(this, ue).forEach((n) => {
|
|
1622
1615
|
n.onMutationUpdate(e);
|
|
1623
|
-
}), o(this,
|
|
1616
|
+
}), o(this, B).notify({
|
|
1624
1617
|
mutation: this,
|
|
1625
1618
|
type: "updated",
|
|
1626
1619
|
action: e
|
|
1627
1620
|
});
|
|
1628
1621
|
});
|
|
1629
|
-
},
|
|
1630
|
-
function
|
|
1622
|
+
}, Tn);
|
|
1623
|
+
function Hn() {
|
|
1631
1624
|
return {
|
|
1632
1625
|
context: void 0,
|
|
1633
1626
|
data: void 0,
|
|
@@ -1640,26 +1633,26 @@ function zn() {
|
|
|
1640
1633
|
submittedAt: 0
|
|
1641
1634
|
};
|
|
1642
1635
|
}
|
|
1643
|
-
var
|
|
1636
|
+
var he, ne, Pt, xn, hi = (xn = class extends at {
|
|
1644
1637
|
constructor(e = {}) {
|
|
1645
1638
|
super();
|
|
1646
|
-
w(this,
|
|
1639
|
+
w(this, he);
|
|
1647
1640
|
w(this, ne);
|
|
1648
1641
|
w(this, Pt);
|
|
1649
|
-
this.config = e,
|
|
1642
|
+
this.config = e, b(this, he, /* @__PURE__ */ new Set()), b(this, ne, /* @__PURE__ */ new Map()), b(this, Pt, 0);
|
|
1650
1643
|
}
|
|
1651
1644
|
build(e, r, n) {
|
|
1652
|
-
const s = new
|
|
1645
|
+
const s = new fi({
|
|
1653
1646
|
mutationCache: this,
|
|
1654
|
-
mutationId: ++
|
|
1647
|
+
mutationId: ++kt(this, Pt)._,
|
|
1655
1648
|
options: e.defaultMutationOptions(r),
|
|
1656
1649
|
state: n
|
|
1657
1650
|
});
|
|
1658
1651
|
return this.add(s), s;
|
|
1659
1652
|
}
|
|
1660
1653
|
add(e) {
|
|
1661
|
-
o(this,
|
|
1662
|
-
const r =
|
|
1654
|
+
o(this, he).add(e);
|
|
1655
|
+
const r = _t(e);
|
|
1663
1656
|
if (typeof r == "string") {
|
|
1664
1657
|
const n = o(this, ne).get(r);
|
|
1665
1658
|
n ? n.push(e) : o(this, ne).set(r, [e]);
|
|
@@ -1667,8 +1660,8 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1667
1660
|
this.notify({ type: "added", mutation: e });
|
|
1668
1661
|
}
|
|
1669
1662
|
remove(e) {
|
|
1670
|
-
if (o(this,
|
|
1671
|
-
const r =
|
|
1663
|
+
if (o(this, he).delete(e)) {
|
|
1664
|
+
const r = _t(e);
|
|
1672
1665
|
if (typeof r == "string") {
|
|
1673
1666
|
const n = o(this, ne).get(r);
|
|
1674
1667
|
if (n)
|
|
@@ -1681,7 +1674,7 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1681
1674
|
this.notify({ type: "removed", mutation: e });
|
|
1682
1675
|
}
|
|
1683
1676
|
canRun(e) {
|
|
1684
|
-
const r =
|
|
1677
|
+
const r = _t(e);
|
|
1685
1678
|
if (typeof r == "string") {
|
|
1686
1679
|
const n = o(this, ne).get(r), s = n == null ? void 0 : n.find(
|
|
1687
1680
|
(a) => a.state.status === "pending"
|
|
@@ -1692,7 +1685,7 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1692
1685
|
}
|
|
1693
1686
|
runNext(e) {
|
|
1694
1687
|
var n;
|
|
1695
|
-
const r =
|
|
1688
|
+
const r = _t(e);
|
|
1696
1689
|
if (typeof r == "string") {
|
|
1697
1690
|
const s = (n = o(this, ne).get(r)) == null ? void 0 : n.find((a) => a !== e && a.state.isPaused);
|
|
1698
1691
|
return (s == null ? void 0 : s.continue()) ?? Promise.resolve();
|
|
@@ -1700,14 +1693,14 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1700
1693
|
return Promise.resolve();
|
|
1701
1694
|
}
|
|
1702
1695
|
clear() {
|
|
1703
|
-
|
|
1704
|
-
o(this,
|
|
1696
|
+
V.batch(() => {
|
|
1697
|
+
o(this, he).forEach((e) => {
|
|
1705
1698
|
this.notify({ type: "removed", mutation: e });
|
|
1706
|
-
}), o(this,
|
|
1699
|
+
}), o(this, he).clear(), o(this, ne).clear();
|
|
1707
1700
|
});
|
|
1708
1701
|
}
|
|
1709
1702
|
getAll() {
|
|
1710
|
-
return Array.from(o(this,
|
|
1703
|
+
return Array.from(o(this, he));
|
|
1711
1704
|
}
|
|
1712
1705
|
find(e) {
|
|
1713
1706
|
const r = { exact: !0, ...e };
|
|
@@ -1719,7 +1712,7 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1719
1712
|
return this.getAll().filter((r) => tn(e, r));
|
|
1720
1713
|
}
|
|
1721
1714
|
notify(e) {
|
|
1722
|
-
|
|
1715
|
+
V.batch(() => {
|
|
1723
1716
|
this.listeners.forEach((r) => {
|
|
1724
1717
|
r(e);
|
|
1725
1718
|
});
|
|
@@ -1727,74 +1720,74 @@ var fe, ne, Pt, Cn, li = (Cn = class extends at {
|
|
|
1727
1720
|
}
|
|
1728
1721
|
resumePausedMutations() {
|
|
1729
1722
|
const e = this.getAll().filter((r) => r.state.isPaused);
|
|
1730
|
-
return
|
|
1723
|
+
return V.batch(
|
|
1731
1724
|
() => Promise.all(
|
|
1732
1725
|
e.map((r) => r.continue().catch(te))
|
|
1733
1726
|
)
|
|
1734
1727
|
);
|
|
1735
1728
|
}
|
|
1736
|
-
},
|
|
1737
|
-
function
|
|
1729
|
+
}, he = new WeakMap(), ne = new WeakMap(), Pt = new WeakMap(), xn);
|
|
1730
|
+
function _t(t) {
|
|
1738
1731
|
var e;
|
|
1739
1732
|
return (e = t.options.scope) == null ? void 0 : e.id;
|
|
1740
1733
|
}
|
|
1741
1734
|
function sn(t) {
|
|
1742
1735
|
return {
|
|
1743
1736
|
onFetch: (e, r) => {
|
|
1744
|
-
var
|
|
1745
|
-
const n = e.options, s = (
|
|
1737
|
+
var f, h, y, m, R;
|
|
1738
|
+
const n = e.options, s = (y = (h = (f = e.fetchOptions) == null ? void 0 : f.meta) == null ? void 0 : h.fetchMore) == null ? void 0 : y.direction, a = ((m = e.state.data) == null ? void 0 : m.pages) || [], u = ((R = e.state.data) == null ? void 0 : R.pageParams) || [];
|
|
1746
1739
|
let l = { pages: [], pageParams: [] }, c = 0;
|
|
1747
1740
|
const d = async () => {
|
|
1748
|
-
let
|
|
1749
|
-
const
|
|
1741
|
+
let g = !1;
|
|
1742
|
+
const E = (j) => {
|
|
1750
1743
|
Object.defineProperty(j, "signal", {
|
|
1751
1744
|
enumerable: !0,
|
|
1752
|
-
get: () => (e.signal.aborted ?
|
|
1753
|
-
|
|
1745
|
+
get: () => (e.signal.aborted ? g = !0 : e.signal.addEventListener("abort", () => {
|
|
1746
|
+
g = !0;
|
|
1754
1747
|
}), e.signal)
|
|
1755
1748
|
});
|
|
1756
|
-
},
|
|
1757
|
-
if (
|
|
1749
|
+
}, T = Qn(e.options, e.fetchOptions), S = async (j, L, M) => {
|
|
1750
|
+
if (g)
|
|
1758
1751
|
return Promise.reject();
|
|
1759
|
-
if (
|
|
1752
|
+
if (L == null && j.pages.length)
|
|
1760
1753
|
return Promise.resolve(j);
|
|
1761
|
-
const
|
|
1754
|
+
const K = {
|
|
1762
1755
|
client: e.client,
|
|
1763
1756
|
queryKey: e.queryKey,
|
|
1764
|
-
pageParam:
|
|
1765
|
-
direction:
|
|
1757
|
+
pageParam: L,
|
|
1758
|
+
direction: M ? "backward" : "forward",
|
|
1766
1759
|
meta: e.options.meta
|
|
1767
1760
|
};
|
|
1768
|
-
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1771
|
-
), { maxPages:
|
|
1761
|
+
E(K);
|
|
1762
|
+
const U = await T(
|
|
1763
|
+
K
|
|
1764
|
+
), { maxPages: _ } = e.options, I = M ? ni : ri;
|
|
1772
1765
|
return {
|
|
1773
|
-
pages:
|
|
1774
|
-
pageParams:
|
|
1766
|
+
pages: I(j.pages, U, _),
|
|
1767
|
+
pageParams: I(j.pageParams, L, _)
|
|
1775
1768
|
};
|
|
1776
1769
|
};
|
|
1777
1770
|
if (s && a.length) {
|
|
1778
|
-
const j = s === "backward",
|
|
1771
|
+
const j = s === "backward", L = j ? di : on, M = {
|
|
1779
1772
|
pages: a,
|
|
1780
1773
|
pageParams: u
|
|
1781
|
-
},
|
|
1782
|
-
l = await
|
|
1774
|
+
}, K = L(n, M);
|
|
1775
|
+
l = await S(M, K, j);
|
|
1783
1776
|
} else {
|
|
1784
1777
|
const j = t ?? a.length;
|
|
1785
1778
|
do {
|
|
1786
|
-
const
|
|
1787
|
-
if (c > 0 &&
|
|
1779
|
+
const L = c === 0 ? u[0] ?? n.initialPageParam : on(n, l);
|
|
1780
|
+
if (c > 0 && L == null)
|
|
1788
1781
|
break;
|
|
1789
|
-
l = await
|
|
1782
|
+
l = await S(l, L), c++;
|
|
1790
1783
|
} while (c < j);
|
|
1791
1784
|
}
|
|
1792
1785
|
return l;
|
|
1793
1786
|
};
|
|
1794
1787
|
e.options.persister ? e.fetchFn = () => {
|
|
1795
|
-
var
|
|
1796
|
-
return (
|
|
1797
|
-
|
|
1788
|
+
var g, E;
|
|
1789
|
+
return (E = (g = e.options).persister) == null ? void 0 : E.call(
|
|
1790
|
+
g,
|
|
1798
1791
|
d,
|
|
1799
1792
|
{
|
|
1800
1793
|
client: e.client,
|
|
@@ -1817,13 +1810,13 @@ function on(t, { pages: e, pageParams: r }) {
|
|
|
1817
1810
|
r
|
|
1818
1811
|
) : void 0;
|
|
1819
1812
|
}
|
|
1820
|
-
function
|
|
1813
|
+
function di(t, { pages: e, pageParams: r }) {
|
|
1821
1814
|
var n;
|
|
1822
1815
|
return e.length > 0 ? (n = t.getPreviousPageParam) == null ? void 0 : n.call(t, e[0], e, r[0], r) : void 0;
|
|
1823
1816
|
}
|
|
1824
|
-
var
|
|
1817
|
+
var N, we, Ee, Xe, Ze, Re, et, tt, Fn, yi = (Fn = class {
|
|
1825
1818
|
constructor(t = {}) {
|
|
1826
|
-
w(this,
|
|
1819
|
+
w(this, N);
|
|
1827
1820
|
w(this, we);
|
|
1828
1821
|
w(this, Ee);
|
|
1829
1822
|
w(this, Xe);
|
|
@@ -1831,21 +1824,21 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1831
1824
|
w(this, Re);
|
|
1832
1825
|
w(this, et);
|
|
1833
1826
|
w(this, tt);
|
|
1834
|
-
|
|
1827
|
+
b(this, N, t.queryCache || new li()), b(this, we, t.mutationCache || new hi()), b(this, Ee, t.defaultOptions || {}), b(this, Xe, /* @__PURE__ */ new Map()), b(this, Ze, /* @__PURE__ */ new Map()), b(this, Re, 0);
|
|
1835
1828
|
}
|
|
1836
1829
|
mount() {
|
|
1837
|
-
|
|
1838
|
-
t && (await this.resumePausedMutations(), o(this,
|
|
1839
|
-
})),
|
|
1840
|
-
t && (await this.resumePausedMutations(), o(this,
|
|
1830
|
+
kt(this, Re)._++, o(this, Re) === 1 && (b(this, et, Sr.subscribe(async (t) => {
|
|
1831
|
+
t && (await this.resumePausedMutations(), o(this, N).onFocus());
|
|
1832
|
+
})), b(this, tt, Nt.subscribe(async (t) => {
|
|
1833
|
+
t && (await this.resumePausedMutations(), o(this, N).onOnline());
|
|
1841
1834
|
})));
|
|
1842
1835
|
}
|
|
1843
1836
|
unmount() {
|
|
1844
1837
|
var t, e;
|
|
1845
|
-
|
|
1838
|
+
kt(this, Re)._--, o(this, Re) === 0 && ((t = o(this, et)) == null || t.call(this), b(this, et, void 0), (e = o(this, tt)) == null || e.call(this), b(this, tt, void 0));
|
|
1846
1839
|
}
|
|
1847
1840
|
isFetching(t) {
|
|
1848
|
-
return o(this,
|
|
1841
|
+
return o(this, N).findAll({ ...t, fetchStatus: "fetching" }).length;
|
|
1849
1842
|
}
|
|
1850
1843
|
isMutating(t) {
|
|
1851
1844
|
return o(this, we).findAll({ ...t, status: "pending" }).length;
|
|
@@ -1853,28 +1846,28 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1853
1846
|
getQueryData(t) {
|
|
1854
1847
|
var r;
|
|
1855
1848
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1856
|
-
return (r = o(this,
|
|
1849
|
+
return (r = o(this, N).get(e.queryHash)) == null ? void 0 : r.state.data;
|
|
1857
1850
|
}
|
|
1858
1851
|
ensureQueryData(t) {
|
|
1859
|
-
const e = this.defaultQueryOptions(t), r = o(this,
|
|
1860
|
-
return n === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && r.isStaleByTime(
|
|
1852
|
+
const e = this.defaultQueryOptions(t), r = o(this, N).build(this, e), n = r.state.data;
|
|
1853
|
+
return n === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && r.isStaleByTime(We(e.staleTime, r)) && this.prefetchQuery(e), Promise.resolve(n));
|
|
1861
1854
|
}
|
|
1862
1855
|
getQueriesData(t) {
|
|
1863
|
-
return o(this,
|
|
1856
|
+
return o(this, N).findAll(t).map(({ queryKey: e, state: r }) => {
|
|
1864
1857
|
const n = r.data;
|
|
1865
1858
|
return [e, n];
|
|
1866
1859
|
});
|
|
1867
1860
|
}
|
|
1868
1861
|
setQueryData(t, e, r) {
|
|
1869
|
-
const n = this.defaultQueryOptions({ queryKey: t }), s = o(this,
|
|
1862
|
+
const n = this.defaultQueryOptions({ queryKey: t }), s = o(this, N).get(
|
|
1870
1863
|
n.queryHash
|
|
1871
|
-
), a = s == null ? void 0 : s.state.data, u =
|
|
1864
|
+
), a = s == null ? void 0 : s.state.data, u = ei(e, a);
|
|
1872
1865
|
if (u !== void 0)
|
|
1873
|
-
return o(this,
|
|
1866
|
+
return o(this, N).build(this, n).setData(u, { ...r, manual: !0 });
|
|
1874
1867
|
}
|
|
1875
1868
|
setQueriesData(t, e, r) {
|
|
1876
|
-
return
|
|
1877
|
-
() => o(this,
|
|
1869
|
+
return V.batch(
|
|
1870
|
+
() => o(this, N).findAll(t).map(({ queryKey: n }) => [
|
|
1878
1871
|
n,
|
|
1879
1872
|
this.setQueryData(n, e, r)
|
|
1880
1873
|
])
|
|
@@ -1883,21 +1876,21 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1883
1876
|
getQueryState(t) {
|
|
1884
1877
|
var r;
|
|
1885
1878
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1886
|
-
return (r = o(this,
|
|
1879
|
+
return (r = o(this, N).get(
|
|
1887
1880
|
e.queryHash
|
|
1888
1881
|
)) == null ? void 0 : r.state;
|
|
1889
1882
|
}
|
|
1890
1883
|
removeQueries(t) {
|
|
1891
|
-
const e = o(this,
|
|
1892
|
-
|
|
1884
|
+
const e = o(this, N);
|
|
1885
|
+
V.batch(() => {
|
|
1893
1886
|
e.findAll(t).forEach((r) => {
|
|
1894
1887
|
e.remove(r);
|
|
1895
1888
|
});
|
|
1896
1889
|
});
|
|
1897
1890
|
}
|
|
1898
1891
|
resetQueries(t, e) {
|
|
1899
|
-
const r = o(this,
|
|
1900
|
-
return
|
|
1892
|
+
const r = o(this, N);
|
|
1893
|
+
return V.batch(() => (r.findAll(t).forEach((n) => {
|
|
1901
1894
|
n.reset();
|
|
1902
1895
|
}), this.refetchQueries(
|
|
1903
1896
|
{
|
|
@@ -1908,13 +1901,13 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1908
1901
|
)));
|
|
1909
1902
|
}
|
|
1910
1903
|
cancelQueries(t, e = {}) {
|
|
1911
|
-
const r = { revert: !0, ...e }, n =
|
|
1912
|
-
() => o(this,
|
|
1904
|
+
const r = { revert: !0, ...e }, n = V.batch(
|
|
1905
|
+
() => o(this, N).findAll(t).map((s) => s.cancel(r))
|
|
1913
1906
|
);
|
|
1914
1907
|
return Promise.all(n).then(te).catch(te);
|
|
1915
1908
|
}
|
|
1916
1909
|
invalidateQueries(t, e = {}) {
|
|
1917
|
-
return
|
|
1910
|
+
return V.batch(() => (o(this, N).findAll(t).forEach((r) => {
|
|
1918
1911
|
r.invalidate();
|
|
1919
1912
|
}), (t == null ? void 0 : t.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
1920
1913
|
{
|
|
@@ -1928,8 +1921,8 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1928
1921
|
const r = {
|
|
1929
1922
|
...e,
|
|
1930
1923
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
1931
|
-
}, n =
|
|
1932
|
-
() => o(this,
|
|
1924
|
+
}, n = V.batch(
|
|
1925
|
+
() => o(this, N).findAll(t).filter((s) => !s.isDisabled()).map((s) => {
|
|
1933
1926
|
let a = s.fetch(void 0, r);
|
|
1934
1927
|
return r.throwOnError || (a = a.catch(te)), s.state.fetchStatus === "paused" ? Promise.resolve() : a;
|
|
1935
1928
|
})
|
|
@@ -1939,9 +1932,9 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1939
1932
|
fetchQuery(t) {
|
|
1940
1933
|
const e = this.defaultQueryOptions(t);
|
|
1941
1934
|
e.retry === void 0 && (e.retry = !1);
|
|
1942
|
-
const r = o(this,
|
|
1935
|
+
const r = o(this, N).build(this, e);
|
|
1943
1936
|
return r.isStaleByTime(
|
|
1944
|
-
|
|
1937
|
+
We(e.staleTime, r)
|
|
1945
1938
|
) ? r.fetch(e) : Promise.resolve(r.state.data);
|
|
1946
1939
|
}
|
|
1947
1940
|
prefetchQuery(t) {
|
|
@@ -1960,7 +1953,7 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1960
1953
|
return Nt.isOnline() ? o(this, we).resumePausedMutations() : Promise.resolve();
|
|
1961
1954
|
}
|
|
1962
1955
|
getQueryCache() {
|
|
1963
|
-
return o(this,
|
|
1956
|
+
return o(this, N);
|
|
1964
1957
|
}
|
|
1965
1958
|
getMutationCache() {
|
|
1966
1959
|
return o(this, we);
|
|
@@ -1969,7 +1962,7 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
1969
1962
|
return o(this, Ee);
|
|
1970
1963
|
}
|
|
1971
1964
|
setDefaultOptions(t) {
|
|
1972
|
-
|
|
1965
|
+
b(this, Ee, t);
|
|
1973
1966
|
}
|
|
1974
1967
|
setQueryDefaults(t, e) {
|
|
1975
1968
|
o(this, Xe).set($e(t), {
|
|
@@ -2007,7 +2000,7 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2007
2000
|
return e.queryHash || (e.queryHash = Pr(
|
|
2008
2001
|
e.queryKey,
|
|
2009
2002
|
e
|
|
2010
|
-
)), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn ===
|
|
2003
|
+
)), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === Ut && (e.enabled = !1), e;
|
|
2011
2004
|
}
|
|
2012
2005
|
defaultMutationOptions(t) {
|
|
2013
2006
|
return t != null && t._defaulted ? t : {
|
|
@@ -2018,20 +2011,20 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2018
2011
|
};
|
|
2019
2012
|
}
|
|
2020
2013
|
clear() {
|
|
2021
|
-
o(this,
|
|
2014
|
+
o(this, N).clear(), o(this, we).clear();
|
|
2022
2015
|
}
|
|
2023
|
-
},
|
|
2016
|
+
}, N = new WeakMap(), we = new WeakMap(), Ee = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Re = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), Fn), J, x, St, G, Ue, rt, Oe, le, Ct, nt, st, Ne, Le, Pe, it, k, pt, cr, lr, fr, hr, dr, yr, pr, Bn, An, pi = (An = class extends at {
|
|
2024
2017
|
constructor(e, r) {
|
|
2025
2018
|
super();
|
|
2026
|
-
w(this,
|
|
2027
|
-
w(this,
|
|
2028
|
-
w(this,
|
|
2019
|
+
w(this, k);
|
|
2020
|
+
w(this, J);
|
|
2021
|
+
w(this, x);
|
|
2029
2022
|
w(this, St);
|
|
2030
|
-
w(this,
|
|
2031
|
-
w(this,
|
|
2023
|
+
w(this, G);
|
|
2024
|
+
w(this, Ue);
|
|
2032
2025
|
w(this, rt);
|
|
2033
2026
|
w(this, Oe);
|
|
2034
|
-
w(this,
|
|
2027
|
+
w(this, le);
|
|
2035
2028
|
w(this, Ct);
|
|
2036
2029
|
w(this, nt);
|
|
2037
2030
|
// This property keeps track of the last query with defined data.
|
|
@@ -2041,7 +2034,7 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2041
2034
|
w(this, Le);
|
|
2042
2035
|
w(this, Pe);
|
|
2043
2036
|
w(this, it, /* @__PURE__ */ new Set());
|
|
2044
|
-
this.options = r,
|
|
2037
|
+
this.options = r, b(this, J, e), b(this, le, null), b(this, Oe, ur()), this.options.experimental_prefetchInRender || o(this, Oe).reject(
|
|
2045
2038
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
2046
2039
|
), this.bindMethods(), this.setOptions(r);
|
|
2047
2040
|
}
|
|
@@ -2049,55 +2042,55 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2049
2042
|
this.refetch = this.refetch.bind(this);
|
|
2050
2043
|
}
|
|
2051
2044
|
onSubscribe() {
|
|
2052
|
-
this.listeners.size === 1 && (o(this,
|
|
2045
|
+
this.listeners.size === 1 && (o(this, x).addObserver(this), an(o(this, x), this.options) ? P(this, k, pt).call(this) : this.updateResult(), P(this, k, hr).call(this));
|
|
2053
2046
|
}
|
|
2054
2047
|
onUnsubscribe() {
|
|
2055
2048
|
this.hasListeners() || this.destroy();
|
|
2056
2049
|
}
|
|
2057
2050
|
shouldFetchOnReconnect() {
|
|
2058
2051
|
return mr(
|
|
2059
|
-
o(this,
|
|
2052
|
+
o(this, x),
|
|
2060
2053
|
this.options,
|
|
2061
2054
|
this.options.refetchOnReconnect
|
|
2062
2055
|
);
|
|
2063
2056
|
}
|
|
2064
2057
|
shouldFetchOnWindowFocus() {
|
|
2065
2058
|
return mr(
|
|
2066
|
-
o(this,
|
|
2059
|
+
o(this, x),
|
|
2067
2060
|
this.options,
|
|
2068
2061
|
this.options.refetchOnWindowFocus
|
|
2069
2062
|
);
|
|
2070
2063
|
}
|
|
2071
2064
|
destroy() {
|
|
2072
|
-
this.listeners = /* @__PURE__ */ new Set(), P(this,
|
|
2065
|
+
this.listeners = /* @__PURE__ */ new Set(), P(this, k, dr).call(this), P(this, k, yr).call(this), o(this, x).removeObserver(this);
|
|
2073
2066
|
}
|
|
2074
2067
|
setOptions(e, r) {
|
|
2075
|
-
const n = this.options, s = o(this,
|
|
2076
|
-
if (this.options = o(this,
|
|
2068
|
+
const n = this.options, s = o(this, x);
|
|
2069
|
+
if (this.options = o(this, J).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof se(this.options.enabled, o(this, x)) != "boolean")
|
|
2077
2070
|
throw new Error(
|
|
2078
2071
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
2079
2072
|
);
|
|
2080
|
-
P(this,
|
|
2073
|
+
P(this, k, pr).call(this), o(this, x).setOptions(this.options), n._defaulted && !Mt(this.options, n) && o(this, J).getQueryCache().notify({
|
|
2081
2074
|
type: "observerOptionsUpdated",
|
|
2082
|
-
query: o(this,
|
|
2075
|
+
query: o(this, x),
|
|
2083
2076
|
observer: this
|
|
2084
2077
|
});
|
|
2085
2078
|
const a = this.hasListeners();
|
|
2086
2079
|
a && un(
|
|
2087
|
-
o(this,
|
|
2080
|
+
o(this, x),
|
|
2088
2081
|
s,
|
|
2089
2082
|
this.options,
|
|
2090
2083
|
n
|
|
2091
|
-
) && P(this,
|
|
2092
|
-
const u = P(this,
|
|
2093
|
-
a && (o(this,
|
|
2084
|
+
) && P(this, k, pt).call(this), this.updateResult(r), a && (o(this, x) !== s || se(this.options.enabled, o(this, x)) !== se(n.enabled, o(this, x)) || We(this.options.staleTime, o(this, x)) !== We(n.staleTime, o(this, x))) && P(this, k, cr).call(this);
|
|
2085
|
+
const u = P(this, k, lr).call(this);
|
|
2086
|
+
a && (o(this, x) !== s || se(this.options.enabled, o(this, x)) !== se(n.enabled, o(this, x)) || u !== o(this, Pe)) && P(this, k, fr).call(this, u);
|
|
2094
2087
|
}
|
|
2095
2088
|
getOptimisticResult(e) {
|
|
2096
|
-
const r = o(this,
|
|
2097
|
-
return
|
|
2089
|
+
const r = o(this, J).getQueryCache().build(o(this, J), e), n = this.createResult(r, e);
|
|
2090
|
+
return gi(this, n) && (b(this, G, n), b(this, rt, this.options), b(this, Ue, o(this, x).state)), n;
|
|
2098
2091
|
}
|
|
2099
2092
|
getCurrentResult() {
|
|
2100
|
-
return o(this,
|
|
2093
|
+
return o(this, G);
|
|
2101
2094
|
}
|
|
2102
2095
|
trackResult(e, r) {
|
|
2103
2096
|
const n = {};
|
|
@@ -2113,7 +2106,7 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2113
2106
|
o(this, it).add(e);
|
|
2114
2107
|
}
|
|
2115
2108
|
getCurrentQuery() {
|
|
2116
|
-
return o(this,
|
|
2109
|
+
return o(this, x);
|
|
2117
2110
|
}
|
|
2118
2111
|
refetch({ ...e } = {}) {
|
|
2119
2112
|
return this.fetch({
|
|
@@ -2121,111 +2114,111 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2121
2114
|
});
|
|
2122
2115
|
}
|
|
2123
2116
|
fetchOptimistic(e) {
|
|
2124
|
-
const r = o(this,
|
|
2117
|
+
const r = o(this, J).defaultQueryOptions(e), n = o(this, J).getQueryCache().build(o(this, J), r);
|
|
2125
2118
|
return n.fetch().then(() => this.createResult(n, r));
|
|
2126
2119
|
}
|
|
2127
2120
|
fetch(e) {
|
|
2128
|
-
return P(this,
|
|
2121
|
+
return P(this, k, pt).call(this, {
|
|
2129
2122
|
...e,
|
|
2130
2123
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
2131
|
-
}).then(() => (this.updateResult(), o(this,
|
|
2124
|
+
}).then(() => (this.updateResult(), o(this, G)));
|
|
2132
2125
|
}
|
|
2133
2126
|
createResult(e, r) {
|
|
2134
|
-
var
|
|
2135
|
-
const n = o(this,
|
|
2136
|
-
let
|
|
2127
|
+
var _;
|
|
2128
|
+
const n = o(this, x), s = this.options, a = o(this, G), u = o(this, Ue), l = o(this, rt), d = e !== n ? e.state : o(this, St), { state: f } = e;
|
|
2129
|
+
let h = { ...f }, y = !1, m;
|
|
2137
2130
|
if (r._optimisticResults) {
|
|
2138
|
-
const
|
|
2139
|
-
(
|
|
2140
|
-
...
|
|
2141
|
-
...
|
|
2142
|
-
}), r._optimisticResults === "isRestoring" && (
|
|
2131
|
+
const I = this.hasListeners(), ie = !I && an(e, r), pe = I && un(e, n, r, s);
|
|
2132
|
+
(ie || pe) && (h = {
|
|
2133
|
+
...h,
|
|
2134
|
+
...Wn(f.data, e.options)
|
|
2135
|
+
}), r._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
|
|
2143
2136
|
}
|
|
2144
|
-
let { error: R, errorUpdatedAt:
|
|
2145
|
-
if (r.select &&
|
|
2146
|
-
if (a &&
|
|
2137
|
+
let { error: R, errorUpdatedAt: g, status: E } = h;
|
|
2138
|
+
if (r.select && h.data !== void 0)
|
|
2139
|
+
if (a && h.data === (u == null ? void 0 : u.data) && r.select === o(this, Ct))
|
|
2147
2140
|
m = o(this, nt);
|
|
2148
2141
|
else
|
|
2149
2142
|
try {
|
|
2150
|
-
|
|
2151
|
-
} catch (
|
|
2152
|
-
|
|
2143
|
+
b(this, Ct, r.select), m = r.select(h.data), m = ar(a == null ? void 0 : a.data, m, r), b(this, nt, m), b(this, le, null);
|
|
2144
|
+
} catch (I) {
|
|
2145
|
+
b(this, le, I);
|
|
2153
2146
|
}
|
|
2154
2147
|
else
|
|
2155
|
-
m =
|
|
2156
|
-
if (r.placeholderData !== void 0 && m === void 0 &&
|
|
2157
|
-
let
|
|
2148
|
+
m = h.data;
|
|
2149
|
+
if (r.placeholderData !== void 0 && m === void 0 && E === "pending") {
|
|
2150
|
+
let I;
|
|
2158
2151
|
if (a != null && a.isPlaceholderData && r.placeholderData === (l == null ? void 0 : l.placeholderData))
|
|
2159
|
-
|
|
2160
|
-
else if (
|
|
2161
|
-
(
|
|
2152
|
+
I = a.data;
|
|
2153
|
+
else if (I = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
2154
|
+
(_ = o(this, st)) == null ? void 0 : _.state.data,
|
|
2162
2155
|
o(this, st)
|
|
2163
|
-
) : r.placeholderData, r.select &&
|
|
2156
|
+
) : r.placeholderData, r.select && I !== void 0)
|
|
2164
2157
|
try {
|
|
2165
|
-
|
|
2166
|
-
} catch (
|
|
2167
|
-
|
|
2158
|
+
I = r.select(I), b(this, le, null);
|
|
2159
|
+
} catch (ie) {
|
|
2160
|
+
b(this, le, ie);
|
|
2168
2161
|
}
|
|
2169
|
-
|
|
2162
|
+
I !== void 0 && (E = "success", m = ar(
|
|
2170
2163
|
a == null ? void 0 : a.data,
|
|
2171
|
-
|
|
2164
|
+
I,
|
|
2172
2165
|
r
|
|
2173
|
-
),
|
|
2166
|
+
), y = !0);
|
|
2174
2167
|
}
|
|
2175
|
-
o(this,
|
|
2176
|
-
const
|
|
2177
|
-
status:
|
|
2178
|
-
fetchStatus:
|
|
2179
|
-
isPending:
|
|
2180
|
-
isSuccess:
|
|
2168
|
+
o(this, le) && (R = o(this, le), m = o(this, nt), g = Date.now(), E = "error");
|
|
2169
|
+
const T = h.fetchStatus === "fetching", S = E === "pending", j = E === "error", L = S && T, M = m !== void 0, U = {
|
|
2170
|
+
status: E,
|
|
2171
|
+
fetchStatus: h.fetchStatus,
|
|
2172
|
+
isPending: S,
|
|
2173
|
+
isSuccess: E === "success",
|
|
2181
2174
|
isError: j,
|
|
2182
|
-
isInitialLoading:
|
|
2183
|
-
isLoading:
|
|
2175
|
+
isInitialLoading: L,
|
|
2176
|
+
isLoading: L,
|
|
2184
2177
|
data: m,
|
|
2185
|
-
dataUpdatedAt:
|
|
2178
|
+
dataUpdatedAt: h.dataUpdatedAt,
|
|
2186
2179
|
error: R,
|
|
2187
|
-
errorUpdatedAt:
|
|
2188
|
-
failureCount:
|
|
2189
|
-
failureReason:
|
|
2190
|
-
errorUpdateCount:
|
|
2191
|
-
isFetched:
|
|
2192
|
-
isFetchedAfterMount:
|
|
2193
|
-
isFetching:
|
|
2194
|
-
isRefetching:
|
|
2195
|
-
isLoadingError: j && !
|
|
2196
|
-
isPaused:
|
|
2197
|
-
isPlaceholderData:
|
|
2198
|
-
isRefetchError: j &&
|
|
2180
|
+
errorUpdatedAt: g,
|
|
2181
|
+
failureCount: h.fetchFailureCount,
|
|
2182
|
+
failureReason: h.fetchFailureReason,
|
|
2183
|
+
errorUpdateCount: h.errorUpdateCount,
|
|
2184
|
+
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
|
|
2185
|
+
isFetchedAfterMount: h.dataUpdateCount > d.dataUpdateCount || h.errorUpdateCount > d.errorUpdateCount,
|
|
2186
|
+
isFetching: T,
|
|
2187
|
+
isRefetching: T && !S,
|
|
2188
|
+
isLoadingError: j && !M,
|
|
2189
|
+
isPaused: h.fetchStatus === "paused",
|
|
2190
|
+
isPlaceholderData: y,
|
|
2191
|
+
isRefetchError: j && M,
|
|
2199
2192
|
isStale: Cr(e, r),
|
|
2200
2193
|
refetch: this.refetch,
|
|
2201
2194
|
promise: o(this, Oe)
|
|
2202
2195
|
};
|
|
2203
2196
|
if (this.options.experimental_prefetchInRender) {
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2206
|
-
},
|
|
2207
|
-
const Fe =
|
|
2208
|
-
|
|
2197
|
+
const I = (Fe) => {
|
|
2198
|
+
U.status === "error" ? Fe.reject(U.error) : U.data !== void 0 && Fe.resolve(U.data);
|
|
2199
|
+
}, ie = () => {
|
|
2200
|
+
const Fe = b(this, Oe, U.promise = ur());
|
|
2201
|
+
I(Fe);
|
|
2209
2202
|
}, pe = o(this, Oe);
|
|
2210
2203
|
switch (pe.status) {
|
|
2211
2204
|
case "pending":
|
|
2212
|
-
e.queryHash === n.queryHash &&
|
|
2205
|
+
e.queryHash === n.queryHash && I(pe);
|
|
2213
2206
|
break;
|
|
2214
2207
|
case "fulfilled":
|
|
2215
|
-
(
|
|
2208
|
+
(U.status === "error" || U.data !== pe.value) && ie();
|
|
2216
2209
|
break;
|
|
2217
2210
|
case "rejected":
|
|
2218
|
-
(
|
|
2211
|
+
(U.status !== "error" || U.error !== pe.reason) && ie();
|
|
2219
2212
|
break;
|
|
2220
2213
|
}
|
|
2221
2214
|
}
|
|
2222
|
-
return
|
|
2215
|
+
return U;
|
|
2223
2216
|
}
|
|
2224
2217
|
updateResult(e) {
|
|
2225
|
-
const r = o(this,
|
|
2226
|
-
if (
|
|
2218
|
+
const r = o(this, G), n = this.createResult(o(this, x), this.options);
|
|
2219
|
+
if (b(this, Ue, o(this, x).state), b(this, rt, this.options), o(this, Ue).data !== void 0 && b(this, st, o(this, x)), Mt(n, r))
|
|
2227
2220
|
return;
|
|
2228
|
-
|
|
2221
|
+
b(this, G, n);
|
|
2229
2222
|
const s = {}, a = () => {
|
|
2230
2223
|
if (!r)
|
|
2231
2224
|
return !0;
|
|
@@ -2235,68 +2228,68 @@ var U, we, Ee, Xe, Ze, Re, et, tt, Tn, hi = (Tn = class {
|
|
|
2235
2228
|
const c = new Set(
|
|
2236
2229
|
l ?? o(this, it)
|
|
2237
2230
|
);
|
|
2238
|
-
return this.options.throwOnError && c.add("error"), Object.keys(o(this,
|
|
2239
|
-
const
|
|
2240
|
-
return o(this,
|
|
2231
|
+
return this.options.throwOnError && c.add("error"), Object.keys(o(this, G)).some((d) => {
|
|
2232
|
+
const f = d;
|
|
2233
|
+
return o(this, G)[f] !== r[f] && c.has(f);
|
|
2241
2234
|
});
|
|
2242
2235
|
};
|
|
2243
|
-
(e == null ? void 0 : e.listeners) !== !1 && a() && (s.listeners = !0), P(this,
|
|
2236
|
+
(e == null ? void 0 : e.listeners) !== !1 && a() && (s.listeners = !0), P(this, k, Bn).call(this, { ...s, ...e });
|
|
2244
2237
|
}
|
|
2245
2238
|
onQueryUpdate() {
|
|
2246
|
-
this.updateResult(), this.hasListeners() && P(this,
|
|
2239
|
+
this.updateResult(), this.hasListeners() && P(this, k, hr).call(this);
|
|
2247
2240
|
}
|
|
2248
|
-
},
|
|
2249
|
-
P(this,
|
|
2250
|
-
let r = o(this,
|
|
2241
|
+
}, J = new WeakMap(), x = new WeakMap(), St = new WeakMap(), G = new WeakMap(), Ue = new WeakMap(), rt = new WeakMap(), Oe = new WeakMap(), le = new WeakMap(), Ct = new WeakMap(), nt = new WeakMap(), st = new WeakMap(), Ne = new WeakMap(), Le = new WeakMap(), Pe = new WeakMap(), it = new WeakMap(), k = new WeakSet(), pt = function(e) {
|
|
2242
|
+
P(this, k, pr).call(this);
|
|
2243
|
+
let r = o(this, x).fetch(
|
|
2251
2244
|
this.options,
|
|
2252
2245
|
e
|
|
2253
2246
|
);
|
|
2254
2247
|
return e != null && e.throwOnError || (r = r.catch(te)), r;
|
|
2255
2248
|
}, cr = function() {
|
|
2256
|
-
P(this,
|
|
2257
|
-
const e =
|
|
2249
|
+
P(this, k, dr).call(this);
|
|
2250
|
+
const e = We(
|
|
2258
2251
|
this.options.staleTime,
|
|
2259
|
-
o(this,
|
|
2252
|
+
o(this, x)
|
|
2260
2253
|
);
|
|
2261
|
-
if (Qe || o(this,
|
|
2254
|
+
if (Qe || o(this, G).isStale || !sr(e))
|
|
2262
2255
|
return;
|
|
2263
|
-
const n =
|
|
2264
|
-
|
|
2265
|
-
o(this,
|
|
2256
|
+
const n = Ln(o(this, G).dataUpdatedAt, e) + 1;
|
|
2257
|
+
b(this, Ne, setTimeout(() => {
|
|
2258
|
+
o(this, G).isStale || this.updateResult();
|
|
2266
2259
|
}, n));
|
|
2267
2260
|
}, lr = function() {
|
|
2268
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(o(this,
|
|
2261
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(o(this, x)) : this.options.refetchInterval) ?? !1;
|
|
2269
2262
|
}, fr = function(e) {
|
|
2270
|
-
P(this,
|
|
2271
|
-
(this.options.refetchIntervalInBackground || Sr.isFocused()) && P(this,
|
|
2263
|
+
P(this, k, yr).call(this), b(this, Pe, e), !(Qe || se(this.options.enabled, o(this, x)) === !1 || !sr(o(this, Pe)) || o(this, Pe) === 0) && b(this, Le, setInterval(() => {
|
|
2264
|
+
(this.options.refetchIntervalInBackground || Sr.isFocused()) && P(this, k, pt).call(this);
|
|
2272
2265
|
}, o(this, Pe)));
|
|
2273
2266
|
}, hr = function() {
|
|
2274
|
-
P(this,
|
|
2267
|
+
P(this, k, cr).call(this), P(this, k, fr).call(this, P(this, k, lr).call(this));
|
|
2275
2268
|
}, dr = function() {
|
|
2276
|
-
o(this, Ne) && (clearTimeout(o(this, Ne)),
|
|
2269
|
+
o(this, Ne) && (clearTimeout(o(this, Ne)), b(this, Ne, void 0));
|
|
2277
2270
|
}, yr = function() {
|
|
2278
|
-
o(this, Le) && (clearInterval(o(this, Le)),
|
|
2271
|
+
o(this, Le) && (clearInterval(o(this, Le)), b(this, Le, void 0));
|
|
2279
2272
|
}, pr = function() {
|
|
2280
|
-
const e = o(this,
|
|
2281
|
-
if (e === o(this,
|
|
2273
|
+
const e = o(this, J).getQueryCache().build(o(this, J), this.options);
|
|
2274
|
+
if (e === o(this, x))
|
|
2282
2275
|
return;
|
|
2283
|
-
const r = o(this,
|
|
2284
|
-
|
|
2285
|
-
},
|
|
2286
|
-
|
|
2276
|
+
const r = o(this, x);
|
|
2277
|
+
b(this, x, e), b(this, St, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
|
|
2278
|
+
}, Bn = function(e) {
|
|
2279
|
+
V.batch(() => {
|
|
2287
2280
|
e.listeners && this.listeners.forEach((r) => {
|
|
2288
|
-
r(o(this,
|
|
2289
|
-
}), o(this,
|
|
2290
|
-
query: o(this,
|
|
2281
|
+
r(o(this, G));
|
|
2282
|
+
}), o(this, J).getQueryCache().notify({
|
|
2283
|
+
query: o(this, x),
|
|
2291
2284
|
type: "observerResultsUpdated"
|
|
2292
2285
|
});
|
|
2293
2286
|
});
|
|
2294
|
-
},
|
|
2295
|
-
function
|
|
2287
|
+
}, An);
|
|
2288
|
+
function mi(t, e) {
|
|
2296
2289
|
return se(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
2297
2290
|
}
|
|
2298
2291
|
function an(t, e) {
|
|
2299
|
-
return
|
|
2292
|
+
return mi(t, e) || t.state.data !== void 0 && mr(t, e, e.refetchOnMount);
|
|
2300
2293
|
}
|
|
2301
2294
|
function mr(t, e, r) {
|
|
2302
2295
|
if (se(e.enabled, t) !== !1) {
|
|
@@ -2309,20 +2302,20 @@ function un(t, e, r, n) {
|
|
|
2309
2302
|
return (t !== e || se(n.enabled, t) === !1) && (!r.suspense || t.state.status !== "error") && Cr(t, r);
|
|
2310
2303
|
}
|
|
2311
2304
|
function Cr(t, e) {
|
|
2312
|
-
return se(e.enabled, t) !== !1 && t.isStaleByTime(
|
|
2305
|
+
return se(e.enabled, t) !== !1 && t.isStaleByTime(We(e.staleTime, t));
|
|
2313
2306
|
}
|
|
2314
|
-
function
|
|
2315
|
-
return !
|
|
2307
|
+
function gi(t, e) {
|
|
2308
|
+
return !Mt(t.getCurrentResult(), e);
|
|
2316
2309
|
}
|
|
2317
|
-
var Se, Ce,
|
|
2310
|
+
var Se, Ce, X, de, ye, jt, gr, Dn, bi = (Dn = class extends at {
|
|
2318
2311
|
constructor(e, r) {
|
|
2319
2312
|
super();
|
|
2320
|
-
w(this,
|
|
2313
|
+
w(this, ye);
|
|
2321
2314
|
w(this, Se);
|
|
2322
2315
|
w(this, Ce);
|
|
2323
|
-
w(this,
|
|
2324
|
-
w(this,
|
|
2325
|
-
|
|
2316
|
+
w(this, X);
|
|
2317
|
+
w(this, de);
|
|
2318
|
+
b(this, Se, e), this.setOptions(r), this.bindMethods(), P(this, ye, jt).call(this);
|
|
2326
2319
|
}
|
|
2327
2320
|
bindMethods() {
|
|
2328
2321
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -2330,34 +2323,34 @@ var Se, Ce, J, he, de, jt, gr, Fn, mi = (Fn = class extends at {
|
|
|
2330
2323
|
setOptions(e) {
|
|
2331
2324
|
var n;
|
|
2332
2325
|
const r = this.options;
|
|
2333
|
-
this.options = o(this, Se).defaultMutationOptions(e),
|
|
2326
|
+
this.options = o(this, Se).defaultMutationOptions(e), Mt(this.options, r) || o(this, Se).getMutationCache().notify({
|
|
2334
2327
|
type: "observerOptionsUpdated",
|
|
2335
|
-
mutation: o(this,
|
|
2328
|
+
mutation: o(this, X),
|
|
2336
2329
|
observer: this
|
|
2337
|
-
}), r != null && r.mutationKey && this.options.mutationKey && $e(r.mutationKey) !== $e(this.options.mutationKey) ? this.reset() : ((n = o(this,
|
|
2330
|
+
}), r != null && r.mutationKey && this.options.mutationKey && $e(r.mutationKey) !== $e(this.options.mutationKey) ? this.reset() : ((n = o(this, X)) == null ? void 0 : n.state.status) === "pending" && o(this, X).setOptions(this.options);
|
|
2338
2331
|
}
|
|
2339
2332
|
onUnsubscribe() {
|
|
2340
2333
|
var e;
|
|
2341
|
-
this.hasListeners() || (e = o(this,
|
|
2334
|
+
this.hasListeners() || (e = o(this, X)) == null || e.removeObserver(this);
|
|
2342
2335
|
}
|
|
2343
2336
|
onMutationUpdate(e) {
|
|
2344
|
-
P(this,
|
|
2337
|
+
P(this, ye, jt).call(this), P(this, ye, gr).call(this, e);
|
|
2345
2338
|
}
|
|
2346
2339
|
getCurrentResult() {
|
|
2347
2340
|
return o(this, Ce);
|
|
2348
2341
|
}
|
|
2349
2342
|
reset() {
|
|
2350
2343
|
var e;
|
|
2351
|
-
(e = o(this,
|
|
2344
|
+
(e = o(this, X)) == null || e.removeObserver(this), b(this, X, void 0), P(this, ye, jt).call(this), P(this, ye, gr).call(this);
|
|
2352
2345
|
}
|
|
2353
2346
|
mutate(e, r) {
|
|
2354
2347
|
var n;
|
|
2355
|
-
return
|
|
2348
|
+
return b(this, de, r), (n = o(this, X)) == null || n.removeObserver(this), b(this, X, o(this, Se).getMutationCache().build(o(this, Se), this.options)), o(this, X).addObserver(this), o(this, X).execute(e);
|
|
2356
2349
|
}
|
|
2357
|
-
}, Se = new WeakMap(), Ce = new WeakMap(),
|
|
2350
|
+
}, Se = new WeakMap(), Ce = new WeakMap(), X = new WeakMap(), de = new WeakMap(), ye = new WeakSet(), jt = function() {
|
|
2358
2351
|
var r;
|
|
2359
|
-
const e = ((r = o(this,
|
|
2360
|
-
|
|
2352
|
+
const e = ((r = o(this, X)) == null ? void 0 : r.state) ?? Hn();
|
|
2353
|
+
b(this, Ce, {
|
|
2361
2354
|
...e,
|
|
2362
2355
|
isPending: e.status === "pending",
|
|
2363
2356
|
isSuccess: e.status === "success",
|
|
@@ -2367,37 +2360,37 @@ var Se, Ce, J, he, de, jt, gr, Fn, mi = (Fn = class extends at {
|
|
|
2367
2360
|
reset: this.reset
|
|
2368
2361
|
});
|
|
2369
2362
|
}, gr = function(e) {
|
|
2370
|
-
|
|
2363
|
+
V.batch(() => {
|
|
2371
2364
|
var r, n, s, a, u, l, c, d;
|
|
2372
|
-
if (o(this,
|
|
2373
|
-
const
|
|
2374
|
-
(e == null ? void 0 : e.type) === "success" ? ((n = (r = o(this,
|
|
2365
|
+
if (o(this, de) && this.hasListeners()) {
|
|
2366
|
+
const f = o(this, Ce).variables, h = o(this, Ce).context;
|
|
2367
|
+
(e == null ? void 0 : e.type) === "success" ? ((n = (r = o(this, de)).onSuccess) == null || n.call(r, e.data, f, h), (a = (s = o(this, de)).onSettled) == null || a.call(s, e.data, null, f, h)) : (e == null ? void 0 : e.type) === "error" && ((l = (u = o(this, de)).onError) == null || l.call(u, e.error, f, h), (d = (c = o(this, de)).onSettled) == null || d.call(
|
|
2375
2368
|
c,
|
|
2376
2369
|
void 0,
|
|
2377
2370
|
e.error,
|
|
2378
|
-
|
|
2379
|
-
|
|
2371
|
+
f,
|
|
2372
|
+
h
|
|
2380
2373
|
));
|
|
2381
2374
|
}
|
|
2382
|
-
this.listeners.forEach((
|
|
2383
|
-
|
|
2375
|
+
this.listeners.forEach((f) => {
|
|
2376
|
+
f(o(this, Ce));
|
|
2384
2377
|
});
|
|
2385
2378
|
});
|
|
2386
|
-
},
|
|
2379
|
+
}, Dn), Gn = z.createContext(
|
|
2387
2380
|
void 0
|
|
2388
2381
|
), Tt = (t) => {
|
|
2389
|
-
const e =
|
|
2382
|
+
const e = z.useContext(Gn);
|
|
2390
2383
|
if (!e)
|
|
2391
2384
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
2392
2385
|
return e;
|
|
2393
|
-
},
|
|
2386
|
+
}, vi = ({
|
|
2394
2387
|
client: t,
|
|
2395
2388
|
children: e
|
|
2396
|
-
}) => (
|
|
2389
|
+
}) => (z.useEffect(() => (t.mount(), () => {
|
|
2397
2390
|
t.unmount();
|
|
2398
|
-
}), [t]), /* @__PURE__ */ gt.jsx(
|
|
2399
|
-
|
|
2400
|
-
function
|
|
2391
|
+
}), [t]), /* @__PURE__ */ gt.jsx(Gn.Provider, { value: t, children: e })), Yn = z.createContext(!1), wi = () => z.useContext(Yn);
|
|
2392
|
+
Yn.Provider;
|
|
2393
|
+
function Ei() {
|
|
2401
2394
|
let t = !1;
|
|
2402
2395
|
return {
|
|
2403
2396
|
clearReset: () => {
|
|
@@ -2409,64 +2402,64 @@ function vi() {
|
|
|
2409
2402
|
isReset: () => t
|
|
2410
2403
|
};
|
|
2411
2404
|
}
|
|
2412
|
-
var
|
|
2413
|
-
function
|
|
2405
|
+
var Ri = z.createContext(Ei()), Oi = () => z.useContext(Ri);
|
|
2406
|
+
function Jn(t, e) {
|
|
2414
2407
|
return typeof t == "function" ? t(...e) : !!t;
|
|
2415
2408
|
}
|
|
2416
2409
|
function br() {
|
|
2417
2410
|
}
|
|
2418
|
-
var
|
|
2411
|
+
var Pi = (t, e) => {
|
|
2419
2412
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
2420
|
-
},
|
|
2421
|
-
|
|
2413
|
+
}, Si = (t) => {
|
|
2414
|
+
z.useEffect(() => {
|
|
2422
2415
|
t.clearReset();
|
|
2423
2416
|
}, [t]);
|
|
2424
|
-
},
|
|
2417
|
+
}, Ci = ({
|
|
2425
2418
|
result: t,
|
|
2426
2419
|
errorResetBoundary: e,
|
|
2427
2420
|
throwOnError: r,
|
|
2428
2421
|
query: n,
|
|
2429
2422
|
suspense: s
|
|
2430
|
-
}) => t.isError && !e.isReset() && !t.isFetching && n && (s && t.data === void 0 ||
|
|
2423
|
+
}) => t.isError && !e.isReset() && !t.isFetching && n && (s && t.data === void 0 || Jn(r, [t.error, n])), Ti = (t) => {
|
|
2431
2424
|
const e = t.staleTime;
|
|
2432
2425
|
t.suspense && (t.staleTime = typeof e == "function" ? (...r) => Math.max(e(...r), 1e3) : Math.max(e ?? 1e3, 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
2433
|
-
},
|
|
2426
|
+
}, xi = (t, e) => t.isLoading && t.isFetching && !e, Fi = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, cn = (t, e, r) => e.fetchOptimistic(t).catch(() => {
|
|
2434
2427
|
r.clearReset();
|
|
2435
2428
|
});
|
|
2436
|
-
function
|
|
2437
|
-
var
|
|
2429
|
+
function Ai(t, e, r) {
|
|
2430
|
+
var h, y, m, R, g;
|
|
2438
2431
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
2439
2432
|
throw new Error(
|
|
2440
2433
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
2441
2434
|
);
|
|
2442
|
-
const n = Tt(), s =
|
|
2443
|
-
(
|
|
2444
|
-
|
|
2435
|
+
const n = Tt(), s = wi(), a = Oi(), u = n.defaultQueryOptions(t);
|
|
2436
|
+
(y = (h = n.getDefaultOptions().queries) == null ? void 0 : h._experimental_beforeQuery) == null || y.call(
|
|
2437
|
+
h,
|
|
2445
2438
|
u
|
|
2446
2439
|
), process.env.NODE_ENV !== "production" && (u.queryFn || console.error(
|
|
2447
2440
|
`[${u.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
2448
|
-
)), u._optimisticResults = s ? "isRestoring" : "optimistic",
|
|
2449
|
-
const l = !n.getQueryCache().get(u.queryHash), [c] =
|
|
2441
|
+
)), u._optimisticResults = s ? "isRestoring" : "optimistic", Ti(u), Pi(u, a), Si(a);
|
|
2442
|
+
const l = !n.getQueryCache().get(u.queryHash), [c] = z.useState(
|
|
2450
2443
|
() => new e(
|
|
2451
2444
|
n,
|
|
2452
2445
|
u
|
|
2453
2446
|
)
|
|
2454
|
-
), d = c.getOptimisticResult(u),
|
|
2455
|
-
if (
|
|
2456
|
-
|
|
2457
|
-
(
|
|
2458
|
-
const
|
|
2459
|
-
return c.updateResult(),
|
|
2447
|
+
), d = c.getOptimisticResult(u), f = !s && t.subscribed !== !1;
|
|
2448
|
+
if (z.useSyncExternalStore(
|
|
2449
|
+
z.useCallback(
|
|
2450
|
+
(E) => {
|
|
2451
|
+
const T = f ? c.subscribe(V.batchCalls(E)) : br;
|
|
2452
|
+
return c.updateResult(), T;
|
|
2460
2453
|
},
|
|
2461
|
-
[c,
|
|
2454
|
+
[c, f]
|
|
2462
2455
|
),
|
|
2463
2456
|
() => c.getCurrentResult(),
|
|
2464
2457
|
() => c.getCurrentResult()
|
|
2465
|
-
),
|
|
2458
|
+
), z.useEffect(() => {
|
|
2466
2459
|
c.setOptions(u, { listeners: !1 });
|
|
2467
|
-
}, [u, c]),
|
|
2460
|
+
}, [u, c]), Fi(u, d))
|
|
2468
2461
|
throw cn(u, c, a);
|
|
2469
|
-
if (
|
|
2462
|
+
if (Ci({
|
|
2470
2463
|
result: d,
|
|
2471
2464
|
errorResetBoundary: a,
|
|
2472
2465
|
throwOnError: u.throwOnError,
|
|
@@ -2478,47 +2471,47 @@ function xi(t, e, r) {
|
|
|
2478
2471
|
m,
|
|
2479
2472
|
u,
|
|
2480
2473
|
d
|
|
2481
|
-
), u.experimental_prefetchInRender && !Qe &&
|
|
2482
|
-
const
|
|
2474
|
+
), u.experimental_prefetchInRender && !Qe && xi(d, s)) {
|
|
2475
|
+
const E = l ? (
|
|
2483
2476
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
2484
2477
|
cn(u, c, a)
|
|
2485
2478
|
) : (
|
|
2486
2479
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
2487
|
-
(
|
|
2480
|
+
(g = n.getQueryCache().get(u.queryHash)) == null ? void 0 : g.promise
|
|
2488
2481
|
);
|
|
2489
|
-
|
|
2482
|
+
E == null || E.catch(br).finally(() => {
|
|
2490
2483
|
c.updateResult();
|
|
2491
2484
|
});
|
|
2492
2485
|
}
|
|
2493
2486
|
return u.notifyOnChangeProps ? d : c.trackResult(d);
|
|
2494
2487
|
}
|
|
2495
|
-
function
|
|
2496
|
-
return
|
|
2488
|
+
function Xn(t, e) {
|
|
2489
|
+
return Ai(t, pi);
|
|
2497
2490
|
}
|
|
2498
2491
|
function Tr(t, e) {
|
|
2499
|
-
const r = Tt(), [n] =
|
|
2500
|
-
() => new
|
|
2492
|
+
const r = Tt(), [n] = z.useState(
|
|
2493
|
+
() => new bi(
|
|
2501
2494
|
r,
|
|
2502
2495
|
t
|
|
2503
2496
|
)
|
|
2504
2497
|
);
|
|
2505
|
-
|
|
2498
|
+
z.useEffect(() => {
|
|
2506
2499
|
n.setOptions(t);
|
|
2507
2500
|
}, [n, t]);
|
|
2508
|
-
const s =
|
|
2509
|
-
|
|
2510
|
-
(u) => n.subscribe(
|
|
2501
|
+
const s = z.useSyncExternalStore(
|
|
2502
|
+
z.useCallback(
|
|
2503
|
+
(u) => n.subscribe(V.batchCalls(u)),
|
|
2511
2504
|
[n]
|
|
2512
2505
|
),
|
|
2513
2506
|
() => n.getCurrentResult(),
|
|
2514
2507
|
() => n.getCurrentResult()
|
|
2515
|
-
), a =
|
|
2508
|
+
), a = z.useCallback(
|
|
2516
2509
|
(u, l) => {
|
|
2517
2510
|
n.mutate(u, l).catch(br);
|
|
2518
2511
|
},
|
|
2519
2512
|
[n]
|
|
2520
2513
|
);
|
|
2521
|
-
if (s.error &&
|
|
2514
|
+
if (s.error && Jn(n.options.throwOnError, [s.error]))
|
|
2522
2515
|
throw s.error;
|
|
2523
2516
|
return { ...s, mutate: a, mutateAsync: s.mutate };
|
|
2524
2517
|
}
|
|
@@ -2551,15 +2544,15 @@ function ut(t) {
|
|
|
2551
2544
|
};
|
|
2552
2545
|
},
|
|
2553
2546
|
pipe(...r) {
|
|
2554
|
-
return r.reduce(
|
|
2547
|
+
return r.reduce(Di, e);
|
|
2555
2548
|
}
|
|
2556
2549
|
};
|
|
2557
2550
|
return e;
|
|
2558
2551
|
}
|
|
2559
|
-
function
|
|
2552
|
+
function Di(t, e) {
|
|
2560
2553
|
return e(t);
|
|
2561
2554
|
}
|
|
2562
|
-
function
|
|
2555
|
+
function ki(t) {
|
|
2563
2556
|
const e = new AbortController();
|
|
2564
2557
|
return new Promise((n, s) => {
|
|
2565
2558
|
let a = !1;
|
|
@@ -2582,7 +2575,7 @@ function Ai(t) {
|
|
|
2582
2575
|
});
|
|
2583
2576
|
});
|
|
2584
2577
|
}
|
|
2585
|
-
function
|
|
2578
|
+
function _i(t) {
|
|
2586
2579
|
return (e) => {
|
|
2587
2580
|
let r = 0, n = null;
|
|
2588
2581
|
const s = [];
|
|
@@ -2620,7 +2613,7 @@ function Di(t) {
|
|
|
2620
2613
|
}));
|
|
2621
2614
|
};
|
|
2622
2615
|
}
|
|
2623
|
-
function
|
|
2616
|
+
function Ii(t) {
|
|
2624
2617
|
return (e) => ut((r) => e.subscribe({
|
|
2625
2618
|
next(n) {
|
|
2626
2619
|
var s;
|
|
@@ -2636,7 +2629,7 @@ function _i(t) {
|
|
|
2636
2629
|
}
|
|
2637
2630
|
}));
|
|
2638
2631
|
}
|
|
2639
|
-
function
|
|
2632
|
+
function ji(t) {
|
|
2640
2633
|
let e = t;
|
|
2641
2634
|
const r = [], n = (u) => {
|
|
2642
2635
|
e !== void 0 && u.next(e), r.push(u);
|
|
@@ -2653,7 +2646,7 @@ function Ii(t) {
|
|
|
2653
2646
|
}
|
|
2654
2647
|
}, a.get = () => e, a;
|
|
2655
2648
|
}
|
|
2656
|
-
function
|
|
2649
|
+
function qi(t) {
|
|
2657
2650
|
return ut((e) => {
|
|
2658
2651
|
function r(s = 0, a = t.op) {
|
|
2659
2652
|
const u = t.links[s];
|
|
@@ -2669,40 +2662,40 @@ function ki(t) {
|
|
|
2669
2662
|
return r().subscribe(e);
|
|
2670
2663
|
});
|
|
2671
2664
|
}
|
|
2672
|
-
const
|
|
2665
|
+
const Zn = () => {
|
|
2673
2666
|
}, ln = (t) => {
|
|
2674
2667
|
Object.freeze && Object.freeze(t);
|
|
2675
2668
|
};
|
|
2676
|
-
function
|
|
2669
|
+
function es(t, e, r) {
|
|
2677
2670
|
var n, s;
|
|
2678
2671
|
const a = e.join(".");
|
|
2679
|
-
return (n = r)[s = a] ?? (n[s] = new Proxy(
|
|
2672
|
+
return (n = r)[s = a] ?? (n[s] = new Proxy(Zn, {
|
|
2680
2673
|
get(u, l) {
|
|
2681
2674
|
if (!(typeof l != "string" || l === "then"))
|
|
2682
|
-
return
|
|
2675
|
+
return es(t, [
|
|
2683
2676
|
...e,
|
|
2684
2677
|
l
|
|
2685
2678
|
], r);
|
|
2686
2679
|
},
|
|
2687
2680
|
apply(u, l, c) {
|
|
2688
2681
|
const d = e[e.length - 1];
|
|
2689
|
-
let
|
|
2682
|
+
let f = {
|
|
2690
2683
|
args: c,
|
|
2691
2684
|
path: e
|
|
2692
2685
|
};
|
|
2693
|
-
return d === "call" ?
|
|
2686
|
+
return d === "call" ? f = {
|
|
2694
2687
|
args: c.length >= 2 ? [
|
|
2695
2688
|
c[1]
|
|
2696
2689
|
] : [],
|
|
2697
2690
|
path: e.slice(0, -1)
|
|
2698
|
-
} : d === "apply" && (
|
|
2691
|
+
} : d === "apply" && (f = {
|
|
2699
2692
|
args: c.length >= 2 ? c[1] : [],
|
|
2700
2693
|
path: e.slice(0, -1)
|
|
2701
|
-
}), ln(
|
|
2694
|
+
}), ln(f.args), ln(f.path), t(f);
|
|
2702
2695
|
}
|
|
2703
2696
|
})), r[a];
|
|
2704
2697
|
}
|
|
2705
|
-
const
|
|
2698
|
+
const Mi = (t) => es(t, [], /* @__PURE__ */ Object.create(null)), Ui = (t) => new Proxy(Zn, {
|
|
2706
2699
|
get(e, r) {
|
|
2707
2700
|
if (r !== "then")
|
|
2708
2701
|
return t(r);
|
|
@@ -2711,7 +2704,7 @@ const ji = (t) => Xn(t, [], /* @__PURE__ */ Object.create(null)), qi = (t) => ne
|
|
|
2711
2704
|
function vt(t) {
|
|
2712
2705
|
return !!t && !Array.isArray(t) && typeof t == "object";
|
|
2713
2706
|
}
|
|
2714
|
-
function
|
|
2707
|
+
function Ni(t, e) {
|
|
2715
2708
|
if ("error" in t) {
|
|
2716
2709
|
const n = e.deserialize(t.error);
|
|
2717
2710
|
return {
|
|
@@ -2738,10 +2731,10 @@ class Xt extends Error {
|
|
|
2738
2731
|
super("Unable to transform response from server");
|
|
2739
2732
|
}
|
|
2740
2733
|
}
|
|
2741
|
-
function
|
|
2734
|
+
function Li(t, e) {
|
|
2742
2735
|
let r;
|
|
2743
2736
|
try {
|
|
2744
|
-
r =
|
|
2737
|
+
r = Ni(t, e);
|
|
2745
2738
|
} catch {
|
|
2746
2739
|
throw new Xt();
|
|
2747
2740
|
}
|
|
@@ -2754,10 +2747,10 @@ function Mi(t, e) {
|
|
|
2754
2747
|
var fn, hn;
|
|
2755
2748
|
(fn = Symbol).dispose ?? (fn.dispose = Symbol());
|
|
2756
2749
|
(hn = Symbol).asyncDispose ?? (hn.asyncDispose = Symbol());
|
|
2757
|
-
var
|
|
2750
|
+
var kn, _n, In, jn, qn, Mn;
|
|
2758
2751
|
typeof window > "u" || "Deno" in window || // eslint-disable-next-line @typescript-eslint/dot-notation
|
|
2759
|
-
((
|
|
2760
|
-
function
|
|
2752
|
+
((_n = (kn = globalThis.process) == null ? void 0 : kn.env) == null ? void 0 : _n.NODE_ENV) === "test" || (jn = (In = globalThis.process) == null ? void 0 : In.env) != null && jn.JEST_WORKER_ID || (Mn = (qn = globalThis.process) == null ? void 0 : qn.env) != null && Mn.VITEST_WORKER_ID;
|
|
2753
|
+
function It(t, e, r) {
|
|
2761
2754
|
return e in t ? Object.defineProperty(t, e, {
|
|
2762
2755
|
value: r,
|
|
2763
2756
|
enumerable: !0,
|
|
@@ -2765,29 +2758,29 @@ function kt(t, e, r) {
|
|
|
2765
2758
|
writable: !0
|
|
2766
2759
|
}) : t[e] = r, t;
|
|
2767
2760
|
}
|
|
2768
|
-
function
|
|
2761
|
+
function Qi(t) {
|
|
2769
2762
|
return t instanceof Te || /**
|
|
2770
2763
|
* @deprecated
|
|
2771
2764
|
* Delete in next major
|
|
2772
2765
|
*/
|
|
2773
2766
|
t instanceof Error && t.name === "TRPCClientError";
|
|
2774
2767
|
}
|
|
2775
|
-
function
|
|
2768
|
+
function $i(t) {
|
|
2776
2769
|
return vt(t) && vt(t.error) && typeof t.error.code == "number" && typeof t.error.message == "string";
|
|
2777
2770
|
}
|
|
2778
|
-
function
|
|
2771
|
+
function Ki(t, e) {
|
|
2779
2772
|
return typeof t == "string" ? t : vt(t) && typeof t.message == "string" ? t.message : e;
|
|
2780
2773
|
}
|
|
2781
2774
|
class Te extends Error {
|
|
2782
2775
|
static from(e, r = {}) {
|
|
2783
2776
|
const n = e;
|
|
2784
|
-
return
|
|
2777
|
+
return Qi(n) ? (r.meta && (n.meta = {
|
|
2785
2778
|
...n.meta,
|
|
2786
2779
|
...r.meta
|
|
2787
|
-
}), n) :
|
|
2780
|
+
}), n) : $i(n) ? new Te(n.error.message, {
|
|
2788
2781
|
...r,
|
|
2789
2782
|
result: n
|
|
2790
|
-
}) : new Te(
|
|
2783
|
+
}) : new Te(Ki(n, "Unknown error"), {
|
|
2791
2784
|
...r,
|
|
2792
2785
|
cause: n
|
|
2793
2786
|
});
|
|
@@ -2799,11 +2792,11 @@ class Te extends Error {
|
|
|
2799
2792
|
cause: n
|
|
2800
2793
|
}), // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2801
2794
|
// @ts-ignore override doesn't work in all environments due to "This member cannot have an 'override' modifier because it is not declared in the base class 'Error'"
|
|
2802
|
-
|
|
2795
|
+
It(this, "cause", void 0), It(this, "shape", void 0), It(this, "data", void 0), /**
|
|
2803
2796
|
* Additional meta data about the error
|
|
2804
2797
|
* In the case of HTTP-errors, we'll have `response` and potentially `responseJSON` here
|
|
2805
2798
|
*/
|
|
2806
|
-
|
|
2799
|
+
It(this, "meta", void 0), this.meta = r == null ? void 0 : r.meta, this.cause = n, this.shape = (s = r == null ? void 0 : r.result) == null ? void 0 : s.error, this.data = (a = r == null ? void 0 : r.result) == null ? void 0 : a.error.data, this.name = "TRPCClientError", Object.setPrototypeOf(this, Te.prototype);
|
|
2807
2800
|
}
|
|
2808
2801
|
}
|
|
2809
2802
|
function Zt(t, e, r) {
|
|
@@ -2814,21 +2807,21 @@ function Zt(t, e, r) {
|
|
|
2814
2807
|
writable: !0
|
|
2815
2808
|
}) : t[e] = r, t;
|
|
2816
2809
|
}
|
|
2817
|
-
class
|
|
2810
|
+
class Vi {
|
|
2818
2811
|
$request(e) {
|
|
2819
|
-
return
|
|
2812
|
+
return qi({
|
|
2820
2813
|
links: this.links,
|
|
2821
2814
|
op: {
|
|
2822
2815
|
...e,
|
|
2823
2816
|
context: e.context ?? {},
|
|
2824
2817
|
id: ++this.requestId
|
|
2825
2818
|
}
|
|
2826
|
-
}).pipe(
|
|
2819
|
+
}).pipe(_i());
|
|
2827
2820
|
}
|
|
2828
2821
|
async requestAsPromise(e) {
|
|
2829
2822
|
try {
|
|
2830
2823
|
const r = this.$request(e);
|
|
2831
|
-
return (await
|
|
2824
|
+
return (await ki(r)).result.data;
|
|
2832
2825
|
} catch (r) {
|
|
2833
2826
|
throw Te.from(r);
|
|
2834
2827
|
}
|
|
@@ -2897,26 +2890,26 @@ class $i {
|
|
|
2897
2890
|
Zt(this, "links", void 0), Zt(this, "runtime", void 0), Zt(this, "requestId", void 0), this.requestId = 0, this.runtime = {}, this.links = e.links.map((r) => r(this.runtime));
|
|
2898
2891
|
}
|
|
2899
2892
|
}
|
|
2900
|
-
const
|
|
2893
|
+
const zi = Symbol.for("trpc_untypedClient"), Wi = {
|
|
2901
2894
|
query: "query",
|
|
2902
2895
|
mutate: "mutation",
|
|
2903
2896
|
subscribe: "subscription"
|
|
2904
|
-
},
|
|
2905
|
-
function
|
|
2906
|
-
const e =
|
|
2897
|
+
}, Hi = (t) => Wi[t];
|
|
2898
|
+
function Bi(t) {
|
|
2899
|
+
const e = Mi(({ path: r, args: n }) => {
|
|
2907
2900
|
const s = [
|
|
2908
2901
|
...r
|
|
2909
|
-
], a =
|
|
2902
|
+
], a = Hi(s.pop()), u = s.join(".");
|
|
2910
2903
|
return t[a](u, ...n);
|
|
2911
2904
|
});
|
|
2912
|
-
return
|
|
2905
|
+
return Ui((r) => r === zi ? t : e[r]);
|
|
2913
2906
|
}
|
|
2914
|
-
function
|
|
2915
|
-
const e = new
|
|
2916
|
-
return
|
|
2907
|
+
function Gi(t) {
|
|
2908
|
+
const e = new Vi(t);
|
|
2909
|
+
return Bi(e);
|
|
2917
2910
|
}
|
|
2918
2911
|
const dn = (t) => typeof t == "function";
|
|
2919
|
-
function
|
|
2912
|
+
function Yi(t) {
|
|
2920
2913
|
if (t)
|
|
2921
2914
|
return t;
|
|
2922
2915
|
if (typeof window < "u" && dn(window.fetch))
|
|
@@ -2934,26 +2927,26 @@ function pn(t) {
|
|
|
2934
2927
|
clearTimeout(r), r = null, e = null;
|
|
2935
2928
|
};
|
|
2936
2929
|
function s(l) {
|
|
2937
|
-
var
|
|
2930
|
+
var f, h;
|
|
2938
2931
|
const c = [
|
|
2939
2932
|
[]
|
|
2940
2933
|
];
|
|
2941
2934
|
let d = 0;
|
|
2942
2935
|
for (; ; ) {
|
|
2943
|
-
const
|
|
2944
|
-
if (!
|
|
2936
|
+
const y = l[d];
|
|
2937
|
+
if (!y)
|
|
2945
2938
|
break;
|
|
2946
2939
|
const m = c[c.length - 1];
|
|
2947
|
-
if (
|
|
2948
|
-
(
|
|
2940
|
+
if (y.aborted) {
|
|
2941
|
+
(f = y.reject) == null || f.call(y, new Error("Aborted")), d++;
|
|
2949
2942
|
continue;
|
|
2950
2943
|
}
|
|
2951
|
-
if (t.validate(m.concat(
|
|
2952
|
-
m.push(
|
|
2944
|
+
if (t.validate(m.concat(y).map((g) => g.key))) {
|
|
2945
|
+
m.push(y), d++;
|
|
2953
2946
|
continue;
|
|
2954
2947
|
}
|
|
2955
2948
|
if (m.length === 0) {
|
|
2956
|
-
(
|
|
2949
|
+
(h = y.reject) == null || h.call(y, new Error("Input is too big for a single dispatch")), d++;
|
|
2957
2950
|
continue;
|
|
2958
2951
|
}
|
|
2959
2952
|
c.push([]);
|
|
@@ -2969,27 +2962,27 @@ function pn(t) {
|
|
|
2969
2962
|
const d = {
|
|
2970
2963
|
items: c
|
|
2971
2964
|
};
|
|
2972
|
-
for (const
|
|
2973
|
-
|
|
2974
|
-
t.fetch(d.items.map((
|
|
2975
|
-
var
|
|
2976
|
-
await Promise.all(
|
|
2977
|
-
var
|
|
2978
|
-
const
|
|
2965
|
+
for (const h of c)
|
|
2966
|
+
h.batch = d;
|
|
2967
|
+
t.fetch(d.items.map((h) => h.key)).then(async (h) => {
|
|
2968
|
+
var y;
|
|
2969
|
+
await Promise.all(h.map(async (m, R) => {
|
|
2970
|
+
var E, T;
|
|
2971
|
+
const g = d.items[R];
|
|
2979
2972
|
try {
|
|
2980
|
-
const
|
|
2981
|
-
(
|
|
2982
|
-
} catch (
|
|
2983
|
-
(
|
|
2973
|
+
const S = await Promise.resolve(m);
|
|
2974
|
+
(E = g.resolve) == null || E.call(g, S);
|
|
2975
|
+
} catch (S) {
|
|
2976
|
+
(T = g.reject) == null || T.call(g, S);
|
|
2984
2977
|
}
|
|
2985
|
-
|
|
2978
|
+
g.batch = null, g.reject = null, g.resolve = null;
|
|
2986
2979
|
}));
|
|
2987
2980
|
for (const m of d.items)
|
|
2988
|
-
(
|
|
2989
|
-
}).catch((
|
|
2990
|
-
var
|
|
2981
|
+
(y = m.reject) == null || y.call(m, new Error("Missing result")), m.batch = null;
|
|
2982
|
+
}).catch((h) => {
|
|
2983
|
+
var y;
|
|
2991
2984
|
for (const m of d.items)
|
|
2992
|
-
(
|
|
2985
|
+
(y = m.reject) == null || y.call(m, h), m.batch = null;
|
|
2993
2986
|
});
|
|
2994
2987
|
}
|
|
2995
2988
|
}
|
|
@@ -3000,8 +2993,8 @@ function pn(t) {
|
|
|
3000
2993
|
batch: null,
|
|
3001
2994
|
resolve: yn,
|
|
3002
2995
|
reject: yn
|
|
3003
|
-
}, d = new Promise((
|
|
3004
|
-
c.reject =
|
|
2996
|
+
}, d = new Promise((f, h) => {
|
|
2997
|
+
c.reject = h, c.resolve = f, e || (e = []), e.push(c);
|
|
3005
2998
|
});
|
|
3006
2999
|
return r || (r = setTimeout(a)), d;
|
|
3007
3000
|
}
|
|
@@ -3009,7 +3002,7 @@ function pn(t) {
|
|
|
3009
3002
|
load: u
|
|
3010
3003
|
};
|
|
3011
3004
|
}
|
|
3012
|
-
function
|
|
3005
|
+
function Ji(...t) {
|
|
3013
3006
|
const e = new AbortController(), r = t.length;
|
|
3014
3007
|
let n = 0;
|
|
3015
3008
|
const s = () => {
|
|
@@ -3021,7 +3014,7 @@ function Gi(...t) {
|
|
|
3021
3014
|
});
|
|
3022
3015
|
return e.signal;
|
|
3023
3016
|
}
|
|
3024
|
-
function
|
|
3017
|
+
function Xi(t) {
|
|
3025
3018
|
const e = t;
|
|
3026
3019
|
return e ? "input" in e ? e : {
|
|
3027
3020
|
input: e,
|
|
@@ -3037,15 +3030,15 @@ function Yi(t) {
|
|
|
3037
3030
|
}
|
|
3038
3031
|
};
|
|
3039
3032
|
}
|
|
3040
|
-
function
|
|
3033
|
+
function Zi(t) {
|
|
3041
3034
|
return {
|
|
3042
3035
|
url: t.url.toString(),
|
|
3043
3036
|
fetch: t.fetch,
|
|
3044
|
-
transformer:
|
|
3037
|
+
transformer: Xi(t.transformer),
|
|
3045
3038
|
methodOverride: t.methodOverride
|
|
3046
3039
|
};
|
|
3047
3040
|
}
|
|
3048
|
-
function
|
|
3041
|
+
function eo(t) {
|
|
3049
3042
|
const e = {};
|
|
3050
3043
|
for (let r = 0; r < t.length; r++) {
|
|
3051
3044
|
const n = t[r];
|
|
@@ -3053,47 +3046,47 @@ function Xi(t) {
|
|
|
3053
3046
|
}
|
|
3054
3047
|
return e;
|
|
3055
3048
|
}
|
|
3056
|
-
const
|
|
3049
|
+
const to = {
|
|
3057
3050
|
query: "GET",
|
|
3058
3051
|
mutation: "POST",
|
|
3059
3052
|
subscription: "PATCH"
|
|
3060
3053
|
};
|
|
3061
|
-
function
|
|
3062
|
-
return "input" in t ? t.transformer.input.serialize(t.input) :
|
|
3054
|
+
function ts(t) {
|
|
3055
|
+
return "input" in t ? t.transformer.input.serialize(t.input) : eo(t.inputs.map((e) => t.transformer.input.serialize(e)));
|
|
3063
3056
|
}
|
|
3064
|
-
const
|
|
3057
|
+
const rs = (t) => {
|
|
3065
3058
|
const e = t.url.split("?");
|
|
3066
3059
|
let n = e[0].replace(/\/$/, "") + "/" + t.path;
|
|
3067
3060
|
const s = [];
|
|
3068
3061
|
if (e[1] && s.push(e[1]), "inputs" in t && s.push("batch=1"), t.type === "query" || t.type === "subscription") {
|
|
3069
|
-
const a =
|
|
3062
|
+
const a = ts(t);
|
|
3070
3063
|
a !== void 0 && t.methodOverride !== "POST" && s.push(`input=${encodeURIComponent(JSON.stringify(a))}`);
|
|
3071
3064
|
}
|
|
3072
3065
|
return s.length && (n += "?" + s.join("&")), n;
|
|
3073
|
-
},
|
|
3066
|
+
}, ro = (t) => {
|
|
3074
3067
|
if (t.type === "query" && t.methodOverride !== "POST")
|
|
3075
3068
|
return;
|
|
3076
|
-
const e =
|
|
3069
|
+
const e = ts(t);
|
|
3077
3070
|
return e !== void 0 ? JSON.stringify(e) : void 0;
|
|
3078
|
-
},
|
|
3071
|
+
}, no = (t) => ao({
|
|
3079
3072
|
...t,
|
|
3080
3073
|
contentTypeHeader: "application/json",
|
|
3081
|
-
getUrl:
|
|
3082
|
-
getBody:
|
|
3074
|
+
getUrl: rs,
|
|
3075
|
+
getBody: ro
|
|
3083
3076
|
});
|
|
3084
|
-
class
|
|
3077
|
+
class so extends Error {
|
|
3085
3078
|
constructor() {
|
|
3086
3079
|
const e = "AbortError";
|
|
3087
3080
|
super(e), this.name = e, this.message = e;
|
|
3088
3081
|
}
|
|
3089
3082
|
}
|
|
3090
|
-
const
|
|
3083
|
+
const io = (t) => {
|
|
3091
3084
|
var e;
|
|
3092
3085
|
if (t != null && t.aborted)
|
|
3093
|
-
throw (e = t.throwIfAborted) == null || e.call(t), typeof DOMException < "u" ? new DOMException("AbortError", "AbortError") : new
|
|
3086
|
+
throw (e = t.throwIfAborted) == null || e.call(t), typeof DOMException < "u" ? new DOMException("AbortError", "AbortError") : new so();
|
|
3094
3087
|
};
|
|
3095
|
-
async function
|
|
3096
|
-
|
|
3088
|
+
async function oo(t) {
|
|
3089
|
+
io(t.signal);
|
|
3097
3090
|
const e = t.getUrl(t), r = t.getBody(t), { type: n } = t, s = await (async () => {
|
|
3098
3091
|
const u = await t.headers();
|
|
3099
3092
|
return Symbol.iterator in u ? Object.fromEntries(u) : u;
|
|
@@ -3106,15 +3099,15 @@ async function so(t) {
|
|
|
3106
3099
|
} : void 0,
|
|
3107
3100
|
...s
|
|
3108
3101
|
};
|
|
3109
|
-
return
|
|
3110
|
-
method: t.methodOverride ??
|
|
3102
|
+
return Yi(t.fetch)(e, {
|
|
3103
|
+
method: t.methodOverride ?? to[n],
|
|
3111
3104
|
signal: t.signal,
|
|
3112
3105
|
body: r,
|
|
3113
3106
|
headers: a
|
|
3114
3107
|
});
|
|
3115
3108
|
}
|
|
3116
|
-
async function
|
|
3117
|
-
const e = {}, r = await
|
|
3109
|
+
async function ao(t) {
|
|
3110
|
+
const e = {}, r = await oo(t);
|
|
3118
3111
|
e.response = r;
|
|
3119
3112
|
const n = await r.json();
|
|
3120
3113
|
return e.responseJSON = n, {
|
|
@@ -3122,38 +3115,38 @@ async function io(t) {
|
|
|
3122
3115
|
meta: e
|
|
3123
3116
|
};
|
|
3124
3117
|
}
|
|
3125
|
-
function
|
|
3126
|
-
const e =
|
|
3118
|
+
function uo(t) {
|
|
3119
|
+
const e = Zi(t), r = t.maxURLLength ?? 1 / 0;
|
|
3127
3120
|
return () => {
|
|
3128
3121
|
const n = (l) => ({
|
|
3129
3122
|
validate(c) {
|
|
3130
3123
|
if (r === 1 / 0)
|
|
3131
3124
|
return !0;
|
|
3132
|
-
const d = c.map((
|
|
3133
|
-
return
|
|
3125
|
+
const d = c.map((y) => y.path).join(","), f = c.map((y) => y.input);
|
|
3126
|
+
return rs({
|
|
3134
3127
|
...e,
|
|
3135
3128
|
type: l,
|
|
3136
3129
|
path: d,
|
|
3137
|
-
inputs:
|
|
3130
|
+
inputs: f,
|
|
3138
3131
|
signal: null
|
|
3139
3132
|
}).length <= r;
|
|
3140
3133
|
},
|
|
3141
3134
|
async fetch(c) {
|
|
3142
|
-
const d = c.map((
|
|
3135
|
+
const d = c.map((g) => g.path).join(","), f = c.map((g) => g.input), h = Ji(...c.map((g) => g.signal)), y = await no({
|
|
3143
3136
|
...e,
|
|
3144
3137
|
path: d,
|
|
3145
|
-
inputs:
|
|
3138
|
+
inputs: f,
|
|
3146
3139
|
type: l,
|
|
3147
3140
|
headers() {
|
|
3148
3141
|
return t.headers ? typeof t.headers == "function" ? t.headers({
|
|
3149
3142
|
opList: c
|
|
3150
3143
|
}) : t.headers : {};
|
|
3151
3144
|
},
|
|
3152
|
-
signal:
|
|
3145
|
+
signal: h
|
|
3153
3146
|
});
|
|
3154
|
-
return (Array.isArray(
|
|
3155
|
-
meta:
|
|
3156
|
-
json:
|
|
3147
|
+
return (Array.isArray(y.json) ? y.json : c.map(() => y.json)).map((g) => ({
|
|
3148
|
+
meta: y.meta,
|
|
3149
|
+
json: g
|
|
3157
3150
|
}));
|
|
3158
3151
|
}
|
|
3159
3152
|
}), s = pn(n("query")), a = pn(n("mutation")), u = {
|
|
@@ -3164,31 +3157,31 @@ function oo(t) {
|
|
|
3164
3157
|
/* istanbul ignore if -- @preserve */
|
|
3165
3158
|
if (l.type === "subscription")
|
|
3166
3159
|
throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
3167
|
-
const
|
|
3168
|
-
let
|
|
3169
|
-
return
|
|
3170
|
-
|
|
3171
|
-
const m =
|
|
3160
|
+
const f = u[l.type].load(l);
|
|
3161
|
+
let h;
|
|
3162
|
+
return f.then((y) => {
|
|
3163
|
+
h = y;
|
|
3164
|
+
const m = Li(y.json, e.transformer.output);
|
|
3172
3165
|
if (!m.ok) {
|
|
3173
3166
|
c.error(Te.from(m.error, {
|
|
3174
|
-
meta:
|
|
3167
|
+
meta: y.meta
|
|
3175
3168
|
}));
|
|
3176
3169
|
return;
|
|
3177
3170
|
}
|
|
3178
3171
|
c.next({
|
|
3179
|
-
context:
|
|
3172
|
+
context: y.meta,
|
|
3180
3173
|
result: m.result
|
|
3181
3174
|
}), c.complete();
|
|
3182
|
-
}).catch((
|
|
3183
|
-
c.error(Te.from(
|
|
3184
|
-
meta:
|
|
3175
|
+
}).catch((y) => {
|
|
3176
|
+
c.error(Te.from(y, {
|
|
3177
|
+
meta: h == null ? void 0 : h.meta
|
|
3185
3178
|
}));
|
|
3186
3179
|
}), () => {
|
|
3187
3180
|
};
|
|
3188
3181
|
});
|
|
3189
3182
|
};
|
|
3190
3183
|
}
|
|
3191
|
-
function
|
|
3184
|
+
function co(t) {
|
|
3192
3185
|
return typeof FormData > "u" ? !1 : t instanceof FormData;
|
|
3193
3186
|
}
|
|
3194
3187
|
const er = {
|
|
@@ -3240,20 +3233,20 @@ const er = {
|
|
|
3240
3233
|
}
|
|
3241
3234
|
}
|
|
3242
3235
|
};
|
|
3243
|
-
function
|
|
3236
|
+
function lo(t) {
|
|
3244
3237
|
const { direction: e, type: r, withContext: n, path: s, id: a, input: u } = t, l = [], c = [];
|
|
3245
3238
|
if (t.colorMode === "none")
|
|
3246
3239
|
l.push(e === "up" ? ">>" : "<<", r, `#${a}`, s);
|
|
3247
3240
|
else if (t.colorMode === "ansi") {
|
|
3248
|
-
const [d,
|
|
3249
|
-
l.push(e === "up" ? d :
|
|
3241
|
+
const [d, f] = er.ansi.regular[r], [h, y] = er.ansi.bold[r];
|
|
3242
|
+
l.push(e === "up" ? d : f, e === "up" ? ">>" : "<<", r, e === "up" ? h : y, `#${a}`, s, "\x1B[0m");
|
|
3250
3243
|
} else {
|
|
3251
|
-
const [d,
|
|
3252
|
-
background-color: #${e === "up" ? d :
|
|
3244
|
+
const [d, f] = er.css[r], h = `
|
|
3245
|
+
background-color: #${e === "up" ? d : f};
|
|
3253
3246
|
color: ${e === "up" ? "black" : "white"};
|
|
3254
3247
|
padding: 2px;
|
|
3255
3248
|
`;
|
|
3256
|
-
l.push("%c", e === "up" ? ">>" : "<<", r, `#${a}`, `%c${s}%c`, "%O"), c.push(
|
|
3249
|
+
l.push("%c", e === "up" ? ">>" : "<<", r, `#${a}`, `%c${s}%c`, "%O"), c.push(h, `${h}; font-weight: bold;`, `${h}; font-weight: normal;`);
|
|
3257
3250
|
}
|
|
3258
3251
|
return e === "up" ? c.push(n ? {
|
|
3259
3252
|
input: u,
|
|
@@ -3272,8 +3265,8 @@ function uo(t) {
|
|
|
3272
3265
|
args: c
|
|
3273
3266
|
};
|
|
3274
3267
|
}
|
|
3275
|
-
const
|
|
3276
|
-
const s = n.input, a =
|
|
3268
|
+
const fo = ({ c: t = console, colorMode: e = "css", withContext: r }) => (n) => {
|
|
3269
|
+
const s = n.input, a = co(s) ? Object.fromEntries(s) : s, { parts: u, args: l } = lo({
|
|
3277
3270
|
...n,
|
|
3278
3271
|
colorMode: e,
|
|
3279
3272
|
input: a,
|
|
@@ -3283,8 +3276,8 @@ const co = ({ c: t = console, colorMode: e = "css", withContext: r }) => (n) =>
|
|
|
3283
3276
|
u.join(" ")
|
|
3284
3277
|
].concat(l));
|
|
3285
3278
|
};
|
|
3286
|
-
function
|
|
3287
|
-
const { enabled: e = () => !0 } = t, r = t.colorMode ?? (typeof window > "u" ? "ansi" : "css"), n = t.withContext ?? r === "css", { logger: s =
|
|
3279
|
+
function ho(t = {}) {
|
|
3280
|
+
const { enabled: e = () => !0 } = t, r = t.colorMode ?? (typeof window > "u" ? "ansi" : "css"), n = t.withContext ?? r === "css", { logger: s = fo({
|
|
3288
3281
|
c: t.console,
|
|
3289
3282
|
colorMode: r,
|
|
3290
3283
|
withContext: n
|
|
@@ -3298,31 +3291,31 @@ function lo(t = {}) {
|
|
|
3298
3291
|
direction: "up"
|
|
3299
3292
|
});
|
|
3300
3293
|
const c = Date.now();
|
|
3301
|
-
function d(
|
|
3302
|
-
const
|
|
3294
|
+
function d(f) {
|
|
3295
|
+
const h = Date.now() - c;
|
|
3303
3296
|
e({
|
|
3304
3297
|
...a,
|
|
3305
3298
|
direction: "down",
|
|
3306
|
-
result:
|
|
3299
|
+
result: f
|
|
3307
3300
|
}) && s({
|
|
3308
3301
|
...a,
|
|
3309
3302
|
direction: "down",
|
|
3310
|
-
elapsedMs:
|
|
3311
|
-
result:
|
|
3303
|
+
elapsedMs: h,
|
|
3304
|
+
result: f
|
|
3312
3305
|
});
|
|
3313
3306
|
}
|
|
3314
|
-
return u(a).pipe(
|
|
3315
|
-
next(
|
|
3316
|
-
d(
|
|
3307
|
+
return u(a).pipe(Ii({
|
|
3308
|
+
next(f) {
|
|
3309
|
+
d(f);
|
|
3317
3310
|
},
|
|
3318
|
-
error(
|
|
3319
|
-
d(
|
|
3311
|
+
error(f) {
|
|
3312
|
+
d(f);
|
|
3320
3313
|
}
|
|
3321
3314
|
})).subscribe(l);
|
|
3322
3315
|
});
|
|
3323
3316
|
}
|
|
3324
|
-
const
|
|
3325
|
-
function
|
|
3317
|
+
const yo = (t, ...e) => typeof t == "function" ? t(...e) : t;
|
|
3318
|
+
function po() {
|
|
3326
3319
|
let t, e;
|
|
3327
3320
|
return {
|
|
3328
3321
|
promise: new Promise((n, s) => {
|
|
@@ -3332,13 +3325,13 @@ function ho() {
|
|
|
3332
3325
|
reject: e
|
|
3333
3326
|
};
|
|
3334
3327
|
}
|
|
3335
|
-
async function
|
|
3336
|
-
const e = await
|
|
3328
|
+
async function mo(t) {
|
|
3329
|
+
const e = await yo(t.url);
|
|
3337
3330
|
if (!t.connectionParams) return e;
|
|
3338
3331
|
const n = `${e.includes("?") ? "&" : "?"}connectionParams=1`;
|
|
3339
3332
|
return e + n;
|
|
3340
3333
|
}
|
|
3341
|
-
function
|
|
3334
|
+
function ke(t, e, r) {
|
|
3342
3335
|
return e in t ? Object.defineProperty(t, e, {
|
|
3343
3336
|
value: r,
|
|
3344
3337
|
enumerable: !0,
|
|
@@ -3346,13 +3339,13 @@ function _e(t, e, r) {
|
|
|
3346
3339
|
writable: !0
|
|
3347
3340
|
}) : t[e] = r, t;
|
|
3348
3341
|
}
|
|
3349
|
-
function
|
|
3350
|
-
const { promise: e, resolve: r, reject: n } =
|
|
3342
|
+
function go(t) {
|
|
3343
|
+
const { promise: e, resolve: r, reject: n } = po();
|
|
3351
3344
|
return t.addEventListener("open", () => {
|
|
3352
3345
|
t.removeEventListener("error", n), r();
|
|
3353
3346
|
}), t.addEventListener("error", n), e;
|
|
3354
3347
|
}
|
|
3355
|
-
function
|
|
3348
|
+
function bo(t, { intervalMs: e, pongTimeoutMs: r }) {
|
|
3356
3349
|
let n, s;
|
|
3357
3350
|
function a() {
|
|
3358
3351
|
n = setTimeout(() => {
|
|
@@ -3395,10 +3388,10 @@ class Lt {
|
|
|
3395
3388
|
async open() {
|
|
3396
3389
|
if (this.openPromise) return this.openPromise;
|
|
3397
3390
|
this.id = ++Lt.connectCount;
|
|
3398
|
-
const e =
|
|
3399
|
-
this.openPromise = e.then(
|
|
3391
|
+
const e = mo(this.urlOptions).then((r) => new this.WebSocketPonyfill(r));
|
|
3392
|
+
this.openPromise = e.then(go), this.ws = await e, this.ws.addEventListener("message", function({ data: r }) {
|
|
3400
3393
|
r === "PING" && this.send("PONG");
|
|
3401
|
-
}), this.keepAliveOpts.enabled &&
|
|
3394
|
+
}), this.keepAliveOpts.enabled && bo(this.ws, this.keepAliveOpts), this.ws.addEventListener("close", () => {
|
|
3402
3395
|
this.ws = null;
|
|
3403
3396
|
});
|
|
3404
3397
|
try {
|
|
@@ -3420,13 +3413,13 @@ class Lt {
|
|
|
3420
3413
|
}
|
|
3421
3414
|
}
|
|
3422
3415
|
constructor(e) {
|
|
3423
|
-
if (
|
|
3416
|
+
if (ke(this, "id", ++Lt.connectCount), ke(this, "WebSocketPonyfill", void 0), ke(this, "urlOptions", void 0), ke(this, "keepAliveOpts", void 0), ke(this, "wsObservable", ji(null)), ke(this, "openPromise", null), this.WebSocketPonyfill = e.WebSocketPonyfill ?? WebSocket, !this.WebSocketPonyfill)
|
|
3424
3417
|
throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
|
|
3425
3418
|
this.urlOptions = e.urlOptions, this.keepAliveOpts = e.keepAlive;
|
|
3426
3419
|
}
|
|
3427
3420
|
}
|
|
3428
|
-
|
|
3429
|
-
class
|
|
3421
|
+
ke(Lt, "connectCount", 0);
|
|
3422
|
+
class vo {
|
|
3430
3423
|
constructor() {
|
|
3431
3424
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
3432
3425
|
}
|
|
@@ -3443,9 +3436,9 @@ class go {
|
|
|
3443
3436
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
3444
3437
|
}
|
|
3445
3438
|
}
|
|
3446
|
-
class
|
|
3439
|
+
class ns {
|
|
3447
3440
|
constructor(e) {
|
|
3448
|
-
this.generateIdentifier = e, this.kv = new
|
|
3441
|
+
this.generateIdentifier = e, this.kv = new vo();
|
|
3449
3442
|
}
|
|
3450
3443
|
register(e, r) {
|
|
3451
3444
|
this.kv.getByValue(e) || (r || (r = this.generateIdentifier(e)), this.kv.set(r, e));
|
|
@@ -3460,7 +3453,7 @@ class ts {
|
|
|
3460
3453
|
return this.kv.getByKey(e);
|
|
3461
3454
|
}
|
|
3462
3455
|
}
|
|
3463
|
-
class
|
|
3456
|
+
class wo extends ns {
|
|
3464
3457
|
constructor() {
|
|
3465
3458
|
super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
3466
3459
|
}
|
|
@@ -3471,7 +3464,7 @@ class bo extends ts {
|
|
|
3471
3464
|
return this.classToAllowedProps.get(e);
|
|
3472
3465
|
}
|
|
3473
3466
|
}
|
|
3474
|
-
function
|
|
3467
|
+
function Eo(t) {
|
|
3475
3468
|
if ("values" in Object)
|
|
3476
3469
|
return Object.values(t);
|
|
3477
3470
|
const e = [];
|
|
@@ -3479,8 +3472,8 @@ function vo(t) {
|
|
|
3479
3472
|
t.hasOwnProperty(r) && e.push(t[r]);
|
|
3480
3473
|
return e;
|
|
3481
3474
|
}
|
|
3482
|
-
function
|
|
3483
|
-
const r =
|
|
3475
|
+
function Ro(t, e) {
|
|
3476
|
+
const r = Eo(t);
|
|
3484
3477
|
if ("find" in r)
|
|
3485
3478
|
return r.find(e);
|
|
3486
3479
|
const n = r;
|
|
@@ -3503,7 +3496,7 @@ function mn(t, e) {
|
|
|
3503
3496
|
return n;
|
|
3504
3497
|
}
|
|
3505
3498
|
}
|
|
3506
|
-
class
|
|
3499
|
+
class Oo {
|
|
3507
3500
|
constructor() {
|
|
3508
3501
|
this.transfomers = {};
|
|
3509
3502
|
}
|
|
@@ -3511,13 +3504,13 @@ class Eo {
|
|
|
3511
3504
|
this.transfomers[e.name] = e;
|
|
3512
3505
|
}
|
|
3513
3506
|
findApplicable(e) {
|
|
3514
|
-
return
|
|
3507
|
+
return Ro(this.transfomers, (r) => r.isApplicable(e));
|
|
3515
3508
|
}
|
|
3516
3509
|
findByName(e) {
|
|
3517
3510
|
return this.transfomers[e];
|
|
3518
3511
|
}
|
|
3519
3512
|
}
|
|
3520
|
-
const
|
|
3513
|
+
const Po = (t) => Object.prototype.toString.call(t).slice(8, -1), ss = (t) => typeof t > "u", So = (t) => t === null, wt = (t) => typeof t != "object" || t === null || t === Object.prototype ? !1 : Object.getPrototypeOf(t) === null ? !0 : Object.getPrototypeOf(t) === Object.prototype, vr = (t) => wt(t) && Object.keys(t).length === 0, xe = (t) => Array.isArray(t), Co = (t) => typeof t == "string", To = (t) => typeof t == "number" && !isNaN(t), xo = (t) => typeof t == "boolean", Fo = (t) => t instanceof RegExp, Et = (t) => t instanceof Map, Rt = (t) => t instanceof Set, is = (t) => Po(t) === "Symbol", Ao = (t) => t instanceof Date && !isNaN(t.valueOf()), Do = (t) => t instanceof Error, gn = (t) => typeof t == "number" && isNaN(t), ko = (t) => xo(t) || So(t) || ss(t) || To(t) || Co(t) || is(t), _o = (t) => typeof t == "bigint", Io = (t) => t === 1 / 0 || t === -1 / 0, jo = (t) => ArrayBuffer.isView(t) && !(t instanceof DataView), qo = (t) => t instanceof URL, os = (t) => t.replace(/\./g, "\\."), tr = (t) => t.map(String).map(os).join("."), mt = (t) => {
|
|
3521
3514
|
const e = [];
|
|
3522
3515
|
let r = "";
|
|
3523
3516
|
for (let s = 0; s < t.length; s++) {
|
|
@@ -3535,7 +3528,7 @@ const Ro = (t) => Object.prototype.toString.call(t).slice(8, -1), rs = (t) => ty
|
|
|
3535
3528
|
const n = r;
|
|
3536
3529
|
return e.push(n), e;
|
|
3537
3530
|
};
|
|
3538
|
-
function
|
|
3531
|
+
function oe(t, e, r, n) {
|
|
3539
3532
|
return {
|
|
3540
3533
|
isApplicable: t,
|
|
3541
3534
|
annotation: e,
|
|
@@ -3543,12 +3536,12 @@ function ie(t, e, r, n) {
|
|
|
3543
3536
|
untransform: n
|
|
3544
3537
|
};
|
|
3545
3538
|
}
|
|
3546
|
-
const
|
|
3547
|
-
|
|
3539
|
+
const as = [
|
|
3540
|
+
oe(ss, "undefined", () => null, () => {
|
|
3548
3541
|
}),
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3542
|
+
oe(_o, "bigint", (t) => t.toString(), (t) => typeof BigInt < "u" ? BigInt(t) : (console.error("Please add a BigInt polyfill."), t)),
|
|
3543
|
+
oe(Ao, "Date", (t) => t.toISOString(), (t) => new Date(t)),
|
|
3544
|
+
oe(Do, "Error", (t, e) => {
|
|
3552
3545
|
const r = {
|
|
3553
3546
|
name: t.name,
|
|
3554
3547
|
message: t.message
|
|
@@ -3562,11 +3555,11 @@ const is = [
|
|
|
3562
3555
|
r[n] = t[n];
|
|
3563
3556
|
}), r;
|
|
3564
3557
|
}),
|
|
3565
|
-
|
|
3558
|
+
oe(Fo, "regexp", (t) => "" + t, (t) => {
|
|
3566
3559
|
const e = t.slice(1, t.lastIndexOf("/")), r = t.slice(t.lastIndexOf("/") + 1);
|
|
3567
3560
|
return new RegExp(e, r);
|
|
3568
3561
|
}),
|
|
3569
|
-
|
|
3562
|
+
oe(
|
|
3570
3563
|
Rt,
|
|
3571
3564
|
"set",
|
|
3572
3565
|
// (sets only exist in es6+)
|
|
@@ -3574,10 +3567,10 @@ const is = [
|
|
|
3574
3567
|
(t) => [...t.values()],
|
|
3575
3568
|
(t) => new Set(t)
|
|
3576
3569
|
),
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3570
|
+
oe(Et, "map", (t) => [...t.entries()], (t) => new Map(t)),
|
|
3571
|
+
oe((t) => gn(t) || Io(t), "number", (t) => gn(t) ? "NaN" : t > 0 ? "Infinity" : "-Infinity", Number),
|
|
3572
|
+
oe((t) => t === 0 && 1 / t === -1 / 0, "number", () => "-0", Number),
|
|
3573
|
+
oe(qo, "URL", (t) => t.toString(), (t) => new URL(t))
|
|
3581
3574
|
];
|
|
3582
3575
|
function Qt(t, e, r, n) {
|
|
3583
3576
|
return {
|
|
@@ -3587,12 +3580,12 @@ function Qt(t, e, r, n) {
|
|
|
3587
3580
|
untransform: n
|
|
3588
3581
|
};
|
|
3589
3582
|
}
|
|
3590
|
-
const
|
|
3583
|
+
const us = Qt((t, e) => is(t) ? !!e.symbolRegistry.getIdentifier(t) : !1, (t, e) => ["symbol", e.symbolRegistry.getIdentifier(t)], (t) => t.description, (t, e, r) => {
|
|
3591
3584
|
const n = r.symbolRegistry.getValue(e[1]);
|
|
3592
3585
|
if (!n)
|
|
3593
3586
|
throw new Error("Trying to deserialize unknown symbol");
|
|
3594
3587
|
return n;
|
|
3595
|
-
}),
|
|
3588
|
+
}), Mo = [
|
|
3596
3589
|
Int8Array,
|
|
3597
3590
|
Uint8Array,
|
|
3598
3591
|
Int16Array,
|
|
@@ -3602,16 +3595,16 @@ const os = Qt((t, e) => ns(t) ? !!e.symbolRegistry.getIdentifier(t) : !1, (t, e)
|
|
|
3602
3595
|
Float32Array,
|
|
3603
3596
|
Float64Array,
|
|
3604
3597
|
Uint8ClampedArray
|
|
3605
|
-
].reduce((t, e) => (t[e.name] = e, t), {}),
|
|
3606
|
-
const r =
|
|
3598
|
+
].reduce((t, e) => (t[e.name] = e, t), {}), cs = Qt(jo, (t) => ["typed-array", t.constructor.name], (t) => [...t], (t, e) => {
|
|
3599
|
+
const r = Mo[e[1]];
|
|
3607
3600
|
if (!r)
|
|
3608
3601
|
throw new Error("Trying to deserialize unknown typed array");
|
|
3609
3602
|
return new r(t);
|
|
3610
3603
|
});
|
|
3611
|
-
function
|
|
3604
|
+
function ls(t, e) {
|
|
3612
3605
|
return t != null && t.constructor ? !!e.classRegistry.getIdentifier(t.constructor) : !1;
|
|
3613
3606
|
}
|
|
3614
|
-
const
|
|
3607
|
+
const fs = Qt(ls, (t, e) => ["class", e.classRegistry.getIdentifier(t.constructor)], (t, e) => {
|
|
3615
3608
|
const r = e.classRegistry.getAllowedProps(t.constructor);
|
|
3616
3609
|
if (!r)
|
|
3617
3610
|
return { ...t };
|
|
@@ -3624,44 +3617,44 @@ const cs = Qt(us, (t, e) => ["class", e.classRegistry.getIdentifier(t.constructo
|
|
|
3624
3617
|
if (!n)
|
|
3625
3618
|
throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
3626
3619
|
return Object.assign(Object.create(n.prototype), t);
|
|
3627
|
-
}),
|
|
3620
|
+
}), hs = Qt((t, e) => !!e.customTransformerRegistry.findApplicable(t), (t, e) => ["custom", e.customTransformerRegistry.findApplicable(t).name], (t, e) => e.customTransformerRegistry.findApplicable(t).serialize(t), (t, e, r) => {
|
|
3628
3621
|
const n = r.customTransformerRegistry.findByName(e[1]);
|
|
3629
3622
|
if (!n)
|
|
3630
3623
|
throw new Error("Trying to deserialize unknown custom value");
|
|
3631
3624
|
return n.deserialize(t);
|
|
3632
|
-
}),
|
|
3633
|
-
const r = mn(
|
|
3625
|
+
}), Uo = [fs, us, hs, cs], bn = (t, e) => {
|
|
3626
|
+
const r = mn(Uo, (s) => s.isApplicable(t, e));
|
|
3634
3627
|
if (r)
|
|
3635
3628
|
return {
|
|
3636
3629
|
value: r.transform(t, e),
|
|
3637
3630
|
type: r.annotation(t, e)
|
|
3638
3631
|
};
|
|
3639
|
-
const n = mn(
|
|
3632
|
+
const n = mn(as, (s) => s.isApplicable(t, e));
|
|
3640
3633
|
if (n)
|
|
3641
3634
|
return {
|
|
3642
3635
|
value: n.transform(t, e),
|
|
3643
3636
|
type: n.annotation
|
|
3644
3637
|
};
|
|
3645
|
-
},
|
|
3646
|
-
|
|
3647
|
-
|
|
3638
|
+
}, ds = {};
|
|
3639
|
+
as.forEach((t) => {
|
|
3640
|
+
ds[t.annotation] = t;
|
|
3648
3641
|
});
|
|
3649
|
-
const
|
|
3642
|
+
const No = (t, e, r) => {
|
|
3650
3643
|
if (xe(e))
|
|
3651
3644
|
switch (e[0]) {
|
|
3652
3645
|
case "symbol":
|
|
3653
|
-
return
|
|
3646
|
+
return us.untransform(t, e, r);
|
|
3654
3647
|
case "class":
|
|
3655
|
-
return
|
|
3648
|
+
return fs.untransform(t, e, r);
|
|
3656
3649
|
case "custom":
|
|
3657
|
-
return
|
|
3650
|
+
return hs.untransform(t, e, r);
|
|
3658
3651
|
case "typed-array":
|
|
3659
|
-
return
|
|
3652
|
+
return cs.untransform(t, e, r);
|
|
3660
3653
|
default:
|
|
3661
3654
|
throw new Error("Unknown transformation: " + e);
|
|
3662
3655
|
}
|
|
3663
3656
|
else {
|
|
3664
|
-
const n =
|
|
3657
|
+
const n = ds[e];
|
|
3665
3658
|
if (!n)
|
|
3666
3659
|
throw new Error("Unknown transformation: " + e);
|
|
3667
3660
|
return n.untransform(t, r);
|
|
@@ -3674,7 +3667,7 @@ const Uo = (t, e, r) => {
|
|
|
3674
3667
|
r.next(), e--;
|
|
3675
3668
|
return r.next().value;
|
|
3676
3669
|
};
|
|
3677
|
-
function
|
|
3670
|
+
function ys(t) {
|
|
3678
3671
|
if (qt(t, "__proto__"))
|
|
3679
3672
|
throw new Error("__proto__ is not allowed as a property");
|
|
3680
3673
|
if (qt(t, "prototype"))
|
|
@@ -3682,8 +3675,8 @@ function hs(t) {
|
|
|
3682
3675
|
if (qt(t, "constructor"))
|
|
3683
3676
|
throw new Error("constructor is not allowed as a property");
|
|
3684
3677
|
}
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3678
|
+
const Lo = (t, e) => {
|
|
3679
|
+
ys(e);
|
|
3687
3680
|
for (let r = 0; r < e.length; r++) {
|
|
3688
3681
|
const n = e[r];
|
|
3689
3682
|
if (Rt(t))
|
|
@@ -3703,7 +3696,7 @@ const Mo = (t, e) => {
|
|
|
3703
3696
|
}
|
|
3704
3697
|
return t;
|
|
3705
3698
|
}, wr = (t, e, r) => {
|
|
3706
|
-
if (
|
|
3699
|
+
if (ys(e), e.length === 0)
|
|
3707
3700
|
return r(t);
|
|
3708
3701
|
let n = t;
|
|
3709
3702
|
for (let a = 0; a < e.length - 1; a++) {
|
|
@@ -3719,13 +3712,13 @@ const Mo = (t, e) => {
|
|
|
3719
3712
|
} else if (Et(n)) {
|
|
3720
3713
|
if (a === e.length - 2)
|
|
3721
3714
|
break;
|
|
3722
|
-
const c = +u, d = +e[++a] == 0 ? "key" : "value",
|
|
3715
|
+
const c = +u, d = +e[++a] == 0 ? "key" : "value", f = ze(n, c);
|
|
3723
3716
|
switch (d) {
|
|
3724
3717
|
case "key":
|
|
3725
|
-
n =
|
|
3718
|
+
n = f;
|
|
3726
3719
|
break;
|
|
3727
3720
|
case "value":
|
|
3728
|
-
n = n.get(
|
|
3721
|
+
n = n.get(f);
|
|
3729
3722
|
break;
|
|
3730
3723
|
}
|
|
3731
3724
|
}
|
|
@@ -3763,14 +3756,14 @@ function Er(t, e, r = []) {
|
|
|
3763
3756
|
Er(a, e, [...r, ...mt(u)]);
|
|
3764
3757
|
}), e(n, r);
|
|
3765
3758
|
}
|
|
3766
|
-
function
|
|
3759
|
+
function Qo(t, e, r) {
|
|
3767
3760
|
return Er(e, (n, s) => {
|
|
3768
|
-
t = wr(t, s, (a) =>
|
|
3761
|
+
t = wr(t, s, (a) => No(a, n, r));
|
|
3769
3762
|
}), t;
|
|
3770
3763
|
}
|
|
3771
|
-
function
|
|
3764
|
+
function $o(t, e) {
|
|
3772
3765
|
function r(n, s) {
|
|
3773
|
-
const a =
|
|
3766
|
+
const a = Lo(t, mt(s));
|
|
3774
3767
|
n.map(mt).forEach((u) => {
|
|
3775
3768
|
t = wr(t, u, () => a);
|
|
3776
3769
|
});
|
|
@@ -3784,12 +3777,12 @@ function Lo(t, e) {
|
|
|
3784
3777
|
ot(e, r);
|
|
3785
3778
|
return t;
|
|
3786
3779
|
}
|
|
3787
|
-
const
|
|
3788
|
-
function
|
|
3780
|
+
const Ko = (t, e) => wt(t) || xe(t) || Et(t) || Rt(t) || ls(t, e);
|
|
3781
|
+
function Vo(t, e, r) {
|
|
3789
3782
|
const n = r.get(t);
|
|
3790
3783
|
n ? n.push(e) : r.set(t, [e]);
|
|
3791
3784
|
}
|
|
3792
|
-
function
|
|
3785
|
+
function zo(t, e) {
|
|
3793
3786
|
const r = {};
|
|
3794
3787
|
let n;
|
|
3795
3788
|
return t.forEach((s) => {
|
|
@@ -3800,17 +3793,17 @@ function Ko(t, e) {
|
|
|
3800
3793
|
a.length === 0 ? n = u.map(tr) : r[tr(a)] = u.map(tr);
|
|
3801
3794
|
}), n ? vr(r) ? [n] : [n, r] : vr(r) ? void 0 : r;
|
|
3802
3795
|
}
|
|
3803
|
-
const
|
|
3804
|
-
const l =
|
|
3796
|
+
const ps = (t, e, r, n, s = [], a = [], u = /* @__PURE__ */ new Map()) => {
|
|
3797
|
+
const l = ko(t);
|
|
3805
3798
|
if (!l) {
|
|
3806
|
-
|
|
3799
|
+
Vo(t, s, e);
|
|
3807
3800
|
const m = u.get(t);
|
|
3808
3801
|
if (m)
|
|
3809
3802
|
return n ? {
|
|
3810
3803
|
transformedValue: null
|
|
3811
3804
|
} : m;
|
|
3812
3805
|
}
|
|
3813
|
-
if (!
|
|
3806
|
+
if (!Ko(t, r)) {
|
|
3814
3807
|
const m = bn(t, r), R = m ? {
|
|
3815
3808
|
transformedValue: m.value,
|
|
3816
3809
|
annotations: [m.type]
|
|
@@ -3823,37 +3816,37 @@ const ds = (t, e, r, n, s = [], a = [], u = /* @__PURE__ */ new Map()) => {
|
|
|
3823
3816
|
return {
|
|
3824
3817
|
transformedValue: null
|
|
3825
3818
|
};
|
|
3826
|
-
const c = bn(t, r), d = (c == null ? void 0 : c.value) ?? t,
|
|
3819
|
+
const c = bn(t, r), d = (c == null ? void 0 : c.value) ?? t, f = xe(d) ? [] : {}, h = {};
|
|
3827
3820
|
ot(d, (m, R) => {
|
|
3828
3821
|
if (R === "__proto__" || R === "constructor" || R === "prototype")
|
|
3829
3822
|
throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);
|
|
3830
|
-
const
|
|
3831
|
-
|
|
3832
|
-
|
|
3823
|
+
const g = ps(m, e, r, n, [...s, R], [...a, t], u);
|
|
3824
|
+
f[R] = g.transformedValue, xe(g.annotations) ? h[R] = g.annotations : wt(g.annotations) && ot(g.annotations, (E, T) => {
|
|
3825
|
+
h[os(R) + "." + T] = E;
|
|
3833
3826
|
});
|
|
3834
3827
|
});
|
|
3835
|
-
const
|
|
3836
|
-
transformedValue:
|
|
3828
|
+
const y = vr(h) ? {
|
|
3829
|
+
transformedValue: f,
|
|
3837
3830
|
annotations: c ? [c.type] : void 0
|
|
3838
3831
|
} : {
|
|
3839
|
-
transformedValue:
|
|
3840
|
-
annotations: c ? [c.type,
|
|
3832
|
+
transformedValue: f,
|
|
3833
|
+
annotations: c ? [c.type, h] : h
|
|
3841
3834
|
};
|
|
3842
|
-
return l || u.set(t,
|
|
3835
|
+
return l || u.set(t, y), y;
|
|
3843
3836
|
};
|
|
3844
|
-
function
|
|
3837
|
+
function ms(t) {
|
|
3845
3838
|
return Object.prototype.toString.call(t).slice(8, -1);
|
|
3846
3839
|
}
|
|
3847
3840
|
function vn(t) {
|
|
3848
|
-
return
|
|
3841
|
+
return ms(t) === "Array";
|
|
3849
3842
|
}
|
|
3850
|
-
function
|
|
3851
|
-
if (
|
|
3843
|
+
function Wo(t) {
|
|
3844
|
+
if (ms(t) !== "Object")
|
|
3852
3845
|
return !1;
|
|
3853
3846
|
const e = Object.getPrototypeOf(t);
|
|
3854
3847
|
return !!e && e.constructor === Object && e === Object.prototype;
|
|
3855
3848
|
}
|
|
3856
|
-
function
|
|
3849
|
+
function Ho(t, e, r, n, s) {
|
|
3857
3850
|
const a = {}.propertyIsEnumerable.call(n, e) ? "enumerable" : "nonenumerable";
|
|
3858
3851
|
a === "enumerable" && (t[e] = r), s && a === "nonenumerable" && Object.defineProperty(t, e, {
|
|
3859
3852
|
value: r,
|
|
@@ -3865,32 +3858,32 @@ function zo(t, e, r, n, s) {
|
|
|
3865
3858
|
function Rr(t, e = {}) {
|
|
3866
3859
|
if (vn(t))
|
|
3867
3860
|
return t.map((s) => Rr(s, e));
|
|
3868
|
-
if (!
|
|
3861
|
+
if (!Wo(t))
|
|
3869
3862
|
return t;
|
|
3870
3863
|
const r = Object.getOwnPropertyNames(t), n = Object.getOwnPropertySymbols(t);
|
|
3871
3864
|
return [...r, ...n].reduce((s, a) => {
|
|
3872
3865
|
if (vn(e.props) && !e.props.includes(a))
|
|
3873
3866
|
return s;
|
|
3874
3867
|
const u = t[a], l = Rr(u, e);
|
|
3875
|
-
return
|
|
3868
|
+
return Ho(s, a, l, t, e.nonenumerable), s;
|
|
3876
3869
|
}, {});
|
|
3877
3870
|
}
|
|
3878
|
-
class
|
|
3871
|
+
class F {
|
|
3879
3872
|
/**
|
|
3880
3873
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
3881
3874
|
*/
|
|
3882
3875
|
constructor({ dedupe: e = !1 } = {}) {
|
|
3883
|
-
this.classRegistry = new
|
|
3876
|
+
this.classRegistry = new wo(), this.symbolRegistry = new ns((r) => r.description ?? ""), this.customTransformerRegistry = new Oo(), this.allowedErrorProps = [], this.dedupe = e;
|
|
3884
3877
|
}
|
|
3885
3878
|
serialize(e) {
|
|
3886
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
3879
|
+
const r = /* @__PURE__ */ new Map(), n = ps(e, r, this, this.dedupe), s = {
|
|
3887
3880
|
json: n.transformedValue
|
|
3888
3881
|
};
|
|
3889
3882
|
n.annotations && (s.meta = {
|
|
3890
3883
|
...s.meta,
|
|
3891
3884
|
values: n.annotations
|
|
3892
3885
|
});
|
|
3893
|
-
const a =
|
|
3886
|
+
const a = zo(r, this.dedupe);
|
|
3894
3887
|
return a && (s.meta = {
|
|
3895
3888
|
...s.meta,
|
|
3896
3889
|
referentialEqualities: a
|
|
@@ -3899,7 +3892,7 @@ class x {
|
|
|
3899
3892
|
deserialize(e) {
|
|
3900
3893
|
const { json: r, meta: n } = e;
|
|
3901
3894
|
let s = Rr(r);
|
|
3902
|
-
return n != null && n.values && (s =
|
|
3895
|
+
return n != null && n.values && (s = Qo(s, n.values, this)), n != null && n.referentialEqualities && (s = $o(s, n.referentialEqualities)), s;
|
|
3903
3896
|
}
|
|
3904
3897
|
stringify(e) {
|
|
3905
3898
|
return JSON.stringify(this.serialize(e));
|
|
@@ -3923,60 +3916,65 @@ class x {
|
|
|
3923
3916
|
this.allowedErrorProps.push(...e);
|
|
3924
3917
|
}
|
|
3925
3918
|
}
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
const
|
|
3944
|
-
function
|
|
3945
|
-
const r =
|
|
3919
|
+
F.defaultInstance = new F();
|
|
3920
|
+
F.serialize = F.defaultInstance.serialize.bind(F.defaultInstance);
|
|
3921
|
+
F.deserialize = F.defaultInstance.deserialize.bind(F.defaultInstance);
|
|
3922
|
+
F.stringify = F.defaultInstance.stringify.bind(F.defaultInstance);
|
|
3923
|
+
F.parse = F.defaultInstance.parse.bind(F.defaultInstance);
|
|
3924
|
+
F.registerClass = F.defaultInstance.registerClass.bind(F.defaultInstance);
|
|
3925
|
+
F.registerSymbol = F.defaultInstance.registerSymbol.bind(F.defaultInstance);
|
|
3926
|
+
F.registerCustom = F.defaultInstance.registerCustom.bind(F.defaultInstance);
|
|
3927
|
+
F.allowErrorProps = F.defaultInstance.allowErrorProps.bind(F.defaultInstance);
|
|
3928
|
+
F.serialize;
|
|
3929
|
+
F.deserialize;
|
|
3930
|
+
F.stringify;
|
|
3931
|
+
F.parse;
|
|
3932
|
+
F.registerClass;
|
|
3933
|
+
F.registerCustom;
|
|
3934
|
+
F.registerSymbol;
|
|
3935
|
+
F.allowErrorProps;
|
|
3936
|
+
const gs = zs(null);
|
|
3937
|
+
function Bo(t, e) {
|
|
3938
|
+
const r = Gi({
|
|
3946
3939
|
links: [
|
|
3947
|
-
|
|
3940
|
+
ho({
|
|
3948
3941
|
enabled: (s) => process.env.NODE_ENV === "development" && typeof window < "u" || s.direction === "down" && s.result instanceof Error
|
|
3949
3942
|
}),
|
|
3950
|
-
|
|
3943
|
+
uo({
|
|
3951
3944
|
url: `${t}/trpc`,
|
|
3952
3945
|
headers: () => ({
|
|
3953
3946
|
Authorization: `Bearer ${e}`
|
|
3954
3947
|
}),
|
|
3955
|
-
transformer:
|
|
3948
|
+
transformer: F
|
|
3956
3949
|
})
|
|
3957
3950
|
]
|
|
3958
3951
|
}), n = async (s, a, u = null) => {
|
|
3959
|
-
const l =
|
|
3960
|
-
|
|
3961
|
-
|
|
3952
|
+
const l = Object.entries(Nn).reduce(
|
|
3953
|
+
(y, [m, R]) => (R.extensions.forEach((g) => {
|
|
3954
|
+
y.set(g, m);
|
|
3955
|
+
}), y),
|
|
3956
|
+
/* @__PURE__ */ new Map()
|
|
3957
|
+
), c = a.map((y) => {
|
|
3958
|
+
const m = y.name.toLowerCase(), R = m.includes(".") ? m.substring(m.lastIndexOf(".")) : "", g = R.startsWith(".") ? R : `.${R}`, E = l.get(g) || null;
|
|
3959
|
+
return { ...y, mimeType: E };
|
|
3962
3960
|
}).filter(
|
|
3963
|
-
(
|
|
3961
|
+
(y) => y.mimeType !== null && Zs.has(y.mimeType)
|
|
3964
3962
|
);
|
|
3965
|
-
if (
|
|
3963
|
+
if (c.length === 0)
|
|
3966
3964
|
return { filesToCreate: [] };
|
|
3967
|
-
const
|
|
3965
|
+
const d = await r.fileRouter.getFilesByProject.query({
|
|
3968
3966
|
projectId: s
|
|
3969
|
-
}),
|
|
3970
|
-
(
|
|
3971
|
-
) : !
|
|
3972
|
-
(
|
|
3967
|
+
}), f = c.filter((y) => u === null ? !d.some(
|
|
3968
|
+
(m) => m.path === y.blobUrl
|
|
3969
|
+
) : !d.some(
|
|
3970
|
+
(m) => m.path === y.blobUrl && m.parentId === u
|
|
3973
3971
|
));
|
|
3974
|
-
return
|
|
3972
|
+
return f.length === 0 ? { filesToCreate: [] } : { filesToCreate: f.map((y) => ({
|
|
3975
3973
|
projectId: s,
|
|
3976
|
-
mimeType:
|
|
3977
|
-
path:
|
|
3974
|
+
mimeType: y.mimeType,
|
|
3975
|
+
path: y.blobUrl,
|
|
3978
3976
|
// Map blobUrl back to path for API
|
|
3979
|
-
name:
|
|
3977
|
+
name: y.name,
|
|
3980
3978
|
size: 0,
|
|
3981
3979
|
// You might need to calculate or pass size
|
|
3982
3980
|
metadata: null,
|
|
@@ -4052,7 +4050,7 @@ function Ho(t, e) {
|
|
|
4052
4050
|
directory: null,
|
|
4053
4051
|
files: []
|
|
4054
4052
|
};
|
|
4055
|
-
const
|
|
4053
|
+
const f = await r.fileRouter.createFile.mutate({
|
|
4056
4054
|
file: {
|
|
4057
4055
|
projectId: s,
|
|
4058
4056
|
mimeType: Or.DIRECTORY,
|
|
@@ -4071,43 +4069,43 @@ function Ho(t, e) {
|
|
|
4071
4069
|
if (l.length === 0)
|
|
4072
4070
|
return {
|
|
4073
4071
|
directory: {
|
|
4074
|
-
blobUrl:
|
|
4075
|
-
name:
|
|
4076
|
-
id:
|
|
4077
|
-
parentId:
|
|
4078
|
-
isDirectory:
|
|
4072
|
+
blobUrl: f.path,
|
|
4073
|
+
name: f.name,
|
|
4074
|
+
id: f.id,
|
|
4075
|
+
parentId: f.parentId,
|
|
4076
|
+
isDirectory: f.isDirectory
|
|
4079
4077
|
},
|
|
4080
4078
|
files: []
|
|
4081
4079
|
};
|
|
4082
|
-
const { filesToCreate:
|
|
4080
|
+
const { filesToCreate: h } = await n(
|
|
4083
4081
|
s,
|
|
4084
4082
|
l,
|
|
4085
|
-
|
|
4083
|
+
f.id
|
|
4086
4084
|
// Pass directory ID as parent
|
|
4087
4085
|
);
|
|
4088
|
-
if (
|
|
4086
|
+
if (h.length === 0)
|
|
4089
4087
|
return {
|
|
4090
4088
|
directory: {
|
|
4091
|
-
blobUrl:
|
|
4092
|
-
name:
|
|
4093
|
-
id:
|
|
4094
|
-
parentId:
|
|
4095
|
-
isDirectory:
|
|
4089
|
+
blobUrl: f.path,
|
|
4090
|
+
name: f.name,
|
|
4091
|
+
id: f.id,
|
|
4092
|
+
parentId: f.parentId,
|
|
4093
|
+
isDirectory: f.isDirectory
|
|
4096
4094
|
},
|
|
4097
4095
|
files: []
|
|
4098
4096
|
};
|
|
4099
|
-
const
|
|
4100
|
-
files:
|
|
4097
|
+
const y = await r.fileRouter.createFiles.mutate({
|
|
4098
|
+
files: h
|
|
4101
4099
|
});
|
|
4102
4100
|
return {
|
|
4103
|
-
directory:
|
|
4104
|
-
blobUrl:
|
|
4105
|
-
name:
|
|
4106
|
-
id:
|
|
4107
|
-
parentId:
|
|
4108
|
-
isDirectory:
|
|
4101
|
+
directory: f ? {
|
|
4102
|
+
blobUrl: f.path,
|
|
4103
|
+
name: f.name,
|
|
4104
|
+
id: f.id,
|
|
4105
|
+
parentId: f.parentId,
|
|
4106
|
+
isDirectory: f.isDirectory
|
|
4109
4107
|
} : null,
|
|
4110
|
-
files:
|
|
4108
|
+
files: y.map((m) => ({
|
|
4111
4109
|
blobUrl: m.path,
|
|
4112
4110
|
name: m.name,
|
|
4113
4111
|
id: m.id,
|
|
@@ -4124,8 +4122,8 @@ function Xo({
|
|
|
4124
4122
|
port: r = 5174,
|
|
4125
4123
|
token: n
|
|
4126
4124
|
}) {
|
|
4127
|
-
const [s, a] =
|
|
4128
|
-
() => new
|
|
4125
|
+
const [s, a] = Ws(null), u = Hs(
|
|
4126
|
+
() => new yi({
|
|
4129
4127
|
defaultOptions: {
|
|
4130
4128
|
queries: {
|
|
4131
4129
|
staleTime: 30 * 1e3,
|
|
@@ -4136,33 +4134,67 @@ function Xo({
|
|
|
4136
4134
|
}),
|
|
4137
4135
|
[]
|
|
4138
4136
|
);
|
|
4139
|
-
return
|
|
4140
|
-
const l = `${e}:${r}`, c =
|
|
4137
|
+
return Bs(() => {
|
|
4138
|
+
const l = `${e}:${r}`, c = Bo(l, n);
|
|
4141
4139
|
a(c);
|
|
4142
|
-
}, [e, r, n]), /* @__PURE__ */ gt.jsx(
|
|
4140
|
+
}, [e, r, n]), /* @__PURE__ */ gt.jsx(vi, { client: u, children: /* @__PURE__ */ gt.jsx(gs.Provider, { value: { host: e, port: r, client: s, token: n }, children: t }) });
|
|
4143
4141
|
}
|
|
4144
4142
|
function ct() {
|
|
4145
|
-
const t =
|
|
4143
|
+
const t = Gs(gs);
|
|
4146
4144
|
if (!t)
|
|
4147
4145
|
throw new Error("useFolioContext must be used within a FolioProvider");
|
|
4148
4146
|
return t;
|
|
4149
4147
|
}
|
|
4150
|
-
const { useEffect:
|
|
4148
|
+
const { useEffect: wn, useRef: Go, useState: En } = z;
|
|
4151
4149
|
function Zo({
|
|
4152
4150
|
width: t = "100%",
|
|
4153
4151
|
height: e = "100vh",
|
|
4154
4152
|
allow: r = "camera; microphone; clipboard-read; clipboard-write; fullscreen",
|
|
4155
4153
|
style: n,
|
|
4156
4154
|
className: s = "",
|
|
4157
|
-
iframeProps: a = {}
|
|
4155
|
+
iframeProps: a = {},
|
|
4156
|
+
debug: u = !1
|
|
4158
4157
|
}) {
|
|
4159
|
-
const { host:
|
|
4160
|
-
return
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4158
|
+
const { host: l, port: c, token: d } = ct(), f = Go(null), [h, y] = En(), [m, R] = En(!1);
|
|
4159
|
+
return wn(() => {
|
|
4160
|
+
const g = `${l}:${c}`;
|
|
4161
|
+
y(g), u && console.log("[FolioEmbed] Setting iframe URL:", g);
|
|
4162
|
+
}, [l, c, u]), wn(() => {
|
|
4163
|
+
var T, S, j, L;
|
|
4164
|
+
if (!d) {
|
|
4165
|
+
u && console.warn("[FolioEmbed] No token available to send");
|
|
4166
|
+
return;
|
|
4167
|
+
}
|
|
4168
|
+
const g = () => {
|
|
4169
|
+
var M, K, U, _, I;
|
|
4170
|
+
try {
|
|
4171
|
+
u && console.log("[FolioEmbed] Sending token to iframe", {
|
|
4172
|
+
readyState: (U = (K = (M = f.current) == null ? void 0 : M.contentWindow) == null ? void 0 : K.document) == null ? void 0 : U.readyState,
|
|
4173
|
+
tokenLength: d.length
|
|
4174
|
+
}), (I = (_ = f.current) == null ? void 0 : _.contentWindow) == null || I.postMessage(
|
|
4175
|
+
{ type: "folio-jwt", token: d },
|
|
4176
|
+
"*"
|
|
4177
|
+
), R(!0), u && console.log("[FolioEmbed] Token sent successfully");
|
|
4178
|
+
} catch (ie) {
|
|
4179
|
+
console.error("[FolioEmbed] Error sending token to iframe:", ie);
|
|
4180
|
+
}
|
|
4181
|
+
};
|
|
4182
|
+
((j = (S = (T = f.current) == null ? void 0 : T.contentWindow) == null ? void 0 : S.document) == null ? void 0 : j.readyState) === "complete" && g();
|
|
4183
|
+
const E = () => {
|
|
4184
|
+
u && console.log("[FolioEmbed] Iframe loaded, sending token"), g();
|
|
4185
|
+
};
|
|
4186
|
+
if ((L = f.current) == null || L.addEventListener("load", E), !m && f.current) {
|
|
4187
|
+
const M = () => {
|
|
4188
|
+
var K, U, _;
|
|
4189
|
+
((_ = (U = (K = f.current) == null ? void 0 : K.contentWindow) == null ? void 0 : U.document) == null ? void 0 : _.readyState) === "complete" ? (u && console.log("[FolioEmbed] Sending token on retry check"), g()) : m || setTimeout(M, 100);
|
|
4190
|
+
};
|
|
4191
|
+
setTimeout(M, 100);
|
|
4192
|
+
}
|
|
4193
|
+
return () => {
|
|
4194
|
+
var M;
|
|
4195
|
+
u && console.log("[FolioEmbed] Cleaning up event listener"), (M = f.current) == null || M.removeEventListener("load", E);
|
|
4196
|
+
};
|
|
4197
|
+
}, [d, l, c, m, u]), h ? /* @__PURE__ */ gt.jsx(
|
|
4166
4198
|
"div",
|
|
4167
4199
|
{
|
|
4168
4200
|
className: `folio-embed-container ${s}`,
|
|
@@ -4175,7 +4207,7 @@ function Zo({
|
|
|
4175
4207
|
children: /* @__PURE__ */ gt.jsx(
|
|
4176
4208
|
"iframe",
|
|
4177
4209
|
{
|
|
4178
|
-
ref:
|
|
4210
|
+
ref: f,
|
|
4179
4211
|
src: h,
|
|
4180
4212
|
width: "100%",
|
|
4181
4213
|
height: "100%",
|
|
@@ -4194,7 +4226,7 @@ function Zo({
|
|
|
4194
4226
|
) : null;
|
|
4195
4227
|
}
|
|
4196
4228
|
function ea() {
|
|
4197
|
-
const { client: t } = ct(), e =
|
|
4229
|
+
const { client: t } = ct(), e = Xn({
|
|
4198
4230
|
queryKey: ["folioProjects"],
|
|
4199
4231
|
queryFn: async () => {
|
|
4200
4232
|
if (!t) throw new Error("Folio client not initialized");
|
|
@@ -4211,7 +4243,7 @@ function ea() {
|
|
|
4211
4243
|
};
|
|
4212
4244
|
}
|
|
4213
4245
|
function ta(t) {
|
|
4214
|
-
const { client: e } = ct(), r =
|
|
4246
|
+
const { client: e } = ct(), r = Xn({
|
|
4215
4247
|
queryKey: ["folioFiles", t],
|
|
4216
4248
|
queryFn: async () => {
|
|
4217
4249
|
if (!e) throw new Error("Folio client not initialized");
|