zudoku 0.3.0-dev.21 → 0.3.0-dev.22

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.
Files changed (58) hide show
  1. package/dist/config/config.d.ts +1 -1
  2. package/dist/lib/authentication/authentication.d.ts +1 -1
  3. package/dist/lib/plugins/api-keys/index.js +1 -0
  4. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  5. package/dist/lib/plugins/markdown/generateRoutes.js +1 -1
  6. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  7. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  8. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  9. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +1 -1
  10. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  11. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  12. package/dist/lib/plugins/openapi/Route.js +8 -0
  13. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  14. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  15. package/dist/lib/plugins/openapi/context.js +11 -0
  16. package/dist/lib/plugins/openapi/context.js.map +1 -0
  17. package/dist/lib/plugins/openapi/index.d.ts +1 -19
  18. package/dist/lib/plugins/openapi/index.js +17 -18
  19. package/dist/lib/plugins/openapi/index.js.map +1 -1
  20. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  21. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  22. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  23. package/lib/{util-voKLTRDG.js → AnchorLink-DIUlXlf0.js} +149 -184
  24. package/lib/DevPortalProvider-gzyAGqHT.js +1080 -0
  25. package/lib/{Markdown-5LmPZyLV.js → Markdown-BjA7peYW.js} +3 -3
  26. package/lib/{MdxComponents-DYD_QPVF.js → MdxComponents-W-fE1ISO.js} +130 -129
  27. package/lib/MdxPage-DQ7lZBzE.js +216 -0
  28. package/lib/OperationList-DuIBqFNA.js +5545 -0
  29. package/lib/Route-B98Y2MdH.js +13 -0
  30. package/lib/{Select-DR3PiqjV.js → Select-DczD5e29.js} +24 -22
  31. package/lib/{Spinner-DjQ2eBxC.js → Spinner-CSoij67T.js} +3 -3
  32. package/lib/cn-DpqTslo9.js +2341 -0
  33. package/lib/context-_fYfJFgk.js +13 -0
  34. package/lib/{hook-FCY9-FHO.js → hook-CBXxHulF.js} +1 -1
  35. package/lib/{index-By9bEW57.js → index-C7O9D7f6.js} +15 -15
  36. package/lib/index-CKvOcM7w.js +712 -0
  37. package/lib/index-Cg6lXS1z.js +709 -0
  38. package/lib/index-ClDDiRmC.js +463 -0
  39. package/lib/router-DibNxKUP.js +3008 -0
  40. package/lib/util-CaVongBq.js +40 -0
  41. package/lib/zudoku.auth-openid.js +7 -6
  42. package/lib/zudoku.components.js +73 -69
  43. package/lib/zudoku.plugin-api-keys.js +26 -23
  44. package/lib/zudoku.plugin-markdown.js +33 -237
  45. package/lib/zudoku.plugin-openapi.js +5 -6238
  46. package/lib/zudoku.plugin-redirect.js +7 -6
  47. package/package.json +1 -1
  48. package/src/lib/authentication/authentication.ts +1 -1
  49. package/src/lib/plugins/api-keys/index.tsx +1 -0
  50. package/src/lib/plugins/markdown/generateRoutes.tsx +2 -2
  51. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  52. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +1 -1
  53. package/src/lib/plugins/openapi/Route.tsx +21 -0
  54. package/src/lib/plugins/openapi/context.tsx +16 -0
  55. package/src/lib/plugins/openapi/index.tsx +19 -46
  56. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  57. package/lib/DevPortalProvider-CRKuwoXc.js +0 -4123
  58. package/lib/index-PyGcnQFX.js +0 -3462
@@ -0,0 +1,3008 @@
1
+ import dr from "react";
2
+ var Wt = { exports: {} }, nt = {};
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var Kt;
13
+ function Pr() {
14
+ if (Kt) return nt;
15
+ Kt = 1;
16
+ var e = dr, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function f(d, c, w) {
18
+ var R, g = {}, E = null, I = null;
19
+ w !== void 0 && (E = "" + w), c.key !== void 0 && (E = "" + c.key), c.ref !== void 0 && (I = c.ref);
20
+ for (R in c) a.call(c, R) && !h.hasOwnProperty(R) && (g[R] = c[R]);
21
+ if (d && d.defaultProps) for (R in c = d.defaultProps, c) g[R] === void 0 && (g[R] = c[R]);
22
+ return { $$typeof: t, type: d, key: E, ref: I, props: g, _owner: o.current };
23
+ }
24
+ return nt.Fragment = n, nt.jsx = f, nt.jsxs = f, nt;
25
+ }
26
+ var it = {};
27
+ /**
28
+ * @license React
29
+ * react-jsx-runtime.development.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */
36
+ var Jt;
37
+ function xr() {
38
+ return Jt || (Jt = 1, process.env.NODE_ENV !== "production" && function() {
39
+ var e = dr, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), d = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), j = Symbol.iterator, M = "@@iterator";
40
+ function A(r) {
41
+ if (r === null || typeof r != "object")
42
+ return null;
43
+ var s = j && r[j] || r[M];
44
+ return typeof s == "function" ? s : null;
45
+ }
46
+ var k = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function T(r) {
48
+ {
49
+ for (var s = arguments.length, v = new Array(s > 1 ? s - 1 : 0), y = 1; y < s; y++)
50
+ v[y - 1] = arguments[y];
51
+ pe("error", r, v);
52
+ }
53
+ }
54
+ function pe(r, s, v) {
55
+ {
56
+ var y = k.ReactDebugCurrentFrame, b = y.getStackAddendum();
57
+ b !== "" && (s += "%s", v = v.concat([b]));
58
+ var _ = v.map(function(D) {
59
+ return String(D);
60
+ });
61
+ _.unshift("Warning: " + s), Function.prototype.apply.call(console[r], console, _);
62
+ }
63
+ }
64
+ var Q = !1, re = !1, m = !1, ae = !1, ue = !1, U;
65
+ U = Symbol.for("react.module.reference");
66
+ function Z(r) {
67
+ return !!(typeof r == "string" || typeof r == "function" || r === a || r === h || ue || r === o || r === w || r === R || ae || r === I || Q || re || m || typeof r == "object" && r !== null && (r.$$typeof === E || r.$$typeof === g || r.$$typeof === f || r.$$typeof === d || r.$$typeof === c || // This needs to include all possible module reference object
68
+ // types supported by any Flight configuration anywhere since
69
+ // we don't know which Flight build this will end up being used
70
+ // with.
71
+ r.$$typeof === U || r.getModuleId !== void 0));
72
+ }
73
+ function J(r, s, v) {
74
+ var y = r.displayName;
75
+ if (y)
76
+ return y;
77
+ var b = s.displayName || s.name || "";
78
+ return b !== "" ? v + "(" + b + ")" : v;
79
+ }
80
+ function ie(r) {
81
+ return r.displayName || "Context";
82
+ }
83
+ function V(r) {
84
+ if (r == null)
85
+ return null;
86
+ if (typeof r.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
87
+ return r.displayName || r.name || null;
88
+ if (typeof r == "string")
89
+ return r;
90
+ switch (r) {
91
+ case a:
92
+ return "Fragment";
93
+ case n:
94
+ return "Portal";
95
+ case h:
96
+ return "Profiler";
97
+ case o:
98
+ return "StrictMode";
99
+ case w:
100
+ return "Suspense";
101
+ case R:
102
+ return "SuspenseList";
103
+ }
104
+ if (typeof r == "object")
105
+ switch (r.$$typeof) {
106
+ case d:
107
+ var s = r;
108
+ return ie(s) + ".Consumer";
109
+ case f:
110
+ var v = r;
111
+ return ie(v._context) + ".Provider";
112
+ case c:
113
+ return J(r, r.render, "ForwardRef");
114
+ case g:
115
+ var y = r.displayName || null;
116
+ return y !== null ? y : V(r.type) || "Memo";
117
+ case E: {
118
+ var b = r, _ = b._payload, D = b._init;
119
+ try {
120
+ return V(D(_));
121
+ } catch {
122
+ return null;
123
+ }
124
+ }
125
+ }
126
+ return null;
127
+ }
128
+ var B = Object.assign, fe = 0, Ue, $, Ie, _e, Ee, ce, Se;
129
+ function Te() {
130
+ }
131
+ Te.__reactDisabledLog = !0;
132
+ function me() {
133
+ {
134
+ if (fe === 0) {
135
+ Ue = console.log, $ = console.info, Ie = console.warn, _e = console.error, Ee = console.group, ce = console.groupCollapsed, Se = console.groupEnd;
136
+ var r = {
137
+ configurable: !0,
138
+ enumerable: !0,
139
+ value: Te,
140
+ writable: !0
141
+ };
142
+ Object.defineProperties(console, {
143
+ info: r,
144
+ log: r,
145
+ warn: r,
146
+ error: r,
147
+ group: r,
148
+ groupCollapsed: r,
149
+ groupEnd: r
150
+ });
151
+ }
152
+ fe++;
153
+ }
154
+ }
155
+ function De() {
156
+ {
157
+ if (fe--, fe === 0) {
158
+ var r = {
159
+ configurable: !0,
160
+ enumerable: !0,
161
+ writable: !0
162
+ };
163
+ Object.defineProperties(console, {
164
+ log: B({}, r, {
165
+ value: Ue
166
+ }),
167
+ info: B({}, r, {
168
+ value: $
169
+ }),
170
+ warn: B({}, r, {
171
+ value: Ie
172
+ }),
173
+ error: B({}, r, {
174
+ value: _e
175
+ }),
176
+ group: B({}, r, {
177
+ value: Ee
178
+ }),
179
+ groupCollapsed: B({}, r, {
180
+ value: ce
181
+ }),
182
+ groupEnd: B({}, r, {
183
+ value: Se
184
+ })
185
+ });
186
+ }
187
+ fe < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ }
189
+ }
190
+ var ve = k.ReactCurrentDispatcher, Qe;
191
+ function Me(r, s, v) {
192
+ {
193
+ if (Qe === void 0)
194
+ try {
195
+ throw Error();
196
+ } catch (b) {
197
+ var y = b.stack.trim().match(/\n( *(at )?)/);
198
+ Qe = y && y[1] || "";
199
+ }
200
+ return `
201
+ ` + Qe + r;
202
+ }
203
+ }
204
+ var Ze = !1, Ye;
205
+ {
206
+ var Mt = typeof WeakMap == "function" ? WeakMap : Map;
207
+ Ye = new Mt();
208
+ }
209
+ function X(r, s) {
210
+ if (!r || Ze)
211
+ return "";
212
+ {
213
+ var v = Ye.get(r);
214
+ if (v !== void 0)
215
+ return v;
216
+ }
217
+ var y;
218
+ Ze = !0;
219
+ var b = Error.prepareStackTrace;
220
+ Error.prepareStackTrace = void 0;
221
+ var _;
222
+ _ = ve.current, ve.current = null, me();
223
+ try {
224
+ if (s) {
225
+ var D = function() {
226
+ throw Error();
227
+ };
228
+ if (Object.defineProperty(D.prototype, "props", {
229
+ set: function() {
230
+ throw Error();
231
+ }
232
+ }), typeof Reflect == "object" && Reflect.construct) {
233
+ try {
234
+ Reflect.construct(D, []);
235
+ } catch (K) {
236
+ y = K;
237
+ }
238
+ Reflect.construct(r, [], D);
239
+ } else {
240
+ try {
241
+ D.call();
242
+ } catch (K) {
243
+ y = K;
244
+ }
245
+ r.call(D.prototype);
246
+ }
247
+ } else {
248
+ try {
249
+ throw Error();
250
+ } catch (K) {
251
+ y = K;
252
+ }
253
+ r();
254
+ }
255
+ } catch (K) {
256
+ if (K && y && typeof K.stack == "string") {
257
+ for (var P = K.stack.split(`
258
+ `), C = y.stack.split(`
259
+ `), O = P.length - 1, L = C.length - 1; O >= 1 && L >= 0 && P[O] !== C[L]; )
260
+ L--;
261
+ for (; O >= 1 && L >= 0; O--, L--)
262
+ if (P[O] !== C[L]) {
263
+ if (O !== 1 || L !== 1)
264
+ do
265
+ if (O--, L--, L < 0 || P[O] !== C[L]) {
266
+ var q = `
267
+ ` + P[O].replace(" at new ", " at ");
268
+ return r.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", r.displayName)), typeof r == "function" && Ye.set(r, q), q;
269
+ }
270
+ while (O >= 1 && L >= 0);
271
+ break;
272
+ }
273
+ }
274
+ } finally {
275
+ Ze = !1, ve.current = _, De(), Error.prepareStackTrace = b;
276
+ }
277
+ var ee = r ? r.displayName || r.name : "", ne = ee ? Me(ee) : "";
278
+ return typeof r == "function" && Ye.set(r, ne), ne;
279
+ }
280
+ function Ce(r, s, v) {
281
+ return X(r, !1);
282
+ }
283
+ function pt(r) {
284
+ var s = r.prototype;
285
+ return !!(s && s.isReactComponent);
286
+ }
287
+ function Ve(r, s, v) {
288
+ if (r == null)
289
+ return "";
290
+ if (typeof r == "function")
291
+ return X(r, pt(r));
292
+ if (typeof r == "string")
293
+ return Me(r);
294
+ switch (r) {
295
+ case w:
296
+ return Me("Suspense");
297
+ case R:
298
+ return Me("SuspenseList");
299
+ }
300
+ if (typeof r == "object")
301
+ switch (r.$$typeof) {
302
+ case c:
303
+ return Ce(r.render);
304
+ case g:
305
+ return Ve(r.type, s, v);
306
+ case E: {
307
+ var y = r, b = y._payload, _ = y._init;
308
+ try {
309
+ return Ve(_(b), s, v);
310
+ } catch {
311
+ }
312
+ }
313
+ }
314
+ return "";
315
+ }
316
+ var oe = Object.prototype.hasOwnProperty, mt = {}, vt = k.ReactDebugCurrentFrame;
317
+ function ke(r) {
318
+ if (r) {
319
+ var s = r._owner, v = Ve(r.type, r._source, s ? s.type : null);
320
+ vt.setExtraStackFrame(v);
321
+ } else
322
+ vt.setExtraStackFrame(null);
323
+ }
324
+ function Ct(r, s, v, y, b) {
325
+ {
326
+ var _ = Function.call.bind(oe);
327
+ for (var D in r)
328
+ if (_(r, D)) {
329
+ var P = void 0;
330
+ try {
331
+ if (typeof r[D] != "function") {
332
+ var C = Error((y || "React class") + ": " + v + " type `" + D + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[D] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw C.name = "Invariant Violation", C;
334
+ }
335
+ P = r[D](s, D, y, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ } catch (O) {
337
+ P = O;
338
+ }
339
+ P && !(P instanceof Error) && (ke(b), T("%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).", y || "React class", v, D, typeof P), ke(null)), P instanceof Error && !(P.message in mt) && (mt[P.message] = !0, ke(b), T("Failed %s type: %s", v, P.message), ke(null));
340
+ }
341
+ }
342
+ }
343
+ var Lt = Array.isArray;
344
+ function et(r) {
345
+ return Lt(r);
346
+ }
347
+ function jt(r) {
348
+ {
349
+ var s = typeof Symbol == "function" && Symbol.toStringTag, v = s && r[Symbol.toStringTag] || r.constructor.name || "Object";
350
+ return v;
351
+ }
352
+ }
353
+ function Ne(r) {
354
+ try {
355
+ return Le(r), !1;
356
+ } catch {
357
+ return !0;
358
+ }
359
+ }
360
+ function Le(r) {
361
+ return "" + r;
362
+ }
363
+ function tt(r) {
364
+ if (Ne(r))
365
+ return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jt(r)), Le(r);
366
+ }
367
+ var Pe = k.ReactCurrentOwner, ye = {
368
+ key: !0,
369
+ ref: !0,
370
+ __self: !0,
371
+ __source: !0
372
+ }, de, rt, je;
373
+ je = {};
374
+ function Ot(r) {
375
+ if (oe.call(r, "ref")) {
376
+ var s = Object.getOwnPropertyDescriptor(r, "ref").get;
377
+ if (s && s.isReactWarning)
378
+ return !1;
379
+ }
380
+ return r.ref !== void 0;
381
+ }
382
+ function be(r) {
383
+ if (oe.call(r, "key")) {
384
+ var s = Object.getOwnPropertyDescriptor(r, "key").get;
385
+ if (s && s.isReactWarning)
386
+ return !1;
387
+ }
388
+ return r.key !== void 0;
389
+ }
390
+ function gt(r, s) {
391
+ if (typeof r.ref == "string" && Pe.current && s && Pe.current.stateNode !== s) {
392
+ var v = V(Pe.current.type);
393
+ je[v] || (T('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', V(Pe.current.type), r.ref), je[v] = !0);
394
+ }
395
+ }
396
+ function yt(r, s) {
397
+ {
398
+ var v = function() {
399
+ de || (de = !0, T("%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)", s));
400
+ };
401
+ v.isReactWarning = !0, Object.defineProperty(r, "key", {
402
+ get: v,
403
+ configurable: !0
404
+ });
405
+ }
406
+ }
407
+ function bt(r, s) {
408
+ {
409
+ var v = function() {
410
+ rt || (rt = !0, T("%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)", s));
411
+ };
412
+ v.isReactWarning = !0, Object.defineProperty(r, "ref", {
413
+ get: v,
414
+ configurable: !0
415
+ });
416
+ }
417
+ }
418
+ var Ft = function(r, s, v, y, b, _, D) {
419
+ var P = {
420
+ // This tag allows us to uniquely identify this as a React Element
421
+ $$typeof: t,
422
+ // Built-in properties that belong on the element
423
+ type: r,
424
+ key: s,
425
+ ref: v,
426
+ props: D,
427
+ // Record the component responsible for creating this element.
428
+ _owner: _
429
+ };
430
+ return P._store = {}, Object.defineProperty(P._store, "validated", {
431
+ configurable: !1,
432
+ enumerable: !1,
433
+ writable: !0,
434
+ value: !1
435
+ }), Object.defineProperty(P, "_self", {
436
+ configurable: !1,
437
+ enumerable: !1,
438
+ writable: !1,
439
+ value: y
440
+ }), Object.defineProperty(P, "_source", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !1,
444
+ value: b
445
+ }), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
446
+ };
447
+ function Rt(r, s, v, y, b) {
448
+ {
449
+ var _, D = {}, P = null, C = null;
450
+ v !== void 0 && (tt(v), P = "" + v), be(s) && (tt(s.key), P = "" + s.key), Ot(s) && (C = s.ref, gt(s, b));
451
+ for (_ in s)
452
+ oe.call(s, _) && !ye.hasOwnProperty(_) && (D[_] = s[_]);
453
+ if (r && r.defaultProps) {
454
+ var O = r.defaultProps;
455
+ for (_ in O)
456
+ D[_] === void 0 && (D[_] = O[_]);
457
+ }
458
+ if (P || C) {
459
+ var L = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
460
+ P && yt(D, L), C && bt(D, L);
461
+ }
462
+ return Ft(r, P, C, b, y, Pe.current, D);
463
+ }
464
+ }
465
+ var Oe = k.ReactCurrentOwner, at = k.ReactDebugCurrentFrame;
466
+ function Re(r) {
467
+ if (r) {
468
+ var s = r._owner, v = Ve(r.type, r._source, s ? s.type : null);
469
+ at.setExtraStackFrame(v);
470
+ } else
471
+ at.setExtraStackFrame(null);
472
+ }
473
+ var Fe;
474
+ Fe = !1;
475
+ function We(r) {
476
+ return typeof r == "object" && r !== null && r.$$typeof === t;
477
+ }
478
+ function wt() {
479
+ {
480
+ if (Oe.current) {
481
+ var r = V(Oe.current.type);
482
+ if (r)
483
+ return `
484
+
485
+ Check the render method of \`` + r + "`.";
486
+ }
487
+ return "";
488
+ }
489
+ }
490
+ function Et(r) {
491
+ return "";
492
+ }
493
+ var St = {};
494
+ function Dt(r) {
495
+ {
496
+ var s = wt();
497
+ if (!s) {
498
+ var v = typeof r == "string" ? r : r.displayName || r.name;
499
+ v && (s = `
500
+
501
+ Check the top-level render call using <` + v + ">.");
502
+ }
503
+ return s;
504
+ }
505
+ }
506
+ function Ke(r, s) {
507
+ {
508
+ if (!r._store || r._store.validated || r.key != null)
509
+ return;
510
+ r._store.validated = !0;
511
+ var v = Dt(s);
512
+ if (St[v])
513
+ return;
514
+ St[v] = !0;
515
+ var y = "";
516
+ r && r._owner && r._owner !== Oe.current && (y = " It was passed a child from " + V(r._owner.type) + "."), Re(r), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, y), Re(null);
517
+ }
518
+ }
519
+ function ze(r, s) {
520
+ {
521
+ if (typeof r != "object")
522
+ return;
523
+ if (et(r))
524
+ for (var v = 0; v < r.length; v++) {
525
+ var y = r[v];
526
+ We(y) && Ke(y, s);
527
+ }
528
+ else if (We(r))
529
+ r._store && (r._store.validated = !0);
530
+ else if (r) {
531
+ var b = A(r);
532
+ if (typeof b == "function" && b !== r.entries)
533
+ for (var _ = b.call(r), D; !(D = _.next()).done; )
534
+ We(D.value) && Ke(D.value, s);
535
+ }
536
+ }
537
+ }
538
+ function At(r) {
539
+ {
540
+ var s = r.type;
541
+ if (s == null || typeof s == "string")
542
+ return;
543
+ var v;
544
+ if (typeof s == "function")
545
+ v = s.propTypes;
546
+ else if (typeof s == "object" && (s.$$typeof === c || // Note: Memo only checks outer props here.
547
+ // Inner props are checked in the reconciler.
548
+ s.$$typeof === g))
549
+ v = s.propTypes;
550
+ else
551
+ return;
552
+ if (v) {
553
+ var y = V(s);
554
+ Ct(v, r.props, "prop", y, r);
555
+ } else if (s.PropTypes !== void 0 && !Fe) {
556
+ Fe = !0;
557
+ var b = V(s);
558
+ T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
559
+ }
560
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
+ }
562
+ }
563
+ function Ut(r) {
564
+ {
565
+ for (var s = Object.keys(r.props), v = 0; v < s.length; v++) {
566
+ var y = s[v];
567
+ if (y !== "children" && y !== "key") {
568
+ Re(r), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), Re(null);
569
+ break;
570
+ }
571
+ }
572
+ r.ref !== null && (Re(r), T("Invalid attribute `ref` supplied to `React.Fragment`."), Re(null));
573
+ }
574
+ }
575
+ var i = {};
576
+ function l(r, s, v, y, b, _) {
577
+ {
578
+ var D = Z(r);
579
+ if (!D) {
580
+ var P = "";
581
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
582
+ var C = Et();
583
+ C ? P += C : P += wt();
584
+ var O;
585
+ r === null ? O = "null" : et(r) ? O = "array" : r !== void 0 && r.$$typeof === t ? (O = "<" + (V(r.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : O = typeof r, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, P);
586
+ }
587
+ var L = Rt(r, s, v, b, _);
588
+ if (L == null)
589
+ return L;
590
+ if (D) {
591
+ var q = s.children;
592
+ if (q !== void 0)
593
+ if (y)
594
+ if (et(q)) {
595
+ for (var ee = 0; ee < q.length; ee++)
596
+ ze(q[ee], r);
597
+ Object.freeze && Object.freeze(q);
598
+ } else
599
+ T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
600
+ else
601
+ ze(q, r);
602
+ }
603
+ if (oe.call(s, "key")) {
604
+ var ne = V(r), K = Object.keys(s).filter(function(Je) {
605
+ return Je !== "key";
606
+ }), we = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
607
+ if (!i[ne + we]) {
608
+ var he = K.length > 0 ? "{" + K.join(": ..., ") + ": ...}" : "{}";
609
+ T(`A props object containing a "key" prop is being spread into JSX:
610
+ let props = %s;
611
+ <%s {...props} />
612
+ React keys must be passed directly to JSX without using spread:
613
+ let props = %s;
614
+ <%s key={someKey} {...props} />`, we, ne, he, ne), i[ne + we] = !0;
615
+ }
616
+ }
617
+ return r === a ? Ut(L) : At(L), L;
618
+ }
619
+ }
620
+ function u(r, s, v) {
621
+ return l(r, s, v, !0);
622
+ }
623
+ function p(r, s, v) {
624
+ return l(r, s, v, !1);
625
+ }
626
+ var S = p, x = u;
627
+ it.Fragment = a, it.jsx = S, it.jsxs = x;
628
+ }()), it;
629
+ }
630
+ process.env.NODE_ENV === "production" ? Wt.exports = Pr() : Wt.exports = xr();
631
+ var Da = Wt.exports;
632
+ /**
633
+ * @remix-run/router v1.17.1
634
+ *
635
+ * Copyright (c) Remix Software Inc.
636
+ *
637
+ * This source code is licensed under the MIT license found in the
638
+ * LICENSE.md file in the root directory of this source tree.
639
+ *
640
+ * @license MIT
641
+ */
642
+ function H() {
643
+ return H = Object.assign ? Object.assign.bind() : function(e) {
644
+ for (var t = 1; t < arguments.length; t++) {
645
+ var n = arguments[t];
646
+ for (var a in n)
647
+ Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
648
+ }
649
+ return e;
650
+ }, H.apply(this, arguments);
651
+ }
652
+ var G;
653
+ (function(e) {
654
+ e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
655
+ })(G || (G = {}));
656
+ const Gt = "popstate";
657
+ function Pa(e) {
658
+ e === void 0 && (e = {});
659
+ function t(a, o) {
660
+ let {
661
+ pathname: h,
662
+ search: f,
663
+ hash: d
664
+ } = a.location;
665
+ return ct(
666
+ "",
667
+ {
668
+ pathname: h,
669
+ search: f,
670
+ hash: d
671
+ },
672
+ // state defaults to `null` because `window.history.state` does
673
+ o.state && o.state.usr || null,
674
+ o.state && o.state.key || "default"
675
+ );
676
+ }
677
+ function n(a, o) {
678
+ return typeof o == "string" ? o : ht(o);
679
+ }
680
+ return Tr(t, n, null, e);
681
+ }
682
+ function N(e, t) {
683
+ if (e === !1 || e === null || typeof e > "u")
684
+ throw new Error(t);
685
+ }
686
+ function qe(e, t) {
687
+ if (!e) {
688
+ typeof console < "u" && console.warn(t);
689
+ try {
690
+ throw new Error(t);
691
+ } catch {
692
+ }
693
+ }
694
+ }
695
+ function _r() {
696
+ return Math.random().toString(36).substr(2, 8);
697
+ }
698
+ function Xt(e, t) {
699
+ return {
700
+ usr: e.state,
701
+ key: e.key,
702
+ idx: t
703
+ };
704
+ }
705
+ function ct(e, t, n, a) {
706
+ return n === void 0 && (n = null), H({
707
+ pathname: typeof e == "string" ? e : e.pathname,
708
+ search: "",
709
+ hash: ""
710
+ }, typeof t == "string" ? He(t) : t, {
711
+ state: n,
712
+ // TODO: This could be cleaned up. push/replace should probably just take
713
+ // full Locations now and avoid the need to run through this flow at all
714
+ // But that's a pretty big refactor to the current test suite so going to
715
+ // keep as is for the time being and just let any incoming keys take precedence
716
+ key: t && t.key || a || _r()
717
+ });
718
+ }
719
+ function ht(e) {
720
+ let {
721
+ pathname: t = "/",
722
+ search: n = "",
723
+ hash: a = ""
724
+ } = e;
725
+ return n && n !== "?" && (t += n.charAt(0) === "?" ? n : "?" + n), a && a !== "#" && (t += a.charAt(0) === "#" ? a : "#" + a), t;
726
+ }
727
+ function He(e) {
728
+ let t = {};
729
+ if (e) {
730
+ let n = e.indexOf("#");
731
+ n >= 0 && (t.hash = e.substr(n), e = e.substr(0, n));
732
+ let a = e.indexOf("?");
733
+ a >= 0 && (t.search = e.substr(a), e = e.substr(0, a)), e && (t.pathname = e);
734
+ }
735
+ return t;
736
+ }
737
+ function Tr(e, t, n, a) {
738
+ a === void 0 && (a = {});
739
+ let {
740
+ window: o = document.defaultView,
741
+ v5Compat: h = !1
742
+ } = a, f = o.history, d = G.Pop, c = null, w = R();
743
+ w == null && (w = 0, f.replaceState(H({}, f.state, {
744
+ idx: w
745
+ }), ""));
746
+ function R() {
747
+ return (f.state || {
748
+ idx: null
749
+ }).idx;
750
+ }
751
+ function g() {
752
+ d = G.Pop;
753
+ let A = R(), k = A == null ? null : A - w;
754
+ w = A, c && c({
755
+ action: d,
756
+ location: M.location,
757
+ delta: k
758
+ });
759
+ }
760
+ function E(A, k) {
761
+ d = G.Push;
762
+ let T = ct(M.location, A, k);
763
+ w = R() + 1;
764
+ let pe = Xt(T, w), Q = M.createHref(T);
765
+ try {
766
+ f.pushState(pe, "", Q);
767
+ } catch (re) {
768
+ if (re instanceof DOMException && re.name === "DataCloneError")
769
+ throw re;
770
+ o.location.assign(Q);
771
+ }
772
+ h && c && c({
773
+ action: d,
774
+ location: M.location,
775
+ delta: 1
776
+ });
777
+ }
778
+ function I(A, k) {
779
+ d = G.Replace;
780
+ let T = ct(M.location, A, k);
781
+ w = R();
782
+ let pe = Xt(T, w), Q = M.createHref(T);
783
+ f.replaceState(pe, "", Q), h && c && c({
784
+ action: d,
785
+ location: M.location,
786
+ delta: 0
787
+ });
788
+ }
789
+ function j(A) {
790
+ let k = o.location.origin !== "null" ? o.location.origin : o.location.href, T = typeof A == "string" ? A : ht(A);
791
+ return T = T.replace(/ $/, "%20"), N(k, "No window.location.(origin|href) available to create URL for href: " + T), new URL(T, k);
792
+ }
793
+ let M = {
794
+ get action() {
795
+ return d;
796
+ },
797
+ get location() {
798
+ return e(o, f);
799
+ },
800
+ listen(A) {
801
+ if (c)
802
+ throw new Error("A history only accepts one active listener");
803
+ return o.addEventListener(Gt, g), c = A, () => {
804
+ o.removeEventListener(Gt, g), c = null;
805
+ };
806
+ },
807
+ createHref(A) {
808
+ return t(o, A);
809
+ },
810
+ createURL: j,
811
+ encodeLocation(A) {
812
+ let k = j(A);
813
+ return {
814
+ pathname: k.pathname,
815
+ search: k.search,
816
+ hash: k.hash
817
+ };
818
+ },
819
+ push: E,
820
+ replace: I,
821
+ go(A) {
822
+ return f.go(A);
823
+ }
824
+ };
825
+ return M;
826
+ }
827
+ var z;
828
+ (function(e) {
829
+ e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
830
+ })(z || (z = {}));
831
+ const Mr = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
832
+ function Cr(e) {
833
+ return e.index === !0;
834
+ }
835
+ function dt(e, t, n, a) {
836
+ return n === void 0 && (n = []), a === void 0 && (a = {}), e.map((o, h) => {
837
+ let f = [...n, String(h)], d = typeof o.id == "string" ? o.id : f.join("-");
838
+ if (N(o.index !== !0 || !o.children, "Cannot specify children on an index route"), N(!a[d], 'Found a route id collision on id "' + d + `". Route id's must be globally unique within Data Router usages`), Cr(o)) {
839
+ let c = H({}, o, t(o), {
840
+ id: d
841
+ });
842
+ return a[d] = c, c;
843
+ } else {
844
+ let c = H({}, o, t(o), {
845
+ id: d,
846
+ children: void 0
847
+ });
848
+ return a[d] = c, o.children && (c.children = dt(o.children, t, f, a)), c;
849
+ }
850
+ });
851
+ }
852
+ function Xe(e, t, n) {
853
+ return n === void 0 && (n = "/"), _t(e, t, n, !1);
854
+ }
855
+ function _t(e, t, n, a) {
856
+ let o = typeof t == "string" ? He(t) : t, h = Tt(o.pathname || "/", n);
857
+ if (h == null)
858
+ return null;
859
+ let f = hr(e);
860
+ jr(f);
861
+ let d = null;
862
+ for (let c = 0; d == null && c < f.length; ++c) {
863
+ let w = $r(h);
864
+ d = zr(f[c], w, a);
865
+ }
866
+ return d;
867
+ }
868
+ function Lr(e, t) {
869
+ let {
870
+ route: n,
871
+ pathname: a,
872
+ params: o
873
+ } = e;
874
+ return {
875
+ id: n.id,
876
+ pathname: a,
877
+ params: o,
878
+ data: t[n.id],
879
+ handle: n.handle
880
+ };
881
+ }
882
+ function hr(e, t, n, a) {
883
+ t === void 0 && (t = []), n === void 0 && (n = []), a === void 0 && (a = "");
884
+ let o = (h, f, d) => {
885
+ let c = {
886
+ relativePath: d === void 0 ? h.path || "" : d,
887
+ caseSensitive: h.caseSensitive === !0,
888
+ childrenIndex: f,
889
+ route: h
890
+ };
891
+ c.relativePath.startsWith("/") && (N(c.relativePath.startsWith(a), 'Absolute route path "' + c.relativePath + '" nested under path ' + ('"' + a + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), c.relativePath = c.relativePath.slice(a.length));
892
+ let w = ut([a, c.relativePath]), R = n.concat(c);
893
+ h.children && h.children.length > 0 && (N(
894
+ // Our types know better, but runtime JS may not!
895
+ // @ts-expect-error
896
+ h.index !== !0,
897
+ "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + w + '".')
898
+ ), hr(h.children, t, R, w)), !(h.path == null && !h.index) && t.push({
899
+ path: w,
900
+ score: Nr(w, h.index),
901
+ routesMeta: R
902
+ });
903
+ };
904
+ return e.forEach((h, f) => {
905
+ var d;
906
+ if (h.path === "" || !((d = h.path) != null && d.includes("?")))
907
+ o(h, f);
908
+ else
909
+ for (let c of pr(h.path))
910
+ o(h, f, c);
911
+ }), t;
912
+ }
913
+ function pr(e) {
914
+ let t = e.split("/");
915
+ if (t.length === 0) return [];
916
+ let [n, ...a] = t, o = n.endsWith("?"), h = n.replace(/\?$/, "");
917
+ if (a.length === 0)
918
+ return o ? [h, ""] : [h];
919
+ let f = pr(a.join("/")), d = [];
920
+ return d.push(...f.map((c) => c === "" ? h : [h, c].join("/"))), o && d.push(...f), d.map((c) => e.startsWith("/") && c === "" ? "/" : c);
921
+ }
922
+ function jr(e) {
923
+ e.sort((t, n) => t.score !== n.score ? n.score - t.score : Wr(t.routesMeta.map((a) => a.childrenIndex), n.routesMeta.map((a) => a.childrenIndex)));
924
+ }
925
+ const Or = /^:[\w-]+$/, Fr = 3, Ar = 2, Ur = 1, Ir = 10, kr = -2, qt = (e) => e === "*";
926
+ function Nr(e, t) {
927
+ let n = e.split("/"), a = n.length;
928
+ return n.some(qt) && (a += kr), t && (a += Ar), n.filter((o) => !qt(o)).reduce((o, h) => o + (Or.test(h) ? Fr : h === "" ? Ur : Ir), a);
929
+ }
930
+ function Wr(e, t) {
931
+ return e.length === t.length && e.slice(0, -1).every((a, o) => a === t[o]) ? (
932
+ // If two routes are siblings, we should try to match the earlier sibling
933
+ // first. This allows people to have fine-grained control over the matching
934
+ // behavior by simply putting routes with identical paths in the order they
935
+ // want them tried.
936
+ e[e.length - 1] - t[t.length - 1]
937
+ ) : (
938
+ // Otherwise, it doesn't really make sense to rank non-siblings by index,
939
+ // so they sort equally.
940
+ 0
941
+ );
942
+ }
943
+ function zr(e, t, n) {
944
+ n === void 0 && (n = !1);
945
+ let {
946
+ routesMeta: a
947
+ } = e, o = {}, h = "/", f = [];
948
+ for (let d = 0; d < a.length; ++d) {
949
+ let c = a[d], w = d === a.length - 1, R = h === "/" ? t : t.slice(h.length) || "/", g = Qt({
950
+ path: c.relativePath,
951
+ caseSensitive: c.caseSensitive,
952
+ end: w
953
+ }, R), E = c.route;
954
+ if (!g && w && n && !a[a.length - 1].route.index && (g = Qt({
955
+ path: c.relativePath,
956
+ caseSensitive: c.caseSensitive,
957
+ end: !1
958
+ }, R)), !g)
959
+ return null;
960
+ Object.assign(o, g.params), f.push({
961
+ // TODO: Can this as be avoided?
962
+ params: o,
963
+ pathname: ut([h, g.pathname]),
964
+ pathnameBase: Jr(ut([h, g.pathnameBase])),
965
+ route: E
966
+ }), g.pathnameBase !== "/" && (h = ut([h, g.pathnameBase]));
967
+ }
968
+ return f;
969
+ }
970
+ function Qt(e, t) {
971
+ typeof e == "string" && (e = {
972
+ path: e,
973
+ caseSensitive: !1,
974
+ end: !0
975
+ });
976
+ let [n, a] = Br(e.path, e.caseSensitive, e.end), o = t.match(n);
977
+ if (!o) return null;
978
+ let h = o[0], f = h.replace(/(.)\/+$/, "$1"), d = o.slice(1);
979
+ return {
980
+ params: a.reduce((w, R, g) => {
981
+ let {
982
+ paramName: E,
983
+ isOptional: I
984
+ } = R;
985
+ if (E === "*") {
986
+ let M = d[g] || "";
987
+ f = h.slice(0, h.length - M.length).replace(/(.)\/+$/, "$1");
988
+ }
989
+ const j = d[g];
990
+ return I && !j ? w[E] = void 0 : w[E] = (j || "").replace(/%2F/g, "/"), w;
991
+ }, {}),
992
+ pathname: h,
993
+ pathnameBase: f,
994
+ pattern: e
995
+ };
996
+ }
997
+ function Br(e, t, n) {
998
+ t === void 0 && (t = !1), n === void 0 && (n = !0), qe(e === "*" || !e.endsWith("*") || e.endsWith("/*"), 'Route path "' + e + '" will be treated as if it were ' + ('"' + e.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + e.replace(/\*$/, "/*") + '".'));
999
+ let a = [], o = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (f, d, c) => (a.push({
1000
+ paramName: d,
1001
+ isOptional: c != null
1002
+ }), c ? "/?([^\\/]+)?" : "/([^\\/]+)"));
1003
+ return e.endsWith("*") ? (a.push({
1004
+ paramName: "*"
1005
+ }), o += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? o += "\\/*$" : e !== "" && e !== "/" && (o += "(?:(?=\\/|$))"), [new RegExp(o, t ? void 0 : "i"), a];
1006
+ }
1007
+ function $r(e) {
1008
+ try {
1009
+ return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
1010
+ } catch (t) {
1011
+ return qe(!1, 'The URL path "' + e + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + t + ").")), e;
1012
+ }
1013
+ }
1014
+ function Tt(e, t) {
1015
+ if (t === "/") return e;
1016
+ if (!e.toLowerCase().startsWith(t.toLowerCase()))
1017
+ return null;
1018
+ let n = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(n);
1019
+ return a && a !== "/" ? null : e.slice(n) || "/";
1020
+ }
1021
+ function Hr(e, t) {
1022
+ t === void 0 && (t = "/");
1023
+ let {
1024
+ pathname: n,
1025
+ search: a = "",
1026
+ hash: o = ""
1027
+ } = typeof e == "string" ? He(e) : e;
1028
+ return {
1029
+ pathname: n ? n.startsWith("/") ? n : Yr(n, t) : t,
1030
+ search: Gr(a),
1031
+ hash: Xr(o)
1032
+ };
1033
+ }
1034
+ function Yr(e, t) {
1035
+ let n = t.replace(/\/+$/, "").split("/");
1036
+ return e.split("/").forEach((o) => {
1037
+ o === ".." ? n.length > 1 && n.pop() : o !== "." && n.push(o);
1038
+ }), n.length > 1 ? n.join("/") : "/";
1039
+ }
1040
+ function It(e, t, n, a) {
1041
+ return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(a) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
1042
+ }
1043
+ function mr(e) {
1044
+ return e.filter((t, n) => n === 0 || t.route.path && t.route.path.length > 0);
1045
+ }
1046
+ function Vr(e, t) {
1047
+ let n = mr(e);
1048
+ return t ? n.map((a, o) => o === n.length - 1 ? a.pathname : a.pathnameBase) : n.map((a) => a.pathnameBase);
1049
+ }
1050
+ function Kr(e, t, n, a) {
1051
+ a === void 0 && (a = !1);
1052
+ let o;
1053
+ typeof e == "string" ? o = He(e) : (o = H({}, e), N(!o.pathname || !o.pathname.includes("?"), It("?", "pathname", "search", o)), N(!o.pathname || !o.pathname.includes("#"), It("#", "pathname", "hash", o)), N(!o.search || !o.search.includes("#"), It("#", "search", "hash", o)));
1054
+ let h = e === "" || o.pathname === "", f = h ? "/" : o.pathname, d;
1055
+ if (f == null)
1056
+ d = n;
1057
+ else {
1058
+ let g = t.length - 1;
1059
+ if (!a && f.startsWith("..")) {
1060
+ let E = f.split("/");
1061
+ for (; E[0] === ".."; )
1062
+ E.shift(), g -= 1;
1063
+ o.pathname = E.join("/");
1064
+ }
1065
+ d = g >= 0 ? t[g] : "/";
1066
+ }
1067
+ let c = Hr(o, d), w = f && f !== "/" && f.endsWith("/"), R = (h || f === ".") && n.endsWith("/");
1068
+ return !c.pathname.endsWith("/") && (w || R) && (c.pathname += "/"), c;
1069
+ }
1070
+ const ut = (e) => e.join("/").replace(/\/\/+/g, "/"), Jr = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Gr = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Xr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
1071
+ class vr {
1072
+ constructor(t, n, a, o) {
1073
+ o === void 0 && (o = !1), this.status = t, this.statusText = n || "", this.internal = o, a instanceof Error ? (this.data = a.toString(), this.error = a) : this.data = a;
1074
+ }
1075
+ }
1076
+ function $t(e) {
1077
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
1078
+ }
1079
+ const gr = ["post", "put", "patch", "delete"], qr = new Set(gr), Qr = ["get", ...gr], Zr = new Set(Qr), ea = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]), ta = /* @__PURE__ */ new Set([307, 308]), kt = {
1080
+ state: "idle",
1081
+ location: void 0,
1082
+ formMethod: void 0,
1083
+ formAction: void 0,
1084
+ formEncType: void 0,
1085
+ formData: void 0,
1086
+ json: void 0,
1087
+ text: void 0
1088
+ }, ra = {
1089
+ state: "idle",
1090
+ data: void 0,
1091
+ formMethod: void 0,
1092
+ formAction: void 0,
1093
+ formEncType: void 0,
1094
+ formData: void 0,
1095
+ json: void 0,
1096
+ text: void 0
1097
+ }, ot = {
1098
+ state: "unblocked",
1099
+ proceed: void 0,
1100
+ reset: void 0,
1101
+ location: void 0
1102
+ }, Ht = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, aa = (e) => ({
1103
+ hasErrorBoundary: !!e.hasErrorBoundary
1104
+ }), yr = "remix-router-transitions";
1105
+ function xa(e) {
1106
+ const t = e.window ? e.window : typeof window < "u" ? window : void 0, n = typeof t < "u" && typeof t.document < "u" && typeof t.document.createElement < "u", a = !n;
1107
+ N(e.routes.length > 0, "You must provide a non-empty routes array to createRouter");
1108
+ let o;
1109
+ if (e.mapRouteProperties)
1110
+ o = e.mapRouteProperties;
1111
+ else if (e.detectErrorBoundary) {
1112
+ let i = e.detectErrorBoundary;
1113
+ o = (l) => ({
1114
+ hasErrorBoundary: i(l)
1115
+ });
1116
+ } else
1117
+ o = aa;
1118
+ let h = {}, f = dt(e.routes, o, void 0, h), d, c = e.basename || "/", w = e.unstable_dataStrategy || sa, R = e.unstable_patchRoutesOnMiss, g = H({
1119
+ v7_fetcherPersist: !1,
1120
+ v7_normalizeFormMethod: !1,
1121
+ v7_partialHydration: !1,
1122
+ v7_prependBasename: !1,
1123
+ v7_relativeSplatPath: !1,
1124
+ unstable_skipActionErrorRevalidation: !1
1125
+ }, e.future), E = null, I = /* @__PURE__ */ new Set(), j = null, M = null, A = null, k = e.hydrationData != null, T = Xe(f, e.history.location, c), pe = null;
1126
+ if (T == null && !R) {
1127
+ let i = te(404, {
1128
+ pathname: e.history.location.pathname
1129
+ }), {
1130
+ matches: l,
1131
+ route: u
1132
+ } = sr(f);
1133
+ T = l, pe = {
1134
+ [u.id]: i
1135
+ };
1136
+ }
1137
+ T && R && Ke(T, f, e.history.location.pathname).active && (T = null);
1138
+ let Q;
1139
+ if (!T)
1140
+ Q = !1, T = [];
1141
+ else if (T.some((i) => i.route.lazy))
1142
+ Q = !1;
1143
+ else if (!T.some((i) => i.route.loader))
1144
+ Q = !0;
1145
+ else if (g.v7_partialHydration) {
1146
+ let i = e.hydrationData ? e.hydrationData.loaderData : null, l = e.hydrationData ? e.hydrationData.errors : null, u = (p) => p.route.loader ? typeof p.route.loader == "function" && p.route.loader.hydrate === !0 ? !1 : i && i[p.route.id] !== void 0 || l && l[p.route.id] !== void 0 : !0;
1147
+ if (l) {
1148
+ let p = T.findIndex((S) => l[S.route.id] !== void 0);
1149
+ Q = T.slice(0, p + 1).every(u);
1150
+ } else
1151
+ Q = T.every(u);
1152
+ } else
1153
+ Q = e.hydrationData != null;
1154
+ let re, m = {
1155
+ historyAction: e.history.action,
1156
+ location: e.history.location,
1157
+ matches: T,
1158
+ initialized: Q,
1159
+ navigation: kt,
1160
+ // Don't restore on initial updateState() if we were SSR'd
1161
+ restoreScrollPosition: e.hydrationData != null ? !1 : null,
1162
+ preventScrollReset: !1,
1163
+ revalidation: "idle",
1164
+ loaderData: e.hydrationData && e.hydrationData.loaderData || {},
1165
+ actionData: e.hydrationData && e.hydrationData.actionData || null,
1166
+ errors: e.hydrationData && e.hydrationData.errors || pe,
1167
+ fetchers: /* @__PURE__ */ new Map(),
1168
+ blockers: /* @__PURE__ */ new Map()
1169
+ }, ae = G.Pop, ue = !1, U, Z = !1, J = /* @__PURE__ */ new Map(), ie = null, V = !1, B = !1, fe = [], Ue = [], $ = /* @__PURE__ */ new Map(), Ie = 0, _e = -1, Ee = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), Se = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), Qe = /* @__PURE__ */ new Map(), Me = !1;
1170
+ function Ze() {
1171
+ if (E = e.history.listen((i) => {
1172
+ let {
1173
+ action: l,
1174
+ location: u,
1175
+ delta: p
1176
+ } = i;
1177
+ if (Me) {
1178
+ Me = !1;
1179
+ return;
1180
+ }
1181
+ qe(ve.size === 0 || p != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");
1182
+ let S = at({
1183
+ currentLocation: m.location,
1184
+ nextLocation: u,
1185
+ historyAction: l
1186
+ });
1187
+ if (S && p != null) {
1188
+ Me = !0, e.history.go(p * -1), Oe(S, {
1189
+ state: "blocked",
1190
+ location: u,
1191
+ proceed() {
1192
+ Oe(S, {
1193
+ state: "proceeding",
1194
+ proceed: void 0,
1195
+ reset: void 0,
1196
+ location: u
1197
+ }), e.history.go(p);
1198
+ },
1199
+ reset() {
1200
+ let x = new Map(m.blockers);
1201
+ x.set(S, ot), X({
1202
+ blockers: x
1203
+ });
1204
+ }
1205
+ });
1206
+ return;
1207
+ }
1208
+ return oe(l, u);
1209
+ }), n) {
1210
+ wa(t, J);
1211
+ let i = () => Ea(t, J);
1212
+ t.addEventListener("pagehide", i), ie = () => t.removeEventListener("pagehide", i);
1213
+ }
1214
+ return m.initialized || oe(G.Pop, m.location, {
1215
+ initialHydration: !0
1216
+ }), re;
1217
+ }
1218
+ function Ye() {
1219
+ E && E(), ie && ie(), I.clear(), U && U.abort(), m.fetchers.forEach((i, l) => je(l)), m.blockers.forEach((i, l) => Rt(l));
1220
+ }
1221
+ function Mt(i) {
1222
+ return I.add(i), () => I.delete(i);
1223
+ }
1224
+ function X(i, l) {
1225
+ l === void 0 && (l = {}), m = H({}, m, i);
1226
+ let u = [], p = [];
1227
+ g.v7_fetcherPersist && m.fetchers.forEach((S, x) => {
1228
+ S.state === "idle" && (me.has(x) ? p.push(x) : u.push(x));
1229
+ }), [...I].forEach((S) => S(m, {
1230
+ deletedFetchers: p,
1231
+ unstable_viewTransitionOpts: l.viewTransitionOpts,
1232
+ unstable_flushSync: l.flushSync === !0
1233
+ })), g.v7_fetcherPersist && (u.forEach((S) => m.fetchers.delete(S)), p.forEach((S) => je(S)));
1234
+ }
1235
+ function Ce(i, l, u) {
1236
+ var p, S;
1237
+ let {
1238
+ flushSync: x
1239
+ } = u === void 0 ? {} : u, r = m.actionData != null && m.navigation.formMethod != null && ge(m.navigation.formMethod) && m.navigation.state === "loading" && ((p = i.state) == null ? void 0 : p._isRedirect) !== !0, s;
1240
+ l.actionData ? Object.keys(l.actionData).length > 0 ? s = l.actionData : s = null : r ? s = m.actionData : s = null;
1241
+ let v = l.loaderData ? or(m.loaderData, l.loaderData, l.matches || [], l.errors) : m.loaderData, y = m.blockers;
1242
+ y.size > 0 && (y = new Map(y), y.forEach((D, P) => y.set(P, ot)));
1243
+ let b = ue === !0 || m.navigation.formMethod != null && ge(m.navigation.formMethod) && ((S = i.state) == null ? void 0 : S._isRedirect) !== !0;
1244
+ d && (f = d, d = void 0), V || ae === G.Pop || (ae === G.Push ? e.history.push(i, i.state) : ae === G.Replace && e.history.replace(i, i.state));
1245
+ let _;
1246
+ if (ae === G.Pop) {
1247
+ let D = J.get(m.location.pathname);
1248
+ D && D.has(i.pathname) ? _ = {
1249
+ currentLocation: m.location,
1250
+ nextLocation: i
1251
+ } : J.has(i.pathname) && (_ = {
1252
+ currentLocation: i,
1253
+ nextLocation: m.location
1254
+ });
1255
+ } else if (Z) {
1256
+ let D = J.get(m.location.pathname);
1257
+ D ? D.add(i.pathname) : (D = /* @__PURE__ */ new Set([i.pathname]), J.set(m.location.pathname, D)), _ = {
1258
+ currentLocation: m.location,
1259
+ nextLocation: i
1260
+ };
1261
+ }
1262
+ X(H({}, l, {
1263
+ actionData: s,
1264
+ loaderData: v,
1265
+ historyAction: ae,
1266
+ location: i,
1267
+ initialized: !0,
1268
+ navigation: kt,
1269
+ revalidation: "idle",
1270
+ restoreScrollPosition: Dt(i, l.matches || m.matches),
1271
+ preventScrollReset: b,
1272
+ blockers: y
1273
+ }), {
1274
+ viewTransitionOpts: _,
1275
+ flushSync: x === !0
1276
+ }), ae = G.Pop, ue = !1, Z = !1, V = !1, B = !1, fe = [], Ue = [];
1277
+ }
1278
+ async function pt(i, l) {
1279
+ if (typeof i == "number") {
1280
+ e.history.go(i);
1281
+ return;
1282
+ }
1283
+ let u = zt(m.location, m.matches, c, g.v7_prependBasename, i, g.v7_relativeSplatPath, l == null ? void 0 : l.fromRouteId, l == null ? void 0 : l.relative), {
1284
+ path: p,
1285
+ submission: S,
1286
+ error: x
1287
+ } = Zt(g.v7_normalizeFormMethod, !1, u, l), r = m.location, s = ct(m.location, p, l && l.state);
1288
+ s = H({}, s, e.history.encodeLocation(s));
1289
+ let v = l && l.replace != null ? l.replace : void 0, y = G.Push;
1290
+ v === !0 ? y = G.Replace : v === !1 || S != null && ge(S.formMethod) && S.formAction === m.location.pathname + m.location.search && (y = G.Replace);
1291
+ let b = l && "preventScrollReset" in l ? l.preventScrollReset === !0 : void 0, _ = (l && l.unstable_flushSync) === !0, D = at({
1292
+ currentLocation: r,
1293
+ nextLocation: s,
1294
+ historyAction: y
1295
+ });
1296
+ if (D) {
1297
+ Oe(D, {
1298
+ state: "blocked",
1299
+ location: s,
1300
+ proceed() {
1301
+ Oe(D, {
1302
+ state: "proceeding",
1303
+ proceed: void 0,
1304
+ reset: void 0,
1305
+ location: s
1306
+ }), pt(i, l);
1307
+ },
1308
+ reset() {
1309
+ let P = new Map(m.blockers);
1310
+ P.set(D, ot), X({
1311
+ blockers: P
1312
+ });
1313
+ }
1314
+ });
1315
+ return;
1316
+ }
1317
+ return await oe(y, s, {
1318
+ submission: S,
1319
+ // Send through the formData serialization error if we have one so we can
1320
+ // render at the right error boundary after we match routes
1321
+ pendingError: x,
1322
+ preventScrollReset: b,
1323
+ replace: l && l.replace,
1324
+ enableViewTransition: l && l.unstable_viewTransition,
1325
+ flushSync: _
1326
+ });
1327
+ }
1328
+ function Ve() {
1329
+ if (Pe(), X({
1330
+ revalidation: "loading"
1331
+ }), m.navigation.state !== "submitting") {
1332
+ if (m.navigation.state === "idle") {
1333
+ oe(m.historyAction, m.location, {
1334
+ startUninterruptedRevalidation: !0
1335
+ });
1336
+ return;
1337
+ }
1338
+ oe(ae || m.historyAction, m.navigation.location, {
1339
+ overrideNavigation: m.navigation
1340
+ });
1341
+ }
1342
+ }
1343
+ async function oe(i, l, u) {
1344
+ U && U.abort(), U = null, ae = i, V = (u && u.startUninterruptedRevalidation) === !0, St(m.location, m.matches), ue = (u && u.preventScrollReset) === !0, Z = (u && u.enableViewTransition) === !0;
1345
+ let p = d || f, S = u && u.overrideNavigation, x = Xe(p, l, c), r = (u && u.flushSync) === !0, s = Ke(x, p, l.pathname);
1346
+ if (s.active && s.matches && (x = s.matches), !x) {
1347
+ let {
1348
+ error: C,
1349
+ notFoundMatches: O,
1350
+ route: L
1351
+ } = Re(l.pathname);
1352
+ Ce(l, {
1353
+ matches: O,
1354
+ loaderData: {},
1355
+ errors: {
1356
+ [L.id]: C
1357
+ }
1358
+ }, {
1359
+ flushSync: r
1360
+ });
1361
+ return;
1362
+ }
1363
+ if (m.initialized && !B && pa(m.location, l) && !(u && u.submission && ge(u.submission.formMethod))) {
1364
+ Ce(l, {
1365
+ matches: x
1366
+ }, {
1367
+ flushSync: r
1368
+ });
1369
+ return;
1370
+ }
1371
+ U = new AbortController();
1372
+ let v = Ge(e.history, l, U.signal, u && u.submission), y;
1373
+ if (u && u.pendingError)
1374
+ y = [ft(x).route.id, {
1375
+ type: z.error,
1376
+ error: u.pendingError
1377
+ }];
1378
+ else if (u && u.submission && ge(u.submission.formMethod)) {
1379
+ let C = await mt(v, l, u.submission, x, s.active, {
1380
+ replace: u.replace,
1381
+ flushSync: r
1382
+ });
1383
+ if (C.shortCircuited)
1384
+ return;
1385
+ if (C.pendingActionResult) {
1386
+ let [O, L] = C.pendingActionResult;
1387
+ if (se(L) && $t(L.error) && L.error.status === 404) {
1388
+ U = null, Ce(l, {
1389
+ matches: C.matches,
1390
+ loaderData: {},
1391
+ errors: {
1392
+ [O]: L.error
1393
+ }
1394
+ });
1395
+ return;
1396
+ }
1397
+ }
1398
+ x = C.matches || x, y = C.pendingActionResult, S = Nt(l, u.submission), r = !1, s.active = !1, v = Ge(e.history, v.url, v.signal);
1399
+ }
1400
+ let {
1401
+ shortCircuited: b,
1402
+ matches: _,
1403
+ loaderData: D,
1404
+ errors: P
1405
+ } = await vt(v, l, x, s.active, S, u && u.submission, u && u.fetcherSubmission, u && u.replace, u && u.initialHydration === !0, r, y);
1406
+ b || (U = null, Ce(l, H({
1407
+ matches: _ || x
1408
+ }, lr(y), {
1409
+ loaderData: D,
1410
+ errors: P
1411
+ })));
1412
+ }
1413
+ async function mt(i, l, u, p, S, x) {
1414
+ x === void 0 && (x = {}), Pe();
1415
+ let r = ba(l, u);
1416
+ if (X({
1417
+ navigation: r
1418
+ }, {
1419
+ flushSync: x.flushSync === !0
1420
+ }), S) {
1421
+ let y = await ze(p, l.pathname, i.signal);
1422
+ if (y.type === "aborted")
1423
+ return {
1424
+ shortCircuited: !0
1425
+ };
1426
+ if (y.type === "error") {
1427
+ let {
1428
+ error: b,
1429
+ notFoundMatches: _,
1430
+ route: D
1431
+ } = Fe(l.pathname, y);
1432
+ return {
1433
+ matches: _,
1434
+ pendingActionResult: [D.id, {
1435
+ type: z.error,
1436
+ error: b
1437
+ }]
1438
+ };
1439
+ } else if (y.matches)
1440
+ p = y.matches;
1441
+ else {
1442
+ let {
1443
+ notFoundMatches: b,
1444
+ error: _,
1445
+ route: D
1446
+ } = Re(l.pathname);
1447
+ return {
1448
+ matches: b,
1449
+ pendingActionResult: [D.id, {
1450
+ type: z.error,
1451
+ error: _
1452
+ }]
1453
+ };
1454
+ }
1455
+ }
1456
+ let s, v = st(p, l);
1457
+ if (!v.route.action && !v.route.lazy)
1458
+ s = {
1459
+ type: z.error,
1460
+ error: te(405, {
1461
+ method: i.method,
1462
+ pathname: l.pathname,
1463
+ routeId: v.route.id
1464
+ })
1465
+ };
1466
+ else if (s = (await Le("action", i, [v], p))[0], i.signal.aborted)
1467
+ return {
1468
+ shortCircuited: !0
1469
+ };
1470
+ if ($e(s)) {
1471
+ let y;
1472
+ return x && x.replace != null ? y = x.replace : y = ar(s.response.headers.get("Location"), new URL(i.url), c) === m.location.pathname + m.location.search, await Ne(i, s, {
1473
+ submission: u,
1474
+ replace: y
1475
+ }), {
1476
+ shortCircuited: !0
1477
+ };
1478
+ }
1479
+ if (Be(s))
1480
+ throw te(400, {
1481
+ type: "defer-action"
1482
+ });
1483
+ if (se(s)) {
1484
+ let y = ft(p, v.route.id);
1485
+ return (x && x.replace) !== !0 && (ae = G.Push), {
1486
+ matches: p,
1487
+ pendingActionResult: [y.route.id, s]
1488
+ };
1489
+ }
1490
+ return {
1491
+ matches: p,
1492
+ pendingActionResult: [v.route.id, s]
1493
+ };
1494
+ }
1495
+ async function vt(i, l, u, p, S, x, r, s, v, y, b) {
1496
+ let _ = S || Nt(l, x), D = x || r || cr(_), P = !V && (!g.v7_partialHydration || !v);
1497
+ if (p) {
1498
+ if (P) {
1499
+ let Y = ke(b);
1500
+ X(H({
1501
+ navigation: _
1502
+ }, Y !== void 0 ? {
1503
+ actionData: Y
1504
+ } : {}), {
1505
+ flushSync: y
1506
+ });
1507
+ }
1508
+ let F = await ze(u, l.pathname, i.signal);
1509
+ if (F.type === "aborted")
1510
+ return {
1511
+ shortCircuited: !0
1512
+ };
1513
+ if (F.type === "error") {
1514
+ let {
1515
+ error: Y,
1516
+ notFoundMatches: le,
1517
+ route: W
1518
+ } = Fe(l.pathname, F);
1519
+ return {
1520
+ matches: le,
1521
+ loaderData: {},
1522
+ errors: {
1523
+ [W.id]: Y
1524
+ }
1525
+ };
1526
+ } else if (F.matches)
1527
+ u = F.matches;
1528
+ else {
1529
+ let {
1530
+ error: Y,
1531
+ notFoundMatches: le,
1532
+ route: W
1533
+ } = Re(l.pathname);
1534
+ return {
1535
+ matches: le,
1536
+ loaderData: {},
1537
+ errors: {
1538
+ [W.id]: Y
1539
+ }
1540
+ };
1541
+ }
1542
+ }
1543
+ let C = d || f, [O, L] = er(e.history, m, u, D, l, g.v7_partialHydration && v === !0, g.unstable_skipActionErrorRevalidation, B, fe, Ue, me, Se, ce, C, c, b);
1544
+ if (We((F) => !(u && u.some((Y) => Y.route.id === F)) || O && O.some((Y) => Y.route.id === F)), _e = ++Ie, O.length === 0 && L.length === 0) {
1545
+ let F = yt();
1546
+ return Ce(l, H({
1547
+ matches: u,
1548
+ loaderData: {},
1549
+ // Commit pending error if we're short circuiting
1550
+ errors: b && se(b[1]) ? {
1551
+ [b[0]]: b[1].error
1552
+ } : null
1553
+ }, lr(b), F ? {
1554
+ fetchers: new Map(m.fetchers)
1555
+ } : {}), {
1556
+ flushSync: y
1557
+ }), {
1558
+ shortCircuited: !0
1559
+ };
1560
+ }
1561
+ if (P) {
1562
+ let F = {};
1563
+ if (!p) {
1564
+ F.navigation = _;
1565
+ let Y = ke(b);
1566
+ Y !== void 0 && (F.actionData = Y);
1567
+ }
1568
+ L.length > 0 && (F.fetchers = Ct(L)), X(F, {
1569
+ flushSync: y
1570
+ });
1571
+ }
1572
+ L.forEach((F) => {
1573
+ $.has(F.key) && be(F.key), F.controller && $.set(F.key, F.controller);
1574
+ });
1575
+ let q = () => L.forEach((F) => be(F.key));
1576
+ U && U.signal.addEventListener("abort", q);
1577
+ let {
1578
+ loaderResults: ee,
1579
+ fetcherResults: ne
1580
+ } = await tt(m.matches, u, O, L, i);
1581
+ if (i.signal.aborted)
1582
+ return {
1583
+ shortCircuited: !0
1584
+ };
1585
+ U && U.signal.removeEventListener("abort", q), L.forEach((F) => $.delete(F.key));
1586
+ let K = ur([...ee, ...ne]);
1587
+ if (K) {
1588
+ if (K.idx >= O.length) {
1589
+ let F = L[K.idx - O.length].key;
1590
+ ce.add(F);
1591
+ }
1592
+ return await Ne(i, K.result, {
1593
+ replace: s
1594
+ }), {
1595
+ shortCircuited: !0
1596
+ };
1597
+ }
1598
+ let {
1599
+ loaderData: we,
1600
+ errors: he
1601
+ } = ir(m, u, O, ee, b, L, ne, De);
1602
+ De.forEach((F, Y) => {
1603
+ F.subscribe((le) => {
1604
+ (le || F.done) && De.delete(Y);
1605
+ });
1606
+ }), g.v7_partialHydration && v && m.errors && Object.entries(m.errors).filter((F) => {
1607
+ let [Y] = F;
1608
+ return !O.some((le) => le.route.id === Y);
1609
+ }).forEach((F) => {
1610
+ let [Y, le] = F;
1611
+ he = Object.assign(he || {}, {
1612
+ [Y]: le
1613
+ });
1614
+ });
1615
+ let Je = yt(), Pt = bt(_e), xt = Je || Pt || L.length > 0;
1616
+ return H({
1617
+ matches: u,
1618
+ loaderData: we,
1619
+ errors: he
1620
+ }, xt ? {
1621
+ fetchers: new Map(m.fetchers)
1622
+ } : {});
1623
+ }
1624
+ function ke(i) {
1625
+ if (i && !se(i[1]))
1626
+ return {
1627
+ [i[0]]: i[1].data
1628
+ };
1629
+ if (m.actionData)
1630
+ return Object.keys(m.actionData).length === 0 ? null : m.actionData;
1631
+ }
1632
+ function Ct(i) {
1633
+ return i.forEach((l) => {
1634
+ let u = m.fetchers.get(l.key), p = lt(void 0, u ? u.data : void 0);
1635
+ m.fetchers.set(l.key, p);
1636
+ }), new Map(m.fetchers);
1637
+ }
1638
+ function Lt(i, l, u, p) {
1639
+ if (a)
1640
+ throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");
1641
+ $.has(i) && be(i);
1642
+ let S = (p && p.unstable_flushSync) === !0, x = d || f, r = zt(m.location, m.matches, c, g.v7_prependBasename, u, g.v7_relativeSplatPath, l, p == null ? void 0 : p.relative), s = Xe(x, r, c), v = Ke(s, x, r);
1643
+ if (v.active && v.matches && (s = v.matches), !s) {
1644
+ de(i, l, te(404, {
1645
+ pathname: r
1646
+ }), {
1647
+ flushSync: S
1648
+ });
1649
+ return;
1650
+ }
1651
+ let {
1652
+ path: y,
1653
+ submission: b,
1654
+ error: _
1655
+ } = Zt(g.v7_normalizeFormMethod, !0, r, p);
1656
+ if (_) {
1657
+ de(i, l, _, {
1658
+ flushSync: S
1659
+ });
1660
+ return;
1661
+ }
1662
+ let D = st(s, y);
1663
+ if (ue = (p && p.preventScrollReset) === !0, b && ge(b.formMethod)) {
1664
+ et(i, l, y, D, s, v.active, S, b);
1665
+ return;
1666
+ }
1667
+ Se.set(i, {
1668
+ routeId: l,
1669
+ path: y
1670
+ }), jt(i, l, y, D, s, v.active, S, b);
1671
+ }
1672
+ async function et(i, l, u, p, S, x, r, s) {
1673
+ Pe(), Se.delete(i);
1674
+ function v(W) {
1675
+ if (!W.route.action && !W.route.lazy) {
1676
+ let xe = te(405, {
1677
+ method: s.formMethod,
1678
+ pathname: u,
1679
+ routeId: l
1680
+ });
1681
+ return de(i, l, xe, {
1682
+ flushSync: r
1683
+ }), !0;
1684
+ }
1685
+ return !1;
1686
+ }
1687
+ if (!x && v(p))
1688
+ return;
1689
+ let y = m.fetchers.get(i);
1690
+ ye(i, Ra(s, y), {
1691
+ flushSync: r
1692
+ });
1693
+ let b = new AbortController(), _ = Ge(e.history, u, b.signal, s);
1694
+ if (x) {
1695
+ let W = await ze(S, u, _.signal);
1696
+ if (W.type === "aborted")
1697
+ return;
1698
+ if (W.type === "error") {
1699
+ let {
1700
+ error: xe
1701
+ } = Fe(u, W);
1702
+ de(i, l, xe, {
1703
+ flushSync: r
1704
+ });
1705
+ return;
1706
+ } else if (W.matches) {
1707
+ if (S = W.matches, p = st(S, u), v(p))
1708
+ return;
1709
+ } else {
1710
+ de(i, l, te(404, {
1711
+ pathname: u
1712
+ }), {
1713
+ flushSync: r
1714
+ });
1715
+ return;
1716
+ }
1717
+ }
1718
+ $.set(i, b);
1719
+ let D = Ie, C = (await Le("action", _, [p], S))[0];
1720
+ if (_.signal.aborted) {
1721
+ $.get(i) === b && $.delete(i);
1722
+ return;
1723
+ }
1724
+ if (g.v7_fetcherPersist && me.has(i)) {
1725
+ if ($e(C) || se(C)) {
1726
+ ye(i, Ae(void 0));
1727
+ return;
1728
+ }
1729
+ } else {
1730
+ if ($e(C))
1731
+ if ($.delete(i), _e > D) {
1732
+ ye(i, Ae(void 0));
1733
+ return;
1734
+ } else
1735
+ return ce.add(i), ye(i, lt(s)), Ne(_, C, {
1736
+ fetcherSubmission: s
1737
+ });
1738
+ if (se(C)) {
1739
+ de(i, l, C.error);
1740
+ return;
1741
+ }
1742
+ }
1743
+ if (Be(C))
1744
+ throw te(400, {
1745
+ type: "defer-action"
1746
+ });
1747
+ let O = m.navigation.location || m.location, L = Ge(e.history, O, b.signal), q = d || f, ee = m.navigation.state !== "idle" ? Xe(q, m.navigation.location, c) : m.matches;
1748
+ N(ee, "Didn't find any matches after fetcher action");
1749
+ let ne = ++Ie;
1750
+ Ee.set(i, ne);
1751
+ let K = lt(s, C.data);
1752
+ m.fetchers.set(i, K);
1753
+ let [we, he] = er(e.history, m, ee, s, O, !1, g.unstable_skipActionErrorRevalidation, B, fe, Ue, me, Se, ce, q, c, [p.route.id, C]);
1754
+ he.filter((W) => W.key !== i).forEach((W) => {
1755
+ let xe = W.key, Vt = m.fetchers.get(xe), Dr = lt(void 0, Vt ? Vt.data : void 0);
1756
+ m.fetchers.set(xe, Dr), $.has(xe) && be(xe), W.controller && $.set(xe, W.controller);
1757
+ }), X({
1758
+ fetchers: new Map(m.fetchers)
1759
+ });
1760
+ let Je = () => he.forEach((W) => be(W.key));
1761
+ b.signal.addEventListener("abort", Je);
1762
+ let {
1763
+ loaderResults: Pt,
1764
+ fetcherResults: xt
1765
+ } = await tt(m.matches, ee, we, he, L);
1766
+ if (b.signal.aborted)
1767
+ return;
1768
+ b.signal.removeEventListener("abort", Je), Ee.delete(i), $.delete(i), he.forEach((W) => $.delete(W.key));
1769
+ let F = ur([...Pt, ...xt]);
1770
+ if (F) {
1771
+ if (F.idx >= we.length) {
1772
+ let W = he[F.idx - we.length].key;
1773
+ ce.add(W);
1774
+ }
1775
+ return Ne(L, F.result);
1776
+ }
1777
+ let {
1778
+ loaderData: Y,
1779
+ errors: le
1780
+ } = ir(m, m.matches, we, Pt, void 0, he, xt, De);
1781
+ if (m.fetchers.has(i)) {
1782
+ let W = Ae(C.data);
1783
+ m.fetchers.set(i, W);
1784
+ }
1785
+ bt(ne), m.navigation.state === "loading" && ne > _e ? (N(ae, "Expected pending action"), U && U.abort(), Ce(m.navigation.location, {
1786
+ matches: ee,
1787
+ loaderData: Y,
1788
+ errors: le,
1789
+ fetchers: new Map(m.fetchers)
1790
+ })) : (X({
1791
+ errors: le,
1792
+ loaderData: or(m.loaderData, Y, ee, le),
1793
+ fetchers: new Map(m.fetchers)
1794
+ }), B = !1);
1795
+ }
1796
+ async function jt(i, l, u, p, S, x, r, s) {
1797
+ let v = m.fetchers.get(i);
1798
+ ye(i, lt(s, v ? v.data : void 0), {
1799
+ flushSync: r
1800
+ });
1801
+ let y = new AbortController(), b = Ge(e.history, u, y.signal);
1802
+ if (x) {
1803
+ let C = await ze(S, u, b.signal);
1804
+ if (C.type === "aborted")
1805
+ return;
1806
+ if (C.type === "error") {
1807
+ let {
1808
+ error: O
1809
+ } = Fe(u, C);
1810
+ de(i, l, O, {
1811
+ flushSync: r
1812
+ });
1813
+ return;
1814
+ } else if (C.matches)
1815
+ S = C.matches, p = st(S, u);
1816
+ else {
1817
+ de(i, l, te(404, {
1818
+ pathname: u
1819
+ }), {
1820
+ flushSync: r
1821
+ });
1822
+ return;
1823
+ }
1824
+ }
1825
+ $.set(i, y);
1826
+ let _ = Ie, P = (await Le("loader", b, [p], S))[0];
1827
+ if (Be(P) && (P = await Sr(P, b.signal, !0) || P), $.get(i) === y && $.delete(i), !b.signal.aborted) {
1828
+ if (me.has(i)) {
1829
+ ye(i, Ae(void 0));
1830
+ return;
1831
+ }
1832
+ if ($e(P))
1833
+ if (_e > _) {
1834
+ ye(i, Ae(void 0));
1835
+ return;
1836
+ } else {
1837
+ ce.add(i), await Ne(b, P);
1838
+ return;
1839
+ }
1840
+ if (se(P)) {
1841
+ de(i, l, P.error);
1842
+ return;
1843
+ }
1844
+ N(!Be(P), "Unhandled fetcher deferred data"), ye(i, Ae(P.data));
1845
+ }
1846
+ }
1847
+ async function Ne(i, l, u) {
1848
+ let {
1849
+ submission: p,
1850
+ fetcherSubmission: S,
1851
+ replace: x
1852
+ } = u === void 0 ? {} : u;
1853
+ l.response.headers.has("X-Remix-Revalidate") && (B = !0);
1854
+ let r = l.response.headers.get("Location");
1855
+ N(r, "Expected a Location header on the redirect Response"), r = ar(r, new URL(i.url), c);
1856
+ let s = ct(m.location, r, {
1857
+ _isRedirect: !0
1858
+ });
1859
+ if (n) {
1860
+ let P = !1;
1861
+ if (l.response.headers.has("X-Remix-Reload-Document"))
1862
+ P = !0;
1863
+ else if (Ht.test(r)) {
1864
+ const C = e.history.createURL(r);
1865
+ P = // Hard reload if it's an absolute URL to a new origin
1866
+ C.origin !== t.location.origin || // Hard reload if it's an absolute URL that does not match our basename
1867
+ Tt(C.pathname, c) == null;
1868
+ }
1869
+ if (P) {
1870
+ x ? t.location.replace(r) : t.location.assign(r);
1871
+ return;
1872
+ }
1873
+ }
1874
+ U = null;
1875
+ let v = x === !0 ? G.Replace : G.Push, {
1876
+ formMethod: y,
1877
+ formAction: b,
1878
+ formEncType: _
1879
+ } = m.navigation;
1880
+ !p && !S && y && b && _ && (p = cr(m.navigation));
1881
+ let D = p || S;
1882
+ if (ta.has(l.response.status) && D && ge(D.formMethod))
1883
+ await oe(v, s, {
1884
+ submission: H({}, D, {
1885
+ formAction: r
1886
+ }),
1887
+ // Preserve this flag across redirects
1888
+ preventScrollReset: ue
1889
+ });
1890
+ else {
1891
+ let P = Nt(s, p);
1892
+ await oe(v, s, {
1893
+ overrideNavigation: P,
1894
+ // Send fetcher submissions through for shouldRevalidate
1895
+ fetcherSubmission: S,
1896
+ // Preserve this flag across redirects
1897
+ preventScrollReset: ue
1898
+ });
1899
+ }
1900
+ }
1901
+ async function Le(i, l, u, p) {
1902
+ try {
1903
+ let S = await ua(w, i, l, u, p, h, o);
1904
+ return await Promise.all(S.map((x, r) => {
1905
+ if (va(x)) {
1906
+ let s = x.result;
1907
+ return {
1908
+ type: z.redirect,
1909
+ response: da(s, l, u[r].route.id, p, c, g.v7_relativeSplatPath)
1910
+ };
1911
+ }
1912
+ return ca(x);
1913
+ }));
1914
+ } catch (S) {
1915
+ return u.map(() => ({
1916
+ type: z.error,
1917
+ error: S
1918
+ }));
1919
+ }
1920
+ }
1921
+ async function tt(i, l, u, p, S) {
1922
+ let [x, ...r] = await Promise.all([u.length ? Le("loader", S, u, l) : [], ...p.map((s) => {
1923
+ if (s.matches && s.match && s.controller) {
1924
+ let v = Ge(e.history, s.path, s.controller.signal);
1925
+ return Le("loader", v, [s.match], s.matches).then((y) => y[0]);
1926
+ } else
1927
+ return Promise.resolve({
1928
+ type: z.error,
1929
+ error: te(404, {
1930
+ pathname: s.path
1931
+ })
1932
+ });
1933
+ })]);
1934
+ return await Promise.all([fr(i, u, x, x.map(() => S.signal), !1, m.loaderData), fr(i, p.map((s) => s.match), r, p.map((s) => s.controller ? s.controller.signal : null), !0)]), {
1935
+ loaderResults: x,
1936
+ fetcherResults: r
1937
+ };
1938
+ }
1939
+ function Pe() {
1940
+ B = !0, fe.push(...We()), Se.forEach((i, l) => {
1941
+ $.has(l) && (Ue.push(l), be(l));
1942
+ });
1943
+ }
1944
+ function ye(i, l, u) {
1945
+ u === void 0 && (u = {}), m.fetchers.set(i, l), X({
1946
+ fetchers: new Map(m.fetchers)
1947
+ }, {
1948
+ flushSync: (u && u.flushSync) === !0
1949
+ });
1950
+ }
1951
+ function de(i, l, u, p) {
1952
+ p === void 0 && (p = {});
1953
+ let S = ft(m.matches, l);
1954
+ je(i), X({
1955
+ errors: {
1956
+ [S.route.id]: u
1957
+ },
1958
+ fetchers: new Map(m.fetchers)
1959
+ }, {
1960
+ flushSync: (p && p.flushSync) === !0
1961
+ });
1962
+ }
1963
+ function rt(i) {
1964
+ return g.v7_fetcherPersist && (Te.set(i, (Te.get(i) || 0) + 1), me.has(i) && me.delete(i)), m.fetchers.get(i) || ra;
1965
+ }
1966
+ function je(i) {
1967
+ let l = m.fetchers.get(i);
1968
+ $.has(i) && !(l && l.state === "loading" && Ee.has(i)) && be(i), Se.delete(i), Ee.delete(i), ce.delete(i), me.delete(i), m.fetchers.delete(i);
1969
+ }
1970
+ function Ot(i) {
1971
+ if (g.v7_fetcherPersist) {
1972
+ let l = (Te.get(i) || 0) - 1;
1973
+ l <= 0 ? (Te.delete(i), me.add(i)) : Te.set(i, l);
1974
+ } else
1975
+ je(i);
1976
+ X({
1977
+ fetchers: new Map(m.fetchers)
1978
+ });
1979
+ }
1980
+ function be(i) {
1981
+ let l = $.get(i);
1982
+ N(l, "Expected fetch controller: " + i), l.abort(), $.delete(i);
1983
+ }
1984
+ function gt(i) {
1985
+ for (let l of i) {
1986
+ let u = rt(l), p = Ae(u.data);
1987
+ m.fetchers.set(l, p);
1988
+ }
1989
+ }
1990
+ function yt() {
1991
+ let i = [], l = !1;
1992
+ for (let u of ce) {
1993
+ let p = m.fetchers.get(u);
1994
+ N(p, "Expected fetcher: " + u), p.state === "loading" && (ce.delete(u), i.push(u), l = !0);
1995
+ }
1996
+ return gt(i), l;
1997
+ }
1998
+ function bt(i) {
1999
+ let l = [];
2000
+ for (let [u, p] of Ee)
2001
+ if (p < i) {
2002
+ let S = m.fetchers.get(u);
2003
+ N(S, "Expected fetcher: " + u), S.state === "loading" && (be(u), Ee.delete(u), l.push(u));
2004
+ }
2005
+ return gt(l), l.length > 0;
2006
+ }
2007
+ function Ft(i, l) {
2008
+ let u = m.blockers.get(i) || ot;
2009
+ return ve.get(i) !== l && ve.set(i, l), u;
2010
+ }
2011
+ function Rt(i) {
2012
+ m.blockers.delete(i), ve.delete(i);
2013
+ }
2014
+ function Oe(i, l) {
2015
+ let u = m.blockers.get(i) || ot;
2016
+ N(u.state === "unblocked" && l.state === "blocked" || u.state === "blocked" && l.state === "blocked" || u.state === "blocked" && l.state === "proceeding" || u.state === "blocked" && l.state === "unblocked" || u.state === "proceeding" && l.state === "unblocked", "Invalid blocker state transition: " + u.state + " -> " + l.state);
2017
+ let p = new Map(m.blockers);
2018
+ p.set(i, l), X({
2019
+ blockers: p
2020
+ });
2021
+ }
2022
+ function at(i) {
2023
+ let {
2024
+ currentLocation: l,
2025
+ nextLocation: u,
2026
+ historyAction: p
2027
+ } = i;
2028
+ if (ve.size === 0)
2029
+ return;
2030
+ ve.size > 1 && qe(!1, "A router only supports one blocker at a time");
2031
+ let S = Array.from(ve.entries()), [x, r] = S[S.length - 1], s = m.blockers.get(x);
2032
+ if (!(s && s.state === "proceeding") && r({
2033
+ currentLocation: l,
2034
+ nextLocation: u,
2035
+ historyAction: p
2036
+ }))
2037
+ return x;
2038
+ }
2039
+ function Re(i) {
2040
+ let l = te(404, {
2041
+ pathname: i
2042
+ }), u = d || f, {
2043
+ matches: p,
2044
+ route: S
2045
+ } = sr(u);
2046
+ return We(), {
2047
+ notFoundMatches: p,
2048
+ route: S,
2049
+ error: l
2050
+ };
2051
+ }
2052
+ function Fe(i, l) {
2053
+ let u = l.partialMatches, p = u[u.length - 1].route, S = te(400, {
2054
+ type: "route-discovery",
2055
+ routeId: p.id,
2056
+ pathname: i,
2057
+ message: l.error != null && "message" in l.error ? l.error : String(l.error)
2058
+ });
2059
+ return {
2060
+ notFoundMatches: u,
2061
+ route: p,
2062
+ error: S
2063
+ };
2064
+ }
2065
+ function We(i) {
2066
+ let l = [];
2067
+ return De.forEach((u, p) => {
2068
+ (!i || i(p)) && (u.cancel(), l.push(p), De.delete(p));
2069
+ }), l;
2070
+ }
2071
+ function wt(i, l, u) {
2072
+ if (j = i, A = l, M = u || null, !k && m.navigation === kt) {
2073
+ k = !0;
2074
+ let p = Dt(m.location, m.matches);
2075
+ p != null && X({
2076
+ restoreScrollPosition: p
2077
+ });
2078
+ }
2079
+ return () => {
2080
+ j = null, A = null, M = null;
2081
+ };
2082
+ }
2083
+ function Et(i, l) {
2084
+ return M && M(i, l.map((p) => Lr(p, m.loaderData))) || i.key;
2085
+ }
2086
+ function St(i, l) {
2087
+ if (j && A) {
2088
+ let u = Et(i, l);
2089
+ j[u] = A();
2090
+ }
2091
+ }
2092
+ function Dt(i, l) {
2093
+ if (j) {
2094
+ let u = Et(i, l), p = j[u];
2095
+ if (typeof p == "number")
2096
+ return p;
2097
+ }
2098
+ return null;
2099
+ }
2100
+ function Ke(i, l, u) {
2101
+ if (R)
2102
+ if (i) {
2103
+ let p = i[i.length - 1].route;
2104
+ if (p.path && (p.path === "*" || p.path.endsWith("/*")))
2105
+ return {
2106
+ active: !0,
2107
+ matches: _t(l, u, c, !0)
2108
+ };
2109
+ } else
2110
+ return {
2111
+ active: !0,
2112
+ matches: _t(l, u, c, !0) || []
2113
+ };
2114
+ return {
2115
+ active: !1,
2116
+ matches: null
2117
+ };
2118
+ }
2119
+ async function ze(i, l, u) {
2120
+ let p = i, S = p.length > 0 ? p[p.length - 1].route : null;
2121
+ for (; ; ) {
2122
+ let x = d == null, r = d || f;
2123
+ try {
2124
+ await la(R, l, p, r, h, o, Qe, u);
2125
+ } catch (b) {
2126
+ return {
2127
+ type: "error",
2128
+ error: b,
2129
+ partialMatches: p
2130
+ };
2131
+ } finally {
2132
+ x && (f = [...f]);
2133
+ }
2134
+ if (u.aborted)
2135
+ return {
2136
+ type: "aborted"
2137
+ };
2138
+ let s = Xe(r, l, c), v = !1;
2139
+ if (s) {
2140
+ let b = s[s.length - 1].route;
2141
+ if (b.index)
2142
+ return {
2143
+ type: "success",
2144
+ matches: s
2145
+ };
2146
+ if (b.path && b.path.length > 0)
2147
+ if (b.path === "*")
2148
+ v = !0;
2149
+ else
2150
+ return {
2151
+ type: "success",
2152
+ matches: s
2153
+ };
2154
+ }
2155
+ let y = _t(r, l, c, !0);
2156
+ if (!y || p.map((b) => b.route.id).join("-") === y.map((b) => b.route.id).join("-"))
2157
+ return {
2158
+ type: "success",
2159
+ matches: v ? s : null
2160
+ };
2161
+ if (p = y, S = p[p.length - 1].route, S.path === "*")
2162
+ return {
2163
+ type: "success",
2164
+ matches: p
2165
+ };
2166
+ }
2167
+ }
2168
+ function At(i) {
2169
+ h = {}, d = dt(i, o, void 0, h);
2170
+ }
2171
+ function Ut(i, l) {
2172
+ let u = d == null;
2173
+ Rr(i, l, d || f, h, o), u && (f = [...f], X({}));
2174
+ }
2175
+ return re = {
2176
+ get basename() {
2177
+ return c;
2178
+ },
2179
+ get future() {
2180
+ return g;
2181
+ },
2182
+ get state() {
2183
+ return m;
2184
+ },
2185
+ get routes() {
2186
+ return f;
2187
+ },
2188
+ get window() {
2189
+ return t;
2190
+ },
2191
+ initialize: Ze,
2192
+ subscribe: Mt,
2193
+ enableScrollRestoration: wt,
2194
+ navigate: pt,
2195
+ fetch: Lt,
2196
+ revalidate: Ve,
2197
+ // Passthrough to history-aware createHref used by useHref so we get proper
2198
+ // hash-aware URLs in DOM paths
2199
+ createHref: (i) => e.history.createHref(i),
2200
+ encodeLocation: (i) => e.history.encodeLocation(i),
2201
+ getFetcher: rt,
2202
+ deleteFetcher: Ot,
2203
+ dispose: Ye,
2204
+ getBlocker: Ft,
2205
+ deleteBlocker: Rt,
2206
+ patchRoutes: Ut,
2207
+ _internalFetchControllers: $,
2208
+ _internalActiveDeferreds: De,
2209
+ // TODO: Remove setRoutes, it's temporary to avoid dealing with
2210
+ // updating the tree while validating the update algorithm.
2211
+ _internalSetRoutes: At
2212
+ }, re;
2213
+ }
2214
+ function na(e) {
2215
+ return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
2216
+ }
2217
+ function zt(e, t, n, a, o, h, f, d) {
2218
+ let c, w;
2219
+ if (f) {
2220
+ c = [];
2221
+ for (let g of t)
2222
+ if (c.push(g), g.route.id === f) {
2223
+ w = g;
2224
+ break;
2225
+ }
2226
+ } else
2227
+ c = t, w = t[t.length - 1];
2228
+ let R = Kr(o || ".", Vr(c, h), Tt(e.pathname, n) || e.pathname, d === "path");
2229
+ return o == null && (R.search = e.search, R.hash = e.hash), (o == null || o === "" || o === ".") && w && w.route.index && !Yt(R.search) && (R.search = R.search ? R.search.replace(/^\?/, "?index&") : "?index"), a && n !== "/" && (R.pathname = R.pathname === "/" ? n : ut([n, R.pathname])), ht(R);
2230
+ }
2231
+ function Zt(e, t, n, a) {
2232
+ if (!a || !na(a))
2233
+ return {
2234
+ path: n
2235
+ };
2236
+ if (a.formMethod && !ya(a.formMethod))
2237
+ return {
2238
+ path: n,
2239
+ error: te(405, {
2240
+ method: a.formMethod
2241
+ })
2242
+ };
2243
+ let o = () => ({
2244
+ path: n,
2245
+ error: te(400, {
2246
+ type: "invalid-body"
2247
+ })
2248
+ }), h = a.formMethod || "get", f = e ? h.toUpperCase() : h.toLowerCase(), d = wr(n);
2249
+ if (a.body !== void 0) {
2250
+ if (a.formEncType === "text/plain") {
2251
+ if (!ge(f))
2252
+ return o();
2253
+ let E = typeof a.body == "string" ? a.body : a.body instanceof FormData || a.body instanceof URLSearchParams ? (
2254
+ // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
2255
+ Array.from(a.body.entries()).reduce((I, j) => {
2256
+ let [M, A] = j;
2257
+ return "" + I + M + "=" + A + `
2258
+ `;
2259
+ }, "")
2260
+ ) : String(a.body);
2261
+ return {
2262
+ path: n,
2263
+ submission: {
2264
+ formMethod: f,
2265
+ formAction: d,
2266
+ formEncType: a.formEncType,
2267
+ formData: void 0,
2268
+ json: void 0,
2269
+ text: E
2270
+ }
2271
+ };
2272
+ } else if (a.formEncType === "application/json") {
2273
+ if (!ge(f))
2274
+ return o();
2275
+ try {
2276
+ let E = typeof a.body == "string" ? JSON.parse(a.body) : a.body;
2277
+ return {
2278
+ path: n,
2279
+ submission: {
2280
+ formMethod: f,
2281
+ formAction: d,
2282
+ formEncType: a.formEncType,
2283
+ formData: void 0,
2284
+ json: E,
2285
+ text: void 0
2286
+ }
2287
+ };
2288
+ } catch {
2289
+ return o();
2290
+ }
2291
+ }
2292
+ }
2293
+ N(typeof FormData == "function", "FormData is not available in this environment");
2294
+ let c, w;
2295
+ if (a.formData)
2296
+ c = Bt(a.formData), w = a.formData;
2297
+ else if (a.body instanceof FormData)
2298
+ c = Bt(a.body), w = a.body;
2299
+ else if (a.body instanceof URLSearchParams)
2300
+ c = a.body, w = nr(c);
2301
+ else if (a.body == null)
2302
+ c = new URLSearchParams(), w = new FormData();
2303
+ else
2304
+ try {
2305
+ c = new URLSearchParams(a.body), w = nr(c);
2306
+ } catch {
2307
+ return o();
2308
+ }
2309
+ let R = {
2310
+ formMethod: f,
2311
+ formAction: d,
2312
+ formEncType: a && a.formEncType || "application/x-www-form-urlencoded",
2313
+ formData: w,
2314
+ json: void 0,
2315
+ text: void 0
2316
+ };
2317
+ if (ge(R.formMethod))
2318
+ return {
2319
+ path: n,
2320
+ submission: R
2321
+ };
2322
+ let g = He(n);
2323
+ return t && g.search && Yt(g.search) && c.append("index", ""), g.search = "?" + c, {
2324
+ path: ht(g),
2325
+ submission: R
2326
+ };
2327
+ }
2328
+ function ia(e, t) {
2329
+ let n = e;
2330
+ if (t) {
2331
+ let a = e.findIndex((o) => o.route.id === t);
2332
+ a >= 0 && (n = e.slice(0, a));
2333
+ }
2334
+ return n;
2335
+ }
2336
+ function er(e, t, n, a, o, h, f, d, c, w, R, g, E, I, j, M) {
2337
+ let A = M ? se(M[1]) ? M[1].error : M[1].data : void 0, k = e.createURL(t.location), T = e.createURL(o), pe = M && se(M[1]) ? M[0] : void 0, Q = pe ? ia(n, pe) : n, re = M ? M[1].statusCode : void 0, m = f && re && re >= 400, ae = Q.filter((U, Z) => {
2338
+ let {
2339
+ route: J
2340
+ } = U;
2341
+ if (J.lazy)
2342
+ return !0;
2343
+ if (J.loader == null)
2344
+ return !1;
2345
+ if (h)
2346
+ return typeof J.loader != "function" || J.loader.hydrate ? !0 : t.loaderData[J.id] === void 0 && // Don't re-run if the loader ran and threw an error
2347
+ (!t.errors || t.errors[J.id] === void 0);
2348
+ if (oa(t.loaderData, t.matches[Z], U) || c.some((B) => B === U.route.id))
2349
+ return !0;
2350
+ let ie = t.matches[Z], V = U;
2351
+ return tr(U, H({
2352
+ currentUrl: k,
2353
+ currentParams: ie.params,
2354
+ nextUrl: T,
2355
+ nextParams: V.params
2356
+ }, a, {
2357
+ actionResult: A,
2358
+ unstable_actionStatus: re,
2359
+ defaultShouldRevalidate: m ? !1 : (
2360
+ // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
2361
+ d || k.pathname + k.search === T.pathname + T.search || // Search params affect all loaders
2362
+ k.search !== T.search || br(ie, V)
2363
+ )
2364
+ }));
2365
+ }), ue = [];
2366
+ return g.forEach((U, Z) => {
2367
+ if (h || !n.some((fe) => fe.route.id === U.routeId) || R.has(Z))
2368
+ return;
2369
+ let J = Xe(I, U.path, j);
2370
+ if (!J) {
2371
+ ue.push({
2372
+ key: Z,
2373
+ routeId: U.routeId,
2374
+ path: U.path,
2375
+ matches: null,
2376
+ match: null,
2377
+ controller: null
2378
+ });
2379
+ return;
2380
+ }
2381
+ let ie = t.fetchers.get(Z), V = st(J, U.path), B = !1;
2382
+ E.has(Z) ? B = !1 : w.includes(Z) ? B = !0 : ie && ie.state !== "idle" && ie.data === void 0 ? B = d : B = tr(V, H({
2383
+ currentUrl: k,
2384
+ currentParams: t.matches[t.matches.length - 1].params,
2385
+ nextUrl: T,
2386
+ nextParams: n[n.length - 1].params
2387
+ }, a, {
2388
+ actionResult: A,
2389
+ unstable_actionStatus: re,
2390
+ defaultShouldRevalidate: m ? !1 : d
2391
+ })), B && ue.push({
2392
+ key: Z,
2393
+ routeId: U.routeId,
2394
+ path: U.path,
2395
+ matches: J,
2396
+ match: V,
2397
+ controller: new AbortController()
2398
+ });
2399
+ }), [ae, ue];
2400
+ }
2401
+ function oa(e, t, n) {
2402
+ let a = (
2403
+ // [a] -> [a, b]
2404
+ !t || // [a, b] -> [a, c]
2405
+ n.route.id !== t.route.id
2406
+ ), o = e[n.route.id] === void 0;
2407
+ return a || o;
2408
+ }
2409
+ function br(e, t) {
2410
+ let n = e.route.path;
2411
+ return (
2412
+ // param change for this match, /users/123 -> /users/456
2413
+ e.pathname !== t.pathname || // splat param changed, which is not present in match.path
2414
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
2415
+ n != null && n.endsWith("*") && e.params["*"] !== t.params["*"]
2416
+ );
2417
+ }
2418
+ function tr(e, t) {
2419
+ if (e.route.shouldRevalidate) {
2420
+ let n = e.route.shouldRevalidate(t);
2421
+ if (typeof n == "boolean")
2422
+ return n;
2423
+ }
2424
+ return t.defaultShouldRevalidate;
2425
+ }
2426
+ async function la(e, t, n, a, o, h, f, d) {
2427
+ let c = [t, ...n.map((w) => w.route.id)].join("-");
2428
+ try {
2429
+ let w = f.get(c);
2430
+ w || (w = e({
2431
+ path: t,
2432
+ matches: n,
2433
+ patch: (R, g) => {
2434
+ d.aborted || Rr(R, g, a, o, h);
2435
+ }
2436
+ }), f.set(c, w)), w && ma(w) && await w;
2437
+ } finally {
2438
+ f.delete(c);
2439
+ }
2440
+ }
2441
+ function Rr(e, t, n, a, o) {
2442
+ if (e) {
2443
+ var h;
2444
+ let f = a[e];
2445
+ N(f, "No route found to patch children into: routeId = " + e);
2446
+ let d = dt(t, o, [e, "patch", String(((h = f.children) == null ? void 0 : h.length) || "0")], a);
2447
+ f.children ? f.children.push(...d) : f.children = d;
2448
+ } else {
2449
+ let f = dt(t, o, ["patch", String(n.length || "0")], a);
2450
+ n.push(...f);
2451
+ }
2452
+ }
2453
+ async function rr(e, t, n) {
2454
+ if (!e.lazy)
2455
+ return;
2456
+ let a = await e.lazy();
2457
+ if (!e.lazy)
2458
+ return;
2459
+ let o = n[e.id];
2460
+ N(o, "No route found in manifest");
2461
+ let h = {};
2462
+ for (let f in a) {
2463
+ let c = o[f] !== void 0 && // This property isn't static since it should always be updated based
2464
+ // on the route updates
2465
+ f !== "hasErrorBoundary";
2466
+ qe(!c, 'Route "' + o.id + '" has a static property "' + f + '" defined but its lazy function is also returning a value for this property. ' + ('The lazy route property "' + f + '" will be ignored.')), !c && !Mr.has(f) && (h[f] = a[f]);
2467
+ }
2468
+ Object.assign(o, h), Object.assign(o, H({}, t(o), {
2469
+ lazy: void 0
2470
+ }));
2471
+ }
2472
+ function sa(e) {
2473
+ return Promise.all(e.matches.map((t) => t.resolve()));
2474
+ }
2475
+ async function ua(e, t, n, a, o, h, f, d) {
2476
+ let c = a.reduce((g, E) => g.add(E.route.id), /* @__PURE__ */ new Set()), w = /* @__PURE__ */ new Set(), R = await e({
2477
+ matches: o.map((g) => {
2478
+ let E = c.has(g.route.id);
2479
+ return H({}, g, {
2480
+ shouldLoad: E,
2481
+ resolve: (j) => (w.add(g.route.id), E ? fa(t, n, g, h, f, j, d) : Promise.resolve({
2482
+ type: z.data,
2483
+ result: void 0
2484
+ }))
2485
+ });
2486
+ }),
2487
+ request: n,
2488
+ params: o[0].params,
2489
+ context: d
2490
+ });
2491
+ return o.forEach((g) => N(w.has(g.route.id), '`match.resolve()` was not called for route id "' + g.route.id + '". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')), R.filter((g, E) => c.has(o[E].route.id));
2492
+ }
2493
+ async function fa(e, t, n, a, o, h, f) {
2494
+ let d, c, w = (R) => {
2495
+ let g, E = new Promise((M, A) => g = A);
2496
+ c = () => g(), t.signal.addEventListener("abort", c);
2497
+ let I = (M) => typeof R != "function" ? Promise.reject(new Error("You cannot call the handler for a route which defines a boolean " + ('"' + e + '" [routeId: ' + n.route.id + "]"))) : R({
2498
+ request: t,
2499
+ params: n.params,
2500
+ context: f
2501
+ }, ...M !== void 0 ? [M] : []), j;
2502
+ return h ? j = h((M) => I(M)) : j = (async () => {
2503
+ try {
2504
+ return {
2505
+ type: "data",
2506
+ result: await I()
2507
+ };
2508
+ } catch (M) {
2509
+ return {
2510
+ type: "error",
2511
+ result: M
2512
+ };
2513
+ }
2514
+ })(), Promise.race([j, E]);
2515
+ };
2516
+ try {
2517
+ let R = n.route[e];
2518
+ if (n.route.lazy)
2519
+ if (R) {
2520
+ let g, [E] = await Promise.all([
2521
+ // If the handler throws, don't let it immediately bubble out,
2522
+ // since we need to let the lazy() execution finish so we know if this
2523
+ // route has a boundary that can handle the error
2524
+ w(R).catch((I) => {
2525
+ g = I;
2526
+ }),
2527
+ rr(n.route, o, a)
2528
+ ]);
2529
+ if (g !== void 0)
2530
+ throw g;
2531
+ d = E;
2532
+ } else if (await rr(n.route, o, a), R = n.route[e], R)
2533
+ d = await w(R);
2534
+ else if (e === "action") {
2535
+ let g = new URL(t.url), E = g.pathname + g.search;
2536
+ throw te(405, {
2537
+ method: t.method,
2538
+ pathname: E,
2539
+ routeId: n.route.id
2540
+ });
2541
+ } else
2542
+ return {
2543
+ type: z.data,
2544
+ result: void 0
2545
+ };
2546
+ else if (R)
2547
+ d = await w(R);
2548
+ else {
2549
+ let g = new URL(t.url), E = g.pathname + g.search;
2550
+ throw te(404, {
2551
+ pathname: E
2552
+ });
2553
+ }
2554
+ N(d.result !== void 0, "You defined " + (e === "action" ? "an action" : "a loader") + " for route " + ('"' + n.route.id + "\" but didn't return anything from your `" + e + "` ") + "function. Please return a value or `null`.");
2555
+ } catch (R) {
2556
+ return {
2557
+ type: z.error,
2558
+ result: R
2559
+ };
2560
+ } finally {
2561
+ c && t.signal.removeEventListener("abort", c);
2562
+ }
2563
+ return d;
2564
+ }
2565
+ async function ca(e) {
2566
+ let {
2567
+ result: t,
2568
+ type: n,
2569
+ status: a
2570
+ } = e;
2571
+ if (Er(t)) {
2572
+ let f;
2573
+ try {
2574
+ let d = t.headers.get("Content-Type");
2575
+ d && /\bapplication\/json\b/.test(d) ? t.body == null ? f = null : f = await t.json() : f = await t.text();
2576
+ } catch (d) {
2577
+ return {
2578
+ type: z.error,
2579
+ error: d
2580
+ };
2581
+ }
2582
+ return n === z.error ? {
2583
+ type: z.error,
2584
+ error: new vr(t.status, t.statusText, f),
2585
+ statusCode: t.status,
2586
+ headers: t.headers
2587
+ } : {
2588
+ type: z.data,
2589
+ data: f,
2590
+ statusCode: t.status,
2591
+ headers: t.headers
2592
+ };
2593
+ }
2594
+ if (n === z.error)
2595
+ return {
2596
+ type: z.error,
2597
+ error: t,
2598
+ statusCode: $t(t) ? t.status : a
2599
+ };
2600
+ if (ga(t)) {
2601
+ var o, h;
2602
+ return {
2603
+ type: z.deferred,
2604
+ deferredData: t,
2605
+ statusCode: (o = t.init) == null ? void 0 : o.status,
2606
+ headers: ((h = t.init) == null ? void 0 : h.headers) && new Headers(t.init.headers)
2607
+ };
2608
+ }
2609
+ return {
2610
+ type: z.data,
2611
+ data: t,
2612
+ statusCode: a
2613
+ };
2614
+ }
2615
+ function da(e, t, n, a, o, h) {
2616
+ let f = e.headers.get("Location");
2617
+ if (N(f, "Redirects returned/thrown from loaders/actions must have a Location header"), !Ht.test(f)) {
2618
+ let d = a.slice(0, a.findIndex((c) => c.route.id === n) + 1);
2619
+ f = zt(new URL(t.url), d, o, !0, f, h), e.headers.set("Location", f);
2620
+ }
2621
+ return e;
2622
+ }
2623
+ function ar(e, t, n) {
2624
+ if (Ht.test(e)) {
2625
+ let a = e, o = a.startsWith("//") ? new URL(t.protocol + a) : new URL(a), h = Tt(o.pathname, n) != null;
2626
+ if (o.origin === t.origin && h)
2627
+ return o.pathname + o.search + o.hash;
2628
+ }
2629
+ return e;
2630
+ }
2631
+ function Ge(e, t, n, a) {
2632
+ let o = e.createURL(wr(t)).toString(), h = {
2633
+ signal: n
2634
+ };
2635
+ if (a && ge(a.formMethod)) {
2636
+ let {
2637
+ formMethod: f,
2638
+ formEncType: d
2639
+ } = a;
2640
+ h.method = f.toUpperCase(), d === "application/json" ? (h.headers = new Headers({
2641
+ "Content-Type": d
2642
+ }), h.body = JSON.stringify(a.json)) : d === "text/plain" ? h.body = a.text : d === "application/x-www-form-urlencoded" && a.formData ? h.body = Bt(a.formData) : h.body = a.formData;
2643
+ }
2644
+ return new Request(o, h);
2645
+ }
2646
+ function Bt(e) {
2647
+ let t = new URLSearchParams();
2648
+ for (let [n, a] of e.entries())
2649
+ t.append(n, typeof a == "string" ? a : a.name);
2650
+ return t;
2651
+ }
2652
+ function nr(e) {
2653
+ let t = new FormData();
2654
+ for (let [n, a] of e.entries())
2655
+ t.append(n, a);
2656
+ return t;
2657
+ }
2658
+ function ha(e, t, n, a, o, h) {
2659
+ let f = {}, d = null, c, w = !1, R = {}, g = a && se(a[1]) ? a[1].error : void 0;
2660
+ return n.forEach((E, I) => {
2661
+ let j = t[I].route.id;
2662
+ if (N(!$e(E), "Cannot handle redirect results in processLoaderData"), se(E)) {
2663
+ let M = E.error;
2664
+ g !== void 0 && (M = g, g = void 0), d = d || {};
2665
+ {
2666
+ let A = ft(e, j);
2667
+ d[A.route.id] == null && (d[A.route.id] = M);
2668
+ }
2669
+ f[j] = void 0, w || (w = !0, c = $t(E.error) ? E.error.status : 500), E.headers && (R[j] = E.headers);
2670
+ } else
2671
+ Be(E) ? (o.set(j, E.deferredData), f[j] = E.deferredData.data, E.statusCode != null && E.statusCode !== 200 && !w && (c = E.statusCode), E.headers && (R[j] = E.headers)) : (f[j] = E.data, E.statusCode && E.statusCode !== 200 && !w && (c = E.statusCode), E.headers && (R[j] = E.headers));
2672
+ }), g !== void 0 && a && (d = {
2673
+ [a[0]]: g
2674
+ }, f[a[0]] = void 0), {
2675
+ loaderData: f,
2676
+ errors: d,
2677
+ statusCode: c || 200,
2678
+ loaderHeaders: R
2679
+ };
2680
+ }
2681
+ function ir(e, t, n, a, o, h, f, d) {
2682
+ let {
2683
+ loaderData: c,
2684
+ errors: w
2685
+ } = ha(t, n, a, o, d);
2686
+ for (let R = 0; R < h.length; R++) {
2687
+ let {
2688
+ key: g,
2689
+ match: E,
2690
+ controller: I
2691
+ } = h[R];
2692
+ N(f !== void 0 && f[R] !== void 0, "Did not find corresponding fetcher result");
2693
+ let j = f[R];
2694
+ if (!(I && I.signal.aborted))
2695
+ if (se(j)) {
2696
+ let M = ft(e.matches, E == null ? void 0 : E.route.id);
2697
+ w && w[M.route.id] || (w = H({}, w, {
2698
+ [M.route.id]: j.error
2699
+ })), e.fetchers.delete(g);
2700
+ } else if ($e(j))
2701
+ N(!1, "Unhandled fetcher revalidation redirect");
2702
+ else if (Be(j))
2703
+ N(!1, "Unhandled fetcher deferred data");
2704
+ else {
2705
+ let M = Ae(j.data);
2706
+ e.fetchers.set(g, M);
2707
+ }
2708
+ }
2709
+ return {
2710
+ loaderData: c,
2711
+ errors: w
2712
+ };
2713
+ }
2714
+ function or(e, t, n, a) {
2715
+ let o = H({}, t);
2716
+ for (let h of n) {
2717
+ let f = h.route.id;
2718
+ if (t.hasOwnProperty(f) ? t[f] !== void 0 && (o[f] = t[f]) : e[f] !== void 0 && h.route.loader && (o[f] = e[f]), a && a.hasOwnProperty(f))
2719
+ break;
2720
+ }
2721
+ return o;
2722
+ }
2723
+ function lr(e) {
2724
+ return e ? se(e[1]) ? {
2725
+ // Clear out prior actionData on errors
2726
+ actionData: {}
2727
+ } : {
2728
+ actionData: {
2729
+ [e[0]]: e[1].data
2730
+ }
2731
+ } : {};
2732
+ }
2733
+ function ft(e, t) {
2734
+ return (t ? e.slice(0, e.findIndex((a) => a.route.id === t) + 1) : [...e]).reverse().find((a) => a.route.hasErrorBoundary === !0) || e[0];
2735
+ }
2736
+ function sr(e) {
2737
+ let t = e.length === 1 ? e[0] : e.find((n) => n.index || !n.path || n.path === "/") || {
2738
+ id: "__shim-error-route__"
2739
+ };
2740
+ return {
2741
+ matches: [{
2742
+ params: {},
2743
+ pathname: "",
2744
+ pathnameBase: "",
2745
+ route: t
2746
+ }],
2747
+ route: t
2748
+ };
2749
+ }
2750
+ function te(e, t) {
2751
+ let {
2752
+ pathname: n,
2753
+ routeId: a,
2754
+ method: o,
2755
+ type: h,
2756
+ message: f
2757
+ } = t === void 0 ? {} : t, d = "Unknown Server Error", c = "Unknown @remix-run/router error";
2758
+ return e === 400 ? (d = "Bad Request", h === "route-discovery" ? c = 'Unable to match URL "' + n + '" - the `children()` function for ' + ("route `" + a + "` threw the following error:\n" + f) : o && n && a ? c = "You made a " + o + ' request to "' + n + '" but ' + ('did not provide a `loader` for route "' + a + '", ') + "so there is no way to handle the request." : h === "defer-action" ? c = "defer() is not supported in actions" : h === "invalid-body" && (c = "Unable to encode submission body")) : e === 403 ? (d = "Forbidden", c = 'Route "' + a + '" does not match URL "' + n + '"') : e === 404 ? (d = "Not Found", c = 'No route matches URL "' + n + '"') : e === 405 && (d = "Method Not Allowed", o && n && a ? c = "You made a " + o.toUpperCase() + ' request to "' + n + '" but ' + ('did not provide an `action` for route "' + a + '", ') + "so there is no way to handle the request." : o && (c = 'Invalid request method "' + o.toUpperCase() + '"')), new vr(e || 500, d, new Error(c), !0);
2759
+ }
2760
+ function ur(e) {
2761
+ for (let t = e.length - 1; t >= 0; t--) {
2762
+ let n = e[t];
2763
+ if ($e(n))
2764
+ return {
2765
+ result: n,
2766
+ idx: t
2767
+ };
2768
+ }
2769
+ }
2770
+ function wr(e) {
2771
+ let t = typeof e == "string" ? He(e) : e;
2772
+ return ht(H({}, t, {
2773
+ hash: ""
2774
+ }));
2775
+ }
2776
+ function pa(e, t) {
2777
+ return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash ? !0 : t.hash !== "";
2778
+ }
2779
+ function ma(e) {
2780
+ return typeof e == "object" && e != null && "then" in e;
2781
+ }
2782
+ function va(e) {
2783
+ return Er(e.result) && ea.has(e.result.status);
2784
+ }
2785
+ function Be(e) {
2786
+ return e.type === z.deferred;
2787
+ }
2788
+ function se(e) {
2789
+ return e.type === z.error;
2790
+ }
2791
+ function $e(e) {
2792
+ return (e && e.type) === z.redirect;
2793
+ }
2794
+ function ga(e) {
2795
+ let t = e;
2796
+ return t && typeof t == "object" && typeof t.data == "object" && typeof t.subscribe == "function" && typeof t.cancel == "function" && typeof t.resolveData == "function";
2797
+ }
2798
+ function Er(e) {
2799
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && typeof e.body < "u";
2800
+ }
2801
+ function ya(e) {
2802
+ return Zr.has(e.toLowerCase());
2803
+ }
2804
+ function ge(e) {
2805
+ return qr.has(e.toLowerCase());
2806
+ }
2807
+ async function fr(e, t, n, a, o, h) {
2808
+ for (let f = 0; f < n.length; f++) {
2809
+ let d = n[f], c = t[f];
2810
+ if (!c)
2811
+ continue;
2812
+ let w = e.find((g) => g.route.id === c.route.id), R = w != null && !br(w, c) && (h && h[c.route.id]) !== void 0;
2813
+ if (Be(d) && (o || R)) {
2814
+ let g = a[f];
2815
+ N(g, "Expected an AbortSignal for revalidating fetcher deferred result"), await Sr(d, g, o).then((E) => {
2816
+ E && (n[f] = E || n[f]);
2817
+ });
2818
+ }
2819
+ }
2820
+ }
2821
+ async function Sr(e, t, n) {
2822
+ if (n === void 0 && (n = !1), !await e.deferredData.resolveData(t)) {
2823
+ if (n)
2824
+ try {
2825
+ return {
2826
+ type: z.data,
2827
+ data: e.deferredData.unwrappedData
2828
+ };
2829
+ } catch (o) {
2830
+ return {
2831
+ type: z.error,
2832
+ error: o
2833
+ };
2834
+ }
2835
+ return {
2836
+ type: z.data,
2837
+ data: e.deferredData.data
2838
+ };
2839
+ }
2840
+ }
2841
+ function Yt(e) {
2842
+ return new URLSearchParams(e).getAll("index").some((t) => t === "");
2843
+ }
2844
+ function st(e, t) {
2845
+ let n = typeof t == "string" ? He(t).search : t.search;
2846
+ if (e[e.length - 1].route.index && Yt(n || ""))
2847
+ return e[e.length - 1];
2848
+ let a = mr(e);
2849
+ return a[a.length - 1];
2850
+ }
2851
+ function cr(e) {
2852
+ let {
2853
+ formMethod: t,
2854
+ formAction: n,
2855
+ formEncType: a,
2856
+ text: o,
2857
+ formData: h,
2858
+ json: f
2859
+ } = e;
2860
+ if (!(!t || !n || !a)) {
2861
+ if (o != null)
2862
+ return {
2863
+ formMethod: t,
2864
+ formAction: n,
2865
+ formEncType: a,
2866
+ formData: void 0,
2867
+ json: void 0,
2868
+ text: o
2869
+ };
2870
+ if (h != null)
2871
+ return {
2872
+ formMethod: t,
2873
+ formAction: n,
2874
+ formEncType: a,
2875
+ formData: h,
2876
+ json: void 0,
2877
+ text: void 0
2878
+ };
2879
+ if (f !== void 0)
2880
+ return {
2881
+ formMethod: t,
2882
+ formAction: n,
2883
+ formEncType: a,
2884
+ formData: void 0,
2885
+ json: f,
2886
+ text: void 0
2887
+ };
2888
+ }
2889
+ }
2890
+ function Nt(e, t) {
2891
+ return t ? {
2892
+ state: "loading",
2893
+ location: e,
2894
+ formMethod: t.formMethod,
2895
+ formAction: t.formAction,
2896
+ formEncType: t.formEncType,
2897
+ formData: t.formData,
2898
+ json: t.json,
2899
+ text: t.text
2900
+ } : {
2901
+ state: "loading",
2902
+ location: e,
2903
+ formMethod: void 0,
2904
+ formAction: void 0,
2905
+ formEncType: void 0,
2906
+ formData: void 0,
2907
+ json: void 0,
2908
+ text: void 0
2909
+ };
2910
+ }
2911
+ function ba(e, t) {
2912
+ return {
2913
+ state: "submitting",
2914
+ location: e,
2915
+ formMethod: t.formMethod,
2916
+ formAction: t.formAction,
2917
+ formEncType: t.formEncType,
2918
+ formData: t.formData,
2919
+ json: t.json,
2920
+ text: t.text
2921
+ };
2922
+ }
2923
+ function lt(e, t) {
2924
+ return e ? {
2925
+ state: "loading",
2926
+ formMethod: e.formMethod,
2927
+ formAction: e.formAction,
2928
+ formEncType: e.formEncType,
2929
+ formData: e.formData,
2930
+ json: e.json,
2931
+ text: e.text,
2932
+ data: t
2933
+ } : {
2934
+ state: "loading",
2935
+ formMethod: void 0,
2936
+ formAction: void 0,
2937
+ formEncType: void 0,
2938
+ formData: void 0,
2939
+ json: void 0,
2940
+ text: void 0,
2941
+ data: t
2942
+ };
2943
+ }
2944
+ function Ra(e, t) {
2945
+ return {
2946
+ state: "submitting",
2947
+ formMethod: e.formMethod,
2948
+ formAction: e.formAction,
2949
+ formEncType: e.formEncType,
2950
+ formData: e.formData,
2951
+ json: e.json,
2952
+ text: e.text,
2953
+ data: t ? t.data : void 0
2954
+ };
2955
+ }
2956
+ function Ae(e) {
2957
+ return {
2958
+ state: "idle",
2959
+ formMethod: void 0,
2960
+ formAction: void 0,
2961
+ formEncType: void 0,
2962
+ formData: void 0,
2963
+ json: void 0,
2964
+ text: void 0,
2965
+ data: e
2966
+ };
2967
+ }
2968
+ function wa(e, t) {
2969
+ try {
2970
+ let n = e.sessionStorage.getItem(yr);
2971
+ if (n) {
2972
+ let a = JSON.parse(n);
2973
+ for (let [o, h] of Object.entries(a || {}))
2974
+ h && Array.isArray(h) && t.set(o, new Set(h || []));
2975
+ }
2976
+ } catch {
2977
+ }
2978
+ }
2979
+ function Ea(e, t) {
2980
+ if (t.size > 0) {
2981
+ let n = {};
2982
+ for (let [a, o] of t)
2983
+ n[a] = [...o];
2984
+ try {
2985
+ e.sessionStorage.setItem(yr, JSON.stringify(n));
2986
+ } catch (a) {
2987
+ qe(!1, "Failed to save applied view transitions in sessionStorage (" + a + ").");
2988
+ }
2989
+ }
2990
+ }
2991
+ export {
2992
+ G as A,
2993
+ vr as E,
2994
+ ut as a,
2995
+ xa as b,
2996
+ ht as c,
2997
+ Pa as d,
2998
+ Xe as e,
2999
+ $t as f,
3000
+ Vr as g,
3001
+ N as i,
3002
+ Da as j,
3003
+ Qt as m,
3004
+ He as p,
3005
+ Kr as r,
3006
+ Tt as s,
3007
+ qe as w
3008
+ };