@animaapp/anima-sdk-react 0.4.3 → 0.4.6
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.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +241 -237
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -84,15 +84,15 @@ class Oa extends Error {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
const Ta = "Request Too Large";
|
|
87
|
-
class
|
|
87
|
+
class Ca extends Error {
|
|
88
88
|
constructor({ fileKey: e, cause: n }) {
|
|
89
89
|
super(Ta), this.fileKey = e, this.cause = n;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Aa = "Not Found";
|
|
93
93
|
class Na extends Error {
|
|
94
94
|
constructor({ fileKey: e, cause: n }) {
|
|
95
|
-
super(
|
|
95
|
+
super(Aa), this.fileKey = e, this.cause = n;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const Ra = "Unknown Figma API Exception";
|
|
@@ -116,7 +116,7 @@ const Ia = (t, e) => {
|
|
|
116
116
|
if (r === 404)
|
|
117
117
|
return new Na({ fileKey: e, cause: t });
|
|
118
118
|
if (r === 400 && s.includes("Request too large"))
|
|
119
|
-
return new
|
|
119
|
+
return new Ca({ fileKey: e, cause: t });
|
|
120
120
|
}
|
|
121
121
|
return new Pa({ fileKey: e, cause: t });
|
|
122
122
|
};
|
|
@@ -129,7 +129,7 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
|
|
|
129
129
|
for (var n of Js(e))
|
|
130
130
|
La.call(e, n) && Ys(t, n, e[n]);
|
|
131
131
|
return t;
|
|
132
|
-
}, Ts = (t, e) => Za(t, Da(e)),
|
|
132
|
+
}, Ts = (t, e) => Za(t, Da(e)), Cs = (t, e, n) => e.has(t) || Or("Cannot " + n), P = (t, e, n) => (Cs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, s) => (Cs(t, e, "write to private field"), e.set(t, n), n), _e = (t, e, n) => (Cs(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
|
|
133
133
|
var a = (c) => {
|
|
134
134
|
try {
|
|
135
135
|
o(n.next(c));
|
|
@@ -148,13 +148,13 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
|
|
|
148
148
|
function Wa(t) {
|
|
149
149
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
150
150
|
}
|
|
151
|
-
var Kn = { exports: {} },
|
|
152
|
-
function
|
|
151
|
+
var Kn = { exports: {} }, Va = Kn.exports, Qs;
|
|
152
|
+
function za() {
|
|
153
153
|
return Qs || (Qs = 1, function(t, e) {
|
|
154
154
|
(function(n, s) {
|
|
155
155
|
t.exports = s();
|
|
156
|
-
})(
|
|
157
|
-
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()),
|
|
156
|
+
})(Va, function() {
|
|
157
|
+
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), z = 8, L = -1;
|
|
158
158
|
function q(j) {
|
|
159
159
|
var Z = typeof j;
|
|
160
160
|
if (Z !== "object")
|
|
@@ -188,15 +188,15 @@ function Va() {
|
|
|
188
188
|
var Se = p && j[Symbol.toStringTag];
|
|
189
189
|
if (typeof Se == "string")
|
|
190
190
|
return Se;
|
|
191
|
-
var
|
|
192
|
-
return
|
|
191
|
+
var $ = Object.getPrototypeOf(j);
|
|
192
|
+
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(j).slice(z, L);
|
|
193
193
|
}
|
|
194
194
|
return q;
|
|
195
195
|
});
|
|
196
196
|
}(Kn)), Kn.exports;
|
|
197
197
|
}
|
|
198
|
-
var Ua =
|
|
199
|
-
const Ba = /* @__PURE__ */ Wa(Ua),
|
|
198
|
+
var Ua = za();
|
|
199
|
+
const Ba = /* @__PURE__ */ Wa(Ua), As = typeof Buffer != "undefined", Ka = As && typeof Buffer.from != "undefined", qa = As ? (
|
|
200
200
|
/**
|
|
201
201
|
* is value is Buffer?
|
|
202
202
|
*
|
|
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Wa(Ua), Cs = typeof Buffer != "undefined", Ka = Cs &&
|
|
|
227
227
|
function(t) {
|
|
228
228
|
return Buffer.from(t);
|
|
229
229
|
}
|
|
230
|
-
) :
|
|
230
|
+
) : As ? (
|
|
231
231
|
/**
|
|
232
232
|
* copy Buffer
|
|
233
233
|
*
|
|
@@ -318,7 +318,7 @@ function ii(t) {
|
|
|
318
318
|
function oi(t) {
|
|
319
319
|
return new String(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ce(t, e) {
|
|
322
322
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
323
323
|
}
|
|
324
324
|
function Q(t) {
|
|
@@ -348,15 +348,15 @@ const li = /* @__PURE__ */ new Map([
|
|
|
348
348
|
["String", oi],
|
|
349
349
|
// typed arrays
|
|
350
350
|
// TODO: pass bound function
|
|
351
|
-
["Float32Array",
|
|
352
|
-
["Float64Array",
|
|
353
|
-
["Int16Array",
|
|
354
|
-
["Int32Array",
|
|
355
|
-
["Int8Array",
|
|
356
|
-
["Uint16Array",
|
|
357
|
-
["Uint32Array",
|
|
358
|
-
["Uint8Array",
|
|
359
|
-
["Uint8ClampedArray",
|
|
351
|
+
["Float32Array", Ce],
|
|
352
|
+
["Float64Array", Ce],
|
|
353
|
+
["Int16Array", Ce],
|
|
354
|
+
["Int32Array", Ce],
|
|
355
|
+
["Int8Array", Ce],
|
|
356
|
+
["Uint16Array", Ce],
|
|
357
|
+
["Uint32Array", Ce],
|
|
358
|
+
["Uint8Array", Ce],
|
|
359
|
+
["Uint8ClampedArray", Ce],
|
|
360
360
|
// shallow copy
|
|
361
361
|
["Array Iterator", Q],
|
|
362
362
|
["Map Iterator", Q],
|
|
@@ -560,7 +560,7 @@ class Pn extends Error {
|
|
|
560
560
|
super(e), this.name = "Request Validation Error";
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Cr() {
|
|
564
564
|
return Array.from(
|
|
565
565
|
{ length: 32 },
|
|
566
566
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -592,7 +592,7 @@ class ki {
|
|
|
592
592
|
const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
|
|
593
593
|
let o = a != null ? a : this.headers;
|
|
594
594
|
const c = kt(P(this, ne));
|
|
595
|
-
return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce":
|
|
595
|
+
return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() })), c.async ? yield _e(this, ge, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield _e(this, ge, Yn).call(this, `${i}${n}`, c, { headers: o });
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
post(e, n) {
|
|
@@ -719,14 +719,14 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
719
719
|
const R = yield (yield P(this, Ge).call(this, `${h}/${v}`, { headers: this.headers })).json();
|
|
720
720
|
if (R.status === "success") {
|
|
721
721
|
clearTimeout(y);
|
|
722
|
-
const
|
|
723
|
-
b(
|
|
722
|
+
const z = R.response_json;
|
|
723
|
+
b(z);
|
|
724
724
|
} else if (R.status === "failed")
|
|
725
725
|
clearTimeout(y), l(new _i(R.response_json));
|
|
726
726
|
else {
|
|
727
727
|
a && a(R.response_json);
|
|
728
|
-
const
|
|
729
|
-
setTimeout(() => m(W + 1),
|
|
728
|
+
const z = o(W);
|
|
729
|
+
setTimeout(() => m(W + 1), z);
|
|
730
730
|
}
|
|
731
731
|
} catch (R) {
|
|
732
732
|
l(R);
|
|
@@ -739,7 +739,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
742
|
-
r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce":
|
|
742
|
+
r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
|
|
743
743
|
let u = n;
|
|
744
744
|
return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && mi() && (c["Content-Encoding"] = "gzip", u = yield yi(u))), r.async ? yield _e(this, ge, Qn).call(this, `${o}${t}`, r.async, {
|
|
745
745
|
method: e,
|
|
@@ -795,7 +795,7 @@ const Ei = (t, e, n) => {
|
|
|
795
795
|
const s = e.sort();
|
|
796
796
|
return `${t}-${s.join("-")}-${n}`;
|
|
797
797
|
}, Si = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
798
|
-
var ve, es,
|
|
798
|
+
var ve, es, Ar;
|
|
799
799
|
class Oi {
|
|
800
800
|
constructor(e) {
|
|
801
801
|
de(this, es), de(this, ve), this.resourceName = "Images", J(this, ve, e);
|
|
@@ -813,7 +813,7 @@ class Oi {
|
|
|
813
813
|
const c = P(this, ve).cache.images.pendingRequests.get(i);
|
|
814
814
|
if (c)
|
|
815
815
|
return c;
|
|
816
|
-
const u = _e(this, es,
|
|
816
|
+
const u = _e(this, es, Ar).call(this, i, n, s, r, a);
|
|
817
817
|
P(this, ve).cache.images.pendingRequests.set(i, u);
|
|
818
818
|
try {
|
|
819
819
|
return yield u;
|
|
@@ -823,7 +823,7 @@ class Oi {
|
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(),
|
|
826
|
+
ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Ar = function(t, e, n, s, r) {
|
|
827
827
|
return B(this, null, function* () {
|
|
828
828
|
const a = yield P(this, ve).get(
|
|
829
829
|
`v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
|
|
@@ -852,7 +852,7 @@ class Ti {
|
|
|
852
852
|
}
|
|
853
853
|
cn = /* @__PURE__ */ new WeakMap();
|
|
854
854
|
var je;
|
|
855
|
-
class
|
|
855
|
+
class Ci extends ki {
|
|
856
856
|
constructor({
|
|
857
857
|
baseAddress: e = "https://api.figma.com/",
|
|
858
858
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
@@ -880,23 +880,26 @@ class Ai extends ki {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
je = /* @__PURE__ */ new WeakMap();
|
|
883
|
-
const
|
|
883
|
+
const Ai = (t) => ke(void 0, [t], function* ({
|
|
884
884
|
fileKey: e,
|
|
885
885
|
authToken: n,
|
|
886
|
-
figmaRestApi: s = new
|
|
887
|
-
params: r = {}
|
|
886
|
+
figmaRestApi: s = new Ci(),
|
|
887
|
+
params: r = {},
|
|
888
|
+
signal: a
|
|
888
889
|
}) {
|
|
889
890
|
n && (s.token = n);
|
|
890
891
|
try {
|
|
891
|
-
return yield s.
|
|
892
|
+
return yield s.withOptions({
|
|
893
|
+
abortSignal: a
|
|
894
|
+
}).files.get({
|
|
892
895
|
fileKey: e,
|
|
893
896
|
params: r
|
|
894
897
|
});
|
|
895
|
-
} catch (
|
|
896
|
-
throw console.error(
|
|
898
|
+
} catch (i) {
|
|
899
|
+
throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), Ia(i, e));
|
|
897
900
|
}
|
|
898
901
|
});
|
|
899
|
-
var
|
|
902
|
+
var A;
|
|
900
903
|
(function(t) {
|
|
901
904
|
t.assertEqual = (r) => r;
|
|
902
905
|
function e(r) {
|
|
@@ -931,12 +934,12 @@ var C;
|
|
|
931
934
|
return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
932
935
|
}
|
|
933
936
|
t.joinValues = s, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
934
|
-
})(
|
|
937
|
+
})(A || (A = {}));
|
|
935
938
|
var ts;
|
|
936
939
|
(function(t) {
|
|
937
940
|
t.mergeShapes = (e, n) => d(d({}, e), n);
|
|
938
941
|
})(ts || (ts = {}));
|
|
939
|
-
const _ =
|
|
942
|
+
const _ = A.arrayToEnum([
|
|
940
943
|
"string",
|
|
941
944
|
"nan",
|
|
942
945
|
"number",
|
|
@@ -978,7 +981,7 @@ const _ = C.arrayToEnum([
|
|
|
978
981
|
default:
|
|
979
982
|
return _.unknown;
|
|
980
983
|
}
|
|
981
|
-
}, f =
|
|
984
|
+
}, f = A.arrayToEnum([
|
|
982
985
|
"invalid_type",
|
|
983
986
|
"invalid_literal",
|
|
984
987
|
"custom",
|
|
@@ -1040,7 +1043,7 @@ class ie extends Error {
|
|
|
1040
1043
|
return this.message;
|
|
1041
1044
|
}
|
|
1042
1045
|
get message() {
|
|
1043
|
-
return JSON.stringify(this.issues,
|
|
1046
|
+
return JSON.stringify(this.issues, A.jsonStringifyReplacer, 2);
|
|
1044
1047
|
}
|
|
1045
1048
|
get isEmpty() {
|
|
1046
1049
|
return this.issues.length === 0;
|
|
@@ -1063,19 +1066,19 @@ const yt = (t, e) => {
|
|
|
1063
1066
|
t.received === _.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
1064
1067
|
break;
|
|
1065
1068
|
case f.invalid_literal:
|
|
1066
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
1069
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, A.jsonStringifyReplacer)}`;
|
|
1067
1070
|
break;
|
|
1068
1071
|
case f.unrecognized_keys:
|
|
1069
|
-
n = `Unrecognized key(s) in object: ${
|
|
1072
|
+
n = `Unrecognized key(s) in object: ${A.joinValues(t.keys, ", ")}`;
|
|
1070
1073
|
break;
|
|
1071
1074
|
case f.invalid_union:
|
|
1072
1075
|
n = "Invalid input";
|
|
1073
1076
|
break;
|
|
1074
1077
|
case f.invalid_union_discriminator:
|
|
1075
|
-
n = `Invalid discriminator value. Expected ${
|
|
1078
|
+
n = `Invalid discriminator value. Expected ${A.joinValues(t.options)}`;
|
|
1076
1079
|
break;
|
|
1077
1080
|
case f.invalid_enum_value:
|
|
1078
|
-
n = `Invalid enum value. Expected ${
|
|
1081
|
+
n = `Invalid enum value. Expected ${A.joinValues(t.options)}, received '${t.received}'`;
|
|
1079
1082
|
break;
|
|
1080
1083
|
case f.invalid_arguments:
|
|
1081
1084
|
n = "Invalid function arguments";
|
|
@@ -1087,7 +1090,7 @@ const yt = (t, e) => {
|
|
|
1087
1090
|
n = "Invalid date";
|
|
1088
1091
|
break;
|
|
1089
1092
|
case f.invalid_string:
|
|
1090
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
1093
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : A.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
1091
1094
|
break;
|
|
1092
1095
|
case f.too_small:
|
|
1093
1096
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -1108,7 +1111,7 @@ const yt = (t, e) => {
|
|
|
1108
1111
|
n = "Number must be finite";
|
|
1109
1112
|
break;
|
|
1110
1113
|
default:
|
|
1111
|
-
n = e.defaultError,
|
|
1114
|
+
n = e.defaultError, A.assertNever(t);
|
|
1112
1115
|
}
|
|
1113
1116
|
return { message: n };
|
|
1114
1117
|
};
|
|
@@ -1428,7 +1431,7 @@ class T {
|
|
|
1428
1431
|
}
|
|
1429
1432
|
default(e) {
|
|
1430
1433
|
const n = typeof e == "function" ? e : () => e;
|
|
1431
|
-
return new
|
|
1434
|
+
return new Vt(E(d({}, O(this._def)), {
|
|
1432
1435
|
innerType: this,
|
|
1433
1436
|
defaultValue: n,
|
|
1434
1437
|
typeName: x.ZodDefault
|
|
@@ -1442,7 +1445,7 @@ class T {
|
|
|
1442
1445
|
}
|
|
1443
1446
|
catch(e) {
|
|
1444
1447
|
const n = typeof e == "function" ? e : () => e;
|
|
1445
|
-
return new
|
|
1448
|
+
return new zt(E(d({}, O(this._def)), {
|
|
1446
1449
|
innerType: this,
|
|
1447
1450
|
catchValue: n,
|
|
1448
1451
|
typeName: x.ZodCatch
|
|
@@ -1469,7 +1472,7 @@ class T {
|
|
|
1469
1472
|
}
|
|
1470
1473
|
const Ii = /^c[^\s-]{8,}$/i, ji = /^[0-9a-z]+$/, Zi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Di = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Mi = /^[a-z0-9_-]{21}$/i, Li = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, $i = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Wi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1471
1474
|
let jn;
|
|
1472
|
-
const
|
|
1475
|
+
const Vi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ui = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Bi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ki = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Hi = new RegExp(`^${Pr}$`);
|
|
1473
1476
|
function Ir(t) {
|
|
1474
1477
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1475
1478
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -1483,7 +1486,7 @@ function jr(t) {
|
|
|
1483
1486
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
1484
1487
|
}
|
|
1485
1488
|
function Ji(t, e) {
|
|
1486
|
-
return !!((e === "v4" || !e) &&
|
|
1489
|
+
return !!((e === "v4" || !e) && Vi.test(t) || (e === "v6" || !e) && Ui.test(t));
|
|
1487
1490
|
}
|
|
1488
1491
|
function Xi(t, e) {
|
|
1489
1492
|
if (!Li.test(t))
|
|
@@ -1496,7 +1499,7 @@ function Xi(t, e) {
|
|
|
1496
1499
|
}
|
|
1497
1500
|
}
|
|
1498
1501
|
function Yi(t, e) {
|
|
1499
|
-
return !!((e === "v4" || !e) &&
|
|
1502
|
+
return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Bi.test(t));
|
|
1500
1503
|
}
|
|
1501
1504
|
class pe extends T {
|
|
1502
1505
|
_parse(e) {
|
|
@@ -1650,7 +1653,7 @@ class pe extends T {
|
|
|
1650
1653
|
validation: "base64url",
|
|
1651
1654
|
code: f.invalid_string,
|
|
1652
1655
|
message: r.message
|
|
1653
|
-
}), n.dirty()) :
|
|
1656
|
+
}), n.dirty()) : A.assertNever(r);
|
|
1654
1657
|
return { status: n.value, value: e.data };
|
|
1655
1658
|
}
|
|
1656
1659
|
_regex(e, n, s) {
|
|
@@ -1889,7 +1892,7 @@ class Le extends T {
|
|
|
1889
1892
|
let n;
|
|
1890
1893
|
const s = new X();
|
|
1891
1894
|
for (const r of this._def.checks)
|
|
1892
|
-
r.kind === "int" ?
|
|
1895
|
+
r.kind === "int" ? A.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1893
1896
|
code: f.invalid_type,
|
|
1894
1897
|
expected: "integer",
|
|
1895
1898
|
received: "float",
|
|
@@ -1915,7 +1918,7 @@ class Le extends T {
|
|
|
1915
1918
|
}), s.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1916
1919
|
code: f.not_finite,
|
|
1917
1920
|
message: r.message
|
|
1918
|
-
}), s.dirty()) :
|
|
1921
|
+
}), s.dirty()) : A.assertNever(r);
|
|
1919
1922
|
return { status: s.value, value: e.data };
|
|
1920
1923
|
}
|
|
1921
1924
|
gte(e, n) {
|
|
@@ -2025,7 +2028,7 @@ class Le extends T {
|
|
|
2025
2028
|
return e;
|
|
2026
2029
|
}
|
|
2027
2030
|
get isInt() {
|
|
2028
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
2031
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && A.isInteger(e.value));
|
|
2029
2032
|
}
|
|
2030
2033
|
get isFinite() {
|
|
2031
2034
|
let e = null, n = null;
|
|
@@ -2074,7 +2077,7 @@ class $e extends T {
|
|
|
2074
2077
|
code: f.not_multiple_of,
|
|
2075
2078
|
multipleOf: r.value,
|
|
2076
2079
|
message: r.message
|
|
2077
|
-
}), s.dirty()) :
|
|
2080
|
+
}), s.dirty()) : A.assertNever(r);
|
|
2078
2081
|
return { status: s.value, value: e.data };
|
|
2079
2082
|
}
|
|
2080
2083
|
_getInvalidInput(e) {
|
|
@@ -2225,7 +2228,7 @@ class Qe extends T {
|
|
|
2225
2228
|
exact: !1,
|
|
2226
2229
|
maximum: r.value,
|
|
2227
2230
|
type: "date"
|
|
2228
|
-
}), n.dirty()) :
|
|
2231
|
+
}), n.dirty()) : A.assertNever(r);
|
|
2229
2232
|
return {
|
|
2230
2233
|
status: n.value,
|
|
2231
2234
|
value: new Date(e.data.getTime())
|
|
@@ -2437,27 +2440,27 @@ me.create = (t, e) => new me(d({
|
|
|
2437
2440
|
typeName: x.ZodArray
|
|
2438
2441
|
}, O(e)));
|
|
2439
2442
|
function ct(t) {
|
|
2440
|
-
if (t instanceof
|
|
2443
|
+
if (t instanceof V) {
|
|
2441
2444
|
const e = {};
|
|
2442
2445
|
for (const n in t.shape) {
|
|
2443
2446
|
const s = t.shape[n];
|
|
2444
2447
|
e[n] = we.create(ct(s));
|
|
2445
2448
|
}
|
|
2446
|
-
return new
|
|
2449
|
+
return new V(E(d({}, t._def), {
|
|
2447
2450
|
shape: () => e
|
|
2448
2451
|
}));
|
|
2449
2452
|
} else return t instanceof me ? new me(E(d({}, t._def), {
|
|
2450
2453
|
type: ct(t.element)
|
|
2451
2454
|
})) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ct(e))) : t;
|
|
2452
2455
|
}
|
|
2453
|
-
class
|
|
2456
|
+
class V extends T {
|
|
2454
2457
|
constructor() {
|
|
2455
2458
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2456
2459
|
}
|
|
2457
2460
|
_getCached() {
|
|
2458
2461
|
if (this._cached !== null)
|
|
2459
2462
|
return this._cached;
|
|
2460
|
-
const e = this._def.shape(), n =
|
|
2463
|
+
const e = this._def.shape(), n = A.objectKeys(e);
|
|
2461
2464
|
return this._cached = { shape: e, keys: n };
|
|
2462
2465
|
}
|
|
2463
2466
|
_parse(e) {
|
|
@@ -2527,7 +2530,7 @@ class z extends T {
|
|
|
2527
2530
|
return this._def.shape();
|
|
2528
2531
|
}
|
|
2529
2532
|
strict(e) {
|
|
2530
|
-
return w.errToObj, new
|
|
2533
|
+
return w.errToObj, new V(d(E(d({}, this._def), {
|
|
2531
2534
|
unknownKeys: "strict"
|
|
2532
2535
|
}), e !== void 0 ? {
|
|
2533
2536
|
errorMap: (n, s) => {
|
|
@@ -2542,12 +2545,12 @@ class z extends T {
|
|
|
2542
2545
|
} : {}));
|
|
2543
2546
|
}
|
|
2544
2547
|
strip() {
|
|
2545
|
-
return new
|
|
2548
|
+
return new V(E(d({}, this._def), {
|
|
2546
2549
|
unknownKeys: "strip"
|
|
2547
2550
|
}));
|
|
2548
2551
|
}
|
|
2549
2552
|
passthrough() {
|
|
2550
|
-
return new
|
|
2553
|
+
return new V(E(d({}, this._def), {
|
|
2551
2554
|
unknownKeys: "passthrough"
|
|
2552
2555
|
}));
|
|
2553
2556
|
}
|
|
@@ -2569,7 +2572,7 @@ class z extends T {
|
|
|
2569
2572
|
// }) as any;
|
|
2570
2573
|
// };
|
|
2571
2574
|
extend(e) {
|
|
2572
|
-
return new
|
|
2575
|
+
return new V(E(d({}, this._def), {
|
|
2573
2576
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2574
2577
|
}));
|
|
2575
2578
|
}
|
|
@@ -2579,7 +2582,7 @@ class z extends T {
|
|
|
2579
2582
|
* upgrade if you are experiencing issues.
|
|
2580
2583
|
*/
|
|
2581
2584
|
merge(e) {
|
|
2582
|
-
return new
|
|
2585
|
+
return new V({
|
|
2583
2586
|
unknownKeys: e._def.unknownKeys,
|
|
2584
2587
|
catchall: e._def.catchall,
|
|
2585
2588
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
@@ -2646,23 +2649,23 @@ class z extends T {
|
|
|
2646
2649
|
// return merged;
|
|
2647
2650
|
// }
|
|
2648
2651
|
catchall(e) {
|
|
2649
|
-
return new
|
|
2652
|
+
return new V(E(d({}, this._def), {
|
|
2650
2653
|
catchall: e
|
|
2651
2654
|
}));
|
|
2652
2655
|
}
|
|
2653
2656
|
pick(e) {
|
|
2654
2657
|
const n = {};
|
|
2655
|
-
return
|
|
2658
|
+
return A.objectKeys(e).forEach((s) => {
|
|
2656
2659
|
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
2657
|
-
}), new
|
|
2660
|
+
}), new V(E(d({}, this._def), {
|
|
2658
2661
|
shape: () => n
|
|
2659
2662
|
}));
|
|
2660
2663
|
}
|
|
2661
2664
|
omit(e) {
|
|
2662
2665
|
const n = {};
|
|
2663
|
-
return
|
|
2666
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2664
2667
|
e[s] || (n[s] = this.shape[s]);
|
|
2665
|
-
}), new
|
|
2668
|
+
}), new V(E(d({}, this._def), {
|
|
2666
2669
|
shape: () => n
|
|
2667
2670
|
}));
|
|
2668
2671
|
}
|
|
@@ -2674,16 +2677,16 @@ class z extends T {
|
|
|
2674
2677
|
}
|
|
2675
2678
|
partial(e) {
|
|
2676
2679
|
const n = {};
|
|
2677
|
-
return
|
|
2680
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2678
2681
|
const r = this.shape[s];
|
|
2679
2682
|
e && !e[s] ? n[s] = r : n[s] = r.optional();
|
|
2680
|
-
}), new
|
|
2683
|
+
}), new V(E(d({}, this._def), {
|
|
2681
2684
|
shape: () => n
|
|
2682
2685
|
}));
|
|
2683
2686
|
}
|
|
2684
2687
|
required(e) {
|
|
2685
2688
|
const n = {};
|
|
2686
|
-
return
|
|
2689
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2687
2690
|
if (e && !e[s])
|
|
2688
2691
|
n[s] = this.shape[s];
|
|
2689
2692
|
else {
|
|
@@ -2692,27 +2695,27 @@ class z extends T {
|
|
|
2692
2695
|
r = r._def.innerType;
|
|
2693
2696
|
n[s] = r;
|
|
2694
2697
|
}
|
|
2695
|
-
}), new
|
|
2698
|
+
}), new V(E(d({}, this._def), {
|
|
2696
2699
|
shape: () => n
|
|
2697
2700
|
}));
|
|
2698
2701
|
}
|
|
2699
2702
|
keyof() {
|
|
2700
|
-
return Zr(
|
|
2703
|
+
return Zr(A.objectKeys(this.shape));
|
|
2701
2704
|
}
|
|
2702
2705
|
}
|
|
2703
|
-
|
|
2706
|
+
V.create = (t, e) => new V(d({
|
|
2704
2707
|
shape: () => t,
|
|
2705
2708
|
unknownKeys: "strip",
|
|
2706
2709
|
catchall: Pe.create(),
|
|
2707
2710
|
typeName: x.ZodObject
|
|
2708
2711
|
}, O(e)));
|
|
2709
|
-
|
|
2712
|
+
V.strictCreate = (t, e) => new V(d({
|
|
2710
2713
|
shape: () => t,
|
|
2711
2714
|
unknownKeys: "strict",
|
|
2712
2715
|
catchall: Pe.create(),
|
|
2713
2716
|
typeName: x.ZodObject
|
|
2714
2717
|
}, O(e)));
|
|
2715
|
-
|
|
2718
|
+
V.lazycreate = (t, e) => new V(d({
|
|
2716
2719
|
shape: t,
|
|
2717
2720
|
unknownKeys: "strip",
|
|
2718
2721
|
catchall: Pe.create(),
|
|
@@ -2786,7 +2789,7 @@ Dt.create = (t, e) => new Dt(d({
|
|
|
2786
2789
|
options: t,
|
|
2787
2790
|
typeName: x.ZodUnion
|
|
2788
2791
|
}, O(e)));
|
|
2789
|
-
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ?
|
|
2792
|
+
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? A.objectValues(t.enum) : t instanceof Vt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof Ut ? Ze(t.unwrap()) : t instanceof zt ? Ze(t._def.innerType) : [];
|
|
2790
2793
|
class xn extends T {
|
|
2791
2794
|
_parse(e) {
|
|
2792
2795
|
const { ctx: n } = this._processInputParams(e);
|
|
@@ -2853,7 +2856,7 @@ function rs(t, e) {
|
|
|
2853
2856
|
if (t === e)
|
|
2854
2857
|
return { valid: !0, data: t };
|
|
2855
2858
|
if (n === _.object && s === _.object) {
|
|
2856
|
-
const r =
|
|
2859
|
+
const r = A.objectKeys(e), a = A.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = d(d({}, t), e);
|
|
2857
2860
|
for (const o of a) {
|
|
2858
2861
|
const c = rs(t[o], e[o]);
|
|
2859
2862
|
if (!c.valid)
|
|
@@ -3253,7 +3256,7 @@ class Fe extends T {
|
|
|
3253
3256
|
if (typeof e.data != "string") {
|
|
3254
3257
|
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
3255
3258
|
return g(n, {
|
|
3256
|
-
expected:
|
|
3259
|
+
expected: A.joinValues(s),
|
|
3257
3260
|
received: n.parsedType,
|
|
3258
3261
|
code: f.invalid_type
|
|
3259
3262
|
}), S;
|
|
@@ -3303,17 +3306,17 @@ class Wt extends T {
|
|
|
3303
3306
|
super(...arguments), Tt.set(this, void 0);
|
|
3304
3307
|
}
|
|
3305
3308
|
_parse(e) {
|
|
3306
|
-
const n =
|
|
3309
|
+
const n = A.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3307
3310
|
if (s.parsedType !== _.string && s.parsedType !== _.number) {
|
|
3308
|
-
const r =
|
|
3311
|
+
const r = A.objectValues(n);
|
|
3309
3312
|
return g(s, {
|
|
3310
|
-
expected:
|
|
3313
|
+
expected: A.joinValues(r),
|
|
3311
3314
|
received: s.parsedType,
|
|
3312
3315
|
code: f.invalid_type
|
|
3313
3316
|
}), S;
|
|
3314
3317
|
}
|
|
3315
|
-
if (pn(this, Tt) || Rr(this, Tt, new Set(
|
|
3316
|
-
const r =
|
|
3318
|
+
if (pn(this, Tt) || Rr(this, Tt, new Set(A.getValidEnumValues(this._def.values))), !pn(this, Tt).has(e.data)) {
|
|
3319
|
+
const r = A.objectValues(n);
|
|
3317
3320
|
return g(s, {
|
|
3318
3321
|
received: s.data,
|
|
3319
3322
|
code: f.invalid_enum_value,
|
|
@@ -3428,7 +3431,7 @@ class ye extends T {
|
|
|
3428
3431
|
return { status: n.value, value: o };
|
|
3429
3432
|
} else
|
|
3430
3433
|
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => Ye(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
|
|
3431
|
-
|
|
3434
|
+
A.assertNever(r);
|
|
3432
3435
|
}
|
|
3433
3436
|
}
|
|
3434
3437
|
ye.create = (t, e, n) => new ye(d({
|
|
@@ -3465,7 +3468,7 @@ We.create = (t, e) => new We(d({
|
|
|
3465
3468
|
innerType: t,
|
|
3466
3469
|
typeName: x.ZodNullable
|
|
3467
3470
|
}, O(e)));
|
|
3468
|
-
class
|
|
3471
|
+
class Vt extends T {
|
|
3469
3472
|
_parse(e) {
|
|
3470
3473
|
const { ctx: n } = this._processInputParams(e);
|
|
3471
3474
|
let s = n.data;
|
|
@@ -3479,12 +3482,12 @@ class zt extends T {
|
|
|
3479
3482
|
return this._def.innerType;
|
|
3480
3483
|
}
|
|
3481
3484
|
}
|
|
3482
|
-
|
|
3485
|
+
Vt.create = (t, e) => new Vt(d({
|
|
3483
3486
|
innerType: t,
|
|
3484
3487
|
typeName: x.ZodDefault,
|
|
3485
3488
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3486
3489
|
}, O(e)));
|
|
3487
|
-
class
|
|
3490
|
+
class zt extends T {
|
|
3488
3491
|
_parse(e) {
|
|
3489
3492
|
const { ctx: n } = this._processInputParams(e), s = E(d({}, n), {
|
|
3490
3493
|
common: E(d({}, n.common), {
|
|
@@ -3517,7 +3520,7 @@ class Vt extends T {
|
|
|
3517
3520
|
return this._def.innerType;
|
|
3518
3521
|
}
|
|
3519
3522
|
}
|
|
3520
|
-
|
|
3523
|
+
zt.create = (t, e) => new zt(d({
|
|
3521
3524
|
innerType: t,
|
|
3522
3525
|
typeName: x.ZodCatch,
|
|
3523
3526
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
@@ -3628,7 +3631,7 @@ function Dr(t, e = {}, n) {
|
|
|
3628
3631
|
}) : gt.create();
|
|
3629
3632
|
}
|
|
3630
3633
|
const to = {
|
|
3631
|
-
object:
|
|
3634
|
+
object: V.lazycreate
|
|
3632
3635
|
};
|
|
3633
3636
|
var x;
|
|
3634
3637
|
(function(t) {
|
|
@@ -3636,7 +3639,7 @@ var x;
|
|
|
3636
3639
|
})(x || (x = {}));
|
|
3637
3640
|
const no = (t, e = {
|
|
3638
3641
|
message: `Input not instance of ${t.name}`
|
|
3639
|
-
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo =
|
|
3642
|
+
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = V.create, yo = V.strictCreate, go = Dt.create, vo = xn.create, _o = Mt.create, bo = Ee.create, wo = Lt.create, ko = gn.create, xo = et.create, Eo = ht.create, So = $t.create, Oo = Ft.create, To = Fe.create, Co = Wt.create, Ao = vt.create, ir = ye.create, No = we.create, Ro = We.create, Po = ye.createWithPreprocess, Io = Jt.create, jo = () => Mr().optional(), Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = {
|
|
3640
3643
|
string: (t) => pe.create(E(d({}, t), { coerce: !0 })),
|
|
3641
3644
|
number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
|
|
3642
3645
|
boolean: (t) => It.create(E(d({}, t), {
|
|
@@ -3645,7 +3648,7 @@ const no = (t, e = {
|
|
|
3645
3648
|
bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
|
|
3646
3649
|
date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
|
|
3647
3650
|
}, Lo = S;
|
|
3648
|
-
var
|
|
3651
|
+
var M = /* @__PURE__ */ Object.freeze({
|
|
3649
3652
|
__proto__: null,
|
|
3650
3653
|
defaultErrorMap: yt,
|
|
3651
3654
|
setErrorMap: Ri,
|
|
@@ -3662,7 +3665,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3662
3665
|
isValid: Ye,
|
|
3663
3666
|
isAsync: Pt,
|
|
3664
3667
|
get util() {
|
|
3665
|
-
return
|
|
3668
|
+
return A;
|
|
3666
3669
|
},
|
|
3667
3670
|
get objectUtil() {
|
|
3668
3671
|
return ts;
|
|
@@ -3684,7 +3687,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3684
3687
|
ZodNever: Pe,
|
|
3685
3688
|
ZodVoid: yn,
|
|
3686
3689
|
ZodArray: me,
|
|
3687
|
-
ZodObject:
|
|
3690
|
+
ZodObject: V,
|
|
3688
3691
|
ZodUnion: Dt,
|
|
3689
3692
|
ZodDiscriminatedUnion: xn,
|
|
3690
3693
|
ZodIntersection: Mt,
|
|
@@ -3702,8 +3705,8 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3702
3705
|
ZodTransformer: ye,
|
|
3703
3706
|
ZodOptional: we,
|
|
3704
3707
|
ZodNullable: We,
|
|
3705
|
-
ZodDefault:
|
|
3706
|
-
ZodCatch:
|
|
3708
|
+
ZodDefault: Vt,
|
|
3709
|
+
ZodCatch: zt,
|
|
3707
3710
|
ZodNaN: vn,
|
|
3708
3711
|
BRAND: eo,
|
|
3709
3712
|
ZodBranded: Ns,
|
|
@@ -3732,7 +3735,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3732
3735
|
literal: Oo,
|
|
3733
3736
|
map: ko,
|
|
3734
3737
|
nan: so,
|
|
3735
|
-
nativeEnum:
|
|
3738
|
+
nativeEnum: Co,
|
|
3736
3739
|
never: fo,
|
|
3737
3740
|
null: co,
|
|
3738
3741
|
nullable: Ro,
|
|
@@ -3744,7 +3747,7 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3744
3747
|
ostring: jo,
|
|
3745
3748
|
pipeline: Io,
|
|
3746
3749
|
preprocess: Po,
|
|
3747
|
-
promise:
|
|
3750
|
+
promise: Ao,
|
|
3748
3751
|
record: wo,
|
|
3749
3752
|
set: xo,
|
|
3750
3753
|
strictObject: yo,
|
|
@@ -3761,15 +3764,16 @@ var $ = /* @__PURE__ */ Object.freeze({
|
|
|
3761
3764
|
quotelessJson: Ni,
|
|
3762
3765
|
ZodError: ie
|
|
3763
3766
|
});
|
|
3764
|
-
|
|
3765
|
-
language:
|
|
3766
|
-
disableMarkedForExport:
|
|
3767
|
+
M.object({
|
|
3768
|
+
language: M.enum(["typescript", "javascript"]).optional(),
|
|
3769
|
+
disableMarkedForExport: M.boolean().optional(),
|
|
3770
|
+
allowAutoSelectFirstNode: M.boolean().optional().default(!0)
|
|
3767
3771
|
}).and(
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
framework:
|
|
3771
|
-
model:
|
|
3772
|
-
styling:
|
|
3772
|
+
M.union([
|
|
3773
|
+
M.object({
|
|
3774
|
+
framework: M.literal("react"),
|
|
3775
|
+
model: M.string().optional(),
|
|
3776
|
+
styling: M.enum([
|
|
3773
3777
|
"plain_css",
|
|
3774
3778
|
"css_modules",
|
|
3775
3779
|
"styled_components",
|
|
@@ -3778,24 +3782,24 @@ $.object({
|
|
|
3778
3782
|
"scss",
|
|
3779
3783
|
"inline_styles"
|
|
3780
3784
|
]),
|
|
3781
|
-
uiLibrary:
|
|
3782
|
-
responsivePages:
|
|
3783
|
-
|
|
3784
|
-
name:
|
|
3785
|
-
framesId:
|
|
3785
|
+
uiLibrary: M.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
3786
|
+
responsivePages: M.array(
|
|
3787
|
+
M.object({
|
|
3788
|
+
name: M.string(),
|
|
3789
|
+
framesId: M.array(M.string())
|
|
3786
3790
|
})
|
|
3787
3791
|
).optional(),
|
|
3788
|
-
enableUILibraryTheming:
|
|
3789
|
-
enableCompactStructure:
|
|
3790
|
-
enableDisplayScreenModelId:
|
|
3791
|
-
enableGeneratePackageLock:
|
|
3792
|
-
enableAutoSplit:
|
|
3793
|
-
autoSplitThreshold:
|
|
3792
|
+
enableUILibraryTheming: M.boolean().optional(),
|
|
3793
|
+
enableCompactStructure: M.boolean().optional(),
|
|
3794
|
+
enableDisplayScreenModelId: M.boolean().optional(),
|
|
3795
|
+
enableGeneratePackageLock: M.boolean().optional(),
|
|
3796
|
+
enableAutoSplit: M.boolean().optional(),
|
|
3797
|
+
autoSplitThreshold: M.number().optional()
|
|
3794
3798
|
}),
|
|
3795
|
-
|
|
3796
|
-
framework:
|
|
3797
|
-
styling:
|
|
3798
|
-
enableTranslation:
|
|
3799
|
+
M.object({
|
|
3800
|
+
framework: M.literal("html"),
|
|
3801
|
+
styling: M.enum(["plain_css", "inline_styles", "tailwind"]),
|
|
3802
|
+
enableTranslation: M.boolean().optional()
|
|
3799
3803
|
})
|
|
3800
3804
|
])
|
|
3801
3805
|
);
|
|
@@ -3961,69 +3965,69 @@ function ur(t) {
|
|
|
3961
3965
|
}
|
|
3962
3966
|
var Fr = (t) => {
|
|
3963
3967
|
throw TypeError(t);
|
|
3964
|
-
}, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n),
|
|
3968
|
+
}, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n), C = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), K = (t, e, n) => e.has(t) ? Fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, s) => (Rs(t, e, "write to private field"), e.set(t, n), n), Ae = (t, e, n) => (Rs(t, e, "access private method"), n), se, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, Ct, he, is, os, cs, dr, us, ds, At, ls, fs;
|
|
3965
3969
|
class dn extends EventTarget {
|
|
3966
3970
|
constructor(e, n) {
|
|
3967
3971
|
var s, r;
|
|
3968
|
-
super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this,
|
|
3972
|
+
super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this, Ct, null), K(this, os, (a) => Ie(this, null, function* () {
|
|
3969
3973
|
var i;
|
|
3970
|
-
|
|
3974
|
+
C(this, dt).reset();
|
|
3971
3975
|
const { body: o, redirected: c, status: u, headers: h } = a;
|
|
3972
3976
|
if (u === 204) {
|
|
3973
|
-
|
|
3977
|
+
Ae(this, he, At).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3974
3978
|
return;
|
|
3975
3979
|
}
|
|
3976
3980
|
if (c ? F(this, ut, new URL(a.url)) : F(this, ut, void 0), u !== 200) {
|
|
3977
|
-
|
|
3981
|
+
Ae(this, he, At).call(this, `Non-200 status code (${u})`, u);
|
|
3978
3982
|
return;
|
|
3979
3983
|
}
|
|
3980
3984
|
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
3981
|
-
|
|
3985
|
+
Ae(this, he, At).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
3982
3986
|
return;
|
|
3983
3987
|
}
|
|
3984
|
-
if (
|
|
3988
|
+
if (C(this, se) === this.CLOSED)
|
|
3985
3989
|
return;
|
|
3986
3990
|
F(this, se, this.OPEN);
|
|
3987
3991
|
const p = new Event("open");
|
|
3988
|
-
if ((i =
|
|
3989
|
-
|
|
3992
|
+
if ((i = C(this, Ct)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3993
|
+
Ae(this, he, At).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
3990
3994
|
return;
|
|
3991
3995
|
}
|
|
3992
3996
|
const k = new TextDecoder(), v = o.getReader();
|
|
3993
3997
|
let b = !0;
|
|
3994
3998
|
do {
|
|
3995
3999
|
const { done: l, value: y } = yield v.read();
|
|
3996
|
-
y &&
|
|
4000
|
+
y && C(this, dt).feed(k.decode(y, { stream: !l })), l && (b = !1, C(this, dt).reset(), Ae(this, he, ls).call(this));
|
|
3997
4001
|
} while (b);
|
|
3998
4002
|
})), K(this, cs, (a) => {
|
|
3999
|
-
F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") &&
|
|
4003
|
+
F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ae(this, he, ls).call(this, as(a));
|
|
4000
4004
|
}), K(this, us, (a) => {
|
|
4001
4005
|
typeof a.id == "string" && F(this, Rt, a.id);
|
|
4002
4006
|
const i = new MessageEvent(a.event || "message", {
|
|
4003
4007
|
data: a.data,
|
|
4004
|
-
origin:
|
|
4008
|
+
origin: C(this, ut) ? C(this, ut).origin : C(this, Je).origin,
|
|
4005
4009
|
lastEventId: a.id || ""
|
|
4006
4010
|
});
|
|
4007
|
-
|
|
4011
|
+
C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
|
|
4008
4012
|
}), K(this, ds, (a) => {
|
|
4009
4013
|
F(this, Nt, a);
|
|
4010
4014
|
}), K(this, fs, () => {
|
|
4011
|
-
F(this, ft, void 0),
|
|
4015
|
+
F(this, ft, void 0), C(this, se) === this.CONNECTING && Ae(this, he, is).call(this);
|
|
4012
4016
|
});
|
|
4013
4017
|
try {
|
|
4014
4018
|
if (e instanceof URL)
|
|
4015
4019
|
F(this, Je, e);
|
|
4016
4020
|
else if (typeof e == "string")
|
|
4017
|
-
F(this, Je, new URL(e,
|
|
4021
|
+
F(this, Je, new URL(e, Vo()));
|
|
4018
4022
|
else
|
|
4019
4023
|
throw new Error("Invalid URL");
|
|
4020
4024
|
} catch (a) {
|
|
4021
4025
|
throw Wo("An invalid or illegal string was specified");
|
|
4022
4026
|
}
|
|
4023
4027
|
F(this, dt, $o({
|
|
4024
|
-
onEvent:
|
|
4025
|
-
onRetry:
|
|
4026
|
-
})), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1),
|
|
4028
|
+
onEvent: C(this, us),
|
|
4029
|
+
onRetry: C(this, ds)
|
|
4030
|
+
})), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ae(this, he, is).call(this);
|
|
4027
4031
|
}
|
|
4028
4032
|
/**
|
|
4029
4033
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -4036,7 +4040,7 @@ class dn extends EventTarget {
|
|
|
4036
4040
|
* @public
|
|
4037
4041
|
*/
|
|
4038
4042
|
get readyState() {
|
|
4039
|
-
return
|
|
4043
|
+
return C(this, se);
|
|
4040
4044
|
}
|
|
4041
4045
|
/**
|
|
4042
4046
|
* Returns the URL providing the event stream.
|
|
@@ -4046,7 +4050,7 @@ class dn extends EventTarget {
|
|
|
4046
4050
|
* @public
|
|
4047
4051
|
*/
|
|
4048
4052
|
get url() {
|
|
4049
|
-
return
|
|
4053
|
+
return C(this, Je).href;
|
|
4050
4054
|
}
|
|
4051
4055
|
/**
|
|
4052
4056
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -4054,28 +4058,28 @@ class dn extends EventTarget {
|
|
|
4054
4058
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
4055
4059
|
*/
|
|
4056
4060
|
get withCredentials() {
|
|
4057
|
-
return
|
|
4061
|
+
return C(this, un);
|
|
4058
4062
|
}
|
|
4059
4063
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
4060
4064
|
get onerror() {
|
|
4061
|
-
return
|
|
4065
|
+
return C(this, pt);
|
|
4062
4066
|
}
|
|
4063
4067
|
set onerror(e) {
|
|
4064
4068
|
F(this, pt, e);
|
|
4065
4069
|
}
|
|
4066
4070
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
4067
4071
|
get onmessage() {
|
|
4068
|
-
return
|
|
4072
|
+
return C(this, lt);
|
|
4069
4073
|
}
|
|
4070
4074
|
set onmessage(e) {
|
|
4071
4075
|
F(this, lt, e);
|
|
4072
4076
|
}
|
|
4073
4077
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
4074
4078
|
get onopen() {
|
|
4075
|
-
return
|
|
4079
|
+
return C(this, Ct);
|
|
4076
4080
|
}
|
|
4077
4081
|
set onopen(e) {
|
|
4078
|
-
F(this,
|
|
4082
|
+
F(this, Ct, e);
|
|
4079
4083
|
}
|
|
4080
4084
|
addEventListener(e, n, s) {
|
|
4081
4085
|
const r = n;
|
|
@@ -4093,16 +4097,16 @@ class dn extends EventTarget {
|
|
|
4093
4097
|
* @public
|
|
4094
4098
|
*/
|
|
4095
4099
|
close() {
|
|
4096
|
-
|
|
4100
|
+
C(this, ft) && clearTimeout(C(this, ft)), C(this, se) !== this.CLOSED && (C(this, De) && C(this, De).abort(), F(this, se, this.CLOSED), F(this, De, void 0));
|
|
4097
4101
|
}
|
|
4098
4102
|
}
|
|
4099
|
-
se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(),
|
|
4103
|
+
se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakSet(), /**
|
|
4100
4104
|
* Connect to the given URL and start receiving events
|
|
4101
4105
|
*
|
|
4102
4106
|
* @internal
|
|
4103
4107
|
*/
|
|
4104
4108
|
is = function() {
|
|
4105
|
-
F(this, se, this.CONNECTING), F(this, De, new AbortController()),
|
|
4109
|
+
F(this, se, this.CONNECTING), F(this, De, new AbortController()), C(this, _n)(C(this, Je), Ae(this, he, dr).call(this)).then(C(this, os)).catch(C(this, cs));
|
|
4106
4110
|
}, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
|
|
4107
4111
|
* Get request options for the `fetch()` request
|
|
4108
4112
|
*
|
|
@@ -4116,9 +4120,9 @@ dr = function() {
|
|
|
4116
4120
|
// [spec] …will have their mode set to "cors"…
|
|
4117
4121
|
mode: "cors",
|
|
4118
4122
|
redirect: "follow",
|
|
4119
|
-
headers: Be({ Accept: "text/event-stream" },
|
|
4123
|
+
headers: Be({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
|
|
4120
4124
|
cache: "no-store",
|
|
4121
|
-
signal: (t =
|
|
4125
|
+
signal: (t = C(this, De)) == null ? void 0 : t.signal
|
|
4122
4126
|
};
|
|
4123
4127
|
return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
|
|
4124
4128
|
}, us = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), /**
|
|
@@ -4128,11 +4132,11 @@ dr = function() {
|
|
|
4128
4132
|
* @param code - The HTTP status code, if available
|
|
4129
4133
|
* @internal
|
|
4130
4134
|
*/
|
|
4131
|
-
|
|
4135
|
+
At = function(t, e) {
|
|
4132
4136
|
var n;
|
|
4133
|
-
|
|
4137
|
+
C(this, se) !== this.CLOSED && F(this, se, this.CLOSED);
|
|
4134
4138
|
const s = new cr("error", { code: e, message: t });
|
|
4135
|
-
(n =
|
|
4139
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
|
|
4136
4140
|
}, /**
|
|
4137
4141
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
4138
4142
|
*
|
|
@@ -4142,11 +4146,11 @@ Ct = function(t, e) {
|
|
|
4142
4146
|
*/
|
|
4143
4147
|
ls = function(t, e) {
|
|
4144
4148
|
var n;
|
|
4145
|
-
if (
|
|
4149
|
+
if (C(this, se) === this.CLOSED)
|
|
4146
4150
|
return;
|
|
4147
4151
|
F(this, se, this.CONNECTING);
|
|
4148
4152
|
const s = new cr("error", { code: e, message: t });
|
|
4149
|
-
(n =
|
|
4153
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), F(this, ft, setTimeout(C(this, fs), C(this, Nt)));
|
|
4150
4154
|
}, fs = /* @__PURE__ */ new WeakMap(), /**
|
|
4151
4155
|
* ReadyState representing an EventSource currently trying to connect
|
|
4152
4156
|
*
|
|
@@ -4163,11 +4167,11 @@ dn.OPEN = 1, /**
|
|
|
4163
4167
|
* @public
|
|
4164
4168
|
*/
|
|
4165
4169
|
dn.CLOSED = 2;
|
|
4166
|
-
function
|
|
4170
|
+
function Vo() {
|
|
4167
4171
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4168
4172
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4169
4173
|
}
|
|
4170
|
-
var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"),
|
|
4174
|
+
var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
|
|
4171
4175
|
// All error codes, starting by 0:
|
|
4172
4176
|
function(t) {
|
|
4173
4177
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4200,7 +4204,7 @@ var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = S
|
|
|
4200
4204
|
] : [];
|
|
4201
4205
|
function re(t, ...e) {
|
|
4202
4206
|
if (process.env.NODE_ENV !== "production") {
|
|
4203
|
-
const n =
|
|
4207
|
+
const n = zo[t], s = typeof n == "function" ? n.apply(null, e) : n;
|
|
4204
4208
|
throw new Error(`[Immer] ${s}`);
|
|
4205
4209
|
}
|
|
4206
4210
|
throw new Error(
|
|
@@ -4213,10 +4217,10 @@ function bt(t) {
|
|
|
4213
4217
|
}
|
|
4214
4218
|
function tt(t) {
|
|
4215
4219
|
var e;
|
|
4216
|
-
return t ?
|
|
4220
|
+
return t ? Vr(t) || Array.isArray(t) || !!t[lr] || !!((e = t.constructor) != null && e[lr]) || Sn(t) || On(t) : !1;
|
|
4217
4221
|
}
|
|
4218
4222
|
var Uo = Object.prototype.constructor.toString();
|
|
4219
|
-
function
|
|
4223
|
+
function Vr(t) {
|
|
4220
4224
|
if (!t || typeof t != "object")
|
|
4221
4225
|
return !1;
|
|
4222
4226
|
const e = _t(t);
|
|
@@ -4237,7 +4241,7 @@ function En(t) {
|
|
|
4237
4241
|
function hs(t, e) {
|
|
4238
4242
|
return En(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4239
4243
|
}
|
|
4240
|
-
function
|
|
4244
|
+
function zr(t, e, n) {
|
|
4241
4245
|
const s = En(t);
|
|
4242
4246
|
s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
|
|
4243
4247
|
}
|
|
@@ -4260,7 +4264,7 @@ function ps(t, e) {
|
|
|
4260
4264
|
return new Set(t);
|
|
4261
4265
|
if (Array.isArray(t))
|
|
4262
4266
|
return Array.prototype.slice.call(t);
|
|
4263
|
-
const n =
|
|
4267
|
+
const n = Vr(t);
|
|
4264
4268
|
if (e === !0 || e === "class_only" && !n) {
|
|
4265
4269
|
const s = Object.getOwnPropertyDescriptors(t);
|
|
4266
4270
|
delete s[oe];
|
|
@@ -4372,7 +4376,7 @@ function mr(t, e, n, s, r, a, i) {
|
|
|
4372
4376
|
if (process.env.NODE_ENV !== "production" && r === n && re(5), bt(r)) {
|
|
4373
4377
|
const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
4374
4378
|
!hs(e.assigned_, s) ? a.concat(s) : void 0, c = wn(t, r, o);
|
|
4375
|
-
if (
|
|
4379
|
+
if (zr(n, s, c), bt(c))
|
|
4376
4380
|
t.canAutoFreeze_ = !1;
|
|
4377
4381
|
else
|
|
4378
4382
|
return;
|
|
@@ -4617,7 +4621,7 @@ function Kr(t) {
|
|
|
4617
4621
|
} else
|
|
4618
4622
|
n = ps(t, !0);
|
|
4619
4623
|
return bn(n, (s, r) => {
|
|
4620
|
-
|
|
4624
|
+
zr(n, s, Kr(r));
|
|
4621
4625
|
}), e && (e.finalized_ = !1), n;
|
|
4622
4626
|
}
|
|
4623
4627
|
var ce = new Yo(), ec = ce.produce;
|
|
@@ -4735,7 +4739,7 @@ const yr = {
|
|
|
4735
4739
|
let y;
|
|
4736
4740
|
try {
|
|
4737
4741
|
l instanceof MessageEvent ? y = JSON.parse(l.data) : y = yield (yield o).json();
|
|
4738
|
-
} catch (
|
|
4742
|
+
} catch (z) {
|
|
4739
4743
|
}
|
|
4740
4744
|
const m = new Gs({
|
|
4741
4745
|
name: (W = y == null ? void 0 : y.payload.name) != null ? W : "Unknown error",
|
|
@@ -4743,8 +4747,8 @@ const yr = {
|
|
|
4743
4747
|
status: y == null ? void 0 : y.payload.status,
|
|
4744
4748
|
detail: y == null ? void 0 : y.payload.detail
|
|
4745
4749
|
});
|
|
4746
|
-
s((
|
|
4747
|
-
|
|
4750
|
+
s((z) => {
|
|
4751
|
+
z.status = "error", z.error = m;
|
|
4748
4752
|
}), v({
|
|
4749
4753
|
result: null,
|
|
4750
4754
|
error: m
|
|
@@ -4762,18 +4766,18 @@ const yr = {
|
|
|
4762
4766
|
const { filePath: y } = gr(
|
|
4763
4767
|
i.assetsStorage
|
|
4764
4768
|
), m = l.assets.map((R) => Ie(void 0, null, function* () {
|
|
4765
|
-
const
|
|
4769
|
+
const L = yield (yield fetch(R.url)).arrayBuffer();
|
|
4766
4770
|
return {
|
|
4767
4771
|
assetName: R.name,
|
|
4768
|
-
base64: ga(
|
|
4772
|
+
base64: ga(L)
|
|
4769
4773
|
};
|
|
4770
4774
|
})), W = yield Promise.allSettled(m);
|
|
4771
4775
|
for (const R of W) {
|
|
4772
|
-
const
|
|
4776
|
+
const z = {};
|
|
4773
4777
|
if (R.status === "fulfilled") {
|
|
4774
|
-
const { assetName:
|
|
4775
|
-
|
|
4776
|
-
const j = y ? `${y}/${
|
|
4778
|
+
const { assetName: L, base64: q } = R.value;
|
|
4779
|
+
z[L] = q;
|
|
4780
|
+
const j = y ? `${y}/${L}` : L;
|
|
4777
4781
|
l.files[j] = {
|
|
4778
4782
|
content: q,
|
|
4779
4783
|
isBinary: !0
|
|
@@ -4937,7 +4941,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4937
4941
|
}, ee = (
|
|
4938
4942
|
/*#__NOINLINE__*/
|
|
4939
4943
|
Me()
|
|
4940
|
-
), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function",
|
|
4944
|
+
), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function", Ve = (t, e) => Be(Be({}, t), e), Jr = (t) => be(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, ic = Xt && "Deno" in window, oc = () => Xt && typeof window.requestAnimationFrame != Is, Xr = (t, e) => {
|
|
4941
4945
|
const n = Re.get(t);
|
|
4942
4946
|
return [
|
|
4943
4947
|
// Getter
|
|
@@ -4946,7 +4950,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4946
4950
|
(s) => {
|
|
4947
4951
|
if (!N(e)) {
|
|
4948
4952
|
const r = t.get(e);
|
|
4949
|
-
e in nn || (nn[e] = r), n[5](e,
|
|
4953
|
+
e in nn || (nn[e] = r), n[5](e, Ve(r, s), r || Fn);
|
|
4950
4954
|
}
|
|
4951
4955
|
},
|
|
4952
4956
|
// Subscriber
|
|
@@ -4982,13 +4986,13 @@ const cc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
|
4982
4986
|
}, hc = {
|
|
4983
4987
|
initFocus: dc,
|
|
4984
4988
|
initReconnect: lc
|
|
4985
|
-
}, xr = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha,
|
|
4989
|
+
}, xr = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha, Vn = typeof navigator != "undefined" && navigator.connection, Er = !Ht && Vn && ([
|
|
4986
4990
|
"slow-2g",
|
|
4987
4991
|
"2g"
|
|
4988
|
-
].includes(
|
|
4992
|
+
].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), zn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
|
|
4989
4993
|
let mc = 0;
|
|
4990
4994
|
const Ss = (t) => {
|
|
4991
|
-
const e = typeof t, n =
|
|
4995
|
+
const e = typeof t, n = zn(t, "Date"), s = zn(t, "RegExp"), r = zn(t, "Object");
|
|
4992
4996
|
let a, i;
|
|
4993
4997
|
if (bs(t) === t && !n && !s) {
|
|
4994
4998
|
if (a = sn.get(t), a) return a;
|
|
@@ -5024,7 +5028,7 @@ let yc = 0;
|
|
|
5024
5028
|
const Os = () => ++yc;
|
|
5025
5029
|
function Yr(...t) {
|
|
5026
5030
|
return Ie(this, null, function* () {
|
|
5027
|
-
const [e, n, s, r] = t, a =
|
|
5031
|
+
const [e, n, s, r] = t, a = Ve({
|
|
5028
5032
|
populateCache: !0,
|
|
5029
5033
|
throwOnError: !0
|
|
5030
5034
|
}, typeof r == "boolean" ? {
|
|
@@ -5046,41 +5050,41 @@ function Yr(...t) {
|
|
|
5046
5050
|
return Ie(this, null, function* () {
|
|
5047
5051
|
const [v] = js(k);
|
|
5048
5052
|
if (!v) return;
|
|
5049
|
-
const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e),
|
|
5053
|
+
const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e), z = () => {
|
|
5050
5054
|
const le = y[v];
|
|
5051
5055
|
return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete W[v], delete R[v], le && le[0]) ? le[0](Gr).then(() => b().data) : b().data;
|
|
5052
5056
|
};
|
|
5053
5057
|
if (t.length < 3)
|
|
5054
|
-
return
|
|
5055
|
-
let
|
|
5058
|
+
return z();
|
|
5059
|
+
let L = s, q;
|
|
5056
5060
|
const j = Os();
|
|
5057
5061
|
m[v] = [
|
|
5058
5062
|
j,
|
|
5059
5063
|
0
|
|
5060
5064
|
];
|
|
5061
|
-
const Z = !N(c), Se = b(),
|
|
5062
|
-
if (Z && (c = be(c) ? c(
|
|
5065
|
+
const Z = !N(c), Se = b(), $ = Se.data, st = Se._c, ze = N(st) ? $ : st;
|
|
5066
|
+
if (Z && (c = be(c) ? c(ze, $) : c, l({
|
|
5063
5067
|
data: c,
|
|
5064
|
-
_c:
|
|
5065
|
-
})), be(
|
|
5068
|
+
_c: ze
|
|
5069
|
+
})), be(L))
|
|
5066
5070
|
try {
|
|
5067
|
-
|
|
5071
|
+
L = L(ze);
|
|
5068
5072
|
} catch (le) {
|
|
5069
5073
|
q = le;
|
|
5070
5074
|
}
|
|
5071
|
-
if (
|
|
5072
|
-
if (
|
|
5075
|
+
if (L && Jr(L))
|
|
5076
|
+
if (L = yield L.catch((le) => {
|
|
5073
5077
|
q = le;
|
|
5074
5078
|
}), j !== m[v][0]) {
|
|
5075
5079
|
if (q) throw q;
|
|
5076
|
-
return
|
|
5080
|
+
return L;
|
|
5077
5081
|
} else q && Z && u(q) && (i = !0, l({
|
|
5078
|
-
data:
|
|
5082
|
+
data: ze,
|
|
5079
5083
|
_c: ee
|
|
5080
5084
|
}));
|
|
5081
5085
|
if (i && !q)
|
|
5082
5086
|
if (be(i)) {
|
|
5083
|
-
const le = i(
|
|
5087
|
+
const le = i(L, ze);
|
|
5084
5088
|
l({
|
|
5085
5089
|
data: le,
|
|
5086
5090
|
error: ee,
|
|
@@ -5088,11 +5092,11 @@ function Yr(...t) {
|
|
|
5088
5092
|
});
|
|
5089
5093
|
} else
|
|
5090
5094
|
l({
|
|
5091
|
-
data:
|
|
5095
|
+
data: L,
|
|
5092
5096
|
error: ee,
|
|
5093
5097
|
_c: ee
|
|
5094
5098
|
});
|
|
5095
|
-
if (m[v][1] = Os(), Promise.resolve(
|
|
5099
|
+
if (m[v][1] = Os(), Promise.resolve(z()).then(() => {
|
|
5096
5100
|
l({
|
|
5097
5101
|
_c: ee
|
|
5098
5102
|
});
|
|
@@ -5100,7 +5104,7 @@ function Yr(...t) {
|
|
|
5100
5104
|
if (h) throw q;
|
|
5101
5105
|
return;
|
|
5102
5106
|
}
|
|
5103
|
-
return
|
|
5107
|
+
return L;
|
|
5104
5108
|
});
|
|
5105
5109
|
}
|
|
5106
5110
|
});
|
|
@@ -5110,7 +5114,7 @@ const Sr = (t, e) => {
|
|
|
5110
5114
|
t[n][0] && t[n][0](e);
|
|
5111
5115
|
}, gc = (t, e) => {
|
|
5112
5116
|
if (!Re.has(t)) {
|
|
5113
|
-
const n =
|
|
5117
|
+
const n = Ve(hc, e), s = /* @__PURE__ */ Object.create(null), r = Yr.bind(ee, t);
|
|
5114
5118
|
let a = Me;
|
|
5115
5119
|
const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
|
|
5116
5120
|
const k = i[h] || [];
|
|
@@ -5151,7 +5155,7 @@ const Sr = (t, e) => {
|
|
|
5151
5155
|
}, vc = (t, e, n, s, r) => {
|
|
5152
5156
|
const a = n.errorRetryCount, i = r.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
5153
5157
|
!N(a) && i > a || setTimeout(s, o, r);
|
|
5154
|
-
}, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc =
|
|
5158
|
+
}, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc = Ve(
|
|
5155
5159
|
{
|
|
5156
5160
|
// events
|
|
5157
5161
|
onLoadingSlow: Me,
|
|
@@ -5179,10 +5183,10 @@ const Sr = (t, e) => {
|
|
|
5179
5183
|
// use web preset by default
|
|
5180
5184
|
fc
|
|
5181
5185
|
), kc = (t, e) => {
|
|
5182
|
-
const n =
|
|
5186
|
+
const n = Ve(t, e);
|
|
5183
5187
|
if (e) {
|
|
5184
5188
|
const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
|
|
5185
|
-
s && a && (n.use = s.concat(a)), r && i && (n.fallback =
|
|
5189
|
+
s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ve(r, i));
|
|
5186
5190
|
}
|
|
5187
5191
|
return n;
|
|
5188
5192
|
}, xc = la({}), Ec = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Sc = ea ? window.__SWR_DEVTOOLS_USE__ : [], Oc = () => {
|
|
@@ -5195,14 +5199,14 @@ const Sr = (t, e) => {
|
|
|
5195
5199
|
t[0],
|
|
5196
5200
|
null,
|
|
5197
5201
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5198
|
-
],
|
|
5202
|
+
], Cc = () => Ve(wc, pa(xc)), Ac = (t) => (e, n, s) => t(e, n && ((...a) => {
|
|
5199
5203
|
const [i] = js(e), [, , , o] = Re.get(Qr);
|
|
5200
5204
|
if (i.startsWith(Ec))
|
|
5201
5205
|
return n(...a);
|
|
5202
5206
|
const c = o[i];
|
|
5203
5207
|
return N(c) ? n(...a) : (delete o[i], c);
|
|
5204
|
-
}), s), Nc = Sc.concat(
|
|
5205
|
-
const s =
|
|
5208
|
+
}), s), Nc = Sc.concat(Ac), Rc = (t) => function(...n) {
|
|
5209
|
+
const s = Cc(), [r, a, i] = Tc(n), o = kc(s, i);
|
|
5206
5210
|
let c = t;
|
|
5207
5211
|
const { use: u } = o, h = (u || []).concat(Nc);
|
|
5208
5212
|
for (let p = h.length; p--; )
|
|
@@ -5238,7 +5242,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5238
5242
|
}), Bn = {
|
|
5239
5243
|
dedupe: !0
|
|
5240
5244
|
}, Ic = (t, e, n) => {
|
|
5241
|
-
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1),
|
|
5245
|
+
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), z = Ke(!1), L = Ke(m), q = Ke(e), j = Ke(n), Z = () => j.current, Se = () => Z().isVisible() && Z().isOnline(), [$, st, ze, le] = Xr(s, m), rt = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Zs = (D, I) => {
|
|
5242
5246
|
for (const G in rt) {
|
|
5243
5247
|
const U = G;
|
|
5244
5248
|
if (U === "data") {
|
|
@@ -5250,16 +5254,16 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5250
5254
|
return !0;
|
|
5251
5255
|
}, Ds = ma(() => {
|
|
5252
5256
|
const D = !m || !e ? !1 : N(o) ? Z().isPaused() || a ? !1 : c !== !1 : o, I = (Y) => {
|
|
5253
|
-
const Oe =
|
|
5257
|
+
const Oe = Ve(Y);
|
|
5254
5258
|
return delete Oe._k, D ? Be({
|
|
5255
5259
|
isValidating: !0,
|
|
5256
5260
|
isLoading: !0
|
|
5257
5261
|
}, Oe) : Oe;
|
|
5258
|
-
}, G =
|
|
5262
|
+
}, G = $(), U = le(), fe = I(G), ot = G === U ? fe : I(U);
|
|
5259
5263
|
let H = fe;
|
|
5260
5264
|
return [
|
|
5261
5265
|
() => {
|
|
5262
|
-
const Y = I(
|
|
5266
|
+
const Y = I($());
|
|
5263
5267
|
return Zs(Y, H) ? (H.data = Y.data, H.isLoading = Y.isLoading, H.isValidating = Y.isValidating, H.error = Y.error, H) : (H = Y, Y);
|
|
5264
5268
|
},
|
|
5265
5269
|
() => ot
|
|
@@ -5268,7 +5272,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5268
5272
|
s,
|
|
5269
5273
|
m
|
|
5270
5274
|
]), at = ac.useSyncExternalStore(rn(
|
|
5271
|
-
(D) =>
|
|
5275
|
+
(D) => ze(m, (I, G) => {
|
|
5272
5276
|
Zs(G, I) || D();
|
|
5273
5277
|
}),
|
|
5274
5278
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -5276,31 +5280,31 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5276
5280
|
s,
|
|
5277
5281
|
m
|
|
5278
5282
|
]
|
|
5279
|
-
), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error,
|
|
5283
|
+
), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error, Cn = Ke(Ue), en = k ? N(it) ? N(Cn.current) ? Ue : Cn.current : it : Ue, Ls = ta && !N(Qt) ? !1 : Ms && !N(o) ? o : Z().isPaused() ? !1 : a ? N(Ue) ? !1 : c : N(Ue) || c, $s = !!(m && e && Ms && Ls), na = N(at.isValidating) ? $s : at.isValidating, sa = N(at.isLoading) ? $s : at.isLoading, wt = rn(
|
|
5280
5284
|
(D) => Ie(void 0, null, function* () {
|
|
5281
5285
|
const I = q.current;
|
|
5282
|
-
if (!m || !I ||
|
|
5286
|
+
if (!m || !I || z.current || Z().isPaused())
|
|
5283
5287
|
return !1;
|
|
5284
5288
|
let G, U, fe = !0;
|
|
5285
|
-
const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () => xr ? !
|
|
5289
|
+
const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () => xr ? !z.current && m === L.current && R.current : m === L.current, Oe = {
|
|
5286
5290
|
isValidating: !1,
|
|
5287
5291
|
isLoading: !1
|
|
5288
5292
|
}, Ws = () => {
|
|
5289
5293
|
st(Oe);
|
|
5290
|
-
},
|
|
5294
|
+
}, Vs = () => {
|
|
5291
5295
|
const ue = l[m];
|
|
5292
5296
|
ue && ue[1] === U && delete l[m];
|
|
5293
|
-
},
|
|
5297
|
+
}, zs = {
|
|
5294
5298
|
isValidating: !0
|
|
5295
5299
|
};
|
|
5296
|
-
N(
|
|
5300
|
+
N($().data) && (zs.isLoading = !0);
|
|
5297
5301
|
try {
|
|
5298
|
-
if (H && (st(
|
|
5302
|
+
if (H && (st(zs), n.loadingTimeout && N($().data) && setTimeout(() => {
|
|
5299
5303
|
fe && Y() && Z().onLoadingSlow(m, n);
|
|
5300
5304
|
}, n.loadingTimeout), l[m] = [
|
|
5301
5305
|
I(W),
|
|
5302
5306
|
Os()
|
|
5303
|
-
]), [G, U] = l[m], G = yield G, H && setTimeout(
|
|
5307
|
+
]), [G, U] = l[m], G = yield G, H && setTimeout(Vs, n.dedupingInterval), !l[m] || l[m][1] !== U)
|
|
5304
5308
|
return H && Y() && Z().onDiscarded(m), !1;
|
|
5305
5309
|
Oe.error = ee;
|
|
5306
5310
|
const ue = b[m];
|
|
@@ -5309,12 +5313,12 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5309
5313
|
U <= ue[1] || // case 3
|
|
5310
5314
|
ue[1] === 0))
|
|
5311
5315
|
return Ws(), H && Y() && Z().onDiscarded(m), !1;
|
|
5312
|
-
const Te =
|
|
5316
|
+
const Te = $().data;
|
|
5313
5317
|
Oe.data = r(Te, G) ? Te : G, H && Y() && Z().onSuccess(G, m, n);
|
|
5314
5318
|
} catch (ue) {
|
|
5315
|
-
|
|
5316
|
-
const Te = Z(), { shouldRetryOnError:
|
|
5317
|
-
Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (
|
|
5319
|
+
Vs();
|
|
5320
|
+
const Te = Z(), { shouldRetryOnError: An } = Te;
|
|
5321
|
+
Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (An === !0 || be(An) && An(ue)) && (!Z().revalidateOnFocus || !Z().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, m, Te, (ra) => {
|
|
5318
5322
|
const Nn = v[m];
|
|
5319
5323
|
Nn && Nn[0] && Nn[0](wr, ra);
|
|
5320
5324
|
}, {
|
|
@@ -5341,12 +5345,12 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5341
5345
|
]
|
|
5342
5346
|
), Fs = rn(
|
|
5343
5347
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5344
|
-
(...D) => Yr(s,
|
|
5348
|
+
(...D) => Yr(s, L.current, ...D),
|
|
5345
5349
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5346
5350
|
[]
|
|
5347
5351
|
);
|
|
5348
5352
|
if (Wn(() => {
|
|
5349
|
-
q.current = e, j.current = n, N(it) || (
|
|
5353
|
+
q.current = e, j.current = n, N(it) || (Cn.current = it);
|
|
5350
5354
|
}), Wn(() => {
|
|
5351
5355
|
if (!m) return;
|
|
5352
5356
|
const D = wt.bind(ee, Bn);
|
|
@@ -5365,21 +5369,21 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5365
5369
|
return wt(ot);
|
|
5366
5370
|
}
|
|
5367
5371
|
});
|
|
5368
|
-
return
|
|
5372
|
+
return z.current = !1, L.current = m, R.current = !0, st({
|
|
5369
5373
|
_k: W
|
|
5370
5374
|
}), Ls && (N(Ue) || Ht ? D() : pc(D)), () => {
|
|
5371
|
-
|
|
5375
|
+
z.current = !0, U();
|
|
5372
5376
|
};
|
|
5373
5377
|
}, [
|
|
5374
5378
|
m
|
|
5375
5379
|
]), Wn(() => {
|
|
5376
5380
|
let D;
|
|
5377
5381
|
function I() {
|
|
5378
|
-
const U = be(u) ? u(
|
|
5382
|
+
const U = be(u) ? u($().data) : u;
|
|
5379
5383
|
U && D !== -1 && (D = setTimeout(G, U));
|
|
5380
5384
|
}
|
|
5381
5385
|
function G() {
|
|
5382
|
-
|
|
5386
|
+
!$().error && (h || Z().isVisible()) && (p || Z().isOnline()) ? wt(Bn).then(I) : I();
|
|
5383
5387
|
}
|
|
5384
5388
|
return I(), () => {
|
|
5385
5389
|
D && (clearTimeout(D), D = -1);
|
|
@@ -5392,7 +5396,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5392
5396
|
]), ya(en), a && N(Ue) && m) {
|
|
5393
5397
|
if (!xr && Ht)
|
|
5394
5398
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5395
|
-
q.current = e, j.current = n,
|
|
5399
|
+
q.current = e, j.current = n, z.current = !1;
|
|
5396
5400
|
const D = y[m];
|
|
5397
5401
|
if (!N(D)) {
|
|
5398
5402
|
const I = Fs(D);
|
|
@@ -5427,7 +5431,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5427
5431
|
}) => {
|
|
5428
5432
|
const r = !!(n && t && e), { data: a, isLoading: i, error: o } = jc(
|
|
5429
5433
|
["figma", t, e, s],
|
|
5430
|
-
() => r ?
|
|
5434
|
+
() => r ? Ai({
|
|
5431
5435
|
fileKey: t,
|
|
5432
5436
|
authToken: e,
|
|
5433
5437
|
params: s
|