@animaapp/anima-sdk-react 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +1013 -935
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var dn = Object.defineProperty, hn = Object.defineProperties;
|
|
2
|
+
var pn = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Ct = Object.getOwnPropertySymbols;
|
|
4
|
+
var En = Object.prototype.hasOwnProperty, mn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var At = (e, n, t) => n in e ? dn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, k = (e, n) => {
|
|
6
|
+
for (var t in n || (n = {}))
|
|
7
|
+
En.call(n, t) && At(e, t, n[t]);
|
|
8
|
+
if (Ct)
|
|
9
|
+
for (var t of Ct(n))
|
|
10
|
+
mn.call(n, t) && At(e, t, n[t]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, Ye = (e, n) => hn(e, pn(n));
|
|
13
|
+
var H = (e, n, t) => new Promise((r, o) => {
|
|
14
|
+
var u = (s) => {
|
|
15
15
|
try {
|
|
16
|
-
l(
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
l(t.next(s));
|
|
17
|
+
} catch (i) {
|
|
18
|
+
o(i);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, a = (s) => {
|
|
21
21
|
try {
|
|
22
|
-
l(
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
l(t.throw(s));
|
|
23
|
+
} catch (i) {
|
|
24
|
+
o(i);
|
|
25
25
|
}
|
|
26
|
-
}, l = (
|
|
27
|
-
l((
|
|
26
|
+
}, l = (s) => s.done ? r(s.value) : Promise.resolve(s.value).then(u, a);
|
|
27
|
+
l((t = t.apply(e, n)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
30
|
-
import { CodegenError as
|
|
29
|
+
import be, { createContext as Yt, useState as rt, useRef as ue, useEffect as Bt, useContext as Ht, useCallback as $e, useLayoutEffect as gn, useMemo as zt, useDebugValue as vn } from "react";
|
|
30
|
+
import { CodegenError as Be } from "@animaapp/anima-sdk";
|
|
31
31
|
var Pe = { exports: {} }, Ce = {};
|
|
32
32
|
/**
|
|
33
33
|
* @license React
|
|
@@ -39,26 +39,26 @@ var Pe = { exports: {} }, Ce = {};
|
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
41
|
var Lt;
|
|
42
|
-
function
|
|
42
|
+
function _n() {
|
|
43
43
|
if (Lt) return Ce;
|
|
44
44
|
Lt = 1;
|
|
45
|
-
var e = Symbol.for("react.transitional.element"),
|
|
46
|
-
function
|
|
47
|
-
var
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
for (var l in
|
|
51
|
-
l !== "key" && (
|
|
52
|
-
} else
|
|
53
|
-
return
|
|
45
|
+
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
46
|
+
function t(r, o, u) {
|
|
47
|
+
var a = null;
|
|
48
|
+
if (u !== void 0 && (a = "" + u), o.key !== void 0 && (a = "" + o.key), "key" in o) {
|
|
49
|
+
u = {};
|
|
50
|
+
for (var l in o)
|
|
51
|
+
l !== "key" && (u[l] = o[l]);
|
|
52
|
+
} else u = o;
|
|
53
|
+
return o = u.ref, {
|
|
54
54
|
$$typeof: e,
|
|
55
55
|
type: r,
|
|
56
|
-
key:
|
|
57
|
-
ref:
|
|
58
|
-
props:
|
|
56
|
+
key: a,
|
|
57
|
+
ref: o !== void 0 ? o : null,
|
|
58
|
+
props: u
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
return Ce.Fragment =
|
|
61
|
+
return Ce.Fragment = n, Ce.jsx = t, Ce.jsxs = t, Ce;
|
|
62
62
|
}
|
|
63
63
|
var Ae = {};
|
|
64
64
|
/**
|
|
@@ -70,346 +70,346 @@ var Ae = {};
|
|
|
70
70
|
* This source code is licensed under the MIT license found in the
|
|
71
71
|
* LICENSE file in the root directory of this source tree.
|
|
72
72
|
*/
|
|
73
|
-
var
|
|
74
|
-
function
|
|
75
|
-
return
|
|
76
|
-
function e(
|
|
77
|
-
if (
|
|
78
|
-
if (typeof
|
|
79
|
-
return
|
|
80
|
-
if (typeof
|
|
81
|
-
switch (
|
|
82
|
-
case
|
|
73
|
+
var Nt;
|
|
74
|
+
function Sn() {
|
|
75
|
+
return Nt || (Nt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
76
|
+
function e(c) {
|
|
77
|
+
if (c == null) return null;
|
|
78
|
+
if (typeof c == "function")
|
|
79
|
+
return c.$$typeof === G ? null : c.displayName || c.name || null;
|
|
80
|
+
if (typeof c == "string") return c;
|
|
81
|
+
switch (c) {
|
|
82
|
+
case d:
|
|
83
83
|
return "Fragment";
|
|
84
|
-
case o:
|
|
85
|
-
return "Profiler";
|
|
86
84
|
case f:
|
|
85
|
+
return "Profiler";
|
|
86
|
+
case g:
|
|
87
87
|
return "StrictMode";
|
|
88
88
|
case T:
|
|
89
89
|
return "Suspense";
|
|
90
|
-
case
|
|
90
|
+
case I:
|
|
91
91
|
return "SuspenseList";
|
|
92
|
-
case
|
|
92
|
+
case ae:
|
|
93
93
|
return "Activity";
|
|
94
94
|
}
|
|
95
|
-
if (typeof
|
|
96
|
-
switch (typeof
|
|
95
|
+
if (typeof c == "object")
|
|
96
|
+
switch (typeof c.tag == "number" && console.error(
|
|
97
97
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
98
|
-
),
|
|
99
|
-
case
|
|
98
|
+
), c.$$typeof) {
|
|
99
|
+
case E:
|
|
100
100
|
return "Portal";
|
|
101
|
-
case
|
|
102
|
-
return (
|
|
103
|
-
case
|
|
104
|
-
return (
|
|
105
|
-
case
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
case
|
|
109
|
-
return
|
|
110
|
-
case
|
|
111
|
-
|
|
101
|
+
case O:
|
|
102
|
+
return (c.displayName || "Context") + ".Provider";
|
|
103
|
+
case w:
|
|
104
|
+
return (c._context.displayName || "Context") + ".Consumer";
|
|
105
|
+
case M:
|
|
106
|
+
var _ = c.render;
|
|
107
|
+
return c = c.displayName, c || (c = _.displayName || _.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
|
|
108
|
+
case q:
|
|
109
|
+
return _ = c.displayName || null, _ !== null ? _ : e(c.type) || "Memo";
|
|
110
|
+
case C:
|
|
111
|
+
_ = c._payload, c = c._init;
|
|
112
112
|
try {
|
|
113
|
-
return e(
|
|
114
|
-
} catch (
|
|
113
|
+
return e(c(_));
|
|
114
|
+
} catch (b) {
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
return null;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return "" +
|
|
119
|
+
function n(c) {
|
|
120
|
+
return "" + c;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function t(c) {
|
|
123
123
|
try {
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
} catch (
|
|
127
|
-
|
|
124
|
+
n(c);
|
|
125
|
+
var _ = !1;
|
|
126
|
+
} catch (Y) {
|
|
127
|
+
_ = !0;
|
|
128
128
|
}
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
var
|
|
132
|
-
return
|
|
133
|
-
|
|
129
|
+
if (_) {
|
|
130
|
+
_ = console;
|
|
131
|
+
var b = _.error, x = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
132
|
+
return b.call(
|
|
133
|
+
_,
|
|
134
134
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
135
|
-
|
|
136
|
-
),
|
|
135
|
+
x
|
|
136
|
+
), n(c);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
function r(
|
|
140
|
-
if (
|
|
141
|
-
if (typeof
|
|
139
|
+
function r(c) {
|
|
140
|
+
if (c === d) return "<>";
|
|
141
|
+
if (typeof c == "object" && c !== null && c.$$typeof === C)
|
|
142
142
|
return "<...>";
|
|
143
143
|
try {
|
|
144
|
-
var
|
|
145
|
-
return
|
|
146
|
-
} catch (
|
|
144
|
+
var _ = e(c);
|
|
145
|
+
return _ ? "<" + _ + ">" : "<...>";
|
|
146
|
+
} catch (b) {
|
|
147
147
|
return "<...>";
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
var
|
|
152
|
-
return
|
|
150
|
+
function o() {
|
|
151
|
+
var c = X.A;
|
|
152
|
+
return c === null ? null : c.getOwner();
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function u() {
|
|
155
155
|
return Error("react-stack-top-frame");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
if (
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
157
|
+
function a(c) {
|
|
158
|
+
if (he.call(c, "key")) {
|
|
159
|
+
var _ = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
160
|
+
if (_ && _.isReactWarning) return !1;
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return c.key !== void 0;
|
|
163
163
|
}
|
|
164
|
-
function l(
|
|
165
|
-
function
|
|
166
|
-
|
|
164
|
+
function l(c, _) {
|
|
165
|
+
function b() {
|
|
166
|
+
ie || (ie = !0, console.error(
|
|
167
167
|
"%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://react.dev/link/special-props)",
|
|
168
|
-
|
|
168
|
+
_
|
|
169
169
|
));
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
get:
|
|
171
|
+
b.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
172
|
+
get: b,
|
|
173
173
|
configurable: !0
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
return
|
|
176
|
+
function s() {
|
|
177
|
+
var c = e(this.type);
|
|
178
|
+
return Re[c] || (Re[c] = !0, console.error(
|
|
179
179
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
180
|
-
)),
|
|
180
|
+
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
184
|
-
$$typeof:
|
|
185
|
-
type:
|
|
186
|
-
key:
|
|
187
|
-
props:
|
|
188
|
-
_owner:
|
|
189
|
-
}, (
|
|
182
|
+
function i(c, _, b, x, Y, $, Ee, me) {
|
|
183
|
+
return b = $.ref, c = {
|
|
184
|
+
$$typeof: p,
|
|
185
|
+
type: c,
|
|
186
|
+
key: _,
|
|
187
|
+
props: $,
|
|
188
|
+
_owner: Y
|
|
189
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(c, "ref", {
|
|
190
190
|
enumerable: !1,
|
|
191
|
-
get:
|
|
192
|
-
}) : Object.defineProperty(
|
|
191
|
+
get: s
|
|
192
|
+
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
193
193
|
configurable: !1,
|
|
194
194
|
enumerable: !1,
|
|
195
195
|
writable: !0,
|
|
196
196
|
value: 0
|
|
197
|
-
}), Object.defineProperty(
|
|
197
|
+
}), Object.defineProperty(c, "_debugInfo", {
|
|
198
198
|
configurable: !1,
|
|
199
199
|
enumerable: !1,
|
|
200
200
|
writable: !0,
|
|
201
201
|
value: null
|
|
202
|
-
}), Object.defineProperty(
|
|
202
|
+
}), Object.defineProperty(c, "_debugStack", {
|
|
203
203
|
configurable: !1,
|
|
204
204
|
enumerable: !1,
|
|
205
205
|
writable: !0,
|
|
206
206
|
value: Ee
|
|
207
|
-
}), Object.defineProperty(
|
|
207
|
+
}), Object.defineProperty(c, "_debugTask", {
|
|
208
208
|
configurable: !1,
|
|
209
209
|
enumerable: !1,
|
|
210
210
|
writable: !0,
|
|
211
211
|
value: me
|
|
212
|
-
}), Object.freeze && (Object.freeze(
|
|
212
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
var P =
|
|
214
|
+
function h(c, _, b, x, Y, $, Ee, me) {
|
|
215
|
+
var P = _.children;
|
|
216
216
|
if (P !== void 0)
|
|
217
|
-
if (
|
|
218
|
-
if (
|
|
219
|
-
for (
|
|
220
|
-
m(P[
|
|
217
|
+
if (x)
|
|
218
|
+
if (Q(P)) {
|
|
219
|
+
for (x = 0; x < P.length; x++)
|
|
220
|
+
m(P[x]);
|
|
221
221
|
Object.freeze && Object.freeze(P);
|
|
222
222
|
} else
|
|
223
223
|
console.error(
|
|
224
224
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
225
225
|
);
|
|
226
226
|
else m(P);
|
|
227
|
-
if (
|
|
228
|
-
P = e(
|
|
229
|
-
var
|
|
230
|
-
return
|
|
227
|
+
if (he.call(_, "key")) {
|
|
228
|
+
P = e(c);
|
|
229
|
+
var ce = Object.keys(_).filter(function(Me) {
|
|
230
|
+
return Me !== "key";
|
|
231
231
|
});
|
|
232
|
-
|
|
232
|
+
x = 0 < ce.length ? "{key: someKey, " + ce.join(": ..., ") + ": ...}" : "{key: someKey}", Te[P + x] || (ce = 0 < ce.length ? "{" + ce.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
233
233
|
`A props object containing a "key" prop is being spread into JSX:
|
|
234
234
|
let props = %s;
|
|
235
235
|
<%s {...props} />
|
|
236
236
|
React keys must be passed directly to JSX without using spread:
|
|
237
237
|
let props = %s;
|
|
238
238
|
<%s key={someKey} {...props} />`,
|
|
239
|
-
|
|
239
|
+
x,
|
|
240
240
|
P,
|
|
241
|
-
|
|
241
|
+
ce,
|
|
242
242
|
P
|
|
243
|
-
), Te[P +
|
|
243
|
+
), Te[P + x] = !0);
|
|
244
244
|
}
|
|
245
|
-
if (P = null,
|
|
246
|
-
|
|
247
|
-
for (var
|
|
248
|
-
|
|
249
|
-
} else
|
|
245
|
+
if (P = null, b !== void 0 && (t(b), P = "" + b), a(_) && (t(_.key), P = "" + _.key), "key" in _) {
|
|
246
|
+
b = {};
|
|
247
|
+
for (var te in _)
|
|
248
|
+
te !== "key" && (b[te] = _[te]);
|
|
249
|
+
} else b = _;
|
|
250
250
|
return P && l(
|
|
251
|
-
|
|
252
|
-
typeof
|
|
253
|
-
),
|
|
254
|
-
|
|
251
|
+
b,
|
|
252
|
+
typeof c == "function" ? c.displayName || c.name || "Unknown" : c
|
|
253
|
+
), i(
|
|
254
|
+
c,
|
|
255
255
|
P,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
$,
|
|
257
|
+
Y,
|
|
258
|
+
o(),
|
|
259
|
+
b,
|
|
260
260
|
Ee,
|
|
261
261
|
me
|
|
262
262
|
);
|
|
263
263
|
}
|
|
264
|
-
function m(
|
|
265
|
-
typeof
|
|
264
|
+
function m(c) {
|
|
265
|
+
typeof c == "object" && c !== null && c.$$typeof === p && c._store && (c._store.validated = 1);
|
|
266
266
|
}
|
|
267
|
-
var
|
|
267
|
+
var v = be, p = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), O = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), ae = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), X = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, he = Object.prototype.hasOwnProperty, Q = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
268
268
|
return null;
|
|
269
269
|
};
|
|
270
|
-
|
|
271
|
-
react_stack_bottom_frame: function(
|
|
272
|
-
return
|
|
270
|
+
v = {
|
|
271
|
+
react_stack_bottom_frame: function(c) {
|
|
272
|
+
return c();
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
)(),
|
|
279
|
-
Ae.Fragment =
|
|
280
|
-
var
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
275
|
+
var ie, Re = {}, Oe = v.react_stack_bottom_frame.bind(
|
|
276
|
+
v,
|
|
277
|
+
u
|
|
278
|
+
)(), ee = D(r(u)), Te = {};
|
|
279
|
+
Ae.Fragment = d, Ae.jsx = function(c, _, b, x, Y) {
|
|
280
|
+
var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
281
|
+
return h(
|
|
282
|
+
c,
|
|
283
|
+
_,
|
|
284
|
+
b,
|
|
285
285
|
!1,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
x,
|
|
287
|
+
Y,
|
|
288
|
+
$ ? Error("react-stack-top-frame") : Oe,
|
|
289
|
+
$ ? D(r(c)) : ee
|
|
290
290
|
);
|
|
291
|
-
}, Ae.jsxs = function(
|
|
292
|
-
var
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
291
|
+
}, Ae.jsxs = function(c, _, b, x, Y) {
|
|
292
|
+
var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
293
|
+
return h(
|
|
294
|
+
c,
|
|
295
|
+
_,
|
|
296
|
+
b,
|
|
297
297
|
!0,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
x,
|
|
299
|
+
Y,
|
|
300
|
+
$ ? Error("react-stack-top-frame") : Oe,
|
|
301
|
+
$ ? D(r(c)) : ee
|
|
302
302
|
);
|
|
303
303
|
};
|
|
304
304
|
})()), Ae;
|
|
305
305
|
}
|
|
306
|
-
var
|
|
307
|
-
function
|
|
308
|
-
return
|
|
306
|
+
var xt;
|
|
307
|
+
function wn() {
|
|
308
|
+
return xt || (xt = 1, process.env.NODE_ENV === "production" ? Pe.exports = _n() : Pe.exports = Sn()), Pe.exports;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
311
|
-
class
|
|
312
|
-
constructor(
|
|
313
|
-
super(
|
|
310
|
+
var yn = wn();
|
|
311
|
+
class kt extends Error {
|
|
312
|
+
constructor(n, t) {
|
|
313
|
+
super(n), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function He(e) {
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function bn(e) {
|
|
319
319
|
if (typeof e == "function")
|
|
320
320
|
throw new TypeError(
|
|
321
321
|
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
322
322
|
);
|
|
323
|
-
const { onEvent:
|
|
324
|
-
let
|
|
325
|
-
function
|
|
326
|
-
const
|
|
327
|
-
for (const
|
|
328
|
-
m(
|
|
329
|
-
|
|
323
|
+
const { onEvent: n = He, onError: t = He, onRetry: r = He, onComment: o } = e;
|
|
324
|
+
let u = "", a = !0, l, s = "", i = "";
|
|
325
|
+
function h(d) {
|
|
326
|
+
const g = a ? d.replace(/^\xEF\xBB\xBF/, "") : d, [f, w] = Rn(`${u}${g}`);
|
|
327
|
+
for (const O of f)
|
|
328
|
+
m(O);
|
|
329
|
+
u = w, a = !1;
|
|
330
330
|
}
|
|
331
|
-
function m(
|
|
332
|
-
if (
|
|
333
|
-
|
|
331
|
+
function m(d) {
|
|
332
|
+
if (d === "") {
|
|
333
|
+
p();
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
337
|
-
|
|
336
|
+
if (d.startsWith(":")) {
|
|
337
|
+
o && o(d.slice(d.startsWith(": ") ? 2 : 1));
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
342
|
-
const
|
|
343
|
-
|
|
340
|
+
const g = d.indexOf(":");
|
|
341
|
+
if (g !== -1) {
|
|
342
|
+
const f = d.slice(0, g), w = d[g + 1] === " " ? 2 : 1, O = d.slice(g + w);
|
|
343
|
+
v(f, O, d);
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
|
-
|
|
346
|
+
v(d, "", d);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
switch (
|
|
348
|
+
function v(d, g, f) {
|
|
349
|
+
switch (d) {
|
|
350
350
|
case "event":
|
|
351
|
-
|
|
351
|
+
i = g;
|
|
352
352
|
break;
|
|
353
353
|
case "data":
|
|
354
|
-
|
|
354
|
+
s = `${s}${g}
|
|
355
355
|
`;
|
|
356
356
|
break;
|
|
357
357
|
case "id":
|
|
358
|
-
l =
|
|
358
|
+
l = g.includes("\0") ? void 0 : g;
|
|
359
359
|
break;
|
|
360
360
|
case "retry":
|
|
361
|
-
/^\d+$/.test(
|
|
362
|
-
new
|
|
361
|
+
/^\d+$/.test(g) ? r(parseInt(g, 10)) : t(
|
|
362
|
+
new kt(`Invalid \`retry\` value: "${g}"`, {
|
|
363
363
|
type: "invalid-retry",
|
|
364
|
-
value:
|
|
365
|
-
line:
|
|
364
|
+
value: g,
|
|
365
|
+
line: f
|
|
366
366
|
})
|
|
367
367
|
);
|
|
368
368
|
break;
|
|
369
369
|
default:
|
|
370
|
-
|
|
371
|
-
new
|
|
372
|
-
`Unknown field "${
|
|
373
|
-
{ type: "unknown-field", field:
|
|
370
|
+
t(
|
|
371
|
+
new kt(
|
|
372
|
+
`Unknown field "${d.length > 20 ? `${d.slice(0, 20)}…` : d}"`,
|
|
373
|
+
{ type: "unknown-field", field: d, value: g, line: f }
|
|
374
374
|
)
|
|
375
375
|
);
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
379
|
+
function p() {
|
|
380
|
+
s.length > 0 && n({
|
|
381
381
|
id: l,
|
|
382
|
-
event:
|
|
382
|
+
event: i || void 0,
|
|
383
383
|
// If the data buffer's last character is a U+000A LINE FEED (LF) character,
|
|
384
384
|
// then remove the last character from the data buffer.
|
|
385
|
-
data:
|
|
386
|
-
`) ?
|
|
387
|
-
}), l = void 0,
|
|
385
|
+
data: s.endsWith(`
|
|
386
|
+
`) ? s.slice(0, -1) : s
|
|
387
|
+
}), l = void 0, s = "", i = "";
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
|
|
389
|
+
function E(d = {}) {
|
|
390
|
+
u && d.consume && m(u), a = !0, l = void 0, s = "", i = "", u = "";
|
|
391
391
|
}
|
|
392
|
-
return { feed:
|
|
392
|
+
return { feed: h, reset: E };
|
|
393
393
|
}
|
|
394
394
|
function Rn(e) {
|
|
395
|
-
const
|
|
396
|
-
let
|
|
395
|
+
const n = [];
|
|
396
|
+
let t = "", r = 0;
|
|
397
397
|
for (; r < e.length; ) {
|
|
398
|
-
const
|
|
398
|
+
const o = e.indexOf("\r", r), u = e.indexOf(`
|
|
399
399
|
`, r);
|
|
400
|
-
let
|
|
401
|
-
if (
|
|
402
|
-
|
|
400
|
+
let a = -1;
|
|
401
|
+
if (o !== -1 && u !== -1 ? a = Math.min(o, u) : o !== -1 ? o === e.length - 1 ? a = -1 : a = o : u !== -1 && (a = u), a === -1) {
|
|
402
|
+
t = e.slice(r);
|
|
403
403
|
break;
|
|
404
404
|
} else {
|
|
405
|
-
const l = e.slice(r,
|
|
406
|
-
|
|
405
|
+
const l = e.slice(r, a);
|
|
406
|
+
n.push(l), r = a + 1, e[r - 1] === "\r" && e[r] === `
|
|
407
407
|
` && r++;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
return [
|
|
410
|
+
return [n, t];
|
|
411
411
|
}
|
|
412
|
-
class
|
|
412
|
+
class It extends Event {
|
|
413
413
|
/**
|
|
414
414
|
* Constructs a new `ErrorEvent` instance. This is typically not called directly,
|
|
415
415
|
* but rather emitted by the `EventSource` object when an error occurs.
|
|
@@ -417,9 +417,9 @@ class kt extends Event {
|
|
|
417
417
|
* @param type - The type of the event (should be "error")
|
|
418
418
|
* @param errorEventInitDict - Optional properties to include in the error event
|
|
419
419
|
*/
|
|
420
|
-
constructor(
|
|
421
|
-
var r,
|
|
422
|
-
super(
|
|
420
|
+
constructor(n, t) {
|
|
421
|
+
var r, o;
|
|
422
|
+
super(n), this.code = (r = t == null ? void 0 : t.code) != null ? r : void 0, this.message = (o = t == null ? void 0 : t.message) != null ? o : void 0;
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,
|
|
@@ -433,8 +433,8 @@ class kt extends Event {
|
|
|
433
433
|
* @param inspect - The inspect function to use (prevents having to import it from `util`)
|
|
434
434
|
* @returns A string representation of the error
|
|
435
435
|
*/
|
|
436
|
-
[Symbol.for("nodejs.util.inspect.custom")](
|
|
437
|
-
return r(Dt(this),
|
|
436
|
+
[Symbol.for("nodejs.util.inspect.custom")](n, t, r) {
|
|
437
|
+
return r(Dt(this), t);
|
|
438
438
|
}
|
|
439
439
|
/**
|
|
440
440
|
* Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,
|
|
@@ -447,13 +447,13 @@ class kt extends Event {
|
|
|
447
447
|
* @param options - The options passed to `Deno.inspect`
|
|
448
448
|
* @returns A string representation of the error
|
|
449
449
|
*/
|
|
450
|
-
[Symbol.for("Deno.customInspect")](
|
|
451
|
-
return
|
|
450
|
+
[Symbol.for("Deno.customInspect")](n, t) {
|
|
451
|
+
return n(Dt(this), t);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
function On(e) {
|
|
455
|
-
const
|
|
456
|
-
return typeof
|
|
455
|
+
const n = globalThis.DOMException;
|
|
456
|
+
return typeof n == "function" ? new n(e, "SyntaxError") : new SyntaxError(e);
|
|
457
457
|
}
|
|
458
458
|
function st(e) {
|
|
459
459
|
return e instanceof Error ? "errors" in e && Array.isArray(e.errors) ? e.errors.map(st).join(", ") : "cause" in e && e.cause instanceof Error ? `${e}: ${st(e.cause)}` : e.message : `${e}`;
|
|
@@ -468,71 +468,71 @@ function Dt(e) {
|
|
|
468
468
|
timeStamp: e.timeStamp
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
var
|
|
471
|
+
var Kt = (e) => {
|
|
472
472
|
throw TypeError(e);
|
|
473
|
-
},
|
|
474
|
-
class
|
|
475
|
-
constructor(
|
|
476
|
-
var r,
|
|
477
|
-
super(), j(this,
|
|
478
|
-
var
|
|
473
|
+
}, St = (e, n, t) => n.has(e) || Kt("Cannot " + t), S = (e, n, t) => (St(e, n, "read from private field"), t ? t.call(e) : n.get(e)), j = (e, n, t) => n.has(e) ? Kt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t), L = (e, n, t, r) => (St(e, n, "write to private field"), n.set(e, t), t), se = (e, n, t) => (St(e, n, "access private method"), t), J, pe, ve, Ue, Je, xe, we, ke, le, _e, ye, Se, Le, K, ot, at, it, jt, ct, ut, Ne, lt, ft;
|
|
474
|
+
class Ie extends EventTarget {
|
|
475
|
+
constructor(n, t) {
|
|
476
|
+
var r, o;
|
|
477
|
+
super(), j(this, K), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, j(this, J), j(this, pe), j(this, ve), j(this, Ue), j(this, Je), j(this, xe), j(this, we), j(this, ke, null), j(this, le), j(this, _e), j(this, ye, null), j(this, Se, null), j(this, Le, null), j(this, at, (u) => H(this, null, function* () {
|
|
478
|
+
var a;
|
|
479
479
|
S(this, _e).reset();
|
|
480
|
-
const { body: l, redirected:
|
|
481
|
-
if (
|
|
482
|
-
|
|
480
|
+
const { body: l, redirected: s, status: i, headers: h } = u;
|
|
481
|
+
if (i === 204) {
|
|
482
|
+
se(this, K, Ne).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
if (
|
|
486
|
-
|
|
485
|
+
if (s ? L(this, ve, new URL(u.url)) : L(this, ve, void 0), i !== 200) {
|
|
486
|
+
se(this, K, Ne).call(this, `Non-200 status code (${i})`, i);
|
|
487
487
|
return;
|
|
488
488
|
}
|
|
489
|
-
if (!(
|
|
490
|
-
|
|
489
|
+
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
490
|
+
se(this, K, Ne).call(this, 'Invalid content type, expected "text/event-stream"', i);
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
|
-
if (S(this,
|
|
493
|
+
if (S(this, J) === this.CLOSED)
|
|
494
494
|
return;
|
|
495
|
-
L(this,
|
|
495
|
+
L(this, J, this.OPEN);
|
|
496
496
|
const m = new Event("open");
|
|
497
|
-
if ((
|
|
498
|
-
|
|
497
|
+
if ((a = S(this, Le)) == null || a.call(this, m), this.dispatchEvent(m), typeof l != "object" || !l || !("getReader" in l)) {
|
|
498
|
+
se(this, K, Ne).call(this, "Invalid response body, expected a web ReadableStream", i), this.close();
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
|
-
const
|
|
502
|
-
let
|
|
501
|
+
const v = new TextDecoder(), p = l.getReader();
|
|
502
|
+
let E = !0;
|
|
503
503
|
do {
|
|
504
|
-
const { done:
|
|
505
|
-
|
|
506
|
-
} while (
|
|
507
|
-
})), j(this,
|
|
508
|
-
L(this,
|
|
509
|
-
}), j(this,
|
|
510
|
-
typeof
|
|
511
|
-
const
|
|
512
|
-
data:
|
|
504
|
+
const { done: d, value: g } = yield p.read();
|
|
505
|
+
g && S(this, _e).feed(v.decode(g, { stream: !d })), d && (E = !1, S(this, _e).reset(), se(this, K, lt).call(this));
|
|
506
|
+
} while (E);
|
|
507
|
+
})), j(this, it, (u) => {
|
|
508
|
+
L(this, le, void 0), !(u.name === "AbortError" || u.type === "aborted") && se(this, K, lt).call(this, st(u));
|
|
509
|
+
}), j(this, ct, (u) => {
|
|
510
|
+
typeof u.id == "string" && L(this, ke, u.id);
|
|
511
|
+
const a = new MessageEvent(u.event || "message", {
|
|
512
|
+
data: u.data,
|
|
513
513
|
origin: S(this, ve) ? S(this, ve).origin : S(this, pe).origin,
|
|
514
|
-
lastEventId:
|
|
514
|
+
lastEventId: u.id || ""
|
|
515
515
|
});
|
|
516
|
-
S(this, Se) && (!
|
|
517
|
-
}), j(this,
|
|
518
|
-
L(this,
|
|
519
|
-
}), j(this,
|
|
520
|
-
L(this, we, void 0), S(this,
|
|
516
|
+
S(this, Se) && (!u.event || u.event === "message") && S(this, Se).call(this, a), this.dispatchEvent(a);
|
|
517
|
+
}), j(this, ut, (u) => {
|
|
518
|
+
L(this, xe, u);
|
|
519
|
+
}), j(this, ft, () => {
|
|
520
|
+
L(this, we, void 0), S(this, J) === this.CONNECTING && se(this, K, ot).call(this);
|
|
521
521
|
});
|
|
522
522
|
try {
|
|
523
|
-
if (
|
|
524
|
-
L(this, pe,
|
|
525
|
-
else if (typeof
|
|
526
|
-
L(this, pe, new URL(
|
|
523
|
+
if (n instanceof URL)
|
|
524
|
+
L(this, pe, n);
|
|
525
|
+
else if (typeof n == "string")
|
|
526
|
+
L(this, pe, new URL(n, Tn()));
|
|
527
527
|
else
|
|
528
528
|
throw new Error("Invalid URL");
|
|
529
|
-
} catch (
|
|
529
|
+
} catch (u) {
|
|
530
530
|
throw On("An invalid or illegal string was specified");
|
|
531
531
|
}
|
|
532
|
-
L(this, _e,
|
|
533
|
-
onEvent: S(this,
|
|
534
|
-
onRetry: S(this,
|
|
535
|
-
})), L(this,
|
|
532
|
+
L(this, _e, bn({
|
|
533
|
+
onEvent: S(this, ct),
|
|
534
|
+
onRetry: S(this, ut)
|
|
535
|
+
})), L(this, J, this.CONNECTING), L(this, xe, 3e3), L(this, Je, (r = t == null ? void 0 : t.fetch) != null ? r : globalThis.fetch), L(this, Ue, (o = t == null ? void 0 : t.withCredentials) != null ? o : !1), se(this, K, ot).call(this);
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
538
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -545,7 +545,7 @@ class Ue extends EventTarget {
|
|
|
545
545
|
* @public
|
|
546
546
|
*/
|
|
547
547
|
get readyState() {
|
|
548
|
-
return S(this,
|
|
548
|
+
return S(this, J);
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
551
551
|
* Returns the URL providing the event stream.
|
|
@@ -563,36 +563,36 @@ class Ue extends EventTarget {
|
|
|
563
563
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
564
564
|
*/
|
|
565
565
|
get withCredentials() {
|
|
566
|
-
return S(this,
|
|
566
|
+
return S(this, Ue);
|
|
567
567
|
}
|
|
568
568
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
569
569
|
get onerror() {
|
|
570
|
-
return S(this,
|
|
570
|
+
return S(this, ye);
|
|
571
571
|
}
|
|
572
|
-
set onerror(
|
|
573
|
-
L(this,
|
|
572
|
+
set onerror(n) {
|
|
573
|
+
L(this, ye, n);
|
|
574
574
|
}
|
|
575
575
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
576
576
|
get onmessage() {
|
|
577
577
|
return S(this, Se);
|
|
578
578
|
}
|
|
579
|
-
set onmessage(
|
|
580
|
-
L(this, Se,
|
|
579
|
+
set onmessage(n) {
|
|
580
|
+
L(this, Se, n);
|
|
581
581
|
}
|
|
582
582
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
583
583
|
get onopen() {
|
|
584
584
|
return S(this, Le);
|
|
585
585
|
}
|
|
586
|
-
set onopen(
|
|
587
|
-
L(this, Le,
|
|
586
|
+
set onopen(n) {
|
|
587
|
+
L(this, Le, n);
|
|
588
588
|
}
|
|
589
|
-
addEventListener(
|
|
590
|
-
const
|
|
591
|
-
super.addEventListener(
|
|
589
|
+
addEventListener(n, t, r) {
|
|
590
|
+
const o = t;
|
|
591
|
+
super.addEventListener(n, o, r);
|
|
592
592
|
}
|
|
593
|
-
removeEventListener(
|
|
594
|
-
const
|
|
595
|
-
super.removeEventListener(
|
|
593
|
+
removeEventListener(n, t, r) {
|
|
594
|
+
const o = t;
|
|
595
|
+
super.removeEventListener(n, o, r);
|
|
596
596
|
}
|
|
597
597
|
/**
|
|
598
598
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -602,17 +602,17 @@ class Ue extends EventTarget {
|
|
|
602
602
|
* @public
|
|
603
603
|
*/
|
|
604
604
|
close() {
|
|
605
|
-
S(this, we) && clearTimeout(S(this, we)), S(this,
|
|
605
|
+
S(this, we) && clearTimeout(S(this, we)), S(this, J) !== this.CLOSED && (S(this, le) && S(this, le).abort(), L(this, J, this.CLOSED), L(this, le, void 0));
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
|
|
608
|
+
J = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakSet(), /**
|
|
609
609
|
* Connect to the given URL and start receiving events
|
|
610
610
|
*
|
|
611
611
|
* @internal
|
|
612
612
|
*/
|
|
613
|
-
|
|
614
|
-
L(this,
|
|
615
|
-
},
|
|
613
|
+
ot = function() {
|
|
614
|
+
L(this, J, this.CONNECTING), L(this, le, new AbortController()), S(this, Je)(S(this, pe), se(this, K, jt).call(this)).then(S(this, at)).catch(S(this, it));
|
|
615
|
+
}, at = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), /**
|
|
616
616
|
* Get request options for the `fetch()` request
|
|
617
617
|
*
|
|
618
618
|
* @returns The request options
|
|
@@ -620,28 +620,28 @@ rt = function() {
|
|
|
620
620
|
*/
|
|
621
621
|
jt = function() {
|
|
622
622
|
var e;
|
|
623
|
-
const
|
|
623
|
+
const n = {
|
|
624
624
|
// [spec] Let `corsAttributeState` be `Anonymous`…
|
|
625
625
|
// [spec] …will have their mode set to "cors"…
|
|
626
626
|
mode: "cors",
|
|
627
627
|
redirect: "follow",
|
|
628
|
-
headers:
|
|
628
|
+
headers: k({ Accept: "text/event-stream" }, S(this, ke) ? { "Last-Event-ID": S(this, ke) } : void 0),
|
|
629
629
|
cache: "no-store",
|
|
630
|
-
signal: (e = S(this,
|
|
630
|
+
signal: (e = S(this, le)) == null ? void 0 : e.signal
|
|
631
631
|
};
|
|
632
|
-
return "window" in globalThis && (
|
|
633
|
-
},
|
|
632
|
+
return "window" in globalThis && (n.credentials = this.withCredentials ? "include" : "same-origin"), n;
|
|
633
|
+
}, ct = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), /**
|
|
634
634
|
* Handles the process referred to in the EventSource specification as "failing a connection".
|
|
635
635
|
*
|
|
636
636
|
* @param error - The error causing the connection to fail
|
|
637
637
|
* @param code - The HTTP status code, if available
|
|
638
638
|
* @internal
|
|
639
639
|
*/
|
|
640
|
-
|
|
641
|
-
var
|
|
642
|
-
S(this,
|
|
643
|
-
const r = new
|
|
644
|
-
(
|
|
640
|
+
Ne = function(e, n) {
|
|
641
|
+
var t;
|
|
642
|
+
S(this, J) !== this.CLOSED && L(this, J, this.CLOSED);
|
|
643
|
+
const r = new It("error", { code: n, message: e });
|
|
644
|
+
(t = S(this, ye)) == null || t.call(this, r), this.dispatchEvent(r);
|
|
645
645
|
}, /**
|
|
646
646
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
647
647
|
*
|
|
@@ -649,40 +649,40 @@ xe = function(e, t) {
|
|
|
649
649
|
* @param code - The HTTP status code, if available
|
|
650
650
|
* @internal
|
|
651
651
|
*/
|
|
652
|
-
|
|
653
|
-
var
|
|
654
|
-
if (S(this,
|
|
652
|
+
lt = function(e, n) {
|
|
653
|
+
var t;
|
|
654
|
+
if (S(this, J) === this.CLOSED)
|
|
655
655
|
return;
|
|
656
|
-
L(this,
|
|
657
|
-
const r = new
|
|
658
|
-
(
|
|
659
|
-
},
|
|
656
|
+
L(this, J, this.CONNECTING);
|
|
657
|
+
const r = new It("error", { code: n, message: e });
|
|
658
|
+
(t = S(this, ye)) == null || t.call(this, r), this.dispatchEvent(r), L(this, we, setTimeout(S(this, ft), S(this, xe)));
|
|
659
|
+
}, ft = /* @__PURE__ */ new WeakMap(), /**
|
|
660
660
|
* ReadyState representing an EventSource currently trying to connect
|
|
661
661
|
*
|
|
662
662
|
* @public
|
|
663
663
|
*/
|
|
664
|
-
|
|
664
|
+
Ie.CONNECTING = 0, /**
|
|
665
665
|
* ReadyState representing an EventSource connection that is open (eg connected)
|
|
666
666
|
*
|
|
667
667
|
* @public
|
|
668
668
|
*/
|
|
669
|
-
|
|
669
|
+
Ie.OPEN = 1, /**
|
|
670
670
|
* ReadyState representing an EventSource connection that is closed (eg disconnected)
|
|
671
671
|
*
|
|
672
672
|
* @public
|
|
673
673
|
*/
|
|
674
|
-
|
|
675
|
-
function
|
|
674
|
+
Ie.CLOSED = 2;
|
|
675
|
+
function Tn() {
|
|
676
676
|
const e = "document" in globalThis ? globalThis.document : void 0;
|
|
677
677
|
return e && typeof e == "object" && "baseURI" in e && typeof e.baseURI == "string" ? e.baseURI : void 0;
|
|
678
678
|
}
|
|
679
|
-
const
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
for (let
|
|
683
|
-
|
|
684
|
-
return btoa(
|
|
685
|
-
},
|
|
679
|
+
const Cn = (e) => {
|
|
680
|
+
let n = "";
|
|
681
|
+
const t = new Uint8Array(e), r = t.byteLength;
|
|
682
|
+
for (let o = 0; o < r; o++)
|
|
683
|
+
n += String.fromCharCode(t[o]);
|
|
684
|
+
return btoa(n);
|
|
685
|
+
}, wt = {
|
|
686
686
|
status: "idle",
|
|
687
687
|
error: null,
|
|
688
688
|
result: null,
|
|
@@ -693,285 +693,362 @@ const bn = (e) => {
|
|
|
693
693
|
uploadAssets: { status: "pending" }
|
|
694
694
|
},
|
|
695
695
|
jobSessionId: null,
|
|
696
|
-
jobStatus: {}
|
|
697
|
-
|
|
696
|
+
jobStatus: {},
|
|
697
|
+
jobType: null
|
|
698
|
+
}, Mt = 10, Xt = (e) => "path" in e ? {
|
|
698
699
|
filePath: e.path.replace(/^\//, ""),
|
|
699
700
|
referencePath: e.path === "/" ? "" : e.path
|
|
700
701
|
// Workaround to avoid duplicated slashes in the URL. Ideally, the fix should be done in Codegen.
|
|
701
702
|
} : {
|
|
702
703
|
filePath: e.filePath.replace(/^\//, ""),
|
|
703
704
|
referencePath: e.referencePath === "/" ? "" : e.referencePath
|
|
704
|
-
}, Zt = (
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
)
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
})
|
|
724
|
-
}), d = new Promise((E, h) => {
|
|
725
|
-
const p = {};
|
|
726
|
-
l.addEventListener("start", (f) => {
|
|
727
|
-
const o = JSON.parse(f.data);
|
|
728
|
-
p.sessionId = o.sessionId, s.tasks.fetchDesign.status = "running", s.jobSessionId = o.sessionId, r(D({}, s));
|
|
729
|
-
}), l.addEventListener("queueing", (f) => {
|
|
730
|
-
const o = JSON.parse(f.data);
|
|
731
|
-
s.jobSessionId = o.payload.sessionId, r(D({}, s));
|
|
732
|
-
}), l.addEventListener("pre_codegen", (f) => {
|
|
705
|
+
}, Zt = ({
|
|
706
|
+
es: e,
|
|
707
|
+
lastFetchResponse: n,
|
|
708
|
+
stateUpdated: t
|
|
709
|
+
}) => {
|
|
710
|
+
const r = structuredClone(wt);
|
|
711
|
+
return r.status = "pending", t(k({}, r)), new Promise((o, u) => {
|
|
712
|
+
const a = {};
|
|
713
|
+
e.addEventListener("set_job_type", (s) => {
|
|
714
|
+
const i = JSON.parse(
|
|
715
|
+
s.data
|
|
716
|
+
);
|
|
717
|
+
r.jobType = i.payload.jobType, t(k({}, r));
|
|
718
|
+
}), e.addEventListener("start", (s) => {
|
|
719
|
+
const i = JSON.parse(s.data);
|
|
720
|
+
a.sessionId = i.sessionId, r.tasks.fetchDesign.status = "running", r.jobSessionId = i.sessionId, t(k({}, r));
|
|
721
|
+
}), e.addEventListener("queueing", (s) => {
|
|
722
|
+
const i = JSON.parse(s.data);
|
|
723
|
+
r.jobSessionId = i.payload.sessionId, t(k({}, r));
|
|
724
|
+
}), e.addEventListener("pre_codegen", (s) => {
|
|
733
725
|
JSON.parse(
|
|
734
|
-
|
|
735
|
-
).message === "Anima model built" && (
|
|
736
|
-
}),
|
|
737
|
-
const
|
|
738
|
-
|
|
726
|
+
s.data
|
|
727
|
+
).message === "Anima model built" && (r.tasks.fetchDesign.status = "finished", r.tasks.codeGeneration.status = "running", r.tasks.uploadAssets.status = "running", t(k({}, r)));
|
|
728
|
+
}), e.addEventListener("figma_metadata", (s) => {
|
|
729
|
+
const i = JSON.parse(
|
|
730
|
+
s.data
|
|
739
731
|
);
|
|
740
|
-
|
|
741
|
-
}),
|
|
742
|
-
const
|
|
743
|
-
|
|
732
|
+
a.figmaFileName = i.figmaFileName, a.figmaSelectedFrameName = i.figmaSelectedFrameName;
|
|
733
|
+
}), e.addEventListener("aborted", () => {
|
|
734
|
+
const s = new Be({ name: "Aborted", reason: "Unknown" });
|
|
735
|
+
r.status = "aborted", r.result = null, r.error = s, t(k({}, r)), o({
|
|
744
736
|
result: null,
|
|
745
|
-
error:
|
|
737
|
+
error: s
|
|
746
738
|
});
|
|
747
|
-
}),
|
|
748
|
-
const
|
|
749
|
-
|
|
739
|
+
}), e.addEventListener("generating_code", (s) => {
|
|
740
|
+
const i = JSON.parse(
|
|
741
|
+
s.data
|
|
750
742
|
);
|
|
751
|
-
|
|
752
|
-
}),
|
|
753
|
-
const
|
|
754
|
-
|
|
743
|
+
i.payload.status === "success" && (a.files = i.payload.files), r.tasks.codeGeneration.progress = i.payload.progress, r.tasks.codeGeneration.status = "running", t(k({}, r));
|
|
744
|
+
}), e.addEventListener("progress_messages_updated", (s) => {
|
|
745
|
+
const i = JSON.parse(
|
|
746
|
+
s.data
|
|
755
747
|
);
|
|
756
|
-
|
|
757
|
-
}),
|
|
758
|
-
const
|
|
759
|
-
|
|
748
|
+
r.progressMessages = i.payload.progressMessages, t(k({}, r));
|
|
749
|
+
}), e.addEventListener("job_status_updated", (s) => {
|
|
750
|
+
const i = JSON.parse(
|
|
751
|
+
s.data
|
|
760
752
|
);
|
|
761
|
-
|
|
762
|
-
}),
|
|
763
|
-
|
|
764
|
-
}),
|
|
765
|
-
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
}),
|
|
769
|
-
const
|
|
770
|
-
|
|
753
|
+
r.jobStatus = i.payload.jobStatus, t(k({}, r));
|
|
754
|
+
}), e.addEventListener("codegen_completed", () => {
|
|
755
|
+
r.tasks.codeGeneration.status = "finished", t(k({}, r));
|
|
756
|
+
}), e.addEventListener("generation_completed", () => {
|
|
757
|
+
r.tasks.codeGeneration.status = "finished", t(k({}, r));
|
|
758
|
+
}), e.addEventListener("assets_uploaded", () => {
|
|
759
|
+
r.tasks.uploadAssets.status = "finished", t(k({}, r));
|
|
760
|
+
}), e.addEventListener("assets_list", (s) => {
|
|
761
|
+
const i = JSON.parse(
|
|
762
|
+
s.data
|
|
771
763
|
);
|
|
772
|
-
|
|
764
|
+
a.assets = i.payload.assets;
|
|
773
765
|
});
|
|
774
|
-
let
|
|
775
|
-
|
|
776
|
-
var
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
766
|
+
let l = 0;
|
|
767
|
+
e.addEventListener("error", (s) => H(null, null, function* () {
|
|
768
|
+
var E, d, g, f, w, O, M;
|
|
769
|
+
if (!n)
|
|
770
|
+
return;
|
|
771
|
+
const i = yield n;
|
|
772
|
+
if (!i.ok) {
|
|
773
|
+
let T = "";
|
|
780
774
|
try {
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
(
|
|
784
|
-
} catch (
|
|
775
|
+
T = yield i.text();
|
|
776
|
+
const I = JSON.parse(T);
|
|
777
|
+
(E = I == null ? void 0 : I.payload) != null && E.message && (T = I.payload.message);
|
|
778
|
+
} catch (I) {
|
|
785
779
|
}
|
|
786
|
-
|
|
787
|
-
new
|
|
780
|
+
u(
|
|
781
|
+
new Be({
|
|
788
782
|
name: "Request failed",
|
|
789
783
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
790
|
-
reason:
|
|
791
|
-
status:
|
|
784
|
+
reason: T,
|
|
785
|
+
status: i.status
|
|
792
786
|
})
|
|
793
|
-
),
|
|
787
|
+
), e.close();
|
|
794
788
|
return;
|
|
795
789
|
}
|
|
796
790
|
console.warn(
|
|
797
|
-
`Experienced error during code generation (attempt ${
|
|
798
|
-
|
|
791
|
+
`Experienced error during code generation (attempt ${l + 1} / ${Mt})`,
|
|
792
|
+
s
|
|
799
793
|
);
|
|
800
|
-
let
|
|
801
|
-
if (
|
|
794
|
+
let h, m = !1;
|
|
795
|
+
if (s instanceof MessageEvent)
|
|
802
796
|
try {
|
|
803
|
-
|
|
804
|
-
} catch (
|
|
797
|
+
h = JSON.parse(s.data);
|
|
798
|
+
} catch (T) {
|
|
805
799
|
}
|
|
806
|
-
(((
|
|
807
|
-
const
|
|
808
|
-
name: (
|
|
809
|
-
reason: (
|
|
810
|
-
status:
|
|
811
|
-
detail:
|
|
800
|
+
(((d = h == null ? void 0 : h.payload) == null ? void 0 : d.name) === "Task Crashed" || ((g = h == null ? void 0 : h.payload) == null ? void 0 : g.name) === "TimeoutError" || ((f = h == null ? void 0 : h.payload) == null ? void 0 : f.name) === "Error" || ((w = h == null ? void 0 : h.payload) == null ? void 0 : w.name) === "Unknown error") && (m = !0);
|
|
801
|
+
const v = new Be({
|
|
802
|
+
name: (O = h == null ? void 0 : h.payload.name) != null ? O : "Unknown error",
|
|
803
|
+
reason: (M = h == null ? void 0 : h.payload.message) != null ? M : "Unknown",
|
|
804
|
+
status: h == null ? void 0 : h.payload.status,
|
|
805
|
+
detail: h == null ? void 0 : h.payload.detail
|
|
812
806
|
});
|
|
813
|
-
|
|
814
|
-
let
|
|
815
|
-
|
|
807
|
+
l++;
|
|
808
|
+
let p = !1;
|
|
809
|
+
l > Mt ? (console.error("Experienced too many errors, terminating request"), p = !0) : m && (console.error("Experienced unrecoverable error, terminating request"), p = !0), p && (r.status = "error", r.error = v, t(k({}, r)), o({
|
|
816
810
|
result: null,
|
|
817
|
-
error:
|
|
811
|
+
error: v
|
|
818
812
|
}));
|
|
819
|
-
})),
|
|
820
|
-
const
|
|
821
|
-
|
|
813
|
+
})), e.addEventListener("done", (s) => {
|
|
814
|
+
const i = JSON.parse(s.data);
|
|
815
|
+
a.tokenUsage = i.payload.tokenUsage, a.sessionId = i.payload.sessionId, r.status = "success", r.result = a, t(k({}, r)), o({ result: a, error: null });
|
|
822
816
|
});
|
|
823
817
|
});
|
|
818
|
+
}, Qt = (e, n, t, r) => H(null, null, function* () {
|
|
819
|
+
var l;
|
|
820
|
+
const o = structuredClone(t);
|
|
821
|
+
if (((l = t.assetsStorage) == null ? void 0 : l.strategy) === "local") {
|
|
822
|
+
const { referencePath: s } = Xt(
|
|
823
|
+
t.assetsStorage
|
|
824
|
+
);
|
|
825
|
+
t.assetsStorage = { strategy: "external", url: s };
|
|
826
|
+
}
|
|
827
|
+
let u;
|
|
828
|
+
const a = new Ie(e, {
|
|
829
|
+
fetch: (s, i) => (u = fetch(s, Ye(k({}, i), {
|
|
830
|
+
method: n,
|
|
831
|
+
body: JSON.stringify(t)
|
|
832
|
+
})), u)
|
|
833
|
+
});
|
|
824
834
|
try {
|
|
825
|
-
const { result:
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
835
|
+
const { result: s, error: i } = yield Zt({
|
|
836
|
+
es: a,
|
|
837
|
+
lastFetchResponse: u,
|
|
838
|
+
stateUpdated: r
|
|
839
|
+
});
|
|
840
|
+
if (i || !s)
|
|
841
|
+
return { result: null, error: i };
|
|
842
|
+
const h = structuredClone(s);
|
|
843
|
+
return en(h, o), { result: h, error: null };
|
|
844
|
+
} finally {
|
|
845
|
+
a.close();
|
|
846
|
+
}
|
|
847
|
+
}), An = (e, n, t) => H(null, null, function* () {
|
|
848
|
+
const r = structuredClone(n);
|
|
849
|
+
let o;
|
|
850
|
+
const u = new Ie(e, {
|
|
851
|
+
fetch: (a, l) => (o = fetch(a, Ye(k({}, l), {
|
|
852
|
+
method: "POST",
|
|
853
|
+
body: JSON.stringify(n)
|
|
854
|
+
})), o)
|
|
855
|
+
});
|
|
856
|
+
try {
|
|
857
|
+
const { result: a, error: l } = yield Zt({
|
|
858
|
+
es: u,
|
|
859
|
+
lastFetchResponse: o,
|
|
860
|
+
stateUpdated: t
|
|
861
|
+
});
|
|
862
|
+
if (l || !a)
|
|
863
|
+
return { result: null, error: l };
|
|
864
|
+
const s = structuredClone(a);
|
|
865
|
+
return en(s, r), { result: s, error: null };
|
|
866
|
+
} finally {
|
|
867
|
+
u.close();
|
|
868
|
+
}
|
|
869
|
+
}), en = (e, n) => H(null, null, function* () {
|
|
870
|
+
var t, r;
|
|
871
|
+
if (((t = n.assetsStorage) == null ? void 0 : t.strategy) === "local" && ((r = e.assets) != null && r.length)) {
|
|
872
|
+
const { filePath: o } = Xt(n.assetsStorage), u = e.assets.map(
|
|
873
|
+
(l) => H(null, null, function* () {
|
|
874
|
+
const i = yield (yield fetch(l.url)).arrayBuffer();
|
|
831
875
|
return {
|
|
832
|
-
assetName:
|
|
833
|
-
base64:
|
|
876
|
+
assetName: l.name,
|
|
877
|
+
base64: Cn(i)
|
|
878
|
+
};
|
|
879
|
+
})
|
|
880
|
+
), a = yield Promise.allSettled(u);
|
|
881
|
+
for (const l of a)
|
|
882
|
+
if (l.status === "fulfilled") {
|
|
883
|
+
const { assetName: s, base64: i } = l.value, h = o ? `${o}/${s}` : s;
|
|
884
|
+
e.files[h] = {
|
|
885
|
+
content: i,
|
|
886
|
+
isBinary: !0
|
|
834
887
|
};
|
|
835
|
-
})), o = yield Promise.allSettled(f);
|
|
836
|
-
for (const g of o) {
|
|
837
|
-
const k = {};
|
|
838
|
-
if (g.status === "fulfilled") {
|
|
839
|
-
const { assetName: N, base64: T } = g.value;
|
|
840
|
-
k[N] = T;
|
|
841
|
-
const F = c ? `${c}/${N}` : N;
|
|
842
|
-
p.files[F] = {
|
|
843
|
-
content: T,
|
|
844
|
-
isBinary: !0
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
888
|
}
|
|
848
|
-
}
|
|
849
|
-
return h ? { result: null, error: h } : { result: p, error: h };
|
|
850
|
-
} finally {
|
|
851
|
-
l.close();
|
|
852
889
|
}
|
|
853
890
|
});
|
|
854
|
-
class
|
|
855
|
-
constructor(
|
|
856
|
-
super(
|
|
891
|
+
class Ln extends Error {
|
|
892
|
+
constructor(n, t) {
|
|
893
|
+
super(n), this.name = "CreateJobError", this.cause = t;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
class Nn extends Error {
|
|
897
|
+
constructor(n, t) {
|
|
898
|
+
super(n), this.name = "AttachJobError", this.cause = t;
|
|
857
899
|
}
|
|
858
900
|
}
|
|
859
|
-
class
|
|
901
|
+
class xn extends Error {
|
|
860
902
|
constructor() {
|
|
861
903
|
super(""), this.name = "UnknownCodegenError";
|
|
862
904
|
}
|
|
863
905
|
}
|
|
864
|
-
const
|
|
865
|
-
function
|
|
866
|
-
const [
|
|
867
|
-
f2c:
|
|
868
|
-
l2c:
|
|
906
|
+
const tn = Yt(null);
|
|
907
|
+
function gr({ figmaRestApi: e, f2cUrl: n, l2cUrl: t, p2cUrl: r, jobsUrl: o, children: u }) {
|
|
908
|
+
const [a, l] = rt({ status: "idle" }), s = ue(null), [i, h] = rt(wt), m = {
|
|
909
|
+
f2c: n,
|
|
910
|
+
l2c: t,
|
|
869
911
|
p2c: r
|
|
870
|
-
},
|
|
871
|
-
var
|
|
872
|
-
if (
|
|
912
|
+
}, v = (E, d) => H(null, null, function* () {
|
|
913
|
+
var g;
|
|
914
|
+
if (a.status === "pending")
|
|
873
915
|
throw new Error("A job is already in progress");
|
|
874
|
-
|
|
916
|
+
s.current = E;
|
|
875
917
|
try {
|
|
876
|
-
const
|
|
877
|
-
if (
|
|
878
|
-
const
|
|
879
|
-
|
|
918
|
+
const f = m[E], { result: w } = yield Qt(f, "POST", d, (O) => h(O));
|
|
919
|
+
if (w) {
|
|
920
|
+
const O = w.sessionId, M = w.files, T = w.assets;
|
|
921
|
+
l((I) => ({
|
|
880
922
|
status: "success",
|
|
881
923
|
type: E,
|
|
882
|
-
params: "params" in
|
|
883
|
-
sessionId:
|
|
884
|
-
payload:
|
|
885
|
-
assets:
|
|
886
|
-
files:
|
|
887
|
-
progressMessages:
|
|
924
|
+
params: "params" in I ? I.params : {},
|
|
925
|
+
sessionId: O,
|
|
926
|
+
payload: i.jobStatus,
|
|
927
|
+
assets: T,
|
|
928
|
+
files: M,
|
|
929
|
+
progressMessages: i.progressMessages
|
|
888
930
|
}));
|
|
889
931
|
return;
|
|
890
932
|
}
|
|
891
|
-
} catch (
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
throw
|
|
933
|
+
} catch (f) {
|
|
934
|
+
s.current = null;
|
|
935
|
+
const w = f instanceof Error ? f.message : "Unknown error", O = new Ln(w, f);
|
|
936
|
+
throw l({
|
|
895
937
|
status: "error",
|
|
896
938
|
type: E,
|
|
897
|
-
params:
|
|
898
|
-
error:
|
|
899
|
-
sessionId: (
|
|
900
|
-
payload:
|
|
901
|
-
progressMessages:
|
|
902
|
-
}),
|
|
939
|
+
params: d,
|
|
940
|
+
error: O,
|
|
941
|
+
sessionId: (g = i.jobSessionId) != null ? g : null,
|
|
942
|
+
payload: i.jobStatus,
|
|
943
|
+
progressMessages: i.progressMessages
|
|
944
|
+
}), O;
|
|
945
|
+
}
|
|
946
|
+
}), p = (E, d) => H(null, null, function* () {
|
|
947
|
+
if (!o)
|
|
948
|
+
throw new Error("jobsUrl is required in order to attach to a job");
|
|
949
|
+
try {
|
|
950
|
+
const g = `${o}/${E}`, { result: f } = yield An(
|
|
951
|
+
g,
|
|
952
|
+
d,
|
|
953
|
+
(w) => h(w)
|
|
954
|
+
);
|
|
955
|
+
if (f) {
|
|
956
|
+
const w = f.files, O = f.assets;
|
|
957
|
+
l((M) => ({
|
|
958
|
+
status: "success",
|
|
959
|
+
type: i.jobType,
|
|
960
|
+
params: "params" in M ? M.params : {},
|
|
961
|
+
sessionId: E,
|
|
962
|
+
payload: i.jobStatus,
|
|
963
|
+
assets: O,
|
|
964
|
+
files: w,
|
|
965
|
+
progressMessages: i.progressMessages
|
|
966
|
+
}));
|
|
967
|
+
}
|
|
968
|
+
} catch (g) {
|
|
969
|
+
const f = g instanceof Error ? g.message : "Unknown error", w = new Nn(f, g);
|
|
970
|
+
throw l({
|
|
971
|
+
status: "error",
|
|
972
|
+
type: s.current,
|
|
973
|
+
params: {},
|
|
974
|
+
error: w,
|
|
975
|
+
sessionId: E,
|
|
976
|
+
payload: i.jobStatus,
|
|
977
|
+
progressMessages: i.progressMessages
|
|
978
|
+
}), w;
|
|
903
979
|
}
|
|
904
980
|
});
|
|
905
|
-
return
|
|
906
|
-
var
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
981
|
+
return Bt(() => {
|
|
982
|
+
var d, g;
|
|
983
|
+
const E = (d = s.current) != null ? d : i.jobType;
|
|
984
|
+
if (E) {
|
|
985
|
+
if (i.status === "error") {
|
|
986
|
+
const f = (g = i.error) != null ? g : new xn();
|
|
987
|
+
l((w) => {
|
|
988
|
+
var O;
|
|
989
|
+
return {
|
|
990
|
+
status: "error",
|
|
991
|
+
type: E,
|
|
992
|
+
params: "params" in w ? w.params : {},
|
|
993
|
+
error: f,
|
|
994
|
+
sessionId: (O = i.jobSessionId) != null ? O : null,
|
|
995
|
+
payload: i.jobStatus,
|
|
996
|
+
progressMessages: i.progressMessages
|
|
997
|
+
};
|
|
998
|
+
});
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
if (i.status === "pending") {
|
|
1002
|
+
l((f) => ({
|
|
1003
|
+
status: "pending",
|
|
916
1004
|
type: E,
|
|
917
|
-
params: "params" in
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
}
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
if (d.status === "pending") {
|
|
927
|
-
u((p) => ({
|
|
928
|
-
status: "pending",
|
|
929
|
-
type: E,
|
|
930
|
-
params: "params" in p ? p.params : {},
|
|
931
|
-
sessionId: d.jobSessionId,
|
|
932
|
-
payload: d.jobStatus,
|
|
933
|
-
progressMessages: d.progressMessages
|
|
934
|
-
}));
|
|
935
|
-
return;
|
|
1005
|
+
params: "params" in f ? f.params : {},
|
|
1006
|
+
sessionId: i.jobSessionId,
|
|
1007
|
+
payload: i.jobStatus,
|
|
1008
|
+
progressMessages: i.progressMessages
|
|
1009
|
+
}));
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
936
1012
|
}
|
|
937
|
-
}, [
|
|
938
|
-
|
|
1013
|
+
}, [i]), /* @__PURE__ */ yn.jsx(
|
|
1014
|
+
tn.Provider,
|
|
939
1015
|
{
|
|
940
1016
|
value: {
|
|
941
|
-
createJob:
|
|
942
|
-
|
|
1017
|
+
createJob: v,
|
|
1018
|
+
attachJob: p,
|
|
1019
|
+
job: a,
|
|
943
1020
|
figmaRestApi: e
|
|
944
1021
|
},
|
|
945
|
-
children:
|
|
1022
|
+
children: u
|
|
946
1023
|
}
|
|
947
1024
|
);
|
|
948
1025
|
}
|
|
949
|
-
function
|
|
950
|
-
const e =
|
|
1026
|
+
function kn() {
|
|
1027
|
+
const e = Ht(tn);
|
|
951
1028
|
if (!e)
|
|
952
1029
|
throw new Error("useAnimaSDK must be used within AnimaSDKProvider");
|
|
953
1030
|
return e;
|
|
954
1031
|
}
|
|
955
|
-
const
|
|
1032
|
+
const vr = ({
|
|
956
1033
|
url: e,
|
|
957
|
-
method:
|
|
1034
|
+
method: n = "POST"
|
|
958
1035
|
}) => {
|
|
959
|
-
const [
|
|
1036
|
+
const [t, r] = rt(wt);
|
|
960
1037
|
return {
|
|
961
|
-
getCode:
|
|
962
|
-
(
|
|
963
|
-
[e,
|
|
1038
|
+
getCode: $e(
|
|
1039
|
+
(u) => Qt(e, n, u, r),
|
|
1040
|
+
[e, n]
|
|
964
1041
|
),
|
|
965
|
-
status:
|
|
966
|
-
progressMessages:
|
|
967
|
-
jobSessionId:
|
|
968
|
-
jobStatus:
|
|
969
|
-
tasks:
|
|
970
|
-
error:
|
|
971
|
-
result:
|
|
1042
|
+
status: t.status,
|
|
1043
|
+
progressMessages: t.progressMessages,
|
|
1044
|
+
jobSessionId: t.jobSessionId,
|
|
1045
|
+
jobStatus: t.jobStatus,
|
|
1046
|
+
tasks: t.tasks,
|
|
1047
|
+
error: t.error,
|
|
1048
|
+
result: t.result
|
|
972
1049
|
};
|
|
973
1050
|
};
|
|
974
|
-
var
|
|
1051
|
+
var We = { exports: {} }, ze = {};
|
|
975
1052
|
/**
|
|
976
1053
|
* @license React
|
|
977
1054
|
* use-sync-external-store-shim.production.js
|
|
@@ -981,48 +1058,48 @@ var Me = { exports: {} }, He = {};
|
|
|
981
1058
|
* This source code is licensed under the MIT license found in the
|
|
982
1059
|
* LICENSE file in the root directory of this source tree.
|
|
983
1060
|
*/
|
|
984
|
-
var
|
|
985
|
-
function
|
|
986
|
-
if (
|
|
987
|
-
|
|
988
|
-
var e =
|
|
989
|
-
function
|
|
990
|
-
return m ===
|
|
1061
|
+
var Pt;
|
|
1062
|
+
function In() {
|
|
1063
|
+
if (Pt) return ze;
|
|
1064
|
+
Pt = 1;
|
|
1065
|
+
var e = be;
|
|
1066
|
+
function n(m, v) {
|
|
1067
|
+
return m === v && (m !== 0 || 1 / m === 1 / v) || m !== m && v !== v;
|
|
991
1068
|
}
|
|
992
|
-
var
|
|
993
|
-
function l(m,
|
|
994
|
-
var
|
|
995
|
-
return
|
|
1069
|
+
var t = typeof Object.is == "function" ? Object.is : n, r = e.useState, o = e.useEffect, u = e.useLayoutEffect, a = e.useDebugValue;
|
|
1070
|
+
function l(m, v) {
|
|
1071
|
+
var p = v(), E = r({ inst: { value: p, getSnapshot: v } }), d = E[0].inst, g = E[1];
|
|
1072
|
+
return u(
|
|
996
1073
|
function() {
|
|
997
|
-
|
|
1074
|
+
d.value = p, d.getSnapshot = v, s(d) && g({ inst: d });
|
|
998
1075
|
},
|
|
999
|
-
[m,
|
|
1000
|
-
),
|
|
1076
|
+
[m, p, v]
|
|
1077
|
+
), o(
|
|
1001
1078
|
function() {
|
|
1002
|
-
return d
|
|
1003
|
-
d
|
|
1079
|
+
return s(d) && g({ inst: d }), m(function() {
|
|
1080
|
+
s(d) && g({ inst: d });
|
|
1004
1081
|
});
|
|
1005
1082
|
},
|
|
1006
1083
|
[m]
|
|
1007
|
-
),
|
|
1084
|
+
), a(p), p;
|
|
1008
1085
|
}
|
|
1009
|
-
function
|
|
1010
|
-
var
|
|
1086
|
+
function s(m) {
|
|
1087
|
+
var v = m.getSnapshot;
|
|
1011
1088
|
m = m.value;
|
|
1012
1089
|
try {
|
|
1013
|
-
var
|
|
1014
|
-
return !
|
|
1015
|
-
} catch (
|
|
1090
|
+
var p = v();
|
|
1091
|
+
return !t(m, p);
|
|
1092
|
+
} catch (E) {
|
|
1016
1093
|
return !0;
|
|
1017
1094
|
}
|
|
1018
1095
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1096
|
+
function i(m, v) {
|
|
1097
|
+
return v();
|
|
1021
1098
|
}
|
|
1022
|
-
var
|
|
1023
|
-
return
|
|
1099
|
+
var h = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? i : l;
|
|
1100
|
+
return ze.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, ze;
|
|
1024
1101
|
}
|
|
1025
|
-
var
|
|
1102
|
+
var Ke = {};
|
|
1026
1103
|
/**
|
|
1027
1104
|
* @license React
|
|
1028
1105
|
* use-sync-external-store-shim.development.js
|
|
@@ -1032,251 +1109,251 @@ var ze = {};
|
|
|
1032
1109
|
* This source code is licensed under the MIT license found in the
|
|
1033
1110
|
* LICENSE file in the root directory of this source tree.
|
|
1034
1111
|
*/
|
|
1035
|
-
var
|
|
1036
|
-
function
|
|
1037
|
-
return
|
|
1038
|
-
function e(
|
|
1039
|
-
return
|
|
1112
|
+
var Wt;
|
|
1113
|
+
function Dn() {
|
|
1114
|
+
return Wt || (Wt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1115
|
+
function e(p, E) {
|
|
1116
|
+
return p === E && (p !== 0 || 1 / p === 1 / E) || p !== p && E !== E;
|
|
1040
1117
|
}
|
|
1041
|
-
function
|
|
1042
|
-
|
|
1118
|
+
function n(p, E) {
|
|
1119
|
+
h || o.startTransition === void 0 || (h = !0, console.error(
|
|
1043
1120
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
1044
1121
|
));
|
|
1045
|
-
var
|
|
1122
|
+
var d = E();
|
|
1046
1123
|
if (!m) {
|
|
1047
|
-
var
|
|
1048
|
-
|
|
1124
|
+
var g = E();
|
|
1125
|
+
u(d, g) || (console.error(
|
|
1049
1126
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
1050
1127
|
), m = !0);
|
|
1051
1128
|
}
|
|
1052
|
-
|
|
1053
|
-
inst: { value:
|
|
1129
|
+
g = a({
|
|
1130
|
+
inst: { value: d, getSnapshot: E }
|
|
1054
1131
|
});
|
|
1055
|
-
var
|
|
1056
|
-
return
|
|
1132
|
+
var f = g[0].inst, w = g[1];
|
|
1133
|
+
return s(
|
|
1057
1134
|
function() {
|
|
1058
|
-
|
|
1135
|
+
f.value = d, f.getSnapshot = E, t(f) && w({ inst: f });
|
|
1059
1136
|
},
|
|
1060
|
-
[
|
|
1137
|
+
[p, d, E]
|
|
1061
1138
|
), l(
|
|
1062
1139
|
function() {
|
|
1063
|
-
return
|
|
1064
|
-
|
|
1140
|
+
return t(f) && w({ inst: f }), p(function() {
|
|
1141
|
+
t(f) && w({ inst: f });
|
|
1065
1142
|
});
|
|
1066
1143
|
},
|
|
1067
|
-
[
|
|
1068
|
-
),
|
|
1144
|
+
[p]
|
|
1145
|
+
), i(d), d;
|
|
1069
1146
|
}
|
|
1070
|
-
function
|
|
1071
|
-
var
|
|
1072
|
-
|
|
1147
|
+
function t(p) {
|
|
1148
|
+
var E = p.getSnapshot;
|
|
1149
|
+
p = p.value;
|
|
1073
1150
|
try {
|
|
1074
|
-
var
|
|
1075
|
-
return !
|
|
1076
|
-
} catch (
|
|
1151
|
+
var d = E();
|
|
1152
|
+
return !u(p, d);
|
|
1153
|
+
} catch (g) {
|
|
1077
1154
|
return !0;
|
|
1078
1155
|
}
|
|
1079
1156
|
}
|
|
1080
|
-
function r(
|
|
1081
|
-
return
|
|
1157
|
+
function r(p, E) {
|
|
1158
|
+
return E();
|
|
1082
1159
|
}
|
|
1083
1160
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
})()),
|
|
1161
|
+
var o = be, u = typeof Object.is == "function" ? Object.is : e, a = o.useState, l = o.useEffect, s = o.useLayoutEffect, i = o.useDebugValue, h = !1, m = !1, v = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? r : n;
|
|
1162
|
+
Ke.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1163
|
+
})()), Ke;
|
|
1087
1164
|
}
|
|
1088
|
-
var
|
|
1089
|
-
function
|
|
1090
|
-
return
|
|
1165
|
+
var Ft;
|
|
1166
|
+
function jn() {
|
|
1167
|
+
return Ft || (Ft = 1, process.env.NODE_ENV === "production" ? We.exports = In() : We.exports = Dn()), We.exports;
|
|
1091
1168
|
}
|
|
1092
|
-
var
|
|
1093
|
-
const
|
|
1094
|
-
var
|
|
1095
|
-
function
|
|
1096
|
-
var
|
|
1097
|
-
if (e ===
|
|
1098
|
-
if (e &&
|
|
1099
|
-
if (
|
|
1100
|
-
if (
|
|
1101
|
-
if (
|
|
1102
|
-
if ((r = e.length) ===
|
|
1103
|
-
for (; r-- &&
|
|
1169
|
+
var Mn = jn();
|
|
1170
|
+
const nn = 0, rn = 1, sn = 2, Vt = 3;
|
|
1171
|
+
var $t = Object.prototype.hasOwnProperty;
|
|
1172
|
+
function dt(e, n) {
|
|
1173
|
+
var t, r;
|
|
1174
|
+
if (e === n) return !0;
|
|
1175
|
+
if (e && n && (t = e.constructor) === n.constructor) {
|
|
1176
|
+
if (t === Date) return e.getTime() === n.getTime();
|
|
1177
|
+
if (t === RegExp) return e.toString() === n.toString();
|
|
1178
|
+
if (t === Array) {
|
|
1179
|
+
if ((r = e.length) === n.length)
|
|
1180
|
+
for (; r-- && dt(e[r], n[r]); ) ;
|
|
1104
1181
|
return r === -1;
|
|
1105
1182
|
}
|
|
1106
|
-
if (!
|
|
1183
|
+
if (!t || typeof e == "object") {
|
|
1107
1184
|
r = 0;
|
|
1108
|
-
for (
|
|
1109
|
-
if (
|
|
1110
|
-
return Object.keys(
|
|
1185
|
+
for (t in e)
|
|
1186
|
+
if ($t.call(e, t) && ++r && !$t.call(n, t) || !(t in n) || !dt(e[t], n[t])) return !1;
|
|
1187
|
+
return Object.keys(n).length === r;
|
|
1111
1188
|
}
|
|
1112
1189
|
}
|
|
1113
|
-
return e !== e &&
|
|
1190
|
+
return e !== e && n !== n;
|
|
1114
1191
|
}
|
|
1115
|
-
const
|
|
1192
|
+
const oe = /* @__PURE__ */ new WeakMap(), fe = () => {
|
|
1116
1193
|
}, V = (
|
|
1117
1194
|
/*#__NOINLINE__*/
|
|
1118
|
-
|
|
1119
|
-
),
|
|
1120
|
-
const
|
|
1195
|
+
fe()
|
|
1196
|
+
), ht = Object, y = (e) => e === V, Z = (e) => typeof e == "function", de = (e, n) => k(k({}, e), n), on = (e) => Z(e.then), Xe = {}, Fe = {}, yt = "undefined", je = typeof window != yt, pt = typeof document != yt, Pn = je && "Deno" in window, Wn = () => je && typeof window.requestAnimationFrame != yt, an = (e, n) => {
|
|
1197
|
+
const t = oe.get(e);
|
|
1121
1198
|
return [
|
|
1122
1199
|
// Getter
|
|
1123
|
-
() => !
|
|
1200
|
+
() => !y(n) && e.get(n) || Xe,
|
|
1124
1201
|
// Setter
|
|
1125
1202
|
(r) => {
|
|
1126
|
-
if (!
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1203
|
+
if (!y(n)) {
|
|
1204
|
+
const o = e.get(n);
|
|
1205
|
+
n in Fe || (Fe[n] = o), t[5](n, de(o, r), o || Xe);
|
|
1129
1206
|
}
|
|
1130
1207
|
},
|
|
1131
1208
|
// Subscriber
|
|
1132
|
-
|
|
1209
|
+
t[6],
|
|
1133
1210
|
// Get server cache snapshot
|
|
1134
|
-
() => !
|
|
1211
|
+
() => !y(n) && n in Fe ? Fe[n] : !y(n) && e.get(n) || Xe
|
|
1135
1212
|
];
|
|
1136
1213
|
};
|
|
1137
|
-
let
|
|
1138
|
-
const
|
|
1214
|
+
let Et = !0;
|
|
1215
|
+
const Fn = () => Et, [mt, gt] = je && window.addEventListener ? [
|
|
1139
1216
|
window.addEventListener.bind(window),
|
|
1140
1217
|
window.removeEventListener.bind(window)
|
|
1141
1218
|
] : [
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
],
|
|
1145
|
-
const e =
|
|
1146
|
-
return
|
|
1147
|
-
},
|
|
1148
|
-
|
|
1149
|
-
}),
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
},
|
|
1153
|
-
|
|
1219
|
+
fe,
|
|
1220
|
+
fe
|
|
1221
|
+
], Vn = () => {
|
|
1222
|
+
const e = pt && document.visibilityState;
|
|
1223
|
+
return y(e) || e !== "hidden";
|
|
1224
|
+
}, $n = (e) => (pt && document.addEventListener("visibilitychange", e), mt("focus", e), () => {
|
|
1225
|
+
pt && document.removeEventListener("visibilitychange", e), gt("focus", e);
|
|
1226
|
+
}), Un = (e) => {
|
|
1227
|
+
const n = () => {
|
|
1228
|
+
Et = !0, e();
|
|
1229
|
+
}, t = () => {
|
|
1230
|
+
Et = !1;
|
|
1154
1231
|
};
|
|
1155
|
-
return
|
|
1156
|
-
|
|
1232
|
+
return mt("online", n), mt("offline", t), () => {
|
|
1233
|
+
gt("online", n), gt("offline", t);
|
|
1157
1234
|
};
|
|
1158
|
-
},
|
|
1159
|
-
isOnline:
|
|
1160
|
-
isVisible:
|
|
1161
|
-
},
|
|
1162
|
-
initFocus:
|
|
1163
|
-
initReconnect:
|
|
1164
|
-
},
|
|
1235
|
+
}, Jn = {
|
|
1236
|
+
isOnline: Fn,
|
|
1237
|
+
isVisible: Vn
|
|
1238
|
+
}, qn = {
|
|
1239
|
+
initFocus: $n,
|
|
1240
|
+
initReconnect: Un
|
|
1241
|
+
}, Ut = !be.useId, De = !je || Pn, Gn = (e) => Wn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ze = De ? Bt : gn, Qe = typeof navigator != "undefined" && navigator.connection, Jt = !De && Qe && ([
|
|
1165
1242
|
"slow-2g",
|
|
1166
1243
|
"2g"
|
|
1167
|
-
].includes(
|
|
1168
|
-
let
|
|
1169
|
-
const
|
|
1170
|
-
const
|
|
1171
|
-
let
|
|
1172
|
-
if (
|
|
1173
|
-
if (
|
|
1174
|
-
if (
|
|
1175
|
-
for (
|
|
1176
|
-
|
|
1177
|
-
|
|
1244
|
+
].includes(Qe.effectiveType) || Qe.saveData), Ve = /* @__PURE__ */ new WeakMap(), Yn = (e) => ht.prototype.toString.call(e), et = (e, n) => e === `[object ${n}]`;
|
|
1245
|
+
let Bn = 0;
|
|
1246
|
+
const vt = (e) => {
|
|
1247
|
+
const n = typeof e, t = Yn(e), r = et(t, "Date"), o = et(t, "RegExp"), u = et(t, "Object");
|
|
1248
|
+
let a, l;
|
|
1249
|
+
if (ht(e) === e && !r && !o) {
|
|
1250
|
+
if (a = Ve.get(e), a) return a;
|
|
1251
|
+
if (a = ++Bn + "~", Ve.set(e, a), Array.isArray(e)) {
|
|
1252
|
+
for (a = "@", l = 0; l < e.length; l++)
|
|
1253
|
+
a += vt(e[l]) + ",";
|
|
1254
|
+
Ve.set(e, a);
|
|
1178
1255
|
}
|
|
1179
|
-
if (
|
|
1180
|
-
|
|
1181
|
-
const
|
|
1182
|
-
for (; !
|
|
1183
|
-
|
|
1184
|
-
|
|
1256
|
+
if (u) {
|
|
1257
|
+
a = "#";
|
|
1258
|
+
const s = ht.keys(e).sort();
|
|
1259
|
+
for (; !y(l = s.pop()); )
|
|
1260
|
+
y(e[l]) || (a += l + ":" + vt(e[l]) + ",");
|
|
1261
|
+
Ve.set(e, a);
|
|
1185
1262
|
}
|
|
1186
1263
|
} else
|
|
1187
|
-
|
|
1188
|
-
return
|
|
1189
|
-
},
|
|
1190
|
-
if (
|
|
1264
|
+
a = r ? e.toJSON() : n == "symbol" ? e.toString() : n == "string" ? JSON.stringify(e) : "" + e;
|
|
1265
|
+
return a;
|
|
1266
|
+
}, bt = (e) => {
|
|
1267
|
+
if (Z(e))
|
|
1191
1268
|
try {
|
|
1192
1269
|
e = e();
|
|
1193
|
-
} catch (
|
|
1270
|
+
} catch (t) {
|
|
1194
1271
|
e = "";
|
|
1195
1272
|
}
|
|
1196
|
-
const
|
|
1197
|
-
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ?
|
|
1273
|
+
const n = e;
|
|
1274
|
+
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? vt(e) : "", [
|
|
1198
1275
|
e,
|
|
1199
|
-
|
|
1276
|
+
n
|
|
1200
1277
|
];
|
|
1201
1278
|
};
|
|
1202
|
-
let
|
|
1203
|
-
const
|
|
1204
|
-
function
|
|
1205
|
-
return
|
|
1206
|
-
const [
|
|
1279
|
+
let Hn = 0;
|
|
1280
|
+
const _t = () => ++Hn;
|
|
1281
|
+
function cn(...e) {
|
|
1282
|
+
return H(this, null, function* () {
|
|
1283
|
+
const [n, t, r, o] = e, u = de({
|
|
1207
1284
|
populateCache: !0,
|
|
1208
1285
|
throwOnError: !0
|
|
1209
|
-
}, typeof
|
|
1210
|
-
revalidate:
|
|
1211
|
-
} :
|
|
1212
|
-
let
|
|
1213
|
-
const l =
|
|
1214
|
-
let
|
|
1215
|
-
const
|
|
1216
|
-
if (
|
|
1217
|
-
const
|
|
1218
|
-
for (const
|
|
1286
|
+
}, typeof o == "boolean" ? {
|
|
1287
|
+
revalidate: o
|
|
1288
|
+
} : o || {});
|
|
1289
|
+
let a = u.populateCache;
|
|
1290
|
+
const l = u.rollbackOnError;
|
|
1291
|
+
let s = u.optimisticData;
|
|
1292
|
+
const i = (v) => typeof l == "function" ? l(v) : l !== !1, h = u.throwOnError;
|
|
1293
|
+
if (Z(t)) {
|
|
1294
|
+
const v = t, p = [], E = n.keys();
|
|
1295
|
+
for (const d of E)
|
|
1219
1296
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
1220
|
-
!/^\$(inf|sub)\$/.test(
|
|
1221
|
-
return Promise.all(
|
|
1297
|
+
!/^\$(inf|sub)\$/.test(d) && v(n.get(d)._k) && p.push(d);
|
|
1298
|
+
return Promise.all(p.map(m));
|
|
1222
1299
|
}
|
|
1223
|
-
return m(
|
|
1224
|
-
function m(
|
|
1225
|
-
return
|
|
1226
|
-
const [
|
|
1227
|
-
if (!
|
|
1228
|
-
const [
|
|
1229
|
-
const
|
|
1230
|
-
return (
|
|
1300
|
+
return m(t);
|
|
1301
|
+
function m(v) {
|
|
1302
|
+
return H(this, null, function* () {
|
|
1303
|
+
const [p] = bt(v);
|
|
1304
|
+
if (!p) return;
|
|
1305
|
+
const [E, d] = an(n, p), [g, f, w, O] = oe.get(n), M = () => {
|
|
1306
|
+
const D = g[p];
|
|
1307
|
+
return (Z(u.revalidate) ? u.revalidate(E().data, v) : u.revalidate !== !1) && (delete w[p], delete O[p], D && D[0]) ? D[0](sn).then(() => E().data) : E().data;
|
|
1231
1308
|
};
|
|
1232
1309
|
if (e.length < 3)
|
|
1233
|
-
return
|
|
1234
|
-
let T = r,
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1237
|
-
|
|
1310
|
+
return M();
|
|
1311
|
+
let T = r, I, q = !1;
|
|
1312
|
+
const C = _t();
|
|
1313
|
+
f[p] = [
|
|
1314
|
+
C,
|
|
1238
1315
|
0
|
|
1239
1316
|
];
|
|
1240
|
-
const
|
|
1241
|
-
if (
|
|
1242
|
-
data:
|
|
1243
|
-
_c:
|
|
1244
|
-
})),
|
|
1317
|
+
const ae = !y(s), G = E(), X = G.data, he = G._c, Q = y(he) ? X : he;
|
|
1318
|
+
if (ae && (s = Z(s) ? s(Q, X) : s, d({
|
|
1319
|
+
data: s,
|
|
1320
|
+
_c: Q
|
|
1321
|
+
})), Z(T))
|
|
1245
1322
|
try {
|
|
1246
|
-
T = T(
|
|
1247
|
-
} catch (
|
|
1248
|
-
|
|
1323
|
+
T = T(Q);
|
|
1324
|
+
} catch (D) {
|
|
1325
|
+
I = D, q = !0;
|
|
1249
1326
|
}
|
|
1250
|
-
if (T &&
|
|
1251
|
-
if (T = yield T.catch((
|
|
1252
|
-
|
|
1253
|
-
}),
|
|
1254
|
-
if (
|
|
1327
|
+
if (T && on(T))
|
|
1328
|
+
if (T = yield T.catch((D) => {
|
|
1329
|
+
I = D, q = !0;
|
|
1330
|
+
}), C !== f[p][0]) {
|
|
1331
|
+
if (q) throw I;
|
|
1255
1332
|
return T;
|
|
1256
|
-
} else
|
|
1257
|
-
data:
|
|
1333
|
+
} else q && ae && i(I) && (a = !0, d({
|
|
1334
|
+
data: Q,
|
|
1258
1335
|
_c: V
|
|
1259
1336
|
}));
|
|
1260
|
-
if (
|
|
1261
|
-
if (
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
data:
|
|
1337
|
+
if (a && !q)
|
|
1338
|
+
if (Z(a)) {
|
|
1339
|
+
const D = a(T, Q);
|
|
1340
|
+
d({
|
|
1341
|
+
data: D,
|
|
1265
1342
|
error: V,
|
|
1266
1343
|
_c: V
|
|
1267
1344
|
});
|
|
1268
1345
|
} else
|
|
1269
|
-
|
|
1346
|
+
d({
|
|
1270
1347
|
data: T,
|
|
1271
1348
|
error: V,
|
|
1272
1349
|
_c: V
|
|
1273
1350
|
});
|
|
1274
|
-
if (
|
|
1275
|
-
|
|
1351
|
+
if (f[p][1] = _t(), Promise.resolve(M()).then(() => {
|
|
1352
|
+
d({
|
|
1276
1353
|
_c: V
|
|
1277
1354
|
});
|
|
1278
|
-
}),
|
|
1279
|
-
if (
|
|
1355
|
+
}), q) {
|
|
1356
|
+
if (h) throw I;
|
|
1280
1357
|
return;
|
|
1281
1358
|
}
|
|
1282
1359
|
return T;
|
|
@@ -1284,89 +1361,89 @@ function on(...e) {
|
|
|
1284
1361
|
}
|
|
1285
1362
|
});
|
|
1286
1363
|
}
|
|
1287
|
-
const
|
|
1288
|
-
for (const
|
|
1289
|
-
e[
|
|
1290
|
-
},
|
|
1291
|
-
if (!
|
|
1292
|
-
const
|
|
1293
|
-
let
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
return
|
|
1297
|
-
},
|
|
1298
|
-
e.set(
|
|
1299
|
-
const
|
|
1300
|
-
if (
|
|
1301
|
-
for (const
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1304
|
-
if (!
|
|
1364
|
+
const qt = (e, n) => {
|
|
1365
|
+
for (const t in e)
|
|
1366
|
+
e[t][0] && e[t][0](n);
|
|
1367
|
+
}, zn = (e, n) => {
|
|
1368
|
+
if (!oe.has(e)) {
|
|
1369
|
+
const t = de(qn, n), r = /* @__PURE__ */ Object.create(null), o = cn.bind(V, e);
|
|
1370
|
+
let u = fe;
|
|
1371
|
+
const a = /* @__PURE__ */ Object.create(null), l = (h, m) => {
|
|
1372
|
+
const v = a[h] || [];
|
|
1373
|
+
return a[h] = v, v.push(m), () => v.splice(v.indexOf(m), 1);
|
|
1374
|
+
}, s = (h, m, v) => {
|
|
1375
|
+
e.set(h, m);
|
|
1376
|
+
const p = a[h];
|
|
1377
|
+
if (p)
|
|
1378
|
+
for (const E of p)
|
|
1379
|
+
E(m, v);
|
|
1380
|
+
}, i = () => {
|
|
1381
|
+
if (!oe.has(e) && (oe.set(e, [
|
|
1305
1382
|
r,
|
|
1306
1383
|
/* @__PURE__ */ Object.create(null),
|
|
1307
1384
|
/* @__PURE__ */ Object.create(null),
|
|
1308
1385
|
/* @__PURE__ */ Object.create(null),
|
|
1386
|
+
o,
|
|
1309
1387
|
s,
|
|
1310
|
-
d,
|
|
1311
1388
|
l
|
|
1312
|
-
]), !
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
|
|
1389
|
+
]), !De)) {
|
|
1390
|
+
const h = t.initFocus(setTimeout.bind(V, qt.bind(V, r, nn))), m = t.initReconnect(setTimeout.bind(V, qt.bind(V, r, rn)));
|
|
1391
|
+
u = () => {
|
|
1392
|
+
h && h(), m && m(), oe.delete(e);
|
|
1316
1393
|
};
|
|
1317
1394
|
}
|
|
1318
1395
|
};
|
|
1319
|
-
return
|
|
1396
|
+
return i(), [
|
|
1320
1397
|
e,
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1398
|
+
o,
|
|
1399
|
+
i,
|
|
1400
|
+
u
|
|
1324
1401
|
];
|
|
1325
1402
|
}
|
|
1326
1403
|
return [
|
|
1327
1404
|
e,
|
|
1328
|
-
|
|
1405
|
+
oe.get(e)[4]
|
|
1329
1406
|
];
|
|
1330
|
-
},
|
|
1331
|
-
const
|
|
1332
|
-
!
|
|
1333
|
-
},
|
|
1407
|
+
}, Kn = (e, n, t, r, o) => {
|
|
1408
|
+
const u = t.errorRetryCount, a = o.retryCount, l = ~~((Math.random() + 0.5) * (1 << (a < 8 ? a : 8))) * t.errorRetryInterval;
|
|
1409
|
+
!y(u) && a > u || setTimeout(r, l, o);
|
|
1410
|
+
}, Xn = dt, [un, Zn] = zn(/* @__PURE__ */ new Map()), Qn = de(
|
|
1334
1411
|
{
|
|
1335
1412
|
// events
|
|
1336
|
-
onLoadingSlow:
|
|
1337
|
-
onSuccess:
|
|
1338
|
-
onError:
|
|
1339
|
-
onErrorRetry:
|
|
1340
|
-
onDiscarded:
|
|
1413
|
+
onLoadingSlow: fe,
|
|
1414
|
+
onSuccess: fe,
|
|
1415
|
+
onError: fe,
|
|
1416
|
+
onErrorRetry: Kn,
|
|
1417
|
+
onDiscarded: fe,
|
|
1341
1418
|
// switches
|
|
1342
1419
|
revalidateOnFocus: !0,
|
|
1343
1420
|
revalidateOnReconnect: !0,
|
|
1344
1421
|
revalidateIfStale: !0,
|
|
1345
1422
|
shouldRetryOnError: !0,
|
|
1346
1423
|
// timeouts
|
|
1347
|
-
errorRetryInterval:
|
|
1424
|
+
errorRetryInterval: Jt ? 1e4 : 5e3,
|
|
1348
1425
|
focusThrottleInterval: 5 * 1e3,
|
|
1349
1426
|
dedupingInterval: 2 * 1e3,
|
|
1350
|
-
loadingTimeout:
|
|
1427
|
+
loadingTimeout: Jt ? 5e3 : 3e3,
|
|
1351
1428
|
// providers
|
|
1352
|
-
compare:
|
|
1429
|
+
compare: Xn,
|
|
1353
1430
|
isPaused: () => !1,
|
|
1354
|
-
cache:
|
|
1355
|
-
mutate:
|
|
1431
|
+
cache: un,
|
|
1432
|
+
mutate: Zn,
|
|
1356
1433
|
fallback: {}
|
|
1357
1434
|
},
|
|
1358
1435
|
// use web preset by default
|
|
1359
|
-
|
|
1360
|
-
),
|
|
1361
|
-
const
|
|
1362
|
-
if (
|
|
1363
|
-
const { use: r, fallback:
|
|
1364
|
-
r &&
|
|
1436
|
+
Jn
|
|
1437
|
+
), er = (e, n) => {
|
|
1438
|
+
const t = de(e, n);
|
|
1439
|
+
if (n) {
|
|
1440
|
+
const { use: r, fallback: o } = e, { use: u, fallback: a } = n;
|
|
1441
|
+
r && u && (t.use = r.concat(u)), o && a && (t.fallback = de(o, a));
|
|
1365
1442
|
}
|
|
1366
|
-
return
|
|
1367
|
-
},
|
|
1368
|
-
|
|
1369
|
-
},
|
|
1443
|
+
return t;
|
|
1444
|
+
}, tr = Yt({}), nr = "$inf$", ln = je && window.__SWR_DEVTOOLS_USE__, rr = ln ? window.__SWR_DEVTOOLS_USE__ : [], sr = () => {
|
|
1445
|
+
ln && (window.__SWR_DEVTOOLS_REACT__ = be);
|
|
1446
|
+
}, or = (e) => Z(e[1]) ? [
|
|
1370
1447
|
e[0],
|
|
1371
1448
|
e[1],
|
|
1372
1449
|
e[2] || {}
|
|
@@ -1374,33 +1451,33 @@ const Jt = (e, t) => {
|
|
|
1374
1451
|
e[0],
|
|
1375
1452
|
null,
|
|
1376
1453
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
1377
|
-
],
|
|
1378
|
-
const e =
|
|
1379
|
-
return
|
|
1454
|
+
], ar = () => {
|
|
1455
|
+
const e = Ht(tr);
|
|
1456
|
+
return zt(() => de(Qn, e), [
|
|
1380
1457
|
e
|
|
1381
1458
|
]);
|
|
1382
|
-
},
|
|
1383
|
-
const [
|
|
1384
|
-
if (
|
|
1385
|
-
return
|
|
1386
|
-
const
|
|
1387
|
-
return
|
|
1388
|
-
}), r),
|
|
1389
|
-
const r =
|
|
1390
|
-
let
|
|
1391
|
-
const { use:
|
|
1392
|
-
for (let m =
|
|
1393
|
-
|
|
1394
|
-
return
|
|
1395
|
-
},
|
|
1396
|
-
const r =
|
|
1397
|
-
return r.push(
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1459
|
+
}, ir = (e) => (n, t, r) => e(n, t && ((...u) => {
|
|
1460
|
+
const [a] = bt(n), [, , , l] = oe.get(un);
|
|
1461
|
+
if (a.startsWith(nr))
|
|
1462
|
+
return t(...u);
|
|
1463
|
+
const s = l[a];
|
|
1464
|
+
return y(s) ? t(...u) : (delete l[a], s);
|
|
1465
|
+
}), r), cr = rr.concat(ir), ur = (e) => function(...t) {
|
|
1466
|
+
const r = ar(), [o, u, a] = or(t), l = er(r, a);
|
|
1467
|
+
let s = e;
|
|
1468
|
+
const { use: i } = l, h = (i || []).concat(cr);
|
|
1469
|
+
for (let m = h.length; m--; )
|
|
1470
|
+
s = h[m](s);
|
|
1471
|
+
return s(o, u || l.fetcher || null, l);
|
|
1472
|
+
}, lr = (e, n, t) => {
|
|
1473
|
+
const r = n[e] || (n[e] = []);
|
|
1474
|
+
return r.push(t), () => {
|
|
1475
|
+
const o = r.indexOf(t);
|
|
1476
|
+
o >= 0 && (r[o] = r[r.length - 1], r.pop());
|
|
1400
1477
|
};
|
|
1401
1478
|
};
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1479
|
+
sr();
|
|
1480
|
+
const tt = be.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
1404
1481
|
// and emitting an error.
|
|
1405
1482
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
1406
1483
|
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
|
|
@@ -1413,100 +1490,100 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1413
1490
|
case "rejected":
|
|
1414
1491
|
throw e.reason;
|
|
1415
1492
|
default:
|
|
1416
|
-
throw e.status = "pending", e.then((
|
|
1417
|
-
e.status = "fulfilled", e.value =
|
|
1418
|
-
}, (
|
|
1419
|
-
e.status = "rejected", e.reason =
|
|
1493
|
+
throw e.status = "pending", e.then((n) => {
|
|
1494
|
+
e.status = "fulfilled", e.value = n;
|
|
1495
|
+
}, (n) => {
|
|
1496
|
+
e.status = "rejected", e.reason = n;
|
|
1420
1497
|
}), e;
|
|
1421
1498
|
}
|
|
1422
|
-
}),
|
|
1499
|
+
}), nt = {
|
|
1423
1500
|
dedupe: !0
|
|
1424
|
-
},
|
|
1425
|
-
const { cache: r, compare:
|
|
1426
|
-
for (const
|
|
1427
|
-
const A =
|
|
1501
|
+
}, Gt = Promise.resolve(V), fr = (e, n, t) => {
|
|
1502
|
+
const { cache: r, compare: o, suspense: u, fallbackData: a, revalidateOnMount: l, revalidateIfStale: s, refreshInterval: i, refreshWhenHidden: h, refreshWhenOffline: m, keepPreviousData: v } = t, [p, E, d, g] = oe.get(r), [f, w] = bt(e), O = ue(!1), M = ue(!1), T = ue(f), I = ue(n), q = ue(t), C = () => q.current, ae = () => C().isVisible() && C().isOnline(), [G, X, he, Q] = an(r, f), D = ue({}).current, ie = y(a) ? y(t.fallback) ? V : t.fallback[f] : a, Re = (R, N) => {
|
|
1503
|
+
for (const W in D) {
|
|
1504
|
+
const A = W;
|
|
1428
1505
|
if (A === "data") {
|
|
1429
|
-
if (!
|
|
1506
|
+
if (!o(R[A], N[A]) && (!y(R[A]) || !o($, N[A])))
|
|
1430
1507
|
return !1;
|
|
1431
|
-
} else if (
|
|
1508
|
+
} else if (N[A] !== R[A])
|
|
1432
1509
|
return !1;
|
|
1433
1510
|
}
|
|
1434
1511
|
return !0;
|
|
1435
|
-
},
|
|
1436
|
-
const
|
|
1437
|
-
const
|
|
1438
|
-
return delete
|
|
1512
|
+
}, Oe = zt(() => {
|
|
1513
|
+
const R = !f || !n ? !1 : y(l) ? C().isPaused() || u ? !1 : s !== !1 : l, N = (U) => {
|
|
1514
|
+
const ne = de(U);
|
|
1515
|
+
return delete ne._k, R ? k({
|
|
1439
1516
|
isValidating: !0,
|
|
1440
1517
|
isLoading: !0
|
|
1441
|
-
},
|
|
1442
|
-
},
|
|
1443
|
-
let
|
|
1518
|
+
}, ne) : ne;
|
|
1519
|
+
}, W = G(), A = Q(), z = N(W), ge = W === A ? z : N(A);
|
|
1520
|
+
let F = z;
|
|
1444
1521
|
return [
|
|
1445
1522
|
() => {
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1523
|
+
const U = N(G());
|
|
1524
|
+
return Re(U, F) ? (F.data = U.data, F.isLoading = U.isLoading, F.isValidating = U.isValidating, F.error = U.error, F) : (F = U, U);
|
|
1448
1525
|
},
|
|
1449
1526
|
() => ge
|
|
1450
1527
|
];
|
|
1451
1528
|
}, [
|
|
1452
1529
|
r,
|
|
1453
|
-
|
|
1454
|
-
]),
|
|
1455
|
-
(
|
|
1456
|
-
|
|
1530
|
+
f
|
|
1531
|
+
]), ee = Mn.useSyncExternalStore($e(
|
|
1532
|
+
(R) => he(f, (N, W) => {
|
|
1533
|
+
Re(W, N) || R();
|
|
1457
1534
|
}),
|
|
1458
1535
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1459
1536
|
[
|
|
1460
1537
|
r,
|
|
1461
|
-
|
|
1538
|
+
f
|
|
1462
1539
|
]
|
|
1463
|
-
),
|
|
1464
|
-
(
|
|
1465
|
-
const
|
|
1466
|
-
if (!
|
|
1540
|
+
), Oe[0], Oe[1]), Te = !O.current, c = p[f] && p[f].length > 0, _ = ee.data, b = y(_) ? ie && on(ie) ? tt(ie) : ie : _, x = ee.error, Y = ue(b), $ = v ? y(_) ? y(Y.current) ? b : Y.current : _ : b, Ee = c && !y(x) ? !1 : Te && !y(l) ? l : C().isPaused() ? !1 : u ? y(b) ? !1 : s : y(b) || s, me = !!(f && n && Te && Ee), P = y(ee.isValidating) ? me : ee.isValidating, ce = y(ee.isLoading) ? me : ee.isLoading, te = $e(
|
|
1541
|
+
(R) => H(null, null, function* () {
|
|
1542
|
+
const N = I.current;
|
|
1543
|
+
if (!f || !N || M.current || C().isPaused())
|
|
1467
1544
|
return !1;
|
|
1468
|
-
let
|
|
1469
|
-
const ge =
|
|
1545
|
+
let W, A, z = !0;
|
|
1546
|
+
const ge = R || {}, F = !d[f] || !ge.dedupe, U = () => Ut ? !M.current && f === T.current && O.current : f === T.current, ne = {
|
|
1470
1547
|
isValidating: !1,
|
|
1471
1548
|
isLoading: !1
|
|
1549
|
+
}, Rt = () => {
|
|
1550
|
+
X(ne);
|
|
1472
1551
|
}, Ot = () => {
|
|
1473
|
-
B
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
z && z[1] === A && delete c[o];
|
|
1477
|
-
}, bt = {
|
|
1552
|
+
const B = d[f];
|
|
1553
|
+
B && B[1] === A && delete d[f];
|
|
1554
|
+
}, Tt = {
|
|
1478
1555
|
isValidating: !0
|
|
1479
1556
|
};
|
|
1480
|
-
|
|
1557
|
+
y(G().data) && (Tt.isLoading = !0);
|
|
1481
1558
|
try {
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1484
|
-
},
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
]), [
|
|
1488
|
-
return
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1491
|
-
if (!
|
|
1492
|
-
(A <=
|
|
1493
|
-
A <=
|
|
1494
|
-
|
|
1495
|
-
return
|
|
1496
|
-
const re =
|
|
1497
|
-
|
|
1498
|
-
} catch (
|
|
1499
|
-
|
|
1500
|
-
const re =
|
|
1501
|
-
re.isPaused() || (
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1559
|
+
if (F && (X(Tt), t.loadingTimeout && y(G().data) && setTimeout(() => {
|
|
1560
|
+
z && U() && C().onLoadingSlow(f, t);
|
|
1561
|
+
}, t.loadingTimeout), d[f] = [
|
|
1562
|
+
N(w),
|
|
1563
|
+
_t()
|
|
1564
|
+
]), [W, A] = d[f], W = yield W, F && setTimeout(Ot, t.dedupingInterval), !d[f] || d[f][1] !== A)
|
|
1565
|
+
return F && U() && C().onDiscarded(f), !1;
|
|
1566
|
+
ne.error = V;
|
|
1567
|
+
const B = E[f];
|
|
1568
|
+
if (!y(B) && // case 1
|
|
1569
|
+
(A <= B[0] || // case 2
|
|
1570
|
+
A <= B[1] || // case 3
|
|
1571
|
+
B[1] === 0))
|
|
1572
|
+
return Rt(), F && U() && C().onDiscarded(f), !1;
|
|
1573
|
+
const re = G().data;
|
|
1574
|
+
ne.data = o(re, W) ? re : W, F && U() && C().onSuccess(W, f, t);
|
|
1575
|
+
} catch (B) {
|
|
1576
|
+
Ot();
|
|
1577
|
+
const re = C(), { shouldRetryOnError: qe } = re;
|
|
1578
|
+
re.isPaused() || (ne.error = B, F && U() && (re.onError(B, f, re), (qe === !0 || Z(qe) && qe(B)) && (!C().revalidateOnFocus || !C().revalidateOnReconnect || ae()) && re.onErrorRetry(B, f, re, (fn) => {
|
|
1579
|
+
const Ge = p[f];
|
|
1580
|
+
Ge && Ge[0] && Ge[0](Vt, fn);
|
|
1504
1581
|
}, {
|
|
1505
1582
|
retryCount: (ge.retryCount || 0) + 1,
|
|
1506
1583
|
dedupe: !0
|
|
1507
1584
|
})));
|
|
1508
1585
|
}
|
|
1509
|
-
return
|
|
1586
|
+
return z = !1, Rt(), !0;
|
|
1510
1587
|
}),
|
|
1511
1588
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
1512
1589
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -1520,94 +1597,94 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1520
1597
|
// even though it might cause unexpected behaviors.
|
|
1521
1598
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1522
1599
|
[
|
|
1523
|
-
|
|
1600
|
+
f,
|
|
1524
1601
|
r
|
|
1525
1602
|
]
|
|
1526
|
-
),
|
|
1603
|
+
), Me = $e(
|
|
1527
1604
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
1528
|
-
(...
|
|
1605
|
+
(...R) => cn(r, T.current, ...R),
|
|
1529
1606
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1530
1607
|
[]
|
|
1531
1608
|
);
|
|
1532
|
-
if (
|
|
1533
|
-
|
|
1534
|
-
}),
|
|
1535
|
-
if (!
|
|
1536
|
-
const
|
|
1537
|
-
let
|
|
1538
|
-
|
|
1539
|
-
const A =
|
|
1540
|
-
if (
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1543
|
-
} else if (
|
|
1544
|
-
|
|
1609
|
+
if (Ze(() => {
|
|
1610
|
+
I.current = n, q.current = t, y(_) || (Y.current = _);
|
|
1611
|
+
}), Ze(() => {
|
|
1612
|
+
if (!f) return;
|
|
1613
|
+
const R = te.bind(V, nt);
|
|
1614
|
+
let N = 0;
|
|
1615
|
+
C().revalidateOnFocus && (N = Date.now() + C().focusThrottleInterval);
|
|
1616
|
+
const A = lr(f, p, (z, ge = {}) => {
|
|
1617
|
+
if (z == nn) {
|
|
1618
|
+
const F = Date.now();
|
|
1619
|
+
C().revalidateOnFocus && F > N && ae() && (N = F + C().focusThrottleInterval, R());
|
|
1620
|
+
} else if (z == rn)
|
|
1621
|
+
C().revalidateOnReconnect && ae() && R();
|
|
1545
1622
|
else {
|
|
1546
|
-
if (
|
|
1547
|
-
return
|
|
1548
|
-
if (
|
|
1549
|
-
return
|
|
1623
|
+
if (z == sn)
|
|
1624
|
+
return te();
|
|
1625
|
+
if (z == Vt)
|
|
1626
|
+
return te(ge);
|
|
1550
1627
|
}
|
|
1551
1628
|
});
|
|
1552
|
-
return
|
|
1553
|
-
_k:
|
|
1554
|
-
}), Ee && (
|
|
1555
|
-
|
|
1629
|
+
return M.current = !1, T.current = f, O.current = !0, X({
|
|
1630
|
+
_k: w
|
|
1631
|
+
}), Ee && (d[f] || (y(b) || De ? R() : Gn(R))), () => {
|
|
1632
|
+
M.current = !0, A();
|
|
1556
1633
|
};
|
|
1557
1634
|
}, [
|
|
1558
|
-
|
|
1559
|
-
]),
|
|
1560
|
-
let
|
|
1561
|
-
function
|
|
1562
|
-
const A =
|
|
1563
|
-
A &&
|
|
1635
|
+
f
|
|
1636
|
+
]), Ze(() => {
|
|
1637
|
+
let R;
|
|
1638
|
+
function N() {
|
|
1639
|
+
const A = Z(i) ? i(G().data) : i;
|
|
1640
|
+
A && R !== -1 && (R = setTimeout(W, A));
|
|
1564
1641
|
}
|
|
1565
|
-
function
|
|
1566
|
-
!
|
|
1642
|
+
function W() {
|
|
1643
|
+
!G().error && (h || C().isVisible()) && (m || C().isOnline()) ? te(nt).then(N) : N();
|
|
1567
1644
|
}
|
|
1568
|
-
return
|
|
1569
|
-
|
|
1645
|
+
return N(), () => {
|
|
1646
|
+
R && (clearTimeout(R), R = -1);
|
|
1570
1647
|
};
|
|
1571
1648
|
}, [
|
|
1572
|
-
|
|
1573
|
-
|
|
1649
|
+
i,
|
|
1650
|
+
h,
|
|
1574
1651
|
m,
|
|
1575
|
-
|
|
1576
|
-
]),
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1652
|
+
f
|
|
1653
|
+
]), vn($), u) {
|
|
1654
|
+
const R = f && y(b);
|
|
1655
|
+
if (!Ut && De && R)
|
|
1579
1656
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
throw
|
|
1584
|
-
const A =
|
|
1585
|
-
!
|
|
1657
|
+
R && (I.current = n, q.current = t, M.current = !1);
|
|
1658
|
+
const N = g[f], W = !y(N) && R ? Me(N) : Gt;
|
|
1659
|
+
if (tt(W), !y(x) && R)
|
|
1660
|
+
throw x;
|
|
1661
|
+
const A = R ? te(nt) : Gt;
|
|
1662
|
+
!y($) && R && (A.status = "fulfilled", A.value = !0), tt(A);
|
|
1586
1663
|
}
|
|
1587
1664
|
return {
|
|
1588
|
-
mutate:
|
|
1665
|
+
mutate: Me,
|
|
1589
1666
|
get data() {
|
|
1590
|
-
return
|
|
1667
|
+
return D.data = !0, $;
|
|
1591
1668
|
},
|
|
1592
1669
|
get error() {
|
|
1593
|
-
return
|
|
1670
|
+
return D.error = !0, x;
|
|
1594
1671
|
},
|
|
1595
1672
|
get isValidating() {
|
|
1596
|
-
return
|
|
1673
|
+
return D.isValidating = !0, P;
|
|
1597
1674
|
},
|
|
1598
1675
|
get isLoading() {
|
|
1599
|
-
return
|
|
1676
|
+
return D.isLoading = !0, ce;
|
|
1600
1677
|
}
|
|
1601
1678
|
};
|
|
1602
|
-
},
|
|
1679
|
+
}, dr = ur(fr), _r = ({
|
|
1603
1680
|
fileKey: e,
|
|
1604
|
-
authToken:
|
|
1605
|
-
enabled:
|
|
1681
|
+
authToken: n,
|
|
1682
|
+
enabled: t = !0,
|
|
1606
1683
|
params: r = {}
|
|
1607
1684
|
}) => {
|
|
1608
|
-
const { figmaRestApi:
|
|
1609
|
-
["useFigmaFile", e,
|
|
1610
|
-
() =>
|
|
1685
|
+
const { figmaRestApi: o } = kn(), u = !!(t && e && n), { data: a, isLoading: l, error: s } = dr(
|
|
1686
|
+
["useFigmaFile", e, n, r],
|
|
1687
|
+
() => u ? o.withOptions(n ? { token: n } : {}).getFile({
|
|
1611
1688
|
fileKey: e,
|
|
1612
1689
|
depth: r.depth
|
|
1613
1690
|
}) : null,
|
|
@@ -1618,18 +1695,19 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1618
1695
|
}
|
|
1619
1696
|
);
|
|
1620
1697
|
return {
|
|
1621
|
-
data:
|
|
1698
|
+
data: a != null ? a : null,
|
|
1622
1699
|
isLoading: l,
|
|
1623
|
-
error:
|
|
1700
|
+
error: s
|
|
1624
1701
|
};
|
|
1625
1702
|
};
|
|
1626
1703
|
export {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1704
|
+
tn as AnimaSdkContext,
|
|
1705
|
+
gr as AnimaSdkProvider,
|
|
1706
|
+
Nn as AttachJobError,
|
|
1707
|
+
Ln as CreateJobError,
|
|
1708
|
+
xn as UnknownCodegenError,
|
|
1709
|
+
vr as useAnimaCodegen,
|
|
1710
|
+
kn as useAnimaSDK,
|
|
1711
|
+
_r as useFigmaFile
|
|
1634
1712
|
};
|
|
1635
1713
|
//# sourceMappingURL=index.js.map
|