@real-router/core 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/Router-73rMK2YI.d.ts +409 -0
  2. package/dist/cjs/Router-NL2_9FQk.js +6 -0
  3. package/dist/cjs/Router-NL2_9FQk.js.map +1 -0
  4. package/dist/cjs/RouterError-BkgjTHQg.js +2 -0
  5. package/dist/cjs/RouterError-BkgjTHQg.js.map +1 -0
  6. package/dist/cjs/RouterValidator-TUi8eT8Q.d.ts +112 -0
  7. package/dist/cjs/api.d.ts +17 -12
  8. package/dist/cjs/api.js +2 -1
  9. package/dist/cjs/api.js.map +1 -1
  10. package/dist/cjs/getPluginApi-BXrM_Nwv.js +2 -0
  11. package/dist/cjs/getPluginApi-BXrM_Nwv.js.map +1 -0
  12. package/dist/cjs/index.d.ts +206 -196
  13. package/dist/cjs/index.js +2 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/internals-na15rxo_.js +2 -0
  16. package/dist/cjs/internals-na15rxo_.js.map +1 -0
  17. package/dist/cjs/utils.d.ts +6 -3
  18. package/dist/cjs/utils.js +2 -1
  19. package/dist/cjs/utils.js.map +1 -1
  20. package/dist/cjs/validation.d.ts +153 -152
  21. package/dist/cjs/validation.js +1 -1
  22. package/dist/esm/Router-BhDMI4UX.d.mts +409 -0
  23. package/dist/esm/Router-CUi2TqAr.mjs +6 -0
  24. package/dist/esm/Router-CUi2TqAr.mjs.map +1 -0
  25. package/dist/esm/RouterError-D0RlQE_5.mjs +2 -0
  26. package/dist/esm/RouterError-D0RlQE_5.mjs.map +1 -0
  27. package/dist/esm/RouterValidator-DphcVMEp.d.mts +112 -0
  28. package/dist/esm/api.d.mts +17 -12
  29. package/dist/esm/api.mjs +2 -1
  30. package/dist/esm/api.mjs.map +1 -1
  31. package/dist/esm/getPluginApi-D0bBPuLp.mjs +2 -0
  32. package/dist/esm/getPluginApi-D0bBPuLp.mjs.map +1 -0
  33. package/dist/esm/index.d.mts +206 -196
  34. package/dist/esm/index.mjs +2 -1
  35. package/dist/esm/index.mjs.map +1 -1
  36. package/dist/esm/internals-CCymabFj.mjs +2 -0
  37. package/dist/esm/internals-CCymabFj.mjs.map +1 -0
  38. package/dist/esm/utils.d.mts +6 -3
  39. package/dist/esm/utils.mjs +2 -1
  40. package/dist/esm/utils.mjs.map +1 -1
  41. package/dist/esm/validation.d.mts +153 -152
  42. package/dist/esm/validation.mjs +1 -1
  43. package/package.json +5 -7
  44. package/src/helpers.ts +9 -6
  45. package/src/namespaces/OptionsNamespace/constants.ts +3 -5
  46. package/dist/cjs/Router-DoJ3NWsT.d.ts +0 -46
  47. package/dist/cjs/RouterValidator-CaIeCVeB.d.ts +0 -136
  48. package/dist/cjs/index.d-y2b-8_3Y.d.ts +0 -236
  49. package/dist/cjs/metafile-cjs.json +0 -1
  50. package/dist/cjs/validation.js.map +0 -1
  51. package/dist/esm/Router-DoJ3NWsT.d.mts +0 -46
  52. package/dist/esm/RouterValidator-CaIeCVeB.d.mts +0 -136
  53. package/dist/esm/chunk-EPF2YSMX.mjs +0 -1
  54. package/dist/esm/chunk-EPF2YSMX.mjs.map +0 -1
  55. package/dist/esm/chunk-UPJLWPEL.mjs +0 -1
  56. package/dist/esm/chunk-UPJLWPEL.mjs.map +0 -1
  57. package/dist/esm/chunk-UUG7DSTN.mjs +0 -1
  58. package/dist/esm/chunk-UUG7DSTN.mjs.map +0 -1
  59. package/dist/esm/chunk-XQJDGUQE.mjs +0 -1
  60. package/dist/esm/chunk-XQJDGUQE.mjs.map +0 -1
  61. package/dist/esm/index.d-y2b-8_3Y.d.mts +0 -236
  62. package/dist/esm/metafile-esm.json +0 -1
  63. package/dist/esm/validation.mjs.map +0 -1
@@ -1,9 +1,8 @@
1
- export { B as BuildStateResultWithSegments, R as RouterValidator } from './RouterValidator-CaIeCVeB.mjs';
2
- import { R as Router } from './Router-DoJ3NWsT.mjs';
3
- import { ErrorCodeKeys, ErrorCodeValues, ErrorCodeToValueMap, EventToNameMap, State, DefaultDependencies, Route, Options, Router as Router$1, Navigator } from '@real-router/types';
4
- export { Config, DefaultDependencies, GuardFn, GuardFnFactory, Listener, NavigationOptions, Navigator, Options, Params, Plugin, PluginFactory, Route, RouteConfigUpdate, SimpleState, State, SubscribeFn, SubscribeState, Subscription, Unsubscribe } from '@real-router/types';
5
- export { R as RouteTree } from './index.d-y2b-8_3Y.mjs';
1
+ import { c as RouteConfigUpdate, f as RouteTree, i as GuardFnFactory, n as BuildStateResultWithSegments, o as PluginFactory, s as Route, t as Router } from "./Router-BhDMI4UX.mjs";
2
+ import { t as RouterValidator } from "./RouterValidator-DphcVMEp.mjs";
3
+ import { Config, DefaultDependencies, DefaultDependencies as DefaultDependencies$1, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventToNameMap, GuardFn, Listener, NavigationOptions, Navigator, Navigator as Navigator$1, Options, Options as Options$1, Params, Plugin, Router as Router$1, SimpleState, State, State as State$1, SubscribeFn, SubscribeState, Subscription, Unsubscribe } from "@real-router/types";
6
4
 
5
+ //#region src/constants.d.ts
7
6
  type ConstantsKeys = "UNKNOWN_ROUTE";
8
7
  type Constants = Record<ConstantsKeys, string>;
9
8
  type ErrorCodes = Record<ErrorCodeKeys, ErrorCodeValues>;
@@ -24,194 +23,202 @@ declare const constants: Constants;
24
23
  * Used with addEventListener/removeEventListener for reactive subscriptions.
25
24
  */
26
25
  declare const events: EventToNameMap;
27
-
26
+ //#endregion
27
+ //#region src/RouterError.d.ts
28
28
  declare class RouterError extends Error {
29
+ [key: string]: unknown;
30
+ readonly segment: string | undefined;
31
+ readonly path: string | undefined;
32
+ readonly redirect: State$1 | undefined;
33
+ code: string;
34
+ /**
35
+ * Creates a new RouterError instance.
36
+ *
37
+ * The options object accepts built-in fields (message, segment, path, redirect)
38
+ * and any additional custom fields, which will all be attached to the error instance.
39
+ *
40
+ * @param code - The error code (e.g., "ROUTE_NOT_FOUND", "CANNOT_ACTIVATE")
41
+ * @param options - Optional configuration object
42
+ * @param options.message - Custom error message (defaults to code if not provided)
43
+ * @param options.segment - The route segment where the error occurred
44
+ * @param options.path - The full path where the error occurred
45
+ * @param options.redirect - Optional redirect state for navigation errors
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * // Basic error
50
+ * const err1 = new RouterError("ROUTE_NOT_FOUND");
51
+ *
52
+ * // Error with custom message
53
+ * const err2 = new RouterError("ERR", { message: "Something went wrong" });
54
+ *
55
+ * // Error with context and custom fields
56
+ * const err3 = new RouterError("CANNOT_ACTIVATE", {
57
+ * message: "Insufficient permissions",
58
+ * segment: "admin",
59
+ * path: "/admin/users",
60
+ * userId: "123" // custom field
61
+ * });
62
+ *
63
+ * // Error with redirect
64
+ * const err4 = new RouterError("TRANSITION_ERR", {
65
+ * redirect: { name: "home", path: "/", params: {} }
66
+ * });
67
+ * ```
68
+ */
69
+ constructor(code: string, {
70
+ message,
71
+ segment,
72
+ path,
73
+ redirect,
74
+ ...rest
75
+ }?: {
29
76
  [key: string]: unknown;
30
- readonly segment: string | undefined;
31
- readonly path: string | undefined;
32
- readonly redirect: State | undefined;
33
- code: string;
34
- /**
35
- * Creates a new RouterError instance.
36
- *
37
- * The options object accepts built-in fields (message, segment, path, redirect)
38
- * and any additional custom fields, which will all be attached to the error instance.
39
- *
40
- * @param code - The error code (e.g., "ROUTE_NOT_FOUND", "CANNOT_ACTIVATE")
41
- * @param options - Optional configuration object
42
- * @param options.message - Custom error message (defaults to code if not provided)
43
- * @param options.segment - The route segment where the error occurred
44
- * @param options.path - The full path where the error occurred
45
- * @param options.redirect - Optional redirect state for navigation errors
46
- *
47
- * @example
48
- * ```typescript
49
- * // Basic error
50
- * const err1 = new RouterError("ROUTE_NOT_FOUND");
51
- *
52
- * // Error with custom message
53
- * const err2 = new RouterError("ERR", { message: "Something went wrong" });
54
- *
55
- * // Error with context and custom fields
56
- * const err3 = new RouterError("CANNOT_ACTIVATE", {
57
- * message: "Insufficient permissions",
58
- * segment: "admin",
59
- * path: "/admin/users",
60
- * userId: "123" // custom field
61
- * });
62
- *
63
- * // Error with redirect
64
- * const err4 = new RouterError("TRANSITION_ERR", {
65
- * redirect: { name: "home", path: "/", params: {} }
66
- * });
67
- * ```
68
- */
69
- constructor(code: string, { message, segment, path, redirect, ...rest }?: {
70
- [key: string]: unknown;
71
- message?: string | undefined;
72
- segment?: string | undefined;
73
- path?: string | undefined;
74
- redirect?: State | undefined;
75
- });
76
- /**
77
- * Updates the error code and conditionally updates the message.
78
- *
79
- * If the current message is one of the standard error code values
80
- * (e.g., "ROUTE_NOT_FOUND", "SAME_STATES"), it will be replaced with the new code.
81
- * This allows keeping error messages in sync with codes when using standard error codes.
82
- *
83
- * If the message is custom (not a standard error code), it will be preserved.
84
- *
85
- * @param newCode - The new error code to set
86
- *
87
- * @example
88
- * // Message follows code (standard error code as message)
89
- * const err = new RouterError("ROUTE_NOT_FOUND", { message: "ROUTE_NOT_FOUND" });
90
- * err.setCode("CUSTOM_ERROR"); // message becomes "CUSTOM_ERROR"
91
- *
92
- * @example
93
- * // Custom message is preserved
94
- * const err = new RouterError("ERR", { message: "Custom error message" });
95
- * err.setCode("NEW_CODE"); // message stays "Custom error message"
96
- */
97
- setCode(newCode: string): void;
98
- /**
99
- * Copies properties from another Error instance to this RouterError.
100
- *
101
- * This method updates the message, cause, and stack trace from the provided error.
102
- * Useful for wrapping native errors while preserving error context.
103
- *
104
- * @param err - The Error instance to copy properties from
105
- * @throws {TypeError} If err is null or undefined
106
- *
107
- * @example
108
- * ```typescript
109
- * const routerErr = new RouterError("TRANSITION_ERR");
110
- * try {
111
- * // some operation that might fail
112
- * } catch (nativeErr) {
113
- * routerErr.setErrorInstance(nativeErr);
114
- * throw routerErr;
115
- * }
116
- * ```
117
- */
118
- setErrorInstance(err: Error): void;
119
- /**
120
- * Adds custom fields to the error object.
121
- *
122
- * This method allows attaching arbitrary data to the error for debugging or logging purposes.
123
- * All fields become accessible as properties on the error instance and are included in JSON serialization.
124
- *
125
- * Reserved method names (setCode, setErrorInstance, setAdditionalFields, hasField, getField, toJSON)
126
- * are automatically filtered out to prevent accidental overwriting of class methods.
127
- *
128
- * @param fields - Object containing custom fields to add to the error
129
- *
130
- * @example
131
- * ```typescript
132
- * const err = new RouterError("CANNOT_ACTIVATE");
133
- * err.setAdditionalFields({
134
- * userId: "123",
135
- * attemptedRoute: "/admin",
136
- * reason: "insufficient permissions"
137
- * });
138
- *
139
- * console.log(err.userId); // "123"
140
- * console.log(JSON.stringify(err)); // includes all custom fields
141
- * ```
142
- */
143
- setAdditionalFields(fields: Record<string, unknown>): void;
144
- /**
145
- * Checks if a custom field exists on the error object.
146
- *
147
- * This method checks for both custom fields added via setAdditionalFields()
148
- * and built-in fields (code, message, segment, etc.).
149
- *
150
- * @param key - The field name to check
151
- * @returns `true` if the field exists, `false` otherwise
152
- *
153
- * @example
154
- * ```typescript
155
- * const err = new RouterError("ERR", { segment: "users" });
156
- * err.setAdditionalFields({ userId: "123" });
157
- *
158
- * err.hasField("userId"); // true
159
- * err.hasField("segment"); // true
160
- * err.hasField("unknown"); // false
161
- * ```
162
- */
163
- hasField(key: string): boolean;
164
- /**
165
- * Retrieves a custom field value from the error object.
166
- *
167
- * This method can access both custom fields and built-in fields.
168
- * Returns `undefined` if the field doesn't exist.
169
- *
170
- * @param key - The field name to retrieve
171
- * @returns The field value, or `undefined` if it doesn't exist
172
- *
173
- * @example
174
- * ```typescript
175
- * const err = new RouterError("ERR");
176
- * err.setAdditionalFields({ userId: "123", role: "admin" });
177
- *
178
- * err.getField("userId"); // "123"
179
- * err.getField("role"); // "admin"
180
- * err.getField("code"); // "ERR" (built-in field)
181
- * err.getField("unknown"); // undefined
182
- * ```
183
- */
184
- getField(key: string): unknown;
185
- /**
186
- * Serializes the error to a JSON-compatible object.
187
- *
188
- * This method is automatically called by JSON.stringify() and includes:
189
- * - Built-in fields: code, message, segment (if set), path (if set), redirect (if set)
190
- * - All custom fields added via setAdditionalFields() or constructor
191
- * - Excludes: stack trace (for security/cleanliness)
192
- *
193
- * @returns A plain object representation of the error, suitable for JSON serialization
194
- *
195
- * @example
196
- * ```typescript
197
- * const err = new RouterError("ROUTE_NOT_FOUND", {
198
- * message: "Route not found",
199
- * path: "/admin/users/123"
200
- * });
201
- * err.setAdditionalFields({ userId: "123" });
202
- *
203
- * JSON.stringify(err);
204
- * // {
205
- * // "code": "ROUTE_NOT_FOUND",
206
- * // "message": "Route not found",
207
- * // "path": "/admin/users/123",
208
- * // "userId": "123"
209
- * // }
210
- * ```
211
- */
212
- toJSON(): Record<string, unknown>;
77
+ message?: string | undefined;
78
+ segment?: string | undefined;
79
+ path?: string | undefined;
80
+ redirect?: State$1 | undefined;
81
+ });
82
+ /**
83
+ * Updates the error code and conditionally updates the message.
84
+ *
85
+ * If the current message is one of the standard error code values
86
+ * (e.g., "ROUTE_NOT_FOUND", "SAME_STATES"), it will be replaced with the new code.
87
+ * This allows keeping error messages in sync with codes when using standard error codes.
88
+ *
89
+ * If the message is custom (not a standard error code), it will be preserved.
90
+ *
91
+ * @param newCode - The new error code to set
92
+ *
93
+ * @example
94
+ * // Message follows code (standard error code as message)
95
+ * const err = new RouterError("ROUTE_NOT_FOUND", { message: "ROUTE_NOT_FOUND" });
96
+ * err.setCode("CUSTOM_ERROR"); // message becomes "CUSTOM_ERROR"
97
+ *
98
+ * @example
99
+ * // Custom message is preserved
100
+ * const err = new RouterError("ERR", { message: "Custom error message" });
101
+ * err.setCode("NEW_CODE"); // message stays "Custom error message"
102
+ */
103
+ setCode(newCode: string): void;
104
+ /**
105
+ * Copies properties from another Error instance to this RouterError.
106
+ *
107
+ * This method updates the message, cause, and stack trace from the provided error.
108
+ * Useful for wrapping native errors while preserving error context.
109
+ *
110
+ * @param err - The Error instance to copy properties from
111
+ * @throws {TypeError} If err is null or undefined
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const routerErr = new RouterError("TRANSITION_ERR");
116
+ * try {
117
+ * // some operation that might fail
118
+ * } catch (nativeErr) {
119
+ * routerErr.setErrorInstance(nativeErr);
120
+ * throw routerErr;
121
+ * }
122
+ * ```
123
+ */
124
+ setErrorInstance(err: Error): void;
125
+ /**
126
+ * Adds custom fields to the error object.
127
+ *
128
+ * This method allows attaching arbitrary data to the error for debugging or logging purposes.
129
+ * All fields become accessible as properties on the error instance and are included in JSON serialization.
130
+ *
131
+ * Reserved method names (setCode, setErrorInstance, setAdditionalFields, hasField, getField, toJSON)
132
+ * are automatically filtered out to prevent accidental overwriting of class methods.
133
+ *
134
+ * @param fields - Object containing custom fields to add to the error
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * const err = new RouterError("CANNOT_ACTIVATE");
139
+ * err.setAdditionalFields({
140
+ * userId: "123",
141
+ * attemptedRoute: "/admin",
142
+ * reason: "insufficient permissions"
143
+ * });
144
+ *
145
+ * console.log(err.userId); // "123"
146
+ * console.log(JSON.stringify(err)); // includes all custom fields
147
+ * ```
148
+ */
149
+ setAdditionalFields(fields: Record<string, unknown>): void;
150
+ /**
151
+ * Checks if a custom field exists on the error object.
152
+ *
153
+ * This method checks for both custom fields added via setAdditionalFields()
154
+ * and built-in fields (code, message, segment, etc.).
155
+ *
156
+ * @param key - The field name to check
157
+ * @returns `true` if the field exists, `false` otherwise
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * const err = new RouterError("ERR", { segment: "users" });
162
+ * err.setAdditionalFields({ userId: "123" });
163
+ *
164
+ * err.hasField("userId"); // true
165
+ * err.hasField("segment"); // true
166
+ * err.hasField("unknown"); // false
167
+ * ```
168
+ */
169
+ hasField(key: string): boolean;
170
+ /**
171
+ * Retrieves a custom field value from the error object.
172
+ *
173
+ * This method can access both custom fields and built-in fields.
174
+ * Returns `undefined` if the field doesn't exist.
175
+ *
176
+ * @param key - The field name to retrieve
177
+ * @returns The field value, or `undefined` if it doesn't exist
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * const err = new RouterError("ERR");
182
+ * err.setAdditionalFields({ userId: "123", role: "admin" });
183
+ *
184
+ * err.getField("userId"); // "123"
185
+ * err.getField("role"); // "admin"
186
+ * err.getField("code"); // "ERR" (built-in field)
187
+ * err.getField("unknown"); // undefined
188
+ * ```
189
+ */
190
+ getField(key: string): unknown;
191
+ /**
192
+ * Serializes the error to a JSON-compatible object.
193
+ *
194
+ * This method is automatically called by JSON.stringify() and includes:
195
+ * - Built-in fields: code, message, segment (if set), path (if set), redirect (if set)
196
+ * - All custom fields added via setAdditionalFields() or constructor
197
+ * - Excludes: stack trace (for security/cleanliness)
198
+ *
199
+ * @returns A plain object representation of the error, suitable for JSON serialization
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * const err = new RouterError("ROUTE_NOT_FOUND", {
204
+ * message: "Route not found",
205
+ * path: "/admin/users/123"
206
+ * });
207
+ * err.setAdditionalFields({ userId: "123" });
208
+ *
209
+ * JSON.stringify(err);
210
+ * // {
211
+ * // "code": "ROUTE_NOT_FOUND",
212
+ * // "message": "Route not found",
213
+ * // "path": "/admin/users/123",
214
+ * // "userId": "123"
215
+ * // }
216
+ * ```
217
+ */
218
+ toJSON(): Record<string, unknown>;
213
219
  }
214
-
220
+ //#endregion
221
+ //#region src/createRouter.d.ts
215
222
  /**
216
223
  * Creates a new router instance.
217
224
  *
@@ -228,10 +235,13 @@ declare class RouterError extends Error {
228
235
  *
229
236
  * router.start('/');
230
237
  */
231
- declare const createRouter: <Dependencies extends DefaultDependencies = DefaultDependencies>(routes?: Route<Dependencies>[], options?: Partial<Options>, dependencies?: Dependencies) => Router<Dependencies>;
232
-
233
- declare const getNavigator: <Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router$1<Dependencies>) => Navigator;
234
-
238
+ declare const createRouter: <Dependencies extends DefaultDependencies$1 = DefaultDependencies$1>(routes?: Route<Dependencies>[], options?: Partial<Options$1>, dependencies?: Dependencies) => Router<Dependencies>;
239
+ //#endregion
240
+ //#region src/getNavigator.d.ts
241
+ declare const getNavigator: <Dependencies extends DefaultDependencies$1 = DefaultDependencies$1>(router: Router$1<Dependencies>) => Navigator$1;
242
+ //#endregion
243
+ //#region src/namespaces/RoutesNamespace/forwardChain.d.ts
235
244
  declare function resolveForwardChain(startRoute: string, forwardMap: Record<string, string>, maxDepth?: number): string;
236
-
237
- export { type Constants, type ErrorCodes, Router, RouterError, UNKNOWN_ROUTE, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
245
+ //#endregion
246
+ export { type BuildStateResultWithSegments, type Config, type Constants, type DefaultDependencies, type ErrorCodes, type GuardFn, type GuardFnFactory, type Listener, type NavigationOptions, type Navigator, type Options, type Params, type Plugin, type PluginFactory, type Route, type RouteConfigUpdate, type RouteTree, Router, RouterError, type RouterValidator, type SimpleState, type State, type SubscribeFn, type SubscribeState, type Subscription, UNKNOWN_ROUTE, type Unsubscribe, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
247
+ //# sourceMappingURL=index.d.mts.map
@@ -1 +1,2 @@
1
- import{Router as e}from"./chunk-XQJDGUQE.mjs";export{Router,resolveForwardChain}from"./chunk-XQJDGUQE.mjs";export{RouterError,UNKNOWN_ROUTE,constants,errorCodes,events}from"./chunk-EPF2YSMX.mjs";import"./chunk-UUG7DSTN.mjs";var t=(t=[],r={},o={})=>new e(t,r,o),r=new WeakMap,o=e=>{let t=r.get(e);return t||(t=Object.freeze({navigate:e.navigate,getState:e.getState,isActiveRoute:e.isActiveRoute,canNavigateTo:e.canNavigateTo,subscribe:e.subscribe}),r.set(e,t)),t};export{t as createRouter,o as getNavigator};//# sourceMappingURL=index.mjs.map
1
+ import{a as e,t}from"./Router-CUi2TqAr.mjs";import{c as n,l as r,o as i,s as a,t as o}from"./RouterError-D0RlQE_5.mjs";const s=(e=[],n={},r={})=>new t(e,n,r),c=new WeakMap,l=e=>{let t=c.get(e);return t||(t=Object.freeze({navigate:e.navigate,getState:e.getState,isActiveRoute:e.isActiveRoute,canNavigateTo:e.canNavigateTo,subscribe:e.subscribe}),c.set(e,t)),t};export{t as Router,o as RouterError,i as UNKNOWN_ROUTE,a as constants,s as createRouter,n as errorCodes,r as events,l as getNavigator,e as resolveForwardChain};
2
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/createRouter.ts","../../src/getNavigator.ts"],"names":[],"mappings":";AAuBO,IAAM,YAAA,GAAe,CAG1B,MAAA,GAAgC,EAAC,EACjC,UAA4B,EAAC,EAC7B,YAAA,GAA6B,EAAC,KACL;AACzB,EAAA,OAAO,IAAI,MAAA,CAAqB,MAAA,EAAQ,OAAA,EAAS,YAAY,CAAA;AAC/D;;;ACzBA,IAAM,KAAA,uBAAY,OAAA,EAA2B;AAEtC,IAAM,YAAA,GAAe,CAG1B,MAAA,KACc;AACd,EAAA,IAAI,GAAA,GAAM,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA;AAE1B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,GAAA,GAAM,OAAO,MAAA,CAAO;AAAA,MAClB,UAAU,MAAA,CAAO,QAAA;AAAA,MACjB,UAAU,MAAA,CAAO,QAAA;AAAA,MACjB,eAAe,MAAA,CAAO,aAAA;AAAA,MACtB,eAAe,MAAA,CAAO,aAAA;AAAA,MACtB,WAAW,MAAA,CAAO;AAAA,KACnB,CAAA;AACD,IAAA,KAAA,CAAM,GAAA,CAAI,QAAQ,GAAG,CAAA;AAAA,EACvB;AAEA,EAAA,OAAO,GAAA;AACT","file":"index.mjs","sourcesContent":["// packages/core/src/createRouter.ts\n\nimport { Router } from \"./Router\";\n\nimport type { Route } from \"./types\";\nimport type { DefaultDependencies, Options } from \"@real-router/types\";\n\n/**\n * Creates a new router instance.\n *\n * @param routes - Array of route definitions\n * @param options - Router configuration options\n * @param dependencies - Dependencies to inject into the router\n * @returns A new Router instance\n *\n * @example\n * const router = createRouter([\n * { name: 'home', path: '/' },\n * { name: 'users', path: '/users' },\n * ]);\n *\n * router.start('/');\n */\nexport const createRouter = <\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n routes: Route<Dependencies>[] = [],\n options: Partial<Options> = {},\n dependencies: Dependencies = {} as Dependencies,\n): Router<Dependencies> => {\n return new Router<Dependencies>(routes, options, dependencies);\n};\n","import type {\n Navigator,\n DefaultDependencies,\n Router,\n} from \"@real-router/types\";\n\nconst cache = new WeakMap<Router, Navigator>();\n\nexport const getNavigator = <\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n router: Router<Dependencies>,\n): Navigator => {\n let nav = cache.get(router);\n\n if (!nav) {\n nav = Object.freeze({\n navigate: router.navigate,\n getState: router.getState,\n isActiveRoute: router.isActiveRoute,\n canNavigateTo: router.canNavigateTo,\n subscribe: router.subscribe,\n });\n cache.set(router, nav);\n }\n\n return nav;\n};\n"]}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/createRouter.ts","../../src/getNavigator.ts"],"sourcesContent":["// packages/core/src/createRouter.ts\n\nimport { Router } from \"./Router\";\n\nimport type { Route } from \"./types\";\nimport type { DefaultDependencies, Options } from \"@real-router/types\";\n\n/**\n * Creates a new router instance.\n *\n * @param routes - Array of route definitions\n * @param options - Router configuration options\n * @param dependencies - Dependencies to inject into the router\n * @returns A new Router instance\n *\n * @example\n * const router = createRouter([\n * { name: 'home', path: '/' },\n * { name: 'users', path: '/users' },\n * ]);\n *\n * router.start('/');\n */\nexport const createRouter = <\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n routes: Route<Dependencies>[] = [],\n options: Partial<Options> = {},\n dependencies: Dependencies = {} as Dependencies,\n): Router<Dependencies> => {\n return new Router<Dependencies>(routes, options, dependencies);\n};\n","import type {\n Navigator,\n DefaultDependencies,\n Router,\n} from \"@real-router/types\";\n\nconst cache = new WeakMap<Router, Navigator>();\n\nexport const getNavigator = <\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n router: Router<Dependencies>,\n): Navigator => {\n let nav = cache.get(router);\n\n if (!nav) {\n nav = Object.freeze({\n navigate: router.navigate,\n getState: router.getState,\n isActiveRoute: router.isActiveRoute,\n canNavigateTo: router.canNavigateTo,\n subscribe: router.subscribe,\n });\n cache.set(router, nav);\n }\n\n return nav;\n};\n"],"mappings":"uHAuBA,MAAa,GAGX,EAAgC,EAAE,CAClC,EAA4B,EAAE,CAC9B,EAA6B,EAAE,GAExB,IAAI,EAAqB,EAAQ,EAAS,EAAa,CCxB1D,EAAQ,IAAI,QAEL,EAGX,GACc,CACd,IAAI,EAAM,EAAM,IAAI,EAAO,CAa3B,OAXK,IACH,EAAM,OAAO,OAAO,CAClB,SAAU,EAAO,SACjB,SAAU,EAAO,SACjB,cAAe,EAAO,cACtB,cAAe,EAAO,cACtB,UAAW,EAAO,UACnB,CAAC,CACF,EAAM,IAAI,EAAQ,EAAI,EAGjB"}
@@ -0,0 +1,2 @@
1
+ const e=new WeakMap;function t(t){let n=e.get(t);if(!n)throw TypeError(`[real-router] Invalid router instance — not found in internals registry`);return n}function n(t,n){e.set(t,n)}function r(e,t,n){let r=t;for(let t of e){let e=r;r=(...n)=>t(e,...n)}return r(...n)}function i(e,t,n){return((...i)=>{let a=n.get(e);return!a||a.length===0?t(...i):r(a,t,i)})}function a(e,t,n){return(i,a)=>{let o=n.get(e);return!o||o.length===0?t(i,a):r(o,t,[i,a])}}export{n as i,a as n,t as r,i as t};
2
+ //# sourceMappingURL=internals-CCymabFj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internals-CCymabFj.mjs","names":[],"sources":["../../src/internals.ts"],"sourcesContent":["import type { DependenciesStore } from \"./namespaces/DependenciesNamespace\";\nimport type { RoutesStore } from \"./namespaces/RoutesNamespace\";\nimport type { Router as RouterClass } from \"./Router\";\nimport type { EventMethodMap, GuardFnFactory, PluginFactory } from \"./types\";\nimport type { RouterValidator } from \"./types/RouterValidator\";\nimport type {\n DefaultDependencies,\n EventName,\n Options,\n Params,\n Plugin,\n Router as RouterInterface,\n RouteTreeState,\n SimpleState,\n State,\n Unsubscribe,\n} from \"@real-router/types\";\nimport type { RouteTree } from \"route-tree\";\n\nexport interface RouterInternals<\n D extends DefaultDependencies = DefaultDependencies,\n> {\n readonly makeState: <P extends Params = Params>(\n name: string,\n params?: P,\n path?: string,\n meta?: Record<string, Record<string, \"url\" | \"query\">>,\n ) => State<P>;\n\n readonly forwardState: <P extends Params = Params>(\n routeName: string,\n routeParams: P,\n ) => SimpleState<P>;\n\n readonly buildStateResolved: (\n resolvedName: string,\n resolvedParams: Params,\n ) => RouteTreeState | undefined;\n\n readonly matchPath: <P extends Params = Params>(\n path: string,\n options?: Options,\n ) => State<P> | undefined;\n\n readonly getOptions: () => Options;\n\n readonly addEventListener: <E extends EventName>(\n eventName: E,\n cb: Plugin[EventMethodMap[E]],\n ) => Unsubscribe;\n\n readonly buildPath: (route: string, params?: Params) => string;\n\n readonly start: (path: string) => Promise<State>;\n\n /* eslint-disable @typescript-eslint/no-explicit-any -- heterogeneous map: stores different InterceptorFn<M> types under different keys */\n readonly interceptors: Map<\n string,\n ((next: (...args: any[]) => any, ...args: any[]) => any)[]\n >;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n\n readonly setRootPath: (rootPath: string) => void;\n readonly getRootPath: () => string;\n\n readonly getTree: () => RouteTree;\n\n readonly isDisposed: () => boolean;\n\n validator: RouterValidator | null;\n\n // Dependencies (issue #172)\n readonly dependenciesGetStore: () => DependenciesStore<D>;\n\n // Clone support (issue #173)\n readonly cloneOptions: () => Options;\n readonly cloneDependencies: () => Record<string, unknown>;\n readonly getLifecycleFactories: () => [\n Record<string, GuardFnFactory<D>>,\n Record<string, GuardFnFactory<D>>,\n ];\n readonly getPluginFactories: () => PluginFactory<D>[];\n\n // Consolidated route data store (issue #174 Phase 2)\n readonly routeGetStore: () => RoutesStore<D>;\n\n // Cross-namespace state (issue #174)\n readonly getStateName: () => string | undefined;\n readonly isTransitioning: () => boolean;\n readonly clearState: () => void;\n readonly setState: (state: State) => void;\n readonly routerExtensions: { keys: string[] }[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- existential type: stores RouterInternals for all Dependencies types\nconst internals = new WeakMap<object, RouterInternals<any>>();\n\nexport function getInternals<D extends DefaultDependencies>(\n router: RouterInterface<D>,\n): RouterInternals<D> {\n const ctx = internals.get(router);\n\n if (!ctx) {\n throw new TypeError(\n \"[real-router] Invalid router instance — not found in internals registry\",\n );\n }\n\n return ctx as RouterInternals<D>;\n}\n\nexport function registerInternals<D extends DefaultDependencies>(\n router: RouterClass<D>,\n ctx: RouterInternals<D>,\n): void {\n internals.set(router, ctx);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument -- internal chain execution: type safety enforced at public API boundary (PluginApi.addInterceptor) */\nfunction executeInterceptorChain<T>(\n interceptors: ((next: (...args: any[]) => any, ...args: any[]) => any)[],\n original: (...args: any[]) => T,\n args: any[],\n): T {\n let chain = original as (...args: any[]) => any;\n\n for (const interceptor of interceptors) {\n const prev = chain;\n\n chain = (...chainArgs: any[]) => interceptor(prev, ...chainArgs);\n }\n\n return chain(...args) as T;\n}\n\nexport function createInterceptable<T extends (...args: any[]) => any>(\n name: string,\n original: T,\n interceptors: Map<\n string,\n ((next: (...args: any[]) => any, ...args: any[]) => any)[]\n >,\n): T {\n return ((...args: any[]) => {\n const chain = interceptors.get(name);\n\n if (!chain || chain.length === 0) {\n return original(...args);\n }\n\n return executeInterceptorChain(chain, original, args);\n }) as T;\n}\n\nexport function createInterceptable2<A, B, R>(\n name: string,\n original: (a: A, b: B) => R,\n interceptors: Map<\n string,\n ((next: (...args: any[]) => any, ...args: any[]) => any)[]\n >,\n): (a: A, b: B) => R {\n return (arg1: A, arg2: B) => {\n const chain = interceptors.get(name);\n\n if (!chain || chain.length === 0) {\n return original(arg1, arg2);\n }\n\n return executeInterceptorChain(chain, original, [arg1, arg2]);\n };\n}\n/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument */\n"],"mappings":"AA+FA,MAAM,EAAY,IAAI,QAEtB,SAAgB,EACd,EACoB,CACpB,IAAM,EAAM,EAAU,IAAI,EAAO,CAEjC,GAAI,CAAC,EACH,MAAU,UACR,0EACD,CAGH,OAAO,EAGT,SAAgB,EACd,EACA,EACM,CACN,EAAU,IAAI,EAAQ,EAAI,CAI5B,SAAS,EACP,EACA,EACA,EACG,CACH,IAAI,EAAQ,EAEZ,IAAK,IAAM,KAAe,EAAc,CACtC,IAAM,EAAO,EAEb,GAAS,GAAG,IAAqB,EAAY,EAAM,GAAG,EAAU,CAGlE,OAAO,EAAM,GAAG,EAAK,CAGvB,SAAgB,EACd,EACA,EACA,EAIG,CACH,QAAS,GAAG,IAAgB,CAC1B,IAAM,EAAQ,EAAa,IAAI,EAAK,CAMpC,MAJI,CAAC,GAAS,EAAM,SAAW,EACtB,EAAS,GAAG,EAAK,CAGnB,EAAwB,EAAO,EAAU,EAAK,GAIzD,SAAgB,EACd,EACA,EACA,EAImB,CACnB,OAAQ,EAAS,IAAY,CAC3B,IAAM,EAAQ,EAAa,IAAI,EAAK,CAMpC,MAJI,CAAC,GAAS,EAAM,SAAW,EACtB,EAAS,EAAM,EAAK,CAGtB,EAAwB,EAAO,EAAU,CAAC,EAAM,EAAK,CAAC"}
@@ -1,8 +1,10 @@
1
- import { DefaultDependencies, Router } from '@real-router/types';
1
+ import { DefaultDependencies, Router } from "@real-router/types";
2
2
 
3
+ //#region src/utils/getStaticPaths.d.ts
3
4
  type StaticPathEntries = Record<string, () => Promise<Record<string, string>[]>>;
4
5
  declare function getStaticPaths<Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router<Dependencies>, entries?: StaticPathEntries): Promise<string[]>;
5
-
6
+ //#endregion
7
+ //#region src/utils/serializeState.d.ts
6
8
  /**
7
9
  * XSS-safe JSON serialization for embedding data in HTML `<script>` tags.
8
10
  *
@@ -16,5 +18,6 @@ declare function getStaticPaths<Dependencies extends DefaultDependencies = Defau
16
18
  * ```
17
19
  */
18
20
  declare function serializeState(data: unknown): string;
19
-
21
+ //#endregion
20
22
  export { type StaticPathEntries, getStaticPaths, serializeState };
23
+ //# sourceMappingURL=utils.d.mts.map
@@ -1 +1,2 @@
1
- import{getPluginApi as n}from"./chunk-UPJLWPEL.mjs";import"./chunk-EPF2YSMX.mjs";import"./chunk-UUG7DSTN.mjs";function r(n){const t=[];for(const o of n.children.values())0===o.children.size?t.push(o.fullName):t.push(...r(o));return t}async function t(t,o){const e=r(n(t).getTree()),u=[];for(const n of e){const r=o?.[n];if(r){const o=await r();for(const r of o)u.push(t.buildPath(n,r))}else u.push(t.buildPath(n,{}))}return u}function o(n){return void 0===n?"null":JSON.stringify(n).replaceAll("<",String.raw`\u003c`).replaceAll(">",String.raw`\u003e`).replaceAll("&",String.raw`\u0026`)}export{t as getStaticPaths,o as serializeState};//# sourceMappingURL=utils.mjs.map
1
+ import{t as e}from"./getPluginApi-D0bBPuLp.mjs";function t(e){let n=[];for(let r of e.children.values())r.children.size===0?n.push(r.fullName):n.push(...t(r));return n}async function n(n,r){let i=t(e(n).getTree()),a=[];for(let e of i){let t=r?.[e];if(t){let r=await t();for(let t of r)a.push(n.buildPath(e,t))}else a.push(n.buildPath(e,{}))}return a}function r(e){return e===void 0?`null`:JSON.stringify(e).replaceAll(`<`,String.raw`\u003c`).replaceAll(`>`,String.raw`\u003e`).replaceAll(`&`,String.raw`\u0026`)}export{n as getStaticPaths,r as serializeState};
2
+ //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/getStaticPaths.ts","../../src/utils/serializeState.ts"],"names":[],"mappings":";AAUA,SAAS,kBAAkB,IAAA,EAA2B;AACpD,EAAA,MAAM,SAAmB,EAAC;AAE1B,EAAA,KAAA,MAAW,KAAA,IAAS,IAAA,CAAK,QAAA,CAAS,MAAA,EAAO,EAAG;AAC1C,IAAA,IAAI,KAAA,CAAM,QAAA,CAAS,IAAA,KAAS,CAAA,EAAG;AAC7B,MAAA,MAAA,CAAO,IAAA,CAAK,MAAM,QAAQ,CAAA;AAAA,IAC5B,CAAA,MAAO;AACL,MAAA,MAAA,CAAO,IAAA,CAAK,GAAG,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAAA,IACzC;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAEA,eAAsB,cAAA,CAGpB,QACA,OAAA,EACmB;AACnB,EAAA,MAAM,IAAA,GAAO,YAAA,CAAa,MAAM,CAAA,CAAE,OAAA,EAAQ;AAC1C,EAAA,MAAM,UAAA,GAAa,kBAAkB,IAAI,CAAA;AACzC,EAAA,MAAM,QAAkB,EAAC;AAEzB,EAAA,KAAA,MAAW,aAAa,UAAA,EAAY;AAClC,IAAA,MAAM,OAAA,GAAU,UAAU,SAAS,CAAA;AAEnC,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,EAAQ;AAEhC,MAAA,KAAA,MAAW,UAAU,SAAA,EAAW;AAC9B,QAAA,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,SAAA,CAAU,SAAA,EAAW,MAAM,CAAC,CAAA;AAAA,MAChD;AAAA,IACF,CAAA,MAAO;AACL,MAAA,KAAA,CAAM,KAAK,MAAA,CAAO,SAAA,CAAU,SAAA,EAAW,EAAE,CAAC,CAAA;AAAA,IAC5C;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;;;ACrCO,SAAS,eAAe,IAAA,EAAuB;AACpD,EAAA,IAAI,SAAS,MAAA,EAAW;AACtB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,KAAK,SAAA,CAAU,IAAI,CAAA,CACvB,UAAA,CAAW,KAAK,MAAA,CAAO,GAAA,CAAA,MAAA,CAAW,CAAA,CAClC,UAAA,CAAW,KAAK,MAAA,CAAO,GAAA,CAAA,MAAA,CAAW,EAClC,UAAA,CAAW,GAAA,EAAK,OAAO,GAAA,CAAA,MAAA,CAAW,CAAA;AACvC","file":"utils.mjs","sourcesContent":["import { getPluginApi } from \"../api/getPluginApi\";\n\nimport type { DefaultDependencies, Router } from \"@real-router/types\";\nimport type { RouteTree } from \"route-tree\";\n\nexport type StaticPathEntries = Record<\n string,\n () => Promise<Record<string, string>[]>\n>;\n\nfunction getLeafRouteNames(node: RouteTree): string[] {\n const result: string[] = [];\n\n for (const child of node.children.values()) {\n if (child.children.size === 0) {\n result.push(child.fullName);\n } else {\n result.push(...getLeafRouteNames(child));\n }\n }\n\n return result;\n}\n\nexport async function getStaticPaths<\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n router: Router<Dependencies>,\n entries?: StaticPathEntries,\n): Promise<string[]> {\n const tree = getPluginApi(router).getTree();\n const leafRoutes = getLeafRouteNames(tree);\n const paths: string[] = [];\n\n for (const routeName of leafRoutes) {\n const entryFn = entries?.[routeName];\n\n if (entryFn) {\n const paramSets = await entryFn();\n\n for (const params of paramSets) {\n paths.push(router.buildPath(routeName, params));\n }\n } else {\n paths.push(router.buildPath(routeName, {}));\n }\n }\n\n return paths;\n}\n","/**\n * XSS-safe JSON serialization for embedding data in HTML `<script>` tags.\n *\n * Escapes `<`, `>`, and `&` to their Unicode equivalents to prevent\n * injection via `</script>` or HTML entities inside inline scripts.\n *\n * @example\n * ```typescript\n * const json = serializeState({ name: \"home\", path: \"/\" });\n * const html = `<script>window.__STATE__=${json}</script>`;\n * ```\n */\nexport function serializeState(data: unknown): string {\n if (data === undefined) {\n return \"null\";\n }\n\n return JSON.stringify(data)\n .replaceAll(\"<\", String.raw`\\u003c`)\n .replaceAll(\">\", String.raw`\\u003e`)\n .replaceAll(\"&\", String.raw`\\u0026`);\n}\n"]}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/utils/getStaticPaths.ts","../../src/utils/serializeState.ts"],"sourcesContent":["import { getPluginApi } from \"../api/getPluginApi\";\n\nimport type { DefaultDependencies, Router } from \"@real-router/types\";\nimport type { RouteTree } from \"route-tree\";\n\nexport type StaticPathEntries = Record<\n string,\n () => Promise<Record<string, string>[]>\n>;\n\nfunction getLeafRouteNames(node: RouteTree): string[] {\n const result: string[] = [];\n\n for (const child of node.children.values()) {\n if (child.children.size === 0) {\n result.push(child.fullName);\n } else {\n result.push(...getLeafRouteNames(child));\n }\n }\n\n return result;\n}\n\nexport async function getStaticPaths<\n Dependencies extends DefaultDependencies = DefaultDependencies,\n>(\n router: Router<Dependencies>,\n entries?: StaticPathEntries,\n): Promise<string[]> {\n const tree = getPluginApi(router).getTree();\n const leafRoutes = getLeafRouteNames(tree);\n const paths: string[] = [];\n\n for (const routeName of leafRoutes) {\n const entryFn = entries?.[routeName];\n\n if (entryFn) {\n const paramSets = await entryFn();\n\n for (const params of paramSets) {\n paths.push(router.buildPath(routeName, params));\n }\n } else {\n paths.push(router.buildPath(routeName, {}));\n }\n }\n\n return paths;\n}\n","/**\n * XSS-safe JSON serialization for embedding data in HTML `<script>` tags.\n *\n * Escapes `<`, `>`, and `&` to their Unicode equivalents to prevent\n * injection via `</script>` or HTML entities inside inline scripts.\n *\n * @example\n * ```typescript\n * const json = serializeState({ name: \"home\", path: \"/\" });\n * const html = `<script>window.__STATE__=${json}</script>`;\n * ```\n */\nexport function serializeState(data: unknown): string {\n if (data === undefined) {\n return \"null\";\n }\n\n return JSON.stringify(data)\n .replaceAll(\"<\", String.raw`\\u003c`)\n .replaceAll(\">\", String.raw`\\u003e`)\n .replaceAll(\"&\", String.raw`\\u0026`);\n}\n"],"mappings":"gDAUA,SAAS,EAAkB,EAA2B,CACpD,IAAM,EAAmB,EAAE,CAE3B,IAAK,IAAM,KAAS,EAAK,SAAS,QAAQ,CACpC,EAAM,SAAS,OAAS,EAC1B,EAAO,KAAK,EAAM,SAAS,CAE3B,EAAO,KAAK,GAAG,EAAkB,EAAM,CAAC,CAI5C,OAAO,EAGT,eAAsB,EAGpB,EACA,EACmB,CAEnB,IAAM,EAAa,EADN,EAAa,EAAO,CAAC,SAAS,CACD,CACpC,EAAkB,EAAE,CAE1B,IAAK,IAAM,KAAa,EAAY,CAClC,IAAM,EAAU,IAAU,GAE1B,GAAI,EAAS,CACX,IAAM,EAAY,MAAM,GAAS,CAEjC,IAAK,IAAM,KAAU,EACnB,EAAM,KAAK,EAAO,UAAU,EAAW,EAAO,CAAC,MAGjD,EAAM,KAAK,EAAO,UAAU,EAAW,EAAE,CAAC,CAAC,CAI/C,OAAO,ECpCT,SAAgB,EAAe,EAAuB,CAKpD,OAJI,IAAS,IAAA,GACJ,OAGF,KAAK,UAAU,EAAK,CACxB,WAAW,IAAK,OAAO,GAAG,SAAS,CACnC,WAAW,IAAK,OAAO,GAAG,SAAS,CACnC,WAAW,IAAK,OAAO,GAAG,SAAS"}