@lvetechs/micro-app 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -2
- package/dist/functions/mountMicroApp.d.ts +91 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +12 -12
- package/dist/index.mjs +328 -283
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (e, t, r) =>
|
|
1
|
+
var br = Object.defineProperty;
|
|
2
|
+
var wr = (e, t, r) => t in e ? br(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var I = (e, t, r) => wr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import * as h from "react";
|
|
5
|
-
import
|
|
5
|
+
import At, { useState as Tt, useCallback as Fe, useReducer as Rr, useEffect as Be, Component as jt, useRef as Ie, Suspense as Cr, useMemo as Sr } from "react";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
class
|
|
7
|
+
class Nr {
|
|
8
8
|
constructor(t, r) {
|
|
9
9
|
I(this, "manager");
|
|
10
10
|
I(this, "name");
|
|
@@ -35,7 +35,7 @@ class Sr {
|
|
|
35
35
|
return this.manager.checkAppHealth(this.name);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class _r {
|
|
39
39
|
constructor(t) {
|
|
40
40
|
I(this, "apps", /* @__PURE__ */ new Map());
|
|
41
41
|
I(this, "configMap", /* @__PURE__ */ new Map());
|
|
@@ -63,7 +63,7 @@ class Nr {
|
|
|
63
63
|
status: "idle",
|
|
64
64
|
entry: r.entry,
|
|
65
65
|
container: n
|
|
66
|
-
}), this.instances.set(r.name, new
|
|
66
|
+
}), this.instances.set(r.name, new Nr(r.name, this));
|
|
67
67
|
}
|
|
68
68
|
this.initialized = !0, console.log("[MicroApp] 初始化完成", this.getAppNames());
|
|
69
69
|
}
|
|
@@ -272,8 +272,8 @@ class Nr {
|
|
|
272
272
|
}), this.apps.clear(), this.configMap.clear(), this.instances.clear(), this.statusListeners.clear(), this.appChangeListeners.clear(), this.initialized = !1, console.log("[MicroApp] 已销毁");
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
const t = new
|
|
275
|
+
function Dt(e) {
|
|
276
|
+
const t = new _r(e);
|
|
277
277
|
return {
|
|
278
278
|
start: () => {
|
|
279
279
|
Object.values(t.getApps()).forEach((n) => {
|
|
@@ -335,6 +335,49 @@ function _r(e) {
|
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
+
function Or(e) {
|
|
339
|
+
const { app: t, onError: r, onStatusChange: n, onLoad: o } = e, i = t.container.startsWith("#") ? t.container : `#${t.container}`;
|
|
340
|
+
let s = document.querySelector(i);
|
|
341
|
+
s || (s = document.createElement("div"), s.id = i.replace("#", ""), s.className = "micro-app-container", document.body.appendChild(s));
|
|
342
|
+
const c = Dt({
|
|
343
|
+
apps: [{
|
|
344
|
+
name: t.name,
|
|
345
|
+
entry: t.entry,
|
|
346
|
+
container: i,
|
|
347
|
+
active_rule: t.activeRule,
|
|
348
|
+
enabled: !0
|
|
349
|
+
}],
|
|
350
|
+
onError: (l) => {
|
|
351
|
+
r == null || r(l);
|
|
352
|
+
},
|
|
353
|
+
onStatusChange: (l, u) => {
|
|
354
|
+
n == null || n(u);
|
|
355
|
+
},
|
|
356
|
+
onLoad: () => {
|
|
357
|
+
o == null || o();
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
return {
|
|
361
|
+
mount: () => {
|
|
362
|
+
c.startApp(t.name);
|
|
363
|
+
},
|
|
364
|
+
unmount: () => {
|
|
365
|
+
c.stopApp(t.name);
|
|
366
|
+
},
|
|
367
|
+
reload: () => {
|
|
368
|
+
c.restartApp(t.name);
|
|
369
|
+
},
|
|
370
|
+
destroy: () => {
|
|
371
|
+
c.destroy();
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function la(e, t) {
|
|
376
|
+
const r = {};
|
|
377
|
+
for (const n of e)
|
|
378
|
+
r[n.name] = Or({ app: n, ...t });
|
|
379
|
+
return r;
|
|
380
|
+
}
|
|
338
381
|
var Ve = { exports: {} }, ae = {};
|
|
339
382
|
/**
|
|
340
383
|
* @license React
|
|
@@ -346,10 +389,10 @@ var Ve = { exports: {} }, ae = {};
|
|
|
346
389
|
* LICENSE file in the root directory of this source tree.
|
|
347
390
|
*/
|
|
348
391
|
var yt;
|
|
349
|
-
function
|
|
392
|
+
function Pr() {
|
|
350
393
|
if (yt) return ae;
|
|
351
394
|
yt = 1;
|
|
352
|
-
var e =
|
|
395
|
+
var e = At, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
353
396
|
function s(c, l, u) {
|
|
354
397
|
var p, f = {}, m = null, w = null;
|
|
355
398
|
u !== void 0 && (m = "" + u), l.key !== void 0 && (m = "" + l.key), l.ref !== void 0 && (w = l.ref);
|
|
@@ -370,9 +413,9 @@ var oe = {};
|
|
|
370
413
|
* LICENSE file in the root directory of this source tree.
|
|
371
414
|
*/
|
|
372
415
|
var Et;
|
|
373
|
-
function
|
|
416
|
+
function Ar() {
|
|
374
417
|
return Et || (Et = 1, process.env.NODE_ENV !== "production" && function() {
|
|
375
|
-
var e =
|
|
418
|
+
var e = At, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), C = Symbol.iterator, _ = "@@iterator";
|
|
376
419
|
function y(a) {
|
|
377
420
|
if (a === null || typeof a != "object")
|
|
378
421
|
return null;
|
|
@@ -391,16 +434,16 @@ function Pr() {
|
|
|
391
434
|
{
|
|
392
435
|
var x = N.ReactDebugCurrentFrame, P = x.getStackAddendum();
|
|
393
436
|
P !== "" && (d += "%s", g = g.concat([P]));
|
|
394
|
-
var
|
|
437
|
+
var A = g.map(function(S) {
|
|
395
438
|
return String(S);
|
|
396
439
|
});
|
|
397
|
-
|
|
440
|
+
A.unshift("Warning: " + d), Function.prototype.apply.call(console[a], console, A);
|
|
398
441
|
}
|
|
399
442
|
}
|
|
400
|
-
var
|
|
443
|
+
var T = !1, U = !1, Q = !1, he = !1, ee = !1, me;
|
|
401
444
|
me = Symbol.for("react.module.reference");
|
|
402
445
|
function te(a) {
|
|
403
|
-
return !!(typeof a == "string" || typeof a == "function" || a === n || a === i || ee || a === o || a === u || a === p || he || a === w ||
|
|
446
|
+
return !!(typeof a == "string" || typeof a == "function" || a === n || a === i || ee || a === o || a === u || a === p || he || a === w || T || U || Q || typeof a == "object" && a !== null && (a.$$typeof === m || a.$$typeof === f || a.$$typeof === s || a.$$typeof === c || a.$$typeof === l || // This needs to include all possible module reference object
|
|
404
447
|
// types supported by any Flight configuration anywhere since
|
|
405
448
|
// we don't know which Flight build this will end up being used
|
|
406
449
|
// with.
|
|
@@ -451,9 +494,9 @@ function Pr() {
|
|
|
451
494
|
var x = a.displayName || null;
|
|
452
495
|
return x !== null ? x : W(a.type) || "Memo";
|
|
453
496
|
case m: {
|
|
454
|
-
var P = a,
|
|
497
|
+
var P = a, A = P._payload, S = P._init;
|
|
455
498
|
try {
|
|
456
|
-
return W(S(
|
|
499
|
+
return W(S(A));
|
|
457
500
|
} catch {
|
|
458
501
|
return null;
|
|
459
502
|
}
|
|
@@ -461,11 +504,11 @@ function Pr() {
|
|
|
461
504
|
}
|
|
462
505
|
return null;
|
|
463
506
|
}
|
|
464
|
-
var
|
|
507
|
+
var q = Object.assign, re = 0, Je, Ge, Xe, Ze, Qe, et, tt;
|
|
465
508
|
function rt() {
|
|
466
509
|
}
|
|
467
510
|
rt.__reactDisabledLog = !0;
|
|
468
|
-
function
|
|
511
|
+
function Ht() {
|
|
469
512
|
{
|
|
470
513
|
if (re === 0) {
|
|
471
514
|
Je = console.log, Ge = console.info, Xe = console.warn, Ze = console.error, Qe = console.group, et = console.groupCollapsed, tt = console.groupEnd;
|
|
@@ -488,7 +531,7 @@ function Pr() {
|
|
|
488
531
|
re++;
|
|
489
532
|
}
|
|
490
533
|
}
|
|
491
|
-
function
|
|
534
|
+
function Jt() {
|
|
492
535
|
{
|
|
493
536
|
if (re--, re === 0) {
|
|
494
537
|
var a = {
|
|
@@ -497,25 +540,25 @@ function Pr() {
|
|
|
497
540
|
writable: !0
|
|
498
541
|
};
|
|
499
542
|
Object.defineProperties(console, {
|
|
500
|
-
log:
|
|
543
|
+
log: q({}, a, {
|
|
501
544
|
value: Je
|
|
502
545
|
}),
|
|
503
|
-
info:
|
|
546
|
+
info: q({}, a, {
|
|
504
547
|
value: Ge
|
|
505
548
|
}),
|
|
506
|
-
warn:
|
|
549
|
+
warn: q({}, a, {
|
|
507
550
|
value: Xe
|
|
508
551
|
}),
|
|
509
|
-
error:
|
|
552
|
+
error: q({}, a, {
|
|
510
553
|
value: Ze
|
|
511
554
|
}),
|
|
512
|
-
group:
|
|
555
|
+
group: q({}, a, {
|
|
513
556
|
value: Qe
|
|
514
557
|
}),
|
|
515
|
-
groupCollapsed:
|
|
558
|
+
groupCollapsed: q({}, a, {
|
|
516
559
|
value: et
|
|
517
560
|
}),
|
|
518
|
-
groupEnd:
|
|
561
|
+
groupEnd: q({}, a, {
|
|
519
562
|
value: tt
|
|
520
563
|
})
|
|
521
564
|
});
|
|
@@ -539,8 +582,8 @@ function Pr() {
|
|
|
539
582
|
}
|
|
540
583
|
var Oe = !1, ge;
|
|
541
584
|
{
|
|
542
|
-
var
|
|
543
|
-
ge = new
|
|
585
|
+
var Gt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
586
|
+
ge = new Gt();
|
|
544
587
|
}
|
|
545
588
|
function nt(a, d) {
|
|
546
589
|
if (!a || Oe)
|
|
@@ -554,8 +597,8 @@ function Pr() {
|
|
|
554
597
|
Oe = !0;
|
|
555
598
|
var P = Error.prepareStackTrace;
|
|
556
599
|
Error.prepareStackTrace = void 0;
|
|
557
|
-
var
|
|
558
|
-
|
|
600
|
+
var A;
|
|
601
|
+
A = Ne.current, Ne.current = null, Ht();
|
|
559
602
|
try {
|
|
560
603
|
if (d) {
|
|
561
604
|
var S = function() {
|
|
@@ -608,15 +651,15 @@ function Pr() {
|
|
|
608
651
|
}
|
|
609
652
|
}
|
|
610
653
|
} finally {
|
|
611
|
-
Oe = !1, Ne.current =
|
|
654
|
+
Oe = !1, Ne.current = A, Jt(), Error.prepareStackTrace = P;
|
|
612
655
|
}
|
|
613
|
-
var J = a ? a.displayName || a.name : "",
|
|
614
|
-
return typeof a == "function" && ge.set(a,
|
|
656
|
+
var J = a ? a.displayName || a.name : "", K = J ? ve(J) : "";
|
|
657
|
+
return typeof a == "function" && ge.set(a, K), K;
|
|
615
658
|
}
|
|
616
|
-
function
|
|
659
|
+
function Xt(a, d, g) {
|
|
617
660
|
return nt(a, !1);
|
|
618
661
|
}
|
|
619
|
-
function
|
|
662
|
+
function Zt(a) {
|
|
620
663
|
var d = a.prototype;
|
|
621
664
|
return !!(d && d.isReactComponent);
|
|
622
665
|
}
|
|
@@ -624,7 +667,7 @@ function Pr() {
|
|
|
624
667
|
if (a == null)
|
|
625
668
|
return "";
|
|
626
669
|
if (typeof a == "function")
|
|
627
|
-
return nt(a,
|
|
670
|
+
return nt(a, Zt(a));
|
|
628
671
|
if (typeof a == "string")
|
|
629
672
|
return ve(a);
|
|
630
673
|
switch (a) {
|
|
@@ -636,13 +679,13 @@ function Pr() {
|
|
|
636
679
|
if (typeof a == "object")
|
|
637
680
|
switch (a.$$typeof) {
|
|
638
681
|
case l:
|
|
639
|
-
return
|
|
682
|
+
return Xt(a.render);
|
|
640
683
|
case f:
|
|
641
684
|
return ye(a.type, d, g);
|
|
642
685
|
case m: {
|
|
643
|
-
var x = a, P = x._payload,
|
|
686
|
+
var x = a, P = x._payload, A = x._init;
|
|
644
687
|
try {
|
|
645
|
-
return ye(
|
|
688
|
+
return ye(A(P), d, g);
|
|
646
689
|
} catch {
|
|
647
690
|
}
|
|
648
691
|
}
|
|
@@ -657,11 +700,11 @@ function Pr() {
|
|
|
657
700
|
} else
|
|
658
701
|
ot.setExtraStackFrame(null);
|
|
659
702
|
}
|
|
660
|
-
function
|
|
703
|
+
function Qt(a, d, g, x, P) {
|
|
661
704
|
{
|
|
662
|
-
var
|
|
705
|
+
var A = Function.call.bind(ne);
|
|
663
706
|
for (var S in a)
|
|
664
|
-
if (
|
|
707
|
+
if (A(a, S)) {
|
|
665
708
|
var R = void 0;
|
|
666
709
|
try {
|
|
667
710
|
if (typeof a[S] != "function") {
|
|
@@ -676,17 +719,17 @@ function Pr() {
|
|
|
676
719
|
}
|
|
677
720
|
}
|
|
678
721
|
}
|
|
679
|
-
var
|
|
722
|
+
var er = Array.isArray;
|
|
680
723
|
function Pe(a) {
|
|
681
|
-
return
|
|
724
|
+
return er(a);
|
|
682
725
|
}
|
|
683
|
-
function
|
|
726
|
+
function tr(a) {
|
|
684
727
|
{
|
|
685
728
|
var d = typeof Symbol == "function" && Symbol.toStringTag, g = d && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
686
729
|
return g;
|
|
687
730
|
}
|
|
688
731
|
}
|
|
689
|
-
function
|
|
732
|
+
function rr(a) {
|
|
690
733
|
try {
|
|
691
734
|
return it(a), !1;
|
|
692
735
|
} catch {
|
|
@@ -697,16 +740,16 @@ function Pr() {
|
|
|
697
740
|
return "" + a;
|
|
698
741
|
}
|
|
699
742
|
function st(a) {
|
|
700
|
-
if (
|
|
701
|
-
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
743
|
+
if (rr(a))
|
|
744
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tr(a)), it(a);
|
|
702
745
|
}
|
|
703
|
-
var lt = N.ReactCurrentOwner,
|
|
746
|
+
var lt = N.ReactCurrentOwner, nr = {
|
|
704
747
|
key: !0,
|
|
705
748
|
ref: !0,
|
|
706
749
|
__self: !0,
|
|
707
750
|
__source: !0
|
|
708
751
|
}, ut, ct;
|
|
709
|
-
function
|
|
752
|
+
function ar(a) {
|
|
710
753
|
if (ne.call(a, "ref")) {
|
|
711
754
|
var d = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
712
755
|
if (d && d.isReactWarning)
|
|
@@ -714,7 +757,7 @@ function Pr() {
|
|
|
714
757
|
}
|
|
715
758
|
return a.ref !== void 0;
|
|
716
759
|
}
|
|
717
|
-
function
|
|
760
|
+
function or(a) {
|
|
718
761
|
if (ne.call(a, "key")) {
|
|
719
762
|
var d = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
720
763
|
if (d && d.isReactWarning)
|
|
@@ -722,10 +765,10 @@ function Pr() {
|
|
|
722
765
|
}
|
|
723
766
|
return a.key !== void 0;
|
|
724
767
|
}
|
|
725
|
-
function
|
|
768
|
+
function ir(a, d) {
|
|
726
769
|
typeof a.ref == "string" && lt.current;
|
|
727
770
|
}
|
|
728
|
-
function
|
|
771
|
+
function sr(a, d) {
|
|
729
772
|
{
|
|
730
773
|
var g = function() {
|
|
731
774
|
ut || (ut = !0, v("%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)", d));
|
|
@@ -736,7 +779,7 @@ function Pr() {
|
|
|
736
779
|
});
|
|
737
780
|
}
|
|
738
781
|
}
|
|
739
|
-
function
|
|
782
|
+
function lr(a, d) {
|
|
740
783
|
{
|
|
741
784
|
var g = function() {
|
|
742
785
|
ct || (ct = !0, v("%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)", d));
|
|
@@ -747,7 +790,7 @@ function Pr() {
|
|
|
747
790
|
});
|
|
748
791
|
}
|
|
749
792
|
}
|
|
750
|
-
var
|
|
793
|
+
var ur = function(a, d, g, x, P, A, S) {
|
|
751
794
|
var R = {
|
|
752
795
|
// This tag allows us to uniquely identify this as a React Element
|
|
753
796
|
$$typeof: t,
|
|
@@ -757,7 +800,7 @@ function Pr() {
|
|
|
757
800
|
ref: g,
|
|
758
801
|
props: S,
|
|
759
802
|
// Record the component responsible for creating this element.
|
|
760
|
-
_owner:
|
|
803
|
+
_owner: A
|
|
761
804
|
};
|
|
762
805
|
return R._store = {}, Object.defineProperty(R._store, "validated", {
|
|
763
806
|
configurable: !1,
|
|
@@ -776,25 +819,25 @@ function Pr() {
|
|
|
776
819
|
value: P
|
|
777
820
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
|
778
821
|
};
|
|
779
|
-
function
|
|
822
|
+
function cr(a, d, g, x, P) {
|
|
780
823
|
{
|
|
781
|
-
var
|
|
782
|
-
g !== void 0 && (st(g), R = "" + g),
|
|
783
|
-
for (
|
|
784
|
-
ne.call(d,
|
|
824
|
+
var A, S = {}, R = null, k = null;
|
|
825
|
+
g !== void 0 && (st(g), R = "" + g), or(d) && (st(d.key), R = "" + d.key), ar(d) && (k = d.ref, ir(d, P));
|
|
826
|
+
for (A in d)
|
|
827
|
+
ne.call(d, A) && !nr.hasOwnProperty(A) && (S[A] = d[A]);
|
|
785
828
|
if (a && a.defaultProps) {
|
|
786
829
|
var j = a.defaultProps;
|
|
787
|
-
for (
|
|
788
|
-
S[
|
|
830
|
+
for (A in j)
|
|
831
|
+
S[A] === void 0 && (S[A] = j[A]);
|
|
789
832
|
}
|
|
790
833
|
if (R || k) {
|
|
791
834
|
var D = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
792
|
-
R &&
|
|
835
|
+
R && sr(S, D), k && lr(S, D);
|
|
793
836
|
}
|
|
794
|
-
return
|
|
837
|
+
return ur(a, R, k, P, x, lt.current, S);
|
|
795
838
|
}
|
|
796
839
|
}
|
|
797
|
-
var
|
|
840
|
+
var Ae = N.ReactCurrentOwner, ft = N.ReactDebugCurrentFrame;
|
|
798
841
|
function H(a) {
|
|
799
842
|
if (a) {
|
|
800
843
|
var d = a._owner, g = ye(a.type, a._source, d ? d.type : null);
|
|
@@ -802,15 +845,15 @@ function Pr() {
|
|
|
802
845
|
} else
|
|
803
846
|
ft.setExtraStackFrame(null);
|
|
804
847
|
}
|
|
805
|
-
var
|
|
806
|
-
|
|
848
|
+
var Te;
|
|
849
|
+
Te = !1;
|
|
807
850
|
function je(a) {
|
|
808
851
|
return typeof a == "object" && a !== null && a.$$typeof === t;
|
|
809
852
|
}
|
|
810
853
|
function dt() {
|
|
811
854
|
{
|
|
812
|
-
if (
|
|
813
|
-
var a = W(
|
|
855
|
+
if (Ae.current) {
|
|
856
|
+
var a = W(Ae.current.type);
|
|
814
857
|
if (a)
|
|
815
858
|
return `
|
|
816
859
|
|
|
@@ -819,11 +862,11 @@ Check the render method of \`` + a + "`.";
|
|
|
819
862
|
return "";
|
|
820
863
|
}
|
|
821
864
|
}
|
|
822
|
-
function
|
|
865
|
+
function fr(a) {
|
|
823
866
|
return "";
|
|
824
867
|
}
|
|
825
868
|
var pt = {};
|
|
826
|
-
function
|
|
869
|
+
function dr(a) {
|
|
827
870
|
{
|
|
828
871
|
var d = dt();
|
|
829
872
|
if (!d) {
|
|
@@ -840,12 +883,12 @@ Check the top-level render call using <` + g + ">.");
|
|
|
840
883
|
if (!a._store || a._store.validated || a.key != null)
|
|
841
884
|
return;
|
|
842
885
|
a._store.validated = !0;
|
|
843
|
-
var g =
|
|
886
|
+
var g = dr(d);
|
|
844
887
|
if (pt[g])
|
|
845
888
|
return;
|
|
846
889
|
pt[g] = !0;
|
|
847
890
|
var x = "";
|
|
848
|
-
a && a._owner && a._owner !==
|
|
891
|
+
a && a._owner && a._owner !== Ae.current && (x = " It was passed a child from " + W(a._owner.type) + "."), H(a), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, x), H(null);
|
|
849
892
|
}
|
|
850
893
|
}
|
|
851
894
|
function mt(a, d) {
|
|
@@ -862,12 +905,12 @@ Check the top-level render call using <` + g + ">.");
|
|
|
862
905
|
else if (a) {
|
|
863
906
|
var P = y(a);
|
|
864
907
|
if (typeof P == "function" && P !== a.entries)
|
|
865
|
-
for (var
|
|
908
|
+
for (var A = P.call(a), S; !(S = A.next()).done; )
|
|
866
909
|
je(S.value) && ht(S.value, d);
|
|
867
910
|
}
|
|
868
911
|
}
|
|
869
912
|
}
|
|
870
|
-
function
|
|
913
|
+
function pr(a) {
|
|
871
914
|
{
|
|
872
915
|
var d = a.type;
|
|
873
916
|
if (d == null || typeof d == "string")
|
|
@@ -883,16 +926,16 @@ Check the top-level render call using <` + g + ">.");
|
|
|
883
926
|
return;
|
|
884
927
|
if (g) {
|
|
885
928
|
var x = W(d);
|
|
886
|
-
|
|
887
|
-
} else if (d.PropTypes !== void 0 && !
|
|
888
|
-
|
|
929
|
+
Qt(g, a.props, "prop", x, a);
|
|
930
|
+
} else if (d.PropTypes !== void 0 && !Te) {
|
|
931
|
+
Te = !0;
|
|
889
932
|
var P = W(d);
|
|
890
933
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
891
934
|
}
|
|
892
935
|
typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
893
936
|
}
|
|
894
937
|
}
|
|
895
|
-
function
|
|
938
|
+
function hr(a) {
|
|
896
939
|
{
|
|
897
940
|
for (var d = Object.keys(a.props), g = 0; g < d.length; g++) {
|
|
898
941
|
var x = d[g];
|
|
@@ -905,18 +948,18 @@ Check the top-level render call using <` + g + ">.");
|
|
|
905
948
|
}
|
|
906
949
|
}
|
|
907
950
|
var vt = {};
|
|
908
|
-
function gt(a, d, g, x, P,
|
|
951
|
+
function gt(a, d, g, x, P, A) {
|
|
909
952
|
{
|
|
910
953
|
var S = te(a);
|
|
911
954
|
if (!S) {
|
|
912
955
|
var R = "";
|
|
913
956
|
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
914
|
-
var k =
|
|
957
|
+
var k = fr();
|
|
915
958
|
k ? R += k : R += dt();
|
|
916
959
|
var j;
|
|
917
960
|
a === null ? j = "null" : Pe(a) ? j = "array" : a !== void 0 && a.$$typeof === t ? (j = "<" + (W(a.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : j = typeof a, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, R);
|
|
918
961
|
}
|
|
919
|
-
var D =
|
|
962
|
+
var D = cr(a, d, g, P, A);
|
|
920
963
|
if (D == null)
|
|
921
964
|
return D;
|
|
922
965
|
if (S) {
|
|
@@ -933,33 +976,33 @@ Check the top-level render call using <` + g + ">.");
|
|
|
933
976
|
mt(F, a);
|
|
934
977
|
}
|
|
935
978
|
if (ne.call(d, "key")) {
|
|
936
|
-
var
|
|
937
|
-
return
|
|
979
|
+
var K = W(a), L = Object.keys(d).filter(function(xr) {
|
|
980
|
+
return xr !== "key";
|
|
938
981
|
}), De = L.length > 0 ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
939
|
-
if (!vt[
|
|
940
|
-
var
|
|
982
|
+
if (!vt[K + De]) {
|
|
983
|
+
var Er = L.length > 0 ? "{" + L.join(": ..., ") + ": ...}" : "{}";
|
|
941
984
|
v(`A props object containing a "key" prop is being spread into JSX:
|
|
942
985
|
let props = %s;
|
|
943
986
|
<%s {...props} />
|
|
944
987
|
React keys must be passed directly to JSX without using spread:
|
|
945
988
|
let props = %s;
|
|
946
|
-
<%s key={someKey} {...props} />`, De,
|
|
989
|
+
<%s key={someKey} {...props} />`, De, K, Er, K), vt[K + De] = !0;
|
|
947
990
|
}
|
|
948
991
|
}
|
|
949
|
-
return a === n ?
|
|
992
|
+
return a === n ? hr(D) : pr(D), D;
|
|
950
993
|
}
|
|
951
994
|
}
|
|
952
|
-
function
|
|
995
|
+
function mr(a, d, g) {
|
|
953
996
|
return gt(a, d, g, !0);
|
|
954
997
|
}
|
|
955
|
-
function
|
|
998
|
+
function vr(a, d, g) {
|
|
956
999
|
return gt(a, d, g, !1);
|
|
957
1000
|
}
|
|
958
|
-
var
|
|
959
|
-
oe.Fragment = n, oe.jsx =
|
|
1001
|
+
var gr = vr, yr = mr;
|
|
1002
|
+
oe.Fragment = n, oe.jsx = gr, oe.jsxs = yr;
|
|
960
1003
|
}()), oe;
|
|
961
1004
|
}
|
|
962
|
-
process.env.NODE_ENV === "production" ? Ve.exports =
|
|
1005
|
+
process.env.NODE_ENV === "production" ? Ve.exports = Pr() : Ve.exports = Ar();
|
|
963
1006
|
var E = Ve.exports;
|
|
964
1007
|
/**
|
|
965
1008
|
* @remix-run/router v1.23.2
|
|
@@ -1009,7 +1052,7 @@ function Tr(e) {
|
|
|
1009
1052
|
function r(n, o) {
|
|
1010
1053
|
return typeof o == "string" ? o : se(o);
|
|
1011
1054
|
}
|
|
1012
|
-
return
|
|
1055
|
+
return Dr(t, r, null, e);
|
|
1013
1056
|
}
|
|
1014
1057
|
function b(e, t) {
|
|
1015
1058
|
if (e === !1 || e === null || typeof e > "u")
|
|
@@ -1024,7 +1067,7 @@ function V(e, t) {
|
|
|
1024
1067
|
}
|
|
1025
1068
|
}
|
|
1026
1069
|
}
|
|
1027
|
-
function
|
|
1070
|
+
function jr() {
|
|
1028
1071
|
return Math.random().toString(36).substr(2, 8);
|
|
1029
1072
|
}
|
|
1030
1073
|
function bt(e, t) {
|
|
@@ -1045,7 +1088,7 @@ function Me(e, t, r, n) {
|
|
|
1045
1088
|
// full Locations now and avoid the need to run through this flow at all
|
|
1046
1089
|
// But that's a pretty big refactor to the current test suite so going to
|
|
1047
1090
|
// keep as is for the time being and just let any incoming keys take precedence
|
|
1048
|
-
key: t && t.key || n ||
|
|
1091
|
+
key: t && t.key || n || jr()
|
|
1049
1092
|
});
|
|
1050
1093
|
}
|
|
1051
1094
|
function se(e) {
|
|
@@ -1066,7 +1109,7 @@ function X(e) {
|
|
|
1066
1109
|
}
|
|
1067
1110
|
return t;
|
|
1068
1111
|
}
|
|
1069
|
-
function
|
|
1112
|
+
function Dr(e, t, r, n) {
|
|
1070
1113
|
n === void 0 && (n = {});
|
|
1071
1114
|
let {
|
|
1072
1115
|
window: o = document.defaultView,
|
|
@@ -1093,13 +1136,13 @@ function jr(e, t, r, n) {
|
|
|
1093
1136
|
c = Y.Push;
|
|
1094
1137
|
let v = Me(_.location, y, N);
|
|
1095
1138
|
u = p() + 1;
|
|
1096
|
-
let O = bt(v, u),
|
|
1139
|
+
let O = bt(v, u), T = _.createHref(v);
|
|
1097
1140
|
try {
|
|
1098
|
-
s.pushState(O, "",
|
|
1141
|
+
s.pushState(O, "", T);
|
|
1099
1142
|
} catch (U) {
|
|
1100
1143
|
if (U instanceof DOMException && U.name === "DataCloneError")
|
|
1101
1144
|
throw U;
|
|
1102
|
-
o.location.assign(
|
|
1145
|
+
o.location.assign(T);
|
|
1103
1146
|
}
|
|
1104
1147
|
i && l && l({
|
|
1105
1148
|
action: c,
|
|
@@ -1111,8 +1154,8 @@ function jr(e, t, r, n) {
|
|
|
1111
1154
|
c = Y.Replace;
|
|
1112
1155
|
let v = Me(_.location, y, N);
|
|
1113
1156
|
u = p();
|
|
1114
|
-
let O = bt(v, u),
|
|
1115
|
-
s.replaceState(O, "",
|
|
1157
|
+
let O = bt(v, u), T = _.createHref(v);
|
|
1158
|
+
s.replaceState(O, "", T), i && l && l({
|
|
1116
1159
|
action: c,
|
|
1117
1160
|
location: _.location,
|
|
1118
1161
|
delta: 0
|
|
@@ -1160,23 +1203,23 @@ var wt;
|
|
|
1160
1203
|
(function(e) {
|
|
1161
1204
|
e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
|
|
1162
1205
|
})(wt || (wt = {}));
|
|
1163
|
-
function
|
|
1164
|
-
return r === void 0 && (r = "/"),
|
|
1206
|
+
function kr(e, t, r) {
|
|
1207
|
+
return r === void 0 && (r = "/"), Lr(e, t, r);
|
|
1165
1208
|
}
|
|
1166
|
-
function
|
|
1209
|
+
function Lr(e, t, r, n) {
|
|
1167
1210
|
let o = typeof t == "string" ? X(t) : t, i = z(o.pathname || "/", r);
|
|
1168
1211
|
if (i == null)
|
|
1169
1212
|
return null;
|
|
1170
|
-
let s =
|
|
1171
|
-
|
|
1213
|
+
let s = kt(e);
|
|
1214
|
+
Fr(s);
|
|
1172
1215
|
let c = null;
|
|
1173
1216
|
for (let l = 0; c == null && l < s.length; ++l) {
|
|
1174
1217
|
let u = Kr(i);
|
|
1175
|
-
c =
|
|
1218
|
+
c = zr(s[l], u);
|
|
1176
1219
|
}
|
|
1177
1220
|
return c;
|
|
1178
1221
|
}
|
|
1179
|
-
function
|
|
1222
|
+
function kt(e, t, r, n) {
|
|
1180
1223
|
t === void 0 && (t = []), r === void 0 && (r = []), n === void 0 && (n = "");
|
|
1181
1224
|
let o = (i, s, c) => {
|
|
1182
1225
|
let l = {
|
|
@@ -1192,9 +1235,9 @@ function Dt(e, t, r, n) {
|
|
|
1192
1235
|
// @ts-expect-error
|
|
1193
1236
|
i.index !== !0,
|
|
1194
1237
|
"Index routes must not have child routes. Please remove " + ('all child routes from route path "' + u + '".')
|
|
1195
|
-
),
|
|
1238
|
+
), kt(i.children, t, p, u)), !(i.path == null && !i.index) && t.push({
|
|
1196
1239
|
path: u,
|
|
1197
|
-
score:
|
|
1240
|
+
score: Wr(u, i.index),
|
|
1198
1241
|
routesMeta: p
|
|
1199
1242
|
});
|
|
1200
1243
|
};
|
|
@@ -1203,28 +1246,28 @@ function Dt(e, t, r, n) {
|
|
|
1203
1246
|
if (i.path === "" || !((c = i.path) != null && c.includes("?")))
|
|
1204
1247
|
o(i, s);
|
|
1205
1248
|
else
|
|
1206
|
-
for (let l of
|
|
1249
|
+
for (let l of Lt(i.path))
|
|
1207
1250
|
o(i, s, l);
|
|
1208
1251
|
}), t;
|
|
1209
1252
|
}
|
|
1210
|
-
function
|
|
1253
|
+
function Lt(e) {
|
|
1211
1254
|
let t = e.split("/");
|
|
1212
1255
|
if (t.length === 0) return [];
|
|
1213
1256
|
let [r, ...n] = t, o = r.endsWith("?"), i = r.replace(/\?$/, "");
|
|
1214
1257
|
if (n.length === 0)
|
|
1215
1258
|
return o ? [i, ""] : [i];
|
|
1216
|
-
let s =
|
|
1259
|
+
let s = Lt(n.join("/")), c = [];
|
|
1217
1260
|
return c.push(...s.map((l) => l === "" ? i : [i, l].join("/"))), o && c.push(...s), c.map((l) => e.startsWith("/") && l === "" ? "/" : l);
|
|
1218
1261
|
}
|
|
1219
|
-
function
|
|
1220
|
-
e.sort((t, r) => t.score !== r.score ? r.score - t.score :
|
|
1262
|
+
function Fr(e) {
|
|
1263
|
+
e.sort((t, r) => t.score !== r.score ? r.score - t.score : Yr(t.routesMeta.map((n) => n.childrenIndex), r.routesMeta.map((n) => n.childrenIndex)));
|
|
1221
1264
|
}
|
|
1222
|
-
const
|
|
1223
|
-
function
|
|
1265
|
+
const Ir = /^:[\w-]+$/, Vr = 3, Mr = 2, Ur = 1, $r = 10, Br = -2, Rt = (e) => e === "*";
|
|
1266
|
+
function Wr(e, t) {
|
|
1224
1267
|
let r = e.split("/"), n = r.length;
|
|
1225
|
-
return r.some(Rt) && (n +=
|
|
1268
|
+
return r.some(Rt) && (n += Br), t && (n += Mr), r.filter((o) => !Rt(o)).reduce((o, i) => o + (Ir.test(i) ? Vr : i === "" ? Ur : $r), n);
|
|
1226
1269
|
}
|
|
1227
|
-
function
|
|
1270
|
+
function Yr(e, t) {
|
|
1228
1271
|
return e.length === t.length && e.slice(0, -1).every((n, o) => n === t[o]) ? (
|
|
1229
1272
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
1230
1273
|
// first. This allows people to have fine-grained control over the matching
|
|
@@ -1237,7 +1280,7 @@ function Wr(e, t) {
|
|
|
1237
1280
|
0
|
|
1238
1281
|
);
|
|
1239
1282
|
}
|
|
1240
|
-
function
|
|
1283
|
+
function zr(e, t, r) {
|
|
1241
1284
|
let {
|
|
1242
1285
|
routesMeta: n
|
|
1243
1286
|
} = e, o = {}, i = "/", s = [];
|
|
@@ -1253,7 +1296,7 @@ function Yr(e, t, r) {
|
|
|
1253
1296
|
// TODO: Can this as be avoided?
|
|
1254
1297
|
params: o,
|
|
1255
1298
|
pathname: $([i, f.pathname]),
|
|
1256
|
-
pathnameBase:
|
|
1299
|
+
pathnameBase: Zr($([i, f.pathnameBase])),
|
|
1257
1300
|
route: m
|
|
1258
1301
|
}), f.pathnameBase !== "/" && (i = $([i, f.pathnameBase]));
|
|
1259
1302
|
}
|
|
@@ -1265,7 +1308,7 @@ function Ue(e, t) {
|
|
|
1265
1308
|
caseSensitive: !1,
|
|
1266
1309
|
end: !0
|
|
1267
1310
|
});
|
|
1268
|
-
let [r, n] =
|
|
1311
|
+
let [r, n] = qr(e.path, e.caseSensitive, e.end), o = t.match(r);
|
|
1269
1312
|
if (!o) return null;
|
|
1270
1313
|
let i = o[0], s = i.replace(/(.)\/+$/, "$1"), c = o.slice(1);
|
|
1271
1314
|
return {
|
|
@@ -1286,7 +1329,7 @@ function Ue(e, t) {
|
|
|
1286
1329
|
pattern: e
|
|
1287
1330
|
};
|
|
1288
1331
|
}
|
|
1289
|
-
function
|
|
1332
|
+
function qr(e, t, r) {
|
|
1290
1333
|
t === void 0 && (t = !1), r === void 0 && (r = !0), V(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(/\*$/, "/*") + '".'));
|
|
1291
1334
|
let n = [], o = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (s, c, l) => (n.push({
|
|
1292
1335
|
paramName: c,
|
|
@@ -1310,8 +1353,8 @@ function z(e, t) {
|
|
|
1310
1353
|
let r = t.endsWith("/") ? t.length - 1 : t.length, n = e.charAt(r);
|
|
1311
1354
|
return n && n !== "/" ? null : e.slice(r) || "/";
|
|
1312
1355
|
}
|
|
1313
|
-
const
|
|
1314
|
-
function
|
|
1356
|
+
const Hr = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Jr = (e) => Hr.test(e);
|
|
1357
|
+
function Gr(e, t) {
|
|
1315
1358
|
t === void 0 && (t = "/");
|
|
1316
1359
|
let {
|
|
1317
1360
|
pathname: r,
|
|
@@ -1319,7 +1362,7 @@ function Jr(e, t) {
|
|
|
1319
1362
|
hash: o = ""
|
|
1320
1363
|
} = typeof e == "string" ? X(e) : e, i;
|
|
1321
1364
|
if (r)
|
|
1322
|
-
if (
|
|
1365
|
+
if (Jr(r))
|
|
1323
1366
|
i = r;
|
|
1324
1367
|
else {
|
|
1325
1368
|
if (r.includes("//")) {
|
|
@@ -1332,8 +1375,8 @@ function Jr(e, t) {
|
|
|
1332
1375
|
i = t;
|
|
1333
1376
|
return {
|
|
1334
1377
|
pathname: i,
|
|
1335
|
-
search:
|
|
1336
|
-
hash:
|
|
1378
|
+
search: Qr(n),
|
|
1379
|
+
hash: en(o)
|
|
1337
1380
|
};
|
|
1338
1381
|
}
|
|
1339
1382
|
function Ct(e, t) {
|
|
@@ -1345,14 +1388,14 @@ function Ct(e, t) {
|
|
|
1345
1388
|
function ke(e, t, r, n) {
|
|
1346
1389
|
return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(n) + "]. Please separate it out to the ") + ("`to." + r + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
|
|
1347
1390
|
}
|
|
1348
|
-
function
|
|
1391
|
+
function Xr(e) {
|
|
1349
1392
|
return e.filter((t, r) => r === 0 || t.route.path && t.route.path.length > 0);
|
|
1350
1393
|
}
|
|
1351
|
-
function
|
|
1352
|
-
let r =
|
|
1394
|
+
function Ft(e, t) {
|
|
1395
|
+
let r = Xr(e);
|
|
1353
1396
|
return t ? r.map((n, o) => o === r.length - 1 ? n.pathname : n.pathnameBase) : r.map((n) => n.pathnameBase);
|
|
1354
1397
|
}
|
|
1355
|
-
function
|
|
1398
|
+
function It(e, t, r, n) {
|
|
1356
1399
|
n === void 0 && (n = !1);
|
|
1357
1400
|
let o;
|
|
1358
1401
|
typeof e == "string" ? o = X(e) : (o = ie({}, e), b(!o.pathname || !o.pathname.includes("?"), ke("?", "pathname", "search", o)), b(!o.pathname || !o.pathname.includes("#"), ke("#", "pathname", "hash", o)), b(!o.search || !o.search.includes("#"), ke("#", "search", "hash", o)));
|
|
@@ -1369,17 +1412,17 @@ function Ft(e, t, r, n) {
|
|
|
1369
1412
|
}
|
|
1370
1413
|
c = f >= 0 ? t[f] : "/";
|
|
1371
1414
|
}
|
|
1372
|
-
let l =
|
|
1415
|
+
let l = Gr(o, c), u = s && s !== "/" && s.endsWith("/"), p = (i || s === ".") && r.endsWith("/");
|
|
1373
1416
|
return !l.pathname.endsWith("/") && (u || p) && (l.pathname += "/"), l;
|
|
1374
1417
|
}
|
|
1375
|
-
const $ = (e) => e.join("/").replace(/\/\/+/g, "/"),
|
|
1376
|
-
function
|
|
1418
|
+
const $ = (e) => e.join("/").replace(/\/\/+/g, "/"), Zr = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Qr = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, en = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
1419
|
+
function tn(e) {
|
|
1377
1420
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
1378
1421
|
}
|
|
1379
|
-
const
|
|
1380
|
-
new Set(
|
|
1381
|
-
const
|
|
1382
|
-
new Set(
|
|
1422
|
+
const Vt = ["post", "put", "patch", "delete"];
|
|
1423
|
+
new Set(Vt);
|
|
1424
|
+
const rn = ["get", ...Vt];
|
|
1425
|
+
new Set(rn);
|
|
1383
1426
|
/**
|
|
1384
1427
|
* React Router v6.30.3
|
|
1385
1428
|
*
|
|
@@ -1404,8 +1447,8 @@ const ce = /* @__PURE__ */ h.createContext(null);
|
|
|
1404
1447
|
process.env.NODE_ENV !== "production" && (ce.displayName = "DataRouter");
|
|
1405
1448
|
const We = /* @__PURE__ */ h.createContext(null);
|
|
1406
1449
|
process.env.NODE_ENV !== "production" && (We.displayName = "DataRouterState");
|
|
1407
|
-
const
|
|
1408
|
-
process.env.NODE_ENV !== "production" && (
|
|
1450
|
+
const nn = /* @__PURE__ */ h.createContext(null);
|
|
1451
|
+
process.env.NODE_ENV !== "production" && (nn.displayName = "Await");
|
|
1409
1452
|
const M = /* @__PURE__ */ h.createContext(null);
|
|
1410
1453
|
process.env.NODE_ENV !== "production" && (M.displayName = "Navigation");
|
|
1411
1454
|
const fe = /* @__PURE__ */ h.createContext(null);
|
|
@@ -1418,7 +1461,7 @@ const B = /* @__PURE__ */ h.createContext({
|
|
|
1418
1461
|
process.env.NODE_ENV !== "production" && (B.displayName = "Route");
|
|
1419
1462
|
const Ye = /* @__PURE__ */ h.createContext(null);
|
|
1420
1463
|
process.env.NODE_ENV !== "production" && (Ye.displayName = "RouteError");
|
|
1421
|
-
function
|
|
1464
|
+
function an(e, t) {
|
|
1422
1465
|
let {
|
|
1423
1466
|
relative: r
|
|
1424
1467
|
} = t === void 0 ? {} : t;
|
|
@@ -1455,17 +1498,17 @@ function Z() {
|
|
|
1455
1498
|
"useLocation() may be used only in the context of a <Router> component."
|
|
1456
1499
|
) : b(!1)), h.useContext(fe).location;
|
|
1457
1500
|
}
|
|
1458
|
-
const
|
|
1459
|
-
function
|
|
1501
|
+
const Mt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
1502
|
+
function Ut(e) {
|
|
1460
1503
|
h.useContext(M).static || h.useLayoutEffect(e);
|
|
1461
1504
|
}
|
|
1462
|
-
function
|
|
1505
|
+
function $t() {
|
|
1463
1506
|
let {
|
|
1464
1507
|
isDataRoute: e
|
|
1465
1508
|
} = h.useContext(B);
|
|
1466
|
-
return e ?
|
|
1509
|
+
return e ? En() : on();
|
|
1467
1510
|
}
|
|
1468
|
-
function
|
|
1511
|
+
function on() {
|
|
1469
1512
|
de() || (process.env.NODE_ENV !== "production" ? b(
|
|
1470
1513
|
!1,
|
|
1471
1514
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -1480,16 +1523,16 @@ function an() {
|
|
|
1480
1523
|
matches: o
|
|
1481
1524
|
} = h.useContext(B), {
|
|
1482
1525
|
pathname: i
|
|
1483
|
-
} = Z(), s = JSON.stringify(
|
|
1484
|
-
return
|
|
1526
|
+
} = Z(), s = JSON.stringify(Ft(o, r.v7_relativeSplatPath)), c = h.useRef(!1);
|
|
1527
|
+
return Ut(() => {
|
|
1485
1528
|
c.current = !0;
|
|
1486
1529
|
}), h.useCallback(function(u, p) {
|
|
1487
|
-
if (p === void 0 && (p = {}), process.env.NODE_ENV !== "production" && V(c.current,
|
|
1530
|
+
if (p === void 0 && (p = {}), process.env.NODE_ENV !== "production" && V(c.current, Mt), !c.current) return;
|
|
1488
1531
|
if (typeof u == "number") {
|
|
1489
1532
|
n.go(u);
|
|
1490
1533
|
return;
|
|
1491
1534
|
}
|
|
1492
|
-
let f =
|
|
1535
|
+
let f = It(u, JSON.parse(s), i, p.relative === "path");
|
|
1493
1536
|
e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : $([t, f.pathname])), (p.replace ? n.replace : n.push)(f, p.state, p);
|
|
1494
1537
|
}, [t, n, s, i, e]);
|
|
1495
1538
|
}
|
|
@@ -1502,13 +1545,13 @@ function pe(e, t) {
|
|
|
1502
1545
|
matches: o
|
|
1503
1546
|
} = h.useContext(B), {
|
|
1504
1547
|
pathname: i
|
|
1505
|
-
} = Z(), s = JSON.stringify(
|
|
1506
|
-
return h.useMemo(() =>
|
|
1548
|
+
} = Z(), s = JSON.stringify(Ft(o, n.v7_relativeSplatPath));
|
|
1549
|
+
return h.useMemo(() => It(e, JSON.parse(s), i, r === "path"), [e, s, i, r]);
|
|
1507
1550
|
}
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1551
|
+
function sn(e, t) {
|
|
1552
|
+
return ln(e, t);
|
|
1510
1553
|
}
|
|
1511
|
-
function
|
|
1554
|
+
function ln(e, t, r, n) {
|
|
1512
1555
|
de() || (process.env.NODE_ENV !== "production" ? b(
|
|
1513
1556
|
!1,
|
|
1514
1557
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -1522,7 +1565,7 @@ function sn(e, t, r, n) {
|
|
|
1522
1565
|
} = h.useContext(B), s = i[i.length - 1], c = s ? s.params : {}, l = s ? s.pathname : "/", u = s ? s.pathnameBase : "/", p = s && s.route;
|
|
1523
1566
|
if (process.env.NODE_ENV !== "production") {
|
|
1524
1567
|
let v = p && p.path || "";
|
|
1525
|
-
|
|
1568
|
+
Wt(l, !p || v.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + l + '" (under <Route path="' + v + '">) but the ') + `parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1526
1569
|
|
|
1527
1570
|
` + ('Please change the parent <Route path="' + v + '"> to <Route ') + ('path="' + (v === "/" ? "*" : v + "/*") + '">.'));
|
|
1528
1571
|
}
|
|
@@ -1538,11 +1581,11 @@ function sn(e, t, r, n) {
|
|
|
1538
1581
|
let v = u.replace(/^\//, "").split("/");
|
|
1539
1582
|
_ = "/" + C.replace(/^\//, "").split("/").slice(v.length).join("/");
|
|
1540
1583
|
}
|
|
1541
|
-
let y =
|
|
1584
|
+
let y = kr(e, {
|
|
1542
1585
|
pathname: _
|
|
1543
1586
|
});
|
|
1544
1587
|
process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && V(p || y != null, 'No routes matched location "' + m.pathname + m.search + m.hash + '" '), process.env.NODE_ENV !== "production" && V(y == null || y[y.length - 1].route.element !== void 0 || y[y.length - 1].route.Component !== void 0 || y[y.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + m.pathname + m.search + m.hash + '" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));
|
|
1545
|
-
let N =
|
|
1588
|
+
let N = pn(y && y.map((v) => Object.assign({}, v, {
|
|
1546
1589
|
params: Object.assign({}, c, v.params),
|
|
1547
1590
|
pathname: $([
|
|
1548
1591
|
u,
|
|
@@ -1568,8 +1611,8 @@ function sn(e, t, r, n) {
|
|
|
1568
1611
|
}
|
|
1569
1612
|
}, N) : N;
|
|
1570
1613
|
}
|
|
1571
|
-
function
|
|
1572
|
-
let e =
|
|
1614
|
+
function un() {
|
|
1615
|
+
let e = yn(), t = tn(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", o = {
|
|
1573
1616
|
padding: "0.5rem",
|
|
1574
1617
|
backgroundColor: n
|
|
1575
1618
|
}, i = {
|
|
@@ -1588,8 +1631,8 @@ function ln() {
|
|
|
1588
1631
|
style: o
|
|
1589
1632
|
}, r) : null, s);
|
|
1590
1633
|
}
|
|
1591
|
-
const
|
|
1592
|
-
class
|
|
1634
|
+
const cn = /* @__PURE__ */ h.createElement(un, null);
|
|
1635
|
+
class fn extends h.Component {
|
|
1593
1636
|
constructor(t) {
|
|
1594
1637
|
super(t), this.state = {
|
|
1595
1638
|
location: t.location,
|
|
@@ -1625,7 +1668,7 @@ class cn extends h.Component {
|
|
|
1625
1668
|
})) : this.props.children;
|
|
1626
1669
|
}
|
|
1627
1670
|
}
|
|
1628
|
-
function
|
|
1671
|
+
function dn(e) {
|
|
1629
1672
|
let {
|
|
1630
1673
|
routeContext: t,
|
|
1631
1674
|
match: r,
|
|
@@ -1635,7 +1678,7 @@ function fn(e) {
|
|
|
1635
1678
|
value: t
|
|
1636
1679
|
}, n);
|
|
1637
1680
|
}
|
|
1638
|
-
function
|
|
1681
|
+
function pn(e, t, r, n) {
|
|
1639
1682
|
var o;
|
|
1640
1683
|
if (t === void 0 && (t = []), r === void 0 && (r = null), n === void 0 && (n = null), e == null) {
|
|
1641
1684
|
var i;
|
|
@@ -1670,10 +1713,10 @@ function dn(e, t, r, n) {
|
|
|
1670
1713
|
}
|
|
1671
1714
|
return s.reduceRight((p, f, m) => {
|
|
1672
1715
|
let w, C = !1, _ = null, y = null;
|
|
1673
|
-
r && (w = c && f.route.id ? c[f.route.id] : void 0, _ = f.route.errorElement ||
|
|
1716
|
+
r && (w = c && f.route.id ? c[f.route.id] : void 0, _ = f.route.errorElement || cn, l && (u < 0 && m === 0 ? (Wt("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), C = !0, y = null) : u === m && (C = !0, y = f.route.hydrateFallbackElement || null)));
|
|
1674
1717
|
let N = t.concat(s.slice(0, m + 1)), v = () => {
|
|
1675
1718
|
let O;
|
|
1676
|
-
return w ? O = _ : C ? O = y : f.route.Component ? O = /* @__PURE__ */ h.createElement(f.route.Component, null) : f.route.element ? O = f.route.element : O = p, /* @__PURE__ */ h.createElement(
|
|
1719
|
+
return w ? O = _ : C ? O = y : f.route.Component ? O = /* @__PURE__ */ h.createElement(f.route.Component, null) : f.route.element ? O = f.route.element : O = p, /* @__PURE__ */ h.createElement(dn, {
|
|
1677
1720
|
match: f,
|
|
1678
1721
|
routeContext: {
|
|
1679
1722
|
outlet: p,
|
|
@@ -1683,7 +1726,7 @@ function dn(e, t, r, n) {
|
|
|
1683
1726
|
children: O
|
|
1684
1727
|
});
|
|
1685
1728
|
};
|
|
1686
|
-
return r && (f.route.ErrorBoundary || f.route.errorElement || m === 0) ? /* @__PURE__ */ h.createElement(
|
|
1729
|
+
return r && (f.route.ErrorBoundary || f.route.errorElement || m === 0) ? /* @__PURE__ */ h.createElement(fn, {
|
|
1687
1730
|
location: r.location,
|
|
1688
1731
|
revalidation: r.revalidation,
|
|
1689
1732
|
component: _,
|
|
@@ -1697,66 +1740,66 @@ function dn(e, t, r, n) {
|
|
|
1697
1740
|
}) : v();
|
|
1698
1741
|
}, null);
|
|
1699
1742
|
}
|
|
1700
|
-
var
|
|
1743
|
+
var Bt = /* @__PURE__ */ function(e) {
|
|
1701
1744
|
return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
|
|
1702
|
-
}(
|
|
1745
|
+
}(Bt || {}), ue = /* @__PURE__ */ function(e) {
|
|
1703
1746
|
return e.UseBlocker = "useBlocker", e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e.UseRouteId = "useRouteId", e;
|
|
1704
1747
|
}(ue || {});
|
|
1705
1748
|
function ze(e) {
|
|
1706
1749
|
return e + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
1707
1750
|
}
|
|
1708
|
-
function
|
|
1751
|
+
function hn(e) {
|
|
1709
1752
|
let t = h.useContext(ce);
|
|
1710
1753
|
return t || (process.env.NODE_ENV !== "production" ? b(!1, ze(e)) : b(!1)), t;
|
|
1711
1754
|
}
|
|
1712
|
-
function
|
|
1755
|
+
function mn(e) {
|
|
1713
1756
|
let t = h.useContext(We);
|
|
1714
1757
|
return t || (process.env.NODE_ENV !== "production" ? b(!1, ze(e)) : b(!1)), t;
|
|
1715
1758
|
}
|
|
1716
|
-
function
|
|
1759
|
+
function vn(e) {
|
|
1717
1760
|
let t = h.useContext(B);
|
|
1718
1761
|
return t || (process.env.NODE_ENV !== "production" ? b(!1, ze(e)) : b(!1)), t;
|
|
1719
1762
|
}
|
|
1720
|
-
function
|
|
1721
|
-
let t =
|
|
1763
|
+
function qe(e) {
|
|
1764
|
+
let t = vn(e), r = t.matches[t.matches.length - 1];
|
|
1722
1765
|
return r.route.id || (process.env.NODE_ENV !== "production" ? b(!1, e + ' can only be used on routes that contain a unique "id"') : b(!1)), r.route.id;
|
|
1723
1766
|
}
|
|
1724
|
-
function vn() {
|
|
1725
|
-
return Ke(ue.UseRouteId);
|
|
1726
|
-
}
|
|
1727
1767
|
function gn() {
|
|
1768
|
+
return qe(ue.UseRouteId);
|
|
1769
|
+
}
|
|
1770
|
+
function yn() {
|
|
1728
1771
|
var e;
|
|
1729
|
-
let t = h.useContext(Ye), r =
|
|
1772
|
+
let t = h.useContext(Ye), r = mn(ue.UseRouteError), n = qe(ue.UseRouteError);
|
|
1730
1773
|
return t !== void 0 ? t : (e = r.errors) == null ? void 0 : e[n];
|
|
1731
1774
|
}
|
|
1732
|
-
function
|
|
1775
|
+
function En() {
|
|
1733
1776
|
let {
|
|
1734
1777
|
router: e
|
|
1735
|
-
} =
|
|
1736
|
-
return
|
|
1778
|
+
} = hn(Bt.UseNavigateStable), t = qe(ue.UseNavigateStable), r = h.useRef(!1);
|
|
1779
|
+
return Ut(() => {
|
|
1737
1780
|
r.current = !0;
|
|
1738
1781
|
}), h.useCallback(function(o, i) {
|
|
1739
|
-
i === void 0 && (i = {}), process.env.NODE_ENV !== "production" && V(r.current,
|
|
1782
|
+
i === void 0 && (i = {}), process.env.NODE_ENV !== "production" && V(r.current, Mt), r.current && (typeof o == "number" ? e.navigate(o) : e.navigate(o, le({
|
|
1740
1783
|
fromRouteId: t
|
|
1741
1784
|
}, i)));
|
|
1742
1785
|
}, [e, t]);
|
|
1743
1786
|
}
|
|
1744
1787
|
const St = {};
|
|
1745
|
-
function
|
|
1788
|
+
function Wt(e, t, r) {
|
|
1746
1789
|
!t && !St[e] && (St[e] = !0, process.env.NODE_ENV !== "production" && V(!1, r));
|
|
1747
1790
|
}
|
|
1748
1791
|
const Nt = {};
|
|
1749
|
-
function
|
|
1792
|
+
function xn(e, t) {
|
|
1750
1793
|
process.env.NODE_ENV !== "production" && !Nt[t] && (Nt[t] = !0, console.warn(t));
|
|
1751
1794
|
}
|
|
1752
|
-
const _t = (e, t, r) =>
|
|
1753
|
-
function
|
|
1795
|
+
const _t = (e, t, r) => xn(e, "⚠️ React Router Future Flag Warning: " + t + ". " + ("You can use the `" + e + "` future flag to opt-in early. ") + ("For more information, see " + r + "."));
|
|
1796
|
+
function bn(e, t) {
|
|
1754
1797
|
(e == null ? void 0 : e.v7_startTransition) === void 0 && _t("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition"), (e == null ? void 0 : e.v7_relativeSplatPath) === void 0 && _t("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
|
|
1755
1798
|
}
|
|
1756
|
-
function
|
|
1799
|
+
function Yt(e) {
|
|
1757
1800
|
process.env.NODE_ENV !== "production" ? b(!1, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.") : b(!1);
|
|
1758
1801
|
}
|
|
1759
|
-
function
|
|
1802
|
+
function wn(e) {
|
|
1760
1803
|
let {
|
|
1761
1804
|
basename: t = "/",
|
|
1762
1805
|
children: r = null,
|
|
@@ -1802,12 +1845,12 @@ function bn(e) {
|
|
|
1802
1845
|
value: _
|
|
1803
1846
|
}));
|
|
1804
1847
|
}
|
|
1805
|
-
function
|
|
1848
|
+
function Rn(e) {
|
|
1806
1849
|
let {
|
|
1807
1850
|
children: t,
|
|
1808
1851
|
location: r
|
|
1809
1852
|
} = e;
|
|
1810
|
-
return
|
|
1853
|
+
return sn($e(t), r);
|
|
1811
1854
|
}
|
|
1812
1855
|
new Promise(() => {
|
|
1813
1856
|
});
|
|
@@ -1822,7 +1865,7 @@ function $e(e, t) {
|
|
|
1822
1865
|
r.push.apply(r, $e(n.props.children, i));
|
|
1823
1866
|
return;
|
|
1824
1867
|
}
|
|
1825
|
-
n.type !==
|
|
1868
|
+
n.type !== Yt && (process.env.NODE_ENV !== "production" ? b(!1, "[" + (typeof n.type == "string" ? n.type : n.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : b(!1)), !n.props.index || !n.props.children || (process.env.NODE_ENV !== "production" ? b(!1, "An index route cannot have child routes.") : b(!1));
|
|
1826
1869
|
let s = {
|
|
1827
1870
|
id: n.props.id || i.join("-"),
|
|
1828
1871
|
caseSensitive: n.props.caseSensitive,
|
|
@@ -1862,7 +1905,7 @@ function G() {
|
|
|
1862
1905
|
return e;
|
|
1863
1906
|
}, G.apply(this, arguments);
|
|
1864
1907
|
}
|
|
1865
|
-
function
|
|
1908
|
+
function Ke(e, t) {
|
|
1866
1909
|
if (e == null) return {};
|
|
1867
1910
|
var r = {}, n = Object.keys(e), o, i;
|
|
1868
1911
|
for (i = 0; i < n.length; i++)
|
|
@@ -1873,25 +1916,25 @@ const be = "get", we = "application/x-www-form-urlencoded";
|
|
|
1873
1916
|
function Ce(e) {
|
|
1874
1917
|
return e != null && typeof e.tagName == "string";
|
|
1875
1918
|
}
|
|
1876
|
-
function
|
|
1919
|
+
function Cn(e) {
|
|
1877
1920
|
return Ce(e) && e.tagName.toLowerCase() === "button";
|
|
1878
1921
|
}
|
|
1879
|
-
function
|
|
1922
|
+
function Sn(e) {
|
|
1880
1923
|
return Ce(e) && e.tagName.toLowerCase() === "form";
|
|
1881
1924
|
}
|
|
1882
|
-
function
|
|
1925
|
+
function Nn(e) {
|
|
1883
1926
|
return Ce(e) && e.tagName.toLowerCase() === "input";
|
|
1884
1927
|
}
|
|
1885
|
-
function
|
|
1928
|
+
function _n(e) {
|
|
1886
1929
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1887
1930
|
}
|
|
1888
|
-
function
|
|
1931
|
+
function On(e, t) {
|
|
1889
1932
|
return e.button === 0 && // Ignore everything but left clicks
|
|
1890
1933
|
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
1891
|
-
!
|
|
1934
|
+
!_n(e);
|
|
1892
1935
|
}
|
|
1893
1936
|
let xe = null;
|
|
1894
|
-
function
|
|
1937
|
+
function Pn() {
|
|
1895
1938
|
if (xe === null)
|
|
1896
1939
|
try {
|
|
1897
1940
|
new FormData(
|
|
@@ -1904,21 +1947,21 @@ function On() {
|
|
|
1904
1947
|
}
|
|
1905
1948
|
return xe;
|
|
1906
1949
|
}
|
|
1907
|
-
const
|
|
1950
|
+
const An = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
1908
1951
|
function Le(e) {
|
|
1909
|
-
return e != null && !
|
|
1952
|
+
return e != null && !An.has(e) ? (process.env.NODE_ENV !== "production" && V(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + we + '"')), null) : e;
|
|
1910
1953
|
}
|
|
1911
1954
|
function Tn(e, t) {
|
|
1912
1955
|
let r, n, o, i, s;
|
|
1913
|
-
if (
|
|
1956
|
+
if (Sn(e)) {
|
|
1914
1957
|
let c = e.getAttribute("action");
|
|
1915
1958
|
n = c ? z(c, t) : null, r = e.getAttribute("method") || be, o = Le(e.getAttribute("enctype")) || we, i = new FormData(e);
|
|
1916
|
-
} else if (
|
|
1959
|
+
} else if (Cn(e) || Nn(e) && (e.type === "submit" || e.type === "image")) {
|
|
1917
1960
|
let c = e.form;
|
|
1918
1961
|
if (c == null)
|
|
1919
1962
|
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
1920
1963
|
let l = e.getAttribute("formaction") || c.getAttribute("action");
|
|
1921
|
-
if (n = l ? z(l, t) : null, r = e.getAttribute("formmethod") || c.getAttribute("method") || be, o = Le(e.getAttribute("formenctype")) || Le(c.getAttribute("enctype")) || we, i = new FormData(c, e), !
|
|
1964
|
+
if (n = l ? z(l, t) : null, r = e.getAttribute("formmethod") || c.getAttribute("method") || be, o = Le(e.getAttribute("formenctype")) || Le(c.getAttribute("enctype")) || we, i = new FormData(c, e), !Pn()) {
|
|
1922
1965
|
let {
|
|
1923
1966
|
name: u,
|
|
1924
1967
|
type: p,
|
|
@@ -1942,19 +1985,19 @@ function Tn(e, t) {
|
|
|
1942
1985
|
body: s
|
|
1943
1986
|
};
|
|
1944
1987
|
}
|
|
1945
|
-
const
|
|
1988
|
+
const jn = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"], Dn = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"], kn = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"], Ln = "6";
|
|
1946
1989
|
try {
|
|
1947
|
-
window.__reactRouterVersion =
|
|
1990
|
+
window.__reactRouterVersion = Ln;
|
|
1948
1991
|
} catch {
|
|
1949
1992
|
}
|
|
1950
|
-
const
|
|
1993
|
+
const zt = /* @__PURE__ */ h.createContext({
|
|
1951
1994
|
isTransitioning: !1
|
|
1952
1995
|
});
|
|
1953
|
-
process.env.NODE_ENV !== "production" && (
|
|
1954
|
-
const
|
|
1955
|
-
process.env.NODE_ENV !== "production" && (
|
|
1956
|
-
const
|
|
1957
|
-
function
|
|
1996
|
+
process.env.NODE_ENV !== "production" && (zt.displayName = "ViewTransition");
|
|
1997
|
+
const Fn = /* @__PURE__ */ h.createContext(/* @__PURE__ */ new Map());
|
|
1998
|
+
process.env.NODE_ENV !== "production" && (Fn.displayName = "Fetchers");
|
|
1999
|
+
const In = "startTransition", Ot = h[In];
|
|
2000
|
+
function Vn(e) {
|
|
1958
2001
|
let {
|
|
1959
2002
|
basename: t,
|
|
1960
2003
|
children: r,
|
|
@@ -1973,7 +2016,7 @@ function In(e) {
|
|
|
1973
2016
|
} = n || {}, p = h.useCallback((f) => {
|
|
1974
2017
|
u && Ot ? Ot(() => l(f)) : l(f);
|
|
1975
2018
|
}, [l, u]);
|
|
1976
|
-
return h.useLayoutEffect(() => s.listen(p), [s, p]), h.useEffect(() =>
|
|
2019
|
+
return h.useLayoutEffect(() => s.listen(p), [s, p]), h.useEffect(() => bn(n), [n]), /* @__PURE__ */ h.createElement(wn, {
|
|
1977
2020
|
basename: t,
|
|
1978
2021
|
children: r,
|
|
1979
2022
|
location: c.location,
|
|
@@ -1983,7 +2026,7 @@ function In(e) {
|
|
|
1983
2026
|
});
|
|
1984
2027
|
}
|
|
1985
2028
|
process.env.NODE_ENV;
|
|
1986
|
-
const
|
|
2029
|
+
const Mn = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Un = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, qt = /* @__PURE__ */ h.forwardRef(function(t, r) {
|
|
1987
2030
|
let {
|
|
1988
2031
|
onClick: n,
|
|
1989
2032
|
relative: o,
|
|
@@ -1994,19 +2037,19 @@ const Vn = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1994
2037
|
to: u,
|
|
1995
2038
|
preventScrollReset: p,
|
|
1996
2039
|
viewTransition: f
|
|
1997
|
-
} = t, m =
|
|
2040
|
+
} = t, m = Ke(t, jn), {
|
|
1998
2041
|
basename: w
|
|
1999
2042
|
} = h.useContext(M), C, _ = !1;
|
|
2000
|
-
if (typeof u == "string" &&
|
|
2043
|
+
if (typeof u == "string" && Un.test(u) && (C = u, Mn))
|
|
2001
2044
|
try {
|
|
2002
|
-
let O = new URL(window.location.href),
|
|
2003
|
-
|
|
2045
|
+
let O = new URL(window.location.href), T = u.startsWith("//") ? new URL(O.protocol + u) : new URL(u), U = z(T.pathname, w);
|
|
2046
|
+
T.origin === O.origin && U != null ? u = U + T.search + T.hash : _ = !0;
|
|
2004
2047
|
} catch {
|
|
2005
2048
|
process.env.NODE_ENV !== "production" && V(!1, '<Link to="' + u + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
2006
2049
|
}
|
|
2007
|
-
let y =
|
|
2050
|
+
let y = an(u, {
|
|
2008
2051
|
relative: o
|
|
2009
|
-
}), N =
|
|
2052
|
+
}), N = Yn(u, {
|
|
2010
2053
|
replace: s,
|
|
2011
2054
|
state: c,
|
|
2012
2055
|
target: l,
|
|
@@ -2027,8 +2070,8 @@ const Vn = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
2027
2070
|
}))
|
|
2028
2071
|
);
|
|
2029
2072
|
});
|
|
2030
|
-
process.env.NODE_ENV !== "production" && (
|
|
2031
|
-
const
|
|
2073
|
+
process.env.NODE_ENV !== "production" && (qt.displayName = "Link");
|
|
2074
|
+
const $n = /* @__PURE__ */ h.forwardRef(function(t, r) {
|
|
2032
2075
|
let {
|
|
2033
2076
|
"aria-current": n = "page",
|
|
2034
2077
|
caseSensitive: o = !1,
|
|
@@ -2038,24 +2081,24 @@ const Un = /* @__PURE__ */ h.forwardRef(function(t, r) {
|
|
|
2038
2081
|
to: l,
|
|
2039
2082
|
viewTransition: u,
|
|
2040
2083
|
children: p
|
|
2041
|
-
} = t, f =
|
|
2084
|
+
} = t, f = Ke(t, Dn), m = pe(l, {
|
|
2042
2085
|
relative: f.relative
|
|
2043
2086
|
}), w = Z(), C = h.useContext(We), {
|
|
2044
2087
|
navigator: _,
|
|
2045
2088
|
basename: y
|
|
2046
2089
|
} = h.useContext(M), N = C != null && // Conditional usage is OK here because the usage of a data router is static
|
|
2047
2090
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2048
|
-
|
|
2049
|
-
o || (O = O.toLowerCase(),
|
|
2091
|
+
Gn(m) && u === !0, v = _.encodeLocation ? _.encodeLocation(m).pathname : m.pathname, O = w.pathname, T = C && C.navigation && C.navigation.location ? C.navigation.location.pathname : null;
|
|
2092
|
+
o || (O = O.toLowerCase(), T = T ? T.toLowerCase() : null, v = v.toLowerCase()), T && y && (T = z(T, y) || T);
|
|
2050
2093
|
const U = v !== "/" && v.endsWith("/") ? v.length - 1 : v.length;
|
|
2051
|
-
let Q = O === v || !s && O.startsWith(v) && O.charAt(U) === "/", he =
|
|
2094
|
+
let Q = O === v || !s && O.startsWith(v) && O.charAt(U) === "/", he = T != null && (T === v || !s && T.startsWith(v) && T.charAt(v.length) === "/"), ee = {
|
|
2052
2095
|
isActive: Q,
|
|
2053
2096
|
isPending: he,
|
|
2054
2097
|
isTransitioning: N
|
|
2055
2098
|
}, me = Q ? n : void 0, te;
|
|
2056
2099
|
typeof i == "function" ? te = i(ee) : te = [i, Q ? "active" : null, he ? "pending" : null, N ? "transitioning" : null].filter(Boolean).join(" ");
|
|
2057
2100
|
let Se = typeof c == "function" ? c(ee) : c;
|
|
2058
|
-
return /* @__PURE__ */ h.createElement(
|
|
2101
|
+
return /* @__PURE__ */ h.createElement(qt, G({}, f, {
|
|
2059
2102
|
"aria-current": me,
|
|
2060
2103
|
className: te,
|
|
2061
2104
|
ref: r,
|
|
@@ -2064,8 +2107,8 @@ const Un = /* @__PURE__ */ h.forwardRef(function(t, r) {
|
|
|
2064
2107
|
viewTransition: u
|
|
2065
2108
|
}), typeof p == "function" ? p(ee) : p);
|
|
2066
2109
|
});
|
|
2067
|
-
process.env.NODE_ENV !== "production" && (
|
|
2068
|
-
const
|
|
2110
|
+
process.env.NODE_ENV !== "production" && ($n.displayName = "NavLink");
|
|
2111
|
+
const Bn = /* @__PURE__ */ h.forwardRef((e, t) => {
|
|
2069
2112
|
let {
|
|
2070
2113
|
fetcherKey: r,
|
|
2071
2114
|
navigate: n,
|
|
@@ -2078,15 +2121,15 @@ const $n = /* @__PURE__ */ h.forwardRef((e, t) => {
|
|
|
2078
2121
|
relative: p,
|
|
2079
2122
|
preventScrollReset: f,
|
|
2080
2123
|
viewTransition: m
|
|
2081
|
-
} = e, w =
|
|
2124
|
+
} = e, w = Ke(e, kn), C = Hn(), _ = Jn(l, {
|
|
2082
2125
|
relative: p
|
|
2083
2126
|
}), y = c.toLowerCase() === "get" ? "get" : "post", N = (v) => {
|
|
2084
2127
|
if (u && u(v), v.defaultPrevented) return;
|
|
2085
2128
|
v.preventDefault();
|
|
2086
|
-
let O = v.nativeEvent.submitter,
|
|
2129
|
+
let O = v.nativeEvent.submitter, T = (O == null ? void 0 : O.getAttribute("formmethod")) || c;
|
|
2087
2130
|
C(O || v.currentTarget, {
|
|
2088
2131
|
fetcherKey: r,
|
|
2089
|
-
method:
|
|
2132
|
+
method: T,
|
|
2090
2133
|
navigate: n,
|
|
2091
2134
|
replace: i,
|
|
2092
2135
|
state: s,
|
|
@@ -2102,7 +2145,7 @@ const $n = /* @__PURE__ */ h.forwardRef((e, t) => {
|
|
|
2102
2145
|
onSubmit: o ? u : N
|
|
2103
2146
|
}, w));
|
|
2104
2147
|
});
|
|
2105
|
-
process.env.NODE_ENV !== "production" && (
|
|
2148
|
+
process.env.NODE_ENV !== "production" && (Bn.displayName = "Form");
|
|
2106
2149
|
process.env.NODE_ENV;
|
|
2107
2150
|
var Re;
|
|
2108
2151
|
(function(e) {
|
|
@@ -2112,14 +2155,14 @@ var Pt;
|
|
|
2112
2155
|
(function(e) {
|
|
2113
2156
|
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
2114
2157
|
})(Pt || (Pt = {}));
|
|
2115
|
-
function
|
|
2158
|
+
function Wn(e) {
|
|
2116
2159
|
return e + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
2117
2160
|
}
|
|
2118
2161
|
function Kt(e) {
|
|
2119
2162
|
let t = h.useContext(ce);
|
|
2120
|
-
return t || (process.env.NODE_ENV !== "production" ? b(!1,
|
|
2163
|
+
return t || (process.env.NODE_ENV !== "production" ? b(!1, Wn(e)) : b(!1)), t;
|
|
2121
2164
|
}
|
|
2122
|
-
function
|
|
2165
|
+
function Yn(e, t) {
|
|
2123
2166
|
let {
|
|
2124
2167
|
target: r,
|
|
2125
2168
|
replace: n,
|
|
@@ -2127,11 +2170,11 @@ function Wn(e, t) {
|
|
|
2127
2170
|
preventScrollReset: i,
|
|
2128
2171
|
relative: s,
|
|
2129
2172
|
viewTransition: c
|
|
2130
|
-
} = t === void 0 ? {} : t, l =
|
|
2173
|
+
} = t === void 0 ? {} : t, l = $t(), u = Z(), p = pe(e, {
|
|
2131
2174
|
relative: s
|
|
2132
2175
|
});
|
|
2133
2176
|
return h.useCallback((f) => {
|
|
2134
|
-
if (
|
|
2177
|
+
if (On(f, r)) {
|
|
2135
2178
|
f.preventDefault();
|
|
2136
2179
|
let m = n !== void 0 ? n : se(u) === se(p);
|
|
2137
2180
|
l(e, {
|
|
@@ -2144,19 +2187,19 @@ function Wn(e, t) {
|
|
|
2144
2187
|
}
|
|
2145
2188
|
}, [u, l, p, n, o, r, e, i, s, c]);
|
|
2146
2189
|
}
|
|
2147
|
-
function
|
|
2190
|
+
function zn() {
|
|
2148
2191
|
if (typeof document > "u")
|
|
2149
2192
|
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
2150
2193
|
}
|
|
2151
|
-
let
|
|
2152
|
-
function
|
|
2194
|
+
let qn = 0, Kn = () => "__" + String(++qn) + "__";
|
|
2195
|
+
function Hn() {
|
|
2153
2196
|
let {
|
|
2154
2197
|
router: e
|
|
2155
2198
|
} = Kt(Re.UseSubmit), {
|
|
2156
2199
|
basename: t
|
|
2157
|
-
} = h.useContext(M), r =
|
|
2200
|
+
} = h.useContext(M), r = gn();
|
|
2158
2201
|
return h.useCallback(function(n, o) {
|
|
2159
|
-
o === void 0 && (o = {}),
|
|
2202
|
+
o === void 0 && (o = {}), zn();
|
|
2160
2203
|
let {
|
|
2161
2204
|
action: i,
|
|
2162
2205
|
method: s,
|
|
@@ -2189,7 +2232,7 @@ function qn() {
|
|
|
2189
2232
|
});
|
|
2190
2233
|
}, [e, t, r]);
|
|
2191
2234
|
}
|
|
2192
|
-
function
|
|
2235
|
+
function Jn(e, t) {
|
|
2193
2236
|
let {
|
|
2194
2237
|
relative: r
|
|
2195
2238
|
} = t === void 0 ? {} : t, {
|
|
@@ -2210,9 +2253,9 @@ function Hn(e, t) {
|
|
|
2210
2253
|
}
|
|
2211
2254
|
return (!e || e === ".") && i.route.index && (s.search = s.search ? s.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (s.pathname = s.pathname === "/" ? n : $([n, s.pathname])), se(s);
|
|
2212
2255
|
}
|
|
2213
|
-
function
|
|
2256
|
+
function Gn(e, t) {
|
|
2214
2257
|
t === void 0 && (t = {});
|
|
2215
|
-
let r = h.useContext(
|
|
2258
|
+
let r = h.useContext(zt);
|
|
2216
2259
|
r == null && (process.env.NODE_ENV !== "production" ? b(!1, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : b(!1));
|
|
2217
2260
|
let {
|
|
2218
2261
|
basename: n
|
|
@@ -2224,7 +2267,7 @@ function Jn(e, t) {
|
|
|
2224
2267
|
let i = z(r.currentLocation.pathname, n) || r.currentLocation.pathname, s = z(r.nextLocation.pathname, n) || r.nextLocation.pathname;
|
|
2225
2268
|
return Ue(o.pathname, s) != null || Ue(o.pathname, i) != null;
|
|
2226
2269
|
}
|
|
2227
|
-
function
|
|
2270
|
+
function Xn({
|
|
2228
2271
|
appName: e,
|
|
2229
2272
|
appPath: t,
|
|
2230
2273
|
children: r,
|
|
@@ -2232,7 +2275,7 @@ function Gn({
|
|
|
2232
2275
|
}) {
|
|
2233
2276
|
return /* @__PURE__ */ E.jsx(E.Fragment, { children: r });
|
|
2234
2277
|
}
|
|
2235
|
-
class
|
|
2278
|
+
class Zn extends jt {
|
|
2236
2279
|
constructor(t) {
|
|
2237
2280
|
super(t), this.state = { hasError: !1, error: null, errorInfo: null };
|
|
2238
2281
|
}
|
|
@@ -2300,16 +2343,16 @@ class Xn extends jt {
|
|
|
2300
2343
|
] }) }) }) : i;
|
|
2301
2344
|
}
|
|
2302
2345
|
}
|
|
2303
|
-
function
|
|
2346
|
+
function Qn({
|
|
2304
2347
|
appName: e,
|
|
2305
2348
|
children: t,
|
|
2306
2349
|
onError: r
|
|
2307
2350
|
}) {
|
|
2308
|
-
const [n, o] =
|
|
2351
|
+
const [n, o] = Tt(0), i = Fe(() => {
|
|
2309
2352
|
console.log(`[ErrorBoundary][${e}] 触发 key 重置,完整重建子应用`), o((l) => l + 1);
|
|
2310
2353
|
}, [e]), s = Fe((l, u) => {
|
|
2311
2354
|
c({ type: "SET_ERROR", error: l }), r == null || r(l, u);
|
|
2312
|
-
}, [r]), [, c] =
|
|
2355
|
+
}, [r]), [, c] = Rr(
|
|
2313
2356
|
(l, u) => {
|
|
2314
2357
|
switch (u.type) {
|
|
2315
2358
|
case "SET_ERROR":
|
|
@@ -2327,7 +2370,7 @@ function Zn({
|
|
|
2327
2370
|
return Be(() => {
|
|
2328
2371
|
c({ type: "ROUTE_CHANGED" });
|
|
2329
2372
|
}, [location.pathname]), /* @__PURE__ */ E.jsx(
|
|
2330
|
-
|
|
2373
|
+
Zn,
|
|
2331
2374
|
{
|
|
2332
2375
|
appName: e,
|
|
2333
2376
|
onError: s,
|
|
@@ -2337,8 +2380,8 @@ function Zn({
|
|
|
2337
2380
|
n
|
|
2338
2381
|
);
|
|
2339
2382
|
}
|
|
2340
|
-
function
|
|
2341
|
-
const [e, t] =
|
|
2383
|
+
function ea() {
|
|
2384
|
+
const [e, t] = Tt(null), r = Fe((n) => {
|
|
2342
2385
|
const o = n instanceof Error ? n : new Error(n);
|
|
2343
2386
|
t(o);
|
|
2344
2387
|
}, []);
|
|
@@ -2346,7 +2389,7 @@ function Qn() {
|
|
|
2346
2389
|
throw e;
|
|
2347
2390
|
return r;
|
|
2348
2391
|
}
|
|
2349
|
-
function
|
|
2392
|
+
function ta({
|
|
2350
2393
|
url: e,
|
|
2351
2394
|
containerId: t,
|
|
2352
2395
|
mode: r = "iframe",
|
|
@@ -2354,7 +2397,7 @@ function ea({
|
|
|
2354
2397
|
onError: o,
|
|
2355
2398
|
onLoad: i
|
|
2356
2399
|
}) {
|
|
2357
|
-
const s = Ie(null), c =
|
|
2400
|
+
const s = Ie(null), c = ea();
|
|
2358
2401
|
async function l(u) {
|
|
2359
2402
|
try {
|
|
2360
2403
|
const p = await fetch(u, {
|
|
@@ -2390,20 +2433,20 @@ function ea({
|
|
|
2390
2433
|
}
|
|
2391
2434
|
);
|
|
2392
2435
|
}
|
|
2393
|
-
function
|
|
2394
|
-
return /* @__PURE__ */ E.jsx(
|
|
2436
|
+
function ra({ apps: e }) {
|
|
2437
|
+
return /* @__PURE__ */ E.jsx(Rn, { children: e.map((t) => {
|
|
2395
2438
|
const r = t.active_rule ? t.active_rule : `/${t.name}/*`, n = t.active_rule || `/app/${t.name}`;
|
|
2396
2439
|
return /* @__PURE__ */ E.jsx(
|
|
2397
|
-
|
|
2440
|
+
Yt,
|
|
2398
2441
|
{
|
|
2399
2442
|
path: r,
|
|
2400
2443
|
element: /* @__PURE__ */ E.jsx(
|
|
2401
|
-
|
|
2444
|
+
Xn,
|
|
2402
2445
|
{
|
|
2403
2446
|
appName: t.name,
|
|
2404
2447
|
appPath: n,
|
|
2405
|
-
children: /* @__PURE__ */ E.jsx(
|
|
2406
|
-
|
|
2448
|
+
children: /* @__PURE__ */ E.jsx(Qn, { appName: t.name, children: /* @__PURE__ */ E.jsx(
|
|
2449
|
+
Cr,
|
|
2407
2450
|
{
|
|
2408
2451
|
fallback: /* @__PURE__ */ E.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ E.jsx("div", { className: "text-center", children: /* @__PURE__ */ E.jsxs("p", { className: "mt-4 text-gray-600", children: [
|
|
2409
2452
|
"正在加载 ",
|
|
@@ -2417,7 +2460,7 @@ function ta({ apps: e }) {
|
|
|
2417
2460
|
"data-micro-app": t.name,
|
|
2418
2461
|
className: "micro-app-container w-full h-full flex-1",
|
|
2419
2462
|
children: t.entry && /* @__PURE__ */ E.jsx(
|
|
2420
|
-
|
|
2463
|
+
ta,
|
|
2421
2464
|
{
|
|
2422
2465
|
url: t.entry,
|
|
2423
2466
|
containerId: t.container.replace("#", ""),
|
|
@@ -2435,10 +2478,10 @@ function ta({ apps: e }) {
|
|
|
2435
2478
|
);
|
|
2436
2479
|
}) });
|
|
2437
2480
|
}
|
|
2438
|
-
function
|
|
2481
|
+
function na(e) {
|
|
2439
2482
|
return e.active_rule ? e.active_rule : `/${e.name}/*`;
|
|
2440
2483
|
}
|
|
2441
|
-
function
|
|
2484
|
+
function aa({
|
|
2442
2485
|
apps: e,
|
|
2443
2486
|
activeApp: t,
|
|
2444
2487
|
onError: r,
|
|
@@ -2446,9 +2489,9 @@ function na({
|
|
|
2446
2489
|
onLoad: o,
|
|
2447
2490
|
children: i
|
|
2448
2491
|
}) {
|
|
2449
|
-
const s =
|
|
2492
|
+
const s = $t(), c = Ie(/* @__PURE__ */ new Set()), l = Ie({ onError: r, onStatusChange: n, onLoad: o });
|
|
2450
2493
|
l.current = { onError: r, onStatusChange: n, onLoad: o };
|
|
2451
|
-
const u =
|
|
2494
|
+
const u = Sr(() => Dt({
|
|
2452
2495
|
apps: e,
|
|
2453
2496
|
onError: l.current.onError,
|
|
2454
2497
|
onStatusChange: (f, m) => {
|
|
@@ -2461,7 +2504,7 @@ function na({
|
|
|
2461
2504
|
if (!t) return;
|
|
2462
2505
|
const p = e.find((w) => w.name === t);
|
|
2463
2506
|
if (!p) return;
|
|
2464
|
-
const f =
|
|
2507
|
+
const f = na(p);
|
|
2465
2508
|
s(f);
|
|
2466
2509
|
const m = () => {
|
|
2467
2510
|
if (!document.querySelector(p.container)) {
|
|
@@ -2474,14 +2517,14 @@ function na({
|
|
|
2474
2517
|
w.name !== t && c.current.has(w.name) && (u.stopApp(w.name), c.current.delete(w.name));
|
|
2475
2518
|
});
|
|
2476
2519
|
}, [t, e, u, s]), /* @__PURE__ */ E.jsxs("div", { className: "micro-app-wrapper", children: [
|
|
2477
|
-
/* @__PURE__ */ E.jsx(
|
|
2520
|
+
/* @__PURE__ */ E.jsx(ra, { apps: e }),
|
|
2478
2521
|
i
|
|
2479
2522
|
] });
|
|
2480
2523
|
}
|
|
2481
|
-
function
|
|
2482
|
-
return /* @__PURE__ */ E.jsx(
|
|
2524
|
+
function ua(e) {
|
|
2525
|
+
return /* @__PURE__ */ E.jsx(Vn, { children: /* @__PURE__ */ E.jsx(aa, { ...e }) });
|
|
2483
2526
|
}
|
|
2484
|
-
class
|
|
2527
|
+
class ca extends jt {
|
|
2485
2528
|
constructor(r) {
|
|
2486
2529
|
super(r);
|
|
2487
2530
|
I(this, "handleRetry", () => {
|
|
@@ -2517,10 +2560,12 @@ class la extends jt {
|
|
|
2517
2560
|
] }) }) : this.props.children;
|
|
2518
2561
|
}
|
|
2519
2562
|
}
|
|
2520
|
-
const
|
|
2563
|
+
const fa = "1.0.0";
|
|
2521
2564
|
export {
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2565
|
+
ca as ErrorBoundary,
|
|
2566
|
+
ua as MicroApp,
|
|
2567
|
+
Dt as createMicroApp,
|
|
2568
|
+
Or as mountMicroApp,
|
|
2569
|
+
la as mountMicroApps,
|
|
2570
|
+
fa as version
|
|
2526
2571
|
};
|