@real-router/core 0.154.0 → 0.155.1
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 +8 -8
- package/dist/cjs/Router-ewvQ-TrA.js +2 -0
- package/dist/cjs/Router-ewvQ-TrA.js.map +1 -0
- package/dist/cjs/Router.d.ts +0 -2
- package/dist/cjs/Router.d.ts.map +1 -1
- package/dist/cjs/RouterError.d.ts +0 -2
- package/dist/cjs/RouterError.d.ts.map +1 -1
- package/dist/cjs/api/cloneRouter.d.ts +0 -2
- package/dist/cjs/api/cloneRouter.d.ts.map +1 -1
- package/dist/cjs/api/getDependenciesApi.d.ts +0 -2
- package/dist/cjs/api/getDependenciesApi.d.ts.map +1 -1
- package/dist/cjs/api/getLifecycleApi.d.ts +0 -2
- package/dist/cjs/api/getLifecycleApi.d.ts.map +1 -1
- package/dist/cjs/api/getPluginApi.d.ts +0 -2
- package/dist/cjs/api/getPluginApi.d.ts.map +1 -1
- package/dist/cjs/api/getRoutesApi.d.ts +0 -2
- package/dist/cjs/api/getRoutesApi.d.ts.map +1 -1
- package/dist/cjs/api/types.d.ts +0 -2
- package/dist/cjs/api/types.d.ts.map +1 -1
- package/dist/cjs/api.js +1 -1
- package/dist/cjs/channels/guard.d.ts +0 -2
- package/dist/cjs/channels/guard.d.ts.map +1 -1
- package/dist/cjs/constants.d.ts +0 -2
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/createRouter.d.ts +0 -2
- package/dist/cjs/createRouter.d.ts.map +1 -1
- package/dist/cjs/dependenciesStore.d.ts +0 -2
- package/dist/cjs/dependenciesStore.d.ts.map +1 -1
- package/dist/cjs/engine/builder/types.d.ts +0 -2
- package/dist/cjs/engine/builder/types.d.ts.map +1 -1
- package/dist/cjs/engine/createMatcher.d.ts +0 -2
- package/dist/cjs/engine/createMatcher.d.ts.map +1 -1
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts +0 -2
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts.map +1 -1
- package/dist/cjs/engine/path-matcher/buildParamMeta.d.ts +0 -2
- package/dist/cjs/engine/path-matcher/buildParamMeta.d.ts.map +1 -1
- package/dist/cjs/engine/path-matcher/types.d.ts +0 -2
- package/dist/cjs/engine/path-matcher/types.d.ts.map +1 -1
- package/dist/cjs/engine/search-params/types.d.ts +0 -2
- package/dist/cjs/engine/search-params/types.d.ts.map +1 -1
- package/dist/cjs/engine/validation/route-batch.d.ts +0 -2
- package/dist/cjs/engine/validation/route-batch.d.ts.map +1 -1
- package/dist/cjs/getNavigator.d.ts +0 -2
- package/dist/cjs/getNavigator.d.ts.map +1 -1
- package/dist/cjs/helpers.d.ts +0 -2
- package/dist/cjs/helpers.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internals.d.ts +0 -2
- package/dist/cjs/internals.d.ts.map +1 -1
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts +0 -2
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts.map +1 -1
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts +0 -2
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts +0 -2
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts +0 -2
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +0 -2
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -1
- package/dist/cjs/pipeline/port.d.ts +0 -2
- package/dist/cjs/pipeline/port.d.ts.map +1 -1
- package/dist/cjs/types/RouterValidator.d.ts +0 -2
- package/dist/cjs/types/RouterValidator.d.ts.map +1 -1
- package/dist/cjs/types/api.d.ts +0 -2
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/base.d.ts +0 -2
- package/dist/cjs/types/base.d.ts.map +1 -1
- package/dist/cjs/types/constants.d.ts +0 -2
- package/dist/cjs/types/constants.d.ts.map +1 -1
- package/dist/cjs/types/internal.d.ts +0 -2
- package/dist/cjs/types/internal.d.ts.map +1 -1
- package/dist/cjs/types/limits.d.ts +0 -2
- package/dist/cjs/types/limits.d.ts.map +1 -1
- package/dist/cjs/types/route-node-types.d.ts +0 -2
- package/dist/cjs/types/route-node-types.d.ts.map +1 -1
- package/dist/cjs/types/router.d.ts +0 -2
- package/dist/cjs/types/router.d.ts.map +1 -1
- package/dist/cjs/types/tree-changed.d.ts +0 -2
- package/dist/cjs/types/tree-changed.d.ts.map +1 -1
- package/dist/cjs/types.d.ts +0 -2
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils/ingest.d.ts +0 -2
- package/dist/cjs/utils/ingest.d.ts.map +1 -1
- package/dist/esm/Router-_DZAf0c_.mjs +2 -0
- package/dist/esm/Router-_DZAf0c_.mjs.map +1 -0
- package/dist/esm/Router.d.mts +0 -2
- package/dist/esm/Router.d.mts.map +1 -1
- package/dist/esm/RouterError.d.mts +0 -2
- package/dist/esm/RouterError.d.mts.map +1 -1
- package/dist/esm/api/cloneRouter.d.mts +0 -2
- package/dist/esm/api/cloneRouter.d.mts.map +1 -1
- package/dist/esm/api/getDependenciesApi.d.mts +0 -2
- package/dist/esm/api/getDependenciesApi.d.mts.map +1 -1
- package/dist/esm/api/getLifecycleApi.d.mts +0 -2
- package/dist/esm/api/getLifecycleApi.d.mts.map +1 -1
- package/dist/esm/api/getPluginApi.d.mts +0 -2
- package/dist/esm/api/getPluginApi.d.mts.map +1 -1
- package/dist/esm/api/getRoutesApi.d.mts +0 -2
- package/dist/esm/api/getRoutesApi.d.mts.map +1 -1
- package/dist/esm/api/types.d.mts +0 -2
- package/dist/esm/api/types.d.mts.map +1 -1
- package/dist/esm/api.mjs +1 -1
- package/dist/esm/channels/guard.d.mts +0 -2
- package/dist/esm/channels/guard.d.mts.map +1 -1
- package/dist/esm/constants.d.mts +0 -2
- package/dist/esm/constants.d.mts.map +1 -1
- package/dist/esm/createRouter.d.mts +0 -2
- package/dist/esm/createRouter.d.mts.map +1 -1
- package/dist/esm/dependenciesStore.d.mts +0 -2
- package/dist/esm/dependenciesStore.d.mts.map +1 -1
- package/dist/esm/engine/builder/types.d.mts +0 -2
- package/dist/esm/engine/builder/types.d.mts.map +1 -1
- package/dist/esm/engine/createMatcher.d.mts +0 -2
- package/dist/esm/engine/createMatcher.d.mts.map +1 -1
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts +0 -2
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts.map +1 -1
- package/dist/esm/engine/path-matcher/buildParamMeta.d.mts +0 -2
- package/dist/esm/engine/path-matcher/buildParamMeta.d.mts.map +1 -1
- package/dist/esm/engine/path-matcher/types.d.mts +0 -2
- package/dist/esm/engine/path-matcher/types.d.mts.map +1 -1
- package/dist/esm/engine/search-params/types.d.mts +0 -2
- package/dist/esm/engine/search-params/types.d.mts.map +1 -1
- package/dist/esm/engine/validation/route-batch.d.mts +0 -2
- package/dist/esm/engine/validation/route-batch.d.mts.map +1 -1
- package/dist/esm/getNavigator.d.mts +0 -2
- package/dist/esm/getNavigator.d.mts.map +1 -1
- package/dist/esm/helpers.d.mts +0 -2
- package/dist/esm/helpers.d.mts.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internals.d.mts +0 -2
- package/dist/esm/internals.d.mts.map +1 -1
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts +0 -2
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts.map +1 -1
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts +0 -2
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts +0 -2
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts +0 -2
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts +0 -2
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -1
- package/dist/esm/pipeline/port.d.mts +0 -2
- package/dist/esm/pipeline/port.d.mts.map +1 -1
- package/dist/esm/types/RouterValidator.d.mts +0 -2
- package/dist/esm/types/RouterValidator.d.mts.map +1 -1
- package/dist/esm/types/api.d.mts +0 -2
- package/dist/esm/types/api.d.mts.map +1 -1
- package/dist/esm/types/base.d.mts +0 -2
- package/dist/esm/types/base.d.mts.map +1 -1
- package/dist/esm/types/constants.d.mts +0 -2
- package/dist/esm/types/constants.d.mts.map +1 -1
- package/dist/esm/types/internal.d.mts +0 -2
- package/dist/esm/types/internal.d.mts.map +1 -1
- package/dist/esm/types/limits.d.mts +0 -2
- package/dist/esm/types/limits.d.mts.map +1 -1
- package/dist/esm/types/route-node-types.d.mts +0 -2
- package/dist/esm/types/route-node-types.d.mts.map +1 -1
- package/dist/esm/types/router.d.mts +0 -2
- package/dist/esm/types/router.d.mts.map +1 -1
- package/dist/esm/types/tree-changed.d.mts +0 -2
- package/dist/esm/types/tree-changed.d.mts.map +1 -1
- package/dist/esm/types.d.mts +0 -2
- package/dist/esm/types.d.mts.map +1 -1
- package/dist/esm/utils/ingest.d.mts +0 -2
- package/dist/esm/utils/ingest.d.mts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/Router-C2Q3JreA.js +0 -2
- package/dist/cjs/Router-C2Q3JreA.js.map +0 -1
- package/dist/esm/Router-B6jYUVPG.mjs +0 -2
- package/dist/esm/Router-B6jYUVPG.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterValidator.d.ts","names":[],"sources":["../../../src/types/RouterValidator.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RouterValidator.d.ts","names":[],"sources":["../../../src/types/RouterValidator.ts"],"mappings":";;;;;;;;;;;;iBAaiB;;;;EAIf;IACE,wBAAwB,gBAAgB;IACxC,wBAAwB;IACxB,4BACE,eACA,iBACA,iBACA;IAEF,+BAA+B;IAC/B,2BACE,eACA,iBACA;;;;;;;;;;;;;IAcF,oBAAoB,eAAe;IACnC,0BAA0B;;;;;EAM5B;IACE,kBAAkB,kBAAkB;;IAEpC,+BAA+B;;;;;EAMjC;IACE,yBAAyB,eAAe;IACxC,4BACE,eACA,gBACA;IAEF,6BAA6B,eAAe;;;;;;IAM5C,2BAA2B,cAAc;;;;;;;;;;IAUzC,0BACE,sBACA,yBACA;IAEF,oBAAoB;IACpB,gBAAgB,cAAc;IAC9B,qBAAqB,gBAAgB;IACrC,wBAAwB;;;;;EAM1B;IACE,sBAAsB,eAAe;IACrC,6BACE,kBACA;IAEF,qBAAqB;IACrB,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;;;;;EAMzB;IACE,uBAAuB,eAAe;IACtC,0BAA0B,eAAe;IACzC,gBAAgB,cAAc,cAAc;IAC5C,qBAAqB,cAAc;;;;;;IAMnC,0BACE,cACA,iBACA;;;;;;IAOF,sBAAsB,cAAc;;;;;EAMtC;IACE,gCAAgC;IAChC,8BAA8B;IAC9B,4BAA4B,kBAAkB;;;;;;;;IAQ9C,sBAAsB,iBAAiB;;;;;;;;IAQvC,iBAAiB,iBAAiB;IAClC,oBAAoB;;;;;EAMtB;IACE,wBACE,eACA,iBACA;IAEF,6BACE,aACA,aACA;;;;;;;;;;;;IAaF,wBAAwB,mBAAmB;;IAG3C,2BAA2B,mBAAmB;;;;;EAMhD;IACE,uBAAuB,eAAe;IACtC,0BACE,eACA,mBACA"}
|
package/dist/cjs/types/api.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { AdoptedOrigins, AnyOptions, DefaultDependencies, GuardFnFactory, Plugin
|
|
|
4
4
|
import { EventMethodMap, EventName } from "./constants.js";
|
|
5
5
|
import { TreeChangedEvent } from "./tree-changed.js";
|
|
6
6
|
import { NavigationOptions, StateContext } from "../types.js";
|
|
7
|
-
//#region src/types/api.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Maps interceptable method names to their signatures.
|
|
10
9
|
* Used by {@link PluginApi.addInterceptor} to provide type-safe interceptor registration.
|
|
@@ -541,5 +540,4 @@ export interface LifecycleApi<Dependencies extends DefaultDependencies = Default
|
|
|
541
540
|
removeActivateGuard: (name: string) => void;
|
|
542
541
|
removeDeactivateGuard: (name: string) => void;
|
|
543
542
|
}
|
|
544
|
-
//#endregion
|
|
545
543
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/types/api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/types/api.ts"],"mappings":"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"}
|
package/dist/cjs/types/base.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StateContext } from "../types.js";
|
|
2
|
-
//#region src/types/base.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Detach function returned by subscription APIs.
|
|
5
4
|
*
|
|
@@ -168,5 +167,4 @@ export type SearchParamValue = SearchParamPrimitive | SearchParamPrimitive[];
|
|
|
168
167
|
* `State.search` without conversion.
|
|
169
168
|
*/
|
|
170
169
|
export type SearchParams = Record<string, SearchParamValue | undefined>;
|
|
171
|
-
//#endregion
|
|
172
170
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../../../src/types/base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../../src/types/base.ts"],"mappings":";;;;;;;;;;YAmBY;iBAEK,YACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,QAAQ;;;;;;EAMR,QAAQ;;YAGE;YAEA;iBAEK;EACf,OAAO;EACP,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;;;iBAIa,MACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,QAAQ;;;;;;EAMR,QAAQ;EACR;;;;;;;;;;;;;;;;;;;;;;EAsBA,YAAY;;;;;;;;;;;;;;;;;;;;;EAqBZ,SAAS,eAAe;;;;;;;;;;iBAWT,iBACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,SAAS;EACT,SAAS;;;;;;;;;;;;;;;;iBAiBM,aACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB,QAAQ;EACR,QAAQ;;;;;;;;;YAUE,sBAAsB,UAAU,SAAS,UAAU,KAC7D,MAAM;;;;;;iBASS,oBAAoB;GAClC;WACQ;WACA;WACA;EACT,UAAU;EACV,mBAAmB,KAAK;EACxB,sBAAsB,QAAQ;EAC9B,WAAW;EACX,WAAW;EACX,cAAc;;iBAGC;GACd,4EAOG,SACA,WACA;;;;;;;YAUM;;;;YAKA,mBAAmB,uBAAuB;;;;;;;;;YAU1C,eAAe,eAAe"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/constants.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Plugin lifecycle method names
|
|
4
3
|
*/
|
|
@@ -69,5 +68,4 @@ export interface ErrorCodeToValueMap {
|
|
|
69
68
|
readonly REENTRANT_TREE_MUTATION: "REENTRANT_TREE_MUTATION";
|
|
70
69
|
readonly WRONG_CHANNEL: "WRONG_CHANNEL";
|
|
71
70
|
}
|
|
72
|
-
//#endregion
|
|
73
71
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/types/constants.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/types/constants.ts"],"mappings":";;;YAGY;;;;YAYA;;;;YAYA;;;;YAYA;;;;YAiBA;;;;iBAoBK;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;iBAMM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;YAOC,oBACT,KAAK,cAAc,eAAe,KAAK,iBAAiB;;;;iBAM1C;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","names":[],"sources":["../../../src/types/internal.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","names":[],"sources":["../../../src/types/internal.ts"],"mappings":";;;;YAyDY,SAAS,SAAS"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/limits.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Configuration for router resource limits.
|
|
4
3
|
* Controls maximum allowed values for various router operations to prevent resource exhaustion.
|
|
@@ -40,5 +39,4 @@ export interface LimitsConfig {
|
|
|
40
39
|
*/
|
|
41
40
|
maxLifecycleHandlers: number;
|
|
42
41
|
}
|
|
43
|
-
//#endregion
|
|
44
42
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../../src/types/limits.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../../src/types/limits.ts"],"mappings":";;;;iBAIiB;;;;;;;EAOf;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ArrayFormat, BooleanFormat, NullFormat, NumberFormat } from "../engine/search-params/types.js";
|
|
2
|
-
//#region src/types/route-node-types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Options for query parameter parsing and building.
|
|
5
4
|
*/
|
|
@@ -27,6 +26,5 @@ export interface RouteTreeState<P extends Record<string, unknown> = RouteParams>
|
|
|
27
26
|
params: P;
|
|
28
27
|
meta: RouteTreeStateMeta;
|
|
29
28
|
}
|
|
30
|
-
//#endregion
|
|
31
29
|
export {};
|
|
32
30
|
//# sourceMappingURL=route-node-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-node-types.d.ts","names":[],"sources":["../../../src/types/route-node-types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-node-types.d.ts","names":[],"sources":["../../../src/types/route-node-types.ts"],"mappings":";;;;iBAwBiB;EACf,cAAc;EACd,gBAAgB;EAChB,aAAa;EACb,eAAe;;;;;YAUL;KAMP;KACA,eAAe,eAAe;KAC9B,qBAAqB,eAAe;iBAExB;GACd,4EAOG,cACA,gBACA;;;;;iBAQW,eACf,UAAU,0BAA0B;EAEpC;EACA,QAAQ;EACR,MAAM"}
|
|
@@ -2,7 +2,6 @@ import { QueryParamsMode, QueryParamsOptions } from "./route-node-types.js";
|
|
|
2
2
|
import { NavigationTarget, Params, ParamsSearch, RouterError, SearchParams, State, Unsubscribe } from "./base.js";
|
|
3
3
|
import { LimitsConfig } from "./limits.js";
|
|
4
4
|
import { NavigationOptions } from "../types.js";
|
|
5
|
-
//#region src/types/router.d.ts
|
|
6
5
|
export type LogLevel = "log" | "warn" | "error";
|
|
7
6
|
export type LogLevelConfig = "all" | "warn-error" | "error-only" | "none";
|
|
8
7
|
export type LogCallback = (level: LogLevel, context: string, message: string, ...args: unknown[]) => void;
|
|
@@ -443,6 +442,5 @@ export interface RouteConfigUpdate<Dependencies extends DefaultDependencies = De
|
|
|
443
442
|
/** Set to null to remove canDeactivate */
|
|
444
443
|
canDeactivate?: GuardFnFactory<Dependencies> | null;
|
|
445
444
|
}
|
|
446
|
-
//#endregion
|
|
447
445
|
export {};
|
|
448
446
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","names":[],"sources":["../../../src/types/router.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"router.d.ts","names":[],"sources":["../../../src/types/router.ts"],"mappings":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DefaultDependencies, ReadonlyRoute, RouteConfigUpdate } from "./router.js";
|
|
2
|
-
//#region src/types/tree-changed.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The subset of {@link RouteConfigUpdate} fields that count as **structural**
|
|
5
4
|
* changes — the only ones that emit `TREE_CHANGED` from `update()`.
|
|
@@ -131,5 +130,4 @@ export interface TreeChangedRootPath {
|
|
|
131
130
|
* this is the mutation that restales all of them at once.
|
|
132
131
|
*/
|
|
133
132
|
export type TreeChangedEvent<Dependencies extends DefaultDependencies = DefaultDependencies> = TreeChangedAdd<Dependencies> | TreeChangedRemove<Dependencies> | TreeChangedUpdate<Dependencies> | TreeChangedReplace<Dependencies> | TreeChangedRootPath | TreeChangedClear<Dependencies>;
|
|
134
|
-
//#endregion
|
|
135
133
|
//# sourceMappingURL=tree-changed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-changed.d.ts","names":[],"sources":["../../../src/types/tree-changed.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree-changed.d.ts","names":[],"sources":["../../../src/types/tree-changed.ts"],"mappings":";;;;;;;;;YA0BY,oBACV,qBAAqB,sBAAsB,uBACzC,KACF,kBAAkB;iBAQH,eACf,qBAAqB,sBAAsB;WAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAgCA,gBAAgB,cAAc;;WAE9B;;iBAGM,kBACf,qBAAqB,sBAAsB;WAElC;WACA;;;;;;;;;;;;WAYA,yBAAyB,cAAc;;iBAGjC,kBACf,qBAAqB,sBAAsB;WAElC;WACA;;;;;;;;;;;WAWA,OAAO,SAAS,oBAAoB;;iBAG9B,mBACf,qBAAqB,sBAAsB;WAElC;;;;;;;;WAQA,kBAAkB,cAAc;;;;;;;;WAQhC,gBAAgB,cAAc;;iBAGxB,iBACf,qBAAqB,sBAAsB;WAElC;;;;;;;;;;WAUA,kBAAkB,cAAc;;iBAG1B;WACN;;WAEA;;WAEA;;;;;;;;;;;;;;;;YAiBC,iBACV,qBAAqB,sBAAsB,uBAEzC,eAAe,gBACf,kBAAkB,gBAClB,kBAAkB,gBAClB,mBAAmB,gBACnB,sBACA,iBAAiB"}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { AdoptedOrigins, AnyOptions, DefaultDependencies, DefaultParamsCallback,
|
|
|
5
5
|
import { ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, PluginMethod } from "./types/constants.js";
|
|
6
6
|
import { TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch } from "./types/tree-changed.js";
|
|
7
7
|
import { CheckFn, CheckPositionMap, ContextNamespaceClaim, DependenciesApi, DiagnosticEventMap, InterceptableMethodMap, InterceptorFn, LifecycleApi, PluginApi, RoutesApi } from "./types/api.js";
|
|
8
|
-
//#region src/types/index.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Empty interface extended by plugins via module augmentation to declare
|
|
11
10
|
* typed `state.context.<namespace>` fields.
|
|
@@ -240,6 +239,5 @@ export interface NavigationOptions {
|
|
|
240
239
|
*/
|
|
241
240
|
signal?: AbortSignal | undefined;
|
|
242
241
|
}
|
|
243
|
-
//#endregion
|
|
244
242
|
export type { AdoptedOrigins, AnyOptions, CheckFn, CheckPositionMap, ContextNamespaceClaim, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DefaultSearchCallback, DependenciesApi, DiagnosticEventMap, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, ForwardToCallback, GuardFn, GuardFnFactory, InterceptableMethodMap, InterceptorFn, LeaveFn, LeaveState, LifecycleApi, LimitsConfig, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, NavigationTarget, Navigator, Options, Params, ParamsSearch, Plugin, PluginApi, PluginFactory, PluginMethod, QueryParamsMode, QueryParamsOptions, ReadonlyRoute, Route, RouteConfigUpdate, RouteParams, RouteTreeState, Router, RouterError, RouterLogger, RoutesApi, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, SubscribeFn, SubscribeState, Subscription, TransitionMeta, TransitionPhase, TransitionReason, TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch, Unsubscribe };
|
|
245
243
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DiB;;;;;;;;;;;;;;iBAeA;;;;;;;;;;;;;;;;;EAiBf;;;;;;;;;;;;;;;EAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;EAYA,SAAS"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/ingest.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Write one field of a record core BUILDS under a key it did not choose.
|
|
4
3
|
*
|
|
@@ -200,5 +199,4 @@ export declare function putField<V>(target: Record<string, V>, key: string, valu
|
|
|
200
199
|
* internal split `helpers.ts` records as the #1792 defect.
|
|
201
200
|
*/
|
|
202
201
|
export declare function copyFields<V>(target: Record<string, V>, source: Record<string, V>): void;
|
|
203
|
-
//#endregion
|
|
204
202
|
//# sourceMappingURL=ingest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.d.ts","names":[],"sources":["../../../src/utils/ingest.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ingest.d.ts","names":[],"sources":["../../../src/utils/ingest.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4UgB,SAAS,GACvB,QAAQ,eAAe,IACvB,aACA,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiDO,WAAW,GACzB,QAAQ,eAAe,IACvB,QAAQ,eAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _,x as v,y}from"./RouterError-DyPeuufj.mjs";import{C as b,S as x,_ as S,a as ee,b as te,c as C,d as ne,g as re,h as ie,i as ae,l as oe,m as se,n as w,o as T,p as ce,r as E,s as le,t as ue,u as de,v as fe,w as pe,x as me,y as he}from"./internals-D-5hS0qt.mjs";import{_ as D,a as ge,c as _e,d as ve,f as ye,g as be,h as xe,i as Se,l as Ce,m as we,n as Te,o as O,p as k,r as Ee,s as De,t as A,u as Oe}from"./helpers-BXXeSrT8.mjs";const ke=Object.entries,Ae=Object.hasOwn;function je(e,t,n){if(e===void 0||n.length===0)return e;let r,i=!1;for(let[a,o]of ke(e))Ae(t,a)&&t[a]!==void 0&&n.includes(a)?i=!0:(r??={},l(r,a,o));return r===void 0?i?void 0:e:r}function Me(e,t,n){for(let[r,i]of ke(e))me(n,r,i,t(r),"this route's `defaultParams`","Move it to `defaultSearch`")}const Ne=Object.entries,Pe=Object.freeze;function Fe(e,t,n){let r,i=!1;for(let[a,o]of Ne(e))t.includes(a)?(r??={},l(r,a,o)):(i=!0,n?.(a));return i?Pe(r??o):e}function Ie(e,t){let n=e.path,r=n.startsWith(`~`),i=r?n.slice(1):n,a=i!==``&&!i.startsWith(`/`)&&!i.startsWith(`?`)?`/${i}`:i,o={name:e.name,path:a,absolute:r,children:[],parent:t};if(e.children)for(let t of e.children){let e=Ie(t,o);o.children.push(e)}return o}function Le(e,t,n){let r=Ie({name:e,path:t},null);for(let e of n){let t=Ie(e,r);r.children.push(t)}return r}const Re=/[^\w!$'()*+,.:;|~-]/gu,ze=/[^\w!$'()*+,.:;|~-]/u,Be=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,Ve=e=>t=>{try{return e(t)}catch{return e(t.replaceAll(Be,`�`))}},He=Ve(e=>e.replaceAll(Re,e=>encodeURIComponent(e))),Ue={default:e=>ze.test(e)?He(e):e,uri:Ve(encodeURI),uriComponent:Ve(encodeURIComponent),none:e=>e},We={default:decodeURIComponent,uri:decodeURI,uriComponent:decodeURIComponent,none:e=>e},Ge={default:`%2F`,uri:`/`,uriComponent:`%2F`,none:`/`},Ke=(e,t)=>{let n=Ue[t],r=Ge[t],i=String(e).split(`/`),a=n(i[0]);for(let e=1;e<i.length;e++)a+=(i[e-1]===``?r:`/`)+n(i[e]);return a},qe=Object.freeze(Object.create(null));function Je(){return{staticChildren:qe,hasChildren:!1,paramChild:void 0,splatChild:void 0,route:void 0,slashChildRoute:void 0}}function j(e){return e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e}function Ye(e,t){return e===``?t:t===``?e:e.endsWith(`/`)&&t.startsWith(`/`)?e+t.slice(1):e+t}function Xe(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ze(e){let t=0;for(;t<e.length;)if(e.codePointAt(t)===37){if(t+2>=e.length)return!1;let n=e.codePointAt(t+1)??0,r=e.codePointAt(t+2)??0;if(!Xe(n)||!Xe(r))return!1;t+=3}else t++;return!0}const Qe=Object.freeze([]),$e=Object.freeze(new Set),et=Object.freeze([]),tt=Object.freeze({}),nt=Object.freeze({}),rt=Object.freeze({});function it(e,t){let n=e.kind===`splat`;return{paramName:e.name,encoder:n?e=>Ke(e,t):Ue[t]}}function at(e,t,n,r){let i=new Set(r);for(let e of t)for(let t of e.paramMeta.urlParams)i.add(t);if(i.size===0)return{buildStaticParts:[e],buildParamSlots:et};let a=[],o=[],s=``,c=te(e),l=c.length-1;for(let[e,t]of c.entries()){let r=he(t);(`error`in r||r.kind!==`splat`||e===l)&&(e>0&&(s+=`/`),`error`in r||r.kind===`static`?s+=t:(a.push(s),s=``,o.push(it(r,n))))}return a.push(s),{buildStaticParts:a,buildParamSlots:o}}const M=c(`router`);function ot(e,t,n){throw M.plain`Parameter name conflict at the same path position: '${n}${e}' and '${n}${t}'. One position binds one name across every route that shares it. Rename one — e.g. use '${n}${e}' in both.`}function st(){throw M.plain`Empty parameter name: a ':'/'*' marker must be followed by a name (e.g. ':id', '*rest'), and a segment cannot end in a bare '?'.`}function ct(e){throw M.plain`Fused parameter marker in segment "${e}": a ':'/'*' marker must begin a segment — write 'a/:b', not 'a:b'.`}function lt(e){throw M.plain`Trailing parameter marker in segment "${e}": a param name cannot end in a bare ':' or '*'. Drop the stray marker.`}function ut(e){throw M.plain`Optional params are not supported: "${e}" — declare two sibling routes instead, one with the segment and one without.`}function dt(e){throw M.plain`Regex constraints are not supported: '<' and '>' are reserved in path segments ("${e}"). Match it as a plain string and validate the value in a canActivate guard.`}function ft(e){throw M.plain`Non-ASCII static segment "${e}": match compares static keys raw and rejects non-ASCII input, so this route can never match. Percent-encode it (e.g. "/caf%C3%A9") or use a param.`}function pt(e,t){switch(e){case`name-less`:return st();case`trailing-marker`:return lt(t);case`fused-marker`:return ct(t);case`optional-removed`:return ut(t);case`constraint-removed`:return dt(t)}}function mt(e,t){let n=new Set,r=``;for(let e of t){if(n.has(e)){r=e;break}n.add(e)}throw M.plain`Duplicate parameter name '${r}' in route "${e}": a name must be unique within a route — the second position overwrites the first. Rename one.`}function ht(e,t){throw M.plain`Invalid query-param declaration "${t}" in route "${e}": a query-param name cannot contain '<' or '>'. Rename it.`}function gt(e){throw M.plain`Double slashes are not allowed in path "${e}": the route would build a URL its own matcher refuses. Remove the empty segment.`}function _t(e,t){throw M.plain`Duplicate route path: routes "${e}" and "${t}" resolve to the same URL — the later would shadow the earlier. Give them distinct paths.`}function vt(e,t){throw M.plain`Index route "${e}" (path "/") under the splat parent "${t}" is unreachable: the wildcard match never reaches the index node. Give the index a distinct path, or make the parent static.`}function yt(e,t){return e.paramChild?e.paramChild.name!==t&&ot(e.paramChild.name,t,`:`):e.paramChild={node:Je(),name:t},e.paramChild.node}function bt(e,t){return e.splatChild?e.splatChild.name!==t&&ot(e.splatChild.name,t,`*`):e.splatChild={node:Je(),name:t},e.splatChild.node}const xt=Object.create;function St(e,t){e.route!==void 0&&e.route!==t&&_t(e.route.name,t.name),e.route=t}function Ct(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>=128)return!0;return!1}function wt(e,t,n){let r=j(n);r===`/`?St(e.root,t):Tt(e,e.root,r,1,t)}function Tt(e,t,n,r,i){let a=n.length;for(;r<=a;){let i=n.indexOf(`/`,r),o=i===-1?a:i,s=n.slice(r,o);t=kt(e,t,s),r=o+1}St(t,i)}function Et(e,t,n){let r=n.length;for(;r>1&&n.codePointAt(r-1)===47;)--r;let i=n.slice(0,r);i.slice(i.lastIndexOf(`/`)+1).startsWith(`*`)&&vt(t.name,n);let a=Dt(e,n);a.slashChildRoute=t}function Dt(e,t){return Ot(e,e.root,t)}function Ot(e,t,n){let r=j(n);if(r===`/`||r===``)return t;let i=t,a=1,o=r.length;for(;a<=o;){let t=r.indexOf(`/`,a),n=t===-1?o:t;if(n<=a)break;let s=r.slice(a,n);i=kt(e,i,s),a=n+1}return i}function kt(e,t,n){let r=he(n);if(`error`in r&&st(),r.kind===`splat`){let e=bt(t,r.name);return t.hasChildren=!0,e}if(r.kind===`param`){let e=yt(t,r.name);return t.hasChildren=!0,e}Ct(n)&&ft(n);let i=e.options.caseSensitive?n:n.toLowerCase();return i in t.staticChildren||(t.staticChildren===qe&&(t.staticChildren=xt(null)),t.staticChildren[i]=Je(),t.hasChildren=!0),t.staticChildren[i]}const At=Object.freeze,jt=Object.hasOwn;function Mt(e){let t=te(e);for(let[n,r]of t.entries())r===``&&n>0&&n<t.length-1&>(e)}function Nt(e){for(let t of te(e)){let e=he(t);`error`in e&&pt(e.error,t)}}function Pt(e,t,n,r,i){let a=t.fullName===``;a||r.push(t);let o=t.absolute,s=t.paramMeta===re?t.path:t.paramMeta.pathPattern,c=o&&s.startsWith(`~`)?s.slice(1):s,l=o?c:s;Mt(t.path),Nt(l);let u=l,d=o?u:Ye(n,u),f=a?i:Ft(e,t,d,o?``:n,r,i);for(let n of t.children.values())Pt(e,n,d,r,f);a||r.pop()}function Ft(e,t,n,r,i,a){let o=Bt(n,r),s=At([...i]),c=It(s),l=j(n),u=At(Vt(e.rootQueryParams,i)),{buildStaticParts:d,buildParamSlots:f}=at(o?j(r):l,o?i.slice(0,-1):i,e.options.urlParamsEncoding,e.rootUrlParams),p=f.map(e=>e.paramName),m=p.length===0?$e:new Set(p);m.size!==p.length&&mt(t.fullName,p),Ht(t.fullName,u);let h={name:t.fullName,parent:a,matchSegments:s,meta:c,declaredQueryParams:u,declaredQueryParamsSet:u.length===0?$e:new Set(u),hasTrailingSlash:n.length>1&&n.endsWith(`/`),buildStaticParts:d,buildParamSlots:f,buildParamNamesSet:m,cachedResult:void 0};return t.paramMeta.urlParams.length===0&&(h.cachedResult=At({segments:h.matchSegments,params:tt,search:nt,meta:h.meta})),e.routesByName.set(t.fullName,h),o?Rt(e,h,r):zt(e,h,n,l,t),h}function It(e){let n;for(let t of e)Lt(t.paramTypeMap)&&(n??=h(),n[t.fullName]=t.paramTypeMap);return n===void 0?rt:At(t(r(n)))}function Lt(e){for(let t in e)if(jt(e,t))return!0;return!1}function Rt(e,t,n){Et(e,t,n);let r=j(n),i=e.options.caseSensitive?r:r.toLowerCase();e.staticCache.has(i)&&e.staticCache.set(i,t)}function zt(e,t,n,r,i){if(wt(e,t,n),i.paramMeta.urlParams.length===0){let n=e.options.caseSensitive?r:r.toLowerCase();e.staticCache.set(n,t)}}function Bt(e,t){return j(e)===j(t)}function Vt(e,t){let n=[];e.length>0&&n.push(...e);for(let e of t)e.paramMeta.queryParams.length>0&&n.push(...e.paramMeta.queryParams);return n.length===0?Qe:n}function Ht(e,t){for(let n of t)S.test(n)&&ht(e,n)}const Ut=c(`router`,`buildPath`),Wt=Symbol.for(`real-router.searchParams.configFault`),Gt=Object.hasOwn,Kt=Object.keys,qt=Object.getOwnPropertyDescriptor;function Jt(e){try{return qt(e,Wt)?.configurable===!1}catch{return!1}}function Yt(e){return typeof e==`string`?e:typeof e==`object`?JSON.stringify(e):String(e)}const Xt=Object.freeze({});function Zt(e,t){return e===`strict`?t?`always`:`never`:e}var Qt=class{get options(){return this.#e}#e;#t=Je();#n=new Map;#r=new Map;#i={cleanPath:``,normalized:``,queryString:void 0};#a=[];#o=``;#s;#c;constructor(e){let t=e.urlParamsEncoding??`default`,n=typeof t==`string`?t:String(t),r=Gt(Ue,n)?n:`default`;this.#e={caseSensitive:e.caseSensitive??!0,strictTrailingSlash:e.strictTrailingSlash??!1,strictQueryParams:e.strictQueryParams??!1,urlParamsEncoding:r,parseQueryString:e.parseQueryString,buildQueryString:e.buildQueryString},this.#s=this.#e.caseSensitive,this.#c=this.#e.urlParamsEncoding===`none`?null:We[this.#e.urlParamsEncoding]}registerTree(e){this.#a=e.paramMeta.queryParams,Pt({root:this.#t,options:this.#e,routesByName:this.#n,staticCache:this.#r,rootQueryParams:this.#a,rootUrlParams:e.paramMeta.urlParams},e,``,[],null)}match(e){if(!this.#f(e))return;let{cleanPath:t,normalized:n,queryString:r}=this.#i,i=this.#s?n:n.toLowerCase(),a=this.#r.get(i);if(a)return this.#e.strictTrailingSlash&&!this.#g(t,a)?void 0:r===void 0&&a.cachedResult?a.cachedResult:this.#m(a,{},r);let o={},s=this.#_(n,o);if(s&&(!this.#e.strictTrailingSlash||this.#g(t,s))&&this.#b(o))return this.#m(s,o,r)}buildPath(e,t,n,r){let i=this.#n.get(e);if(!i)throw Ut.plain`'${e}' is not defined`;let a=this.#l(i,t),o=this.#u(a,Zt(r?.trailingSlash,i.hasTrailingSlash)),s=this.#d(i,n??t,r?.queryParamsMode);return o+(s?`?${s}`:``)}getSegmentsByName(e){return this.#n.get(e)?.matchSegments}getMetaByName(e){return this.#n.get(e)?.meta}getDeclaredQueryParams(e){return this.#n.get(e)?.declaredQueryParams}hasRoute(e){return this.#n.has(e)}#l(e,t){let n=e.buildStaticParts,r=e.buildParamSlots;if(r.length===0)return n[0];let i=n[0];for(let[e,a]of r.entries()){let r=t!=null&&Gt(t,a.paramName)?t[a.paramName]:void 0;if(r==null)throw Ut.plain`Missing required param '${a.paramName}'`;if(r===``)throw Ut.plain`Missing required param '${a.paramName}' (empty string)`;let o=a.encoder(Yt(r));i+=o+n[e+1]}return i}#u(e,t){return t===`always`&&!e.endsWith(`/`)?`${e}/`:t===`never`&&e!==`/`&&e.endsWith(`/`)?e.slice(0,-1):e}#d(e,t,n){if(!t||e.declaredQueryParams.length===0&&n!==`loose`)return``;let r={},i=!1;for(let n of e.declaredQueryParams)Gt(t,n)&&(l(r,n,t[n]),i=!0);if(n===`loose`)for(let n of Kt(t))e.declaredQueryParamsSet.has(n)||e.buildParamNamesSet.has(n)||(l(r,n,t[n]),i=!0);return i?this.#e.buildQueryString(r):``}#f(e){if(e===``&&(e=`/`),e.codePointAt(0)!==47)return!1;let t=this.#p(e);if(t===-2)return!1;t===-3&&(e=this.#o);let n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):void 0;if(r!==void 0){let e=r.indexOf(`#`);e!==-1&&(r=r.slice(0,e))}let i=j(n);return this.#i.cleanPath=n,this.#i.normalized=i,this.#i.queryString=r,!0}#p(e){let t=!1;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);if(r===35)return this.#o=e.slice(0,n),-3;if(r===63)return n;if(r>=128)return-2;if(r===47){if(t)return-2;t=!0}else t=!1}return-1}#m(e,t,n){let r=Xt;if(n!==void 0){let t=this.#h(e,n);if(t===void 0)return;r=t}return{segments:e.matchSegments,params:t,search:r,meta:e.meta}}#h(e,t){let n;try{n=this.#e.parseQueryString(t)}catch(e){if(Jt(e))throw e;return}if(this.#e.strictQueryParams){let t=e.declaredQueryParamsSet;for(let e of Kt(n))if(!t.has(e))return}return n}#g(e,t){return(e.length>1&&e.endsWith(`/`))===t.hasTrailingSlash}#_(e,t){return e.length===1?this.#t.slashChildRoute??this.#t.route:this.#v(this.#t,e,1,t)}#v(e,t,n,r){let i=e,a=t.length,o=this.#s;for(;n<=a;){let e=t.indexOf(`/`,n),s=e===-1?a:e,c=t.slice(n,s),u=o?c:c.toLowerCase(),d;if(u in i.staticChildren){let e=i.staticChildren[u];if(i.splatChild!==void 0){let a={},o=this.#v(e,t,s+1,a);return o===void 0?this.#y(i.splatChild,t,n,r):(f(r,a),o)}d=e}else if(i.paramChild){let e=i.paramChild;if(i.splatChild!==void 0){let a={[e.name]:c},o=this.#v(e.node,t,s+1,a);return o===void 0?this.#y(i.splatChild,t,n,r):(f(r,a),o)}d=e.node,l(r,e.name,c)}else if(i.splatChild)return this.#y(i.splatChild,t,n,r);else return;i=d,n=s+1}return i.slashChildRoute??i.route}#y(e,t,n,r){let i=e.node;if(!i.hasChildren)return l(r,e.name,t.slice(n)),i.route;let a={},o=this.#v(i,t,n,a);return o?(f(r,a),o):(l(r,e.name,t.slice(n)),i.route)}#b(e){let t=this.#c;if(!t)return!0;for(let n of Kt(e)){let r=e[n];if(r.includes(`%`)){if(!Ze(r))return!1;try{e[n]=t(r)}catch{return!1}}}return!0}};const N=Object.freeze,$t=Object.freeze(new Map),en=Object.freeze([]);function tn(e){return e.parent?.name?`${e.parent.fullName}.${e.name}`:e.name}function nn(e){let t=new Map;for(let n of e)t.set(n.name,n);return t}function rn(e,t){let n=[],r=[];for(let i of e){let e=an(i,t);n.push(e),e.absolute||r.push(e)}return{childrenMap:nn(n),nonAbsoluteChildren:r}}function an(e,t){let n=fe(e.path),r=n.urlParams.length===0&&n.queryParams.length===0&&n.pathPattern===e.path?re:n,i=r.paramTypeMap,a={name:e.name,path:e.path,absolute:e.absolute,parent:t,children:void 0,paramMeta:r,nonAbsoluteChildren:void 0,fullName:``,paramTypeMap:i};if(a.fullName=tn(a),e.children.length===0)a.children=$t,a.nonAbsoluteChildren=en;else{let{childrenMap:t,nonAbsoluteChildren:n}=rn(e.children,a);a.children=t,a.nonAbsoluteChildren=n,N(a.nonAbsoluteChildren),N(a.children)}return N(i),N(r.urlParams),N(r.queryParams),N(r),N(a),a}function on(e){return an(e,null)}function sn(e,t,n){return on(Le(e,t,n))}function cn(e){let t=e.absolute?`~${e.path}`:e.path,n={name:e.name,path:t};return e.children.size>0&&l(n,`children`,Array.from(e.children.values(),cn)),n}function ln(e){return Array.from(e.children.values(),cn)}const un=e=>{let t=e.indexOf(`%`),n=e.indexOf(`+`);if(t===-1&&n===-1)return e;let r=n===-1?e:e.replaceAll(`+`,` `);return t===-1?r:decodeURIComponent(r)},dn=(e,t)=>{if(e===void 0)return t.boolean.decodeUndefined();let n=t.boolean.decodeRaw(e);if(n!==null)return n;let r=un(e),i=t.number.decode(r);return i===null?t.boolean.decodeValue(r):i},fn=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,pn=e=>{try{return encodeURIComponent(e)}catch(t){if(!(t instanceof URIError))throw t;return encodeURIComponent(String(e).replaceAll(fn,`�`))}},mn=c(`router`),hn=e=>{let t=typeof e;if(t!==`string`&&t!==`number`&&t!==`boolean`)throw mn.type`Invalid query value: an array element must be a string, number, or boolean — received ${t}`;return pn(e)},gn=(e,t,n,r)=>{let i=`${e}${n}`,a=[];for(let e of t)if(e===null){let e=r.encode(i);e&&a.push(e)}else a.push(`${i}=${hn(e)}`);return a.join(`&`)},_n={none:{encodeArray:(e,t,n)=>gn(e,t,``,n)},brackets:{encodeArray:(e,t,n)=>gn(e,t,`[]`,n)},index:{encodeArray:(e,t,n)=>{let r=[];for(let[i,a]of t.entries()){let t=`${e}[${i}]`;if(a===null){let e=n.encode(t);e&&r.push(e)}else r.push(`${t}=${hn(a)}`)}return r.join(`&`)},indexed:!0},comma:{encodeArray:(e,t)=>{let n=[];for(let e of t)e!==null&&n.push(hn(e));return n.length===0?``:`${e}=${n.join(`,`)}`},decodeValue:e=>e.includes(`,`)?e.split(`,`):null}},vn={none:{encode:(e,t)=>`${e}=${t}`,decodeUndefined:()=>null,decodeRaw:()=>null,decodeValue:e=>e},auto:{encode:(e,t)=>`${e}=${t}`,decodeUndefined:()=>null,decodeRaw:e=>e===`true`||e!==`false`&&null,decodeValue:e=>e},"empty-true":{encode:(e,t)=>t?e:`${e}=false`,decodeUndefined:()=>!0,decodeRaw:e=>e===`true`||e!==`false`&&null,decodeValue:e=>e}},yn={default:{encode:e=>e},hidden:{encode:()=>``}},bn={auto:{decode:e=>{let t=e.length;if(t===0)return null;let n=+(e.codePointAt(0)===45);if(n===t||t-n>1&&e.codePointAt(n)===48&&e.codePointAt(n+1)!==46)return null;let r=!1;for(let i=n;i<t;i++){let a=e.codePointAt(i);if(!(a!==void 0&&a>=48&&a<=57)){if(a===46&&!r&&i!==n&&i!==t-1)r=!0;else return null}}let i=Number(e);return String(i)!==e||!Number.isSafeInteger(i)&&!r?null:i}},none:{decode:()=>null}},xn=c(`router`),Sn=Object.defineProperty,Cn=Object.keys,wn=Object.hasOwn,Tn=Symbol.for(`real-router.searchParams.configFault`),En=(e,t,n)=>{let r=typeof t==`string`?t:String(t);if(!wn(e,r)){let t=xn.type`Invalid "queryParams.${n}": "${r}" — expected ${Cn(e).map(e=>`"${e}"`).join(` | `)}`;throw Sn(t,Tn,{value:!0}),t}return e[r]},Dn=(e,t,n,r)=>({boolean:En(vn,t,`booleanFormat`),null:En(yn,n,`nullFormat`),number:En(bn,r,`numberFormat`),array:En(_n,e,`arrayFormat`)}),On=Object.freeze({boolean:vn.auto,null:yn.default,number:bn.auto,array:_n.none}),P=Object.freeze({arrayFormat:`none`,booleanFormat:`auto`,nullFormat:`default`,numberFormat:`auto`}),kn=Object.freeze({...P,strategies:On}),An=e=>{if(!e||e.arrayFormat===void 0&&e.booleanFormat===void 0&&e.nullFormat===void 0&&e.numberFormat===void 0)return kn;let t=e.arrayFormat??P.arrayFormat,n=e.booleanFormat??P.booleanFormat,r=e.nullFormat??P.nullFormat,i=e.numberFormat??P.numberFormat;return{arrayFormat:t,booleanFormat:n,nullFormat:r,numberFormat:i,strategies:Dn(t,n,r,i)}},jn=e=>pn(e),Mn=(e,t,n)=>{let r=jn(e);switch(typeof t){case`string`:case`number`:return`${r}=${jn(t)}`;case`boolean`:return n.strategies.boolean.encode(r,t);case`object`:return t===null?n.strategies.null.encode(r):Array.isArray(t)?n.strategies.array.encodeArray(r,t,n.strategies.null):`${r}=${jn(t)}`;default:return`${r}=${jn(t)}`}},Nn=Object.hasOwn,Pn=Object.keys;function Fn(e,t,n){l(e,t,n)}function In(e,t,n,r){if(!Nn(e,t)){Fn(e,t,r?[n]:n);return}let i=e[t];Array.isArray(i)?i.push(n):Fn(e,t,[i,n])}function Ln(e,t,n){let r=t+1,i=0,a=!1;for(;r<n;){let t=e.codePointAt(r);if(t===93)return a?i:null;if(t!==void 0&&t>=48&&t<=57)i=i*10+(t-48),a=!0,r++;else return null}return null}function Rn(e,t,n){let{searchPart:r,nameEnd:i,nameSourceEnd:a,rawValue:o,decodedName:s}=e,c=Ln(r,i,a);if(c===null)return!1;let l=dn(o,t),u=n.get(s);return u===void 0?n.set(s,[[c,l]]):u.push([c,l]),!0}function zn(e,t,n,r,i,a,o){let s=a!==-1&&a<n?e.slice(a+1,n):void 0,c=s===void 0?n:a,l=c,u=!1;for(let n=t;n<c;n++)if(e.codePointAt(n)===91){l=n,u=!0;break}let d=un(e.slice(t,l));if(!(o!==void 0&&u&&Rn({searchPart:e,nameEnd:l,nameSourceEnd:c,rawValue:s,decodedName:d},i,o))){if(!u&&s!==void 0&&i.array.decodeValue){let e=i.array.decodeValue(s);if(e){for(let t of e)In(r,d,dn(t,i),!0);return}}In(r,d,dn(s,i),u)}}const Bn=(e,t)=>{if(e===``||e===`?`)return{};let n={};return Vn(e,n,t.strategies),n};function Vn(e,t,n){let r=n.array.indexed?new Map:void 0,i=0,a=e.length,o=-2;for(;i<a;){let s=e.indexOf(`&`,i);s===-1&&(s=a),s>i&&(o!==-1&&o<i&&(o=e.indexOf(`=`,i)),zn(e,i,s,t,n,o,r)),i=s+1}if(r!==void 0)for(let[e,n]of r)n.sort((e,t)=>e[0]-t[0]),Fn(t,e,n.map(e=>e[1]))}const Hn=(e,t)=>{let n=Pn(e);if(n.length===0)return``;let r=[];for(let i of n){let n=e[i];if(n===void 0)continue;let a=Mn(i,n,t);a&&r.push(a)}return r.join(`&`)};function Un(e){let t=e?.queryParams,n=An(t);return new Qt({...e?.caseSensitive!==void 0&&{caseSensitive:e.caseSensitive},...e?.strictTrailingSlash!==void 0&&{strictTrailingSlash:e.strictTrailingSlash},...e?.strictQueryParams!==void 0&&{strictQueryParams:e.strictQueryParams},...e?.urlParamsEncoding!==void 0&&{urlParamsEncoding:e.urlParamsEncoding},parseQueryString:e=>Bn(e,n),buildQueryString:e=>Hn(e,n)})}const Wn=c(`router`,`addEventListener`),Gn=c(`router`,`subscribeChanges`),Kn=c(`router`,`addInterceptor`),qn=c(`router`,`addCheck`),Jn=c(`router`,`extendRouter`),F=c(`router`),Yn=Object.keys,Xn=Object.values,I=Object.hasOwn,Zn=Object.getOwnPropertyDescriptor,Qn=Object.getPrototypeOf,$n=Object,er=new Set(Xn(v));function tr(e){if(!er.has(e))throw Wn.type`Invalid event name: ${String(e)}. Must be one of: ${[...er].join(`, `)}`}function nr(e){if(typeof e!=`function`)throw Wn.type`callback must be a function, got ${typeof e}`}function rr(e){if(typeof e!=`function`)throw Gn.type`Expected a function`}function ir(e,t){if(typeof e!=`string`||!I(E,e))throw Kn.type`Invalid method: ${typeof e==`string`?`"${e}"`:typeof e}. Must be one of: ${Yn(E).join(`, `)}`;if(typeof t!=`function`)throw Kn.type`interceptor must be a function, got ${typeof t}`}function ar(e,t){if(typeof e!=`string`||!I(w,e))throw qn.type`Invalid position: ${typeof e==`string`?`"${e}"`:typeof e}. Must be one of: ${Yn(w).join(`, `)}`;if(typeof t!=`function`)throw qn.type`check must be a function, got ${typeof t}`}function or(e,t){if(typeof e!=`string`)throw c(`router`,t).type`Route name must be a string, got ${typeof e}`}function sr(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=Qn(e);return t===null||t.constructor===$n}function cr(e){if(!sr(e))throw F.type`dependencies must be a plain object`}function lr(e){return e===null?`null`:typeof e==`object`?`a non-plain object`:typeof e}function ur(e){if(!sr(e))throw Jn.type`extensions must be a plain object, got ${lr(e)}`}function dr(e,t){cr(e);let n=e,r=[];for(let e of Yn(n)){if(Zn(n,e)?.get)throw F.type`dependencies cannot contain getters: "${e}"`;let t=n[e];t!==void 0&&r.push([e,t])}for(let[e,n]of r)t(e,n)}function fr(e){let t=[];for(let n of e){let e=n;if(typeof e!=`object`||!e||Array.isArray(e))throw F.type`route must be a non-array object`;ce(e,`addRoute`);let r={...e},i=r.children;i&&l(r,`children`,fr(i)),t.push(r)}return t}const pr=new Set([`all`,`warn-error`,`error-only`,`none`]);function mr(e){return typeof e==`string`&&pr.has(e)}function hr(e){return typeof e==`string`?`"${e}"`:typeof e==`object`?JSON.stringify(e):String(e)}function gr(e){for(let t of Yn(e))if(t!==`level`&&t!==`callback`&&t!==`callbackIgnoresLevel`)throw F.type`Unknown logger config property: "${t}"`}function _r(e){if(!I(e,`level`))return;let t=e.level;if(t!==void 0){if(!mr(t))throw F.type`Invalid logger level: ${hr(t)}. Expected: "all" | "warn-error" | "error-only" | "none"`;return t}}function vr(e){if(!I(e,`callbackIgnoresLevel`))return;let t=e.callbackIgnoresLevel;if(t!==void 0){if(typeof t!=`boolean`)throw F.type`Logger callbackIgnoresLevel must be a boolean, got ${typeof t}`;return t}}function yr(e){if(typeof e!=`object`||!e)throw F.type`Logger config must be an object`;let t=e;gr(t);let n=h(),r=_r(t);if(r!==void 0&&(n.level=r),I(t,`callback`)){let e=t.callback;if(e!==void 0&&typeof e!=`function`)throw F.type`Logger callback must be a function, got ${typeof e}`;n.callback=e}let i=vr(t);return i!==void 0&&(n.callbackIgnoresLevel=i),n}const br=Object.create;function xr(e,t,n){e[t]=n}function Sr(e,t){return e.dependencies[t]}function Cr(e){e.dependencies=br(null)}function wr(e){return De({...e.dependencies})}function Tr(e,t){let n=br(null),r=e,i=n;return dr(r,(e,t)=>{xr(i,e,t)}),{dependencies:n,limits:t}}const L={defaultRoute:``,defaultParams:{},defaultSearch:{},trailingSlash:`preserve`,caseSensitive:!0,queryParamsMode:`loose`,queryParams:P,urlParamsEncoding:`default`,allowNotFound:!0,rewritePathOnMatch:!0},Er=[`strict`,`never`,`always`,`preserve`],Dr=[`default`,`strict`,`loose`];function Or(e){return e!==void 0&&Er.includes(e)?e:L.trailingSlash}function kr(e){return e!==void 0&&Dr.includes(e)?e:L.queryParamsMode}const Ar=c(`router`);function jr(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Ar.type`options must be a plain object`}const Mr=Object.freeze;var Nr=class{#e;constructor(e={}){this.#e=Mr(De({...L,...e}))}static validateOptionsIsObject(e){jr(e)}get(){return this.#e}};function Pr(e,t){return typeof e==`function`?e(t):e}const Fr=Object.keys;function Ir(e,t,n,r,i){let a=e.pathNames(t);if(a!==void 0)for(let e of Fr(n))!r.includes(e)&&!a.includes(e)&&i(t,e)}function R(e,t,n,r,i){let a=String(t),c=i?.resolveForward===!1?{name:a,params:n,search:r}:e.resolveForward(a,n,r),l=c.name,u=ye(c.params,s),d=i?.diagnoseUndeclared===!0?e.reportUndeclaredParamKey:void 0;d&&Ir(e,l,u,e.queryNames(l),d);let f=e.defaultParams(l),p=e.defaultSearch(l);if((c.search===void 0||c.search===o)&&f===void 0&&p===void 0)return{name:l,path:u,query:o};let m=e.queryNames(l),h=e.reportDroppedQueryKey,g=i?.resolveForward===!1?je(p,u,m):p,_=ye(c.search,o),v=ve(g,_);return{name:l,path:Oe(f,u),query:e.admitsUndeclaredQuery()?v:Fe(v,e.printedQueryNames(l),t=>{h!==void 0&&e.pathNames(l)!==void 0&&h(l,t)})}}function z(e,t){return t.buildPath(e.name,e.path,e.query)}const Lr=Object.freeze;function Rr(e,t){let n={name:e.name,params:e.path,search:e.query,path:t,context:{},transition:p};return Lr(n.params),n}function B(e,t){return _e(Rr(e,t))}function zr(e,t){return Rr(e,t)}var Br=class{#e;#t;get(){return this.#e.current}getPrevious(){return this.#e.previous}setContext(e){this.#e=e}setDependencies(e){this.#t=e}makeState(e,t,n,r){let i=this.#t.port(),a=R(i,e,t??s,n,{resolveForward:!1});return x(`makeState`,a.name,a.path,i.queryNames(a.name)),B(a,r??z(a,i))}areStatesEqual(e,t,n=!0){if(!e||!t)return!!e==!!t;let r=e.name;return r===t.name?n?be(e.params,t.params,this.#t.getUrlParams(r)):xe(e.params,t.params)&&xe(e.search,t.search):!1}};const Vr=Object.keys,Hr={[e.ROUTER_START]:v.ROUTER_START,[e.ROUTER_STOP]:v.ROUTER_STOP,[e.TRANSITION_SUCCESS]:v.TRANSITION_SUCCESS,[e.TRANSITION_START]:v.TRANSITION_START,[e.TRANSITION_LEAVE_APPROVE]:v.TRANSITION_LEAVE_APPROVE,[e.TRANSITION_ERROR]:v.TRANSITION_ERROR,[e.TRANSITION_CANCEL]:v.TRANSITION_CANCEL},Ur=Vr(Hr),Wr=c(`router`,`usePlugin`);function Gr(e){if(!(e&&typeof e==`object`)||Array.isArray(e))throw Wr.type`Plugin factory must return an object, got ${typeof e}`;if(typeof e.then==`function`)throw Wr.type`Async plugin factories are not supported. Factory returned a Promise instead of a plugin object.`}const Kr=Object.freeze;var qr=class e{#e=new Set;#t=new Set;#n;static validatePlugin(e){Gr(e)}setDependencies(e){this.#n=e}count(){return this.#e.size}use(...e){if(this.#n.getValidator()?.plugins.validateCountThresholds(this.#e.size+e.length),e.length===1){let t=e[0],n=this.#i(t);this.#e.add(t);let r=!1,i=()=>{if(!r){r=!0,this.#e.delete(t),this.#t.delete(i);try{n()}catch(e){this.#n.logger.error(`router`,`Error during cleanup:`,e)}}};return this.#t.add(i),i}let t=this.#r(e),n=[];try{for(let e of t){let t=this.#i(e);n.push({factory:e,cleanup:t})}}catch(e){for(let{cleanup:e}of n)try{e()}catch(e){this.#n.logger.error(`router.usePlugin`,`Cleanup error:`,e)}throw e}for(let{factory:e}of n)this.#e.add(e);let r=!1,i=()=>{if(!r){r=!0,this.#t.delete(i);for(let{factory:e}of n)this.#e.delete(e);for(let{cleanup:e}of n)try{e()}catch(e){this.#n.logger.error(`router`,`Error during cleanup:`,e)}}};return this.#t.add(i),i}getAll(){return[...this.#e]}disposeAll(){for(let e of this.#t)e();this.#e.clear(),this.#t.clear()}#r(e){let t=new Set;for(let n of e)t.has(n)?this.#n.getValidator()?.plugins.warnBatchDuplicates(e):t.add(n);return t}#i(t){let n=this.#n.compileFactory(t);e.validatePlugin(n),this.#n.getValidator()?.plugins.validatePluginKeys(n),Kr(n);let r=[];for(let e of Ur)e in n&&(typeof n[e]==`function`?(r.push(this.#n.addEventListener(Hr[e],n[e])),e===`onStart`&&this.#n.canNavigate()&&this.#n.emitDiagnostic(ue.PLUGIN_AFTER_START,e)):this.#n.getValidator()?.plugins.warnPluginMethodType(e));return()=>{for(let e of r)e();typeof n.teardown==`function`&&n.teardown()}}};const V=Object.create,Jr=()=>!0,Yr=()=>!1,Xr=()=>Jr,Zr=()=>Yr;function Qr(e){return e?Xr:Zr}function $r(e,t,n){n===void 0?e.delete(t):e.set(t,n)}var ei=class{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=new Map;#a=new Map;#o=new Map;#s=new Map;#c=new Map;#l=new Map;#u=[this.#i,this.#a];#d;setDependencies(e){this.#d=e}getHandlerCount(e){let t=e===`activate`?this.#e:this.#n,n=e===`activate`?this.#t:this.#r;if(t.size===0)return n.size;if(n.size===0)return t.size;let r=new Set(t.keys());for(let e of n.keys())r.add(e);return r.size}preflightHandlerLimit(e,t,n){let r=this.#d.getValidator();if(!r)return;let i=(e,t,i)=>{let{definition:a,external:o}=this.#g(e),s=0;for(let e of t)(n?o.has(e):a.has(e)||o.has(e))||s++;if(s===0)return;let c=n?o.size:this.getHandlerCount(e);r.lifecycle.validateHandlerLimit(c+s-1,i)};i(`activate`,e,`canActivate`),i(`deactivate`,t,`canDeactivate`)}addCanActivate(e,t,n,r){this.#f(`activate`,e,t,n,`canActivate`,r)}addCanDeactivate(e,t,n,r){this.#f(`deactivate`,e,t,n,`canDeactivate`,r)}clearCanActivate(e,t){this.#p(`activate`,e,t)}clearCanDeactivate(e,t){this.#p(`deactivate`,e,t)}clearAll(){this.#e.clear(),this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#a.clear(),this.#i.clear(),this.#o.clear(),this.#s.clear(),this.#c.clear(),this.#l.clear()}clearDefinitionGuards(){for(let e of this.#e.keys())this.#c.delete(e),this.#t.has(e)?this.#m(`activate`,e):this.#a.delete(e);for(let e of this.#n.keys())this.#o.delete(e),this.#r.has(e)?this.#m(`deactivate`,e):this.#i.delete(e);this.#e.clear(),this.#n.clear()}getFactories(){let e=V(null),t=V(null);for(let[t,n]of this.#n)e[t]=n;for(let[t,n]of this.#r)e[t]=n;for(let[e,n]of this.#e)t[e]=n;for(let[e,n]of this.#t)t[e]=n;return[e,t]}getFactoriesByOrigin(){let e=V(null),t=V(null),n=V(null),r=V(null);for(let[t,n]of this.#n)e[t]=n;for(let[e,n]of this.#e)t[e]=n;for(let[e,t]of this.#r)n[e]=t;for(let[e,t]of this.#t)r[e]=t;return{definition:[e,t],external:[n,r]}}getFunctions(){return this.#u}canNavigateTo(e,t,n,r,i){for(let t of e)if(!this.#_(this.#i,t,n,r,i))return!1;for(let e of t)if(!this.#_(this.#a,e,n,r,i))return!1;return!0}compileGuardFactory(e,t){let n=typeof e==`boolean`?Qr(e):e,r=this.#d.compileFactory(n);if(typeof r!=`function`)throw c(`router`,t).type`Factory must return a function, got ${typeof r}`;return r}#f(e,t,n,r,i,a){let o=this.#g(e),s=e===`activate`?this.#a:this.#i,c=r?o.definition:o.external,l=r?o.external:o.definition;if(c.has(t)||l.has(t))this.#d.getValidator()?.lifecycle.warnOverwrite(t,e,i);else{let t=this.#d.getValidator();if(t){let n=this.getHandlerCount(e);t.lifecycle.validateHandlerLimit(n,i),t.lifecycle.validateCountThresholds(n+1,i)}}let u=typeof n==`boolean`?Qr(n):n,d=c.get(t),f=this.#h(e),p=r?f.definition:f.external,m=p.get(t);c.set(t,u);let h=r&&l.has(t);try{let e=a??this.compileGuardFactory(u,i);p.set(t,e),h||s.set(t,e)}catch(n){throw $r(c,t,d),$r(p,t,m),this.#m(e,t),n}}#p(e,t,n){let{definition:r,external:i}=this.#g(e),a=this.#h(e),o=n!==`external`&&r.delete(t),s=n!==`definition`&&i.delete(t);o&&a.definition.delete(t),s&&a.external.delete(t),(o||s)&&this.#m(e,t)}#m(e,t){let n=this.#h(e),r=e===`activate`?this.#a:this.#i,i=n.external.get(t)??n.definition.get(t);i?r.set(t,i):r.delete(t)}#h(e){return e===`activate`?{definition:this.#c,external:this.#l}:{definition:this.#o,external:this.#s}}#g(e){return e===`activate`?{definition:this.#e,external:this.#t}:{definition:this.#n,external:this.#r}}#_(e,t,n,r,i){let a=e.get(t);if(!a)return!0;try{let e=a(n,r);if(typeof e==`boolean`)return e;let o=e?.then,s=this.#d.getValidator();return typeof o==`function`?(Promise.resolve(e).catch(()=>void 0),s?.lifecycle.warnAsyncGuardSync(t,i)):s?.lifecycle.warnNonBooleanGuardSync(t,e,i),!1}catch(e){return this.#d.logger.warn(`router.${i}`,`Guard for "${t}" threw — treated as navigation-blocking (returned false)`,e),!1}}};const ti=new Set([`name`,`path`,`children`,`canActivate`,`canDeactivate`,`forwardTo`,`encodeParams`,`decodeParams`,`defaultParams`,`defaultSearch`]),ni=Object.freeze,H=Object.create,ri=Object.hasOwn,ii=Object.keys;function ai(){return{decoders:H(null),encoders:H(null),defaultParams:H(null),defaultSearch:H(null),forwardMap:H(null),forwardFnMap:H(null)}}function oi(e){return ii(e.forwardMap).length>0||ii(e.forwardFnMap).length>0}function si(e,t){for(let n of ii(t))Object.assign(e[n],t[n])}function ci(e,t){for(let n in e)if(ri(t,n)&&!ge(e[n],t[n]))return!1;return!0}function li(e){return typeof e==`string`?e:`<non-string>`}function ui(e,t){for(let n in e)if(!ge(e[n],t[n]))return!1;return!0}function di(e){let t={name:e.name,path:e.path};return e.children&&l(t,`children`,e.children.map(e=>di(e))),t}function fi(e,t,n){if(n.add(t),e.children)for(let r of e.children)fi(r,`${t}.${r.name}`,n)}function pi(e,t,n=``){for(let r=0;r<e.length;r++){let i=e[r],a=n?`${n}.${i.name}`:i.name;if(a===t){e.splice(r,1);let t=new Set;return fi(i,a,t),t}if(i.children&&t.startsWith(`${a}.`)){let e=pi(i.children,t,a);if(e)return e}}}function mi(e,t){for(let n of ii(e))t(n)&&delete e[n]}function hi(e,t){let n=t.search(/[?#]/),r=n===-1?t:t.slice(0,n);if(r===`/`||r.endsWith(`/`))return t;let i=e.search(/[?#]/),a=i===-1?e:e.slice(0,i);return a.length>1&&a.endsWith(`/`)?`${r}/${n===-1?``:t.slice(n)}`:t}function gi(e){let t=[];for(let n of e)for(let e of n.paramMeta.urlParams)t.push(e);return t}const _i=ni([]);function vi(e,t,n){let r=n.get(t);if(r!==void 0)return r;let i=e.getSegmentsByName(t);if(!i)return _i;let a=ni(gi(i));return n.set(t,a),a}function yi(e,t){return vi(e.matcher,t,e.urlParamsCache)}const bi=ni([]);function xi(e,t,n,r){let i=r.get(t);if(i!==void 0)return i;let a=e.getDeclaredQueryParams(t);if(!a)return bi;let o=vi(e,t,n),s=ni(a.filter(e=>!o.includes(e)));return r.set(t,s),s}function Si(e,t){return e.getDeclaredQueryParams(t)??bi}function Ci(e,t){return xi(e.matcher,t,e.urlParamsCache,e.queryParamsCache)}function wi(e,t,n){let r=new Map,i=new Map;Me(t.defaultParams,t=>xi(e,t,r,i),n)}const Ti=c(`router`);function Ei(e,t,n=100){let r=String(e),i=new Set,a=[r],o=r;for(;;){let e=t[o];if(!e)break;let r=String(e);if(i.has(r)){let e=a.indexOf(r),t=[...a.slice(e),r];throw Ti.plain`Circular forwardTo: ${t.join(` → `)}`}if(i.add(o),a.push(r),o=r,a.length>n)throw Ti.plain`forwardTo chain exceeds maximum depth (${n}): ${a.join(` → `)}`}return o}const Di=c(`router`),Oi=c(`router`,`addRoute`),ki=Object.freeze,U=Object.create,Ai=Object.entries,ji=Object.keys,Mi=Object.defineProperty,Ni=Object.fromEntries;function Pi(e,t,n){let r=sn(``,t,e),i=Un(n);return i.registerTree(r),{tree:r,matcher:i}}function Fi(e,t=e.definitions){let n=Pi(t,e.rootPath,e.matcherOptions);e.tree=n.tree,e.matcher=n.matcher,e.urlParamsCache.clear(),e.queryParamsCache.clear()}function Ii(e,t){let n=Pi(e.definitions,t,e.matcherOptions);wi(n.matcher,e.config,`setRootPath`),e.rootPath=t,e.tree=n.tree,e.matcher=n.matcher,e.urlParamsCache.clear(),e.queryParamsCache.clear()}function Li(e,t){Fi(e,t),W(e,Bi(e.config))}function Ri(e){zi(e),Fi(e,[])}function zi(e){Object.assign(e.config,ai()),W(e,U(null)),e.routeCustomFields=U(null)}function W(e,t){e.resolvedForwardMap=t,e.hasAnyForward=oi(e.config)}function Bi(e){let t=U(null);for(let n of ji(e.forwardMap))t[n]=Ei(n,e.forwardMap);return t}function Vi(e,t){if(typeof e!=`function`){if(typeof e!=`string`&&e!==null)throw Di.type`forwardTo must be a string or function for route "${t}", got ${typeof e}`;return}let n=e.constructor.name===`AsyncFunction`,r=e.toString().includes(`__awaiter`);if(n||r)throw Di.type`forwardTo callback cannot be async for route "${t}". Async functions break matchPath/buildPath.`}function Hi(e,t,n){t&&ne(`encodeParams`,t,n,void 0),e&&ne(`decodeParams`,e,n,void 0)}function Ui(e,t,n,r){if(Vi(e.forwardTo,t),e.canActivate){let n=typeof e.forwardTo==`string`?e.forwardTo:`[dynamic]`;r.warn(`router`,`Route "${t}" has both forwardTo and canActivate. canActivate will be ignored because forwardTo creates a redirect (industry standard). Move canActivate to the target route "${n}".`)}if(e.canDeactivate){let n=typeof e.forwardTo==`string`?e.forwardTo:`[dynamic]`;r.warn(`router`,`Route "${t}" has both forwardTo and canDeactivate. canDeactivate will be ignored because forwardTo creates a redirect (industry standard). Move canDeactivate to the target route "${n}".`)}typeof e.forwardTo==`string`?n.forwardMap[t]=e.forwardTo:n.forwardFnMap[t]=e.forwardTo}function Wi(e,t,n,r,i,a,o){let{decodeParams:s,encodeParams:c}=e;Hi(s,c,t);let l=Ni(Ai(e).filter(([e])=>!ti.has(e)));ji(l).length>0&&(r[t]=ki(l)),e.canActivate&&i.set(t,e.canActivate),e.canDeactivate&&a.set(t,e.canDeactivate),e.forwardTo&&Ui(e,t,n,o),s&&(n.decoders[t]=e=>s(e)??e),c&&(n.encoders[t]=e=>c(e)??e),e.defaultParams&&(n.defaultParams[t]=O(`defaultParams`,e.defaultParams)),e.defaultSearch&&(n.defaultSearch[t]=O(`defaultSearch`,e.defaultSearch))}function Gi(e,t,n,r,i,a,o=``){for(let s of e){let e=o?`${o}.${s.name}`:s.name;Wi(s,e,t,n,r,i,a),s.children&&Gi(s.children,t,n,r,i,a,e)}}function Ki(e){let t=ai();return si(t,e),t}function qi(e,t,n){if(n.length===0)return[...e,...t];let[r,...i]=n;return e.map(e=>{if(e.name!==r)return e;let n=e.children??[];return{...e,children:i.length===0?[...n,...t]:qi(n,t,i)}})}function Ji(e,t,n){for(let r of e){let e=t?`${t}.${r.name}`:r.name;n(e),r.children&&Ji(r.children,e,n)}}function Yi(e,t,n){let r=new Set;Ji(e,t,e=>{if(r.has(e))throw c(`router`,n).plain`Duplicate route "${e}" in batch`;r.add(e)})}function Xi(e,t){if(or(e,t),e.startsWith(`@@`))throw c(`router`,t).plain`Route name "${e}" uses the reserved "${`@@`}" prefix. Routes with this prefix are internal and cannot be modified through the public API.`}function Zi(e,t){for(let n of e)Xi(n.name,t),n.children&&Zi(n.children,t)}function Qi(e,t){for(let n of e)ie(n.name,t),n.children&&Qi(n.children,t)}function $i(e,t){for(let n of e)se(n.name,t),n.children&&$i(n.children,t)}function ea(e,t,n){let r=new Map,i=(e,t)=>{for(let a of e){let e=r.get(t);if(e?.has(a.path))throw c(`router`,n).plain`Path "${a.path}" is already defined`;e?e.add(a.path):r.set(t,new Set([a.path])),a.children&&i(a.children,t?`${t}.${a.name}`:a.name)}};i(e,t)}function ta(e,t,n){if(Zi(t,`addRoute`),Qi(t,`addRoute`),$i(t,`addRoute`),n!==void 0&&!e.matcher.hasRoute(n))throw Oi.plain`Parent route "${n}" does not exist`;Ji(t,n??``,t=>{if(e.matcher.hasRoute(t))throw Oi.plain`Route "${t}" already exists`}),Yi(t,n??``,`addRoute`),ea(t,n??``,`addRoute`)}function na({definitions:e,routesForHandlers:t,config:n,routeCustomFields:r,handlerParentName:i,rootPath:a,matcherOptions:o,logger:s}){let c=new Map,l=new Map;Gi(t,n,r,c,l,s,i);let u=Bi(n),{tree:d,matcher:f}=Pi(e,a,o);return{config:n,routeCustomFields:r,pendingCanActivate:c,pendingCanDeactivate:l,tree:d,matcher:f,resolvedForwardMap:u}}function ra(e,t,n,r){return na({definitions:qi(e.definitions,t.map(e=>di(e)),n===void 0?[]:n.split(`.`)),routesForHandlers:t,config:Ki(e.config),routeCustomFields:Object.assign(U(null),e.routeCustomFields),handlerParentName:n??``,rootPath:e.rootPath,matcherOptions:e.matcherOptions,logger:r})}function ia(e,t,n,r){return na({definitions:e.map(e=>di(e)),routesForHandlers:e,config:ai(),routeCustomFields:U(null),handlerParentName:``,rootPath:t,matcherOptions:n,logger:r})}function aa(e,t,n){let r=[];for(let[i,a]of e)r.push([i,a,t(a,n)]);return r}function oa(e,t){return{activate:aa(e.pendingCanActivate,t.compileGuard,`canActivate`),deactivate:aa(e.pendingCanDeactivate,t.compileGuard,`canDeactivate`)}}function sa(e,t,n){let r=e.depsStore,{activate:i,deactivate:a}=n??oa(t,r);Object.assign(e.config,t.config),e.routeCustomFields=t.routeCustomFields,e.tree=t.tree,e.matcher=t.matcher,e.urlParamsCache.clear(),e.queryParamsCache.clear(),W(e,t.resolvedForwardMap);for(let[e,t,n]of i)r.addActivateGuard(e,t,n);for(let[e,t,n]of a)r.addDeactivateGuard(e,t,n)}function G(e){return e===null?e:e||void 0}function ca(e,t){return t==null?t:O(e,t)}function la(e,t,n,r){let{forwardTo:i,defaultParams:a,defaultSearch:o,decodeParams:s,encodeParams:c,canActivate:l,canDeactivate:u}=r,d=G(i),f=ca(`defaultParams`,G(a)),p=ca(`defaultSearch`,G(o)),m=G(s),h=G(c),g=G(l),_=G(u);f!=null&&me(`updateRoute`,n,f,Ci(e,n),"this route's `defaultParams`","Move it to `defaultSearch`"),Hi(m,h,n);let v=d===void 0?void 0:ua(n,d,e.config),y=da(e,n,r),b=g==null?void 0:t.compileGuardFactory(g,`canActivate`),x=_==null?void 0:t.compileGuardFactory(_,`canDeactivate`);return t.preflightHandlerLimit(b===void 0?[]:[n],x===void 0?[]:[n],!1),y!==void 0&&(ji(y).length>0?e.routeCustomFields[n]=ki(y):delete e.routeCustomFields[n]),v!==void 0&&(e.config.forwardMap=v.forwardMap,e.config.forwardFnMap=v.forwardFnMap,W(e,v.resolved)),pa(e,n,{defaultParams:f,defaultSearch:p,decodeParams:m,encodeParams:h}),ma(t,`activate`,n,g,b),ma(t,`deactivate`,n,_,x),{forwardTo:d,defaultParams:f,defaultSearch:p,decodeParams:m,encodeParams:h}}function ua(e,t,n){Vi(t,e);let r=Object.assign(U(null),n.forwardMap),i=Object.assign(U(null),n.forwardFnMap);return t===null?(delete r[e],delete i[e]):typeof t==`string`?(delete i[e],r[e]=t):(delete r[e],i[e]=t),{forwardMap:r,forwardFnMap:i,resolved:Bi({...n,forwardMap:r})}}function da(e,t,n){let r;for(let i of ji(n)){if(ti.has(i))continue;let a=n[i];a!==void 0&&(r??={...e.routeCustomFields[t]},a===null?delete r[i]:l(r,i,a))}return r}function fa(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function pa(e,t,n){if(fa(e.config.defaultParams,t,n.defaultParams),fa(e.config.defaultSearch,t,n.defaultSearch),n.decodeParams!==void 0){if(n.decodeParams===null)delete e.config.decoders[t];else{let r=n.decodeParams;e.config.decoders[t]=e=>r(e)??e}}if(n.encodeParams!==void 0){if(n.encodeParams===null)delete e.config.encoders[t];else{let r=n.encodeParams;e.config.encoders[t]=e=>r(e)??e}}}function ma(e,t,n,r,i){r!==void 0&&(t===`activate`?r===null?e.clearCanActivate(n,`definition`):e.addCanActivate(n,r,!0,i):r===null?e.clearCanDeactivate(n,`definition`):e.addCanDeactivate(n,r,!0,i))}function ha(e,t,n){let r=e;Zi(r,`addRoute`),Qi(r,void 0),$i(r,void 0),Yi(r,``,`addRoute`);let i=ia(r,``,t,n),a={get definitions(){return ln(a.tree)},config:i.config,tree:i.tree,matcher:i.matcher,urlParamsCache:new Map,queryParamsCache:new Map,resolvedForwardMap:i.resolvedForwardMap,hasAnyForward:oi(i.config),routeCustomFields:i.routeCustomFields,rootPath:``,matcherOptions:t,depsStore:void 0,lifecycleNamespace:void 0,revalidating:!1,pendingCanActivate:i.pendingCanActivate,pendingCanDeactivate:i.pendingCanDeactivate};return wi(a.matcher,a.config,`addRoute`),Mi(a,`matcherOptions`,{writable:!1,configurable:!1}),a}const ga=Object.freeze,_a=Object.keys,va=[];Object.freeze(va);function ya(e){let t=e.split(`.`),n=t.length,r=[t[0]],i=t[0].length;for(let a=1;a<n-1;a++)i+=1+t[a].length,r.push(e.slice(0,i));return r.push(e),r}function ba(e){return typeof e==`object`&&!!e}function xa(e,t){if(e===t)return!0;let n=Array.isArray(e),r=Array.isArray(t);if(!n&&!r)return ba(e)&&ba(t)||ge(e,t);let i=n?e:[e],a=r?t:[t],o=i.length;if(o!==a.length)return!1;for(let e=0;e<o;e++)if(!xa(i[e],a[e]))return!1;return!0}function Sa(e,t,n,r){let i=t[e];if(!i||typeof i!=`object`)return!0;for(let e of _a(i))if(!xa(n.params[e],r.params[e])||!xa(n.search[e],r.search[e]))return!1;return!0}function Ca(e,t,n,r,i,a){for(let o=0;o<a;o++){let a=r[o];if(a!==i[o]||!Sa(a,e,t,n))return o}return a}const wa=new Map;function K(e){let t=wa.get(e);if(t)return t;let n=Ta(e);return ga(n),wa.set(e,n),n}function Ta(e){if(!e)return[``];let t=e.indexOf(`.`);if(t===-1)return[e];let n=e.indexOf(`.`,t+1);if(n===-1)return[e.slice(0,t),e];let r=e.indexOf(`.`,n+1);return r===-1?[e.slice(0,t),e.slice(0,n),e]:e.indexOf(`.`,r+1)===-1?[e.slice(0,t),e.slice(0,n),e.slice(0,r),e]:ya(e)}let Ea,Da,Oa=null,ka,Aa,ja=null;function Ma(e,t,n){if(!t)return{intersection:``,toActivate:K(e.name),toDeactivate:va};let r=n(e.name),i=n(t.name);if(!r&&!i)return{intersection:``,toActivate:K(e.name),toDeactivate:K(t.name)};let a=K(e.name),o=K(t.name),s=Math.min(o.length,a.length),c=Ca(r??i,e,t,a,o,s),l;if(c>=o.length)l=va;else if(c===0&&o.length===1)l=o;else{l=[];for(let e=o.length-1;e>=c;e--)l.push(o[e])}let u=c===0?a:a.slice(c);return{intersection:c>0?o[c-1]:``,toDeactivate:l,toActivate:u}}function Na(e,t,n){if(Oa!==null&&e===Ea&&t===Da)return Oa;if(ja!==null&&e===ka&&t===Aa)return ja;let r=Ma(e,t,n);return ka=Ea,Aa=Da,ja=Oa,Ea=e,Da=t,Oa=r,r}const Pa=c(`router`),Fa=c(`router`,`shouldUpdateNode`),Ia=Object.freeze,q=Object.hasOwn;function La(e,t){return{name:t??e.segments.at(-1).fullName,params:e.params,search:e.search,meta:e.meta}}function Ra(e){let t=Or(e);return t===`preserve`?void 0:t}var za=class{#e;#t;#n;get#r(){return this.#e.depsStore}constructor(e,t,n){this.#e=ha(e,t,n)}static shouldUpdateNode(e,t){return(n,r)=>{if(!(n&&typeof n==`object`&&`name`in n))throw Fa.type`toState must be valid State object`;if(n.transition?.reload||e===``)return!0;let{intersection:i,toActivate:a,toDeactivate:o}=Na(n,r,t);return e===i||a.includes(e)?!0:o.includes(e)}}isRevalidating(){return this.#e.revalidating}setDependencies(e){this.#e.depsStore=e}flushPendingGuards(){let e=this.#r;for(let[t,n]of this.#e.pendingCanActivate)e.addActivateGuard(t,n);this.#e.pendingCanActivate.clear();for(let[t,n]of this.#e.pendingCanDeactivate)e.addDeactivateGuard(t,n);this.#e.pendingCanDeactivate.clear()}setLifecycleNamespace(e){this.#e.lifecycleNamespace=e}setRootPath(e){Ii(this.#e,e)}hasRoute(e){return this.#e.matcher.hasRoute(e)}clearRoutes(){Ri(this.#e)}buildPath(e,t,n,r){if(e===y.UNKNOWN_ROUTE)return typeof t.path==`string`?t.path:``;let i=this.#e.config.encoders[e];if(typeof i==`function`){let a=i({params:{...t},search:{...n}});return this.#e.matcher.buildPath(e,a.params??t,a.search??n,this.#c(r))}return this.#e.matcher.buildPath(e,t,n,this.#c(r))}buildPathFromIntent(e,t,n){return e===y.UNKNOWN_ROUTE?this.#r.port.buildPath(e,ye(t,s),n??o):z(R(this.#r.port,e,t,n,{resolveForward:!1}),this.#r.port)}matchPath(e,t){let n=t,r=this.#e.matcher.match(e);if(!r)return;let i=La(r),{name:a}=i,o=D(i.params),s=D(i.search),c=this.#e.config.decoders[a],l;if(typeof c==`function`){l=c({params:o,search:s});let e=l,t=e.params,n=t??o;l={params:n,search:e.search??s},this.#r.getValidator()?.routes.validateStateBuilderArgs(a,t,`matchPath`),me(`matchPath`,a,n,this.getQueryParams(a),"the `params` returned by this route's `decodeParams`")}else l={params:o,search:s};let u=R(this.#r.port,a,l.params,l.search),d=u.name;x(`matchPath`,u.name,u.path,this.getQueryParams(u.name));let f=u.path,p=u.query,m=e;if(n.rewritePathOnMatch){let t=this.#e.config.encoders[d],r=typeof t==`function`?t({params:f,search:p}):{params:f,search:p},i=n.trailingSlash;try{m=this.#e.matcher.buildPath(d,r.params??f,r.search??p,{trailingSlash:Ra(i),queryParamsMode:kr(n.queryParamsMode)}),Or(i)===`preserve`&&(m=hi(e,m))}catch{m=e}}return B(u,m)}forwardState(e,t,n){let r=n??o;if(q(this.#e.config.forwardFnMap,e)){let n=this.#e.config.forwardFnMap[e],{target:i,chain:a,params:o}=this.#l(e,n,t);return this.#s(i,a,o,r)}let i=this.#e.resolvedForwardMap[e]??e;if(i!==e&&q(this.#e.config.forwardFnMap,i)){let n=this.#e.config.forwardFnMap[i],{target:a,chain:o,params:s}=this.#l(i,n,t);return this.#s(a,[...this.#o(e),...o],s,r)}return i===e?{name:e,params:t,search:r}:this.#s(i,this.#o(e),t,r)}buildStateResolved(e,t){let n=this.#e.matcher.getSegmentsByName(e);if(n)return La({segments:n,params:t,search:{},meta:this.#e.matcher.getMetaByName(e)},e)}isActiveRoute(e,t=s,n=o,r=!1,i=!0){if(this.#i(e,t,n,r,i))return!0;if(!this.#e.hasAnyForward)return!1;let a;try{a=typeof e==`string`?e:String(e)}catch{return!1}if(!q(this.#e.config.forwardMap,a)&&!q(this.#e.config.forwardFnMap,a))return!1;let c;try{c=this.forwardState(e,t,n)}catch(t){return this.#r.logger.warn(`router.isActiveRoute`,`Dynamic forwardTo of route "${li(e)}" threw while resolving the active-link destination; treating the link as inactive.`,t),!1}return this.#i(c.name,c.params,c.search,r,i)}getMetaForState(e){return this.#e.matcher.hasRoute(e)?this.#e.matcher.getMetaByName(e):void 0}getUrlParams(e){return yi(this.#e,e)}getQueryParams(e){return Ci(this.#e,e)}getPrintedQueryParams(e){return Si(this.#e.matcher,e)}getStore(){return this.#e}getPort(){return this.#r.port}#i(e,t,n,r,i){try{return this.#a(e,t,n,r,i)}catch(t){return this.#r.logger.warn(`router.isActiveRoute`,`Reading the arguments for route "${li(e)}" threw while resolving the active-link state; treating the link as inactive.`,t),!1}}#a(e,t,n,r,i){let a=this.#r.getState();if(!a)return!1;let o=a.name;if(o!==e&&!o.startsWith(`${e}.`)&&!e.startsWith(`${o}.`))return!1;let s=R(this.#r.port,e,t,n,{resolveForward:!1});if(r||o===e){let e=zr(s,``);return!this.#r.areStatesEqual(e,a,!0)||!ci(s.path,a.params)?!1:i||xe(e.search,a.search)}return!(!o.startsWith(`${e}.`)||!ci(s.path,a.params)||!i&&!ui(s.query,a.search))}#o(e){let t=[],n=e;for(;q(this.#e.config.forwardMap,n);)t.push(n),n=this.#e.config.forwardMap[n];return t}#s(e,t,n,r){let i,a;for(let e of t)i=Ce(this.#e.config.defaultParams[e],i),a=Ce(this.#e.config.defaultSearch[e],a);return{name:e,params:ye(Ce(i,n),s),search:ye(Ce(a,r),o)}}#c(e){return this.#t?(e!==this.#n&&this.#r.logger.warn(`router.buildPath`,"`options` differs from the cached source reference; router options are immutable per router instance, so the first-cached buildPath options are reused (#957)."),this.#t):(this.#n=e,this.#t=Ia({trailingSlash:Ra(e?.trailingSlash),queryParamsMode:kr(e?.queryParamsMode)}),this.#t)}#l(e,t,n){let r=A(n),i=new Set([e]),a=[e],o=t(this.#r.getDependency,r),s=0;if(typeof o!=`string`)throw Pa.type`forwardTo callback must return a string, got ${typeof o}`;for(;s<100;){if(this.#e.matcher.getSegmentsByName(o)===void 0)throw Pa.plain`Route "${o}" does not exist`;if(i.has(o)){let e=[...i,o].join(` → `);throw Pa.plain`Circular forwardTo: ${e}`}if(i.add(o),q(this.#e.config.forwardFnMap,o)){let e=this.#e.config.forwardFnMap[o];a.push(o),o=e(this.#r.getDependency,r),s++;continue}let e=this.#e.config.forwardMap[o];if(e!==void 0)a.push(o),o=e,s++;else return{target:o,chain:a,params:r}}throw Pa.plain`forwardTo exceeds maximum depth of ${100}`}};const Ba=c(`router`),Va=new g(n.ROUTER_NOT_STARTED),Ha=new g(n.SAME_STATES),Ua=Ba.code(n.ROUTER_NOT_STARTED)`cannot commit before the start navigation does — the boot would overwrite it; defer with queueMicrotask/await, or navigate after start() resolves`;Object.freeze(Va),Object.freeze(Ha),Object.freeze(Ua);const Wa=Promise.reject(Va),Ga=Promise.reject(Ha),Ka=Promise.reject(Ua);Wa.catch(()=>{}),Ga.catch(()=>{}),Ka.catch(()=>{});const qa=new Set([n.SAME_STATES,n.TRANSITION_CANCELLED,n.ROUTER_NOT_STARTED,n.ROUTE_NOT_FOUND,n.CANNOT_ACTIVATE,n.CANNOT_DEACTIVATE,n.ROUTER_ALREADY_STARTED]);function Ja(e){return e instanceof g&&qa.has(e.code)}const Ya=new Set([Wa,Ga,Ka]),J=Object.freeze;function Xa(e){let{fromState:t,toDeactivate:n,toActivate:r,intersection:i}=e;J(n),J(r);let a={phase:`activating`,reason:`success`,segments:J({deactivated:n,activated:r,intersection:i})};return t?.name!==void 0&&(a.from=t.name),e.reload!==void 0&&(a.reload=e.reload),e.replace!==void 0&&(a.replace=e.replace),e.redirected!==void 0&&(a.redirected=e.redirected),J(a)}function Za(e,t){let{toState:r,fromState:i,toDeactivate:a,toActivate:o}=t;if(r.name!==y.UNKNOWN_ROUTE&&!e.hasRoute(r.name)){let a=d(new g(n.ROUTE_NOT_FOUND,{routeName:r.name}));throw e.sendTransitionFail(i,a,t),a}let s=t,c={...r,transition:Xa(t)},l=J(c);t.toState=l;let u=e.canCommitTransition(s);if(!u)throw d(new g(n.TRANSITION_CANCELLED));for(let n of a)!o.includes(n)&&t.canDeactivateFunctions.has(n)&&e.clearCanDeactivate(n,u);return e.sendTransitionDone(s),l}const Qa=Object.entries;function $a(e){return e instanceof g&&e.code===n.TRANSITION_CANCELLED}function eo(e){return $a(e)?e:d(new g(n.TRANSITION_CANCELLED,{reason:e}))}function to(e,t,n,r){$a(t)?e.cancelIfInFlight(r,t):e.isTransitioning()&&e.sendTransitionFail(n,t,r)}function no(e,t,r){if(_(e)&&io(e,t,r),e instanceof DOMException&&e.name===`AbortError`)throw d(new g(n.TRANSITION_CANCELLED));if($a(e))throw e;io(e,t,r)}function ro(e){return _(e)?ao(e,n.CANNOT_DEACTIVATE):e}function io(e,t,n){throw e instanceof g?ao(e,t):d(new g(t,so(e,n)))}function ao(e,t){let{code:n,message:r,...i}=e.toJSON(),a=new g(n,{...i,message:r});return a.setCode(t),a.stack=e.stack??``,d(a)}const oo=new Set([`code`,`segment`,`path`,`then`]);function so(e,t){let n={segment:t};if(e instanceof Error){let t=e.message,r=e.stack,i=`cause`in e?e.cause:void 0;return{...n,message:t,stack:r,...i!==void 0&&{cause:i}}}if(e&&typeof e==`object`){let t={};for(let[n,r]of Qa(e))n!==`__proto__`&&!oo.has(n)&&l(t,n,r);return{...n,...t}}return n}async function co(e,t,n,r){let i;try{i=await e}catch(e){no(e,t,n);return}if(i!==!0)throw i!==!1&&r(n,i),d(new g(t,{segment:n}))}function lo(e,t,r,i,a,o,s,c,l,u,f){if(!l())throw d(new g(n.TRANSITION_CANCELLED));if(e===1){let n=u();return n===void 0?void 0:{phase:e,index:t+1,pending:n}}let p=r[t],m=i.get(p);if(!m)return;let h;try{h=m(o,s,c)}catch(e){no(e,a,p)}if(h!==!0){if(h!==!1){let n=uo(h,a,p);if(n!==void 0)return{phase:e,index:t+1,pending:n};f(p,h)}throw d(new g(a,{segment:p}))}}function uo(e,t,n){let r;try{r=e?.then}catch(e){no(e,t,n)}if(typeof r==`function`)return new Promise((t,n)=>{Reflect.apply(r,e,[t,n])})}function fo(e,t,r,i,a,o,s,c,l,u,d,f,p,m){let h=e===1,g=e===0;if(!h&&!(g?s:c))return;let _=g?a:o,v=h?1:_.length,y=g?r:i,b=g?n.CANNOT_DEACTIVATE:n.CANNOT_ACTIVATE;for(let n=t;n<v;n++){let t=lo(e,n,_,y,b,l,u,d,f,p,m);if(t!==void 0)return t}}function po(e,t,n,r,i,a,o,s,c,l,u,d,f,p){for(let m=f;m<=2;m++){let h=fo(m,m===f?p:0,e,t,n,r,i,a,o,s,c,l,u,d);if(h!==void 0)return h}}async function mo(e,t,r,i,a,o,s,c,l,u,d,f,p){let m=e;for(;m!==void 0;){if(m.phase===1)await m.pending;else{let e=m.phase===0;await co(m.pending,e?n.CANNOT_DEACTIVATE:n.CANNOT_ACTIVATE,(e?i:a)[m.index-1],p)}m=po(t,r,i,a,o,s,c,l,u,d,f,p,m.phase,m.index)}}function ho(e,t,n,r,i,a,o,s,c,l,u,d){let f=po(e,t,n,r,i,a,o,s,c,l,u,d,0,0);return f===void 0?void 0:mo(f,e,t,n,r,i,a,o,s,c,l,u,d)}const go=Object.freeze,_o=Object.freeze([]),vo=new Map;function yo(e,t){return t?go({...e,replace:!0}):e}function bo(e,t,n,r){return!!e&&!t&&!n&&e.path===r.path}function xo(e,t){if(e.size===0)return!1;for(let n of t)if(e.has(n))return!0;return!1}function So(e){let t=e.controller;if(t!==void 0)return t;let n=new AbortController;return e.cancelReason!==void 0&&(n.abort(e.cancelReason),i(n.signal.reason)),e.controller=n,n}function Co(e,t){t.externalSignal!==void 0&&t.cancelReason===void 0&&t.hasGuards&&e.bridgeExternalSignal(t)}function wo(e,t,r,i,a,o,s,c,l,u){jo(e,o);let f=e.hasLeaveListeners()||e.hasPreCommitListeners(),p={toState:t,fromState:r,opts:i,suspendable:a!==void 0||f,forceDeactivate:u,toDeactivate:_o,toActivate:_o,intersection:``,canDeactivateFunctions:vo,canActivateFunctions:vo,shouldDeactivate:!1,shouldActivate:!1,hasGuards:!1,controller:void 0,cancelReason:void 0,detachExternalBridge:void 0,externalSignal:a,reload:s,replace:c,redirected:l};if(!e.startTransition(p))throw d(new g(n.TRANSITION_CANCELLED));return p}function To(e,t){return e.sendLeaveApprove(t),Za(e,t)}function Eo(e,t){let[n,r]=e.getLifecycleFunctions(),{toDeactivate:i,toActivate:a,intersection:o}=Na(t.toState,t.fromState,t=>e.getMetaForState(t));t.canDeactivateFunctions=n,t.canActivateFunctions=r,t.toDeactivate=i,t.toActivate=a,t.intersection=o,t.shouldDeactivate=!!t.fromState&&!t.forceDeactivate&&i.length>0,t.shouldActivate=t.toState.name!==y.UNKNOWN_ROUTE&&a.length>0,t.hasGuards=t.shouldDeactivate&&xo(n,i)||t.shouldActivate&&xo(r,a)}function Do(e,t,r){let a,o;try{let i=we(r),s=i?.aborted===!0?i:void 0;r=Se(r),a=e.getState();let c=k(r,`reload`),l=k(r,`force`),u=k(r,`replace`),f=k(r,`redirected`),p=k(r,`forceDeactivate`)===!0,m=a?.name===y.UNKNOWN_ROUTE&&!u,h=m||u;if(r=yo(r,m),bo(a,c,l,t))return e.emitTransitionError(t,a,Ha),Ga;let _=wo(e,t,a,r,i,s,c,h,f,p);o=_;let v=_.externalSignal;if(v?.aborted===!0&&e.cancelNavigation(v.reason),Eo(e,_),Co(e,_),!_.hasGuards&&!_.suspendable)return To(e,_);let{canDeactivateFunctions:b,canActivateFunctions:x,toDeactivate:S,toActivate:ee,shouldDeactivate:te,shouldActivate:C,hasGuards:ne}=_,re=t;if(!ne){let t=Ao(e,_);if(t!==void 0)return t}if(ne){let r=So(_),i=()=>!r.signal.aborted,o=r.signal,s=ho(b,x,S,ee,te,C,t,a,o,i,()=>{if(e.sendLeaveApprove(_),e.hasLeaveListeners())return e.awaitLeaveListeners(re,a,o)},e.warnNonBooleanGuard);if(s!==void 0)return Oo(e,s,_,r);if(!i())throw d(new g(n.TRANSITION_CANCELLED))}return Za(e,_)}catch(t){let n=ko(e,t,{nav:o,fromState:a});return i(n),Promise.reject(n)}}async function Oo(e,t,r,a){let o=()=>!a.signal.aborted,s=r.externalSignal,c,l=!1,u,f=new Promise(e=>{a.signal.aborted?e():(c=()=>{e()},a.signal.addEventListener(`abort`,c,{once:!0}))});t.catch(()=>{});try{if(s?.aborted)throw d(new g(n.TRANSITION_CANCELLED,{reason:s.reason}));if(await Promise.race([t,f]),!o())throw d(new g(n.TRANSITION_CANCELLED));let i=Za(e,r);return l=!0,i}catch(t){let n=o()?t:eo(t);throw u=n,to(e,n,r.fromState,r),i(n),n}finally{c&&a.signal.removeEventListener(`abort`,c),l||(a.abort(u),i(a.signal.reason))}}function ko(e,t,n){let{nav:r}=n;if(e.dispatchAbort(r?.controller,t),r!==void 0){let i=r.cancelReason===void 0?t:eo(t);return to(e,i,n.fromState,r),i}return t}function Ao(e,t){let{toState:n,fromState:r}=t;if(e.hasLeaveListeners()&&So(t),e.sendLeaveApprove(t),e.hasLeaveListeners()){let i=So(t),a=e.awaitLeaveListeners(n,r,i.signal);return a===void 0?void 0:Oo(e,a,t,i)}}function jo(e,t){if(e.isTransitioning()&&(e.logger.warn(`router`,`Concurrent navigation detected on shared router instance. For SSR, use cloneRouter() to create isolated instance per request.`),e.cancelNavigation()),t!==void 0)throw d(new g(n.TRANSITION_CANCELLED,{reason:t.reason}))}const Mo=Object.freeze,No=c(`router`,`navigateToNotFound`),Po=Object.freeze([y.UNKNOWN_ROUTE]),Fo=Object.freeze({replace:!0});function Io(e,t,r){jo(e,void 0);let i=e.getState(),a=i?K(i.name).toReversed():[];Mo(a);let c={deactivated:a,activated:Po,intersection:``};Mo(c);let l={phase:`activating`,...i&&{from:i.name},reason:`success`,replace:!0,segments:c};Mo(l);let u={name:y.UNKNOWN_ROUTE,params:s,search:o,path:t,transition:l,context:{}};if(Mo(u),r&&i!==void 0&&!e.canDeactivateCurrent(a,u,i)){let r=No.code(n.CANNOT_DEACTIVATE,{path:t})`a canDeactivate guard on "${i.name}" refused to leave for ${t}`;throw e.emitTransitionError(void 0,i,r),r}return e.systemCommit(u,i,Fo)}function Lo(e,t){return Io(e,t,!0)}function Ro(e,t){return Io(e,t,!1)}const zo=c(`router`,`navigateToState`),Bo=c(`router`,`navigateToDefault`);var Vo=class{#e;#t;#n=0;#r=0;setDependencies(e){this.#e=e,this.#t=t=>{Ja(t)||e.logger.error(`router`,`Unexpected navigation error`,t)}}navigate(e,t,n,r){return this.#i(this.#a(e,t,n,r))}navigateToState(e,t){return this.#i(this.#o(e,t))}navigateToDefault(e){return this.#i(this.#c(e))}navigateToNotFound(e){this.#r++;try{return Lo(this.#e,e)}finally{this.#r--}}isCommittingNotFound(){return this.#r>0}revalidateToNotFound(e){return Ro(this.#e,e)}isPreparing(){return this.#n>0}#i(e){return e instanceof Promise&&!Ya.has(e)&&e.catch(this.#t),e}#a(e,t,r,i){let a=this.#e;if(!a.canNavigate())return a.isStarting()?Ka:Wa;let o;this.#n++;try{o=a.buildNavigateState(e,t,r)}catch(e){return Promise.reject(e)}finally{this.#n--}if(!o){let t=d(new g(n.ROUTE_NOT_FOUND,{routeName:e}));return a.emitTransitionError(void 0,a.getState(),t),Promise.reject(t)}return Do(this.#e,o,i)}#o(e,t){let r=this.#e;if(!r.canNavigate())return r.isStarting()?Ka:Wa;let i=e.name;if(i!==y.UNKNOWN_ROUTE&&!r.hasRoute(i)){let e=d(new g(n.ROUTE_NOT_FOUND,{routeName:i}));return r.emitTransitionError(void 0,r.getState(),e),Promise.reject(e)}let a=b(e.params,r.getQueryParams(i));if(a!==void 0){let e=zo.code(n.WRONG_CHANNEL,{routeName:i})`${pe(i,a,"`state.params`")}`;return r.emitTransitionError(void 0,r.getState(),e),Promise.reject(e)}let o;try{o=this.#s(e,i)}catch(e){return Promise.reject(e)}return Do(this.#e,o,t)}#s(e,t){let n={name:t,params:Te(e.params,s),search:Te(e.search,o),path:e.path,context:{...e.context},transition:p};return _e(n)}#c(e){let t=this.#e;if(!t.getOptions().defaultRoute)return Promise.reject(Bo.code(n.ROUTE_NOT_FOUND)`no defaultRoute is configured — pass one to createRouter, or navigate to a route by name`);let r,i,a;this.#n++;try{({route:r,params:i,search:a}=t.resolveDefault())}catch(e){return Promise.reject(e)}finally{this.#n--}return r?typeof r==`string`?this.#a(r,i,a,e):Promise.reject(Bo.code(n.ROUTE_NOT_FOUND)`defaultRoute resolved to ${typeof r}, which cannot name a route`):Promise.reject(Bo.code(n.ROUTE_NOT_FOUND)`defaultRoute resolved to an empty name`)}};const Ho={},Uo=c(`router`,`start`),Wo=Object.freeze({replace:!0});function Go(e){return e instanceof g&&e.code===n.ROUTE_NOT_FOUND}var Ko=class{#e;setDependencies(e){this.#e=e}async start(e){let t=this.#e;if(t.isIdle())throw d(new g(n.TRANSITION_CANCELLED));let r=t.getOptions();if(typeof e!=`string`)throw Uo.type`path must be a string, got ${typeof e}`;let i=t.getRootPath(),a=t.matchPath(e);if(!a&&!r.allowNotFound){let t=new g(n.ROUTE_NOT_FOUND,{path:e});throw d(t)}if(t.completeStart(),a!==void 0&&t.getRootPath()!==i&&(a=t.matchPath(e),!a&&!r.allowNotFound))throw d(new g(n.ROUTE_NOT_FOUND,{path:e}));if(a)try{return await t.navigateToState(a,Wo)}catch(n){if(!r.allowNotFound||!Go(n))throw n;return t.navigateToNotFound(e)}return t.navigateToNotFound(e)}};const qo={},Jo=Object.create,Yo=Object.entries,Xo=Object.hasOwn,Zo=Object.values,Qo=new WeakMap;function $o(e,t,n){if(typeof n==`string`)return{target:n,when:void 0,update:void 0};let r=n.when,i=n.update;if(r!==void 0&&typeof r!=`function`)throw m.plain`transitions["${e}"]["${t}"].when is not a function`;if(i!==void 0&&typeof i!=`function`)throw m.plain`transitions["${e}"]["${t}"].update is not a function`;return{target:n.target,when:r,update:i}}function es(e){let t=Qo.get(e);if(t!==void 0)return t;let n=e,r=Jo(null);for(let[e,t]of Yo(n)){let n=Jo(null);for(let[r,i]of Yo(t))i!==void 0&&(n[r]=$o(e,r,i));r[e]=n}for(let e of Zo(r))for(let t of Zo(e))if(t!==void 0&&r[t.target]===void 0)throw m.plain`state "${t.target}" is not declared in config.transitions`;return Qo.set(e,r),r}var ts=class{#e;#t;#n=0;#r=null;#i;#a;#o=[];constructor(e){let t=e.initial;if(this.#e=t,this.#i=e.context,this.#a=es(e.transitions),this.#a[t]===void 0)throw m.plain`state "${t}" is not declared in config.transitions`;this.#t=this.#a[t]}send(e,t){let n=this.#t[e];if(n===void 0)return this.#e;let r=t,i=n.when;if(i!==void 0&&!i(this.#i,r))return this.#e;let a=n.target,o=n.update,s=this.#e;if(this.#e=a,this.#t=this.#a[a],o?.(this.#i,r),this.#r!==null){let t=this.#r.get(s)?.get(e);t!==void 0&&t(r)}if(this.#n>0){let t={from:s,to:a,event:e,payload:r};for(let e of this.#o)e!==null&&e(t)}return this.#e}canSend(e,t){let n=this.#t[e];return n===void 0?!1:n.when===void 0||n.when(this.#i,t)}getState(){return this.#e}getContext(){return this.#i}on(e,t,n){let r=this.#a[e];if(r===void 0)throw m.plain`state "${e}" is not declared in config.transitions`;if(!Xo(r,t))throw m.plain`event "${t}" has no edge from state "${e}"`;this.#r??=new Map;let i=this.#r.get(e);i||(i=new Map,this.#r.set(e,i));let a=n;return i.set(t,a),()=>{let n=this.#r?.get(e);n?.get(t)===a&&n.delete(t)}}onTransition(e){let t=this.#o.indexOf(null),n;t===-1?(n=this.#o.length,this.#o.push(e)):(this.#o[t]=e,n=t),this.#n++;let r=!0;return()=>{r&&(r=!1,this.#o[n]=null,this.#n--)}}};const Y={IDLE:`IDLE`,STARTING:`STARTING`,READY:`READY`,TRANSITION_STARTED:`TRANSITION_STARTED`,LEAVE_APPROVED:`LEAVE_APPROVED`,DISPOSED:`DISPOSED`},X={START:`START`,STARTED:`STARTED`,NAVIGATE:`NAVIGATE`,LEAVE_APPROVE:`LEAVE_APPROVE`,COMPLETE:`COMPLETE`,FAIL:`FAIL`,CANCEL:`CANCEL`,STOP:`STOP`,DISPOSE:`DISPOSE`,SYSTEM_COMMIT:`SYSTEM_COMMIT`};function ns(){return{inflight:void 0,current:void 0,previous:void 0}}const rs=(e,t)=>t?.nav===void 0||t.nav===e.inflight,is=(e,t)=>t!==void 0&&t===e.inflight&&t.externalSignal?.aborted!==!0,as=(e,t)=>{e.previous=e.current,e.current=_e(t)},os=(e,t)=>{as(e,t.toState),e.inflight=void 0},ss=(e,t)=>{as(e,t.toState)},cs=e=>{e.previous=e.current,e.current=void 0},Z=e=>{e.current=void 0,e.previous=void 0,e.inflight=void 0},ls=(e,t)=>{e.inflight=t},us={[Y.IDLE]:{[X.START]:Y.STARTING,[X.DISPOSE]:{target:Y.DISPOSED,update:Z}},[Y.STARTING]:{[X.STARTED]:Y.READY,[X.FAIL]:Y.IDLE,[X.STOP]:{target:Y.IDLE,update:cs},[X.DISPOSE]:{target:Y.DISPOSED,update:Z}},[Y.READY]:{[X.NAVIGATE]:{target:Y.TRANSITION_STARTED,update:ls},[X.SYSTEM_COMMIT]:{target:Y.READY,update:ss},[X.STOP]:{target:Y.IDLE,update:cs},[X.DISPOSE]:{target:Y.DISPOSED,update:Z}},[Y.TRANSITION_STARTED]:{[X.NAVIGATE]:{target:Y.TRANSITION_STARTED,update:ls},[X.LEAVE_APPROVE]:Y.LEAVE_APPROVED,[X.CANCEL]:Y.READY,[X.FAIL]:{target:Y.READY,when:rs},[X.DISPOSE]:{target:Y.DISPOSED,update:Z}},[Y.LEAVE_APPROVED]:{[X.NAVIGATE]:{target:Y.TRANSITION_STARTED,update:ls},[X.COMPLETE]:{target:Y.READY,when:is,update:os},[X.CANCEL]:Y.READY,[X.FAIL]:{target:Y.READY,when:rs},[X.DISPOSE]:{target:Y.DISPOSED,update:Z}},[Y.DISPOSED]:{}};function ds(){return new ts({initial:Y.IDLE,context:ns(),transitions:us})}const fs=c(`router`,`subscribe`),ps=c(`router`,`subscribeChanges`),ms=c(`router`,`subscribeDiagnostic`),hs=c(`router`,`subscribeLeave`),gs=Object.freeze,_s=`TREE_CHANGED`;function vs(e){return e instanceof Error?e:Error(String(e))}function ys(e,t,r){return new Promise((i,a)=>{let o=()=>{let e=r.reason;a(e instanceof g&&e.code===n.TRANSITION_CANCELLED?e:d(new g(n.TRANSITION_CANCELLED,{reason:e})))};r.aborted?(Promise.allSettled(e),o()):(r.addEventListener(`abort`,o,{once:!0}),Promise.allSettled(e).then(e=>{if(r.removeEventListener(`abort`,o),r.aborted)return;if(t!==void 0){a(vs(ro(t)));return}let n=e.find(e=>e.status===`rejected`);n===void 0?i():a(vs(ro(n.reason)))}))})}function bs(e,t,n){return e.addEventListener(`abort`,t,{once:!0}),()=>{n(),e.removeEventListener(`abort`,t)}}var xs=class{#e;#t;#n;#r=[];#i=0;constructor(e){this.#e=e.routerFSM,this.#t=e.emitter,this.#s()}static validateSubscribeListener(e){if(typeof e!=`function`)throw fs.type`Expected a function. For Observable pattern use observable(router) from @real-router/rx`}static validateSubscribeLeaveListener(e){if(typeof e!=`function`)throw hs.type`Expected a function`}emitRouterStart(){this.#i++;try{this.#t.emit(v.ROUTER_START)}finally{this.#i--}}emitRouterStop(){this.#t.emit(v.ROUTER_STOP)}emitTransitionStart(e,t,n){this.#i++;try{this.#t.emit(v.TRANSITION_START,e,t)}finally{this.#i--}}emitTransitionSuccess(e,t,n){this.#i++;try{this.#t.emit(v.TRANSITION_SUCCESS,e,t,n)}finally{this.#i--}}emitTransitionError(e,t,n){this.#i++;try{this.#t.emit(v.TRANSITION_ERROR,e,t,n)}finally{this.#i--}}emitTransitionCancel(e,t){this.#i++;try{this.#t.emit(v.TRANSITION_CANCEL,e,t)}finally{this.#i--}}emitTransitionLeaveApprove(e,t){this.#i++;try{this.#t.emit(v.TRANSITION_LEAVE_APPROVE,e,t)}finally{this.#i--}}dispatchAbort(e,t){if(e!==void 0){this.#i++;try{e.abort(t),i(e.signal.reason)}finally{this.#i--}}}isProcessing(){return this.#i>0}emitTreeChanged(e){this.#t.emit(_s,e)}isEmittingTreeChanged(){return this.#t.isDispatching(_s)}subscribeTreeChanged(e){if(this.isDisposed())throw ps.code(n.ROUTER_DISPOSED)`cannot subscribe on a disposed router — dispose() is terminal`;return this.#t.on(_s,t=>{e(t)})}emitDiagnostic(e,...t){this.#t.emit(e,...t)}subscribeDiagnostic(e,t){if(this.isDisposed())throw ms.code(n.ROUTER_DISPOSED)`cannot subscribe on a disposed router — dispose() is terminal`;return this.#t.on(e,(...e)=>{t(...e)})}treeChangedListenerCount(){return this.#t.listenerCount(_s)}sendStart(){this.#e.send(X.START)}sendStop(){this.#e.send(X.STOP)}sendStopForDispose(){this.#i++;try{this.#e.send(X.STOP)}finally{this.#i--}}sendDispose(){this.#e.send(X.DISPOSE)}sendStarted(){this.#e.send(X.STARTED)}sendNavigate(e){return this.#e.send(X.NAVIGATE,e)===Y.TRANSITION_STARTED}canCommitTransition(e){return this.#e.canSend(X.COMPLETE,e)}sendComplete(e){this.#e.send(X.COMPLETE,e)}sendLeaveApprove(e){this.#e.send(X.LEAVE_APPROVE,e)}sendFail(e,t,n){this.#e.send(X.FAIL,{nav:n,fromState:e,error:t})}sendCancel(e,t){this.#e.send(X.CANCEL,{fromState:e,reason:t})}systemCommit(e,t){let{toState:n}=e,r=n.transition,i={name:t,params:Te(n.params,s),search:Te(n.search,o),path:n.path,context:{...n.context},...r!=null&&{transition:Ee(r)}};if(!this.#e.canSend(X.SYSTEM_COMMIT))throw d(this.#o());return this.#e.send(X.SYSTEM_COMMIT,{...e,toState:i}),i}canBeginTransition(){return this.#e.canSend(X.NAVIGATE)}canStart(){return this.#e.canSend(X.START)}canCancel(){return this.#e.canSend(X.CANCEL)}isActive(){let e=this.#e.getState();return e!==Y.IDLE&&e!==Y.DISPOSED}isDisposed(){return this.#e.getState()===Y.DISPOSED}isTransitioning(){let e=this.#e.getState();return e===Y.TRANSITION_STARTED||e===Y.LEAVE_APPROVED}isLeaveApproved(){return this.#e.getState()===Y.LEAVE_APPROVED}isReady(){return this.#e.getState()===Y.READY}isStarting(){return this.#e.getState()===Y.STARTING}isIdle(){return this.#e.getState()===Y.IDLE}addEventListener(e,t,n){return this.#a(e,n),this.#t.on(e,t)}subscribe(e){if(this.isDisposed())throw fs.code(n.ROUTER_DISPOSED)`cannot subscribe on a disposed router — dispose() is terminal`;return this.#a(v.TRANSITION_SUCCESS,`subscribe`),this.#t.on(v.TRANSITION_SUCCESS,(t,n)=>e({route:t,previousRoute:n}))}subscribeLeave(e){if(this.isDisposed())throw hs.code(n.ROUTER_DISPOSED)`cannot subscribe on a disposed router — dispose() is terminal`;this.#r.push(e);let t=!1;return()=>{if(t)return;t=!0;let n=this.#r.indexOf(e);n!==-1&&this.#r.splice(n,1)}}hasLeaveListeners(){return this.#r.length>0}hasPreCommitListeners(){return this.#t.listenerCount(v.TRANSITION_START)>0||this.#t.listenerCount(v.TRANSITION_LEAVE_APPROVE)>0}awaitLeaveListeners(e,t,n){if(t===void 0)return;let r=gs({route:t,nextRoute:e,signal:n}),i,a,o=[...this.#r];this.#i++;try{for(let e of o)try{let t=e(r);t!==void 0&&typeof t.then==`function`&&(i??=[],i.push(t))}catch(e){a===void 0&&(a=e)}}finally{this.#i--}if(i===void 0){if(a!==void 0)throw vs(ro(a))}else return ys(i,a,n)}clearAll(){this.#t.clearAll(),this.#r.length=0}setLimits(e){this.#t.setLimits(e)}setValidatorAccessor(e){this.#n=e}sendCancelIfPossible(e,t){this.canCancel()&&this.sendCancel(e,t)}sendCancelIfInFlight(e,t,n){this.#e.getContext().inflight===e&&this.sendCancelIfPossible(t,n)}bridgeExternalSignal(e){let t=e.externalSignal;if(t===void 0||e.detachExternalBridge!==void 0)return qo;let n=bs(t,()=>{this.sendCancelIfPossible(this.#e.getContext().current,t.reason)},()=>{e.detachExternalBridge=void 0});return e.cancelReason===void 0?e.detachExternalBridge=n:n(),qo}#a(e,t){let n=this.#n?.();n&&n.eventBus.validateCountThresholds(this.#t.listenerCount(e)+1,e,t)}#o(){if(this.isDisposed())return new g(n.ROUTER_DISPOSED,{message:`[router] cannot commit a state on a disposed router — dispose() is terminal`});let e;return e=this.isTransitioning()?`[router] cannot commit a state while a transition is in flight — the navigation in progress commits its own`:this.isStarting()?`[router] cannot commit before the start navigation does — the boot would overwrite it; await start() first`:`[router] cannot commit a state before the router has started`,new g(n.ROUTER_NOT_STARTED,{message:e})}#s(){let e=this.#e;e.on(Y.STARTING,X.STARTED,()=>{this.emitRouterStart()}),e.on(Y.READY,X.STOP,()=>{this.emitRouterStop()});let t=e=>{let t=e.externalSignal!==void 0&&(this.hasLeaveListeners()||this.hasPreCommitListeners())?this.bridgeExternalSignal(e):qo;this.emitTransitionStart(e.toState,e.fromState,t)};e.on(Y.READY,X.NAVIGATE,t),e.on(Y.TRANSITION_STARTED,X.NAVIGATE,t),e.on(Y.LEAVE_APPROVED,X.NAVIGATE,t),e.on(Y.TRANSITION_STARTED,X.LEAVE_APPROVE,e=>{this.emitTransitionLeaveApprove(e.toState,e.fromState)}),e.on(Y.LEAVE_APPROVED,X.COMPLETE,e=>{e.detachExternalBridge?.(),this.emitTransitionSuccess(e.toState,e.fromState,e.opts)});let r=e=>{let{fromState:t,reason:r}=e,i=this.#e.getContext().inflight,a=r??d(new g(n.TRANSITION_CANCELLED));i.cancelReason=a,this.dispatchAbort(i.controller,a),i.detachExternalBridge?.(),this.emitTransitionCancel(i.toState,t)};e.on(Y.TRANSITION_STARTED,X.CANCEL,r),e.on(Y.LEAVE_APPROVED,X.CANCEL,r),e.on(Y.READY,X.SYSTEM_COMMIT,e=>{this.emitTransitionSuccess(e.toState,e.fromState,e.opts)});let i=e=>{let t=this.#e.getContext().inflight;t?.detachExternalBridge?.(),this.emitTransitionError(t?.toState,e.fromState,e.error)};e.on(Y.LEAVE_APPROVED,X.FAIL,i),e.on(Y.TRANSITION_STARTED,X.FAIL,i),e.on(Y.STARTING,X.FAIL,e=>{this.emitTransitionError(void 0,e.fromState,e.error)})}};const Ss=Object.freeze;function Cs(e){return Ts(e)&&!Object.isFrozen(e)&&e!==L.defaultParams&&e!==L.defaultSearch}function ws(e){let{defaultParams:t,defaultSearch:n}=e;return Ss({...Cs(t)&&{defaultParams:new WeakRef(t)},...Cs(n)&&{defaultSearch:new WeakRef(n)}})}function Ts(e){return typeof e==`object`&&!!e}function Es(e){let t={...e};return e.limits!=null&&(t.limits=O(`limits`,e.limits)),Ts(e.defaultParams)&&(t.defaultParams=O(`defaultParams`,e.defaultParams)),Ts(e.defaultSearch)&&(t.defaultSearch=O(`defaultSearch`,e.defaultSearch)),t}const Ds=Object.keys,Os=Object.freeze;function ks(e={}){let t={...a,...e};return Os({maxDependencies:Number(t.maxDependencies),maxPlugins:Number(t.maxPlugins),maxListeners:Number(t.maxListeners),warnListeners:Number(t.warnListeners),maxLifecycleHandlers:Number(t.maxLifecycleHandlers)})}function As(e){return e==null?void 0:Os(Ds(e))}const js=c(`router`),Ms=Object.freeze,Ns=Object.freeze({});function Ps(e,t){let n;try{n=t[e]}catch(t){throw js.type({cause:t})`Invalid "queryParams.${e}": reading it threw.`}if(n!=null){if(typeof n==`string`)return n;try{return String(n)}catch(t){throw js.type({cause:t})`Invalid "queryParams.${e}": its value cannot be converted to a string.`}}}function Fs(e){if(e==null)return`default`;try{return String(e)}catch(e){throw js.type({cause:e})`Invalid "urlParamsEncoding": coercing it threw.`}}function Is(e){if(!e)return Ns;let t=Ps(`arrayFormat`,e),n=Ps(`booleanFormat`,e),r=Ps(`nullFormat`,e),i=Ps(`numberFormat`,e);return Ms({...t!==void 0&&{arrayFormat:t},...n!==void 0&&{booleanFormat:n},...r!==void 0&&{nullFormat:r},...i!==void 0&&{numberFormat:i}})}function Ls(e){return Ms({strictTrailingSlash:e.trailingSlash===`strict`,caseSensitive:e.caseSensitive,strictQueryParams:e.queryParamsMode===`strict`,urlParamsEncoding:Fs(e.urlParamsEncoding),queryParams:Is(e.queryParams)})}const Rs=new g(n.ROUTER_ALREADY_STARTED);Object.freeze(Rs);const zs=c(`router`),Bs={maxListeners:0,warnListeners:0};var Vs=class{#e=new Map;#t=new Set;#n=null;#r=Bs;#i;#a;constructor(e){e?.limits&&(this.#r=e.limits),this.#i=e?.onListenerError??null,this.#a=e?.onListenerWarn??null}setLimits(e){this.#r=e}on(e,t){let n=this.#e.get(e),r=n?.size??0;if(n?.has(t))throw zs.plain`Duplicate listener for "${e}"`;let{maxListeners:i,warnListeners:a}=this.#r;if(i!==0&&r>=i)throw zs.plain`Listener limit (${i}) reached for "${e}"`;a!==0&&r===a&&this.#a!==null&&(this.#n??=new Set,this.#n.has(e)||(this.#a(e,a),this.#n.add(e)));let o=n;return o===void 0&&(o=new Set,this.#e.set(e,o)),o.add(t),()=>{this.off(e,t)}}off(e,t){let n=this.#e.get(e);n&&(n.delete(t),n.size===0&&(this.#e.delete(e),this.#n?.delete(e)))}emit(e,t,n,r,i){let a=this.#e.get(e);if(!a||a.size===0||this.#t.has(e))return;let o=arguments.length-1;this.#t.add(e);try{if(a.size===1){let[s]=a;this.#o(e,s,o,t,n,r,i)}else{let s=[...a];for(let a of s)this.#o(e,a,o,t,n,r,i)}}finally{this.#t.delete(e)}}clearAll(){this.#e.clear(),this.#n=null}listenerCount(e){return this.#e.get(e)?.size??0}isDispatching(e){return this.#t.has(e)}#o(e,t,n,r,i,a,o){try{let s=this.#s(t,n,r,i,a,o),c=s?.then;typeof c==`function`&&new Promise((e,t)=>{c.call(s,e,t)}).catch(t=>{this.#i?.(e,t)})}catch(t){this.#i?.(e,t)}}#s(e,t,n,r,i,a){switch(t){case 0:return e();case 1:return e(n);case 2:return e(n,r);case 3:return e(n,r,i);default:return e(n,r,i,a)}}};const Hs=Object.freeze({log:0,warn:1,error:2}),Us=Object.freeze({all:0,"warn-error":1,"error-only":2,none:3}),Ws=Object.hasOwn;var Gs=class{#e={level:`all`,callback:void 0,callbackIgnoresLevel:!1};#t=0;#n=!1;constructor(e){e&&this.configure(e)}isInCallback(){return this.#n}configure(e){let t=yr(e),n=t.level;n!==void 0&&(this.#e.level=n,this.#t=Us[n]),Ws(t,`callback`)&&(this.#e.callback=t.callback),t.callbackIgnoresLevel!==void 0&&(this.#e.callbackIgnoresLevel=t.callbackIgnoresLevel)}getConfig(){return{level:this.#e.level,callback:this.#e.callback,callbackIgnoresLevel:this.#e.callbackIgnoresLevel}}log(e,t,...n){this.#r(`log`,e,t,n)}warn(e,t,...n){this.#r(`warn`,e,t,n)}error(e,t,...n){this.#r(`error`,e,t,n)}#r(e,t,n,r){if(this.#e.level===`none`&&!this.#e.callbackIgnoresLevel)return;let i=Hs[e]<this.#t;i||this.#i(e,t,n,r),this.#a(e,t,n,i,r)}#i(e,t,n,r){if(typeof console<`u`&&typeof console[e]==`function`){let i=t?`[${t}] ${n}`:n;console[e](i,...r)}}#a(e,t,n,r,i){if(!(!this.#e.callback||!this.#e.callbackIgnoresLevel&&r)&&!this.#n){this.#n=!0;try{let r=this.#e.callback(e,t,n,...i);r!=null&&typeof r.then==`function`&&Promise.resolve(r).catch(e=>{this.#o(`[router] Error in async callback:`,e)})}catch(e){this.#o(`[router] Error in callback:`,e)}finally{this.#n=!1}}}#o(e,t){typeof console<`u`&&typeof console.error==`function`&&console.error(e,t)}};function Ks(e){let t=t=>Sr(e.dependenciesStore,t),n=qs(e.router,t),r=$s(e),i=()=>T(e.router).validator;Js(e),Ys(e,i),Xs(e,n,i),Zs(e,r,i,t),Qs(e,n,i),ec(e,r,t),tc(e),nc(e,r)}function qs(e,t){return n=>n(e,t)}function Js(e){e.eventBus.setLimits({maxListeners:e.limits.maxListeners,warnListeners:e.limits.warnListeners})}function Ys(e,t){e.eventBus.setValidatorAccessor(t)}function Xs(e,t,n){let r={logger:T(e.router).logger,compileFactory:t,getValidator:n};e.routeLifecycle.setDependencies(r)}function Zs(e,t,n,r){let i={logger:T(e.router).logger,getValidator:n,port:t,addActivateGuard:(t,n,r)=>{e.routeLifecycle.addCanActivate(t,n,!0,r)},addDeactivateGuard:(t,n,r)=>{e.routeLifecycle.addCanDeactivate(t,n,!0,r)},compileGuard:(t,n)=>e.routeLifecycle.compileGuardFactory(t,n),getState:()=>e.state.get(),areStatesEqual:(t,n,r)=>e.state.areStatesEqual(t,n,r),getDependency:r};e.routes.setDependencies(i),e.routes.setLifecycleNamespace(e.routeLifecycle)}function Qs(e,t,n){let r={logger:T(e.router).logger,addEventListener:(t,n)=>e.eventBus.addEventListener(t,n,`usePlugin`),canNavigate:()=>e.eventBus.canBeginTransition(),compileFactory:t,getValidator:n,emitDiagnostic:(t,...n)=>{e.eventBus.emitDiagnostic(t,...n)}};e.plugins.setDependencies(r)}function $s(e){let t=T(e.router),n=e.routes.getStore(),r=(e,n)=>{t.validator?.state.reportUndeclaredParamKey(e,n)},i=(e,n)=>{t.validator?.state.reportDroppedQueryKey(e,n)};return{resolveForward:(e,n,r)=>t.forwardState(e,n,r),defaultParams:e=>n.config.defaultParams[e],defaultSearch:e=>n.config.defaultSearch[e],buildPath:(t,n,r)=>e.routes.buildPath(t,n,r,e.options.get()),queryNames:t=>e.routes.getQueryParams(t),printedQueryNames:t=>e.routes.getPrintedQueryParams(t),pathNames:t=>e.routes.hasRoute(t)?e.routes.getUrlParams(t):void 0,admitsUndeclaredQuery:()=>kr(e.options.get().queryParamsMode)===`loose`,get reportDroppedQueryKey(){return t.validator?i:void 0},get reportUndeclaredParamKey(){return t.validator?r:void 0}}}function ec(e,t,n){let r=e=>n(e),i={logger:T(e.router).logger,getOptions:()=>e.options.get(),hasRoute:t=>e.routes.hasRoute(t),getQueryParams:t=>e.routes.getQueryParams(t),getMetaForState:t=>e.routes.getMetaForState(t),getState:()=>e.state.get(),buildNavigateState:(n,r,i)=>{T(e.router).validator?.routes.validateStateBuilderArgs(n,r,`navigate`);let a=R(t,n,r,i,{diagnoseUndeclared:!0});if(e.routes.getMetaForState(a.name)!==void 0)return x(`navigate`,a.name,a.path,t.queryNames(a.name)),B(a,z(a,t))},resolveDefault:()=>{let t=e.options.get(),n=T(e.router),i=Pr(t.defaultRoute,r),a=Pr(t.defaultParams,r),o=Pr(t.defaultSearch,r);return typeof t.defaultRoute==`function`&&n.validator?.options.validateResolvedDefaultRoute(i),{route:i,params:a,search:o}},startTransition:t=>e.eventBus.sendNavigate(t),systemCommit:(t,n,r)=>e.eventBus.systemCommit({toState:t,fromState:n,opts:r},t.name),cancelNavigation:t=>{e.eventBus.sendCancelIfPossible(e.state.get(),t)},cancelIfInFlight:(t,n)=>{e.eventBus.sendCancelIfInFlight(t,e.state.get(),n)},dispatchAbort:(t,n)=>{e.eventBus.dispatchAbort(t,n)},bridgeExternalSignal:t=>{e.eventBus.bridgeExternalSignal(t)},canCommitTransition:t=>e.eventBus.canCommitTransition(t)?Ho:void 0,sendTransitionDone:t=>{e.eventBus.sendComplete(t)},sendTransitionFail:(t,n,r)=>{e.eventBus.sendFail(t,n,r)},emitTransitionError:(t,n,r)=>{e.eventBus.emitTransitionError(t,n,r)},sendLeaveApprove:t=>{e.eventBus.sendLeaveApprove(t)},canNavigate:()=>e.eventBus.canBeginTransition(),isStarting:()=>e.eventBus.isStarting(),getLifecycleFunctions:()=>e.routeLifecycle.getFunctions(),warnNonBooleanGuard:(t,n)=>{T(e.router).validator?.lifecycle.warnNonBooleanGuard(t,n)},canDeactivateCurrent:(t,n,r)=>e.routeLifecycle.canNavigateTo(t,[],n,r,`navigateToNotFound`),isTransitioning:()=>e.eventBus.isTransitioning(),clearCanDeactivate:(t,n)=>{e.routeLifecycle.clearCanDeactivate(t,`external`)},hasLeaveListeners:()=>e.eventBus.hasLeaveListeners(),hasPreCommitListeners:()=>e.eventBus.hasPreCommitListeners(),awaitLeaveListeners:(t,n,r)=>e.eventBus.awaitLeaveListeners(t,n,r)};e.navigation.setDependencies(i)}function tc(e){e.lifecycle.setDependencies({getOptions:()=>e.options.get(),navigateToState:(t,n)=>e.navigation.navigateToState(t,n),navigateToNotFound:t=>e.navigation.navigateToNotFound(t),matchPath:t=>e.routes.matchPath(t,e.options.get()),getRootPath:()=>e.routes.getStore().rootPath,completeStart:()=>{e.eventBus.sendStarted()},isIdle:()=>e.eventBus.isIdle()})}function nc(e,t){e.state.setDependencies({port:()=>t,getUrlParams:t=>e.routes.getUrlParams(t)})}const rc=c(`router`,`navigateToNotFound`),ic=c(`router`,`usePlugin`),ac=c(`router`,`start`),Q=c(`router`);var oc=class e{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;constructor(t=[],r={},i={}){let{logger:a,...o}=r,c=new Gs(a?yr(a):void 0);this.#f=c,this.#p=e=>{Ja(e)||c.error(`router.start`,`Unexpected start error`,e)},Nr.validateOptionsIsObject(r),cr(i);let l=fr(t),f=Es(o);this.#r=ws(o),this.#e=new Nr(f),this.#t=ks(f.limits),this.#n=As(f.limits),this.#i=Tr(i,this.#t),this.#a=new Br,this.#o=new za(l,Ls(this.#e.get()),c),this.#s=new ei,this.#c=new qr,this.#l=new Vo,this.#u=new Ko;let p=ds();this.#a.setContext(p.getContext());let m=new Vs({onListenerError:(e,t)=>{c.error(`router`,`Error in listener for ${e}:`,t)},onListenerWarn:(e,t)=>{c.warn(`router`,`Event "${e}" has ${t} listeners — possible memory leak`)}});this.#d=new xs({routerFSM:p,emitter:m});let h=new Map,_=new Map,v=e=>{let t=e.params,n=e.search;return{name:e.name,params:t==null?t:D(t),search:n==null?n:D(n)}},y=ee(E.forwardState,(e,t,n)=>this.#o.forwardState(e,t,n),h,v,sc),b=((e,t,n)=>{let r=y(e,t,n),i=r.name,a=r.params;me(`forwardState`,i,a,this.#o.getQueryParams(i),()=>i===e?"the `params` bag leaving the forwardState chain":`the \`params\` bag leaving the forwardState chain (forwarded here from "${e}")`);let o=r.search,c=o==null;return{name:i,params:D(a??s),search:c?o:D(o)}}),x=ee(E.forwardState,(e,t,n)=>({name:e,params:t,search:n}),h,v,sc);this.#h=(e,t,n)=>{let r=x(e,t,n),i=r.params,a=r.search;return this.#o.buildPathFromIntent(r.name,i??s,a)},this.#m=ae(E.start,e=>this.#u.start(e),h);let S={logger:c,makeState:(e,t,n,r)=>{de(S,`makeState`,e,t);let i=A(t);return S.validator?.state.validateMakeStateArgs(e,i,r),S.validator?.navigation.validateSearch(n,`makeState`),this.#a.makeState(e,i,n,r)},getMetaForState:e=>this.#o.getMetaForState(e),getDeclaredQueryNames:e=>this.#o.getQueryParams(e),forwardState:b,buildStateResolved:(e,t)=>this.#o.buildStateResolved(e,t),buildPathResolved:(e,t,n)=>{let r=A(t);return S.validator?.navigation.validateParamsShape(t,`buildPathResolved`),S.validator?.navigation.validateSearch(n,`buildPathResolved`),C(S.checks,w[`buildPathResolved:params`],r),this.#o.buildPathFromIntent(e,r??s,n)},port:()=>this.#o.getPort(),matchPath:(e,t)=>(S.validator?.routes.validateMatchPathArgs(e),this.#o.matchPath(e,t??this.#e.get())),getOptions:()=>this.#e.get(),getAdoptedOrigins:()=>this.#r,addEventListener:(e,t)=>(oe(S.isDisposed),tr(e),nr(t),S.validator?.eventBus.validateListenerArgs(e,t),this.#d.addEventListener(e,t,`addEventListener`)),subscribeDiagnostic:(e,t)=>this.#d.subscribeDiagnostic(e,t),treeChanged:{emit:e=>{this.#d.emitTreeChanged(e)},subscribe:e=>this.#d.subscribeTreeChanged(e),listenerCount:()=>this.#d.treeChangedListenerCount(),isEmitting:()=>this.#d.isEmittingTreeChanged()},emitTransitionError:e=>{this.#d.emitTransitionError(void 0,this.#a.get(),e)},navigateToNotFound:e=>{if(this.#v(),e!==void 0&&typeof e!=`string`)throw rc.type`path must be a string, got ${typeof e}`;return this.#l.navigateToNotFound(e)},revalidateToNotFound:e=>(this.#y(),this.#l.revalidateToNotFound(e)),start:e=>this.start(e),navigateToState:(t,n)=>(oe(S.isDisposed),S.validator?.navigation.validateNavigateToStateArgs(t),n!==void 0&&S.validator?.navigation.validateNavigationOptions(n,`navigateToState`),this.#v(),e.#g(this.#l.navigateToState(t,n??u))),interceptors:h,checks:_,setRootPath:e=>{S.validator?.routes.validateSetRootPathArgs(e),this.#o.setRootPath(e)},getRootPath:()=>this.#o.getStore().rootPath,getTree:()=>this.#o.getStore().tree,isDisposed:()=>this.#d.isDisposed(),validator:null,dependenciesGetStore:()=>this.#i,getCloneState:()=>({options:{...this.#e.get()},dependencies:wr(this.#i),pluginFactories:this.#c.getAll(),loggerConfig:c.getConfig(),limits:this.#t,limitKeys:this.#n}),routeGetStore:()=>this.#o.getStore(),getStateName:()=>this.#a.get()?.name,isTransitioning:()=>this.#d.isTransitioning(),systemCommit:(e,t,r)=>{this.#y();let i=e.name;if(i!==`@@router/UNKNOWN_ROUTE`&&!this.#o.hasRoute(i))throw d(new g(n.ROUTE_NOT_FOUND,{routeName:i}));return this.#d.systemCommit({toState:e,fromState:t,opts:r},i)},routerExtensions:[],contextClaimRecords:new Map};le(this,S),Ks({router:this,options:this.#e,limits:this.#t,dependenciesStore:this.#i,state:this.#a,routes:this.#o,routeLifecycle:this.#s,plugins:this.#c,navigation:this.#l,lifecycle:this.#u,eventBus:this.#d}),this.isActiveRoute=this.isActiveRoute.bind(this),this.buildPath=this.buildPath.bind(this),this.getState=this.getState.bind(this),this.getPreviousState=this.getPreviousState.bind(this),this.areStatesEqual=this.areStatesEqual.bind(this),this.shouldUpdateNode=this.shouldUpdateNode.bind(this),this.isActive=this.isActive.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.dispose=this.dispose.bind(this),this.canNavigateTo=this.canNavigateTo.bind(this),this.usePlugin=this.usePlugin.bind(this),this.navigate=this.navigate.bind(this),this.navigateToDefault=this.navigateToDefault.bind(this),this.navigateToNotFound=this.navigateToNotFound.bind(this),this.subscribe=this.subscribe.bind(this),this.subscribeLeave=this.subscribeLeave.bind(this),this.isLeaveApproved=this.isLeaveApproved.bind(this);try{this.#o.flushPendingGuards()}catch(e){throw this.dispose(),e}}isActiveRoute(e,t,n,r,i){let a=T(this);return a.validator?.routes.validateIsActiveRouteArgs(e,t,r,i),a.validator?.navigation.validateSearch(n,`isActiveRoute`),a.validator?.routes.validateRouteName(e,`isActiveRoute`),e===``?(a.logger.warn(`router.isActiveRoute`,`isActiveRoute("") called with empty string. Root node is not considered a parent of any route.`),!1):this.#o.isActiveRoute(e,t,n,r,i)}buildPath(e,t,n){let r=T(this);r.validator?.routes.validateBuildPathArgs(e,t),r.validator?.navigation.validateParamsShape(t,`buildPath`),r.validator?.navigation.validateSearch(n,`buildPath`);let i=A(t);return C(r.checks,w[`buildPath:params`],i),this.#h(e,i??s,n)}getState(){return this.#a.get()}getPreviousState(){return this.#a.getPrevious()}areStatesEqual(e,t,n=!0){return T(this).validator?.state.validateAreStatesEqualArgs(e,t,n),this.#a.areStatesEqual(e,t,n)}shouldUpdateNode(e){return T(this).validator?.routes.validateShouldUpdateNodeArgs(e),za.shouldUpdateNode(e,e=>this.#o.getMetaForState(e))}isActive(){return this.#d.isActive()}start(e){let t=this.#_(e);return t.catch(this.#p),t}stop(){return this.#d.sendCancelIfPossible(this.#a.get()),!this.#d.isReady()&&!this.#d.isTransitioning()&&!this.#d.isStarting()||this.#d.sendStop(),this}dispose(){if(this.#d.isDisposed())return;this.#d.sendCancelIfPossible(this.#a.get()),(this.#d.isReady()||this.#d.isTransitioning())&&this.#d.sendStopForDispose(),this.#d.sendDispose(),this.#d.clearAll(),this.#c.disposeAll();let e=T(this);for(let t of e.routerExtensions)for(let e of t.keys)delete this[e];e.routerExtensions.length=0,e.contextClaimRecords.clear(),e.interceptors.clear(),e.checks.clear(),this.#o.clearRoutes(),this.#s.clearAll(),Cr(this.#i),this.#x()}canNavigateTo(e,t,n){let r=T(this);C(r.checks,w[`canNavigateTo:entry`],e,t,n);let i;try{i=A(t)}catch(t){return r.logger.warn(`router.canNavigateTo`,`Reading the params bag for route "${e}" threw; treating the route as unreachable.`,t),!1}if(C(r.checks,w[`canNavigateTo:params`],i),!this.#o.hasRoute(e)||b(t,this.#o.getQueryParams(e))!==void 0)return!1;let a=this.#o.getPort(),o;try{o=R(a,e,i??s,n)}catch(t){return r.logger.warn(`router.canNavigateTo`,`Resolving route "${e}" threw while answering the predicate; treating the route as unreachable.`,t),!1}let c;try{c=B(o,z(o,a))}catch{return!1}let l=this.#a.get(),{toDeactivate:u,toActivate:d}=Na(c,l,e=>this.#o.getMetaForState(e));return this.#s.canNavigateTo(u,d,c,l,`canNavigateTo`)}usePlugin(...e){if(this.#d.isDisposed())throw ic.code(n.ROUTER_DISPOSED)`cannot install a plugin on a disposed router — dispose() is terminal`;let t=e.filter(Boolean);if(t.length===0)return()=>{};let r=T(this);r.validator?.plugins.validatePluginLimit(this.#c.count(),this.#t);for(let e of t)r.validator?.plugins.validateNoDuplicatePlugins(e,this.#c.getAll());return this.#c.use(...t)}subscribe(e){return xs.validateSubscribeListener(e),this.#d.subscribe(e)}subscribeLeave(e){return xs.validateSubscribeLeaveListener(e),this.#d.subscribeLeave(e)}isLeaveApproved(){return this.#d.isLeaveApproved()}navigate(t,n,r,i){this.#v();let a=T(this),o,c,l,d;typeof t==`object`&&t?(o=t.name,c=t.params,l=t.search,d=n??u):(o=t,c=n,l=r,d=i??u),de(a,`navigate`,o,c),C(a.checks,w[`navigate:entry`],o,c,l,d);let f;try{f=A(c)}catch(e){return Promise.reject(e)}return C(a.checks,w[`navigate:params`],f),e.#g(this.#l.navigate(o,f??s,l,d))}navigateToDefault(t){this.#v();let n=T(this);n.validator?.navigation.validateNavigateToDefaultArgs(t);let r=t??u;return n.validator?.navigation.validateNavigationOptions(r,`navigateToDefault`),e.#g(this.#l.navigateToDefault(r))}navigateToNotFound(e){if(this.#v(),!this.#d.isActive())throw d(new g(n.ROUTER_NOT_STARTED));if(e!==void 0&&typeof e!=`string`)throw rc.type`path must be a string, got ${typeof e}`;if(e!==void 0)return this.#l.navigateToNotFound(e);let t=this.#a.get();if(t===void 0)throw rc.code(n.ROUTER_NOT_STARTED)`cannot derive the path before the start navigation commits — pass an explicit path`;return this.#l.navigateToNotFound(t.path)}static#g(e){return e instanceof Promise?e:Promise.resolve(e)}#_(e){if(!this.#d.canStart())return Promise.reject(Rs);this.#v(),T(this).validator?.navigation.validateStartArgs(e),this.#d.sendStart();let t;try{let n=this.#m(e);t=typeof n?.then==`function`?n:Promise.reject(ac.type`a \`start\` interceptor returned without calling next(). Every start interceptor must return \`next(path)\`.`)}catch(e){t=Promise.reject(e)}return t.catch(e=>this.#b(e))}#v(){if(this.#f.isInCallback())throw Q.code(n.REENTRANT_NAVIGATION)`cannot start a navigation from inside the logger's callback — core logs from the middle of its own operations, and a navigation started there would run inside the one being logged. Defer it: queueMicrotask(() => router.navigate(...)).`;if(this.#d.isProcessing())throw Q.code(n.REENTRANT_NAVIGATION)`cannot start a navigation from inside a router event listener or an abort listener of a navigation's signal — the nested navigation would commit a state the outer one overwrites. Defer it: queueMicrotask(() => router.navigate(...)), await the current transition, or use an async listener.`;if(this.#l.isPreparing())throw Q.code(n.REENTRANT_NAVIGATION)`cannot start a navigation from inside a forwardState interceptor, a route's encodeParams or dynamic forwardTo callback, or a defaultRoute/defaultParams/defaultSearch option callback — they run while a navigation is being prepared, before it is announced. Defer it: queueMicrotask(() => router.navigate(...)).`;if(this.#l.isCommittingNotFound())throw Q.code(n.REENTRANT_NAVIGATION)`cannot start a navigation from inside a canDeactivate guard that navigateToNotFound() consults — the 404 commits from the state read before the guard was asked. A guard does not redirect: return false to stay, or defer the navigation: queueMicrotask(() => router.navigate(...)).`;if(this.#o.isRevalidating())throw Q.code(n.REENTRANT_NAVIGATION)`cannot start a navigation from inside replace()'s revalidation — the revalidation would then defer to a commit that may never happen. Defer it: queueMicrotask(() => router.navigate(...)).`}#y(){this.#o.isRevalidating()||this.#v()}#b(e){throw this.#d.isReady()&&this.#a.get()===void 0?this.#d.sendStop():this.#d.isStarting()&&this.#d.sendFail(void 0,e),e}#x(){this.navigate=$,this.navigateToDefault=$,this.navigateToNotFound=$,this.start=$,this.stop=$,this.usePlugin=$,this.subscribe=$,this.subscribeLeave=$,this.canNavigateTo=$}};function $(){throw Q.code(n.ROUTER_DISPOSED)`this router is disposed — dispose() is terminal and swapped every method to refuse`}function sc(e,t,n){return[e,A(t),A(n)]}export{xr as A,yi as C,Cr as D,R as E,rr as F,fr as I,dr as L,ur as M,ir as N,Sr as O,or as P,cn as R,pi as S,z as T,Ri as _,ta as a,si as b,ea as c,Qi as d,ra as f,oa as g,Li as h,sa as i,ar as j,wr as k,Zi as l,la as m,Na as n,$i as o,ia as p,W as r,Yi as s,oc as t,Xi as u,Ei as v,B as w,mi as x,wi as y,ln as z};
|
|
2
|
+
//# sourceMappingURL=Router-_DZAf0c_.mjs.map
|