@react-motion-router/core 2.0.0-beta.sha-f2a0328 → 2.0.0-beta.sha-684da01

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/build/index.js CHANGED
@@ -1,1473 +1,1825 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
2
- import * as __WEBPACK_EXTERNAL_MODULE_web_animations_extension_74b2916c__ from "web-animations-extension";
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ 837:
6
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7
-
8
- /**
9
- * @license React
10
- * react-jsx-runtime.production.min.js
11
- *
12
- * Copyright (c) Facebook, Inc. and its affiliates.
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- */
17
- var f=__webpack_require__(810),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
18
- function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
19
-
20
-
21
- /***/ }),
22
-
23
- /***/ 322:
24
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
25
-
26
-
27
-
28
- if (true) {
29
- module.exports = __webpack_require__(837);
30
- } else {}
31
-
32
-
33
- /***/ }),
34
-
35
- /***/ 174:
36
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
37
-
38
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39
- /* harmony export */ "DM": () => (/* binding */ PromiseAllDynamic),
40
- /* harmony export */ "Ky": () => (/* binding */ isURLPatternSupported),
41
- /* harmony export */ "Nu": () => (/* binding */ dispatchEvent),
42
- /* harmony export */ "QN": () => (/* binding */ matchRoute),
43
- /* harmony export */ "Sy": () => (/* binding */ polyfillNavigation),
44
- /* harmony export */ "Vo": () => (/* binding */ lazy),
45
- /* harmony export */ "e1": () => (/* binding */ includesRoute),
46
- /* harmony export */ "gy": () => (/* binding */ polyfillURLPattern),
47
- /* harmony export */ "n4": () => (/* binding */ resolveBaseURLFromPattern),
48
- /* harmony export */ "vi": () => (/* binding */ isNavigationSupported),
49
- /* harmony export */ "yb": () => (/* binding */ cloneAndInject),
50
- /* harmony export */ "zW": () => (/* binding */ toCamelCase)
51
- /* harmony export */ });
52
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(810);
53
-
54
- function resolveBaseURLFromPattern(pattern, pathname) {
55
- if (!pattern.endsWith("**"))
56
- pattern += '**'; // allows us to match nested routes
57
- const origin = window.location.origin;
58
- const baseURLMatch = new URLPattern(pattern, origin).exec(pathname, origin);
59
- if (!baseURLMatch)
60
- return null;
61
- const groups = Object.keys(baseURLMatch.pathname.groups)
62
- .filter((key) => !isNaN(Number(key)))
63
- .map((key) => baseURLMatch.pathname.groups[key])
64
- .filter((group) => group !== undefined);
65
- const nestedPathnameGroup = groups.at(-1) ?? '';
66
- // derive concrete baseURL
67
- return new URL(pathname.replace(nestedPathnameGroup, ''), window.location.origin);
1
+ import { jsx as T, jsxs as Gt, Fragment as oe } from "react/jsx-runtime";
2
+ import { createContext as nt, Component as it, createRef as K, lazy as le, cloneElement as Xt, Suspense as Et, isValidElement as Ut, Children as jt, useContext as yt, useDebugValue as ce } from "react";
3
+ const Ht = nt(null);
4
+ class Fe extends it {
5
+ ref = K();
6
+ static contextType = Ht;
7
+ componentDidMount() {
8
+ this.scene.addNode(this);
9
+ }
10
+ componentDidUpdate(t) {
11
+ this.props.id !== t.id && (this.scene.removeNode(t.id.toString()), this.scene.addNode(this));
12
+ }
13
+ componentWillUnmount() {
14
+ this.scene.removeNode(this.id);
15
+ }
16
+ get styles() {
17
+ return this.props.config?.styles ? this.props.config.styles : [];
18
+ }
19
+ get canTransition() {
20
+ return !this.props.disabled && this.scene.canTransition;
21
+ }
22
+ get scene() {
23
+ return this.context;
24
+ }
25
+ get id() {
26
+ return `shared-element-${this.props.id.toString()}`;
27
+ }
28
+ get transitionType() {
29
+ return this.props.config?.type ?? this.scene.previousScene?.nodes.get(this.id)?.transitionType ?? "morph";
30
+ }
31
+ getBoundingClientRect() {
32
+ return this.ref.current?.firstElementChild?.getBoundingClientRect() ?? new DOMRect();
33
+ }
34
+ clone() {
35
+ if (!this.ref.current)
36
+ return null;
37
+ const t = this.props.config?.deepClone ?? !0;
38
+ return this.ref.current.firstElementChild?.cloneNode(t);
39
+ }
40
+ hide() {
41
+ this.ref.current && (this.ref.current.style.visibility = "hidden");
42
+ }
43
+ unhide() {
44
+ this.ref.current && (this.ref.current.style.visibility = "visible");
45
+ }
46
+ render() {
47
+ return /* @__PURE__ */ T(
48
+ "div",
49
+ {
50
+ ref: this.ref,
51
+ id: this.id,
52
+ style: { display: "contents" },
53
+ children: this.props.children
54
+ }
55
+ );
56
+ }
68
57
  }
69
- function matchRoute(pathnamePattern, pathname, baseURLPattern = `${window.location.origin}/`, caseSensitive = true) {
70
- if (!caseSensitive) {
71
- pathnamePattern = pathnamePattern.toLowerCase();
72
- pathname = pathname.toLowerCase();
73
- }
74
- const baseURL = resolveBaseURLFromPattern(baseURLPattern, pathname)?.href;
75
- if (!baseURL)
76
- return null;
77
- const match = new URLPattern({ baseURL, pathname: pathnamePattern }).exec({ pathname, baseURL });
78
- const params = match?.pathname.groups ?? {};
79
- if (match) {
80
- return {
81
- params
82
- };
83
- }
58
+ function bt(s, t) {
59
+ s.endsWith("**") || (s += "**");
60
+ const e = window.location.origin, n = new URLPattern(s, e).exec(t, e);
61
+ if (!n)
84
62
  return null;
63
+ const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(-1) ?? "";
64
+ return new URL(t.replace(a, ""), window.location.origin);
85
65
  }
86
- function includesRoute(pathnamePatterns, pathname, baseURL = window.location.origin) {
87
- return pathnamePatterns.some(({ pattern, caseSensitive }) => matchRoute(pattern, pathname, baseURL, caseSensitive));
66
+ function Zt(s, t, e = `${window.location.origin}/`, n = !0) {
67
+ n || (s = s.toLowerCase(), t = t.toLowerCase());
68
+ const r = bt(e, t)?.href;
69
+ if (!r)
70
+ return null;
71
+ const a = new URLPattern({ baseURL: r, pathname: s }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
72
+ return a ? {
73
+ params: o
74
+ } : null;
88
75
  }
89
- function dispatchEvent(event, target = window) {
90
- return new Promise((resolve) => {
91
- queueMicrotask(() => resolve(target.dispatchEvent(event)));
92
- });
76
+ function Be(s, t, e = window.location.origin) {
77
+ return s.some(({ pattern: n, caseSensitive: r }) => Zt(n, t, e, r));
93
78
  }
94
- function lazy(factory) {
95
- const Component = (0,react__WEBPACK_IMPORTED_MODULE_0__.lazy)(factory);
96
- Component.load = async () => {
97
- Component.module ??= await factory();
98
- return Component.module;
99
- };
100
- return Component;
79
+ function he(s, t = window) {
80
+ return new Promise((e) => {
81
+ queueMicrotask(() => e(
82
+ t.dispatchEvent(s)
83
+ ));
84
+ });
101
85
  }
102
- function isNavigationSupported() {
103
- return Boolean(window.navigation);
86
+ function Ke(s) {
87
+ const t = le(s);
88
+ return t.load = async () => (t.module ??= await s(), t.module), t;
104
89
  }
105
- function isURLPatternSupported() {
106
- // @ts-ignore: Property 'UrlPattern' does not exist
107
- return Boolean(globalThis.URLPattern);
90
+ function qe() {
91
+ return !!window.navigation;
108
92
  }
109
- async function polyfillURLPattern() {
110
- const { URLPattern } = await import(/*webpackIgnore: true*/ "urlpattern-polyfill");
111
- // @ts-ignore: Property 'UrlPattern' does not exist
112
- globalThis.URLPattern = URLPattern;
93
+ function ze() {
94
+ return !!globalThis.URLPattern;
113
95
  }
114
- async function polyfillNavigation() {
115
- const { applyPolyfill } = await import(/*webpackIgnore: true*/ "@virtualstate/navigation");
116
- applyPolyfill({
117
- history: true,
118
- interceptEvents: true,
119
- patch: true,
120
- persist: true,
121
- persistState: true
122
- });
96
+ async function Ge() {
97
+ const { URLPattern: s } = await import(
98
+ /*webpackIgnore: true*/
99
+ "urlpattern-polyfill"
100
+ );
101
+ globalThis.URLPattern = s;
123
102
  }
124
- async function PromiseAllDynamic(values) {
125
- const awaited = [];
126
- for (const value of values) {
127
- awaited.push(await value);
128
- }
129
- return awaited;
103
+ async function Xe() {
104
+ const { applyPolyfill: s } = await import(
105
+ /*webpackIgnore: true*/
106
+ "@virtualstate/navigation"
107
+ );
108
+ s({
109
+ history: !0,
110
+ interceptEvents: !0,
111
+ patch: !0,
112
+ persist: !0,
113
+ persistState: !0
114
+ });
130
115
  }
131
- function toCamelCase(value) {
132
- return value.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
116
+ async function ue(s) {
117
+ const t = [];
118
+ for (const e of s)
119
+ t.push(await e);
120
+ return t;
133
121
  }
134
- function cloneAndInject(element, injectProps) {
135
- return (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(element, injectProps);
122
+ function de(s) {
123
+ return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
136
124
  }
137
-
138
-
139
- /***/ }),
140
-
141
- /***/ 810:
142
- /***/ ((module) => {
143
-
144
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
145
- var y = x => () => x
146
- module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
147
-
148
- /***/ })
149
-
150
- /******/ });
151
- /************************************************************************/
152
- /******/ // The module cache
153
- /******/ var __webpack_module_cache__ = {};
154
- /******/
155
- /******/ // The require function
156
- /******/ function __webpack_require__(moduleId) {
157
- /******/ // Check if module is in cache
158
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
159
- /******/ if (cachedModule !== undefined) {
160
- /******/ return cachedModule.exports;
161
- /******/ }
162
- /******/ // Create a new module (and put it into the cache)
163
- /******/ var module = __webpack_module_cache__[moduleId] = {
164
- /******/ // no module.id needed
165
- /******/ // no module.loaded needed
166
- /******/ exports: {}
167
- /******/ };
168
- /******/
169
- /******/ // Execute the module function
170
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
171
- /******/
172
- /******/ // Return the exports of the module
173
- /******/ return module.exports;
174
- /******/ }
175
- /******/
176
- /************************************************************************/
177
- /******/ /* webpack/runtime/define property getters */
178
- /******/ (() => {
179
- /******/ // define getter functions for harmony exports
180
- /******/ __webpack_require__.d = (exports, definition) => {
181
- /******/ for(var key in definition) {
182
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
183
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
184
- /******/ }
185
- /******/ }
186
- /******/ };
187
- /******/ })();
188
- /******/
189
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
190
- /******/ (() => {
191
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
192
- /******/ })();
193
- /******/
194
- /************************************************************************/
195
- var __webpack_exports__ = {};
196
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
197
- (() => {
198
-
199
- // EXPORTS
200
- __webpack_require__.d(__webpack_exports__, {
201
- "Tc": () => (/* reexport */ LoadEvent),
202
- "YU": () => (/* reexport */ MAX_NORM_PROGRESS),
203
- "SR": () => (/* reexport */ MAX_PROGRESS),
204
- "dw": () => (/* reexport */ MAX_Z_INDEX),
205
- "Uy": () => (/* reexport */ MIN_NORM_PROGRESS),
206
- "yn": () => (/* reexport */ MIN_PROGRESS),
207
- "vw": () => (/* reexport */ MotionContext),
208
- "FC": () => (/* reexport */ MotionProgressEndEvent),
209
- "yx": () => (/* reexport */ MotionProgressEvent),
210
- "z4": () => (/* reexport */ MotionProgressStartEvent),
211
- "DC": () => (/* reexport */ NavigationBase),
212
- "Fh": () => (/* reexport */ NestedRouterContext),
213
- "DM": () => (/* reexport */ utils/* PromiseAllDynamic */.DM),
214
- "GW": () => (/* reexport */ RouterBase),
215
- "_q": () => (/* reexport */ RouterContext),
216
- "RG": () => (/* reexport */ ScreenBase),
217
- "rJ": () => (/* reexport */ SharedElement),
218
- "XP": () => (/* reexport */ TransitionCancelEvent),
219
- "d7": () => (/* reexport */ TransitionEndEvent),
220
- "sy": () => (/* reexport */ TransitionStartEvent),
221
- "yb": () => (/* reexport */ utils/* cloneAndInject */.yb),
222
- "Nu": () => (/* reexport */ utils/* dispatchEvent */.Nu),
223
- "e1": () => (/* reexport */ utils/* includesRoute */.e1),
224
- "Qv": () => (/* reexport */ isLazyExoticComponent),
225
- "R1": () => (/* reexport */ isNativeLazyExoticComponent),
226
- "vi": () => (/* reexport */ utils/* isNavigationSupported */.vi),
227
- "R_": () => (/* reexport */ isStylableElement),
228
- "Ky": () => (/* reexport */ utils/* isURLPatternSupported */.Ky),
229
- "$r": () => (/* reexport */ isValidScreenChild),
230
- "Vo": () => (/* reexport */ utils/* lazy */.Vo),
231
- "QN": () => (/* reexport */ utils/* matchRoute */.QN),
232
- "Sy": () => (/* reexport */ utils/* polyfillNavigation */.Sy),
233
- "gy": () => (/* reexport */ utils/* polyfillURLPattern */.gy),
234
- "n4": () => (/* reexport */ utils/* resolveBaseURLFromPattern */.n4),
235
- "zW": () => (/* reexport */ utils/* toCamelCase */.zW),
236
- "nc": () => (/* reexport */ useMotion),
237
- "ev": () => (/* reexport */ useNavigationBase),
238
- "Ot": () => (/* reexport */ useParamsBase),
239
- "qr": () => (/* reexport */ useRouteBase),
240
- "yL": () => (/* reexport */ useRouterBase)
241
- });
242
-
243
- // EXTERNAL MODULE: ../../node_modules/react/jsx-runtime.js
244
- var jsx_runtime = __webpack_require__(322);
245
- // EXTERNAL MODULE: external "react"
246
- var external_react_ = __webpack_require__(810);
247
- ;// CONCATENATED MODULE: ./src/SharedElementSceneContext.ts
248
-
249
- const SharedElementSceneContext = (0,external_react_.createContext)(null);
250
-
251
- ;// CONCATENATED MODULE: ./src/SharedElement.tsx
252
-
253
-
254
-
255
- class SharedElement extends external_react_.Component {
256
- ref = (0,external_react_.createRef)();
257
- static contextType = SharedElementSceneContext;
258
- componentDidMount() {
259
- this.scene.addNode(this);
260
- }
261
- componentDidUpdate(prevProps) {
262
- if (this.props.id !== prevProps.id) {
263
- this.scene.removeNode(prevProps.id.toString());
264
- this.scene.addNode(this);
265
- }
266
- }
267
- componentWillUnmount() {
268
- this.scene.removeNode(this.id);
269
- }
270
- get styles() {
271
- if (this.props.config?.styles) {
272
- return this.props.config.styles;
273
- }
274
- return [];
275
- }
276
- get canTransition() {
277
- return !this.props.disabled
278
- && this.scene.canTransition;
279
- }
280
- get scene() {
281
- return this.context;
282
- }
283
- get id() {
284
- return `shared-element-${this.props.id.toString()}`;
285
- }
286
- get transitionType() {
287
- return this.props.config?.type ?? this.scene.previousScene?.nodes.get(this.id)?.transitionType ?? "morph";
288
- }
289
- getBoundingClientRect() {
290
- return this.ref.current?.firstElementChild?.getBoundingClientRect() ?? new DOMRect();
291
- }
292
- clone() {
293
- if (!this.ref.current)
294
- return null;
295
- const deepClone = this.props.config?.deepClone ?? true;
296
- return this.ref.current.firstElementChild?.cloneNode(deepClone);
297
- }
298
- hide() {
299
- if (!this.ref.current)
300
- return;
301
- this.ref.current.style.visibility = 'hidden';
302
- }
303
- unhide() {
304
- if (!this.ref.current)
305
- return;
306
- this.ref.current.style.visibility = 'visible';
307
- }
308
- render() {
309
- return ((0,jsx_runtime.jsx)("div", { ref: this.ref, id: this.id, style: { display: "contents" }, children: this.props.children }));
310
- }
125
+ function He(s, t) {
126
+ return Xt(s, t);
311
127
  }
312
-
313
- // EXTERNAL MODULE: ./src/common/utils.ts
314
- var utils = __webpack_require__(174);
315
- ;// CONCATENATED MODULE: ./src/common/events.ts
316
-
317
- class TransitionStartEvent extends Event {
318
- constructor() {
319
- super('transition-start');
320
- }
128
+ class pe extends Event {
129
+ constructor() {
130
+ super("transition-start");
131
+ }
321
132
  }
322
- class TransitionCancelEvent extends Event {
323
- constructor() {
324
- super('transition-cancel');
325
- }
133
+ class fe extends Event {
134
+ constructor() {
135
+ super("transition-cancel");
136
+ }
326
137
  }
327
- class TransitionEndEvent extends Event {
328
- constructor() {
329
- super('transition-end');
330
- }
138
+ class me extends Event {
139
+ constructor() {
140
+ super("transition-end");
141
+ }
331
142
  }
332
- class MotionProgressStartEvent extends Event {
333
- constructor() {
334
- super('motion-progress-start');
335
- }
143
+ class Ze extends Event {
144
+ constructor() {
145
+ super("motion-progress-start");
146
+ }
336
147
  }
337
- class MotionProgressEvent extends Event {
338
- progress;
339
- constructor(progress) {
340
- super('motion-progress');
341
- this.progress = progress;
342
- }
148
+ class ge extends Event {
149
+ progress;
150
+ constructor(t) {
151
+ super("motion-progress"), this.progress = t;
152
+ }
343
153
  }
344
- class MotionProgressEndEvent extends Event {
345
- constructor() {
346
- super('motion-progress-end');
347
- }
154
+ class Ye extends Event {
155
+ constructor() {
156
+ super("motion-progress-end");
157
+ }
348
158
  }
349
- class LoadEvent extends Event {
350
- #navigationType = "load";
351
- #userInitiated = false;
352
- #canIntercept = true;
353
- #hashChange = false;
354
- #formData = null;
355
- #downloadRequest = null;
356
- #destination;
357
- #signal;
358
- #abortable = new AbortController();
359
- #intercepted = false;
360
- #thenables = [];
361
- #transition = null;
362
- hasUAVisualTransition = false;
363
- constructor() {
364
- super('navigate', { cancelable: false, bubbles: false, composed: false });
365
- const currentEntry = window.navigation.currentEntry;
366
- if (!currentEntry)
367
- throw new Error("Current entry is null");
368
- this.#destination = {
369
- getState() {
370
- return currentEntry.getState();
159
+ class ye extends Event {
160
+ #t = "load";
161
+ #e = !1;
162
+ #c = !0;
163
+ #h = !1;
164
+ #u = null;
165
+ #d = null;
166
+ #a;
167
+ #i;
168
+ #o = new AbortController();
169
+ #l = !1;
170
+ #n = [];
171
+ #s = null;
172
+ hasUAVisualTransition = !1;
173
+ constructor() {
174
+ super("navigate", { cancelable: !1, bubbles: !1, composed: !1 });
175
+ const t = window.navigation.currentEntry;
176
+ if (!t)
177
+ throw new Error("Current entry is null");
178
+ this.#a = {
179
+ getState() {
180
+ return t.getState();
181
+ },
182
+ url: t.url ?? new URL(window.location.href).href,
183
+ key: t.key,
184
+ index: t.index,
185
+ id: t.id,
186
+ sameDocument: !0
187
+ }, this.#i = this.#o.signal, window.navigation.addEventListener("navigate", this.#r, { signal: this.#i });
188
+ }
189
+ #r = (t) => {
190
+ t !== this ? this.#o.abort() : this.#n.length || window.navigation.removeEventListener("navigate", this.#r);
191
+ };
192
+ intercept(t) {
193
+ if (this.#l)
194
+ throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
195
+ let e = null;
196
+ this.#s || (this.#s = {
197
+ finished: new Promise((r) => e = r),
198
+ from: window.navigation.currentEntry,
199
+ navigationType: "load"
200
+ });
201
+ const n = t?.handler?.();
202
+ n && this.#n.push(n), this.#n.length === 1 && ue(this.#n).then(() => {
203
+ this.#l = !0, window.removeEventListener("navigate", this.#r), e?.();
204
+ });
205
+ }
206
+ scroll() {
207
+ throw new Error("Method not implemented.");
208
+ }
209
+ get transition() {
210
+ return this.#s;
211
+ }
212
+ get navigationType() {
213
+ return this.#t;
214
+ }
215
+ get userInitiated() {
216
+ return this.#e;
217
+ }
218
+ get canIntercept() {
219
+ return this.#c;
220
+ }
221
+ get hashChange() {
222
+ return this.#h;
223
+ }
224
+ get formData() {
225
+ return this.#u;
226
+ }
227
+ get downloadRequest() {
228
+ return this.#d;
229
+ }
230
+ get destination() {
231
+ return this.#a;
232
+ }
233
+ get signal() {
234
+ return this.#i;
235
+ }
236
+ }
237
+ const Yt = nt(null);
238
+ class ve extends it {
239
+ ref = K();
240
+ static contextType = Yt;
241
+ index = 0;
242
+ exiting = !1;
243
+ state = {
244
+ zIndex: "unset"
245
+ };
246
+ onAnimationEnd = () => {
247
+ this.ref.current && (this.ref.current.style.willChange = "auto", this.ref.current.style.pointerEvents = "auto");
248
+ };
249
+ onAnimationStart = () => {
250
+ this.ref.current && (this.ref.current.style.willChange = "transform, opacity", this.ref.current.style.pointerEvents = "none");
251
+ };
252
+ componentDidMount() {
253
+ this.props.navigation.addEventListener("transition-start", this.onAnimationStart), this.props.navigation.addEventListener("transition-end", this.onAnimationEnd), this.props.navigation.addEventListener("transition-cancel", this.onAnimationEnd);
254
+ }
255
+ componentWillUnmount() {
256
+ this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
257
+ }
258
+ get animationEffect() {
259
+ const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: c, exiting: g, ref: p } = this;
260
+ return t?.({
261
+ ref: p.current,
262
+ index: c,
263
+ exiting: g,
264
+ timeline: a,
265
+ direction: n,
266
+ playbackRate: o,
267
+ hasUAVisualTransition: r
268
+ }) ?? null;
269
+ }
270
+ setZIndex(t) {
271
+ return new Promise((e) => this.setState({ zIndex: t }, e));
272
+ }
273
+ render() {
274
+ const t = this.props.renderAs, e = this.props.focused ? void 0 : "";
275
+ return /* @__PURE__ */ T(
276
+ t,
277
+ {
278
+ id: this.props.id,
279
+ className: "screen-transition-provider",
280
+ ref: this.ref,
281
+ inert: e,
282
+ style: {
283
+ gridArea: "1 / 1",
284
+ width: "100%",
285
+ height: "100%",
286
+ transformOrigin: "center center",
287
+ zIndex: this.state.zIndex
288
+ },
289
+ children: this.props.children
290
+ }
291
+ );
292
+ }
293
+ }
294
+ const _t = nt(null), vt = nt(null), Jt = nt(null);
295
+ class we {
296
+ id;
297
+ nodes = /* @__PURE__ */ new Map();
298
+ getScreenRect = () => new DOMRect();
299
+ keepAlive = !1;
300
+ previousScene = null;
301
+ canTransition = !0;
302
+ // should be false if page animation already started
303
+ constructor(t) {
304
+ this.id = t;
305
+ }
306
+ addNode(t) {
307
+ t && (console.assert(!this.nodes.has(t.id), `Duplicate Shared Element ID: ${t.id} in ${this.id}`), this.nodes.set(t.id, t));
308
+ }
309
+ removeNode(t) {
310
+ this.nodes.delete(t);
311
+ }
312
+ get xRatio() {
313
+ const e = (this.getScreenRect().width / window.innerWidth).toFixed(2);
314
+ return parseFloat(e);
315
+ }
316
+ get yRatio() {
317
+ const e = (this.getScreenRect().height / window.innerHeight).toFixed(2);
318
+ return parseFloat(e);
319
+ }
320
+ get x() {
321
+ return this.getScreenRect().x;
322
+ }
323
+ get y() {
324
+ return this.getScreenRect().y;
325
+ }
326
+ isEmpty() {
327
+ return !this.nodes.size;
328
+ }
329
+ }
330
+ class Ee extends it {
331
+ sharedElementScene;
332
+ #t = K();
333
+ ref = K();
334
+ nestedRouterData;
335
+ static contextType = vt;
336
+ state = {
337
+ focused: !1,
338
+ config: {},
339
+ params: {},
340
+ elementType: "div"
341
+ };
342
+ constructor(t, e) {
343
+ super(t), this.sharedElementScene = new we(`${this.name}-shared-element-scene`), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = { parentScreen: this, parentRouter: e };
344
+ }
345
+ setParams(t) {
346
+ this.setState(({ params: e }) => ({ params: { ...e, ...t } }));
347
+ }
348
+ setConfig(t) {
349
+ this.setState(({ config: e }) => ({ config: { ...e, ...t } }));
350
+ }
351
+ get focused() {
352
+ return this.state.focused;
353
+ }
354
+ get name() {
355
+ return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : te(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
356
+ }
357
+ blur() {
358
+ return new Promise((t) => this.setState({ focused: !1 }, t));
359
+ }
360
+ focus() {
361
+ return new Promise((t) => this.setState({ focused: !0 }, t));
362
+ }
363
+ async load(t) {
364
+ let e = this.props.component, n;
365
+ "load" in e ? n = await e.load() : n = { default: e };
366
+ const r = this.context.navigation, a = this.routeProp;
367
+ return await this.props.config?.onLoad?.({ navigation: r, route: a, signal: t }), n;
368
+ }
369
+ async onExited(t) {
370
+ await this.routeProp.config.onExited?.({
371
+ route: this.routeProp,
372
+ navigation: this.context.navigation,
373
+ signal: t
374
+ });
375
+ }
376
+ async onExit(t) {
377
+ await this.routeProp.config.onExit?.({
378
+ route: this.routeProp,
379
+ navigation: this.context.navigation,
380
+ signal: t
381
+ });
382
+ }
383
+ async onEnter(t) {
384
+ await this.routeProp.config.onEnter?.({
385
+ route: this.routeProp,
386
+ navigation: this.context.navigation,
387
+ signal: t
388
+ });
389
+ }
390
+ async onEntered(t) {
391
+ await this.routeProp.config.onEntered?.({
392
+ route: this.routeProp,
393
+ navigation: this.context.navigation,
394
+ signal: t
395
+ });
396
+ }
397
+ get path() {
398
+ return this.props.path;
399
+ }
400
+ get transitionProvider() {
401
+ return this.#t;
402
+ }
403
+ render() {
404
+ const t = this.context.navigation, e = this.routeProp, n = this.props.component, r = e.config.header?.component, a = e.config.footer?.component;
405
+ return /* @__PURE__ */ T(
406
+ ve,
407
+ {
408
+ ref: this.#t,
409
+ renderAs: this.state.elementType,
410
+ id: `${this.context.id}-${this.name}-transition-provider`,
411
+ animation: e.config.animation,
412
+ navigation: t,
413
+ focused: this.state.focused,
414
+ children: /* @__PURE__ */ T(
415
+ "div",
416
+ {
417
+ id: `${this.context.id}-${this.name}`,
418
+ ref: this.ref,
419
+ className: "screen",
420
+ style: {
421
+ height: "100%",
422
+ width: "100%",
423
+ display: "flex",
424
+ flexDirection: "column",
425
+ pointerEvents: "inherit"
371
426
  },
372
- url: currentEntry.url ?? new URL(window.location.href).href,
373
- key: currentEntry.key,
374
- index: currentEntry.index,
375
- id: currentEntry.id,
376
- sameDocument: true
377
- };
378
- this.#signal = this.#abortable.signal;
379
- window.navigation.addEventListener('navigate', this.#onNavigate, { signal: this.#signal });
380
- }
381
- #onNavigate = (e) => {
382
- if (e !== this) {
383
- this.#abortable.abort();
384
- }
385
- else if (!this.#thenables.length) {
386
- window.navigation.removeEventListener('navigate', this.#onNavigate);
387
- }
388
- };
389
- intercept(options) {
390
- if (this.#intercepted)
391
- throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
392
- let finish = null;
393
- if (!this.#transition) {
394
- this.#transition = {
395
- finished: new Promise((resolve) => finish = resolve),
396
- from: window.navigation.currentEntry,
397
- navigationType: "load"
398
- };
399
- }
400
- const thenable = options?.handler?.();
401
- if (thenable)
402
- this.#thenables.push(thenable);
403
- if (this.#thenables.length === 1) {
404
- (0,utils/* PromiseAllDynamic */.DM)(this.#thenables).then(() => {
405
- this.#intercepted = true;
406
- window.removeEventListener('navigate', this.#onNavigate);
407
- finish?.();
408
- });
409
- }
410
- }
411
- scroll() {
412
- throw new Error("Method not implemented.");
413
- }
414
- get transition() {
415
- return this.#transition;
416
- }
417
- get navigationType() {
418
- return this.#navigationType;
419
- }
420
- get userInitiated() {
421
- return this.#userInitiated;
422
- }
423
- get canIntercept() {
424
- return this.#canIntercept;
425
- }
426
- get hashChange() {
427
- return this.#hashChange;
428
- }
429
- get formData() {
430
- return this.#formData;
431
- }
432
- get downloadRequest() {
433
- return this.#downloadRequest;
434
- }
435
- get destination() {
436
- return this.#destination;
437
- }
438
- get signal() {
439
- return this.#signal;
440
- }
427
+ children: /* @__PURE__ */ T(Ht.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(Jt.Provider, { value: e, children: /* @__PURE__ */ Gt(_t.Provider, { value: this.nestedRouterData, children: [
428
+ /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: r, route: e, navigation: t }) }),
429
+ /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: n, route: e, navigation: t }) }),
430
+ /* @__PURE__ */ T(Et, { fallback: /* @__PURE__ */ T(H, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(H, { component: a, route: e, navigation: t }) })
431
+ ] }) }) })
432
+ }
433
+ )
434
+ }
435
+ );
436
+ }
441
437
  }
442
-
443
- ;// CONCATENATED MODULE: ./src/ScreenTransitionLayerContext.tsx
444
-
445
- const ScreenTransitionLayerContext = (0,external_react_.createContext)(null);
446
-
447
- ;// CONCATENATED MODULE: ./src/ScreenTransitionProvider.tsx
448
-
449
-
450
-
451
- class ScreenTransitionProvider extends external_react_.Component {
452
- ref = (0,external_react_.createRef)();
453
- static contextType = ScreenTransitionLayerContext;
454
- index = 0;
455
- exiting = false;
456
- state = {
457
- zIndex: 'unset',
458
- };
459
- onAnimationEnd = () => {
460
- if (this.ref.current) {
461
- this.ref.current.style.willChange = 'auto';
462
- this.ref.current.style.pointerEvents = 'auto';
463
- }
464
- };
465
- onAnimationStart = () => {
466
- if (this.ref.current) {
467
- this.ref.current.style.willChange = 'transform, opacity';
468
- this.ref.current.style.pointerEvents = 'none';
469
- }
470
- };
471
- componentDidMount() {
472
- this.props.navigation.addEventListener('transition-start', this.onAnimationStart);
473
- this.props.navigation.addEventListener('transition-end', this.onAnimationEnd);
474
- this.props.navigation.addEventListener('transition-cancel', this.onAnimationEnd);
475
- }
476
- componentWillUnmount() {
477
- this.props.navigation.removeEventListener('transition-start', this.onAnimationStart);
478
- this.props.navigation.removeEventListener('transition-end', this.onAnimationEnd);
479
- this.props.navigation.removeEventListener('transition-cancel', this.onAnimationEnd);
480
- }
481
- get animationEffect() {
482
- const animationEffectFactory = this.props.animation;
483
- const { animation, direction, hasUAVisualTransition } = this.context;
484
- const { timeline, playbackRate } = animation;
485
- const { index, exiting, ref } = this;
486
- return animationEffectFactory?.({
487
- ref: ref.current,
488
- index,
489
- exiting,
490
- timeline,
491
- direction,
492
- playbackRate,
493
- hasUAVisualTransition
494
- }) ?? null;
495
- }
496
- setZIndex(zIndex) {
497
- return new Promise(resolve => this.setState({ zIndex }, resolve));
498
- }
499
- render() {
500
- const Element = this.props.renderAs;
501
- const inert = !this.props.focused ? '' : undefined;
502
- return ((0,jsx_runtime.jsx)(Element, { id: this.props.id, className: "screen-transition-provider", ref: this.ref, inert, style: {
503
- gridArea: '1 / 1',
504
- width: '100%',
505
- height: '100%',
506
- transformOrigin: 'center center',
507
- zIndex: this.state.zIndex
508
- }, children: this.props.children }));
509
- }
438
+ function H({ component: s, route: t, navigation: e }) {
439
+ te(s) && s.module?.default && (s = s.module.default);
440
+ const n = s ?? null;
441
+ return typeof n == "function" || Qt(n) ? /* @__PURE__ */ T(
442
+ n,
443
+ {
444
+ navigation: e,
445
+ route: t
446
+ }
447
+ ) : Ut(n) ? Xt(n, {
448
+ navigation: e,
449
+ route: t
450
+ }) : /* @__PURE__ */ T(oe, { children: n });
510
451
  }
511
-
512
- ;// CONCATENATED MODULE: ./src/RouterContext.ts
513
-
514
- const NestedRouterContext = (0,external_react_.createContext)(null);
515
- const RouterContext = (0,external_react_.createContext)(null);
516
-
517
- ;// CONCATENATED MODULE: ./src/RoutePropContext.ts
518
-
519
- const RoutePropContext = (0,external_react_.createContext)(null);
520
-
521
- ;// CONCATENATED MODULE: ./src/SharedElementScene.ts
522
- class SharedElementScene {
523
- id;
524
- nodes = new Map();
525
- getScreenRect = () => new DOMRect();
526
- keepAlive = false;
527
- previousScene = null;
528
- canTransition = true; // should be false if page animation already started
529
- constructor(id) {
530
- this.id = id;
531
- }
532
- addNode(node) {
533
- if (!node)
534
- return;
535
- console.assert(!this.nodes.has(node.id), `Duplicate Shared Element ID: ${node.id} in ${this.id}`);
536
- this.nodes.set(node.id, node);
537
- }
538
- removeNode(_id) {
539
- this.nodes.delete(_id);
540
- }
541
- get xRatio() {
542
- const screenRect = this.getScreenRect();
543
- const xRatio = (screenRect.width / window.innerWidth).toFixed(2);
544
- return parseFloat(xRatio);
545
- }
546
- get yRatio() {
547
- const screenRect = this.getScreenRect();
548
- const yRatio = (screenRect.height / window.innerHeight).toFixed(2);
549
- return parseFloat(yRatio);
550
- }
551
- get x() {
552
- return this.getScreenRect().x;
553
- }
554
- get y() {
555
- return this.getScreenRect().y;
556
- }
557
- isEmpty() {
558
- return !Boolean(this.nodes.size);
559
- }
452
+ function _e(s) {
453
+ return Ut(s) ? Object.getPrototypeOf(s.type) === Ee : !1;
560
454
  }
561
-
562
- ;// CONCATENATED MODULE: ./src/ScreenBase.tsx
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
-
571
- class ScreenBase extends external_react_.Component {
572
- sharedElementScene;
573
- #transitionProvider = (0,external_react_.createRef)();
574
- ref = (0,external_react_.createRef)();
575
- nestedRouterData;
576
- static contextType = RouterContext;
577
- state = {
578
- focused: false,
579
- config: {},
580
- params: {},
581
- elementType: 'div'
582
- };
583
- constructor(props, context) {
584
- super(props);
585
- this.sharedElementScene = new SharedElementScene(`${this.name}-shared-element-scene`);
586
- this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect();
587
- this.nestedRouterData = { parentScreen: this, parentRouter: context };
588
- }
589
- setParams(newParams) {
590
- this.setState(({ params }) => ({ params: { ...params, ...newParams } }));
591
- }
592
- setConfig(newConfig) {
593
- this.setState(({ config }) => ({ config: { ...config, ...newConfig } }));
594
- }
595
- get focused() {
596
- return this.state.focused;
597
- }
598
- get name() {
599
- if (this.props.name)
600
- return this.props.name
601
- .toLowerCase()
602
- .replace(/[^\w-]/g, '-') // Remove non-alphanumeric chars
603
- .replace(/-+/g, '-') // Replace multiple hyphens with a single one
604
- .replace(/^-|-$/g, ''); // Remove leading and trailing hyphens;
605
- else if (isLazyExoticComponent(this.props.component))
606
- return this.props.component.module?.default.name.toLowerCase();
607
- return this.props.component.name.toLowerCase();
608
- }
609
- blur() {
610
- return new Promise(resolve => this.setState({ focused: false }, resolve));
611
- }
612
- focus() {
613
- return new Promise(resolve => this.setState({ focused: true }, resolve));
614
- }
615
- async load(signal) {
616
- let Component = this.props.component;
617
- let result;
618
- if ('load' in Component) {
619
- result = await Component.load();
620
- }
621
- else {
622
- result = { default: Component };
623
- }
624
- const navigation = this.context.navigation;
625
- const route = this.routeProp;
626
- await this.props.config?.onLoad?.({ navigation, route, signal });
627
- return result;
628
- }
629
- async onExited(signal) {
630
- await this.routeProp.config.onExited?.({
631
- route: this.routeProp,
632
- navigation: this.context.navigation,
633
- signal
634
- });
635
- }
636
- async onExit(signal) {
637
- await this.routeProp.config.onExit?.({
638
- route: this.routeProp,
639
- navigation: this.context.navigation,
640
- signal
641
- });
642
- }
643
- async onEnter(signal) {
644
- await this.routeProp.config.onEnter?.({
645
- route: this.routeProp,
646
- navigation: this.context.navigation,
647
- signal
648
- });
649
- }
650
- async onEntered(signal) {
651
- await this.routeProp.config.onEntered?.({
652
- route: this.routeProp,
653
- navigation: this.context.navigation,
654
- signal
655
- });
656
- }
657
- get path() {
658
- return this.props.path;
659
- }
660
- get transitionProvider() {
661
- return this.#transitionProvider;
662
- }
663
- render() {
664
- const navigation = this.context.navigation;
665
- const routeProp = this.routeProp;
666
- const Component = this.props.component;
667
- const HeaderComponent = routeProp.config.header?.component;
668
- const FooterComponent = routeProp.config.footer?.component;
669
- return ((0,jsx_runtime.jsx)(ScreenTransitionProvider, { ref: this.#transitionProvider, renderAs: this.state.elementType, id: `${this.context.id}-${this.name}-transition-provider`, animation: routeProp.config.animation, navigation: navigation, focused: this.state.focused, children: (0,jsx_runtime.jsx)("div", { id: `${this.context.id}-${this.name}`, ref: this.ref, className: "screen", style: {
670
- height: '100%',
671
- width: '100%',
672
- display: 'flex',
673
- flexDirection: 'column',
674
- pointerEvents: 'inherit'
675
- }, children: (0,jsx_runtime.jsx)(SharedElementSceneContext.Provider, { value: this.sharedElementScene, children: (0,jsx_runtime.jsx)(RoutePropContext.Provider, { value: routeProp, children: (0,jsx_runtime.jsxs)(NestedRouterContext.Provider, { value: this.nestedRouterData, children: [(0,jsx_runtime.jsx)(external_react_.Suspense, { fallback: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: routeProp.config.header?.fallback, route: routeProp, navigation: navigation }), children: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: HeaderComponent, route: routeProp, navigation: navigation }) }), (0,jsx_runtime.jsx)(external_react_.Suspense, { fallback: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: this.props.fallback, route: routeProp, navigation: navigation }), children: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: Component, route: routeProp, navigation: navigation }) }), (0,jsx_runtime.jsx)(external_react_.Suspense, { fallback: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: routeProp.config.footer?.fallback, route: routeProp, navigation: navigation }), children: (0,jsx_runtime.jsx)(ComponentWithRouteProps, { component: FooterComponent, route: routeProp, navigation: navigation }) })] }) }) }) }) }));
676
- }
455
+ function Qt(s) {
456
+ return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
677
457
  }
678
- function ComponentWithRouteProps({ component, route, navigation }) {
679
- if (isLazyExoticComponent(component) && component.module?.default) {
680
- component = component.module.default;
681
- }
682
- const Component = component ?? null;
683
- if (typeof Component === "function" || isNativeLazyExoticComponent(Component)) {
684
- return ((0,jsx_runtime.jsx)(Component, { navigation: navigation, route: route }));
685
- }
686
- else if ((0,external_react_.isValidElement)(Component)) {
687
- return (0,external_react_.cloneElement)(Component, {
688
- navigation,
689
- route
690
- });
691
- }
692
- return (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { children: Component });
458
+ function te(s) {
459
+ return Qt(s) && "load" in s;
460
+ }
461
+ function be(s) {
462
+ return "style" in s && s.style instanceof CSSStyleDeclaration;
463
+ }
464
+ var Te = Object.defineProperty, Se = (s, t, e) => t in s ? Te(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Se(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
465
+ if (!t.has(s))
466
+ throw TypeError("Cannot " + e);
467
+ }, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), m = (s, t, e) => {
468
+ if (t.has(s))
469
+ throw TypeError("Cannot add the same private member more than once");
470
+ t instanceof WeakSet ? t.add(s) : t.set(s, e);
471
+ }, l = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), f = (s, t, e) => (Wt(s, t, "access private method"), e);
472
+ const ht = {
473
+ delay: 0,
474
+ direction: "normal",
475
+ duration: "auto",
476
+ easing: "linear",
477
+ endDelay: 0,
478
+ fill: "auto",
479
+ iterationStart: 0,
480
+ iterations: 1
481
+ }, It = 1e3, Re = window.Animation, ut = window.KeyframeEffect;
482
+ function Ft(s) {
483
+ return Array.isArray(s);
693
484
  }
694
-
695
- ;// CONCATENATED MODULE: ./src/common/types.ts
696
-
697
-
698
- function isValidScreenChild(value) {
699
- if (!(0,external_react_.isValidElement)(value))
700
- return false;
701
- return Object.getPrototypeOf(value.type) === ScreenBase;
485
+ function X(s) {
486
+ return typeof s == "object" && s === null;
702
487
  }
703
- var SharedElementTransitionTypeEnum;
704
- (function (SharedElementTransitionTypeEnum) {
705
- SharedElementTransitionTypeEnum[SharedElementTransitionTypeEnum["morph"] = 0] = "morph";
706
- SharedElementTransitionTypeEnum[SharedElementTransitionTypeEnum["fade-through"] = 1] = "fade-through";
707
- SharedElementTransitionTypeEnum[SharedElementTransitionTypeEnum["fade"] = 2] = "fade";
708
- SharedElementTransitionTypeEnum[SharedElementTransitionTypeEnum["cross-fade"] = 3] = "cross-fade";
709
- })(SharedElementTransitionTypeEnum || (SharedElementTransitionTypeEnum = {}));
710
- function isNativeLazyExoticComponent(value) {
711
- return typeof value === "object"
712
- && value !== null
713
- && value.$$typeof === Symbol.for('react.lazy');
488
+ function h(s, t) {
489
+ return X(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
714
490
  }
715
- function isLazyExoticComponent(value) {
716
- return isNativeLazyExoticComponent(value) && 'load' in value;
491
+ function ke(s, t = ht) {
492
+ let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
493
+ if (X(s))
494
+ return s;
495
+ if (typeof s == "number" || s.type().percent === void 0)
496
+ throw new DOMException(
497
+ "CSSNumericValue must be a percentage for progress based animations.",
498
+ "NotSupportedError"
499
+ );
500
+ if (e === "auto")
501
+ e = It;
502
+ else if (e instanceof CSSNumericValue)
503
+ e = e.to("ms").value;
504
+ else if (typeof e == "string")
505
+ throw new TypeError("Unknown effect duration keyword.");
506
+ const { delay: a = 0, endDelay: o = 0 } = t, c = e / n * n / Math.abs(r), g = a + c + o;
507
+ return st(
508
+ s.to("percent").value,
509
+ [0, 100],
510
+ [0, g]
511
+ );
512
+ }
513
+ function wt(s) {
514
+ if (X(s) || typeof s == "number")
515
+ return s;
516
+ if (s.type().time !== void 0)
517
+ throw new DOMException(
518
+ "CSSNumericValue must be a time value for time based animations.",
519
+ "NotSupportedError"
520
+ );
521
+ return s.to("ms").value;
522
+ }
523
+ function Bt(s, t) {
524
+ const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
525
+ return r + o * (a - r);
526
+ }
527
+ function xe(s, t, e) {
528
+ let n = 0, r = 0;
529
+ for (const [a, o] of Object.entries(s)) {
530
+ const { min: c, max: g } = t, p = e[a] ?? 1, w = (o - c[a]) / (g[a] - c[a]) * p;
531
+ n += w, r += p;
532
+ }
533
+ return n / r;
534
+ }
535
+ function st(s, t, e, n = {}) {
536
+ let r;
537
+ if (typeof s == "number" && Ft(t)) {
538
+ const o = { x: t[0] }, c = { x: t[1] };
539
+ t = { min: o, max: c }, s = { x: s };
540
+ } else
541
+ throw new TypeError("Input and input range must have the same dimensions.");
542
+ if (r = xe(s, t, n), r = Ce(r, 0, 1), Ft(e))
543
+ return Bt(r, e);
544
+ const a = {};
545
+ for (const o of Object.keys(e.min)) {
546
+ const c = e.min[o], g = e.max[o], p = [c, g];
547
+ a[o] = Bt(r, p);
548
+ }
549
+ return a;
550
+ }
551
+ function Ce(s, t, e) {
552
+ return s < t ? t : e && s > e ? e : s;
553
+ }
554
+ function $t(s) {
555
+ let {
556
+ duration: t = "auto",
557
+ iterations: e = 1,
558
+ playbackRate: n = 1,
559
+ delay: r = 0,
560
+ endDelay: a = 0,
561
+ localTime: o = null,
562
+ progress: c = null
563
+ } = s;
564
+ const g = new CSSUnitValue(100, "percent");
565
+ if (t === "auto")
566
+ t = It, r = 0, a = 0;
567
+ else if (t instanceof CSSNumericValue)
568
+ t = t.to("ms").value;
569
+ else if (typeof t == "string")
570
+ throw TypeError("Unknown effect duration keyword.");
571
+ const p = t / e, w = p * e / Math.abs(n), S = r + w + a;
572
+ t = new CSSUnitValue(p / S * 100, "percent");
573
+ const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
574
+ return o !== null && (c = h(o, "percent") / g.value), {
575
+ ...s,
576
+ progress: c,
577
+ activeDuration: E,
578
+ duration: t,
579
+ iterations: e,
580
+ delay: r,
581
+ endDelay: a,
582
+ endTime: g
583
+ };
584
+ }
585
+ function ee(s, t) {
586
+ let { activeDuration: e = 0, localTime: n = null, endTime: r = 1 / 0, delay: a = 0 } = s;
587
+ if (r = h(r), e = h(e), n = h(n), n == null || n === void 0)
588
+ return "idle";
589
+ const o = Math.max(Math.min(a, r), 0), c = Math.max(Math.min(a + e, r), 0);
590
+ return n < o || t === "backwards" && n === o ? "before" : n > c || t === "forwards" && n === c ? "after" : "active";
591
+ }
592
+ function Me(s, t) {
593
+ let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
594
+ if (r = h(r), e = h(e), e == null || e === void 0)
595
+ return null;
596
+ switch (t) {
597
+ case "before":
598
+ return a === "backwards" || a === "both" ? Math.max(e - n, 0) : null;
599
+ case "active":
600
+ return e - n;
601
+ case "after":
602
+ return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, r), 0) : null;
603
+ default:
604
+ return null;
605
+ }
606
+ }
607
+ function Le(s, t, e) {
608
+ const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
609
+ if (typeof n != "number")
610
+ throw new TypeError("Duration cannot be unresolved");
611
+ let o = 0;
612
+ return n === 0 ? t === "before" ? o = 0 : o = r : o = e / wt(n), o + a;
613
+ }
614
+ function Pe(s, t, e, n) {
615
+ const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
616
+ if (X(e))
617
+ return null;
618
+ let c = 0;
619
+ return e === 1 / 0 && (c = a % 1), c === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (c = 1), c;
620
+ }
621
+ function ne(s, t) {
622
+ const { iterations: e = 1 } = s, n = Me(s, t);
623
+ if (X(n))
624
+ return null;
625
+ if (t === "after" && e === 1 / 0)
626
+ return 1 / 0;
627
+ const r = Le(s, t, n);
628
+ return Pe(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
717
629
  }
718
- function isStylableElement(element) {
719
- return 'style' in element && element.style instanceof CSSStyleDeclaration;
630
+ class De extends Event {
631
+ constructor(t) {
632
+ super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
633
+ }
720
634
  }
721
-
722
- ;// CONCATENATED MODULE: external "web-animations-extension"
723
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
724
- var y = x => () => x
725
- const external_web_animations_extension_namespaceObject = x({ ["Animation"]: () => __WEBPACK_EXTERNAL_MODULE_web_animations_extension_74b2916c__.Animation, ["ParallelEffect"]: () => __WEBPACK_EXTERNAL_MODULE_web_animations_extension_74b2916c__.ParallelEffect });
726
- ;// CONCATENATED MODULE: ./src/SharedElementTransitionLayer.tsx
727
-
728
-
729
-
730
-
731
-
732
- class SharedElementTransitionLayer extends external_react_.Component {
733
- ref = (0,external_react_.createRef)();
734
- #outgoingScreen = null;
735
- #incomingScreen = null;
736
- state = {
737
- transitioning: false
635
+ var N, Z;
636
+ class b extends EventTarget {
637
+ constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
638
+ super(), m(this, N, void 0), m(this, Z, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), l(this, Z, CSS.percent(0)), l(this, N, t);
639
+ }
640
+ onGesture(t) {
641
+ const e = i(this, N).source.getBoundingClientRect();
642
+ let n = 0;
643
+ const r = {
644
+ x: t.x - e.left,
645
+ y: t.y - e.top
738
646
  };
739
- set outgoingScreen(outgoingScreen) {
740
- this.#outgoingScreen = outgoingScreen;
741
- }
742
- set incomingScreen(incomingScreen) {
743
- this.#incomingScreen = incomingScreen;
744
- }
745
- get outgoingScreen() {
746
- return this.#outgoingScreen;
747
- }
748
- get incomingScreen() {
749
- return this.#incomingScreen;
750
- }
751
- getKeyframeProperties(element, styleList) {
752
- const computedStyles = {};
753
- const computedStyle = window.getComputedStyle(element);
754
- for (const key of styleList) {
755
- let transformedKey;
756
- if (key === "offset")
757
- transformedKey = "cssOffset";
758
- else if (key === "float")
759
- transformedKey = "cssFloat";
760
- else
761
- transformedKey = (0,utils/* toCamelCase */.zW)(key);
762
- computedStyles[transformedKey] = computedStyle.getPropertyValue(key);
763
- }
764
- return computedStyles;
765
- }
766
- copyStyles(srcElement, cloneElement, styleList) {
767
- if (!isStylableElement(srcElement))
768
- return;
769
- const computedStyles = window.getComputedStyle(srcElement);
770
- for (const key of styleList) {
771
- const value = computedStyles.getPropertyValue(key);
772
- const priority = computedStyles.getPropertyPriority(key);
773
- cloneElement.style.setProperty(key, value, priority);
774
- }
775
- }
776
- getAnimationEffect(start, end) {
777
- const keyframeEffects = new Array();
778
- const startRect = start.instance.getBoundingClientRect();
779
- const endRect = end.instance.getBoundingClientRect();
780
- const config = {
781
- fill: "both",
782
- duration: "auto",
783
- easing: "ease",
784
- };
785
- const transitionType = end.instance.transitionType;
786
- const startTransform = `translate(${startRect.x}px, ${startRect.y}px)`;
787
- const endTransform = `translate(${endRect.x}px, ${endRect.y}px)`;
788
- switch (transitionType) {
789
- case "fade":
790
- keyframeEffects.push(new KeyframeEffect(start.clone, [
791
- { transform: startTransform, opacity: 1 },
792
- { transform: endTransform, opacity: 0 }
793
- ], config));
794
- keyframeEffects.push(new KeyframeEffect(end.clone, [
795
- { transform: startTransform },
796
- { transform: endTransform }
797
- ], config));
798
- break;
799
- case "fade-through":
800
- keyframeEffects.push(new KeyframeEffect(start.clone, [
801
- { transform: startTransform, opacity: 1 },
802
- { opacity: 0, offset: 0.5 },
803
- { transform: endTransform, opacity: 0 }
804
- ], config));
805
- keyframeEffects.push(new KeyframeEffect(end.clone, [
806
- { transform: startTransform, opacity: 0 },
807
- { opacity: 0, offset: 0.5 },
808
- { transform: endTransform, opacity: 1 }
809
- ], config));
810
- break;
811
- case "cross-fade":
812
- end.clone.style.mixBlendMode = "plus-lighter";
813
- keyframeEffects.push(new KeyframeEffect(start.clone, [
814
- { transform: startTransform, opacity: 1 },
815
- { transform: endTransform, opacity: 0 }
816
- ], config));
817
- keyframeEffects.push(new KeyframeEffect(end.clone, [
818
- { transform: startTransform },
819
- { transform: endTransform }
820
- ], config));
821
- break;
822
- case "morph": {
823
- const styleList = Array.from(new Set([...start.instance.styles, ...end.instance.styles]));
824
- keyframeEffects.push(new KeyframeEffect(end.clone, [
825
- {
826
- ...Object.fromEntries((start.instance.ref.current?.firstElementChild).attributeStyleMap),
827
- transform: startTransform,
828
- width: `${startRect.width}px`,
829
- height: `${startRect.height}px`,
830
- },
831
- {
832
- ...Object.fromEntries((end.instance.ref.current?.firstElementChild).attributeStyleMap),
833
- ...this.getKeyframeProperties(end.instance.ref.current?.firstElementChild, styleList),
834
- transform: endTransform,
835
- width: `${endRect.width}px`,
836
- height: `${endRect.height}px`,
837
- }
838
- ], config));
839
- break;
840
- }
841
- }
842
- return new external_web_animations_extension_namespaceObject.ParallelEffect(keyframeEffects);
843
- }
844
- get animationEffect() {
845
- const currentScene = this.outgoingScreen?.current?.sharedElementScene;
846
- const nextScene = this.incomingScreen?.current?.sharedElementScene;
847
- if (!currentScene || !nextScene)
848
- return null;
849
- if (currentScene === nextScene)
850
- return null;
851
- currentScene.previousScene = null;
852
- nextScene.previousScene = currentScene;
853
- const parallelEffects = new Array();
854
- for (const [id, end] of Array.from(nextScene.nodes.entries())) {
855
- const start = currentScene.nodes.get(id);
856
- if (!start?.canTransition || !end.canTransition)
857
- continue;
858
- const endClone = end.clone();
859
- const startClone = start.clone();
860
- if (!startClone || !endClone)
861
- continue;
862
- const styleList = Array.from(new Set([...start.styles, ...end.styles, 'width', 'height']));
863
- if (end.transitionType !== "morph") {
864
- startClone.id = `${id}-start`;
865
- startClone.style.position = "absolute";
866
- startClone.style.gridArea = "1 / 1";
867
- startClone.style.margin = "0";
868
- this.copyStyles(start.ref.current?.firstElementChild, startClone, styleList);
869
- this.copyStyles(end.ref.current?.firstElementChild, endClone, styleList);
870
- this.ref.current?.prepend(startClone);
871
- }
872
- else {
873
- this.copyStyles(start.ref.current?.firstElementChild, endClone, styleList);
874
- }
875
- endClone.id = `${id}${end.transitionType === "morph" ? '' : '-end'}`;
876
- endClone.style.position = "absolute";
877
- endClone.style.gridArea = "1 / 1";
878
- endClone.style.margin = "0";
879
- this.ref.current?.prepend(endClone);
880
- start.hide();
881
- end.hide();
882
- const onFinish = async () => {
883
- if (this.props.direction === "forwards")
884
- end.unhide();
885
- else
886
- start.unhide();
887
- endClone.remove();
888
- startClone.remove();
889
- };
890
- this.props.navigation.addEventListener('transition-end', onFinish, { once: true });
891
- this.props.navigation.addEventListener('transition-cancel', onFinish, { once: true });
892
- parallelEffects.push(this.getAnimationEffect({ instance: start, clone: startClone }, { instance: end, clone: endClone }));
893
- }
894
- return new external_web_animations_extension_namespaceObject.ParallelEffect(parallelEffects);
895
- }
896
- render() {
897
- return ((0,jsx_runtime.jsx)("dialog", { className: "shared-element-layer", ref: this.ref, style: {
898
- maxWidth: 'unset',
899
- maxHeight: 'unset',
900
- width: '100vw',
901
- height: '100vh',
902
- contain: 'strict',
903
- padding: 0,
904
- border: 'none',
905
- backgroundColor: 'transparent',
906
- isolation: 'isolate',
907
- }, children: (0,jsx_runtime.jsx)("style", { children: `
908
- .shared-element-layer::backdrop {display: none}
909
- .shared-element-layer[open] {display:grid}
910
- ` }) }));
911
- }
647
+ switch (i(this, N).type) {
648
+ case "swipe": {
649
+ const { rangeStart: a, rangeEnd: o } = i(this, N), c = i(this, N).axis;
650
+ n = st(
651
+ r[c],
652
+ [h(a, "px"), h(o, "px")],
653
+ [0, 100]
654
+ );
655
+ break;
656
+ }
657
+ case "pan": {
658
+ const { rangeStart: a, rangeEnd: o } = i(this, N), { x: c, y: g } = r;
659
+ n = st(
660
+ { x: c, y: g },
661
+ {
662
+ min: { x: h(a.x, "px"), y: h(a.y, "px") },
663
+ max: { x: h(o.x, "px"), y: h(o.y, "px") }
664
+ },
665
+ [0, 100],
666
+ { x: 1, y: 1 }
667
+ );
668
+ break;
669
+ }
670
+ case "pinch": {
671
+ const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: c } = t;
672
+ n = st(
673
+ c,
674
+ [h(a, ""), h(o, "")],
675
+ // figure out which unit
676
+ [0, 100]
677
+ );
678
+ break;
679
+ }
680
+ case "rotate": {
681
+ const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: c } = t;
682
+ n = st(
683
+ c,
684
+ [h(a, "deg"), h(o, "deg")],
685
+ [0, 100]
686
+ );
687
+ }
688
+ }
689
+ l(this, Z, CSS.percent(n)), this.dispatchEvent(new De(i(this, Z)));
690
+ }
691
+ addEventListener(t, e, n) {
692
+ super.addEventListener(t, e, n);
693
+ }
694
+ removeEventListener(t, e, n) {
695
+ super.removeEventListener(t, e, n);
696
+ }
697
+ get currentTime() {
698
+ return i(this, Z);
699
+ }
700
+ get phase() {
701
+ return "active";
702
+ }
912
703
  }
913
-
914
- ;// CONCATENATED MODULE: ./src/MotionContext.ts
915
-
916
- const MotionContext = (0,external_react_.createContext)(0);
917
-
918
- ;// CONCATENATED MODULE: ./src/ScreenTransitionLayer.tsx
919
-
920
-
921
-
922
-
923
-
924
-
925
-
926
- class ScreenTransitionLayer extends external_react_.Component {
927
- sharedElementTransitionLayer = (0,external_react_.createRef)();
928
- animation = new external_web_animations_extension_namespaceObject.Animation();
929
- #direction = "normal";
930
- #screens = new Array();
931
- state = {
932
- gestureNavigating: false,
933
- progress: 1
704
+ N = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap();
705
+ const A = /* @__PURE__ */ new WeakMap();
706
+ var rt;
707
+ class dt extends ut {
708
+ constructor(t, e = null) {
709
+ super(t), m(this, rt, null), l(this, rt, e);
710
+ }
711
+ get parent() {
712
+ return i(this, rt);
713
+ }
714
+ getTiming() {
715
+ var t;
716
+ const e = super.getTiming();
717
+ if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof b) {
718
+ if (e.duration === 1 / 0)
719
+ throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
720
+ if (e.iterations === 1 / 0)
721
+ throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
722
+ }
723
+ return e;
724
+ }
725
+ getComputedTiming() {
726
+ var t;
727
+ const e = super.getComputedTiming();
728
+ if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof b) {
729
+ if (e.duration === 1 / 0)
730
+ throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
731
+ if (e.iterations === 1 / 0)
732
+ throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
733
+ return $t(e);
734
+ }
735
+ return e;
736
+ }
737
+ updateTiming(t) {
738
+ var e;
739
+ const n = super.getTiming();
740
+ t = {
741
+ ...n,
742
+ duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
743
+ ...t
934
744
  };
935
- onAnimationFrame() {
936
- const progress = this.animation.effect?.getComputedTiming().progress;
937
- if (progress)
938
- this.onProgress(progress);
939
- if (this.animation.playState === "running")
940
- requestAnimationFrame(this.onAnimationFrame.bind(this));
941
- }
942
- onTransitionCancel() {
943
- this.props.navigation.dispatchEvent(new TransitionCancelEvent());
944
- }
945
- onTransitionStart() {
946
- this.props.navigation.dispatchEvent(new TransitionStartEvent());
947
- this.onAnimationFrame();
948
- }
949
- onTransitionEnd() {
950
- this.props.navigation.dispatchEvent(new TransitionEndEvent());
951
- }
952
- onProgress(progress) {
953
- this.setState({ progress });
954
- this.props.navigation.dispatchEvent(new MotionProgressEvent(progress));
955
- }
956
- get screens() {
957
- return this.#screens;
958
- }
959
- set screens(screens) {
960
- this.#screens = screens;
961
- }
962
- set direction(direction) {
963
- this.#direction = direction;
964
- this.animation.effect?.updateTiming({ direction });
965
- }
966
- get direction() {
967
- return this.#direction;
968
- }
969
- get hasUAVisualTransition() {
970
- return this.props.hasUAVisualTransition;
971
- }
972
- transition() {
973
- const effect = new external_web_animations_extension_namespaceObject.ParallelEffect(this.screens.map(screen => {
974
- return screen.current?.transitionProvider?.current?.animationEffect ?? null;
975
- }).filter((effect) => effect !== null));
976
- const sharedElementEffect = this.sharedElementTransitionLayer.current?.animationEffect;
977
- const duration = effect.getComputedTiming().duration;
978
- if (sharedElementEffect) {
979
- sharedElementEffect.updateTiming({
980
- duration: duration instanceof CSSNumericValue ? duration.to('ms').value : duration
981
- });
982
- effect.append(sharedElementEffect);
983
- this.sharedElementTransitionLayer.current?.ref.current?.showModal();
984
- }
985
- this.animation.effect = effect;
986
- this.animation.play();
987
- this.onTransitionStart();
988
- this.animation.oncancel = () => {
989
- this.sharedElementTransitionLayer.current?.ref.current?.close();
990
- this.onTransitionCancel();
991
- this.animation.effect = null;
992
- };
993
- this.animation.finished.then(() => {
994
- this.animation.commitStyles();
995
- this.onTransitionEnd();
996
- this.sharedElementTransitionLayer.current?.ref.current?.close();
997
- this.animation.effect = null;
998
- });
999
- return this.animation;
1000
- }
1001
- render() {
1002
- return ((0,jsx_runtime.jsxs)(ScreenTransitionLayerContext.Provider, { value: this, children: [(0,jsx_runtime.jsx)(SharedElementTransitionLayer, { ref: this.sharedElementTransitionLayer, navigation: this.props.navigation, direction: this.animation.playbackRate > 0 ? "forwards" : "backwards" }), (0,jsx_runtime.jsx)("div", { className: "screen-transition-layer", style: {
1003
- width: '100%',
1004
- height: '100%',
1005
- display: 'grid',
1006
- contain: 'layout',
1007
- isolation: 'isolate',
1008
- '--motion-progress': this.state.progress
1009
- }, children: (0,jsx_runtime.jsx)(MotionContext.Provider, { value: this.state.progress, children: this.props.children }) })] }));
1010
- }
745
+ let r = i(this, rt);
746
+ for (; r; ) {
747
+ const a = r.getTiming();
748
+ t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), r = r.parent;
749
+ }
750
+ if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof b) {
751
+ if (t?.duration === 1 / 0)
752
+ throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
753
+ if (t != null && t.iterations)
754
+ throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
755
+ }
756
+ return super.updateTiming(t);
757
+ }
1011
758
  }
1012
-
1013
- ;// CONCATENATED MODULE: ./src/RouterBase.tsx
1014
-
1015
-
1016
-
1017
-
1018
-
1019
-
1020
- class RouterBase extends external_react_.Component {
1021
- ref = (0,external_react_.createRef)();
1022
- screenTransitionLayer = (0,external_react_.createRef)();
1023
- parent = null;
1024
- #child = null;
1025
- loadDispatched = false;
1026
- hasUAVisualTransition = false;
1027
- parentScreen = null;
1028
- static rootRouterRef = null;
1029
- static contextType = NestedRouterContext;
1030
- constructor(props, context) {
1031
- super(props);
1032
- this.parentScreen = context?.parentScreen ?? null;
1033
- this.parent = context?.parentRouter ?? null;
1034
- if (this.parent) {
1035
- this.parent.child = this;
1036
- }
1037
- if (this.isRoot) {
1038
- RouterBase.rootRouterRef = new WeakRef(this);
1039
- }
1040
- }
1041
- componentDidMount() {
1042
- if (this.isRoot) {
1043
- window.navigation.addEventListener('navigate', this.handleNavigationDispatch);
1044
- }
1045
- if (!this.loadDispatched) {
1046
- window.navigation.dispatchEvent(new LoadEvent());
1047
- this.loadDispatched = true;
1048
- }
1049
- }
1050
- componentWillUnmount() {
1051
- if (this.isRoot) {
1052
- window.navigation.removeEventListener('navigate', this.handleNavigationDispatch);
1053
- }
1054
- }
1055
- handleNavigationDispatch = (e) => {
1056
- const activeRouters = [...this.#activeRoutersIter()];
1057
- // travel down router tree to find a router that can intercept
1058
- const interceptor = activeRouters.findLast(router => router.canIntercept(e));
1059
- if (interceptor) {
1060
- interceptor.intercept(e);
1061
- this.hasUAVisualTransition = e.hasUAVisualTransition;
1062
- }
759
+ rt = /* @__PURE__ */ new WeakMap();
760
+ var U, Y;
761
+ const Ae = class pt {
762
+ constructor(t) {
763
+ m(this, U, []), m(this, Y, null), l(this, U, t.map((e) => (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), e)));
764
+ }
765
+ get parent() {
766
+ return i(this, Y);
767
+ }
768
+ get children() {
769
+ const t = i(this, U);
770
+ return {
771
+ length: t.length,
772
+ item(e) {
773
+ return t.at(e) ?? null;
774
+ }
1063
775
  };
1064
- *#activeRoutersIter() {
1065
- let router = this;
1066
- while (router) {
1067
- yield router;
1068
- router = router.child;
1069
- }
776
+ }
777
+ get firstChild() {
778
+ return i(this, U).at(0) ?? null;
779
+ }
780
+ get lastChild() {
781
+ return i(this, U).at(-1) ?? null;
782
+ }
783
+ clone() {
784
+ return structuredClone(this);
785
+ }
786
+ append(...t) {
787
+ t.forEach((e) => {
788
+ i(this, U).includes(e) || (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), i(this, U).push(e));
789
+ });
790
+ }
791
+ prepend(...t) {
792
+ t.forEach((e) => {
793
+ i(this, U).includes(e) || (e instanceof pt ? l(e, Y, this) : e instanceof ut && (e = new dt(e, this)), i(this, U).unshift(e));
794
+ });
795
+ }
796
+ };
797
+ U = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
798
+ let Ot = Ae;
799
+ class et {
800
+ constructor() {
801
+ j(this, "promise"), j(this, "state"), j(this, "nativeResolve"), j(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
802
+ this.nativeResolve = t, this.nativeReject = e;
803
+ });
804
+ }
805
+ resolve(t) {
806
+ var e;
807
+ this.state = "resolved", (e = this.nativeResolve) == null || e.call(this, t);
808
+ }
809
+ reject(t) {
810
+ var e;
811
+ this.state = "rejected", this.promise.catch(() => {
812
+ }), (e = this.nativeReject) == null || e.call(this, t);
813
+ }
814
+ }
815
+ var _, Tt, ie;
816
+ class Ne extends Ot {
817
+ constructor(t, e = ht) {
818
+ super(t), m(this, Tt), m(this, _, void 0), l(this, _, {
819
+ ...ht,
820
+ ...e
821
+ });
822
+ }
823
+ prepend(...t) {
824
+ super.prepend(...t), t.forEach((e) => e.updateTiming());
825
+ }
826
+ append(...t) {
827
+ super.append(...t), t.forEach((e) => e.updateTiming());
828
+ }
829
+ getTiming() {
830
+ return i(this, _);
831
+ }
832
+ getComputedTiming() {
833
+ var t, e;
834
+ const n = this.getTiming(), r = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: c = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
835
+ n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime = c;
836
+ for (let C = 0; C < this.children.length; C++) {
837
+ const M = this.children.item(C);
838
+ if (!M)
839
+ continue;
840
+ let {
841
+ duration: L = "auto",
842
+ activeDuration: Vt = 0
843
+ } = M.getComputedTiming();
844
+ r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(Vt, "ms") : Vt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, L = L instanceof CSSNumericValue ? L.to("ms").value : L, typeof L != "string" && (n.duration === "auto" ? n.duration = h(L, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + L : L));
845
+ }
846
+ const { timeline: g, startTime: p, currentTime: w } = A.get(this) ?? {}, S = g instanceof b ? "percent" : "ms";
847
+ let { duration: E = 0, iterations: F = 1 } = r;
848
+ if (E === "auto" && (E = 0), typeof E == "string")
849
+ throw new TypeError("Unknown effect duration keyword.");
850
+ return r.duration = E, r.activeDuration = wt(E) * F, r.startTime = p ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, Tt, ie))), g instanceof b ? $t(r) : (g instanceof DocumentTimeline && (r.progress = w && h(w, S) / h(c, S)), r);
851
+ }
852
+ updateTiming(t) {
853
+ l(this, _, {
854
+ ...i(this, _),
855
+ ...t
856
+ });
857
+ for (let e = 0; e < this.children.length; e++) {
858
+ const n = this.children.item(e);
859
+ n?.updateTiming();
1070
860
  }
1071
- getRouterById(routerId, target) {
1072
- const router = target ?? RouterBase.rootRouterRef?.deref();
1073
- if (router.id === routerId) {
1074
- return router ?? null;
1075
- }
1076
- else if (router?.child) {
1077
- return this.getRouterById(routerId, router.child);
861
+ }
862
+ }
863
+ _ = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), ie = function() {
864
+ const { playbackRate: s = 1 } = A.get(this) ?? {};
865
+ return s < 0 ? "backwards" : "forwards";
866
+ };
867
+ var d, x, ct, v, R, P, u, y, k, z, O, at, W, ft, St, J, ot, q, Q, Rt, Kt, kt, qt, xt, zt, B, G, lt, mt, Ct, I, V, D, $, gt, Mt, Lt;
868
+ const se = class extends EventTarget {
869
+ constructor(t, e) {
870
+ super(), m(this, ft), m(this, J), m(this, q), m(this, Rt), m(this, kt), m(this, xt), m(this, B), m(this, mt), m(this, I), m(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), m(this, d, void 0), m(this, x, void 0), m(this, ct, "active"), m(this, v, {
871
+ task: null,
872
+ playbackRate: null
873
+ }), m(this, R, new et()), m(this, P, new et()), m(this, u, null), m(this, y, null), m(this, k, []), m(this, z, null), m(this, O, !1), m(this, at, 0), m(this, W, 1), m(this, lt, () => {
874
+ f(this, B, G).call(this);
875
+ }), m(this, gt, () => {
876
+ var n;
877
+ if (i(this, P).state !== "pending" || this.playState !== "finished")
878
+ return;
879
+ i(this, P).resolve(this);
880
+ const r = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
881
+ "finish",
882
+ {
883
+ get currentTime() {
884
+ return r;
885
+ },
886
+ get timelineTime() {
887
+ return a;
888
+ }
1078
889
  }
1079
- else {
1080
- return null;
890
+ );
891
+ requestAnimationFrame(() => {
892
+ var c;
893
+ this.dispatchEvent(o), (c = this.onfinish) == null || c.call(this, o);
894
+ });
895
+ }), m(this, Mt, () => {
896
+ var n, r;
897
+ const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, c = new AnimationPlaybackEvent(
898
+ "cancel",
899
+ {
900
+ get currentTime() {
901
+ return a;
902
+ },
903
+ get timelineTime() {
904
+ return o;
905
+ }
1081
906
  }
1082
- }
1083
- dispatchEvent(event) {
1084
- const ref = this.ref.current ?? undefined;
1085
- return (0,utils/* dispatchEvent */.Nu)(event, ref);
1086
- }
1087
- addEventListener(type, listener, options) {
1088
- return this.ref.current?.addEventListener(type, listener, options);
1089
- }
1090
- removeEventListener(type, listener, options) {
1091
- return this.ref.current?.removeEventListener(type, listener, options);
1092
- }
1093
- preloadRoute(pathname) {
1094
- return new Promise((resolve, reject) => {
1095
- let found = false;
1096
- const routes = this.props.children;
1097
- external_react_.Children.forEach(routes, (route) => {
1098
- if (found)
1099
- return; // stop after first
1100
- if (!(0,external_react_.isValidElement)(route))
1101
- return;
1102
- const { path, caseSensitive } = route.props;
1103
- const baseURLPattern = this.baseURLPattern.pathname;
1104
- const matchInfo = (0,utils/* matchRoute */.QN)(path, pathname, baseURLPattern, caseSensitive);
1105
- if (!matchInfo)
1106
- return;
1107
- found = true;
1108
- const config = route.props.config;
1109
- queueMicrotask(async () => {
1110
- const preloadTasks = [];
1111
- if ('load' in route.props.component) {
1112
- preloadTasks.push(route.props.component.load());
1113
- }
1114
- if (config?.header?.component && 'load' in config?.header?.component) {
1115
- preloadTasks.push(config?.header?.component.load());
1116
- }
1117
- if (config?.footer?.component && 'load' in config?.footer?.component) {
1118
- preloadTasks.push(config?.footer?.component.load());
1119
- }
1120
- try {
1121
- await Promise.all(preloadTasks);
1122
- resolve(found);
1123
- }
1124
- catch (e) {
1125
- reject(e);
1126
- }
1127
- });
1128
- });
1129
- if (!found)
1130
- resolve(false);
1131
- });
1132
- }
1133
- get id() {
1134
- if (this.props.id)
1135
- return this.props.id;
1136
- const prefix = this.parent?.id;
1137
- const id = this.parentScreen?.id ?? 'root';
1138
- return [prefix, id].filter(Boolean).join('-');
1139
- }
1140
- get isRoot() {
1141
- return !this.parent;
1142
- }
1143
- get baseURL() {
1144
- const pathname = this.isRoot ? window.location.pathname : this.parentScreen?.resolvedPathname;
1145
- const pattern = this.baseURLPattern.pathname;
1146
- return (0,utils/* resolveBaseURLFromPattern */.n4)(pattern, pathname);
1147
- }
1148
- get baseURLPattern() {
1149
- let baseURL = window.location.origin + "/";
1150
- let basePath = this.props.config?.basePath;
1151
- if (!basePath) {
1152
- if (this.isRoot) {
1153
- basePath = "/";
1154
- }
1155
- else {
1156
- basePath = ".";
1157
- }
907
+ );
908
+ this.dispatchEvent(c), (r = this.oncancel) == null || r.call(this, c);
909
+ }), m(this, Lt, () => {
910
+ var n;
911
+ const r = new Event("remove");
912
+ this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
913
+ }), i(this, R).resolve(this), l(this, x, t ?? null), l(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), f(this, mt, Ct).call(this), e instanceof b && e.addEventListener("update", i(this, lt));
914
+ }
915
+ reverse() {
916
+ var t;
917
+ const { endTime: e = 0 } = ((t = i(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W), r = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || r && r > 0 || !a);
918
+ if (!i(this, d) || !o) {
919
+ o && (i(this, v).playbackRate = -n);
920
+ return;
921
+ }
922
+ if (i(this, d).currentTime === null)
923
+ throw new DOMException(
924
+ "Cannot reverse an animation with no active timeline",
925
+ "InvalidStateError"
926
+ );
927
+ this.updatePlaybackRate(-n), this.play();
928
+ }
929
+ play() {
930
+ const t = this.playState === "paused" && this.pending;
931
+ let e = this.currentTime;
932
+ (i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && l(this, y, 0), e === null && l(this, O, !0), (this.playState === "finished" || t) && (l(this, u, null), l(this, y, null), l(this, O, !0)), i(this, y) && l(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (f(this, B, G).call(this), f(this, J, ot).call(this), i(this, v).task = "play", f(this, I, V).call(this, !1));
933
+ }
934
+ pause() {
935
+ this.playState !== "paused" && (this.currentTime === null && l(this, O, !0), i(this, v).task && (i(this, v).task = null), f(this, J, ot).call(this), i(this, v).task = "pause");
936
+ }
937
+ persist() {
938
+ i(this, k).forEach((t) => t.persist()), l(this, ct, "persisted");
939
+ }
940
+ finish() {
941
+ var t;
942
+ const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
943
+ if (n === 0 || n > 0 && e === 1 / 0)
944
+ throw new DOMException("InvalidStateError");
945
+ f(this, D, $).call(this);
946
+ let r;
947
+ if (n > 0 ? r = e : r = 0, f(this, ft, St).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
948
+ const a = i(this, d) instanceof b ? "percent" : "ms";
949
+ r = h(r, a);
950
+ const o = h(i(this, d).currentTime, a);
951
+ l(this, u, o - r / n);
952
+ }
953
+ i(this, v).task === "pause" && i(this, u) !== null && (l(this, y, null), f(this, q, Q).call(this), i(this, R).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (f(this, q, Q).call(this), i(this, R).resolve(this)), f(this, I, V).call(this, !0), i(this, k).forEach((a) => a.finish());
954
+ }
955
+ commitStyles() {
956
+ i(this, k).forEach((t) => {
957
+ t.effect instanceof dt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
958
+ });
959
+ }
960
+ cancel() {
961
+ this.playState !== "idle" && (f(this, D, $).call(this), i(this, R).reject(new DOMException("The user aborted a request", "AbortError")), f(this, q, Q).call(this), l(this, R, new et()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), l(this, P, new et()), i(this, k).forEach((t) => t.cancel())), l(this, u, null), l(this, y, null);
962
+ }
963
+ updatePlaybackRate(t) {
964
+ var e;
965
+ i(this, v).playbackRate = t;
966
+ const n = this.playState;
967
+ if (i(this, R).state !== "pending")
968
+ switch (n) {
969
+ case "idle":
970
+ case "paused":
971
+ f(this, D, $).call(this);
972
+ break;
973
+ case "finished": {
974
+ const r = i(this, d) instanceof b ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
975
+ if (t === 0)
976
+ l(this, u, h(a, r));
977
+ else if (a !== null) {
978
+ let o = null;
979
+ o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && l(this, u, (h(a, r) - o) / t);
980
+ }
981
+ f(this, D, $).call(this), f(this, I, V).call(this, !1), f(this, B, G).call(this);
982
+ break;
1158
983
  }
1159
- if (this.parent && this.parentScreen) {
1160
- const { resolvedPathname = window.location.pathname, path } = this.parentScreen;
1161
- const parentBaseURL = this.parent.baseURL?.href;
1162
- const pattern = new URLPattern({ baseURL: parentBaseURL, pathname: path });
1163
- baseURL = (0,utils/* resolveBaseURLFromPattern */.n4)(pattern.pathname, resolvedPathname).href;
984
+ default:
985
+ this.play();
986
+ }
987
+ }
988
+ addEventListener(t, e, n) {
989
+ super.addEventListener(t, e, n);
990
+ }
991
+ removeEventListener(t, e, n) {
992
+ super.removeEventListener(t, e, n);
993
+ }
994
+ set playbackRate(t) {
995
+ l(this, W, t), i(this, k).forEach((e) => {
996
+ e.playbackRate *= t;
997
+ });
998
+ }
999
+ set startTime(t) {
1000
+ l(this, u, h(t)), i(this, k).forEach((e) => e.startTime = t);
1001
+ }
1002
+ set currentTime(t) {
1003
+ var e;
1004
+ const n = i(this, d) instanceof b ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
1005
+ if (X(t) && !X(r))
1006
+ throw new TypeError("currentTime may not be changed from resolved to unresolved.");
1007
+ l(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? l(this, y, h(t, n)) : l(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && l(this, u, null), l(this, z, null), f(this, ft, St).call(this, t), i(this, v).task === "pause" && (l(this, y, h(t, n)), f(this, D, $).call(this), l(this, u, null), f(this, q, Q).call(this), i(this, R).resolve(this)), f(this, I, V).call(this, !0);
1008
+ }
1009
+ set timeline(t) {
1010
+ var e, n;
1011
+ const r = this.timeline;
1012
+ if (r === t)
1013
+ return;
1014
+ i(this, d) instanceof b && i(this, d).removeEventListener("update", i(this, lt));
1015
+ const a = this.playState, o = r instanceof b ? "percent" : "ms", c = h(this.currentTime, o), { progress: g = null, endTime: p = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(p, o), S = r instanceof b, E = t instanceof b, F = t instanceof DocumentTimeline, C = this.pending;
1016
+ if (E)
1017
+ l(this, d, t), t.addEventListener("update", i(this, lt)), f(this, D, $).call(this), l(this, O, !0), l(this, u, null), l(this, y, null), (a === "running" || a === "finished") && ((!i(this, R) || i(this, R).state === "resolved") && f(this, J, ot).call(this), i(this, v).task = "play", i(this, k).forEach((M) => M.pause())), a === "paused" && g !== null && l(this, y, g * w), C && ((!i(this, R) || i(this, R).state === "resolved") && f(this, J, ot).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && l(this, y, null), f(this, I, V).call(this, !1);
1018
+ else if (F) {
1019
+ if (l(this, d, t), S) {
1020
+ if (c !== null && g !== null) {
1021
+ const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
1022
+ this.currentTime = g * L;
1164
1023
  }
1165
- return new URLPattern({ baseURL, pathname: basePath });
1166
- }
1167
- get pathPatterns() {
1168
- return external_react_.Children.map(this.props.children, (child) => {
1169
- return { pattern: child.props.path, caseSensitive: Boolean(child.props.caseSensitive) };
1170
- });
1171
- }
1172
- get mounted() {
1173
- return Boolean(this.ref.current);
1174
- }
1175
- get child() {
1176
- return this.#child?.deref() ?? null;
1177
- }
1178
- set child(child) {
1179
- const currentChildRouter = this.#child?.deref();
1180
- if (currentChildRouter
1181
- && child?.id !== currentChildRouter?.id
1182
- && currentChildRouter?.mounted) {
1183
- throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1024
+ switch (a) {
1025
+ case "paused":
1026
+ i(this, k).forEach((M) => M.pause());
1027
+ break;
1028
+ case "running":
1029
+ case "finished":
1030
+ i(this, k).forEach((M) => M.play());
1184
1031
  }
1185
- if (child)
1186
- this.#child = new WeakRef(child);
1187
- else
1188
- this.#child = null;
1189
- }
1190
- render() {
1191
- if (!this.navigation)
1192
- return;
1193
- return ((0,jsx_runtime.jsx)("div", { id: this.id, className: "react-motion-router", style: { width: '100%', height: '100%' }, ref: this.ref, children: (0,jsx_runtime.jsx)(RouterContext.Provider, { value: this, children: (0,jsx_runtime.jsx)(ScreenTransitionLayer, { ref: this.screenTransitionLayer, navigation: this.navigation, hasUAVisualTransition: this.hasUAVisualTransition, children: this.screens }) }) }));
1032
+ }
1033
+ } else
1034
+ throw TypeError("Unsupported timeline: " + t);
1035
+ }
1036
+ set effect(t) {
1037
+ if (t !== i(this, x)) {
1038
+ if (this.pending && f(this, q, Q).call(this), i(this, x) && A.delete(i(this, x)), t) {
1039
+ const e = A.get(t);
1040
+ e && (e.effect = null), A.set(t, this);
1041
+ }
1042
+ l(this, x, t), f(this, mt, Ct).call(this), f(this, I, V).call(this, !1);
1043
+ }
1044
+ }
1045
+ get ready() {
1046
+ return i(this, R).promise;
1047
+ }
1048
+ get finished() {
1049
+ return i(this, P).promise;
1050
+ }
1051
+ get playState() {
1052
+ var t;
1053
+ let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
1054
+ const n = i(this, d) instanceof b ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
1055
+ return e = h(e, n), a === null && r === null && i(this, v).task === null ? "idle" : i(this, v).task === "pause" || r === null && i(this, v).task !== "play" ? "paused" : a !== null && (i(this, W) > 0 && a >= e || i(this, W) < 0 && a <= 0) ? "finished" : "running";
1056
+ }
1057
+ get playbackRate() {
1058
+ return i(this, W);
1059
+ }
1060
+ get replaceState() {
1061
+ return i(this, ct);
1062
+ }
1063
+ get pending() {
1064
+ return i(this, R).state === "pending";
1065
+ }
1066
+ get currentTime() {
1067
+ var t;
1068
+ const e = ((t = this.timeline) == null ? void 0 : t.currentTime) ?? null;
1069
+ if (i(this, y)) {
1070
+ if (typeof e == "number")
1071
+ return i(this, y);
1072
+ const a = i(this, d) instanceof b ? "percent" : "ms";
1073
+ return new CSSUnitValue(i(this, y), a);
1074
+ }
1075
+ if (e === null || i(this, u) === null)
1076
+ return null;
1077
+ const n = i(this, d) instanceof b ? "percent" : "ms";
1078
+ let r = (h(e, n) - i(this, u)) * this.playbackRate;
1079
+ return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
1080
+ }
1081
+ get startTime() {
1082
+ var t;
1083
+ if (i(this, u) === null)
1084
+ return null;
1085
+ if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
1086
+ return i(this, u);
1087
+ const e = i(this, d) instanceof b ? "percent" : "ms";
1088
+ return new CSSUnitValue(i(this, u), e);
1089
+ }
1090
+ get timeline() {
1091
+ return i(this, d);
1092
+ }
1093
+ get effect() {
1094
+ return i(this, x);
1095
+ }
1096
+ };
1097
+ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakSet(), St = function(s) {
1098
+ var t;
1099
+ const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
1100
+ if (s === null && e !== null)
1101
+ throw new TypeError();
1102
+ s === null || e === null || (s = h(s), l(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof b && i(this, d).phase === "inactive" || i(this, W) === 0 ? l(this, y, s) : l(this, u, e - s / i(this, W)), i(this, d) instanceof b && i(this, d).phase === "inactive" && l(this, u, null), l(this, z, null));
1103
+ }, J = /* @__PURE__ */ new WeakSet(), ot = function() {
1104
+ i(this, R).state !== "pending" && l(this, R, new et()), cancelAnimationFrame(i(this, at)), l(this, at, requestAnimationFrame(() => {
1105
+ var s;
1106
+ (((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (f(this, xt, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? f(this, Rt, Kt).call(this) : i(this, v).task === "pause" && f(this, kt, qt).call(this), Promise.all(i(this, k).map((t) => t.finished)).then(i(this, gt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Lt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Mt)).then(() => l(this, ct, "removed")));
1107
+ }));
1108
+ }, q = /* @__PURE__ */ new WeakSet(), Q = function() {
1109
+ cancelAnimationFrame(i(this, at)), i(this, v).task = null;
1110
+ }, Rt = /* @__PURE__ */ new WeakSet(), Kt = function() {
1111
+ var s;
1112
+ const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1113
+ if (t === null)
1114
+ return;
1115
+ const e = i(this, d) instanceof b ? "percent" : "ms";
1116
+ if (i(this, y) !== null)
1117
+ f(this, D, $).call(this), this.playbackRate === 0 ? l(this, u, h(t, e)) : (l(this, u, h(t, e) - i(this, y) / this.playbackRate), l(this, y, null));
1118
+ else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
1119
+ const n = (h(t, e) - i(this, u)) * this.playbackRate;
1120
+ f(this, D, $).call(this);
1121
+ const r = this.playbackRate;
1122
+ r === 0 ? (l(this, y, null), l(this, u, h(t, e))) : l(this, u, h(t, e) - n / r);
1123
+ }
1124
+ i(this, R).state === "pending" && i(this, R).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, k).forEach((n) => n.play());
1125
+ }, kt = /* @__PURE__ */ new WeakSet(), qt = function() {
1126
+ var s;
1127
+ const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1128
+ if (t === null)
1129
+ return;
1130
+ const e = i(this, d) instanceof b ? "percent" : "ms", n = t;
1131
+ i(this, u) !== null && i(this, y) === null && l(this, y, (h(n, e) - i(this, u)) * this.playbackRate), f(this, D, $).call(this), l(this, u, null), i(this, R).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, i(this, k).forEach((r) => r.pause());
1132
+ }, xt = /* @__PURE__ */ new WeakSet(), zt = function() {
1133
+ if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
1134
+ if (i(this, d) instanceof b) {
1135
+ const s = i(this, v).playbackRate ?? this.playbackRate;
1136
+ l(this, u, s >= 0 ? 0 : 100);
1137
+ } else
1138
+ l(this, u, h(i(this, d).currentTime, "ms"));
1139
+ l(this, y, null);
1140
+ }
1141
+ }, B = /* @__PURE__ */ new WeakSet(), G = function() {
1142
+ var s;
1143
+ const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
1144
+ if (t === null)
1145
+ return;
1146
+ const e = i(this, x), n = i(this, d) instanceof b ? ke(t, e?.getTiming()) : wt(t);
1147
+ let r = null;
1148
+ if (i(this, u) !== null) {
1149
+ const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
1150
+ r = (n - i(this, u)) * this.playbackRate, r += a;
1151
+ } else if (i(this, y) !== null)
1152
+ r = i(this, y);
1153
+ else
1154
+ return;
1155
+ i(this, k).forEach((a) => a.currentTime = r);
1156
+ }, lt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), Ct = function() {
1157
+ var s;
1158
+ let t = i(this, x);
1159
+ const e = [];
1160
+ if (t instanceof Ot)
1161
+ for (let n = 0; n < t.children.length; n++) {
1162
+ const r = new se(t.children.item(n));
1163
+ if (t instanceof Ne && n > 0) {
1164
+ const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
1165
+ r.startTime = h(a, "ms");
1166
+ }
1167
+ e.push(r);
1168
+ }
1169
+ else {
1170
+ const n = i(this, d) instanceof b ? document.timeline : i(this, d);
1171
+ e.push(new Re(t, n));
1172
+ }
1173
+ l(this, k, e);
1174
+ }, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
1175
+ var t, e;
1176
+ const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof b ? "percent" : "ms";
1177
+ let a = h(this.currentTime, r);
1178
+ if (a && i(this, u) !== null && !this.pending) {
1179
+ let { delay: o = 0, endDelay: c = 0, iterations: g = 1, duration: p = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1180
+ const w = i(this, v).playbackRate ?? this.playbackRate;
1181
+ if (p === "auto")
1182
+ p = i(this, d) instanceof b ? It : 0;
1183
+ else if (p instanceof CSSNumericValue)
1184
+ p = p.to("ms").value;
1185
+ else if (typeof p == "string")
1186
+ throw new TypeError("Unknown effect duration keyword.");
1187
+ const S = o + p * g + c;
1188
+ let E = h(i(this, z), r);
1189
+ w > 0 && a >= S && i(this, z) !== null ? ((E === null || E < S) && (E = S), l(this, y, s ? a : E)) : w < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), l(this, y, s ? a : E)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? l(this, u, h(n, r) - i(this, y) / w) : l(this, u, null)), l(this, y, null));
1190
+ }
1191
+ f(this, B, G).call(this), l(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, gt).call(this) : i(this, P).state === "resolved" && l(this, P, new et());
1192
+ }, D = /* @__PURE__ */ new WeakSet(), $ = function() {
1193
+ i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
1194
+ }, gt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap();
1195
+ let Ue = se;
1196
+ var tt, Pt, re;
1197
+ class Dt extends Ot {
1198
+ constructor(t, e = ht) {
1199
+ super(t), m(this, Pt), m(this, tt, void 0), l(this, tt, {
1200
+ ...ht,
1201
+ ...e
1202
+ }), t.forEach((n) => n.updateTiming());
1203
+ }
1204
+ prepend(...t) {
1205
+ super.prepend(...t), t.forEach((e) => e.updateTiming());
1206
+ }
1207
+ append(...t) {
1208
+ super.append(...t), t.forEach((e) => e.updateTiming());
1209
+ }
1210
+ getTiming() {
1211
+ return i(this, tt);
1212
+ }
1213
+ getComputedTiming() {
1214
+ const t = this.getTiming(), e = { ...t };
1215
+ for (let w = 0; w < this.children.length; w++) {
1216
+ const S = this.children.item(w);
1217
+ if (!S)
1218
+ continue;
1219
+ let {
1220
+ delay: E = 0,
1221
+ endDelay: F = 0,
1222
+ duration: C = "auto",
1223
+ activeDuration: M = 0,
1224
+ endTime: L = 0
1225
+ } = S.getComputedTiming();
1226
+ t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, F) : F, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(L, "ms")) : L, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(M, "ms")) : M, t.duration = t.duration instanceof CSSNumericValue ? t.duration.to("ms").value : t.duration, C = C instanceof CSSNumericValue ? C.to("ms").value : C, typeof C != "string" && (t.duration === "auto" ? t.duration = h(C, "ms") : typeof t.duration != "string" && (t.duration = t.duration ? Math.max(t.duration, C) : C));
1227
+ }
1228
+ const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1229
+ let { duration: c = 0, iterations: g = 1, endTime: p = 0 } = e;
1230
+ if (c === "auto" && (c = 0), typeof c == "string")
1231
+ throw new TypeError("Unknown effect duration keyword.");
1232
+ return e.duration = c, e.activeDuration = wt(c) * g, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = ne(e, ee(e, i(this, Pt, re))), n instanceof b ? $t(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(p, o)), e);
1233
+ }
1234
+ updateTiming(t) {
1235
+ l(this, tt, {
1236
+ ...i(this, tt),
1237
+ ...t
1238
+ });
1239
+ for (let e = 0; e < this.children.length; e++) {
1240
+ const n = this.children.item(e);
1241
+ n?.updateTiming();
1194
1242
  }
1243
+ }
1195
1244
  }
1196
-
1197
- ;// CONCATENATED MODULE: ./src/MetaData.ts
1198
- class MetaData {
1199
- #map = new Map();
1200
- mutationObserver;
1201
- constructor() {
1202
- this.mutationObserver = new MutationObserver(this.observeMutations.bind(this));
1203
- const { head } = document;
1204
- this.mutationObserver.observe(head, {
1205
- childList: true
1206
- });
1207
- Array.from(head.querySelectorAll('meta')).forEach(node => {
1208
- this.mutationObserver.observe(node, {
1209
- attributes: true
1210
- });
1211
- });
1212
- Array.from(head.querySelectorAll('meta')).forEach(this.metaDataFromNode.bind(this));
1213
- }
1214
- get(key) {
1215
- const metaKey = this.getMetaKey(key);
1216
- const metaContent = this.#map.get(metaKey);
1217
- if (!metaContent)
1218
- return undefined;
1219
- let content;
1220
- if (metaContent.includes(',') && metaContent.includes('=')) {
1221
- content = metaContent.split(/,\s*/).map(keyVal => keyVal.split('='));
1245
+ tt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakSet(), re = function() {
1246
+ const { playbackRate: s = 1 } = A.get(this) ?? {};
1247
+ return s < 0 ? "backwards" : "forwards";
1248
+ };
1249
+ class We extends it {
1250
+ ref = K();
1251
+ #t = null;
1252
+ #e = null;
1253
+ state = {
1254
+ transitioning: !1
1255
+ };
1256
+ set outgoingScreen(t) {
1257
+ this.#t = t;
1258
+ }
1259
+ set incomingScreen(t) {
1260
+ this.#e = t;
1261
+ }
1262
+ get outgoingScreen() {
1263
+ return this.#t;
1264
+ }
1265
+ get incomingScreen() {
1266
+ return this.#e;
1267
+ }
1268
+ getKeyframeProperties(t, e) {
1269
+ const n = {}, r = window.getComputedStyle(t);
1270
+ for (const a of e) {
1271
+ let o;
1272
+ a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = de(a), n[o] = r.getPropertyValue(a);
1273
+ }
1274
+ return n;
1275
+ }
1276
+ copyStyles(t, e, n) {
1277
+ if (!be(t))
1278
+ return;
1279
+ const r = window.getComputedStyle(t);
1280
+ for (const a of n) {
1281
+ const o = r.getPropertyValue(a), c = r.getPropertyPriority(a);
1282
+ e.style.setProperty(a, o, c);
1283
+ }
1284
+ }
1285
+ getAnimationEffect(t, e) {
1286
+ const n = new Array(), r = {
1287
+ fill: "both",
1288
+ duration: "auto",
1289
+ easing: "ease"
1290
+ }, a = e.instance.transitionType, o = `translate(${t.rect.x}px, ${t.rect.y}px)`, c = `translate(${e.rect.x}px, ${e.rect.y}px)`;
1291
+ switch (a) {
1292
+ case "fade":
1293
+ n.push(
1294
+ new KeyframeEffect(
1295
+ t.clone,
1296
+ [
1297
+ { transform: o, opacity: 1 },
1298
+ { transform: c, opacity: 0 }
1299
+ ],
1300
+ r
1301
+ )
1302
+ ), n.push(
1303
+ new KeyframeEffect(
1304
+ e.clone,
1305
+ [
1306
+ { transform: o },
1307
+ { transform: c }
1308
+ ],
1309
+ r
1310
+ )
1311
+ );
1312
+ break;
1313
+ case "fade-through":
1314
+ n.push(
1315
+ new KeyframeEffect(
1316
+ t.clone,
1317
+ [
1318
+ { transform: o, opacity: 1 },
1319
+ { opacity: 0, offset: 0.5 },
1320
+ { transform: c, opacity: 0 }
1321
+ ],
1322
+ r
1323
+ )
1324
+ ), n.push(
1325
+ new KeyframeEffect(
1326
+ e.clone,
1327
+ [
1328
+ { transform: o, opacity: 0 },
1329
+ { opacity: 0, offset: 0.5 },
1330
+ { transform: c, opacity: 1 }
1331
+ ],
1332
+ r
1333
+ )
1334
+ );
1335
+ break;
1336
+ case "cross-fade":
1337
+ e.clone.style.mixBlendMode = "plus-lighter", n.push(
1338
+ new KeyframeEffect(
1339
+ t.clone,
1340
+ [
1341
+ { transform: o, opacity: 1 },
1342
+ { transform: c, opacity: 0 }
1343
+ ],
1344
+ r
1345
+ )
1346
+ ), n.push(
1347
+ new KeyframeEffect(
1348
+ e.clone,
1349
+ [
1350
+ { transform: o },
1351
+ { transform: c }
1352
+ ],
1353
+ r
1354
+ )
1355
+ );
1356
+ break;
1357
+ case "morph": {
1358
+ const g = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
1359
+ n.push(
1360
+ new KeyframeEffect(
1361
+ e.clone,
1362
+ [
1363
+ {
1364
+ ...Object.fromEntries((t.instance.ref.current?.firstElementChild).attributeStyleMap),
1365
+ transform: o,
1366
+ width: `${t.rect.width}px`,
1367
+ height: `${t.rect.height}px`
1368
+ },
1369
+ {
1370
+ ...Object.fromEntries((e.instance.ref.current?.firstElementChild).attributeStyleMap),
1371
+ ...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, g),
1372
+ transform: c,
1373
+ width: `${e.rect.width}px`,
1374
+ height: `${e.rect.height}px`
1375
+ }
1376
+ ],
1377
+ r
1378
+ )
1379
+ );
1380
+ break;
1381
+ }
1382
+ }
1383
+ return new Dt(n);
1384
+ }
1385
+ get animationEffect() {
1386
+ const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
1387
+ if (!t || !e || t === e)
1388
+ return null;
1389
+ t.previousScene = null, e.previousScene = t;
1390
+ const n = new Array();
1391
+ for (const [r, a] of Array.from(e.nodes.entries())) {
1392
+ const o = a.getBoundingClientRect(), c = t.nodes.get(r);
1393
+ if (!c?.canTransition || !a.canTransition)
1394
+ continue;
1395
+ const g = c.getBoundingClientRect(), p = a.clone(), w = c.clone();
1396
+ if (!w || !p)
1397
+ continue;
1398
+ const S = Array.from(/* @__PURE__ */ new Set([...c.styles, ...a.styles]));
1399
+ a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(c.ref.current?.firstElementChild, w, S), this.copyStyles(a.ref.current?.firstElementChild, p, S), w.style.width = `${g.width}px`, w.style.height = `${g.height}px`, p.style.width = `${o.width}px`, p.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(c.ref.current?.firstElementChild, p, S), p.style.width = `${g.width}px`, p.style.height = `${g.height}px`), p.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, p.style.position = "absolute", p.style.gridArea = "1 / 1", p.style.margin = "0", this.ref.current?.prepend(p), c.hide(), a.hide();
1400
+ const E = async () => {
1401
+ this.props.direction === "forwards" ? a.unhide() : c.unhide(), p.remove(), w.remove();
1402
+ };
1403
+ this.props.navigation.addEventListener("transition-end", E, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", E, { once: !0 }), n.push(this.getAnimationEffect(
1404
+ { instance: c, clone: w, rect: g },
1405
+ { instance: a, clone: p, rect: o }
1406
+ ));
1407
+ }
1408
+ return new Dt(n);
1409
+ }
1410
+ render() {
1411
+ return /* @__PURE__ */ T("dialog", { className: "shared-element-layer", ref: this.ref, style: {
1412
+ maxWidth: "unset",
1413
+ maxHeight: "unset",
1414
+ width: "100vw",
1415
+ height: "100vh",
1416
+ contain: "strict",
1417
+ padding: 0,
1418
+ border: "none",
1419
+ backgroundColor: "transparent",
1420
+ isolation: "isolate"
1421
+ }, children: /* @__PURE__ */ T("style", { children: `
1422
+ .shared-element-layer::backdrop {display: none}
1423
+ .shared-element-layer[open] {display:grid}
1424
+ ` }) });
1425
+ }
1426
+ }
1427
+ const ae = nt(0);
1428
+ class Ie extends it {
1429
+ sharedElementTransitionLayer = K();
1430
+ animation = new Ue();
1431
+ #t = "normal";
1432
+ #e = new Array();
1433
+ state = {
1434
+ gestureNavigating: !1,
1435
+ progress: 1
1436
+ };
1437
+ onAnimationFrame() {
1438
+ const t = this.animation.effect?.getComputedTiming().progress;
1439
+ t && this.onProgress(t), this.animation.playState === "running" && requestAnimationFrame(this.onAnimationFrame.bind(this));
1440
+ }
1441
+ onTransitionCancel() {
1442
+ this.props.navigation.dispatchEvent(new fe());
1443
+ }
1444
+ onTransitionStart() {
1445
+ this.props.navigation.dispatchEvent(new pe()), this.onAnimationFrame();
1446
+ }
1447
+ onTransitionEnd() {
1448
+ this.props.navigation.dispatchEvent(new me());
1449
+ }
1450
+ onProgress(t) {
1451
+ this.setState({ progress: t }), this.props.navigation.dispatchEvent(new ge(t));
1452
+ }
1453
+ get screens() {
1454
+ return this.#e;
1455
+ }
1456
+ set screens(t) {
1457
+ this.#e = t;
1458
+ }
1459
+ set direction(t) {
1460
+ this.#t = t, this.animation.effect?.updateTiming({ direction: t });
1461
+ }
1462
+ get direction() {
1463
+ return this.#t;
1464
+ }
1465
+ get hasUAVisualTransition() {
1466
+ return this.props.hasUAVisualTransition;
1467
+ }
1468
+ transition() {
1469
+ const t = new Dt(
1470
+ this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
1471
+ ), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
1472
+ return e && (e.updateTiming({
1473
+ duration: n instanceof CSSNumericValue ? n.to("ms").value : n
1474
+ }), t.append(e), this.sharedElementTransitionLayer.current?.ref.current?.showModal()), this.animation.effect = t, this.animation.play(), this.onTransitionStart(), this.animation.oncancel = () => {
1475
+ this.sharedElementTransitionLayer.current?.ref.current?.close(), this.onTransitionCancel(), this.animation.effect = null;
1476
+ }, this.animation.finished.then(() => {
1477
+ this.animation.commitStyles(), this.onTransitionEnd(), this.sharedElementTransitionLayer.current?.ref.current?.close(), this.animation.effect = null;
1478
+ }), this.animation;
1479
+ }
1480
+ render() {
1481
+ return /* @__PURE__ */ Gt(Yt.Provider, { value: this, children: [
1482
+ /* @__PURE__ */ T(
1483
+ We,
1484
+ {
1485
+ ref: this.sharedElementTransitionLayer,
1486
+ navigation: this.props.navigation,
1487
+ direction: this.animation.playbackRate > 0 ? "forwards" : "backwards"
1222
1488
  }
1223
- else {
1224
- content = metaContent;
1489
+ ),
1490
+ /* @__PURE__ */ T(
1491
+ "div",
1492
+ {
1493
+ className: "screen-transition-layer",
1494
+ style: {
1495
+ width: "100%",
1496
+ height: "100%",
1497
+ display: "grid",
1498
+ contain: "layout",
1499
+ isolation: "isolate",
1500
+ "--motion-progress": this.state.progress
1501
+ },
1502
+ children: /* @__PURE__ */ T(ae.Provider, { value: this.state.progress, children: this.props.children })
1225
1503
  }
1226
- return content;
1227
- }
1228
- set(key, content) {
1229
- const metaKey = this.getMetaKey(key);
1230
- const metaContent = this.getMetaContent(content);
1231
- this.#map.set(metaKey, metaContent);
1232
- this.updateMetaElement(metaKey, metaContent);
1233
- }
1234
- has(key) {
1235
- const metaKey = this.getMetaKey(key);
1236
- return this.#map.has(metaKey);
1237
- }
1238
- delete(key) {
1239
- const metaKey = this.getMetaKey(key);
1240
- this.#map.delete(metaKey);
1241
- document.head.querySelector(`meta[${metaKey}]`)?.remove();
1242
- }
1243
- clear() {
1244
- document.head.querySelectorAll('meta').forEach(node => node.remove());
1245
- }
1246
- entries() {
1247
- return this.#map.entries();
1248
- }
1249
- [Symbol.iterator]() {
1250
- return this.entries();
1251
- }
1252
- get size() {
1253
- return this.#map.size;
1254
- }
1255
- observeMutations(mutations) {
1256
- for (const mutation of mutations) {
1257
- if (mutation.type === 'attributes') {
1258
- const node = mutation.target;
1259
- this.metaDataFromNode(node);
1504
+ )
1505
+ ] });
1506
+ }
1507
+ }
1508
+ class At extends it {
1509
+ ref = K();
1510
+ screenTransitionLayer = K();
1511
+ parent = null;
1512
+ #t = null;
1513
+ loadDispatched = !1;
1514
+ hasUAVisualTransition = !1;
1515
+ parentScreen = null;
1516
+ static rootRouterRef = null;
1517
+ static contextType = _t;
1518
+ constructor(t, e) {
1519
+ super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (At.rootRouterRef = new WeakRef(this));
1520
+ }
1521
+ componentDidMount() {
1522
+ this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new ye()), this.loadDispatched = !0);
1523
+ }
1524
+ componentWillUnmount() {
1525
+ this.isRoot && window.navigation.removeEventListener("navigate", this.handleNavigationDispatch);
1526
+ }
1527
+ handleNavigationDispatch = (t) => {
1528
+ const n = [...this.#e()].findLast((r) => r.canIntercept(t));
1529
+ n && (n.intercept(t), this.hasUAVisualTransition = t.hasUAVisualTransition);
1530
+ };
1531
+ *#e() {
1532
+ let t = this;
1533
+ for (; t; )
1534
+ yield t, t = t.child;
1535
+ }
1536
+ getRouterById(t, e) {
1537
+ const n = e ?? At.rootRouterRef?.deref();
1538
+ return n.id === t ? n ?? null : n?.child ? this.getRouterById(t, n.child) : null;
1539
+ }
1540
+ dispatchEvent(t) {
1541
+ const e = this.ref.current ?? void 0;
1542
+ return he(t, e);
1543
+ }
1544
+ addEventListener(t, e, n) {
1545
+ return this.ref.current?.addEventListener(t, e, n);
1546
+ }
1547
+ removeEventListener(t, e, n) {
1548
+ return this.ref.current?.removeEventListener(t, e, n);
1549
+ }
1550
+ preloadRoute(t) {
1551
+ return new Promise((e, n) => {
1552
+ let r = !1;
1553
+ const a = this.props.children;
1554
+ jt.forEach(a, (o) => {
1555
+ if (r || !Ut(o))
1556
+ return;
1557
+ const { path: c, caseSensitive: g } = o.props, p = this.baseURLPattern.pathname;
1558
+ if (!Zt(c, t, p, g))
1559
+ return;
1560
+ r = !0;
1561
+ const S = o.props.config;
1562
+ queueMicrotask(async () => {
1563
+ const E = [];
1564
+ "load" in o.props.component && E.push(o.props.component.load()), S?.header?.component && "load" in S?.header?.component && E.push(S?.header?.component.load()), S?.footer?.component && "load" in S?.footer?.component && E.push(S?.footer?.component.load());
1565
+ try {
1566
+ await Promise.all(E), e(r);
1567
+ } catch (F) {
1568
+ n(F);
1569
+ }
1570
+ });
1571
+ }), r || e(!1);
1572
+ });
1573
+ }
1574
+ get id() {
1575
+ if (this.props.id)
1576
+ return this.props.id;
1577
+ const t = this.parent?.id, e = this.parentScreen?.id ?? "root";
1578
+ return [t, e].filter(Boolean).join("-");
1579
+ }
1580
+ get isRoot() {
1581
+ return !this.parent;
1582
+ }
1583
+ get baseURL() {
1584
+ const t = this.isRoot ? window.location.pathname : this.parentScreen?.resolvedPathname, e = this.baseURLPattern.pathname;
1585
+ return bt(e, t);
1586
+ }
1587
+ get baseURLPattern() {
1588
+ let t = window.location.origin + "/", e = this.props.config?.basePath;
1589
+ if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
1590
+ const { resolvedPathname: n = window.location.pathname, path: r } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({ baseURL: a, pathname: r });
1591
+ t = bt(
1592
+ o.pathname,
1593
+ n
1594
+ ).href;
1595
+ }
1596
+ return new URLPattern({ baseURL: t, pathname: e });
1597
+ }
1598
+ get pathPatterns() {
1599
+ return jt.map(this.props.children, (t) => ({ pattern: t.props.path, caseSensitive: !!t.props.caseSensitive }));
1600
+ }
1601
+ get mounted() {
1602
+ return !!this.ref.current;
1603
+ }
1604
+ get child() {
1605
+ return this.#t?.deref() ?? null;
1606
+ }
1607
+ set child(t) {
1608
+ const e = this.#t?.deref();
1609
+ if (e && t?.id !== e?.id && e?.mounted)
1610
+ throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1611
+ t ? this.#t = new WeakRef(t) : this.#t = null;
1612
+ }
1613
+ render() {
1614
+ if (this.navigation)
1615
+ return /* @__PURE__ */ T(
1616
+ "div",
1617
+ {
1618
+ id: this.id,
1619
+ className: "react-motion-router",
1620
+ style: { width: "100%", height: "100%" },
1621
+ ref: this.ref,
1622
+ children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
1623
+ Ie,
1624
+ {
1625
+ ref: this.screenTransitionLayer,
1626
+ navigation: this.navigation,
1627
+ hasUAVisualTransition: this.hasUAVisualTransition,
1628
+ children: this.screens
1260
1629
  }
1261
- if (mutation.type !== 'childList')
1262
- return;
1263
- mutation.removedNodes.forEach((node) => {
1264
- if (node.nodeName === 'META') {
1265
- const [type] = Array.from(node.attributes).filter(attribute => attribute.nodeName !== "content");
1266
- const metaType = [type.nodeName, type.value];
1267
- const key = metaType.join('=');
1268
- if (this.#map.has(key)) {
1269
- this.#map.delete(key);
1270
- }
1271
- }
1272
- });
1273
- mutation.addedNodes.forEach(node => {
1274
- if (node.nodeName === 'META') {
1275
- this.metaDataFromNode(node);
1276
- }
1277
- });
1278
- }
1279
- }
1280
- metaDataFromNode(node) {
1281
- const [type] = Array.from(node.attributes).filter(attribute => attribute.nodeName !== "content");
1282
- const [content] = Array.from(node.attributes).filter(attribute => attribute.nodeName === "content");
1283
- const metaType = [type.nodeName, type.value];
1284
- const key = metaType.join('=');
1285
- this.#map.set(key, content?.value);
1286
- }
1287
- getMetaKey(key) {
1288
- let metaKey;
1289
- if (typeof key === "string") {
1290
- metaKey = `name=${key}`;
1291
- }
1292
- else {
1293
- metaKey = key.join('=');
1294
- }
1295
- return metaKey;
1296
- }
1297
- getMetaContent(content) {
1298
- if (!content)
1299
- return undefined;
1300
- let metaContent;
1301
- if (typeof content === "string") {
1302
- metaContent = content;
1303
- }
1304
- else {
1305
- metaContent = content.map(contentTuple => contentTuple.join('=')).join(', ');
1630
+ ) })
1306
1631
  }
1307
- return metaContent;
1308
- }
1309
- updateMetaElement(key, content) {
1310
- const meta = document.querySelector(`meta[${key}]`) || document.createElement('meta');
1311
- const metaType = key.split('=');
1312
- meta.setAttribute(...metaType);
1313
- if (content)
1314
- meta.setAttribute('content', content);
1315
- else
1316
- meta.removeAttribute('content');
1317
- if (!meta.parentElement) {
1318
- document.head.appendChild(meta);
1632
+ );
1633
+ }
1634
+ }
1635
+ class $e {
1636
+ #t = /* @__PURE__ */ new Map();
1637
+ mutationObserver;
1638
+ constructor() {
1639
+ this.mutationObserver = new MutationObserver(this.observeMutations.bind(this));
1640
+ const { head: t } = document;
1641
+ this.mutationObserver.observe(t, {
1642
+ childList: !0
1643
+ }), Array.from(t.querySelectorAll("meta")).forEach((e) => {
1644
+ this.mutationObserver.observe(e, {
1645
+ attributes: !0
1646
+ });
1647
+ }), Array.from(t.querySelectorAll("meta")).forEach(this.metaDataFromNode.bind(this));
1648
+ }
1649
+ get(t) {
1650
+ const e = this.getMetaKey(t), n = this.#t.get(e);
1651
+ if (!n)
1652
+ return;
1653
+ let r;
1654
+ return n.includes(",") && n.includes("=") ? r = n.split(/,\s*/).map((a) => a.split("=")) : r = n, r;
1655
+ }
1656
+ set(t, e) {
1657
+ const n = this.getMetaKey(t), r = this.getMetaContent(e);
1658
+ this.#t.set(n, r), this.updateMetaElement(n, r);
1659
+ }
1660
+ has(t) {
1661
+ const e = this.getMetaKey(t);
1662
+ return this.#t.has(e);
1663
+ }
1664
+ delete(t) {
1665
+ const e = this.getMetaKey(t);
1666
+ this.#t.delete(e), document.head.querySelector(`meta[${e}]`)?.remove();
1667
+ }
1668
+ clear() {
1669
+ document.head.querySelectorAll("meta").forEach((t) => t.remove());
1670
+ }
1671
+ entries() {
1672
+ return this.#t.entries();
1673
+ }
1674
+ [Symbol.iterator]() {
1675
+ return this.entries();
1676
+ }
1677
+ get size() {
1678
+ return this.#t.size;
1679
+ }
1680
+ observeMutations(t) {
1681
+ for (const e of t) {
1682
+ if (e.type === "attributes") {
1683
+ const n = e.target;
1684
+ this.metaDataFromNode(n);
1685
+ }
1686
+ if (e.type !== "childList")
1687
+ return;
1688
+ e.removedNodes.forEach((n) => {
1689
+ if (n.nodeName === "META") {
1690
+ const [r] = Array.from(n.attributes).filter((c) => c.nodeName !== "content"), o = [r.nodeName, r.value].join("=");
1691
+ this.#t.has(o) && this.#t.delete(o);
1319
1692
  }
1320
- }
1693
+ }), e.addedNodes.forEach((n) => {
1694
+ n.nodeName === "META" && this.metaDataFromNode(n);
1695
+ });
1696
+ }
1697
+ }
1698
+ metaDataFromNode(t) {
1699
+ const [e] = Array.from(t.attributes).filter((o) => o.nodeName !== "content"), [n] = Array.from(t.attributes).filter((o) => o.nodeName === "content"), a = [e.nodeName, e.value].join("=");
1700
+ this.#t.set(a, n?.value);
1701
+ }
1702
+ getMetaKey(t) {
1703
+ let e;
1704
+ return typeof t == "string" ? e = `name=${t}` : e = t.join("="), e;
1705
+ }
1706
+ getMetaContent(t) {
1707
+ if (!t)
1708
+ return;
1709
+ let e;
1710
+ return typeof t == "string" ? e = t : e = t.map((n) => n.join("=")).join(", "), e;
1711
+ }
1712
+ updateMetaElement(t, e) {
1713
+ const n = document.querySelector(`meta[${t}]`) || document.createElement("meta"), r = t.split("=");
1714
+ n.setAttribute(...r), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1715
+ }
1321
1716
  }
1322
-
1323
- ;// CONCATENATED MODULE: ./src/NavigationBase.ts
1324
-
1325
- class NavigationBase {
1326
- static rootNavigatorRef = null;
1327
- metaData = new MetaData();
1328
- constructor() {
1329
- const rootNavigator = NavigationBase.rootNavigatorRef?.deref();
1330
- if (!rootNavigator || !rootNavigator.isInDocument)
1331
- NavigationBase.rootNavigatorRef = new WeakRef(this);
1332
- }
1333
- addEventListener(type, listener, options) {
1334
- this.router.addEventListener(type, listener, options);
1335
- return () => this.router.removeEventListener(type, listener, options);
1336
- }
1337
- removeEventListener(type, listener, options) {
1338
- return this.router.removeEventListener(type, listener, options);
1339
- }
1340
- dispatchEvent(event) {
1341
- return this.router.dispatchEvent?.(event);
1342
- }
1343
- get parent() {
1344
- return this.router.parent?.navigation ?? null;
1345
- }
1346
- get routerId() {
1347
- return this.router.id;
1348
- }
1349
- get baseURL() {
1350
- return this.router.baseURL;
1351
- }
1352
- get baseURLPattern() {
1353
- return this.router.baseURLPattern;
1354
- }
1355
- getNavigatorById(routerId) {
1356
- return this.router.getRouterById(routerId)?.navigation ?? null;
1357
- }
1358
- preloadRoute(path) {
1359
- const { pathname } = new URL(path, this.baseURL);
1360
- return this.router.preloadRoute(pathname);
1361
- }
1362
- get isInDocument() {
1363
- return Boolean(document.getElementById(`${this.routerId}`));
1364
- }
1717
+ class Nt {
1718
+ static rootNavigatorRef = null;
1719
+ metaData = new $e();
1720
+ constructor() {
1721
+ const t = Nt.rootNavigatorRef?.deref();
1722
+ (!t || !t.isInDocument) && (Nt.rootNavigatorRef = new WeakRef(this));
1723
+ }
1724
+ addEventListener(t, e, n) {
1725
+ return this.router.addEventListener(t, e, n), () => this.router.removeEventListener(t, e, n);
1726
+ }
1727
+ removeEventListener(t, e, n) {
1728
+ return this.router.removeEventListener(t, e, n);
1729
+ }
1730
+ dispatchEvent(t) {
1731
+ return this.router.dispatchEvent?.(t);
1732
+ }
1733
+ get parent() {
1734
+ return this.router.parent?.navigation ?? null;
1735
+ }
1736
+ get routerId() {
1737
+ return this.router.id;
1738
+ }
1739
+ get baseURL() {
1740
+ return this.router.baseURL;
1741
+ }
1742
+ get baseURLPattern() {
1743
+ return this.router.baseURLPattern;
1744
+ }
1745
+ getNavigatorById(t) {
1746
+ return this.router.getRouterById(t)?.navigation ?? null;
1747
+ }
1748
+ preloadRoute(t) {
1749
+ const { pathname: e } = new URL(t, this.baseURL);
1750
+ return this.router.preloadRoute(e);
1751
+ }
1752
+ get isInDocument() {
1753
+ return !!document.getElementById(`${this.routerId}`);
1754
+ }
1365
1755
  }
1366
-
1367
- ;// CONCATENATED MODULE: ./src/common/hooks.ts
1368
-
1369
-
1370
-
1371
-
1372
- function useNavigationBase() {
1373
- const router = (0,external_react_.useContext)(RouterContext);
1374
- if (router) {
1375
- return router.navigation;
1376
- }
1377
- else {
1378
- throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1379
- }
1756
+ function Qe() {
1757
+ const s = yt(vt);
1758
+ if (s)
1759
+ return s.navigation;
1760
+ throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1380
1761
  }
1381
- function useRouterBase() {
1382
- return (0,external_react_.useContext)(RouterContext);
1762
+ function tn() {
1763
+ return yt(vt);
1383
1764
  }
1384
- function useMotion() {
1385
- (0,external_react_.useDebugValue)("Motion");
1386
- return (0,external_react_.useContext)(MotionContext);
1765
+ function en() {
1766
+ return ce("Motion"), yt(ae);
1387
1767
  }
1388
- function useRouteBase() {
1389
- const routeProp = (0,external_react_.useContext)(RoutePropContext);
1390
- if (routeProp) {
1391
- return routeProp;
1392
- }
1393
- else {
1394
- throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1395
- }
1768
+ function Oe() {
1769
+ const s = yt(Jt);
1770
+ if (s)
1771
+ return s;
1772
+ throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1396
1773
  }
1397
- function useParamsBase(key, initialParams) {
1398
- const route = useRouteBase();
1399
- initialParams = initialParams instanceof Function ? initialParams() : initialParams;
1400
- const setParams = (params) => {
1401
- if (params instanceof Function)
1402
- params = params(route.params[key] ?? initialParams);
1403
- route.setParams({ [key]: params });
1404
- };
1405
- return [route.params[key] ?? initialParams, setParams];
1774
+ function nn(s, t) {
1775
+ const e = Oe();
1776
+ t = t instanceof Function ? t() : t;
1777
+ const n = (r) => {
1778
+ r instanceof Function && (r = r(e.params[s] ?? t)), e.setParams({ [s]: r });
1779
+ };
1780
+ return [e.params[s] ?? t, n];
1406
1781
  }
1407
-
1408
- ;// CONCATENATED MODULE: ./src/common/constants.ts
1409
- const MAX_Z_INDEX = 2147483647;
1410
- const MAX_PROGRESS = 100;
1411
- const MIN_PROGRESS = 0;
1412
- const MIN_NORM_PROGRESS = 0;
1413
- const MAX_NORM_PROGRESS = 1;
1414
-
1415
- ;// CONCATENATED MODULE: ./src/index.ts
1416
- /// <reference types="urlpattern-polyfill" />
1417
-
1418
-
1419
-
1420
-
1421
-
1422
-
1423
-
1424
-
1425
-
1426
-
1427
-
1428
-
1429
- })();
1430
-
1431
- var __webpack_exports__LoadEvent = __webpack_exports__.Tc;
1432
- var __webpack_exports__MAX_NORM_PROGRESS = __webpack_exports__.YU;
1433
- var __webpack_exports__MAX_PROGRESS = __webpack_exports__.SR;
1434
- var __webpack_exports__MAX_Z_INDEX = __webpack_exports__.dw;
1435
- var __webpack_exports__MIN_NORM_PROGRESS = __webpack_exports__.Uy;
1436
- var __webpack_exports__MIN_PROGRESS = __webpack_exports__.yn;
1437
- var __webpack_exports__MotionContext = __webpack_exports__.vw;
1438
- var __webpack_exports__MotionProgressEndEvent = __webpack_exports__.FC;
1439
- var __webpack_exports__MotionProgressEvent = __webpack_exports__.yx;
1440
- var __webpack_exports__MotionProgressStartEvent = __webpack_exports__.z4;
1441
- var __webpack_exports__NavigationBase = __webpack_exports__.DC;
1442
- var __webpack_exports__NestedRouterContext = __webpack_exports__.Fh;
1443
- var __webpack_exports__PromiseAllDynamic = __webpack_exports__.DM;
1444
- var __webpack_exports__RouterBase = __webpack_exports__.GW;
1445
- var __webpack_exports__RouterContext = __webpack_exports__._q;
1446
- var __webpack_exports__ScreenBase = __webpack_exports__.RG;
1447
- var __webpack_exports__SharedElement = __webpack_exports__.rJ;
1448
- var __webpack_exports__TransitionCancelEvent = __webpack_exports__.XP;
1449
- var __webpack_exports__TransitionEndEvent = __webpack_exports__.d7;
1450
- var __webpack_exports__TransitionStartEvent = __webpack_exports__.sy;
1451
- var __webpack_exports__cloneAndInject = __webpack_exports__.yb;
1452
- var __webpack_exports__dispatchEvent = __webpack_exports__.Nu;
1453
- var __webpack_exports__includesRoute = __webpack_exports__.e1;
1454
- var __webpack_exports__isLazyExoticComponent = __webpack_exports__.Qv;
1455
- var __webpack_exports__isNativeLazyExoticComponent = __webpack_exports__.R1;
1456
- var __webpack_exports__isNavigationSupported = __webpack_exports__.vi;
1457
- var __webpack_exports__isStylableElement = __webpack_exports__.R_;
1458
- var __webpack_exports__isURLPatternSupported = __webpack_exports__.Ky;
1459
- var __webpack_exports__isValidScreenChild = __webpack_exports__.$r;
1460
- var __webpack_exports__lazy = __webpack_exports__.Vo;
1461
- var __webpack_exports__matchRoute = __webpack_exports__.QN;
1462
- var __webpack_exports__polyfillNavigation = __webpack_exports__.Sy;
1463
- var __webpack_exports__polyfillURLPattern = __webpack_exports__.gy;
1464
- var __webpack_exports__resolveBaseURLFromPattern = __webpack_exports__.n4;
1465
- var __webpack_exports__toCamelCase = __webpack_exports__.zW;
1466
- var __webpack_exports__useMotion = __webpack_exports__.nc;
1467
- var __webpack_exports__useNavigationBase = __webpack_exports__.ev;
1468
- var __webpack_exports__useParamsBase = __webpack_exports__.Ot;
1469
- var __webpack_exports__useRouteBase = __webpack_exports__.qr;
1470
- var __webpack_exports__useRouterBase = __webpack_exports__.yL;
1471
- export { __webpack_exports__LoadEvent as LoadEvent, __webpack_exports__MAX_NORM_PROGRESS as MAX_NORM_PROGRESS, __webpack_exports__MAX_PROGRESS as MAX_PROGRESS, __webpack_exports__MAX_Z_INDEX as MAX_Z_INDEX, __webpack_exports__MIN_NORM_PROGRESS as MIN_NORM_PROGRESS, __webpack_exports__MIN_PROGRESS as MIN_PROGRESS, __webpack_exports__MotionContext as MotionContext, __webpack_exports__MotionProgressEndEvent as MotionProgressEndEvent, __webpack_exports__MotionProgressEvent as MotionProgressEvent, __webpack_exports__MotionProgressStartEvent as MotionProgressStartEvent, __webpack_exports__NavigationBase as NavigationBase, __webpack_exports__NestedRouterContext as NestedRouterContext, __webpack_exports__PromiseAllDynamic as PromiseAllDynamic, __webpack_exports__RouterBase as RouterBase, __webpack_exports__RouterContext as RouterContext, __webpack_exports__ScreenBase as ScreenBase, __webpack_exports__SharedElement as SharedElement, __webpack_exports__TransitionCancelEvent as TransitionCancelEvent, __webpack_exports__TransitionEndEvent as TransitionEndEvent, __webpack_exports__TransitionStartEvent as TransitionStartEvent, __webpack_exports__cloneAndInject as cloneAndInject, __webpack_exports__dispatchEvent as dispatchEvent, __webpack_exports__includesRoute as includesRoute, __webpack_exports__isLazyExoticComponent as isLazyExoticComponent, __webpack_exports__isNativeLazyExoticComponent as isNativeLazyExoticComponent, __webpack_exports__isNavigationSupported as isNavigationSupported, __webpack_exports__isStylableElement as isStylableElement, __webpack_exports__isURLPatternSupported as isURLPatternSupported, __webpack_exports__isValidScreenChild as isValidScreenChild, __webpack_exports__lazy as lazy, __webpack_exports__matchRoute as matchRoute, __webpack_exports__polyfillNavigation as polyfillNavigation, __webpack_exports__polyfillURLPattern as polyfillURLPattern, __webpack_exports__resolveBaseURLFromPattern as resolveBaseURLFromPattern, __webpack_exports__toCamelCase as toCamelCase, __webpack_exports__useMotion as useMotion, __webpack_exports__useNavigationBase as useNavigationBase, __webpack_exports__useParamsBase as useParamsBase, __webpack_exports__useRouteBase as useRouteBase, __webpack_exports__useRouterBase as useRouterBase };
1472
-
1473
- //# sourceMappingURL=index.js.map
1782
+ const sn = 2147483647, rn = 100, an = 0, on = 0, ln = 1;
1783
+ export {
1784
+ ye as LoadEvent,
1785
+ ln as MAX_NORM_PROGRESS,
1786
+ rn as MAX_PROGRESS,
1787
+ sn as MAX_Z_INDEX,
1788
+ on as MIN_NORM_PROGRESS,
1789
+ an as MIN_PROGRESS,
1790
+ ae as MotionContext,
1791
+ Ye as MotionProgressEndEvent,
1792
+ ge as MotionProgressEvent,
1793
+ Ze as MotionProgressStartEvent,
1794
+ Nt as NavigationBase,
1795
+ _t as NestedRouterContext,
1796
+ ue as PromiseAllDynamic,
1797
+ At as RouterBase,
1798
+ vt as RouterContext,
1799
+ Ee as ScreenBase,
1800
+ Fe as SharedElement,
1801
+ fe as TransitionCancelEvent,
1802
+ me as TransitionEndEvent,
1803
+ pe as TransitionStartEvent,
1804
+ He as cloneAndInject,
1805
+ he as dispatchEvent,
1806
+ Be as includesRoute,
1807
+ te as isLazyExoticComponent,
1808
+ Qt as isNativeLazyExoticComponent,
1809
+ qe as isNavigationSupported,
1810
+ be as isStylableElement,
1811
+ ze as isURLPatternSupported,
1812
+ _e as isValidScreenChild,
1813
+ Ke as lazy,
1814
+ Zt as matchRoute,
1815
+ Xe as polyfillNavigation,
1816
+ Ge as polyfillURLPattern,
1817
+ bt as resolveBaseURLFromPattern,
1818
+ de as toCamelCase,
1819
+ en as useMotion,
1820
+ Qe as useNavigationBase,
1821
+ nn as useParamsBase,
1822
+ Oe as useRouteBase,
1823
+ tn as useRouterBase
1824
+ };
1825
+ //# sourceMappingURL=index.js.map