@shiftengineering/folio 0.1.35 → 0.1.37
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.
|
@@ -3,19 +3,19 @@ var sn = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var Xs = (t, e, r) => e in t ? Js(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
6
|
-
var
|
|
7
|
-
var a = (t, e, r) => (
|
|
8
|
-
var
|
|
6
|
+
var nr = (t, e, r) => Xs(t, typeof e != "symbol" ? e + "" : e, r), sr = (t, e, r) => e.has(t) || sn("Cannot " + r);
|
|
7
|
+
var a = (t, e, r) => (sr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), O = (t, e, r) => e.has(t) ? sn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), E = (t, e, r, n) => (sr(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), F = (t, e, r) => (sr(t, e, "access private method"), r);
|
|
8
|
+
var _t = (t, e, r, n) => ({
|
|
9
9
|
set _(s) {
|
|
10
|
-
|
|
10
|
+
E(t, e, s, r);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return a(t, e, n);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
import * as K from "react";
|
|
17
|
-
import Vn, { createContext as Zs, useState as ei, useMemo as ti, useEffect as
|
|
18
|
-
var
|
|
17
|
+
import Vn, { createContext as Zs, useState as ei, useMemo as ti, useEffect as ir, useContext as ri } from "react";
|
|
18
|
+
var lr = { exports: {} }, pt = {};
|
|
19
19
|
/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
@@ -31,11 +31,11 @@ function ni() {
|
|
|
31
31
|
on = 1;
|
|
32
32
|
var t = Vn, 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, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
33
33
|
function u(l, c, h) {
|
|
34
|
-
var
|
|
35
|
-
h !== void 0 && (
|
|
36
|
-
for (
|
|
37
|
-
if (l && l.defaultProps) for (
|
|
38
|
-
return { $$typeof: e, type: l, key:
|
|
34
|
+
var p, f = {}, d = null, m = null;
|
|
35
|
+
h !== void 0 && (d = "" + h), c.key !== void 0 && (d = "" + c.key), c.ref !== void 0 && (m = c.ref);
|
|
36
|
+
for (p in c) n.call(c, p) && !i.hasOwnProperty(p) && (f[p] = c[p]);
|
|
37
|
+
if (l && l.defaultProps) for (p in c = l.defaultProps, c) f[p] === void 0 && (f[p] = c[p]);
|
|
38
|
+
return { $$typeof: e, type: l, key: d, ref: m, props: f, _owner: s.current };
|
|
39
39
|
}
|
|
40
40
|
return pt.Fragment = r, pt.jsx = u, pt.jsxs = u, pt;
|
|
41
41
|
}
|
|
@@ -52,46 +52,46 @@ var mt = {};
|
|
|
52
52
|
var an;
|
|
53
53
|
function si() {
|
|
54
54
|
return an || (an = 1, process.env.NODE_ENV !== "production" && function() {
|
|
55
|
-
var t = Vn, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"),
|
|
56
|
-
function
|
|
55
|
+
var t = Vn, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), b = Symbol.iterator, g = "@@iterator";
|
|
56
|
+
function w(o) {
|
|
57
57
|
if (o === null || typeof o != "object")
|
|
58
58
|
return null;
|
|
59
|
-
var
|
|
60
|
-
return typeof
|
|
59
|
+
var y = b && o[b] || o[g];
|
|
60
|
+
return typeof y == "function" ? y : null;
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
63
63
|
function P(o) {
|
|
64
64
|
{
|
|
65
|
-
for (var
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
for (var y = arguments.length, R = new Array(y > 1 ? y - 1 : 0), C = 1; C < y; C++)
|
|
66
|
+
R[C - 1] = arguments[C];
|
|
67
|
+
S("error", o, R);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function S(o, y, R) {
|
|
71
71
|
{
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
return String(
|
|
72
|
+
var C = v.ReactDebugCurrentFrame, k = C.getStackAddendum();
|
|
73
|
+
k !== "" && (y += "%s", R = R.concat([k]));
|
|
74
|
+
var q = R.map(function(D) {
|
|
75
|
+
return String(D);
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
q.unshift("Warning: " + y), Function.prototype.apply.call(console[o], console, q);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
var
|
|
81
|
-
|
|
80
|
+
var T = !1, j = !1, Z = !1, z = !1, U = !1, M;
|
|
81
|
+
M = Symbol.for("react.module.reference");
|
|
82
82
|
function ge(o) {
|
|
83
|
-
return !!(typeof o == "string" || typeof o == "function" || o === n || o === i || U || o === s || o === h || o ===
|
|
83
|
+
return !!(typeof o == "string" || typeof o == "function" || o === n || o === i || U || o === s || o === h || o === p || z || o === m || T || j || Z || typeof o == "object" && o !== null && (o.$$typeof === d || o.$$typeof === f || o.$$typeof === u || o.$$typeof === l || o.$$typeof === c || // This needs to include all possible module reference object
|
|
84
84
|
// types supported by any Flight configuration anywhere since
|
|
85
85
|
// we don't know which Flight build this will end up being used
|
|
86
86
|
// with.
|
|
87
|
-
o.$$typeof ===
|
|
87
|
+
o.$$typeof === M || o.getModuleId !== void 0));
|
|
88
88
|
}
|
|
89
|
-
function ve(o,
|
|
90
|
-
var
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
var
|
|
94
|
-
return
|
|
89
|
+
function ve(o, y, R) {
|
|
90
|
+
var C = o.displayName;
|
|
91
|
+
if (C)
|
|
92
|
+
return C;
|
|
93
|
+
var k = y.displayName || y.name || "";
|
|
94
|
+
return k !== "" ? R + "(" + k + ")" : R;
|
|
95
95
|
}
|
|
96
96
|
function De(o) {
|
|
97
97
|
return o.displayName || "Context";
|
|
@@ -114,26 +114,26 @@ function si() {
|
|
|
114
114
|
return "StrictMode";
|
|
115
115
|
case h:
|
|
116
116
|
return "Suspense";
|
|
117
|
-
case
|
|
117
|
+
case p:
|
|
118
118
|
return "SuspenseList";
|
|
119
119
|
}
|
|
120
120
|
if (typeof o == "object")
|
|
121
121
|
switch (o.$$typeof) {
|
|
122
122
|
case l:
|
|
123
|
-
var
|
|
124
|
-
return De(
|
|
123
|
+
var y = o;
|
|
124
|
+
return De(y) + ".Consumer";
|
|
125
125
|
case u:
|
|
126
|
-
var
|
|
127
|
-
return De(
|
|
126
|
+
var R = o;
|
|
127
|
+
return De(R._context) + ".Provider";
|
|
128
128
|
case c:
|
|
129
129
|
return ve(o, o.render, "ForwardRef");
|
|
130
|
-
case
|
|
131
|
-
var
|
|
132
|
-
return
|
|
133
|
-
case
|
|
134
|
-
var
|
|
130
|
+
case f:
|
|
131
|
+
var C = o.displayName || null;
|
|
132
|
+
return C !== null ? C : be(o.type) || "Memo";
|
|
133
|
+
case d: {
|
|
134
|
+
var k = o, q = k._payload, D = k._init;
|
|
135
135
|
try {
|
|
136
|
-
return be(
|
|
136
|
+
return be(D(q));
|
|
137
137
|
} catch {
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
@@ -141,14 +141,14 @@ function si() {
|
|
|
141
141
|
}
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var ke = Object.assign, ht = 0, jr, qr, Mr, Ur, Nr, Lr, Qr;
|
|
145
145
|
function $r() {
|
|
146
146
|
}
|
|
147
147
|
$r.__reactDisabledLog = !0;
|
|
148
|
-
function
|
|
148
|
+
function Os() {
|
|
149
149
|
{
|
|
150
150
|
if (ht === 0) {
|
|
151
|
-
jr = console.log, qr = console.info,
|
|
151
|
+
jr = console.log, qr = console.info, Mr = console.warn, Ur = console.error, Nr = console.group, Lr = console.groupCollapsed, Qr = console.groupEnd;
|
|
152
152
|
var o = {
|
|
153
153
|
configurable: !0,
|
|
154
154
|
enumerable: !0,
|
|
@@ -177,25 +177,25 @@ function si() {
|
|
|
177
177
|
writable: !0
|
|
178
178
|
};
|
|
179
179
|
Object.defineProperties(console, {
|
|
180
|
-
log:
|
|
180
|
+
log: ke({}, o, {
|
|
181
181
|
value: jr
|
|
182
182
|
}),
|
|
183
|
-
info:
|
|
183
|
+
info: ke({}, o, {
|
|
184
184
|
value: qr
|
|
185
185
|
}),
|
|
186
|
-
warn:
|
|
187
|
-
value: Ur
|
|
188
|
-
}),
|
|
189
|
-
error: _e({}, o, {
|
|
186
|
+
warn: ke({}, o, {
|
|
190
187
|
value: Mr
|
|
191
188
|
}),
|
|
192
|
-
|
|
189
|
+
error: ke({}, o, {
|
|
190
|
+
value: Ur
|
|
191
|
+
}),
|
|
192
|
+
group: ke({}, o, {
|
|
193
193
|
value: Nr
|
|
194
194
|
}),
|
|
195
|
-
groupCollapsed:
|
|
195
|
+
groupCollapsed: ke({}, o, {
|
|
196
196
|
value: Lr
|
|
197
197
|
}),
|
|
198
|
-
groupEnd:
|
|
198
|
+
groupEnd: ke({}, o, {
|
|
199
199
|
value: Qr
|
|
200
200
|
})
|
|
201
201
|
});
|
|
@@ -203,104 +203,104 @@ function si() {
|
|
|
203
203
|
ht < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
function xt(o,
|
|
206
|
+
var Gt = v.ReactCurrentDispatcher, Yt;
|
|
207
|
+
function xt(o, y, R) {
|
|
208
208
|
{
|
|
209
|
-
if (
|
|
209
|
+
if (Yt === void 0)
|
|
210
210
|
try {
|
|
211
211
|
throw Error();
|
|
212
|
-
} catch (
|
|
213
|
-
var
|
|
214
|
-
|
|
212
|
+
} catch (k) {
|
|
213
|
+
var C = k.stack.trim().match(/\n( *(at )?)/);
|
|
214
|
+
Yt = C && C[1] || "";
|
|
215
215
|
}
|
|
216
216
|
return `
|
|
217
|
-
` +
|
|
217
|
+
` + Yt + o;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
var
|
|
220
|
+
var Jt = !1, It;
|
|
221
221
|
{
|
|
222
222
|
var Cs = typeof WeakMap == "function" ? WeakMap : Map;
|
|
223
223
|
It = new Cs();
|
|
224
224
|
}
|
|
225
|
-
function Kr(o,
|
|
226
|
-
if (!o ||
|
|
225
|
+
function Kr(o, y) {
|
|
226
|
+
if (!o || Jt)
|
|
227
227
|
return "";
|
|
228
228
|
{
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
return
|
|
229
|
+
var R = It.get(o);
|
|
230
|
+
if (R !== void 0)
|
|
231
|
+
return R;
|
|
232
232
|
}
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
var
|
|
233
|
+
var C;
|
|
234
|
+
Jt = !0;
|
|
235
|
+
var k = Error.prepareStackTrace;
|
|
236
236
|
Error.prepareStackTrace = void 0;
|
|
237
|
-
var
|
|
238
|
-
|
|
237
|
+
var q;
|
|
238
|
+
q = Gt.current, Gt.current = null, Os();
|
|
239
239
|
try {
|
|
240
|
-
if (
|
|
241
|
-
var
|
|
240
|
+
if (y) {
|
|
241
|
+
var D = function() {
|
|
242
242
|
throw Error();
|
|
243
243
|
};
|
|
244
|
-
if (Object.defineProperty(
|
|
244
|
+
if (Object.defineProperty(D.prototype, "props", {
|
|
245
245
|
set: function() {
|
|
246
246
|
throw Error();
|
|
247
247
|
}
|
|
248
248
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
249
249
|
try {
|
|
250
|
-
Reflect.construct(
|
|
250
|
+
Reflect.construct(D, []);
|
|
251
251
|
} catch (Y) {
|
|
252
|
-
|
|
252
|
+
C = Y;
|
|
253
253
|
}
|
|
254
|
-
Reflect.construct(o, [],
|
|
254
|
+
Reflect.construct(o, [], D);
|
|
255
255
|
} else {
|
|
256
256
|
try {
|
|
257
|
-
|
|
257
|
+
D.call();
|
|
258
258
|
} catch (Y) {
|
|
259
|
-
|
|
259
|
+
C = Y;
|
|
260
260
|
}
|
|
261
|
-
o.call(
|
|
261
|
+
o.call(D.prototype);
|
|
262
262
|
}
|
|
263
263
|
} else {
|
|
264
264
|
try {
|
|
265
265
|
throw Error();
|
|
266
266
|
} catch (Y) {
|
|
267
|
-
|
|
267
|
+
C = Y;
|
|
268
268
|
}
|
|
269
269
|
o();
|
|
270
270
|
}
|
|
271
271
|
} catch (Y) {
|
|
272
|
-
if (Y &&
|
|
273
|
-
for (var
|
|
274
|
-
`), W =
|
|
275
|
-
`), L =
|
|
272
|
+
if (Y && C && typeof Y.stack == "string") {
|
|
273
|
+
for (var A = Y.stack.split(`
|
|
274
|
+
`), W = C.stack.split(`
|
|
275
|
+
`), L = A.length - 1, Q = W.length - 1; L >= 1 && Q >= 0 && A[L] !== W[Q]; )
|
|
276
276
|
Q--;
|
|
277
277
|
for (; L >= 1 && Q >= 0; L--, Q--)
|
|
278
|
-
if (
|
|
278
|
+
if (A[L] !== W[Q]) {
|
|
279
279
|
if (L !== 1 || Q !== 1)
|
|
280
280
|
do
|
|
281
|
-
if (L--, Q--, Q < 0 ||
|
|
282
|
-
var
|
|
283
|
-
` +
|
|
284
|
-
return o.displayName &&
|
|
281
|
+
if (L--, Q--, Q < 0 || A[L] !== W[Q]) {
|
|
282
|
+
var te = `
|
|
283
|
+
` + A[L].replace(" at new ", " at ");
|
|
284
|
+
return o.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", o.displayName)), typeof o == "function" && It.set(o, te), te;
|
|
285
285
|
}
|
|
286
286
|
while (L >= 1 && Q >= 0);
|
|
287
287
|
break;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
} finally {
|
|
291
|
-
|
|
291
|
+
Jt = !1, Gt.current = q, Ss(), Error.prepareStackTrace = k;
|
|
292
292
|
}
|
|
293
|
-
var Be = o ? o.displayName || o.name : "",
|
|
294
|
-
return typeof o == "function" && It.set(o,
|
|
293
|
+
var Be = o ? o.displayName || o.name : "", _e = Be ? xt(Be) : "";
|
|
294
|
+
return typeof o == "function" && It.set(o, _e), _e;
|
|
295
295
|
}
|
|
296
|
-
function Ts(o,
|
|
296
|
+
function Ts(o, y, R) {
|
|
297
297
|
return Kr(o, !1);
|
|
298
298
|
}
|
|
299
299
|
function Fs(o) {
|
|
300
|
-
var
|
|
301
|
-
return !!(
|
|
300
|
+
var y = o.prototype;
|
|
301
|
+
return !!(y && y.isReactComponent);
|
|
302
302
|
}
|
|
303
|
-
function Dt(o,
|
|
303
|
+
function Dt(o, y, R) {
|
|
304
304
|
if (o == null)
|
|
305
305
|
return "";
|
|
306
306
|
if (typeof o == "function")
|
|
@@ -310,187 +310,187 @@ function si() {
|
|
|
310
310
|
switch (o) {
|
|
311
311
|
case h:
|
|
312
312
|
return xt("Suspense");
|
|
313
|
-
case
|
|
313
|
+
case p:
|
|
314
314
|
return xt("SuspenseList");
|
|
315
315
|
}
|
|
316
316
|
if (typeof o == "object")
|
|
317
317
|
switch (o.$$typeof) {
|
|
318
318
|
case c:
|
|
319
319
|
return Ts(o.render);
|
|
320
|
-
case
|
|
321
|
-
return Dt(o.type,
|
|
322
|
-
case
|
|
323
|
-
var
|
|
320
|
+
case f:
|
|
321
|
+
return Dt(o.type, y, R);
|
|
322
|
+
case d: {
|
|
323
|
+
var C = o, k = C._payload, q = C._init;
|
|
324
324
|
try {
|
|
325
|
-
return Dt(k
|
|
325
|
+
return Dt(q(k), y, R);
|
|
326
326
|
} catch {
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
return "";
|
|
331
331
|
}
|
|
332
|
-
var yt = Object.prototype.hasOwnProperty, zr = {}, Vr =
|
|
333
|
-
function
|
|
332
|
+
var yt = Object.prototype.hasOwnProperty, zr = {}, Vr = v.ReactDebugCurrentFrame;
|
|
333
|
+
function kt(o) {
|
|
334
334
|
if (o) {
|
|
335
|
-
var
|
|
336
|
-
Vr.setExtraStackFrame(
|
|
335
|
+
var y = o._owner, R = Dt(o.type, o._source, y ? y.type : null);
|
|
336
|
+
Vr.setExtraStackFrame(R);
|
|
337
337
|
} else
|
|
338
338
|
Vr.setExtraStackFrame(null);
|
|
339
339
|
}
|
|
340
|
-
function As(o,
|
|
340
|
+
function As(o, y, R, C, k) {
|
|
341
341
|
{
|
|
342
|
-
var
|
|
343
|
-
for (var
|
|
344
|
-
if (
|
|
345
|
-
var
|
|
342
|
+
var q = Function.call.bind(yt);
|
|
343
|
+
for (var D in o)
|
|
344
|
+
if (q(o, D)) {
|
|
345
|
+
var A = void 0;
|
|
346
346
|
try {
|
|
347
|
-
if (typeof o[
|
|
348
|
-
var W = Error((
|
|
347
|
+
if (typeof o[D] != "function") {
|
|
348
|
+
var W = Error((C || "React class") + ": " + R + " type `" + D + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[D] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
349
349
|
throw W.name = "Invariant Violation", W;
|
|
350
350
|
}
|
|
351
|
-
|
|
351
|
+
A = o[D](y, D, C, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
352
352
|
} catch (L) {
|
|
353
|
-
|
|
353
|
+
A = L;
|
|
354
354
|
}
|
|
355
|
-
|
|
355
|
+
A && !(A instanceof Error) && (kt(k), P("%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).", C || "React class", R, D, typeof A), kt(null)), A instanceof Error && !(A.message in zr) && (zr[A.message] = !0, kt(k), P("Failed %s type: %s", R, A.message), kt(null));
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
var xs = Array.isArray;
|
|
360
|
-
function
|
|
360
|
+
function Xt(o) {
|
|
361
361
|
return xs(o);
|
|
362
362
|
}
|
|
363
363
|
function Is(o) {
|
|
364
364
|
{
|
|
365
|
-
var
|
|
366
|
-
return
|
|
365
|
+
var y = typeof Symbol == "function" && Symbol.toStringTag, R = y && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
366
|
+
return R;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
function Ds(o) {
|
|
370
370
|
try {
|
|
371
|
-
return
|
|
371
|
+
return Hr(o), !1;
|
|
372
372
|
} catch {
|
|
373
373
|
return !0;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Hr(o) {
|
|
377
377
|
return "" + o;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Wr(o) {
|
|
380
380
|
if (Ds(o))
|
|
381
|
-
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Is(o)),
|
|
381
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Is(o)), Hr(o);
|
|
382
382
|
}
|
|
383
|
-
var Br =
|
|
383
|
+
var Br = v.ReactCurrentOwner, ks = {
|
|
384
384
|
key: !0,
|
|
385
385
|
ref: !0,
|
|
386
386
|
__self: !0,
|
|
387
387
|
__source: !0
|
|
388
388
|
}, Gr, Yr;
|
|
389
|
-
function
|
|
389
|
+
function _s(o) {
|
|
390
390
|
if (yt.call(o, "ref")) {
|
|
391
|
-
var
|
|
392
|
-
if (
|
|
391
|
+
var y = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
392
|
+
if (y && y.isReactWarning)
|
|
393
393
|
return !1;
|
|
394
394
|
}
|
|
395
395
|
return o.ref !== void 0;
|
|
396
396
|
}
|
|
397
397
|
function js(o) {
|
|
398
398
|
if (yt.call(o, "key")) {
|
|
399
|
-
var
|
|
400
|
-
if (
|
|
399
|
+
var y = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
400
|
+
if (y && y.isReactWarning)
|
|
401
401
|
return !1;
|
|
402
402
|
}
|
|
403
403
|
return o.key !== void 0;
|
|
404
404
|
}
|
|
405
|
-
function qs(o,
|
|
405
|
+
function qs(o, y) {
|
|
406
406
|
typeof o.ref == "string" && Br.current;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Ms(o, y) {
|
|
409
409
|
{
|
|
410
|
-
var
|
|
411
|
-
Gr || (Gr = !0, P("%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)",
|
|
410
|
+
var R = function() {
|
|
411
|
+
Gr || (Gr = !0, P("%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)", y));
|
|
412
412
|
};
|
|
413
|
-
|
|
414
|
-
get:
|
|
413
|
+
R.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
414
|
+
get: R,
|
|
415
415
|
configurable: !0
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Us(o, y) {
|
|
420
420
|
{
|
|
421
|
-
var
|
|
422
|
-
Yr || (Yr = !0, P("%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)",
|
|
421
|
+
var R = function() {
|
|
422
|
+
Yr || (Yr = !0, P("%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)", y));
|
|
423
423
|
};
|
|
424
|
-
|
|
425
|
-
get:
|
|
424
|
+
R.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
425
|
+
get: R,
|
|
426
426
|
configurable: !0
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
var Ns = function(o,
|
|
431
|
-
var
|
|
430
|
+
var Ns = function(o, y, R, C, k, q, D) {
|
|
431
|
+
var A = {
|
|
432
432
|
// This tag allows us to uniquely identify this as a React Element
|
|
433
433
|
$$typeof: e,
|
|
434
434
|
// Built-in properties that belong on the element
|
|
435
435
|
type: o,
|
|
436
|
-
key:
|
|
437
|
-
ref:
|
|
438
|
-
props:
|
|
436
|
+
key: y,
|
|
437
|
+
ref: R,
|
|
438
|
+
props: D,
|
|
439
439
|
// Record the component responsible for creating this element.
|
|
440
|
-
_owner:
|
|
440
|
+
_owner: q
|
|
441
441
|
};
|
|
442
|
-
return
|
|
442
|
+
return A._store = {}, Object.defineProperty(A._store, "validated", {
|
|
443
443
|
configurable: !1,
|
|
444
444
|
enumerable: !1,
|
|
445
445
|
writable: !0,
|
|
446
446
|
value: !1
|
|
447
|
-
}), Object.defineProperty(
|
|
447
|
+
}), Object.defineProperty(A, "_self", {
|
|
448
448
|
configurable: !1,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !1,
|
|
451
|
-
value:
|
|
452
|
-
}), Object.defineProperty(
|
|
451
|
+
value: C
|
|
452
|
+
}), Object.defineProperty(A, "_source", {
|
|
453
453
|
configurable: !1,
|
|
454
454
|
enumerable: !1,
|
|
455
455
|
writable: !1,
|
|
456
|
-
value:
|
|
457
|
-
}), Object.freeze && (Object.freeze(
|
|
456
|
+
value: k
|
|
457
|
+
}), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
|
|
458
458
|
};
|
|
459
|
-
function Ls(o,
|
|
459
|
+
function Ls(o, y, R, C, k) {
|
|
460
460
|
{
|
|
461
|
-
var
|
|
462
|
-
|
|
463
|
-
for (
|
|
464
|
-
yt.call(
|
|
461
|
+
var q, D = {}, A = null, W = null;
|
|
462
|
+
R !== void 0 && (Wr(R), A = "" + R), js(y) && (Wr(y.key), A = "" + y.key), _s(y) && (W = y.ref, qs(y, k));
|
|
463
|
+
for (q in y)
|
|
464
|
+
yt.call(y, q) && !ks.hasOwnProperty(q) && (D[q] = y[q]);
|
|
465
465
|
if (o && o.defaultProps) {
|
|
466
466
|
var L = o.defaultProps;
|
|
467
|
-
for (
|
|
468
|
-
|
|
467
|
+
for (q in L)
|
|
468
|
+
D[q] === void 0 && (D[q] = L[q]);
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
470
|
+
if (A || W) {
|
|
471
471
|
var Q = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
472
|
-
|
|
472
|
+
A && Ms(D, Q), W && Us(D, Q);
|
|
473
473
|
}
|
|
474
|
-
return Ns(o,
|
|
474
|
+
return Ns(o, A, W, k, C, Br.current, D);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
var
|
|
478
|
-
function
|
|
477
|
+
var Zt = v.ReactCurrentOwner, Jr = v.ReactDebugCurrentFrame;
|
|
478
|
+
function We(o) {
|
|
479
479
|
if (o) {
|
|
480
|
-
var
|
|
481
|
-
Jr.setExtraStackFrame(
|
|
480
|
+
var y = o._owner, R = Dt(o.type, o._source, y ? y.type : null);
|
|
481
|
+
Jr.setExtraStackFrame(R);
|
|
482
482
|
} else
|
|
483
483
|
Jr.setExtraStackFrame(null);
|
|
484
484
|
}
|
|
485
|
-
var
|
|
486
|
-
|
|
487
|
-
function
|
|
485
|
+
var er;
|
|
486
|
+
er = !1;
|
|
487
|
+
function tr(o) {
|
|
488
488
|
return typeof o == "object" && o !== null && o.$$typeof === e;
|
|
489
489
|
}
|
|
490
490
|
function Xr() {
|
|
491
491
|
{
|
|
492
|
-
if (
|
|
493
|
-
var o = be(
|
|
492
|
+
if (Zt.current) {
|
|
493
|
+
var o = be(Zt.current.type);
|
|
494
494
|
if (o)
|
|
495
495
|
return `
|
|
496
496
|
|
|
@@ -505,149 +505,149 @@ Check the render method of \`` + o + "`.";
|
|
|
505
505
|
var Zr = {};
|
|
506
506
|
function $s(o) {
|
|
507
507
|
{
|
|
508
|
-
var
|
|
509
|
-
if (!
|
|
510
|
-
var
|
|
511
|
-
|
|
508
|
+
var y = Xr();
|
|
509
|
+
if (!y) {
|
|
510
|
+
var R = typeof o == "string" ? o : o.displayName || o.name;
|
|
511
|
+
R && (y = `
|
|
512
512
|
|
|
513
|
-
Check the top-level render call using <` +
|
|
513
|
+
Check the top-level render call using <` + R + ">.");
|
|
514
514
|
}
|
|
515
|
-
return
|
|
515
|
+
return y;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function en(o,
|
|
518
|
+
function en(o, y) {
|
|
519
519
|
{
|
|
520
520
|
if (!o._store || o._store.validated || o.key != null)
|
|
521
521
|
return;
|
|
522
522
|
o._store.validated = !0;
|
|
523
|
-
var
|
|
524
|
-
if (Zr[
|
|
523
|
+
var R = $s(y);
|
|
524
|
+
if (Zr[R])
|
|
525
525
|
return;
|
|
526
|
-
Zr[
|
|
527
|
-
var
|
|
528
|
-
o && o._owner && o._owner !==
|
|
526
|
+
Zr[R] = !0;
|
|
527
|
+
var C = "";
|
|
528
|
+
o && o._owner && o._owner !== Zt.current && (C = " It was passed a child from " + be(o._owner.type) + "."), We(o), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', R, C), We(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function tn(o,
|
|
531
|
+
function tn(o, y) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof o != "object")
|
|
534
534
|
return;
|
|
535
|
-
if (
|
|
536
|
-
for (var
|
|
537
|
-
var
|
|
538
|
-
|
|
535
|
+
if (Xt(o))
|
|
536
|
+
for (var R = 0; R < o.length; R++) {
|
|
537
|
+
var C = o[R];
|
|
538
|
+
tr(C) && en(C, y);
|
|
539
539
|
}
|
|
540
|
-
else if (
|
|
540
|
+
else if (tr(o))
|
|
541
541
|
o._store && (o._store.validated = !0);
|
|
542
542
|
else if (o) {
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
for (var
|
|
546
|
-
|
|
543
|
+
var k = w(o);
|
|
544
|
+
if (typeof k == "function" && k !== o.entries)
|
|
545
|
+
for (var q = k.call(o), D; !(D = q.next()).done; )
|
|
546
|
+
tr(D.value) && en(D.value, y);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
function Ks(o) {
|
|
551
551
|
{
|
|
552
|
-
var
|
|
553
|
-
if (
|
|
552
|
+
var y = o.type;
|
|
553
|
+
if (y == null || typeof y == "string")
|
|
554
554
|
return;
|
|
555
|
-
var
|
|
556
|
-
if (typeof
|
|
557
|
-
|
|
558
|
-
else if (typeof
|
|
555
|
+
var R;
|
|
556
|
+
if (typeof y == "function")
|
|
557
|
+
R = y.propTypes;
|
|
558
|
+
else if (typeof y == "object" && (y.$$typeof === c || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
y.$$typeof === f))
|
|
561
|
+
R = y.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
|
-
if (
|
|
565
|
-
var
|
|
566
|
-
As(
|
|
567
|
-
} else if (
|
|
568
|
-
|
|
569
|
-
var
|
|
570
|
-
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
564
|
+
if (R) {
|
|
565
|
+
var C = be(y);
|
|
566
|
+
As(R, o.props, "prop", C, o);
|
|
567
|
+
} else if (y.PropTypes !== void 0 && !er) {
|
|
568
|
+
er = !0;
|
|
569
|
+
var k = be(y);
|
|
570
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof
|
|
572
|
+
typeof y.getDefaultProps == "function" && !y.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function zs(o) {
|
|
576
576
|
{
|
|
577
|
-
for (var
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
580
|
-
|
|
577
|
+
for (var y = Object.keys(o.props), R = 0; R < y.length; R++) {
|
|
578
|
+
var C = y[R];
|
|
579
|
+
if (C !== "children" && C !== "key") {
|
|
580
|
+
We(o), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), We(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
o.ref !== null && (
|
|
584
|
+
o.ref !== null && (We(o), P("Invalid attribute `ref` supplied to `React.Fragment`."), We(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
var rn = {};
|
|
588
|
-
function nn(o,
|
|
588
|
+
function nn(o, y, R, C, k, q) {
|
|
589
589
|
{
|
|
590
|
-
var
|
|
591
|
-
if (!
|
|
592
|
-
var
|
|
593
|
-
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (
|
|
590
|
+
var D = ge(o);
|
|
591
|
+
if (!D) {
|
|
592
|
+
var A = "";
|
|
593
|
+
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
594
|
var W = Qs();
|
|
595
|
-
W ?
|
|
595
|
+
W ? A += W : A += Xr();
|
|
596
596
|
var L;
|
|
597
|
-
o === null ? L = "null" :
|
|
597
|
+
o === null ? L = "null" : Xt(o) ? L = "array" : o !== void 0 && o.$$typeof === e ? (L = "<" + (be(o.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : L = typeof o, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, A);
|
|
598
598
|
}
|
|
599
|
-
var Q = Ls(o,
|
|
599
|
+
var Q = Ls(o, y, R, k, q);
|
|
600
600
|
if (Q == null)
|
|
601
601
|
return Q;
|
|
602
|
-
if (
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
for (var Be = 0; Be <
|
|
608
|
-
tn(
|
|
609
|
-
Object.freeze && Object.freeze(
|
|
602
|
+
if (D) {
|
|
603
|
+
var te = y.children;
|
|
604
|
+
if (te !== void 0)
|
|
605
|
+
if (C)
|
|
606
|
+
if (Xt(te)) {
|
|
607
|
+
for (var Be = 0; Be < te.length; Be++)
|
|
608
|
+
tn(te[Be], o);
|
|
609
|
+
Object.freeze && Object.freeze(te);
|
|
610
610
|
} else
|
|
611
611
|
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
612
|
else
|
|
613
|
-
tn(
|
|
613
|
+
tn(te, o);
|
|
614
614
|
}
|
|
615
|
-
if (yt.call(
|
|
616
|
-
var
|
|
615
|
+
if (yt.call(y, "key")) {
|
|
616
|
+
var _e = be(o), Y = Object.keys(y).filter(function(Ys) {
|
|
617
617
|
return Ys !== "key";
|
|
618
|
-
}),
|
|
619
|
-
if (!rn[
|
|
618
|
+
}), rr = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!rn[_e + rr]) {
|
|
620
620
|
var Gs = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
621
621
|
P(`A props object containing a "key" prop is being spread into JSX:
|
|
622
622
|
let props = %s;
|
|
623
623
|
<%s {...props} />
|
|
624
624
|
React keys must be passed directly to JSX without using spread:
|
|
625
625
|
let props = %s;
|
|
626
|
-
<%s key={someKey} {...props} />`,
|
|
626
|
+
<%s key={someKey} {...props} />`, rr, _e, Gs, _e), rn[_e + rr] = !0;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
return o === n ? zs(Q) : Ks(Q), Q;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function Vs(o,
|
|
633
|
-
return nn(o,
|
|
632
|
+
function Vs(o, y, R) {
|
|
633
|
+
return nn(o, y, R, !0);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return nn(o,
|
|
635
|
+
function Hs(o, y, R) {
|
|
636
|
+
return nn(o, y, R, !1);
|
|
637
637
|
}
|
|
638
|
-
var
|
|
639
|
-
mt.Fragment = n, mt.jsx =
|
|
638
|
+
var Ws = Hs, Bs = Vs;
|
|
639
|
+
mt.Fragment = n, mt.jsx = Ws, mt.jsxs = Bs;
|
|
640
640
|
}()), mt;
|
|
641
641
|
}
|
|
642
|
-
process.env.NODE_ENV === "production" ?
|
|
643
|
-
var wt =
|
|
642
|
+
process.env.NODE_ENV === "production" ? lr.exports = ni() : lr.exports = si();
|
|
643
|
+
var wt = lr.exports, Mt = /* @__PURE__ */ ((t) => (t.NOT_CHUNKED = "NOT_CHUNKED", t.PROCESSING = "PROCESSING", t.CHUNKED = "CHUNKED", t.ERROR_CHUNKING = "ERROR_CHUNKING", t))(Mt || {}), Lt = /* @__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))(Lt || {});
|
|
644
644
|
const gt = 4e3 * 1024 * 1024, ii = [
|
|
645
645
|
".txt",
|
|
646
646
|
".json",
|
|
647
647
|
".py",
|
|
648
648
|
".ts",
|
|
649
649
|
".tsx"
|
|
650
|
-
],
|
|
650
|
+
], Hn = {
|
|
651
651
|
"application/pdf": {
|
|
652
652
|
extensions: [".pdf"],
|
|
653
653
|
maxSize: gt
|
|
@@ -669,14 +669,14 @@ const gt = 4e3 * 1024 * 1024, ii = [
|
|
|
669
669
|
maxSize: gt
|
|
670
670
|
}
|
|
671
671
|
};
|
|
672
|
-
Object.entries(
|
|
672
|
+
Object.entries(Hn).reduce(
|
|
673
673
|
(t, [e, r]) => ({
|
|
674
674
|
...t,
|
|
675
675
|
[e]: r.extensions
|
|
676
676
|
}),
|
|
677
677
|
{}
|
|
678
678
|
);
|
|
679
|
-
const oi = new Set(Object.values(
|
|
679
|
+
const oi = new Set(Object.values(Lt));
|
|
680
680
|
var ft = class {
|
|
681
681
|
constructor() {
|
|
682
682
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -694,15 +694,15 @@ var ft = class {
|
|
|
694
694
|
onUnsubscribe() {
|
|
695
695
|
}
|
|
696
696
|
}, ze = typeof window > "u" || "Deno" in globalThis;
|
|
697
|
-
function
|
|
697
|
+
function ne() {
|
|
698
698
|
}
|
|
699
699
|
function ai(t, e) {
|
|
700
700
|
return typeof t == "function" ? t(e) : t;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function fr(t) {
|
|
703
703
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Wn(t, e) {
|
|
706
706
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
707
707
|
}
|
|
708
708
|
function Ye(t, e) {
|
|
@@ -753,28 +753,28 @@ function Ir(t, e) {
|
|
|
753
753
|
function Ve(t) {
|
|
754
754
|
return JSON.stringify(
|
|
755
755
|
t,
|
|
756
|
-
(e, r) =>
|
|
756
|
+
(e, r) => hr(r) ? Object.keys(r).sort().reduce((n, s) => (n[s] = r[s], n), {}) : r
|
|
757
757
|
);
|
|
758
758
|
}
|
|
759
759
|
function Et(t, e) {
|
|
760
760
|
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((r) => !Et(t[r], e[r])) : !1;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function dr(t, e) {
|
|
763
763
|
if (t === e)
|
|
764
764
|
return t;
|
|
765
765
|
const r = ln(t) && ln(e);
|
|
766
|
-
if (r ||
|
|
766
|
+
if (r || hr(t) && hr(e)) {
|
|
767
767
|
const n = r ? t : Object.keys(t), s = n.length, i = r ? e : Object.keys(e), u = i.length, l = r ? [] : {};
|
|
768
768
|
let c = 0;
|
|
769
769
|
for (let h = 0; h < u; h++) {
|
|
770
|
-
const
|
|
771
|
-
(!r && n.includes(
|
|
770
|
+
const p = r ? h : i[h];
|
|
771
|
+
(!r && n.includes(p) || r) && t[p] === void 0 && e[p] === void 0 ? (l[p] = void 0, c++) : (l[p] = dr(t[p], e[p]), l[p] === t[p] && t[p] !== void 0 && c++);
|
|
772
772
|
}
|
|
773
773
|
return s === u && c === s ? t : l;
|
|
774
774
|
}
|
|
775
775
|
return e;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Qt(t, e) {
|
|
778
778
|
if (!e || Object.keys(t).length !== Object.keys(e).length)
|
|
779
779
|
return !1;
|
|
780
780
|
for (const r in t)
|
|
@@ -785,7 +785,7 @@ function Nt(t, e) {
|
|
|
785
785
|
function ln(t) {
|
|
786
786
|
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function hr(t) {
|
|
789
789
|
if (!fn(t))
|
|
790
790
|
return !1;
|
|
791
791
|
const e = t.constructor;
|
|
@@ -802,19 +802,19 @@ function ui(t) {
|
|
|
802
802
|
setTimeout(e, t);
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function yr(t, e, r) {
|
|
806
806
|
if (typeof r.structuralSharing == "function")
|
|
807
807
|
return r.structuralSharing(t, e);
|
|
808
808
|
if (r.structuralSharing !== !1) {
|
|
809
809
|
if (process.env.NODE_ENV !== "production")
|
|
810
810
|
try {
|
|
811
|
-
return
|
|
811
|
+
return dr(t, e);
|
|
812
812
|
} catch (n) {
|
|
813
813
|
console.error(
|
|
814
814
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`
|
|
815
815
|
);
|
|
816
816
|
}
|
|
817
|
-
return
|
|
817
|
+
return dr(t, e);
|
|
818
818
|
}
|
|
819
819
|
return e;
|
|
820
820
|
}
|
|
@@ -826,19 +826,19 @@ function li(t, e, r = 0) {
|
|
|
826
826
|
const n = [e, ...t];
|
|
827
827
|
return r && n.length > r ? n.slice(0, -1) : n;
|
|
828
828
|
}
|
|
829
|
-
var
|
|
829
|
+
var $t = Symbol();
|
|
830
830
|
function Bn(t, e) {
|
|
831
|
-
return process.env.NODE_ENV !== "production" && t.queryFn ===
|
|
831
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === $t && console.error(
|
|
832
832
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
833
|
-
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn ===
|
|
833
|
+
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === $t ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
834
834
|
}
|
|
835
835
|
var qe, Ee, Je, An, fi = (An = class extends ft {
|
|
836
836
|
constructor() {
|
|
837
837
|
super();
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
838
|
+
O(this, qe);
|
|
839
|
+
O(this, Ee);
|
|
840
|
+
O(this, Je);
|
|
841
|
+
E(this, Je, (e) => {
|
|
842
842
|
if (!ze && window.addEventListener) {
|
|
843
843
|
const r = () => e();
|
|
844
844
|
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
@@ -852,16 +852,16 @@ var qe, Ee, Je, An, fi = (An = class extends ft {
|
|
|
852
852
|
}
|
|
853
853
|
onUnsubscribe() {
|
|
854
854
|
var e;
|
|
855
|
-
this.hasListeners() || ((e = a(this, Ee)) == null || e.call(this),
|
|
855
|
+
this.hasListeners() || ((e = a(this, Ee)) == null || e.call(this), E(this, Ee, void 0));
|
|
856
856
|
}
|
|
857
857
|
setEventListener(e) {
|
|
858
858
|
var r;
|
|
859
|
-
|
|
859
|
+
E(this, Je, e), (r = a(this, Ee)) == null || r.call(this), E(this, Ee, e((n) => {
|
|
860
860
|
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
861
861
|
}));
|
|
862
862
|
}
|
|
863
863
|
setFocused(e) {
|
|
864
|
-
a(this, qe) !== e && (
|
|
864
|
+
a(this, qe) !== e && (E(this, qe, e), this.onFocus());
|
|
865
865
|
}
|
|
866
866
|
onFocus() {
|
|
867
867
|
const e = this.isFocused();
|
|
@@ -876,10 +876,10 @@ var qe, Ee, Je, An, fi = (An = class extends ft {
|
|
|
876
876
|
}, qe = new WeakMap(), Ee = new WeakMap(), Je = new WeakMap(), An), Dr = new fi(), Xe, Pe, Ze, xn, di = (xn = class extends ft {
|
|
877
877
|
constructor() {
|
|
878
878
|
super();
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
879
|
+
O(this, Xe, !0);
|
|
880
|
+
O(this, Pe);
|
|
881
|
+
O(this, Ze);
|
|
882
|
+
E(this, Ze, (e) => {
|
|
883
883
|
if (!ze && window.addEventListener) {
|
|
884
884
|
const r = () => e(!0), n = () => e(!1);
|
|
885
885
|
return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => {
|
|
@@ -893,22 +893,22 @@ var qe, Ee, Je, An, fi = (An = class extends ft {
|
|
|
893
893
|
}
|
|
894
894
|
onUnsubscribe() {
|
|
895
895
|
var e;
|
|
896
|
-
this.hasListeners() || ((e = a(this, Pe)) == null || e.call(this),
|
|
896
|
+
this.hasListeners() || ((e = a(this, Pe)) == null || e.call(this), E(this, Pe, void 0));
|
|
897
897
|
}
|
|
898
898
|
setEventListener(e) {
|
|
899
899
|
var r;
|
|
900
|
-
|
|
900
|
+
E(this, Ze, e), (r = a(this, Pe)) == null || r.call(this), E(this, Pe, e(this.setOnline.bind(this)));
|
|
901
901
|
}
|
|
902
902
|
setOnline(e) {
|
|
903
|
-
a(this, Xe) !== e && (
|
|
903
|
+
a(this, Xe) !== e && (E(this, Xe, e), this.listeners.forEach((n) => {
|
|
904
904
|
n(e);
|
|
905
905
|
}));
|
|
906
906
|
}
|
|
907
907
|
isOnline() {
|
|
908
908
|
return a(this, Xe);
|
|
909
909
|
}
|
|
910
|
-
}, Xe = new WeakMap(), Pe = new WeakMap(), Ze = new WeakMap(), xn),
|
|
911
|
-
function
|
|
910
|
+
}, Xe = new WeakMap(), Pe = new WeakMap(), Ze = new WeakMap(), xn), Kt = new di();
|
|
911
|
+
function pr() {
|
|
912
912
|
let t, e;
|
|
913
913
|
const r = new Promise((s, i) => {
|
|
914
914
|
t = s, e = i;
|
|
@@ -934,60 +934,60 @@ function hi(t) {
|
|
|
934
934
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
935
935
|
}
|
|
936
936
|
function Gn(t) {
|
|
937
|
-
return (t ?? "online") === "online" ?
|
|
937
|
+
return (t ?? "online") === "online" ? Kt.isOnline() : !0;
|
|
938
938
|
}
|
|
939
939
|
var Yn = class extends Error {
|
|
940
940
|
constructor(t) {
|
|
941
941
|
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
942
942
|
}
|
|
943
943
|
};
|
|
944
|
-
function
|
|
944
|
+
function or(t) {
|
|
945
945
|
return t instanceof Yn;
|
|
946
946
|
}
|
|
947
947
|
function Jn(t) {
|
|
948
948
|
let e = !1, r = 0, n = !1, s;
|
|
949
|
-
const i =
|
|
950
|
-
var
|
|
951
|
-
n || (
|
|
949
|
+
const i = pr(), u = (g) => {
|
|
950
|
+
var w;
|
|
951
|
+
n || (d(new Yn(g)), (w = t.abort) == null || w.call(t));
|
|
952
952
|
}, l = () => {
|
|
953
953
|
e = !0;
|
|
954
954
|
}, c = () => {
|
|
955
955
|
e = !1;
|
|
956
|
-
}, h = () => Dr.isFocused() && (t.networkMode === "always" ||
|
|
957
|
-
var
|
|
958
|
-
n || (n = !0, (
|
|
959
|
-
},
|
|
960
|
-
var
|
|
961
|
-
n || (n = !0, (
|
|
962
|
-
},
|
|
963
|
-
var
|
|
964
|
-
s = (
|
|
965
|
-
(n || h()) &&
|
|
966
|
-
}, (
|
|
956
|
+
}, h = () => Dr.isFocused() && (t.networkMode === "always" || Kt.isOnline()) && t.canRun(), p = () => Gn(t.networkMode) && t.canRun(), f = (g) => {
|
|
957
|
+
var w;
|
|
958
|
+
n || (n = !0, (w = t.onSuccess) == null || w.call(t, g), s == null || s(), i.resolve(g));
|
|
959
|
+
}, d = (g) => {
|
|
960
|
+
var w;
|
|
961
|
+
n || (n = !0, (w = t.onError) == null || w.call(t, g), s == null || s(), i.reject(g));
|
|
962
|
+
}, m = () => new Promise((g) => {
|
|
963
|
+
var w;
|
|
964
|
+
s = (v) => {
|
|
965
|
+
(n || h()) && g(v);
|
|
966
|
+
}, (w = t.onPause) == null || w.call(t);
|
|
967
967
|
}).then(() => {
|
|
968
|
-
var
|
|
969
|
-
s = void 0, n || (
|
|
970
|
-
}),
|
|
968
|
+
var g;
|
|
969
|
+
s = void 0, n || (g = t.onContinue) == null || g.call(t);
|
|
970
|
+
}), b = () => {
|
|
971
971
|
if (n)
|
|
972
972
|
return;
|
|
973
|
-
let
|
|
974
|
-
const
|
|
973
|
+
let g;
|
|
974
|
+
const w = r === 0 ? t.initialPromise : void 0;
|
|
975
975
|
try {
|
|
976
|
-
|
|
977
|
-
} catch (
|
|
978
|
-
|
|
976
|
+
g = w ?? t.fn();
|
|
977
|
+
} catch (v) {
|
|
978
|
+
g = Promise.reject(v);
|
|
979
979
|
}
|
|
980
|
-
Promise.resolve(
|
|
980
|
+
Promise.resolve(g).then(f).catch((v) => {
|
|
981
981
|
var Z;
|
|
982
982
|
if (n)
|
|
983
983
|
return;
|
|
984
|
-
const P = t.retry ?? (ze ? 0 : 3),
|
|
985
|
-
if (e || !
|
|
986
|
-
|
|
984
|
+
const P = t.retry ?? (ze ? 0 : 3), S = t.retryDelay ?? hi, T = typeof S == "function" ? S(r, v) : S, j = P === !0 || typeof P == "number" && r < P || typeof P == "function" && P(r, v);
|
|
985
|
+
if (e || !j) {
|
|
986
|
+
d(v);
|
|
987
987
|
return;
|
|
988
988
|
}
|
|
989
|
-
r++, (Z = t.onFail) == null || Z.call(t, r,
|
|
990
|
-
e ?
|
|
989
|
+
r++, (Z = t.onFail) == null || Z.call(t, r, v), ui(T).then(() => h() ? void 0 : m()).then(() => {
|
|
990
|
+
e ? d(v) : b();
|
|
991
991
|
});
|
|
992
992
|
});
|
|
993
993
|
};
|
|
@@ -997,8 +997,8 @@ function Jn(t) {
|
|
|
997
997
|
continue: () => (s == null || s(), i),
|
|
998
998
|
cancelRetry: l,
|
|
999
999
|
continueRetry: c,
|
|
1000
|
-
canStart:
|
|
1001
|
-
start: () => (
|
|
1000
|
+
canStart: p,
|
|
1001
|
+
start: () => (p() ? b() : m().then(b), i)
|
|
1002
1002
|
};
|
|
1003
1003
|
}
|
|
1004
1004
|
function yi() {
|
|
@@ -1060,15 +1060,15 @@ function yi() {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
var $ = yi(),
|
|
1063
|
+
var $ = yi(), Me, In, Xn = (In = class {
|
|
1064
1064
|
constructor() {
|
|
1065
|
-
|
|
1065
|
+
O(this, Me);
|
|
1066
1066
|
}
|
|
1067
1067
|
destroy() {
|
|
1068
1068
|
this.clearGcTimeout();
|
|
1069
1069
|
}
|
|
1070
1070
|
scheduleGc() {
|
|
1071
|
-
this.clearGcTimeout(),
|
|
1071
|
+
this.clearGcTimeout(), fr(this.gcTime) && E(this, Me, setTimeout(() => {
|
|
1072
1072
|
this.optionalRemove();
|
|
1073
1073
|
}, this.gcTime));
|
|
1074
1074
|
}
|
|
@@ -1079,37 +1079,37 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1079
1079
|
);
|
|
1080
1080
|
}
|
|
1081
1081
|
clearGcTimeout() {
|
|
1082
|
-
a(this,
|
|
1082
|
+
a(this, Me) && (clearTimeout(a(this, Me)), E(this, Me, void 0));
|
|
1083
1083
|
}
|
|
1084
|
-
},
|
|
1084
|
+
}, Me = new WeakMap(), In), et, tt, re, Ue, H, Ct, Ne, se, he, Dn, pi = (Dn = class extends Xn {
|
|
1085
1085
|
constructor(e) {
|
|
1086
1086
|
super();
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1087
|
+
O(this, se);
|
|
1088
|
+
O(this, et);
|
|
1089
|
+
O(this, tt);
|
|
1090
|
+
O(this, re);
|
|
1091
|
+
O(this, Ue);
|
|
1092
|
+
O(this, H);
|
|
1093
|
+
O(this, Ct);
|
|
1094
|
+
O(this, Ne);
|
|
1095
|
+
E(this, Ne, !1), E(this, Ct, e.defaultOptions), this.setOptions(e.options), this.observers = [], E(this, Ue, e.client), E(this, re, a(this, Ue).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, E(this, et, mi(this.options)), this.state = e.state ?? a(this, et), this.scheduleGc();
|
|
1096
1096
|
}
|
|
1097
1097
|
get meta() {
|
|
1098
1098
|
return this.options.meta;
|
|
1099
1099
|
}
|
|
1100
1100
|
get promise() {
|
|
1101
1101
|
var e;
|
|
1102
|
-
return (e = a(this,
|
|
1102
|
+
return (e = a(this, H)) == null ? void 0 : e.promise;
|
|
1103
1103
|
}
|
|
1104
1104
|
setOptions(e) {
|
|
1105
1105
|
this.options = { ...a(this, Ct), ...e }, this.updateGcTime(this.options.gcTime);
|
|
1106
1106
|
}
|
|
1107
1107
|
optionalRemove() {
|
|
1108
|
-
!this.observers.length && this.state.fetchStatus === "idle" && a(this,
|
|
1108
|
+
!this.observers.length && this.state.fetchStatus === "idle" && a(this, re).remove(this);
|
|
1109
1109
|
}
|
|
1110
1110
|
setData(e, r) {
|
|
1111
|
-
const n =
|
|
1112
|
-
return
|
|
1111
|
+
const n = yr(this.state.data, e, this.options);
|
|
1112
|
+
return F(this, se, he).call(this, {
|
|
1113
1113
|
data: n,
|
|
1114
1114
|
type: "success",
|
|
1115
1115
|
dataUpdatedAt: r == null ? void 0 : r.updatedAt,
|
|
@@ -1117,12 +1117,12 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1117
1117
|
}), n;
|
|
1118
1118
|
}
|
|
1119
1119
|
setState(e, r) {
|
|
1120
|
-
|
|
1120
|
+
F(this, se, he).call(this, { type: "setState", state: e, setStateOptions: r });
|
|
1121
1121
|
}
|
|
1122
1122
|
cancel(e) {
|
|
1123
1123
|
var n, s;
|
|
1124
|
-
const r = (n = a(this,
|
|
1125
|
-
return (s = a(this,
|
|
1124
|
+
const r = (n = a(this, H)) == null ? void 0 : n.promise;
|
|
1125
|
+
return (s = a(this, H)) == null || s.cancel(e), r ? r.then(ne).catch(ne) : Promise.resolve();
|
|
1126
1126
|
}
|
|
1127
1127
|
destroy() {
|
|
1128
1128
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1136,7 +1136,7 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1136
1136
|
);
|
|
1137
1137
|
}
|
|
1138
1138
|
isDisabled() {
|
|
1139
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
1139
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === $t || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
1140
1140
|
}
|
|
1141
1141
|
isStale() {
|
|
1142
1142
|
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -1144,131 +1144,131 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1144
1144
|
) : this.state.data === void 0;
|
|
1145
1145
|
}
|
|
1146
1146
|
isStaleByTime(e = 0) {
|
|
1147
|
-
return this.state.isInvalidated || this.state.data === void 0 || !
|
|
1147
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Wn(this.state.dataUpdatedAt, e);
|
|
1148
1148
|
}
|
|
1149
1149
|
onFocus() {
|
|
1150
1150
|
var r;
|
|
1151
1151
|
const e = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1152
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = a(this,
|
|
1152
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = a(this, H)) == null || r.continue();
|
|
1153
1153
|
}
|
|
1154
1154
|
onOnline() {
|
|
1155
1155
|
var r;
|
|
1156
1156
|
const e = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1157
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (r = a(this,
|
|
1157
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (r = a(this, H)) == null || r.continue();
|
|
1158
1158
|
}
|
|
1159
1159
|
addObserver(e) {
|
|
1160
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), a(this,
|
|
1160
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), a(this, re).notify({ type: "observerAdded", query: this, observer: e }));
|
|
1161
1161
|
}
|
|
1162
1162
|
removeObserver(e) {
|
|
1163
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (a(this,
|
|
1163
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((r) => r !== e), this.observers.length || (a(this, H) && (a(this, Ne) ? a(this, H).cancel({ revert: !0 }) : a(this, H).cancelRetry()), this.scheduleGc()), a(this, re).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
1164
1164
|
}
|
|
1165
1165
|
getObserversCount() {
|
|
1166
1166
|
return this.observers.length;
|
|
1167
1167
|
}
|
|
1168
1168
|
invalidate() {
|
|
1169
|
-
this.state.isInvalidated ||
|
|
1169
|
+
this.state.isInvalidated || F(this, se, he).call(this, { type: "invalidate" });
|
|
1170
1170
|
}
|
|
1171
1171
|
fetch(e, r) {
|
|
1172
|
-
var c, h,
|
|
1172
|
+
var c, h, p;
|
|
1173
1173
|
if (this.state.fetchStatus !== "idle") {
|
|
1174
1174
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1175
1175
|
this.cancel({ silent: !0 });
|
|
1176
|
-
else if (a(this,
|
|
1177
|
-
return a(this,
|
|
1176
|
+
else if (a(this, H))
|
|
1177
|
+
return a(this, H).continueRetry(), a(this, H).promise;
|
|
1178
1178
|
}
|
|
1179
1179
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1180
|
+
const f = this.observers.find((d) => d.options.queryFn);
|
|
1181
|
+
f && this.setOptions(f.options);
|
|
1182
1182
|
}
|
|
1183
1183
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
1184
1184
|
"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']"
|
|
1185
1185
|
));
|
|
1186
|
-
const n = new AbortController(), s = (
|
|
1187
|
-
Object.defineProperty(
|
|
1186
|
+
const n = new AbortController(), s = (f) => {
|
|
1187
|
+
Object.defineProperty(f, "signal", {
|
|
1188
1188
|
enumerable: !0,
|
|
1189
|
-
get: () => (
|
|
1189
|
+
get: () => (E(this, Ne, !0), n.signal)
|
|
1190
1190
|
});
|
|
1191
1191
|
}, i = () => {
|
|
1192
|
-
const
|
|
1193
|
-
client: a(this,
|
|
1192
|
+
const f = Bn(this.options, r), d = {
|
|
1193
|
+
client: a(this, Ue),
|
|
1194
1194
|
queryKey: this.queryKey,
|
|
1195
1195
|
meta: this.meta
|
|
1196
1196
|
};
|
|
1197
|
-
return s(
|
|
1198
|
-
d,
|
|
1197
|
+
return s(d), E(this, Ne, !1), this.options.persister ? this.options.persister(
|
|
1199
1198
|
f,
|
|
1199
|
+
d,
|
|
1200
1200
|
this
|
|
1201
|
-
) : d
|
|
1201
|
+
) : f(d);
|
|
1202
1202
|
}, u = {
|
|
1203
1203
|
fetchOptions: r,
|
|
1204
1204
|
options: this.options,
|
|
1205
1205
|
queryKey: this.queryKey,
|
|
1206
|
-
client: a(this,
|
|
1206
|
+
client: a(this, Ue),
|
|
1207
1207
|
state: this.state,
|
|
1208
1208
|
fetchFn: i
|
|
1209
1209
|
};
|
|
1210
1210
|
s(u), (c = this.options.behavior) == null || c.onFetch(
|
|
1211
1211
|
u,
|
|
1212
1212
|
this
|
|
1213
|
-
),
|
|
1214
|
-
const l = (
|
|
1215
|
-
var
|
|
1216
|
-
|
|
1213
|
+
), E(this, tt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((h = u.fetchOptions) == null ? void 0 : h.meta)) && F(this, se, he).call(this, { type: "fetch", meta: (p = u.fetchOptions) == null ? void 0 : p.meta });
|
|
1214
|
+
const l = (f) => {
|
|
1215
|
+
var d, m, b, g;
|
|
1216
|
+
or(f) && f.silent || F(this, se, he).call(this, {
|
|
1217
1217
|
type: "error",
|
|
1218
|
-
error:
|
|
1219
|
-
}),
|
|
1220
|
-
f,
|
|
1218
|
+
error: f
|
|
1219
|
+
}), or(f) || ((m = (d = a(this, re).config).onError) == null || m.call(
|
|
1221
1220
|
d,
|
|
1221
|
+
f,
|
|
1222
1222
|
this
|
|
1223
|
-
), (
|
|
1224
|
-
|
|
1223
|
+
), (g = (b = a(this, re).config).onSettled) == null || g.call(
|
|
1224
|
+
b,
|
|
1225
1225
|
this.state.data,
|
|
1226
|
-
|
|
1226
|
+
f,
|
|
1227
1227
|
this
|
|
1228
1228
|
)), this.scheduleGc();
|
|
1229
1229
|
};
|
|
1230
|
-
return
|
|
1230
|
+
return E(this, H, Jn({
|
|
1231
1231
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1232
1232
|
fn: u.fetchFn,
|
|
1233
1233
|
abort: n.abort.bind(n),
|
|
1234
|
-
onSuccess: (
|
|
1235
|
-
var
|
|
1236
|
-
if (
|
|
1234
|
+
onSuccess: (f) => {
|
|
1235
|
+
var d, m, b, g;
|
|
1236
|
+
if (f === void 0) {
|
|
1237
1237
|
process.env.NODE_ENV !== "production" && console.error(
|
|
1238
1238
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
1239
1239
|
), l(new Error(`${this.queryHash} data is undefined`));
|
|
1240
1240
|
return;
|
|
1241
1241
|
}
|
|
1242
1242
|
try {
|
|
1243
|
-
this.setData(
|
|
1244
|
-
} catch (
|
|
1245
|
-
l(
|
|
1243
|
+
this.setData(f);
|
|
1244
|
+
} catch (w) {
|
|
1245
|
+
l(w);
|
|
1246
1246
|
return;
|
|
1247
1247
|
}
|
|
1248
|
-
(
|
|
1249
|
-
|
|
1250
|
-
|
|
1248
|
+
(m = (d = a(this, re).config).onSuccess) == null || m.call(d, f, this), (g = (b = a(this, re).config).onSettled) == null || g.call(
|
|
1249
|
+
b,
|
|
1250
|
+
f,
|
|
1251
1251
|
this.state.error,
|
|
1252
1252
|
this
|
|
1253
1253
|
), this.scheduleGc();
|
|
1254
1254
|
},
|
|
1255
1255
|
onError: l,
|
|
1256
|
-
onFail: (
|
|
1257
|
-
|
|
1256
|
+
onFail: (f, d) => {
|
|
1257
|
+
F(this, se, he).call(this, { type: "failed", failureCount: f, error: d });
|
|
1258
1258
|
},
|
|
1259
1259
|
onPause: () => {
|
|
1260
|
-
|
|
1260
|
+
F(this, se, he).call(this, { type: "pause" });
|
|
1261
1261
|
},
|
|
1262
1262
|
onContinue: () => {
|
|
1263
|
-
|
|
1263
|
+
F(this, se, he).call(this, { type: "continue" });
|
|
1264
1264
|
},
|
|
1265
1265
|
retry: u.options.retry,
|
|
1266
1266
|
retryDelay: u.options.retryDelay,
|
|
1267
1267
|
networkMode: u.options.networkMode,
|
|
1268
1268
|
canRun: () => !0
|
|
1269
|
-
})), a(this,
|
|
1269
|
+
})), a(this, H).start();
|
|
1270
1270
|
}
|
|
1271
|
-
}, et = new WeakMap(), tt = new WeakMap(),
|
|
1271
|
+
}, et = new WeakMap(), tt = new WeakMap(), re = new WeakMap(), Ue = new WeakMap(), H = new WeakMap(), Ct = new WeakMap(), Ne = new WeakMap(), se = new WeakSet(), he = function(e) {
|
|
1272
1272
|
const r = (n) => {
|
|
1273
1273
|
switch (e.type) {
|
|
1274
1274
|
case "failed":
|
|
@@ -1310,7 +1310,7 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1310
1310
|
};
|
|
1311
1311
|
case "error":
|
|
1312
1312
|
const s = e.error;
|
|
1313
|
-
return
|
|
1313
|
+
return or(s) && s.revert && a(this, tt) ? { ...a(this, tt), fetchStatus: "idle" } : {
|
|
1314
1314
|
...n,
|
|
1315
1315
|
error: s,
|
|
1316
1316
|
errorUpdateCount: n.errorUpdateCount + 1,
|
|
@@ -1335,7 +1335,7 @@ var $ = yi(), Ue, In, Xn = (In = class {
|
|
|
1335
1335
|
this.state = r(this.state), $.batch(() => {
|
|
1336
1336
|
this.observers.forEach((n) => {
|
|
1337
1337
|
n.onQueryUpdate();
|
|
1338
|
-
}), a(this,
|
|
1338
|
+
}), a(this, re).notify({ query: this, type: "updated", action: e });
|
|
1339
1339
|
});
|
|
1340
1340
|
}, Dn);
|
|
1341
1341
|
function Zn(t, e) {
|
|
@@ -1366,11 +1366,11 @@ function mi(t) {
|
|
|
1366
1366
|
fetchStatus: "idle"
|
|
1367
1367
|
};
|
|
1368
1368
|
}
|
|
1369
|
-
var ue,
|
|
1369
|
+
var ue, kn, gi = (kn = class extends ft {
|
|
1370
1370
|
constructor(e = {}) {
|
|
1371
1371
|
super();
|
|
1372
|
-
|
|
1373
|
-
this.config = e,
|
|
1372
|
+
O(this, ue);
|
|
1373
|
+
this.config = e, E(this, ue, /* @__PURE__ */ new Map());
|
|
1374
1374
|
}
|
|
1375
1375
|
build(e, r, n) {
|
|
1376
1376
|
const s = r.queryKey, i = r.queryHash ?? Ir(s, r);
|
|
@@ -1438,14 +1438,14 @@ var ue, _n, gi = (_n = class extends ft {
|
|
|
1438
1438
|
});
|
|
1439
1439
|
});
|
|
1440
1440
|
}
|
|
1441
|
-
}, ue = new WeakMap(),
|
|
1441
|
+
}, ue = new WeakMap(), kn), ce, B, Le, le, we, _n, vi = (_n = class extends Xn {
|
|
1442
1442
|
constructor(e) {
|
|
1443
1443
|
super();
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
this.mutationId = e.mutationId,
|
|
1444
|
+
O(this, le);
|
|
1445
|
+
O(this, ce);
|
|
1446
|
+
O(this, B);
|
|
1447
|
+
O(this, Le);
|
|
1448
|
+
this.mutationId = e.mutationId, E(this, B, e.mutationCache), E(this, ce, []), this.state = e.state || es(), this.setOptions(e.options), this.scheduleGc();
|
|
1449
1449
|
}
|
|
1450
1450
|
setOptions(e) {
|
|
1451
1451
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -1454,21 +1454,21 @@ var ue, _n, gi = (_n = class extends ft {
|
|
|
1454
1454
|
return this.options.meta;
|
|
1455
1455
|
}
|
|
1456
1456
|
addObserver(e) {
|
|
1457
|
-
a(this, ce).includes(e) || (a(this, ce).push(e), this.clearGcTimeout(), a(this,
|
|
1457
|
+
a(this, ce).includes(e) || (a(this, ce).push(e), this.clearGcTimeout(), a(this, B).notify({
|
|
1458
1458
|
type: "observerAdded",
|
|
1459
1459
|
mutation: this,
|
|
1460
1460
|
observer: e
|
|
1461
1461
|
}));
|
|
1462
1462
|
}
|
|
1463
1463
|
removeObserver(e) {
|
|
1464
|
-
|
|
1464
|
+
E(this, ce, a(this, ce).filter((r) => r !== e)), this.scheduleGc(), a(this, B).notify({
|
|
1465
1465
|
type: "observerRemoved",
|
|
1466
1466
|
mutation: this,
|
|
1467
1467
|
observer: e
|
|
1468
1468
|
});
|
|
1469
1469
|
}
|
|
1470
1470
|
optionalRemove() {
|
|
1471
|
-
a(this, ce).length || (this.state.status === "pending" ? this.scheduleGc() : a(this,
|
|
1471
|
+
a(this, ce).length || (this.state.status === "pending" ? this.scheduleGc() : a(this, B).remove(this));
|
|
1472
1472
|
}
|
|
1473
1473
|
continue() {
|
|
1474
1474
|
var e;
|
|
@@ -1476,69 +1476,69 @@ var ue, _n, gi = (_n = class extends ft {
|
|
|
1476
1476
|
this.execute(this.state.variables);
|
|
1477
1477
|
}
|
|
1478
1478
|
async execute(e) {
|
|
1479
|
-
var s, i, u, l, c, h,
|
|
1480
|
-
|
|
1479
|
+
var s, i, u, l, c, h, p, f, d, m, b, g, w, v, P, S, T, j, Z, z;
|
|
1480
|
+
E(this, Le, Jn({
|
|
1481
1481
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
|
|
1482
|
-
onFail: (U,
|
|
1483
|
-
|
|
1482
|
+
onFail: (U, M) => {
|
|
1483
|
+
F(this, le, we).call(this, { type: "failed", failureCount: U, error: M });
|
|
1484
1484
|
},
|
|
1485
1485
|
onPause: () => {
|
|
1486
|
-
|
|
1486
|
+
F(this, le, we).call(this, { type: "pause" });
|
|
1487
1487
|
},
|
|
1488
1488
|
onContinue: () => {
|
|
1489
|
-
|
|
1489
|
+
F(this, le, we).call(this, { type: "continue" });
|
|
1490
1490
|
},
|
|
1491
1491
|
retry: this.options.retry ?? 0,
|
|
1492
1492
|
retryDelay: this.options.retryDelay,
|
|
1493
1493
|
networkMode: this.options.networkMode,
|
|
1494
|
-
canRun: () => a(this,
|
|
1494
|
+
canRun: () => a(this, B).canRun(this)
|
|
1495
1495
|
}));
|
|
1496
1496
|
const r = this.state.status === "pending", n = !a(this, Le).canStart();
|
|
1497
1497
|
try {
|
|
1498
1498
|
if (!r) {
|
|
1499
|
-
|
|
1499
|
+
F(this, le, we).call(this, { type: "pending", variables: e, isPaused: n }), await ((i = (s = a(this, B).config).onMutate) == null ? void 0 : i.call(
|
|
1500
1500
|
s,
|
|
1501
1501
|
e,
|
|
1502
1502
|
this
|
|
1503
1503
|
));
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1504
|
+
const M = await ((l = (u = this.options).onMutate) == null ? void 0 : l.call(u, e));
|
|
1505
|
+
M !== this.state.context && F(this, le, we).call(this, {
|
|
1506
1506
|
type: "pending",
|
|
1507
|
-
context:
|
|
1507
|
+
context: M,
|
|
1508
1508
|
variables: e,
|
|
1509
1509
|
isPaused: n
|
|
1510
1510
|
});
|
|
1511
1511
|
}
|
|
1512
1512
|
const U = await a(this, Le).start();
|
|
1513
|
-
return await ((h = (c = a(this,
|
|
1513
|
+
return await ((h = (c = a(this, B).config).onSuccess) == null ? void 0 : h.call(
|
|
1514
1514
|
c,
|
|
1515
1515
|
U,
|
|
1516
1516
|
e,
|
|
1517
1517
|
this.state.context,
|
|
1518
1518
|
this
|
|
1519
|
-
)), await ((
|
|
1520
|
-
|
|
1519
|
+
)), await ((f = (p = this.options).onSuccess) == null ? void 0 : f.call(p, U, e, this.state.context)), await ((m = (d = a(this, B).config).onSettled) == null ? void 0 : m.call(
|
|
1520
|
+
d,
|
|
1521
1521
|
U,
|
|
1522
1522
|
null,
|
|
1523
1523
|
this.state.variables,
|
|
1524
1524
|
this.state.context,
|
|
1525
1525
|
this
|
|
1526
|
-
)), await ((
|
|
1526
|
+
)), await ((g = (b = this.options).onSettled) == null ? void 0 : g.call(b, U, null, e, this.state.context)), F(this, le, we).call(this, { type: "success", data: U }), U;
|
|
1527
1527
|
} catch (U) {
|
|
1528
1528
|
try {
|
|
1529
|
-
throw await ((
|
|
1530
|
-
|
|
1529
|
+
throw await ((v = (w = a(this, B).config).onError) == null ? void 0 : v.call(
|
|
1530
|
+
w,
|
|
1531
1531
|
U,
|
|
1532
1532
|
e,
|
|
1533
1533
|
this.state.context,
|
|
1534
1534
|
this
|
|
1535
|
-
)), await ((
|
|
1535
|
+
)), await ((S = (P = this.options).onError) == null ? void 0 : S.call(
|
|
1536
1536
|
P,
|
|
1537
1537
|
U,
|
|
1538
1538
|
e,
|
|
1539
1539
|
this.state.context
|
|
1540
|
-
)), await ((
|
|
1541
|
-
|
|
1540
|
+
)), await ((j = (T = a(this, B).config).onSettled) == null ? void 0 : j.call(
|
|
1541
|
+
T,
|
|
1542
1542
|
void 0,
|
|
1543
1543
|
U,
|
|
1544
1544
|
this.state.variables,
|
|
@@ -1552,13 +1552,13 @@ var ue, _n, gi = (_n = class extends ft {
|
|
|
1552
1552
|
this.state.context
|
|
1553
1553
|
)), U;
|
|
1554
1554
|
} finally {
|
|
1555
|
-
|
|
1555
|
+
F(this, le, we).call(this, { type: "error", error: U });
|
|
1556
1556
|
}
|
|
1557
1557
|
} finally {
|
|
1558
|
-
a(this,
|
|
1558
|
+
a(this, B).runNext(this);
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
}, ce = new WeakMap(),
|
|
1561
|
+
}, ce = new WeakMap(), B = new WeakMap(), Le = new WeakMap(), le = new WeakSet(), we = function(e) {
|
|
1562
1562
|
const r = (n) => {
|
|
1563
1563
|
switch (e.type) {
|
|
1564
1564
|
case "failed":
|
|
@@ -1615,13 +1615,13 @@ var ue, _n, gi = (_n = class extends ft {
|
|
|
1615
1615
|
this.state = r(this.state), $.batch(() => {
|
|
1616
1616
|
a(this, ce).forEach((n) => {
|
|
1617
1617
|
n.onMutationUpdate(e);
|
|
1618
|
-
}), a(this,
|
|
1618
|
+
}), a(this, B).notify({
|
|
1619
1619
|
mutation: this,
|
|
1620
1620
|
type: "updated",
|
|
1621
1621
|
action: e
|
|
1622
1622
|
});
|
|
1623
1623
|
});
|
|
1624
|
-
},
|
|
1624
|
+
}, _n);
|
|
1625
1625
|
function es() {
|
|
1626
1626
|
return {
|
|
1627
1627
|
context: void 0,
|
|
@@ -1638,15 +1638,15 @@ function es() {
|
|
|
1638
1638
|
var ye, ie, Tt, jn, bi = (jn = class extends ft {
|
|
1639
1639
|
constructor(e = {}) {
|
|
1640
1640
|
super();
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
this.config = e,
|
|
1641
|
+
O(this, ye);
|
|
1642
|
+
O(this, ie);
|
|
1643
|
+
O(this, Tt);
|
|
1644
|
+
this.config = e, E(this, ye, /* @__PURE__ */ new Set()), E(this, ie, /* @__PURE__ */ new Map()), E(this, Tt, 0);
|
|
1645
1645
|
}
|
|
1646
1646
|
build(e, r, n) {
|
|
1647
1647
|
const s = new vi({
|
|
1648
1648
|
mutationCache: this,
|
|
1649
|
-
mutationId: ++
|
|
1649
|
+
mutationId: ++_t(this, Tt)._,
|
|
1650
1650
|
options: e.defaultMutationOptions(r),
|
|
1651
1651
|
state: n
|
|
1652
1652
|
});
|
|
@@ -1724,7 +1724,7 @@ var ye, ie, Tt, jn, bi = (jn = class extends ft {
|
|
|
1724
1724
|
const e = this.getAll().filter((r) => r.state.isPaused);
|
|
1725
1725
|
return $.batch(
|
|
1726
1726
|
() => Promise.all(
|
|
1727
|
-
e.map((r) => r.continue().catch(
|
|
1727
|
+
e.map((r) => r.continue().catch(ne))
|
|
1728
1728
|
)
|
|
1729
1729
|
);
|
|
1730
1730
|
}
|
|
@@ -1736,60 +1736,60 @@ function jt(t) {
|
|
|
1736
1736
|
function dn(t) {
|
|
1737
1737
|
return {
|
|
1738
1738
|
onFetch: (e, r) => {
|
|
1739
|
-
var
|
|
1740
|
-
const n = e.options, s = (
|
|
1739
|
+
var p, f, d, m, b;
|
|
1740
|
+
const n = e.options, s = (d = (f = (p = e.fetchOptions) == null ? void 0 : p.meta) == null ? void 0 : f.fetchMore) == null ? void 0 : d.direction, i = ((m = e.state.data) == null ? void 0 : m.pages) || [], u = ((b = e.state.data) == null ? void 0 : b.pageParams) || [];
|
|
1741
1741
|
let l = { pages: [], pageParams: [] }, c = 0;
|
|
1742
1742
|
const h = async () => {
|
|
1743
|
-
let
|
|
1744
|
-
const
|
|
1745
|
-
Object.defineProperty(
|
|
1743
|
+
let g = !1;
|
|
1744
|
+
const w = (S) => {
|
|
1745
|
+
Object.defineProperty(S, "signal", {
|
|
1746
1746
|
enumerable: !0,
|
|
1747
|
-
get: () => (e.signal.aborted ?
|
|
1748
|
-
|
|
1747
|
+
get: () => (e.signal.aborted ? g = !0 : e.signal.addEventListener("abort", () => {
|
|
1748
|
+
g = !0;
|
|
1749
1749
|
}), e.signal)
|
|
1750
1750
|
});
|
|
1751
|
-
},
|
|
1752
|
-
if (
|
|
1751
|
+
}, v = Bn(e.options, e.fetchOptions), P = async (S, T, j) => {
|
|
1752
|
+
if (g)
|
|
1753
1753
|
return Promise.reject();
|
|
1754
|
-
if (
|
|
1755
|
-
return Promise.resolve(
|
|
1754
|
+
if (T == null && S.pages.length)
|
|
1755
|
+
return Promise.resolve(S);
|
|
1756
1756
|
const Z = {
|
|
1757
1757
|
client: e.client,
|
|
1758
1758
|
queryKey: e.queryKey,
|
|
1759
|
-
pageParam:
|
|
1760
|
-
direction:
|
|
1759
|
+
pageParam: T,
|
|
1760
|
+
direction: j ? "backward" : "forward",
|
|
1761
1761
|
meta: e.options.meta
|
|
1762
1762
|
};
|
|
1763
|
-
|
|
1764
|
-
const z = await
|
|
1763
|
+
w(Z);
|
|
1764
|
+
const z = await v(
|
|
1765
1765
|
Z
|
|
1766
|
-
), { maxPages: U } = e.options,
|
|
1766
|
+
), { maxPages: U } = e.options, M = j ? li : ci;
|
|
1767
1767
|
return {
|
|
1768
|
-
pages:
|
|
1769
|
-
pageParams:
|
|
1768
|
+
pages: M(S.pages, z, U),
|
|
1769
|
+
pageParams: M(S.pageParams, T, U)
|
|
1770
1770
|
};
|
|
1771
1771
|
};
|
|
1772
1772
|
if (s && i.length) {
|
|
1773
|
-
const
|
|
1773
|
+
const S = s === "backward", T = S ? wi : hn, j = {
|
|
1774
1774
|
pages: i,
|
|
1775
1775
|
pageParams: u
|
|
1776
|
-
}, Z =
|
|
1777
|
-
l = await P(
|
|
1776
|
+
}, Z = T(n, j);
|
|
1777
|
+
l = await P(j, Z, S);
|
|
1778
1778
|
} else {
|
|
1779
|
-
const
|
|
1779
|
+
const S = t ?? i.length;
|
|
1780
1780
|
do {
|
|
1781
|
-
const
|
|
1782
|
-
if (c > 0 &&
|
|
1781
|
+
const T = c === 0 ? u[0] ?? n.initialPageParam : hn(n, l);
|
|
1782
|
+
if (c > 0 && T == null)
|
|
1783
1783
|
break;
|
|
1784
|
-
l = await P(l,
|
|
1785
|
-
} while (c <
|
|
1784
|
+
l = await P(l, T), c++;
|
|
1785
|
+
} while (c < S);
|
|
1786
1786
|
}
|
|
1787
1787
|
return l;
|
|
1788
1788
|
};
|
|
1789
1789
|
e.options.persister ? e.fetchFn = () => {
|
|
1790
|
-
var
|
|
1791
|
-
return (
|
|
1792
|
-
|
|
1790
|
+
var g, w;
|
|
1791
|
+
return (w = (g = e.options).persister) == null ? void 0 : w.call(
|
|
1792
|
+
g,
|
|
1793
1793
|
h,
|
|
1794
1794
|
{
|
|
1795
1795
|
client: e.client,
|
|
@@ -1816,60 +1816,60 @@ function wi(t, { pages: e, pageParams: r }) {
|
|
|
1816
1816
|
var n;
|
|
1817
1817
|
return e.length > 0 ? (n = t.getPreviousPageParam) == null ? void 0 : n.call(t, e[0], e, r[0], r) : void 0;
|
|
1818
1818
|
}
|
|
1819
|
-
var
|
|
1819
|
+
var N, Re, Oe, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
1820
1820
|
constructor(t = {}) {
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1821
|
+
O(this, N);
|
|
1822
|
+
O(this, Re);
|
|
1823
|
+
O(this, Oe);
|
|
1824
|
+
O(this, rt);
|
|
1825
|
+
O(this, nt);
|
|
1826
|
+
O(this, Se);
|
|
1827
|
+
O(this, st);
|
|
1828
|
+
O(this, it);
|
|
1829
|
+
E(this, N, t.queryCache || new gi()), E(this, Re, t.mutationCache || new bi()), E(this, Oe, t.defaultOptions || {}), E(this, rt, /* @__PURE__ */ new Map()), E(this, nt, /* @__PURE__ */ new Map()), E(this, Se, 0);
|
|
1830
1830
|
}
|
|
1831
1831
|
mount() {
|
|
1832
|
-
|
|
1833
|
-
t && (await this.resumePausedMutations(), a(this,
|
|
1834
|
-
})),
|
|
1835
|
-
t && (await this.resumePausedMutations(), a(this,
|
|
1832
|
+
_t(this, Se)._++, a(this, Se) === 1 && (E(this, st, Dr.subscribe(async (t) => {
|
|
1833
|
+
t && (await this.resumePausedMutations(), a(this, N).onFocus());
|
|
1834
|
+
})), E(this, it, Kt.subscribe(async (t) => {
|
|
1835
|
+
t && (await this.resumePausedMutations(), a(this, N).onOnline());
|
|
1836
1836
|
})));
|
|
1837
1837
|
}
|
|
1838
1838
|
unmount() {
|
|
1839
1839
|
var t, e;
|
|
1840
|
-
|
|
1840
|
+
_t(this, Se)._--, a(this, Se) === 0 && ((t = a(this, st)) == null || t.call(this), E(this, st, void 0), (e = a(this, it)) == null || e.call(this), E(this, it, void 0));
|
|
1841
1841
|
}
|
|
1842
1842
|
isFetching(t) {
|
|
1843
|
-
return a(this,
|
|
1843
|
+
return a(this, N).findAll({ ...t, fetchStatus: "fetching" }).length;
|
|
1844
1844
|
}
|
|
1845
1845
|
isMutating(t) {
|
|
1846
|
-
return a(this,
|
|
1846
|
+
return a(this, Re).findAll({ ...t, status: "pending" }).length;
|
|
1847
1847
|
}
|
|
1848
1848
|
getQueryData(t) {
|
|
1849
1849
|
var r;
|
|
1850
1850
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1851
|
-
return (r = a(this,
|
|
1851
|
+
return (r = a(this, N).get(e.queryHash)) == null ? void 0 : r.state.data;
|
|
1852
1852
|
}
|
|
1853
1853
|
ensureQueryData(t) {
|
|
1854
|
-
const e = this.defaultQueryOptions(t), r = a(this,
|
|
1854
|
+
const e = this.defaultQueryOptions(t), r = a(this, N).build(this, e), n = r.state.data;
|
|
1855
1855
|
return n === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && r.isStaleByTime(Ye(e.staleTime, r)) && this.prefetchQuery(e), Promise.resolve(n));
|
|
1856
1856
|
}
|
|
1857
1857
|
getQueriesData(t) {
|
|
1858
|
-
return a(this,
|
|
1858
|
+
return a(this, N).findAll(t).map(({ queryKey: e, state: r }) => {
|
|
1859
1859
|
const n = r.data;
|
|
1860
1860
|
return [e, n];
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
1863
|
setQueryData(t, e, r) {
|
|
1864
|
-
const n = this.defaultQueryOptions({ queryKey: t }), s = a(this,
|
|
1864
|
+
const n = this.defaultQueryOptions({ queryKey: t }), s = a(this, N).get(
|
|
1865
1865
|
n.queryHash
|
|
1866
1866
|
), i = s == null ? void 0 : s.state.data, u = ai(e, i);
|
|
1867
1867
|
if (u !== void 0)
|
|
1868
|
-
return a(this,
|
|
1868
|
+
return a(this, N).build(this, n).setData(u, { ...r, manual: !0 });
|
|
1869
1869
|
}
|
|
1870
1870
|
setQueriesData(t, e, r) {
|
|
1871
1871
|
return $.batch(
|
|
1872
|
-
() => a(this,
|
|
1872
|
+
() => a(this, N).findAll(t).map(({ queryKey: n }) => [
|
|
1873
1873
|
n,
|
|
1874
1874
|
this.setQueryData(n, e, r)
|
|
1875
1875
|
])
|
|
@@ -1878,12 +1878,12 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
1878
1878
|
getQueryState(t) {
|
|
1879
1879
|
var r;
|
|
1880
1880
|
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1881
|
-
return (r = a(this,
|
|
1881
|
+
return (r = a(this, N).get(
|
|
1882
1882
|
e.queryHash
|
|
1883
1883
|
)) == null ? void 0 : r.state;
|
|
1884
1884
|
}
|
|
1885
1885
|
removeQueries(t) {
|
|
1886
|
-
const e = a(this,
|
|
1886
|
+
const e = a(this, N);
|
|
1887
1887
|
$.batch(() => {
|
|
1888
1888
|
e.findAll(t).forEach((r) => {
|
|
1889
1889
|
e.remove(r);
|
|
@@ -1891,7 +1891,7 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
1891
1891
|
});
|
|
1892
1892
|
}
|
|
1893
1893
|
resetQueries(t, e) {
|
|
1894
|
-
const r = a(this,
|
|
1894
|
+
const r = a(this, N);
|
|
1895
1895
|
return $.batch(() => (r.findAll(t).forEach((n) => {
|
|
1896
1896
|
n.reset();
|
|
1897
1897
|
}), this.refetchQueries(
|
|
@@ -1904,12 +1904,12 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
cancelQueries(t, e = {}) {
|
|
1906
1906
|
const r = { revert: !0, ...e }, n = $.batch(
|
|
1907
|
-
() => a(this,
|
|
1907
|
+
() => a(this, N).findAll(t).map((s) => s.cancel(r))
|
|
1908
1908
|
);
|
|
1909
|
-
return Promise.all(n).then(
|
|
1909
|
+
return Promise.all(n).then(ne).catch(ne);
|
|
1910
1910
|
}
|
|
1911
1911
|
invalidateQueries(t, e = {}) {
|
|
1912
|
-
return $.batch(() => (a(this,
|
|
1912
|
+
return $.batch(() => (a(this, N).findAll(t).forEach((r) => {
|
|
1913
1913
|
r.invalidate();
|
|
1914
1914
|
}), (t == null ? void 0 : t.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
1915
1915
|
{
|
|
@@ -1924,47 +1924,47 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
1924
1924
|
...e,
|
|
1925
1925
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
1926
1926
|
}, n = $.batch(
|
|
1927
|
-
() => a(this,
|
|
1927
|
+
() => a(this, N).findAll(t).filter((s) => !s.isDisabled()).map((s) => {
|
|
1928
1928
|
let i = s.fetch(void 0, r);
|
|
1929
|
-
return r.throwOnError || (i = i.catch(
|
|
1929
|
+
return r.throwOnError || (i = i.catch(ne)), s.state.fetchStatus === "paused" ? Promise.resolve() : i;
|
|
1930
1930
|
})
|
|
1931
1931
|
);
|
|
1932
|
-
return Promise.all(n).then(
|
|
1932
|
+
return Promise.all(n).then(ne);
|
|
1933
1933
|
}
|
|
1934
1934
|
fetchQuery(t) {
|
|
1935
1935
|
const e = this.defaultQueryOptions(t);
|
|
1936
1936
|
e.retry === void 0 && (e.retry = !1);
|
|
1937
|
-
const r = a(this,
|
|
1937
|
+
const r = a(this, N).build(this, e);
|
|
1938
1938
|
return r.isStaleByTime(
|
|
1939
1939
|
Ye(e.staleTime, r)
|
|
1940
1940
|
) ? r.fetch(e) : Promise.resolve(r.state.data);
|
|
1941
1941
|
}
|
|
1942
1942
|
prefetchQuery(t) {
|
|
1943
|
-
return this.fetchQuery(t).then(
|
|
1943
|
+
return this.fetchQuery(t).then(ne).catch(ne);
|
|
1944
1944
|
}
|
|
1945
1945
|
fetchInfiniteQuery(t) {
|
|
1946
1946
|
return t.behavior = dn(t.pages), this.fetchQuery(t);
|
|
1947
1947
|
}
|
|
1948
1948
|
prefetchInfiniteQuery(t) {
|
|
1949
|
-
return this.fetchInfiniteQuery(t).then(
|
|
1949
|
+
return this.fetchInfiniteQuery(t).then(ne).catch(ne);
|
|
1950
1950
|
}
|
|
1951
1951
|
ensureInfiniteQueryData(t) {
|
|
1952
1952
|
return t.behavior = dn(t.pages), this.ensureQueryData(t);
|
|
1953
1953
|
}
|
|
1954
1954
|
resumePausedMutations() {
|
|
1955
|
-
return
|
|
1955
|
+
return Kt.isOnline() ? a(this, Re).resumePausedMutations() : Promise.resolve();
|
|
1956
1956
|
}
|
|
1957
1957
|
getQueryCache() {
|
|
1958
|
-
return a(this,
|
|
1958
|
+
return a(this, N);
|
|
1959
1959
|
}
|
|
1960
1960
|
getMutationCache() {
|
|
1961
|
-
return a(this,
|
|
1961
|
+
return a(this, Re);
|
|
1962
1962
|
}
|
|
1963
1963
|
getDefaultOptions() {
|
|
1964
|
-
return a(this,
|
|
1964
|
+
return a(this, Oe);
|
|
1965
1965
|
}
|
|
1966
1966
|
setDefaultOptions(t) {
|
|
1967
|
-
|
|
1967
|
+
E(this, Oe, t);
|
|
1968
1968
|
}
|
|
1969
1969
|
setQueryDefaults(t, e) {
|
|
1970
1970
|
a(this, rt).set(Ve(t), {
|
|
@@ -1994,7 +1994,7 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
1994
1994
|
if (t._defaulted)
|
|
1995
1995
|
return t;
|
|
1996
1996
|
const e = {
|
|
1997
|
-
...a(this,
|
|
1997
|
+
...a(this, Oe).queries,
|
|
1998
1998
|
...this.getQueryDefaults(t.queryKey),
|
|
1999
1999
|
...t,
|
|
2000
2000
|
_defaulted: !0
|
|
@@ -2002,41 +2002,41 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2002
2002
|
return e.queryHash || (e.queryHash = Ir(
|
|
2003
2003
|
e.queryKey,
|
|
2004
2004
|
e
|
|
2005
|
-
)), 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 ===
|
|
2005
|
+
)), 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 === $t && (e.enabled = !1), e;
|
|
2006
2006
|
}
|
|
2007
2007
|
defaultMutationOptions(t) {
|
|
2008
2008
|
return t != null && t._defaulted ? t : {
|
|
2009
|
-
...a(this,
|
|
2009
|
+
...a(this, Oe).mutations,
|
|
2010
2010
|
...(t == null ? void 0 : t.mutationKey) && this.getMutationDefaults(t.mutationKey),
|
|
2011
2011
|
...t,
|
|
2012
2012
|
_defaulted: !0
|
|
2013
2013
|
};
|
|
2014
2014
|
}
|
|
2015
2015
|
clear() {
|
|
2016
|
-
a(this,
|
|
2016
|
+
a(this, N).clear(), a(this, Re).clear();
|
|
2017
2017
|
}
|
|
2018
|
-
},
|
|
2018
|
+
}, N = new WeakMap(), Re = new WeakMap(), Oe = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), st = new WeakMap(), it = new WeakMap(), qn), J, x, Ft, G, Qe, ot, Ce, fe, At, at, ut, $e, Ke, Te, ct, _, vt, mr, gr, vr, br, wr, Er, Pr, ts, Mn, Pi = (Mn = class extends ft {
|
|
2019
2019
|
constructor(e, r) {
|
|
2020
2020
|
super();
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2021
|
+
O(this, _);
|
|
2022
|
+
O(this, J);
|
|
2023
|
+
O(this, x);
|
|
2024
|
+
O(this, Ft);
|
|
2025
|
+
O(this, G);
|
|
2026
|
+
O(this, Qe);
|
|
2027
|
+
O(this, ot);
|
|
2028
|
+
O(this, Ce);
|
|
2029
|
+
O(this, fe);
|
|
2030
|
+
O(this, At);
|
|
2031
|
+
O(this, at);
|
|
2032
2032
|
// This property keeps track of the last query with defined data.
|
|
2033
2033
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
this.options = r,
|
|
2034
|
+
O(this, ut);
|
|
2035
|
+
O(this, $e);
|
|
2036
|
+
O(this, Ke);
|
|
2037
|
+
O(this, Te);
|
|
2038
|
+
O(this, ct, /* @__PURE__ */ new Set());
|
|
2039
|
+
this.options = r, E(this, J, e), E(this, fe, null), E(this, Ce, pr()), this.options.experimental_prefetchInRender || a(this, Ce).reject(
|
|
2040
2040
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
2041
2041
|
), this.bindMethods(), this.setOptions(r);
|
|
2042
2042
|
}
|
|
@@ -2044,55 +2044,55 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2044
2044
|
this.refetch = this.refetch.bind(this);
|
|
2045
2045
|
}
|
|
2046
2046
|
onSubscribe() {
|
|
2047
|
-
this.listeners.size === 1 && (a(this,
|
|
2047
|
+
this.listeners.size === 1 && (a(this, x).addObserver(this), yn(a(this, x), this.options) ? F(this, _, vt).call(this) : this.updateResult(), F(this, _, br).call(this));
|
|
2048
2048
|
}
|
|
2049
2049
|
onUnsubscribe() {
|
|
2050
2050
|
this.hasListeners() || this.destroy();
|
|
2051
2051
|
}
|
|
2052
2052
|
shouldFetchOnReconnect() {
|
|
2053
|
-
return
|
|
2054
|
-
a(this,
|
|
2053
|
+
return Rr(
|
|
2054
|
+
a(this, x),
|
|
2055
2055
|
this.options,
|
|
2056
2056
|
this.options.refetchOnReconnect
|
|
2057
2057
|
);
|
|
2058
2058
|
}
|
|
2059
2059
|
shouldFetchOnWindowFocus() {
|
|
2060
|
-
return
|
|
2061
|
-
a(this,
|
|
2060
|
+
return Rr(
|
|
2061
|
+
a(this, x),
|
|
2062
2062
|
this.options,
|
|
2063
2063
|
this.options.refetchOnWindowFocus
|
|
2064
2064
|
);
|
|
2065
2065
|
}
|
|
2066
2066
|
destroy() {
|
|
2067
|
-
this.listeners = /* @__PURE__ */ new Set(),
|
|
2067
|
+
this.listeners = /* @__PURE__ */ new Set(), F(this, _, wr).call(this), F(this, _, Er).call(this), a(this, x).removeObserver(this);
|
|
2068
2068
|
}
|
|
2069
2069
|
setOptions(e, r) {
|
|
2070
|
-
const n = this.options, s = a(this,
|
|
2071
|
-
if (this.options = a(this, J).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof oe(this.options.enabled, a(this,
|
|
2070
|
+
const n = this.options, s = a(this, x);
|
|
2071
|
+
if (this.options = a(this, J).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof oe(this.options.enabled, a(this, x)) != "boolean")
|
|
2072
2072
|
throw new Error(
|
|
2073
2073
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
2074
2074
|
);
|
|
2075
|
-
|
|
2075
|
+
F(this, _, Pr).call(this), a(this, x).setOptions(this.options), n._defaulted && !Qt(this.options, n) && a(this, J).getQueryCache().notify({
|
|
2076
2076
|
type: "observerOptionsUpdated",
|
|
2077
|
-
query: a(this,
|
|
2077
|
+
query: a(this, x),
|
|
2078
2078
|
observer: this
|
|
2079
2079
|
});
|
|
2080
2080
|
const i = this.hasListeners();
|
|
2081
2081
|
i && pn(
|
|
2082
|
-
a(this,
|
|
2082
|
+
a(this, x),
|
|
2083
2083
|
s,
|
|
2084
2084
|
this.options,
|
|
2085
2085
|
n
|
|
2086
|
-
) &&
|
|
2087
|
-
const u =
|
|
2088
|
-
i && (a(this,
|
|
2086
|
+
) && F(this, _, vt).call(this), this.updateResult(r), i && (a(this, x) !== s || oe(this.options.enabled, a(this, x)) !== oe(n.enabled, a(this, x)) || Ye(this.options.staleTime, a(this, x)) !== Ye(n.staleTime, a(this, x))) && F(this, _, mr).call(this);
|
|
2087
|
+
const u = F(this, _, gr).call(this);
|
|
2088
|
+
i && (a(this, x) !== s || oe(this.options.enabled, a(this, x)) !== oe(n.enabled, a(this, x)) || u !== a(this, Te)) && F(this, _, vr).call(this, u);
|
|
2089
2089
|
}
|
|
2090
2090
|
getOptimisticResult(e) {
|
|
2091
2091
|
const r = a(this, J).getQueryCache().build(a(this, J), e), n = this.createResult(r, e);
|
|
2092
|
-
return
|
|
2092
|
+
return Oi(this, n) && (E(this, G, n), E(this, ot, this.options), E(this, Qe, a(this, x).state)), n;
|
|
2093
2093
|
}
|
|
2094
2094
|
getCurrentResult() {
|
|
2095
|
-
return a(this,
|
|
2095
|
+
return a(this, G);
|
|
2096
2096
|
}
|
|
2097
2097
|
trackResult(e, r) {
|
|
2098
2098
|
const n = {};
|
|
@@ -2108,7 +2108,7 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2108
2108
|
a(this, ct).add(e);
|
|
2109
2109
|
}
|
|
2110
2110
|
getCurrentQuery() {
|
|
2111
|
-
return a(this,
|
|
2111
|
+
return a(this, x);
|
|
2112
2112
|
}
|
|
2113
2113
|
refetch({ ...e } = {}) {
|
|
2114
2114
|
return this.fetch({
|
|
@@ -2120,91 +2120,91 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2120
2120
|
return n.fetch().then(() => this.createResult(n, r));
|
|
2121
2121
|
}
|
|
2122
2122
|
fetch(e) {
|
|
2123
|
-
return
|
|
2123
|
+
return F(this, _, vt).call(this, {
|
|
2124
2124
|
...e,
|
|
2125
2125
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
2126
|
-
}).then(() => (this.updateResult(), a(this,
|
|
2126
|
+
}).then(() => (this.updateResult(), a(this, G)));
|
|
2127
2127
|
}
|
|
2128
2128
|
createResult(e, r) {
|
|
2129
2129
|
var U;
|
|
2130
|
-
const n = a(this,
|
|
2131
|
-
let
|
|
2130
|
+
const n = a(this, x), s = this.options, i = a(this, G), u = a(this, Qe), l = a(this, ot), h = e !== n ? e.state : a(this, Ft), { state: p } = e;
|
|
2131
|
+
let f = { ...p }, d = !1, m;
|
|
2132
2132
|
if (r._optimisticResults) {
|
|
2133
|
-
const
|
|
2134
|
-
(ge || ve) && (
|
|
2135
|
-
...
|
|
2136
|
-
...Zn(
|
|
2137
|
-
}), r._optimisticResults === "isRestoring" && (
|
|
2133
|
+
const M = this.hasListeners(), ge = !M && yn(e, r), ve = M && pn(e, n, r, s);
|
|
2134
|
+
(ge || ve) && (f = {
|
|
2135
|
+
...f,
|
|
2136
|
+
...Zn(p.data, e.options)
|
|
2137
|
+
}), r._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
|
|
2138
2138
|
}
|
|
2139
|
-
let { error:
|
|
2140
|
-
if (r.select &&
|
|
2141
|
-
if (i &&
|
|
2142
|
-
|
|
2139
|
+
let { error: b, errorUpdatedAt: g, status: w } = f;
|
|
2140
|
+
if (r.select && f.data !== void 0)
|
|
2141
|
+
if (i && f.data === (u == null ? void 0 : u.data) && r.select === a(this, At))
|
|
2142
|
+
m = a(this, at);
|
|
2143
2143
|
else
|
|
2144
2144
|
try {
|
|
2145
|
-
|
|
2146
|
-
} catch (
|
|
2147
|
-
|
|
2145
|
+
E(this, At, r.select), m = r.select(f.data), m = yr(i == null ? void 0 : i.data, m, r), E(this, at, m), E(this, fe, null);
|
|
2146
|
+
} catch (M) {
|
|
2147
|
+
E(this, fe, M);
|
|
2148
2148
|
}
|
|
2149
2149
|
else
|
|
2150
|
-
|
|
2151
|
-
if (r.placeholderData !== void 0 &&
|
|
2152
|
-
let
|
|
2150
|
+
m = f.data;
|
|
2151
|
+
if (r.placeholderData !== void 0 && m === void 0 && w === "pending") {
|
|
2152
|
+
let M;
|
|
2153
2153
|
if (i != null && i.isPlaceholderData && r.placeholderData === (l == null ? void 0 : l.placeholderData))
|
|
2154
|
-
|
|
2155
|
-
else if (
|
|
2154
|
+
M = i.data;
|
|
2155
|
+
else if (M = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
2156
2156
|
(U = a(this, ut)) == null ? void 0 : U.state.data,
|
|
2157
2157
|
a(this, ut)
|
|
2158
|
-
) : r.placeholderData, r.select &&
|
|
2158
|
+
) : r.placeholderData, r.select && M !== void 0)
|
|
2159
2159
|
try {
|
|
2160
|
-
|
|
2160
|
+
M = r.select(M), E(this, fe, null);
|
|
2161
2161
|
} catch (ge) {
|
|
2162
|
-
|
|
2162
|
+
E(this, fe, ge);
|
|
2163
2163
|
}
|
|
2164
|
-
|
|
2164
|
+
M !== void 0 && (w = "success", m = yr(
|
|
2165
2165
|
i == null ? void 0 : i.data,
|
|
2166
|
-
|
|
2166
|
+
M,
|
|
2167
2167
|
r
|
|
2168
|
-
),
|
|
2168
|
+
), d = !0);
|
|
2169
2169
|
}
|
|
2170
|
-
a(this, fe) && (
|
|
2171
|
-
const
|
|
2172
|
-
status:
|
|
2173
|
-
fetchStatus:
|
|
2170
|
+
a(this, fe) && (b = a(this, fe), m = a(this, at), g = Date.now(), w = "error");
|
|
2171
|
+
const v = f.fetchStatus === "fetching", P = w === "pending", S = w === "error", T = P && v, j = m !== void 0, z = {
|
|
2172
|
+
status: w,
|
|
2173
|
+
fetchStatus: f.fetchStatus,
|
|
2174
2174
|
isPending: P,
|
|
2175
|
-
isSuccess:
|
|
2176
|
-
isError:
|
|
2177
|
-
isInitialLoading:
|
|
2178
|
-
isLoading:
|
|
2179
|
-
data:
|
|
2180
|
-
dataUpdatedAt:
|
|
2181
|
-
error:
|
|
2182
|
-
errorUpdatedAt:
|
|
2183
|
-
failureCount:
|
|
2184
|
-
failureReason:
|
|
2185
|
-
errorUpdateCount:
|
|
2186
|
-
isFetched:
|
|
2187
|
-
isFetchedAfterMount:
|
|
2188
|
-
isFetching:
|
|
2189
|
-
isRefetching:
|
|
2190
|
-
isLoadingError:
|
|
2191
|
-
isPaused:
|
|
2192
|
-
isPlaceholderData:
|
|
2193
|
-
isRefetchError:
|
|
2194
|
-
isStale:
|
|
2175
|
+
isSuccess: w === "success",
|
|
2176
|
+
isError: S,
|
|
2177
|
+
isInitialLoading: T,
|
|
2178
|
+
isLoading: T,
|
|
2179
|
+
data: m,
|
|
2180
|
+
dataUpdatedAt: f.dataUpdatedAt,
|
|
2181
|
+
error: b,
|
|
2182
|
+
errorUpdatedAt: g,
|
|
2183
|
+
failureCount: f.fetchFailureCount,
|
|
2184
|
+
failureReason: f.fetchFailureReason,
|
|
2185
|
+
errorUpdateCount: f.errorUpdateCount,
|
|
2186
|
+
isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
|
|
2187
|
+
isFetchedAfterMount: f.dataUpdateCount > h.dataUpdateCount || f.errorUpdateCount > h.errorUpdateCount,
|
|
2188
|
+
isFetching: v,
|
|
2189
|
+
isRefetching: v && !P,
|
|
2190
|
+
isLoadingError: S && !j,
|
|
2191
|
+
isPaused: f.fetchStatus === "paused",
|
|
2192
|
+
isPlaceholderData: d,
|
|
2193
|
+
isRefetchError: S && j,
|
|
2194
|
+
isStale: kr(e, r),
|
|
2195
2195
|
refetch: this.refetch,
|
|
2196
2196
|
promise: a(this, Ce)
|
|
2197
2197
|
};
|
|
2198
2198
|
if (this.options.experimental_prefetchInRender) {
|
|
2199
|
-
const
|
|
2199
|
+
const M = (De) => {
|
|
2200
2200
|
z.status === "error" ? De.reject(z.error) : z.data !== void 0 && De.resolve(z.data);
|
|
2201
2201
|
}, ge = () => {
|
|
2202
|
-
const De =
|
|
2203
|
-
|
|
2202
|
+
const De = E(this, Ce, z.promise = pr());
|
|
2203
|
+
M(De);
|
|
2204
2204
|
}, ve = a(this, Ce);
|
|
2205
2205
|
switch (ve.status) {
|
|
2206
2206
|
case "pending":
|
|
2207
|
-
e.queryHash === n.queryHash &&
|
|
2207
|
+
e.queryHash === n.queryHash && M(ve);
|
|
2208
2208
|
break;
|
|
2209
2209
|
case "fulfilled":
|
|
2210
2210
|
(z.status === "error" || z.data !== ve.value) && ge();
|
|
@@ -2217,10 +2217,10 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2217
2217
|
return z;
|
|
2218
2218
|
}
|
|
2219
2219
|
updateResult(e) {
|
|
2220
|
-
const r = a(this,
|
|
2221
|
-
if (
|
|
2220
|
+
const r = a(this, G), n = this.createResult(a(this, x), this.options);
|
|
2221
|
+
if (E(this, Qe, a(this, x).state), E(this, ot, this.options), a(this, Qe).data !== void 0 && E(this, ut, a(this, x)), Qt(n, r))
|
|
2222
2222
|
return;
|
|
2223
|
-
|
|
2223
|
+
E(this, G, n);
|
|
2224
2224
|
const s = {}, i = () => {
|
|
2225
2225
|
if (!r)
|
|
2226
2226
|
return !0;
|
|
@@ -2230,94 +2230,94 @@ var M, Oe, Re, rt, nt, Se, st, it, qn, Ei = (qn = class {
|
|
|
2230
2230
|
const c = new Set(
|
|
2231
2231
|
l ?? a(this, ct)
|
|
2232
2232
|
);
|
|
2233
|
-
return this.options.throwOnError && c.add("error"), Object.keys(a(this,
|
|
2234
|
-
const
|
|
2235
|
-
return a(this,
|
|
2233
|
+
return this.options.throwOnError && c.add("error"), Object.keys(a(this, G)).some((h) => {
|
|
2234
|
+
const p = h;
|
|
2235
|
+
return a(this, G)[p] !== r[p] && c.has(p);
|
|
2236
2236
|
});
|
|
2237
2237
|
};
|
|
2238
|
-
(e == null ? void 0 : e.listeners) !== !1 && i() && (s.listeners = !0),
|
|
2238
|
+
(e == null ? void 0 : e.listeners) !== !1 && i() && (s.listeners = !0), F(this, _, ts).call(this, { ...s, ...e });
|
|
2239
2239
|
}
|
|
2240
2240
|
onQueryUpdate() {
|
|
2241
|
-
this.updateResult(), this.hasListeners() &&
|
|
2241
|
+
this.updateResult(), this.hasListeners() && F(this, _, br).call(this);
|
|
2242
2242
|
}
|
|
2243
|
-
}, J = new WeakMap(),
|
|
2244
|
-
|
|
2245
|
-
let r = a(this,
|
|
2243
|
+
}, J = new WeakMap(), x = new WeakMap(), Ft = new WeakMap(), G = new WeakMap(), Qe = new WeakMap(), ot = new WeakMap(), Ce = new WeakMap(), fe = new WeakMap(), At = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), $e = new WeakMap(), Ke = new WeakMap(), Te = new WeakMap(), ct = new WeakMap(), _ = new WeakSet(), vt = function(e) {
|
|
2244
|
+
F(this, _, Pr).call(this);
|
|
2245
|
+
let r = a(this, x).fetch(
|
|
2246
2246
|
this.options,
|
|
2247
2247
|
e
|
|
2248
2248
|
);
|
|
2249
|
-
return e != null && e.throwOnError || (r = r.catch(
|
|
2250
|
-
},
|
|
2251
|
-
|
|
2249
|
+
return e != null && e.throwOnError || (r = r.catch(ne)), r;
|
|
2250
|
+
}, mr = function() {
|
|
2251
|
+
F(this, _, wr).call(this);
|
|
2252
2252
|
const e = Ye(
|
|
2253
2253
|
this.options.staleTime,
|
|
2254
|
-
a(this,
|
|
2254
|
+
a(this, x)
|
|
2255
2255
|
);
|
|
2256
|
-
if (ze || a(this,
|
|
2256
|
+
if (ze || a(this, G).isStale || !fr(e))
|
|
2257
2257
|
return;
|
|
2258
|
-
const n =
|
|
2259
|
-
|
|
2260
|
-
a(this,
|
|
2258
|
+
const n = Wn(a(this, G).dataUpdatedAt, e) + 1;
|
|
2259
|
+
E(this, $e, setTimeout(() => {
|
|
2260
|
+
a(this, G).isStale || this.updateResult();
|
|
2261
2261
|
}, n));
|
|
2262
|
-
},
|
|
2263
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this,
|
|
2264
|
-
},
|
|
2265
|
-
|
|
2266
|
-
(this.options.refetchIntervalInBackground || Dr.isFocused()) &&
|
|
2262
|
+
}, gr = function() {
|
|
2263
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this, x)) : this.options.refetchInterval) ?? !1;
|
|
2264
|
+
}, vr = function(e) {
|
|
2265
|
+
F(this, _, Er).call(this), E(this, Te, e), !(ze || oe(this.options.enabled, a(this, x)) === !1 || !fr(a(this, Te)) || a(this, Te) === 0) && E(this, Ke, setInterval(() => {
|
|
2266
|
+
(this.options.refetchIntervalInBackground || Dr.isFocused()) && F(this, _, vt).call(this);
|
|
2267
2267
|
}, a(this, Te)));
|
|
2268
|
-
}, vr = function() {
|
|
2269
|
-
C(this, _, pr).call(this), C(this, _, gr).call(this, C(this, _, mr).call(this));
|
|
2270
2268
|
}, br = function() {
|
|
2271
|
-
|
|
2269
|
+
F(this, _, mr).call(this), F(this, _, vr).call(this, F(this, _, gr).call(this));
|
|
2272
2270
|
}, wr = function() {
|
|
2273
|
-
a(this,
|
|
2271
|
+
a(this, $e) && (clearTimeout(a(this, $e)), E(this, $e, void 0));
|
|
2274
2272
|
}, Er = function() {
|
|
2273
|
+
a(this, Ke) && (clearInterval(a(this, Ke)), E(this, Ke, void 0));
|
|
2274
|
+
}, Pr = function() {
|
|
2275
2275
|
const e = a(this, J).getQueryCache().build(a(this, J), this.options);
|
|
2276
|
-
if (e === a(this,
|
|
2276
|
+
if (e === a(this, x))
|
|
2277
2277
|
return;
|
|
2278
|
-
const r = a(this,
|
|
2279
|
-
|
|
2278
|
+
const r = a(this, x);
|
|
2279
|
+
E(this, x, e), E(this, Ft, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
|
|
2280
2280
|
}, ts = function(e) {
|
|
2281
2281
|
$.batch(() => {
|
|
2282
2282
|
e.listeners && this.listeners.forEach((r) => {
|
|
2283
|
-
r(a(this,
|
|
2283
|
+
r(a(this, G));
|
|
2284
2284
|
}), a(this, J).getQueryCache().notify({
|
|
2285
|
-
query: a(this,
|
|
2285
|
+
query: a(this, x),
|
|
2286
2286
|
type: "observerResultsUpdated"
|
|
2287
2287
|
});
|
|
2288
2288
|
});
|
|
2289
|
-
},
|
|
2290
|
-
function
|
|
2289
|
+
}, Mn);
|
|
2290
|
+
function Ri(t, e) {
|
|
2291
2291
|
return oe(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
2292
2292
|
}
|
|
2293
2293
|
function yn(t, e) {
|
|
2294
|
-
return
|
|
2294
|
+
return Ri(t, e) || t.state.data !== void 0 && Rr(t, e, e.refetchOnMount);
|
|
2295
2295
|
}
|
|
2296
|
-
function
|
|
2296
|
+
function Rr(t, e, r) {
|
|
2297
2297
|
if (oe(e.enabled, t) !== !1) {
|
|
2298
2298
|
const n = typeof r == "function" ? r(t) : r;
|
|
2299
|
-
return n === "always" || n !== !1 &&
|
|
2299
|
+
return n === "always" || n !== !1 && kr(t, e);
|
|
2300
2300
|
}
|
|
2301
2301
|
return !1;
|
|
2302
2302
|
}
|
|
2303
2303
|
function pn(t, e, r, n) {
|
|
2304
|
-
return (t !== e || oe(n.enabled, t) === !1) && (!r.suspense || t.state.status !== "error") &&
|
|
2304
|
+
return (t !== e || oe(n.enabled, t) === !1) && (!r.suspense || t.state.status !== "error") && kr(t, r);
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2306
|
+
function kr(t, e) {
|
|
2307
2307
|
return oe(e.enabled, t) !== !1 && t.isStaleByTime(Ye(e.staleTime, t));
|
|
2308
2308
|
}
|
|
2309
|
-
function
|
|
2310
|
-
return !
|
|
2309
|
+
function Oi(t, e) {
|
|
2310
|
+
return !Qt(t.getCurrentResult(), e);
|
|
2311
2311
|
}
|
|
2312
|
-
var Fe, Ae, X, pe, me, Ut, Or,
|
|
2312
|
+
var Fe, Ae, X, pe, me, Ut, Or, Un, Si = (Un = class extends ft {
|
|
2313
2313
|
constructor(e, r) {
|
|
2314
2314
|
super();
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2315
|
+
O(this, me);
|
|
2316
|
+
O(this, Fe);
|
|
2317
|
+
O(this, Ae);
|
|
2318
|
+
O(this, X);
|
|
2319
|
+
O(this, pe);
|
|
2320
|
+
E(this, Fe, e), this.setOptions(r), this.bindMethods(), F(this, me, Ut).call(this);
|
|
2321
2321
|
}
|
|
2322
2322
|
bindMethods() {
|
|
2323
2323
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -2325,7 +2325,7 @@ var Fe, Ae, X, pe, me, Ut, Or, Mn, Si = (Mn = class extends ft {
|
|
|
2325
2325
|
setOptions(e) {
|
|
2326
2326
|
var n;
|
|
2327
2327
|
const r = this.options;
|
|
2328
|
-
this.options = a(this, Fe).defaultMutationOptions(e),
|
|
2328
|
+
this.options = a(this, Fe).defaultMutationOptions(e), Qt(this.options, r) || a(this, Fe).getMutationCache().notify({
|
|
2329
2329
|
type: "observerOptionsUpdated",
|
|
2330
2330
|
mutation: a(this, X),
|
|
2331
2331
|
observer: this
|
|
@@ -2336,23 +2336,23 @@ var Fe, Ae, X, pe, me, Ut, Or, Mn, Si = (Mn = class extends ft {
|
|
|
2336
2336
|
this.hasListeners() || (e = a(this, X)) == null || e.removeObserver(this);
|
|
2337
2337
|
}
|
|
2338
2338
|
onMutationUpdate(e) {
|
|
2339
|
-
|
|
2339
|
+
F(this, me, Ut).call(this), F(this, me, Or).call(this, e);
|
|
2340
2340
|
}
|
|
2341
2341
|
getCurrentResult() {
|
|
2342
2342
|
return a(this, Ae);
|
|
2343
2343
|
}
|
|
2344
2344
|
reset() {
|
|
2345
2345
|
var e;
|
|
2346
|
-
(e = a(this, X)) == null || e.removeObserver(this),
|
|
2346
|
+
(e = a(this, X)) == null || e.removeObserver(this), E(this, X, void 0), F(this, me, Ut).call(this), F(this, me, Or).call(this);
|
|
2347
2347
|
}
|
|
2348
2348
|
mutate(e, r) {
|
|
2349
2349
|
var n;
|
|
2350
|
-
return
|
|
2350
|
+
return E(this, pe, r), (n = a(this, X)) == null || n.removeObserver(this), E(this, X, a(this, Fe).getMutationCache().build(a(this, Fe), this.options)), a(this, X).addObserver(this), a(this, X).execute(e);
|
|
2351
2351
|
}
|
|
2352
2352
|
}, Fe = new WeakMap(), Ae = new WeakMap(), X = new WeakMap(), pe = new WeakMap(), me = new WeakSet(), Ut = function() {
|
|
2353
2353
|
var r;
|
|
2354
2354
|
const e = ((r = a(this, X)) == null ? void 0 : r.state) ?? es();
|
|
2355
|
-
|
|
2355
|
+
E(this, Ae, {
|
|
2356
2356
|
...e,
|
|
2357
2357
|
isPending: e.status === "pending",
|
|
2358
2358
|
isSuccess: e.status === "success",
|
|
@@ -2365,20 +2365,20 @@ var Fe, Ae, X, pe, me, Ut, Or, Mn, Si = (Mn = class extends ft {
|
|
|
2365
2365
|
$.batch(() => {
|
|
2366
2366
|
var r, n, s, i, u, l, c, h;
|
|
2367
2367
|
if (a(this, pe) && this.hasListeners()) {
|
|
2368
|
-
const
|
|
2369
|
-
(e == null ? void 0 : e.type) === "success" ? ((n = (r = a(this, pe)).onSuccess) == null || n.call(r, e.data,
|
|
2368
|
+
const p = a(this, Ae).variables, f = a(this, Ae).context;
|
|
2369
|
+
(e == null ? void 0 : e.type) === "success" ? ((n = (r = a(this, pe)).onSuccess) == null || n.call(r, e.data, p, f), (i = (s = a(this, pe)).onSettled) == null || i.call(s, e.data, null, p, f)) : (e == null ? void 0 : e.type) === "error" && ((l = (u = a(this, pe)).onError) == null || l.call(u, e.error, p, f), (h = (c = a(this, pe)).onSettled) == null || h.call(
|
|
2370
2370
|
c,
|
|
2371
2371
|
void 0,
|
|
2372
2372
|
e.error,
|
|
2373
|
-
|
|
2374
|
-
|
|
2373
|
+
p,
|
|
2374
|
+
f
|
|
2375
2375
|
));
|
|
2376
2376
|
}
|
|
2377
|
-
this.listeners.forEach((
|
|
2378
|
-
|
|
2377
|
+
this.listeners.forEach((p) => {
|
|
2378
|
+
p(a(this, Ae));
|
|
2379
2379
|
});
|
|
2380
2380
|
});
|
|
2381
|
-
},
|
|
2381
|
+
}, Un), rs = K.createContext(
|
|
2382
2382
|
void 0
|
|
2383
2383
|
), dt = (t) => {
|
|
2384
2384
|
const e = K.useContext(rs);
|
|
@@ -2408,7 +2408,7 @@ var Ai = K.createContext(Fi()), xi = () => K.useContext(Ai);
|
|
|
2408
2408
|
function ss(t, e) {
|
|
2409
2409
|
return typeof t == "function" ? t(...e) : !!t;
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function Sr() {
|
|
2412
2412
|
}
|
|
2413
2413
|
var Ii = (t, e) => {
|
|
2414
2414
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
@@ -2416,44 +2416,44 @@ var Ii = (t, e) => {
|
|
|
2416
2416
|
K.useEffect(() => {
|
|
2417
2417
|
t.clearReset();
|
|
2418
2418
|
}, [t]);
|
|
2419
|
-
},
|
|
2419
|
+
}, ki = ({
|
|
2420
2420
|
result: t,
|
|
2421
2421
|
errorResetBoundary: e,
|
|
2422
2422
|
throwOnError: r,
|
|
2423
2423
|
query: n,
|
|
2424
2424
|
suspense: s
|
|
2425
|
-
}) => t.isError && !e.isReset() && !t.isFetching && n && (s && t.data === void 0 || ss(r, [t.error, n])),
|
|
2425
|
+
}) => t.isError && !e.isReset() && !t.isFetching && n && (s && t.data === void 0 || ss(r, [t.error, n])), _i = (t) => {
|
|
2426
2426
|
const e = t.staleTime;
|
|
2427
2427
|
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)));
|
|
2428
2428
|
}, ji = (t, e) => t.isLoading && t.isFetching && !e, qi = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, mn = (t, e, r) => e.fetchOptimistic(t).catch(() => {
|
|
2429
2429
|
r.clearReset();
|
|
2430
2430
|
});
|
|
2431
|
-
function
|
|
2432
|
-
var
|
|
2431
|
+
function Mi(t, e, r) {
|
|
2432
|
+
var f, d, m, b, g;
|
|
2433
2433
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
2434
2434
|
throw new Error(
|
|
2435
2435
|
'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'
|
|
2436
2436
|
);
|
|
2437
2437
|
const n = dt(), s = Ti(), i = xi(), u = n.defaultQueryOptions(t);
|
|
2438
|
-
(
|
|
2439
|
-
|
|
2438
|
+
(d = (f = n.getDefaultOptions().queries) == null ? void 0 : f._experimental_beforeQuery) == null || d.call(
|
|
2439
|
+
f,
|
|
2440
2440
|
u
|
|
2441
2441
|
), process.env.NODE_ENV !== "production" && (u.queryFn || console.error(
|
|
2442
2442
|
`[${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`
|
|
2443
|
-
)), u._optimisticResults = s ? "isRestoring" : "optimistic",
|
|
2443
|
+
)), u._optimisticResults = s ? "isRestoring" : "optimistic", _i(u), Ii(u, i), Di(i);
|
|
2444
2444
|
const l = !n.getQueryCache().get(u.queryHash), [c] = K.useState(
|
|
2445
2445
|
() => new e(
|
|
2446
2446
|
n,
|
|
2447
2447
|
u
|
|
2448
2448
|
)
|
|
2449
|
-
), h = c.getOptimisticResult(u),
|
|
2449
|
+
), h = c.getOptimisticResult(u), p = !s && t.subscribed !== !1;
|
|
2450
2450
|
if (K.useSyncExternalStore(
|
|
2451
2451
|
K.useCallback(
|
|
2452
|
-
(
|
|
2453
|
-
const
|
|
2454
|
-
return c.updateResult(),
|
|
2452
|
+
(w) => {
|
|
2453
|
+
const v = p ? c.subscribe($.batchCalls(w)) : Sr;
|
|
2454
|
+
return c.updateResult(), v;
|
|
2455
2455
|
},
|
|
2456
|
-
[c,
|
|
2456
|
+
[c, p]
|
|
2457
2457
|
),
|
|
2458
2458
|
() => c.getCurrentResult(),
|
|
2459
2459
|
() => c.getCurrentResult()
|
|
@@ -2461,7 +2461,7 @@ function Ui(t, e, r) {
|
|
|
2461
2461
|
c.setOptions(u, { listeners: !1 });
|
|
2462
2462
|
}, [u, c]), qi(u, h))
|
|
2463
2463
|
throw mn(u, c, i);
|
|
2464
|
-
if (
|
|
2464
|
+
if (ki({
|
|
2465
2465
|
result: h,
|
|
2466
2466
|
errorResetBoundary: i,
|
|
2467
2467
|
throwOnError: u.throwOnError,
|
|
@@ -2469,28 +2469,28 @@ function Ui(t, e, r) {
|
|
|
2469
2469
|
suspense: u.suspense
|
|
2470
2470
|
}))
|
|
2471
2471
|
throw h.error;
|
|
2472
|
-
if ((
|
|
2473
|
-
|
|
2472
|
+
if ((b = (m = n.getDefaultOptions().queries) == null ? void 0 : m._experimental_afterQuery) == null || b.call(
|
|
2473
|
+
m,
|
|
2474
2474
|
u,
|
|
2475
2475
|
h
|
|
2476
2476
|
), u.experimental_prefetchInRender && !ze && ji(h, s)) {
|
|
2477
|
-
const
|
|
2477
|
+
const w = l ? (
|
|
2478
2478
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
2479
2479
|
mn(u, c, i)
|
|
2480
2480
|
) : (
|
|
2481
2481
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
2482
|
-
(
|
|
2482
|
+
(g = n.getQueryCache().get(u.queryHash)) == null ? void 0 : g.promise
|
|
2483
2483
|
);
|
|
2484
|
-
|
|
2484
|
+
w == null || w.catch(Sr).finally(() => {
|
|
2485
2485
|
c.updateResult();
|
|
2486
2486
|
});
|
|
2487
2487
|
}
|
|
2488
2488
|
return u.notifyOnChangeProps ? h : c.trackResult(h);
|
|
2489
2489
|
}
|
|
2490
|
-
function
|
|
2491
|
-
return
|
|
2490
|
+
function _r(t, e) {
|
|
2491
|
+
return Mi(t, Pi);
|
|
2492
2492
|
}
|
|
2493
|
-
function
|
|
2493
|
+
function Vt(t, e) {
|
|
2494
2494
|
const r = dt(), [n] = K.useState(
|
|
2495
2495
|
() => new Si(
|
|
2496
2496
|
r,
|
|
@@ -2509,7 +2509,7 @@ function Kt(t, e) {
|
|
|
2509
2509
|
() => n.getCurrentResult()
|
|
2510
2510
|
), i = K.useCallback(
|
|
2511
2511
|
(u, l) => {
|
|
2512
|
-
n.mutate(u, l).catch(
|
|
2512
|
+
n.mutate(u, l).catch(Sr);
|
|
2513
2513
|
},
|
|
2514
2514
|
[n]
|
|
2515
2515
|
);
|
|
@@ -2517,7 +2517,7 @@ function Kt(t, e) {
|
|
|
2517
2517
|
throw s.error;
|
|
2518
2518
|
return { ...s, mutate: i, mutateAsync: s.mutate };
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function Ht(t) {
|
|
2521
2521
|
const e = {
|
|
2522
2522
|
subscribe(r) {
|
|
2523
2523
|
let n = null, s = !1, i = !1, u = !1;
|
|
@@ -2546,12 +2546,12 @@ function zt(t) {
|
|
|
2546
2546
|
};
|
|
2547
2547
|
},
|
|
2548
2548
|
pipe(...r) {
|
|
2549
|
-
return r.reduce(
|
|
2549
|
+
return r.reduce(Ui, e);
|
|
2550
2550
|
}
|
|
2551
2551
|
};
|
|
2552
2552
|
return e;
|
|
2553
2553
|
}
|
|
2554
|
-
function
|
|
2554
|
+
function Ui(t, e) {
|
|
2555
2555
|
return e(t);
|
|
2556
2556
|
}
|
|
2557
2557
|
function Ni(t) {
|
|
@@ -2606,7 +2606,7 @@ function Li(t) {
|
|
|
2606
2606
|
n = null, l.unsubscribe();
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
2609
|
-
return
|
|
2609
|
+
return Ht((l) => (r++, s.push(l), i(), {
|
|
2610
2610
|
unsubscribe() {
|
|
2611
2611
|
r--, u();
|
|
2612
2612
|
const c = s.findIndex((h) => h === l);
|
|
@@ -2621,7 +2621,7 @@ function Qi(t) {
|
|
|
2621
2621
|
e !== void 0 && u.next(e), r.push(u);
|
|
2622
2622
|
}, s = (u) => {
|
|
2623
2623
|
r.splice(r.indexOf(u), 1);
|
|
2624
|
-
}, i =
|
|
2624
|
+
}, i = Ht((u) => (n(u), () => {
|
|
2625
2625
|
s(u);
|
|
2626
2626
|
}));
|
|
2627
2627
|
return i.next = (u) => {
|
|
@@ -2633,7 +2633,7 @@ function Qi(t) {
|
|
|
2633
2633
|
}, i.get = () => e, i;
|
|
2634
2634
|
}
|
|
2635
2635
|
function $i(t) {
|
|
2636
|
-
return
|
|
2636
|
+
return Ht((e) => {
|
|
2637
2637
|
function r(s = 0, i = t.op) {
|
|
2638
2638
|
const u = t.links[s];
|
|
2639
2639
|
if (!u)
|
|
@@ -2665,19 +2665,19 @@ function os(t, e, r) {
|
|
|
2665
2665
|
},
|
|
2666
2666
|
apply(u, l, c) {
|
|
2667
2667
|
const h = e[e.length - 1];
|
|
2668
|
-
let
|
|
2668
|
+
let p = {
|
|
2669
2669
|
args: c,
|
|
2670
2670
|
path: e
|
|
2671
2671
|
};
|
|
2672
|
-
return h === "call" ?
|
|
2672
|
+
return h === "call" ? p = {
|
|
2673
2673
|
args: c.length >= 2 ? [
|
|
2674
2674
|
c[1]
|
|
2675
2675
|
] : [],
|
|
2676
2676
|
path: e.slice(0, -1)
|
|
2677
|
-
} : h === "apply" && (
|
|
2677
|
+
} : h === "apply" && (p = {
|
|
2678
2678
|
args: c.length >= 2 ? c[1] : [],
|
|
2679
2679
|
path: e.slice(0, -1)
|
|
2680
|
-
}), gn(
|
|
2680
|
+
}), gn(p.args), gn(p.path), t(p);
|
|
2681
2681
|
}
|
|
2682
2682
|
})), r[i];
|
|
2683
2683
|
}
|
|
@@ -2712,22 +2712,22 @@ function Vi(t, e) {
|
|
|
2712
2712
|
}
|
|
2713
2713
|
};
|
|
2714
2714
|
}
|
|
2715
|
-
class
|
|
2715
|
+
class ar extends Error {
|
|
2716
2716
|
constructor() {
|
|
2717
2717
|
super("Unable to transform response from server");
|
|
2718
2718
|
}
|
|
2719
2719
|
}
|
|
2720
|
-
function
|
|
2720
|
+
function Hi(t, e) {
|
|
2721
2721
|
let r;
|
|
2722
2722
|
try {
|
|
2723
2723
|
r = Vi(t, e);
|
|
2724
2724
|
} catch {
|
|
2725
|
-
throw new
|
|
2725
|
+
throw new ar();
|
|
2726
2726
|
}
|
|
2727
2727
|
if (!r.ok && (!Pt(r.error.error) || typeof r.error.error.code != "number"))
|
|
2728
|
-
throw new
|
|
2728
|
+
throw new ar();
|
|
2729
2729
|
if (r.ok && !Pt(r.result))
|
|
2730
|
-
throw new
|
|
2730
|
+
throw new ar();
|
|
2731
2731
|
return r;
|
|
2732
2732
|
}
|
|
2733
2733
|
var vn, bn;
|
|
@@ -2744,7 +2744,7 @@ function qt(t, e, r) {
|
|
|
2744
2744
|
writable: !0
|
|
2745
2745
|
}) : t[e] = r, t;
|
|
2746
2746
|
}
|
|
2747
|
-
function
|
|
2747
|
+
function Wi(t) {
|
|
2748
2748
|
return t instanceof xe || /**
|
|
2749
2749
|
* @deprecated
|
|
2750
2750
|
* Delete in next major
|
|
@@ -2760,7 +2760,7 @@ function Gi(t, e) {
|
|
|
2760
2760
|
class xe extends Error {
|
|
2761
2761
|
static from(e, r = {}) {
|
|
2762
2762
|
const n = e;
|
|
2763
|
-
return
|
|
2763
|
+
return Wi(n) ? (r.meta && (n.meta = {
|
|
2764
2764
|
...n.meta,
|
|
2765
2765
|
...r.meta
|
|
2766
2766
|
}), n) : Bi(n) ? new xe(n.error.message, {
|
|
@@ -2785,7 +2785,7 @@ class xe extends Error {
|
|
|
2785
2785
|
qt(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 = (i = r == null ? void 0 : r.result) == null ? void 0 : i.error.data, this.name = "TRPCClientError", Object.setPrototypeOf(this, xe.prototype);
|
|
2786
2786
|
}
|
|
2787
2787
|
}
|
|
2788
|
-
function
|
|
2788
|
+
function ur(t, e, r) {
|
|
2789
2789
|
return e in t ? Object.defineProperty(t, e, {
|
|
2790
2790
|
value: r,
|
|
2791
2791
|
enumerable: !0,
|
|
@@ -2873,7 +2873,7 @@ class Yi {
|
|
|
2873
2873
|
});
|
|
2874
2874
|
}
|
|
2875
2875
|
constructor(e) {
|
|
2876
|
-
|
|
2876
|
+
ur(this, "links", void 0), ur(this, "runtime", void 0), ur(this, "requestId", void 0), this.requestId = 0, this.runtime = {}, this.links = e.links.map((r) => r(this.runtime));
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
const Ji = Symbol.for("trpc_untypedClient"), Xi = {
|
|
@@ -2913,26 +2913,26 @@ function Pn(t) {
|
|
|
2913
2913
|
clearTimeout(r), r = null, e = null;
|
|
2914
2914
|
};
|
|
2915
2915
|
function s(l) {
|
|
2916
|
-
var
|
|
2916
|
+
var p, f;
|
|
2917
2917
|
const c = [
|
|
2918
2918
|
[]
|
|
2919
2919
|
];
|
|
2920
2920
|
let h = 0;
|
|
2921
2921
|
for (; ; ) {
|
|
2922
|
-
const
|
|
2923
|
-
if (!
|
|
2922
|
+
const d = l[h];
|
|
2923
|
+
if (!d)
|
|
2924
2924
|
break;
|
|
2925
|
-
const
|
|
2926
|
-
if (
|
|
2927
|
-
(
|
|
2925
|
+
const m = c[c.length - 1];
|
|
2926
|
+
if (d.aborted) {
|
|
2927
|
+
(p = d.reject) == null || p.call(d, new Error("Aborted")), h++;
|
|
2928
2928
|
continue;
|
|
2929
2929
|
}
|
|
2930
|
-
if (t.validate(
|
|
2931
|
-
|
|
2930
|
+
if (t.validate(m.concat(d).map((g) => g.key))) {
|
|
2931
|
+
m.push(d), h++;
|
|
2932
2932
|
continue;
|
|
2933
2933
|
}
|
|
2934
|
-
if (
|
|
2935
|
-
(
|
|
2934
|
+
if (m.length === 0) {
|
|
2935
|
+
(f = d.reject) == null || f.call(d, new Error("Input is too big for a single dispatch")), h++;
|
|
2936
2936
|
continue;
|
|
2937
2937
|
}
|
|
2938
2938
|
c.push([]);
|
|
@@ -2948,27 +2948,27 @@ function Pn(t) {
|
|
|
2948
2948
|
const h = {
|
|
2949
2949
|
items: c
|
|
2950
2950
|
};
|
|
2951
|
-
for (const
|
|
2952
|
-
|
|
2953
|
-
t.fetch(h.items.map((
|
|
2954
|
-
var
|
|
2955
|
-
await Promise.all(
|
|
2956
|
-
var
|
|
2957
|
-
const
|
|
2951
|
+
for (const f of c)
|
|
2952
|
+
f.batch = h;
|
|
2953
|
+
t.fetch(h.items.map((f) => f.key)).then(async (f) => {
|
|
2954
|
+
var d;
|
|
2955
|
+
await Promise.all(f.map(async (m, b) => {
|
|
2956
|
+
var w, v;
|
|
2957
|
+
const g = h.items[b];
|
|
2958
2958
|
try {
|
|
2959
|
-
const P = await Promise.resolve(
|
|
2960
|
-
(
|
|
2959
|
+
const P = await Promise.resolve(m);
|
|
2960
|
+
(w = g.resolve) == null || w.call(g, P);
|
|
2961
2961
|
} catch (P) {
|
|
2962
|
-
(
|
|
2962
|
+
(v = g.reject) == null || v.call(g, P);
|
|
2963
2963
|
}
|
|
2964
|
-
|
|
2964
|
+
g.batch = null, g.reject = null, g.resolve = null;
|
|
2965
2965
|
}));
|
|
2966
|
-
for (const
|
|
2967
|
-
(
|
|
2968
|
-
}).catch((
|
|
2969
|
-
var
|
|
2970
|
-
for (const
|
|
2971
|
-
(
|
|
2966
|
+
for (const m of h.items)
|
|
2967
|
+
(d = m.reject) == null || d.call(m, new Error("Missing result")), m.batch = null;
|
|
2968
|
+
}).catch((f) => {
|
|
2969
|
+
var d;
|
|
2970
|
+
for (const m of h.items)
|
|
2971
|
+
(d = m.reject) == null || d.call(m, f), m.batch = null;
|
|
2972
2972
|
});
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
@@ -2979,8 +2979,8 @@ function Pn(t) {
|
|
|
2979
2979
|
batch: null,
|
|
2980
2980
|
resolve: En,
|
|
2981
2981
|
reject: En
|
|
2982
|
-
}, h = new Promise((
|
|
2983
|
-
c.reject =
|
|
2982
|
+
}, h = new Promise((p, f) => {
|
|
2983
|
+
c.reject = f, c.resolve = p, e || (e = []), e.push(c);
|
|
2984
2984
|
});
|
|
2985
2985
|
return r || (r = setTimeout(i)), h;
|
|
2986
2986
|
}
|
|
@@ -3108,59 +3108,59 @@ function po(t) {
|
|
|
3108
3108
|
validate(c) {
|
|
3109
3109
|
if (r === 1 / 0)
|
|
3110
3110
|
return !0;
|
|
3111
|
-
const h = c.map((
|
|
3111
|
+
const h = c.map((d) => d.path).join(","), p = c.map((d) => d.input);
|
|
3112
3112
|
return us({
|
|
3113
3113
|
...e,
|
|
3114
3114
|
type: l,
|
|
3115
3115
|
path: h,
|
|
3116
|
-
inputs:
|
|
3116
|
+
inputs: p,
|
|
3117
3117
|
signal: null
|
|
3118
3118
|
}).length <= r;
|
|
3119
3119
|
},
|
|
3120
3120
|
async fetch(c) {
|
|
3121
|
-
const h = c.map((
|
|
3121
|
+
const h = c.map((g) => g.path).join(","), p = c.map((g) => g.input), f = no(...c.map((g) => g.signal)), d = await co({
|
|
3122
3122
|
...e,
|
|
3123
3123
|
path: h,
|
|
3124
|
-
inputs:
|
|
3124
|
+
inputs: p,
|
|
3125
3125
|
type: l,
|
|
3126
3126
|
headers() {
|
|
3127
3127
|
return t.headers ? typeof t.headers == "function" ? t.headers({
|
|
3128
3128
|
opList: c
|
|
3129
3129
|
}) : t.headers : {};
|
|
3130
3130
|
},
|
|
3131
|
-
signal:
|
|
3131
|
+
signal: f
|
|
3132
3132
|
});
|
|
3133
|
-
return (Array.isArray(
|
|
3134
|
-
meta:
|
|
3135
|
-
json:
|
|
3133
|
+
return (Array.isArray(d.json) ? d.json : c.map(() => d.json)).map((g) => ({
|
|
3134
|
+
meta: d.meta,
|
|
3135
|
+
json: g
|
|
3136
3136
|
}));
|
|
3137
3137
|
}
|
|
3138
3138
|
}), s = Pn(n("query")), i = Pn(n("mutation")), u = {
|
|
3139
3139
|
query: s,
|
|
3140
3140
|
mutation: i
|
|
3141
3141
|
};
|
|
3142
|
-
return ({ op: l }) =>
|
|
3142
|
+
return ({ op: l }) => Ht((c) => {
|
|
3143
3143
|
/* istanbul ignore if -- @preserve */
|
|
3144
3144
|
if (l.type === "subscription")
|
|
3145
3145
|
throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
3146
|
-
const
|
|
3147
|
-
let
|
|
3148
|
-
return
|
|
3149
|
-
|
|
3150
|
-
const
|
|
3151
|
-
if (!
|
|
3152
|
-
c.error(xe.from(
|
|
3153
|
-
meta:
|
|
3146
|
+
const p = u[l.type].load(l);
|
|
3147
|
+
let f;
|
|
3148
|
+
return p.then((d) => {
|
|
3149
|
+
f = d;
|
|
3150
|
+
const m = Hi(d.json, e.transformer.output);
|
|
3151
|
+
if (!m.ok) {
|
|
3152
|
+
c.error(xe.from(m.error, {
|
|
3153
|
+
meta: d.meta
|
|
3154
3154
|
}));
|
|
3155
3155
|
return;
|
|
3156
3156
|
}
|
|
3157
3157
|
c.next({
|
|
3158
|
-
context:
|
|
3159
|
-
result:
|
|
3158
|
+
context: d.meta,
|
|
3159
|
+
result: m.result
|
|
3160
3160
|
}), c.complete();
|
|
3161
|
-
}).catch((
|
|
3162
|
-
c.error(xe.from(
|
|
3163
|
-
meta:
|
|
3161
|
+
}).catch((d) => {
|
|
3162
|
+
c.error(xe.from(d, {
|
|
3163
|
+
meta: f == null ? void 0 : f.meta
|
|
3164
3164
|
}));
|
|
3165
3165
|
}), () => {
|
|
3166
3166
|
};
|
|
@@ -3219,7 +3219,7 @@ function wo(t, { intervalMs: e, pongTimeoutMs: r }) {
|
|
|
3219
3219
|
clearTimeout(n), clearTimeout(s);
|
|
3220
3220
|
});
|
|
3221
3221
|
}
|
|
3222
|
-
class
|
|
3222
|
+
class zt {
|
|
3223
3223
|
get ws() {
|
|
3224
3224
|
return this.wsObservable.get();
|
|
3225
3225
|
}
|
|
@@ -3240,7 +3240,7 @@ class $t {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
async open() {
|
|
3242
3242
|
if (this.openPromise) return this.openPromise;
|
|
3243
|
-
this.id =
|
|
3243
|
+
this.id = ++zt.connectCount;
|
|
3244
3244
|
const e = vo(this.urlOptions).then((r) => new this.WebSocketPonyfill(r));
|
|
3245
3245
|
this.openPromise = e.then(bo), this.ws = await e, this.ws.addEventListener("message", function({ data: r }) {
|
|
3246
3246
|
r === "PING" && this.send("PONG");
|
|
@@ -3266,12 +3266,12 @@ class $t {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
3268
|
constructor(e) {
|
|
3269
|
-
if (je(this, "id",
|
|
3269
|
+
if (je(this, "id", ++zt.connectCount), je(this, "WebSocketPonyfill", void 0), je(this, "urlOptions", void 0), je(this, "keepAliveOpts", void 0), je(this, "wsObservable", Qi(null)), je(this, "openPromise", null), this.WebSocketPonyfill = e.WebSocketPonyfill ?? WebSocket, !this.WebSocketPonyfill)
|
|
3270
3270
|
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");
|
|
3271
3271
|
this.urlOptions = e.urlOptions, this.keepAliveOpts = e.keepAlive;
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
je(
|
|
3274
|
+
je(zt, "connectCount", 0);
|
|
3275
3275
|
class Eo {
|
|
3276
3276
|
constructor() {
|
|
3277
3277
|
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
@@ -3317,7 +3317,7 @@ class Po extends cs {
|
|
|
3317
3317
|
return this.classToAllowedProps.get(e);
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
3320
|
-
function
|
|
3320
|
+
function Ro(t) {
|
|
3321
3321
|
if ("values" in Object)
|
|
3322
3322
|
return Object.values(t);
|
|
3323
3323
|
const e = [];
|
|
@@ -3325,8 +3325,8 @@ function Oo(t) {
|
|
|
3325
3325
|
t.hasOwnProperty(r) && e.push(t[r]);
|
|
3326
3326
|
return e;
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3329
|
-
const r =
|
|
3328
|
+
function Oo(t, e) {
|
|
3329
|
+
const r = Ro(t);
|
|
3330
3330
|
if ("find" in r)
|
|
3331
3331
|
return r.find(e);
|
|
3332
3332
|
const n = r;
|
|
@@ -3339,10 +3339,10 @@ function Ro(t, e) {
|
|
|
3339
3339
|
function lt(t, e) {
|
|
3340
3340
|
Object.entries(t).forEach(([r, n]) => e(n, r));
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3342
|
+
function Nt(t, e) {
|
|
3343
3343
|
return t.indexOf(e) !== -1;
|
|
3344
3344
|
}
|
|
3345
|
-
function
|
|
3345
|
+
function Rn(t, e) {
|
|
3346
3346
|
for (let r = 0; r < t.length; r++) {
|
|
3347
3347
|
const n = t[r];
|
|
3348
3348
|
if (e(n))
|
|
@@ -3357,13 +3357,13 @@ class So {
|
|
|
3357
3357
|
this.transfomers[e.name] = e;
|
|
3358
3358
|
}
|
|
3359
3359
|
findApplicable(e) {
|
|
3360
|
-
return
|
|
3360
|
+
return Oo(this.transfomers, (r) => r.isApplicable(e));
|
|
3361
3361
|
}
|
|
3362
3362
|
findByName(e) {
|
|
3363
3363
|
return this.transfomers[e];
|
|
3364
3364
|
}
|
|
3365
3365
|
}
|
|
3366
|
-
const Co = (t) => Object.prototype.toString.call(t).slice(8, -1), ls = (t) => typeof t > "u", To = (t) => t === null,
|
|
3366
|
+
const Co = (t) => Object.prototype.toString.call(t).slice(8, -1), ls = (t) => typeof t > "u", To = (t) => t === null, Rt = (t) => typeof t != "object" || t === null || t === Object.prototype ? !1 : Object.getPrototypeOf(t) === null ? !0 : Object.getPrototypeOf(t) === Object.prototype, Cr = (t) => Rt(t) && Object.keys(t).length === 0, Ie = (t) => Array.isArray(t), Fo = (t) => typeof t == "string", Ao = (t) => typeof t == "number" && !isNaN(t), xo = (t) => typeof t == "boolean", Io = (t) => t instanceof RegExp, Ot = (t) => t instanceof Map, St = (t) => t instanceof Set, fs = (t) => Co(t) === "Symbol", Do = (t) => t instanceof Date && !isNaN(t.valueOf()), ko = (t) => t instanceof Error, On = (t) => typeof t == "number" && isNaN(t), _o = (t) => xo(t) || To(t) || ls(t) || Ao(t) || Fo(t) || fs(t), jo = (t) => typeof t == "bigint", qo = (t) => t === 1 / 0 || t === -1 / 0, Mo = (t) => ArrayBuffer.isView(t) && !(t instanceof DataView), Uo = (t) => t instanceof URL, ds = (t) => t.replace(/\./g, "\\."), cr = (t) => t.map(String).map(ds).join("."), bt = (t) => {
|
|
3367
3367
|
const e = [];
|
|
3368
3368
|
let r = "";
|
|
3369
3369
|
for (let s = 0; s < t.length; s++) {
|
|
@@ -3394,7 +3394,7 @@ const hs = [
|
|
|
3394
3394
|
}),
|
|
3395
3395
|
ae(jo, "bigint", (t) => t.toString(), (t) => typeof BigInt < "u" ? BigInt(t) : (console.error("Please add a BigInt polyfill."), t)),
|
|
3396
3396
|
ae(Do, "Date", (t) => t.toISOString(), (t) => new Date(t)),
|
|
3397
|
-
ae(
|
|
3397
|
+
ae(ko, "Error", (t, e) => {
|
|
3398
3398
|
const r = {
|
|
3399
3399
|
name: t.name,
|
|
3400
3400
|
message: t.message
|
|
@@ -3420,12 +3420,12 @@ const hs = [
|
|
|
3420
3420
|
(t) => [...t.values()],
|
|
3421
3421
|
(t) => new Set(t)
|
|
3422
3422
|
),
|
|
3423
|
-
ae(
|
|
3424
|
-
ae((t) =>
|
|
3423
|
+
ae(Ot, "map", (t) => [...t.entries()], (t) => new Map(t)),
|
|
3424
|
+
ae((t) => On(t) || qo(t), "number", (t) => On(t) ? "NaN" : t > 0 ? "Infinity" : "-Infinity", Number),
|
|
3425
3425
|
ae((t) => t === 0 && 1 / t === -1 / 0, "number", () => "-0", Number),
|
|
3426
|
-
ae(
|
|
3426
|
+
ae(Uo, "URL", (t) => t.toString(), (t) => new URL(t))
|
|
3427
3427
|
];
|
|
3428
|
-
function
|
|
3428
|
+
function Wt(t, e, r, n) {
|
|
3429
3429
|
return {
|
|
3430
3430
|
isApplicable: t,
|
|
3431
3431
|
annotation: e,
|
|
@@ -3433,7 +3433,7 @@ function Vt(t, e, r, n) {
|
|
|
3433
3433
|
untransform: n
|
|
3434
3434
|
};
|
|
3435
3435
|
}
|
|
3436
|
-
const ys =
|
|
3436
|
+
const ys = Wt((t, e) => fs(t) ? !!e.symbolRegistry.getIdentifier(t) : !1, (t, e) => ["symbol", e.symbolRegistry.getIdentifier(t)], (t) => t.description, (t, e, r) => {
|
|
3437
3437
|
const n = r.symbolRegistry.getValue(e[1]);
|
|
3438
3438
|
if (!n)
|
|
3439
3439
|
throw new Error("Trying to deserialize unknown symbol");
|
|
@@ -3448,7 +3448,7 @@ const ys = Vt((t, e) => fs(t) ? !!e.symbolRegistry.getIdentifier(t) : !1, (t, e)
|
|
|
3448
3448
|
Float32Array,
|
|
3449
3449
|
Float64Array,
|
|
3450
3450
|
Uint8ClampedArray
|
|
3451
|
-
].reduce((t, e) => (t[e.name] = e, t), {}), ps =
|
|
3451
|
+
].reduce((t, e) => (t[e.name] = e, t), {}), ps = Wt(Mo, (t) => ["typed-array", t.constructor.name], (t) => [...t], (t, e) => {
|
|
3452
3452
|
const r = No[e[1]];
|
|
3453
3453
|
if (!r)
|
|
3454
3454
|
throw new Error("Trying to deserialize unknown typed array");
|
|
@@ -3457,7 +3457,7 @@ const ys = Vt((t, e) => fs(t) ? !!e.symbolRegistry.getIdentifier(t) : !1, (t, e)
|
|
|
3457
3457
|
function ms(t, e) {
|
|
3458
3458
|
return t != null && t.constructor ? !!e.classRegistry.getIdentifier(t.constructor) : !1;
|
|
3459
3459
|
}
|
|
3460
|
-
const gs =
|
|
3460
|
+
const gs = Wt(ms, (t, e) => ["class", e.classRegistry.getIdentifier(t.constructor)], (t, e) => {
|
|
3461
3461
|
const r = e.classRegistry.getAllowedProps(t.constructor);
|
|
3462
3462
|
if (!r)
|
|
3463
3463
|
return { ...t };
|
|
@@ -3470,19 +3470,19 @@ const gs = Vt(ms, (t, e) => ["class", e.classRegistry.getIdentifier(t.constructo
|
|
|
3470
3470
|
if (!n)
|
|
3471
3471
|
throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
3472
3472
|
return Object.assign(Object.create(n.prototype), t);
|
|
3473
|
-
}), vs =
|
|
3473
|
+
}), vs = Wt((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) => {
|
|
3474
3474
|
const n = r.customTransformerRegistry.findByName(e[1]);
|
|
3475
3475
|
if (!n)
|
|
3476
3476
|
throw new Error("Trying to deserialize unknown custom value");
|
|
3477
3477
|
return n.deserialize(t);
|
|
3478
3478
|
}), Lo = [gs, ys, vs, ps], Sn = (t, e) => {
|
|
3479
|
-
const r =
|
|
3479
|
+
const r = Rn(Lo, (s) => s.isApplicable(t, e));
|
|
3480
3480
|
if (r)
|
|
3481
3481
|
return {
|
|
3482
3482
|
value: r.transform(t, e),
|
|
3483
3483
|
type: r.annotation(t, e)
|
|
3484
3484
|
};
|
|
3485
|
-
const n =
|
|
3485
|
+
const n = Rn(hs, (s) => s.isApplicable(t, e));
|
|
3486
3486
|
if (n)
|
|
3487
3487
|
return {
|
|
3488
3488
|
value: n.transform(t, e),
|
|
@@ -3521,11 +3521,11 @@ const Qo = (t, e, r) => {
|
|
|
3521
3521
|
return r.next().value;
|
|
3522
3522
|
};
|
|
3523
3523
|
function ws(t) {
|
|
3524
|
-
if (
|
|
3524
|
+
if (Nt(t, "__proto__"))
|
|
3525
3525
|
throw new Error("__proto__ is not allowed as a property");
|
|
3526
|
-
if (
|
|
3526
|
+
if (Nt(t, "prototype"))
|
|
3527
3527
|
throw new Error("prototype is not allowed as a property");
|
|
3528
|
-
if (
|
|
3528
|
+
if (Nt(t, "constructor"))
|
|
3529
3529
|
throw new Error("constructor is not allowed as a property");
|
|
3530
3530
|
}
|
|
3531
3531
|
const $o = (t, e) => {
|
|
@@ -3534,7 +3534,7 @@ const $o = (t, e) => {
|
|
|
3534
3534
|
const n = e[r];
|
|
3535
3535
|
if (St(t))
|
|
3536
3536
|
t = Ge(t, +n);
|
|
3537
|
-
else if (
|
|
3537
|
+
else if (Ot(t)) {
|
|
3538
3538
|
const s = +n, i = +e[++r] == 0 ? "key" : "value", u = Ge(t, s);
|
|
3539
3539
|
switch (i) {
|
|
3540
3540
|
case "key":
|
|
@@ -3548,7 +3548,7 @@ const $o = (t, e) => {
|
|
|
3548
3548
|
t = t[n];
|
|
3549
3549
|
}
|
|
3550
3550
|
return t;
|
|
3551
|
-
},
|
|
3551
|
+
}, Tr = (t, e, r) => {
|
|
3552
3552
|
if (ws(e), e.length === 0)
|
|
3553
3553
|
return r(t);
|
|
3554
3554
|
let n = t;
|
|
@@ -3557,31 +3557,31 @@ const $o = (t, e) => {
|
|
|
3557
3557
|
if (Ie(n)) {
|
|
3558
3558
|
const l = +u;
|
|
3559
3559
|
n = n[l];
|
|
3560
|
-
} else if (
|
|
3560
|
+
} else if (Rt(n))
|
|
3561
3561
|
n = n[u];
|
|
3562
3562
|
else if (St(n)) {
|
|
3563
3563
|
const l = +u;
|
|
3564
3564
|
n = Ge(n, l);
|
|
3565
|
-
} else if (
|
|
3565
|
+
} else if (Ot(n)) {
|
|
3566
3566
|
if (i === e.length - 2)
|
|
3567
3567
|
break;
|
|
3568
|
-
const c = +u, h = +e[++i] == 0 ? "key" : "value",
|
|
3568
|
+
const c = +u, h = +e[++i] == 0 ? "key" : "value", p = Ge(n, c);
|
|
3569
3569
|
switch (h) {
|
|
3570
3570
|
case "key":
|
|
3571
|
-
n =
|
|
3571
|
+
n = p;
|
|
3572
3572
|
break;
|
|
3573
3573
|
case "value":
|
|
3574
|
-
n = n.get(
|
|
3574
|
+
n = n.get(p);
|
|
3575
3575
|
break;
|
|
3576
3576
|
}
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
3579
|
const s = e[e.length - 1];
|
|
3580
|
-
if (Ie(n) ? n[+s] = r(n[+s]) :
|
|
3580
|
+
if (Ie(n) ? n[+s] = r(n[+s]) : Rt(n) && (n[s] = r(n[s])), St(n)) {
|
|
3581
3581
|
const i = Ge(n, +s), u = r(i);
|
|
3582
3582
|
i !== u && (n.delete(i), n.add(u));
|
|
3583
3583
|
}
|
|
3584
|
-
if (
|
|
3584
|
+
if (Ot(n)) {
|
|
3585
3585
|
const i = +e[e.length - 2], u = Ge(n, i);
|
|
3586
3586
|
switch (+s == 0 ? "key" : "value") {
|
|
3587
3587
|
case "key": {
|
|
@@ -3597,45 +3597,45 @@ const $o = (t, e) => {
|
|
|
3597
3597
|
}
|
|
3598
3598
|
return t;
|
|
3599
3599
|
};
|
|
3600
|
-
function
|
|
3600
|
+
function Fr(t, e, r = []) {
|
|
3601
3601
|
if (!t)
|
|
3602
3602
|
return;
|
|
3603
3603
|
if (!Ie(t)) {
|
|
3604
|
-
lt(t, (i, u) =>
|
|
3604
|
+
lt(t, (i, u) => Fr(i, e, [...r, ...bt(u)]));
|
|
3605
3605
|
return;
|
|
3606
3606
|
}
|
|
3607
3607
|
const [n, s] = t;
|
|
3608
3608
|
s && lt(s, (i, u) => {
|
|
3609
|
-
|
|
3609
|
+
Fr(i, e, [...r, ...bt(u)]);
|
|
3610
3610
|
}), e(n, r);
|
|
3611
3611
|
}
|
|
3612
3612
|
function Ko(t, e, r) {
|
|
3613
|
-
return
|
|
3614
|
-
t =
|
|
3613
|
+
return Fr(e, (n, s) => {
|
|
3614
|
+
t = Tr(t, s, (i) => Qo(i, n, r));
|
|
3615
3615
|
}), t;
|
|
3616
3616
|
}
|
|
3617
3617
|
function zo(t, e) {
|
|
3618
3618
|
function r(n, s) {
|
|
3619
3619
|
const i = $o(t, bt(s));
|
|
3620
3620
|
n.map(bt).forEach((u) => {
|
|
3621
|
-
t =
|
|
3621
|
+
t = Tr(t, u, () => i);
|
|
3622
3622
|
});
|
|
3623
3623
|
}
|
|
3624
3624
|
if (Ie(e)) {
|
|
3625
3625
|
const [n, s] = e;
|
|
3626
3626
|
n.forEach((i) => {
|
|
3627
|
-
t =
|
|
3627
|
+
t = Tr(t, bt(i), () => t);
|
|
3628
3628
|
}), s && lt(s, r);
|
|
3629
3629
|
} else
|
|
3630
3630
|
lt(e, r);
|
|
3631
3631
|
return t;
|
|
3632
3632
|
}
|
|
3633
|
-
const Vo = (t, e) =>
|
|
3634
|
-
function
|
|
3633
|
+
const Vo = (t, e) => Rt(t) || Ie(t) || Ot(t) || St(t) || ms(t, e);
|
|
3634
|
+
function Ho(t, e, r) {
|
|
3635
3635
|
const n = r.get(t);
|
|
3636
3636
|
n ? n.push(e) : r.set(t, [e]);
|
|
3637
3637
|
}
|
|
3638
|
-
function
|
|
3638
|
+
function Wo(t, e) {
|
|
3639
3639
|
const r = {};
|
|
3640
3640
|
let n;
|
|
3641
3641
|
return t.forEach((s) => {
|
|
@@ -3643,49 +3643,49 @@ function Ho(t, e) {
|
|
|
3643
3643
|
return;
|
|
3644
3644
|
e || (s = s.map((l) => l.map(String)).sort((l, c) => l.length - c.length));
|
|
3645
3645
|
const [i, ...u] = s;
|
|
3646
|
-
i.length === 0 ? n = u.map(
|
|
3647
|
-
}), n ?
|
|
3646
|
+
i.length === 0 ? n = u.map(cr) : r[cr(i)] = u.map(cr);
|
|
3647
|
+
}), n ? Cr(r) ? [n] : [n, r] : Cr(r) ? void 0 : r;
|
|
3648
3648
|
}
|
|
3649
3649
|
const Es = (t, e, r, n, s = [], i = [], u = /* @__PURE__ */ new Map()) => {
|
|
3650
|
-
const l =
|
|
3650
|
+
const l = _o(t);
|
|
3651
3651
|
if (!l) {
|
|
3652
|
-
|
|
3653
|
-
const
|
|
3654
|
-
if (
|
|
3652
|
+
Ho(t, s, e);
|
|
3653
|
+
const m = u.get(t);
|
|
3654
|
+
if (m)
|
|
3655
3655
|
return n ? {
|
|
3656
3656
|
transformedValue: null
|
|
3657
|
-
} :
|
|
3657
|
+
} : m;
|
|
3658
3658
|
}
|
|
3659
3659
|
if (!Vo(t, r)) {
|
|
3660
|
-
const
|
|
3661
|
-
transformedValue:
|
|
3662
|
-
annotations: [
|
|
3660
|
+
const m = Sn(t, r), b = m ? {
|
|
3661
|
+
transformedValue: m.value,
|
|
3662
|
+
annotations: [m.type]
|
|
3663
3663
|
} : {
|
|
3664
3664
|
transformedValue: t
|
|
3665
3665
|
};
|
|
3666
|
-
return l || u.set(t,
|
|
3666
|
+
return l || u.set(t, b), b;
|
|
3667
3667
|
}
|
|
3668
|
-
if (
|
|
3668
|
+
if (Nt(i, t))
|
|
3669
3669
|
return {
|
|
3670
3670
|
transformedValue: null
|
|
3671
3671
|
};
|
|
3672
|
-
const c = Sn(t, r), h = (c == null ? void 0 : c.value) ?? t,
|
|
3673
|
-
lt(h, (
|
|
3674
|
-
if (
|
|
3675
|
-
throw new Error(`Detected property ${
|
|
3676
|
-
const
|
|
3677
|
-
|
|
3678
|
-
|
|
3672
|
+
const c = Sn(t, r), h = (c == null ? void 0 : c.value) ?? t, p = Ie(h) ? [] : {}, f = {};
|
|
3673
|
+
lt(h, (m, b) => {
|
|
3674
|
+
if (b === "__proto__" || b === "constructor" || b === "prototype")
|
|
3675
|
+
throw new Error(`Detected property ${b}. This is a prototype pollution risk, please remove it from your object.`);
|
|
3676
|
+
const g = Es(m, e, r, n, [...s, b], [...i, t], u);
|
|
3677
|
+
p[b] = g.transformedValue, Ie(g.annotations) ? f[b] = g.annotations : Rt(g.annotations) && lt(g.annotations, (w, v) => {
|
|
3678
|
+
f[ds(b) + "." + v] = w;
|
|
3679
3679
|
});
|
|
3680
3680
|
});
|
|
3681
|
-
const
|
|
3682
|
-
transformedValue:
|
|
3681
|
+
const d = Cr(f) ? {
|
|
3682
|
+
transformedValue: p,
|
|
3683
3683
|
annotations: c ? [c.type] : void 0
|
|
3684
3684
|
} : {
|
|
3685
|
-
transformedValue:
|
|
3686
|
-
annotations: c ? [c.type,
|
|
3685
|
+
transformedValue: p,
|
|
3686
|
+
annotations: c ? [c.type, f] : f
|
|
3687
3687
|
};
|
|
3688
|
-
return l || u.set(t,
|
|
3688
|
+
return l || u.set(t, d), d;
|
|
3689
3689
|
};
|
|
3690
3690
|
function Ps(t) {
|
|
3691
3691
|
return Object.prototype.toString.call(t).slice(8, -1);
|
|
@@ -3708,20 +3708,20 @@ function Go(t, e, r, n, s) {
|
|
|
3708
3708
|
configurable: !0
|
|
3709
3709
|
});
|
|
3710
3710
|
}
|
|
3711
|
-
function
|
|
3711
|
+
function Ar(t, e = {}) {
|
|
3712
3712
|
if (Cn(t))
|
|
3713
|
-
return t.map((s) =>
|
|
3713
|
+
return t.map((s) => Ar(s, e));
|
|
3714
3714
|
if (!Bo(t))
|
|
3715
3715
|
return t;
|
|
3716
3716
|
const r = Object.getOwnPropertyNames(t), n = Object.getOwnPropertySymbols(t);
|
|
3717
3717
|
return [...r, ...n].reduce((s, i) => {
|
|
3718
3718
|
if (Cn(e.props) && !e.props.includes(i))
|
|
3719
3719
|
return s;
|
|
3720
|
-
const u = t[i], l =
|
|
3720
|
+
const u = t[i], l = Ar(u, e);
|
|
3721
3721
|
return Go(s, i, l, t, e.nonenumerable), s;
|
|
3722
3722
|
}, {});
|
|
3723
3723
|
}
|
|
3724
|
-
class
|
|
3724
|
+
class I {
|
|
3725
3725
|
/**
|
|
3726
3726
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
3727
3727
|
*/
|
|
@@ -3736,7 +3736,7 @@ class A {
|
|
|
3736
3736
|
...s.meta,
|
|
3737
3737
|
values: n.annotations
|
|
3738
3738
|
});
|
|
3739
|
-
const i =
|
|
3739
|
+
const i = Wo(r, this.dedupe);
|
|
3740
3740
|
return i && (s.meta = {
|
|
3741
3741
|
...s.meta,
|
|
3742
3742
|
referentialEqualities: i
|
|
@@ -3744,7 +3744,7 @@ class A {
|
|
|
3744
3744
|
}
|
|
3745
3745
|
deserialize(e) {
|
|
3746
3746
|
const { json: r, meta: n } = e;
|
|
3747
|
-
let s =
|
|
3747
|
+
let s = Ar(r);
|
|
3748
3748
|
return n != null && n.values && (s = Ko(s, n.values, this)), n != null && n.referentialEqualities && (s = zo(s, n.referentialEqualities)), s;
|
|
3749
3749
|
}
|
|
3750
3750
|
stringify(e) {
|
|
@@ -3769,44 +3769,44 @@ class A {
|
|
|
3769
3769
|
this.allowedErrorProps.push(...e);
|
|
3770
3770
|
}
|
|
3771
3771
|
}
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
class
|
|
3772
|
+
I.defaultInstance = new I();
|
|
3773
|
+
I.serialize = I.defaultInstance.serialize.bind(I.defaultInstance);
|
|
3774
|
+
I.deserialize = I.defaultInstance.deserialize.bind(I.defaultInstance);
|
|
3775
|
+
I.stringify = I.defaultInstance.stringify.bind(I.defaultInstance);
|
|
3776
|
+
I.parse = I.defaultInstance.parse.bind(I.defaultInstance);
|
|
3777
|
+
I.registerClass = I.defaultInstance.registerClass.bind(I.defaultInstance);
|
|
3778
|
+
I.registerSymbol = I.defaultInstance.registerSymbol.bind(I.defaultInstance);
|
|
3779
|
+
I.registerCustom = I.defaultInstance.registerCustom.bind(I.defaultInstance);
|
|
3780
|
+
I.allowErrorProps = I.defaultInstance.allowErrorProps.bind(I.defaultInstance);
|
|
3781
|
+
I.serialize;
|
|
3782
|
+
I.deserialize;
|
|
3783
|
+
I.stringify;
|
|
3784
|
+
I.parse;
|
|
3785
|
+
I.registerClass;
|
|
3786
|
+
I.registerCustom;
|
|
3787
|
+
I.registerSymbol;
|
|
3788
|
+
I.allowErrorProps;
|
|
3789
|
+
class Bt extends Error {
|
|
3790
3790
|
constructor(r, n) {
|
|
3791
3791
|
super(r);
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
this.name = "FolioError", this.context = n == null ? void 0 : n.context, this.originalError = n == null ? void 0 : n.originalError, Object.setPrototypeOf(this,
|
|
3792
|
+
nr(this, "context");
|
|
3793
|
+
nr(this, "originalError");
|
|
3794
|
+
this.name = "FolioError", this.context = n == null ? void 0 : n.context, this.originalError = n == null ? void 0 : n.originalError, Object.setPrototypeOf(this, Bt.prototype);
|
|
3795
3795
|
}
|
|
3796
3796
|
}
|
|
3797
|
-
function
|
|
3798
|
-
return new
|
|
3797
|
+
function V(t, e) {
|
|
3798
|
+
return new Bt(t, e);
|
|
3799
3799
|
}
|
|
3800
|
-
function
|
|
3801
|
-
t instanceof
|
|
3800
|
+
function ee(t) {
|
|
3801
|
+
t instanceof Bt ? (console.error(`🔴 Folio Error: ${t.message}`), t.context && Object.keys(t.context).length > 0 && console.error("Context:", t.context), t.originalError && console.error("Original error:", t.originalError)) : console.error("🔴 Unexpected error:", t);
|
|
3802
3802
|
}
|
|
3803
3803
|
function de(t, e, r) {
|
|
3804
|
-
return
|
|
3804
|
+
return V(`${t}: ${e}`, {
|
|
3805
3805
|
context: { hookName: t },
|
|
3806
3806
|
originalError: r
|
|
3807
3807
|
});
|
|
3808
3808
|
}
|
|
3809
|
-
const
|
|
3809
|
+
const Rs = Zs(null);
|
|
3810
3810
|
function Yo(t, e) {
|
|
3811
3811
|
const r = to({
|
|
3812
3812
|
links: [
|
|
@@ -3815,21 +3815,21 @@ function Yo(t, e) {
|
|
|
3815
3815
|
headers: () => ({
|
|
3816
3816
|
Authorization: `Bearer ${e}`
|
|
3817
3817
|
}),
|
|
3818
|
-
transformer:
|
|
3818
|
+
transformer: I
|
|
3819
3819
|
})
|
|
3820
3820
|
]
|
|
3821
3821
|
}), n = async (s, i, u = null) => {
|
|
3822
3822
|
try {
|
|
3823
|
-
const l = Object.entries(
|
|
3824
|
-
(
|
|
3825
|
-
|
|
3826
|
-
}),
|
|
3823
|
+
const l = Object.entries(Hn).reduce(
|
|
3824
|
+
(d, [m, b]) => (b.extensions.forEach((g) => {
|
|
3825
|
+
d.set(g, m);
|
|
3826
|
+
}), d),
|
|
3827
3827
|
/* @__PURE__ */ new Map()
|
|
3828
|
-
), c = i.map((
|
|
3829
|
-
const
|
|
3830
|
-
return { ...
|
|
3828
|
+
), c = i.map((d) => {
|
|
3829
|
+
const m = d.name.toLowerCase(), b = m.includes(".") ? m.substring(m.lastIndexOf(".")) : "", g = b.startsWith(".") ? b : `.${b}`, w = l.get(g) || null;
|
|
3830
|
+
return { ...d, mimeType: w };
|
|
3831
3831
|
}).filter(
|
|
3832
|
-
(
|
|
3832
|
+
(d) => d.mimeType !== null && oi.has(d.mimeType)
|
|
3833
3833
|
);
|
|
3834
3834
|
if (c.length === 0)
|
|
3835
3835
|
return { filesToCreate: [] };
|
|
@@ -3837,27 +3837,27 @@ function Yo(t, e) {
|
|
|
3837
3837
|
{
|
|
3838
3838
|
projectId: s
|
|
3839
3839
|
}
|
|
3840
|
-
),
|
|
3841
|
-
(
|
|
3840
|
+
), p = c.filter((d) => !h.some(
|
|
3841
|
+
(m) => m.userProvidedId === d.userProvidedId && m.parentId === u
|
|
3842
3842
|
));
|
|
3843
|
-
return
|
|
3843
|
+
return p.length === 0 ? { filesToCreate: [] } : { filesToCreate: p.map((d) => ({
|
|
3844
3844
|
projectId: s,
|
|
3845
|
-
mimeType:
|
|
3846
|
-
path:
|
|
3845
|
+
mimeType: d.mimeType,
|
|
3846
|
+
path: d.blobUrl,
|
|
3847
3847
|
// Map blobUrl back to path for API
|
|
3848
|
-
name:
|
|
3848
|
+
name: d.name,
|
|
3849
3849
|
size: 0,
|
|
3850
3850
|
// You might need to calculate or pass size
|
|
3851
3851
|
metadata: null,
|
|
3852
3852
|
isArtifact: !1,
|
|
3853
3853
|
summary: null,
|
|
3854
|
-
chunkingStatus:
|
|
3854
|
+
chunkingStatus: Mt.NOT_CHUNKED,
|
|
3855
3855
|
isDirectory: !1,
|
|
3856
3856
|
parentId: u,
|
|
3857
|
-
userProvidedId:
|
|
3857
|
+
userProvidedId: d.userProvidedId
|
|
3858
3858
|
})) };
|
|
3859
3859
|
} catch (l) {
|
|
3860
|
-
throw
|
|
3860
|
+
throw V("Failed to validate and filter files", {
|
|
3861
3861
|
context: { projectId: s, parentId: u, fileCount: i.length },
|
|
3862
3862
|
originalError: l
|
|
3863
3863
|
});
|
|
@@ -3889,7 +3889,7 @@ function Yo(t, e) {
|
|
|
3889
3889
|
})
|
|
3890
3890
|
);
|
|
3891
3891
|
} catch (s) {
|
|
3892
|
-
throw
|
|
3892
|
+
throw V("Failed to get projects for user", {
|
|
3893
3893
|
originalError: s
|
|
3894
3894
|
});
|
|
3895
3895
|
}
|
|
@@ -3906,7 +3906,7 @@ function Yo(t, e) {
|
|
|
3906
3906
|
createdAt: i.createdAt
|
|
3907
3907
|
};
|
|
3908
3908
|
} catch (i) {
|
|
3909
|
-
throw
|
|
3909
|
+
throw V("Failed to add project for user", {
|
|
3910
3910
|
context: { projectName: s },
|
|
3911
3911
|
originalError: i
|
|
3912
3912
|
});
|
|
@@ -3933,7 +3933,7 @@ function Yo(t, e) {
|
|
|
3933
3933
|
updatedAt: c.updatedAt
|
|
3934
3934
|
}));
|
|
3935
3935
|
} catch (u) {
|
|
3936
|
-
throw
|
|
3936
|
+
throw V("Failed to add files to project", {
|
|
3937
3937
|
context: { projectId: s, fileCount: i.length },
|
|
3938
3938
|
originalError: u
|
|
3939
3939
|
});
|
|
@@ -3956,7 +3956,7 @@ function Yo(t, e) {
|
|
|
3956
3956
|
updatedAt: u.updatedAt
|
|
3957
3957
|
}));
|
|
3958
3958
|
} catch (i) {
|
|
3959
|
-
throw
|
|
3959
|
+
throw V("Failed to get files for project", {
|
|
3960
3960
|
context: { projectId: s },
|
|
3961
3961
|
originalError: i
|
|
3962
3962
|
});
|
|
@@ -3966,26 +3966,33 @@ function Yo(t, e) {
|
|
|
3966
3966
|
try {
|
|
3967
3967
|
const h = await r.fileRouter.getFilesByProject.query({
|
|
3968
3968
|
projectId: s
|
|
3969
|
-
}),
|
|
3969
|
+
}), f = ((v) => {
|
|
3970
|
+
let P = 0;
|
|
3971
|
+
for (let S = 0; S < v.length; S++) {
|
|
3972
|
+
const T = v.charCodeAt(S);
|
|
3973
|
+
P = (P << 5) - P + T, P = P & P;
|
|
3974
|
+
}
|
|
3975
|
+
return Math.abs(P).toString(36).substring(0, 6);
|
|
3976
|
+
})(u), d = c || `directory-${i}-${f}`;
|
|
3970
3977
|
if (h.some(
|
|
3971
|
-
(
|
|
3978
|
+
(v) => v.userProvidedId === d && v.isDirectory === !0 && v.parentId === null
|
|
3972
3979
|
))
|
|
3973
|
-
return
|
|
3974
|
-
|
|
3980
|
+
return ee(
|
|
3981
|
+
V("Directory already exists", {
|
|
3975
3982
|
context: {
|
|
3976
3983
|
projectId: s,
|
|
3977
3984
|
directoryName: i,
|
|
3978
|
-
userProvidedId:
|
|
3985
|
+
userProvidedId: d
|
|
3979
3986
|
}
|
|
3980
3987
|
})
|
|
3981
3988
|
), {
|
|
3982
3989
|
directory: null,
|
|
3983
3990
|
files: []
|
|
3984
3991
|
};
|
|
3985
|
-
const
|
|
3992
|
+
const b = await r.fileRouter.createFile.mutate({
|
|
3986
3993
|
file: {
|
|
3987
3994
|
projectId: s,
|
|
3988
|
-
mimeType:
|
|
3995
|
+
mimeType: Lt.DIRECTORY,
|
|
3989
3996
|
path: "",
|
|
3990
3997
|
name: i,
|
|
3991
3998
|
size: 0,
|
|
@@ -3995,72 +4002,72 @@ function Yo(t, e) {
|
|
|
3995
4002
|
parentId: null,
|
|
3996
4003
|
// Always at the root level
|
|
3997
4004
|
summary: null,
|
|
3998
|
-
chunkingStatus:
|
|
3999
|
-
userProvidedId:
|
|
4005
|
+
chunkingStatus: Mt.NOT_CHUNKED,
|
|
4006
|
+
userProvidedId: d
|
|
4000
4007
|
// Use the deduplication-consistent userProvidedId
|
|
4001
4008
|
}
|
|
4002
4009
|
});
|
|
4003
4010
|
if (l.length === 0)
|
|
4004
4011
|
return {
|
|
4005
4012
|
directory: {
|
|
4006
|
-
blobUrl:
|
|
4007
|
-
name:
|
|
4008
|
-
id:
|
|
4009
|
-
parentId:
|
|
4010
|
-
isDirectory:
|
|
4011
|
-
userProvidedId:
|
|
4012
|
-
createdAt:
|
|
4013
|
-
updatedAt:
|
|
4013
|
+
blobUrl: b.path,
|
|
4014
|
+
name: b.name,
|
|
4015
|
+
id: b.id,
|
|
4016
|
+
parentId: b.parentId,
|
|
4017
|
+
isDirectory: b.isDirectory,
|
|
4018
|
+
userProvidedId: b.userProvidedId || d,
|
|
4019
|
+
createdAt: b.createdAt,
|
|
4020
|
+
updatedAt: b.updatedAt
|
|
4014
4021
|
},
|
|
4015
4022
|
files: []
|
|
4016
4023
|
};
|
|
4017
4024
|
const { filesToCreate: g } = await n(
|
|
4018
4025
|
s,
|
|
4019
4026
|
l,
|
|
4020
|
-
|
|
4027
|
+
b.id
|
|
4021
4028
|
// Pass directory ID as parent
|
|
4022
4029
|
);
|
|
4023
4030
|
if (g.length === 0)
|
|
4024
4031
|
return {
|
|
4025
4032
|
directory: {
|
|
4026
|
-
blobUrl:
|
|
4027
|
-
name:
|
|
4028
|
-
id:
|
|
4029
|
-
parentId:
|
|
4030
|
-
isDirectory:
|
|
4031
|
-
userProvidedId:
|
|
4032
|
-
createdAt:
|
|
4033
|
-
updatedAt:
|
|
4033
|
+
blobUrl: b.path,
|
|
4034
|
+
name: b.name,
|
|
4035
|
+
id: b.id,
|
|
4036
|
+
parentId: b.parentId,
|
|
4037
|
+
isDirectory: b.isDirectory,
|
|
4038
|
+
userProvidedId: b.userProvidedId || d,
|
|
4039
|
+
createdAt: b.createdAt,
|
|
4040
|
+
updatedAt: b.updatedAt
|
|
4034
4041
|
},
|
|
4035
4042
|
files: []
|
|
4036
4043
|
};
|
|
4037
|
-
const
|
|
4044
|
+
const w = await r.fileRouter.createFiles.mutate({
|
|
4038
4045
|
files: g
|
|
4039
4046
|
});
|
|
4040
4047
|
return {
|
|
4041
|
-
directory:
|
|
4042
|
-
blobUrl:
|
|
4043
|
-
name:
|
|
4044
|
-
id:
|
|
4045
|
-
parentId:
|
|
4046
|
-
isDirectory:
|
|
4047
|
-
userProvidedId:
|
|
4048
|
-
createdAt:
|
|
4049
|
-
updatedAt:
|
|
4048
|
+
directory: b ? {
|
|
4049
|
+
blobUrl: b.path,
|
|
4050
|
+
name: b.name,
|
|
4051
|
+
id: b.id,
|
|
4052
|
+
parentId: b.parentId,
|
|
4053
|
+
isDirectory: b.isDirectory,
|
|
4054
|
+
userProvidedId: b.userProvidedId || `directory-${i}`,
|
|
4055
|
+
createdAt: b.createdAt,
|
|
4056
|
+
updatedAt: b.updatedAt
|
|
4050
4057
|
} : null,
|
|
4051
|
-
files:
|
|
4052
|
-
blobUrl:
|
|
4053
|
-
name:
|
|
4054
|
-
id:
|
|
4055
|
-
parentId:
|
|
4056
|
-
isDirectory:
|
|
4057
|
-
userProvidedId:
|
|
4058
|
-
createdAt:
|
|
4059
|
-
updatedAt:
|
|
4058
|
+
files: w.map((v) => ({
|
|
4059
|
+
blobUrl: v.path,
|
|
4060
|
+
name: v.name,
|
|
4061
|
+
id: v.id,
|
|
4062
|
+
parentId: v.parentId,
|
|
4063
|
+
isDirectory: v.isDirectory,
|
|
4064
|
+
userProvidedId: v.userProvidedId || "",
|
|
4065
|
+
createdAt: v.createdAt,
|
|
4066
|
+
updatedAt: v.updatedAt
|
|
4060
4067
|
}))
|
|
4061
4068
|
};
|
|
4062
4069
|
} catch (h) {
|
|
4063
|
-
throw
|
|
4070
|
+
throw V(
|
|
4064
4071
|
"Failed to add directory with files to project",
|
|
4065
4072
|
{
|
|
4066
4073
|
context: { projectId: s, directoryName: i, fileCount: l.length },
|
|
@@ -4069,13 +4076,137 @@ function Yo(t, e) {
|
|
|
4069
4076
|
);
|
|
4070
4077
|
}
|
|
4071
4078
|
},
|
|
4079
|
+
addDirectoriesWithFilesToProjectBatch: async (s, i) => {
|
|
4080
|
+
try {
|
|
4081
|
+
const u = [];
|
|
4082
|
+
if (i.length === 0)
|
|
4083
|
+
return [];
|
|
4084
|
+
const l = await r.fileRouter.getFilesByProject.query({
|
|
4085
|
+
projectId: s
|
|
4086
|
+
}), c = (w) => {
|
|
4087
|
+
let v = 0;
|
|
4088
|
+
for (let P = 0; P < w.length; P++) {
|
|
4089
|
+
const S = w.charCodeAt(P);
|
|
4090
|
+
v = (v << 5) - v + S, v = v & v;
|
|
4091
|
+
}
|
|
4092
|
+
return Math.abs(v).toString(36).substring(0, 6);
|
|
4093
|
+
}, h = [], p = [];
|
|
4094
|
+
i.forEach((w, v) => {
|
|
4095
|
+
const P = c(w.directoryMetadata), S = w.userProvidedId || `directory-${w.directoryName}-${P}`;
|
|
4096
|
+
l.some(
|
|
4097
|
+
(j) => j.userProvidedId === S && j.isDirectory === !0 && j.parentId === null
|
|
4098
|
+
) ? (ee(
|
|
4099
|
+
V("Directory already exists", {
|
|
4100
|
+
context: {
|
|
4101
|
+
projectId: s,
|
|
4102
|
+
directoryName: w.directoryName,
|
|
4103
|
+
userProvidedId: S
|
|
4104
|
+
}
|
|
4105
|
+
})
|
|
4106
|
+
), p.push({
|
|
4107
|
+
originalIndex: v,
|
|
4108
|
+
reason: "Directory already exists"
|
|
4109
|
+
})) : h.push({
|
|
4110
|
+
directoryData: {
|
|
4111
|
+
projectId: s,
|
|
4112
|
+
mimeType: Lt.DIRECTORY,
|
|
4113
|
+
path: "",
|
|
4114
|
+
name: w.directoryName,
|
|
4115
|
+
size: 0,
|
|
4116
|
+
metadata: w.directoryMetadata,
|
|
4117
|
+
isArtifact: !1,
|
|
4118
|
+
isDirectory: !0,
|
|
4119
|
+
parentId: null,
|
|
4120
|
+
summary: null,
|
|
4121
|
+
chunkingStatus: Mt.NOT_CHUNKED,
|
|
4122
|
+
userProvidedId: S
|
|
4123
|
+
},
|
|
4124
|
+
originalIndex: v,
|
|
4125
|
+
files: w.files
|
|
4126
|
+
});
|
|
4127
|
+
});
|
|
4128
|
+
const f = h.length > 0 ? await r.fileRouter.createFiles.mutate({
|
|
4129
|
+
files: h.map((w) => w.directoryData)
|
|
4130
|
+
}) : [], d = [];
|
|
4131
|
+
for (let w = 0; w < f.length; w++) {
|
|
4132
|
+
const v = f[w], { files: P, originalIndex: S } = h[w];
|
|
4133
|
+
if (P.length > 0) {
|
|
4134
|
+
const { filesToCreate: T } = await n(
|
|
4135
|
+
s,
|
|
4136
|
+
P,
|
|
4137
|
+
v.id
|
|
4138
|
+
);
|
|
4139
|
+
T.forEach((j) => {
|
|
4140
|
+
d.push({
|
|
4141
|
+
fileData: j,
|
|
4142
|
+
originalDirectoryIndex: S
|
|
4143
|
+
});
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
const m = d.length > 0 ? await r.fileRouter.createFiles.mutate({
|
|
4148
|
+
files: d.map((w) => w.fileData)
|
|
4149
|
+
}) : [], b = {};
|
|
4150
|
+
let g = 0;
|
|
4151
|
+
for (const { originalDirectoryIndex: w } of d)
|
|
4152
|
+
if (b[w] || (b[w] = []), g < m.length) {
|
|
4153
|
+
const v = m[g];
|
|
4154
|
+
b[w].push({
|
|
4155
|
+
blobUrl: v.path,
|
|
4156
|
+
name: v.name,
|
|
4157
|
+
id: v.id,
|
|
4158
|
+
parentId: v.parentId,
|
|
4159
|
+
isDirectory: v.isDirectory,
|
|
4160
|
+
userProvidedId: v.userProvidedId || "",
|
|
4161
|
+
createdAt: v.createdAt,
|
|
4162
|
+
updatedAt: v.updatedAt
|
|
4163
|
+
}), g++;
|
|
4164
|
+
}
|
|
4165
|
+
return i.forEach((w, v) => {
|
|
4166
|
+
if (p.some(
|
|
4167
|
+
(T) => T.originalIndex === v
|
|
4168
|
+
)) {
|
|
4169
|
+
u.push({ directory: null, files: [] });
|
|
4170
|
+
return;
|
|
4171
|
+
}
|
|
4172
|
+
const S = h.findIndex(
|
|
4173
|
+
(T) => T.originalIndex === v
|
|
4174
|
+
);
|
|
4175
|
+
if (S >= 0 && S < f.length) {
|
|
4176
|
+
const T = f[S], j = b[v] || [];
|
|
4177
|
+
u.push({
|
|
4178
|
+
directory: {
|
|
4179
|
+
blobUrl: T.path,
|
|
4180
|
+
name: T.name,
|
|
4181
|
+
id: T.id,
|
|
4182
|
+
parentId: T.parentId,
|
|
4183
|
+
isDirectory: T.isDirectory,
|
|
4184
|
+
userProvidedId: T.userProvidedId || "",
|
|
4185
|
+
createdAt: T.createdAt,
|
|
4186
|
+
updatedAt: T.updatedAt
|
|
4187
|
+
},
|
|
4188
|
+
files: j
|
|
4189
|
+
});
|
|
4190
|
+
} else
|
|
4191
|
+
u.push({ directory: null, files: [] });
|
|
4192
|
+
}), u;
|
|
4193
|
+
} catch (u) {
|
|
4194
|
+
throw V(
|
|
4195
|
+
"Failed to add directories with files to project in batch",
|
|
4196
|
+
{
|
|
4197
|
+
context: { projectId: s, directoryCount: i.length },
|
|
4198
|
+
originalError: u
|
|
4199
|
+
}
|
|
4200
|
+
);
|
|
4201
|
+
}
|
|
4202
|
+
},
|
|
4072
4203
|
updateUserMetadata: async (s) => {
|
|
4073
4204
|
try {
|
|
4074
4205
|
await r.userRouter.updateUserMetadata.mutate({
|
|
4075
4206
|
metadata: s
|
|
4076
4207
|
});
|
|
4077
4208
|
} catch (i) {
|
|
4078
|
-
throw
|
|
4209
|
+
throw V("Failed to update user metadata", {
|
|
4079
4210
|
originalError: i
|
|
4080
4211
|
});
|
|
4081
4212
|
}
|
|
@@ -4084,7 +4215,7 @@ function Yo(t, e) {
|
|
|
4084
4215
|
try {
|
|
4085
4216
|
return await r.userRouter.getUserMetadata.query();
|
|
4086
4217
|
} catch (s) {
|
|
4087
|
-
throw
|
|
4218
|
+
throw V("Failed to get user metadata", {
|
|
4088
4219
|
originalError: s
|
|
4089
4220
|
});
|
|
4090
4221
|
}
|
|
@@ -4112,65 +4243,65 @@ function ra({
|
|
|
4112
4243
|
}),
|
|
4113
4244
|
[]
|
|
4114
4245
|
);
|
|
4115
|
-
return
|
|
4116
|
-
const
|
|
4117
|
-
c(
|
|
4118
|
-
}, [e, r, n]),
|
|
4246
|
+
return ir(() => {
|
|
4247
|
+
const p = `${e}:${r}`, f = Yo(p, n);
|
|
4248
|
+
c(f);
|
|
4249
|
+
}, [e, r, n]), ir(() => {
|
|
4119
4250
|
if (!l || !s)
|
|
4120
4251
|
return;
|
|
4121
|
-
const
|
|
4122
|
-
l.updateUserMetadata(
|
|
4252
|
+
const p = JSON.stringify(s);
|
|
4253
|
+
l.updateUserMetadata(p).catch((f) => {
|
|
4123
4254
|
console.error(
|
|
4124
4255
|
"[FolioProvider] Failed to set initial user metadata:",
|
|
4125
|
-
|
|
4126
|
-
),
|
|
4127
|
-
|
|
4128
|
-
originalError:
|
|
4256
|
+
f
|
|
4257
|
+
), ee(
|
|
4258
|
+
V("Failed to set initial user metadata", {
|
|
4259
|
+
originalError: f
|
|
4129
4260
|
})
|
|
4130
4261
|
);
|
|
4131
4262
|
});
|
|
4132
|
-
}, [l, s]),
|
|
4263
|
+
}, [l, s]), ir(() => {
|
|
4133
4264
|
if (!i)
|
|
4134
4265
|
return;
|
|
4135
|
-
const
|
|
4136
|
-
i(
|
|
4137
|
-
},
|
|
4138
|
-
var
|
|
4139
|
-
((
|
|
4266
|
+
const p = (d) => {
|
|
4267
|
+
i(d.detail);
|
|
4268
|
+
}, f = (d) => {
|
|
4269
|
+
var m;
|
|
4270
|
+
((m = d.data) == null ? void 0 : m.type) === "folio-analytics" && d.data.event && i(d.data.event);
|
|
4140
4271
|
};
|
|
4141
4272
|
return window.addEventListener(
|
|
4142
4273
|
"folio-analytics",
|
|
4143
|
-
|
|
4144
|
-
), window.addEventListener("message",
|
|
4274
|
+
p
|
|
4275
|
+
), window.addEventListener("message", f), () => {
|
|
4145
4276
|
window.removeEventListener(
|
|
4146
4277
|
"folio-analytics",
|
|
4147
|
-
|
|
4148
|
-
), window.removeEventListener("message",
|
|
4278
|
+
p
|
|
4279
|
+
), window.removeEventListener("message", f);
|
|
4149
4280
|
};
|
|
4150
4281
|
}, [i]), /* @__PURE__ */ wt.jsx(Ci, { client: h, children: /* @__PURE__ */ wt.jsx(
|
|
4151
|
-
|
|
4282
|
+
Rs.Provider,
|
|
4152
4283
|
{
|
|
4153
4284
|
value: { host: e, port: r, client: l, token: n, passTokenInQueryParam: u },
|
|
4154
4285
|
children: t
|
|
4155
4286
|
}
|
|
4156
4287
|
) });
|
|
4157
4288
|
}
|
|
4158
|
-
function
|
|
4159
|
-
const t = ri(
|
|
4289
|
+
function He() {
|
|
4290
|
+
const t = ri(Rs);
|
|
4160
4291
|
if (!t)
|
|
4161
4292
|
throw console.error(
|
|
4162
4293
|
"[useFolioContext] Context not found - component not wrapped in FolioProvider"
|
|
4163
|
-
),
|
|
4294
|
+
), V(
|
|
4164
4295
|
"useFolioContext must be used within a FolioProvider"
|
|
4165
4296
|
);
|
|
4166
4297
|
return t;
|
|
4167
4298
|
}
|
|
4168
|
-
const
|
|
4299
|
+
const xr = "folio-token";
|
|
4169
4300
|
let Tn = null;
|
|
4170
4301
|
const Jo = () => {
|
|
4171
4302
|
const t = (e) => {
|
|
4172
4303
|
var r;
|
|
4173
|
-
((r = e.data) == null ? void 0 : r.type) ===
|
|
4304
|
+
((r = e.data) == null ? void 0 : r.type) === xr && typeof e.data.token == "string" && !Tn && (Tn = e.data.token);
|
|
4174
4305
|
};
|
|
4175
4306
|
return window.addEventListener("message", t), () => window.removeEventListener("message", t);
|
|
4176
4307
|
};
|
|
@@ -4189,78 +4320,78 @@ function na({
|
|
|
4189
4320
|
host: l,
|
|
4190
4321
|
port: c,
|
|
4191
4322
|
token: h,
|
|
4192
|
-
passTokenInQueryParam:
|
|
4193
|
-
} =
|
|
4323
|
+
passTokenInQueryParam: p
|
|
4324
|
+
} = He(), f = Xo(null), [d, m] = Zo(), b = `${l}:${c}`, g = u !== void 0 ? u : p;
|
|
4194
4325
|
Fn(() => {
|
|
4195
4326
|
(() => {
|
|
4196
4327
|
try {
|
|
4197
|
-
let P =
|
|
4198
|
-
|
|
4328
|
+
let P = b;
|
|
4329
|
+
g && (P = `${b}?jwt=${encodeURIComponent(h)}`), m(P);
|
|
4199
4330
|
} catch (P) {
|
|
4200
|
-
console.error("[FolioEmbed] Failed to set up iframe URL:", P),
|
|
4201
|
-
|
|
4331
|
+
console.error("[FolioEmbed] Failed to set up iframe URL:", P), ee(
|
|
4332
|
+
V("Failed to set up iframe URL", {
|
|
4202
4333
|
context: { host: l, port: c },
|
|
4203
4334
|
originalError: P
|
|
4204
4335
|
})
|
|
4205
4336
|
);
|
|
4206
4337
|
}
|
|
4207
4338
|
})();
|
|
4208
|
-
}, [l, c, h,
|
|
4209
|
-
if (
|
|
4339
|
+
}, [l, c, h, b, g]), Fn(() => {
|
|
4340
|
+
if (g)
|
|
4210
4341
|
return;
|
|
4211
|
-
const
|
|
4212
|
-
var
|
|
4342
|
+
const v = (P) => {
|
|
4343
|
+
var S, T;
|
|
4213
4344
|
try {
|
|
4214
|
-
if (((
|
|
4345
|
+
if (((S = P.data) == null ? void 0 : S.type) !== "folio-request-token")
|
|
4215
4346
|
return;
|
|
4216
4347
|
if (!P.source || typeof P.source.postMessage != "function") {
|
|
4217
4348
|
console.warn("[FolioEmbed] Invalid event source for token request");
|
|
4218
4349
|
return;
|
|
4219
4350
|
}
|
|
4220
4351
|
P.source.postMessage(
|
|
4221
|
-
{ type:
|
|
4352
|
+
{ type: xr, token: h },
|
|
4222
4353
|
"*"
|
|
4223
4354
|
);
|
|
4224
|
-
} catch (
|
|
4225
|
-
console.error("[FolioEmbed] Failed to handle iframe message:",
|
|
4226
|
-
|
|
4227
|
-
context: { messageType: (
|
|
4228
|
-
originalError:
|
|
4355
|
+
} catch (j) {
|
|
4356
|
+
console.error("[FolioEmbed] Failed to handle iframe message:", j), ee(
|
|
4357
|
+
V("Failed to handle iframe message", {
|
|
4358
|
+
context: { messageType: (T = P == null ? void 0 : P.data) == null ? void 0 : T.type },
|
|
4359
|
+
originalError: j
|
|
4229
4360
|
})
|
|
4230
4361
|
);
|
|
4231
4362
|
}
|
|
4232
4363
|
};
|
|
4233
|
-
return window.addEventListener("message",
|
|
4234
|
-
window.removeEventListener("message",
|
|
4364
|
+
return window.addEventListener("message", v), () => {
|
|
4365
|
+
window.removeEventListener("message", v);
|
|
4235
4366
|
};
|
|
4236
|
-
}, [h,
|
|
4237
|
-
const
|
|
4367
|
+
}, [h, g]);
|
|
4368
|
+
const w = () => {
|
|
4238
4369
|
var P;
|
|
4239
|
-
if (
|
|
4370
|
+
if (g || !((P = f.current) != null && P.contentWindow))
|
|
4240
4371
|
return;
|
|
4241
|
-
const
|
|
4242
|
-
var
|
|
4243
|
-
if ((
|
|
4372
|
+
const v = (S = 1) => {
|
|
4373
|
+
var T;
|
|
4374
|
+
if ((T = f.current) != null && T.contentWindow)
|
|
4244
4375
|
try {
|
|
4245
|
-
|
|
4246
|
-
{ type:
|
|
4376
|
+
f.current.contentWindow.postMessage(
|
|
4377
|
+
{ type: xr, token: h },
|
|
4247
4378
|
"*"
|
|
4248
4379
|
);
|
|
4249
|
-
} catch (
|
|
4380
|
+
} catch (j) {
|
|
4250
4381
|
console.error(
|
|
4251
|
-
`[FolioEmbed] Failed to post token message to iframe on load (attempt ${
|
|
4252
|
-
|
|
4253
|
-
),
|
|
4254
|
-
|
|
4255
|
-
originalError:
|
|
4256
|
-
context: { attemptNumber:
|
|
4382
|
+
`[FolioEmbed] Failed to post token message to iframe on load (attempt ${S}):`,
|
|
4383
|
+
j
|
|
4384
|
+
), ee(
|
|
4385
|
+
V("Failed to post token message to iframe", {
|
|
4386
|
+
originalError: j,
|
|
4387
|
+
context: { attemptNumber: S }
|
|
4257
4388
|
})
|
|
4258
4389
|
);
|
|
4259
4390
|
}
|
|
4260
4391
|
};
|
|
4261
|
-
|
|
4392
|
+
v(1), setTimeout(() => v(2), 100), setTimeout(() => v(3), 500), setTimeout(() => v(4), 1e3);
|
|
4262
4393
|
};
|
|
4263
|
-
return
|
|
4394
|
+
return d ? /* @__PURE__ */ wt.jsx(
|
|
4264
4395
|
"div",
|
|
4265
4396
|
{
|
|
4266
4397
|
className: `folio-embed-container ${s}`,
|
|
@@ -4273,8 +4404,8 @@ function na({
|
|
|
4273
4404
|
children: /* @__PURE__ */ wt.jsx(
|
|
4274
4405
|
"iframe",
|
|
4275
4406
|
{
|
|
4276
|
-
ref:
|
|
4277
|
-
src:
|
|
4407
|
+
ref: f,
|
|
4408
|
+
src: d,
|
|
4278
4409
|
width: "100%",
|
|
4279
4410
|
height: "100%",
|
|
4280
4411
|
style: {
|
|
@@ -4285,7 +4416,7 @@ function na({
|
|
|
4285
4416
|
},
|
|
4286
4417
|
allow: r,
|
|
4287
4418
|
allowFullScreen: !0,
|
|
4288
|
-
onLoad:
|
|
4419
|
+
onLoad: w,
|
|
4289
4420
|
...i
|
|
4290
4421
|
}
|
|
4291
4422
|
)
|
|
@@ -4293,7 +4424,7 @@ function na({
|
|
|
4293
4424
|
) : null;
|
|
4294
4425
|
}
|
|
4295
4426
|
function sa() {
|
|
4296
|
-
const { client: t } =
|
|
4427
|
+
const { client: t } = He(), e = _r({
|
|
4297
4428
|
queryKey: ["folioProjects"],
|
|
4298
4429
|
queryFn: async () => {
|
|
4299
4430
|
if (!t)
|
|
@@ -4304,7 +4435,7 @@ function sa() {
|
|
|
4304
4435
|
try {
|
|
4305
4436
|
return t.getProjectsForUser();
|
|
4306
4437
|
} catch (r) {
|
|
4307
|
-
throw
|
|
4438
|
+
throw ee(r), r;
|
|
4308
4439
|
}
|
|
4309
4440
|
},
|
|
4310
4441
|
enabled: !!t
|
|
@@ -4318,7 +4449,7 @@ function sa() {
|
|
|
4318
4449
|
};
|
|
4319
4450
|
}
|
|
4320
4451
|
function ia() {
|
|
4321
|
-
const { client: t } =
|
|
4452
|
+
const { client: t } = He(), e = dt(), r = _r({
|
|
4322
4453
|
queryKey: ["folioUserMetadata"],
|
|
4323
4454
|
queryFn: async () => {
|
|
4324
4455
|
if (!t)
|
|
@@ -4329,11 +4460,11 @@ function ia() {
|
|
|
4329
4460
|
try {
|
|
4330
4461
|
return t.getUserMetadata();
|
|
4331
4462
|
} catch (s) {
|
|
4332
|
-
throw
|
|
4463
|
+
throw ee(s), s;
|
|
4333
4464
|
}
|
|
4334
4465
|
},
|
|
4335
4466
|
enabled: !!t
|
|
4336
|
-
}), n =
|
|
4467
|
+
}), n = Vt({
|
|
4337
4468
|
mutationFn: async (s) => {
|
|
4338
4469
|
if (!t)
|
|
4339
4470
|
throw de(
|
|
@@ -4344,7 +4475,7 @@ function ia() {
|
|
|
4344
4475
|
const i = JSON.stringify(s);
|
|
4345
4476
|
return t.updateUserMetadata(i);
|
|
4346
4477
|
} catch (i) {
|
|
4347
|
-
throw
|
|
4478
|
+
throw ee(i), i;
|
|
4348
4479
|
}
|
|
4349
4480
|
},
|
|
4350
4481
|
onSuccess: () => {
|
|
@@ -4363,7 +4494,7 @@ function ia() {
|
|
|
4363
4494
|
};
|
|
4364
4495
|
}
|
|
4365
4496
|
function oa(t) {
|
|
4366
|
-
const { client: e } =
|
|
4497
|
+
const { client: e } = He(), r = _r({
|
|
4367
4498
|
queryKey: ["folioFiles", t],
|
|
4368
4499
|
queryFn: async () => {
|
|
4369
4500
|
if (!e)
|
|
@@ -4373,7 +4504,7 @@ function oa(t) {
|
|
|
4373
4504
|
try {
|
|
4374
4505
|
return e.getFilesForProject(t);
|
|
4375
4506
|
} catch (n) {
|
|
4376
|
-
throw
|
|
4507
|
+
throw ee(n), n;
|
|
4377
4508
|
}
|
|
4378
4509
|
},
|
|
4379
4510
|
enabled: !!e && !!t
|
|
@@ -4387,7 +4518,7 @@ function oa(t) {
|
|
|
4387
4518
|
};
|
|
4388
4519
|
}
|
|
4389
4520
|
function aa() {
|
|
4390
|
-
const { client: t } =
|
|
4521
|
+
const { client: t } = He(), e = dt(), r = Vt({
|
|
4391
4522
|
mutationFn: async (n) => {
|
|
4392
4523
|
if (!t)
|
|
4393
4524
|
throw de(
|
|
@@ -4397,7 +4528,7 @@ function aa() {
|
|
|
4397
4528
|
try {
|
|
4398
4529
|
return t.addProjectForUser(n);
|
|
4399
4530
|
} catch (s) {
|
|
4400
|
-
throw
|
|
4531
|
+
throw ee(s), s;
|
|
4401
4532
|
}
|
|
4402
4533
|
},
|
|
4403
4534
|
onSuccess: () => {
|
|
@@ -4414,7 +4545,7 @@ function aa() {
|
|
|
4414
4545
|
};
|
|
4415
4546
|
}
|
|
4416
4547
|
function ua(t) {
|
|
4417
|
-
const { client: e } =
|
|
4548
|
+
const { client: e } = He(), r = dt(), n = Vt({
|
|
4418
4549
|
mutationFn: async (s) => {
|
|
4419
4550
|
if (!e)
|
|
4420
4551
|
throw de(
|
|
@@ -4426,7 +4557,7 @@ function ua(t) {
|
|
|
4426
4557
|
try {
|
|
4427
4558
|
return e.addFilesToProject(t, s);
|
|
4428
4559
|
} catch (i) {
|
|
4429
|
-
throw
|
|
4560
|
+
throw ee(i), i;
|
|
4430
4561
|
}
|
|
4431
4562
|
},
|
|
4432
4563
|
onSuccess: () => {
|
|
@@ -4443,7 +4574,7 @@ function ua(t) {
|
|
|
4443
4574
|
};
|
|
4444
4575
|
}
|
|
4445
4576
|
function ca(t) {
|
|
4446
|
-
const { client: e } =
|
|
4577
|
+
const { client: e } = He(), r = dt(), n = Vt({
|
|
4447
4578
|
mutationFn: async (s) => {
|
|
4448
4579
|
if (!e)
|
|
4449
4580
|
throw de(
|
|
@@ -4456,20 +4587,30 @@ function ca(t) {
|
|
|
4456
4587
|
"Project ID is required"
|
|
4457
4588
|
);
|
|
4458
4589
|
try {
|
|
4459
|
-
const i = Array.isArray(s) ? s : [s]
|
|
4460
|
-
|
|
4461
|
-
const
|
|
4590
|
+
const i = Array.isArray(s) ? s : [s];
|
|
4591
|
+
if (Array.isArray(s)) {
|
|
4592
|
+
const u = i.map((l) => ({
|
|
4593
|
+
directoryName: l.directoryName,
|
|
4594
|
+
directoryMetadata: JSON.stringify(l.directoryMetadata),
|
|
4595
|
+
files: l.files,
|
|
4596
|
+
userProvidedId: l.userProvidedId
|
|
4597
|
+
}));
|
|
4598
|
+
return await e.addDirectoriesWithFilesToProjectBatch(
|
|
4599
|
+
t,
|
|
4600
|
+
u
|
|
4601
|
+
);
|
|
4602
|
+
} else {
|
|
4603
|
+
const u = i[0], l = JSON.stringify(u.directoryMetadata), c = await e.addDirectoryWithFilesToProject(
|
|
4462
4604
|
t,
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4605
|
+
u.directoryName,
|
|
4606
|
+
l,
|
|
4607
|
+
u.files,
|
|
4608
|
+
u.userProvidedId
|
|
4467
4609
|
);
|
|
4468
|
-
|
|
4610
|
+
return Array.isArray(s) ? [c] : c;
|
|
4469
4611
|
}
|
|
4470
|
-
return Array.isArray(s) ? u : u[0];
|
|
4471
4612
|
} catch (i) {
|
|
4472
|
-
throw
|
|
4613
|
+
throw ee(i), i;
|
|
4473
4614
|
}
|
|
4474
4615
|
},
|
|
4475
4616
|
onSuccess: () => {
|