one 2.21.0 → 2.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Root.cjs +6 -1
- package/dist/cjs/Root.native.cjs +6 -1
- package/dist/cjs/Root.native.js +6 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/router/warmState.cjs +16 -0
- package/dist/cjs/router/warmState.native.cjs +16 -0
- package/dist/cjs/router/warmState.native.js +16 -0
- package/dist/cjs/router/warmState.native.js.map +1 -1
- package/dist/esm/Root.mjs +7 -2
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +7 -2
- package/dist/esm/Root.native.js.map +1 -1
- package/dist/esm/router/warmState.mjs +16 -1
- package/dist/esm/router/warmState.mjs.map +1 -1
- package/dist/esm/router/warmState.native.js +16 -1
- package/dist/esm/router/warmState.native.js.map +1 -1
- package/package.json +13 -13
- package/src/Root.tsx +8 -1
- package/src/router/warmState.test.ts +34 -0
- package/src/router/warmState.ts +23 -0
- package/types/Root.d.ts.map +1 -1
- package/types/router/warmState.d.ts +2 -0
- package/types/router/warmState.d.ts.map +1 -1
package/dist/esm/Root.native.js
CHANGED
|
@@ -10,7 +10,7 @@ import { getURL } from "./getURL.native.js";
|
|
|
10
10
|
import { FlagsContext } from "./router/FlagsContext.native.js";
|
|
11
11
|
import { getResolvedLinking } from "./router/linkingConfig.native.js";
|
|
12
12
|
import { handleNavigationContainerStateChange, linkTo } from "./router/router.native.js";
|
|
13
|
-
import { configureWarmStateFromFlags, consumeWarmRouteApplied, flushWarmState, isWarmRouteApplied, isWarmStateEnabled, reconcileNativeColdDeepLink } from "./router/warmState.native.js";
|
|
13
|
+
import { configureWarmStateFromFlags, consumeWarmRouteApplied, flushWarmState, isWarmRouteApplied, isWarmStateEnabled, reconcileNativeColdDeepLink, settleWarmLaunch } from "./router/warmState.native.js";
|
|
14
14
|
import { attachWarmStateLifecycle, getNativeInitialURL } from "./router/warmStatePlatform.native.js";
|
|
15
15
|
import { ServerLocationContext } from "./router/serverLocationContext.native.js";
|
|
16
16
|
import { LaunchScreenRelease } from "./router/LaunchScreenRelease.native.js";
|
|
@@ -65,7 +65,9 @@ function Root(props) {
|
|
|
65
65
|
useEffect(function() {
|
|
66
66
|
var _store_routeInfo, _store_routeInfo1;
|
|
67
67
|
if (!isWarmStateEnabled()) return;
|
|
68
|
+
var settle = setTimeout(settleWarmLaunch, 5e3);
|
|
68
69
|
var detach = attachWarmStateLifecycle(function() {
|
|
70
|
+
settleWarmLaunch();
|
|
69
71
|
flushWarmState();
|
|
70
72
|
});
|
|
71
73
|
var currentHref = ((_store_routeInfo = store.routeInfo) === null || _store_routeInfo === void 0 ? void 0 : _store_routeInfo.unstable_globalHref) || ((_store_routeInfo1 = store.routeInfo) === null || _store_routeInfo1 === void 0 ? void 0 : _store_routeInfo1.pathname);
|
|
@@ -85,7 +87,10 @@ function Root(props) {
|
|
|
85
87
|
setIsHoldingWarmReconcile(false);
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
|
-
return
|
|
90
|
+
return function() {
|
|
91
|
+
clearTimeout(settle);
|
|
92
|
+
detach();
|
|
93
|
+
};
|
|
89
94
|
}, []);
|
|
90
95
|
if (isNative && process.env.NODE_ENV === "production" && store.routeNode) {
|
|
91
96
|
var loadError = getRouteLoadError(store.routeNode.loadRoute());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useEffect, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative, isWebServer } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange, linkTo } from \"./router/router\";\nimport { configureWarmStateFromFlags, consumeWarmRouteApplied, flushWarmState, isWarmRouteApplied, isWarmStateEnabled, reconcileNativeColdDeepLink } from \"./router/warmState\";\nimport { attachWarmStateLifecycle, getNativeInitialURL } from \"./router/warmStatePlatform\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { LaunchScreenRelease } from \"./router/LaunchScreenRelease\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { getRouteLoadError, useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n if (!isWebServer) {\n configureWarmStateFromFlags(props.flags);\n }\n var store = useInitializeOneRouter(context, location, linking);\n var [warmRouteWasApplied] = useState(function() {\n return isNative && isWarmRouteApplied();\n });\n var [isHoldingWarmReconcile, setIsHoldingWarmReconcile] = useState(function() {\n return warmRouteWasApplied;\n });\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n useEffect(function() {\n var _store_routeInfo, _store_routeInfo1;\n if (!isWarmStateEnabled()) return;\n var detach = attachWarmStateLifecycle(function() {\n flushWarmState();\n });\n var currentHref = ((_store_routeInfo = store.routeInfo) === null || _store_routeInfo === void 0 ? void 0 : _store_routeInfo.unstable_globalHref) || ((_store_routeInfo1 = store.routeInfo) === null || _store_routeInfo1 === void 0 ? void 0 : _store_routeInfo1.pathname);\n if (isNative && consumeWarmRouteApplied()) {\n var _getResolvedLinking;\n void reconcileNativeColdDeepLink({\n getInitialURL: getNativeInitialURL,\n prefixes: (_getResolvedLinking = getResolvedLinking()) === null || _getResolvedLinking === void 0 ? void 0 : _getResolvedLinking.prefixes,\n currentHref,\n currentPathname: currentHref,\n navigateTo: function navigateTo(href) {\n return linkTo(href, \"REPLACE\");\n }\n }).catch(function() {\n return null;\n }).finally(function() {\n setIsHoldingWarmReconcile(false);\n });\n }\n return detach;\n }, []);\n if (isNative && process.env.NODE_ENV === \"production\" && store.routeNode) {\n var loadError = getRouteLoadError(store.routeNode.loadRoute());\n if (loadError) throw loadError;\n }\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var deferredPriority = props.mode === \"spa-shell\" ? void 0 : \"low\";\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: deferredPriority,\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n }),\n /* @__PURE__ */ _jsx(LaunchScreenRelease, {\n hold: isHoldingWarmReconcile\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI,mCAAmC,IAAI,IAAI;AAC/C,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,IAAI,4BAA4C,8BAAc,IAAI;AAClE,SAAS,KAAK,OAAO;CACnB,IAAI;CACJ,WAAW,sCAAsC,WAAW;EAC1D,OAAO,WAAW,yBAAyB;CAC7C;CACA,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,IAAI,EAAE,MAAM,QAAQ,cAAc,UAAU,0BAA0B,YAAY,YAAY;CAC9F,IAAI,UAAU,cAAc,QAAQ,MAAM,YAAY,cAAc,WAAW,gBAAgB;CAC/F,IAAI,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC3L,IAAI,CAAC,aAAa;EAChB,4BAA4B,MAAM,KAAK;CACzC;CACA,IAAI,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC7D,IAAI,CAAC,uBAAuB,SAAS,WAAW;EAC9C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AAI,UAAU,OAAO;EACrB,IAAI,UAAU,eAAe,OAAO,KAAK,GAAG,UAAU,iBAAiB,KAAK,UAAU,OAAO,OAAO,MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,MAAM;KAClE,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useEffect, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative, isWebServer } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange, linkTo } from \"./router/router\";\nimport { configureWarmStateFromFlags, consumeWarmRouteApplied, flushWarmState, isWarmRouteApplied, isWarmStateEnabled, reconcileNativeColdDeepLink, settleWarmLaunch } from \"./router/warmState\";\nimport { attachWarmStateLifecycle, getNativeInitialURL } from \"./router/warmStatePlatform\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { LaunchScreenRelease } from \"./router/LaunchScreenRelease\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { getRouteLoadError, useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n if (!isWebServer) {\n configureWarmStateFromFlags(props.flags);\n }\n var store = useInitializeOneRouter(context, location, linking);\n var [warmRouteWasApplied] = useState(function() {\n return isNative && isWarmRouteApplied();\n });\n var [isHoldingWarmReconcile, setIsHoldingWarmReconcile] = useState(function() {\n return warmRouteWasApplied;\n });\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n useEffect(function() {\n var _store_routeInfo, _store_routeInfo1;\n if (!isWarmStateEnabled()) return;\n var settle = setTimeout(settleWarmLaunch, 5e3);\n var detach = attachWarmStateLifecycle(function() {\n settleWarmLaunch();\n flushWarmState();\n });\n var currentHref = ((_store_routeInfo = store.routeInfo) === null || _store_routeInfo === void 0 ? void 0 : _store_routeInfo.unstable_globalHref) || ((_store_routeInfo1 = store.routeInfo) === null || _store_routeInfo1 === void 0 ? void 0 : _store_routeInfo1.pathname);\n if (isNative && consumeWarmRouteApplied()) {\n var _getResolvedLinking;\n void reconcileNativeColdDeepLink({\n getInitialURL: getNativeInitialURL,\n prefixes: (_getResolvedLinking = getResolvedLinking()) === null || _getResolvedLinking === void 0 ? void 0 : _getResolvedLinking.prefixes,\n currentHref,\n currentPathname: currentHref,\n navigateTo: function navigateTo(href) {\n return linkTo(href, \"REPLACE\");\n }\n }).catch(function() {\n return null;\n }).finally(function() {\n setIsHoldingWarmReconcile(false);\n });\n }\n return function() {\n clearTimeout(settle);\n detach();\n };\n }, []);\n if (isNative && process.env.NODE_ENV === \"production\" && store.routeNode) {\n var loadError = getRouteLoadError(store.routeNode.loadRoute());\n if (loadError) throw loadError;\n }\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var deferredPriority = props.mode === \"spa-shell\" ? void 0 : \"low\";\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: deferredPriority,\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n }),\n /* @__PURE__ */ _jsx(LaunchScreenRelease, {\n hold: isHoldingWarmReconcile\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI,mCAAmC,IAAI,IAAI;AAC/C,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,IAAI,4BAA4C,8BAAc,IAAI;AAClE,SAAS,KAAK,OAAO;CACnB,IAAI;CACJ,WAAW,sCAAsC,WAAW;EAC1D,OAAO,WAAW,yBAAyB;CAC7C;CACA,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,IAAI,EAAE,MAAM,QAAQ,cAAc,UAAU,0BAA0B,YAAY,YAAY;CAC9F,IAAI,UAAU,cAAc,QAAQ,MAAM,YAAY,cAAc,WAAW,gBAAgB;CAC/F,IAAI,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC3L,IAAI,CAAC,aAAa;EAChB,4BAA4B,MAAM,KAAK;CACzC;CACA,IAAI,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC7D,IAAI,CAAC,uBAAuB,SAAS,WAAW;EAC9C,OAAO,YAAY,mBAAmB;CACxC,CAAC;CACD,IAAI,CAAC,wBAAwB,6BAA6B,SAAS,WAAW;EAC5E,OAAO;CACT,CAAC;CACD,IAAI,aAAa,cAAc;CAC/B,IAAI,YAAY,MAAM;CACtB,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,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MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,MAAM;KAClE,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
@@ -31,6 +31,8 @@ let restoredLaunch = false;
|
|
|
31
31
|
let restoredState;
|
|
32
32
|
let restoredPathname;
|
|
33
33
|
let warmInitialRouteConsumed = false;
|
|
34
|
+
const RESTORE_GUARD_KEY = `${WARM_STATE_STORAGE_KEY}restoring`;
|
|
35
|
+
let restoreGuardSet = false;
|
|
34
36
|
let latestNavState;
|
|
35
37
|
let latestPathname;
|
|
36
38
|
let pendingInput = null;
|
|
@@ -139,6 +141,11 @@ function ensureLoadedEnvelope() {
|
|
|
139
141
|
loadedFromStorage = true;
|
|
140
142
|
const raw = safeReadStorage(WARM_STATE_STORAGE_KEY);
|
|
141
143
|
if (!raw) return null;
|
|
144
|
+
if (isNativeRuntime() && safeReadStorage(RESTORE_GUARD_KEY)) {
|
|
145
|
+
safeRemoveStorage(WARM_STATE_STORAGE_KEY);
|
|
146
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
142
149
|
const parsed = parseWarmEnvelope(raw, {
|
|
143
150
|
schemaVersion: config.schemaVersion,
|
|
144
151
|
maxAgeMs: config.maxAgeMs,
|
|
@@ -150,8 +157,14 @@ function ensureLoadedEnvelope() {
|
|
|
150
157
|
return null;
|
|
151
158
|
}
|
|
152
159
|
hydratedEnvelope = parsed;
|
|
160
|
+
if (isNativeRuntime()) restoreGuardSet = safeWriteStorage(RESTORE_GUARD_KEY, "1");
|
|
153
161
|
return hydratedEnvelope;
|
|
154
162
|
}
|
|
163
|
+
function settleWarmLaunch() {
|
|
164
|
+
if (!restoreGuardSet) return;
|
|
165
|
+
restoreGuardSet = false;
|
|
166
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
167
|
+
}
|
|
155
168
|
function getHydratedWarmState() {
|
|
156
169
|
if (!isWarmStateEnabled()) return null;
|
|
157
170
|
return ensureLoadedEnvelope();
|
|
@@ -389,6 +402,8 @@ function flushWarmState() {
|
|
|
389
402
|
}
|
|
390
403
|
function clearWarmState(options) {
|
|
391
404
|
safeRemoveStorage(WARM_STATE_STORAGE_KEY);
|
|
405
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
406
|
+
restoreGuardSet = false;
|
|
392
407
|
loadedFromStorage = false;
|
|
393
408
|
hydratedEnvelope = null;
|
|
394
409
|
hydratedSourceKeys.clear();
|
|
@@ -448,5 +463,5 @@ async function reconcileNativeColdDeepLink(options) {
|
|
|
448
463
|
return normalizedTarget;
|
|
449
464
|
}
|
|
450
465
|
|
|
451
|
-
export { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern2 as normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };
|
|
466
|
+
export { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern2 as normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, settleWarmLaunch, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };
|
|
452
467
|
//# sourceMappingURL=warmState.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warmState.js","names":[],"sources":["esm/router/warmState.js"],"sourcesContent":["import { SERVER_CONTEXT_KEY } from \"../constants\";\nimport { extractPathFromURL } from \"../fork/extractPathFromURL\";\nimport { getPathDataFromState } from \"../fork/getPathFromState\";\nimport { getStateFromPath } from \"../fork/getStateFromPath\";\nimport { Storage } from \"../platform/storage\";\nimport { extractParamsFromState, findAllRouteNodesFromState } from \"./findRouteNode\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { createWarmSerializer } from \"./warmStateSerialize\";\nimport { DEFAULT_WARM_STATE_MAX_AGE_MS, WARM_STATE_STORAGE_KEY, matchRoutePattern, matchRoutePattern as matchRoutePattern2, normalizeRoutePattern as normalizeRoutePattern2, parseWarmEnvelope, serializeWarmInputSync } from \"./warmStateShared\";\n\n// dist/esm/router/warmState.js?tamagui-build-prune\nconst defaultConfig = {\n\tenabled: false,\n\tschemaVersion: 1,\n\tmaxAgeMs: DEFAULT_WARM_STATE_MAX_AGE_MS,\n\trestoreRoute: true,\n\trestoreWebRoute: false,\n\tpreloadRoutes: true,\n\tincludeRoutes: void 0,\n\texcludeRoutes: void 0,\n\talignRoute: void 0,\n\tnow: () => Date.now()\n};\nlet config = { ...defaultConfig };\nconst registeredSources = /* @__PURE__ */ new Map();\nconst hydratedSourceKeys = /* @__PURE__ */ new Set();\nlet loadedFromStorage = false;\nlet hydratedEnvelope = null;\nlet warmRouteApplied = false;\nlet restoredLaunch = false;\nlet restoredState;\nlet restoredPathname;\nlet warmInitialRouteConsumed = false;\nlet latestNavState;\nlet latestPathname;\nlet pendingInput = null;\nlet serializer = null;\nfunction isNativeRuntime() {\n\treturn false;\n}\nfunction isWebClientRuntime() {\n\treturn typeof window !== \"undefined\";\n}\nfunction isSSRRuntime() {\n\treturn typeof window === \"undefined\";\n}\nfunction hasDefaultStorage() {\n\tif (isSSRRuntime()) return false;\n\tif (isNativeRuntime()) return true;\n\treturn typeof localStorage !== \"undefined\";\n}\nfunction getStorage() {\n\tif (config.storage) return config.storage;\n\tif (!hasDefaultStorage()) return null;\n\treturn Storage;\n}\nfunction safeReadStorage(key) {\n\tconst storage = getStorage();\n\tif (!storage) return null;\n\ttry {\n\t\treturn storage.getItem(key);\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction safeWriteStorage(key, value) {\n\tconst storage = getStorage();\n\tif (!storage) return false;\n\ttry {\n\t\tstorage.setItem(key, value);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction safeRemoveStorage(key) {\n\tconst storage = getStorage();\n\tif (!storage) return;\n\ttry {\n\t\tstorage.removeItem(key);\n\t} catch {}\n}\nfunction normalizeWarmFlag(flag) {\n\tif (!flag) return null;\n\tif (flag === true) return { enabled: true };\n\treturn {\n\t\tenabled: flag.enabled ?? true,\n\t\t...flag\n\t};\n}\nfunction configureWarmState(options) {\n\tif (isSSRRuntime()) return;\n\tconfig = {\n\t\t...config,\n\t\t...options.enabled !== void 0 ? { enabled: options.enabled } : {},\n\t\t...options.schemaVersion !== void 0 ? { schemaVersion: options.schemaVersion } : {},\n\t\t...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},\n\t\t...options.restoreRoute !== void 0 ? { restoreRoute: options.restoreRoute } : {},\n\t\t...options.restoreWebRoute !== void 0 ? { restoreWebRoute: options.restoreWebRoute } : {},\n\t\t...options.preloadRoutes !== void 0 ? { preloadRoutes: options.preloadRoutes } : {},\n\t\t...options.includeRoutes !== void 0 ? { includeRoutes: options.includeRoutes } : {},\n\t\t...options.excludeRoutes !== void 0 ? { excludeRoutes: options.excludeRoutes } : {},\n\t\t...options.alignRoute !== void 0 ? { alignRoute: options.alignRoute } : {},\n\t\t...options.storage !== void 0 ? { storage: options.storage } : {},\n\t\t...options.now !== void 0 ? { now: options.now } : {}\n\t};\n}\nfunction configureWarmStateFromFlags(flags) {\n\tif (isSSRRuntime() || !flags?.warmStart) return;\n\tconst normalized = normalizeWarmFlag(flags.warmStart);\n\tif (normalized) configureWarmState(normalized);\n}\nfunction isWarmStateEnabled() {\n\treturn !isSSRRuntime() && config.enabled;\n}\nfunction shouldRestoreWarmRoute() {\n\tif (!isWarmStateEnabled()) return false;\n\tif (isNativeRuntime()) return config.restoreRoute;\n\treturn config.restoreWebRoute;\n}\nfunction hydrateSourceKey(key, source, envelope) {\n\tif (hydratedSourceKeys.has(key)) return;\n\tif (!(key in envelope.sources)) return;\n\tconst payload = envelope.sources[key];\n\tif (source.validate && !source.validate(payload)) return;\n\thydratedSourceKeys.add(key);\n\tsource.hydrate(payload);\n}\nfunction registerWarmStateSource(key, source) {\n\tregisteredSources.set(key, source);\n\tif (!isSSRRuntime() && config.enabled && hydratedEnvelope) hydrateSourceKey(key, source, hydratedEnvelope);\n\treturn () => {\n\t\tregisteredSources.delete(key);\n\t};\n}\nfunction ensureLoadedEnvelope() {\n\tif (!isWarmStateEnabled()) return null;\n\tif (loadedFromStorage) return hydratedEnvelope;\n\tloadedFromStorage = true;\n\tconst raw = safeReadStorage(WARM_STATE_STORAGE_KEY);\n\tif (!raw) return null;\n\tconst parsed = parseWarmEnvelope(raw, {\n\t\tschemaVersion: config.schemaVersion,\n\t\tmaxAgeMs: config.maxAgeMs,\n\t\tnow: config.now()\n\t});\n\tif (!parsed) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\thydratedEnvelope = null;\n\t\treturn null;\n\t}\n\thydratedEnvelope = parsed;\n\treturn hydratedEnvelope;\n}\nfunction getHydratedWarmState() {\n\tif (!isWarmStateEnabled()) return null;\n\treturn ensureLoadedEnvelope();\n}\nfunction getPathnameFromSnapshot(snapshot) {\n\tconst activeRoute = snapshot.routes[snapshot.index ?? 0] ?? snapshot.routes[0];\n\tif (!activeRoute) return void 0;\n\tif (typeof activeRoute.path === \"string\" && activeRoute.path) return activeRoute.path.startsWith(\"/\") ? activeRoute.path : `/${activeRoute.path}`;\n\tif (typeof activeRoute.name === \"string\" && activeRoute.name) return activeRoute.name === \"index\" ? \"/\" : `/${activeRoute.name}`;\n}\nlet cachedAlignedRoute = null;\nfunction getOrEvaluateAlignRoute(envelope) {\n\tif (!config.alignRoute || !envelope.state) return;\n\tif (cachedAlignedRoute && cachedAlignedRoute.evaluated) return cachedAlignedRoute.result;\n\tconst result = config.alignRoute({\n\t\tpathname: envelope.pathname ?? \"/\",\n\t\tstate: envelope.state\n\t});\n\tcachedAlignedRoute = {\n\t\tevaluated: true,\n\t\tresult\n\t};\n\treturn result;\n}\nlet activeWarmRoutePreload = null;\nlet warmRoutePreloadCompleted = false;\nfunction isWarmRoutePreloadPending() {\n\treturn activeWarmRoutePreload !== null && !warmRoutePreloadCompleted;\n}\nasync function waitForWarmRoutePreload(timeoutMs = 200) {\n\tif (!activeWarmRoutePreload || warmRoutePreloadCompleted) return;\n\ttry {\n\t\tif (timeoutMs <= 0) {\n\t\t\tawait activeWarmRoutePreload;\n\t\t\treturn;\n\t\t}\n\t\tawait Promise.race([activeWarmRoutePreload, new Promise((resolve) => setTimeout(resolve, timeoutMs))]);\n\t} catch {}\n}\nfunction hydrateWarmInitialLoad(options) {\n\tif (isSSRRuntime()) return null;\n\tif (options?.flags) configureWarmStateFromFlags(options.flags);\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (!config.enabled) return null;\n\tconst envelope = ensureLoadedEnvelope();\n\tif (!envelope) return null;\n\tfor (const [key, source] of registeredSources) hydrateSourceKey(key, source, envelope);\n\tif (config.preloadRoutes && envelope.pathname && options?.routes) {\n\t\tlet targetPathname = envelope.pathname;\n\t\tconst cleanPath = targetPathname.split(\"?\")[0].split(\"#\")[0] || \"/\";\n\t\tif (config.excludeRoutes?.some((p) => matchRoutePattern(p, cleanPath))) targetPathname = void 0;\n\t\telse if (config.includeRoutes && config.includeRoutes.length > 0 && !config.includeRoutes.some((p) => matchRoutePattern(p, cleanPath))) targetPathname = void 0;\n\t\telse if (config.alignRoute && envelope.state) {\n\t\t\tconst aligned = getOrEvaluateAlignRoute(envelope);\n\t\t\tif (aligned === false || aligned === null) targetPathname = void 0;\n\t\t\telse if (typeof aligned === \"string\") targetPathname = aligned;\n\t\t\telse if (typeof aligned === \"object\" && aligned !== null) targetPathname = getPathnameFromSnapshot(aligned);\n\t\t}\n\t\tif (targetPathname) {\n\t\t\tglobalThis[\"__importMetaGlobbed\"] = options.routes;\n\t\t\twarmRoutePreloadCompleted = false;\n\t\t\tactiveWarmRoutePreload = preloadRouteModules(targetPathname).catch(() => {}).finally(() => {\n\t\t\t\twarmRoutePreloadCompleted = true;\n\t\t\t});\n\t\t}\n\t}\n\treturn envelope;\n}\nfunction routesMatchLinkingConfig(routes, screens) {\n\tif (!screens || Object.keys(screens).length === 0) return true;\n\tfor (let i = 0; i < routes.length; i++) {\n\t\tconst route = routes[i];\n\t\tconst entry = screens[route.name];\n\t\tif (entry === void 0 || entry === null) return false;\n\t\tif (route.state) {\n\t\t\tif (typeof entry !== \"object\" || !entry.screens) return false;\n\t\t\tif (!routesMatchLinkingConfig(route.state.routes, entry.screens)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction getStateFromHref(href, linking) {\n\tconst parsed = (linking?.getStateFromPath ?? getStateFromPath)(href, linking?.config);\n\tif (!parsed?.routes?.length) return void 0;\n\treturn parsed;\n}\nfunction evaluateRouteRestore(state, routeNode, pathname) {\n\tconst nodes = findAllRouteNodesFromState(state, routeNode);\n\tif (nodes[0] !== routeNode) nodes.unshift(routeNode);\n\tlet params;\n\tfor (const node of nodes) {\n\t\tconst restore = node.loadRoute?.()?.restore;\n\t\tif (restore === void 0 || restore === true) continue;\n\t\tif (restore === false) return false;\n\t\tparams ??= extractParamsFromState(state);\n\t\tconst result = restore({\n\t\t\tpathname,\n\t\t\tparams\n\t\t});\n\t\tif (result === false || result === null) return false;\n\t\tif (typeof result === \"string\") return result;\n\t}\n\treturn true;\n}\nfunction consumeWarmInitialNavigationState(routeNode, linking) {\n\tif (isSSRRuntime()) return void 0;\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (warmInitialRouteConsumed) return restoredLaunch ? restoredState : void 0;\n\tif (!shouldRestoreWarmRoute()) return;\n\twarmInitialRouteConsumed = true;\n\tconst envelope = hydrateWarmInitialLoad();\n\tif (!envelope?.state || !routeNode) return void 0;\n\tconst savedPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\tif (config.excludeRoutes && config.excludeRoutes.length > 0) {\n\t\tif (config.excludeRoutes.some((pattern) => matchRoutePattern(pattern, savedPathname))) return;\n\t}\n\tif (config.includeRoutes && config.includeRoutes.length > 0) {\n\t\tif (!config.includeRoutes.some((pattern) => matchRoutePattern(pattern, savedPathname))) return;\n\t}\n\tlet targetState = envelope.state;\n\tif (config.alignRoute) {\n\t\tconst aligned = getOrEvaluateAlignRoute(envelope);\n\t\tif (aligned === false || aligned === null) return;\n\t\tif (typeof aligned === \"string\") {\n\t\t\tconst parsed = getStateFromHref(aligned, linking);\n\t\t\tif (!parsed) return void 0;\n\t\t\ttargetState = parsed;\n\t\t\tenvelope.pathname = aligned;\n\t\t} else if (typeof aligned === \"object\" && aligned !== null) {\n\t\t\tif (!aligned.routes || !Array.isArray(aligned.routes) || aligned.routes.length === 0) return;\n\t\t\ttargetState = aligned;\n\t\t\tconst derivedPath = getPathnameFromSnapshot(aligned);\n\t\t\tif (derivedPath) envelope.pathname = derivedPath;\n\t\t}\n\t}\n\tlet restore;\n\ttry {\n\t\trestore = evaluateRouteRestore(targetState, routeNode, envelope.pathname || \"/\");\n\t} catch (error) {\n\t\twarmInitialRouteConsumed = false;\n\t\tthrow error;\n\t}\n\tif (restore === false) return void 0;\n\tif (typeof restore === \"string\") {\n\t\tconst parsed = getStateFromHref(restore, linking);\n\t\tif (!parsed) return void 0;\n\t\ttargetState = parsed;\n\t\tenvelope.pathname = restore;\n\t}\n\tif (!routesMatchLinkingConfig(targetState.routes, linking?.config?.screens)) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\ttry {\n\t\tgetPathDataFromState(targetState, {\n\t\t\tscreens: [],\n\t\t\t...linking?.config\n\t\t});\n\t} catch {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\twarmRouteApplied = true;\n\trestoredLaunch = true;\n\trestoredPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\trestoredState = targetState;\n\treturn restoredState;\n}\nfunction shouldAttemptWarmRouteRestore(initialLocation) {\n\tif (!shouldRestoreWarmRoute()) return false;\n\treturn isNativeRuntime() || isWarmWebRestoreEligible(initialLocation);\n}\nfunction isWarmWebRestoreEligible(initialLocation) {\n\tif (!isWebClientRuntime() || !config.restoreWebRoute || !initialLocation) return false;\n\tconst serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n\tif (serverMode !== \"spa\" && serverMode !== \"spa-shell\") return false;\n\treturn initialLocation.pathname === \"/\" && !initialLocation.search && !initialLocation.hash;\n}\nfunction isWarmRouteApplied() {\n\treturn warmRouteApplied;\n}\nfunction isRestoredLaunch() {\n\treturn restoredLaunch;\n}\nfunction trackRestoredLaunch(pathname) {\n\tif (!restoredLaunch || pathname === restoredPathname) return;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n}\nfunction consumeWarmRouteApplied() {\n\tif (!warmRouteApplied) return false;\n\twarmRouteApplied = false;\n\treturn true;\n}\nfunction ensureSerializer() {\n\tif (serializer) return serializer;\n\tserializer = createWarmSerializer((state) => {\n\t\tif (state.phase !== \"ready\") return;\n\t\tif (!pendingInput) return;\n\t\tif (safeWriteStorage(WARM_STATE_STORAGE_KEY, state.result.value.json)) pendingInput = null;\n\t});\n\treturn serializer;\n}\nfunction collectSources() {\n\tconst sources = {};\n\tfor (const [key, source] of registeredSources) sources[key] = source.getSnapshot();\n\treturn sources;\n}\nfunction scheduleWarmStatePersist(navState, pathname) {\n\tif (!isWarmStateEnabled()) return;\n\tif (navState !== void 0) latestNavState = navState;\n\tif (pathname !== void 0) latestPathname = pathname;\n\tconst input = {\n\t\tschemaVersion: config.schemaVersion,\n\t\tupdatedAt: config.now(),\n\t\tpathname: latestPathname,\n\t\tstate: latestNavState,\n\t\tsources: collectSources()\n\t};\n\tpendingInput = input;\n\tensureSerializer().update(input);\n}\nfunction flushWarmState() {\n\tif (!isWarmStateEnabled() || !pendingInput) return false;\n\tconst input = pendingInput;\n\tpendingInput = null;\n\tconst { json } = serializeWarmInputSync(input);\n\treturn safeWriteStorage(WARM_STATE_STORAGE_KEY, json);\n}\nfunction clearWarmState(options) {\n\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\tloadedFromStorage = false;\n\thydratedEnvelope = null;\n\thydratedSourceKeys.clear();\n\twarmRouteApplied = false;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n\twarmInitialRouteConsumed = false;\n\tlatestNavState = void 0;\n\tlatestPathname = void 0;\n\tpendingInput = null;\n\tserializer?.dispose();\n\tserializer = null;\n\tactiveWarmRoutePreload = null;\n\twarmRoutePreloadCompleted = false;\n\tcachedAlignedRoute = null;\n\tdelete globalThis[\"__importMetaGlobbed\"];\n\tif (!options?.keepConfig) {\n\t\tconfig = { ...defaultConfig };\n\t\tregisteredSources.clear();\n\t}\n}\nfunction normalizeHref(href) {\n\tconst [withoutHash, ...hashParts] = (href.startsWith(\"/\") ? href : `/${href}`).split(\"#\");\n\tconst hash = hashParts.length > 0 ? `#${hashParts.join(\"#\")}` : \"\";\n\tconst [pathname, ...queryParts] = withoutHash.split(\"?\");\n\tconst query = queryParts.length > 0 ? `?${queryParts.join(\"?\")}` : \"\";\n\treturn `${pathname.length > 1 && pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname}${query}${hash}`;\n}\nasync function reconcileNativeColdDeepLink(options) {\n\tif (isSSRRuntime()) return null;\n\tlet initialUrl = null;\n\ttry {\n\t\tinitialUrl = await options.getInitialURL();\n\t} catch {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tif (!initialUrl) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tconst extracted = extractPathFromURL(options.prefixes ?? [], initialUrl);\n\tif (!extracted) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tconst normalizedTarget = normalizeHref(extracted);\n\tconst current = options.currentHref ?? options.currentPathname;\n\tconst normalizedCurrent = current ? normalizeHref(current) : void 0;\n\tif (normalizedCurrent && normalizedTarget === normalizedCurrent) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\ttrackRestoredLaunch(normalizedTarget);\n\toptions.navigateTo(normalizedTarget);\n\toptions.onComplete?.(normalizedTarget);\n\treturn normalizedTarget;\n}\n\nexport { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern2 as normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };"],"mappings":";;;;;;;;;;;AAWA,MAAM,gBAAgB;CACrB,SAAS;CACT,eAAe;CACf,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,eAAe,KAAK;CACpB,eAAe,KAAK;CACpB,YAAY,KAAK;CACjB,WAAW,KAAK,IAAI;AACrB;AACA,IAAI,SAAS,EAAE,GAAG,cAAc;AAChC,MAAM,oCAAoC,IAAI,IAAI;AAClD,MAAM,qCAAqC,IAAI,IAAI;AACnD,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,iBAAiB;AACrB,IAAI;AACJ,IAAI;AACJ,IAAI,2BAA2B;AAC/B,IAAI;AACJ,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,SAAS,kBAAkB;CAC1B,OAAO;AACR;AACA,SAAS,qBAAqB;CAC7B,OAAO,OAAO,WAAW;AAC1B;AACA,SAAS,eAAe;CACvB,OAAO,OAAO,WAAW;AAC1B;AACA,SAAS,oBAAoB;CAC5B,IAAI,aAAa,GAAG,OAAO;CAC3B,IAAI,gBAAgB,GAAG,OAAO;CAC9B,OAAO,OAAO,iBAAiB;AAChC;AACA,SAAS,aAAa;CACrB,IAAI,OAAO,SAAS,OAAO,OAAO;CAClC,IAAI,CAAC,kBAAkB,GAAG,OAAO;CACjC,OAAO;AACR;AACA,SAAS,gBAAgB,KAAK;CAC7B,MAAM,UAAU,WAAW;CAC3B,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI;EACH,OAAO,QAAQ,QAAQ,GAAG;CAC3B,QAAQ;EACP,OAAO;CACR;AACD;AACA,SAAS,iBAAiB,KAAK,OAAO;CACrC,MAAM,UAAU,WAAW;CAC3B,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI;EACH,QAAQ,Q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AAS,SAAS,KAAK,SAAS,SAAS,GAAG,IAAI,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,WAAW,QAAQ;AACtG;AACA,eAAe,4BAA4B,SAAS;CACnD,IAAI,aAAa,GAAG,OAAO;CAC3B,IAAI,aAAa;CACjB,IAAI;EACH,aAAa,MAAM,QAAQ,cAAc;CAC1C,QAAQ;EACP,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,IAAI,CAAC,YAAY;EAChB,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,MAAM,YAAY,mBAAmB,QAAQ,YAAY,CAAC,GAAG,UAAU;CACvE,IAAI,CAAC,WAAW;EACf,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,MAAM,mBAAmB,cAAc,SAAS;CAChD,MAAM,UAAU,QAAQ,eAAe,QAAQ;CAC/C,MAAM,oBAAoB,UAAU,cAAc,OAAO,IAAI,KAAK;CAClE,IAAI,qBAAqB,qBAAqB,mBAAmB;EAChE,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,oBAAoB,gBAAgB;CACpC,QAAQ,WAAW,gBAAgB;CACnC,QAAQ,aAAa,gBAAgB;CACrC,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"warmState.js","names":[],"sources":["esm/router/warmState.js"],"sourcesContent":["import { SERVER_CONTEXT_KEY } from \"../constants\";\nimport { extractPathFromURL } from \"../fork/extractPathFromURL\";\nimport { getPathDataFromState } from \"../fork/getPathFromState\";\nimport { getStateFromPath } from \"../fork/getStateFromPath\";\nimport { Storage } from \"../platform/storage\";\nimport { extractParamsFromState, findAllRouteNodesFromState } from \"./findRouteNode\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { createWarmSerializer } from \"./warmStateSerialize\";\nimport { DEFAULT_WARM_STATE_MAX_AGE_MS, WARM_STATE_STORAGE_KEY, matchRoutePattern, matchRoutePattern as matchRoutePattern2, normalizeRoutePattern as normalizeRoutePattern2, parseWarmEnvelope, serializeWarmInputSync } from \"./warmStateShared\";\n\n// dist/esm/router/warmState.js?tamagui-build-prune\nconst defaultConfig = {\n\tenabled: false,\n\tschemaVersion: 1,\n\tmaxAgeMs: DEFAULT_WARM_STATE_MAX_AGE_MS,\n\trestoreRoute: true,\n\trestoreWebRoute: false,\n\tpreloadRoutes: true,\n\tincludeRoutes: void 0,\n\texcludeRoutes: void 0,\n\talignRoute: void 0,\n\tnow: () => Date.now()\n};\nlet config = { ...defaultConfig };\nconst registeredSources = /* @__PURE__ */ new Map();\nconst hydratedSourceKeys = /* @__PURE__ */ new Set();\nlet loadedFromStorage = false;\nlet hydratedEnvelope = null;\nlet warmRouteApplied = false;\nlet restoredLaunch = false;\nlet restoredState;\nlet restoredPathname;\nlet warmInitialRouteConsumed = false;\nconst RESTORE_GUARD_KEY = `${WARM_STATE_STORAGE_KEY}restoring`;\nlet restoreGuardSet = false;\nlet latestNavState;\nlet latestPathname;\nlet pendingInput = null;\nlet serializer = null;\nfunction isNativeRuntime() {\n\treturn false;\n}\nfunction isWebClientRuntime() {\n\treturn typeof window !== \"undefined\";\n}\nfunction isSSRRuntime() {\n\treturn typeof window === \"undefined\";\n}\nfunction hasDefaultStorage() {\n\tif (isSSRRuntime()) return false;\n\tif (isNativeRuntime()) return true;\n\treturn typeof localStorage !== \"undefined\";\n}\nfunction getStorage() {\n\tif (config.storage) return config.storage;\n\tif (!hasDefaultStorage()) return null;\n\treturn Storage;\n}\nfunction safeReadStorage(key) {\n\tconst storage = getStorage();\n\tif (!storage) return null;\n\ttry {\n\t\treturn storage.getItem(key);\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction safeWriteStorage(key, value) {\n\tconst storage = getStorage();\n\tif (!storage) return false;\n\ttry {\n\t\tstorage.setItem(key, value);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction safeRemoveStorage(key) {\n\tconst storage = getStorage();\n\tif (!storage) return;\n\ttry {\n\t\tstorage.removeItem(key);\n\t} catch {}\n}\nfunction normalizeWarmFlag(flag) {\n\tif (!flag) return null;\n\tif (flag === true) return { enabled: true };\n\treturn {\n\t\tenabled: flag.enabled ?? true,\n\t\t...flag\n\t};\n}\nfunction configureWarmState(options) {\n\tif (isSSRRuntime()) return;\n\tconfig = {\n\t\t...config,\n\t\t...options.enabled !== void 0 ? { enabled: options.enabled } : {},\n\t\t...options.schemaVersion !== void 0 ? { schemaVersion: options.schemaVersion } : {},\n\t\t...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},\n\t\t...options.restoreRoute !== void 0 ? { restoreRoute: options.restoreRoute } : {},\n\t\t...options.restoreWebRoute !== void 0 ? { restoreWebRoute: options.restoreWebRoute } : {},\n\t\t...options.preloadRoutes !== void 0 ? { preloadRoutes: options.preloadRoutes } : {},\n\t\t...options.includeRoutes !== void 0 ? { includeRoutes: options.includeRoutes } : {},\n\t\t...options.excludeRoutes !== void 0 ? { excludeRoutes: options.excludeRoutes } : {},\n\t\t...options.alignRoute !== void 0 ? { alignRoute: options.alignRoute } : {},\n\t\t...options.storage !== void 0 ? { storage: options.storage } : {},\n\t\t...options.now !== void 0 ? { now: options.now } : {}\n\t};\n}\nfunction configureWarmStateFromFlags(flags) {\n\tif (isSSRRuntime() || !flags?.warmStart) return;\n\tconst normalized = normalizeWarmFlag(flags.warmStart);\n\tif (normalized) configureWarmState(normalized);\n}\nfunction isWarmStateEnabled() {\n\treturn !isSSRRuntime() && config.enabled;\n}\nfunction shouldRestoreWarmRoute() {\n\tif (!isWarmStateEnabled()) return false;\n\tif (isNativeRuntime()) return config.restoreRoute;\n\treturn config.restoreWebRoute;\n}\nfunction hydrateSourceKey(key, source, envelope) {\n\tif (hydratedSourceKeys.has(key)) return;\n\tif (!(key in envelope.sources)) return;\n\tconst payload = envelope.sources[key];\n\tif (source.validate && !source.validate(payload)) return;\n\thydratedSourceKeys.add(key);\n\tsource.hydrate(payload);\n}\nfunction registerWarmStateSource(key, source) {\n\tregisteredSources.set(key, source);\n\tif (!isSSRRuntime() && config.enabled && hydratedEnvelope) hydrateSourceKey(key, source, hydratedEnvelope);\n\treturn () => {\n\t\tregisteredSources.delete(key);\n\t};\n}\nfunction ensureLoadedEnvelope() {\n\tif (!isWarmStateEnabled()) return null;\n\tif (loadedFromStorage) return hydratedEnvelope;\n\tloadedFromStorage = true;\n\tconst raw = safeReadStorage(WARM_STATE_STORAGE_KEY);\n\tif (!raw) return null;\n\tif (isNativeRuntime() && safeReadStorage(RESTORE_GUARD_KEY)) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n\t\treturn null;\n\t}\n\tconst parsed = parseWarmEnvelope(raw, {\n\t\tschemaVersion: config.schemaVersion,\n\t\tmaxAgeMs: config.maxAgeMs,\n\t\tnow: config.now()\n\t});\n\tif (!parsed) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\thydratedEnvelope = null;\n\t\treturn null;\n\t}\n\thydratedEnvelope = parsed;\n\tif (isNativeRuntime()) restoreGuardSet = safeWriteStorage(RESTORE_GUARD_KEY, \"1\");\n\treturn hydratedEnvelope;\n}\nfunction settleWarmLaunch() {\n\tif (!restoreGuardSet) return;\n\trestoreGuardSet = false;\n\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n}\nfunction getHydratedWarmState() {\n\tif (!isWarmStateEnabled()) return null;\n\treturn ensureLoadedEnvelope();\n}\nfunction getPathnameFromSnapshot(snapshot) {\n\tconst activeRoute = snapshot.routes[snapshot.index ?? 0] ?? snapshot.routes[0];\n\tif (!activeRoute) return void 0;\n\tif (typeof activeRoute.path === \"string\" && activeRoute.path) return activeRoute.path.startsWith(\"/\") ? activeRoute.path : `/${activeRoute.path}`;\n\tif (typeof activeRoute.name === \"string\" && activeRoute.name) return activeRoute.name === \"index\" ? \"/\" : `/${activeRoute.name}`;\n}\nlet cachedAlignedRoute = null;\nfunction getOrEvaluateAlignRoute(envelope) {\n\tif (!config.alignRoute || !envelope.state) return;\n\tif (cachedAlignedRoute && cachedAlignedRoute.evaluated) return cachedAlignedRoute.result;\n\tconst result = config.alignRoute({\n\t\tpathname: envelope.pathname ?? \"/\",\n\t\tstate: envelope.state\n\t});\n\tcachedAlignedRoute = {\n\t\tevaluated: true,\n\t\tresult\n\t};\n\treturn result;\n}\nlet activeWarmRoutePreload = null;\nlet warmRoutePreloadCompleted = false;\nfunction isWarmRoutePreloadPending() {\n\treturn activeWarmRoutePreload !== null && !warmRoutePreloadCompleted;\n}\nasync function waitForWarmRoutePreload(timeoutMs = 200) {\n\tif (!activeWarmRoutePreload || warmRoutePreloadCompleted) return;\n\ttry {\n\t\tif (timeoutMs <= 0) {\n\t\t\tawait activeWarmRoutePreload;\n\t\t\treturn;\n\t\t}\n\t\tawait Promise.race([activeWarmRoutePreload, new Promise((resolve) => setTimeout(resolve, timeoutMs))]);\n\t} catch {}\n}\nfunction hydrateWarmInitialLoad(options) {\n\tif (isSSRRuntime()) return null;\n\tif (options?.flags) configureWarmStateFromFlags(options.flags);\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (!config.enabled) return null;\n\tconst envelope = ensureLoadedEnvelope();\n\tif (!envelope) return null;\n\tfor (const [key, source] of registeredSources) hydrateSourceKey(key, source, envelope);\n\tif (config.preloadRoutes && envelope.pathname && options?.routes) {\n\t\tlet targetPathname = envelope.pathname;\n\t\tconst cleanPath = targetPathname.split(\"?\")[0].split(\"#\")[0] || \"/\";\n\t\tif (config.excludeRoutes?.some((p) => matchRoutePattern(p, cleanPath))) targetPathname = void 0;\n\t\telse if (config.includeRoutes && config.includeRoutes.length > 0 && !config.includeRoutes.some((p) => matchRoutePattern(p, cleanPath))) targetPathname = void 0;\n\t\telse if (config.alignRoute && envelope.state) {\n\t\t\tconst aligned = getOrEvaluateAlignRoute(envelope);\n\t\t\tif (aligned === false || aligned === null) targetPathname = void 0;\n\t\t\telse if (typeof aligned === \"string\") targetPathname = aligned;\n\t\t\telse if (typeof aligned === \"object\" && aligned !== null) targetPathname = getPathnameFromSnapshot(aligned);\n\t\t}\n\t\tif (targetPathname) {\n\t\t\tglobalThis[\"__importMetaGlobbed\"] = options.routes;\n\t\t\twarmRoutePreloadCompleted = false;\n\t\t\tactiveWarmRoutePreload = preloadRouteModules(targetPathname).catch(() => {}).finally(() => {\n\t\t\t\twarmRoutePreloadCompleted = true;\n\t\t\t});\n\t\t}\n\t}\n\treturn envelope;\n}\nfunction routesMatchLinkingConfig(routes, screens) {\n\tif (!screens || Object.keys(screens).length === 0) return true;\n\tfor (let i = 0; i < routes.length; i++) {\n\t\tconst route = routes[i];\n\t\tconst entry = screens[route.name];\n\t\tif (entry === void 0 || entry === null) return false;\n\t\tif (route.state) {\n\t\t\tif (typeof entry !== \"object\" || !entry.screens) return false;\n\t\t\tif (!routesMatchLinkingConfig(route.state.routes, entry.screens)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction getStateFromHref(href, linking) {\n\tconst parsed = (linking?.getStateFromPath ?? getStateFromPath)(href, linking?.config);\n\tif (!parsed?.routes?.length) return void 0;\n\treturn parsed;\n}\nfunction evaluateRouteRestore(state, routeNode, pathname) {\n\tconst nodes = findAllRouteNodesFromState(state, routeNode);\n\tif (nodes[0] !== routeNode) nodes.unshift(routeNode);\n\tlet params;\n\tfor (const node of nodes) {\n\t\tconst restore = node.loadRoute?.()?.restore;\n\t\tif (restore === void 0 || restore === true) continue;\n\t\tif (restore === false) return false;\n\t\tparams ??= extractParamsFromState(state);\n\t\tconst result = restore({\n\t\t\tpathname,\n\t\t\tparams\n\t\t});\n\t\tif (result === false || result === null) return false;\n\t\tif (typeof result === \"string\") return result;\n\t}\n\treturn true;\n}\nfunction consumeWarmInitialNavigationState(routeNode, linking) {\n\tif (isSSRRuntime()) return void 0;\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (warmInitialRouteConsumed) return restoredLaunch ? restoredState : void 0;\n\tif (!shouldRestoreWarmRoute()) return;\n\twarmInitialRouteConsumed = true;\n\tconst envelope = hydrateWarmInitialLoad();\n\tif (!envelope?.state || !routeNode) return void 0;\n\tconst savedPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\tif (config.excludeRoutes && config.excludeRoutes.length > 0) {\n\t\tif (config.excludeRoutes.some((pattern) => matchRoutePattern(pattern, savedPathname))) return;\n\t}\n\tif (config.includeRoutes && config.includeRoutes.length > 0) {\n\t\tif (!config.includeRoutes.some((pattern) => matchRoutePattern(pattern, savedPathname))) return;\n\t}\n\tlet targetState = envelope.state;\n\tif (config.alignRoute) {\n\t\tconst aligned = getOrEvaluateAlignRoute(envelope);\n\t\tif (aligned === false || aligned === null) return;\n\t\tif (typeof aligned === \"string\") {\n\t\t\tconst parsed = getStateFromHref(aligned, linking);\n\t\t\tif (!parsed) return void 0;\n\t\t\ttargetState = parsed;\n\t\t\tenvelope.pathname = aligned;\n\t\t} else if (typeof aligned === \"object\" && aligned !== null) {\n\t\t\tif (!aligned.routes || !Array.isArray(aligned.routes) || aligned.routes.length === 0) return;\n\t\t\ttargetState = aligned;\n\t\t\tconst derivedPath = getPathnameFromSnapshot(aligned);\n\t\t\tif (derivedPath) envelope.pathname = derivedPath;\n\t\t}\n\t}\n\tlet restore;\n\ttry {\n\t\trestore = evaluateRouteRestore(targetState, routeNode, envelope.pathname || \"/\");\n\t} catch (error) {\n\t\twarmInitialRouteConsumed = false;\n\t\tthrow error;\n\t}\n\tif (restore === false) return void 0;\n\tif (typeof restore === \"string\") {\n\t\tconst parsed = getStateFromHref(restore, linking);\n\t\tif (!parsed) return void 0;\n\t\ttargetState = parsed;\n\t\tenvelope.pathname = restore;\n\t}\n\tif (!routesMatchLinkingConfig(targetState.routes, linking?.config?.screens)) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\ttry {\n\t\tgetPathDataFromState(targetState, {\n\t\t\tscreens: [],\n\t\t\t...linking?.config\n\t\t});\n\t} catch {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\twarmRouteApplied = true;\n\trestoredLaunch = true;\n\trestoredPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\trestoredState = targetState;\n\treturn restoredState;\n}\nfunction shouldAttemptWarmRouteRestore(initialLocation) {\n\tif (!shouldRestoreWarmRoute()) return false;\n\treturn isNativeRuntime() || isWarmWebRestoreEligible(initialLocation);\n}\nfunction isWarmWebRestoreEligible(initialLocation) {\n\tif (!isWebClientRuntime() || !config.restoreWebRoute || !initialLocation) return false;\n\tconst serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n\tif (serverMode !== \"spa\" && serverMode !== \"spa-shell\") return false;\n\treturn initialLocation.pathname === \"/\" && !initialLocation.search && !initialLocation.hash;\n}\nfunction isWarmRouteApplied() {\n\treturn warmRouteApplied;\n}\nfunction isRestoredLaunch() {\n\treturn restoredLaunch;\n}\nfunction trackRestoredLaunch(pathname) {\n\tif (!restoredLaunch || pathname === restoredPathname) return;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n}\nfunction consumeWarmRouteApplied() {\n\tif (!warmRouteApplied) return false;\n\twarmRouteApplied = false;\n\treturn true;\n}\nfunction ensureSerializer() {\n\tif (serializer) return serializer;\n\tserializer = createWarmSerializer((state) => {\n\t\tif (state.phase !== \"ready\") return;\n\t\tif (!pendingInput) return;\n\t\tif (safeWriteStorage(WARM_STATE_STORAGE_KEY, state.result.value.json)) pendingInput = null;\n\t});\n\treturn serializer;\n}\nfunction collectSources() {\n\tconst sources = {};\n\tfor (const [key, source] of registeredSources) sources[key] = source.getSnapshot();\n\treturn sources;\n}\nfunction scheduleWarmStatePersist(navState, pathname) {\n\tif (!isWarmStateEnabled()) return;\n\tif (navState !== void 0) latestNavState = navState;\n\tif (pathname !== void 0) latestPathname = pathname;\n\tconst input = {\n\t\tschemaVersion: config.schemaVersion,\n\t\tupdatedAt: config.now(),\n\t\tpathname: latestPathname,\n\t\tstate: latestNavState,\n\t\tsources: collectSources()\n\t};\n\tpendingInput = input;\n\tensureSerializer().update(input);\n}\nfunction flushWarmState() {\n\tif (!isWarmStateEnabled() || !pendingInput) return false;\n\tconst input = pendingInput;\n\tpendingInput = null;\n\tconst { json } = serializeWarmInputSync(input);\n\treturn safeWriteStorage(WARM_STATE_STORAGE_KEY, json);\n}\nfunction clearWarmState(options) {\n\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n\trestoreGuardSet = false;\n\tloadedFromStorage = false;\n\thydratedEnvelope = null;\n\thydratedSourceKeys.clear();\n\twarmRouteApplied = false;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n\twarmInitialRouteConsumed = false;\n\tlatestNavState = void 0;\n\tlatestPathname = void 0;\n\tpendingInput = null;\n\tserializer?.dispose();\n\tserializer = null;\n\tactiveWarmRoutePreload = null;\n\twarmRoutePreloadCompleted = false;\n\tcachedAlignedRoute = null;\n\tdelete globalThis[\"__importMetaGlobbed\"];\n\tif (!options?.keepConfig) {\n\t\tconfig = { ...defaultConfig };\n\t\tregisteredSources.clear();\n\t}\n}\nfunction normalizeHref(href) {\n\tconst [withoutHash, ...hashParts] = (href.startsWith(\"/\") ? href : `/${href}`).split(\"#\");\n\tconst hash = hashParts.length > 0 ? `#${hashParts.join(\"#\")}` : \"\";\n\tconst [pathname, ...queryParts] = withoutHash.split(\"?\");\n\tconst query = queryParts.length > 0 ? `?${queryParts.join(\"?\")}` : \"\";\n\treturn `${pathname.length > 1 && pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname}${query}${hash}`;\n}\nasync function reconcileNativeColdDeepLink(options) {\n\tif (isSSRRuntime()) return null;\n\tlet initialUrl = null;\n\ttry {\n\t\tinitialUrl = await options.getInitialURL();\n\t} catch {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tif (!initialUrl) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tconst extracted = extractPathFromURL(options.prefixes ?? [], initialUrl);\n\tif (!extracted) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\tconst normalizedTarget = normalizeHref(extracted);\n\tconst current = options.currentHref ?? options.currentPathname;\n\tconst normalizedCurrent = current ? normalizeHref(current) : void 0;\n\tif (normalizedCurrent && normalizedTarget === normalizedCurrent) {\n\t\toptions.onComplete?.(null);\n\t\treturn null;\n\t}\n\ttrackRestoredLaunch(normalizedTarget);\n\toptions.navigateTo(normalizedTarget);\n\toptions.onComplete?.(normalizedTarget);\n\treturn normalizedTarget;\n}\n\nexport { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern2 as normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, settleWarmLaunch, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };"],"mappings":";;;;;;;;;;;AAWA,MAAM,gBAAgB;CACrB,SAAS;CACT,eAAe;CACf,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,eAAe,KAAK;CACpB,eAAe,KAAK;CACpB,YAAY,KAAK;CACjB,WAAW,KAAK,IAAI;AACrB;AACA,IAAI,SAAS,EAAE,GAAG,cAAc;AAChC,MAAM,oCAAoC,IAAI,IAAI;AAClD,MAAM,qCAAqC,IAAI,IAAI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AAG,CAAC,CAAC,IAAI,WAAW,QAAQ;AACtG;AACA,eAAe,4BAA4B,SAAS;CACnD,IAAI,aAAa,GAAG,OAAO;CAC3B,IAAI,aAAa;CACjB,IAAI;EACH,aAAa,MAAM,QAAQ,cAAc;CAC1C,QAAQ;EACP,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,IAAI,CAAC,YAAY;EAChB,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,MAAM,YAAY,mBAAmB,QAAQ,YAAY,CAAC,GAAG,UAAU;CACvE,IAAI,CAAC,WAAW;EACf,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,MAAM,mBAAmB,cAAc,SAAS;CAChD,MAAM,UAAU,QAAQ,eAAe,QAAQ;CAC/C,MAAM,oBAAoB,UAAU,cAAc,OAAO,IAAI,KAAK;CAClE,IAAI,qBAAqB,qBAAqB,mBAAmB;EAChE,QAAQ,aAAa,IAAI;EACzB,OAAO;CACR;CACA,oBAAoB,gBAAgB;CACpC,QAAQ,WAAW,gBAAgB;CACnC,QAAQ,aAAa,gBAAgB;CACrC,OAAO;AACR"}
|
|
@@ -33,6 +33,8 @@ var restoredLaunch = false;
|
|
|
33
33
|
var restoredState;
|
|
34
34
|
var restoredPathname;
|
|
35
35
|
var warmInitialRouteConsumed = false;
|
|
36
|
+
var RESTORE_GUARD_KEY = `${WARM_STATE_STORAGE_KEY}restoring`;
|
|
37
|
+
var restoreGuardSet = false;
|
|
36
38
|
var latestNavState;
|
|
37
39
|
var latestPathname;
|
|
38
40
|
var pendingInput = null;
|
|
@@ -142,6 +144,11 @@ function ensureLoadedEnvelope() {
|
|
|
142
144
|
loadedFromStorage = true;
|
|
143
145
|
var raw = safeReadStorage(WARM_STATE_STORAGE_KEY);
|
|
144
146
|
if (!raw) return null;
|
|
147
|
+
if (isNativeRuntime() && safeReadStorage(RESTORE_GUARD_KEY)) {
|
|
148
|
+
safeRemoveStorage(WARM_STATE_STORAGE_KEY);
|
|
149
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
145
152
|
var parsed = parseWarmEnvelope(raw, {
|
|
146
153
|
schemaVersion: config.schemaVersion,
|
|
147
154
|
maxAgeMs: config.maxAgeMs,
|
|
@@ -153,8 +160,14 @@ function ensureLoadedEnvelope() {
|
|
|
153
160
|
return null;
|
|
154
161
|
}
|
|
155
162
|
hydratedEnvelope = parsed;
|
|
163
|
+
if (isNativeRuntime()) restoreGuardSet = safeWriteStorage(RESTORE_GUARD_KEY, "1");
|
|
156
164
|
return hydratedEnvelope;
|
|
157
165
|
}
|
|
166
|
+
function settleWarmLaunch() {
|
|
167
|
+
if (!restoreGuardSet) return;
|
|
168
|
+
restoreGuardSet = false;
|
|
169
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
170
|
+
}
|
|
158
171
|
function getHydratedWarmState() {
|
|
159
172
|
if (!isWarmStateEnabled()) return null;
|
|
160
173
|
return ensureLoadedEnvelope();
|
|
@@ -454,6 +467,8 @@ function flushWarmState() {
|
|
|
454
467
|
}
|
|
455
468
|
function clearWarmState(options) {
|
|
456
469
|
safeRemoveStorage(WARM_STATE_STORAGE_KEY);
|
|
470
|
+
safeRemoveStorage(RESTORE_GUARD_KEY);
|
|
471
|
+
restoreGuardSet = false;
|
|
457
472
|
loadedFromStorage = false;
|
|
458
473
|
hydratedEnvelope = null;
|
|
459
474
|
hydratedSourceKeys.clear();
|
|
@@ -519,5 +534,5 @@ async function reconcileNativeColdDeepLink(options) {
|
|
|
519
534
|
return normalizedTarget;
|
|
520
535
|
}
|
|
521
536
|
|
|
522
|
-
export { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };
|
|
537
|
+
export { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, settleWarmLaunch, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };
|
|
523
538
|
//# sourceMappingURL=warmState.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warmState.native.js","names":[],"sources":["esm/router/warmState.native.js"],"sourcesContent":["import { SERVER_CONTEXT_KEY } from \"../constants\";\nimport { extractPathFromURL } from \"../fork/extractPathFromURL\";\nimport { getPathDataFromState } from \"../fork/getPathFromState\";\nimport { getStateFromPath } from \"../fork/getStateFromPath\";\nimport { Storage } from \"../platform/storage\";\nimport { extractParamsFromState, findAllRouteNodesFromState } from \"./findRouteNode\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { createWarmSerializer } from \"./warmStateSerialize\";\nimport { DEFAULT_WARM_STATE_MAX_AGE_MS, WARM_STATE_STORAGE_KEY, matchRoutePattern, matchRoutePattern as matchRoutePattern2, normalizeRoutePattern, parseWarmEnvelope, serializeWarmInputSync } from \"./warmStateShared\";\n\n// dist/esm/router/warmState.native.js?tamagui-build-prune\nvar defaultConfig = {\n\tenabled: false,\n\tschemaVersion: 1,\n\tmaxAgeMs: DEFAULT_WARM_STATE_MAX_AGE_MS,\n\trestoreRoute: true,\n\trestoreWebRoute: false,\n\tpreloadRoutes: true,\n\tincludeRoutes: void 0,\n\texcludeRoutes: void 0,\n\talignRoute: void 0,\n\tnow: function now() {\n\t\treturn Date.now();\n\t}\n};\nvar config = { ...defaultConfig };\nvar registeredSources = /* @__PURE__ */ new Map();\nvar hydratedSourceKeys = /* @__PURE__ */ new Set();\nvar loadedFromStorage = false;\nvar hydratedEnvelope = null;\nvar warmRouteApplied = false;\nvar restoredLaunch = false;\nvar restoredState;\nvar restoredPathname;\nvar warmInitialRouteConsumed = false;\nvar latestNavState;\nvar latestPathname;\nvar pendingInput = null;\nvar serializer = null;\nfunction isNativeRuntime() {\n\treturn true;\n}\nfunction isWebClientRuntime() {\n\treturn false;\n}\nfunction isSSRRuntime() {\n\treturn false;\n}\nfunction hasDefaultStorage() {\n\tif (isSSRRuntime()) return false;\n\tif (isNativeRuntime()) return true;\n\treturn typeof localStorage !== \"undefined\";\n}\nfunction getStorage() {\n\tif (config.storage) return config.storage;\n\tif (!hasDefaultStorage()) return null;\n\treturn Storage;\n}\nfunction safeReadStorage(key) {\n\tvar storage = getStorage();\n\tif (!storage) return null;\n\ttry {\n\t\treturn storage.getItem(key);\n\t} catch (unused) {\n\t\treturn null;\n\t}\n}\nfunction safeWriteStorage(key, value) {\n\tvar storage = getStorage();\n\tif (!storage) return false;\n\ttry {\n\t\tstorage.setItem(key, value);\n\t\treturn true;\n\t} catch (unused) {\n\t\treturn false;\n\t}\n}\nfunction safeRemoveStorage(key) {\n\tvar storage = getStorage();\n\tif (!storage) return;\n\ttry {\n\t\tstorage.removeItem(key);\n\t} catch (unused) {}\n}\nfunction normalizeWarmFlag(flag) {\n\tvar _flag_enabled;\n\tif (!flag) return null;\n\tif (flag === true) return { enabled: true };\n\treturn {\n\t\tenabled: (_flag_enabled = flag.enabled) !== null && _flag_enabled !== void 0 ? _flag_enabled : true,\n\t\t...flag\n\t};\n}\nfunction configureWarmState(options) {\n\tif (isSSRRuntime()) return;\n\tconfig = {\n\t\t...config,\n\t\t...options.enabled !== void 0 ? { enabled: options.enabled } : {},\n\t\t...options.schemaVersion !== void 0 ? { schemaVersion: options.schemaVersion } : {},\n\t\t...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},\n\t\t...options.restoreRoute !== void 0 ? { restoreRoute: options.restoreRoute } : {},\n\t\t...options.restoreWebRoute !== void 0 ? { restoreWebRoute: options.restoreWebRoute } : {},\n\t\t...options.preloadRoutes !== void 0 ? { preloadRoutes: options.preloadRoutes } : {},\n\t\t...options.includeRoutes !== void 0 ? { includeRoutes: options.includeRoutes } : {},\n\t\t...options.excludeRoutes !== void 0 ? { excludeRoutes: options.excludeRoutes } : {},\n\t\t...options.alignRoute !== void 0 ? { alignRoute: options.alignRoute } : {},\n\t\t...options.storage !== void 0 ? { storage: options.storage } : {},\n\t\t...options.now !== void 0 ? { now: options.now } : {}\n\t};\n}\nfunction configureWarmStateFromFlags(flags) {\n\tif (isSSRRuntime() || !(flags === null || flags === void 0 ? void 0 : flags.warmStart)) return;\n\tvar normalized = normalizeWarmFlag(flags.warmStart);\n\tif (normalized) configureWarmState(normalized);\n}\nfunction isWarmStateEnabled() {\n\treturn !isSSRRuntime() && config.enabled;\n}\nfunction shouldRestoreWarmRoute() {\n\tif (!isWarmStateEnabled()) return false;\n\tif (isNativeRuntime()) return config.restoreRoute;\n\treturn config.restoreWebRoute;\n}\nfunction hydrateSourceKey(key, source, envelope) {\n\tif (hydratedSourceKeys.has(key)) return;\n\tif (!(key in envelope.sources)) return;\n\tvar payload = envelope.sources[key];\n\tif (source.validate && !source.validate(payload)) return;\n\thydratedSourceKeys.add(key);\n\tsource.hydrate(payload);\n}\nfunction registerWarmStateSource(key, source) {\n\tregisteredSources.set(key, source);\n\tif (!isSSRRuntime() && config.enabled && hydratedEnvelope) hydrateSourceKey(key, source, hydratedEnvelope);\n\treturn function() {\n\t\tregisteredSources.delete(key);\n\t};\n}\nfunction ensureLoadedEnvelope() {\n\tif (!isWarmStateEnabled()) return null;\n\tif (loadedFromStorage) return hydratedEnvelope;\n\tloadedFromStorage = true;\n\tvar raw = safeReadStorage(WARM_STATE_STORAGE_KEY);\n\tif (!raw) return null;\n\tvar parsed = parseWarmEnvelope(raw, {\n\t\tschemaVersion: config.schemaVersion,\n\t\tmaxAgeMs: config.maxAgeMs,\n\t\tnow: config.now()\n\t});\n\tif (!parsed) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\thydratedEnvelope = null;\n\t\treturn null;\n\t}\n\thydratedEnvelope = parsed;\n\treturn hydratedEnvelope;\n}\nfunction getHydratedWarmState() {\n\tif (!isWarmStateEnabled()) return null;\n\treturn ensureLoadedEnvelope();\n}\nfunction getPathnameFromSnapshot(snapshot) {\n\tvar _snapshot_routes_, _snapshot_index;\n\tvar activeRoute = (_snapshot_routes_ = snapshot.routes[(_snapshot_index = snapshot.index) !== null && _snapshot_index !== void 0 ? _snapshot_index : 0]) !== null && _snapshot_routes_ !== void 0 ? _snapshot_routes_ : snapshot.routes[0];\n\tif (!activeRoute) return void 0;\n\tif (typeof activeRoute.path === \"string\" && activeRoute.path) return activeRoute.path.startsWith(\"/\") ? activeRoute.path : `/${activeRoute.path}`;\n\tif (typeof activeRoute.name === \"string\" && activeRoute.name) return activeRoute.name === \"index\" ? \"/\" : `/${activeRoute.name}`;\n}\nvar cachedAlignedRoute = null;\nfunction getOrEvaluateAlignRoute(envelope) {\n\tvar _envelope_pathname;\n\tif (!config.alignRoute || !envelope.state) return;\n\tif (cachedAlignedRoute && cachedAlignedRoute.evaluated) return cachedAlignedRoute.result;\n\tvar result = config.alignRoute({\n\t\tpathname: (_envelope_pathname = envelope.pathname) !== null && _envelope_pathname !== void 0 ? _envelope_pathname : \"/\",\n\t\tstate: envelope.state\n\t});\n\tcachedAlignedRoute = {\n\t\tevaluated: true,\n\t\tresult\n\t};\n\treturn result;\n}\nvar activeWarmRoutePreload = null;\nvar warmRoutePreloadCompleted = false;\nfunction isWarmRoutePreloadPending() {\n\treturn activeWarmRoutePreload !== null && !warmRoutePreloadCompleted;\n}\nasync function waitForWarmRoutePreload() {\n\tvar timeoutMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 200;\n\tif (!activeWarmRoutePreload || warmRoutePreloadCompleted) return;\n\ttry {\n\t\tif (timeoutMs <= 0) {\n\t\t\tawait activeWarmRoutePreload;\n\t\t\treturn;\n\t\t}\n\t\tawait Promise.race([activeWarmRoutePreload, new Promise(function(resolve) {\n\t\t\treturn setTimeout(resolve, timeoutMs);\n\t\t})]);\n\t} catch (unused) {}\n}\nfunction hydrateWarmInitialLoad(options) {\n\tif (isSSRRuntime()) return null;\n\tif (options === null || options === void 0 ? void 0 : options.flags) configureWarmStateFromFlags(options.flags);\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (!config.enabled) return null;\n\tvar envelope = ensureLoadedEnvelope();\n\tif (!envelope) return null;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = registeredSources[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [key, source] = _step.value;\n\t\t\thydrateSourceKey(key, source, envelope);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\tif (config.preloadRoutes && envelope.pathname && (options === null || options === void 0 ? void 0 : options.routes)) {\n\t\tvar _config_excludeRoutes;\n\t\tvar targetPathname = envelope.pathname;\n\t\tvar cleanPath = targetPathname.split(\"?\")[0].split(\"#\")[0] || \"/\";\n\t\tif ((_config_excludeRoutes = config.excludeRoutes) === null || _config_excludeRoutes === void 0 ? void 0 : _config_excludeRoutes.some(function(p) {\n\t\t\treturn matchRoutePattern(p, cleanPath);\n\t\t})) targetPathname = void 0;\n\t\telse if (config.includeRoutes && config.includeRoutes.length > 0 && !config.includeRoutes.some(function(p) {\n\t\t\treturn matchRoutePattern(p, cleanPath);\n\t\t})) targetPathname = void 0;\n\t\telse if (config.alignRoute && envelope.state) {\n\t\t\tvar aligned = getOrEvaluateAlignRoute(envelope);\n\t\t\tif (aligned === false || aligned === null) targetPathname = void 0;\n\t\t\telse if (typeof aligned === \"string\") targetPathname = aligned;\n\t\t\telse if (typeof aligned === \"object\" && aligned !== null) targetPathname = getPathnameFromSnapshot(aligned);\n\t\t}\n\t\tif (targetPathname) {\n\t\t\tglobalThis[\"__importMetaGlobbed\"] = options.routes;\n\t\t\twarmRoutePreloadCompleted = false;\n\t\t\tactiveWarmRoutePreload = preloadRouteModules(targetPathname).catch(function() {}).finally(function() {\n\t\t\t\twarmRoutePreloadCompleted = true;\n\t\t\t});\n\t\t}\n\t}\n\treturn envelope;\n}\nfunction routesMatchLinkingConfig(routes, screens) {\n\tif (!screens || Object.keys(screens).length === 0) return true;\n\tfor (var i = 0; i < routes.length; i++) {\n\t\tvar route = routes[i];\n\t\tvar entry = screens[route.name];\n\t\tif (entry === void 0 || entry === null) return false;\n\t\tif (route.state) {\n\t\t\tif (typeof entry !== \"object\" || !entry.screens) return false;\n\t\t\tif (!routesMatchLinkingConfig(route.state.routes, entry.screens)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction getStateFromHref(href, linking) {\n\tvar _ref;\n\tvar _parsed_routes;\n\tvar parsed = ((_ref = linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) !== null && _ref !== void 0 ? _ref : getStateFromPath)(href, linking === null || linking === void 0 ? void 0 : linking.config);\n\tif (!(parsed === null || parsed === void 0 ? void 0 : (_parsed_routes = parsed.routes) === null || _parsed_routes === void 0 ? void 0 : _parsed_routes.length)) return void 0;\n\treturn parsed;\n}\nfunction evaluateRouteRestore(state, routeNode, pathname) {\n\tvar nodes = findAllRouteNodesFromState(state, routeNode);\n\tif (nodes[0] !== routeNode) nodes.unshift(routeNode);\n\tvar params;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar node = _step.value;\n\t\t\tvar _node_loadRoute, _node_loadRoute1;\n\t\t\tvar restore = (_node_loadRoute1 = node.loadRoute) === null || _node_loadRoute1 === void 0 ? void 0 : (_node_loadRoute = _node_loadRoute1.call(node)) === null || _node_loadRoute === void 0 ? void 0 : _node_loadRoute.restore;\n\t\t\tif (restore === void 0 || restore === true) continue;\n\t\t\tif (restore === false) return false;\n\t\t\tparams !== null && params !== void 0 || (params = extractParamsFromState(state));\n\t\t\tvar result = restore({\n\t\t\t\tpathname,\n\t\t\t\tparams\n\t\t\t});\n\t\t\tif (result === false || result === null) return false;\n\t\t\tif (typeof result === \"string\") return result;\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn true;\n}\nfunction consumeWarmInitialNavigationState(routeNode, linking) {\n\tvar _linking_config;\n\tif (isSSRRuntime()) return void 0;\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (warmInitialRouteConsumed) return restoredLaunch ? restoredState : void 0;\n\tif (!shouldRestoreWarmRoute()) return;\n\twarmInitialRouteConsumed = true;\n\tvar envelope = hydrateWarmInitialLoad();\n\tif (!(envelope === null || envelope === void 0 ? void 0 : envelope.state) || !routeNode) return void 0;\n\tvar savedPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\tif (config.excludeRoutes && config.excludeRoutes.length > 0) {\n\t\tif (config.excludeRoutes.some(function(pattern) {\n\t\t\treturn matchRoutePattern(pattern, savedPathname);\n\t\t})) return;\n\t}\n\tif (config.includeRoutes && config.includeRoutes.length > 0) {\n\t\tif (!config.includeRoutes.some(function(pattern) {\n\t\t\treturn matchRoutePattern(pattern, savedPathname);\n\t\t})) return;\n\t}\n\tvar targetState = envelope.state;\n\tif (config.alignRoute) {\n\t\tvar aligned = getOrEvaluateAlignRoute(envelope);\n\t\tif (aligned === false || aligned === null) return;\n\t\tif (typeof aligned === \"string\") {\n\t\t\tvar parsed = getStateFromHref(aligned, linking);\n\t\t\tif (!parsed) return void 0;\n\t\t\ttargetState = parsed;\n\t\t\tenvelope.pathname = aligned;\n\t\t} else if (typeof aligned === \"object\" && aligned !== null) {\n\t\t\tif (!aligned.routes || !Array.isArray(aligned.routes) || aligned.routes.length === 0) return;\n\t\t\ttargetState = aligned;\n\t\t\tvar derivedPath = getPathnameFromSnapshot(aligned);\n\t\t\tif (derivedPath) envelope.pathname = derivedPath;\n\t\t}\n\t}\n\tvar restore;\n\ttry {\n\t\trestore = evaluateRouteRestore(targetState, routeNode, envelope.pathname || \"/\");\n\t} catch (error) {\n\t\twarmInitialRouteConsumed = false;\n\t\tthrow error;\n\t}\n\tif (restore === false) return void 0;\n\tif (typeof restore === \"string\") {\n\t\tvar parsed1 = getStateFromHref(restore, linking);\n\t\tif (!parsed1) return void 0;\n\t\ttargetState = parsed1;\n\t\tenvelope.pathname = restore;\n\t}\n\tif (!routesMatchLinkingConfig(targetState.routes, linking === null || linking === void 0 ? void 0 : (_linking_config = linking.config) === null || _linking_config === void 0 ? void 0 : _linking_config.screens)) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\ttry {\n\t\tgetPathDataFromState(targetState, {\n\t\t\tscreens: [],\n\t\t\t...linking === null || linking === void 0 ? void 0 : linking.config\n\t\t});\n\t} catch (unused) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\twarmRouteApplied = true;\n\trestoredLaunch = true;\n\trestoredPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\trestoredState = targetState;\n\treturn restoredState;\n}\nfunction shouldAttemptWarmRouteRestore(initialLocation) {\n\tif (!shouldRestoreWarmRoute()) return false;\n\treturn isNativeRuntime() || isWarmWebRestoreEligible(initialLocation);\n}\nfunction isWarmWebRestoreEligible(initialLocation) {\n\tvar _globalThis_SERVER_CONTEXT_KEY;\n\tif (!isWebClientRuntime() || !config.restoreWebRoute || !initialLocation) return false;\n\tvar serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n\tif (serverMode !== \"spa\" && serverMode !== \"spa-shell\") return false;\n\treturn initialLocation.pathname === \"/\" && !initialLocation.search && !initialLocation.hash;\n}\nfunction isWarmRouteApplied() {\n\treturn warmRouteApplied;\n}\nfunction isRestoredLaunch() {\n\treturn restoredLaunch;\n}\nfunction trackRestoredLaunch(pathname) {\n\tif (!restoredLaunch || pathname === restoredPathname) return;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n}\nfunction consumeWarmRouteApplied() {\n\tif (!warmRouteApplied) return false;\n\twarmRouteApplied = false;\n\treturn true;\n}\nfunction ensureSerializer() {\n\tif (serializer) return serializer;\n\tserializer = createWarmSerializer(function(state) {\n\t\tif (state.phase !== \"ready\") return;\n\t\tif (!pendingInput) return;\n\t\tif (safeWriteStorage(WARM_STATE_STORAGE_KEY, state.result.value.json)) pendingInput = null;\n\t});\n\treturn serializer;\n}\nfunction collectSources() {\n\tvar sources = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = registeredSources[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [key, source] = _step.value;\n\t\t\tsources[key] = source.getSnapshot();\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn sources;\n}\nfunction scheduleWarmStatePersist(navState, pathname) {\n\tif (!isWarmStateEnabled()) return;\n\tif (navState !== void 0) latestNavState = navState;\n\tif (pathname !== void 0) latestPathname = pathname;\n\tvar input = {\n\t\tschemaVersion: config.schemaVersion,\n\t\tupdatedAt: config.now(),\n\t\tpathname: latestPathname,\n\t\tstate: latestNavState,\n\t\tsources: collectSources()\n\t};\n\tpendingInput = input;\n\tensureSerializer().update(input);\n}\nfunction flushWarmState() {\n\tif (!isWarmStateEnabled() || !pendingInput) return false;\n\tvar input = pendingInput;\n\tpendingInput = null;\n\tvar { json } = serializeWarmInputSync(input);\n\treturn safeWriteStorage(WARM_STATE_STORAGE_KEY, json);\n}\nfunction clearWarmState(options) {\n\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\tloadedFromStorage = false;\n\thydratedEnvelope = null;\n\thydratedSourceKeys.clear();\n\twarmRouteApplied = false;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n\twarmInitialRouteConsumed = false;\n\tlatestNavState = void 0;\n\tlatestPathname = void 0;\n\tpendingInput = null;\n\tserializer === null || serializer === void 0 || serializer.dispose();\n\tserializer = null;\n\tactiveWarmRoutePreload = null;\n\twarmRoutePreloadCompleted = false;\n\tcachedAlignedRoute = null;\n\tdelete globalThis[\"__importMetaGlobbed\"];\n\tif (!(options === null || options === void 0 ? void 0 : options.keepConfig)) {\n\t\tconfig = { ...defaultConfig };\n\t\tregisteredSources.clear();\n\t}\n}\nfunction normalizeHref(href) {\n\tvar [withoutHash, ...hashParts] = (href.startsWith(\"/\") ? href : `/${href}`).split(\"#\");\n\tvar hash = hashParts.length > 0 ? `#${hashParts.join(\"#\")}` : \"\";\n\tvar [pathname, ...queryParts] = withoutHash.split(\"?\");\n\tvar query = queryParts.length > 0 ? `?${queryParts.join(\"?\")}` : \"\";\n\treturn `${pathname.length > 1 && pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname}${query}${hash}`;\n}\nasync function reconcileNativeColdDeepLink(options) {\n\tvar _options_prefixes, _options_currentHref;\n\tvar _options_onComplete;\n\tif (isSSRRuntime()) return null;\n\tvar initialUrl = null;\n\ttry {\n\t\tinitialUrl = await options.getInitialURL();\n\t} catch (unused) {\n\t\tvar _options_onComplete1;\n\t\t(_options_onComplete1 = options.onComplete) === null || _options_onComplete1 === void 0 || _options_onComplete1.call(options, null);\n\t\treturn null;\n\t}\n\tif (!initialUrl) {\n\t\tvar _options_onComplete2;\n\t\t(_options_onComplete2 = options.onComplete) === null || _options_onComplete2 === void 0 || _options_onComplete2.call(options, null);\n\t\treturn null;\n\t}\n\tvar extracted = extractPathFromURL((_options_prefixes = options.prefixes) !== null && _options_prefixes !== void 0 ? _options_prefixes : [], initialUrl);\n\tif (!extracted) {\n\t\tvar _options_onComplete3;\n\t\t(_options_onComplete3 = options.onComplete) === null || _options_onComplete3 === void 0 || _options_onComplete3.call(options, null);\n\t\treturn null;\n\t}\n\tvar normalizedTarget = normalizeHref(extracted);\n\tvar current = (_options_currentHref = options.currentHref) !== null && _options_currentHref !== void 0 ? _options_currentHref : options.currentPathname;\n\tvar normalizedCurrent = current ? normalizeHref(current) : void 0;\n\tif (normalizedCurrent && normalizedTarget === normalizedCurrent) {\n\t\tvar _options_onComplete4;\n\t\t(_options_onComplete4 = options.onComplete) === null || _options_onComplete4 === void 0 || _options_onComplete4.call(options, null);\n\t\treturn null;\n\t}\n\ttrackRestoredLaunch(normalizedTarget);\n\toptions.navigateTo(normalizedTarget);\n\t(_options_onComplete = options.onComplete) === null || _options_onComplete === void 0 || _options_onComplete.call(options, normalizedTarget);\n\treturn normalizedTarget;\n}\n\nexport { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };"],"mappings":";;;;;;;;;;;AAWA,IAAI,gBAAgB;CACnB,SAAS;CACT,eAAe;CACf,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,eAAe,KAAK;CACpB,eAAe,KAAK;CACpB,YAAY,KAAK;CACjB,KAAK,SAAS,MAAM;EACnB,OAAO,KAAK,IAAI;CACjB;AACD;AACA,IAAI,SAAS,EAAE,GAAG,cAAc;AAChC,IAAI,oCAAoC,IAAI,IAAI;AAChD,IAAI,qCAAqC,IAAI,IAAI;AACjD,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,iBAAiB;AACrB,IAAI;AACJ,IAAI;AACJ,IAAI,2BAA2B;AAC/B,IAAI;AACJ,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,SAAS,kBAAkB;CAC1B,OAAO;AACR;AACA,SAAS,qBAAqB;CAC7B,OAAO;AACR;AACA,SAAS,eAAe;CACvB,OAAO;AACR;AACA,SAAS,oBAAoB;CAC5B,IAAI,aAAa,GAAG,OAAO;CAC3B,IAAI,gBAAgB,GAAG,OAAO;CAC9B,OAAO,OAAO,iBAAiB;AAChC;AACA,SAAS,aA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Ac,SAAS;CAC9C,IAAI,WAAW,uBAAuB,QAAQ,iBAAiB,QAAQ,yBAAyB,KAAK,IAAI,uBAAuB,QAAQ;CACxI,IAAI,oBAAoB,UAAU,cAAc,OAAO,IAAI,KAAK;CAChE,IAAI,qBAAqB,qBAAqB,mBAAmB;EAChE,IAAI;EACJ,CAAC,uBAAuB,QAAQ,gBAAgB,QAAQ,yBAAyB,KAAK,KAAK,qBAAqB,KAAK,SAAS,IAAI;EAClI,OAAO;CACR;CACA,oBAAoB,gBAAgB;CACpC,QAAQ,WAAW,gBAAgB;CACnC,CAAC,sBAAsB,QAAQ,gBAAgB,QAAQ,wBAAwB,KAAK,KAAK,oBAAoB,KAAK,SAAS,gBAAgB;CAC3I,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"warmState.native.js","names":[],"sources":["esm/router/warmState.native.js"],"sourcesContent":["import { SERVER_CONTEXT_KEY } from \"../constants\";\nimport { extractPathFromURL } from \"../fork/extractPathFromURL\";\nimport { getPathDataFromState } from \"../fork/getPathFromState\";\nimport { getStateFromPath } from \"../fork/getStateFromPath\";\nimport { Storage } from \"../platform/storage\";\nimport { extractParamsFromState, findAllRouteNodesFromState } from \"./findRouteNode\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { createWarmSerializer } from \"./warmStateSerialize\";\nimport { DEFAULT_WARM_STATE_MAX_AGE_MS, WARM_STATE_STORAGE_KEY, matchRoutePattern, matchRoutePattern as matchRoutePattern2, normalizeRoutePattern, parseWarmEnvelope, serializeWarmInputSync } from \"./warmStateShared\";\n\n// dist/esm/router/warmState.native.js?tamagui-build-prune\nvar defaultConfig = {\n\tenabled: false,\n\tschemaVersion: 1,\n\tmaxAgeMs: DEFAULT_WARM_STATE_MAX_AGE_MS,\n\trestoreRoute: true,\n\trestoreWebRoute: false,\n\tpreloadRoutes: true,\n\tincludeRoutes: void 0,\n\texcludeRoutes: void 0,\n\talignRoute: void 0,\n\tnow: function now() {\n\t\treturn Date.now();\n\t}\n};\nvar config = { ...defaultConfig };\nvar registeredSources = /* @__PURE__ */ new Map();\nvar hydratedSourceKeys = /* @__PURE__ */ new Set();\nvar loadedFromStorage = false;\nvar hydratedEnvelope = null;\nvar warmRouteApplied = false;\nvar restoredLaunch = false;\nvar restoredState;\nvar restoredPathname;\nvar warmInitialRouteConsumed = false;\nvar RESTORE_GUARD_KEY = `${WARM_STATE_STORAGE_KEY}restoring`;\nvar restoreGuardSet = false;\nvar latestNavState;\nvar latestPathname;\nvar pendingInput = null;\nvar serializer = null;\nfunction isNativeRuntime() {\n\treturn true;\n}\nfunction isWebClientRuntime() {\n\treturn false;\n}\nfunction isSSRRuntime() {\n\treturn false;\n}\nfunction hasDefaultStorage() {\n\tif (isSSRRuntime()) return false;\n\tif (isNativeRuntime()) return true;\n\treturn typeof localStorage !== \"undefined\";\n}\nfunction getStorage() {\n\tif (config.storage) return config.storage;\n\tif (!hasDefaultStorage()) return null;\n\treturn Storage;\n}\nfunction safeReadStorage(key) {\n\tvar storage = getStorage();\n\tif (!storage) return null;\n\ttry {\n\t\treturn storage.getItem(key);\n\t} catch (unused) {\n\t\treturn null;\n\t}\n}\nfunction safeWriteStorage(key, value) {\n\tvar storage = getStorage();\n\tif (!storage) return false;\n\ttry {\n\t\tstorage.setItem(key, value);\n\t\treturn true;\n\t} catch (unused) {\n\t\treturn false;\n\t}\n}\nfunction safeRemoveStorage(key) {\n\tvar storage = getStorage();\n\tif (!storage) return;\n\ttry {\n\t\tstorage.removeItem(key);\n\t} catch (unused) {}\n}\nfunction normalizeWarmFlag(flag) {\n\tvar _flag_enabled;\n\tif (!flag) return null;\n\tif (flag === true) return { enabled: true };\n\treturn {\n\t\tenabled: (_flag_enabled = flag.enabled) !== null && _flag_enabled !== void 0 ? _flag_enabled : true,\n\t\t...flag\n\t};\n}\nfunction configureWarmState(options) {\n\tif (isSSRRuntime()) return;\n\tconfig = {\n\t\t...config,\n\t\t...options.enabled !== void 0 ? { enabled: options.enabled } : {},\n\t\t...options.schemaVersion !== void 0 ? { schemaVersion: options.schemaVersion } : {},\n\t\t...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},\n\t\t...options.restoreRoute !== void 0 ? { restoreRoute: options.restoreRoute } : {},\n\t\t...options.restoreWebRoute !== void 0 ? { restoreWebRoute: options.restoreWebRoute } : {},\n\t\t...options.preloadRoutes !== void 0 ? { preloadRoutes: options.preloadRoutes } : {},\n\t\t...options.includeRoutes !== void 0 ? { includeRoutes: options.includeRoutes } : {},\n\t\t...options.excludeRoutes !== void 0 ? { excludeRoutes: options.excludeRoutes } : {},\n\t\t...options.alignRoute !== void 0 ? { alignRoute: options.alignRoute } : {},\n\t\t...options.storage !== void 0 ? { storage: options.storage } : {},\n\t\t...options.now !== void 0 ? { now: options.now } : {}\n\t};\n}\nfunction configureWarmStateFromFlags(flags) {\n\tif (isSSRRuntime() || !(flags === null || flags === void 0 ? void 0 : flags.warmStart)) return;\n\tvar normalized = normalizeWarmFlag(flags.warmStart);\n\tif (normalized) configureWarmState(normalized);\n}\nfunction isWarmStateEnabled() {\n\treturn !isSSRRuntime() && config.enabled;\n}\nfunction shouldRestoreWarmRoute() {\n\tif (!isWarmStateEnabled()) return false;\n\tif (isNativeRuntime()) return config.restoreRoute;\n\treturn config.restoreWebRoute;\n}\nfunction hydrateSourceKey(key, source, envelope) {\n\tif (hydratedSourceKeys.has(key)) return;\n\tif (!(key in envelope.sources)) return;\n\tvar payload = envelope.sources[key];\n\tif (source.validate && !source.validate(payload)) return;\n\thydratedSourceKeys.add(key);\n\tsource.hydrate(payload);\n}\nfunction registerWarmStateSource(key, source) {\n\tregisteredSources.set(key, source);\n\tif (!isSSRRuntime() && config.enabled && hydratedEnvelope) hydrateSourceKey(key, source, hydratedEnvelope);\n\treturn function() {\n\t\tregisteredSources.delete(key);\n\t};\n}\nfunction ensureLoadedEnvelope() {\n\tif (!isWarmStateEnabled()) return null;\n\tif (loadedFromStorage) return hydratedEnvelope;\n\tloadedFromStorage = true;\n\tvar raw = safeReadStorage(WARM_STATE_STORAGE_KEY);\n\tif (!raw) return null;\n\tif (isNativeRuntime() && safeReadStorage(RESTORE_GUARD_KEY)) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n\t\treturn null;\n\t}\n\tvar parsed = parseWarmEnvelope(raw, {\n\t\tschemaVersion: config.schemaVersion,\n\t\tmaxAgeMs: config.maxAgeMs,\n\t\tnow: config.now()\n\t});\n\tif (!parsed) {\n\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\thydratedEnvelope = null;\n\t\treturn null;\n\t}\n\thydratedEnvelope = parsed;\n\tif (isNativeRuntime()) restoreGuardSet = safeWriteStorage(RESTORE_GUARD_KEY, \"1\");\n\treturn hydratedEnvelope;\n}\nfunction settleWarmLaunch() {\n\tif (!restoreGuardSet) return;\n\trestoreGuardSet = false;\n\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n}\nfunction getHydratedWarmState() {\n\tif (!isWarmStateEnabled()) return null;\n\treturn ensureLoadedEnvelope();\n}\nfunction getPathnameFromSnapshot(snapshot) {\n\tvar _snapshot_routes_, _snapshot_index;\n\tvar activeRoute = (_snapshot_routes_ = snapshot.routes[(_snapshot_index = snapshot.index) !== null && _snapshot_index !== void 0 ? _snapshot_index : 0]) !== null && _snapshot_routes_ !== void 0 ? _snapshot_routes_ : snapshot.routes[0];\n\tif (!activeRoute) return void 0;\n\tif (typeof activeRoute.path === \"string\" && activeRoute.path) return activeRoute.path.startsWith(\"/\") ? activeRoute.path : `/${activeRoute.path}`;\n\tif (typeof activeRoute.name === \"string\" && activeRoute.name) return activeRoute.name === \"index\" ? \"/\" : `/${activeRoute.name}`;\n}\nvar cachedAlignedRoute = null;\nfunction getOrEvaluateAlignRoute(envelope) {\n\tvar _envelope_pathname;\n\tif (!config.alignRoute || !envelope.state) return;\n\tif (cachedAlignedRoute && cachedAlignedRoute.evaluated) return cachedAlignedRoute.result;\n\tvar result = config.alignRoute({\n\t\tpathname: (_envelope_pathname = envelope.pathname) !== null && _envelope_pathname !== void 0 ? _envelope_pathname : \"/\",\n\t\tstate: envelope.state\n\t});\n\tcachedAlignedRoute = {\n\t\tevaluated: true,\n\t\tresult\n\t};\n\treturn result;\n}\nvar activeWarmRoutePreload = null;\nvar warmRoutePreloadCompleted = false;\nfunction isWarmRoutePreloadPending() {\n\treturn activeWarmRoutePreload !== null && !warmRoutePreloadCompleted;\n}\nasync function waitForWarmRoutePreload() {\n\tvar timeoutMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 200;\n\tif (!activeWarmRoutePreload || warmRoutePreloadCompleted) return;\n\ttry {\n\t\tif (timeoutMs <= 0) {\n\t\t\tawait activeWarmRoutePreload;\n\t\t\treturn;\n\t\t}\n\t\tawait Promise.race([activeWarmRoutePreload, new Promise(function(resolve) {\n\t\t\treturn setTimeout(resolve, timeoutMs);\n\t\t})]);\n\t} catch (unused) {}\n}\nfunction hydrateWarmInitialLoad(options) {\n\tif (isSSRRuntime()) return null;\n\tif (options === null || options === void 0 ? void 0 : options.flags) configureWarmStateFromFlags(options.flags);\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (!config.enabled) return null;\n\tvar envelope = ensureLoadedEnvelope();\n\tif (!envelope) return null;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = registeredSources[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [key, source] = _step.value;\n\t\t\thydrateSourceKey(key, source, envelope);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\tif (config.preloadRoutes && envelope.pathname && (options === null || options === void 0 ? void 0 : options.routes)) {\n\t\tvar _config_excludeRoutes;\n\t\tvar targetPathname = envelope.pathname;\n\t\tvar cleanPath = targetPathname.split(\"?\")[0].split(\"#\")[0] || \"/\";\n\t\tif ((_config_excludeRoutes = config.excludeRoutes) === null || _config_excludeRoutes === void 0 ? void 0 : _config_excludeRoutes.some(function(p) {\n\t\t\treturn matchRoutePattern(p, cleanPath);\n\t\t})) targetPathname = void 0;\n\t\telse if (config.includeRoutes && config.includeRoutes.length > 0 && !config.includeRoutes.some(function(p) {\n\t\t\treturn matchRoutePattern(p, cleanPath);\n\t\t})) targetPathname = void 0;\n\t\telse if (config.alignRoute && envelope.state) {\n\t\t\tvar aligned = getOrEvaluateAlignRoute(envelope);\n\t\t\tif (aligned === false || aligned === null) targetPathname = void 0;\n\t\t\telse if (typeof aligned === \"string\") targetPathname = aligned;\n\t\t\telse if (typeof aligned === \"object\" && aligned !== null) targetPathname = getPathnameFromSnapshot(aligned);\n\t\t}\n\t\tif (targetPathname) {\n\t\t\tglobalThis[\"__importMetaGlobbed\"] = options.routes;\n\t\t\twarmRoutePreloadCompleted = false;\n\t\t\tactiveWarmRoutePreload = preloadRouteModules(targetPathname).catch(function() {}).finally(function() {\n\t\t\t\twarmRoutePreloadCompleted = true;\n\t\t\t});\n\t\t}\n\t}\n\treturn envelope;\n}\nfunction routesMatchLinkingConfig(routes, screens) {\n\tif (!screens || Object.keys(screens).length === 0) return true;\n\tfor (var i = 0; i < routes.length; i++) {\n\t\tvar route = routes[i];\n\t\tvar entry = screens[route.name];\n\t\tif (entry === void 0 || entry === null) return false;\n\t\tif (route.state) {\n\t\t\tif (typeof entry !== \"object\" || !entry.screens) return false;\n\t\t\tif (!routesMatchLinkingConfig(route.state.routes, entry.screens)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction getStateFromHref(href, linking) {\n\tvar _ref;\n\tvar _parsed_routes;\n\tvar parsed = ((_ref = linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) !== null && _ref !== void 0 ? _ref : getStateFromPath)(href, linking === null || linking === void 0 ? void 0 : linking.config);\n\tif (!(parsed === null || parsed === void 0 ? void 0 : (_parsed_routes = parsed.routes) === null || _parsed_routes === void 0 ? void 0 : _parsed_routes.length)) return void 0;\n\treturn parsed;\n}\nfunction evaluateRouteRestore(state, routeNode, pathname) {\n\tvar nodes = findAllRouteNodesFromState(state, routeNode);\n\tif (nodes[0] !== routeNode) nodes.unshift(routeNode);\n\tvar params;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar node = _step.value;\n\t\t\tvar _node_loadRoute, _node_loadRoute1;\n\t\t\tvar restore = (_node_loadRoute1 = node.loadRoute) === null || _node_loadRoute1 === void 0 ? void 0 : (_node_loadRoute = _node_loadRoute1.call(node)) === null || _node_loadRoute === void 0 ? void 0 : _node_loadRoute.restore;\n\t\t\tif (restore === void 0 || restore === true) continue;\n\t\t\tif (restore === false) return false;\n\t\t\tparams !== null && params !== void 0 || (params = extractParamsFromState(state));\n\t\t\tvar result = restore({\n\t\t\t\tpathname,\n\t\t\t\tparams\n\t\t\t});\n\t\t\tif (result === false || result === null) return false;\n\t\t\tif (typeof result === \"string\") return result;\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn true;\n}\nfunction consumeWarmInitialNavigationState(routeNode, linking) {\n\tvar _linking_config;\n\tif (isSSRRuntime()) return void 0;\n\tif (typeof globalThis !== \"undefined\" && globalThis.__oneWarmStartOptions) configureWarmState(globalThis.__oneWarmStartOptions);\n\tif (warmInitialRouteConsumed) return restoredLaunch ? restoredState : void 0;\n\tif (!shouldRestoreWarmRoute()) return;\n\twarmInitialRouteConsumed = true;\n\tvar envelope = hydrateWarmInitialLoad();\n\tif (!(envelope === null || envelope === void 0 ? void 0 : envelope.state) || !routeNode) return void 0;\n\tvar savedPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\tif (config.excludeRoutes && config.excludeRoutes.length > 0) {\n\t\tif (config.excludeRoutes.some(function(pattern) {\n\t\t\treturn matchRoutePattern(pattern, savedPathname);\n\t\t})) return;\n\t}\n\tif (config.includeRoutes && config.includeRoutes.length > 0) {\n\t\tif (!config.includeRoutes.some(function(pattern) {\n\t\t\treturn matchRoutePattern(pattern, savedPathname);\n\t\t})) return;\n\t}\n\tvar targetState = envelope.state;\n\tif (config.alignRoute) {\n\t\tvar aligned = getOrEvaluateAlignRoute(envelope);\n\t\tif (aligned === false || aligned === null) return;\n\t\tif (typeof aligned === \"string\") {\n\t\t\tvar parsed = getStateFromHref(aligned, linking);\n\t\t\tif (!parsed) return void 0;\n\t\t\ttargetState = parsed;\n\t\t\tenvelope.pathname = aligned;\n\t\t} else if (typeof aligned === \"object\" && aligned !== null) {\n\t\t\tif (!aligned.routes || !Array.isArray(aligned.routes) || aligned.routes.length === 0) return;\n\t\t\ttargetState = aligned;\n\t\t\tvar derivedPath = getPathnameFromSnapshot(aligned);\n\t\t\tif (derivedPath) envelope.pathname = derivedPath;\n\t\t}\n\t}\n\tvar restore;\n\ttry {\n\t\trestore = evaluateRouteRestore(targetState, routeNode, envelope.pathname || \"/\");\n\t} catch (error) {\n\t\twarmInitialRouteConsumed = false;\n\t\tthrow error;\n\t}\n\tif (restore === false) return void 0;\n\tif (typeof restore === \"string\") {\n\t\tvar parsed1 = getStateFromHref(restore, linking);\n\t\tif (!parsed1) return void 0;\n\t\ttargetState = parsed1;\n\t\tenvelope.pathname = restore;\n\t}\n\tif (!routesMatchLinkingConfig(targetState.routes, linking === null || linking === void 0 ? void 0 : (_linking_config = linking.config) === null || _linking_config === void 0 ? void 0 : _linking_config.screens)) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\ttry {\n\t\tgetPathDataFromState(targetState, {\n\t\t\tscreens: [],\n\t\t\t...linking === null || linking === void 0 ? void 0 : linking.config\n\t\t});\n\t} catch (unused) {\n\t\tif (targetState === envelope.state) {\n\t\t\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\t\t\thydratedEnvelope = null;\n\t\t}\n\t\treturn;\n\t}\n\twarmRouteApplied = true;\n\trestoredLaunch = true;\n\trestoredPathname = (envelope.pathname || \"/\").split(\"?\")[0].split(\"#\")[0] || \"/\";\n\trestoredState = targetState;\n\treturn restoredState;\n}\nfunction shouldAttemptWarmRouteRestore(initialLocation) {\n\tif (!shouldRestoreWarmRoute()) return false;\n\treturn isNativeRuntime() || isWarmWebRestoreEligible(initialLocation);\n}\nfunction isWarmWebRestoreEligible(initialLocation) {\n\tvar _globalThis_SERVER_CONTEXT_KEY;\n\tif (!isWebClientRuntime() || !config.restoreWebRoute || !initialLocation) return false;\n\tvar serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n\tif (serverMode !== \"spa\" && serverMode !== \"spa-shell\") return false;\n\treturn initialLocation.pathname === \"/\" && !initialLocation.search && !initialLocation.hash;\n}\nfunction isWarmRouteApplied() {\n\treturn warmRouteApplied;\n}\nfunction isRestoredLaunch() {\n\treturn restoredLaunch;\n}\nfunction trackRestoredLaunch(pathname) {\n\tif (!restoredLaunch || pathname === restoredPathname) return;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n}\nfunction consumeWarmRouteApplied() {\n\tif (!warmRouteApplied) return false;\n\twarmRouteApplied = false;\n\treturn true;\n}\nfunction ensureSerializer() {\n\tif (serializer) return serializer;\n\tserializer = createWarmSerializer(function(state) {\n\t\tif (state.phase !== \"ready\") return;\n\t\tif (!pendingInput) return;\n\t\tif (safeWriteStorage(WARM_STATE_STORAGE_KEY, state.result.value.json)) pendingInput = null;\n\t});\n\treturn serializer;\n}\nfunction collectSources() {\n\tvar sources = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = registeredSources[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [key, source] = _step.value;\n\t\t\tsources[key] = source.getSnapshot();\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn sources;\n}\nfunction scheduleWarmStatePersist(navState, pathname) {\n\tif (!isWarmStateEnabled()) return;\n\tif (navState !== void 0) latestNavState = navState;\n\tif (pathname !== void 0) latestPathname = pathname;\n\tvar input = {\n\t\tschemaVersion: config.schemaVersion,\n\t\tupdatedAt: config.now(),\n\t\tpathname: latestPathname,\n\t\tstate: latestNavState,\n\t\tsources: collectSources()\n\t};\n\tpendingInput = input;\n\tensureSerializer().update(input);\n}\nfunction flushWarmState() {\n\tif (!isWarmStateEnabled() || !pendingInput) return false;\n\tvar input = pendingInput;\n\tpendingInput = null;\n\tvar { json } = serializeWarmInputSync(input);\n\treturn safeWriteStorage(WARM_STATE_STORAGE_KEY, json);\n}\nfunction clearWarmState(options) {\n\tsafeRemoveStorage(WARM_STATE_STORAGE_KEY);\n\tsafeRemoveStorage(RESTORE_GUARD_KEY);\n\trestoreGuardSet = false;\n\tloadedFromStorage = false;\n\thydratedEnvelope = null;\n\thydratedSourceKeys.clear();\n\twarmRouteApplied = false;\n\trestoredLaunch = false;\n\trestoredState = void 0;\n\twarmInitialRouteConsumed = false;\n\tlatestNavState = void 0;\n\tlatestPathname = void 0;\n\tpendingInput = null;\n\tserializer === null || serializer === void 0 || serializer.dispose();\n\tserializer = null;\n\tactiveWarmRoutePreload = null;\n\twarmRoutePreloadCompleted = false;\n\tcachedAlignedRoute = null;\n\tdelete globalThis[\"__importMetaGlobbed\"];\n\tif (!(options === null || options === void 0 ? void 0 : options.keepConfig)) {\n\t\tconfig = { ...defaultConfig };\n\t\tregisteredSources.clear();\n\t}\n}\nfunction normalizeHref(href) {\n\tvar [withoutHash, ...hashParts] = (href.startsWith(\"/\") ? href : `/${href}`).split(\"#\");\n\tvar hash = hashParts.length > 0 ? `#${hashParts.join(\"#\")}` : \"\";\n\tvar [pathname, ...queryParts] = withoutHash.split(\"?\");\n\tvar query = queryParts.length > 0 ? `?${queryParts.join(\"?\")}` : \"\";\n\treturn `${pathname.length > 1 && pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname}${query}${hash}`;\n}\nasync function reconcileNativeColdDeepLink(options) {\n\tvar _options_prefixes, _options_currentHref;\n\tvar _options_onComplete;\n\tif (isSSRRuntime()) return null;\n\tvar initialUrl = null;\n\ttry {\n\t\tinitialUrl = await options.getInitialURL();\n\t} catch (unused) {\n\t\tvar _options_onComplete1;\n\t\t(_options_onComplete1 = options.onComplete) === null || _options_onComplete1 === void 0 || _options_onComplete1.call(options, null);\n\t\treturn null;\n\t}\n\tif (!initialUrl) {\n\t\tvar _options_onComplete2;\n\t\t(_options_onComplete2 = options.onComplete) === null || _options_onComplete2 === void 0 || _options_onComplete2.call(options, null);\n\t\treturn null;\n\t}\n\tvar extracted = extractPathFromURL((_options_prefixes = options.prefixes) !== null && _options_prefixes !== void 0 ? _options_prefixes : [], initialUrl);\n\tif (!extracted) {\n\t\tvar _options_onComplete3;\n\t\t(_options_onComplete3 = options.onComplete) === null || _options_onComplete3 === void 0 || _options_onComplete3.call(options, null);\n\t\treturn null;\n\t}\n\tvar normalizedTarget = normalizeHref(extracted);\n\tvar current = (_options_currentHref = options.currentHref) !== null && _options_currentHref !== void 0 ? _options_currentHref : options.currentPathname;\n\tvar normalizedCurrent = current ? normalizeHref(current) : void 0;\n\tif (normalizedCurrent && normalizedTarget === normalizedCurrent) {\n\t\tvar _options_onComplete4;\n\t\t(_options_onComplete4 = options.onComplete) === null || _options_onComplete4 === void 0 || _options_onComplete4.call(options, null);\n\t\treturn null;\n\t}\n\ttrackRestoredLaunch(normalizedTarget);\n\toptions.navigateTo(normalizedTarget);\n\t(_options_onComplete = options.onComplete) === null || _options_onComplete === void 0 || _options_onComplete.call(options, normalizedTarget);\n\treturn normalizedTarget;\n}\n\nexport { clearWarmState, configureWarmState, configureWarmStateFromFlags, consumeWarmInitialNavigationState, consumeWarmRouteApplied, flushWarmState, getHydratedWarmState, hydrateWarmInitialLoad, isRestoredLaunch, isWarmRouteApplied, isWarmRoutePreloadPending, isWarmStateEnabled, isWarmWebRestoreEligible, matchRoutePattern2 as matchRoutePattern, normalizeHref, normalizeRoutePattern, reconcileNativeColdDeepLink, registerWarmStateSource, scheduleWarmStatePersist, settleWarmLaunch, shouldAttemptWarmRouteRestore, shouldRestoreWarmRoute, trackRestoredLaunch, waitForWarmRoutePreload };"],"mappings":";;;;;;;;;;;AAWA,IAAI,gBAAgB;CACnB,SAAS;CACT,eAAe;CACf,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,eAAe,KAAK;CACpB,eAAe,KAAK;CACpB,YAAY,KAAK;CACjB,KAAK,SAAS,MAAM;EACnB,OAAO,KAAK,IAAI;CACjB;AACD;AACA,IAAI,SAAS,EAAE,GAAG,cAAc;AAChC,IAAI,oCAAoC,IAAI,IAAI;AAChD,IAAI,qCAAqC,IAAI,IAAI;AACjD,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,mBA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
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -297,15 +297,15 @@
|
|
|
297
297
|
"@react-navigation/routers": "8.0.0-alpha.21",
|
|
298
298
|
"@rozenite/middleware": "^2.5.0",
|
|
299
299
|
"@ungap/structured-clone": "^1.2.0",
|
|
300
|
-
"@vxrn/color-scheme": "2.21.
|
|
301
|
-
"@vxrn/compiler": "2.21.
|
|
302
|
-
"@vxrn/resolve": "2.21.
|
|
303
|
-
"@vxrn/tslib-lite": "2.21.
|
|
304
|
-
"@vxrn/use-isomorphic-layout-effect": "2.21.
|
|
305
|
-
"@vxrn/utils": "2.21.
|
|
300
|
+
"@vxrn/color-scheme": "2.21.1",
|
|
301
|
+
"@vxrn/compiler": "2.21.1",
|
|
302
|
+
"@vxrn/resolve": "2.21.1",
|
|
303
|
+
"@vxrn/tslib-lite": "2.21.1",
|
|
304
|
+
"@vxrn/use-isomorphic-layout-effect": "2.21.1",
|
|
305
|
+
"@vxrn/utils": "2.21.1",
|
|
306
306
|
"citty": "^0.1.6",
|
|
307
307
|
"core-js": "^3.38.1",
|
|
308
|
-
"create-vxrn": "2.21.
|
|
308
|
+
"create-vxrn": "2.21.1",
|
|
309
309
|
"escape-string-regexp": "^5.0.0",
|
|
310
310
|
"fast-deep-equal": "^3.1.3",
|
|
311
311
|
"fast-glob": "^3.3.3",
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"tsconfig-paths": "^4",
|
|
328
328
|
"use-latest-callback": "^0.3.5",
|
|
329
329
|
"vite": "^8.2.2",
|
|
330
|
-
"vxrn": "2.21.
|
|
330
|
+
"vxrn": "2.21.1",
|
|
331
331
|
"web-streams-polyfill": "^4.3.0",
|
|
332
332
|
"ws": "^8.21.0",
|
|
333
333
|
"xxhashjs": "^0.2.2"
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"@babel/types": "^7.28.5",
|
|
358
358
|
"babel-dead-code-elimination": "1.0.10",
|
|
359
359
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
360
|
-
"@vxrn/vite-plugin-metro": "2.21.
|
|
360
|
+
"@vxrn/vite-plugin-metro": "2.21.1",
|
|
361
361
|
"react-native-css-interop": "^0.2.6"
|
|
362
362
|
},
|
|
363
363
|
"peerDependenciesMeta": {
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
"@types/react-dom": "^19.3.0",
|
|
436
436
|
"@types/react-test-renderer": "^19.1.0",
|
|
437
437
|
"@types/xxhashjs": "^0.2.4",
|
|
438
|
-
"@vxrn/emitter": "2.21.
|
|
438
|
+
"@vxrn/emitter": "2.21.1",
|
|
439
439
|
"abort-controller": "3.0.0",
|
|
440
440
|
"depcheck": "^1.4.7",
|
|
441
441
|
"esbuild": "^0.28.1",
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
"@babel/types": "^7.28.5",
|
|
465
465
|
"babel-dead-code-elimination": "1.0.10",
|
|
466
466
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
467
|
-
"@vxrn/vite-plugin-metro": "2.21.
|
|
467
|
+
"@vxrn/vite-plugin-metro": "2.21.1",
|
|
468
468
|
"react-native-css-interop": "^0.2.6",
|
|
469
469
|
"zod": "4.6.6"
|
|
470
470
|
},
|
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
},
|
|
645
|
-
"releaseSourceCommit": "
|
|
645
|
+
"releaseSourceCommit": "ec0938fb2fbbb8edab73a15616e29e7a7949b7be",
|
|
646
646
|
"repository": {
|
|
647
647
|
"type": "git",
|
|
648
648
|
"url": "git+https://github.com/onejs/one.git",
|