@kubb/swagger-ts 2.0.0-alpha.9 → 2.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3969 @@
1
+ import { createRequire } from 'module';
2
+ import transformers2, { camelCase, pascalCase } from '@kubb/core/transformers';
3
+ import { print } from '@kubb/parser';
4
+ import * as factory2 from '@kubb/parser/factory';
5
+ import { keywordTypeNodes } from '@kubb/parser/factory';
6
+ import { usePlugin, useFile, File, usePluginManager, createRoot, Type } from '@kubb/react';
7
+ import { useOas, useSchemas, useOperationFile, useOperationName, useOperation } from '@kubb/swagger/hooks';
8
+ import { pluginName as pluginName$1, OasBuilder, OperationGenerator as OperationGenerator$1 } from '@kubb/swagger';
9
+ import { refsSorter, isReference, getSchemaFactory } from '@kubb/swagger/utils';
10
+ import { createPlugin, FileManager, PluginManager, Generator } from '@kubb/core';
11
+ import { renderTemplate, getUniqueName } from '@kubb/core/utils';
12
+ import path from 'path';
13
+
14
+ createRequire(import.meta.url);
15
+
16
+ var __create = Object.create;
17
+ var __defProp = Object.defineProperty;
18
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
19
+ var __getOwnPropNames = Object.getOwnPropertyNames;
20
+ var __getProtoOf = Object.getPrototypeOf;
21
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
22
+ var __esm = (fn, res) => function __init() {
23
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
24
+ };
25
+ var __commonJS = (cb, mod) => function __require() {
26
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
27
+ };
28
+ var __copyProps = (to, from, except, desc) => {
29
+ if (from && typeof from === "object" || typeof from === "function") {
30
+ for (let key of __getOwnPropNames(from))
31
+ if (!__hasOwnProp.call(to, key) && key !== except)
32
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
33
+ }
34
+ return to;
35
+ };
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
+ // If the importer is in node compatibility mode or this is not an ESM
38
+ // file that has been converted to a CommonJS file using a Babel-
39
+ // compatible transform (i.e. "__esModule" has not been set), then set
40
+ // "default" to the CommonJS "module.exports" for node compatibility.
41
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
42
+ mod
43
+ ));
44
+ var __accessCheck = (obj, member, msg) => {
45
+ if (!member.has(obj))
46
+ throw TypeError("Cannot " + msg);
47
+ };
48
+ var __privateGet = (obj, member, getter) => {
49
+ __accessCheck(obj, member, "read from private field");
50
+ return getter ? getter.call(obj) : member.get(obj);
51
+ };
52
+ var __privateAdd = (obj, member, value) => {
53
+ if (member.has(obj))
54
+ throw TypeError("Cannot add the same private member more than once");
55
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
56
+ };
57
+ var __privateMethod = (obj, member, method) => {
58
+ __accessCheck(obj, member, "access private method");
59
+ return method;
60
+ };
61
+
62
+ // ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js
63
+ var init_esm_shims = __esm({
64
+ "../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js"() {
65
+ }
66
+ });
67
+
68
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js
69
+ var require_react_production_min = __commonJS({
70
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js"(exports) {
71
+ init_esm_shims();
72
+ var l = Symbol.for("react.element");
73
+ var n = Symbol.for("react.portal");
74
+ var p = Symbol.for("react.fragment");
75
+ var q = Symbol.for("react.strict_mode");
76
+ var r = Symbol.for("react.profiler");
77
+ var t = Symbol.for("react.provider");
78
+ var u = Symbol.for("react.context");
79
+ var v = Symbol.for("react.forward_ref");
80
+ var w = Symbol.for("react.suspense");
81
+ var x = Symbol.for("react.memo");
82
+ var y = Symbol.for("react.lazy");
83
+ var z = Symbol.iterator;
84
+ function A(a) {
85
+ if (null === a || "object" !== typeof a)
86
+ return null;
87
+ a = z && a[z] || a["@@iterator"];
88
+ return "function" === typeof a ? a : null;
89
+ }
90
+ var B = { isMounted: function() {
91
+ return false;
92
+ }, enqueueForceUpdate: function() {
93
+ }, enqueueReplaceState: function() {
94
+ }, enqueueSetState: function() {
95
+ } };
96
+ var C = Object.assign;
97
+ var D = {};
98
+ function E(a, b, e) {
99
+ this.props = a;
100
+ this.context = b;
101
+ this.refs = D;
102
+ this.updater = e || B;
103
+ }
104
+ E.prototype.isReactComponent = {};
105
+ E.prototype.setState = function(a, b) {
106
+ if ("object" !== typeof a && "function" !== typeof a && null != a)
107
+ throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
108
+ this.updater.enqueueSetState(this, a, b, "setState");
109
+ };
110
+ E.prototype.forceUpdate = function(a) {
111
+ this.updater.enqueueForceUpdate(this, a, "forceUpdate");
112
+ };
113
+ function F() {
114
+ }
115
+ F.prototype = E.prototype;
116
+ function G(a, b, e) {
117
+ this.props = a;
118
+ this.context = b;
119
+ this.refs = D;
120
+ this.updater = e || B;
121
+ }
122
+ var H = G.prototype = new F();
123
+ H.constructor = G;
124
+ C(H, E.prototype);
125
+ H.isPureReactComponent = true;
126
+ var I = Array.isArray;
127
+ var J = Object.prototype.hasOwnProperty;
128
+ var K = { current: null };
129
+ var L = { key: true, ref: true, __self: true, __source: true };
130
+ function M(a, b, e) {
131
+ var d, c = {}, k = null, h = null;
132
+ if (null != b)
133
+ for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b)
134
+ J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
135
+ var g = arguments.length - 2;
136
+ if (1 === g)
137
+ c.children = e;
138
+ else if (1 < g) {
139
+ for (var f = Array(g), m = 0; m < g; m++)
140
+ f[m] = arguments[m + 2];
141
+ c.children = f;
142
+ }
143
+ if (a && a.defaultProps)
144
+ for (d in g = a.defaultProps, g)
145
+ void 0 === c[d] && (c[d] = g[d]);
146
+ return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
147
+ }
148
+ function N(a, b) {
149
+ return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner };
150
+ }
151
+ function O(a) {
152
+ return "object" === typeof a && null !== a && a.$$typeof === l;
153
+ }
154
+ function escape(a) {
155
+ var b = { "=": "=0", ":": "=2" };
156
+ return "$" + a.replace(/[=:]/g, function(a2) {
157
+ return b[a2];
158
+ });
159
+ }
160
+ var P = /\/+/g;
161
+ function Q(a, b) {
162
+ return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
163
+ }
164
+ function R(a, b, e, d, c) {
165
+ var k = typeof a;
166
+ if ("undefined" === k || "boolean" === k)
167
+ a = null;
168
+ var h = false;
169
+ if (null === a)
170
+ h = true;
171
+ else
172
+ switch (k) {
173
+ case "string":
174
+ case "number":
175
+ h = true;
176
+ break;
177
+ case "object":
178
+ switch (a.$$typeof) {
179
+ case l:
180
+ case n:
181
+ h = true;
182
+ }
183
+ }
184
+ if (h)
185
+ return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a2) {
186
+ return a2;
187
+ })) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
188
+ h = 0;
189
+ d = "" === d ? "." : d + ":";
190
+ if (I(a))
191
+ for (var g = 0; g < a.length; g++) {
192
+ k = a[g];
193
+ var f = d + Q(k, g);
194
+ h += R(k, b, e, f, c);
195
+ }
196
+ else if (f = A(a), "function" === typeof f)
197
+ for (a = f.call(a), g = 0; !(k = a.next()).done; )
198
+ k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
199
+ else if ("object" === k)
200
+ throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
201
+ return h;
202
+ }
203
+ function S(a, b, e) {
204
+ if (null == a)
205
+ return a;
206
+ var d = [], c = 0;
207
+ R(a, d, "", "", function(a2) {
208
+ return b.call(e, a2, c++);
209
+ });
210
+ return d;
211
+ }
212
+ function T(a) {
213
+ if (-1 === a._status) {
214
+ var b = a._result;
215
+ b = b();
216
+ b.then(function(b2) {
217
+ if (0 === a._status || -1 === a._status)
218
+ a._status = 1, a._result = b2;
219
+ }, function(b2) {
220
+ if (0 === a._status || -1 === a._status)
221
+ a._status = 2, a._result = b2;
222
+ });
223
+ -1 === a._status && (a._status = 0, a._result = b);
224
+ }
225
+ if (1 === a._status)
226
+ return a._result.default;
227
+ throw a._result;
228
+ }
229
+ var U = { current: null };
230
+ var V = { transition: null };
231
+ var W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
232
+ exports.Children = { map: S, forEach: function(a, b, e) {
233
+ S(a, function() {
234
+ b.apply(this, arguments);
235
+ }, e);
236
+ }, count: function(a) {
237
+ var b = 0;
238
+ S(a, function() {
239
+ b++;
240
+ });
241
+ return b;
242
+ }, toArray: function(a) {
243
+ return S(a, function(a2) {
244
+ return a2;
245
+ }) || [];
246
+ }, only: function(a) {
247
+ if (!O(a))
248
+ throw Error("React.Children.only expected to receive a single React element child.");
249
+ return a;
250
+ } };
251
+ exports.Component = E;
252
+ exports.Fragment = p;
253
+ exports.Profiler = r;
254
+ exports.PureComponent = G;
255
+ exports.StrictMode = q;
256
+ exports.Suspense = w;
257
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
258
+ exports.cloneElement = function(a, b, e) {
259
+ if (null === a || void 0 === a)
260
+ throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
261
+ var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
262
+ if (null != b) {
263
+ void 0 !== b.ref && (k = b.ref, h = K.current);
264
+ void 0 !== b.key && (c = "" + b.key);
265
+ if (a.type && a.type.defaultProps)
266
+ var g = a.type.defaultProps;
267
+ for (f in b)
268
+ J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
269
+ }
270
+ var f = arguments.length - 2;
271
+ if (1 === f)
272
+ d.children = e;
273
+ else if (1 < f) {
274
+ g = Array(f);
275
+ for (var m = 0; m < f; m++)
276
+ g[m] = arguments[m + 2];
277
+ d.children = g;
278
+ }
279
+ return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h };
280
+ };
281
+ exports.createContext = function(a) {
282
+ a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
283
+ a.Provider = { $$typeof: t, _context: a };
284
+ return a.Consumer = a;
285
+ };
286
+ exports.createElement = M;
287
+ exports.createFactory = function(a) {
288
+ var b = M.bind(null, a);
289
+ b.type = a;
290
+ return b;
291
+ };
292
+ exports.createRef = function() {
293
+ return { current: null };
294
+ };
295
+ exports.forwardRef = function(a) {
296
+ return { $$typeof: v, render: a };
297
+ };
298
+ exports.isValidElement = O;
299
+ exports.lazy = function(a) {
300
+ return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
301
+ };
302
+ exports.memo = function(a, b) {
303
+ return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
304
+ };
305
+ exports.startTransition = function(a) {
306
+ var b = V.transition;
307
+ V.transition = {};
308
+ try {
309
+ a();
310
+ } finally {
311
+ V.transition = b;
312
+ }
313
+ };
314
+ exports.unstable_act = function() {
315
+ throw Error("act(...) is not supported in production builds of React.");
316
+ };
317
+ exports.useCallback = function(a, b) {
318
+ return U.current.useCallback(a, b);
319
+ };
320
+ exports.useContext = function(a) {
321
+ return U.current.useContext(a);
322
+ };
323
+ exports.useDebugValue = function() {
324
+ };
325
+ exports.useDeferredValue = function(a) {
326
+ return U.current.useDeferredValue(a);
327
+ };
328
+ exports.useEffect = function(a, b) {
329
+ return U.current.useEffect(a, b);
330
+ };
331
+ exports.useId = function() {
332
+ return U.current.useId();
333
+ };
334
+ exports.useImperativeHandle = function(a, b, e) {
335
+ return U.current.useImperativeHandle(a, b, e);
336
+ };
337
+ exports.useInsertionEffect = function(a, b) {
338
+ return U.current.useInsertionEffect(a, b);
339
+ };
340
+ exports.useLayoutEffect = function(a, b) {
341
+ return U.current.useLayoutEffect(a, b);
342
+ };
343
+ exports.useMemo = function(a, b) {
344
+ return U.current.useMemo(a, b);
345
+ };
346
+ exports.useReducer = function(a, b, e) {
347
+ return U.current.useReducer(a, b, e);
348
+ };
349
+ exports.useRef = function(a) {
350
+ return U.current.useRef(a);
351
+ };
352
+ exports.useState = function(a) {
353
+ return U.current.useState(a);
354
+ };
355
+ exports.useSyncExternalStore = function(a, b, e) {
356
+ return U.current.useSyncExternalStore(a, b, e);
357
+ };
358
+ exports.useTransition = function() {
359
+ return U.current.useTransition();
360
+ };
361
+ exports.version = "18.2.0";
362
+ }
363
+ });
364
+
365
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js
366
+ var require_react_development = __commonJS({
367
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js"(exports, module) {
368
+ init_esm_shims();
369
+ if (process.env.NODE_ENV !== "production") {
370
+ (function() {
371
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
372
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
373
+ }
374
+ var ReactVersion = "18.2.0";
375
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
376
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
377
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
378
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
379
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
380
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
381
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
382
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
383
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
384
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
385
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
386
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
387
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
388
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
389
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
390
+ function getIteratorFn(maybeIterable) {
391
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
392
+ return null;
393
+ }
394
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
395
+ if (typeof maybeIterator === "function") {
396
+ return maybeIterator;
397
+ }
398
+ return null;
399
+ }
400
+ var ReactCurrentDispatcher = {
401
+ /**
402
+ * @internal
403
+ * @type {ReactComponent}
404
+ */
405
+ current: null
406
+ };
407
+ var ReactCurrentBatchConfig = {
408
+ transition: null
409
+ };
410
+ var ReactCurrentActQueue = {
411
+ current: null,
412
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode.
413
+ isBatchingLegacy: false,
414
+ didScheduleLegacyUpdate: false
415
+ };
416
+ var ReactCurrentOwner = {
417
+ /**
418
+ * @internal
419
+ * @type {ReactComponent}
420
+ */
421
+ current: null
422
+ };
423
+ var ReactDebugCurrentFrame = {};
424
+ var currentExtraStackFrame = null;
425
+ function setExtraStackFrame(stack) {
426
+ {
427
+ currentExtraStackFrame = stack;
428
+ }
429
+ }
430
+ {
431
+ ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
432
+ {
433
+ currentExtraStackFrame = stack;
434
+ }
435
+ };
436
+ ReactDebugCurrentFrame.getCurrentStack = null;
437
+ ReactDebugCurrentFrame.getStackAddendum = function() {
438
+ var stack = "";
439
+ if (currentExtraStackFrame) {
440
+ stack += currentExtraStackFrame;
441
+ }
442
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
443
+ if (impl) {
444
+ stack += impl() || "";
445
+ }
446
+ return stack;
447
+ };
448
+ }
449
+ var enableScopeAPI = false;
450
+ var enableCacheElement = false;
451
+ var enableTransitionTracing = false;
452
+ var enableLegacyHidden = false;
453
+ var enableDebugTracing = false;
454
+ var ReactSharedInternals = {
455
+ ReactCurrentDispatcher,
456
+ ReactCurrentBatchConfig,
457
+ ReactCurrentOwner
458
+ };
459
+ {
460
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
461
+ ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
462
+ }
463
+ function warn(format) {
464
+ {
465
+ {
466
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
467
+ args[_key - 1] = arguments[_key];
468
+ }
469
+ printWarning("warn", format, args);
470
+ }
471
+ }
472
+ }
473
+ function error(format) {
474
+ {
475
+ {
476
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
477
+ args[_key2 - 1] = arguments[_key2];
478
+ }
479
+ printWarning("error", format, args);
480
+ }
481
+ }
482
+ }
483
+ function printWarning(level, format, args) {
484
+ {
485
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
486
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
487
+ if (stack !== "") {
488
+ format += "%s";
489
+ args = args.concat([stack]);
490
+ }
491
+ var argsWithFormat = args.map(function(item) {
492
+ return String(item);
493
+ });
494
+ argsWithFormat.unshift("Warning: " + format);
495
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
496
+ }
497
+ }
498
+ var didWarnStateUpdateForUnmountedComponent = {};
499
+ function warnNoop(publicInstance, callerName) {
500
+ {
501
+ var _constructor = publicInstance.constructor;
502
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
503
+ var warningKey = componentName + "." + callerName;
504
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
505
+ return;
506
+ }
507
+ error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
508
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
509
+ }
510
+ }
511
+ var ReactNoopUpdateQueue = {
512
+ /**
513
+ * Checks whether or not this composite component is mounted.
514
+ * @param {ReactClass} publicInstance The instance we want to test.
515
+ * @return {boolean} True if mounted, false otherwise.
516
+ * @protected
517
+ * @final
518
+ */
519
+ isMounted: function(publicInstance) {
520
+ return false;
521
+ },
522
+ /**
523
+ * Forces an update. This should only be invoked when it is known with
524
+ * certainty that we are **not** in a DOM transaction.
525
+ *
526
+ * You may want to call this when you know that some deeper aspect of the
527
+ * component's state has changed but `setState` was not called.
528
+ *
529
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
530
+ * `componentWillUpdate` and `componentDidUpdate`.
531
+ *
532
+ * @param {ReactClass} publicInstance The instance that should rerender.
533
+ * @param {?function} callback Called after component is updated.
534
+ * @param {?string} callerName name of the calling function in the public API.
535
+ * @internal
536
+ */
537
+ enqueueForceUpdate: function(publicInstance, callback, callerName) {
538
+ warnNoop(publicInstance, "forceUpdate");
539
+ },
540
+ /**
541
+ * Replaces all of the state. Always use this or `setState` to mutate state.
542
+ * You should treat `this.state` as immutable.
543
+ *
544
+ * There is no guarantee that `this.state` will be immediately updated, so
545
+ * accessing `this.state` after calling this method may return the old value.
546
+ *
547
+ * @param {ReactClass} publicInstance The instance that should rerender.
548
+ * @param {object} completeState Next state.
549
+ * @param {?function} callback Called after component is updated.
550
+ * @param {?string} callerName name of the calling function in the public API.
551
+ * @internal
552
+ */
553
+ enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
554
+ warnNoop(publicInstance, "replaceState");
555
+ },
556
+ /**
557
+ * Sets a subset of the state. This only exists because _pendingState is
558
+ * internal. This provides a merging strategy that is not available to deep
559
+ * properties which is confusing. TODO: Expose pendingState or don't use it
560
+ * during the merge.
561
+ *
562
+ * @param {ReactClass} publicInstance The instance that should rerender.
563
+ * @param {object} partialState Next partial state to be merged with state.
564
+ * @param {?function} callback Called after component is updated.
565
+ * @param {?string} Name of the calling function in the public API.
566
+ * @internal
567
+ */
568
+ enqueueSetState: function(publicInstance, partialState, callback, callerName) {
569
+ warnNoop(publicInstance, "setState");
570
+ }
571
+ };
572
+ var assign = Object.assign;
573
+ var emptyObject = {};
574
+ {
575
+ Object.freeze(emptyObject);
576
+ }
577
+ function Component(props, context, updater) {
578
+ this.props = props;
579
+ this.context = context;
580
+ this.refs = emptyObject;
581
+ this.updater = updater || ReactNoopUpdateQueue;
582
+ }
583
+ Component.prototype.isReactComponent = {};
584
+ Component.prototype.setState = function(partialState, callback) {
585
+ if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
586
+ throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
587
+ }
588
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
589
+ };
590
+ Component.prototype.forceUpdate = function(callback) {
591
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
592
+ };
593
+ {
594
+ var deprecatedAPIs = {
595
+ isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
596
+ replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
597
+ };
598
+ var defineDeprecationWarning = function(methodName, info) {
599
+ Object.defineProperty(Component.prototype, methodName, {
600
+ get: function() {
601
+ warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
602
+ return void 0;
603
+ }
604
+ });
605
+ };
606
+ for (var fnName in deprecatedAPIs) {
607
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
608
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
609
+ }
610
+ }
611
+ }
612
+ function ComponentDummy() {
613
+ }
614
+ ComponentDummy.prototype = Component.prototype;
615
+ function PureComponent(props, context, updater) {
616
+ this.props = props;
617
+ this.context = context;
618
+ this.refs = emptyObject;
619
+ this.updater = updater || ReactNoopUpdateQueue;
620
+ }
621
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
622
+ pureComponentPrototype.constructor = PureComponent;
623
+ assign(pureComponentPrototype, Component.prototype);
624
+ pureComponentPrototype.isPureReactComponent = true;
625
+ function createRef() {
626
+ var refObject = {
627
+ current: null
628
+ };
629
+ {
630
+ Object.seal(refObject);
631
+ }
632
+ return refObject;
633
+ }
634
+ var isArrayImpl = Array.isArray;
635
+ function isArray(a) {
636
+ return isArrayImpl(a);
637
+ }
638
+ function typeName(value) {
639
+ {
640
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
641
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
642
+ return type;
643
+ }
644
+ }
645
+ function willCoercionThrow(value) {
646
+ {
647
+ try {
648
+ testStringCoercion(value);
649
+ return false;
650
+ } catch (e) {
651
+ return true;
652
+ }
653
+ }
654
+ }
655
+ function testStringCoercion(value) {
656
+ return "" + value;
657
+ }
658
+ function checkKeyStringCoercion(value) {
659
+ {
660
+ if (willCoercionThrow(value)) {
661
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
662
+ return testStringCoercion(value);
663
+ }
664
+ }
665
+ }
666
+ function getWrappedName(outerType, innerType, wrapperName) {
667
+ var displayName = outerType.displayName;
668
+ if (displayName) {
669
+ return displayName;
670
+ }
671
+ var functionName = innerType.displayName || innerType.name || "";
672
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
673
+ }
674
+ function getContextName(type) {
675
+ return type.displayName || "Context";
676
+ }
677
+ function getComponentNameFromType(type) {
678
+ if (type == null) {
679
+ return null;
680
+ }
681
+ {
682
+ if (typeof type.tag === "number") {
683
+ error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
684
+ }
685
+ }
686
+ if (typeof type === "function") {
687
+ return type.displayName || type.name || null;
688
+ }
689
+ if (typeof type === "string") {
690
+ return type;
691
+ }
692
+ switch (type) {
693
+ case REACT_FRAGMENT_TYPE:
694
+ return "Fragment";
695
+ case REACT_PORTAL_TYPE:
696
+ return "Portal";
697
+ case REACT_PROFILER_TYPE:
698
+ return "Profiler";
699
+ case REACT_STRICT_MODE_TYPE:
700
+ return "StrictMode";
701
+ case REACT_SUSPENSE_TYPE:
702
+ return "Suspense";
703
+ case REACT_SUSPENSE_LIST_TYPE:
704
+ return "SuspenseList";
705
+ }
706
+ if (typeof type === "object") {
707
+ switch (type.$$typeof) {
708
+ case REACT_CONTEXT_TYPE:
709
+ var context = type;
710
+ return getContextName(context) + ".Consumer";
711
+ case REACT_PROVIDER_TYPE:
712
+ var provider = type;
713
+ return getContextName(provider._context) + ".Provider";
714
+ case REACT_FORWARD_REF_TYPE:
715
+ return getWrappedName(type, type.render, "ForwardRef");
716
+ case REACT_MEMO_TYPE:
717
+ var outerName = type.displayName || null;
718
+ if (outerName !== null) {
719
+ return outerName;
720
+ }
721
+ return getComponentNameFromType(type.type) || "Memo";
722
+ case REACT_LAZY_TYPE: {
723
+ var lazyComponent = type;
724
+ var payload = lazyComponent._payload;
725
+ var init = lazyComponent._init;
726
+ try {
727
+ return getComponentNameFromType(init(payload));
728
+ } catch (x) {
729
+ return null;
730
+ }
731
+ }
732
+ }
733
+ }
734
+ return null;
735
+ }
736
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
737
+ var RESERVED_PROPS = {
738
+ key: true,
739
+ ref: true,
740
+ __self: true,
741
+ __source: true
742
+ };
743
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
744
+ {
745
+ didWarnAboutStringRefs = {};
746
+ }
747
+ function hasValidRef(config) {
748
+ {
749
+ if (hasOwnProperty.call(config, "ref")) {
750
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
751
+ if (getter && getter.isReactWarning) {
752
+ return false;
753
+ }
754
+ }
755
+ }
756
+ return config.ref !== void 0;
757
+ }
758
+ function hasValidKey(config) {
759
+ {
760
+ if (hasOwnProperty.call(config, "key")) {
761
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
762
+ if (getter && getter.isReactWarning) {
763
+ return false;
764
+ }
765
+ }
766
+ }
767
+ return config.key !== void 0;
768
+ }
769
+ function defineKeyPropWarningGetter(props, displayName) {
770
+ var warnAboutAccessingKey = function() {
771
+ {
772
+ if (!specialPropKeyWarningShown) {
773
+ specialPropKeyWarningShown = true;
774
+ error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
775
+ }
776
+ }
777
+ };
778
+ warnAboutAccessingKey.isReactWarning = true;
779
+ Object.defineProperty(props, "key", {
780
+ get: warnAboutAccessingKey,
781
+ configurable: true
782
+ });
783
+ }
784
+ function defineRefPropWarningGetter(props, displayName) {
785
+ var warnAboutAccessingRef = function() {
786
+ {
787
+ if (!specialPropRefWarningShown) {
788
+ specialPropRefWarningShown = true;
789
+ error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
790
+ }
791
+ }
792
+ };
793
+ warnAboutAccessingRef.isReactWarning = true;
794
+ Object.defineProperty(props, "ref", {
795
+ get: warnAboutAccessingRef,
796
+ configurable: true
797
+ });
798
+ }
799
+ function warnIfStringRefCannotBeAutoConverted(config) {
800
+ {
801
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
802
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
803
+ if (!didWarnAboutStringRefs[componentName]) {
804
+ error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
805
+ didWarnAboutStringRefs[componentName] = true;
806
+ }
807
+ }
808
+ }
809
+ }
810
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
811
+ var element = {
812
+ // This tag allows us to uniquely identify this as a React Element
813
+ $$typeof: REACT_ELEMENT_TYPE,
814
+ // Built-in properties that belong on the element
815
+ type,
816
+ key,
817
+ ref,
818
+ props,
819
+ // Record the component responsible for creating this element.
820
+ _owner: owner
821
+ };
822
+ {
823
+ element._store = {};
824
+ Object.defineProperty(element._store, "validated", {
825
+ configurable: false,
826
+ enumerable: false,
827
+ writable: true,
828
+ value: false
829
+ });
830
+ Object.defineProperty(element, "_self", {
831
+ configurable: false,
832
+ enumerable: false,
833
+ writable: false,
834
+ value: self
835
+ });
836
+ Object.defineProperty(element, "_source", {
837
+ configurable: false,
838
+ enumerable: false,
839
+ writable: false,
840
+ value: source
841
+ });
842
+ if (Object.freeze) {
843
+ Object.freeze(element.props);
844
+ Object.freeze(element);
845
+ }
846
+ }
847
+ return element;
848
+ };
849
+ function createElement(type, config, children) {
850
+ var propName;
851
+ var props = {};
852
+ var key = null;
853
+ var ref = null;
854
+ var self = null;
855
+ var source = null;
856
+ if (config != null) {
857
+ if (hasValidRef(config)) {
858
+ ref = config.ref;
859
+ {
860
+ warnIfStringRefCannotBeAutoConverted(config);
861
+ }
862
+ }
863
+ if (hasValidKey(config)) {
864
+ {
865
+ checkKeyStringCoercion(config.key);
866
+ }
867
+ key = "" + config.key;
868
+ }
869
+ self = config.__self === void 0 ? null : config.__self;
870
+ source = config.__source === void 0 ? null : config.__source;
871
+ for (propName in config) {
872
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
873
+ props[propName] = config[propName];
874
+ }
875
+ }
876
+ }
877
+ var childrenLength = arguments.length - 2;
878
+ if (childrenLength === 1) {
879
+ props.children = children;
880
+ } else if (childrenLength > 1) {
881
+ var childArray = Array(childrenLength);
882
+ for (var i = 0; i < childrenLength; i++) {
883
+ childArray[i] = arguments[i + 2];
884
+ }
885
+ {
886
+ if (Object.freeze) {
887
+ Object.freeze(childArray);
888
+ }
889
+ }
890
+ props.children = childArray;
891
+ }
892
+ if (type && type.defaultProps) {
893
+ var defaultProps = type.defaultProps;
894
+ for (propName in defaultProps) {
895
+ if (props[propName] === void 0) {
896
+ props[propName] = defaultProps[propName];
897
+ }
898
+ }
899
+ }
900
+ {
901
+ if (key || ref) {
902
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
903
+ if (key) {
904
+ defineKeyPropWarningGetter(props, displayName);
905
+ }
906
+ if (ref) {
907
+ defineRefPropWarningGetter(props, displayName);
908
+ }
909
+ }
910
+ }
911
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
912
+ }
913
+ function cloneAndReplaceKey(oldElement, newKey) {
914
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
915
+ return newElement;
916
+ }
917
+ function cloneElement(element, config, children) {
918
+ if (element === null || element === void 0) {
919
+ throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
920
+ }
921
+ var propName;
922
+ var props = assign({}, element.props);
923
+ var key = element.key;
924
+ var ref = element.ref;
925
+ var self = element._self;
926
+ var source = element._source;
927
+ var owner = element._owner;
928
+ if (config != null) {
929
+ if (hasValidRef(config)) {
930
+ ref = config.ref;
931
+ owner = ReactCurrentOwner.current;
932
+ }
933
+ if (hasValidKey(config)) {
934
+ {
935
+ checkKeyStringCoercion(config.key);
936
+ }
937
+ key = "" + config.key;
938
+ }
939
+ var defaultProps;
940
+ if (element.type && element.type.defaultProps) {
941
+ defaultProps = element.type.defaultProps;
942
+ }
943
+ for (propName in config) {
944
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
945
+ if (config[propName] === void 0 && defaultProps !== void 0) {
946
+ props[propName] = defaultProps[propName];
947
+ } else {
948
+ props[propName] = config[propName];
949
+ }
950
+ }
951
+ }
952
+ }
953
+ var childrenLength = arguments.length - 2;
954
+ if (childrenLength === 1) {
955
+ props.children = children;
956
+ } else if (childrenLength > 1) {
957
+ var childArray = Array(childrenLength);
958
+ for (var i = 0; i < childrenLength; i++) {
959
+ childArray[i] = arguments[i + 2];
960
+ }
961
+ props.children = childArray;
962
+ }
963
+ return ReactElement(element.type, key, ref, self, source, owner, props);
964
+ }
965
+ function isValidElement(object) {
966
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
967
+ }
968
+ var SEPARATOR = ".";
969
+ var SUBSEPARATOR = ":";
970
+ function escape(key) {
971
+ var escapeRegex = /[=:]/g;
972
+ var escaperLookup = {
973
+ "=": "=0",
974
+ ":": "=2"
975
+ };
976
+ var escapedString = key.replace(escapeRegex, function(match) {
977
+ return escaperLookup[match];
978
+ });
979
+ return "$" + escapedString;
980
+ }
981
+ var didWarnAboutMaps = false;
982
+ var userProvidedKeyEscapeRegex = /\/+/g;
983
+ function escapeUserProvidedKey(text) {
984
+ return text.replace(userProvidedKeyEscapeRegex, "$&/");
985
+ }
986
+ function getElementKey(element, index) {
987
+ if (typeof element === "object" && element !== null && element.key != null) {
988
+ {
989
+ checkKeyStringCoercion(element.key);
990
+ }
991
+ return escape("" + element.key);
992
+ }
993
+ return index.toString(36);
994
+ }
995
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
996
+ var type = typeof children;
997
+ if (type === "undefined" || type === "boolean") {
998
+ children = null;
999
+ }
1000
+ var invokeCallback = false;
1001
+ if (children === null) {
1002
+ invokeCallback = true;
1003
+ } else {
1004
+ switch (type) {
1005
+ case "string":
1006
+ case "number":
1007
+ invokeCallback = true;
1008
+ break;
1009
+ case "object":
1010
+ switch (children.$$typeof) {
1011
+ case REACT_ELEMENT_TYPE:
1012
+ case REACT_PORTAL_TYPE:
1013
+ invokeCallback = true;
1014
+ }
1015
+ }
1016
+ }
1017
+ if (invokeCallback) {
1018
+ var _child = children;
1019
+ var mappedChild = callback(_child);
1020
+ var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1021
+ if (isArray(mappedChild)) {
1022
+ var escapedChildKey = "";
1023
+ if (childKey != null) {
1024
+ escapedChildKey = escapeUserProvidedKey(childKey) + "/";
1025
+ }
1026
+ mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
1027
+ return c;
1028
+ });
1029
+ } else if (mappedChild != null) {
1030
+ if (isValidElement(mappedChild)) {
1031
+ {
1032
+ if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
1033
+ checkKeyStringCoercion(mappedChild.key);
1034
+ }
1035
+ }
1036
+ mappedChild = cloneAndReplaceKey(
1037
+ mappedChild,
1038
+ // Keep both the (mapped) and old keys if they differ, just as
1039
+ // traverseAllChildren used to do for objects as children
1040
+ escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1041
+ (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
1042
+ // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1043
+ // eslint-disable-next-line react-internal/safe-string-coercion
1044
+ escapeUserProvidedKey("" + mappedChild.key) + "/"
1045
+ ) : "") + childKey
1046
+ );
1047
+ }
1048
+ array.push(mappedChild);
1049
+ }
1050
+ return 1;
1051
+ }
1052
+ var child;
1053
+ var nextName;
1054
+ var subtreeCount = 0;
1055
+ var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1056
+ if (isArray(children)) {
1057
+ for (var i = 0; i < children.length; i++) {
1058
+ child = children[i];
1059
+ nextName = nextNamePrefix + getElementKey(child, i);
1060
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1061
+ }
1062
+ } else {
1063
+ var iteratorFn = getIteratorFn(children);
1064
+ if (typeof iteratorFn === "function") {
1065
+ var iterableChildren = children;
1066
+ {
1067
+ if (iteratorFn === iterableChildren.entries) {
1068
+ if (!didWarnAboutMaps) {
1069
+ warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
1070
+ }
1071
+ didWarnAboutMaps = true;
1072
+ }
1073
+ }
1074
+ var iterator = iteratorFn.call(iterableChildren);
1075
+ var step;
1076
+ var ii = 0;
1077
+ while (!(step = iterator.next()).done) {
1078
+ child = step.value;
1079
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1080
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1081
+ }
1082
+ } else if (type === "object") {
1083
+ var childrenString = String(children);
1084
+ throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
1085
+ }
1086
+ }
1087
+ return subtreeCount;
1088
+ }
1089
+ function mapChildren(children, func, context) {
1090
+ if (children == null) {
1091
+ return children;
1092
+ }
1093
+ var result = [];
1094
+ var count = 0;
1095
+ mapIntoArray(children, result, "", "", function(child) {
1096
+ return func.call(context, child, count++);
1097
+ });
1098
+ return result;
1099
+ }
1100
+ function countChildren(children) {
1101
+ var n = 0;
1102
+ mapChildren(children, function() {
1103
+ n++;
1104
+ });
1105
+ return n;
1106
+ }
1107
+ function forEachChildren(children, forEachFunc, forEachContext) {
1108
+ mapChildren(children, function() {
1109
+ forEachFunc.apply(this, arguments);
1110
+ }, forEachContext);
1111
+ }
1112
+ function toArray(children) {
1113
+ return mapChildren(children, function(child) {
1114
+ return child;
1115
+ }) || [];
1116
+ }
1117
+ function onlyChild(children) {
1118
+ if (!isValidElement(children)) {
1119
+ throw new Error("React.Children.only expected to receive a single React element child.");
1120
+ }
1121
+ return children;
1122
+ }
1123
+ function createContext(defaultValue) {
1124
+ var context = {
1125
+ $$typeof: REACT_CONTEXT_TYPE,
1126
+ // As a workaround to support multiple concurrent renderers, we categorize
1127
+ // some renderers as primary and others as secondary. We only expect
1128
+ // there to be two concurrent renderers at most: React Native (primary) and
1129
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1130
+ // Secondary renderers store their context values on separate fields.
1131
+ _currentValue: defaultValue,
1132
+ _currentValue2: defaultValue,
1133
+ // Used to track how many concurrent renderers this context currently
1134
+ // supports within in a single renderer. Such as parallel server rendering.
1135
+ _threadCount: 0,
1136
+ // These are circular
1137
+ Provider: null,
1138
+ Consumer: null,
1139
+ // Add these to use same hidden class in VM as ServerContext
1140
+ _defaultValue: null,
1141
+ _globalName: null
1142
+ };
1143
+ context.Provider = {
1144
+ $$typeof: REACT_PROVIDER_TYPE,
1145
+ _context: context
1146
+ };
1147
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1148
+ var hasWarnedAboutUsingConsumerProvider = false;
1149
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1150
+ {
1151
+ var Consumer = {
1152
+ $$typeof: REACT_CONTEXT_TYPE,
1153
+ _context: context
1154
+ };
1155
+ Object.defineProperties(Consumer, {
1156
+ Provider: {
1157
+ get: function() {
1158
+ if (!hasWarnedAboutUsingConsumerProvider) {
1159
+ hasWarnedAboutUsingConsumerProvider = true;
1160
+ error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
1161
+ }
1162
+ return context.Provider;
1163
+ },
1164
+ set: function(_Provider) {
1165
+ context.Provider = _Provider;
1166
+ }
1167
+ },
1168
+ _currentValue: {
1169
+ get: function() {
1170
+ return context._currentValue;
1171
+ },
1172
+ set: function(_currentValue) {
1173
+ context._currentValue = _currentValue;
1174
+ }
1175
+ },
1176
+ _currentValue2: {
1177
+ get: function() {
1178
+ return context._currentValue2;
1179
+ },
1180
+ set: function(_currentValue2) {
1181
+ context._currentValue2 = _currentValue2;
1182
+ }
1183
+ },
1184
+ _threadCount: {
1185
+ get: function() {
1186
+ return context._threadCount;
1187
+ },
1188
+ set: function(_threadCount) {
1189
+ context._threadCount = _threadCount;
1190
+ }
1191
+ },
1192
+ Consumer: {
1193
+ get: function() {
1194
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1195
+ hasWarnedAboutUsingNestedContextConsumers = true;
1196
+ error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
1197
+ }
1198
+ return context.Consumer;
1199
+ }
1200
+ },
1201
+ displayName: {
1202
+ get: function() {
1203
+ return context.displayName;
1204
+ },
1205
+ set: function(displayName) {
1206
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1207
+ warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
1208
+ hasWarnedAboutDisplayNameOnConsumer = true;
1209
+ }
1210
+ }
1211
+ }
1212
+ });
1213
+ context.Consumer = Consumer;
1214
+ }
1215
+ {
1216
+ context._currentRenderer = null;
1217
+ context._currentRenderer2 = null;
1218
+ }
1219
+ return context;
1220
+ }
1221
+ var Uninitialized = -1;
1222
+ var Pending = 0;
1223
+ var Resolved = 1;
1224
+ var Rejected = 2;
1225
+ function lazyInitializer(payload) {
1226
+ if (payload._status === Uninitialized) {
1227
+ var ctor = payload._result;
1228
+ var thenable = ctor();
1229
+ thenable.then(function(moduleObject2) {
1230
+ if (payload._status === Pending || payload._status === Uninitialized) {
1231
+ var resolved = payload;
1232
+ resolved._status = Resolved;
1233
+ resolved._result = moduleObject2;
1234
+ }
1235
+ }, function(error2) {
1236
+ if (payload._status === Pending || payload._status === Uninitialized) {
1237
+ var rejected = payload;
1238
+ rejected._status = Rejected;
1239
+ rejected._result = error2;
1240
+ }
1241
+ });
1242
+ if (payload._status === Uninitialized) {
1243
+ var pending = payload;
1244
+ pending._status = Pending;
1245
+ pending._result = thenable;
1246
+ }
1247
+ }
1248
+ if (payload._status === Resolved) {
1249
+ var moduleObject = payload._result;
1250
+ {
1251
+ if (moduleObject === void 0) {
1252
+ error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
1253
+ }
1254
+ }
1255
+ {
1256
+ if (!("default" in moduleObject)) {
1257
+ error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
1258
+ }
1259
+ }
1260
+ return moduleObject.default;
1261
+ } else {
1262
+ throw payload._result;
1263
+ }
1264
+ }
1265
+ function lazy(ctor) {
1266
+ var payload = {
1267
+ // We use these fields to store the result.
1268
+ _status: Uninitialized,
1269
+ _result: ctor
1270
+ };
1271
+ var lazyType = {
1272
+ $$typeof: REACT_LAZY_TYPE,
1273
+ _payload: payload,
1274
+ _init: lazyInitializer
1275
+ };
1276
+ {
1277
+ var defaultProps;
1278
+ var propTypes;
1279
+ Object.defineProperties(lazyType, {
1280
+ defaultProps: {
1281
+ configurable: true,
1282
+ get: function() {
1283
+ return defaultProps;
1284
+ },
1285
+ set: function(newDefaultProps) {
1286
+ error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
1287
+ defaultProps = newDefaultProps;
1288
+ Object.defineProperty(lazyType, "defaultProps", {
1289
+ enumerable: true
1290
+ });
1291
+ }
1292
+ },
1293
+ propTypes: {
1294
+ configurable: true,
1295
+ get: function() {
1296
+ return propTypes;
1297
+ },
1298
+ set: function(newPropTypes) {
1299
+ error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
1300
+ propTypes = newPropTypes;
1301
+ Object.defineProperty(lazyType, "propTypes", {
1302
+ enumerable: true
1303
+ });
1304
+ }
1305
+ }
1306
+ });
1307
+ }
1308
+ return lazyType;
1309
+ }
1310
+ function forwardRef(render) {
1311
+ {
1312
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1313
+ error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
1314
+ } else if (typeof render !== "function") {
1315
+ error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
1316
+ } else {
1317
+ if (render.length !== 0 && render.length !== 2) {
1318
+ error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
1319
+ }
1320
+ }
1321
+ if (render != null) {
1322
+ if (render.defaultProps != null || render.propTypes != null) {
1323
+ error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
1324
+ }
1325
+ }
1326
+ }
1327
+ var elementType = {
1328
+ $$typeof: REACT_FORWARD_REF_TYPE,
1329
+ render
1330
+ };
1331
+ {
1332
+ var ownName;
1333
+ Object.defineProperty(elementType, "displayName", {
1334
+ enumerable: false,
1335
+ configurable: true,
1336
+ get: function() {
1337
+ return ownName;
1338
+ },
1339
+ set: function(name) {
1340
+ ownName = name;
1341
+ if (!render.name && !render.displayName) {
1342
+ render.displayName = name;
1343
+ }
1344
+ }
1345
+ });
1346
+ }
1347
+ return elementType;
1348
+ }
1349
+ var REACT_MODULE_REFERENCE;
1350
+ {
1351
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
1352
+ }
1353
+ function isValidElementType(type) {
1354
+ if (typeof type === "string" || typeof type === "function") {
1355
+ return true;
1356
+ }
1357
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
1358
+ return true;
1359
+ }
1360
+ if (typeof type === "object" && type !== null) {
1361
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
1362
+ // types supported by any Flight configuration anywhere since
1363
+ // we don't know which Flight build this will end up being used
1364
+ // with.
1365
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
1366
+ return true;
1367
+ }
1368
+ }
1369
+ return false;
1370
+ }
1371
+ function memo(type, compare) {
1372
+ {
1373
+ if (!isValidElementType(type)) {
1374
+ error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
1375
+ }
1376
+ }
1377
+ var elementType = {
1378
+ $$typeof: REACT_MEMO_TYPE,
1379
+ type,
1380
+ compare: compare === void 0 ? null : compare
1381
+ };
1382
+ {
1383
+ var ownName;
1384
+ Object.defineProperty(elementType, "displayName", {
1385
+ enumerable: false,
1386
+ configurable: true,
1387
+ get: function() {
1388
+ return ownName;
1389
+ },
1390
+ set: function(name) {
1391
+ ownName = name;
1392
+ if (!type.name && !type.displayName) {
1393
+ type.displayName = name;
1394
+ }
1395
+ }
1396
+ });
1397
+ }
1398
+ return elementType;
1399
+ }
1400
+ function resolveDispatcher() {
1401
+ var dispatcher = ReactCurrentDispatcher.current;
1402
+ {
1403
+ if (dispatcher === null) {
1404
+ error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
1405
+ }
1406
+ }
1407
+ return dispatcher;
1408
+ }
1409
+ function useContext(Context) {
1410
+ var dispatcher = resolveDispatcher();
1411
+ {
1412
+ if (Context._context !== void 0) {
1413
+ var realContext = Context._context;
1414
+ if (realContext.Consumer === Context) {
1415
+ error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
1416
+ } else if (realContext.Provider === Context) {
1417
+ error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
1418
+ }
1419
+ }
1420
+ }
1421
+ return dispatcher.useContext(Context);
1422
+ }
1423
+ function useState(initialState) {
1424
+ var dispatcher = resolveDispatcher();
1425
+ return dispatcher.useState(initialState);
1426
+ }
1427
+ function useReducer(reducer, initialArg, init) {
1428
+ var dispatcher = resolveDispatcher();
1429
+ return dispatcher.useReducer(reducer, initialArg, init);
1430
+ }
1431
+ function useRef(initialValue) {
1432
+ var dispatcher = resolveDispatcher();
1433
+ return dispatcher.useRef(initialValue);
1434
+ }
1435
+ function useEffect(create, deps) {
1436
+ var dispatcher = resolveDispatcher();
1437
+ return dispatcher.useEffect(create, deps);
1438
+ }
1439
+ function useInsertionEffect(create, deps) {
1440
+ var dispatcher = resolveDispatcher();
1441
+ return dispatcher.useInsertionEffect(create, deps);
1442
+ }
1443
+ function useLayoutEffect(create, deps) {
1444
+ var dispatcher = resolveDispatcher();
1445
+ return dispatcher.useLayoutEffect(create, deps);
1446
+ }
1447
+ function useCallback(callback, deps) {
1448
+ var dispatcher = resolveDispatcher();
1449
+ return dispatcher.useCallback(callback, deps);
1450
+ }
1451
+ function useMemo(create, deps) {
1452
+ var dispatcher = resolveDispatcher();
1453
+ return dispatcher.useMemo(create, deps);
1454
+ }
1455
+ function useImperativeHandle(ref, create, deps) {
1456
+ var dispatcher = resolveDispatcher();
1457
+ return dispatcher.useImperativeHandle(ref, create, deps);
1458
+ }
1459
+ function useDebugValue(value, formatterFn) {
1460
+ {
1461
+ var dispatcher = resolveDispatcher();
1462
+ return dispatcher.useDebugValue(value, formatterFn);
1463
+ }
1464
+ }
1465
+ function useTransition() {
1466
+ var dispatcher = resolveDispatcher();
1467
+ return dispatcher.useTransition();
1468
+ }
1469
+ function useDeferredValue(value) {
1470
+ var dispatcher = resolveDispatcher();
1471
+ return dispatcher.useDeferredValue(value);
1472
+ }
1473
+ function useId() {
1474
+ var dispatcher = resolveDispatcher();
1475
+ return dispatcher.useId();
1476
+ }
1477
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
1478
+ var dispatcher = resolveDispatcher();
1479
+ return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1480
+ }
1481
+ var disabledDepth = 0;
1482
+ var prevLog;
1483
+ var prevInfo;
1484
+ var prevWarn;
1485
+ var prevError;
1486
+ var prevGroup;
1487
+ var prevGroupCollapsed;
1488
+ var prevGroupEnd;
1489
+ function disabledLog() {
1490
+ }
1491
+ disabledLog.__reactDisabledLog = true;
1492
+ function disableLogs() {
1493
+ {
1494
+ if (disabledDepth === 0) {
1495
+ prevLog = console.log;
1496
+ prevInfo = console.info;
1497
+ prevWarn = console.warn;
1498
+ prevError = console.error;
1499
+ prevGroup = console.group;
1500
+ prevGroupCollapsed = console.groupCollapsed;
1501
+ prevGroupEnd = console.groupEnd;
1502
+ var props = {
1503
+ configurable: true,
1504
+ enumerable: true,
1505
+ value: disabledLog,
1506
+ writable: true
1507
+ };
1508
+ Object.defineProperties(console, {
1509
+ info: props,
1510
+ log: props,
1511
+ warn: props,
1512
+ error: props,
1513
+ group: props,
1514
+ groupCollapsed: props,
1515
+ groupEnd: props
1516
+ });
1517
+ }
1518
+ disabledDepth++;
1519
+ }
1520
+ }
1521
+ function reenableLogs() {
1522
+ {
1523
+ disabledDepth--;
1524
+ if (disabledDepth === 0) {
1525
+ var props = {
1526
+ configurable: true,
1527
+ enumerable: true,
1528
+ writable: true
1529
+ };
1530
+ Object.defineProperties(console, {
1531
+ log: assign({}, props, {
1532
+ value: prevLog
1533
+ }),
1534
+ info: assign({}, props, {
1535
+ value: prevInfo
1536
+ }),
1537
+ warn: assign({}, props, {
1538
+ value: prevWarn
1539
+ }),
1540
+ error: assign({}, props, {
1541
+ value: prevError
1542
+ }),
1543
+ group: assign({}, props, {
1544
+ value: prevGroup
1545
+ }),
1546
+ groupCollapsed: assign({}, props, {
1547
+ value: prevGroupCollapsed
1548
+ }),
1549
+ groupEnd: assign({}, props, {
1550
+ value: prevGroupEnd
1551
+ })
1552
+ });
1553
+ }
1554
+ if (disabledDepth < 0) {
1555
+ error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1556
+ }
1557
+ }
1558
+ }
1559
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1560
+ var prefix;
1561
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
1562
+ {
1563
+ if (prefix === void 0) {
1564
+ try {
1565
+ throw Error();
1566
+ } catch (x) {
1567
+ var match = x.stack.trim().match(/\n( *(at )?)/);
1568
+ prefix = match && match[1] || "";
1569
+ }
1570
+ }
1571
+ return "\n" + prefix + name;
1572
+ }
1573
+ }
1574
+ var reentry = false;
1575
+ var componentFrameCache;
1576
+ {
1577
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
1578
+ componentFrameCache = new PossiblyWeakMap();
1579
+ }
1580
+ function describeNativeComponentFrame(fn, construct) {
1581
+ if (!fn || reentry) {
1582
+ return "";
1583
+ }
1584
+ {
1585
+ var frame = componentFrameCache.get(fn);
1586
+ if (frame !== void 0) {
1587
+ return frame;
1588
+ }
1589
+ }
1590
+ var control;
1591
+ reentry = true;
1592
+ var previousPrepareStackTrace = Error.prepareStackTrace;
1593
+ Error.prepareStackTrace = void 0;
1594
+ var previousDispatcher;
1595
+ {
1596
+ previousDispatcher = ReactCurrentDispatcher$1.current;
1597
+ ReactCurrentDispatcher$1.current = null;
1598
+ disableLogs();
1599
+ }
1600
+ try {
1601
+ if (construct) {
1602
+ var Fake = function() {
1603
+ throw Error();
1604
+ };
1605
+ Object.defineProperty(Fake.prototype, "props", {
1606
+ set: function() {
1607
+ throw Error();
1608
+ }
1609
+ });
1610
+ if (typeof Reflect === "object" && Reflect.construct) {
1611
+ try {
1612
+ Reflect.construct(Fake, []);
1613
+ } catch (x) {
1614
+ control = x;
1615
+ }
1616
+ Reflect.construct(fn, [], Fake);
1617
+ } else {
1618
+ try {
1619
+ Fake.call();
1620
+ } catch (x) {
1621
+ control = x;
1622
+ }
1623
+ fn.call(Fake.prototype);
1624
+ }
1625
+ } else {
1626
+ try {
1627
+ throw Error();
1628
+ } catch (x) {
1629
+ control = x;
1630
+ }
1631
+ fn();
1632
+ }
1633
+ } catch (sample) {
1634
+ if (sample && control && typeof sample.stack === "string") {
1635
+ var sampleLines = sample.stack.split("\n");
1636
+ var controlLines = control.stack.split("\n");
1637
+ var s = sampleLines.length - 1;
1638
+ var c = controlLines.length - 1;
1639
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1640
+ c--;
1641
+ }
1642
+ for (; s >= 1 && c >= 0; s--, c--) {
1643
+ if (sampleLines[s] !== controlLines[c]) {
1644
+ if (s !== 1 || c !== 1) {
1645
+ do {
1646
+ s--;
1647
+ c--;
1648
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
1649
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
1650
+ if (fn.displayName && _frame.includes("<anonymous>")) {
1651
+ _frame = _frame.replace("<anonymous>", fn.displayName);
1652
+ }
1653
+ {
1654
+ if (typeof fn === "function") {
1655
+ componentFrameCache.set(fn, _frame);
1656
+ }
1657
+ }
1658
+ return _frame;
1659
+ }
1660
+ } while (s >= 1 && c >= 0);
1661
+ }
1662
+ break;
1663
+ }
1664
+ }
1665
+ }
1666
+ } finally {
1667
+ reentry = false;
1668
+ {
1669
+ ReactCurrentDispatcher$1.current = previousDispatcher;
1670
+ reenableLogs();
1671
+ }
1672
+ Error.prepareStackTrace = previousPrepareStackTrace;
1673
+ }
1674
+ var name = fn ? fn.displayName || fn.name : "";
1675
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
1676
+ {
1677
+ if (typeof fn === "function") {
1678
+ componentFrameCache.set(fn, syntheticFrame);
1679
+ }
1680
+ }
1681
+ return syntheticFrame;
1682
+ }
1683
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
1684
+ {
1685
+ return describeNativeComponentFrame(fn, false);
1686
+ }
1687
+ }
1688
+ function shouldConstruct(Component2) {
1689
+ var prototype = Component2.prototype;
1690
+ return !!(prototype && prototype.isReactComponent);
1691
+ }
1692
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1693
+ if (type == null) {
1694
+ return "";
1695
+ }
1696
+ if (typeof type === "function") {
1697
+ {
1698
+ return describeNativeComponentFrame(type, shouldConstruct(type));
1699
+ }
1700
+ }
1701
+ if (typeof type === "string") {
1702
+ return describeBuiltInComponentFrame(type);
1703
+ }
1704
+ switch (type) {
1705
+ case REACT_SUSPENSE_TYPE:
1706
+ return describeBuiltInComponentFrame("Suspense");
1707
+ case REACT_SUSPENSE_LIST_TYPE:
1708
+ return describeBuiltInComponentFrame("SuspenseList");
1709
+ }
1710
+ if (typeof type === "object") {
1711
+ switch (type.$$typeof) {
1712
+ case REACT_FORWARD_REF_TYPE:
1713
+ return describeFunctionComponentFrame(type.render);
1714
+ case REACT_MEMO_TYPE:
1715
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1716
+ case REACT_LAZY_TYPE: {
1717
+ var lazyComponent = type;
1718
+ var payload = lazyComponent._payload;
1719
+ var init = lazyComponent._init;
1720
+ try {
1721
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1722
+ } catch (x) {
1723
+ }
1724
+ }
1725
+ }
1726
+ }
1727
+ return "";
1728
+ }
1729
+ var loggedTypeFailures = {};
1730
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1731
+ function setCurrentlyValidatingElement(element) {
1732
+ {
1733
+ if (element) {
1734
+ var owner = element._owner;
1735
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1736
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1737
+ } else {
1738
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1739
+ }
1740
+ }
1741
+ }
1742
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
1743
+ {
1744
+ var has = Function.call.bind(hasOwnProperty);
1745
+ for (var typeSpecName in typeSpecs) {
1746
+ if (has(typeSpecs, typeSpecName)) {
1747
+ var error$1 = void 0;
1748
+ try {
1749
+ if (typeof typeSpecs[typeSpecName] !== "function") {
1750
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1751
+ err.name = "Invariant Violation";
1752
+ throw err;
1753
+ }
1754
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1755
+ } catch (ex) {
1756
+ error$1 = ex;
1757
+ }
1758
+ if (error$1 && !(error$1 instanceof Error)) {
1759
+ setCurrentlyValidatingElement(element);
1760
+ error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
1761
+ setCurrentlyValidatingElement(null);
1762
+ }
1763
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
1764
+ loggedTypeFailures[error$1.message] = true;
1765
+ setCurrentlyValidatingElement(element);
1766
+ error("Failed %s type: %s", location, error$1.message);
1767
+ setCurrentlyValidatingElement(null);
1768
+ }
1769
+ }
1770
+ }
1771
+ }
1772
+ }
1773
+ function setCurrentlyValidatingElement$1(element) {
1774
+ {
1775
+ if (element) {
1776
+ var owner = element._owner;
1777
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1778
+ setExtraStackFrame(stack);
1779
+ } else {
1780
+ setExtraStackFrame(null);
1781
+ }
1782
+ }
1783
+ }
1784
+ var propTypesMisspellWarningShown;
1785
+ {
1786
+ propTypesMisspellWarningShown = false;
1787
+ }
1788
+ function getDeclarationErrorAddendum() {
1789
+ if (ReactCurrentOwner.current) {
1790
+ var name = getComponentNameFromType(ReactCurrentOwner.current.type);
1791
+ if (name) {
1792
+ return "\n\nCheck the render method of `" + name + "`.";
1793
+ }
1794
+ }
1795
+ return "";
1796
+ }
1797
+ function getSourceInfoErrorAddendum(source) {
1798
+ if (source !== void 0) {
1799
+ var fileName = source.fileName.replace(/^.*[\\\/]/, "");
1800
+ var lineNumber = source.lineNumber;
1801
+ return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
1802
+ }
1803
+ return "";
1804
+ }
1805
+ function getSourceInfoErrorAddendumForProps(elementProps) {
1806
+ if (elementProps !== null && elementProps !== void 0) {
1807
+ return getSourceInfoErrorAddendum(elementProps.__source);
1808
+ }
1809
+ return "";
1810
+ }
1811
+ var ownerHasKeyUseWarning = {};
1812
+ function getCurrentComponentErrorInfo(parentType) {
1813
+ var info = getDeclarationErrorAddendum();
1814
+ if (!info) {
1815
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
1816
+ if (parentName) {
1817
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1818
+ }
1819
+ }
1820
+ return info;
1821
+ }
1822
+ function validateExplicitKey(element, parentType) {
1823
+ if (!element._store || element._store.validated || element.key != null) {
1824
+ return;
1825
+ }
1826
+ element._store.validated = true;
1827
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1828
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1829
+ return;
1830
+ }
1831
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
1832
+ var childOwner = "";
1833
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
1834
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1835
+ }
1836
+ {
1837
+ setCurrentlyValidatingElement$1(element);
1838
+ error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1839
+ setCurrentlyValidatingElement$1(null);
1840
+ }
1841
+ }
1842
+ function validateChildKeys(node, parentType) {
1843
+ if (typeof node !== "object") {
1844
+ return;
1845
+ }
1846
+ if (isArray(node)) {
1847
+ for (var i = 0; i < node.length; i++) {
1848
+ var child = node[i];
1849
+ if (isValidElement(child)) {
1850
+ validateExplicitKey(child, parentType);
1851
+ }
1852
+ }
1853
+ } else if (isValidElement(node)) {
1854
+ if (node._store) {
1855
+ node._store.validated = true;
1856
+ }
1857
+ } else if (node) {
1858
+ var iteratorFn = getIteratorFn(node);
1859
+ if (typeof iteratorFn === "function") {
1860
+ if (iteratorFn !== node.entries) {
1861
+ var iterator = iteratorFn.call(node);
1862
+ var step;
1863
+ while (!(step = iterator.next()).done) {
1864
+ if (isValidElement(step.value)) {
1865
+ validateExplicitKey(step.value, parentType);
1866
+ }
1867
+ }
1868
+ }
1869
+ }
1870
+ }
1871
+ }
1872
+ function validatePropTypes(element) {
1873
+ {
1874
+ var type = element.type;
1875
+ if (type === null || type === void 0 || typeof type === "string") {
1876
+ return;
1877
+ }
1878
+ var propTypes;
1879
+ if (typeof type === "function") {
1880
+ propTypes = type.propTypes;
1881
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1882
+ // Inner props are checked in the reconciler.
1883
+ type.$$typeof === REACT_MEMO_TYPE)) {
1884
+ propTypes = type.propTypes;
1885
+ } else {
1886
+ return;
1887
+ }
1888
+ if (propTypes) {
1889
+ var name = getComponentNameFromType(type);
1890
+ checkPropTypes(propTypes, element.props, "prop", name, element);
1891
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
1892
+ propTypesMisspellWarningShown = true;
1893
+ var _name = getComponentNameFromType(type);
1894
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
1895
+ }
1896
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
1897
+ error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1898
+ }
1899
+ }
1900
+ }
1901
+ function validateFragmentProps(fragment) {
1902
+ {
1903
+ var keys = Object.keys(fragment.props);
1904
+ for (var i = 0; i < keys.length; i++) {
1905
+ var key = keys[i];
1906
+ if (key !== "children" && key !== "key") {
1907
+ setCurrentlyValidatingElement$1(fragment);
1908
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
1909
+ setCurrentlyValidatingElement$1(null);
1910
+ break;
1911
+ }
1912
+ }
1913
+ if (fragment.ref !== null) {
1914
+ setCurrentlyValidatingElement$1(fragment);
1915
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
1916
+ setCurrentlyValidatingElement$1(null);
1917
+ }
1918
+ }
1919
+ }
1920
+ function createElementWithValidation(type, props, children) {
1921
+ var validType = isValidElementType(type);
1922
+ if (!validType) {
1923
+ var info = "";
1924
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
1925
+ info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
1926
+ }
1927
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
1928
+ if (sourceInfo) {
1929
+ info += sourceInfo;
1930
+ } else {
1931
+ info += getDeclarationErrorAddendum();
1932
+ }
1933
+ var typeString;
1934
+ if (type === null) {
1935
+ typeString = "null";
1936
+ } else if (isArray(type)) {
1937
+ typeString = "array";
1938
+ } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
1939
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
1940
+ info = " Did you accidentally export a JSX literal instead of a component?";
1941
+ } else {
1942
+ typeString = typeof type;
1943
+ }
1944
+ {
1945
+ error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
1946
+ }
1947
+ }
1948
+ var element = createElement.apply(this, arguments);
1949
+ if (element == null) {
1950
+ return element;
1951
+ }
1952
+ if (validType) {
1953
+ for (var i = 2; i < arguments.length; i++) {
1954
+ validateChildKeys(arguments[i], type);
1955
+ }
1956
+ }
1957
+ if (type === REACT_FRAGMENT_TYPE) {
1958
+ validateFragmentProps(element);
1959
+ } else {
1960
+ validatePropTypes(element);
1961
+ }
1962
+ return element;
1963
+ }
1964
+ var didWarnAboutDeprecatedCreateFactory = false;
1965
+ function createFactoryWithValidation(type) {
1966
+ var validatedFactory = createElementWithValidation.bind(null, type);
1967
+ validatedFactory.type = type;
1968
+ {
1969
+ if (!didWarnAboutDeprecatedCreateFactory) {
1970
+ didWarnAboutDeprecatedCreateFactory = true;
1971
+ warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
1972
+ }
1973
+ Object.defineProperty(validatedFactory, "type", {
1974
+ enumerable: false,
1975
+ get: function() {
1976
+ warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
1977
+ Object.defineProperty(this, "type", {
1978
+ value: type
1979
+ });
1980
+ return type;
1981
+ }
1982
+ });
1983
+ }
1984
+ return validatedFactory;
1985
+ }
1986
+ function cloneElementWithValidation(element, props, children) {
1987
+ var newElement = cloneElement.apply(this, arguments);
1988
+ for (var i = 2; i < arguments.length; i++) {
1989
+ validateChildKeys(arguments[i], newElement.type);
1990
+ }
1991
+ validatePropTypes(newElement);
1992
+ return newElement;
1993
+ }
1994
+ function startTransition(scope, options) {
1995
+ var prevTransition = ReactCurrentBatchConfig.transition;
1996
+ ReactCurrentBatchConfig.transition = {};
1997
+ var currentTransition = ReactCurrentBatchConfig.transition;
1998
+ {
1999
+ ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
2000
+ }
2001
+ try {
2002
+ scope();
2003
+ } finally {
2004
+ ReactCurrentBatchConfig.transition = prevTransition;
2005
+ {
2006
+ if (prevTransition === null && currentTransition._updatedFibers) {
2007
+ var updatedFibersCount = currentTransition._updatedFibers.size;
2008
+ if (updatedFibersCount > 10) {
2009
+ warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
2010
+ }
2011
+ currentTransition._updatedFibers.clear();
2012
+ }
2013
+ }
2014
+ }
2015
+ }
2016
+ var didWarnAboutMessageChannel = false;
2017
+ var enqueueTaskImpl = null;
2018
+ function enqueueTask(task) {
2019
+ if (enqueueTaskImpl === null) {
2020
+ try {
2021
+ var requireString = ("require" + Math.random()).slice(0, 7);
2022
+ var nodeRequire = module && module[requireString];
2023
+ enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
2024
+ } catch (_err) {
2025
+ enqueueTaskImpl = function(callback) {
2026
+ {
2027
+ if (didWarnAboutMessageChannel === false) {
2028
+ didWarnAboutMessageChannel = true;
2029
+ if (typeof MessageChannel === "undefined") {
2030
+ error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
2031
+ }
2032
+ }
2033
+ }
2034
+ var channel = new MessageChannel();
2035
+ channel.port1.onmessage = callback;
2036
+ channel.port2.postMessage(void 0);
2037
+ };
2038
+ }
2039
+ }
2040
+ return enqueueTaskImpl(task);
2041
+ }
2042
+ var actScopeDepth = 0;
2043
+ var didWarnNoAwaitAct = false;
2044
+ function act(callback) {
2045
+ {
2046
+ var prevActScopeDepth = actScopeDepth;
2047
+ actScopeDepth++;
2048
+ if (ReactCurrentActQueue.current === null) {
2049
+ ReactCurrentActQueue.current = [];
2050
+ }
2051
+ var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
2052
+ var result;
2053
+ try {
2054
+ ReactCurrentActQueue.isBatchingLegacy = true;
2055
+ result = callback();
2056
+ if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
2057
+ var queue = ReactCurrentActQueue.current;
2058
+ if (queue !== null) {
2059
+ ReactCurrentActQueue.didScheduleLegacyUpdate = false;
2060
+ flushActQueue(queue);
2061
+ }
2062
+ }
2063
+ } catch (error2) {
2064
+ popActScope(prevActScopeDepth);
2065
+ throw error2;
2066
+ } finally {
2067
+ ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
2068
+ }
2069
+ if (result !== null && typeof result === "object" && typeof result.then === "function") {
2070
+ var thenableResult = result;
2071
+ var wasAwaited = false;
2072
+ var thenable = {
2073
+ then: function(resolve, reject) {
2074
+ wasAwaited = true;
2075
+ thenableResult.then(function(returnValue2) {
2076
+ popActScope(prevActScopeDepth);
2077
+ if (actScopeDepth === 0) {
2078
+ recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
2079
+ } else {
2080
+ resolve(returnValue2);
2081
+ }
2082
+ }, function(error2) {
2083
+ popActScope(prevActScopeDepth);
2084
+ reject(error2);
2085
+ });
2086
+ }
2087
+ };
2088
+ {
2089
+ if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
2090
+ Promise.resolve().then(function() {
2091
+ }).then(function() {
2092
+ if (!wasAwaited) {
2093
+ didWarnNoAwaitAct = true;
2094
+ error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
2095
+ }
2096
+ });
2097
+ }
2098
+ }
2099
+ return thenable;
2100
+ } else {
2101
+ var returnValue = result;
2102
+ popActScope(prevActScopeDepth);
2103
+ if (actScopeDepth === 0) {
2104
+ var _queue = ReactCurrentActQueue.current;
2105
+ if (_queue !== null) {
2106
+ flushActQueue(_queue);
2107
+ ReactCurrentActQueue.current = null;
2108
+ }
2109
+ var _thenable = {
2110
+ then: function(resolve, reject) {
2111
+ if (ReactCurrentActQueue.current === null) {
2112
+ ReactCurrentActQueue.current = [];
2113
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2114
+ } else {
2115
+ resolve(returnValue);
2116
+ }
2117
+ }
2118
+ };
2119
+ return _thenable;
2120
+ } else {
2121
+ var _thenable2 = {
2122
+ then: function(resolve, reject) {
2123
+ resolve(returnValue);
2124
+ }
2125
+ };
2126
+ return _thenable2;
2127
+ }
2128
+ }
2129
+ }
2130
+ }
2131
+ function popActScope(prevActScopeDepth) {
2132
+ {
2133
+ if (prevActScopeDepth !== actScopeDepth - 1) {
2134
+ error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
2135
+ }
2136
+ actScopeDepth = prevActScopeDepth;
2137
+ }
2138
+ }
2139
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
2140
+ {
2141
+ var queue = ReactCurrentActQueue.current;
2142
+ if (queue !== null) {
2143
+ try {
2144
+ flushActQueue(queue);
2145
+ enqueueTask(function() {
2146
+ if (queue.length === 0) {
2147
+ ReactCurrentActQueue.current = null;
2148
+ resolve(returnValue);
2149
+ } else {
2150
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2151
+ }
2152
+ });
2153
+ } catch (error2) {
2154
+ reject(error2);
2155
+ }
2156
+ } else {
2157
+ resolve(returnValue);
2158
+ }
2159
+ }
2160
+ }
2161
+ var isFlushing = false;
2162
+ function flushActQueue(queue) {
2163
+ {
2164
+ if (!isFlushing) {
2165
+ isFlushing = true;
2166
+ var i = 0;
2167
+ try {
2168
+ for (; i < queue.length; i++) {
2169
+ var callback = queue[i];
2170
+ do {
2171
+ callback = callback(true);
2172
+ } while (callback !== null);
2173
+ }
2174
+ queue.length = 0;
2175
+ } catch (error2) {
2176
+ queue = queue.slice(i + 1);
2177
+ throw error2;
2178
+ } finally {
2179
+ isFlushing = false;
2180
+ }
2181
+ }
2182
+ }
2183
+ }
2184
+ var createElement$1 = createElementWithValidation;
2185
+ var cloneElement$1 = cloneElementWithValidation;
2186
+ var createFactory = createFactoryWithValidation;
2187
+ var Children = {
2188
+ map: mapChildren,
2189
+ forEach: forEachChildren,
2190
+ count: countChildren,
2191
+ toArray,
2192
+ only: onlyChild
2193
+ };
2194
+ exports.Children = Children;
2195
+ exports.Component = Component;
2196
+ exports.Fragment = REACT_FRAGMENT_TYPE;
2197
+ exports.Profiler = REACT_PROFILER_TYPE;
2198
+ exports.PureComponent = PureComponent;
2199
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
2200
+ exports.Suspense = REACT_SUSPENSE_TYPE;
2201
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2202
+ exports.cloneElement = cloneElement$1;
2203
+ exports.createContext = createContext;
2204
+ exports.createElement = createElement$1;
2205
+ exports.createFactory = createFactory;
2206
+ exports.createRef = createRef;
2207
+ exports.forwardRef = forwardRef;
2208
+ exports.isValidElement = isValidElement;
2209
+ exports.lazy = lazy;
2210
+ exports.memo = memo;
2211
+ exports.startTransition = startTransition;
2212
+ exports.unstable_act = act;
2213
+ exports.useCallback = useCallback;
2214
+ exports.useContext = useContext;
2215
+ exports.useDebugValue = useDebugValue;
2216
+ exports.useDeferredValue = useDeferredValue;
2217
+ exports.useEffect = useEffect;
2218
+ exports.useId = useId;
2219
+ exports.useImperativeHandle = useImperativeHandle;
2220
+ exports.useInsertionEffect = useInsertionEffect;
2221
+ exports.useLayoutEffect = useLayoutEffect;
2222
+ exports.useMemo = useMemo;
2223
+ exports.useReducer = useReducer;
2224
+ exports.useRef = useRef;
2225
+ exports.useState = useState;
2226
+ exports.useSyncExternalStore = useSyncExternalStore;
2227
+ exports.useTransition = useTransition;
2228
+ exports.version = ReactVersion;
2229
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
2230
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2231
+ }
2232
+ })();
2233
+ }
2234
+ }
2235
+ });
2236
+
2237
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
2238
+ var require_react = __commonJS({
2239
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js"(exports, module) {
2240
+ init_esm_shims();
2241
+ if (process.env.NODE_ENV === "production") {
2242
+ module.exports = require_react_production_min();
2243
+ } else {
2244
+ module.exports = require_react_development();
2245
+ }
2246
+ }
2247
+ });
2248
+
2249
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js
2250
+ var require_react_jsx_runtime_production_min = __commonJS({
2251
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports) {
2252
+ init_esm_shims();
2253
+ var f = require_react();
2254
+ var k = Symbol.for("react.element");
2255
+ var l = Symbol.for("react.fragment");
2256
+ var m = Object.prototype.hasOwnProperty;
2257
+ var n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
2258
+ var p = { key: true, ref: true, __self: true, __source: true };
2259
+ function q(c, a, g) {
2260
+ var b, d = {}, e = null, h = null;
2261
+ void 0 !== g && (e = "" + g);
2262
+ void 0 !== a.key && (e = "" + a.key);
2263
+ void 0 !== a.ref && (h = a.ref);
2264
+ for (b in a)
2265
+ m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
2266
+ if (c && c.defaultProps)
2267
+ for (b in a = c.defaultProps, a)
2268
+ void 0 === d[b] && (d[b] = a[b]);
2269
+ return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
2270
+ }
2271
+ exports.Fragment = l;
2272
+ exports.jsx = q;
2273
+ exports.jsxs = q;
2274
+ }
2275
+ });
2276
+
2277
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js
2278
+ var require_react_jsx_runtime_development = __commonJS({
2279
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
2280
+ init_esm_shims();
2281
+ if (process.env.NODE_ENV !== "production") {
2282
+ (function() {
2283
+ var React = require_react();
2284
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
2285
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
2286
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
2287
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
2288
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
2289
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
2290
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
2291
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
2292
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
2293
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
2294
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
2295
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
2296
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
2297
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
2298
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
2299
+ function getIteratorFn(maybeIterable) {
2300
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
2301
+ return null;
2302
+ }
2303
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
2304
+ if (typeof maybeIterator === "function") {
2305
+ return maybeIterator;
2306
+ }
2307
+ return null;
2308
+ }
2309
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2310
+ function error(format) {
2311
+ {
2312
+ {
2313
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2314
+ args[_key2 - 1] = arguments[_key2];
2315
+ }
2316
+ printWarning("error", format, args);
2317
+ }
2318
+ }
2319
+ }
2320
+ function printWarning(level, format, args) {
2321
+ {
2322
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
2323
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
2324
+ if (stack !== "") {
2325
+ format += "%s";
2326
+ args = args.concat([stack]);
2327
+ }
2328
+ var argsWithFormat = args.map(function(item) {
2329
+ return String(item);
2330
+ });
2331
+ argsWithFormat.unshift("Warning: " + format);
2332
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
2333
+ }
2334
+ }
2335
+ var enableScopeAPI = false;
2336
+ var enableCacheElement = false;
2337
+ var enableTransitionTracing = false;
2338
+ var enableLegacyHidden = false;
2339
+ var enableDebugTracing = false;
2340
+ var REACT_MODULE_REFERENCE;
2341
+ {
2342
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
2343
+ }
2344
+ function isValidElementType(type) {
2345
+ if (typeof type === "string" || typeof type === "function") {
2346
+ return true;
2347
+ }
2348
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
2349
+ return true;
2350
+ }
2351
+ if (typeof type === "object" && type !== null) {
2352
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
2353
+ // types supported by any Flight configuration anywhere since
2354
+ // we don't know which Flight build this will end up being used
2355
+ // with.
2356
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
2357
+ return true;
2358
+ }
2359
+ }
2360
+ return false;
2361
+ }
2362
+ function getWrappedName(outerType, innerType, wrapperName) {
2363
+ var displayName = outerType.displayName;
2364
+ if (displayName) {
2365
+ return displayName;
2366
+ }
2367
+ var functionName = innerType.displayName || innerType.name || "";
2368
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
2369
+ }
2370
+ function getContextName(type) {
2371
+ return type.displayName || "Context";
2372
+ }
2373
+ function getComponentNameFromType(type) {
2374
+ if (type == null) {
2375
+ return null;
2376
+ }
2377
+ {
2378
+ if (typeof type.tag === "number") {
2379
+ error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
2380
+ }
2381
+ }
2382
+ if (typeof type === "function") {
2383
+ return type.displayName || type.name || null;
2384
+ }
2385
+ if (typeof type === "string") {
2386
+ return type;
2387
+ }
2388
+ switch (type) {
2389
+ case REACT_FRAGMENT_TYPE:
2390
+ return "Fragment";
2391
+ case REACT_PORTAL_TYPE:
2392
+ return "Portal";
2393
+ case REACT_PROFILER_TYPE:
2394
+ return "Profiler";
2395
+ case REACT_STRICT_MODE_TYPE:
2396
+ return "StrictMode";
2397
+ case REACT_SUSPENSE_TYPE:
2398
+ return "Suspense";
2399
+ case REACT_SUSPENSE_LIST_TYPE:
2400
+ return "SuspenseList";
2401
+ }
2402
+ if (typeof type === "object") {
2403
+ switch (type.$$typeof) {
2404
+ case REACT_CONTEXT_TYPE:
2405
+ var context = type;
2406
+ return getContextName(context) + ".Consumer";
2407
+ case REACT_PROVIDER_TYPE:
2408
+ var provider = type;
2409
+ return getContextName(provider._context) + ".Provider";
2410
+ case REACT_FORWARD_REF_TYPE:
2411
+ return getWrappedName(type, type.render, "ForwardRef");
2412
+ case REACT_MEMO_TYPE:
2413
+ var outerName = type.displayName || null;
2414
+ if (outerName !== null) {
2415
+ return outerName;
2416
+ }
2417
+ return getComponentNameFromType(type.type) || "Memo";
2418
+ case REACT_LAZY_TYPE: {
2419
+ var lazyComponent = type;
2420
+ var payload = lazyComponent._payload;
2421
+ var init = lazyComponent._init;
2422
+ try {
2423
+ return getComponentNameFromType(init(payload));
2424
+ } catch (x) {
2425
+ return null;
2426
+ }
2427
+ }
2428
+ }
2429
+ }
2430
+ return null;
2431
+ }
2432
+ var assign = Object.assign;
2433
+ var disabledDepth = 0;
2434
+ var prevLog;
2435
+ var prevInfo;
2436
+ var prevWarn;
2437
+ var prevError;
2438
+ var prevGroup;
2439
+ var prevGroupCollapsed;
2440
+ var prevGroupEnd;
2441
+ function disabledLog() {
2442
+ }
2443
+ disabledLog.__reactDisabledLog = true;
2444
+ function disableLogs() {
2445
+ {
2446
+ if (disabledDepth === 0) {
2447
+ prevLog = console.log;
2448
+ prevInfo = console.info;
2449
+ prevWarn = console.warn;
2450
+ prevError = console.error;
2451
+ prevGroup = console.group;
2452
+ prevGroupCollapsed = console.groupCollapsed;
2453
+ prevGroupEnd = console.groupEnd;
2454
+ var props = {
2455
+ configurable: true,
2456
+ enumerable: true,
2457
+ value: disabledLog,
2458
+ writable: true
2459
+ };
2460
+ Object.defineProperties(console, {
2461
+ info: props,
2462
+ log: props,
2463
+ warn: props,
2464
+ error: props,
2465
+ group: props,
2466
+ groupCollapsed: props,
2467
+ groupEnd: props
2468
+ });
2469
+ }
2470
+ disabledDepth++;
2471
+ }
2472
+ }
2473
+ function reenableLogs() {
2474
+ {
2475
+ disabledDepth--;
2476
+ if (disabledDepth === 0) {
2477
+ var props = {
2478
+ configurable: true,
2479
+ enumerable: true,
2480
+ writable: true
2481
+ };
2482
+ Object.defineProperties(console, {
2483
+ log: assign({}, props, {
2484
+ value: prevLog
2485
+ }),
2486
+ info: assign({}, props, {
2487
+ value: prevInfo
2488
+ }),
2489
+ warn: assign({}, props, {
2490
+ value: prevWarn
2491
+ }),
2492
+ error: assign({}, props, {
2493
+ value: prevError
2494
+ }),
2495
+ group: assign({}, props, {
2496
+ value: prevGroup
2497
+ }),
2498
+ groupCollapsed: assign({}, props, {
2499
+ value: prevGroupCollapsed
2500
+ }),
2501
+ groupEnd: assign({}, props, {
2502
+ value: prevGroupEnd
2503
+ })
2504
+ });
2505
+ }
2506
+ if (disabledDepth < 0) {
2507
+ error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
2508
+ }
2509
+ }
2510
+ }
2511
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
2512
+ var prefix;
2513
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
2514
+ {
2515
+ if (prefix === void 0) {
2516
+ try {
2517
+ throw Error();
2518
+ } catch (x) {
2519
+ var match = x.stack.trim().match(/\n( *(at )?)/);
2520
+ prefix = match && match[1] || "";
2521
+ }
2522
+ }
2523
+ return "\n" + prefix + name;
2524
+ }
2525
+ }
2526
+ var reentry = false;
2527
+ var componentFrameCache;
2528
+ {
2529
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
2530
+ componentFrameCache = new PossiblyWeakMap();
2531
+ }
2532
+ function describeNativeComponentFrame(fn, construct) {
2533
+ if (!fn || reentry) {
2534
+ return "";
2535
+ }
2536
+ {
2537
+ var frame = componentFrameCache.get(fn);
2538
+ if (frame !== void 0) {
2539
+ return frame;
2540
+ }
2541
+ }
2542
+ var control;
2543
+ reentry = true;
2544
+ var previousPrepareStackTrace = Error.prepareStackTrace;
2545
+ Error.prepareStackTrace = void 0;
2546
+ var previousDispatcher;
2547
+ {
2548
+ previousDispatcher = ReactCurrentDispatcher.current;
2549
+ ReactCurrentDispatcher.current = null;
2550
+ disableLogs();
2551
+ }
2552
+ try {
2553
+ if (construct) {
2554
+ var Fake = function() {
2555
+ throw Error();
2556
+ };
2557
+ Object.defineProperty(Fake.prototype, "props", {
2558
+ set: function() {
2559
+ throw Error();
2560
+ }
2561
+ });
2562
+ if (typeof Reflect === "object" && Reflect.construct) {
2563
+ try {
2564
+ Reflect.construct(Fake, []);
2565
+ } catch (x) {
2566
+ control = x;
2567
+ }
2568
+ Reflect.construct(fn, [], Fake);
2569
+ } else {
2570
+ try {
2571
+ Fake.call();
2572
+ } catch (x) {
2573
+ control = x;
2574
+ }
2575
+ fn.call(Fake.prototype);
2576
+ }
2577
+ } else {
2578
+ try {
2579
+ throw Error();
2580
+ } catch (x) {
2581
+ control = x;
2582
+ }
2583
+ fn();
2584
+ }
2585
+ } catch (sample) {
2586
+ if (sample && control && typeof sample.stack === "string") {
2587
+ var sampleLines = sample.stack.split("\n");
2588
+ var controlLines = control.stack.split("\n");
2589
+ var s = sampleLines.length - 1;
2590
+ var c = controlLines.length - 1;
2591
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
2592
+ c--;
2593
+ }
2594
+ for (; s >= 1 && c >= 0; s--, c--) {
2595
+ if (sampleLines[s] !== controlLines[c]) {
2596
+ if (s !== 1 || c !== 1) {
2597
+ do {
2598
+ s--;
2599
+ c--;
2600
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
2601
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
2602
+ if (fn.displayName && _frame.includes("<anonymous>")) {
2603
+ _frame = _frame.replace("<anonymous>", fn.displayName);
2604
+ }
2605
+ {
2606
+ if (typeof fn === "function") {
2607
+ componentFrameCache.set(fn, _frame);
2608
+ }
2609
+ }
2610
+ return _frame;
2611
+ }
2612
+ } while (s >= 1 && c >= 0);
2613
+ }
2614
+ break;
2615
+ }
2616
+ }
2617
+ }
2618
+ } finally {
2619
+ reentry = false;
2620
+ {
2621
+ ReactCurrentDispatcher.current = previousDispatcher;
2622
+ reenableLogs();
2623
+ }
2624
+ Error.prepareStackTrace = previousPrepareStackTrace;
2625
+ }
2626
+ var name = fn ? fn.displayName || fn.name : "";
2627
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
2628
+ {
2629
+ if (typeof fn === "function") {
2630
+ componentFrameCache.set(fn, syntheticFrame);
2631
+ }
2632
+ }
2633
+ return syntheticFrame;
2634
+ }
2635
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
2636
+ {
2637
+ return describeNativeComponentFrame(fn, false);
2638
+ }
2639
+ }
2640
+ function shouldConstruct(Component) {
2641
+ var prototype = Component.prototype;
2642
+ return !!(prototype && prototype.isReactComponent);
2643
+ }
2644
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2645
+ if (type == null) {
2646
+ return "";
2647
+ }
2648
+ if (typeof type === "function") {
2649
+ {
2650
+ return describeNativeComponentFrame(type, shouldConstruct(type));
2651
+ }
2652
+ }
2653
+ if (typeof type === "string") {
2654
+ return describeBuiltInComponentFrame(type);
2655
+ }
2656
+ switch (type) {
2657
+ case REACT_SUSPENSE_TYPE:
2658
+ return describeBuiltInComponentFrame("Suspense");
2659
+ case REACT_SUSPENSE_LIST_TYPE:
2660
+ return describeBuiltInComponentFrame("SuspenseList");
2661
+ }
2662
+ if (typeof type === "object") {
2663
+ switch (type.$$typeof) {
2664
+ case REACT_FORWARD_REF_TYPE:
2665
+ return describeFunctionComponentFrame(type.render);
2666
+ case REACT_MEMO_TYPE:
2667
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2668
+ case REACT_LAZY_TYPE: {
2669
+ var lazyComponent = type;
2670
+ var payload = lazyComponent._payload;
2671
+ var init = lazyComponent._init;
2672
+ try {
2673
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2674
+ } catch (x) {
2675
+ }
2676
+ }
2677
+ }
2678
+ }
2679
+ return "";
2680
+ }
2681
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
2682
+ var loggedTypeFailures = {};
2683
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2684
+ function setCurrentlyValidatingElement(element) {
2685
+ {
2686
+ if (element) {
2687
+ var owner = element._owner;
2688
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2689
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
2690
+ } else {
2691
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
2692
+ }
2693
+ }
2694
+ }
2695
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
2696
+ {
2697
+ var has = Function.call.bind(hasOwnProperty);
2698
+ for (var typeSpecName in typeSpecs) {
2699
+ if (has(typeSpecs, typeSpecName)) {
2700
+ var error$1 = void 0;
2701
+ try {
2702
+ if (typeof typeSpecs[typeSpecName] !== "function") {
2703
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
2704
+ err.name = "Invariant Violation";
2705
+ throw err;
2706
+ }
2707
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
2708
+ } catch (ex) {
2709
+ error$1 = ex;
2710
+ }
2711
+ if (error$1 && !(error$1 instanceof Error)) {
2712
+ setCurrentlyValidatingElement(element);
2713
+ error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
2714
+ setCurrentlyValidatingElement(null);
2715
+ }
2716
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2717
+ loggedTypeFailures[error$1.message] = true;
2718
+ setCurrentlyValidatingElement(element);
2719
+ error("Failed %s type: %s", location, error$1.message);
2720
+ setCurrentlyValidatingElement(null);
2721
+ }
2722
+ }
2723
+ }
2724
+ }
2725
+ }
2726
+ var isArrayImpl = Array.isArray;
2727
+ function isArray(a) {
2728
+ return isArrayImpl(a);
2729
+ }
2730
+ function typeName(value) {
2731
+ {
2732
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
2733
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
2734
+ return type;
2735
+ }
2736
+ }
2737
+ function willCoercionThrow(value) {
2738
+ {
2739
+ try {
2740
+ testStringCoercion(value);
2741
+ return false;
2742
+ } catch (e) {
2743
+ return true;
2744
+ }
2745
+ }
2746
+ }
2747
+ function testStringCoercion(value) {
2748
+ return "" + value;
2749
+ }
2750
+ function checkKeyStringCoercion(value) {
2751
+ {
2752
+ if (willCoercionThrow(value)) {
2753
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
2754
+ return testStringCoercion(value);
2755
+ }
2756
+ }
2757
+ }
2758
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
2759
+ var RESERVED_PROPS = {
2760
+ key: true,
2761
+ ref: true,
2762
+ __self: true,
2763
+ __source: true
2764
+ };
2765
+ var specialPropKeyWarningShown;
2766
+ var specialPropRefWarningShown;
2767
+ var didWarnAboutStringRefs;
2768
+ {
2769
+ didWarnAboutStringRefs = {};
2770
+ }
2771
+ function hasValidRef(config) {
2772
+ {
2773
+ if (hasOwnProperty.call(config, "ref")) {
2774
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
2775
+ if (getter && getter.isReactWarning) {
2776
+ return false;
2777
+ }
2778
+ }
2779
+ }
2780
+ return config.ref !== void 0;
2781
+ }
2782
+ function hasValidKey(config) {
2783
+ {
2784
+ if (hasOwnProperty.call(config, "key")) {
2785
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
2786
+ if (getter && getter.isReactWarning) {
2787
+ return false;
2788
+ }
2789
+ }
2790
+ }
2791
+ return config.key !== void 0;
2792
+ }
2793
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
2794
+ {
2795
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
2796
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
2797
+ if (!didWarnAboutStringRefs[componentName]) {
2798
+ error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
2799
+ didWarnAboutStringRefs[componentName] = true;
2800
+ }
2801
+ }
2802
+ }
2803
+ }
2804
+ function defineKeyPropWarningGetter(props, displayName) {
2805
+ {
2806
+ var warnAboutAccessingKey = function() {
2807
+ if (!specialPropKeyWarningShown) {
2808
+ specialPropKeyWarningShown = true;
2809
+ error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
2810
+ }
2811
+ };
2812
+ warnAboutAccessingKey.isReactWarning = true;
2813
+ Object.defineProperty(props, "key", {
2814
+ get: warnAboutAccessingKey,
2815
+ configurable: true
2816
+ });
2817
+ }
2818
+ }
2819
+ function defineRefPropWarningGetter(props, displayName) {
2820
+ {
2821
+ var warnAboutAccessingRef = function() {
2822
+ if (!specialPropRefWarningShown) {
2823
+ specialPropRefWarningShown = true;
2824
+ error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
2825
+ }
2826
+ };
2827
+ warnAboutAccessingRef.isReactWarning = true;
2828
+ Object.defineProperty(props, "ref", {
2829
+ get: warnAboutAccessingRef,
2830
+ configurable: true
2831
+ });
2832
+ }
2833
+ }
2834
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
2835
+ var element = {
2836
+ // This tag allows us to uniquely identify this as a React Element
2837
+ $$typeof: REACT_ELEMENT_TYPE,
2838
+ // Built-in properties that belong on the element
2839
+ type,
2840
+ key,
2841
+ ref,
2842
+ props,
2843
+ // Record the component responsible for creating this element.
2844
+ _owner: owner
2845
+ };
2846
+ {
2847
+ element._store = {};
2848
+ Object.defineProperty(element._store, "validated", {
2849
+ configurable: false,
2850
+ enumerable: false,
2851
+ writable: true,
2852
+ value: false
2853
+ });
2854
+ Object.defineProperty(element, "_self", {
2855
+ configurable: false,
2856
+ enumerable: false,
2857
+ writable: false,
2858
+ value: self
2859
+ });
2860
+ Object.defineProperty(element, "_source", {
2861
+ configurable: false,
2862
+ enumerable: false,
2863
+ writable: false,
2864
+ value: source
2865
+ });
2866
+ if (Object.freeze) {
2867
+ Object.freeze(element.props);
2868
+ Object.freeze(element);
2869
+ }
2870
+ }
2871
+ return element;
2872
+ };
2873
+ function jsxDEV(type, config, maybeKey, source, self) {
2874
+ {
2875
+ var propName;
2876
+ var props = {};
2877
+ var key = null;
2878
+ var ref = null;
2879
+ if (maybeKey !== void 0) {
2880
+ {
2881
+ checkKeyStringCoercion(maybeKey);
2882
+ }
2883
+ key = "" + maybeKey;
2884
+ }
2885
+ if (hasValidKey(config)) {
2886
+ {
2887
+ checkKeyStringCoercion(config.key);
2888
+ }
2889
+ key = "" + config.key;
2890
+ }
2891
+ if (hasValidRef(config)) {
2892
+ ref = config.ref;
2893
+ warnIfStringRefCannotBeAutoConverted(config, self);
2894
+ }
2895
+ for (propName in config) {
2896
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2897
+ props[propName] = config[propName];
2898
+ }
2899
+ }
2900
+ if (type && type.defaultProps) {
2901
+ var defaultProps = type.defaultProps;
2902
+ for (propName in defaultProps) {
2903
+ if (props[propName] === void 0) {
2904
+ props[propName] = defaultProps[propName];
2905
+ }
2906
+ }
2907
+ }
2908
+ if (key || ref) {
2909
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
2910
+ if (key) {
2911
+ defineKeyPropWarningGetter(props, displayName);
2912
+ }
2913
+ if (ref) {
2914
+ defineRefPropWarningGetter(props, displayName);
2915
+ }
2916
+ }
2917
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2918
+ }
2919
+ }
2920
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
2921
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2922
+ function setCurrentlyValidatingElement$1(element) {
2923
+ {
2924
+ if (element) {
2925
+ var owner = element._owner;
2926
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2927
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2928
+ } else {
2929
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2930
+ }
2931
+ }
2932
+ }
2933
+ var propTypesMisspellWarningShown;
2934
+ {
2935
+ propTypesMisspellWarningShown = false;
2936
+ }
2937
+ function isValidElement(object) {
2938
+ {
2939
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2940
+ }
2941
+ }
2942
+ function getDeclarationErrorAddendum() {
2943
+ {
2944
+ if (ReactCurrentOwner$1.current) {
2945
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
2946
+ if (name) {
2947
+ return "\n\nCheck the render method of `" + name + "`.";
2948
+ }
2949
+ }
2950
+ return "";
2951
+ }
2952
+ }
2953
+ function getSourceInfoErrorAddendum(source) {
2954
+ {
2955
+ if (source !== void 0) {
2956
+ var fileName = source.fileName.replace(/^.*[\\\/]/, "");
2957
+ var lineNumber = source.lineNumber;
2958
+ return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
2959
+ }
2960
+ return "";
2961
+ }
2962
+ }
2963
+ var ownerHasKeyUseWarning = {};
2964
+ function getCurrentComponentErrorInfo(parentType) {
2965
+ {
2966
+ var info = getDeclarationErrorAddendum();
2967
+ if (!info) {
2968
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
2969
+ if (parentName) {
2970
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2971
+ }
2972
+ }
2973
+ return info;
2974
+ }
2975
+ }
2976
+ function validateExplicitKey(element, parentType) {
2977
+ {
2978
+ if (!element._store || element._store.validated || element.key != null) {
2979
+ return;
2980
+ }
2981
+ element._store.validated = true;
2982
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2983
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2984
+ return;
2985
+ }
2986
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
2987
+ var childOwner = "";
2988
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
2989
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
2990
+ }
2991
+ setCurrentlyValidatingElement$1(element);
2992
+ error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
2993
+ setCurrentlyValidatingElement$1(null);
2994
+ }
2995
+ }
2996
+ function validateChildKeys(node, parentType) {
2997
+ {
2998
+ if (typeof node !== "object") {
2999
+ return;
3000
+ }
3001
+ if (isArray(node)) {
3002
+ for (var i = 0; i < node.length; i++) {
3003
+ var child = node[i];
3004
+ if (isValidElement(child)) {
3005
+ validateExplicitKey(child, parentType);
3006
+ }
3007
+ }
3008
+ } else if (isValidElement(node)) {
3009
+ if (node._store) {
3010
+ node._store.validated = true;
3011
+ }
3012
+ } else if (node) {
3013
+ var iteratorFn = getIteratorFn(node);
3014
+ if (typeof iteratorFn === "function") {
3015
+ if (iteratorFn !== node.entries) {
3016
+ var iterator = iteratorFn.call(node);
3017
+ var step;
3018
+ while (!(step = iterator.next()).done) {
3019
+ if (isValidElement(step.value)) {
3020
+ validateExplicitKey(step.value, parentType);
3021
+ }
3022
+ }
3023
+ }
3024
+ }
3025
+ }
3026
+ }
3027
+ }
3028
+ function validatePropTypes(element) {
3029
+ {
3030
+ var type = element.type;
3031
+ if (type === null || type === void 0 || typeof type === "string") {
3032
+ return;
3033
+ }
3034
+ var propTypes;
3035
+ if (typeof type === "function") {
3036
+ propTypes = type.propTypes;
3037
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
3038
+ // Inner props are checked in the reconciler.
3039
+ type.$$typeof === REACT_MEMO_TYPE)) {
3040
+ propTypes = type.propTypes;
3041
+ } else {
3042
+ return;
3043
+ }
3044
+ if (propTypes) {
3045
+ var name = getComponentNameFromType(type);
3046
+ checkPropTypes(propTypes, element.props, "prop", name, element);
3047
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
3048
+ propTypesMisspellWarningShown = true;
3049
+ var _name = getComponentNameFromType(type);
3050
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
3051
+ }
3052
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
3053
+ error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
3054
+ }
3055
+ }
3056
+ }
3057
+ function validateFragmentProps(fragment) {
3058
+ {
3059
+ var keys = Object.keys(fragment.props);
3060
+ for (var i = 0; i < keys.length; i++) {
3061
+ var key = keys[i];
3062
+ if (key !== "children" && key !== "key") {
3063
+ setCurrentlyValidatingElement$1(fragment);
3064
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
3065
+ setCurrentlyValidatingElement$1(null);
3066
+ break;
3067
+ }
3068
+ }
3069
+ if (fragment.ref !== null) {
3070
+ setCurrentlyValidatingElement$1(fragment);
3071
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
3072
+ setCurrentlyValidatingElement$1(null);
3073
+ }
3074
+ }
3075
+ }
3076
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
3077
+ {
3078
+ var validType = isValidElementType(type);
3079
+ if (!validType) {
3080
+ var info = "";
3081
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
3082
+ info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
3083
+ }
3084
+ var sourceInfo = getSourceInfoErrorAddendum(source);
3085
+ if (sourceInfo) {
3086
+ info += sourceInfo;
3087
+ } else {
3088
+ info += getDeclarationErrorAddendum();
3089
+ }
3090
+ var typeString;
3091
+ if (type === null) {
3092
+ typeString = "null";
3093
+ } else if (isArray(type)) {
3094
+ typeString = "array";
3095
+ } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
3096
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
3097
+ info = " Did you accidentally export a JSX literal instead of a component?";
3098
+ } else {
3099
+ typeString = typeof type;
3100
+ }
3101
+ error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
3102
+ }
3103
+ var element = jsxDEV(type, props, key, source, self);
3104
+ if (element == null) {
3105
+ return element;
3106
+ }
3107
+ if (validType) {
3108
+ var children = props.children;
3109
+ if (children !== void 0) {
3110
+ if (isStaticChildren) {
3111
+ if (isArray(children)) {
3112
+ for (var i = 0; i < children.length; i++) {
3113
+ validateChildKeys(children[i], type);
3114
+ }
3115
+ if (Object.freeze) {
3116
+ Object.freeze(children);
3117
+ }
3118
+ } else {
3119
+ error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
3120
+ }
3121
+ } else {
3122
+ validateChildKeys(children, type);
3123
+ }
3124
+ }
3125
+ }
3126
+ if (type === REACT_FRAGMENT_TYPE) {
3127
+ validateFragmentProps(element);
3128
+ } else {
3129
+ validatePropTypes(element);
3130
+ }
3131
+ return element;
3132
+ }
3133
+ }
3134
+ function jsxWithValidationStatic(type, props, key) {
3135
+ {
3136
+ return jsxWithValidation(type, props, key, true);
3137
+ }
3138
+ }
3139
+ function jsxWithValidationDynamic(type, props, key) {
3140
+ {
3141
+ return jsxWithValidation(type, props, key, false);
3142
+ }
3143
+ }
3144
+ var jsx5 = jsxWithValidationDynamic;
3145
+ var jsxs4 = jsxWithValidationStatic;
3146
+ exports.Fragment = REACT_FRAGMENT_TYPE;
3147
+ exports.jsx = jsx5;
3148
+ exports.jsxs = jsxs4;
3149
+ })();
3150
+ }
3151
+ }
3152
+ });
3153
+
3154
+ // ../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js
3155
+ var require_jsx_runtime = __commonJS({
3156
+ "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js"(exports, module) {
3157
+ init_esm_shims();
3158
+ if (process.env.NODE_ENV === "production") {
3159
+ module.exports = require_react_jsx_runtime_production_min();
3160
+ } else {
3161
+ module.exports = require_react_jsx_runtime_development();
3162
+ }
3163
+ }
3164
+ });
3165
+
3166
+ // src/components/index.ts
3167
+ init_esm_shims();
3168
+
3169
+ // src/components/Mutation.tsx
3170
+ init_esm_shims();
3171
+
3172
+ // src/TypeBuilder.ts
3173
+ init_esm_shims();
3174
+
3175
+ // src/TypeGenerator.ts
3176
+ init_esm_shims();
3177
+
3178
+ // src/plugin.ts
3179
+ init_esm_shims();
3180
+
3181
+ // src/OperationGenerator.tsx
3182
+ init_esm_shims();
3183
+
3184
+ // src/components/Oas.tsx
3185
+ init_esm_shims();
3186
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
3187
+ function Template({
3188
+ name,
3189
+ typeName,
3190
+ api
3191
+ }) {
3192
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
3193
+ `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const`,
3194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
3195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` })
3196
+ ] });
3197
+ }
3198
+ var defaultTemplates = { default: Template };
3199
+ function Oas({
3200
+ name,
3201
+ typeName,
3202
+ Template: Template2 = defaultTemplates.default
3203
+ }) {
3204
+ const oas = useOas();
3205
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Template2, { name, typeName, api: oas.api });
3206
+ }
3207
+ Oas.File = function({ name, typeName, templates = defaultTemplates }) {
3208
+ const { key: pluginKey2 } = usePlugin();
3209
+ const file = useFile({ name, pluginKey: pluginKey2 });
3210
+ const Template2 = templates.default;
3211
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
3212
+ File,
3213
+ {
3214
+ baseName: file.baseName,
3215
+ path: file.path,
3216
+ meta: file.meta,
3217
+ children: [
3218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Import, { name: ["Infer"], path: "@kubb/swagger-ts/oas", isTypeOnly: true }),
3219
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Source, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Oas, { Template: Template2, name, typeName }) })
3220
+ ]
3221
+ }
3222
+ );
3223
+ };
3224
+ Oas.templates = defaultTemplates;
3225
+
3226
+ // src/components/Query.tsx
3227
+ init_esm_shims();
3228
+ var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
3229
+ function printCombinedSchema(name, operation, schemas) {
3230
+ const properties = {
3231
+ "response": factory2.createTypeReferenceNode(
3232
+ factory2.createIdentifier(schemas.response.name),
3233
+ void 0
3234
+ )
3235
+ };
3236
+ if (schemas.request) {
3237
+ properties["request"] = factory2.createTypeReferenceNode(
3238
+ factory2.createIdentifier(schemas.request.name),
3239
+ void 0
3240
+ );
3241
+ }
3242
+ if (schemas.pathParams) {
3243
+ properties["pathParams"] = factory2.createTypeReferenceNode(
3244
+ factory2.createIdentifier(schemas.pathParams.name),
3245
+ void 0
3246
+ );
3247
+ }
3248
+ if (schemas.queryParams) {
3249
+ properties["queryParams"] = factory2.createTypeReferenceNode(
3250
+ factory2.createIdentifier(schemas.queryParams.name),
3251
+ void 0
3252
+ );
3253
+ }
3254
+ if (schemas.headerParams) {
3255
+ properties["headerParams"] = factory2.createTypeReferenceNode(
3256
+ factory2.createIdentifier(schemas.headerParams.name),
3257
+ void 0
3258
+ );
3259
+ }
3260
+ if (schemas.errors) {
3261
+ properties["errors"] = factory2.createUnionDeclaration({
3262
+ nodes: schemas.errors.map((error) => {
3263
+ return factory2.createTypeReferenceNode(
3264
+ factory2.createIdentifier(error.name),
3265
+ void 0
3266
+ );
3267
+ })
3268
+ });
3269
+ }
3270
+ const namespaceNode = factory2.createNamespaceDeclaration({
3271
+ name: operation.method === "get" ? `${name}Query` : `${name}Mutation`,
3272
+ statements: Object.keys(properties).map((key) => {
3273
+ const type = properties[key];
3274
+ if (!type) {
3275
+ return void 0;
3276
+ }
3277
+ return factory2.createTypeAliasDeclaration({
3278
+ modifiers: [factory2.modifiers.export],
3279
+ name: transformers2.pascalCase(key),
3280
+ type
3281
+ });
3282
+ }).filter(Boolean)
3283
+ });
3284
+ return print(namespaceNode);
3285
+ }
3286
+ function Query({
3287
+ builder
3288
+ }) {
3289
+ const { source } = builder.build();
3290
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: source });
3291
+ }
3292
+ Query.File = function({ mode }) {
3293
+ const { options } = usePlugin();
3294
+ const schemas = useSchemas();
3295
+ const pluginManager = usePluginManager();
3296
+ const oas = useOas();
3297
+ const file = useOperationFile();
3298
+ const factoryName = useOperationName({ type: "type" });
3299
+ const operation = useOperation();
3300
+ const builder = new TypeBuilder(options, { oas, pluginManager }).add(schemas.pathParams).add(schemas.queryParams).add(schemas.headerParams).add(schemas.response).add(schemas.errors);
3301
+ const { source, imports } = builder.build();
3302
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
3303
+ File,
3304
+ {
3305
+ baseName: file.baseName,
3306
+ path: file.path,
3307
+ meta: file.meta,
3308
+ children: [
3309
+ mode === "directory" && imports.map((item, index) => {
3310
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(File.Import, { root: file.path, ...item }, index);
3311
+ }),
3312
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(File.Source, { children: [
3313
+ source,
3314
+ printCombinedSchema(factoryName, operation, schemas)
3315
+ ] })
3316
+ ]
3317
+ }
3318
+ ) });
3319
+ };
3320
+
3321
+ // src/OperationGenerator.tsx
3322
+ var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
3323
+ var OperationGenerator = class extends OperationGenerator$1 {
3324
+ async all() {
3325
+ const { oas, pluginManager, plugin } = this.context;
3326
+ if (!plugin.options.oasType) {
3327
+ return null;
3328
+ }
3329
+ const root = createRoot({ logger: pluginManager.logger });
3330
+ root.render(
3331
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Oas.File, { name: "oas", typeName: "Oas" }),
3332
+ { meta: { oas, pluginManager, plugin } }
3333
+ );
3334
+ return root.files;
3335
+ }
3336
+ async get(operation, schemas, options) {
3337
+ const { oas, pluginManager, plugin, mode = "directory" } = this.context;
3338
+ const root = createRoot({ logger: pluginManager.logger });
3339
+ root.render(
3340
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Query.File, { mode }),
3341
+ { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } }
3342
+ );
3343
+ return root.files;
3344
+ }
3345
+ async post(operation, schemas, options) {
3346
+ const { oas, pluginManager, plugin, mode = "directory" } = this.context;
3347
+ const root = createRoot({ logger: pluginManager.logger });
3348
+ root.render(
3349
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Mutation.File, { mode }),
3350
+ { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } }
3351
+ );
3352
+ return root.files;
3353
+ }
3354
+ async put(operation, schemas, options) {
3355
+ return this.post(operation, schemas, options);
3356
+ }
3357
+ async patch(operation, schemas, options) {
3358
+ return this.post(operation, schemas, options);
3359
+ }
3360
+ async delete(operation, schemas, options) {
3361
+ return this.post(operation, schemas, options);
3362
+ }
3363
+ };
3364
+
3365
+ // src/plugin.ts
3366
+ var pluginName = "swagger-ts";
3367
+ var pluginKey = [pluginName];
3368
+ createPlugin((options) => {
3369
+ const {
3370
+ output = { path: "types" },
3371
+ group,
3372
+ exclude = [],
3373
+ include,
3374
+ override = [],
3375
+ enumType = "asConst",
3376
+ dateType = "string",
3377
+ optionalType = "questionToken",
3378
+ transformers: transformers5 = {},
3379
+ oasType = false
3380
+ } = options;
3381
+ const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
3382
+ return {
3383
+ name: pluginName,
3384
+ options: {
3385
+ transformers: transformers5,
3386
+ dateType,
3387
+ enumType,
3388
+ optionalType,
3389
+ oasType,
3390
+ // keep the used enumnames between TypeBuilder and OperationGenerator per plugin(pluginKey)
3391
+ usedEnumNames: {}
3392
+ },
3393
+ pre: [pluginName$1],
3394
+ resolvePath(baseName, directory, options2) {
3395
+ const root = path.resolve(this.config.root, this.config.output.path);
3396
+ const mode = FileManager.getMode(path.resolve(root, output.path));
3397
+ if (mode === "file") {
3398
+ return path.resolve(root, output.path);
3399
+ }
3400
+ if (options2?.tag && group?.type === "tag") {
3401
+ const tag = camelCase(options2.tag);
3402
+ return path.resolve(root, renderTemplate(template, { tag }), baseName);
3403
+ }
3404
+ return path.resolve(root, output.path, baseName);
3405
+ },
3406
+ resolveName(name, type) {
3407
+ const resolvedName = pascalCase(name);
3408
+ if (type) {
3409
+ return transformers5?.name?.(resolvedName, type) || resolvedName;
3410
+ }
3411
+ return resolvedName;
3412
+ },
3413
+ async writeFile(source, writePath) {
3414
+ if (!writePath.endsWith(".ts") || !source) {
3415
+ return;
3416
+ }
3417
+ return this.fileManager.write(source, writePath);
3418
+ },
3419
+ async buildStart() {
3420
+ const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginName$1]);
3421
+ const oas = await swaggerPlugin.api.getOas();
3422
+ const schemas = await swaggerPlugin.api.getSchemas();
3423
+ const root = path.resolve(this.config.root, this.config.output.path);
3424
+ const mode = FileManager.getMode(path.resolve(root, output.path));
3425
+ const builder = new TypeBuilder(this.plugin.options, { oas, pluginManager: this.pluginManager });
3426
+ builder.add(
3427
+ Object.entries(schemas).map(([name, schema]) => ({ name, schema }))
3428
+ );
3429
+ if (mode === "directory") {
3430
+ const mapFolderSchema = async ([name]) => {
3431
+ const baseName = `${this.resolveName({ name, pluginKey: this.plugin.key, type: "file" })}.ts`;
3432
+ const resolvedPath = this.resolvePath({ baseName, pluginKey: this.plugin.key });
3433
+ const { source, imports } = builder.build(name);
3434
+ if (!resolvedPath) {
3435
+ return null;
3436
+ }
3437
+ return this.addFile({
3438
+ path: resolvedPath,
3439
+ baseName,
3440
+ source,
3441
+ imports: imports.map((item) => ({ ...item, root: resolvedPath })),
3442
+ meta: {
3443
+ pluginKey: this.plugin.key
3444
+ }
3445
+ });
3446
+ };
3447
+ const promises = Object.entries(schemas).map(mapFolderSchema);
3448
+ await Promise.all(promises);
3449
+ }
3450
+ if (mode === "file") {
3451
+ const resolvedPath = this.resolvePath({ baseName: "", pluginKey: this.plugin.key });
3452
+ const { source } = builder.build();
3453
+ if (!resolvedPath) {
3454
+ return;
3455
+ }
3456
+ await this.addFile({
3457
+ path: resolvedPath,
3458
+ baseName: output.path,
3459
+ source,
3460
+ imports: [],
3461
+ meta: {
3462
+ pluginKey: this.plugin.key
3463
+ }
3464
+ });
3465
+ }
3466
+ const operationGenerator = new OperationGenerator(
3467
+ this.plugin.options,
3468
+ {
3469
+ oas,
3470
+ pluginManager: this.pluginManager,
3471
+ plugin: this.plugin,
3472
+ contentType: swaggerPlugin.api.contentType,
3473
+ exclude,
3474
+ include,
3475
+ override,
3476
+ mode
3477
+ }
3478
+ );
3479
+ const files = await operationGenerator.build();
3480
+ await this.addFile(...files);
3481
+ },
3482
+ async buildEnd() {
3483
+ if (this.config.output.write === false) {
3484
+ return;
3485
+ }
3486
+ const root = path.resolve(this.config.root, this.config.output.path);
3487
+ const { exportType = "barrel" } = output;
3488
+ if (exportType === "barrel") {
3489
+ await this.fileManager.addIndexes({
3490
+ root,
3491
+ output,
3492
+ meta: { pluginKey: this.plugin.key },
3493
+ options: {
3494
+ isTypeOnly: true
3495
+ }
3496
+ });
3497
+ }
3498
+ }
3499
+ };
3500
+ });
3501
+
3502
+ // src/TypeGenerator.ts
3503
+ var _usedAliasNames, _getTypeFromProperties, getTypeFromProperties_fn, _getRefAlias, getRefAlias_fn, _getParsedSchema, getParsedSchema_fn, _getBaseTypeFromSchema, getBaseTypeFromSchema_fn;
3504
+ var TypeGenerator = class extends Generator {
3505
+ constructor() {
3506
+ super(...arguments);
3507
+ /**
3508
+ * Recursively creates a type literal with the given props.
3509
+ */
3510
+ __privateAdd(this, _getTypeFromProperties);
3511
+ /**
3512
+ * Create a type alias for the schema referenced by the given ReferenceObject
3513
+ */
3514
+ __privateAdd(this, _getRefAlias);
3515
+ __privateAdd(this, _getParsedSchema);
3516
+ /**
3517
+ * This is the very core of the OpenAPI to TS conversion - it takes a
3518
+ * schema and returns the appropriate type.
3519
+ */
3520
+ __privateAdd(this, _getBaseTypeFromSchema);
3521
+ this.refs = {};
3522
+ this.imports = [];
3523
+ this.extraNodes = [];
3524
+ this.aliases = [];
3525
+ // Keep track of already used type aliases
3526
+ __privateAdd(this, _usedAliasNames, {});
3527
+ }
3528
+ build({
3529
+ schema,
3530
+ baseName,
3531
+ description,
3532
+ keysToOmit
3533
+ }) {
3534
+ const nodes = [];
3535
+ const type = this.getTypeFromSchema(schema, baseName);
3536
+ if (!type) {
3537
+ return this.extraNodes;
3538
+ }
3539
+ const node = factory2.createTypeAliasDeclaration({
3540
+ modifiers: [factory2.modifiers.export],
3541
+ name: this.context.pluginManager.resolveName({ name: baseName, pluginKey, type: "type" }),
3542
+ type: keysToOmit?.length ? factory2.createOmitDeclaration({ keys: keysToOmit, type, nonNullable: true }) : type
3543
+ });
3544
+ if (description) {
3545
+ nodes.push(
3546
+ factory2.appendJSDocToNode({
3547
+ node,
3548
+ comments: [`@description ${transformers2.trim(description)}`]
3549
+ })
3550
+ );
3551
+ } else {
3552
+ nodes.push(node);
3553
+ }
3554
+ const filterdNodes = nodes.filter(
3555
+ (node2) => !this.extraNodes.some(
3556
+ (extraNode) => extraNode?.name?.escapedText === node2?.name?.escapedText
3557
+ )
3558
+ );
3559
+ return [...this.extraNodes, ...filterdNodes];
3560
+ }
3561
+ /**
3562
+ * Creates a type node from a given schema.
3563
+ * Delegates to getBaseTypeFromSchema internally and
3564
+ * optionally adds a union with null.
3565
+ */
3566
+ getTypeFromSchema(schema, name) {
3567
+ const type = __privateMethod(this, _getBaseTypeFromSchema, getBaseTypeFromSchema_fn).call(this, schema, name);
3568
+ if (!type) {
3569
+ return null;
3570
+ }
3571
+ if (schema && !schema.nullable) {
3572
+ return type;
3573
+ }
3574
+ return factory2.createUnionDeclaration({ nodes: [type, factory2.keywordTypeNodes.null] });
3575
+ }
3576
+ };
3577
+ _usedAliasNames = new WeakMap();
3578
+ _getTypeFromProperties = new WeakSet();
3579
+ getTypeFromProperties_fn = function(baseSchema, baseName) {
3580
+ const { optionalType } = this.options;
3581
+ const properties = baseSchema?.properties || {};
3582
+ const required = baseSchema?.required;
3583
+ const additionalProperties = baseSchema?.additionalProperties;
3584
+ const members = Object.keys(properties).map((name) => {
3585
+ const schema = properties[name];
3586
+ const isRequired = Array.isArray(required) ? required.includes(name) : !!required;
3587
+ let type = this.getTypeFromSchema(schema, this.context.pluginManager.resolveName({ name: `${baseName || ""} ${name}`, pluginKey, type: "type" }));
3588
+ if (!type) {
3589
+ return null;
3590
+ }
3591
+ if (!isRequired && ["undefined", "questionTokenAndUndefined"].includes(optionalType)) {
3592
+ type = factory2.createUnionDeclaration({ nodes: [type, factory2.keywordTypeNodes.undefined] });
3593
+ }
3594
+ const propertySignature = factory2.createPropertySignature({
3595
+ questionToken: ["questionToken", "questionTokenAndUndefined"].includes(optionalType) && !isRequired,
3596
+ name,
3597
+ type,
3598
+ readOnly: schema.readOnly
3599
+ });
3600
+ return factory2.appendJSDocToNode({
3601
+ node: propertySignature,
3602
+ comments: [
3603
+ schema.description ? `@description ${schema.description}` : void 0,
3604
+ schema.type ? `@type ${schema.type?.toString()}${isRequired ? "" : " | undefined"} ${schema.format || ""}` : void 0,
3605
+ schema.example ? `@example ${schema.example}` : void 0,
3606
+ schema.deprecated ? `@deprecated` : void 0,
3607
+ schema.default !== void 0 && typeof schema.default === "string" ? `@default '${schema.default}'` : void 0,
3608
+ schema.default !== void 0 && typeof schema.default !== "string" ? `@default ${schema.default}` : void 0
3609
+ ].filter(Boolean)
3610
+ });
3611
+ });
3612
+ if (additionalProperties) {
3613
+ const type = additionalProperties === true ? factory2.keywordTypeNodes.any : this.getTypeFromSchema(additionalProperties);
3614
+ if (type) {
3615
+ members.push(factory2.createIndexSignature(type));
3616
+ }
3617
+ }
3618
+ return factory2.createTypeLiteralNode(members.filter(Boolean));
3619
+ };
3620
+ _getRefAlias = new WeakSet();
3621
+ getRefAlias_fn = function(obj, _baseName) {
3622
+ const { $ref } = obj;
3623
+ let ref = this.refs[$ref];
3624
+ if (ref) {
3625
+ return factory2.createTypeReferenceNode(ref.propertyName, void 0);
3626
+ }
3627
+ const originalName = getUniqueName($ref.replace(/.+\//, ""), __privateGet(this, _usedAliasNames));
3628
+ const propertyName = this.context.pluginManager.resolveName({ name: originalName, pluginKey, type: "type" });
3629
+ ref = this.refs[$ref] = {
3630
+ propertyName,
3631
+ originalName
3632
+ };
3633
+ const path2 = this.context.pluginManager.resolvePath({ baseName: propertyName, pluginKey });
3634
+ this.imports.push({
3635
+ ref,
3636
+ path: path2 || "",
3637
+ isTypeOnly: true
3638
+ });
3639
+ return factory2.createTypeReferenceNode(ref.propertyName, void 0);
3640
+ };
3641
+ _getParsedSchema = new WeakSet();
3642
+ getParsedSchema_fn = function(schema) {
3643
+ const parsedSchema = getSchemaFactory(this.context.oas)(schema);
3644
+ return parsedSchema;
3645
+ };
3646
+ _getBaseTypeFromSchema = new WeakSet();
3647
+ getBaseTypeFromSchema_fn = function(_schema, baseName) {
3648
+ const { schema, version } = __privateMethod(this, _getParsedSchema, getParsedSchema_fn).call(this, _schema);
3649
+ if (!schema) {
3650
+ return factory2.keywordTypeNodes.any;
3651
+ }
3652
+ if (isReference(schema)) {
3653
+ return __privateMethod(this, _getRefAlias, getRefAlias_fn).call(this, schema, baseName);
3654
+ }
3655
+ if (schema.oneOf) {
3656
+ const schemaWithoutOneOf = { ...schema, oneOf: void 0 };
3657
+ const union = factory2.createUnionDeclaration({
3658
+ withParentheses: true,
3659
+ nodes: schema.oneOf.map((item) => {
3660
+ return item && this.getTypeFromSchema(item);
3661
+ }).filter((item) => {
3662
+ return item && item !== factory2.keywordTypeNodes.any;
3663
+ })
3664
+ });
3665
+ if (schemaWithoutOneOf.properties) {
3666
+ return factory2.createIntersectionDeclaration({
3667
+ nodes: [this.getTypeFromSchema(schemaWithoutOneOf, baseName), union].filter(Boolean)
3668
+ });
3669
+ }
3670
+ return union;
3671
+ }
3672
+ if (schema.anyOf) {
3673
+ const schemaWithoutAnyOf = { ...schema, anyOf: void 0 };
3674
+ const union = factory2.createUnionDeclaration({
3675
+ withParentheses: true,
3676
+ nodes: schema.anyOf.map((item) => {
3677
+ return item && this.getTypeFromSchema(item);
3678
+ }).filter((item) => {
3679
+ return item && item !== factory2.keywordTypeNodes.any;
3680
+ })
3681
+ });
3682
+ if (schemaWithoutAnyOf.properties) {
3683
+ return factory2.createIntersectionDeclaration({
3684
+ nodes: [this.getTypeFromSchema(schemaWithoutAnyOf, baseName), union].filter(Boolean)
3685
+ });
3686
+ }
3687
+ return union;
3688
+ }
3689
+ if (schema.allOf) {
3690
+ const schemaWithoutAllOf = { ...schema, allOf: void 0 };
3691
+ const and = factory2.createIntersectionDeclaration({
3692
+ withParentheses: true,
3693
+ nodes: schema.allOf.map((item) => {
3694
+ return item && this.getTypeFromSchema(item);
3695
+ }).filter((item) => {
3696
+ return item && item !== factory2.keywordTypeNodes.any;
3697
+ })
3698
+ });
3699
+ if (schemaWithoutAllOf.properties) {
3700
+ return factory2.createIntersectionDeclaration({
3701
+ nodes: [this.getTypeFromSchema(schemaWithoutAllOf, baseName), and].filter(Boolean)
3702
+ });
3703
+ }
3704
+ return and;
3705
+ }
3706
+ if (schema.enum && baseName) {
3707
+ const enumName = getUniqueName(baseName, this.options.usedEnumNames);
3708
+ let enums = [...new Set(schema.enum)].map((key) => [key, key]);
3709
+ if ("x-enumNames" in schema) {
3710
+ enums = [...new Set(schema["x-enumNames"])].map((key, index) => {
3711
+ return [key, schema.enum?.[index]];
3712
+ });
3713
+ }
3714
+ this.extraNodes.push(
3715
+ ...factory2.createEnumDeclaration({
3716
+ name: transformers2.camelCase(enumName),
3717
+ typeName: this.context.pluginManager.resolveName({ name: enumName, pluginKey, type: "type" }),
3718
+ enums,
3719
+ type: this.options.enumType
3720
+ })
3721
+ );
3722
+ return factory2.createTypeReferenceNode(this.context.pluginManager.resolveName({ name: enumName, pluginKey, type: "type" }), void 0);
3723
+ }
3724
+ if (schema.enum) {
3725
+ return factory2.createUnionDeclaration({
3726
+ nodes: schema.enum.map((name) => {
3727
+ return factory2.createLiteralTypeNode(typeof name === "number" ? factory2.createNumericLiteral(name) : factory2.createStringLiteral(`${name}`));
3728
+ })
3729
+ });
3730
+ }
3731
+ if ("items" in schema) {
3732
+ const node = this.getTypeFromSchema(schema.items, baseName);
3733
+ if (node) {
3734
+ return factory2.createArrayTypeNode(node);
3735
+ }
3736
+ }
3737
+ if ("prefixItems" in schema) {
3738
+ const prefixItems = schema.prefixItems;
3739
+ return factory2.createTupleDeclaration({
3740
+ nodes: prefixItems.map((item) => {
3741
+ return this.getTypeFromSchema(item, void 0);
3742
+ })
3743
+ });
3744
+ }
3745
+ if (schema.properties || schema.additionalProperties) {
3746
+ return __privateMethod(this, _getTypeFromProperties, getTypeFromProperties_fn).call(this, schema, baseName);
3747
+ }
3748
+ if (version === "3.1" && "const" in schema) {
3749
+ if (schema["const"]) {
3750
+ if (typeof schema["const"] === "string") {
3751
+ return factory2.createLiteralTypeNode(factory2.createStringLiteral(schema["const"]));
3752
+ } else if (typeof schema["const"] === "number") {
3753
+ return factory2.createLiteralTypeNode(factory2.createNumericLiteral(schema["const"]));
3754
+ }
3755
+ } else {
3756
+ return keywordTypeNodes.null;
3757
+ }
3758
+ }
3759
+ if (schema.type) {
3760
+ if (Array.isArray(schema.type)) {
3761
+ const [type, nullable] = schema.type;
3762
+ return factory2.createUnionDeclaration({
3763
+ nodes: [
3764
+ this.getTypeFromSchema(
3765
+ {
3766
+ ...schema,
3767
+ type
3768
+ },
3769
+ baseName
3770
+ ),
3771
+ nullable ? factory2.createLiteralTypeNode(factory2.createNull()) : void 0
3772
+ ].filter(Boolean)
3773
+ });
3774
+ }
3775
+ if (this.options.dateType === "date" && ["date", "date-time"].some((item) => item === schema.format)) {
3776
+ return factory2.createTypeReferenceNode(factory2.createIdentifier("Date"));
3777
+ }
3778
+ if (schema.type in factory2.keywordTypeNodes) {
3779
+ return factory2.keywordTypeNodes[schema.type];
3780
+ }
3781
+ }
3782
+ if (schema.format === "binary") {
3783
+ return factory2.createTypeReferenceNode("Blob", []);
3784
+ }
3785
+ return factory2.keywordTypeNodes.any;
3786
+ };
3787
+
3788
+ // src/TypeBuilder.ts
3789
+ var TypeBuilder = class extends OasBuilder {
3790
+ build(name) {
3791
+ const importMeta = [];
3792
+ const codes = [];
3793
+ const generated = this.items.filter((operationSchema) => name ? operationSchema.name === name : true).sort(transformers2.nameSorter).map((operationSchema) => {
3794
+ const generator = new TypeGenerator(this.options, this.context);
3795
+ const sources = generator.build({
3796
+ schema: operationSchema.schema,
3797
+ baseName: operationSchema.name,
3798
+ description: operationSchema.description,
3799
+ keysToOmit: operationSchema.keysToOmit
3800
+ });
3801
+ importMeta.push(...generator.imports);
3802
+ return {
3803
+ import: {
3804
+ refs: generator.refs,
3805
+ name: operationSchema.name
3806
+ },
3807
+ sources
3808
+ };
3809
+ }).sort(refsSorter);
3810
+ generated.forEach((item) => {
3811
+ codes.push(print(item.sources));
3812
+ });
3813
+ const imports = importMeta.map((item) => {
3814
+ return {
3815
+ name: [item.ref.propertyName],
3816
+ path: item.path,
3817
+ isTypeOnly: item.isTypeOnly
3818
+ };
3819
+ });
3820
+ return {
3821
+ imports,
3822
+ source: transformers2.combineCodes(codes)
3823
+ };
3824
+ }
3825
+ };
3826
+
3827
+ // src/components/Mutation.tsx
3828
+ var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
3829
+ function printCombinedSchema2(name, operation, schemas) {
3830
+ const properties = {
3831
+ "response": factory2.createTypeReferenceNode(
3832
+ factory2.createIdentifier(schemas.response.name),
3833
+ void 0
3834
+ )
3835
+ };
3836
+ if (schemas.request) {
3837
+ properties["request"] = factory2.createTypeReferenceNode(
3838
+ factory2.createIdentifier(schemas.request.name),
3839
+ void 0
3840
+ );
3841
+ }
3842
+ if (schemas.pathParams) {
3843
+ properties["pathParams"] = factory2.createTypeReferenceNode(
3844
+ factory2.createIdentifier(schemas.pathParams.name),
3845
+ void 0
3846
+ );
3847
+ }
3848
+ if (schemas.queryParams) {
3849
+ properties["queryParams"] = factory2.createTypeReferenceNode(
3850
+ factory2.createIdentifier(schemas.queryParams.name),
3851
+ void 0
3852
+ );
3853
+ }
3854
+ if (schemas.headerParams) {
3855
+ properties["headerParams"] = factory2.createTypeReferenceNode(
3856
+ factory2.createIdentifier(schemas.headerParams.name),
3857
+ void 0
3858
+ );
3859
+ }
3860
+ if (schemas.errors) {
3861
+ properties["errors"] = factory2.createUnionDeclaration({
3862
+ nodes: schemas.errors.map((error) => {
3863
+ return factory2.createTypeReferenceNode(
3864
+ factory2.createIdentifier(error.name),
3865
+ void 0
3866
+ );
3867
+ })
3868
+ });
3869
+ }
3870
+ const namespaceNode = factory2.createNamespaceDeclaration({
3871
+ name: operation.method === "get" ? `${name}Query` : `${name}Mutation`,
3872
+ statements: Object.keys(properties).map((key) => {
3873
+ const type = properties[key];
3874
+ if (!type) {
3875
+ return void 0;
3876
+ }
3877
+ return factory2.createTypeAliasDeclaration({
3878
+ modifiers: [factory2.modifiers.export],
3879
+ name: transformers2.pascalCase(key),
3880
+ type
3881
+ });
3882
+ }).filter(Boolean)
3883
+ });
3884
+ return print(namespaceNode);
3885
+ }
3886
+ function Mutation({
3887
+ builder
3888
+ }) {
3889
+ const { source } = builder.build();
3890
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: source });
3891
+ }
3892
+ Mutation.File = function({ mode }) {
3893
+ const { options } = usePlugin();
3894
+ const schemas = useSchemas();
3895
+ const pluginManager = usePluginManager();
3896
+ const oas = useOas();
3897
+ const file = useOperationFile();
3898
+ const factoryName = useOperationName({ type: "type" });
3899
+ const operation = useOperation();
3900
+ const builder = new TypeBuilder(options, { oas, pluginManager }).add(schemas.pathParams).add(schemas.queryParams).add(schemas.headerParams).add(schemas.response).add(schemas.request).add(schemas.errors);
3901
+ const { source, imports } = builder.build();
3902
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
3903
+ File,
3904
+ {
3905
+ baseName: file.baseName,
3906
+ path: file.path,
3907
+ meta: file.meta,
3908
+ children: [
3909
+ mode === "directory" && imports.map((item, index) => {
3910
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(File.Import, { root: file.path, ...item }, index);
3911
+ }),
3912
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(File.Source, { children: [
3913
+ source,
3914
+ printCombinedSchema2(factoryName, operation, schemas)
3915
+ ] })
3916
+ ]
3917
+ }
3918
+ ) });
3919
+ };
3920
+ /*! Bundled license information:
3921
+
3922
+ react/cjs/react.production.min.js:
3923
+ (**
3924
+ * @license React
3925
+ * react.production.min.js
3926
+ *
3927
+ * Copyright (c) Facebook, Inc. and its affiliates.
3928
+ *
3929
+ * This source code is licensed under the MIT license found in the
3930
+ * LICENSE file in the root directory of this source tree.
3931
+ *)
3932
+
3933
+ react/cjs/react.development.js:
3934
+ (**
3935
+ * @license React
3936
+ * react.development.js
3937
+ *
3938
+ * Copyright (c) Facebook, Inc. and its affiliates.
3939
+ *
3940
+ * This source code is licensed under the MIT license found in the
3941
+ * LICENSE file in the root directory of this source tree.
3942
+ *)
3943
+
3944
+ react/cjs/react-jsx-runtime.production.min.js:
3945
+ (**
3946
+ * @license React
3947
+ * react-jsx-runtime.production.min.js
3948
+ *
3949
+ * Copyright (c) Facebook, Inc. and its affiliates.
3950
+ *
3951
+ * This source code is licensed under the MIT license found in the
3952
+ * LICENSE file in the root directory of this source tree.
3953
+ *)
3954
+
3955
+ react/cjs/react-jsx-runtime.development.js:
3956
+ (**
3957
+ * @license React
3958
+ * react-jsx-runtime.development.js
3959
+ *
3960
+ * Copyright (c) Facebook, Inc. and its affiliates.
3961
+ *
3962
+ * This source code is licensed under the MIT license found in the
3963
+ * LICENSE file in the root directory of this source tree.
3964
+ *)
3965
+ */
3966
+
3967
+ export { Mutation, Oas, Query };
3968
+ //# sourceMappingURL=out.js.map
3969
+ //# sourceMappingURL=components.js.map